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 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the structure of the WooCommerce Blocks Handbook (#6429)
* Improve the structure of the WooCommerce Blocks Handbook Co-authored-by: Rania Lang <[email protected]>
- Loading branch information
1 parent
26cb69e
commit a5d7c19
Showing
171 changed files
with
6,228 additions
and
56,765 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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
**/node_modules/** | ||
**/vendor/** | ||
docs/extensibility/actions.md | ||
docs/extensibility/filters.md | ||
**/extensibility/**/actions.md | ||
**/extensibility/**/filters.md |
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
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
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 |
---|---|---|
@@ -1,8 +1,17 @@ | ||
# WooCommerce Blocks - Editor Components | ||
# Editor Components | ||
|
||
These are shared components used in WooCommerce blocks for the editor (Gutenberg) UI. | ||
These are shared components used in WooCommerce blocks for the editor (Gutenberg) UI. | ||
|
||
Many of our blocks need rich, smart components to provide an interface for selecting or configuring blocks with WooCommerce data. Often there are multiple blocks that need such components. Components in this collection are used in multiple blocks, and may include logic for working with Woo data specifically (e.g. products, shipping methods, product categories). | ||
|
||
See [_Components & Storybook_](docs/contributors/storybook.md) doc for more information. | ||
See [Storybook & Components](docs/contributors/storybook.md) doc for more information. | ||
|
||
<!-- FEEDBACK --> | ||
|
||
--- | ||
|
||
[We're hiring!](https://woocommerce.com/careers/) Come work with us! | ||
|
||
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/README.md) | ||
|
||
<!-- /FEEDBACK --> |
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
48 changes: 26 additions & 22 deletions
48
assets/js/editor-components/text-toolbar-button/README.md
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 |
---|---|---|
@@ -1,37 +1,41 @@ | ||
# TextToolbarButton | ||
# TextToolbarButton <!-- omit in toc --> | ||
|
||
TextToolbarButton is used in Toolbar for text buttons which show `isToggled` state. | ||
|
||
Notes: | ||
Notes: | ||
|
||
- Gutenberg core has `ToolbarGroup` and `ToolbarButton` in progress. When these are available this component may not be needed. | ||
- Gutenberg [core `html` block uses regular `Button` in toolbar](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/html/edit.js), and sets `is-active` class to trigger "active" styling when button is toggled on. | ||
- Gutenberg core has `ToolbarGroup` and `ToolbarButton` in progress. When these are available this component may not be needed. | ||
- Gutenberg [core `html` block uses regular `Button` in toolbar](https://github.com/WordPress/gutenberg/blob/master/packages/block-library/src/html/edit.js), and sets `is-active` class to trigger "active" styling when button is toggled on. | ||
|
||
## Usage | ||
|
||
Example: two text buttons to select edit modes for cart block. | ||
|
||
```jsx | ||
<BlockControls> | ||
<Toolbar> | ||
<TextToolbarButton | ||
onClick={ toggleFullCartMode } | ||
isToggled={ isFullCartMode }> | ||
{ __( | ||
'Full Cart', | ||
'woo-gutenberg-products-block' | ||
) } | ||
</TextToolbarButton> | ||
<TextToolbarButton | ||
onClick={ toggleFullCartMode } | ||
isToggled={ ! isFullCartMode }> | ||
{ __( | ||
'Empty Cart', | ||
'woo-gutenberg-products-block' | ||
) } | ||
</TextToolbarButton> | ||
</Toolbar> | ||
<Toolbar> | ||
<TextToolbarButton | ||
onClick={ toggleFullCartMode } | ||
isToggled={ isFullCartMode } | ||
> | ||
{ __( 'Full Cart', 'woo-gutenberg-products-block' ) } | ||
</TextToolbarButton> | ||
<TextToolbarButton | ||
onClick={ toggleFullCartMode } | ||
isToggled={ ! isFullCartMode } | ||
> | ||
{ __( 'Empty Cart', 'woo-gutenberg-products-block' ) } | ||
</TextToolbarButton> | ||
</Toolbar> | ||
</BlockControls> | ||
``` | ||
|
||
<!-- FEEDBACK --> | ||
|
||
--- | ||
|
||
[We're hiring!](https://woocommerce.com/careers/) Come work with us! | ||
|
||
🐞 Found a mistake, or have a suggestion? [Leave feedback about this document here.](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/new?assignees=&labels=type%3A+documentation&template=--doc-feedback.md&title=Feedback%20on%20./docs/README.md) | ||
|
||
<!-- /FEEDBACK --> |
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
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.