Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the repo with the last changes done in WooCommerce Blocks plugin #69

Merged
merged 64 commits into from
Aug 11, 2022

Conversation

cbravobernal
Copy link
Collaborator

@cbravobernal cbravobernal commented Aug 11, 2022

Update our experiments repo with the main woocommerce-blocks repo

albarin and others added 30 commits July 28, 2022 12:49
Bumps [mockery/mockery](https://github.com/mockery/mockery) from 1.4.4 to 1.5.0.
- [Release notes](https://github.com/mockery/mockery/releases)
- [Changelog](https://github.com/mockery/mockery/blob/master/CHANGELOG.md)
- [Commits](mockery/mockery@1.4.4...1.5.0)

---
updated-dependencies:
- dependency-name: mockery/mockery
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alba Rincón <[email protected]>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
… (#6718)

* refactor coupon functions outside of useSelect

* fix test
* Add new icon for mini cart block (inserter).

See woocommerce/woocommerce-blocks#6617.

* Adjust size of SVG

The new SVG was rendering a little bit smaller than the original icon.
Potentially because of the mask and the artboard size.

This commit adjusts the size to render at the same size as the original
version of the icon in the inserter.
* Try registering the "cart taxes" inner block

Registering server side. This example isn't working, but I'm pushing to
share it and see what's wrong with this implementation.

* Fix registering the cart taxes inner block issue

* Update translation script loading

* Remove unnecessary JS translation

The translation should work fine by getting the title & description from
the `block.json` file

* Put back the initial code in the 'Cart Taxes' inner block

We didn't provide the correct `block.json` file path server side,
that's why the `metadata` wasn't correctly registered

* Generate `block.json`files for inner blocks

This is the first step on fixing the missing translations of `metadata`
in `block.json` files

* Set the folder name exactly the same as the inner block name

We are doing this first test for the `Cart taxes` inner block.

The `Block` & its containing folder need to have the same name for:
- Consistency
- We use the `Block` name to get the file Path

* Update imports after folder renaming

* Get block name directly from the JSON metadata

Getting the block name from the JSON metadata is less error prone than
extracting it from the file path.

And no need to rename all our `inner-blocks` to get the correct
`block.json` path

* Revert folder naming change of `Cart taxes` inner block

Since we are getting the `block` name directly from the `block.json`
metadata instead of extracting it from the file path, there is no need
to keep their names in sync anymore

* Fix missing translations for the `Cart Subtotal` Block

* Register only the client-side settings on the client

When the block is registered on the server, you only need to register
the client-side settings on the client using the same block’s name.
See [docs](https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#javascript-client-side).

* Add schema validation to `block.json`

Development is improved by using a defined schema definition file.
Supported editors can provide help like tooltips, autocomplete, and
schema validation.

* Use the same `editor_script` as the parent block

This prevents WordPress from generating script tags to inexistant
inner blocks JS files

* Add C&C inner blocks in Cart.php & Checkout.php

This is a refactoring to keep the block types controller file less
overloaded

* Fix all Cart inner blocks missing translations

* Create the "AbstractInnerBlock" class

The "Inner Blocks" will use their parent's script, so no need to create
new scripts for each one of them

And, our "Inner Blocks" should always be registered using the metadata file

* Update the "Inner Blocks" PHP classes

* Fix PHP lint erros & update function description

* Fix missing translations bug for all Checkout Inner Blocks

* Update src/BlockTypes/Checkout.php

Co-authored-by: Seghir Nadir <[email protected]>

* skip lazy loaded scripts

Co-authored-by: Seghir Nadir <[email protected]>
… (#6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate
… (#6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate
* Add toggle control to sidebar in editor.

Adds a visibility toggle in the Mini Cart block's sidebar editor
settings for the block price.

* Update name of hasVisiblePrice attrubite.

Adjusts the name of the hasVisiblePrice attribute to hasHiddenPrice.
This seems a bit easier to reason about, where we can set the default
state of the visibility toggle to 'off'.

* Add conditional price rendering to server side.

Since this is a dynamic block, need to add the condidional attribute
state to the server-side render callback.

* Add price visibility setting to block frontend.

We need to prevent pricec from rendering when hidden setting is active
after the JS kicks in on the frontend (i.e., when the Mini Cart is
interacted with by the user).

* Fix logic error in frontend rendering conditional.

* Add unit tests for both show/hide price states.
* Empty commit for release pull request

* Update 8.2.0 changelog

* Add 8.2.0 testing steps

* Fix typo in 8.2.0 testing steps

* Ensure package names display correctly if only one item is in package (#6815)

* Check package length >= 1 to show package name

* Check shipping rates length in order shipping packages slot

* Fix TS error where boolean value could be undefined

* Show items if there is more than one shipping rate

* Update 8.2.0 testing zip

* Bumping version strings to new version.

* Remove empty element from changelog

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Albert Juhé Lluveras <[email protected]>
Co-authored-by: Thomas Roberts <[email protected]>
Bumps [@wordpress/is-shallow-equal](https://github.com/WordPress/gutenberg/tree/HEAD/packages/is-shallow-equal) from 4.12.0 to 4.13.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/is-shallow-equal/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/[email protected]/packages/is-shallow-equal)

---
updated-dependencies:
- dependency-name: "@wordpress/is-shallow-equal"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <[email protected]>
Bumps [AbleLincoln/push-to-sftp](https://github.com/AbleLincoln/push-to-sftp) from 1.0 to 1.2.
- [Release notes](https://github.com/AbleLincoln/push-to-sftp/releases)
- [Commits](AbleLincoln/push-to-sftp@v1.0...v1.2)

---
updated-dependencies:
- dependency-name: AbleLincoln/push-to-sftp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <[email protected]>
gigitux and others added 26 commits August 3, 2022 14:00
Bumps [@wordpress/api-fetch](https://github.com/WordPress/gutenberg/tree/HEAD/packages/api-fetch) from 6.9.0 to 6.11.0.
- [Release notes](https://github.com/WordPress/gutenberg/releases)
- [Changelog](https://github.com/WordPress/gutenberg/blob/trunk/packages/api-fetch/CHANGELOG.md)
- [Commits](https://github.com/WordPress/gutenberg/commits/@wordpress/[email protected]/packages/api-fetch)

---
updated-dependencies:
- dependency-name: "@wordpress/api-fetch"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…Editor URL (#6811)

* e2e:try: detect loading state for product list

* fix: always use site-editor.php

* wait for price filter to be applied before checking the result
* delete renovate bot

* update renovate configuration

* try now
Bumps [mini-css-extract-plugin](https://github.com/webpack-contrib/mini-css-extract-plugin) from 1.3.6 to 1.6.2.
- [Release notes](https://github.com/webpack-contrib/mini-css-extract-plugin/releases)
- [Changelog](https://github.com/webpack-contrib/mini-css-extract-plugin/blob/master/CHANGELOG.md)
- [Commits](webpack-contrib/mini-css-extract-plugin@v1.3.6...v1.6.2)

---
updated-dependencies:
- dependency-name: mini-css-extract-plugin
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luigi Teschio <[email protected]>
* Empty commit for release pull request

* Update 8.2.1 changelog

* Ensure onChange is set for radio buttons in SavedPaymentMethodOptions (#6825)

Co-authored-by: Seghir Nadir <[email protected]>

* Add 8.2.1 testing steps

* Bumping version strings to new version.

Co-authored-by: github-actions <[email protected]>
Co-authored-by: Paulo Arromba <[email protected]>
Co-authored-by: Thomas Roberts <[email protected]>
Co-authored-by: Seghir Nadir <[email protected]>
# Conflicts:
#	docs/internal-developers/testing/releases/README.md
#	package.json
#	readme.txt
#	src/Package.php
#	woocommerce-gutenberg-products-block.php
* Add font-weight option to Mini Cart button text.

Need to repeat steps for icon SVG and cart item count.

* Add font-weight controls to mini-cart item count.

* Add better error handling to PHP style output.

Ensure style value is set for style item in the
get_font_weight_class_and_style attributes array before rendering it to
the output.

* Revert font-weight option for quantity badge.

Per conversation with @vivialice, it looks better for now to keep the
font weight adjustment capabilities to just the price and leave the cart
icon and count as-is.

* Move $typography_styles variable into markup fn.

To resolve merge conflicts and get everything in it's proper place, this
commit will move the $typography_styles variable into the
get_cart_price_markup() function from #6796.
* 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.
- The registry is now the instance of a BlockRegistry class.
- The BlockRegistry class has a `whenDefined()` method which is used to
 await the registration of a block with a given name.
@github-actions
Copy link
Contributor

Size Change: -6 kB (-1%)

Total Size: 872 kB

Filename Size Change
build/active-filters-frontend.js 7.32 kB -24 B (0%)
build/active-filters.js 7.99 kB -7 B (0%)
build/all-products-frontend.js 18.1 kB +6 B (0%)
build/all-products.js 33.8 kB +64 B (0%)
build/all-reviews.js 7.79 kB -8 B (0%)
build/attribute-filter-frontend.js 21.9 kB -3.19 kB (-13%) 👏
build/attribute-filter.js 12.9 kB -1.5 kB (-10%) 👏
build/blocks-checkout.js 17.4 kB +21 B (0%)
build/cart-blocks/cart-accepted-payment-methods-frontend.js 1.16 kB -2 B (0%)
build/cart-blocks/cart-express-payment-frontend.js 5.09 kB +30 B (+1%)
build/cart-blocks/cart-items-frontend.js 298 B -1 B (0%)
build/cart-blocks/cart-line-items--mini-cart-contents-block/products-table-frontend.js 5.27 kB +1 B (0%)
build/cart-blocks/cart-totals-frontend.js 321 B -1 B (0%)
build/cart-blocks/empty-cart-frontend.js 345 B -1 B (0%)
build/cart-blocks/order-summary-coupon-form-frontend.js 2.65 kB +28 B (+1%)
build/cart-blocks/order-summary-discount-frontend.js 2.14 kB +18 B (+1%)
build/cart-blocks/order-summary-shipping--checkout-blocks/order-summary-shipping-frontend.js 6.39 kB +26 B (0%)
build/cart-blocks/order-summary-shipping-frontend.js 423 B -2 B (0%)
build/cart-blocks/order-summary-taxes-frontend.js 431 B -1 B (0%)
build/cart-blocks/proceed-to-checkout-frontend.js 1.15 kB -2 B (0%)
build/cart-frontend.js 47.1 kB +77 B (0%)
build/cart.js 43.2 kB -1.07 kB (-2%)
build/checkout-blocks/actions-frontend.js 1.41 kB -5 B (0%)
build/checkout-blocks/billing-address--checkout-blocks/shipping-address-frontend.js 4.12 kB +7 B (0%)
build/checkout-blocks/billing-address-frontend.js 892 B +4 B (0%)
build/checkout-blocks/contact-information-frontend.js 2.84 kB +3 B (0%)
build/checkout-blocks/express-payment-frontend.js 5.38 kB +32 B (+1%)
build/checkout-blocks/order-summary-cart-items-frontend.js 3.66 kB +1 B (0%)
build/checkout-blocks/order-summary-coupon-form-frontend.js 2.8 kB +20 B (+1%)
build/checkout-blocks/order-summary-discount-frontend.js 2.27 kB +17 B (+1%)
build/checkout-blocks/order-summary-frontend.js 1.1 kB -1 B (0%)
build/checkout-blocks/order-summary-shipping-frontend.js 600 B -3 B (0%)
build/checkout-blocks/order-summary-taxes-frontend.js 430 B -1 B (0%)
build/checkout-blocks/payment-frontend.js 7.69 kB +27 B (0%)
build/checkout-blocks/shipping-address-frontend.js 1.03 kB +38 B (+4%)
build/checkout-blocks/shipping-methods-frontend.js 4.78 kB +14 B (0%)
build/checkout-blocks/terms-frontend.js 1.21 kB -7 B (-1%)
build/checkout-frontend.js 49.3 kB +74 B (0%)
build/checkout.js 44.7 kB -851 B (-2%)
build/featured-category.js 13.2 kB -1 B (0%)
build/featured-product.js 13.5 kB -5 B (0%)
build/handpicked-products.js 7.37 kB -8 B (0%)
build/legacy-template.js 2.8 kB +1 B (0%)
build/mini-cart-component-frontend.js 16.8 kB +195 B (+1%)
build/mini-cart-contents-block/empty-cart-frontend.js 365 B +1 B (0%)
build/mini-cart-contents-block/footer--mini-cart-contents-block/products-table-frontend.js 4.69 kB +4 B (0%)
build/mini-cart-contents.js 22.9 kB +6 B (0%)
build/mini-cart.js 4.59 kB -2.04 kB (-31%) 🎉
build/price-filter-frontend.js 13.1 kB +5 B (0%)
build/price-filter.js 9.02 kB -13 B (0%)
build/product-add-to-cart--product-button--product-image--product-title.js 2.66 kB +2 B (0%)
build/product-add-to-cart--product-button.js 0 B -564 B (removed) 🏆
build/product-add-to-cart-frontend.js 6.95 kB -1 B (0%)
build/product-add-to-cart.js 6.88 kB +248 B (+4%)
build/product-button--product-category-list--product-image--product-price--product-rating--product-sale-b--e17c7c01.js 437 B -63 B (-13%) 👏
build/product-button-frontend.js 1.87 kB +30 B (+2%)
build/product-button.js 1.57 kB +485 B (+45%) 🚨
build/product-categories.js 2.78 kB +3 B (0%)
build/product-category-list-frontend.js 879 B -42 B (-5%)
build/product-category-list.js 503 B +2 B (0%)
build/product-category.js 8.68 kB -8 B (0%)
build/product-image-frontend.js 1.88 kB +46 B (+3%)
build/product-image.js 1.59 kB +519 B (+48%) 🚨
build/product-new.js 7.71 kB -11 B (0%)
build/product-on-sale.js 8.02 kB -12 B (0%)
build/product-price-frontend.js 1.9 kB -42 B (-2%)
build/product-price.js 1.51 kB +3 B (0%)
build/product-rating-frontend.js 1.16 kB +16 B (+1%)
build/product-rating.js 741 B +10 B (+1%)
build/product-sale-badge-frontend.js 1.13 kB +37 B (+3%)
build/product-sale-badge.js 801 B +123 B (+18%) ⚠️
build/product-search.js 2.18 kB +2 B (0%)
build/product-sku.js 380 B -2 B (-1%)
build/product-stock-indicator-frontend.js 994 B -36 B (-3%)
build/product-stock-indicator.js 624 B +3 B (0%)
build/product-summary-frontend.js 1.29 kB -44 B (-3%)
build/product-summary.js 921 B +4 B (0%)
build/product-tag-list-frontend.js 875 B -41 B (-4%)
build/product-tag-list.js 499 B +4 B (+1%)
build/product-tag.js 8.08 kB -10 B (0%)
build/product-title-frontend.js 1.31 kB +15 B (+1%)
build/product-title.js 918 B +6 B (+1%)
build/product-top-rated.js 7.95 kB -7 B (0%)
build/products-by-attribute.js 8.63 kB -11 B (0%)
build/reviews-by-category.js 11.2 kB -10 B (0%)
build/reviews-by-product.js 12.3 kB -9 B (0%)
build/reviews-frontend.js 7.01 kB +2 B (0%)
build/single-product-frontend.js 21.4 kB +8 B (0%)
build/single-product.js 10.1 kB +8 B (0%)
build/stock-filter-frontend.js 7.37 kB -13 B (0%)
build/stock-filter.js 7.29 kB -10 B (0%)
build/vendors--cart-blocks/cart-line-items--cart-blocks/cart-order-summary--cart-blocks/order-summary-shi--c02aad66-frontend.js 5.26 kB +1 B (0%)
build/vendors--cart-blocks/cart-line-items--checkout-blocks/order-summary-cart-items--mini-cart-contents---233ab542-frontend.js 3.14 kB -1 B (0%)
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--5b8feb0b-frontend.js 4.85 kB +104 B (+2%)
build/vendors--mini-cart-contents-block/footer-frontend.js 6.86 kB +2 B (0%)
build/vendors--product-add-to-cart-frontend.js 7.53 kB -2 B (0%)
build/wc-blocks-style-rtl.css 22.8 kB +652 B (+3%)
build/wc-blocks-style.css 22.7 kB +647 B (+3%)
build/wc-blocks-vendors-style-rtl.css 1.95 kB +695 B (+55%) 🆘
build/wc-blocks-vendors-style.css 1.95 kB +692 B (+55%) 🆘
build/wc-blocks-vendors.js 54.5 kB -4.29 kB (-7%)
build/wc-blocks.js 2.62 kB -1 B (0%)
build/general-style-rtl.css 1.29 kB +1.29 kB (new file) 🆕
build/general-style.css 1.29 kB +1.29 kB (new file) 🆕
build/product-button--product-image--product-rating--product-sale-badge--product-title.js 302 B +302 B (new file) 🆕
ℹ️ View Unchanged
Filename Size
build/cart-blocks/cart-line-items-frontend.js 430 B
build/cart-blocks/cart-order-summary-frontend.js 1.1 kB
build/cart-blocks/filled-cart-frontend.js 782 B
build/cart-blocks/order-summary-fee-frontend.js 272 B
build/cart-blocks/order-summary-heading-frontend.js 455 B
build/cart-blocks/order-summary-subtotal-frontend.js 273 B
build/checkout-blocks/fields-frontend.js 344 B
build/checkout-blocks/order-note-frontend.js 1.08 kB
build/checkout-blocks/order-summary-fee-frontend.js 275 B
build/checkout-blocks/order-summary-subtotal-frontend.js 273 B
build/checkout-blocks/totals-frontend.js 325 B
build/mini-cart-contents-block/filled-cart-frontend.js 229 B
build/mini-cart-contents-block/footer-frontend.js 6.99 kB
build/mini-cart-contents-block/items-frontend.js 237 B
build/mini-cart-contents-block/products-table-frontend.js 289 B
build/mini-cart-contents-block/shopping-button-frontend.js 288 B
build/mini-cart-contents-block/title-frontend.js 367 B
build/mini-cart-frontend.js 1.72 kB
build/price-format.js 1.19 kB
build/product-add-to-cart--product-button--product-category-list--product-image--product-price--product-r--a0326d00.js 223 B
build/product-best-sellers.js 7.71 kB
build/product-sku-frontend.js 380 B
build/vendors--cart-blocks/order-summary-shipping--checkout-blocks/billing-address--checkout-blocks/order--decc3dc6-frontend.js 19.1 kB
build/wc-blocks-data.js 9.87 kB
build/wc-blocks-editor-style-rtl.css 5.04 kB
build/wc-blocks-editor-style.css 5.04 kB
build/wc-blocks-google-analytics.js 1.56 kB
build/wc-blocks-middleware.js 930 B
build/wc-blocks-registry.js 2.7 kB
build/wc-blocks-shared-context.js 1.52 kB
build/wc-blocks-shared-hocs.js 1.14 kB
build/wc-payment-method-bacs.js 816 B
build/wc-payment-method-cheque.js 811 B
build/wc-payment-method-cod.js 909 B
build/wc-payment-method-paypal.js 837 B
build/wc-settings.js 2.6 kB

compressed-size-action

@cbravobernal cbravobernal marked this pull request as ready for review August 11, 2022 10:55
@cbravobernal cbravobernal merged commit 8467d25 into trunk Aug 11, 2022
@luisherranz luisherranz mentioned this pull request Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.