This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'trunk' into update/interactivity-api-store-ssr
- Loading branch information
Showing
117 changed files
with
2,485 additions
and
406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"httpHeaders": [ | ||
{ | ||
"urls": [ | ||
"https://github.com/", | ||
"https://guides.github.com/", | ||
"https://help.github.com/", | ||
"https://docs.github.com/" | ||
], | ||
"headers": { | ||
"Accept-Encoding": "zstd, br, gzip, deflate" | ||
} | ||
} | ||
], | ||
"ignorePatterns": [ | ||
{ | ||
"pattern": "^http://localhost" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Check Markdown links | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: {} | ||
|
||
jobs: | ||
markdown-link-check: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: gaurav-nelson/github-action-markdown-link-check@v1 | ||
with: | ||
use-quiet-mode: 'yes' | ||
use-verbose-mode: 'no' | ||
config-file: '.github/workflows/check-doc-links-config.json' | ||
folder-path: './docs' | ||
file-path: './README.md' | ||
max-depth: 3 | ||
base-branch: 'trunk' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
36 changes: 36 additions & 0 deletions
36
assets/js/atomic/blocks/product-elements/add-to-cart-form/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { registerBlockSingleProductTemplate } from '@woocommerce/atomic-utils'; | ||
import { registerBlockType, unregisterBlockType } from '@wordpress/blocks'; | ||
import { Icon, button } from '@wordpress/icons'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import metadata from './block.json'; | ||
import edit from './edit'; | ||
|
||
registerBlockSingleProductTemplate( { | ||
registerBlockFn: () => { | ||
// @ts-expect-error: `registerBlockType` is a function that is typed in WordPress core. | ||
registerBlockType( metadata, { | ||
icon: { | ||
src: ( | ||
<Icon | ||
icon={ button } | ||
className="wc-block-editor-components-block-icon" | ||
/> | ||
), | ||
}, | ||
edit, | ||
save() { | ||
return null; | ||
}, | ||
} ); | ||
}, | ||
unregisterBlockFn: () => { | ||
unregisterBlockType( metadata.name ); | ||
}, | ||
blockName: metadata.name, | ||
} ); |
6 changes: 6 additions & 0 deletions
6
assets/js/atomic/blocks/product-elements/add-to-cart-form/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.wp-block-add-to-cart-form { | ||
.woocommerce-Price-amount.amount, | ||
.woocommerce-grouped-product-list-item__price del { | ||
font-size: var(--wp--preset--font-size--large); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
assets/js/atomic/blocks/product-elements/related-products/block.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "woocommerce/related-products", | ||
"version": "1.0.0", | ||
"title": "Related Products", | ||
"icon": "product", | ||
"description": "Display related products.", | ||
"category": "woocommerce", | ||
"supports": { | ||
"align": true, | ||
"reusable": false | ||
}, | ||
"keywords": [ "WooCommerce" ], | ||
"usesContext": [ "postId", "postType", "queryId" ], | ||
"textdomain": "woo-gutenberg-products-block", | ||
"apiVersion": 2, | ||
"$schema": "https://schemas.wp.org/trunk/block.json" | ||
} |
45 changes: 45 additions & 0 deletions
45
assets/js/atomic/blocks/product-elements/related-products/edit.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { | ||
BLOCK_ATTRIBUTES, | ||
INNER_BLOCKS_TEMPLATE, | ||
} from '@woocommerce/blocks/product-query/variations'; | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
import { InnerBlockTemplate } from '@wordpress/blocks'; | ||
import { Disabled, Notice } from '@wordpress/components'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import './editor.scss'; | ||
|
||
const Edit = () => { | ||
const TEMPLATE: InnerBlockTemplate[] = [ | ||
[ 'core/query', BLOCK_ATTRIBUTES, INNER_BLOCKS_TEMPLATE ], | ||
]; | ||
const blockProps = useBlockProps(); | ||
|
||
return ( | ||
<div { ...blockProps }> | ||
<Disabled> | ||
<Notice | ||
className={ 'wc-block-editor-related-products__notice' } | ||
status={ 'warning' } | ||
isDismissible={ false } | ||
> | ||
<p> | ||
{ __( | ||
'These products will vary depending on the main product in the page', | ||
'woo-gutenberg-products-block' | ||
) } | ||
</p> | ||
</Notice> | ||
</Disabled> | ||
<InnerBlocks template={ TEMPLATE } /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Edit; |
4 changes: 4 additions & 0 deletions
4
assets/js/atomic/blocks/product-elements/related-products/editor.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.wc-block-editor-related-products__notice { | ||
margin: 10px auto; | ||
max-width: max-content; | ||
} |
28 changes: 28 additions & 0 deletions
28
assets/js/atomic/blocks/product-elements/related-products/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { box as icon } from '@wordpress/icons'; | ||
import { registerBlockType, unregisterBlockType } from '@wordpress/blocks'; | ||
import { registerBlockSingleProductTemplate } from '@woocommerce/atomic-utils'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import edit from './edit'; | ||
import save from './save'; | ||
import metadata from './block.json'; | ||
|
||
registerBlockSingleProductTemplate( { | ||
registerBlockFn: () => { | ||
// @ts-expect-error: `registerBlockType` is a function that is typed in WordPress core. | ||
registerBlockType( metadata, { | ||
icon, | ||
edit, | ||
save, | ||
} ); | ||
}, | ||
unregisterBlockFn: () => { | ||
unregisterBlockType( metadata.name ); | ||
}, | ||
blockName: metadata.name, | ||
} ); |
17 changes: 17 additions & 0 deletions
17
assets/js/atomic/blocks/product-elements/related-products/save.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { InnerBlocks, useBlockProps } from '@wordpress/block-editor'; | ||
|
||
const Save = () => { | ||
const blockProps = useBlockProps.save(); | ||
|
||
return ( | ||
<div { ...blockProps }> | ||
{ /* @ts-expect-error: `InnerBlocks.Content` is a component that is typed in WordPress core*/ } | ||
<InnerBlocks.Content /> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Save; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.