active-filters
2 years ago
add-to-cart-form
2 years ago
all-products
2 years ago
attribute-filter
2 years ago
base-components-mini-cart-contents-block
2 years ago
base-components-product-price~mini-cart-contents-block
2 years ago
breadcrumbs
2 years ago
cart-blocks
2 years ago
catalog-sorting
2 years ago
checkout
2 years ago
checkout-blocks
2 years ago
classic-shortcode
2 years ago
collection-active-filters
2 years ago
collection-attribute-filter
2 years ago
collection-filters
2 years ago
collection-price-filter
2 years ago
collection-rating-filter
2 years ago
collection-stock-filter
2 years ago
customer-account
2 years ago
featured-category
2 years ago
featured-product
2 years ago
filter-wrapper
2 years ago
handpicked-products
2 years ago
inner-blocks
2 years ago
mini-cart
2 years ago
mini-cart-contents-block
2 years ago
order-confirmation-additional-information
2 years ago
order-confirmation-billing-address
2 years ago
order-confirmation-billing-wrapper
2 years ago
order-confirmation-downloads
2 years ago
order-confirmation-downloads-wrapper
2 years ago
order-confirmation-shipping-address
2 years ago
order-confirmation-shipping-wrapper
2 years ago
order-confirmation-status
2 years ago
order-confirmation-summary
2 years ago
order-confirmation-totals
2 years ago
order-confirmation-totals-wrapper
2 years ago
page-content-wrapper
2 years ago
price-filter
2 years ago
product-average-rating
2 years ago
product-best-sellers
2 years ago
product-button
2 years ago
product-categories
2 years ago
product-category
2 years ago
product-collection
2 years ago
product-collection-no-results
2 years ago
product-details
2 years ago
product-gallery
2 years ago
product-gallery-large-image
2 years ago
product-gallery-large-image-next-previous
2 years ago
product-gallery-pager
2 years ago
product-gallery-thumbnails
2 years ago
product-image-gallery
2 years ago
product-meta
2 years ago
product-new
2 years ago
product-rating
2 years ago
product-rating-counter
2 years ago
product-rating-stars
2 years ago
product-results-count
2 years ago
product-reviews
2 years ago
product-tag
2 years ago
product-template
2 years ago
product-top-rated
2 years ago
products-by-attribute
2 years ago
rating-filter
2 years ago
related-products
2 years ago
single-product
2 years ago
stock-filter
2 years ago
store-notices
2 years ago
active-filters-frontend.asset.php
2 years ago
active-filters-frontend.js
2 years ago
active-filters-frontend.js.map
2 years ago
active-filters-rtl.css
2 years ago
active-filters-style.asset.php
2 years ago
active-filters-style.js.map
2 years ago
active-filters-wrapper-frontend.js
2 years ago
active-filters-wrapper-frontend.js.map
2 years ago
active-filters-wrapper-rtl.css
2 years ago
active-filters-wrapper-style.js.map
2 years ago
active-filters-wrapper.css
2 years ago
active-filters-wrapper.css.map
2 years ago
active-filters.asset.php
2 years ago
active-filters.css
2 years ago
active-filters.css.map
2 years ago
active-filters.js
2 years ago
active-filters.js.map
2 years ago
add-to-cart-form-rtl.css
2 years ago
add-to-cart-form-style.asset.php
2 years ago
add-to-cart-form-style.js.map
2 years ago
add-to-cart-form.css
2 years ago
add-to-cart-form.css.map
2 years ago
all-products-frontend.asset.php
2 years ago
all-products-frontend.js
2 years ago
all-products-frontend.js.map
2 years ago
all-products-rtl.css
2 years ago
all-products-style.asset.php
2 years ago
all-products-style.js.map
2 years ago
all-products.asset.php
2 years ago
all-products.css
2 years ago
all-products.css.map
2 years ago
all-products.js
2 years ago
all-products.js.map
2 years ago
all-reviews-rtl.css
2 years ago
all-reviews-style.asset.php
2 years ago
all-reviews-style.js.map
2 years ago
all-reviews.asset.php
2 years ago
all-reviews.css
2 years ago
all-reviews.css.map
2 years ago
all-reviews.js
2 years ago
all-reviews.js.map
2 years ago
assets_js_base_context_hooks_collections_use-collection_ts-assets_js_base_context_hooks_use-q-fdf7ba-style.js.map
2 years ago
assets_js_base_context_hooks_use-store-add-to-cart_ts-assets_js_base_context_hooks_use-store--e30f56-style.js.map
2 years ago
attribute-filter-frontend.asset.php
2 years ago
attribute-filter-frontend.js
2 years ago
attribute-filter-frontend.js.map
2 years ago
attribute-filter-rtl.css
2 years ago
attribute-filter-style.asset.php
2 years ago
attribute-filter-style.js.map
2 years ago
attribute-filter-wrapper-frontend.js
2 years ago
attribute-filter-wrapper-frontend.js.map
2 years ago
attribute-filter-wrapper-rtl.css
2 years ago
attribute-filter-wrapper-style.js.map
2 years ago
attribute-filter-wrapper.css
2 years ago
attribute-filter-wrapper.css.map
2 years ago
attribute-filter.asset.php
2 years ago
attribute-filter.css
2 years ago
attribute-filter.css.map
2 years ago
attribute-filter.js
2 years ago
attribute-filter.js.map
2 years ago
base-components-attribute-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-price-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-price-filter-wrapper-style.scss-rtl.css
2 years ago
base-components-price-filter-wrapper-style.scss.css
2 years ago
base-components-price-filter-wrapper-style.scss.css.map
2 years ago
base-components-rating-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-rating-filter-wrapper-style.scss-rtl.css
2 years ago
base-components-rating-filter-wrapper-style.scss.css
2 years ago
base-components-rating-filter-wrapper-style.scss.css.map
2 years ago
base-components-stock-filter-wrapper-index.tsx-style.js.map
2 years ago
base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss-rtl.css
2 years ago
base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss.css
2 years ago
base-components-stock-filter-wrapper~attribute-filter-wrapper~rating-filter-wrapper-style.scss.css.map
2 years ago
base-context-product-add-to-cart-index.js-style.js.map
2 years ago
blocks-checkout.asset.php
2 years ago
blocks-checkout.js
2 years ago
blocks-checkout.js.map
2 years ago
blocks-components.asset.php
2 years ago
blocks-components.js
2 years ago
blocks-components.js.map
2 years ago
breadcrumbs-rtl.css
2 years ago
breadcrumbs-style.asset.php
2 years ago
breadcrumbs-style.js.map
2 years ago
breadcrumbs.asset.php
2 years ago
breadcrumbs.css
2 years ago
breadcrumbs.css.map
2 years ago
breadcrumbs.js
2 years ago
breadcrumbs.js.map
2 years ago
cart-frontend.asset.php
2 years ago
cart-frontend.js
2 years ago
cart-frontend.js.map
2 years ago
cart-rtl.css
2 years ago
cart-style.asset.php
2 years ago
cart-style.js.map
2 years ago
cart.asset.php
2 years ago
cart.css
2 years ago
cart.css.map
2 years ago
cart.js
2 years ago
cart.js.map
2 years ago
catalog-sorting-rtl.css
2 years ago
catalog-sorting-style.asset.php
2 years ago
catalog-sorting-style.js.map
2 years ago
catalog-sorting.asset.php
2 years ago
catalog-sorting.css
2 years ago
catalog-sorting.css.map
2 years ago
catalog-sorting.js
2 years ago
catalog-sorting.js.map
2 years ago
checkout-frontend.asset.php
2 years ago
checkout-frontend.js
2 years ago
checkout-frontend.js.map
2 years ago
checkout-rtl.css
2 years ago
checkout-style.asset.php
2 years ago
checkout-style.js.map
2 years ago
checkout.asset.php
2 years ago
checkout.css
2 years ago
checkout.css.map
2 years ago
checkout.js
2 years ago
checkout.js.map
2 years ago
classic-shortcode-rtl.css
2 years ago
classic-shortcode-style.asset.php
2 years ago
classic-shortcode-style.js.map
2 years ago
classic-shortcode.asset.php
2 years ago
classic-shortcode.css
2 years ago
classic-shortcode.css.map
2 years ago
classic-shortcode.js
2 years ago
classic-shortcode.js.map
2 years ago
collection-active-filters-frontend.asset.php
2 years ago
collection-active-filters-frontend.js
2 years ago
collection-active-filters-frontend.js.map
2 years ago
collection-active-filters-rtl.css
2 years ago
collection-active-filters-style.asset.php
2 years ago
collection-active-filters-style.js.map
2 years ago
collection-active-filters.asset.php
2 years ago
collection-active-filters.css
2 years ago
collection-active-filters.css.map
2 years ago
collection-active-filters.js
2 years ago
collection-active-filters.js.map
2 years ago
collection-attribute-filter-frontend.asset.php
2 years ago
collection-attribute-filter-frontend.js
2 years ago
collection-attribute-filter-frontend.js.map
2 years ago
collection-attribute-filter-rtl.css
2 years ago
collection-attribute-filter-style.asset.php
2 years ago
collection-attribute-filter-style.js.map
2 years ago
collection-attribute-filter.asset.php
2 years ago
collection-attribute-filter.css
2 years ago
collection-attribute-filter.css.map
2 years ago
collection-attribute-filter.js
2 years ago
collection-attribute-filter.js.map
2 years ago
collection-filters-style.asset.php
2 years ago
collection-filters-style.js.map
2 years ago
collection-filters.asset.php
2 years ago
collection-filters.js
2 years ago
collection-filters.js.map
2 years ago
collection-price-filter-frontend.asset.php
2 years ago
collection-price-filter-frontend.js
2 years ago
collection-price-filter-frontend.js.map
2 years ago
collection-price-filter-rtl.css
2 years ago
collection-price-filter-style.asset.php
2 years ago
collection-price-filter-style.js.map
2 years ago
collection-price-filter.asset.php
2 years ago
collection-price-filter.css
2 years ago
collection-price-filter.css.map
2 years ago
collection-price-filter.js
2 years ago
collection-price-filter.js.map
2 years ago
collection-rating-filter-frontend.asset.php
2 years ago
collection-rating-filter-frontend.js
2 years ago
collection-rating-filter-frontend.js.map
2 years ago
collection-rating-filter-rtl.css
2 years ago
collection-rating-filter-style.asset.php
2 years ago
collection-rating-filter-style.js.map
2 years ago
collection-rating-filter.asset.php
2 years ago
collection-rating-filter.css
2 years ago
collection-rating-filter.css.map
2 years ago
collection-rating-filter.js
2 years ago
collection-rating-filter.js.map
2 years ago
collection-stock-filter-frontend.asset.php
2 years ago
collection-stock-filter-frontend.js
2 years ago
collection-stock-filter-frontend.js.map
2 years ago
collection-stock-filter-rtl.css
2 years ago
collection-stock-filter-style.asset.php
2 years ago
collection-stock-filter-style.js.map
2 years ago
collection-stock-filter.asset.php
2 years ago
collection-stock-filter.css
2 years ago
collection-stock-filter.css.map
2 years ago
collection-stock-filter.js
2 years ago
collection-stock-filter.js.map
2 years ago
customer-account-rtl.css
2 years ago
customer-account-style.asset.php
2 years ago
customer-account-style.js.map
2 years ago
customer-account.asset.php
2 years ago
customer-account.css
2 years ago
customer-account.css.map
2 years ago
customer-account.js
2 years ago
customer-account.js.map
2 years ago
featured-category-rtl.css
2 years ago
featured-category-style.asset.php
2 years ago
featured-category-style.js.map
2 years ago
featured-category.asset.php
2 years ago
featured-category.css
2 years ago
featured-category.css.map
2 years ago
featured-category.js
2 years ago
featured-category.js.map
2 years ago
featured-product-rtl.css
2 years ago
featured-product-style.asset.php
2 years ago
featured-product-style.js.map
2 years ago
featured-product.asset.php
2 years ago
featured-product.css
2 years ago
featured-product.css.map
2 years ago
featured-product.js
2 years ago
featured-product.js.map
2 years ago
filter-wrapper-frontend.asset.php
2 years ago
filter-wrapper-frontend.js
2 years ago
filter-wrapper-frontend.js.map
2 years ago
filter-wrapper-rtl.css
2 years ago
filter-wrapper-style.asset.php
2 years ago
filter-wrapper-style.js.map
2 years ago
filter-wrapper.asset.php
2 years ago
filter-wrapper.css
2 years ago
filter-wrapper.css.map
2 years ago
filter-wrapper.js
2 years ago
filter-wrapper.js.map
2 years ago
handpicked-products-style.asset.php
2 years ago
handpicked-products-style.js.map
2 years ago
handpicked-products.asset.php
2 years ago
handpicked-products.js
2 years ago
handpicked-products.js.map
2 years ago
legacy-template-rtl.css
2 years ago
legacy-template-style.asset.php
2 years ago
legacy-template-style.js.map
2 years ago
legacy-template.asset.php
2 years ago
legacy-template.css
2 years ago
legacy-template.css.map
2 years ago
legacy-template.js
2 years ago
legacy-template.js.map
2 years ago
mini-cart-component-frontend.asset.php
2 years ago
mini-cart-component-frontend.js
2 years ago
mini-cart-component-frontend.js.map
2 years ago
mini-cart-contents-rtl.css
2 years ago
mini-cart-contents-style.asset.php
2 years ago
mini-cart-contents-style.js.map
2 years ago
mini-cart-contents.asset.php
2 years ago
mini-cart-contents.css
2 years ago
mini-cart-contents.css.map
2 years ago
mini-cart-contents.js
2 years ago
mini-cart-contents.js.map
2 years ago
mini-cart-frontend.asset.php
2 years ago
mini-cart-frontend.js
2 years ago
mini-cart-frontend.js.map
2 years ago
mini-cart-rtl.css
2 years ago
mini-cart-style.asset.php
2 years ago
mini-cart-style.js.map
2 years ago
mini-cart.asset.php
2 years ago
mini-cart.css
2 years ago
mini-cart.css.map
2 years ago
mini-cart.js
2 years ago
mini-cart.js.map
2 years ago
order-confirmation-additional-information-rtl.css
2 years ago
order-confirmation-additional-information-style.asset.php
2 years ago
order-confirmation-additional-information-style.js.map
2 years ago
order-confirmation-additional-information.asset.php
2 years ago
order-confirmation-additional-information.css
2 years ago
order-confirmation-additional-information.css.map
2 years ago
order-confirmation-additional-information.js
2 years ago
order-confirmation-additional-information.js.map
2 years ago
order-confirmation-billing-address-rtl.css
2 years ago
order-confirmation-billing-address-style.asset.php
2 years ago
order-confirmation-billing-address-style.js.map
2 years ago
order-confirmation-billing-address.asset.php
2 years ago
order-confirmation-billing-address.css
2 years ago
order-confirmation-billing-address.css.map
2 years ago
order-confirmation-billing-address.js
2 years ago
order-confirmation-billing-address.js.map
2 years ago
order-confirmation-billing-wrapper-style.asset.php
2 years ago
order-confirmation-billing-wrapper-style.js.map
2 years ago
order-confirmation-billing-wrapper.asset.php
2 years ago
order-confirmation-billing-wrapper.js
2 years ago
order-confirmation-billing-wrapper.js.map
2 years ago
order-confirmation-downloads-rtl.css
2 years ago
order-confirmation-downloads-style.asset.php
2 years ago
order-confirmation-downloads-style.js.map
2 years ago
order-confirmation-downloads-wrapper-style.asset.php
2 years ago
order-confirmation-downloads-wrapper-style.js.map
2 years ago
order-confirmation-downloads-wrapper.asset.php
2 years ago
order-confirmation-downloads-wrapper.js
2 years ago
order-confirmation-downloads-wrapper.js.map
2 years ago
order-confirmation-downloads.asset.php
2 years ago
order-confirmation-downloads.css
2 years ago
order-confirmation-downloads.css.map
2 years ago
order-confirmation-downloads.js
2 years ago
order-confirmation-downloads.js.map
2 years ago
order-confirmation-shipping-address-rtl.css
2 years ago
order-confirmation-shipping-address-style.asset.php
2 years ago
order-confirmation-shipping-address-style.js.map
2 years ago
order-confirmation-shipping-address.asset.php
2 years ago
order-confirmation-shipping-address.css
2 years ago
order-confirmation-shipping-address.css.map
2 years ago
order-confirmation-shipping-address.js
2 years ago
order-confirmation-shipping-address.js.map
2 years ago
order-confirmation-shipping-wrapper-style.asset.php
2 years ago
order-confirmation-shipping-wrapper-style.js.map
2 years ago
order-confirmation-shipping-wrapper.asset.php
2 years ago
order-confirmation-shipping-wrapper.js
2 years ago
order-confirmation-shipping-wrapper.js.map
2 years ago
order-confirmation-status-rtl.css
2 years ago
order-confirmation-status-style.asset.php
2 years ago
order-confirmation-status-style.js.map
2 years ago
order-confirmation-status.asset.php
2 years ago
order-confirmation-status.css
2 years ago
order-confirmation-status.css.map
2 years ago
order-confirmation-status.js
2 years ago
order-confirmation-status.js.map
2 years ago
order-confirmation-summary-rtl.css
2 years ago
order-confirmation-summary-style.asset.php
2 years ago
order-confirmation-summary-style.js.map
2 years ago
order-confirmation-summary.asset.php
2 years ago
order-confirmation-summary.css
2 years ago
order-confirmation-summary.css.map
2 years ago
order-confirmation-summary.js
2 years ago
order-confirmation-summary.js.map
2 years ago
order-confirmation-totals-rtl.css
2 years ago
order-confirmation-totals-style.asset.php
2 years ago
order-confirmation-totals-style.js.map
2 years ago
order-confirmation-totals-wrapper-style.asset.php
2 years ago
order-confirmation-totals-wrapper-style.js.map
2 years ago
order-confirmation-totals-wrapper.asset.php
2 years ago
order-confirmation-totals-wrapper.js
2 years ago
order-confirmation-totals-wrapper.js.map
2 years ago
order-confirmation-totals.asset.php
2 years ago
order-confirmation-totals.css
2 years ago
order-confirmation-totals.css.map
2 years ago
order-confirmation-totals.js
2 years ago
order-confirmation-totals.js.map
2 years ago
packages-style-rtl.css
2 years ago
packages-style-style.asset.php
2 years ago
packages-style-style.js.map
2 years ago
packages-style.css
2 years ago
packages-style.css.map
2 years ago
page-content-wrapper-style.asset.php
2 years ago
page-content-wrapper-style.js.map
2 years ago
page-content-wrapper.asset.php
2 years ago
page-content-wrapper.js
2 years ago
page-content-wrapper.js.map
2 years ago
price-filter-frontend.asset.php
2 years ago
price-filter-frontend.js
2 years ago
price-filter-frontend.js.map
2 years ago
price-filter-rtl.css
2 years ago
price-filter-style.asset.php
2 years ago
price-filter-style.js.map
2 years ago
price-filter-wrapper-frontend.js
2 years ago
price-filter-wrapper-frontend.js.map
2 years ago
price-filter-wrapper-rtl.css
2 years ago
price-filter-wrapper-style.js.map
2 years ago
price-filter-wrapper.css
2 years ago
price-filter-wrapper.css.map
2 years ago
price-filter.asset.php
2 years ago
price-filter.css
2 years ago
price-filter.css.map
2 years ago
price-filter.js
2 years ago
price-filter.js.map
2 years ago
price-format.asset.php
2 years ago
price-format.js
2 years ago
price-format.js.map
2 years ago
product-add-to-cart-frontend.js
2 years ago
product-add-to-cart-frontend.js.map
2 years ago
product-add-to-cart-rtl.css
2 years ago
product-add-to-cart-style.js.map
2 years ago
product-add-to-cart.css
2 years ago
product-add-to-cart.css.map
2 years ago
product-add-to-cart.js
2 years ago
product-add-to-cart.js.map
2 years ago
product-average-rating-frontend.js
2 years ago
product-average-rating-frontend.js.map
2 years ago
product-average-rating-style.js.map
2 years ago
product-average-rating.js
2 years ago
product-average-rating.js.map
2 years ago
product-best-sellers-style.asset.php
2 years ago
product-best-sellers-style.js.map
2 years ago
product-best-sellers.asset.php
2 years ago
product-best-sellers.js
2 years ago
product-best-sellers.js.map
2 years ago
product-button-frontend.js
2 years ago
product-button-frontend.js.map
2 years ago
product-button-interactivity-frontend.asset.php
2 years ago
product-button-interactivity-frontend.js
2 years ago
product-button-interactivity-frontend.js.map
2 years ago
product-button-rtl.css
2 years ago
product-button-style.js.map
2 years ago
product-button.css
2 years ago
product-button.css.map
2 years ago
product-button.js
2 years ago
product-button.js.map
2 years ago
product-categories-rtl.css
2 years ago
product-categories-style.asset.php
2 years ago
product-categories-style.js.map
2 years ago
product-categories.asset.php
2 years ago
product-categories.css
2 years ago
product-categories.css.map
2 years ago
product-categories.js
2 years ago
product-categories.js.map
2 years ago
product-category-style.asset.php
2 years ago
product-category-style.js.map
2 years ago
product-category.asset.php
2 years ago
product-category.js
2 years ago
product-category.js.map
2 years ago
product-collection-no-results-style.asset.php
2 years ago
product-collection-no-results-style.js.map
2 years ago
product-collection-no-results.asset.php
2 years ago
product-collection-no-results.js
2 years ago
product-collection-no-results.js.map
2 years ago
product-collection-style.asset.php
2 years ago
product-collection-style.js.map
2 years ago
product-collection.asset.php
2 years ago
product-collection.js
2 years ago
product-collection.js.map
2 years ago
product-details-rtl.css
2 years ago
product-details-style.asset.php
2 years ago
product-details-style.js.map
2 years ago
product-details.css
2 years ago
product-details.css.map
2 years ago
product-gallery-frontend.asset.php
2 years ago
product-gallery-frontend.js
2 years ago
product-gallery-frontend.js.map
2 years ago
product-gallery-large-image-frontend.asset.php
2 years ago
product-gallery-large-image-frontend.js
2 years ago
product-gallery-large-image-frontend.js.map
2 years ago
product-gallery-large-image-next-previous-style.asset.php
2 years ago
product-gallery-large-image-next-previous-style.js.map
2 years ago
product-gallery-large-image-next-previous.asset.php
2 years ago
product-gallery-large-image-next-previous.js
2 years ago
product-gallery-large-image-next-previous.js.map
2 years ago
product-gallery-large-image-style.asset.php
2 years ago
product-gallery-large-image-style.js.map
2 years ago
product-gallery-large-image.asset.php
2 years ago
product-gallery-large-image.js
2 years ago
product-gallery-large-image.js.map
2 years ago
product-gallery-pager-style.asset.php
2 years ago
product-gallery-pager-style.js.map
2 years ago
product-gallery-pager.asset.php
2 years ago
product-gallery-pager.js
2 years ago
product-gallery-pager.js.map
2 years ago
product-gallery-rtl.css
2 years ago
product-gallery-style.asset.php
2 years ago
product-gallery-style.js.map
2 years ago
product-gallery-thumbnails-style.asset.php
2 years ago
product-gallery-thumbnails-style.js.map
2 years ago
product-gallery-thumbnails.asset.php
2 years ago
product-gallery-thumbnails.js
2 years ago
product-gallery-thumbnails.js.map
2 years ago
product-gallery.asset.php
2 years ago
product-gallery.css
2 years ago
product-gallery.css.map
2 years ago
product-gallery.js
2 years ago
product-gallery.js.map
2 years ago
product-image-frontend.js
2 years ago
product-image-frontend.js.map
2 years ago
product-image-gallery-rtl.css
2 years ago
product-image-gallery-style.asset.php
2 years ago
product-image-gallery-style.js.map
2 years ago
product-image-gallery.css
2 years ago
product-image-gallery.css.map
2 years ago
product-image-rtl.css
2 years ago
product-image-style.js.map
2 years ago
product-image.css
2 years ago
product-image.css.map
2 years ago
product-image.js
2 years ago
product-image.js.map
2 years ago
product-new-style.asset.php
2 years ago
product-new-style.js.map
2 years ago
product-new.asset.php
2 years ago
product-new.js
2 years ago
product-new.js.map
2 years ago
product-on-sale-style.asset.php
2 years ago
product-on-sale-style.js.map
2 years ago
product-on-sale.asset.php
2 years ago
product-on-sale.js
2 years ago
product-on-sale.js.map
2 years ago
product-price-frontend.js
2 years ago
product-price-frontend.js.map
2 years ago
product-price-rtl.css
2 years ago
product-price-style.js.map
2 years ago
product-price.css
2 years ago
product-price.css.map
2 years ago
product-price.js
2 years ago
product-price.js.map
2 years ago
product-query-rtl.css
2 years ago
product-query-style.asset.php
2 years ago
product-query-style.js.map
2 years ago
product-query.asset.php
2 years ago
product-query.css
2 years ago
product-query.css.map
2 years ago
product-query.js
2 years ago
product-query.js.map
2 years ago
product-rating-counter-frontend.js
2 years ago
product-rating-counter-frontend.js.map
2 years ago
product-rating-counter-style.js.map
2 years ago
product-rating-counter.js
2 years ago
product-rating-counter.js.map
2 years ago
product-rating-frontend.js
2 years ago
product-rating-frontend.js.map
2 years ago
product-rating-rtl.css
2 years ago
product-rating-stars-frontend.js
2 years ago
product-rating-stars-frontend.js.map
2 years ago
product-rating-stars-rtl.css
2 years ago
product-rating-stars-style.js.map
2 years ago
product-rating-stars.css
2 years ago
product-rating-stars.css.map
2 years ago
product-rating-stars.js
2 years ago
product-rating-stars.js.map
2 years ago
product-rating-style.js.map
2 years ago
product-rating.css
2 years ago
product-rating.css.map
2 years ago
product-rating.js
2 years ago
product-rating.js.map
2 years ago
product-results-count-rtl.css
2 years ago
product-results-count-style.asset.php
2 years ago
product-results-count-style.js.map
2 years ago
product-results-count.asset.php
2 years ago
product-results-count.css
2 years ago
product-results-count.css.map
2 years ago
product-results-count.js
2 years ago
product-results-count.js.map
2 years ago
product-reviews-rtl.css
2 years ago
product-reviews-style.asset.php
2 years ago
product-reviews-style.js.map
2 years ago
product-reviews.css
2 years ago
product-reviews.css.map
2 years ago
product-sale-badge-frontend.js
2 years ago
product-sale-badge-frontend.js.map
2 years ago
product-sale-badge-rtl.css
2 years ago
product-sale-badge-style.js.map
2 years ago
product-sale-badge.css
2 years ago
product-sale-badge.css.map
2 years ago
product-sale-badge.js
2 years ago
product-sale-badge.js.map
2 years ago
product-search-rtl.css
2 years ago
product-search-style.asset.php
2 years ago
product-search-style.js.map
2 years ago
product-search.asset.php
2 years ago
product-search.css
2 years ago
product-search.css.map
2 years ago
product-search.js
2 years ago
product-search.js.map
2 years ago
product-sku-frontend.js
2 years ago
product-sku-frontend.js.map
2 years ago
product-sku-rtl.css
2 years ago
product-sku-style.js.map
2 years ago
product-sku.css
2 years ago
product-sku.css.map
2 years ago
product-sku.js
2 years ago
product-sku.js.map
2 years ago
product-stock-indicator-frontend.js
2 years ago
product-stock-indicator-frontend.js.map
2 years ago
product-stock-indicator-rtl.css
2 years ago
product-stock-indicator-style.js.map
2 years ago
product-stock-indicator.css
2 years ago
product-stock-indicator.css.map
2 years ago
product-stock-indicator.js
2 years ago
product-stock-indicator.js.map
2 years ago
product-summary-frontend.js
2 years ago
product-summary-frontend.js.map
2 years ago
product-summary-rtl.css
2 years ago
product-summary-style.js.map
2 years ago
product-summary.css
2 years ago
product-summary.css.map
2 years ago
product-summary.js
2 years ago
product-summary.js.map
2 years ago
product-tag-style.asset.php
2 years ago
product-tag-style.js.map
2 years ago
product-tag.asset.php
2 years ago
product-tag.js
2 years ago
product-tag.js.map
2 years ago
product-template-rtl.css
2 years ago
product-template-style.asset.php
2 years ago
product-template-style.js.map
2 years ago
product-template.asset.php
2 years ago
product-template.css
2 years ago
product-template.css.map
2 years ago
product-template.js
2 years ago
product-template.js.map
2 years ago
product-title-frontend.js
2 years ago
product-title-frontend.js.map
2 years ago
product-title-rtl.css
2 years ago
product-title-style.js.map
2 years ago
product-title.css
2 years ago
product-title.css.map
2 years ago
product-title.js
2 years ago
product-title.js.map
2 years ago
product-top-rated-style.asset.php
2 years ago
product-top-rated-style.js.map
2 years ago
product-top-rated.asset.php
2 years ago
product-top-rated.js
2 years ago
product-top-rated.js.map
2 years ago
products-by-attribute-style.asset.php
2 years ago
products-by-attribute-style.js.map
2 years ago
products-by-attribute.asset.php
2 years ago
products-by-attribute.js
2 years ago
products-by-attribute.js.map
2 years ago
rating-filter-frontend.asset.php
2 years ago
rating-filter-frontend.js
2 years ago
rating-filter-frontend.js.map
2 years ago
rating-filter-rtl.css
2 years ago
rating-filter-style.asset.php
2 years ago
rating-filter-style.js.map
2 years ago
rating-filter-wrapper-frontend.js
2 years ago
rating-filter-wrapper-frontend.js.map
2 years ago
rating-filter-wrapper-rtl.css
2 years ago
rating-filter-wrapper-style.js.map
2 years ago
rating-filter-wrapper.css
2 years ago
rating-filter-wrapper.css.map
2 years ago
rating-filter.asset.php
2 years ago
rating-filter.css
2 years ago
rating-filter.css.map
2 years ago
rating-filter.js
2 years ago
rating-filter.js.map
2 years ago
reviews-by-category-rtl.css
2 years ago
reviews-by-category-style.asset.php
2 years ago
reviews-by-category-style.js.map
2 years ago
reviews-by-category.asset.php
2 years ago
reviews-by-category.css
2 years ago
reviews-by-category.css.map
2 years ago
reviews-by-category.js
2 years ago
reviews-by-category.js.map
2 years ago
reviews-by-product-rtl.css
2 years ago
reviews-by-product-style.asset.php
2 years ago
reviews-by-product-style.js.map
2 years ago
reviews-by-product.asset.php
2 years ago
reviews-by-product.css
2 years ago
reviews-by-product.css.map
2 years ago
reviews-by-product.js
2 years ago
reviews-by-product.js.map
2 years ago
reviews-frontend.asset.php
2 years ago
reviews-frontend.js
2 years ago
reviews-frontend.js.map
2 years ago
single-product-rtl.css
2 years ago
single-product-style.asset.php
2 years ago
single-product-style.js.map
2 years ago
single-product.asset.php
2 years ago
single-product.css
2 years ago
single-product.css.map
2 years ago
single-product.js
2 years ago
single-product.js.map
2 years ago
stock-filter-frontend.asset.php
2 years ago
stock-filter-frontend.js
2 years ago
stock-filter-frontend.js.map
2 years ago
stock-filter-rtl.css
2 years ago
stock-filter-style.asset.php
2 years ago
stock-filter-style.js.map
2 years ago
stock-filter-wrapper-frontend.js
2 years ago
stock-filter-wrapper-frontend.js.map
2 years ago
stock-filter-wrapper-rtl.css
2 years ago
stock-filter-wrapper-style.js.map
2 years ago
stock-filter-wrapper.css
2 years ago
stock-filter-wrapper.css.map
2 years ago
stock-filter.asset.php
2 years ago
stock-filter.css
2 years ago
stock-filter.css.map
2 years ago
stock-filter.js
2 years ago
stock-filter.js.map
2 years ago
store-notices-rtl.css
2 years ago
store-notices-style.asset.php
2 years ago
store-notices-style.js.map
2 years ago
store-notices.asset.php
2 years ago
store-notices.css
2 years ago
store-notices.css.map
2 years ago
store-notices.js
2 years ago
store-notices.js.map
2 years ago
vendors-node_modules_pnpm_dinero_js_1_9_1_node_modules_dinero_js_build_esm_dinero_js-style.js.map
2 years ago
vendors-node_modules_pnpm_param-case_3_0_4_node_modules_param-case_dist_es2015_index_js-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-019903-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-37238e-frontend.js
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-37238e-frontend.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-68c184-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-70a73f-frontend.js
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-70a73f-frontend.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-849324-frontend.js
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-849324-frontend.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-bab841-style.js.map
2 years ago
vendors-node_modules_pnpm_wordpress_components_14_2_0__types_react_17_0_71_react-dom_17_0_2_r-c6918e-style.js.map
2 years ago
wc-blocks-classic-template-revert-button-style-rtl.css
2 years ago
wc-blocks-classic-template-revert-button-style-style.asset.php
2 years ago
wc-blocks-classic-template-revert-button-style-style.js.map
2 years ago
wc-blocks-classic-template-revert-button-style.css
2 years ago
wc-blocks-classic-template-revert-button-style.css.map
2 years ago
wc-blocks-classic-template-revert-button.asset.php
2 years ago
wc-blocks-classic-template-revert-button.js
2 years ago
wc-blocks-classic-template-revert-button.js.map
2 years ago
wc-blocks-data.asset.php
2 years ago
wc-blocks-data.js
2 years ago
wc-blocks-data.js.map
2 years ago
wc-blocks-editor-style-rtl.css
2 years ago
wc-blocks-editor-style.css
2 years ago
wc-blocks-editor-style.css.map
2 years ago
wc-blocks-google-analytics.asset.php
2 years ago
wc-blocks-google-analytics.js
2 years ago
wc-blocks-google-analytics.js.map
2 years ago
wc-blocks-middleware.asset.php
2 years ago
wc-blocks-middleware.js
2 years ago
wc-blocks-middleware.js.map
2 years ago
wc-blocks-registry.asset.php
2 years ago
wc-blocks-registry.js
2 years ago
wc-blocks-registry.js.map
2 years ago
wc-blocks-rtl.css
2 years ago
wc-blocks-shared-context.asset.php
2 years ago
wc-blocks-shared-context.js
2 years ago
wc-blocks-shared-context.js.map
2 years ago
wc-blocks-shared-hocs.asset.php
2 years ago
wc-blocks-shared-hocs.js
2 years ago
wc-blocks-shared-hocs.js.map
2 years ago
wc-blocks-style.asset.php
2 years ago
wc-blocks-style.js.map
2 years ago
wc-blocks-vendors.asset.php
2 years ago
wc-blocks-vendors.js
2 years ago
wc-blocks-vendors.js.map
2 years ago
wc-blocks.asset.php
2 years ago
wc-blocks.css
2 years ago
wc-blocks.css.map
2 years ago
wc-blocks.js
2 years ago
wc-blocks.js.map
2 years ago
wc-interactivity-checkbox-list-rtl.css
2 years ago
wc-interactivity-checkbox-list-style.asset.php
2 years ago
wc-interactivity-checkbox-list-style.js.map
2 years ago
wc-interactivity-checkbox-list.asset.php
2 years ago
wc-interactivity-checkbox-list.css
2 years ago
wc-interactivity-checkbox-list.css.map
2 years ago
wc-interactivity-checkbox-list.js
2 years ago
wc-interactivity-checkbox-list.js.map
2 years ago
wc-interactivity-dropdown-rtl.css
2 years ago
wc-interactivity-dropdown-style.asset.php
2 years ago
wc-interactivity-dropdown-style.js.map
2 years ago
wc-interactivity-dropdown.asset.php
2 years ago
wc-interactivity-dropdown.css
2 years ago
wc-interactivity-dropdown.css.map
2 years ago
wc-interactivity-dropdown.js
2 years ago
wc-interactivity-dropdown.js.map
2 years ago
wc-interactivity.asset.php
2 years ago
wc-interactivity.js
2 years ago
wc-interactivity.js.map
2 years ago
wc-payment-method-bacs.asset.php
2 years ago
wc-payment-method-bacs.js
2 years ago
wc-payment-method-bacs.js.map
2 years ago
wc-payment-method-cheque.asset.php
2 years ago
wc-payment-method-cheque.js
2 years ago
wc-payment-method-cheque.js.map
2 years ago
wc-payment-method-cod.asset.php
2 years ago
wc-payment-method-cod.js
2 years ago
wc-payment-method-cod.js.map
2 years ago
wc-payment-method-paypal.asset.php
2 years ago
wc-payment-method-paypal.js
2 years ago
wc-payment-method-paypal.js.map
2 years ago
wc-settings.asset.php
2 years ago
wc-settings.js
2 years ago
wc-settings.js.map
2 years ago
wc-shipping-method-pickup-location.asset.php
2 years ago
wc-shipping-method-pickup-location.js
2 years ago
wc-shipping-method-pickup-location.js.map
2 years ago
handpicked-products.js
3095 lines
| 1 | /******/ (() => { // webpackBootstrap |
| 2 | /******/ var __webpack_modules__ = ({ |
| 3 | |
| 4 | /***/ "./assets/js/base/utils/errors.ts": |
| 5 | /*!****************************************!*\ |
| 6 | !*** ./assets/js/base/utils/errors.ts ***! |
| 7 | \****************************************/ |
| 8 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 9 | |
| 10 | "use strict"; |
| 11 | __webpack_require__.r(__webpack_exports__); |
| 12 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 13 | /* harmony export */ formatError: () => (/* binding */ formatError) |
| 14 | /* harmony export */ }); |
| 15 | const formatError = async error => { |
| 16 | if ('json' in error) { |
| 17 | try { |
| 18 | const parsedError = await error.json(); |
| 19 | return { |
| 20 | message: parsedError.message, |
| 21 | type: parsedError.type || 'api' |
| 22 | }; |
| 23 | } catch (e) { |
| 24 | return { |
| 25 | // We could only return this if e is instanceof Error but, to avoid changing runtime |
| 26 | // behaviour, we'll just cast it instead. |
| 27 | message: e.message, |
| 28 | type: 'general' |
| 29 | }; |
| 30 | } |
| 31 | } else { |
| 32 | return { |
| 33 | message: error.message, |
| 34 | type: error.type || 'general' |
| 35 | }; |
| 36 | } |
| 37 | }; |
| 38 | |
| 39 | /***/ }), |
| 40 | |
| 41 | /***/ "./assets/js/base/utils/keyby.ts": |
| 42 | /*!***************************************!*\ |
| 43 | !*** ./assets/js/base/utils/keyby.ts ***! |
| 44 | \***************************************/ |
| 45 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 46 | |
| 47 | "use strict"; |
| 48 | __webpack_require__.r(__webpack_exports__); |
| 49 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 50 | /* harmony export */ keyBy: () => (/* binding */ keyBy) |
| 51 | /* harmony export */ }); |
| 52 | const keyBy = (array, key) => { |
| 53 | return array.reduce((acc, value) => { |
| 54 | const computedKey = key ? String(value[key]) : String(value); |
| 55 | acc[computedKey] = value; |
| 56 | return acc; |
| 57 | }, {}); |
| 58 | }; |
| 59 | |
| 60 | /***/ }), |
| 61 | |
| 62 | /***/ "./assets/js/blocks/handpicked-products/block.tsx": |
| 63 | /*!********************************************************!*\ |
| 64 | !*** ./assets/js/blocks/handpicked-products/block.tsx ***! |
| 65 | \********************************************************/ |
| 66 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 67 | |
| 68 | "use strict"; |
| 69 | __webpack_require__.r(__webpack_exports__); |
| 70 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 71 | /* harmony export */ HandpickedProductsBlock: () => (/* binding */ HandpickedProductsBlock) |
| 72 | /* harmony export */ }); |
| 73 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 74 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 75 | /* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/server-side-render */ "@wordpress/server-side-render"); |
| 76 | /* harmony import */ var _wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_1__); |
| 77 | /* harmony import */ var _woocommerce_resource_previews__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/resource-previews */ "./assets/js/previews/grid-block.js"); |
| 78 | |
| 79 | /** |
| 80 | * External dependencies |
| 81 | */ |
| 82 | |
| 83 | |
| 84 | |
| 85 | /** |
| 86 | * Internal dependencies |
| 87 | */ |
| 88 | |
| 89 | const HandpickedProductsBlock = props => { |
| 90 | const { |
| 91 | attributes, |
| 92 | name |
| 93 | } = props; |
| 94 | if (attributes.isPreview) { |
| 95 | return _woocommerce_resource_previews__WEBPACK_IMPORTED_MODULE_2__.gridBlockPreview; |
| 96 | } |
| 97 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)((_wordpress_server_side_render__WEBPACK_IMPORTED_MODULE_1___default()), { |
| 98 | block: name, |
| 99 | attributes: attributes |
| 100 | }); |
| 101 | }; |
| 102 | HandpickedProductsBlock.__docgenInfo = { |
| 103 | "description": "", |
| 104 | "methods": [], |
| 105 | "displayName": "HandpickedProductsBlock" |
| 106 | }; |
| 107 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 108 | STORYBOOK_REACT_CLASSES["assets/js/blocks/handpicked-products/block.tsx"] = { |
| 109 | name: "HandpickedProductsBlock", |
| 110 | docgenInfo: HandpickedProductsBlock.__docgenInfo, |
| 111 | path: "assets/js/blocks/handpicked-products/block.tsx" |
| 112 | }; |
| 113 | } |
| 114 | |
| 115 | /***/ }), |
| 116 | |
| 117 | /***/ "./assets/js/blocks/handpicked-products/edit-mode.tsx": |
| 118 | /*!************************************************************!*\ |
| 119 | !*** ./assets/js/blocks/handpicked-products/edit-mode.tsx ***! |
| 120 | \************************************************************/ |
| 121 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 122 | |
| 123 | "use strict"; |
| 124 | __webpack_require__.r(__webpack_exports__); |
| 125 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 126 | /* harmony export */ HandpickedProductsEditMode: () => (/* binding */ HandpickedProductsEditMode) |
| 127 | /* harmony export */ }); |
| 128 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 129 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 130 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 131 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 132 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 133 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 134 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js"); |
| 135 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/stack.js"); |
| 136 | /* harmony import */ var _woocommerce_editor_components_products_control__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/editor-components/products-control */ "./assets/js/editor-components/products-control/index.js"); |
| 137 | |
| 138 | /** |
| 139 | * External dependencies |
| 140 | */ |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | /** |
| 147 | * Internal dependencies |
| 148 | */ |
| 149 | |
| 150 | const HandpickedProductsEditMode = props => { |
| 151 | const { |
| 152 | attributes, |
| 153 | setAttributes, |
| 154 | debouncedSpeak, |
| 155 | isEditing, |
| 156 | setIsEditing |
| 157 | } = props; |
| 158 | const onDone = () => { |
| 159 | setIsEditing(!isEditing); |
| 160 | debouncedSpeak((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Now displaying a preview of the Hand-picked Products block.', 'woocommerce')); |
| 161 | }; |
| 162 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Placeholder, { |
| 163 | icon: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 164 | icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"] |
| 165 | }), |
| 166 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Hand-picked Products', 'woocommerce'), |
| 167 | className: "wc-block-products-grid wc-block-handpicked-products" |
| 168 | }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Display a selection of hand-picked products in a grid.', 'woocommerce'), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 169 | className: "wc-block-handpicked-products__selection" |
| 170 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_products_control__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 171 | selected: attributes.products, |
| 172 | onChange: (value = []) => { |
| 173 | const ids = value.map(({ |
| 174 | id |
| 175 | }) => id); |
| 176 | setAttributes({ |
| 177 | products: ids |
| 178 | }); |
| 179 | } |
| 180 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| 181 | variant: "primary", |
| 182 | onClick: onDone |
| 183 | }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Done', 'woocommerce')))); |
| 184 | }; |
| 185 | HandpickedProductsEditMode.__docgenInfo = { |
| 186 | "description": "", |
| 187 | "methods": [], |
| 188 | "displayName": "HandpickedProductsEditMode", |
| 189 | "props": { |
| 190 | "isEditing": { |
| 191 | "required": true, |
| 192 | "tsType": { |
| 193 | "name": "boolean" |
| 194 | }, |
| 195 | "description": "" |
| 196 | }, |
| 197 | "setIsEditing": { |
| 198 | "required": true, |
| 199 | "tsType": { |
| 200 | "name": "signature", |
| 201 | "type": "function", |
| 202 | "raw": "( isEditing: boolean ) => void", |
| 203 | "signature": { |
| 204 | "arguments": [{ |
| 205 | "name": "isEditing", |
| 206 | "type": { |
| 207 | "name": "boolean" |
| 208 | } |
| 209 | }], |
| 210 | "return": { |
| 211 | "name": "void" |
| 212 | } |
| 213 | } |
| 214 | }, |
| 215 | "description": "" |
| 216 | } |
| 217 | }, |
| 218 | "composes": ["Props"] |
| 219 | }; |
| 220 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 221 | STORYBOOK_REACT_CLASSES["assets/js/blocks/handpicked-products/edit-mode.tsx"] = { |
| 222 | name: "HandpickedProductsEditMode", |
| 223 | docgenInfo: HandpickedProductsEditMode.__docgenInfo, |
| 224 | path: "assets/js/blocks/handpicked-products/edit-mode.tsx" |
| 225 | }; |
| 226 | } |
| 227 | |
| 228 | /***/ }), |
| 229 | |
| 230 | /***/ "./assets/js/blocks/handpicked-products/edit.tsx": |
| 231 | /*!*******************************************************!*\ |
| 232 | !*** ./assets/js/blocks/handpicked-products/edit.tsx ***! |
| 233 | \*******************************************************/ |
| 234 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 235 | |
| 236 | "use strict"; |
| 237 | __webpack_require__.r(__webpack_exports__); |
| 238 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 239 | /* harmony export */ Edit: () => (/* binding */ Edit), |
| 240 | /* harmony export */ EditBlock: () => (/* binding */ EditBlock) |
| 241 | /* harmony export */ }); |
| 242 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 243 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 244 | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| 245 | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| 246 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 247 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 248 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 249 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); |
| 250 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 251 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__); |
| 252 | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/blocks/handpicked-products/editor.scss"); |
| 253 | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_5__); |
| 254 | /* harmony import */ var _inspector_controls__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./inspector-controls */ "./assets/js/blocks/handpicked-products/inspector-controls.tsx"); |
| 255 | /* harmony import */ var _edit_mode__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./edit-mode */ "./assets/js/blocks/handpicked-products/edit-mode.tsx"); |
| 256 | /* harmony import */ var _block__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./block */ "./assets/js/blocks/handpicked-products/block.tsx"); |
| 257 | |
| 258 | /** |
| 259 | * External dependencies |
| 260 | */ |
| 261 | |
| 262 | |
| 263 | |
| 264 | |
| 265 | /** |
| 266 | * Internal dependencies |
| 267 | */ |
| 268 | |
| 269 | |
| 270 | |
| 271 | |
| 272 | const EditBlock = props => { |
| 273 | const blockProps = (0,_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.useBlockProps)(); |
| 274 | const { |
| 275 | attributes: { |
| 276 | products |
| 277 | } |
| 278 | } = props; |
| 279 | const [isEditing, setIsEditing] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(!products.length); |
| 280 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 281 | ...blockProps |
| 282 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.BlockControls, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToolbarGroup, { |
| 283 | controls: [{ |
| 284 | icon: 'edit', |
| 285 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Edit selected products', 'woocommerce'), |
| 286 | onClick: () => setIsEditing(!isEditing), |
| 287 | isActive: isEditing |
| 288 | }] |
| 289 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_inspector_controls__WEBPACK_IMPORTED_MODULE_6__.HandpickedProductsInspectorControls, { |
| 290 | ...props |
| 291 | }), isEditing ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_edit_mode__WEBPACK_IMPORTED_MODULE_7__.HandpickedProductsEditMode, { |
| 292 | isEditing: isEditing, |
| 293 | setIsEditing: setIsEditing, |
| 294 | ...props |
| 295 | }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Disabled, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_block__WEBPACK_IMPORTED_MODULE_8__.HandpickedProductsBlock, { |
| 296 | ...props |
| 297 | }))); |
| 298 | }; |
| 299 | const Edit = (0,_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.withSpokenMessages)(EditBlock); |
| 300 | EditBlock.__docgenInfo = { |
| 301 | "description": "", |
| 302 | "methods": [], |
| 303 | "displayName": "EditBlock" |
| 304 | }; |
| 305 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 306 | STORYBOOK_REACT_CLASSES["assets/js/blocks/handpicked-products/edit.tsx"] = { |
| 307 | name: "EditBlock", |
| 308 | docgenInfo: EditBlock.__docgenInfo, |
| 309 | path: "assets/js/blocks/handpicked-products/edit.tsx" |
| 310 | }; |
| 311 | } |
| 312 | |
| 313 | /***/ }), |
| 314 | |
| 315 | /***/ "./assets/js/blocks/handpicked-products/index.tsx": |
| 316 | /*!********************************************************!*\ |
| 317 | !*** ./assets/js/blocks/handpicked-products/index.tsx ***! |
| 318 | \********************************************************/ |
| 319 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 320 | |
| 321 | "use strict"; |
| 322 | __webpack_require__.r(__webpack_exports__); |
| 323 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 324 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 325 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| 326 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__); |
| 327 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 328 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__); |
| 329 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js"); |
| 330 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/stack.js"); |
| 331 | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/blocks/handpicked-products/editor.scss"); |
| 332 | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_3__); |
| 333 | /* harmony import */ var _block_json__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./block.json */ "./assets/js/blocks/handpicked-products/block.json"); |
| 334 | /* harmony import */ var _edit__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./edit */ "./assets/js/blocks/handpicked-products/edit.tsx"); |
| 335 | |
| 336 | /** |
| 337 | * External dependencies |
| 338 | */ |
| 339 | |
| 340 | |
| 341 | |
| 342 | |
| 343 | /** |
| 344 | * Internal dependencies |
| 345 | */ |
| 346 | |
| 347 | |
| 348 | |
| 349 | (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_1__.registerBlockType)(_block_json__WEBPACK_IMPORTED_MODULE_4__, { |
| 350 | icon: { |
| 351 | src: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 352 | icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"], |
| 353 | className: "wc-block-editor-components-block-icon" |
| 354 | }) |
| 355 | }, |
| 356 | attributes: { |
| 357 | ..._block_json__WEBPACK_IMPORTED_MODULE_4__.attributes, |
| 358 | columns: { |
| 359 | type: 'number', |
| 360 | default: (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('defaultColumns', 3) |
| 361 | } |
| 362 | }, |
| 363 | edit: _edit__WEBPACK_IMPORTED_MODULE_7__.Edit, |
| 364 | save: () => { |
| 365 | return null; |
| 366 | } |
| 367 | }); |
| 368 | |
| 369 | /***/ }), |
| 370 | |
| 371 | /***/ "./assets/js/blocks/handpicked-products/inspector-controls.tsx": |
| 372 | /*!*********************************************************************!*\ |
| 373 | !*** ./assets/js/blocks/handpicked-products/inspector-controls.tsx ***! |
| 374 | \*********************************************************************/ |
| 375 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 376 | |
| 377 | "use strict"; |
| 378 | __webpack_require__.r(__webpack_exports__); |
| 379 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 380 | /* harmony export */ HandpickedProductsInspectorControls: () => (/* binding */ HandpickedProductsInspectorControls) |
| 381 | /* harmony export */ }); |
| 382 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 383 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 384 | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/block-editor */ "@wordpress/block-editor"); |
| 385 | /* harmony import */ var _wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__); |
| 386 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 387 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 388 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 389 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); |
| 390 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 391 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_4__); |
| 392 | /* harmony import */ var _woocommerce_editor_components_grid_content_control__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/editor-components/grid-content-control */ "./assets/js/editor-components/grid-content-control/index.tsx"); |
| 393 | /* harmony import */ var _woocommerce_editor_components_product_orderby_control__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/editor-components/product-orderby-control */ "./assets/js/editor-components/product-orderby-control/index.tsx"); |
| 394 | /* harmony import */ var _woocommerce_editor_components_products_control__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @woocommerce/editor-components/products-control */ "./assets/js/editor-components/products-control/index.js"); |
| 395 | |
| 396 | /** |
| 397 | * External dependencies |
| 398 | */ |
| 399 | |
| 400 | |
| 401 | |
| 402 | |
| 403 | |
| 404 | |
| 405 | |
| 406 | |
| 407 | /** |
| 408 | * Internal dependencies |
| 409 | */ |
| 410 | |
| 411 | const HandpickedProductsInspectorControls = props => { |
| 412 | const { |
| 413 | attributes, |
| 414 | setAttributes |
| 415 | } = props; |
| 416 | const { |
| 417 | columns, |
| 418 | contentVisibility, |
| 419 | orderby, |
| 420 | alignButtons |
| 421 | } = attributes; |
| 422 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_block_editor__WEBPACK_IMPORTED_MODULE_1__.InspectorControls, { |
| 423 | key: "inspector" |
| 424 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| 425 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Layout', 'woocommerce'), |
| 426 | initialOpen: true |
| 427 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.RangeControl, { |
| 428 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Columns', 'woocommerce'), |
| 429 | value: columns, |
| 430 | onChange: value => setAttributes({ |
| 431 | columns: value |
| 432 | }), |
| 433 | min: (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_4__.getSetting)('minColumns', 1), |
| 434 | max: (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_4__.getSetting)('maxColumns', 6) |
| 435 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| 436 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Align Buttons', 'woocommerce'), |
| 437 | help: alignButtons ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Buttons are aligned vertically.', 'woocommerce') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Buttons follow content.', 'woocommerce'), |
| 438 | checked: alignButtons, |
| 439 | onChange: () => setAttributes({ |
| 440 | alignButtons: !alignButtons |
| 441 | }) |
| 442 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| 443 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Content', 'woocommerce'), |
| 444 | initialOpen: true |
| 445 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_grid_content_control__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 446 | settings: contentVisibility, |
| 447 | onChange: value => setAttributes({ |
| 448 | contentVisibility: value |
| 449 | }) |
| 450 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| 451 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Order By', 'woocommerce'), |
| 452 | initialOpen: false |
| 453 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_product_orderby_control__WEBPACK_IMPORTED_MODULE_6__["default"], { |
| 454 | setAttributes: setAttributes, |
| 455 | value: orderby |
| 456 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.PanelBody, { |
| 457 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Products', 'woocommerce'), |
| 458 | initialOpen: false |
| 459 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_products_control__WEBPACK_IMPORTED_MODULE_7__["default"], { |
| 460 | selected: attributes.products, |
| 461 | onChange: (value = []) => { |
| 462 | const ids = value.map(({ |
| 463 | id |
| 464 | }) => id); |
| 465 | setAttributes({ |
| 466 | products: ids |
| 467 | }); |
| 468 | }, |
| 469 | isCompact: true |
| 470 | }))); |
| 471 | }; |
| 472 | HandpickedProductsInspectorControls.__docgenInfo = { |
| 473 | "description": "", |
| 474 | "methods": [], |
| 475 | "displayName": "HandpickedProductsInspectorControls" |
| 476 | }; |
| 477 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 478 | STORYBOOK_REACT_CLASSES["assets/js/blocks/handpicked-products/inspector-controls.tsx"] = { |
| 479 | name: "HandpickedProductsInspectorControls", |
| 480 | docgenInfo: HandpickedProductsInspectorControls.__docgenInfo, |
| 481 | path: "assets/js/blocks/handpicked-products/inspector-controls.tsx" |
| 482 | }; |
| 483 | } |
| 484 | |
| 485 | /***/ }), |
| 486 | |
| 487 | /***/ "./assets/js/editor-components/error-placeholder/error-message.tsx": |
| 488 | /*!*************************************************************************!*\ |
| 489 | !*** ./assets/js/editor-components/error-placeholder/error-message.tsx ***! |
| 490 | \*************************************************************************/ |
| 491 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 492 | |
| 493 | "use strict"; |
| 494 | __webpack_require__.r(__webpack_exports__); |
| 495 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 496 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 497 | /* harmony export */ }); |
| 498 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 499 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 500 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 501 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 502 | /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/escape-html */ "@wordpress/escape-html"); |
| 503 | /* harmony import */ var _wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__); |
| 504 | |
| 505 | /** |
| 506 | * External dependencies |
| 507 | */ |
| 508 | |
| 509 | |
| 510 | |
| 511 | /** |
| 512 | * Internal dependencies |
| 513 | */ |
| 514 | |
| 515 | const getErrorMessage = ({ |
| 516 | message, |
| 517 | type |
| 518 | }) => { |
| 519 | if (!message) { |
| 520 | return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('An error has prevented the block from being updated.', 'woocommerce'); |
| 521 | } |
| 522 | if (type === 'general') { |
| 523 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The following error was returned', 'woocommerce'), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("br", null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("code", null, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__.escapeHTML)(message))); |
| 524 | } |
| 525 | if (type === 'api') { |
| 526 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The following error was returned from the API', 'woocommerce'), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("br", null), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("code", null, (0,_wordpress_escape_html__WEBPACK_IMPORTED_MODULE_2__.escapeHTML)(message))); |
| 527 | } |
| 528 | return message; |
| 529 | }; |
| 530 | const ErrorMessage = ({ |
| 531 | error |
| 532 | }) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 533 | className: "wc-block-error-message" |
| 534 | }, getErrorMessage(error)); |
| 535 | ErrorMessage.__docgenInfo = { |
| 536 | "description": "", |
| 537 | "methods": [], |
| 538 | "displayName": "ErrorMessage", |
| 539 | "props": { |
| 540 | "error": { |
| 541 | "required": true, |
| 542 | "tsType": { |
| 543 | "name": "ErrorObject" |
| 544 | }, |
| 545 | "description": "The error object." |
| 546 | } |
| 547 | } |
| 548 | }; |
| 549 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorMessage); |
| 550 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 551 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/error-placeholder/error-message.tsx"] = { |
| 552 | name: "ErrorMessage", |
| 553 | docgenInfo: ErrorMessage.__docgenInfo, |
| 554 | path: "assets/js/editor-components/error-placeholder/error-message.tsx" |
| 555 | }; |
| 556 | } |
| 557 | |
| 558 | /***/ }), |
| 559 | |
| 560 | /***/ "./assets/js/editor-components/grid-content-control/index.tsx": |
| 561 | /*!********************************************************************!*\ |
| 562 | !*** ./assets/js/editor-components/grid-content-control/index.tsx ***! |
| 563 | \********************************************************************/ |
| 564 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 565 | |
| 566 | "use strict"; |
| 567 | __webpack_require__.r(__webpack_exports__); |
| 568 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 569 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 570 | /* harmony export */ }); |
| 571 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 572 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 573 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 574 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 575 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 576 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 577 | |
| 578 | /** |
| 579 | * External dependencies |
| 580 | */ |
| 581 | |
| 582 | |
| 583 | /** |
| 584 | * A combination of toggle controls for content visibility in product grids. |
| 585 | * |
| 586 | * @param {Object} props Incoming props for the component. |
| 587 | * @param {function(any):any} props.onChange |
| 588 | * @param {Object} props.settings |
| 589 | */ |
| 590 | const GridContentControl = ({ |
| 591 | onChange, |
| 592 | settings |
| 593 | }) => { |
| 594 | const { |
| 595 | image, |
| 596 | button, |
| 597 | price, |
| 598 | rating, |
| 599 | title |
| 600 | } = settings; |
| 601 | // If `image` is undefined, that might be because it's a block that was |
| 602 | // created before the `image` attribute existed, so we default to true. |
| 603 | const imageIsVisible = image !== false; |
| 604 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| 605 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Product image', 'woocommerce'), |
| 606 | checked: imageIsVisible, |
| 607 | onChange: () => onChange({ |
| 608 | ...settings, |
| 609 | image: !imageIsVisible |
| 610 | }) |
| 611 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| 612 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Product title', 'woocommerce'), |
| 613 | checked: title, |
| 614 | onChange: () => onChange({ |
| 615 | ...settings, |
| 616 | title: !title |
| 617 | }) |
| 618 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| 619 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Product price', 'woocommerce'), |
| 620 | checked: price, |
| 621 | onChange: () => onChange({ |
| 622 | ...settings, |
| 623 | price: !price |
| 624 | }) |
| 625 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| 626 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Product rating', 'woocommerce'), |
| 627 | checked: rating, |
| 628 | onChange: () => onChange({ |
| 629 | ...settings, |
| 630 | rating: !rating |
| 631 | }) |
| 632 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.ToggleControl, { |
| 633 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Add to Cart button', 'woocommerce'), |
| 634 | checked: button, |
| 635 | onChange: () => onChange({ |
| 636 | ...settings, |
| 637 | button: !button |
| 638 | }) |
| 639 | })); |
| 640 | }; |
| 641 | GridContentControl.__docgenInfo = { |
| 642 | "description": "A combination of toggle controls for content visibility in product grids.\n\n@param {Object} props Incoming props for the component.\n@param {function(any):any} props.onChange\n@param {Object} props.settings", |
| 643 | "methods": [], |
| 644 | "displayName": "GridContentControl", |
| 645 | "props": { |
| 646 | "onChange": { |
| 647 | "required": true, |
| 648 | "tsType": { |
| 649 | "name": "signature", |
| 650 | "type": "function", |
| 651 | "raw": "( settings: GridContentSettings ) => void", |
| 652 | "signature": { |
| 653 | "arguments": [{ |
| 654 | "name": "settings", |
| 655 | "type": { |
| 656 | "name": "GridContentSettings" |
| 657 | } |
| 658 | }], |
| 659 | "return": { |
| 660 | "name": "void" |
| 661 | } |
| 662 | } |
| 663 | }, |
| 664 | "description": "" |
| 665 | }, |
| 666 | "settings": { |
| 667 | "required": true, |
| 668 | "tsType": { |
| 669 | "name": "GridContentSettings" |
| 670 | }, |
| 671 | "description": "" |
| 672 | } |
| 673 | } |
| 674 | }; |
| 675 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GridContentControl); |
| 676 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 677 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/grid-content-control/index.tsx"] = { |
| 678 | name: "GridContentControl", |
| 679 | docgenInfo: GridContentControl.__docgenInfo, |
| 680 | path: "assets/js/editor-components/grid-content-control/index.tsx" |
| 681 | }; |
| 682 | } |
| 683 | |
| 684 | /***/ }), |
| 685 | |
| 686 | /***/ "./assets/js/editor-components/product-orderby-control/index.tsx": |
| 687 | /*!***********************************************************************!*\ |
| 688 | !*** ./assets/js/editor-components/product-orderby-control/index.tsx ***! |
| 689 | \***********************************************************************/ |
| 690 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 691 | |
| 692 | "use strict"; |
| 693 | __webpack_require__.r(__webpack_exports__); |
| 694 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 695 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 696 | /* harmony export */ }); |
| 697 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 698 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 699 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 700 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 701 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 702 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 703 | |
| 704 | /** |
| 705 | * External dependencies |
| 706 | */ |
| 707 | |
| 708 | |
| 709 | |
| 710 | /** |
| 711 | * Internal dependencies |
| 712 | */ |
| 713 | |
| 714 | /** |
| 715 | * A pre-configured SelectControl for product orderby settings. |
| 716 | * |
| 717 | * @param {Object} props Incoming props for the component. |
| 718 | * @param {string} props.value |
| 719 | * @param {function(any):any} props.setAttributes Setter for block attributes. |
| 720 | */ |
| 721 | const ProductOrderbyControl = ({ |
| 722 | value, |
| 723 | setAttributes |
| 724 | }) => { |
| 725 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.SelectControl, { |
| 726 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Order products by', 'woocommerce'), |
| 727 | value: value, |
| 728 | options: [{ |
| 729 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Newness - newest first', 'woocommerce'), |
| 730 | value: 'date' |
| 731 | }, { |
| 732 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Price - low to high', 'woocommerce'), |
| 733 | value: 'price_asc' |
| 734 | }, { |
| 735 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Price - high to low', 'woocommerce'), |
| 736 | value: 'price_desc' |
| 737 | }, { |
| 738 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rating - highest first', 'woocommerce'), |
| 739 | value: 'rating' |
| 740 | }, { |
| 741 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sales - most first', 'woocommerce'), |
| 742 | value: 'popularity' |
| 743 | }, { |
| 744 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Title - alphabetical', 'woocommerce'), |
| 745 | value: 'title' |
| 746 | }, { |
| 747 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Menu Order', 'woocommerce'), |
| 748 | value: 'menu_order' |
| 749 | }], |
| 750 | onChange: orderby => setAttributes({ |
| 751 | orderby |
| 752 | }) |
| 753 | }); |
| 754 | }; |
| 755 | ProductOrderbyControl.__docgenInfo = { |
| 756 | "description": "A pre-configured SelectControl for product orderby settings.\n\n@param {Object} props Incoming props for the component.\n@param {string} props.value\n@param {function(any):any} props.setAttributes Setter for block attributes.", |
| 757 | "methods": [], |
| 758 | "displayName": "ProductOrderbyControl" |
| 759 | }; |
| 760 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ProductOrderbyControl); |
| 761 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 762 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/product-orderby-control/index.tsx"] = { |
| 763 | name: "ProductOrderbyControl", |
| 764 | docgenInfo: ProductOrderbyControl.__docgenInfo, |
| 765 | path: "assets/js/editor-components/product-orderby-control/index.tsx" |
| 766 | }; |
| 767 | } |
| 768 | |
| 769 | /***/ }), |
| 770 | |
| 771 | /***/ "./assets/js/editor-components/products-control/index.js": |
| 772 | /*!***************************************************************!*\ |
| 773 | !*** ./assets/js/editor-components/products-control/index.js ***! |
| 774 | \***************************************************************/ |
| 775 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 776 | |
| 777 | "use strict"; |
| 778 | __webpack_require__.r(__webpack_exports__); |
| 779 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 780 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 781 | /* harmony export */ }); |
| 782 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 783 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 784 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 785 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 786 | /* harmony import */ var _woocommerce_editor_components_search_list_control__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/editor-components/search-list-control */ "./assets/js/editor-components/search-list-control/search-list-control.tsx"); |
| 787 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"); |
| 788 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__); |
| 789 | /* harmony import */ var _woocommerce_block_hocs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/block-hocs */ "./assets/js/hocs/with-searched-products.tsx"); |
| 790 | /* harmony import */ var _woocommerce_editor_components_error_placeholder_error_message__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/editor-components/error-placeholder/error-message */ "./assets/js/editor-components/error-placeholder/error-message.tsx"); |
| 791 | /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); |
| 792 | /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__); |
| 793 | |
| 794 | /** |
| 795 | * External dependencies |
| 796 | */ |
| 797 | |
| 798 | |
| 799 | |
| 800 | |
| 801 | |
| 802 | |
| 803 | |
| 804 | /** |
| 805 | * The products control exposes a custom selector for searching and selecting |
| 806 | * products. |
| 807 | * |
| 808 | * @param {Object} props Component props. |
| 809 | * @param {string} props.error |
| 810 | * @param {Function} props.onChange Callback fired when the selected item changes |
| 811 | * @param {Function} props.onSearch Callback fired when a search is triggered |
| 812 | * @param {Array} props.selected An array of selected products. |
| 813 | * @param {Array} props.products An array of products to select from. |
| 814 | * @param {boolean} props.isLoading Whether or not the products are being loaded. |
| 815 | * @param {boolean} props.isCompact Whether or not the control should have compact styles. |
| 816 | * |
| 817 | * @return {Function} A functional component. |
| 818 | */ |
| 819 | const ProductsControl = ({ |
| 820 | error, |
| 821 | onChange, |
| 822 | onSearch, |
| 823 | selected, |
| 824 | products, |
| 825 | isLoading, |
| 826 | isCompact |
| 827 | }) => { |
| 828 | const messages = { |
| 829 | clear: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Clear all products', 'woocommerce'), |
| 830 | list: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Products', 'woocommerce'), |
| 831 | noItems: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Your store doesn't have any products.", 'woocommerce'), |
| 832 | search: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Search for products to display', 'woocommerce'), |
| 833 | selected: n => (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %d is the number of selected products. */ |
| 834 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._n)('%d product selected', '%d products selected', n, 'woocommerce'), n), |
| 835 | updated: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Product search results updated.', 'woocommerce') |
| 836 | }; |
| 837 | if (error) { |
| 838 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_error_placeholder_error_message__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 839 | error: error |
| 840 | }); |
| 841 | } |
| 842 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_editor_components_search_list_control__WEBPACK_IMPORTED_MODULE_4__.SearchListControl, { |
| 843 | className: "woocommerce-products", |
| 844 | list: products.map(product => { |
| 845 | const formattedSku = product.sku ? ' (' + product.sku + ')' : ''; |
| 846 | return { |
| 847 | ...product, |
| 848 | name: `${(0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_2__.decodeEntities)(product.name)}${formattedSku}` |
| 849 | }; |
| 850 | }), |
| 851 | isCompact: isCompact, |
| 852 | isLoading: isLoading, |
| 853 | selected: products.filter(({ |
| 854 | id |
| 855 | }) => selected.includes(id)), |
| 856 | onSearch: onSearch, |
| 857 | onChange: onChange, |
| 858 | messages: messages |
| 859 | }); |
| 860 | }; |
| 861 | ProductsControl.propTypes = { |
| 862 | onChange: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().func).isRequired, |
| 863 | onSearch: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().func), |
| 864 | selected: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().array), |
| 865 | products: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().array), |
| 866 | isCompact: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool), |
| 867 | isLoading: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool) |
| 868 | }; |
| 869 | ProductsControl.defaultProps = { |
| 870 | selected: [], |
| 871 | products: [], |
| 872 | isCompact: false, |
| 873 | isLoading: true |
| 874 | }; |
| 875 | ProductsControl.__docgenInfo = { |
| 876 | "description": "The products control exposes a custom selector for searching and selecting\nproducts.\n\n@param {Object} props Component props.\n@param {string} props.error\n@param {Function} props.onChange Callback fired when the selected item changes\n@param {Function} props.onSearch Callback fired when a search is triggered\n@param {Array} props.selected An array of selected products.\n@param {Array} props.products An array of products to select from.\n@param {boolean} props.isLoading Whether or not the products are being loaded.\n@param {boolean} props.isCompact Whether or not the control should have compact styles.\n\n@return {Function} A functional component.", |
| 877 | "methods": [], |
| 878 | "displayName": "ProductsControl", |
| 879 | "props": { |
| 880 | "selected": { |
| 881 | "defaultValue": { |
| 882 | "value": "[]", |
| 883 | "computed": false |
| 884 | }, |
| 885 | "description": "", |
| 886 | "type": { |
| 887 | "name": "array" |
| 888 | }, |
| 889 | "required": false |
| 890 | }, |
| 891 | "products": { |
| 892 | "defaultValue": { |
| 893 | "value": "[]", |
| 894 | "computed": false |
| 895 | }, |
| 896 | "description": "", |
| 897 | "type": { |
| 898 | "name": "array" |
| 899 | }, |
| 900 | "required": false |
| 901 | }, |
| 902 | "isCompact": { |
| 903 | "defaultValue": { |
| 904 | "value": "false", |
| 905 | "computed": false |
| 906 | }, |
| 907 | "description": "", |
| 908 | "type": { |
| 909 | "name": "bool" |
| 910 | }, |
| 911 | "required": false |
| 912 | }, |
| 913 | "isLoading": { |
| 914 | "defaultValue": { |
| 915 | "value": "true", |
| 916 | "computed": false |
| 917 | }, |
| 918 | "description": "", |
| 919 | "type": { |
| 920 | "name": "bool" |
| 921 | }, |
| 922 | "required": false |
| 923 | }, |
| 924 | "onChange": { |
| 925 | "description": "", |
| 926 | "type": { |
| 927 | "name": "func" |
| 928 | }, |
| 929 | "required": true |
| 930 | }, |
| 931 | "onSearch": { |
| 932 | "description": "", |
| 933 | "type": { |
| 934 | "name": "func" |
| 935 | }, |
| 936 | "required": false |
| 937 | } |
| 938 | } |
| 939 | }; |
| 940 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_woocommerce_block_hocs__WEBPACK_IMPORTED_MODULE_6__["default"])(ProductsControl)); |
| 941 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 942 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/products-control/index.js"] = { |
| 943 | name: "ProductsControl", |
| 944 | docgenInfo: ProductsControl.__docgenInfo, |
| 945 | path: "assets/js/editor-components/products-control/index.js" |
| 946 | }; |
| 947 | } |
| 948 | |
| 949 | /***/ }), |
| 950 | |
| 951 | /***/ "./assets/js/editor-components/search-list-control/item.tsx": |
| 952 | /*!******************************************************************!*\ |
| 953 | !*** ./assets/js/editor-components/search-list-control/item.tsx ***! |
| 954 | \******************************************************************/ |
| 955 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 956 | |
| 957 | "use strict"; |
| 958 | __webpack_require__.r(__webpack_exports__); |
| 959 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 960 | /* harmony export */ SearchListItem: () => (/* binding */ SearchListItem), |
| 961 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 962 | /* harmony export */ }); |
| 963 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 964 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 965 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 966 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); |
| 967 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 968 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 969 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 970 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); |
| 971 | /* harmony import */ var _woocommerce_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/utils */ "./assets/js/utils/array-operations.ts"); |
| 972 | /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); |
| 973 | /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__); |
| 974 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils */ "./assets/js/editor-components/search-list-control/utils.tsx"); |
| 975 | |
| 976 | /** |
| 977 | * External dependencies |
| 978 | */ |
| 979 | |
| 980 | |
| 981 | |
| 982 | |
| 983 | |
| 984 | |
| 985 | /** |
| 986 | * Internal dependencies |
| 987 | */ |
| 988 | |
| 989 | |
| 990 | const Count = ({ |
| 991 | label |
| 992 | }) => { |
| 993 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 994 | className: "woocommerce-search-list__item-count" |
| 995 | }, label); |
| 996 | }; |
| 997 | const ItemLabel = props => { |
| 998 | const { |
| 999 | item, |
| 1000 | search |
| 1001 | } = props; |
| 1002 | const hasBreadcrumbs = item.breadcrumbs && item.breadcrumbs.length; |
| 1003 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1004 | className: "woocommerce-search-list__item-label" |
| 1005 | }, hasBreadcrumbs ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1006 | className: "woocommerce-search-list__item-prefix" |
| 1007 | }, (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getBreadcrumbsForDisplay)(item.breadcrumbs)) : null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1008 | className: "woocommerce-search-list__item-name" |
| 1009 | }, (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getHighlightedName)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.name), search))); |
| 1010 | }; |
| 1011 | const SearchListItem = ({ |
| 1012 | countLabel, |
| 1013 | className, |
| 1014 | depth = 0, |
| 1015 | controlId = '', |
| 1016 | item, |
| 1017 | isSelected, |
| 1018 | isSingle, |
| 1019 | onSelect, |
| 1020 | search = '', |
| 1021 | selected, |
| 1022 | useExpandedPanelId, |
| 1023 | ...props |
| 1024 | }) => { |
| 1025 | var _item$breadcrumbs, _item$children; |
| 1026 | const [expandedPanelId, setExpandedPanelId] = useExpandedPanelId; |
| 1027 | const showCount = countLabel !== undefined && countLabel !== null && item.count !== undefined && item.count !== null; |
| 1028 | const hasBreadcrumbs = !!((_item$breadcrumbs = item.breadcrumbs) !== null && _item$breadcrumbs !== void 0 && _item$breadcrumbs.length); |
| 1029 | const hasChildren = !!((_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length); |
| 1030 | const isExpanded = expandedPanelId === item.id; |
| 1031 | const classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(['woocommerce-search-list__item', `depth-${depth}`, className], { |
| 1032 | 'has-breadcrumbs': hasBreadcrumbs, |
| 1033 | 'has-children': hasChildren, |
| 1034 | 'has-count': showCount, |
| 1035 | 'is-expanded': isExpanded, |
| 1036 | 'is-radio-button': isSingle |
| 1037 | }); |
| 1038 | const name = props.name || `search-list-item-${controlId}`; |
| 1039 | const id = `${name}-${item.id}`; |
| 1040 | const togglePanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => { |
| 1041 | setExpandedPanelId(isExpanded ? -1 : Number(item.id)); |
| 1042 | }, [isExpanded, item.id, setExpandedPanelId]); |
| 1043 | return hasChildren ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1044 | className: classes, |
| 1045 | onClick: togglePanel, |
| 1046 | onKeyDown: e => e.key === 'Enter' || e.key === ' ' ? togglePanel() : null, |
| 1047 | role: "treeitem", |
| 1048 | tabIndex: 0 |
| 1049 | }, isSingle ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { |
| 1050 | type: "radio", |
| 1051 | id: id, |
| 1052 | name: name, |
| 1053 | value: item.value, |
| 1054 | onChange: onSelect(item), |
| 1055 | onClick: e => e.stopPropagation(), |
| 1056 | checked: isSelected, |
| 1057 | className: "woocommerce-search-list__item-input", |
| 1058 | ...props |
| 1059 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemLabel, { |
| 1060 | item: item, |
| 1061 | search: search |
| 1062 | }), showCount ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Count, { |
| 1063 | label: countLabel || item.count |
| 1064 | }) : null) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, { |
| 1065 | className: "woocommerce-search-list__item-input", |
| 1066 | checked: isSelected, |
| 1067 | ...(!isSelected && |
| 1068 | // We know that `item.children` is not `undefined` because |
| 1069 | // we are here only if `hasChildren` is `true`. |
| 1070 | item.children.some(child => selected.find(selectedItem => selectedItem.id === child.id)) ? { |
| 1071 | indeterminate: true |
| 1072 | } : {}), |
| 1073 | label: (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getHighlightedName)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.name), search), |
| 1074 | onChange: () => { |
| 1075 | if (isSelected) { |
| 1076 | onSelect((0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_6__.arrayDifferenceBy)(selected, item.children, 'id'))(); |
| 1077 | } else { |
| 1078 | onSelect((0,_woocommerce_utils__WEBPACK_IMPORTED_MODULE_6__.arrayUnionBy)(selected, item.children, 'id'))(); |
| 1079 | } |
| 1080 | }, |
| 1081 | onClick: e => e.stopPropagation() |
| 1082 | }), showCount ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Count, { |
| 1083 | label: countLabel || item.count |
| 1084 | }) : null)) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("label", { |
| 1085 | htmlFor: id, |
| 1086 | className: classes |
| 1087 | }, isSingle ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("input", { |
| 1088 | ...props, |
| 1089 | type: "radio", |
| 1090 | id: id, |
| 1091 | name: name, |
| 1092 | value: item.value, |
| 1093 | onChange: onSelect(item), |
| 1094 | checked: isSelected, |
| 1095 | className: "woocommerce-search-list__item-input" |
| 1096 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ItemLabel, { |
| 1097 | item: item, |
| 1098 | search: search |
| 1099 | })) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.CheckboxControl, { |
| 1100 | ...props, |
| 1101 | id: id, |
| 1102 | name: name, |
| 1103 | className: "woocommerce-search-list__item-input", |
| 1104 | value: (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.value), |
| 1105 | label: (0,_utils__WEBPACK_IMPORTED_MODULE_5__.getHighlightedName)((0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(item.name), search), |
| 1106 | onChange: onSelect(item), |
| 1107 | checked: isSelected |
| 1108 | }), showCount ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Count, { |
| 1109 | label: countLabel || item.count |
| 1110 | }) : null); |
| 1111 | }; |
| 1112 | SearchListItem.__docgenInfo = { |
| 1113 | "description": "", |
| 1114 | "methods": [], |
| 1115 | "displayName": "SearchListItem", |
| 1116 | "props": { |
| 1117 | "depth": { |
| 1118 | "defaultValue": { |
| 1119 | "value": "0", |
| 1120 | "computed": false |
| 1121 | }, |
| 1122 | "required": false |
| 1123 | }, |
| 1124 | "controlId": { |
| 1125 | "defaultValue": { |
| 1126 | "value": "''", |
| 1127 | "computed": false |
| 1128 | }, |
| 1129 | "required": false |
| 1130 | }, |
| 1131 | "search": { |
| 1132 | "defaultValue": { |
| 1133 | "value": "''", |
| 1134 | "computed": false |
| 1135 | }, |
| 1136 | "required": false |
| 1137 | } |
| 1138 | } |
| 1139 | }; |
| 1140 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SearchListItem); |
| 1141 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1142 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/search-list-control/item.tsx"] = { |
| 1143 | name: "SearchListItem", |
| 1144 | docgenInfo: SearchListItem.__docgenInfo, |
| 1145 | path: "assets/js/editor-components/search-list-control/item.tsx" |
| 1146 | }; |
| 1147 | } |
| 1148 | |
| 1149 | /***/ }), |
| 1150 | |
| 1151 | /***/ "./assets/js/editor-components/search-list-control/search-list-control.tsx": |
| 1152 | /*!*********************************************************************************!*\ |
| 1153 | !*** ./assets/js/editor-components/search-list-control/search-list-control.tsx ***! |
| 1154 | \*********************************************************************************/ |
| 1155 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1156 | |
| 1157 | "use strict"; |
| 1158 | __webpack_require__.r(__webpack_exports__); |
| 1159 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1160 | /* harmony export */ SearchListControl: () => (/* binding */ SearchListControl), |
| 1161 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1162 | /* harmony export */ }); |
| 1163 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1164 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1165 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1166 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 1167 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 1168 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__); |
| 1169 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1170 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); |
| 1171 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js"); |
| 1172 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/info.js"); |
| 1173 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 1174 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_4__); |
| 1175 | /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); |
| 1176 | /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); |
| 1177 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./assets/js/editor-components/search-list-control/utils.tsx"); |
| 1178 | /* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./item */ "./assets/js/editor-components/search-list-control/item.tsx"); |
| 1179 | /* harmony import */ var _tag__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../tag */ "./assets/js/editor-components/tag/index.tsx"); |
| 1180 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./style.scss */ "./assets/js/editor-components/search-list-control/style.scss"); |
| 1181 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_6__); |
| 1182 | |
| 1183 | /** |
| 1184 | * External dependencies |
| 1185 | */ |
| 1186 | |
| 1187 | |
| 1188 | |
| 1189 | |
| 1190 | |
| 1191 | |
| 1192 | |
| 1193 | /** |
| 1194 | * Internal dependencies |
| 1195 | */ |
| 1196 | |
| 1197 | |
| 1198 | |
| 1199 | |
| 1200 | const defaultRenderListItem = args => { |
| 1201 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_item__WEBPACK_IMPORTED_MODULE_7__["default"], { |
| 1202 | ...args |
| 1203 | }); |
| 1204 | }; |
| 1205 | const ListItems = props => { |
| 1206 | const { |
| 1207 | list, |
| 1208 | selected, |
| 1209 | renderItem, |
| 1210 | depth = 0, |
| 1211 | onSelect, |
| 1212 | instanceId, |
| 1213 | isSingle, |
| 1214 | search, |
| 1215 | useExpandedPanelId |
| 1216 | } = props; |
| 1217 | const [expandedPanelId] = useExpandedPanelId; |
| 1218 | if (!list) { |
| 1219 | return null; |
| 1220 | } |
| 1221 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, null, list.map(item => { |
| 1222 | var _item$children, _item$children2; |
| 1223 | const isSelected = (_item$children = item.children) !== null && _item$children !== void 0 && _item$children.length && !isSingle ? item.children.every(({ |
| 1224 | id |
| 1225 | }) => selected.find(selectedItem => selectedItem.id === id)) : !!selected.find(({ |
| 1226 | id |
| 1227 | }) => id === item.id); |
| 1228 | const isExpanded = ((_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.length) && expandedPanelId === item.id; |
| 1229 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, { |
| 1230 | key: item.id |
| 1231 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", null, renderItem({ |
| 1232 | item, |
| 1233 | isSelected, |
| 1234 | onSelect, |
| 1235 | isSingle, |
| 1236 | selected, |
| 1237 | search, |
| 1238 | depth, |
| 1239 | useExpandedPanelId, |
| 1240 | controlId: instanceId |
| 1241 | })), isExpanded ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItems, { |
| 1242 | ...props, |
| 1243 | list: item.children, |
| 1244 | depth: depth + 1 |
| 1245 | }) : null); |
| 1246 | })); |
| 1247 | }; |
| 1248 | const SelectedListItems = ({ |
| 1249 | isLoading, |
| 1250 | isSingle, |
| 1251 | selected, |
| 1252 | messages, |
| 1253 | onChange, |
| 1254 | onRemove |
| 1255 | }) => { |
| 1256 | if (isLoading || isSingle || !selected) { |
| 1257 | return null; |
| 1258 | } |
| 1259 | const selectedCount = selected.length; |
| 1260 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1261 | className: "woocommerce-search-list__selected" |
| 1262 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1263 | className: "woocommerce-search-list__selected-header" |
| 1264 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", null, messages.selected(selectedCount)), selectedCount > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Button, { |
| 1265 | variant: "link", |
| 1266 | isDestructive: true, |
| 1267 | onClick: () => onChange([]), |
| 1268 | "aria-label": messages.clear |
| 1269 | }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Clear all', 'woocommerce')) : null), selectedCount > 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", null, selected.map((item, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { |
| 1270 | key: i |
| 1271 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_tag__WEBPACK_IMPORTED_MODULE_8__["default"], { |
| 1272 | label: item.name, |
| 1273 | id: item.id, |
| 1274 | remove: onRemove |
| 1275 | })))) : null); |
| 1276 | }; |
| 1277 | const ListItemsContainer = ({ |
| 1278 | filteredList, |
| 1279 | search, |
| 1280 | onSelect, |
| 1281 | instanceId, |
| 1282 | useExpandedPanelId, |
| 1283 | ...props |
| 1284 | }) => { |
| 1285 | const { |
| 1286 | messages, |
| 1287 | renderItem, |
| 1288 | selected, |
| 1289 | isSingle |
| 1290 | } = props; |
| 1291 | const renderItemCallback = renderItem || defaultRenderListItem; |
| 1292 | if (filteredList.length === 0) { |
| 1293 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1294 | className: "woocommerce-search-list__list is-not-found" |
| 1295 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1296 | className: "woocommerce-search-list__not-found-icon" |
| 1297 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"], { |
| 1298 | icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_10__["default"], |
| 1299 | role: "img" |
| 1300 | })), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1301 | className: "woocommerce-search-list__not-found-text" |
| 1302 | }, search ? |
| 1303 | // eslint-disable-next-line @wordpress/valid-sprintf |
| 1304 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(messages.noResults, search) : messages.noItems)); |
| 1305 | } |
| 1306 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", { |
| 1307 | className: "woocommerce-search-list__list" |
| 1308 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItems, { |
| 1309 | useExpandedPanelId: useExpandedPanelId, |
| 1310 | list: filteredList, |
| 1311 | selected: selected, |
| 1312 | renderItem: renderItemCallback, |
| 1313 | onSelect: onSelect, |
| 1314 | instanceId: instanceId, |
| 1315 | isSingle: isSingle, |
| 1316 | search: search |
| 1317 | })); |
| 1318 | }; |
| 1319 | |
| 1320 | /** |
| 1321 | * Component to display a searchable, selectable list of items. |
| 1322 | */ |
| 1323 | const SearchListControl = props => { |
| 1324 | const { |
| 1325 | className = '', |
| 1326 | isCompact, |
| 1327 | isHierarchical, |
| 1328 | isLoading, |
| 1329 | isSingle, |
| 1330 | list, |
| 1331 | messages: customMessages = _utils__WEBPACK_IMPORTED_MODULE_11__.defaultMessages, |
| 1332 | onChange, |
| 1333 | onSearch, |
| 1334 | selected, |
| 1335 | type = 'text', |
| 1336 | debouncedSpeak |
| 1337 | } = props; |
| 1338 | const [search, setSearch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(''); |
| 1339 | const useExpandedPanelId = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(-1); |
| 1340 | const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useInstanceId)(SearchListControl); |
| 1341 | const messages = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => ({ |
| 1342 | ..._utils__WEBPACK_IMPORTED_MODULE_11__.defaultMessages, |
| 1343 | ...customMessages |
| 1344 | }), [customMessages]); |
| 1345 | const filteredList = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useMemo)(() => { |
| 1346 | return (0,_utils__WEBPACK_IMPORTED_MODULE_11__.getFilteredList)(list, search, isHierarchical); |
| 1347 | }, [list, search, isHierarchical]); |
| 1348 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { |
| 1349 | if (debouncedSpeak) { |
| 1350 | debouncedSpeak(messages.updated); |
| 1351 | } |
| 1352 | }, [debouncedSpeak, messages]); |
| 1353 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => { |
| 1354 | if (typeof onSearch === 'function') { |
| 1355 | onSearch(search); |
| 1356 | } |
| 1357 | }, [search, onSearch]); |
| 1358 | const onRemove = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(itemId => () => { |
| 1359 | if (isSingle) { |
| 1360 | onChange([]); |
| 1361 | } |
| 1362 | const i = selected.findIndex(({ |
| 1363 | id: selectedId |
| 1364 | }) => selectedId === itemId); |
| 1365 | onChange([...selected.slice(0, i), ...selected.slice(i + 1)]); |
| 1366 | }, [isSingle, selected, onChange]); |
| 1367 | const onSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(item => () => { |
| 1368 | if (Array.isArray(item)) { |
| 1369 | onChange(item); |
| 1370 | return; |
| 1371 | } |
| 1372 | if (selected.findIndex(({ |
| 1373 | id |
| 1374 | }) => id === item.id) !== -1) { |
| 1375 | onRemove(item.id)(); |
| 1376 | return; |
| 1377 | } |
| 1378 | if (isSingle) { |
| 1379 | onChange([item]); |
| 1380 | } else { |
| 1381 | onChange([...selected, item]); |
| 1382 | } |
| 1383 | }, [isSingle, onRemove, onChange, selected]); |
| 1384 | const onRemoveToken = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(tokens => { |
| 1385 | const [removedItem] = selected.filter(item => !tokens.find(token => item.id === token.id)); |
| 1386 | onRemove(removedItem.id)(); |
| 1387 | }, [onRemove, selected]); |
| 1388 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1389 | className: classnames__WEBPACK_IMPORTED_MODULE_4___default()('woocommerce-search-list', className, { |
| 1390 | 'is-compact': isCompact, |
| 1391 | 'is-loading': isLoading, |
| 1392 | 'is-token': type === 'token' |
| 1393 | }) |
| 1394 | }, type === 'text' && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(SelectedListItems, { |
| 1395 | ...props, |
| 1396 | onRemove: onRemove, |
| 1397 | messages: messages |
| 1398 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1399 | className: "woocommerce-search-list__search" |
| 1400 | }, type === 'text' ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.TextControl, { |
| 1401 | label: messages.search, |
| 1402 | type: "search", |
| 1403 | value: search, |
| 1404 | onChange: value => setSearch(value) |
| 1405 | }) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.FormTokenField, { |
| 1406 | disabled: isLoading, |
| 1407 | label: messages.search, |
| 1408 | onChange: onRemoveToken, |
| 1409 | onInputChange: value => setSearch(value), |
| 1410 | suggestions: [] |
| 1411 | // eslint-disable-next-line @typescript-eslint/ban-ts-comment |
| 1412 | // @ts-ignore - Ignoring because `__experimentalValidateInput` is not yet in the type definitions. |
| 1413 | , |
| 1414 | __experimentalValidateInput: () => false, |
| 1415 | value: isLoading ? [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Loading…', 'woocommerce')] : selected.map(token => ({ |
| 1416 | ...token, |
| 1417 | value: token.name |
| 1418 | })), |
| 1419 | __experimentalShowHowTo: false |
| 1420 | })), isLoading ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1421 | className: "woocommerce-search-list__list" |
| 1422 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.Spinner, null)) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(ListItemsContainer, { |
| 1423 | ...props, |
| 1424 | search: search, |
| 1425 | filteredList: filteredList, |
| 1426 | messages: messages, |
| 1427 | onSelect: onSelect, |
| 1428 | instanceId: instanceId, |
| 1429 | useExpandedPanelId: useExpandedPanelId |
| 1430 | })); |
| 1431 | }; |
| 1432 | SearchListControl.__docgenInfo = { |
| 1433 | "description": "Component to display a searchable, selectable list of items.", |
| 1434 | "methods": [], |
| 1435 | "displayName": "SearchListControl" |
| 1436 | }; |
| 1437 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_components__WEBPACK_IMPORTED_MODULE_2__.withSpokenMessages)(SearchListControl)); |
| 1438 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1439 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/search-list-control/search-list-control.tsx"] = { |
| 1440 | name: "SearchListControl", |
| 1441 | docgenInfo: SearchListControl.__docgenInfo, |
| 1442 | path: "assets/js/editor-components/search-list-control/search-list-control.tsx" |
| 1443 | }; |
| 1444 | } |
| 1445 | |
| 1446 | /***/ }), |
| 1447 | |
| 1448 | /***/ "./assets/js/editor-components/search-list-control/utils.tsx": |
| 1449 | /*!*******************************************************************!*\ |
| 1450 | !*** ./assets/js/editor-components/search-list-control/utils.tsx ***! |
| 1451 | \*******************************************************************/ |
| 1452 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1453 | |
| 1454 | "use strict"; |
| 1455 | __webpack_require__.r(__webpack_exports__); |
| 1456 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1457 | /* harmony export */ buildTermsTree: () => (/* binding */ buildTermsTree), |
| 1458 | /* harmony export */ defaultMessages: () => (/* binding */ defaultMessages), |
| 1459 | /* harmony export */ getBreadcrumbsForDisplay: () => (/* binding */ getBreadcrumbsForDisplay), |
| 1460 | /* harmony export */ getFilteredList: () => (/* binding */ getFilteredList), |
| 1461 | /* harmony export */ getHighlightedName: () => (/* binding */ getHighlightedName) |
| 1462 | /* harmony export */ }); |
| 1463 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1464 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1465 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1466 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); |
| 1467 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1468 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__); |
| 1469 | /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/keyby.ts"); |
| 1470 | |
| 1471 | /** |
| 1472 | * External dependencies |
| 1473 | */ |
| 1474 | |
| 1475 | |
| 1476 | |
| 1477 | |
| 1478 | /** |
| 1479 | * Internal dependencies |
| 1480 | */ |
| 1481 | |
| 1482 | const defaultMessages = { |
| 1483 | clear: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Clear all selected items', 'woocommerce'), |
| 1484 | noItems: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No items found.', 'woocommerce'), |
| 1485 | /* Translators: %s search term */ |
| 1486 | noResults: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No results for %s', 'woocommerce'), |
| 1487 | search: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search for items', 'woocommerce'), |
| 1488 | selected: n => (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)( /* translators: Number of items selected from list. */ |
| 1489 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('%d item selected', '%d items selected', n, 'woocommerce'), n), |
| 1490 | updated: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Search results updated.', 'woocommerce') |
| 1491 | }; |
| 1492 | |
| 1493 | /** |
| 1494 | * Returns terms in a tree form. |
| 1495 | * |
| 1496 | * @param {Array} filteredList Array of terms, possibly a subset of all terms, in flat format. |
| 1497 | * @param {Array} list Array of the full list of terms, defaults to the filteredList. |
| 1498 | * |
| 1499 | * @return {Array} Array of terms in tree format. |
| 1500 | */ |
| 1501 | const buildTermsTree = (filteredList, list = filteredList) => { |
| 1502 | const termsByParent = filteredList.reduce((acc, currentValue) => { |
| 1503 | const key = currentValue.parent || 0; |
| 1504 | if (!acc[key]) { |
| 1505 | acc[key] = []; |
| 1506 | } |
| 1507 | acc[key].push(currentValue); |
| 1508 | return acc; |
| 1509 | }, {}); |
| 1510 | const listById = (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_3__.keyBy)(list, 'id'); |
| 1511 | const builtParents = ['0']; |
| 1512 | const getParentsName = (term = {}) => { |
| 1513 | if (!term.parent) { |
| 1514 | return term.name ? [term.name] : []; |
| 1515 | } |
| 1516 | const parentName = getParentsName(listById[term.parent]); |
| 1517 | return [...parentName, term.name]; |
| 1518 | }; |
| 1519 | const fillWithChildren = terms => { |
| 1520 | return terms.map(term => { |
| 1521 | const children = termsByParent[term.id]; |
| 1522 | builtParents.push('' + term.id); |
| 1523 | return { |
| 1524 | ...term, |
| 1525 | breadcrumbs: getParentsName(listById[term.parent]), |
| 1526 | children: children && children.length ? fillWithChildren(children) : [] |
| 1527 | }; |
| 1528 | }); |
| 1529 | }; |
| 1530 | const tree = fillWithChildren(termsByParent['0'] || []); |
| 1531 | |
| 1532 | // Handle remaining items in termsByParent that have not been built (orphaned). |
| 1533 | Object.entries(termsByParent).forEach(([termId, terms]) => { |
| 1534 | if (!builtParents.includes(termId)) { |
| 1535 | tree.push(...fillWithChildren(terms || [])); |
| 1536 | } |
| 1537 | }); |
| 1538 | return tree; |
| 1539 | }; |
| 1540 | const getFilteredList = (list, search, isHierarchical) => { |
| 1541 | if (!search) { |
| 1542 | return isHierarchical ? buildTermsTree(list) : list; |
| 1543 | } |
| 1544 | const re = new RegExp(search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'i'); |
| 1545 | const filteredList = list.map(item => re.test(item.name) ? item : false).filter(Boolean); |
| 1546 | return isHierarchical ? buildTermsTree(filteredList, list) : filteredList; |
| 1547 | }; |
| 1548 | const getHighlightedName = (name, search) => { |
| 1549 | if (!search) { |
| 1550 | return name; |
| 1551 | } |
| 1552 | const re = new RegExp( |
| 1553 | // Escaping. |
| 1554 | `(${search.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&')})`, 'ig'); |
| 1555 | const nameParts = name.split(re); |
| 1556 | return nameParts.map((part, i) => { |
| 1557 | return re.test(part) ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("strong", { |
| 1558 | key: i |
| 1559 | }, part) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, { |
| 1560 | key: i |
| 1561 | }, part); |
| 1562 | }); |
| 1563 | }; |
| 1564 | const getBreadcrumbsForDisplay = breadcrumbs => { |
| 1565 | if (breadcrumbs.length === 1) { |
| 1566 | return breadcrumbs.slice(0, 1).toString(); |
| 1567 | } |
| 1568 | if (breadcrumbs.length === 2) { |
| 1569 | return breadcrumbs.slice(0, 1).toString() + ' › ' + breadcrumbs.slice(-1).toString(); |
| 1570 | } |
| 1571 | return breadcrumbs.slice(0, 1).toString() + ' … ' + breadcrumbs.slice(-1).toString(); |
| 1572 | }; |
| 1573 | |
| 1574 | /***/ }), |
| 1575 | |
| 1576 | /***/ "./assets/js/editor-components/tag/index.tsx": |
| 1577 | /*!***************************************************!*\ |
| 1578 | !*** ./assets/js/editor-components/tag/index.tsx ***! |
| 1579 | \***************************************************/ |
| 1580 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1581 | |
| 1582 | "use strict"; |
| 1583 | __webpack_require__.r(__webpack_exports__); |
| 1584 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1585 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1586 | /* harmony export */ }); |
| 1587 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1588 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1589 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1590 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 1591 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 1592 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); |
| 1593 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/components */ "@wordpress/components"); |
| 1594 | /* harmony import */ var _wordpress_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__); |
| 1595 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/icon/index.js"); |
| 1596 | /* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/icons */ "../../node_modules/.pnpm/@wordpress+icons@9.36.0/node_modules/@wordpress/icons/build-module/library/cancel-circle-filled.js"); |
| 1597 | /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/html-entities */ "@wordpress/html-entities"); |
| 1598 | /* harmony import */ var _wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__); |
| 1599 | /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "@wordpress/compose"); |
| 1600 | /* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__); |
| 1601 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1602 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__); |
| 1603 | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./editor.scss */ "./assets/js/editor-components/tag/editor.scss"); |
| 1604 | /* harmony import */ var _editor_scss__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_editor_scss__WEBPACK_IMPORTED_MODULE_7__); |
| 1605 | |
| 1606 | /** |
| 1607 | * External dependencies |
| 1608 | */ |
| 1609 | |
| 1610 | |
| 1611 | |
| 1612 | |
| 1613 | |
| 1614 | |
| 1615 | |
| 1616 | |
| 1617 | /** |
| 1618 | * Internal dependencies |
| 1619 | */ |
| 1620 | |
| 1621 | |
| 1622 | /** |
| 1623 | * This component can be used to show an item styled as a "tag", optionally with an `X` + "remove" |
| 1624 | * or with a popover that is shown on click. |
| 1625 | */ |
| 1626 | const Tag = ({ |
| 1627 | id, |
| 1628 | label, |
| 1629 | popoverContents, |
| 1630 | remove, |
| 1631 | screenReaderLabel, |
| 1632 | className = '' |
| 1633 | }) => { |
| 1634 | const [isVisible, setIsVisible] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(false); |
| 1635 | const instanceId = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__.useInstanceId)(Tag); |
| 1636 | screenReaderLabel = screenReaderLabel || label; |
| 1637 | if (!label) { |
| 1638 | // A null label probably means something went wrong |
| 1639 | return null; |
| 1640 | } |
| 1641 | label = (0,_wordpress_html_entities__WEBPACK_IMPORTED_MODULE_4__.decodeEntities)(label); |
| 1642 | const classes = classnames__WEBPACK_IMPORTED_MODULE_2___default()('woocommerce-tag', className, { |
| 1643 | 'has-remove': !!remove |
| 1644 | }); |
| 1645 | const labelId = `woocommerce-tag__label-${instanceId}`; |
| 1646 | const labelTextNode = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1647 | className: "screen-reader-text" |
| 1648 | }, screenReaderLabel), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1649 | "aria-hidden": "true" |
| 1650 | }, label)); |
| 1651 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1652 | className: classes |
| 1653 | }, popoverContents ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, { |
| 1654 | className: "woocommerce-tag__text", |
| 1655 | id: labelId, |
| 1656 | onClick: () => setIsVisible(true) |
| 1657 | }, labelTextNode) : (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 1658 | className: "woocommerce-tag__text", |
| 1659 | id: labelId |
| 1660 | }, labelTextNode), popoverContents && isVisible && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Popover, { |
| 1661 | onClose: () => setIsVisible(false) |
| 1662 | }, popoverContents), remove && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_components__WEBPACK_IMPORTED_MODULE_3__.Button, { |
| 1663 | className: "woocommerce-tag__remove", |
| 1664 | onClick: remove(id), |
| 1665 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( |
| 1666 | // Translators: %s label. |
| 1667 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Remove %s', 'woocommerce'), label), |
| 1668 | "aria-describedby": labelId |
| 1669 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_8__["default"], { |
| 1670 | icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_9__["default"], |
| 1671 | size: 20, |
| 1672 | className: "clear-icon", |
| 1673 | role: "img" |
| 1674 | }))); |
| 1675 | }; |
| 1676 | Tag.__docgenInfo = { |
| 1677 | "description": "This component can be used to show an item styled as a \"tag\", optionally with an `X` + \"remove\"\nor with a popover that is shown on click.", |
| 1678 | "methods": [], |
| 1679 | "displayName": "Tag", |
| 1680 | "props": { |
| 1681 | "className": { |
| 1682 | "defaultValue": { |
| 1683 | "value": "''", |
| 1684 | "computed": false |
| 1685 | }, |
| 1686 | "required": false, |
| 1687 | "tsType": { |
| 1688 | "name": "string" |
| 1689 | }, |
| 1690 | "description": "" |
| 1691 | }, |
| 1692 | "id": { |
| 1693 | "required": true, |
| 1694 | "tsType": { |
| 1695 | "name": "union", |
| 1696 | "raw": "string | number", |
| 1697 | "elements": [{ |
| 1698 | "name": "string" |
| 1699 | }, { |
| 1700 | "name": "number" |
| 1701 | }] |
| 1702 | }, |
| 1703 | "description": "" |
| 1704 | }, |
| 1705 | "label": { |
| 1706 | "required": true, |
| 1707 | "tsType": { |
| 1708 | "name": "string" |
| 1709 | }, |
| 1710 | "description": "" |
| 1711 | }, |
| 1712 | "popoverContents": { |
| 1713 | "required": false, |
| 1714 | "tsType": { |
| 1715 | "name": "JSX.Element" |
| 1716 | }, |
| 1717 | "description": "" |
| 1718 | }, |
| 1719 | "remove": { |
| 1720 | "required": false, |
| 1721 | "tsType": { |
| 1722 | "name": "signature", |
| 1723 | "type": "function", |
| 1724 | "raw": "( id: string | number ) => () => void", |
| 1725 | "signature": { |
| 1726 | "arguments": [{ |
| 1727 | "name": "id", |
| 1728 | "type": { |
| 1729 | "name": "union", |
| 1730 | "raw": "string | number", |
| 1731 | "elements": [{ |
| 1732 | "name": "string" |
| 1733 | }, { |
| 1734 | "name": "number" |
| 1735 | }] |
| 1736 | } |
| 1737 | }], |
| 1738 | "return": { |
| 1739 | "name": "signature", |
| 1740 | "type": "function", |
| 1741 | "raw": "() => void", |
| 1742 | "signature": { |
| 1743 | "arguments": [], |
| 1744 | "return": { |
| 1745 | "name": "void" |
| 1746 | } |
| 1747 | } |
| 1748 | } |
| 1749 | } |
| 1750 | }, |
| 1751 | "description": "" |
| 1752 | }, |
| 1753 | "screenReaderLabel": { |
| 1754 | "required": false, |
| 1755 | "tsType": { |
| 1756 | "name": "string" |
| 1757 | }, |
| 1758 | "description": "" |
| 1759 | } |
| 1760 | } |
| 1761 | }; |
| 1762 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Tag); |
| 1763 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1764 | STORYBOOK_REACT_CLASSES["assets/js/editor-components/tag/index.tsx"] = { |
| 1765 | name: "Tag", |
| 1766 | docgenInfo: Tag.__docgenInfo, |
| 1767 | path: "assets/js/editor-components/tag/index.tsx" |
| 1768 | }; |
| 1769 | } |
| 1770 | |
| 1771 | /***/ }), |
| 1772 | |
| 1773 | /***/ "./assets/js/editor-components/utils/index.js": |
| 1774 | /*!****************************************************!*\ |
| 1775 | !*** ./assets/js/editor-components/utils/index.js ***! |
| 1776 | \****************************************************/ |
| 1777 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1778 | |
| 1779 | "use strict"; |
| 1780 | __webpack_require__.r(__webpack_exports__); |
| 1781 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1782 | /* harmony export */ formatTitle: () => (/* binding */ formatTitle), |
| 1783 | /* harmony export */ getAttributes: () => (/* binding */ getAttributes), |
| 1784 | /* harmony export */ getCategories: () => (/* binding */ getCategories), |
| 1785 | /* harmony export */ getCategory: () => (/* binding */ getCategory), |
| 1786 | /* harmony export */ getProduct: () => (/* binding */ getProduct), |
| 1787 | /* harmony export */ getProductTags: () => (/* binding */ getProductTags), |
| 1788 | /* harmony export */ getProductVariations: () => (/* binding */ getProductVariations), |
| 1789 | /* harmony export */ getProducts: () => (/* binding */ getProducts), |
| 1790 | /* harmony export */ getTerms: () => (/* binding */ getTerms) |
| 1791 | /* harmony export */ }); |
| 1792 | /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "@wordpress/url"); |
| 1793 | /* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_url__WEBPACK_IMPORTED_MODULE_0__); |
| 1794 | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); |
| 1795 | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1__); |
| 1796 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 1797 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__); |
| 1798 | /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts"); |
| 1799 | /** |
| 1800 | * External dependencies |
| 1801 | */ |
| 1802 | |
| 1803 | |
| 1804 | |
| 1805 | |
| 1806 | |
| 1807 | /** |
| 1808 | * Get product query requests for the Store API. |
| 1809 | * |
| 1810 | * @param {Object} request A query object with the list of selected products and search term. |
| 1811 | * @param {number[]} request.selected Currently selected products. |
| 1812 | * @param {string=} request.search Search string. |
| 1813 | * @param {(Record<string, unknown>)=} request.queryArgs Query args to pass in. |
| 1814 | */ |
| 1815 | const getProductsRequests = ({ |
| 1816 | selected = [], |
| 1817 | search = '', |
| 1818 | queryArgs = {} |
| 1819 | }) => { |
| 1820 | const isLargeCatalog = _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_3__.blocksConfig.productCount > 100; |
| 1821 | const defaultArgs = { |
| 1822 | per_page: isLargeCatalog ? 100 : 0, |
| 1823 | catalog_visibility: 'any', |
| 1824 | search, |
| 1825 | orderby: 'title', |
| 1826 | order: 'asc' |
| 1827 | }; |
| 1828 | const requests = [(0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)('/wc/store/v1/products', { |
| 1829 | ...defaultArgs, |
| 1830 | ...queryArgs |
| 1831 | })]; |
| 1832 | |
| 1833 | // If we have a large catalog, we might not get all selected products in the first page. |
| 1834 | if (isLargeCatalog && selected.length) { |
| 1835 | requests.push((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)('/wc/store/v1/products', { |
| 1836 | catalog_visibility: 'any', |
| 1837 | include: selected, |
| 1838 | per_page: 0 |
| 1839 | })); |
| 1840 | } |
| 1841 | return requests; |
| 1842 | }; |
| 1843 | const uniqBy = (array, iteratee) => { |
| 1844 | const seen = new Map(); |
| 1845 | return array.filter(item => { |
| 1846 | const key = iteratee(item); |
| 1847 | if (!seen.has(key)) { |
| 1848 | seen.set(key, item); |
| 1849 | return true; |
| 1850 | } |
| 1851 | return false; |
| 1852 | }); |
| 1853 | }; |
| 1854 | |
| 1855 | /** |
| 1856 | * Get a promise that resolves to a list of products from the Store API. |
| 1857 | * |
| 1858 | * @param {Object} request A query object with the list of selected products and search term. |
| 1859 | * @param {number[]} request.selected Currently selected products. |
| 1860 | * @param {string=} request.search Search string. |
| 1861 | * @param {(Record<string, unknown>)=} request.queryArgs Query args to pass in. |
| 1862 | * @return {Promise<unknown>} Promise resolving to a Product list. |
| 1863 | * @throws Exception if there is an error. |
| 1864 | */ |
| 1865 | const getProducts = ({ |
| 1866 | selected = [], |
| 1867 | search = '', |
| 1868 | queryArgs = {} |
| 1869 | }) => { |
| 1870 | const requests = getProductsRequests({ |
| 1871 | selected, |
| 1872 | search, |
| 1873 | queryArgs |
| 1874 | }); |
| 1875 | return Promise.all(requests.map(path => _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1876 | path |
| 1877 | }))).then(data => { |
| 1878 | const flatData = data.flat(); |
| 1879 | const products = uniqBy(flatData, item => item.id); |
| 1880 | const list = products.map(product => ({ |
| 1881 | ...product, |
| 1882 | parent: 0 |
| 1883 | })); |
| 1884 | return list; |
| 1885 | }).catch(e => { |
| 1886 | throw e; |
| 1887 | }); |
| 1888 | }; |
| 1889 | |
| 1890 | /** |
| 1891 | * Get a promise that resolves to a product object from the Store API. |
| 1892 | * |
| 1893 | * @param {number} productId Id of the product to retrieve. |
| 1894 | */ |
| 1895 | const getProduct = productId => { |
| 1896 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1897 | path: `/wc/store/v1/products/${productId}` |
| 1898 | }); |
| 1899 | }; |
| 1900 | |
| 1901 | /** |
| 1902 | * Get a promise that resolves to a list of attribute objects from the Store API. |
| 1903 | */ |
| 1904 | const getAttributes = () => { |
| 1905 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1906 | path: `wc/store/v1/products/attributes` |
| 1907 | }); |
| 1908 | }; |
| 1909 | |
| 1910 | /** |
| 1911 | * Get a promise that resolves to a list of attribute term objects from the Store API. |
| 1912 | * |
| 1913 | * @param {number} attribute Id of the attribute to retrieve terms for. |
| 1914 | */ |
| 1915 | const getTerms = attribute => { |
| 1916 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1917 | path: `wc/store/v1/products/attributes/${attribute}/terms` |
| 1918 | }); |
| 1919 | }; |
| 1920 | |
| 1921 | /** |
| 1922 | * Get product tag query requests for the Store API. |
| 1923 | * |
| 1924 | * @param {Object} request A query object with the list of selected products and search term. |
| 1925 | * @param {Array} request.selected Currently selected tags. |
| 1926 | * @param {string} request.search Search string. |
| 1927 | */ |
| 1928 | const getProductTagsRequests = ({ |
| 1929 | selected = [], |
| 1930 | search |
| 1931 | }) => { |
| 1932 | const limitTags = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('limitTags', false); |
| 1933 | const requests = [(0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(`wc/store/v1/products/tags`, { |
| 1934 | per_page: limitTags ? 100 : 0, |
| 1935 | orderby: limitTags ? 'count' : 'name', |
| 1936 | order: limitTags ? 'desc' : 'asc', |
| 1937 | search |
| 1938 | })]; |
| 1939 | |
| 1940 | // If we have a large catalog, we might not get all selected products in the first page. |
| 1941 | if (limitTags && selected.length) { |
| 1942 | requests.push((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(`wc/store/v1/products/tags`, { |
| 1943 | include: selected |
| 1944 | })); |
| 1945 | } |
| 1946 | return requests; |
| 1947 | }; |
| 1948 | |
| 1949 | /** |
| 1950 | * Get a promise that resolves to a list of tags from the Store API. |
| 1951 | * |
| 1952 | * @param {Object} props A query object with the list of selected products and search term. |
| 1953 | * @param {Array} props.selected |
| 1954 | * @param {string} props.search |
| 1955 | */ |
| 1956 | const getProductTags = ({ |
| 1957 | selected = [], |
| 1958 | search |
| 1959 | }) => { |
| 1960 | const requests = getProductTagsRequests({ |
| 1961 | selected, |
| 1962 | search |
| 1963 | }); |
| 1964 | return Promise.all(requests.map(path => _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1965 | path |
| 1966 | }))).then(data => { |
| 1967 | const flatData = data.flat(); |
| 1968 | return uniqBy(flatData, item => item.id); |
| 1969 | }); |
| 1970 | }; |
| 1971 | |
| 1972 | /** |
| 1973 | * Get a promise that resolves to a list of category objects from the Store API. |
| 1974 | * |
| 1975 | * @param {Object} queryArgs Query args to pass in. |
| 1976 | */ |
| 1977 | const getCategories = queryArgs => { |
| 1978 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1979 | path: (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(`wc/store/v1/products/categories`, { |
| 1980 | per_page: 0, |
| 1981 | ...queryArgs |
| 1982 | }) |
| 1983 | }); |
| 1984 | }; |
| 1985 | |
| 1986 | /** |
| 1987 | * Get a promise that resolves to a category object from the API. |
| 1988 | * |
| 1989 | * @param {number} categoryId Id of the product to retrieve. |
| 1990 | */ |
| 1991 | const getCategory = categoryId => { |
| 1992 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 1993 | path: `wc/store/v1/products/categories/${categoryId}` |
| 1994 | }); |
| 1995 | }; |
| 1996 | |
| 1997 | /** |
| 1998 | * Get a promise that resolves to a list of variation objects from the Store API. |
| 1999 | * |
| 2000 | * @param {number} product Product ID. |
| 2001 | */ |
| 2002 | const getProductVariations = product => { |
| 2003 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_1___default()({ |
| 2004 | path: (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.addQueryArgs)(`wc/store/v1/products`, { |
| 2005 | per_page: 0, |
| 2006 | type: 'variation', |
| 2007 | parent: product |
| 2008 | }) |
| 2009 | }); |
| 2010 | }; |
| 2011 | |
| 2012 | /** |
| 2013 | * Given a page object and an array of page, format the title. |
| 2014 | * |
| 2015 | * @param {Object} page Page object. |
| 2016 | * @param {Object} page.title Page title object. |
| 2017 | * @param {string} page.title.raw Page title. |
| 2018 | * @param {string} page.slug Page slug. |
| 2019 | * @param {Array} pages Array of all pages. |
| 2020 | * @return {string} Formatted page title to display. |
| 2021 | */ |
| 2022 | const formatTitle = (page, pages) => { |
| 2023 | if (!page.title.raw) { |
| 2024 | return page.slug; |
| 2025 | } |
| 2026 | const isUnique = pages.filter(p => p.title.raw === page.title.raw).length === 1; |
| 2027 | return page.title.raw + (!isUnique ? ` - ${page.slug}` : ''); |
| 2028 | }; |
| 2029 | |
| 2030 | /***/ }), |
| 2031 | |
| 2032 | /***/ "./assets/js/hocs/with-searched-products.tsx": |
| 2033 | /*!***************************************************!*\ |
| 2034 | !*** ./assets/js/hocs/with-searched-products.tsx ***! |
| 2035 | \***************************************************/ |
| 2036 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2037 | |
| 2038 | "use strict"; |
| 2039 | __webpack_require__.r(__webpack_exports__); |
| 2040 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2041 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 2042 | /* harmony export */ }); |
| 2043 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2044 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2045 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 2046 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); |
| 2047 | /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts"); |
| 2048 | /* harmony import */ var _woocommerce_editor_components_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/editor-components/utils */ "./assets/js/editor-components/utils/index.js"); |
| 2049 | /* harmony import */ var use_debounce__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! use-debounce */ "../../node_modules/.pnpm/use-debounce@9.0.4_react@17.0.2/node_modules/use-debounce/dist/index.module.js"); |
| 2050 | /* harmony import */ var _base_utils_errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base/utils/errors */ "./assets/js/base/utils/errors.ts"); |
| 2051 | |
| 2052 | /** |
| 2053 | * External dependencies |
| 2054 | */ |
| 2055 | |
| 2056 | |
| 2057 | |
| 2058 | |
| 2059 | /** |
| 2060 | * Internal dependencies |
| 2061 | */ |
| 2062 | |
| 2063 | /** |
| 2064 | * A higher order component that enhances the provided component with products from a search query. |
| 2065 | */ |
| 2066 | const withSearchedProducts = OriginalComponent => { |
| 2067 | return ({ |
| 2068 | selected, |
| 2069 | ...props |
| 2070 | }) => { |
| 2071 | const [isLoading, setIsLoading] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(true); |
| 2072 | const [error, setError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null); |
| 2073 | const [productsList, setProductsList] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]); |
| 2074 | const isLargeCatalog = _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__.blocksConfig.productCount > 100; |
| 2075 | const setErrorState = async e => { |
| 2076 | const formattedError = await (0,_base_utils_errors__WEBPACK_IMPORTED_MODULE_3__.formatError)(e); |
| 2077 | setError(formattedError); |
| 2078 | setIsLoading(false); |
| 2079 | }; |
| 2080 | const selectedRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(selected); |
| 2081 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => { |
| 2082 | (0,_woocommerce_editor_components_utils__WEBPACK_IMPORTED_MODULE_4__.getProducts)({ |
| 2083 | selected: selectedRef.current |
| 2084 | }).then(results => { |
| 2085 | setProductsList(results); |
| 2086 | setIsLoading(false); |
| 2087 | }).catch(setErrorState); |
| 2088 | }, [selectedRef]); |
| 2089 | const debouncedSearch = (0,use_debounce__WEBPACK_IMPORTED_MODULE_5__.useDebouncedCallback)(search => { |
| 2090 | (0,_woocommerce_editor_components_utils__WEBPACK_IMPORTED_MODULE_4__.getProducts)({ |
| 2091 | selected, |
| 2092 | search |
| 2093 | }).then(results => { |
| 2094 | setProductsList(results); |
| 2095 | setIsLoading(false); |
| 2096 | }).catch(setErrorState); |
| 2097 | }, 400); |
| 2098 | const onSearch = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(search => { |
| 2099 | setIsLoading(true); |
| 2100 | debouncedSearch(search); |
| 2101 | }, [setIsLoading, debouncedSearch]); |
| 2102 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(OriginalComponent, { |
| 2103 | ...props, |
| 2104 | selected: selected, |
| 2105 | error: error, |
| 2106 | products: productsList, |
| 2107 | isLoading: isLoading, |
| 2108 | onSearch: isLargeCatalog ? onSearch : null |
| 2109 | }); |
| 2110 | }; |
| 2111 | }; |
| 2112 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (withSearchedProducts); |
| 2113 | |
| 2114 | /***/ }), |
| 2115 | |
| 2116 | /***/ "./assets/js/previews/grid-block.js": |
| 2117 | /*!******************************************!*\ |
| 2118 | !*** ./assets/js/previews/grid-block.js ***! |
| 2119 | \******************************************/ |
| 2120 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2121 | |
| 2122 | "use strict"; |
| 2123 | __webpack_require__.r(__webpack_exports__); |
| 2124 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2125 | /* harmony export */ gridBlockPreview: () => (/* binding */ gridBlockPreview) |
| 2126 | /* harmony export */ }); |
| 2127 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2128 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2129 | |
| 2130 | /** |
| 2131 | * External dependencies |
| 2132 | */ |
| 2133 | const gridBlockPreview = (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("svg", { |
| 2134 | xmlns: "http://www.w3.org/2000/svg", |
| 2135 | fill: "none", |
| 2136 | viewBox: "0 0 230 250", |
| 2137 | style: { |
| 2138 | width: '100%' |
| 2139 | } |
| 2140 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("title", null, "Grid Block Preview"), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2141 | width: "65.374", |
| 2142 | height: "65.374", |
| 2143 | x: ".162", |
| 2144 | y: ".779", |
| 2145 | fill: "#E1E3E6", |
| 2146 | rx: "3" |
| 2147 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2148 | width: "47.266", |
| 2149 | height: "5.148", |
| 2150 | x: "9.216", |
| 2151 | y: "76.153", |
| 2152 | fill: "#E1E3E6", |
| 2153 | rx: "2.574" |
| 2154 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2155 | width: "62.8", |
| 2156 | height: "15", |
| 2157 | x: "1.565", |
| 2158 | y: "101.448", |
| 2159 | fill: "#E1E3E6", |
| 2160 | rx: "5" |
| 2161 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2162 | width: "65.374", |
| 2163 | height: "65.374", |
| 2164 | x: ".162", |
| 2165 | y: "136.277", |
| 2166 | fill: "#E1E3E6", |
| 2167 | rx: "3" |
| 2168 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2169 | width: "47.266", |
| 2170 | height: "5.148", |
| 2171 | x: "9.216", |
| 2172 | y: "211.651", |
| 2173 | fill: "#E1E3E6", |
| 2174 | rx: "2.574" |
| 2175 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2176 | width: "62.8", |
| 2177 | height: "15", |
| 2178 | x: "1.565", |
| 2179 | y: "236.946", |
| 2180 | fill: "#E1E3E6", |
| 2181 | rx: "5" |
| 2182 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2183 | width: "65.374", |
| 2184 | height: "65.374", |
| 2185 | x: "82.478", |
| 2186 | y: ".779", |
| 2187 | fill: "#E1E3E6", |
| 2188 | rx: "3" |
| 2189 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2190 | width: "47.266", |
| 2191 | height: "5.148", |
| 2192 | x: "91.532", |
| 2193 | y: "76.153", |
| 2194 | fill: "#E1E3E6", |
| 2195 | rx: "2.574" |
| 2196 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2197 | width: "62.8", |
| 2198 | height: "15", |
| 2199 | x: "83.882", |
| 2200 | y: "101.448", |
| 2201 | fill: "#E1E3E6", |
| 2202 | rx: "5" |
| 2203 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2204 | width: "65.374", |
| 2205 | height: "65.374", |
| 2206 | x: "82.478", |
| 2207 | y: "136.277", |
| 2208 | fill: "#E1E3E6", |
| 2209 | rx: "3" |
| 2210 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2211 | width: "47.266", |
| 2212 | height: "5.148", |
| 2213 | x: "91.532", |
| 2214 | y: "211.651", |
| 2215 | fill: "#E1E3E6", |
| 2216 | rx: "2.574" |
| 2217 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2218 | width: "62.8", |
| 2219 | height: "15", |
| 2220 | x: "83.882", |
| 2221 | y: "236.946", |
| 2222 | fill: "#E1E3E6", |
| 2223 | rx: "5" |
| 2224 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2225 | width: "65.374", |
| 2226 | height: "65.374", |
| 2227 | x: "164.788", |
| 2228 | y: ".779", |
| 2229 | fill: "#E1E3E6", |
| 2230 | rx: "3" |
| 2231 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2232 | width: "47.266", |
| 2233 | height: "5.148", |
| 2234 | x: "173.843", |
| 2235 | y: "76.153", |
| 2236 | fill: "#E1E3E6", |
| 2237 | rx: "2.574" |
| 2238 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2239 | width: "62.8", |
| 2240 | height: "15", |
| 2241 | x: "166.192", |
| 2242 | y: "101.448", |
| 2243 | fill: "#E1E3E6", |
| 2244 | rx: "5" |
| 2245 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2246 | width: "65.374", |
| 2247 | height: "65.374", |
| 2248 | x: "164.788", |
| 2249 | y: "136.277", |
| 2250 | fill: "#E1E3E6", |
| 2251 | rx: "3" |
| 2252 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2253 | width: "47.266", |
| 2254 | height: "5.148", |
| 2255 | x: "173.843", |
| 2256 | y: "211.651", |
| 2257 | fill: "#E1E3E6", |
| 2258 | rx: "2.574" |
| 2259 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2260 | width: "62.8", |
| 2261 | height: "15", |
| 2262 | x: "166.192", |
| 2263 | y: "236.946", |
| 2264 | fill: "#E1E3E6", |
| 2265 | rx: "5" |
| 2266 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2267 | width: "6.177", |
| 2268 | height: "6.177", |
| 2269 | x: "13.283", |
| 2270 | y: "86.301", |
| 2271 | fill: "#E1E3E6", |
| 2272 | rx: "3" |
| 2273 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2274 | width: "6.177", |
| 2275 | height: "6.177", |
| 2276 | x: "21.498", |
| 2277 | y: "86.301", |
| 2278 | fill: "#E1E3E6", |
| 2279 | rx: "3" |
| 2280 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2281 | width: "6.177", |
| 2282 | height: "6.177", |
| 2283 | x: "29.713", |
| 2284 | y: "86.301", |
| 2285 | fill: "#E1E3E6", |
| 2286 | rx: "3" |
| 2287 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2288 | width: "6.177", |
| 2289 | height: "6.177", |
| 2290 | x: "37.927", |
| 2291 | y: "86.301", |
| 2292 | fill: "#E1E3E6", |
| 2293 | rx: "3" |
| 2294 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2295 | width: "6.177", |
| 2296 | height: "6.177", |
| 2297 | x: "46.238", |
| 2298 | y: "86.301", |
| 2299 | fill: "#E1E3E6", |
| 2300 | rx: "3" |
| 2301 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2302 | width: "6.177", |
| 2303 | height: "6.177", |
| 2304 | x: "95.599", |
| 2305 | y: "86.301", |
| 2306 | fill: "#E1E3E6", |
| 2307 | rx: "3" |
| 2308 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2309 | width: "6.177", |
| 2310 | height: "6.177", |
| 2311 | x: "103.814", |
| 2312 | y: "86.301", |
| 2313 | fill: "#E1E3E6", |
| 2314 | rx: "3" |
| 2315 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2316 | width: "6.177", |
| 2317 | height: "6.177", |
| 2318 | x: "112.029", |
| 2319 | y: "86.301", |
| 2320 | fill: "#E1E3E6", |
| 2321 | rx: "3" |
| 2322 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2323 | width: "6.177", |
| 2324 | height: "6.177", |
| 2325 | x: "120.243", |
| 2326 | y: "86.301", |
| 2327 | fill: "#E1E3E6", |
| 2328 | rx: "3" |
| 2329 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2330 | width: "6.177", |
| 2331 | height: "6.177", |
| 2332 | x: "128.554", |
| 2333 | y: "86.301", |
| 2334 | fill: "#E1E3E6", |
| 2335 | rx: "3" |
| 2336 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2337 | width: "6.177", |
| 2338 | height: "6.177", |
| 2339 | x: "177.909", |
| 2340 | y: "86.301", |
| 2341 | fill: "#E1E3E6", |
| 2342 | rx: "3" |
| 2343 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2344 | width: "6.177", |
| 2345 | height: "6.177", |
| 2346 | x: "186.124", |
| 2347 | y: "86.301", |
| 2348 | fill: "#E1E3E6", |
| 2349 | rx: "3" |
| 2350 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2351 | width: "6.177", |
| 2352 | height: "6.177", |
| 2353 | x: "194.339", |
| 2354 | y: "86.301", |
| 2355 | fill: "#E1E3E6", |
| 2356 | rx: "3" |
| 2357 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2358 | width: "6.177", |
| 2359 | height: "6.177", |
| 2360 | x: "202.553", |
| 2361 | y: "86.301", |
| 2362 | fill: "#E1E3E6", |
| 2363 | rx: "3" |
| 2364 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2365 | width: "6.177", |
| 2366 | height: "6.177", |
| 2367 | x: "210.864", |
| 2368 | y: "86.301", |
| 2369 | fill: "#E1E3E6", |
| 2370 | rx: "3" |
| 2371 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2372 | width: "6.177", |
| 2373 | height: "6.177", |
| 2374 | x: "13.283", |
| 2375 | y: "221.798", |
| 2376 | fill: "#E1E3E6", |
| 2377 | rx: "3" |
| 2378 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2379 | width: "6.177", |
| 2380 | height: "6.177", |
| 2381 | x: "21.498", |
| 2382 | y: "221.798", |
| 2383 | fill: "#E1E3E6", |
| 2384 | rx: "3" |
| 2385 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2386 | width: "6.177", |
| 2387 | height: "6.177", |
| 2388 | x: "29.713", |
| 2389 | y: "221.798", |
| 2390 | fill: "#E1E3E6", |
| 2391 | rx: "3" |
| 2392 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2393 | width: "6.177", |
| 2394 | height: "6.177", |
| 2395 | x: "37.927", |
| 2396 | y: "221.798", |
| 2397 | fill: "#E1E3E6", |
| 2398 | rx: "3" |
| 2399 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2400 | width: "6.177", |
| 2401 | height: "6.177", |
| 2402 | x: "46.238", |
| 2403 | y: "221.798", |
| 2404 | fill: "#E1E3E6", |
| 2405 | rx: "3" |
| 2406 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2407 | width: "6.177", |
| 2408 | height: "6.177", |
| 2409 | x: "95.599", |
| 2410 | y: "221.798", |
| 2411 | fill: "#E1E3E6", |
| 2412 | rx: "3" |
| 2413 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2414 | width: "6.177", |
| 2415 | height: "6.177", |
| 2416 | x: "103.814", |
| 2417 | y: "221.798", |
| 2418 | fill: "#E1E3E6", |
| 2419 | rx: "3" |
| 2420 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2421 | width: "6.177", |
| 2422 | height: "6.177", |
| 2423 | x: "112.029", |
| 2424 | y: "221.798", |
| 2425 | fill: "#E1E3E6", |
| 2426 | rx: "3" |
| 2427 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2428 | width: "6.177", |
| 2429 | height: "6.177", |
| 2430 | x: "120.243", |
| 2431 | y: "221.798", |
| 2432 | fill: "#E1E3E6", |
| 2433 | rx: "3" |
| 2434 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2435 | width: "6.177", |
| 2436 | height: "6.177", |
| 2437 | x: "128.554", |
| 2438 | y: "221.798", |
| 2439 | fill: "#E1E3E6", |
| 2440 | rx: "3" |
| 2441 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2442 | width: "6.177", |
| 2443 | height: "6.177", |
| 2444 | x: "177.909", |
| 2445 | y: "221.798", |
| 2446 | fill: "#E1E3E6", |
| 2447 | rx: "3" |
| 2448 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2449 | width: "6.177", |
| 2450 | height: "6.177", |
| 2451 | x: "186.124", |
| 2452 | y: "221.798", |
| 2453 | fill: "#E1E3E6", |
| 2454 | rx: "3" |
| 2455 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2456 | width: "6.177", |
| 2457 | height: "6.177", |
| 2458 | x: "194.339", |
| 2459 | y: "221.798", |
| 2460 | fill: "#E1E3E6", |
| 2461 | rx: "3" |
| 2462 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2463 | width: "6.177", |
| 2464 | height: "6.177", |
| 2465 | x: "202.553", |
| 2466 | y: "221.798", |
| 2467 | fill: "#E1E3E6", |
| 2468 | rx: "3" |
| 2469 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("rect", { |
| 2470 | width: "6.177", |
| 2471 | height: "6.177", |
| 2472 | x: "210.864", |
| 2473 | y: "221.798", |
| 2474 | fill: "#E1E3E6", |
| 2475 | rx: "3" |
| 2476 | })); |
| 2477 | |
| 2478 | /***/ }), |
| 2479 | |
| 2480 | /***/ "./assets/js/settings/blocks/constants.ts": |
| 2481 | /*!************************************************!*\ |
| 2482 | !*** ./assets/js/settings/blocks/constants.ts ***! |
| 2483 | \************************************************/ |
| 2484 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2485 | |
| 2486 | "use strict"; |
| 2487 | __webpack_require__.r(__webpack_exports__); |
| 2488 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2489 | /* harmony export */ ADDITIONAL_FIELDS_KEYS: () => (/* binding */ ADDITIONAL_FIELDS_KEYS), |
| 2490 | /* harmony export */ ADDRESS_FIELDS_KEYS: () => (/* binding */ ADDRESS_FIELDS_KEYS), |
| 2491 | /* harmony export */ ALLOWED_COUNTRIES: () => (/* binding */ ALLOWED_COUNTRIES), |
| 2492 | /* harmony export */ ALLOWED_STATES: () => (/* binding */ ALLOWED_STATES), |
| 2493 | /* harmony export */ CART_PAGE_ID: () => (/* binding */ CART_PAGE_ID), |
| 2494 | /* harmony export */ CART_URL: () => (/* binding */ CART_URL), |
| 2495 | /* harmony export */ CHECKOUT_PAGE_ID: () => (/* binding */ CHECKOUT_PAGE_ID), |
| 2496 | /* harmony export */ CHECKOUT_URL: () => (/* binding */ CHECKOUT_URL), |
| 2497 | /* harmony export */ CONTACT_FIELDS_KEYS: () => (/* binding */ CONTACT_FIELDS_KEYS), |
| 2498 | /* harmony export */ COUNTRY_LOCALE: () => (/* binding */ COUNTRY_LOCALE), |
| 2499 | /* harmony export */ LOCAL_PICKUP_ENABLED: () => (/* binding */ LOCAL_PICKUP_ENABLED), |
| 2500 | /* harmony export */ LOGIN_URL: () => (/* binding */ LOGIN_URL), |
| 2501 | /* harmony export */ PRIVACY_PAGE_NAME: () => (/* binding */ PRIVACY_PAGE_NAME), |
| 2502 | /* harmony export */ PRIVACY_URL: () => (/* binding */ PRIVACY_URL), |
| 2503 | /* harmony export */ SHIPPING_COUNTRIES: () => (/* binding */ SHIPPING_COUNTRIES), |
| 2504 | /* harmony export */ SHIPPING_STATES: () => (/* binding */ SHIPPING_STATES), |
| 2505 | /* harmony export */ SHOP_URL: () => (/* binding */ SHOP_URL), |
| 2506 | /* harmony export */ TERMS_PAGE_NAME: () => (/* binding */ TERMS_PAGE_NAME), |
| 2507 | /* harmony export */ TERMS_URL: () => (/* binding */ TERMS_URL), |
| 2508 | /* harmony export */ WC_BLOCKS_BUILD_URL: () => (/* binding */ WC_BLOCKS_BUILD_URL), |
| 2509 | /* harmony export */ WC_BLOCKS_IMAGE_URL: () => (/* binding */ WC_BLOCKS_IMAGE_URL), |
| 2510 | /* harmony export */ WC_BLOCKS_PHASE: () => (/* binding */ WC_BLOCKS_PHASE), |
| 2511 | /* harmony export */ blocksConfig: () => (/* binding */ blocksConfig) |
| 2512 | /* harmony export */ }); |
| 2513 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 2514 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__); |
| 2515 | var _STORE_PAGES$shop, _STORE_PAGES$checkout, _STORE_PAGES$checkout2, _STORE_PAGES$privacy, _STORE_PAGES$privacy2, _STORE_PAGES$terms, _STORE_PAGES$terms2, _STORE_PAGES$cart, _STORE_PAGES$cart2, _STORE_PAGES$myaccoun; |
| 2516 | /** |
| 2517 | * External dependencies |
| 2518 | */ |
| 2519 | |
| 2520 | const blocksConfig = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('wcBlocksConfig', { |
| 2521 | buildPhase: 1, |
| 2522 | pluginUrl: '', |
| 2523 | productCount: 0, |
| 2524 | defaultAvatar: '', |
| 2525 | restApiRoutes: {}, |
| 2526 | wordCountType: 'words' |
| 2527 | }); |
| 2528 | const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'assets/images/'; |
| 2529 | const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'assets/client/blocks/'; |
| 2530 | const WC_BLOCKS_PHASE = blocksConfig.buildPhase; |
| 2531 | const SHOP_URL = (_STORE_PAGES$shop = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.shop) === null || _STORE_PAGES$shop === void 0 ? void 0 : _STORE_PAGES$shop.permalink; |
| 2532 | const CHECKOUT_PAGE_ID = (_STORE_PAGES$checkout = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.checkout) === null || _STORE_PAGES$checkout === void 0 ? void 0 : _STORE_PAGES$checkout.id; |
| 2533 | const CHECKOUT_URL = (_STORE_PAGES$checkout2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.checkout) === null || _STORE_PAGES$checkout2 === void 0 ? void 0 : _STORE_PAGES$checkout2.permalink; |
| 2534 | const PRIVACY_URL = (_STORE_PAGES$privacy = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.privacy) === null || _STORE_PAGES$privacy === void 0 ? void 0 : _STORE_PAGES$privacy.permalink; |
| 2535 | const PRIVACY_PAGE_NAME = (_STORE_PAGES$privacy2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.privacy) === null || _STORE_PAGES$privacy2 === void 0 ? void 0 : _STORE_PAGES$privacy2.title; |
| 2536 | const TERMS_URL = (_STORE_PAGES$terms = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.terms) === null || _STORE_PAGES$terms === void 0 ? void 0 : _STORE_PAGES$terms.permalink; |
| 2537 | const TERMS_PAGE_NAME = (_STORE_PAGES$terms2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.terms) === null || _STORE_PAGES$terms2 === void 0 ? void 0 : _STORE_PAGES$terms2.title; |
| 2538 | const CART_PAGE_ID = (_STORE_PAGES$cart = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.cart) === null || _STORE_PAGES$cart === void 0 ? void 0 : _STORE_PAGES$cart.id; |
| 2539 | const CART_URL = (_STORE_PAGES$cart2 = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.cart) === null || _STORE_PAGES$cart2 === void 0 ? void 0 : _STORE_PAGES$cart2.permalink; |
| 2540 | const LOGIN_URL = (_STORE_PAGES$myaccoun = _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.myaccount) !== null && _STORE_PAGES$myaccoun !== void 0 && _STORE_PAGES$myaccoun.permalink ? _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.STORE_PAGES.myaccount.permalink : (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('wpLoginUrl', '/wp-login.php'); |
| 2541 | const LOCAL_PICKUP_ENABLED = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('localPickupEnabled', false); |
| 2542 | // Contains country names. |
| 2543 | const countries = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('countries', {}); |
| 2544 | |
| 2545 | // Contains country settings. |
| 2546 | const countryData = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('countryData', {}); |
| 2547 | const ALLOWED_COUNTRIES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2548 | return countryData[countryCode].allowBilling === true; |
| 2549 | }).map(countryCode => { |
| 2550 | return [countryCode, countries[countryCode] || '']; |
| 2551 | })); |
| 2552 | const ALLOWED_STATES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2553 | return countryData[countryCode].allowBilling === true; |
| 2554 | }).map(countryCode => { |
| 2555 | return [countryCode, countryData[countryCode].states || []]; |
| 2556 | })); |
| 2557 | const SHIPPING_COUNTRIES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2558 | return countryData[countryCode].allowShipping === true; |
| 2559 | }).map(countryCode => { |
| 2560 | return [countryCode, countries[countryCode] || '']; |
| 2561 | })); |
| 2562 | const SHIPPING_STATES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2563 | return countryData[countryCode].allowShipping === true; |
| 2564 | }).map(countryCode => { |
| 2565 | return [countryCode, countryData[countryCode].states || []]; |
| 2566 | })); |
| 2567 | const COUNTRY_LOCALE = Object.fromEntries(Object.keys(countryData).map(countryCode => { |
| 2568 | return [countryCode, countryData[countryCode].locale || []]; |
| 2569 | })); |
| 2570 | const defaultFieldsLocations = { |
| 2571 | address: ['first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'postcode', 'country', 'state', 'phone'], |
| 2572 | contact: ['email'], |
| 2573 | additional: [] |
| 2574 | }; |
| 2575 | const ADDRESS_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).address; |
| 2576 | const CONTACT_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).contact; |
| 2577 | const ADDITIONAL_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).additional; |
| 2578 | |
| 2579 | /***/ }), |
| 2580 | |
| 2581 | /***/ "./assets/js/settings/blocks/feature-flags.ts": |
| 2582 | /*!****************************************************!*\ |
| 2583 | !*** ./assets/js/settings/blocks/feature-flags.ts ***! |
| 2584 | \****************************************************/ |
| 2585 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2586 | |
| 2587 | "use strict"; |
| 2588 | __webpack_require__.r(__webpack_exports__); |
| 2589 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2590 | /* harmony export */ isExperimentalBuild: () => (/* binding */ isExperimentalBuild), |
| 2591 | /* harmony export */ isFeaturePluginBuild: () => (/* binding */ isFeaturePluginBuild), |
| 2592 | /* harmony export */ registerExperimentalBlockType: () => (/* binding */ registerExperimentalBlockType), |
| 2593 | /* harmony export */ registerFeaturePluginBlockType: () => (/* binding */ registerFeaturePluginBlockType) |
| 2594 | /* harmony export */ }); |
| 2595 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| 2596 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| 2597 | /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./assets/js/settings/blocks/constants.ts"); |
| 2598 | /** |
| 2599 | * External dependencies |
| 2600 | */ |
| 2601 | |
| 2602 | /** |
| 2603 | * Internal dependencies |
| 2604 | */ |
| 2605 | |
| 2606 | |
| 2607 | /** |
| 2608 | * Registers a new experimental block provided a unique name and an object defining its |
| 2609 | * behavior. Once registered, the block is made available as an option to any |
| 2610 | * editor interface where blocks are implemented. |
| 2611 | */ |
| 2612 | const registerExperimentalBlockType = (blockNameOrMetadata, settings) => { |
| 2613 | if (_constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 2) { |
| 2614 | return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(blockNameOrMetadata, settings); |
| 2615 | } |
| 2616 | }; |
| 2617 | |
| 2618 | /** |
| 2619 | * Registers a new feature plugin block provided a unique name and an object |
| 2620 | * defining its behavior. Once registered, the block is made available as an |
| 2621 | * option to any editor interface where blocks are implemented. |
| 2622 | */ |
| 2623 | const registerFeaturePluginBlockType = (blockNameOrMetadata, settings) => { |
| 2624 | if (_constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 1) { |
| 2625 | return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(blockNameOrMetadata, settings); |
| 2626 | } |
| 2627 | }; |
| 2628 | |
| 2629 | /** |
| 2630 | * Checks if we're executing the code in an experimental build mode. |
| 2631 | * |
| 2632 | * @return {boolean} True if this is an experimental build, false otherwise. |
| 2633 | */ |
| 2634 | const isExperimentalBuild = () => _constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 2; |
| 2635 | |
| 2636 | /** |
| 2637 | * Checks if we're executing the code in an feature plugin or experimental build mode. |
| 2638 | * |
| 2639 | * @return {boolean} True if this is an experimental or feature plugin build, false otherwise. |
| 2640 | */ |
| 2641 | const isFeaturePluginBuild = () => _constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 1; |
| 2642 | |
| 2643 | /***/ }), |
| 2644 | |
| 2645 | /***/ "./assets/js/settings/blocks/index.ts": |
| 2646 | /*!********************************************!*\ |
| 2647 | !*** ./assets/js/settings/blocks/index.ts ***! |
| 2648 | \********************************************/ |
| 2649 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2650 | |
| 2651 | "use strict"; |
| 2652 | __webpack_require__.r(__webpack_exports__); |
| 2653 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2654 | /* harmony export */ ADDITIONAL_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ADDITIONAL_FIELDS_KEYS), |
| 2655 | /* harmony export */ ADDRESS_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ADDRESS_FIELDS_KEYS), |
| 2656 | /* harmony export */ ALLOWED_COUNTRIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ALLOWED_COUNTRIES), |
| 2657 | /* harmony export */ ALLOWED_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ALLOWED_STATES), |
| 2658 | /* harmony export */ CART_PAGE_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CART_PAGE_ID), |
| 2659 | /* harmony export */ CART_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CART_URL), |
| 2660 | /* harmony export */ CHECKOUT_PAGE_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CHECKOUT_PAGE_ID), |
| 2661 | /* harmony export */ CHECKOUT_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CHECKOUT_URL), |
| 2662 | /* harmony export */ CONTACT_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CONTACT_FIELDS_KEYS), |
| 2663 | /* harmony export */ COUNTRY_LOCALE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.COUNTRY_LOCALE), |
| 2664 | /* harmony export */ LOCAL_PICKUP_ENABLED: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.LOCAL_PICKUP_ENABLED), |
| 2665 | /* harmony export */ LOGIN_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.LOGIN_URL), |
| 2666 | /* harmony export */ PRIVACY_PAGE_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PRIVACY_PAGE_NAME), |
| 2667 | /* harmony export */ PRIVACY_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PRIVACY_URL), |
| 2668 | /* harmony export */ SHIPPING_COUNTRIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHIPPING_COUNTRIES), |
| 2669 | /* harmony export */ SHIPPING_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHIPPING_STATES), |
| 2670 | /* harmony export */ SHOP_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHOP_URL), |
| 2671 | /* harmony export */ TERMS_PAGE_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.TERMS_PAGE_NAME), |
| 2672 | /* harmony export */ TERMS_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.TERMS_URL), |
| 2673 | /* harmony export */ WC_BLOCKS_BUILD_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_BUILD_URL), |
| 2674 | /* harmony export */ WC_BLOCKS_IMAGE_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL), |
| 2675 | /* harmony export */ WC_BLOCKS_PHASE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_PHASE), |
| 2676 | /* harmony export */ blocksConfig: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.blocksConfig), |
| 2677 | /* harmony export */ isExperimentalBuild: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.isExperimentalBuild), |
| 2678 | /* harmony export */ isFeaturePluginBuild: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.isFeaturePluginBuild), |
| 2679 | /* harmony export */ registerExperimentalBlockType: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.registerExperimentalBlockType), |
| 2680 | /* harmony export */ registerFeaturePluginBlockType: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.registerFeaturePluginBlockType) |
| 2681 | /* harmony export */ }); |
| 2682 | /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/settings/blocks/constants.ts"); |
| 2683 | /* harmony import */ var _feature_flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./feature-flags */ "./assets/js/settings/blocks/feature-flags.ts"); |
| 2684 | /** |
| 2685 | * Internal dependencies |
| 2686 | */ |
| 2687 | |
| 2688 | |
| 2689 | |
| 2690 | /***/ }), |
| 2691 | |
| 2692 | /***/ "./assets/js/utils/array-operations.ts": |
| 2693 | /*!*********************************************!*\ |
| 2694 | !*** ./assets/js/utils/array-operations.ts ***! |
| 2695 | \*********************************************/ |
| 2696 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2697 | |
| 2698 | "use strict"; |
| 2699 | __webpack_require__.r(__webpack_exports__); |
| 2700 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2701 | /* harmony export */ arrayDifferenceBy: () => (/* binding */ arrayDifferenceBy), |
| 2702 | /* harmony export */ arrayUnionBy: () => (/* binding */ arrayUnionBy) |
| 2703 | /* harmony export */ }); |
| 2704 | /** |
| 2705 | * Returns the difference between two arrays (A - B) |
| 2706 | */ |
| 2707 | function arrayDifferenceBy(a, b, key) { |
| 2708 | const keys = new Set(b.map(item => item[key])); |
| 2709 | return a.filter(item => !keys.has(item[key])); |
| 2710 | } |
| 2711 | |
| 2712 | /** |
| 2713 | * Returns the union of two arrays (A ∪ B) |
| 2714 | */ |
| 2715 | function arrayUnionBy(a, b, key) { |
| 2716 | const difference = arrayDifferenceBy(b, a, key); |
| 2717 | return [...a, ...difference]; |
| 2718 | } |
| 2719 | |
| 2720 | /***/ }), |
| 2721 | |
| 2722 | /***/ "./assets/js/blocks/handpicked-products/editor.scss": |
| 2723 | /*!**********************************************************!*\ |
| 2724 | !*** ./assets/js/blocks/handpicked-products/editor.scss ***! |
| 2725 | \**********************************************************/ |
| 2726 | /***/ (() => { |
| 2727 | |
| 2728 | |
| 2729 | |
| 2730 | /***/ }), |
| 2731 | |
| 2732 | /***/ "./assets/js/editor-components/search-list-control/style.scss": |
| 2733 | /*!********************************************************************!*\ |
| 2734 | !*** ./assets/js/editor-components/search-list-control/style.scss ***! |
| 2735 | \********************************************************************/ |
| 2736 | /***/ (() => { |
| 2737 | |
| 2738 | |
| 2739 | |
| 2740 | /***/ }), |
| 2741 | |
| 2742 | /***/ "./assets/js/editor-components/tag/editor.scss": |
| 2743 | /*!*****************************************************!*\ |
| 2744 | !*** ./assets/js/editor-components/tag/editor.scss ***! |
| 2745 | \*****************************************************/ |
| 2746 | /***/ (() => { |
| 2747 | |
| 2748 | |
| 2749 | |
| 2750 | /***/ }), |
| 2751 | |
| 2752 | /***/ "react": |
| 2753 | /*!************************!*\ |
| 2754 | !*** external "React" ***! |
| 2755 | \************************/ |
| 2756 | /***/ ((module) => { |
| 2757 | |
| 2758 | "use strict"; |
| 2759 | module.exports = window["React"]; |
| 2760 | |
| 2761 | /***/ }), |
| 2762 | |
| 2763 | /***/ "@woocommerce/settings": |
| 2764 | /*!************************************!*\ |
| 2765 | !*** external ["wc","wcSettings"] ***! |
| 2766 | \************************************/ |
| 2767 | /***/ ((module) => { |
| 2768 | |
| 2769 | "use strict"; |
| 2770 | module.exports = window["wc"]["wcSettings"]; |
| 2771 | |
| 2772 | /***/ }), |
| 2773 | |
| 2774 | /***/ "@wordpress/api-fetch": |
| 2775 | /*!**********************************!*\ |
| 2776 | !*** external ["wp","apiFetch"] ***! |
| 2777 | \**********************************/ |
| 2778 | /***/ ((module) => { |
| 2779 | |
| 2780 | "use strict"; |
| 2781 | module.exports = window["wp"]["apiFetch"]; |
| 2782 | |
| 2783 | /***/ }), |
| 2784 | |
| 2785 | /***/ "@wordpress/block-editor": |
| 2786 | /*!*************************************!*\ |
| 2787 | !*** external ["wp","blockEditor"] ***! |
| 2788 | \*************************************/ |
| 2789 | /***/ ((module) => { |
| 2790 | |
| 2791 | "use strict"; |
| 2792 | module.exports = window["wp"]["blockEditor"]; |
| 2793 | |
| 2794 | /***/ }), |
| 2795 | |
| 2796 | /***/ "@wordpress/blocks": |
| 2797 | /*!********************************!*\ |
| 2798 | !*** external ["wp","blocks"] ***! |
| 2799 | \********************************/ |
| 2800 | /***/ ((module) => { |
| 2801 | |
| 2802 | "use strict"; |
| 2803 | module.exports = window["wp"]["blocks"]; |
| 2804 | |
| 2805 | /***/ }), |
| 2806 | |
| 2807 | /***/ "@wordpress/components": |
| 2808 | /*!************************************!*\ |
| 2809 | !*** external ["wp","components"] ***! |
| 2810 | \************************************/ |
| 2811 | /***/ ((module) => { |
| 2812 | |
| 2813 | "use strict"; |
| 2814 | module.exports = window["wp"]["components"]; |
| 2815 | |
| 2816 | /***/ }), |
| 2817 | |
| 2818 | /***/ "@wordpress/compose": |
| 2819 | /*!*********************************!*\ |
| 2820 | !*** external ["wp","compose"] ***! |
| 2821 | \*********************************/ |
| 2822 | /***/ ((module) => { |
| 2823 | |
| 2824 | "use strict"; |
| 2825 | module.exports = window["wp"]["compose"]; |
| 2826 | |
| 2827 | /***/ }), |
| 2828 | |
| 2829 | /***/ "@wordpress/element": |
| 2830 | /*!*********************************!*\ |
| 2831 | !*** external ["wp","element"] ***! |
| 2832 | \*********************************/ |
| 2833 | /***/ ((module) => { |
| 2834 | |
| 2835 | "use strict"; |
| 2836 | module.exports = window["wp"]["element"]; |
| 2837 | |
| 2838 | /***/ }), |
| 2839 | |
| 2840 | /***/ "@wordpress/escape-html": |
| 2841 | /*!************************************!*\ |
| 2842 | !*** external ["wp","escapeHtml"] ***! |
| 2843 | \************************************/ |
| 2844 | /***/ ((module) => { |
| 2845 | |
| 2846 | "use strict"; |
| 2847 | module.exports = window["wp"]["escapeHtml"]; |
| 2848 | |
| 2849 | /***/ }), |
| 2850 | |
| 2851 | /***/ "@wordpress/html-entities": |
| 2852 | /*!**************************************!*\ |
| 2853 | !*** external ["wp","htmlEntities"] ***! |
| 2854 | \**************************************/ |
| 2855 | /***/ ((module) => { |
| 2856 | |
| 2857 | "use strict"; |
| 2858 | module.exports = window["wp"]["htmlEntities"]; |
| 2859 | |
| 2860 | /***/ }), |
| 2861 | |
| 2862 | /***/ "@wordpress/i18n": |
| 2863 | /*!******************************!*\ |
| 2864 | !*** external ["wp","i18n"] ***! |
| 2865 | \******************************/ |
| 2866 | /***/ ((module) => { |
| 2867 | |
| 2868 | "use strict"; |
| 2869 | module.exports = window["wp"]["i18n"]; |
| 2870 | |
| 2871 | /***/ }), |
| 2872 | |
| 2873 | /***/ "@wordpress/primitives": |
| 2874 | /*!************************************!*\ |
| 2875 | !*** external ["wp","primitives"] ***! |
| 2876 | \************************************/ |
| 2877 | /***/ ((module) => { |
| 2878 | |
| 2879 | "use strict"; |
| 2880 | module.exports = window["wp"]["primitives"]; |
| 2881 | |
| 2882 | /***/ }), |
| 2883 | |
| 2884 | /***/ "@wordpress/server-side-render": |
| 2885 | /*!******************************************!*\ |
| 2886 | !*** external ["wp","serverSideRender"] ***! |
| 2887 | \******************************************/ |
| 2888 | /***/ ((module) => { |
| 2889 | |
| 2890 | "use strict"; |
| 2891 | module.exports = window["wp"]["serverSideRender"]; |
| 2892 | |
| 2893 | /***/ }), |
| 2894 | |
| 2895 | /***/ "@wordpress/url": |
| 2896 | /*!*****************************!*\ |
| 2897 | !*** external ["wp","url"] ***! |
| 2898 | \*****************************/ |
| 2899 | /***/ ((module) => { |
| 2900 | |
| 2901 | "use strict"; |
| 2902 | module.exports = window["wp"]["url"]; |
| 2903 | |
| 2904 | /***/ }), |
| 2905 | |
| 2906 | /***/ "./assets/js/blocks/handpicked-products/block.json": |
| 2907 | /*!*********************************************************!*\ |
| 2908 | !*** ./assets/js/blocks/handpicked-products/block.json ***! |
| 2909 | \*********************************************************/ |
| 2910 | /***/ ((module) => { |
| 2911 | |
| 2912 | "use strict"; |
| 2913 | module.exports = JSON.parse('{"name":"woocommerce/handpicked-products","title":"Hand-picked Products","category":"woocommerce","keywords":["Handpicked Products","WooCommerce"],"description":"Display a selection of hand-picked products in a grid.","supports":{"align":["wide","full"],"html":false},"attributes":{"align":{"type":"string"},"columns":{"type":"number","default":3},"contentVisibility":{"type":"object","default":{"image":true,"title":true,"price":true,"rating":true,"button":true},"properties":{"image":{"type":"boolean","image":true},"title":{"type":"boolean","title":true},"price":{"type":"boolean","price":true},"rating":{"type":"boolean","rating":true},"button":{"type":"boolean","button":true}}},"orderby":{"type":"string","enum":["date","popularity","price_asc","price_desc","rating","title","menu_order"],"default":"date"},"products":{"type":"array","default":[]},"alignButtons":{"type":"boolean","default":false},"isPreview":{"type":"boolean","default":false}},"textdomain":"woocommerce","apiVersion":2,"$schema":"https://schemas.wp.org/trunk/block.json"}'); |
| 2914 | |
| 2915 | /***/ }) |
| 2916 | |
| 2917 | /******/ }); |
| 2918 | /************************************************************************/ |
| 2919 | /******/ // The module cache |
| 2920 | /******/ var __webpack_module_cache__ = {}; |
| 2921 | /******/ |
| 2922 | /******/ // The require function |
| 2923 | /******/ function __webpack_require__(moduleId) { |
| 2924 | /******/ // Check if module is in cache |
| 2925 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 2926 | /******/ if (cachedModule !== undefined) { |
| 2927 | /******/ return cachedModule.exports; |
| 2928 | /******/ } |
| 2929 | /******/ // Create a new module (and put it into the cache) |
| 2930 | /******/ var module = __webpack_module_cache__[moduleId] = { |
| 2931 | /******/ // no module.id needed |
| 2932 | /******/ // no module.loaded needed |
| 2933 | /******/ exports: {} |
| 2934 | /******/ }; |
| 2935 | /******/ |
| 2936 | /******/ // Execute the module function |
| 2937 | /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); |
| 2938 | /******/ |
| 2939 | /******/ // Return the exports of the module |
| 2940 | /******/ return module.exports; |
| 2941 | /******/ } |
| 2942 | /******/ |
| 2943 | /******/ // expose the modules object (__webpack_modules__) |
| 2944 | /******/ __webpack_require__.m = __webpack_modules__; |
| 2945 | /******/ |
| 2946 | /************************************************************************/ |
| 2947 | /******/ /* webpack/runtime/chunk loaded */ |
| 2948 | /******/ (() => { |
| 2949 | /******/ var deferred = []; |
| 2950 | /******/ __webpack_require__.O = (result, chunkIds, fn, priority) => { |
| 2951 | /******/ if(chunkIds) { |
| 2952 | /******/ priority = priority || 0; |
| 2953 | /******/ for(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1]; |
| 2954 | /******/ deferred[i] = [chunkIds, fn, priority]; |
| 2955 | /******/ return; |
| 2956 | /******/ } |
| 2957 | /******/ var notFulfilled = Infinity; |
| 2958 | /******/ for (var i = 0; i < deferred.length; i++) { |
| 2959 | /******/ var [chunkIds, fn, priority] = deferred[i]; |
| 2960 | /******/ var fulfilled = true; |
| 2961 | /******/ for (var j = 0; j < chunkIds.length; j++) { |
| 2962 | /******/ if ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) { |
| 2963 | /******/ chunkIds.splice(j--, 1); |
| 2964 | /******/ } else { |
| 2965 | /******/ fulfilled = false; |
| 2966 | /******/ if(priority < notFulfilled) notFulfilled = priority; |
| 2967 | /******/ } |
| 2968 | /******/ } |
| 2969 | /******/ if(fulfilled) { |
| 2970 | /******/ deferred.splice(i--, 1) |
| 2971 | /******/ var r = fn(); |
| 2972 | /******/ if (r !== undefined) result = r; |
| 2973 | /******/ } |
| 2974 | /******/ } |
| 2975 | /******/ return result; |
| 2976 | /******/ }; |
| 2977 | /******/ })(); |
| 2978 | /******/ |
| 2979 | /******/ /* webpack/runtime/compat get default export */ |
| 2980 | /******/ (() => { |
| 2981 | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| 2982 | /******/ __webpack_require__.n = (module) => { |
| 2983 | /******/ var getter = module && module.__esModule ? |
| 2984 | /******/ () => (module['default']) : |
| 2985 | /******/ () => (module); |
| 2986 | /******/ __webpack_require__.d(getter, { a: getter }); |
| 2987 | /******/ return getter; |
| 2988 | /******/ }; |
| 2989 | /******/ })(); |
| 2990 | /******/ |
| 2991 | /******/ /* webpack/runtime/define property getters */ |
| 2992 | /******/ (() => { |
| 2993 | /******/ // define getter functions for harmony exports |
| 2994 | /******/ __webpack_require__.d = (exports, definition) => { |
| 2995 | /******/ for(var key in definition) { |
| 2996 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 2997 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 2998 | /******/ } |
| 2999 | /******/ } |
| 3000 | /******/ }; |
| 3001 | /******/ })(); |
| 3002 | /******/ |
| 3003 | /******/ /* webpack/runtime/global */ |
| 3004 | /******/ (() => { |
| 3005 | /******/ __webpack_require__.g = (function() { |
| 3006 | /******/ if (typeof globalThis === 'object') return globalThis; |
| 3007 | /******/ try { |
| 3008 | /******/ return this || new Function('return this')(); |
| 3009 | /******/ } catch (e) { |
| 3010 | /******/ if (typeof window === 'object') return window; |
| 3011 | /******/ } |
| 3012 | /******/ })(); |
| 3013 | /******/ })(); |
| 3014 | /******/ |
| 3015 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 3016 | /******/ (() => { |
| 3017 | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 3018 | /******/ })(); |
| 3019 | /******/ |
| 3020 | /******/ /* webpack/runtime/make namespace object */ |
| 3021 | /******/ (() => { |
| 3022 | /******/ // define __esModule on exports |
| 3023 | /******/ __webpack_require__.r = (exports) => { |
| 3024 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 3025 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 3026 | /******/ } |
| 3027 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 3028 | /******/ }; |
| 3029 | /******/ })(); |
| 3030 | /******/ |
| 3031 | /******/ /* webpack/runtime/jsonp chunk loading */ |
| 3032 | /******/ (() => { |
| 3033 | /******/ // no baseURI |
| 3034 | /******/ |
| 3035 | /******/ // object to store loaded and loading chunks |
| 3036 | /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched |
| 3037 | /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded |
| 3038 | /******/ var installedChunks = { |
| 3039 | /******/ "handpicked-products": 0 |
| 3040 | /******/ }; |
| 3041 | /******/ |
| 3042 | /******/ // no chunk on demand loading |
| 3043 | /******/ |
| 3044 | /******/ // no prefetching |
| 3045 | /******/ |
| 3046 | /******/ // no preloaded |
| 3047 | /******/ |
| 3048 | /******/ // no HMR |
| 3049 | /******/ |
| 3050 | /******/ // no HMR manifest |
| 3051 | /******/ |
| 3052 | /******/ __webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0); |
| 3053 | /******/ |
| 3054 | /******/ // install a JSONP callback for chunk loading |
| 3055 | /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { |
| 3056 | /******/ var [chunkIds, moreModules, runtime] = data; |
| 3057 | /******/ // add "moreModules" to the modules object, |
| 3058 | /******/ // then flag all "chunkIds" as loaded and fire callback |
| 3059 | /******/ var moduleId, chunkId, i = 0; |
| 3060 | /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { |
| 3061 | /******/ for(moduleId in moreModules) { |
| 3062 | /******/ if(__webpack_require__.o(moreModules, moduleId)) { |
| 3063 | /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; |
| 3064 | /******/ } |
| 3065 | /******/ } |
| 3066 | /******/ if(runtime) var result = runtime(__webpack_require__); |
| 3067 | /******/ } |
| 3068 | /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); |
| 3069 | /******/ for(;i < chunkIds.length; i++) { |
| 3070 | /******/ chunkId = chunkIds[i]; |
| 3071 | /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { |
| 3072 | /******/ installedChunks[chunkId][0](); |
| 3073 | /******/ } |
| 3074 | /******/ installedChunks[chunkId] = 0; |
| 3075 | /******/ } |
| 3076 | /******/ return __webpack_require__.O(result); |
| 3077 | /******/ } |
| 3078 | /******/ |
| 3079 | /******/ var chunkLoadingGlobal = self["webpackChunkwebpackWcBlocksJsonp"] = self["webpackChunkwebpackWcBlocksJsonp"] || []; |
| 3080 | /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); |
| 3081 | /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); |
| 3082 | /******/ })(); |
| 3083 | /******/ |
| 3084 | /************************************************************************/ |
| 3085 | /******/ |
| 3086 | /******/ // startup |
| 3087 | /******/ // Load entry module and return exports |
| 3088 | /******/ // This entry module depends on other loaded chunks and execution need to be delayed |
| 3089 | /******/ var __webpack_exports__ = __webpack_require__.O(undefined, ["wc-blocks-vendors"], () => (__webpack_require__("./assets/js/blocks/handpicked-products/index.tsx"))) |
| 3090 | /******/ __webpack_exports__ = __webpack_require__.O(__webpack_exports__); |
| 3091 | /******/ ((this.wc = this.wc || {}).blocks = this.wc.blocks || {})["handpicked-products"] = __webpack_exports__; |
| 3092 | /******/ |
| 3093 | /******/ })() |
| 3094 | ; |
| 3095 | //# sourceMappingURL=handpicked-products.js.map |