A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
Go to file
Daniel W. Robert 5c40b83480 Add Style Attributes Hooks to blocks/hooks Directory. (https://github.com/woocommerce/woocommerce-blocks/pull/6870)
* Copy style-attributes file to desired directory.

Add a copy of the style-attributes file in blocks/hooks to the desired
base/hooks directory with the other hooks.

* Remove relative imports in favor of global aliases

Utilizes the custom global project aliases in place of using relative
imports.

Note: seeing some linting issues with the aliases. This seems to be the
case elsewhere so it is likely not a blocker for this effort, however,
it may be worth looking into as a follow-up.

* Adjust all imports to use @woocommerce/base-hooks.

Replace all instances of relative file paths to hooks/style-attributes
to use the custom global alias.

* Remove the hooks dir in `assets/js/blocks/`.

Now that everything is using the `@woocommerce/base-hooks` custom global
alias and we have the `style-attributes` hooks file in the base/hooks
directory, we no longer need the `style-attributes` hooks file in the
aforementioned `assets/js/blocks` directory.

* Split style-attributes.ts out into separate files.

Moved the four hooks in style-attributes.ts out into their own, separate
hook file to be consistent with the rest of our custom hooks.

Additionally, moved the helper function (parseStyle) out into a separate
export in base/utils.
2022-08-10 20:04:12 -04:00
plugins/woocommerce-blocks Add Style Attributes Hooks to blocks/hooks Directory. (https://github.com/woocommerce/woocommerce-blocks/pull/6870) 2022-08-10 20:04:12 -04:00