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
reviews-frontend.js
4025 lines
| 1 | /******/ (() => { // webpackBootstrap |
| 2 | /******/ var __webpack_modules__ = ({ |
| 3 | |
| 4 | /***/ "./assets/js/base/components/block-error-boundary/block-error.tsx": |
| 5 | /*!************************************************************************!*\ |
| 6 | !*** ./assets/js/base/components/block-error-boundary/block-error.tsx ***! |
| 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 */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 14 | /* harmony export */ }); |
| 15 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 16 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 17 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 18 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 19 | /* harmony import */ var _woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/block-settings */ "./assets/js/settings/blocks/index.ts"); |
| 20 | |
| 21 | /** |
| 22 | * External dependencies |
| 23 | */ |
| 24 | |
| 25 | |
| 26 | |
| 27 | /** |
| 28 | * Internal dependencies |
| 29 | */ |
| 30 | |
| 31 | const BlockError = ({ |
| 32 | imageUrl = `${_woocommerce_block_settings__WEBPACK_IMPORTED_MODULE_2__.WC_BLOCKS_IMAGE_URL}/block-error.svg`, |
| 33 | header = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Oops!', 'woocommerce'), |
| 34 | text = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('There was an error loading the content.', 'woocommerce'), |
| 35 | errorMessage, |
| 36 | errorMessagePrefix = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error:', 'woocommerce'), |
| 37 | button, |
| 38 | showErrorBlock = true |
| 39 | }) => { |
| 40 | return showErrorBlock ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 41 | className: "wc-block-error wc-block-components-error" |
| 42 | }, imageUrl && |
| 43 | // The alt text is left empty on purpose, as it's considered a decorative image. |
| 44 | // More can be found here: https://www.w3.org/WAI/tutorials/images/decorative/. |
| 45 | // Github discussion for a context: https://github.com/woocommerce/woocommerce-blocks/pull/7651#discussion_r1019560494. |
| 46 | (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { |
| 47 | className: "wc-block-error__image wc-block-components-error__image", |
| 48 | src: imageUrl, |
| 49 | alt: "" |
| 50 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 51 | className: "wc-block-error__content wc-block-components-error__content" |
| 52 | }, header && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { |
| 53 | className: "wc-block-error__header wc-block-components-error__header" |
| 54 | }, header), text && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { |
| 55 | className: "wc-block-error__text wc-block-components-error__text" |
| 56 | }, text), errorMessage && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { |
| 57 | className: "wc-block-error__message wc-block-components-error__message" |
| 58 | }, errorMessagePrefix ? errorMessagePrefix + ' ' : '', errorMessage), button && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("p", { |
| 59 | className: "wc-block-error__button wc-block-components-error__button" |
| 60 | }, button))) : null; |
| 61 | }; |
| 62 | BlockError.__docgenInfo = { |
| 63 | "description": "", |
| 64 | "methods": [], |
| 65 | "displayName": "BlockError", |
| 66 | "props": { |
| 67 | "imageUrl": { |
| 68 | "defaultValue": { |
| 69 | "value": "`${ WC_BLOCKS_IMAGE_URL }/block-error.svg`", |
| 70 | "computed": false |
| 71 | }, |
| 72 | "required": false |
| 73 | }, |
| 74 | "header": { |
| 75 | "defaultValue": { |
| 76 | "value": "__( 'Oops!', 'woocommerce' )", |
| 77 | "computed": true |
| 78 | }, |
| 79 | "required": false |
| 80 | }, |
| 81 | "text": { |
| 82 | "defaultValue": { |
| 83 | "value": "__( 'There was an error loading the content.', 'woocommerce' )", |
| 84 | "computed": true |
| 85 | }, |
| 86 | "required": false |
| 87 | }, |
| 88 | "errorMessagePrefix": { |
| 89 | "defaultValue": { |
| 90 | "value": "__( 'Error:', 'woocommerce' )", |
| 91 | "computed": true |
| 92 | }, |
| 93 | "required": false |
| 94 | }, |
| 95 | "showErrorBlock": { |
| 96 | "defaultValue": { |
| 97 | "value": "true", |
| 98 | "computed": false |
| 99 | }, |
| 100 | "required": false |
| 101 | } |
| 102 | } |
| 103 | }; |
| 104 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockError); |
| 105 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 106 | STORYBOOK_REACT_CLASSES["assets/js/base/components/block-error-boundary/block-error.tsx"] = { |
| 107 | name: "BlockError", |
| 108 | docgenInfo: BlockError.__docgenInfo, |
| 109 | path: "assets/js/base/components/block-error-boundary/block-error.tsx" |
| 110 | }; |
| 111 | } |
| 112 | |
| 113 | /***/ }), |
| 114 | |
| 115 | /***/ "./assets/js/base/components/block-error-boundary/index.tsx": |
| 116 | /*!******************************************************************!*\ |
| 117 | !*** ./assets/js/base/components/block-error-boundary/index.tsx ***! |
| 118 | \******************************************************************/ |
| 119 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 120 | |
| 121 | "use strict"; |
| 122 | __webpack_require__.r(__webpack_exports__); |
| 123 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 124 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 125 | /* harmony export */ }); |
| 126 | /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js"); |
| 127 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 128 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 129 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 130 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
| 131 | /* harmony import */ var _block_error__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./block-error */ "./assets/js/base/components/block-error-boundary/block-error.tsx"); |
| 132 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/block-error-boundary/style.scss"); |
| 133 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_4__); |
| 134 | |
| 135 | |
| 136 | /** |
| 137 | * External dependencies |
| 138 | */ |
| 139 | |
| 140 | |
| 141 | /** |
| 142 | * Internal dependencies |
| 143 | */ |
| 144 | |
| 145 | |
| 146 | class BlockErrorBoundary extends _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Component { |
| 147 | constructor(...args) { |
| 148 | super(...args); |
| 149 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "state", { |
| 150 | errorMessage: '', |
| 151 | hasError: false |
| 152 | }); |
| 153 | } |
| 154 | static getDerivedStateFromError(error) { |
| 155 | if (typeof error.statusText !== 'undefined' && typeof error.status !== 'undefined') { |
| 156 | return { |
| 157 | errorMessage: (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(react__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("strong", null, error.status), ":\xA0", error.statusText), |
| 158 | hasError: true |
| 159 | }; |
| 160 | } |
| 161 | return { |
| 162 | errorMessage: error.message, |
| 163 | hasError: true |
| 164 | }; |
| 165 | } |
| 166 | render() { |
| 167 | const { |
| 168 | header, |
| 169 | imageUrl, |
| 170 | showErrorMessage = true, |
| 171 | showErrorBlock = true, |
| 172 | text, |
| 173 | errorMessagePrefix, |
| 174 | renderError, |
| 175 | button |
| 176 | } = this.props; |
| 177 | const { |
| 178 | errorMessage, |
| 179 | hasError |
| 180 | } = this.state; |
| 181 | if (hasError) { |
| 182 | if (typeof renderError === 'function') { |
| 183 | return renderError({ |
| 184 | errorMessage |
| 185 | }); |
| 186 | } |
| 187 | return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_block_error__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 188 | showErrorBlock: showErrorBlock, |
| 189 | errorMessage: showErrorMessage ? errorMessage : null, |
| 190 | header: header, |
| 191 | imageUrl: imageUrl, |
| 192 | text: text, |
| 193 | errorMessagePrefix: errorMessagePrefix, |
| 194 | button: button |
| 195 | }); |
| 196 | } |
| 197 | return this.props.children; |
| 198 | } |
| 199 | } |
| 200 | BlockErrorBoundary.__docgenInfo = { |
| 201 | "description": "", |
| 202 | "methods": [], |
| 203 | "displayName": "BlockErrorBoundary" |
| 204 | }; |
| 205 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BlockErrorBoundary); |
| 206 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 207 | STORYBOOK_REACT_CLASSES["assets/js/base/components/block-error-boundary/index.tsx"] = { |
| 208 | name: "BlockErrorBoundary", |
| 209 | docgenInfo: BlockErrorBoundary.__docgenInfo, |
| 210 | path: "assets/js/base/components/block-error-boundary/index.tsx" |
| 211 | }; |
| 212 | } |
| 213 | |
| 214 | /***/ }), |
| 215 | |
| 216 | /***/ "./assets/js/base/components/load-more-button/index.tsx": |
| 217 | /*!**************************************************************!*\ |
| 218 | !*** ./assets/js/base/components/load-more-button/index.tsx ***! |
| 219 | \**************************************************************/ |
| 220 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 221 | |
| 222 | "use strict"; |
| 223 | __webpack_require__.r(__webpack_exports__); |
| 224 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 225 | /* harmony export */ LoadMoreButton: () => (/* binding */ LoadMoreButton), |
| 226 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 227 | /* harmony export */ }); |
| 228 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 229 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 230 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 231 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 232 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/load-more-button/style.scss"); |
| 233 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_2__); |
| 234 | /* harmony import */ var _packages_components_label__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../../packages/components/label */ "./packages/components/label/index.tsx"); |
| 235 | |
| 236 | /** |
| 237 | * External dependencies |
| 238 | */ |
| 239 | |
| 240 | /** |
| 241 | * Internal dependencies |
| 242 | */ |
| 243 | |
| 244 | // Imported like this because importing from the components package loads the data stores unnecessarily - not a problem in the front end but would require a lot of unit test rewrites to prevent breaking tests due to incorrect mocks. |
| 245 | |
| 246 | const LoadMoreButton = ({ |
| 247 | onClick, |
| 248 | label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Load more', 'woocommerce'), |
| 249 | screenReaderLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Load more', 'woocommerce') |
| 250 | }) => { |
| 251 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 252 | className: "wp-block-button wc-block-load-more wc-block-components-load-more" |
| 253 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("button", { |
| 254 | className: "wp-block-button__link", |
| 255 | onClick: onClick |
| 256 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_packages_components_label__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 257 | label: label, |
| 258 | screenReaderLabel: screenReaderLabel |
| 259 | }))); |
| 260 | }; |
| 261 | LoadMoreButton.__docgenInfo = { |
| 262 | "description": "", |
| 263 | "methods": [], |
| 264 | "displayName": "LoadMoreButton", |
| 265 | "props": { |
| 266 | "label": { |
| 267 | "defaultValue": { |
| 268 | "value": "__( 'Load more', 'woocommerce' )", |
| 269 | "computed": true |
| 270 | }, |
| 271 | "required": false, |
| 272 | "tsType": { |
| 273 | "name": "string" |
| 274 | }, |
| 275 | "description": "" |
| 276 | }, |
| 277 | "screenReaderLabel": { |
| 278 | "defaultValue": { |
| 279 | "value": "__( 'Load more', 'woocommerce' )", |
| 280 | "computed": true |
| 281 | }, |
| 282 | "required": false, |
| 283 | "tsType": { |
| 284 | "name": "string" |
| 285 | }, |
| 286 | "description": "" |
| 287 | }, |
| 288 | "onClick": { |
| 289 | "required": true, |
| 290 | "tsType": { |
| 291 | "name": "MouseEventHandler" |
| 292 | }, |
| 293 | "description": "" |
| 294 | } |
| 295 | } |
| 296 | }; |
| 297 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LoadMoreButton); |
| 298 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 299 | STORYBOOK_REACT_CLASSES["assets/js/base/components/load-more-button/index.tsx"] = { |
| 300 | name: "LoadMoreButton", |
| 301 | docgenInfo: LoadMoreButton.__docgenInfo, |
| 302 | path: "assets/js/base/components/load-more-button/index.tsx" |
| 303 | }; |
| 304 | } |
| 305 | |
| 306 | /***/ }), |
| 307 | |
| 308 | /***/ "./assets/js/base/components/read-more/index.tsx": |
| 309 | /*!*******************************************************!*\ |
| 310 | !*** ./assets/js/base/components/read-more/index.tsx ***! |
| 311 | \*******************************************************/ |
| 312 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 313 | |
| 314 | "use strict"; |
| 315 | __webpack_require__.r(__webpack_exports__); |
| 316 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 317 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), |
| 318 | /* harmony export */ defaultProps: () => (/* binding */ defaultProps) |
| 319 | /* harmony export */ }); |
| 320 | /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js"); |
| 321 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 322 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 323 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 324 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
| 325 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 326 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__); |
| 327 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./assets/js/base/components/read-more/utils.ts"); |
| 328 | |
| 329 | |
| 330 | /** |
| 331 | * External dependencies |
| 332 | */ |
| 333 | |
| 334 | |
| 335 | /** |
| 336 | * Internal dependencies |
| 337 | */ |
| 338 | |
| 339 | const defaultProps = { |
| 340 | className: 'read-more-content', |
| 341 | ellipsis: '…', |
| 342 | lessText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Read less', 'woocommerce'), |
| 343 | maxLines: 3, |
| 344 | moreText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Read more', 'woocommerce') |
| 345 | }; |
| 346 | |
| 347 | /** |
| 348 | * Show text based content, limited to a number of lines, with a read more link. |
| 349 | * |
| 350 | * Based on https://github.com/zoltantothcom/react-clamp-lines. |
| 351 | */ |
| 352 | class ReadMore extends _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Component { |
| 353 | constructor(props) { |
| 354 | super(props); |
| 355 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "reviewSummary", void 0); |
| 356 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "reviewContent", void 0); |
| 357 | this.state = { |
| 358 | /** |
| 359 | * This is true when read more has been pressed and the full review is shown. |
| 360 | */ |
| 361 | isExpanded: false, |
| 362 | /** |
| 363 | * True if we are clamping content. False if the review is short. Null during init. |
| 364 | */ |
| 365 | clampEnabled: null, |
| 366 | /** |
| 367 | * Content is passed in via children. |
| 368 | */ |
| 369 | content: props.children, |
| 370 | /** |
| 371 | * Summary content generated from content HTML. |
| 372 | */ |
| 373 | summary: '.' |
| 374 | }; |
| 375 | this.reviewContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRef)(); |
| 376 | this.reviewSummary = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createRef)(); |
| 377 | this.getButton = this.getButton.bind(this); |
| 378 | this.onClick = this.onClick.bind(this); |
| 379 | } |
| 380 | componentDidMount() { |
| 381 | this.setSummary(); |
| 382 | } |
| 383 | componentDidUpdate(prevProps) { |
| 384 | if (prevProps.maxLines !== this.props.maxLines || prevProps.children !== this.props.children) { |
| 385 | /** |
| 386 | * if maxLines or content changed we need to reset the state to |
| 387 | * initial values so that summary can be calculated again |
| 388 | */ |
| 389 | this.setState({ |
| 390 | clampEnabled: null, |
| 391 | summary: '.' |
| 392 | }, this.setSummary); |
| 393 | } |
| 394 | } |
| 395 | setSummary() { |
| 396 | if (this.props.children) { |
| 397 | const { |
| 398 | maxLines, |
| 399 | ellipsis |
| 400 | } = this.props; |
| 401 | if (!this.reviewSummary.current || !this.reviewContent.current) { |
| 402 | return; |
| 403 | } |
| 404 | const lineHeight = this.reviewSummary.current.clientHeight + 1; |
| 405 | const reviewHeight = this.reviewContent.current.clientHeight + 1; |
| 406 | const maxHeight = lineHeight * maxLines + 1; |
| 407 | const clampEnabled = reviewHeight > maxHeight; |
| 408 | this.setState({ |
| 409 | clampEnabled |
| 410 | }); |
| 411 | if (clampEnabled) { |
| 412 | this.setState({ |
| 413 | summary: (0,_utils__WEBPACK_IMPORTED_MODULE_4__.clampLines)(this.reviewContent.current.innerHTML, this.reviewSummary.current, maxHeight, ellipsis) |
| 414 | }); |
| 415 | } |
| 416 | } |
| 417 | } |
| 418 | getButton() { |
| 419 | const { |
| 420 | isExpanded |
| 421 | } = this.state; |
| 422 | const { |
| 423 | className, |
| 424 | lessText, |
| 425 | moreText |
| 426 | } = this.props; |
| 427 | const buttonText = isExpanded ? lessText : moreText; |
| 428 | if (!buttonText) { |
| 429 | return; |
| 430 | } |
| 431 | return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("a", { |
| 432 | href: "#more", |
| 433 | className: className + '__read_more', |
| 434 | onClick: this.onClick, |
| 435 | "aria-expanded": !isExpanded, |
| 436 | role: "button" |
| 437 | }, buttonText); |
| 438 | } |
| 439 | |
| 440 | /** |
| 441 | * Handles the click event for the read more/less button. |
| 442 | */ |
| 443 | onClick(e) { |
| 444 | e.preventDefault(); |
| 445 | const { |
| 446 | isExpanded |
| 447 | } = this.state; |
| 448 | this.setState({ |
| 449 | isExpanded: !isExpanded |
| 450 | }); |
| 451 | } |
| 452 | render() { |
| 453 | const { |
| 454 | className |
| 455 | } = this.props; |
| 456 | const { |
| 457 | content, |
| 458 | summary, |
| 459 | clampEnabled, |
| 460 | isExpanded |
| 461 | } = this.state; |
| 462 | if (!content) { |
| 463 | return null; |
| 464 | } |
| 465 | if (clampEnabled === false) { |
| 466 | return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { |
| 467 | className: className |
| 468 | }, (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { |
| 469 | ref: this.reviewContent |
| 470 | }, content)); |
| 471 | } |
| 472 | return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { |
| 473 | className: className |
| 474 | }, (!isExpanded || clampEnabled === null) && (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { |
| 475 | ref: this.reviewSummary, |
| 476 | "aria-hidden": isExpanded, |
| 477 | dangerouslySetInnerHTML: { |
| 478 | __html: summary |
| 479 | } |
| 480 | }), (isExpanded || clampEnabled === null) && (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)("div", { |
| 481 | ref: this.reviewContent, |
| 482 | "aria-hidden": !isExpanded |
| 483 | }, content), this.getButton()); |
| 484 | } |
| 485 | } |
| 486 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(ReadMore, "defaultProps", defaultProps); |
| 487 | ReadMore.__docgenInfo = { |
| 488 | "description": "Show text based content, limited to a number of lines, with a read more link.\n\nBased on https://github.com/zoltantothcom/react-clamp-lines.", |
| 489 | "methods": [{ |
| 490 | "name": "setSummary", |
| 491 | "docblock": null, |
| 492 | "modifiers": [], |
| 493 | "params": [], |
| 494 | "returns": { |
| 495 | "type": { |
| 496 | "name": "void" |
| 497 | } |
| 498 | } |
| 499 | }, { |
| 500 | "name": "getButton", |
| 501 | "docblock": null, |
| 502 | "modifiers": [], |
| 503 | "params": [], |
| 504 | "returns": { |
| 505 | "type": { |
| 506 | "name": "union", |
| 507 | "raw": "JSX.Element | undefined", |
| 508 | "elements": [{ |
| 509 | "name": "JSX.Element" |
| 510 | }, { |
| 511 | "name": "undefined" |
| 512 | }] |
| 513 | } |
| 514 | } |
| 515 | }, { |
| 516 | "name": "onClick", |
| 517 | "docblock": "Handles the click event for the read more/less button.", |
| 518 | "modifiers": [], |
| 519 | "params": [{ |
| 520 | "name": "e", |
| 521 | "type": { |
| 522 | "name": "MouseEvent", |
| 523 | "elements": [{ |
| 524 | "name": "HTMLAnchorElement" |
| 525 | }, { |
| 526 | "name": "MouseEvent" |
| 527 | }], |
| 528 | "raw": "MouseEvent< HTMLAnchorElement, MouseEvent >", |
| 529 | "alias": "MouseEvent" |
| 530 | } |
| 531 | }], |
| 532 | "returns": { |
| 533 | "type": { |
| 534 | "name": "void" |
| 535 | } |
| 536 | }, |
| 537 | "description": "Handles the click event for the read more/less button." |
| 538 | }], |
| 539 | "displayName": "ReadMore", |
| 540 | "props": { |
| 541 | "className": { |
| 542 | "defaultValue": { |
| 543 | "value": "'read-more-content'", |
| 544 | "computed": false |
| 545 | }, |
| 546 | "required": false, |
| 547 | "tsType": { |
| 548 | "name": "string" |
| 549 | }, |
| 550 | "description": "Class names for the wrapped component" |
| 551 | }, |
| 552 | "ellipsis": { |
| 553 | "defaultValue": { |
| 554 | "value": "'…'", |
| 555 | "computed": false |
| 556 | }, |
| 557 | "required": false, |
| 558 | "tsType": { |
| 559 | "name": "string" |
| 560 | }, |
| 561 | "description": "What symbol to show after the allowed lines are reached\n\n@default '&hellip';" |
| 562 | }, |
| 563 | "lessText": { |
| 564 | "defaultValue": { |
| 565 | "value": "__( 'Read less', 'woocommerce' )", |
| 566 | "computed": true |
| 567 | }, |
| 568 | "required": false, |
| 569 | "tsType": { |
| 570 | "name": "string" |
| 571 | }, |
| 572 | "description": "The string to show to collapse the entire text into its clamped form\n\n@default 'Read less'" |
| 573 | }, |
| 574 | "maxLines": { |
| 575 | "defaultValue": { |
| 576 | "value": "3", |
| 577 | "computed": false |
| 578 | }, |
| 579 | "required": false, |
| 580 | "tsType": { |
| 581 | "name": "number" |
| 582 | }, |
| 583 | "description": "How many lines to show before the text is clamped\n\n@default 3" |
| 584 | }, |
| 585 | "moreText": { |
| 586 | "defaultValue": { |
| 587 | "value": "__( 'Read more', 'woocommerce' )", |
| 588 | "computed": true |
| 589 | }, |
| 590 | "required": false, |
| 591 | "tsType": { |
| 592 | "name": "string" |
| 593 | }, |
| 594 | "description": "The string to show to expande the entire text\n\n@default 'Read more'" |
| 595 | }, |
| 596 | "children": { |
| 597 | "required": true, |
| 598 | "tsType": { |
| 599 | "name": "ReactNode" |
| 600 | }, |
| 601 | "description": "The entire content to clamp" |
| 602 | } |
| 603 | } |
| 604 | }; |
| 605 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReadMore); |
| 606 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 607 | STORYBOOK_REACT_CLASSES["assets/js/base/components/read-more/index.tsx"] = { |
| 608 | name: "ReadMore", |
| 609 | docgenInfo: ReadMore.__docgenInfo, |
| 610 | path: "assets/js/base/components/read-more/index.tsx" |
| 611 | }; |
| 612 | } |
| 613 | |
| 614 | /***/ }), |
| 615 | |
| 616 | /***/ "./assets/js/base/components/read-more/trim-html.js": |
| 617 | /*!**********************************************************!*\ |
| 618 | !*** ./assets/js/base/components/read-more/trim-html.js ***! |
| 619 | \**********************************************************/ |
| 620 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 621 | |
| 622 | "use strict"; |
| 623 | __webpack_require__.r(__webpack_exports__); |
| 624 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 625 | /* harmony export */ trimHtml: () => (/* binding */ trimHtml) |
| 626 | /* harmony export */ }); |
| 627 | // count symbols like one char |
| 628 | function getCharArr(rowCut) { |
| 629 | // eslint-disable-next-line prefer-const |
| 630 | let charArr = [], |
| 631 | subRow, |
| 632 | match, |
| 633 | char; |
| 634 | for (let i = 0; i < rowCut.length; i++) { |
| 635 | subRow = rowCut.substring(i); |
| 636 | match = subRow.match(/^&[a-z0-9#]+;/); |
| 637 | if (match) { |
| 638 | char = match[0]; |
| 639 | charArr.push(char); |
| 640 | i += char.length - 1; |
| 641 | } else { |
| 642 | charArr.push(rowCut[i]); |
| 643 | } |
| 644 | } |
| 645 | return charArr; |
| 646 | } |
| 647 | |
| 648 | // Copy-pasted from https://github.com/brankosekulic/trimHtml/blob/master/index.js |
| 649 | // the published npm version of this code contains a bug that causes it throw exceptions. |
| 650 | function trimHtml(html, options) { |
| 651 | options = options || {}; |
| 652 | const limit = options.limit || 100, |
| 653 | preserveTags = typeof options.preserveTags !== 'undefined' ? options.preserveTags : true, |
| 654 | wordBreak = typeof options.wordBreak !== 'undefined' ? options.wordBreak : false, |
| 655 | suffix = options.suffix || '...', |
| 656 | moreLink = options.moreLink || '', |
| 657 | moreText = options.moreText || '»', |
| 658 | preserveWhiteSpace = options.preserveWhiteSpace || false; |
| 659 | const arr = html.replace(/</g, '\n<').replace(/>/g, '>\n').replace(/\n\n/g, '\n').replace(/^\n/g, '').replace(/\n$/g, '').split('\n'); |
| 660 | let sum = 0, |
| 661 | row, |
| 662 | cut, |
| 663 | add, |
| 664 | rowCut, |
| 665 | tagMatch, |
| 666 | tagName, |
| 667 | // eslint-disable-next-line prefer-const |
| 668 | tagStack = [], |
| 669 | more = false; |
| 670 | for (let i = 0; i < arr.length; i++) { |
| 671 | row = arr[i]; |
| 672 | |
| 673 | // count multiple spaces as one character |
| 674 | if (!preserveWhiteSpace) { |
| 675 | rowCut = row.replace(/[ ]+/g, ' '); |
| 676 | } else { |
| 677 | rowCut = row; |
| 678 | } |
| 679 | if (!row.length) { |
| 680 | continue; |
| 681 | } |
| 682 | const charArr = getCharArr(rowCut); |
| 683 | if (row[0] !== '<') { |
| 684 | if (sum >= limit) { |
| 685 | row = ''; |
| 686 | } else if (sum + charArr.length >= limit) { |
| 687 | cut = limit - sum; |
| 688 | if (charArr[cut - 1] === ' ') { |
| 689 | while (cut) { |
| 690 | cut -= 1; |
| 691 | if (charArr[cut - 1] !== ' ') { |
| 692 | break; |
| 693 | } |
| 694 | } |
| 695 | } else { |
| 696 | add = charArr.slice(cut).indexOf(' '); |
| 697 | |
| 698 | // break on halh of word |
| 699 | if (!wordBreak) { |
| 700 | if (add !== -1) { |
| 701 | cut += add; |
| 702 | } else { |
| 703 | cut = row.length; |
| 704 | } |
| 705 | } |
| 706 | } |
| 707 | row = charArr.slice(0, cut).join('') + suffix; |
| 708 | if (moreLink) { |
| 709 | row += '<a href="' + moreLink + '" style="display:inline">' + moreText + '</a>'; |
| 710 | } |
| 711 | sum = limit; |
| 712 | more = true; |
| 713 | } else { |
| 714 | sum += charArr.length; |
| 715 | } |
| 716 | } else if (!preserveTags) { |
| 717 | row = ''; |
| 718 | } else if (sum >= limit) { |
| 719 | tagMatch = row.match(/[a-zA-Z]+/); |
| 720 | tagName = tagMatch ? tagMatch[0] : ''; |
| 721 | if (tagName) { |
| 722 | if (row.substring(0, 2) !== '</') { |
| 723 | tagStack.push(tagName); |
| 724 | row = ''; |
| 725 | } else { |
| 726 | while (tagStack[tagStack.length - 1] !== tagName && tagStack.length) { |
| 727 | tagStack.pop(); |
| 728 | } |
| 729 | if (tagStack.length) { |
| 730 | row = ''; |
| 731 | } |
| 732 | tagStack.pop(); |
| 733 | } |
| 734 | } else { |
| 735 | row = ''; |
| 736 | } |
| 737 | } |
| 738 | arr[i] = row; |
| 739 | } |
| 740 | return { |
| 741 | html: arr.join('\n').replace(/\n/g, ''), |
| 742 | more |
| 743 | }; |
| 744 | } |
| 745 | |
| 746 | /***/ }), |
| 747 | |
| 748 | /***/ "./assets/js/base/components/read-more/utils.ts": |
| 749 | /*!******************************************************!*\ |
| 750 | !*** ./assets/js/base/components/read-more/utils.ts ***! |
| 751 | \******************************************************/ |
| 752 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 753 | |
| 754 | "use strict"; |
| 755 | __webpack_require__.r(__webpack_exports__); |
| 756 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 757 | /* harmony export */ clampLines: () => (/* binding */ clampLines), |
| 758 | /* harmony export */ truncateHtml: () => (/* binding */ truncateHtml) |
| 759 | /* harmony export */ }); |
| 760 | /* harmony import */ var _trim_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./trim-html */ "./assets/js/base/components/read-more/trim-html.js"); |
| 761 | /** |
| 762 | * Internal dependencies |
| 763 | */ |
| 764 | |
| 765 | |
| 766 | /** |
| 767 | * External dependencies |
| 768 | */ |
| 769 | |
| 770 | /** |
| 771 | * Truncate some HTML content to a given length. |
| 772 | * |
| 773 | * @param {string} html HTML that will be truncated. |
| 774 | * @param {number} length Length to truncate the string to. |
| 775 | * @param {string} ellipsis Character to append to truncated content. |
| 776 | */ |
| 777 | const truncateHtml = (html, length, ellipsis = '...') => { |
| 778 | const trimmed = (0,_trim_html__WEBPACK_IMPORTED_MODULE_0__.trimHtml)(html, { |
| 779 | suffix: ellipsis, |
| 780 | limit: length |
| 781 | }); |
| 782 | return trimmed.html; |
| 783 | }; |
| 784 | |
| 785 | /** |
| 786 | * Move string markers. Used by calculateLength. |
| 787 | * |
| 788 | * @param {Markers} markers Markers for clamped content. |
| 789 | * @param {number} currentHeight Current height of clamped content. |
| 790 | * @param {number} maxHeight Max height of the clamped content. |
| 791 | */ |
| 792 | const moveMarkers = (markers, currentHeight, maxHeight) => { |
| 793 | if (currentHeight <= maxHeight) { |
| 794 | markers.start = markers.middle + 1; |
| 795 | } else { |
| 796 | markers.end = markers.middle - 1; |
| 797 | } |
| 798 | return markers; |
| 799 | }; |
| 800 | |
| 801 | /** |
| 802 | * Calculate how long the content can be based on the maximum number of lines allowed, and client height. |
| 803 | * |
| 804 | * @param {string} originalContent Content to be clamped. |
| 805 | * @param {HTMLElement} targetElement Element which will contain the clamped content. |
| 806 | * @param {number} maxHeight Max height of the clamped content. |
| 807 | */ |
| 808 | const calculateLength = (originalContent, targetElement, maxHeight) => { |
| 809 | let markers = { |
| 810 | start: 0, |
| 811 | middle: 0, |
| 812 | end: originalContent.length |
| 813 | }; |
| 814 | while (markers.start <= markers.end) { |
| 815 | markers.middle = Math.floor((markers.start + markers.end) / 2); |
| 816 | |
| 817 | // We set the innerHTML directly in the DOM here so we can reliably check the clientHeight later in moveMarkers. |
| 818 | targetElement.innerHTML = truncateHtml(originalContent, markers.middle); |
| 819 | markers = moveMarkers(markers, targetElement.clientHeight, maxHeight); |
| 820 | } |
| 821 | return markers.middle; |
| 822 | }; |
| 823 | |
| 824 | /** |
| 825 | * Clamp lines calculates the height of a line of text and then limits it to the |
| 826 | * value of the lines prop. Content is updated once limited. |
| 827 | * |
| 828 | * @param {string} originalContent Content to be clamped. |
| 829 | * @param {HTMLElement} targetElement Element which will contain the clamped content. |
| 830 | * @param {number} maxHeight Max height of the clamped content. |
| 831 | * @param {string} ellipsis Character to append to clamped content. |
| 832 | * @return {string} clamped content |
| 833 | */ |
| 834 | const clampLines = (originalContent, targetElement, maxHeight, ellipsis) => { |
| 835 | const length = calculateLength(originalContent, targetElement, maxHeight); |
| 836 | return truncateHtml(originalContent, length - ellipsis.length, ellipsis); |
| 837 | }; |
| 838 | |
| 839 | /***/ }), |
| 840 | |
| 841 | /***/ "./assets/js/base/components/reviews/review-list-item/index.tsx": |
| 842 | /*!**********************************************************************!*\ |
| 843 | !*** ./assets/js/base/components/reviews/review-list-item/index.tsx ***! |
| 844 | \**********************************************************************/ |
| 845 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 846 | |
| 847 | "use strict"; |
| 848 | __webpack_require__.r(__webpack_exports__); |
| 849 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 850 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 851 | /* harmony export */ }); |
| 852 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 853 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 854 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 855 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 856 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 857 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); |
| 858 | /* harmony import */ var _woocommerce_base_components_read_more__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-components/read-more */ "./assets/js/base/components/read-more/index.tsx"); |
| 859 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/reviews/review-list-item/style.scss"); |
| 860 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_4__); |
| 861 | |
| 862 | /** |
| 863 | * External dependencies |
| 864 | */ |
| 865 | |
| 866 | |
| 867 | |
| 868 | /** |
| 869 | * Internal dependencies |
| 870 | */ |
| 871 | |
| 872 | function getReviewImage(review, imageType, isLoading) { |
| 873 | var _review$product_image, _review$product_image2; |
| 874 | if (isLoading || !review) { |
| 875 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 876 | className: "wc-block-review-list-item__image wc-block-components-review-list-item__image" |
| 877 | }); |
| 878 | } |
| 879 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 880 | className: "wc-block-review-list-item__image wc-block-components-review-list-item__image" |
| 881 | }, imageType === 'product' ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { |
| 882 | "aria-hidden": "true", |
| 883 | alt: ((_review$product_image = review.product_image) === null || _review$product_image === void 0 ? void 0 : _review$product_image.alt) || '', |
| 884 | src: ((_review$product_image2 = review.product_image) === null || _review$product_image2 === void 0 ? void 0 : _review$product_image2.thumbnail) || '' |
| 885 | }) : |
| 886 | // The alt text is left empty on purpose, as it's considered a decorative image. |
| 887 | // More can be found here: https://www.w3.org/WAI/tutorials/images/decorative/. |
| 888 | // Github discussion for a context: https://github.com/woocommerce/woocommerce-blocks/pull/7651#discussion_r1019560494. |
| 889 | (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("img", { |
| 890 | "aria-hidden": "true", |
| 891 | alt: "", |
| 892 | src: review.reviewer_avatar_urls['96'] || '' |
| 893 | }), review.verified && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 894 | className: "wc-block-review-list-item__verified wc-block-components-review-list-item__verified", |
| 895 | title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Verified buyer', 'woocommerce') |
| 896 | }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Verified buyer', 'woocommerce'))); |
| 897 | } |
| 898 | function getReviewContent(review) { |
| 899 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_read_more__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 900 | maxLines: 10, |
| 901 | moreText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Read full review', 'woocommerce'), |
| 902 | lessText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Hide full review', 'woocommerce'), |
| 903 | className: "wc-block-review-list-item__text wc-block-components-review-list-item__text" |
| 904 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 905 | dangerouslySetInnerHTML: { |
| 906 | // `content` is the `review` parameter returned by the `reviews` endpoint. |
| 907 | // It's filtered with `wp_filter_post_kses()`, which removes dangerous HTML tags, |
| 908 | // so using it inside `dangerouslySetInnerHTML` is safe. |
| 909 | __html: review.review || '' |
| 910 | } |
| 911 | })); |
| 912 | } |
| 913 | function getReviewProductName(review) { |
| 914 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 915 | className: "wc-block-review-list-item__product wc-block-components-review-list-item__product" |
| 916 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("a", { |
| 917 | href: review.product_permalink, |
| 918 | dangerouslySetInnerHTML: { |
| 919 | // `product_name` might have html entities for things like |
| 920 | // emdash. So to display properly we need to allow the |
| 921 | // browser to render. |
| 922 | __html: review.product_name |
| 923 | } |
| 924 | })); |
| 925 | } |
| 926 | function getReviewerName(review) { |
| 927 | const { |
| 928 | reviewer = '' |
| 929 | } = review; |
| 930 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 931 | className: "wc-block-review-list-item__author wc-block-components-review-list-item__author" |
| 932 | }, reviewer); |
| 933 | } |
| 934 | function getReviewDate(review) { |
| 935 | const { |
| 936 | date_created: dateCreated, |
| 937 | formatted_date_created: formattedDateCreated |
| 938 | } = review; |
| 939 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("time", { |
| 940 | className: "wc-block-review-list-item__published-date wc-block-components-review-list-item__published-date", |
| 941 | dateTime: dateCreated |
| 942 | }, formattedDateCreated); |
| 943 | } |
| 944 | function getReviewRating(review) { |
| 945 | const { |
| 946 | rating |
| 947 | } = review; |
| 948 | const starStyle = { |
| 949 | width: rating / 5 * 100 + '%' /* stylelint-disable-line */ |
| 950 | }; |
| 951 | const ratingText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %f is referring to the average rating value */ |
| 952 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rated %f out of 5', 'woocommerce'), rating); |
| 953 | const ratingHTML = { |
| 954 | __html: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %s is referring to the average rating value */ |
| 955 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Rated %s out of 5', 'woocommerce'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)('<strong class="rating">%f</strong>', rating)) |
| 956 | }; |
| 957 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 958 | className: "wc-block-review-list-item__rating wc-block-components-review-list-item__rating" |
| 959 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 960 | className: "wc-block-review-list-item__rating__stars wc-block-components-review-list-item__rating__stars", |
| 961 | role: "img", |
| 962 | "aria-label": ratingText |
| 963 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 964 | style: starStyle, |
| 965 | dangerouslySetInnerHTML: ratingHTML |
| 966 | }))); |
| 967 | } |
| 968 | const ReviewListItem = ({ |
| 969 | attributes, |
| 970 | review = {} |
| 971 | }) => { |
| 972 | const { |
| 973 | imageType, |
| 974 | showReviewDate, |
| 975 | showReviewerName, |
| 976 | showReviewImage, |
| 977 | showReviewRating: showReviewRatingAttr, |
| 978 | showReviewContent, |
| 979 | showProductName |
| 980 | } = attributes; |
| 981 | const { |
| 982 | rating |
| 983 | } = review; |
| 984 | const isLoading = !(Object.keys(review).length > 0); |
| 985 | const showReviewRating = Number.isFinite(rating) && showReviewRatingAttr; |
| 986 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("li", { |
| 987 | className: classnames__WEBPACK_IMPORTED_MODULE_2___default()('wc-block-review-list-item__item', 'wc-block-components-review-list-item__item', { |
| 988 | 'is-loading': isLoading, |
| 989 | 'wc-block-components-review-list-item__item--has-image': showReviewImage |
| 990 | }), |
| 991 | "aria-hidden": isLoading |
| 992 | }, (showProductName || showReviewDate || showReviewerName || showReviewImage || showReviewRating) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 993 | className: "wc-block-review-list-item__info wc-block-components-review-list-item__info" |
| 994 | }, showReviewImage && getReviewImage(review, imageType, isLoading), (showProductName || showReviewerName || showReviewRating || showReviewDate) && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 995 | className: "wc-block-review-list-item__meta wc-block-components-review-list-item__meta" |
| 996 | }, showReviewRating && getReviewRating(review), showProductName && getReviewProductName(review), showReviewerName && getReviewerName(review), showReviewDate && getReviewDate(review))), showReviewContent && getReviewContent(review)); |
| 997 | }; |
| 998 | |
| 999 | /** |
| 1000 | * BE AWARE. ReviewListItem expects product data that is equivalent to what is |
| 1001 | * made available for output in a public view. Thus content that may contain |
| 1002 | * html data is not sanitized further. |
| 1003 | * |
| 1004 | * Currently the following data is trusted (assumed to already be sanitized): |
| 1005 | * - `review.review` (review content) |
| 1006 | * - `review.product_name` (the product title) |
| 1007 | */ |
| 1008 | ReviewListItem.__docgenInfo = { |
| 1009 | "description": "", |
| 1010 | "methods": [], |
| 1011 | "displayName": "ReviewListItem", |
| 1012 | "props": { |
| 1013 | "review": { |
| 1014 | "defaultValue": { |
| 1015 | "value": "{}", |
| 1016 | "computed": false |
| 1017 | }, |
| 1018 | "required": false, |
| 1019 | "tsType": { |
| 1020 | "name": "Review" |
| 1021 | }, |
| 1022 | "description": "" |
| 1023 | }, |
| 1024 | "attributes": { |
| 1025 | "required": true, |
| 1026 | "tsType": { |
| 1027 | "name": "ReviewBlockAttributes" |
| 1028 | }, |
| 1029 | "description": "" |
| 1030 | } |
| 1031 | } |
| 1032 | }; |
| 1033 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReviewListItem); |
| 1034 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1035 | STORYBOOK_REACT_CLASSES["assets/js/base/components/reviews/review-list-item/index.tsx"] = { |
| 1036 | name: "ReviewListItem", |
| 1037 | docgenInfo: ReviewListItem.__docgenInfo, |
| 1038 | path: "assets/js/base/components/reviews/review-list-item/index.tsx" |
| 1039 | }; |
| 1040 | } |
| 1041 | |
| 1042 | /***/ }), |
| 1043 | |
| 1044 | /***/ "./assets/js/base/components/reviews/review-list/index.tsx": |
| 1045 | /*!*****************************************************************!*\ |
| 1046 | !*** ./assets/js/base/components/reviews/review-list/index.tsx ***! |
| 1047 | \*****************************************************************/ |
| 1048 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1049 | |
| 1050 | "use strict"; |
| 1051 | __webpack_require__.r(__webpack_exports__); |
| 1052 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1053 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1054 | /* harmony export */ }); |
| 1055 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1056 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1057 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 1058 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__); |
| 1059 | /* harmony import */ var _review_list_item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../review-list-item */ "./assets/js/base/components/reviews/review-list-item/index.tsx"); |
| 1060 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/reviews/review-list/style.scss"); |
| 1061 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_3__); |
| 1062 | |
| 1063 | /** |
| 1064 | * External dependencies |
| 1065 | */ |
| 1066 | |
| 1067 | /** |
| 1068 | * Internal dependencies |
| 1069 | */ |
| 1070 | |
| 1071 | |
| 1072 | const ReviewList = ({ |
| 1073 | attributes, |
| 1074 | reviews |
| 1075 | }) => { |
| 1076 | const showAvatars = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__.getSetting)('showAvatars', true); |
| 1077 | const reviewRatingsEnabled = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_1__.getSetting)('reviewRatingsEnabled', true); |
| 1078 | const showReviewImage = (showAvatars || attributes.imageType === 'product') && attributes.showReviewImage; |
| 1079 | const showReviewRating = reviewRatingsEnabled && attributes.showReviewRating; |
| 1080 | const attrs = { |
| 1081 | ...attributes, |
| 1082 | showReviewImage, |
| 1083 | showReviewRating |
| 1084 | }; |
| 1085 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("ul", { |
| 1086 | className: "wc-block-review-list wc-block-components-review-list" |
| 1087 | }, reviews.length === 0 ? (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_review_list_item__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1088 | attributes: attrs |
| 1089 | }) : reviews.map((review, i) => (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_review_list_item__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1090 | key: review.id || i, |
| 1091 | attributes: attrs, |
| 1092 | review: review |
| 1093 | }))); |
| 1094 | }; |
| 1095 | ReviewList.__docgenInfo = { |
| 1096 | "description": "", |
| 1097 | "methods": [], |
| 1098 | "displayName": "ReviewList", |
| 1099 | "props": { |
| 1100 | "attributes": { |
| 1101 | "required": true, |
| 1102 | "tsType": { |
| 1103 | "name": "ReviewBlockAttributes" |
| 1104 | }, |
| 1105 | "description": "" |
| 1106 | }, |
| 1107 | "reviews": { |
| 1108 | "required": true, |
| 1109 | "tsType": { |
| 1110 | "name": "Array", |
| 1111 | "elements": [{ |
| 1112 | "name": "Review" |
| 1113 | }], |
| 1114 | "raw": "Review[]" |
| 1115 | }, |
| 1116 | "description": "" |
| 1117 | } |
| 1118 | } |
| 1119 | }; |
| 1120 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReviewList); |
| 1121 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1122 | STORYBOOK_REACT_CLASSES["assets/js/base/components/reviews/review-list/index.tsx"] = { |
| 1123 | name: "ReviewList", |
| 1124 | docgenInfo: ReviewList.__docgenInfo, |
| 1125 | path: "assets/js/base/components/reviews/review-list/index.tsx" |
| 1126 | }; |
| 1127 | } |
| 1128 | |
| 1129 | /***/ }), |
| 1130 | |
| 1131 | /***/ "./assets/js/base/components/reviews/review-sort-select/index.tsx": |
| 1132 | /*!************************************************************************!*\ |
| 1133 | !*** ./assets/js/base/components/reviews/review-sort-select/index.tsx ***! |
| 1134 | \************************************************************************/ |
| 1135 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1136 | |
| 1137 | "use strict"; |
| 1138 | __webpack_require__.r(__webpack_exports__); |
| 1139 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1140 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1141 | /* harmony export */ }); |
| 1142 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1143 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1144 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1145 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 1146 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/blocks-components */ "@woocommerce/blocks-components"); |
| 1147 | /* harmony import */ var _woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__); |
| 1148 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./style.scss */ "./assets/js/base/components/reviews/review-sort-select/style.scss"); |
| 1149 | /* harmony import */ var _style_scss__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_style_scss__WEBPACK_IMPORTED_MODULE_3__); |
| 1150 | |
| 1151 | /** |
| 1152 | * External dependencies |
| 1153 | */ |
| 1154 | |
| 1155 | |
| 1156 | /** |
| 1157 | * Internal dependencies |
| 1158 | */ |
| 1159 | |
| 1160 | const ReviewSortSelect = ({ |
| 1161 | onChange, |
| 1162 | readOnly, |
| 1163 | value |
| 1164 | }) => { |
| 1165 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_blocks_components__WEBPACK_IMPORTED_MODULE_2__.SortSelect, { |
| 1166 | className: "wc-block-review-sort-select wc-block-components-review-sort-select", |
| 1167 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Order by', 'woocommerce'), |
| 1168 | onChange: onChange, |
| 1169 | options: [{ |
| 1170 | key: 'most-recent', |
| 1171 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Most recent', 'woocommerce') |
| 1172 | }, { |
| 1173 | key: 'highest-rating', |
| 1174 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Highest rating', 'woocommerce') |
| 1175 | }, { |
| 1176 | key: 'lowest-rating', |
| 1177 | label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Lowest rating', 'woocommerce') |
| 1178 | }], |
| 1179 | readOnly: readOnly, |
| 1180 | screenReaderLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Order reviews by', 'woocommerce'), |
| 1181 | value: value |
| 1182 | }); |
| 1183 | }; |
| 1184 | ReviewSortSelect.__docgenInfo = { |
| 1185 | "description": "", |
| 1186 | "methods": [], |
| 1187 | "displayName": "ReviewSortSelect", |
| 1188 | "props": { |
| 1189 | "onChange": { |
| 1190 | "required": true, |
| 1191 | "tsType": { |
| 1192 | "name": "ChangeEventHandler" |
| 1193 | }, |
| 1194 | "description": "" |
| 1195 | }, |
| 1196 | "readOnly": { |
| 1197 | "required": false, |
| 1198 | "tsType": { |
| 1199 | "name": "boolean" |
| 1200 | }, |
| 1201 | "description": "" |
| 1202 | }, |
| 1203 | "value": { |
| 1204 | "required": true, |
| 1205 | "tsType": { |
| 1206 | "name": "union", |
| 1207 | "raw": "'most-recent' | 'highest-rating' | 'lowest-rating'", |
| 1208 | "elements": [{ |
| 1209 | "name": "literal", |
| 1210 | "value": "'most-recent'" |
| 1211 | }, { |
| 1212 | "name": "literal", |
| 1213 | "value": "'highest-rating'" |
| 1214 | }, { |
| 1215 | "name": "literal", |
| 1216 | "value": "'lowest-rating'" |
| 1217 | }] |
| 1218 | }, |
| 1219 | "description": "" |
| 1220 | } |
| 1221 | } |
| 1222 | }; |
| 1223 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReviewSortSelect); |
| 1224 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1225 | STORYBOOK_REACT_CLASSES["assets/js/base/components/reviews/review-sort-select/index.tsx"] = { |
| 1226 | name: "ReviewSortSelect", |
| 1227 | docgenInfo: ReviewSortSelect.__docgenInfo, |
| 1228 | path: "assets/js/base/components/reviews/review-sort-select/index.tsx" |
| 1229 | }; |
| 1230 | } |
| 1231 | |
| 1232 | /***/ }), |
| 1233 | |
| 1234 | /***/ "./assets/js/base/hocs/with-reviews.js": |
| 1235 | /*!*********************************************!*\ |
| 1236 | !*** ./assets/js/base/hocs/with-reviews.js ***! |
| 1237 | \*********************************************/ |
| 1238 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1239 | |
| 1240 | "use strict"; |
| 1241 | __webpack_require__.r(__webpack_exports__); |
| 1242 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1243 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1244 | /* harmony export */ }); |
| 1245 | /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js"); |
| 1246 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "react"); |
| 1247 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__); |
| 1248 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1249 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__); |
| 1250 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js"); |
| 1251 | /* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__); |
| 1252 | /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/is-shallow-equal */ "@wordpress/is-shallow-equal"); |
| 1253 | /* harmony import */ var _wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3__); |
| 1254 | /* harmony import */ var _blocks_reviews_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../blocks/reviews/utils */ "./assets/js/blocks/reviews/utils.js"); |
| 1255 | /* harmony import */ var _utils_errors__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/errors */ "./assets/js/base/utils/errors.ts"); |
| 1256 | |
| 1257 | |
| 1258 | /** |
| 1259 | * External dependencies |
| 1260 | */ |
| 1261 | |
| 1262 | |
| 1263 | |
| 1264 | |
| 1265 | /** |
| 1266 | * Internal dependencies |
| 1267 | */ |
| 1268 | |
| 1269 | |
| 1270 | |
| 1271 | /** |
| 1272 | * HOC that queries reviews for a component. |
| 1273 | * |
| 1274 | * @param {Function} OriginalComponent Component being wrapped. |
| 1275 | */ |
| 1276 | const withReviews = OriginalComponent => { |
| 1277 | class WrappedComponent extends _wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Component { |
| 1278 | constructor(...args) { |
| 1279 | super(...args); |
| 1280 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "isPreview", !!this.props.attributes.previewReviews); |
| 1281 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "delayedAppendReviews", this.props.delayFunction(this.appendReviews)); |
| 1282 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "isMounted", false); |
| 1283 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "state", { |
| 1284 | error: null, |
| 1285 | loading: true, |
| 1286 | reviews: this.isPreview ? this.props.attributes.previewReviews : [], |
| 1287 | totalReviews: this.isPreview ? this.props.attributes.previewReviews.length : 0 |
| 1288 | }); |
| 1289 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(this, "setError", async e => { |
| 1290 | if (!this.isMounted) { |
| 1291 | return; |
| 1292 | } |
| 1293 | const { |
| 1294 | onReviewsLoadError |
| 1295 | } = this.props; |
| 1296 | const error = await (0,_utils_errors__WEBPACK_IMPORTED_MODULE_4__.formatError)(e); |
| 1297 | this.setState({ |
| 1298 | reviews: [], |
| 1299 | loading: false, |
| 1300 | error |
| 1301 | }); |
| 1302 | onReviewsLoadError(error); |
| 1303 | }); |
| 1304 | } |
| 1305 | componentDidMount() { |
| 1306 | this.isMounted = true; |
| 1307 | this.replaceReviews(); |
| 1308 | } |
| 1309 | componentDidUpdate(prevProps) { |
| 1310 | if (prevProps.reviewsToDisplay < this.props.reviewsToDisplay) { |
| 1311 | // Since this attribute might be controlled via something with |
| 1312 | // short intervals between value changes, this allows for optionally |
| 1313 | // delaying review fetches via the provided delay function. |
| 1314 | this.delayedAppendReviews(); |
| 1315 | } else if (this.shouldReplaceReviews(prevProps, this.props)) { |
| 1316 | this.replaceReviews(); |
| 1317 | } |
| 1318 | } |
| 1319 | shouldReplaceReviews(prevProps, nextProps) { |
| 1320 | return prevProps.orderby !== nextProps.orderby || prevProps.order !== nextProps.order || prevProps.productId !== nextProps.productId || !_wordpress_is_shallow_equal__WEBPACK_IMPORTED_MODULE_3___default()(prevProps.categoryIds, nextProps.categoryIds); |
| 1321 | } |
| 1322 | componentWillUnmount() { |
| 1323 | this.isMounted = false; |
| 1324 | if (this.delayedAppendReviews.cancel) { |
| 1325 | this.delayedAppendReviews.cancel(); |
| 1326 | } |
| 1327 | } |
| 1328 | getArgs(reviewsToSkip) { |
| 1329 | const { |
| 1330 | categoryIds, |
| 1331 | order, |
| 1332 | orderby, |
| 1333 | productId, |
| 1334 | reviewsToDisplay |
| 1335 | } = this.props; |
| 1336 | const args = { |
| 1337 | order, |
| 1338 | orderby, |
| 1339 | per_page: reviewsToDisplay - reviewsToSkip, |
| 1340 | offset: reviewsToSkip |
| 1341 | }; |
| 1342 | if (categoryIds) { |
| 1343 | const categories = Array.isArray(categoryIds) ? categoryIds : JSON.parse(categoryIds); |
| 1344 | args.category_id = Array.isArray(categories) ? categories.join(',') : categories; |
| 1345 | } |
| 1346 | if (productId) { |
| 1347 | args.product_id = productId; |
| 1348 | } |
| 1349 | return args; |
| 1350 | } |
| 1351 | replaceReviews() { |
| 1352 | if (this.isPreview) { |
| 1353 | return; |
| 1354 | } |
| 1355 | const { |
| 1356 | onReviewsReplaced |
| 1357 | } = this.props; |
| 1358 | this.updateListOfReviews().then(onReviewsReplaced); |
| 1359 | } |
| 1360 | appendReviews() { |
| 1361 | if (this.isPreview) { |
| 1362 | return; |
| 1363 | } |
| 1364 | const { |
| 1365 | onReviewsAppended, |
| 1366 | reviewsToDisplay |
| 1367 | } = this.props; |
| 1368 | const { |
| 1369 | reviews |
| 1370 | } = this.state; |
| 1371 | |
| 1372 | // Given that this function is delayed, props might have been updated since |
| 1373 | // it was called so we need to check again if fetching new reviews is necessary. |
| 1374 | if (reviewsToDisplay <= reviews.length) { |
| 1375 | return; |
| 1376 | } |
| 1377 | this.updateListOfReviews(reviews).then(onReviewsAppended); |
| 1378 | } |
| 1379 | updateListOfReviews(oldReviews = []) { |
| 1380 | const { |
| 1381 | reviewsToDisplay |
| 1382 | } = this.props; |
| 1383 | const { |
| 1384 | totalReviews |
| 1385 | } = this.state; |
| 1386 | const reviewsToLoad = Math.min(totalReviews, reviewsToDisplay) - oldReviews.length; |
| 1387 | this.setState({ |
| 1388 | loading: true, |
| 1389 | reviews: oldReviews.concat(Array(reviewsToLoad).fill({})) |
| 1390 | }); |
| 1391 | return (0,_blocks_reviews_utils__WEBPACK_IMPORTED_MODULE_5__.getReviews)(this.getArgs(oldReviews.length)).then(({ |
| 1392 | reviews: newReviews, |
| 1393 | totalReviews: newTotalReviews |
| 1394 | }) => { |
| 1395 | if (this.isMounted) { |
| 1396 | this.setState({ |
| 1397 | reviews: oldReviews.filter(review => Object.keys(review).length).concat(newReviews), |
| 1398 | totalReviews: newTotalReviews, |
| 1399 | loading: false, |
| 1400 | error: null |
| 1401 | }); |
| 1402 | } |
| 1403 | return { |
| 1404 | newReviews |
| 1405 | }; |
| 1406 | }).catch(this.setError); |
| 1407 | } |
| 1408 | render() { |
| 1409 | const { |
| 1410 | reviewsToDisplay |
| 1411 | } = this.props; |
| 1412 | const { |
| 1413 | error, |
| 1414 | loading, |
| 1415 | reviews, |
| 1416 | totalReviews |
| 1417 | } = this.state; |
| 1418 | return (0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(OriginalComponent, { |
| 1419 | ...this.props, |
| 1420 | error: error, |
| 1421 | isLoading: loading, |
| 1422 | reviews: reviews.slice(0, reviewsToDisplay), |
| 1423 | totalReviews: totalReviews |
| 1424 | }); |
| 1425 | } |
| 1426 | } |
| 1427 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(WrappedComponent, "propTypes", { |
| 1428 | order: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOf(['asc', 'desc']).isRequired, |
| 1429 | orderby: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string).isRequired, |
| 1430 | reviewsToDisplay: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().number).isRequired, |
| 1431 | categoryIds: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().array)]), |
| 1432 | delayFunction: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func), |
| 1433 | onReviewsAppended: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func), |
| 1434 | onReviewsLoadError: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func), |
| 1435 | onReviewsReplaced: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func), |
| 1436 | productId: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().number)]) |
| 1437 | }); |
| 1438 | (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__["default"])(WrappedComponent, "defaultProps", { |
| 1439 | delayFunction: f => f, |
| 1440 | onReviewsAppended: () => {}, |
| 1441 | onReviewsLoadError: () => {}, |
| 1442 | onReviewsReplaced: () => {} |
| 1443 | }); |
| 1444 | const { |
| 1445 | displayName = OriginalComponent.name || 'Component' |
| 1446 | } = OriginalComponent; |
| 1447 | WrappedComponent.displayName = `WithReviews( ${displayName} )`; |
| 1448 | return WrappedComponent; |
| 1449 | }; |
| 1450 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (withReviews); |
| 1451 | |
| 1452 | /***/ }), |
| 1453 | |
| 1454 | /***/ "./assets/js/base/utils/errors.ts": |
| 1455 | /*!****************************************!*\ |
| 1456 | !*** ./assets/js/base/utils/errors.ts ***! |
| 1457 | \****************************************/ |
| 1458 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1459 | |
| 1460 | "use strict"; |
| 1461 | __webpack_require__.r(__webpack_exports__); |
| 1462 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1463 | /* harmony export */ formatError: () => (/* binding */ formatError) |
| 1464 | /* harmony export */ }); |
| 1465 | const formatError = async error => { |
| 1466 | if ('json' in error) { |
| 1467 | try { |
| 1468 | const parsedError = await error.json(); |
| 1469 | return { |
| 1470 | message: parsedError.message, |
| 1471 | type: parsedError.type || 'api' |
| 1472 | }; |
| 1473 | } catch (e) { |
| 1474 | return { |
| 1475 | // We could only return this if e is instanceof Error but, to avoid changing runtime |
| 1476 | // behaviour, we'll just cast it instead. |
| 1477 | message: e.message, |
| 1478 | type: 'general' |
| 1479 | }; |
| 1480 | } |
| 1481 | } else { |
| 1482 | return { |
| 1483 | message: error.message, |
| 1484 | type: error.type || 'general' |
| 1485 | }; |
| 1486 | } |
| 1487 | }; |
| 1488 | |
| 1489 | /***/ }), |
| 1490 | |
| 1491 | /***/ "./assets/js/base/utils/render-frontend.tsx": |
| 1492 | /*!**************************************************!*\ |
| 1493 | !*** ./assets/js/base/utils/render-frontend.tsx ***! |
| 1494 | \**************************************************/ |
| 1495 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1496 | |
| 1497 | "use strict"; |
| 1498 | __webpack_require__.r(__webpack_exports__); |
| 1499 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1500 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), |
| 1501 | /* harmony export */ renderBlock: () => (/* binding */ renderBlock), |
| 1502 | /* harmony export */ renderFrontend: () => (/* binding */ renderFrontend) |
| 1503 | /* harmony export */ }); |
| 1504 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1505 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1506 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1507 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); |
| 1508 | /* harmony import */ var _woocommerce_base_components_block_error_boundary__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/base-components/block-error-boundary */ "./assets/js/base/components/block-error-boundary/index.tsx"); |
| 1509 | |
| 1510 | /** |
| 1511 | * External dependencies |
| 1512 | */ |
| 1513 | |
| 1514 | |
| 1515 | |
| 1516 | // Some blocks take care of rendering their inner blocks automatically. For |
| 1517 | // example, the empty cart. In those cases, we don't want to trigger the render |
| 1518 | // function of inner components on load. Instead, the wrapper block can trigger |
| 1519 | // the event `wc-blocks_render_blocks_frontend` to render its inner blocks. |
| 1520 | const selectorsToSkipOnLoad = ['.wp-block-woocommerce-cart']; |
| 1521 | /** |
| 1522 | * Renders a block component in a single `container` node. |
| 1523 | */ |
| 1524 | const renderBlock = ({ |
| 1525 | Block, |
| 1526 | container, |
| 1527 | attributes = {}, |
| 1528 | props = {}, |
| 1529 | errorBoundaryProps = {} |
| 1530 | }) => { |
| 1531 | (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.render)((0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_block_error_boundary__WEBPACK_IMPORTED_MODULE_2__["default"], { |
| 1532 | ...errorBoundaryProps |
| 1533 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Suspense, { |
| 1534 | fallback: (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("div", { |
| 1535 | className: "wc-block-placeholder" |
| 1536 | }) |
| 1537 | }, Block && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Block, { |
| 1538 | ...props, |
| 1539 | attributes: attributes |
| 1540 | }))), container, () => { |
| 1541 | if (container.classList) { |
| 1542 | container.classList.remove('is-loading'); |
| 1543 | } |
| 1544 | }); |
| 1545 | }; |
| 1546 | /** |
| 1547 | * Renders a block component in each `containers` node. |
| 1548 | */ |
| 1549 | const renderBlockInContainers = ({ |
| 1550 | Block, |
| 1551 | containers, |
| 1552 | getProps = () => ({}), |
| 1553 | getErrorBoundaryProps = () => ({}) |
| 1554 | }) => { |
| 1555 | if (containers.length === 0) { |
| 1556 | return; |
| 1557 | } |
| 1558 | |
| 1559 | // Use Array.forEach for IE11 compatibility. |
| 1560 | Array.prototype.forEach.call(containers, (el, i) => { |
| 1561 | const props = getProps(el, i); |
| 1562 | const errorBoundaryProps = getErrorBoundaryProps(el, i); |
| 1563 | const attributes = { |
| 1564 | ...el.dataset, |
| 1565 | ...(props.attributes || {}) |
| 1566 | }; |
| 1567 | renderBlock({ |
| 1568 | Block, |
| 1569 | container: el, |
| 1570 | props, |
| 1571 | attributes, |
| 1572 | errorBoundaryProps |
| 1573 | }); |
| 1574 | }); |
| 1575 | }; |
| 1576 | |
| 1577 | // Given an element and a list of wrappers, check if the element is inside at |
| 1578 | // least one of the wrappers. |
| 1579 | const isElementInsideWrappers = (el, wrappers) => { |
| 1580 | return Array.prototype.some.call(wrappers, wrapper => wrapper.contains(el) && !wrapper.isSameNode(el)); |
| 1581 | }; |
| 1582 | /** |
| 1583 | * Renders the block frontend in the elements matched by the selector which are |
| 1584 | * outside the wrapper elements. |
| 1585 | */ |
| 1586 | const renderBlockOutsideWrappers = ({ |
| 1587 | Block, |
| 1588 | getProps, |
| 1589 | getErrorBoundaryProps, |
| 1590 | selector, |
| 1591 | wrappers |
| 1592 | }) => { |
| 1593 | const containers = document.body.querySelectorAll(selector); |
| 1594 | // Filter out blocks inside the wrappers. |
| 1595 | if (wrappers && wrappers.length > 0) { |
| 1596 | Array.prototype.filter.call(containers, el => { |
| 1597 | return !isElementInsideWrappers(el, wrappers); |
| 1598 | }); |
| 1599 | } |
| 1600 | renderBlockInContainers({ |
| 1601 | Block, |
| 1602 | containers, |
| 1603 | getProps, |
| 1604 | getErrorBoundaryProps |
| 1605 | }); |
| 1606 | }; |
| 1607 | /** |
| 1608 | * Renders the block frontend in the elements matched by the selector inside the |
| 1609 | * wrapper element. |
| 1610 | */ |
| 1611 | const renderBlockInsideWrapper = ({ |
| 1612 | Block, |
| 1613 | getProps, |
| 1614 | getErrorBoundaryProps, |
| 1615 | selector, |
| 1616 | wrapper |
| 1617 | }) => { |
| 1618 | const containers = wrapper.querySelectorAll(selector); |
| 1619 | renderBlockInContainers({ |
| 1620 | Block, |
| 1621 | containers, |
| 1622 | getProps, |
| 1623 | getErrorBoundaryProps |
| 1624 | }); |
| 1625 | }; |
| 1626 | /** |
| 1627 | * Renders the block frontend on page load. If the block is contained inside a |
| 1628 | * wrapper element that should be excluded from initial load, it adds the |
| 1629 | * appropriate event listeners to render the block when the |
| 1630 | * `wc-blocks_render_blocks_frontend` event is triggered. |
| 1631 | */ |
| 1632 | const renderFrontend = props => { |
| 1633 | const wrappersToSkipOnLoad = document.body.querySelectorAll(selectorsToSkipOnLoad.join(',')); |
| 1634 | const { |
| 1635 | Block, |
| 1636 | getProps, |
| 1637 | getErrorBoundaryProps, |
| 1638 | selector |
| 1639 | } = props; |
| 1640 | renderBlockOutsideWrappers({ |
| 1641 | Block, |
| 1642 | getProps, |
| 1643 | getErrorBoundaryProps, |
| 1644 | selector, |
| 1645 | wrappers: wrappersToSkipOnLoad |
| 1646 | }); |
| 1647 | // For each wrapper, add an event listener to render the inner blocks when |
| 1648 | // `wc-blocks_render_blocks_frontend` event is triggered. |
| 1649 | Array.prototype.forEach.call(wrappersToSkipOnLoad, wrapper => { |
| 1650 | wrapper.addEventListener('wc-blocks_render_blocks_frontend', () => { |
| 1651 | renderBlockInsideWrapper({ |
| 1652 | ...props, |
| 1653 | wrapper |
| 1654 | }); |
| 1655 | }); |
| 1656 | }); |
| 1657 | }; |
| 1658 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (renderFrontend); |
| 1659 | |
| 1660 | /***/ }), |
| 1661 | |
| 1662 | /***/ "./assets/js/blocks/reviews/frontend-block.tsx": |
| 1663 | /*!*****************************************************!*\ |
| 1664 | !*** ./assets/js/blocks/reviews/frontend-block.tsx ***! |
| 1665 | \*****************************************************/ |
| 1666 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1667 | |
| 1668 | "use strict"; |
| 1669 | __webpack_require__.r(__webpack_exports__); |
| 1670 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1671 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1672 | /* harmony export */ }); |
| 1673 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1674 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1675 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1676 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 1677 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 1678 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__); |
| 1679 | /* harmony import */ var _woocommerce_base_components_load_more_button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @woocommerce/base-components/load-more-button */ "./assets/js/base/components/load-more-button/index.tsx"); |
| 1680 | /* harmony import */ var _woocommerce_base_components_reviews__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @woocommerce/base-components/reviews */ "./assets/js/base/components/reviews/review-sort-select/index.tsx"); |
| 1681 | /* harmony import */ var _woocommerce_base_components_reviews__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @woocommerce/base-components/reviews */ "./assets/js/base/components/reviews/review-list/index.tsx"); |
| 1682 | /* harmony import */ var _woocommerce_base_hocs_with_reviews__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @woocommerce/base-hocs/with-reviews */ "./assets/js/base/hocs/with-reviews.js"); |
| 1683 | |
| 1684 | /** |
| 1685 | * External dependencies |
| 1686 | */ |
| 1687 | |
| 1688 | |
| 1689 | |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | /** |
| 1694 | * Internal dependencies |
| 1695 | */ |
| 1696 | |
| 1697 | const FrontendBlock = ({ |
| 1698 | attributes, |
| 1699 | onAppendReviews, |
| 1700 | onChangeOrderby, |
| 1701 | reviews, |
| 1702 | sortSelectValue, |
| 1703 | totalReviews |
| 1704 | }) => { |
| 1705 | if (reviews.length === 0) { |
| 1706 | return null; |
| 1707 | } |
| 1708 | const reviewRatingsEnabled = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('reviewRatingsEnabled', true); |
| 1709 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(react__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, attributes.showOrderby && reviewRatingsEnabled && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_reviews__WEBPACK_IMPORTED_MODULE_4__["default"], { |
| 1710 | value: sortSelectValue, |
| 1711 | onChange: onChangeOrderby |
| 1712 | }), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_reviews__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 1713 | attributes: attributes, |
| 1714 | reviews: reviews |
| 1715 | }), attributes.showLoadMore && totalReviews > reviews.length && (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_woocommerce_base_components_load_more_button__WEBPACK_IMPORTED_MODULE_3__["default"], { |
| 1716 | onClick: onAppendReviews, |
| 1717 | screenReaderLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Load more reviews', 'woocommerce') |
| 1718 | })); |
| 1719 | }; |
| 1720 | FrontendBlock.__docgenInfo = { |
| 1721 | "description": "", |
| 1722 | "methods": [], |
| 1723 | "displayName": "FrontendBlock", |
| 1724 | "props": { |
| 1725 | "attributes": { |
| 1726 | "required": true, |
| 1727 | "tsType": { |
| 1728 | "name": "ReviewBlockAttributes" |
| 1729 | }, |
| 1730 | "description": "" |
| 1731 | }, |
| 1732 | "onAppendReviews": { |
| 1733 | "required": true, |
| 1734 | "tsType": { |
| 1735 | "name": "MouseEventHandler" |
| 1736 | }, |
| 1737 | "description": "" |
| 1738 | }, |
| 1739 | "onChangeOrderby": { |
| 1740 | "required": true, |
| 1741 | "tsType": { |
| 1742 | "name": "ChangeEventHandler", |
| 1743 | "elements": [{ |
| 1744 | "name": "HTMLSelectElement" |
| 1745 | }], |
| 1746 | "raw": "ChangeEventHandler< HTMLSelectElement >" |
| 1747 | }, |
| 1748 | "description": "" |
| 1749 | }, |
| 1750 | "sortSelectValue": { |
| 1751 | "required": true, |
| 1752 | "tsType": { |
| 1753 | "name": "union", |
| 1754 | "raw": "'most-recent' | 'highest-rating' | 'lowest-rating'", |
| 1755 | "elements": [{ |
| 1756 | "name": "literal", |
| 1757 | "value": "'most-recent'" |
| 1758 | }, { |
| 1759 | "name": "literal", |
| 1760 | "value": "'highest-rating'" |
| 1761 | }, { |
| 1762 | "name": "literal", |
| 1763 | "value": "'lowest-rating'" |
| 1764 | }] |
| 1765 | }, |
| 1766 | "description": "" |
| 1767 | }, |
| 1768 | "reviews": { |
| 1769 | "required": true, |
| 1770 | "tsType": { |
| 1771 | "name": "Array", |
| 1772 | "elements": [{ |
| 1773 | "name": "Review" |
| 1774 | }], |
| 1775 | "raw": "Review[]" |
| 1776 | }, |
| 1777 | "description": "" |
| 1778 | }, |
| 1779 | "totalReviews": { |
| 1780 | "required": true, |
| 1781 | "tsType": { |
| 1782 | "name": "number" |
| 1783 | }, |
| 1784 | "description": "" |
| 1785 | } |
| 1786 | } |
| 1787 | }; |
| 1788 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_woocommerce_base_hocs_with_reviews__WEBPACK_IMPORTED_MODULE_6__["default"])(FrontendBlock)); |
| 1789 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 1790 | STORYBOOK_REACT_CLASSES["assets/js/blocks/reviews/frontend-block.tsx"] = { |
| 1791 | name: "FrontendBlock", |
| 1792 | docgenInfo: FrontendBlock.__docgenInfo, |
| 1793 | path: "assets/js/blocks/reviews/frontend-block.tsx" |
| 1794 | }; |
| 1795 | } |
| 1796 | |
| 1797 | /***/ }), |
| 1798 | |
| 1799 | /***/ "./assets/js/blocks/reviews/frontend-container-block.tsx": |
| 1800 | /*!***************************************************************!*\ |
| 1801 | !*** ./assets/js/blocks/reviews/frontend-container-block.tsx ***! |
| 1802 | \***************************************************************/ |
| 1803 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 1804 | |
| 1805 | "use strict"; |
| 1806 | __webpack_require__.r(__webpack_exports__); |
| 1807 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 1808 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 1809 | /* harmony export */ }); |
| 1810 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 1811 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 1812 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n"); |
| 1813 | /* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__); |
| 1814 | /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/a11y */ "@wordpress/a11y"); |
| 1815 | /* harmony import */ var _wordpress_a11y__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__); |
| 1816 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 1817 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__); |
| 1818 | /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./assets/js/blocks/reviews/utils.js"); |
| 1819 | /* harmony import */ var _frontend_block__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./frontend-block */ "./assets/js/blocks/reviews/frontend-block.tsx"); |
| 1820 | |
| 1821 | /** |
| 1822 | * External dependencies |
| 1823 | */ |
| 1824 | |
| 1825 | |
| 1826 | |
| 1827 | /** |
| 1828 | * Internal dependencies |
| 1829 | */ |
| 1830 | |
| 1831 | |
| 1832 | /** |
| 1833 | * Container of the block rendered in the frontend. |
| 1834 | */ |
| 1835 | class FrontendContainerBlock extends _wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Component { |
| 1836 | constructor(props) { |
| 1837 | super(props); |
| 1838 | const { |
| 1839 | attributes |
| 1840 | } = this.props; |
| 1841 | this.state = { |
| 1842 | orderby: attributes === null || attributes === void 0 ? void 0 : attributes.orderby, |
| 1843 | reviewsToDisplay: this.getReviewsOnPageLoad() |
| 1844 | }; |
| 1845 | this.onAppendReviews = this.onAppendReviews.bind(this); |
| 1846 | this.onChangeOrderby = this.onChangeOrderby.bind(this); |
| 1847 | } |
| 1848 | getReviewsOnPageLoad() { |
| 1849 | const { |
| 1850 | attributes |
| 1851 | } = this.props; |
| 1852 | return typeof attributes.reviewsOnPageLoad === 'number' ? attributes.reviewsOnPageLoad : parseInt(attributes.reviewsOnPageLoad, 10); |
| 1853 | } |
| 1854 | getReviewsOnLoadMore() { |
| 1855 | const { |
| 1856 | attributes |
| 1857 | } = this.props; |
| 1858 | return typeof attributes.reviewsOnLoadMore === 'number' ? attributes.reviewsOnLoadMore : parseInt(attributes.reviewsOnLoadMore, 10); |
| 1859 | } |
| 1860 | onAppendReviews() { |
| 1861 | const { |
| 1862 | reviewsToDisplay |
| 1863 | } = this.state; |
| 1864 | this.setState({ |
| 1865 | reviewsToDisplay: reviewsToDisplay + this.getReviewsOnLoadMore() |
| 1866 | }); |
| 1867 | } |
| 1868 | onChangeOrderby(event) { |
| 1869 | this.setState({ |
| 1870 | orderby: event.target.value, |
| 1871 | reviewsToDisplay: this.getReviewsOnPageLoad() |
| 1872 | }); |
| 1873 | } |
| 1874 | onReviewsAppended({ |
| 1875 | newReviews |
| 1876 | }) { |
| 1877 | (0,_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__.speak)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)( /* translators: %d is the count of reviews loaded. */ |
| 1878 | (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._n)('%d review loaded.', '%d reviews loaded.', newReviews.length, 'woocommerce'), newReviews.length)); |
| 1879 | } |
| 1880 | onReviewsReplaced() { |
| 1881 | (0,_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__.speak)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Reviews list updated.', 'woocommerce')); |
| 1882 | } |
| 1883 | onReviewsLoadError() { |
| 1884 | (0,_wordpress_a11y__WEBPACK_IMPORTED_MODULE_2__.speak)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('There was an error loading the reviews.', 'woocommerce')); |
| 1885 | } |
| 1886 | render() { |
| 1887 | const { |
| 1888 | attributes |
| 1889 | } = this.props; |
| 1890 | const { |
| 1891 | categoryIds, |
| 1892 | productId |
| 1893 | } = attributes; |
| 1894 | const { |
| 1895 | reviewsToDisplay |
| 1896 | } = this.state; |
| 1897 | const { |
| 1898 | order, |
| 1899 | orderby |
| 1900 | } = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.getSortArgs)(this.state.orderby); |
| 1901 | return ( |
| 1902 | // @ts-expect-error - TODO: Refactor WrappedComponent |
| 1903 | (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(_frontend_block__WEBPACK_IMPORTED_MODULE_5__["default"], { |
| 1904 | attributes: attributes, |
| 1905 | categoryIds: categoryIds, |
| 1906 | onAppendReviews: this.onAppendReviews, |
| 1907 | onChangeOrderby: this.onChangeOrderby, |
| 1908 | onReviewsAppended: this.onReviewsAppended, |
| 1909 | onReviewsLoadError: this.onReviewsLoadError, |
| 1910 | onReviewsReplaced: this.onReviewsReplaced, |
| 1911 | order: order, |
| 1912 | orderby: orderby, |
| 1913 | productId: productId, |
| 1914 | reviewsToDisplay: reviewsToDisplay, |
| 1915 | sortSelectValue: this.state.orderby |
| 1916 | }) |
| 1917 | ); |
| 1918 | } |
| 1919 | } |
| 1920 | FrontendContainerBlock.__docgenInfo = { |
| 1921 | "description": "Container of the block rendered in the frontend.", |
| 1922 | "methods": [{ |
| 1923 | "name": "getReviewsOnPageLoad", |
| 1924 | "docblock": null, |
| 1925 | "modifiers": [], |
| 1926 | "params": [], |
| 1927 | "returns": null |
| 1928 | }, { |
| 1929 | "name": "getReviewsOnLoadMore", |
| 1930 | "docblock": null, |
| 1931 | "modifiers": [], |
| 1932 | "params": [], |
| 1933 | "returns": null |
| 1934 | }, { |
| 1935 | "name": "onAppendReviews", |
| 1936 | "docblock": null, |
| 1937 | "modifiers": [], |
| 1938 | "params": [], |
| 1939 | "returns": null |
| 1940 | }, { |
| 1941 | "name": "onChangeOrderby", |
| 1942 | "docblock": null, |
| 1943 | "modifiers": [], |
| 1944 | "params": [{ |
| 1945 | "name": "event", |
| 1946 | "type": { |
| 1947 | "name": "ReactChangeEvent", |
| 1948 | "raw": "React.ChangeEvent< HTMLSelectElement >", |
| 1949 | "elements": [{ |
| 1950 | "name": "HTMLSelectElement" |
| 1951 | }] |
| 1952 | } |
| 1953 | }], |
| 1954 | "returns": null |
| 1955 | }, { |
| 1956 | "name": "onReviewsAppended", |
| 1957 | "docblock": null, |
| 1958 | "modifiers": [], |
| 1959 | "params": [{ |
| 1960 | "name": "{ newReviews }: { newReviews: Review[] }", |
| 1961 | "type": { |
| 1962 | "name": "signature", |
| 1963 | "type": "object", |
| 1964 | "raw": "{ newReviews: Review[] }", |
| 1965 | "signature": { |
| 1966 | "properties": [{ |
| 1967 | "key": "newReviews", |
| 1968 | "value": { |
| 1969 | "name": "Array", |
| 1970 | "elements": [{ |
| 1971 | "name": "Review" |
| 1972 | }], |
| 1973 | "raw": "Review[]", |
| 1974 | "required": true |
| 1975 | } |
| 1976 | }] |
| 1977 | } |
| 1978 | } |
| 1979 | }], |
| 1980 | "returns": null |
| 1981 | }, { |
| 1982 | "name": "onReviewsReplaced", |
| 1983 | "docblock": null, |
| 1984 | "modifiers": [], |
| 1985 | "params": [], |
| 1986 | "returns": null |
| 1987 | }, { |
| 1988 | "name": "onReviewsLoadError", |
| 1989 | "docblock": null, |
| 1990 | "modifiers": [], |
| 1991 | "params": [], |
| 1992 | "returns": null |
| 1993 | }], |
| 1994 | "displayName": "FrontendContainerBlock", |
| 1995 | "props": { |
| 1996 | "attributes": { |
| 1997 | "required": true, |
| 1998 | "tsType": { |
| 1999 | "name": "ReviewBlockAttributes" |
| 2000 | }, |
| 2001 | "description": "" |
| 2002 | } |
| 2003 | } |
| 2004 | }; |
| 2005 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FrontendContainerBlock); |
| 2006 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 2007 | STORYBOOK_REACT_CLASSES["assets/js/blocks/reviews/frontend-container-block.tsx"] = { |
| 2008 | name: "FrontendContainerBlock", |
| 2009 | docgenInfo: FrontendContainerBlock.__docgenInfo, |
| 2010 | path: "assets/js/blocks/reviews/frontend-container-block.tsx" |
| 2011 | }; |
| 2012 | } |
| 2013 | |
| 2014 | /***/ }), |
| 2015 | |
| 2016 | /***/ "./assets/js/blocks/reviews/utils.js": |
| 2017 | /*!*******************************************!*\ |
| 2018 | !*** ./assets/js/blocks/reviews/utils.js ***! |
| 2019 | \*******************************************/ |
| 2020 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2021 | |
| 2022 | "use strict"; |
| 2023 | __webpack_require__.r(__webpack_exports__); |
| 2024 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2025 | /* harmony export */ getBlockClassName: () => (/* binding */ getBlockClassName), |
| 2026 | /* harmony export */ getDataAttrs: () => (/* binding */ getDataAttrs), |
| 2027 | /* harmony export */ getReviews: () => (/* binding */ getReviews), |
| 2028 | /* harmony export */ getSortArgs: () => (/* binding */ getSortArgs) |
| 2029 | /* harmony export */ }); |
| 2030 | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch */ "@wordpress/api-fetch"); |
| 2031 | /* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0__); |
| 2032 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 2033 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__); |
| 2034 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 2035 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__); |
| 2036 | /** |
| 2037 | * External dependencies |
| 2038 | */ |
| 2039 | |
| 2040 | |
| 2041 | |
| 2042 | const getSortArgs = sortValue => { |
| 2043 | const reviewRatingsEnabled = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_2__.getSetting)('reviewRatingsEnabled', true); |
| 2044 | if (reviewRatingsEnabled) { |
| 2045 | if (sortValue === 'lowest-rating') { |
| 2046 | return { |
| 2047 | order: 'asc', |
| 2048 | orderby: 'rating' |
| 2049 | }; |
| 2050 | } |
| 2051 | if (sortValue === 'highest-rating') { |
| 2052 | return { |
| 2053 | order: 'desc', |
| 2054 | orderby: 'rating' |
| 2055 | }; |
| 2056 | } |
| 2057 | } |
| 2058 | return { |
| 2059 | order: 'desc', |
| 2060 | orderby: 'date_gmt' |
| 2061 | }; |
| 2062 | }; |
| 2063 | const getReviews = args => { |
| 2064 | return _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_0___default()({ |
| 2065 | path: '/wc/store/v1/products/reviews?' + Object.entries(args).map(arg => arg.join('=')).join('&'), |
| 2066 | parse: false |
| 2067 | }).then(response => { |
| 2068 | return response.json().then(reviews => { |
| 2069 | const totalReviews = parseInt(response.headers.get('x-wp-total'), 10); |
| 2070 | return { |
| 2071 | reviews, |
| 2072 | totalReviews |
| 2073 | }; |
| 2074 | }); |
| 2075 | }); |
| 2076 | }; |
| 2077 | const getBlockClassName = attributes => { |
| 2078 | const { |
| 2079 | className, |
| 2080 | categoryIds, |
| 2081 | productId, |
| 2082 | showReviewDate, |
| 2083 | showReviewerName, |
| 2084 | showReviewContent, |
| 2085 | showProductName, |
| 2086 | showReviewImage, |
| 2087 | showReviewRating |
| 2088 | } = attributes; |
| 2089 | let blockClassName = 'wc-block-all-reviews'; |
| 2090 | if (productId) { |
| 2091 | blockClassName = 'wc-block-reviews-by-product'; |
| 2092 | } |
| 2093 | if (Array.isArray(categoryIds)) { |
| 2094 | blockClassName = 'wc-block-reviews-by-category'; |
| 2095 | } |
| 2096 | return classnames__WEBPACK_IMPORTED_MODULE_1___default()(blockClassName, className, { |
| 2097 | 'has-image': showReviewImage, |
| 2098 | 'has-name': showReviewerName, |
| 2099 | 'has-date': showReviewDate, |
| 2100 | 'has-rating': showReviewRating, |
| 2101 | 'has-content': showReviewContent, |
| 2102 | 'has-product-name': showProductName |
| 2103 | }); |
| 2104 | }; |
| 2105 | const getDataAttrs = attributes => { |
| 2106 | const { |
| 2107 | categoryIds, |
| 2108 | imageType, |
| 2109 | orderby, |
| 2110 | productId, |
| 2111 | reviewsOnPageLoad, |
| 2112 | reviewsOnLoadMore, |
| 2113 | showLoadMore, |
| 2114 | showOrderby |
| 2115 | } = attributes; |
| 2116 | const data = { |
| 2117 | 'data-image-type': imageType, |
| 2118 | 'data-orderby': orderby, |
| 2119 | 'data-reviews-on-page-load': reviewsOnPageLoad, |
| 2120 | 'data-reviews-on-load-more': reviewsOnLoadMore, |
| 2121 | 'data-show-load-more': showLoadMore, |
| 2122 | 'data-show-orderby': showOrderby |
| 2123 | }; |
| 2124 | if (productId) { |
| 2125 | data['data-product-id'] = productId; |
| 2126 | } |
| 2127 | if (Array.isArray(categoryIds)) { |
| 2128 | data['data-category-ids'] = categoryIds.join(','); |
| 2129 | } |
| 2130 | return data; |
| 2131 | }; |
| 2132 | |
| 2133 | /***/ }), |
| 2134 | |
| 2135 | /***/ "./assets/js/settings/blocks/constants.ts": |
| 2136 | /*!************************************************!*\ |
| 2137 | !*** ./assets/js/settings/blocks/constants.ts ***! |
| 2138 | \************************************************/ |
| 2139 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2140 | |
| 2141 | "use strict"; |
| 2142 | __webpack_require__.r(__webpack_exports__); |
| 2143 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2144 | /* harmony export */ ADDITIONAL_FIELDS_KEYS: () => (/* binding */ ADDITIONAL_FIELDS_KEYS), |
| 2145 | /* harmony export */ ADDRESS_FIELDS_KEYS: () => (/* binding */ ADDRESS_FIELDS_KEYS), |
| 2146 | /* harmony export */ ALLOWED_COUNTRIES: () => (/* binding */ ALLOWED_COUNTRIES), |
| 2147 | /* harmony export */ ALLOWED_STATES: () => (/* binding */ ALLOWED_STATES), |
| 2148 | /* harmony export */ CART_PAGE_ID: () => (/* binding */ CART_PAGE_ID), |
| 2149 | /* harmony export */ CART_URL: () => (/* binding */ CART_URL), |
| 2150 | /* harmony export */ CHECKOUT_PAGE_ID: () => (/* binding */ CHECKOUT_PAGE_ID), |
| 2151 | /* harmony export */ CHECKOUT_URL: () => (/* binding */ CHECKOUT_URL), |
| 2152 | /* harmony export */ CONTACT_FIELDS_KEYS: () => (/* binding */ CONTACT_FIELDS_KEYS), |
| 2153 | /* harmony export */ COUNTRY_LOCALE: () => (/* binding */ COUNTRY_LOCALE), |
| 2154 | /* harmony export */ LOCAL_PICKUP_ENABLED: () => (/* binding */ LOCAL_PICKUP_ENABLED), |
| 2155 | /* harmony export */ LOGIN_URL: () => (/* binding */ LOGIN_URL), |
| 2156 | /* harmony export */ PRIVACY_PAGE_NAME: () => (/* binding */ PRIVACY_PAGE_NAME), |
| 2157 | /* harmony export */ PRIVACY_URL: () => (/* binding */ PRIVACY_URL), |
| 2158 | /* harmony export */ SHIPPING_COUNTRIES: () => (/* binding */ SHIPPING_COUNTRIES), |
| 2159 | /* harmony export */ SHIPPING_STATES: () => (/* binding */ SHIPPING_STATES), |
| 2160 | /* harmony export */ SHOP_URL: () => (/* binding */ SHOP_URL), |
| 2161 | /* harmony export */ TERMS_PAGE_NAME: () => (/* binding */ TERMS_PAGE_NAME), |
| 2162 | /* harmony export */ TERMS_URL: () => (/* binding */ TERMS_URL), |
| 2163 | /* harmony export */ WC_BLOCKS_BUILD_URL: () => (/* binding */ WC_BLOCKS_BUILD_URL), |
| 2164 | /* harmony export */ WC_BLOCKS_IMAGE_URL: () => (/* binding */ WC_BLOCKS_IMAGE_URL), |
| 2165 | /* harmony export */ WC_BLOCKS_PHASE: () => (/* binding */ WC_BLOCKS_PHASE), |
| 2166 | /* harmony export */ blocksConfig: () => (/* binding */ blocksConfig) |
| 2167 | /* harmony export */ }); |
| 2168 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/settings */ "@woocommerce/settings"); |
| 2169 | /* harmony import */ var _woocommerce_settings__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__); |
| 2170 | 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; |
| 2171 | /** |
| 2172 | * External dependencies |
| 2173 | */ |
| 2174 | |
| 2175 | const blocksConfig = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('wcBlocksConfig', { |
| 2176 | buildPhase: 1, |
| 2177 | pluginUrl: '', |
| 2178 | productCount: 0, |
| 2179 | defaultAvatar: '', |
| 2180 | restApiRoutes: {}, |
| 2181 | wordCountType: 'words' |
| 2182 | }); |
| 2183 | const WC_BLOCKS_IMAGE_URL = blocksConfig.pluginUrl + 'assets/images/'; |
| 2184 | const WC_BLOCKS_BUILD_URL = blocksConfig.pluginUrl + 'assets/client/blocks/'; |
| 2185 | const WC_BLOCKS_PHASE = blocksConfig.buildPhase; |
| 2186 | 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; |
| 2187 | 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; |
| 2188 | 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; |
| 2189 | 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; |
| 2190 | 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; |
| 2191 | 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; |
| 2192 | 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; |
| 2193 | 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; |
| 2194 | 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; |
| 2195 | 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'); |
| 2196 | const LOCAL_PICKUP_ENABLED = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('localPickupEnabled', false); |
| 2197 | // Contains country names. |
| 2198 | const countries = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('countries', {}); |
| 2199 | |
| 2200 | // Contains country settings. |
| 2201 | const countryData = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('countryData', {}); |
| 2202 | const ALLOWED_COUNTRIES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2203 | return countryData[countryCode].allowBilling === true; |
| 2204 | }).map(countryCode => { |
| 2205 | return [countryCode, countries[countryCode] || '']; |
| 2206 | })); |
| 2207 | const ALLOWED_STATES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2208 | return countryData[countryCode].allowBilling === true; |
| 2209 | }).map(countryCode => { |
| 2210 | return [countryCode, countryData[countryCode].states || []]; |
| 2211 | })); |
| 2212 | const SHIPPING_COUNTRIES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2213 | return countryData[countryCode].allowShipping === true; |
| 2214 | }).map(countryCode => { |
| 2215 | return [countryCode, countries[countryCode] || '']; |
| 2216 | })); |
| 2217 | const SHIPPING_STATES = Object.fromEntries(Object.keys(countryData).filter(countryCode => { |
| 2218 | return countryData[countryCode].allowShipping === true; |
| 2219 | }).map(countryCode => { |
| 2220 | return [countryCode, countryData[countryCode].states || []]; |
| 2221 | })); |
| 2222 | const COUNTRY_LOCALE = Object.fromEntries(Object.keys(countryData).map(countryCode => { |
| 2223 | return [countryCode, countryData[countryCode].locale || []]; |
| 2224 | })); |
| 2225 | const defaultFieldsLocations = { |
| 2226 | address: ['first_name', 'last_name', 'company', 'address_1', 'address_2', 'city', 'postcode', 'country', 'state', 'phone'], |
| 2227 | contact: ['email'], |
| 2228 | additional: [] |
| 2229 | }; |
| 2230 | const ADDRESS_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).address; |
| 2231 | const CONTACT_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).contact; |
| 2232 | const ADDITIONAL_FIELDS_KEYS = (0,_woocommerce_settings__WEBPACK_IMPORTED_MODULE_0__.getSetting)('addressFieldsLocations', defaultFieldsLocations).additional; |
| 2233 | |
| 2234 | /***/ }), |
| 2235 | |
| 2236 | /***/ "./assets/js/settings/blocks/feature-flags.ts": |
| 2237 | /*!****************************************************!*\ |
| 2238 | !*** ./assets/js/settings/blocks/feature-flags.ts ***! |
| 2239 | \****************************************************/ |
| 2240 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2241 | |
| 2242 | "use strict"; |
| 2243 | __webpack_require__.r(__webpack_exports__); |
| 2244 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2245 | /* harmony export */ isExperimentalBuild: () => (/* binding */ isExperimentalBuild), |
| 2246 | /* harmony export */ isFeaturePluginBuild: () => (/* binding */ isFeaturePluginBuild), |
| 2247 | /* harmony export */ registerExperimentalBlockType: () => (/* binding */ registerExperimentalBlockType), |
| 2248 | /* harmony export */ registerFeaturePluginBlockType: () => (/* binding */ registerFeaturePluginBlockType) |
| 2249 | /* harmony export */ }); |
| 2250 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/blocks */ "@wordpress/blocks"); |
| 2251 | /* harmony import */ var _wordpress_blocks__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__); |
| 2252 | /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./assets/js/settings/blocks/constants.ts"); |
| 2253 | /** |
| 2254 | * External dependencies |
| 2255 | */ |
| 2256 | |
| 2257 | /** |
| 2258 | * Internal dependencies |
| 2259 | */ |
| 2260 | |
| 2261 | |
| 2262 | /** |
| 2263 | * Registers a new experimental block provided a unique name and an object defining its |
| 2264 | * behavior. Once registered, the block is made available as an option to any |
| 2265 | * editor interface where blocks are implemented. |
| 2266 | */ |
| 2267 | const registerExperimentalBlockType = (blockNameOrMetadata, settings) => { |
| 2268 | if (_constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 2) { |
| 2269 | return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(blockNameOrMetadata, settings); |
| 2270 | } |
| 2271 | }; |
| 2272 | |
| 2273 | /** |
| 2274 | * Registers a new feature plugin block provided a unique name and an object |
| 2275 | * defining its behavior. Once registered, the block is made available as an |
| 2276 | * option to any editor interface where blocks are implemented. |
| 2277 | */ |
| 2278 | const registerFeaturePluginBlockType = (blockNameOrMetadata, settings) => { |
| 2279 | if (_constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 1) { |
| 2280 | return (0,_wordpress_blocks__WEBPACK_IMPORTED_MODULE_0__.registerBlockType)(blockNameOrMetadata, settings); |
| 2281 | } |
| 2282 | }; |
| 2283 | |
| 2284 | /** |
| 2285 | * Checks if we're executing the code in an experimental build mode. |
| 2286 | * |
| 2287 | * @return {boolean} True if this is an experimental build, false otherwise. |
| 2288 | */ |
| 2289 | const isExperimentalBuild = () => _constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 2; |
| 2290 | |
| 2291 | /** |
| 2292 | * Checks if we're executing the code in an feature plugin or experimental build mode. |
| 2293 | * |
| 2294 | * @return {boolean} True if this is an experimental or feature plugin build, false otherwise. |
| 2295 | */ |
| 2296 | const isFeaturePluginBuild = () => _constants__WEBPACK_IMPORTED_MODULE_1__.WC_BLOCKS_PHASE > 1; |
| 2297 | |
| 2298 | /***/ }), |
| 2299 | |
| 2300 | /***/ "./assets/js/settings/blocks/index.ts": |
| 2301 | /*!********************************************!*\ |
| 2302 | !*** ./assets/js/settings/blocks/index.ts ***! |
| 2303 | \********************************************/ |
| 2304 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2305 | |
| 2306 | "use strict"; |
| 2307 | __webpack_require__.r(__webpack_exports__); |
| 2308 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2309 | /* harmony export */ ADDITIONAL_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ADDITIONAL_FIELDS_KEYS), |
| 2310 | /* harmony export */ ADDRESS_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ADDRESS_FIELDS_KEYS), |
| 2311 | /* harmony export */ ALLOWED_COUNTRIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ALLOWED_COUNTRIES), |
| 2312 | /* harmony export */ ALLOWED_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.ALLOWED_STATES), |
| 2313 | /* harmony export */ CART_PAGE_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CART_PAGE_ID), |
| 2314 | /* harmony export */ CART_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CART_URL), |
| 2315 | /* harmony export */ CHECKOUT_PAGE_ID: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CHECKOUT_PAGE_ID), |
| 2316 | /* harmony export */ CHECKOUT_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CHECKOUT_URL), |
| 2317 | /* harmony export */ CONTACT_FIELDS_KEYS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.CONTACT_FIELDS_KEYS), |
| 2318 | /* harmony export */ COUNTRY_LOCALE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.COUNTRY_LOCALE), |
| 2319 | /* harmony export */ LOCAL_PICKUP_ENABLED: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.LOCAL_PICKUP_ENABLED), |
| 2320 | /* harmony export */ LOGIN_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.LOGIN_URL), |
| 2321 | /* harmony export */ PRIVACY_PAGE_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PRIVACY_PAGE_NAME), |
| 2322 | /* harmony export */ PRIVACY_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.PRIVACY_URL), |
| 2323 | /* harmony export */ SHIPPING_COUNTRIES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHIPPING_COUNTRIES), |
| 2324 | /* harmony export */ SHIPPING_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHIPPING_STATES), |
| 2325 | /* harmony export */ SHOP_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.SHOP_URL), |
| 2326 | /* harmony export */ TERMS_PAGE_NAME: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.TERMS_PAGE_NAME), |
| 2327 | /* harmony export */ TERMS_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.TERMS_URL), |
| 2328 | /* harmony export */ WC_BLOCKS_BUILD_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_BUILD_URL), |
| 2329 | /* harmony export */ WC_BLOCKS_IMAGE_URL: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_IMAGE_URL), |
| 2330 | /* harmony export */ WC_BLOCKS_PHASE: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.WC_BLOCKS_PHASE), |
| 2331 | /* harmony export */ blocksConfig: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_0__.blocksConfig), |
| 2332 | /* harmony export */ isExperimentalBuild: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.isExperimentalBuild), |
| 2333 | /* harmony export */ isFeaturePluginBuild: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.isFeaturePluginBuild), |
| 2334 | /* harmony export */ registerExperimentalBlockType: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.registerExperimentalBlockType), |
| 2335 | /* harmony export */ registerFeaturePluginBlockType: () => (/* reexport safe */ _feature_flags__WEBPACK_IMPORTED_MODULE_1__.registerFeaturePluginBlockType) |
| 2336 | /* harmony export */ }); |
| 2337 | /* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./assets/js/settings/blocks/constants.ts"); |
| 2338 | /* harmony import */ var _feature_flags__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./feature-flags */ "./assets/js/settings/blocks/feature-flags.ts"); |
| 2339 | /** |
| 2340 | * Internal dependencies |
| 2341 | */ |
| 2342 | |
| 2343 | |
| 2344 | |
| 2345 | /***/ }), |
| 2346 | |
| 2347 | /***/ "./packages/components/label/index.tsx": |
| 2348 | /*!*********************************************!*\ |
| 2349 | !*** ./packages/components/label/index.tsx ***! |
| 2350 | \*********************************************/ |
| 2351 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
| 2352 | |
| 2353 | "use strict"; |
| 2354 | __webpack_require__.r(__webpack_exports__); |
| 2355 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 2356 | /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) |
| 2357 | /* harmony export */ }); |
| 2358 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react"); |
| 2359 | /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__); |
| 2360 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "@wordpress/element"); |
| 2361 | /* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__); |
| 2362 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! classnames */ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js"); |
| 2363 | /* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_2__); |
| 2364 | |
| 2365 | /** |
| 2366 | * External dependencies |
| 2367 | */ |
| 2368 | |
| 2369 | |
| 2370 | /** |
| 2371 | * Component used to render an accessible text given a label and/or a |
| 2372 | * screenReaderLabel. The wrapper element and wrapper props can also be |
| 2373 | * specified via props. |
| 2374 | * |
| 2375 | */ |
| 2376 | const Label = ({ |
| 2377 | label, |
| 2378 | screenReaderLabel, |
| 2379 | wrapperElement, |
| 2380 | wrapperProps = {} |
| 2381 | }) => { |
| 2382 | let Wrapper; |
| 2383 | const hasLabel = typeof label !== 'undefined' && label !== null; |
| 2384 | const hasScreenReaderLabel = typeof screenReaderLabel !== 'undefined' && screenReaderLabel !== null; |
| 2385 | if (!hasLabel && hasScreenReaderLabel) { |
| 2386 | Wrapper = wrapperElement || 'span'; |
| 2387 | wrapperProps = { |
| 2388 | ...wrapperProps, |
| 2389 | className: classnames__WEBPACK_IMPORTED_MODULE_2___default()(wrapperProps.className, 'screen-reader-text') |
| 2390 | }; |
| 2391 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Wrapper, { |
| 2392 | ...wrapperProps |
| 2393 | }, screenReaderLabel); |
| 2394 | } |
| 2395 | Wrapper = wrapperElement || _wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment; |
| 2396 | if (hasLabel && hasScreenReaderLabel && label !== screenReaderLabel) { |
| 2397 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Wrapper, { |
| 2398 | ...wrapperProps |
| 2399 | }, (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 2400 | "aria-hidden": "true" |
| 2401 | }, label), (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)("span", { |
| 2402 | className: "screen-reader-text" |
| 2403 | }, screenReaderLabel)); |
| 2404 | } |
| 2405 | return (0,react__WEBPACK_IMPORTED_MODULE_0__.createElement)(Wrapper, { |
| 2406 | ...wrapperProps |
| 2407 | }, label); |
| 2408 | }; |
| 2409 | Label.__docgenInfo = { |
| 2410 | "description": "Component used to render an accessible text given a label and/or a\nscreenReaderLabel. The wrapper element and wrapper props can also be\nspecified via props.", |
| 2411 | "methods": [], |
| 2412 | "displayName": "Label", |
| 2413 | "props": { |
| 2414 | "wrapperProps": { |
| 2415 | "defaultValue": { |
| 2416 | "value": "{}", |
| 2417 | "computed": false |
| 2418 | }, |
| 2419 | "required": false, |
| 2420 | "tsType": { |
| 2421 | "name": "union", |
| 2422 | "raw": "HTMLProps< HTMLElement > | undefined", |
| 2423 | "elements": [{ |
| 2424 | "name": "HTMLProps", |
| 2425 | "elements": [{ |
| 2426 | "name": "HTMLElement" |
| 2427 | }], |
| 2428 | "raw": "HTMLProps< HTMLElement >" |
| 2429 | }, { |
| 2430 | "name": "undefined" |
| 2431 | }] |
| 2432 | }, |
| 2433 | "description": "" |
| 2434 | }, |
| 2435 | "label": { |
| 2436 | "required": false, |
| 2437 | "tsType": { |
| 2438 | "name": "union", |
| 2439 | "raw": "string | undefined", |
| 2440 | "elements": [{ |
| 2441 | "name": "string" |
| 2442 | }, { |
| 2443 | "name": "undefined" |
| 2444 | }] |
| 2445 | }, |
| 2446 | "description": "" |
| 2447 | }, |
| 2448 | "screenReaderLabel": { |
| 2449 | "required": false, |
| 2450 | "tsType": { |
| 2451 | "name": "union", |
| 2452 | "raw": "string | undefined", |
| 2453 | "elements": [{ |
| 2454 | "name": "string" |
| 2455 | }, { |
| 2456 | "name": "undefined" |
| 2457 | }] |
| 2458 | }, |
| 2459 | "description": "" |
| 2460 | }, |
| 2461 | "wrapperElement": { |
| 2462 | "required": false, |
| 2463 | "tsType": { |
| 2464 | "name": "union", |
| 2465 | "raw": "string | undefined", |
| 2466 | "elements": [{ |
| 2467 | "name": "string" |
| 2468 | }, { |
| 2469 | "name": "undefined" |
| 2470 | }] |
| 2471 | }, |
| 2472 | "description": "" |
| 2473 | } |
| 2474 | }, |
| 2475 | "composes": ["HTMLProps"] |
| 2476 | }; |
| 2477 | /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Label); |
| 2478 | if (typeof STORYBOOK_REACT_CLASSES !== "undefined") { |
| 2479 | STORYBOOK_REACT_CLASSES["packages/components/label/index.tsx"] = { |
| 2480 | name: "Label", |
| 2481 | docgenInfo: Label.__docgenInfo, |
| 2482 | path: "packages/components/label/index.tsx" |
| 2483 | }; |
| 2484 | } |
| 2485 | |
| 2486 | /***/ }), |
| 2487 | |
| 2488 | /***/ "../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js": |
| 2489 | /*!**********************************************************************************!*\ |
| 2490 | !*** ../../node_modules/.pnpm/classnames@2.3.1/node_modules/classnames/index.js ***! |
| 2491 | \**********************************************************************************/ |
| 2492 | /***/ ((module, exports) => { |
| 2493 | |
| 2494 | var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! |
| 2495 | Copyright (c) 2018 Jed Watson. |
| 2496 | Licensed under the MIT License (MIT), see |
| 2497 | http://jedwatson.github.io/classnames |
| 2498 | */ |
| 2499 | /* global define */ |
| 2500 | |
| 2501 | (function () { |
| 2502 | 'use strict'; |
| 2503 | |
| 2504 | var hasOwn = {}.hasOwnProperty; |
| 2505 | |
| 2506 | function classNames() { |
| 2507 | var classes = []; |
| 2508 | |
| 2509 | for (var i = 0; i < arguments.length; i++) { |
| 2510 | var arg = arguments[i]; |
| 2511 | if (!arg) continue; |
| 2512 | |
| 2513 | var argType = typeof arg; |
| 2514 | |
| 2515 | if (argType === 'string' || argType === 'number') { |
| 2516 | classes.push(arg); |
| 2517 | } else if (Array.isArray(arg)) { |
| 2518 | if (arg.length) { |
| 2519 | var inner = classNames.apply(null, arg); |
| 2520 | if (inner) { |
| 2521 | classes.push(inner); |
| 2522 | } |
| 2523 | } |
| 2524 | } else if (argType === 'object') { |
| 2525 | if (arg.toString === Object.prototype.toString) { |
| 2526 | for (var key in arg) { |
| 2527 | if (hasOwn.call(arg, key) && arg[key]) { |
| 2528 | classes.push(key); |
| 2529 | } |
| 2530 | } |
| 2531 | } else { |
| 2532 | classes.push(arg.toString()); |
| 2533 | } |
| 2534 | } |
| 2535 | } |
| 2536 | |
| 2537 | return classes.join(' '); |
| 2538 | } |
| 2539 | |
| 2540 | if ( true && module.exports) { |
| 2541 | classNames.default = classNames; |
| 2542 | module.exports = classNames; |
| 2543 | } else if (true) { |
| 2544 | // register as 'classnames', consistent with npm package name |
| 2545 | !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { |
| 2546 | return classNames; |
| 2547 | }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), |
| 2548 | __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); |
| 2549 | } else {} |
| 2550 | }()); |
| 2551 | |
| 2552 | |
| 2553 | /***/ }), |
| 2554 | |
| 2555 | /***/ "./assets/js/base/components/block-error-boundary/style.scss": |
| 2556 | /*!*******************************************************************!*\ |
| 2557 | !*** ./assets/js/base/components/block-error-boundary/style.scss ***! |
| 2558 | \*******************************************************************/ |
| 2559 | /***/ (() => { |
| 2560 | |
| 2561 | |
| 2562 | |
| 2563 | /***/ }), |
| 2564 | |
| 2565 | /***/ "./assets/js/base/components/load-more-button/style.scss": |
| 2566 | /*!***************************************************************!*\ |
| 2567 | !*** ./assets/js/base/components/load-more-button/style.scss ***! |
| 2568 | \***************************************************************/ |
| 2569 | /***/ (() => { |
| 2570 | |
| 2571 | |
| 2572 | |
| 2573 | /***/ }), |
| 2574 | |
| 2575 | /***/ "./assets/js/base/components/reviews/review-list-item/style.scss": |
| 2576 | /*!***********************************************************************!*\ |
| 2577 | !*** ./assets/js/base/components/reviews/review-list-item/style.scss ***! |
| 2578 | \***********************************************************************/ |
| 2579 | /***/ (() => { |
| 2580 | |
| 2581 | |
| 2582 | |
| 2583 | /***/ }), |
| 2584 | |
| 2585 | /***/ "./assets/js/base/components/reviews/review-list/style.scss": |
| 2586 | /*!******************************************************************!*\ |
| 2587 | !*** ./assets/js/base/components/reviews/review-list/style.scss ***! |
| 2588 | \******************************************************************/ |
| 2589 | /***/ (() => { |
| 2590 | |
| 2591 | |
| 2592 | |
| 2593 | /***/ }), |
| 2594 | |
| 2595 | /***/ "./assets/js/base/components/reviews/review-sort-select/style.scss": |
| 2596 | /*!*************************************************************************!*\ |
| 2597 | !*** ./assets/js/base/components/reviews/review-sort-select/style.scss ***! |
| 2598 | \*************************************************************************/ |
| 2599 | /***/ (() => { |
| 2600 | |
| 2601 | |
| 2602 | |
| 2603 | /***/ }), |
| 2604 | |
| 2605 | /***/ "../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js": |
| 2606 | /*!****************************************************************************************!*\ |
| 2607 | !*** ../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js ***! |
| 2608 | \****************************************************************************************/ |
| 2609 | /***/ ((module) => { |
| 2610 | |
| 2611 | "use strict"; |
| 2612 | /* |
| 2613 | object-assign |
| 2614 | (c) Sindre Sorhus |
| 2615 | @license MIT |
| 2616 | */ |
| 2617 | |
| 2618 | |
| 2619 | /* eslint-disable no-unused-vars */ |
| 2620 | var getOwnPropertySymbols = Object.getOwnPropertySymbols; |
| 2621 | var hasOwnProperty = Object.prototype.hasOwnProperty; |
| 2622 | var propIsEnumerable = Object.prototype.propertyIsEnumerable; |
| 2623 | |
| 2624 | function toObject(val) { |
| 2625 | if (val === null || val === undefined) { |
| 2626 | throw new TypeError('Object.assign cannot be called with null or undefined'); |
| 2627 | } |
| 2628 | |
| 2629 | return Object(val); |
| 2630 | } |
| 2631 | |
| 2632 | function shouldUseNative() { |
| 2633 | try { |
| 2634 | if (!Object.assign) { |
| 2635 | return false; |
| 2636 | } |
| 2637 | |
| 2638 | // Detect buggy property enumeration order in older V8 versions. |
| 2639 | |
| 2640 | // https://bugs.chromium.org/p/v8/issues/detail?id=4118 |
| 2641 | var test1 = new String('abc'); // eslint-disable-line no-new-wrappers |
| 2642 | test1[5] = 'de'; |
| 2643 | if (Object.getOwnPropertyNames(test1)[0] === '5') { |
| 2644 | return false; |
| 2645 | } |
| 2646 | |
| 2647 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 |
| 2648 | var test2 = {}; |
| 2649 | for (var i = 0; i < 10; i++) { |
| 2650 | test2['_' + String.fromCharCode(i)] = i; |
| 2651 | } |
| 2652 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) { |
| 2653 | return test2[n]; |
| 2654 | }); |
| 2655 | if (order2.join('') !== '0123456789') { |
| 2656 | return false; |
| 2657 | } |
| 2658 | |
| 2659 | // https://bugs.chromium.org/p/v8/issues/detail?id=3056 |
| 2660 | var test3 = {}; |
| 2661 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { |
| 2662 | test3[letter] = letter; |
| 2663 | }); |
| 2664 | if (Object.keys(Object.assign({}, test3)).join('') !== |
| 2665 | 'abcdefghijklmnopqrst') { |
| 2666 | return false; |
| 2667 | } |
| 2668 | |
| 2669 | return true; |
| 2670 | } catch (err) { |
| 2671 | // We don't expect any of the above to throw, but better to be safe. |
| 2672 | return false; |
| 2673 | } |
| 2674 | } |
| 2675 | |
| 2676 | module.exports = shouldUseNative() ? Object.assign : function (target, source) { |
| 2677 | var from; |
| 2678 | var to = toObject(target); |
| 2679 | var symbols; |
| 2680 | |
| 2681 | for (var s = 1; s < arguments.length; s++) { |
| 2682 | from = Object(arguments[s]); |
| 2683 | |
| 2684 | for (var key in from) { |
| 2685 | if (hasOwnProperty.call(from, key)) { |
| 2686 | to[key] = from[key]; |
| 2687 | } |
| 2688 | } |
| 2689 | |
| 2690 | if (getOwnPropertySymbols) { |
| 2691 | symbols = getOwnPropertySymbols(from); |
| 2692 | for (var i = 0; i < symbols.length; i++) { |
| 2693 | if (propIsEnumerable.call(from, symbols[i])) { |
| 2694 | to[symbols[i]] = from[symbols[i]]; |
| 2695 | } |
| 2696 | } |
| 2697 | } |
| 2698 | } |
| 2699 | |
| 2700 | return to; |
| 2701 | }; |
| 2702 | |
| 2703 | |
| 2704 | /***/ }), |
| 2705 | |
| 2706 | /***/ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js": |
| 2707 | /*!********************************************************************************************!*\ |
| 2708 | !*** ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js ***! |
| 2709 | \********************************************************************************************/ |
| 2710 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2711 | |
| 2712 | "use strict"; |
| 2713 | /** |
| 2714 | * Copyright (c) 2013-present, Facebook, Inc. |
| 2715 | * |
| 2716 | * This source code is licensed under the MIT license found in the |
| 2717 | * LICENSE file in the root directory of this source tree. |
| 2718 | */ |
| 2719 | |
| 2720 | |
| 2721 | |
| 2722 | var printWarning = function() {}; |
| 2723 | |
| 2724 | if (true) { |
| 2725 | var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js"); |
| 2726 | var loggedTypeFailures = {}; |
| 2727 | var has = __webpack_require__(/*! ./lib/has */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js"); |
| 2728 | |
| 2729 | printWarning = function(text) { |
| 2730 | var message = 'Warning: ' + text; |
| 2731 | if (typeof console !== 'undefined') { |
| 2732 | console.error(message); |
| 2733 | } |
| 2734 | try { |
| 2735 | // --- Welcome to debugging React --- |
| 2736 | // This error was thrown as a convenience so that you can use this stack |
| 2737 | // to find the callsite that caused this warning to fire. |
| 2738 | throw new Error(message); |
| 2739 | } catch (x) { /**/ } |
| 2740 | }; |
| 2741 | } |
| 2742 | |
| 2743 | /** |
| 2744 | * Assert that the values match with the type specs. |
| 2745 | * Error messages are memorized and will only be shown once. |
| 2746 | * |
| 2747 | * @param {object} typeSpecs Map of name to a ReactPropType |
| 2748 | * @param {object} values Runtime values that need to be type-checked |
| 2749 | * @param {string} location e.g. "prop", "context", "child context" |
| 2750 | * @param {string} componentName Name of the component for error messages. |
| 2751 | * @param {?Function} getStack Returns the component stack. |
| 2752 | * @private |
| 2753 | */ |
| 2754 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) { |
| 2755 | if (true) { |
| 2756 | for (var typeSpecName in typeSpecs) { |
| 2757 | if (has(typeSpecs, typeSpecName)) { |
| 2758 | var error; |
| 2759 | // Prop type validation may throw. In case they do, we don't want to |
| 2760 | // fail the render phase where it didn't fail before. So we log it. |
| 2761 | // After these have been cleaned up, we'll let them throw. |
| 2762 | try { |
| 2763 | // This is intentionally an invariant that gets caught. It's the same |
| 2764 | // behavior as without this statement except with a better message. |
| 2765 | if (typeof typeSpecs[typeSpecName] !== 'function') { |
| 2766 | var err = Error( |
| 2767 | (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + |
| 2768 | 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + |
| 2769 | 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' |
| 2770 | ); |
| 2771 | err.name = 'Invariant Violation'; |
| 2772 | throw err; |
| 2773 | } |
| 2774 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); |
| 2775 | } catch (ex) { |
| 2776 | error = ex; |
| 2777 | } |
| 2778 | if (error && !(error instanceof Error)) { |
| 2779 | printWarning( |
| 2780 | (componentName || 'React class') + ': type specification of ' + |
| 2781 | location + ' `' + typeSpecName + '` is invalid; the type checker ' + |
| 2782 | 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + |
| 2783 | 'You may have forgotten to pass an argument to the type checker ' + |
| 2784 | 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + |
| 2785 | 'shape all require an argument).' |
| 2786 | ); |
| 2787 | } |
| 2788 | if (error instanceof Error && !(error.message in loggedTypeFailures)) { |
| 2789 | // Only monitor this failure once because there tends to be a lot of the |
| 2790 | // same error. |
| 2791 | loggedTypeFailures[error.message] = true; |
| 2792 | |
| 2793 | var stack = getStack ? getStack() : ''; |
| 2794 | |
| 2795 | printWarning( |
| 2796 | 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') |
| 2797 | ); |
| 2798 | } |
| 2799 | } |
| 2800 | } |
| 2801 | } |
| 2802 | } |
| 2803 | |
| 2804 | /** |
| 2805 | * Resets warning cache when testing. |
| 2806 | * |
| 2807 | * @private |
| 2808 | */ |
| 2809 | checkPropTypes.resetWarningCache = function() { |
| 2810 | if (true) { |
| 2811 | loggedTypeFailures = {}; |
| 2812 | } |
| 2813 | } |
| 2814 | |
| 2815 | module.exports = checkPropTypes; |
| 2816 | |
| 2817 | |
| 2818 | /***/ }), |
| 2819 | |
| 2820 | /***/ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js": |
| 2821 | /*!*****************************************************************************************************!*\ |
| 2822 | !*** ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js ***! |
| 2823 | \*****************************************************************************************************/ |
| 2824 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 2825 | |
| 2826 | "use strict"; |
| 2827 | /** |
| 2828 | * Copyright (c) 2013-present, Facebook, Inc. |
| 2829 | * |
| 2830 | * This source code is licensed under the MIT license found in the |
| 2831 | * LICENSE file in the root directory of this source tree. |
| 2832 | */ |
| 2833 | |
| 2834 | |
| 2835 | |
| 2836 | var ReactIs = __webpack_require__(/*! react-is */ "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js"); |
| 2837 | var assign = __webpack_require__(/*! object-assign */ "../../node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.js"); |
| 2838 | |
| 2839 | var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js"); |
| 2840 | var has = __webpack_require__(/*! ./lib/has */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js"); |
| 2841 | var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.js"); |
| 2842 | |
| 2843 | var printWarning = function() {}; |
| 2844 | |
| 2845 | if (true) { |
| 2846 | printWarning = function(text) { |
| 2847 | var message = 'Warning: ' + text; |
| 2848 | if (typeof console !== 'undefined') { |
| 2849 | console.error(message); |
| 2850 | } |
| 2851 | try { |
| 2852 | // --- Welcome to debugging React --- |
| 2853 | // This error was thrown as a convenience so that you can use this stack |
| 2854 | // to find the callsite that caused this warning to fire. |
| 2855 | throw new Error(message); |
| 2856 | } catch (x) {} |
| 2857 | }; |
| 2858 | } |
| 2859 | |
| 2860 | function emptyFunctionThatReturnsNull() { |
| 2861 | return null; |
| 2862 | } |
| 2863 | |
| 2864 | module.exports = function(isValidElement, throwOnDirectAccess) { |
| 2865 | /* global Symbol */ |
| 2866 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; |
| 2867 | var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. |
| 2868 | |
| 2869 | /** |
| 2870 | * Returns the iterator method function contained on the iterable object. |
| 2871 | * |
| 2872 | * Be sure to invoke the function with the iterable as context: |
| 2873 | * |
| 2874 | * var iteratorFn = getIteratorFn(myIterable); |
| 2875 | * if (iteratorFn) { |
| 2876 | * var iterator = iteratorFn.call(myIterable); |
| 2877 | * ... |
| 2878 | * } |
| 2879 | * |
| 2880 | * @param {?object} maybeIterable |
| 2881 | * @return {?function} |
| 2882 | */ |
| 2883 | function getIteratorFn(maybeIterable) { |
| 2884 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); |
| 2885 | if (typeof iteratorFn === 'function') { |
| 2886 | return iteratorFn; |
| 2887 | } |
| 2888 | } |
| 2889 | |
| 2890 | /** |
| 2891 | * Collection of methods that allow declaration and validation of props that are |
| 2892 | * supplied to React components. Example usage: |
| 2893 | * |
| 2894 | * var Props = require('ReactPropTypes'); |
| 2895 | * var MyArticle = React.createClass({ |
| 2896 | * propTypes: { |
| 2897 | * // An optional string prop named "description". |
| 2898 | * description: Props.string, |
| 2899 | * |
| 2900 | * // A required enum prop named "category". |
| 2901 | * category: Props.oneOf(['News','Photos']).isRequired, |
| 2902 | * |
| 2903 | * // A prop named "dialog" that requires an instance of Dialog. |
| 2904 | * dialog: Props.instanceOf(Dialog).isRequired |
| 2905 | * }, |
| 2906 | * render: function() { ... } |
| 2907 | * }); |
| 2908 | * |
| 2909 | * A more formal specification of how these methods are used: |
| 2910 | * |
| 2911 | * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) |
| 2912 | * decl := ReactPropTypes.{type}(.isRequired)? |
| 2913 | * |
| 2914 | * Each and every declaration produces a function with the same signature. This |
| 2915 | * allows the creation of custom validation functions. For example: |
| 2916 | * |
| 2917 | * var MyLink = React.createClass({ |
| 2918 | * propTypes: { |
| 2919 | * // An optional string or URI prop named "href". |
| 2920 | * href: function(props, propName, componentName) { |
| 2921 | * var propValue = props[propName]; |
| 2922 | * if (propValue != null && typeof propValue !== 'string' && |
| 2923 | * !(propValue instanceof URI)) { |
| 2924 | * return new Error( |
| 2925 | * 'Expected a string or an URI for ' + propName + ' in ' + |
| 2926 | * componentName |
| 2927 | * ); |
| 2928 | * } |
| 2929 | * } |
| 2930 | * }, |
| 2931 | * render: function() {...} |
| 2932 | * }); |
| 2933 | * |
| 2934 | * @internal |
| 2935 | */ |
| 2936 | |
| 2937 | var ANONYMOUS = '<<anonymous>>'; |
| 2938 | |
| 2939 | // Important! |
| 2940 | // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. |
| 2941 | var ReactPropTypes = { |
| 2942 | array: createPrimitiveTypeChecker('array'), |
| 2943 | bigint: createPrimitiveTypeChecker('bigint'), |
| 2944 | bool: createPrimitiveTypeChecker('boolean'), |
| 2945 | func: createPrimitiveTypeChecker('function'), |
| 2946 | number: createPrimitiveTypeChecker('number'), |
| 2947 | object: createPrimitiveTypeChecker('object'), |
| 2948 | string: createPrimitiveTypeChecker('string'), |
| 2949 | symbol: createPrimitiveTypeChecker('symbol'), |
| 2950 | |
| 2951 | any: createAnyTypeChecker(), |
| 2952 | arrayOf: createArrayOfTypeChecker, |
| 2953 | element: createElementTypeChecker(), |
| 2954 | elementType: createElementTypeTypeChecker(), |
| 2955 | instanceOf: createInstanceTypeChecker, |
| 2956 | node: createNodeChecker(), |
| 2957 | objectOf: createObjectOfTypeChecker, |
| 2958 | oneOf: createEnumTypeChecker, |
| 2959 | oneOfType: createUnionTypeChecker, |
| 2960 | shape: createShapeTypeChecker, |
| 2961 | exact: createStrictShapeTypeChecker, |
| 2962 | }; |
| 2963 | |
| 2964 | /** |
| 2965 | * inlined Object.is polyfill to avoid requiring consumers ship their own |
| 2966 | * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is |
| 2967 | */ |
| 2968 | /*eslint-disable no-self-compare*/ |
| 2969 | function is(x, y) { |
| 2970 | // SameValue algorithm |
| 2971 | if (x === y) { |
| 2972 | // Steps 1-5, 7-10 |
| 2973 | // Steps 6.b-6.e: +0 != -0 |
| 2974 | return x !== 0 || 1 / x === 1 / y; |
| 2975 | } else { |
| 2976 | // Step 6.a: NaN == NaN |
| 2977 | return x !== x && y !== y; |
| 2978 | } |
| 2979 | } |
| 2980 | /*eslint-enable no-self-compare*/ |
| 2981 | |
| 2982 | /** |
| 2983 | * We use an Error-like object for backward compatibility as people may call |
| 2984 | * PropTypes directly and inspect their output. However, we don't use real |
| 2985 | * Errors anymore. We don't inspect their stack anyway, and creating them |
| 2986 | * is prohibitively expensive if they are created too often, such as what |
| 2987 | * happens in oneOfType() for any type before the one that matched. |
| 2988 | */ |
| 2989 | function PropTypeError(message, data) { |
| 2990 | this.message = message; |
| 2991 | this.data = data && typeof data === 'object' ? data: {}; |
| 2992 | this.stack = ''; |
| 2993 | } |
| 2994 | // Make `instanceof Error` still work for returned errors. |
| 2995 | PropTypeError.prototype = Error.prototype; |
| 2996 | |
| 2997 | function createChainableTypeChecker(validate) { |
| 2998 | if (true) { |
| 2999 | var manualPropTypeCallCache = {}; |
| 3000 | var manualPropTypeWarningCount = 0; |
| 3001 | } |
| 3002 | function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { |
| 3003 | componentName = componentName || ANONYMOUS; |
| 3004 | propFullName = propFullName || propName; |
| 3005 | |
| 3006 | if (secret !== ReactPropTypesSecret) { |
| 3007 | if (throwOnDirectAccess) { |
| 3008 | // New behavior only for users of `prop-types` package |
| 3009 | var err = new Error( |
| 3010 | 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + |
| 3011 | 'Use `PropTypes.checkPropTypes()` to call them. ' + |
| 3012 | 'Read more at http://fb.me/use-check-prop-types' |
| 3013 | ); |
| 3014 | err.name = 'Invariant Violation'; |
| 3015 | throw err; |
| 3016 | } else if ( true && typeof console !== 'undefined') { |
| 3017 | // Old behavior for people using React.PropTypes |
| 3018 | var cacheKey = componentName + ':' + propName; |
| 3019 | if ( |
| 3020 | !manualPropTypeCallCache[cacheKey] && |
| 3021 | // Avoid spamming the console because they are often not actionable except for lib authors |
| 3022 | manualPropTypeWarningCount < 3 |
| 3023 | ) { |
| 3024 | printWarning( |
| 3025 | 'You are manually calling a React.PropTypes validation ' + |
| 3026 | 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + |
| 3027 | 'and will throw in the standalone `prop-types` package. ' + |
| 3028 | 'You may be seeing this warning due to a third-party PropTypes ' + |
| 3029 | 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' |
| 3030 | ); |
| 3031 | manualPropTypeCallCache[cacheKey] = true; |
| 3032 | manualPropTypeWarningCount++; |
| 3033 | } |
| 3034 | } |
| 3035 | } |
| 3036 | if (props[propName] == null) { |
| 3037 | if (isRequired) { |
| 3038 | if (props[propName] === null) { |
| 3039 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); |
| 3040 | } |
| 3041 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); |
| 3042 | } |
| 3043 | return null; |
| 3044 | } else { |
| 3045 | return validate(props, propName, componentName, location, propFullName); |
| 3046 | } |
| 3047 | } |
| 3048 | |
| 3049 | var chainedCheckType = checkType.bind(null, false); |
| 3050 | chainedCheckType.isRequired = checkType.bind(null, true); |
| 3051 | |
| 3052 | return chainedCheckType; |
| 3053 | } |
| 3054 | |
| 3055 | function createPrimitiveTypeChecker(expectedType) { |
| 3056 | function validate(props, propName, componentName, location, propFullName, secret) { |
| 3057 | var propValue = props[propName]; |
| 3058 | var propType = getPropType(propValue); |
| 3059 | if (propType !== expectedType) { |
| 3060 | // `propValue` being instance of, say, date/regexp, pass the 'object' |
| 3061 | // check, but we can offer a more precise error message here rather than |
| 3062 | // 'of type `object`'. |
| 3063 | var preciseType = getPreciseType(propValue); |
| 3064 | |
| 3065 | return new PropTypeError( |
| 3066 | 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), |
| 3067 | {expectedType: expectedType} |
| 3068 | ); |
| 3069 | } |
| 3070 | return null; |
| 3071 | } |
| 3072 | return createChainableTypeChecker(validate); |
| 3073 | } |
| 3074 | |
| 3075 | function createAnyTypeChecker() { |
| 3076 | return createChainableTypeChecker(emptyFunctionThatReturnsNull); |
| 3077 | } |
| 3078 | |
| 3079 | function createArrayOfTypeChecker(typeChecker) { |
| 3080 | function validate(props, propName, componentName, location, propFullName) { |
| 3081 | if (typeof typeChecker !== 'function') { |
| 3082 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); |
| 3083 | } |
| 3084 | var propValue = props[propName]; |
| 3085 | if (!Array.isArray(propValue)) { |
| 3086 | var propType = getPropType(propValue); |
| 3087 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); |
| 3088 | } |
| 3089 | for (var i = 0; i < propValue.length; i++) { |
| 3090 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); |
| 3091 | if (error instanceof Error) { |
| 3092 | return error; |
| 3093 | } |
| 3094 | } |
| 3095 | return null; |
| 3096 | } |
| 3097 | return createChainableTypeChecker(validate); |
| 3098 | } |
| 3099 | |
| 3100 | function createElementTypeChecker() { |
| 3101 | function validate(props, propName, componentName, location, propFullName) { |
| 3102 | var propValue = props[propName]; |
| 3103 | if (!isValidElement(propValue)) { |
| 3104 | var propType = getPropType(propValue); |
| 3105 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); |
| 3106 | } |
| 3107 | return null; |
| 3108 | } |
| 3109 | return createChainableTypeChecker(validate); |
| 3110 | } |
| 3111 | |
| 3112 | function createElementTypeTypeChecker() { |
| 3113 | function validate(props, propName, componentName, location, propFullName) { |
| 3114 | var propValue = props[propName]; |
| 3115 | if (!ReactIs.isValidElementType(propValue)) { |
| 3116 | var propType = getPropType(propValue); |
| 3117 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); |
| 3118 | } |
| 3119 | return null; |
| 3120 | } |
| 3121 | return createChainableTypeChecker(validate); |
| 3122 | } |
| 3123 | |
| 3124 | function createInstanceTypeChecker(expectedClass) { |
| 3125 | function validate(props, propName, componentName, location, propFullName) { |
| 3126 | if (!(props[propName] instanceof expectedClass)) { |
| 3127 | var expectedClassName = expectedClass.name || ANONYMOUS; |
| 3128 | var actualClassName = getClassName(props[propName]); |
| 3129 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); |
| 3130 | } |
| 3131 | return null; |
| 3132 | } |
| 3133 | return createChainableTypeChecker(validate); |
| 3134 | } |
| 3135 | |
| 3136 | function createEnumTypeChecker(expectedValues) { |
| 3137 | if (!Array.isArray(expectedValues)) { |
| 3138 | if (true) { |
| 3139 | if (arguments.length > 1) { |
| 3140 | printWarning( |
| 3141 | 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + |
| 3142 | 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' |
| 3143 | ); |
| 3144 | } else { |
| 3145 | printWarning('Invalid argument supplied to oneOf, expected an array.'); |
| 3146 | } |
| 3147 | } |
| 3148 | return emptyFunctionThatReturnsNull; |
| 3149 | } |
| 3150 | |
| 3151 | function validate(props, propName, componentName, location, propFullName) { |
| 3152 | var propValue = props[propName]; |
| 3153 | for (var i = 0; i < expectedValues.length; i++) { |
| 3154 | if (is(propValue, expectedValues[i])) { |
| 3155 | return null; |
| 3156 | } |
| 3157 | } |
| 3158 | |
| 3159 | var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { |
| 3160 | var type = getPreciseType(value); |
| 3161 | if (type === 'symbol') { |
| 3162 | return String(value); |
| 3163 | } |
| 3164 | return value; |
| 3165 | }); |
| 3166 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); |
| 3167 | } |
| 3168 | return createChainableTypeChecker(validate); |
| 3169 | } |
| 3170 | |
| 3171 | function createObjectOfTypeChecker(typeChecker) { |
| 3172 | function validate(props, propName, componentName, location, propFullName) { |
| 3173 | if (typeof typeChecker !== 'function') { |
| 3174 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); |
| 3175 | } |
| 3176 | var propValue = props[propName]; |
| 3177 | var propType = getPropType(propValue); |
| 3178 | if (propType !== 'object') { |
| 3179 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); |
| 3180 | } |
| 3181 | for (var key in propValue) { |
| 3182 | if (has(propValue, key)) { |
| 3183 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); |
| 3184 | if (error instanceof Error) { |
| 3185 | return error; |
| 3186 | } |
| 3187 | } |
| 3188 | } |
| 3189 | return null; |
| 3190 | } |
| 3191 | return createChainableTypeChecker(validate); |
| 3192 | } |
| 3193 | |
| 3194 | function createUnionTypeChecker(arrayOfTypeCheckers) { |
| 3195 | if (!Array.isArray(arrayOfTypeCheckers)) { |
| 3196 | true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; |
| 3197 | return emptyFunctionThatReturnsNull; |
| 3198 | } |
| 3199 | |
| 3200 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) { |
| 3201 | var checker = arrayOfTypeCheckers[i]; |
| 3202 | if (typeof checker !== 'function') { |
| 3203 | printWarning( |
| 3204 | 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + |
| 3205 | 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' |
| 3206 | ); |
| 3207 | return emptyFunctionThatReturnsNull; |
| 3208 | } |
| 3209 | } |
| 3210 | |
| 3211 | function validate(props, propName, componentName, location, propFullName) { |
| 3212 | var expectedTypes = []; |
| 3213 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) { |
| 3214 | var checker = arrayOfTypeCheckers[i]; |
| 3215 | var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); |
| 3216 | if (checkerResult == null) { |
| 3217 | return null; |
| 3218 | } |
| 3219 | if (checkerResult.data && has(checkerResult.data, 'expectedType')) { |
| 3220 | expectedTypes.push(checkerResult.data.expectedType); |
| 3221 | } |
| 3222 | } |
| 3223 | var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; |
| 3224 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); |
| 3225 | } |
| 3226 | return createChainableTypeChecker(validate); |
| 3227 | } |
| 3228 | |
| 3229 | function createNodeChecker() { |
| 3230 | function validate(props, propName, componentName, location, propFullName) { |
| 3231 | if (!isNode(props[propName])) { |
| 3232 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); |
| 3233 | } |
| 3234 | return null; |
| 3235 | } |
| 3236 | return createChainableTypeChecker(validate); |
| 3237 | } |
| 3238 | |
| 3239 | function invalidValidatorError(componentName, location, propFullName, key, type) { |
| 3240 | return new PropTypeError( |
| 3241 | (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + |
| 3242 | 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' |
| 3243 | ); |
| 3244 | } |
| 3245 | |
| 3246 | function createShapeTypeChecker(shapeTypes) { |
| 3247 | function validate(props, propName, componentName, location, propFullName) { |
| 3248 | var propValue = props[propName]; |
| 3249 | var propType = getPropType(propValue); |
| 3250 | if (propType !== 'object') { |
| 3251 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); |
| 3252 | } |
| 3253 | for (var key in shapeTypes) { |
| 3254 | var checker = shapeTypes[key]; |
| 3255 | if (typeof checker !== 'function') { |
| 3256 | return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); |
| 3257 | } |
| 3258 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); |
| 3259 | if (error) { |
| 3260 | return error; |
| 3261 | } |
| 3262 | } |
| 3263 | return null; |
| 3264 | } |
| 3265 | return createChainableTypeChecker(validate); |
| 3266 | } |
| 3267 | |
| 3268 | function createStrictShapeTypeChecker(shapeTypes) { |
| 3269 | function validate(props, propName, componentName, location, propFullName) { |
| 3270 | var propValue = props[propName]; |
| 3271 | var propType = getPropType(propValue); |
| 3272 | if (propType !== 'object') { |
| 3273 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); |
| 3274 | } |
| 3275 | // We need to check all keys in case some are required but missing from props. |
| 3276 | var allKeys = assign({}, props[propName], shapeTypes); |
| 3277 | for (var key in allKeys) { |
| 3278 | var checker = shapeTypes[key]; |
| 3279 | if (has(shapeTypes, key) && typeof checker !== 'function') { |
| 3280 | return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); |
| 3281 | } |
| 3282 | if (!checker) { |
| 3283 | return new PropTypeError( |
| 3284 | 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + |
| 3285 | '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + |
| 3286 | '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') |
| 3287 | ); |
| 3288 | } |
| 3289 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); |
| 3290 | if (error) { |
| 3291 | return error; |
| 3292 | } |
| 3293 | } |
| 3294 | return null; |
| 3295 | } |
| 3296 | |
| 3297 | return createChainableTypeChecker(validate); |
| 3298 | } |
| 3299 | |
| 3300 | function isNode(propValue) { |
| 3301 | switch (typeof propValue) { |
| 3302 | case 'number': |
| 3303 | case 'string': |
| 3304 | case 'undefined': |
| 3305 | return true; |
| 3306 | case 'boolean': |
| 3307 | return !propValue; |
| 3308 | case 'object': |
| 3309 | if (Array.isArray(propValue)) { |
| 3310 | return propValue.every(isNode); |
| 3311 | } |
| 3312 | if (propValue === null || isValidElement(propValue)) { |
| 3313 | return true; |
| 3314 | } |
| 3315 | |
| 3316 | var iteratorFn = getIteratorFn(propValue); |
| 3317 | if (iteratorFn) { |
| 3318 | var iterator = iteratorFn.call(propValue); |
| 3319 | var step; |
| 3320 | if (iteratorFn !== propValue.entries) { |
| 3321 | while (!(step = iterator.next()).done) { |
| 3322 | if (!isNode(step.value)) { |
| 3323 | return false; |
| 3324 | } |
| 3325 | } |
| 3326 | } else { |
| 3327 | // Iterator will provide entry [k,v] tuples rather than values. |
| 3328 | while (!(step = iterator.next()).done) { |
| 3329 | var entry = step.value; |
| 3330 | if (entry) { |
| 3331 | if (!isNode(entry[1])) { |
| 3332 | return false; |
| 3333 | } |
| 3334 | } |
| 3335 | } |
| 3336 | } |
| 3337 | } else { |
| 3338 | return false; |
| 3339 | } |
| 3340 | |
| 3341 | return true; |
| 3342 | default: |
| 3343 | return false; |
| 3344 | } |
| 3345 | } |
| 3346 | |
| 3347 | function isSymbol(propType, propValue) { |
| 3348 | // Native Symbol. |
| 3349 | if (propType === 'symbol') { |
| 3350 | return true; |
| 3351 | } |
| 3352 | |
| 3353 | // falsy value can't be a Symbol |
| 3354 | if (!propValue) { |
| 3355 | return false; |
| 3356 | } |
| 3357 | |
| 3358 | // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' |
| 3359 | if (propValue['@@toStringTag'] === 'Symbol') { |
| 3360 | return true; |
| 3361 | } |
| 3362 | |
| 3363 | // Fallback for non-spec compliant Symbols which are polyfilled. |
| 3364 | if (typeof Symbol === 'function' && propValue instanceof Symbol) { |
| 3365 | return true; |
| 3366 | } |
| 3367 | |
| 3368 | return false; |
| 3369 | } |
| 3370 | |
| 3371 | // Equivalent of `typeof` but with special handling for array and regexp. |
| 3372 | function getPropType(propValue) { |
| 3373 | var propType = typeof propValue; |
| 3374 | if (Array.isArray(propValue)) { |
| 3375 | return 'array'; |
| 3376 | } |
| 3377 | if (propValue instanceof RegExp) { |
| 3378 | // Old webkits (at least until Android 4.0) return 'function' rather than |
| 3379 | // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ |
| 3380 | // passes PropTypes.object. |
| 3381 | return 'object'; |
| 3382 | } |
| 3383 | if (isSymbol(propType, propValue)) { |
| 3384 | return 'symbol'; |
| 3385 | } |
| 3386 | return propType; |
| 3387 | } |
| 3388 | |
| 3389 | // This handles more types than `getPropType`. Only used for error messages. |
| 3390 | // See `createPrimitiveTypeChecker`. |
| 3391 | function getPreciseType(propValue) { |
| 3392 | if (typeof propValue === 'undefined' || propValue === null) { |
| 3393 | return '' + propValue; |
| 3394 | } |
| 3395 | var propType = getPropType(propValue); |
| 3396 | if (propType === 'object') { |
| 3397 | if (propValue instanceof Date) { |
| 3398 | return 'date'; |
| 3399 | } else if (propValue instanceof RegExp) { |
| 3400 | return 'regexp'; |
| 3401 | } |
| 3402 | } |
| 3403 | return propType; |
| 3404 | } |
| 3405 | |
| 3406 | // Returns a string that is postfixed to a warning about an invalid type. |
| 3407 | // For example, "undefined" or "of type array" |
| 3408 | function getPostfixForTypeWarning(value) { |
| 3409 | var type = getPreciseType(value); |
| 3410 | switch (type) { |
| 3411 | case 'array': |
| 3412 | case 'object': |
| 3413 | return 'an ' + type; |
| 3414 | case 'boolean': |
| 3415 | case 'date': |
| 3416 | case 'regexp': |
| 3417 | return 'a ' + type; |
| 3418 | default: |
| 3419 | return type; |
| 3420 | } |
| 3421 | } |
| 3422 | |
| 3423 | // Returns class name of the object, if any. |
| 3424 | function getClassName(propValue) { |
| 3425 | if (!propValue.constructor || !propValue.constructor.name) { |
| 3426 | return ANONYMOUS; |
| 3427 | } |
| 3428 | return propValue.constructor.name; |
| 3429 | } |
| 3430 | |
| 3431 | ReactPropTypes.checkPropTypes = checkPropTypes; |
| 3432 | ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; |
| 3433 | ReactPropTypes.PropTypes = ReactPropTypes; |
| 3434 | |
| 3435 | return ReactPropTypes; |
| 3436 | }; |
| 3437 | |
| 3438 | |
| 3439 | /***/ }), |
| 3440 | |
| 3441 | /***/ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js": |
| 3442 | /*!***********************************************************************************!*\ |
| 3443 | !*** ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.js ***! |
| 3444 | \***********************************************************************************/ |
| 3445 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3446 | |
| 3447 | /** |
| 3448 | * Copyright (c) 2013-present, Facebook, Inc. |
| 3449 | * |
| 3450 | * This source code is licensed under the MIT license found in the |
| 3451 | * LICENSE file in the root directory of this source tree. |
| 3452 | */ |
| 3453 | |
| 3454 | if (true) { |
| 3455 | var ReactIs = __webpack_require__(/*! react-is */ "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js"); |
| 3456 | |
| 3457 | // By explicitly using `prop-types` you are opting into new development behavior. |
| 3458 | // http://fb.me/prop-types-in-prod |
| 3459 | var throwOnDirectAccess = true; |
| 3460 | module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); |
| 3461 | } else {} |
| 3462 | |
| 3463 | |
| 3464 | /***/ }), |
| 3465 | |
| 3466 | /***/ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js": |
| 3467 | /*!******************************************************************************************************!*\ |
| 3468 | !*** ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.js ***! |
| 3469 | \******************************************************************************************************/ |
| 3470 | /***/ ((module) => { |
| 3471 | |
| 3472 | "use strict"; |
| 3473 | /** |
| 3474 | * Copyright (c) 2013-present, Facebook, Inc. |
| 3475 | * |
| 3476 | * This source code is licensed under the MIT license found in the |
| 3477 | * LICENSE file in the root directory of this source tree. |
| 3478 | */ |
| 3479 | |
| 3480 | |
| 3481 | |
| 3482 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; |
| 3483 | |
| 3484 | module.exports = ReactPropTypesSecret; |
| 3485 | |
| 3486 | |
| 3487 | /***/ }), |
| 3488 | |
| 3489 | /***/ "../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js": |
| 3490 | /*!*************************************************************************************!*\ |
| 3491 | !*** ../../node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.js ***! |
| 3492 | \*************************************************************************************/ |
| 3493 | /***/ ((module) => { |
| 3494 | |
| 3495 | module.exports = Function.call.bind(Object.prototype.hasOwnProperty); |
| 3496 | |
| 3497 | |
| 3498 | /***/ }), |
| 3499 | |
| 3500 | /***/ "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js": |
| 3501 | /*!***************************************************************************************************!*\ |
| 3502 | !*** ../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js ***! |
| 3503 | \***************************************************************************************************/ |
| 3504 | /***/ ((__unused_webpack_module, exports) => { |
| 3505 | |
| 3506 | "use strict"; |
| 3507 | /** @license React v16.13.1 |
| 3508 | * react-is.development.js |
| 3509 | * |
| 3510 | * Copyright (c) Facebook, Inc. and its affiliates. |
| 3511 | * |
| 3512 | * This source code is licensed under the MIT license found in the |
| 3513 | * LICENSE file in the root directory of this source tree. |
| 3514 | */ |
| 3515 | |
| 3516 | |
| 3517 | |
| 3518 | |
| 3519 | |
| 3520 | if (true) { |
| 3521 | (function() { |
| 3522 | 'use strict'; |
| 3523 | |
| 3524 | // The Symbol used to tag the ReactElement-like types. If there is no native Symbol |
| 3525 | // nor polyfill, then a plain number is used for performance. |
| 3526 | var hasSymbol = typeof Symbol === 'function' && Symbol.for; |
| 3527 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; |
| 3528 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; |
| 3529 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; |
| 3530 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; |
| 3531 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; |
| 3532 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; |
| 3533 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary |
| 3534 | // (unstable) APIs that have been removed. Can we remove the symbols? |
| 3535 | |
| 3536 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; |
| 3537 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; |
| 3538 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; |
| 3539 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; |
| 3540 | var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; |
| 3541 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; |
| 3542 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; |
| 3543 | var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; |
| 3544 | var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; |
| 3545 | var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; |
| 3546 | var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; |
| 3547 | |
| 3548 | function isValidElementType(type) { |
| 3549 | return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. |
| 3550 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); |
| 3551 | } |
| 3552 | |
| 3553 | function typeOf(object) { |
| 3554 | if (typeof object === 'object' && object !== null) { |
| 3555 | var $$typeof = object.$$typeof; |
| 3556 | |
| 3557 | switch ($$typeof) { |
| 3558 | case REACT_ELEMENT_TYPE: |
| 3559 | var type = object.type; |
| 3560 | |
| 3561 | switch (type) { |
| 3562 | case REACT_ASYNC_MODE_TYPE: |
| 3563 | case REACT_CONCURRENT_MODE_TYPE: |
| 3564 | case REACT_FRAGMENT_TYPE: |
| 3565 | case REACT_PROFILER_TYPE: |
| 3566 | case REACT_STRICT_MODE_TYPE: |
| 3567 | case REACT_SUSPENSE_TYPE: |
| 3568 | return type; |
| 3569 | |
| 3570 | default: |
| 3571 | var $$typeofType = type && type.$$typeof; |
| 3572 | |
| 3573 | switch ($$typeofType) { |
| 3574 | case REACT_CONTEXT_TYPE: |
| 3575 | case REACT_FORWARD_REF_TYPE: |
| 3576 | case REACT_LAZY_TYPE: |
| 3577 | case REACT_MEMO_TYPE: |
| 3578 | case REACT_PROVIDER_TYPE: |
| 3579 | return $$typeofType; |
| 3580 | |
| 3581 | default: |
| 3582 | return $$typeof; |
| 3583 | } |
| 3584 | |
| 3585 | } |
| 3586 | |
| 3587 | case REACT_PORTAL_TYPE: |
| 3588 | return $$typeof; |
| 3589 | } |
| 3590 | } |
| 3591 | |
| 3592 | return undefined; |
| 3593 | } // AsyncMode is deprecated along with isAsyncMode |
| 3594 | |
| 3595 | var AsyncMode = REACT_ASYNC_MODE_TYPE; |
| 3596 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; |
| 3597 | var ContextConsumer = REACT_CONTEXT_TYPE; |
| 3598 | var ContextProvider = REACT_PROVIDER_TYPE; |
| 3599 | var Element = REACT_ELEMENT_TYPE; |
| 3600 | var ForwardRef = REACT_FORWARD_REF_TYPE; |
| 3601 | var Fragment = REACT_FRAGMENT_TYPE; |
| 3602 | var Lazy = REACT_LAZY_TYPE; |
| 3603 | var Memo = REACT_MEMO_TYPE; |
| 3604 | var Portal = REACT_PORTAL_TYPE; |
| 3605 | var Profiler = REACT_PROFILER_TYPE; |
| 3606 | var StrictMode = REACT_STRICT_MODE_TYPE; |
| 3607 | var Suspense = REACT_SUSPENSE_TYPE; |
| 3608 | var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated |
| 3609 | |
| 3610 | function isAsyncMode(object) { |
| 3611 | { |
| 3612 | if (!hasWarnedAboutDeprecatedIsAsyncMode) { |
| 3613 | hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint |
| 3614 | |
| 3615 | console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); |
| 3616 | } |
| 3617 | } |
| 3618 | |
| 3619 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; |
| 3620 | } |
| 3621 | function isConcurrentMode(object) { |
| 3622 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; |
| 3623 | } |
| 3624 | function isContextConsumer(object) { |
| 3625 | return typeOf(object) === REACT_CONTEXT_TYPE; |
| 3626 | } |
| 3627 | function isContextProvider(object) { |
| 3628 | return typeOf(object) === REACT_PROVIDER_TYPE; |
| 3629 | } |
| 3630 | function isElement(object) { |
| 3631 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; |
| 3632 | } |
| 3633 | function isForwardRef(object) { |
| 3634 | return typeOf(object) === REACT_FORWARD_REF_TYPE; |
| 3635 | } |
| 3636 | function isFragment(object) { |
| 3637 | return typeOf(object) === REACT_FRAGMENT_TYPE; |
| 3638 | } |
| 3639 | function isLazy(object) { |
| 3640 | return typeOf(object) === REACT_LAZY_TYPE; |
| 3641 | } |
| 3642 | function isMemo(object) { |
| 3643 | return typeOf(object) === REACT_MEMO_TYPE; |
| 3644 | } |
| 3645 | function isPortal(object) { |
| 3646 | return typeOf(object) === REACT_PORTAL_TYPE; |
| 3647 | } |
| 3648 | function isProfiler(object) { |
| 3649 | return typeOf(object) === REACT_PROFILER_TYPE; |
| 3650 | } |
| 3651 | function isStrictMode(object) { |
| 3652 | return typeOf(object) === REACT_STRICT_MODE_TYPE; |
| 3653 | } |
| 3654 | function isSuspense(object) { |
| 3655 | return typeOf(object) === REACT_SUSPENSE_TYPE; |
| 3656 | } |
| 3657 | |
| 3658 | exports.AsyncMode = AsyncMode; |
| 3659 | exports.ConcurrentMode = ConcurrentMode; |
| 3660 | exports.ContextConsumer = ContextConsumer; |
| 3661 | exports.ContextProvider = ContextProvider; |
| 3662 | exports.Element = Element; |
| 3663 | exports.ForwardRef = ForwardRef; |
| 3664 | exports.Fragment = Fragment; |
| 3665 | exports.Lazy = Lazy; |
| 3666 | exports.Memo = Memo; |
| 3667 | exports.Portal = Portal; |
| 3668 | exports.Profiler = Profiler; |
| 3669 | exports.StrictMode = StrictMode; |
| 3670 | exports.Suspense = Suspense; |
| 3671 | exports.isAsyncMode = isAsyncMode; |
| 3672 | exports.isConcurrentMode = isConcurrentMode; |
| 3673 | exports.isContextConsumer = isContextConsumer; |
| 3674 | exports.isContextProvider = isContextProvider; |
| 3675 | exports.isElement = isElement; |
| 3676 | exports.isForwardRef = isForwardRef; |
| 3677 | exports.isFragment = isFragment; |
| 3678 | exports.isLazy = isLazy; |
| 3679 | exports.isMemo = isMemo; |
| 3680 | exports.isPortal = isPortal; |
| 3681 | exports.isProfiler = isProfiler; |
| 3682 | exports.isStrictMode = isStrictMode; |
| 3683 | exports.isSuspense = isSuspense; |
| 3684 | exports.isValidElementType = isValidElementType; |
| 3685 | exports.typeOf = typeOf; |
| 3686 | })(); |
| 3687 | } |
| 3688 | |
| 3689 | |
| 3690 | /***/ }), |
| 3691 | |
| 3692 | /***/ "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js": |
| 3693 | /*!********************************************************************************!*\ |
| 3694 | !*** ../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.js ***! |
| 3695 | \********************************************************************************/ |
| 3696 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => { |
| 3697 | |
| 3698 | "use strict"; |
| 3699 | |
| 3700 | |
| 3701 | if (false) {} else { |
| 3702 | module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.js"); |
| 3703 | } |
| 3704 | |
| 3705 | |
| 3706 | /***/ }), |
| 3707 | |
| 3708 | /***/ "react": |
| 3709 | /*!************************!*\ |
| 3710 | !*** external "React" ***! |
| 3711 | \************************/ |
| 3712 | /***/ ((module) => { |
| 3713 | |
| 3714 | "use strict"; |
| 3715 | module.exports = window["React"]; |
| 3716 | |
| 3717 | /***/ }), |
| 3718 | |
| 3719 | /***/ "@woocommerce/blocks-components": |
| 3720 | /*!******************************************!*\ |
| 3721 | !*** external ["wc","blocksComponents"] ***! |
| 3722 | \******************************************/ |
| 3723 | /***/ ((module) => { |
| 3724 | |
| 3725 | "use strict"; |
| 3726 | module.exports = window["wc"]["blocksComponents"]; |
| 3727 | |
| 3728 | /***/ }), |
| 3729 | |
| 3730 | /***/ "@woocommerce/settings": |
| 3731 | /*!************************************!*\ |
| 3732 | !*** external ["wc","wcSettings"] ***! |
| 3733 | \************************************/ |
| 3734 | /***/ ((module) => { |
| 3735 | |
| 3736 | "use strict"; |
| 3737 | module.exports = window["wc"]["wcSettings"]; |
| 3738 | |
| 3739 | /***/ }), |
| 3740 | |
| 3741 | /***/ "@wordpress/a11y": |
| 3742 | /*!******************************!*\ |
| 3743 | !*** external ["wp","a11y"] ***! |
| 3744 | \******************************/ |
| 3745 | /***/ ((module) => { |
| 3746 | |
| 3747 | "use strict"; |
| 3748 | module.exports = window["wp"]["a11y"]; |
| 3749 | |
| 3750 | /***/ }), |
| 3751 | |
| 3752 | /***/ "@wordpress/api-fetch": |
| 3753 | /*!**********************************!*\ |
| 3754 | !*** external ["wp","apiFetch"] ***! |
| 3755 | \**********************************/ |
| 3756 | /***/ ((module) => { |
| 3757 | |
| 3758 | "use strict"; |
| 3759 | module.exports = window["wp"]["apiFetch"]; |
| 3760 | |
| 3761 | /***/ }), |
| 3762 | |
| 3763 | /***/ "@wordpress/blocks": |
| 3764 | /*!********************************!*\ |
| 3765 | !*** external ["wp","blocks"] ***! |
| 3766 | \********************************/ |
| 3767 | /***/ ((module) => { |
| 3768 | |
| 3769 | "use strict"; |
| 3770 | module.exports = window["wp"]["blocks"]; |
| 3771 | |
| 3772 | /***/ }), |
| 3773 | |
| 3774 | /***/ "@wordpress/element": |
| 3775 | /*!*********************************!*\ |
| 3776 | !*** external ["wp","element"] ***! |
| 3777 | \*********************************/ |
| 3778 | /***/ ((module) => { |
| 3779 | |
| 3780 | "use strict"; |
| 3781 | module.exports = window["wp"]["element"]; |
| 3782 | |
| 3783 | /***/ }), |
| 3784 | |
| 3785 | /***/ "@wordpress/i18n": |
| 3786 | /*!******************************!*\ |
| 3787 | !*** external ["wp","i18n"] ***! |
| 3788 | \******************************/ |
| 3789 | /***/ ((module) => { |
| 3790 | |
| 3791 | "use strict"; |
| 3792 | module.exports = window["wp"]["i18n"]; |
| 3793 | |
| 3794 | /***/ }), |
| 3795 | |
| 3796 | /***/ "@wordpress/is-shallow-equal": |
| 3797 | /*!****************************************!*\ |
| 3798 | !*** external ["wp","isShallowEqual"] ***! |
| 3799 | \****************************************/ |
| 3800 | /***/ ((module) => { |
| 3801 | |
| 3802 | "use strict"; |
| 3803 | module.exports = window["wp"]["isShallowEqual"]; |
| 3804 | |
| 3805 | /***/ }), |
| 3806 | |
| 3807 | /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js": |
| 3808 | /*!****************************************************************************************************************!*\ |
| 3809 | !*** ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! |
| 3810 | \****************************************************************************************************************/ |
| 3811 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 3812 | |
| 3813 | "use strict"; |
| 3814 | __webpack_require__.r(__webpack_exports__); |
| 3815 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3816 | /* harmony export */ "default": () => (/* binding */ _defineProperty) |
| 3817 | /* harmony export */ }); |
| 3818 | /* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); |
| 3819 | |
| 3820 | function _defineProperty(obj, key, value) { |
| 3821 | key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key); |
| 3822 | if (key in obj) { |
| 3823 | Object.defineProperty(obj, key, { |
| 3824 | value: value, |
| 3825 | enumerable: true, |
| 3826 | configurable: true, |
| 3827 | writable: true |
| 3828 | }); |
| 3829 | } else { |
| 3830 | obj[key] = value; |
| 3831 | } |
| 3832 | return obj; |
| 3833 | } |
| 3834 | |
| 3835 | /***/ }), |
| 3836 | |
| 3837 | /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPrimitive.js": |
| 3838 | /*!*************************************************************************************************************!*\ |
| 3839 | !*** ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! |
| 3840 | \*************************************************************************************************************/ |
| 3841 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 3842 | |
| 3843 | "use strict"; |
| 3844 | __webpack_require__.r(__webpack_exports__); |
| 3845 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3846 | /* harmony export */ "default": () => (/* binding */ _toPrimitive) |
| 3847 | /* harmony export */ }); |
| 3848 | /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js"); |
| 3849 | |
| 3850 | function _toPrimitive(input, hint) { |
| 3851 | if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input) !== "object" || input === null) return input; |
| 3852 | var prim = input[Symbol.toPrimitive]; |
| 3853 | if (prim !== undefined) { |
| 3854 | var res = prim.call(input, hint || "default"); |
| 3855 | if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(res) !== "object") return res; |
| 3856 | throw new TypeError("@@toPrimitive must return a primitive value."); |
| 3857 | } |
| 3858 | return (hint === "string" ? String : Number)(input); |
| 3859 | } |
| 3860 | |
| 3861 | /***/ }), |
| 3862 | |
| 3863 | /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": |
| 3864 | /*!***************************************************************************************************************!*\ |
| 3865 | !*** ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! |
| 3866 | \***************************************************************************************************************/ |
| 3867 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 3868 | |
| 3869 | "use strict"; |
| 3870 | __webpack_require__.r(__webpack_exports__); |
| 3871 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3872 | /* harmony export */ "default": () => (/* binding */ _toPropertyKey) |
| 3873 | /* harmony export */ }); |
| 3874 | /* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js"); |
| 3875 | /* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/toPrimitive.js"); |
| 3876 | |
| 3877 | |
| 3878 | function _toPropertyKey(arg) { |
| 3879 | var key = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arg, "string"); |
| 3880 | return (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key) === "symbol" ? key : String(key); |
| 3881 | } |
| 3882 | |
| 3883 | /***/ }), |
| 3884 | |
| 3885 | /***/ "../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js": |
| 3886 | /*!********************************************************************************************************!*\ |
| 3887 | !*** ../../node_modules/.pnpm/@babel+runtime@7.23.5/node_modules/@babel/runtime/helpers/esm/typeof.js ***! |
| 3888 | \********************************************************************************************************/ |
| 3889 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { |
| 3890 | |
| 3891 | "use strict"; |
| 3892 | __webpack_require__.r(__webpack_exports__); |
| 3893 | /* harmony export */ __webpack_require__.d(__webpack_exports__, { |
| 3894 | /* harmony export */ "default": () => (/* binding */ _typeof) |
| 3895 | /* harmony export */ }); |
| 3896 | function _typeof(o) { |
| 3897 | "@babel/helpers - typeof"; |
| 3898 | |
| 3899 | return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { |
| 3900 | return typeof o; |
| 3901 | } : function (o) { |
| 3902 | return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; |
| 3903 | }, _typeof(o); |
| 3904 | } |
| 3905 | |
| 3906 | /***/ }) |
| 3907 | |
| 3908 | /******/ }); |
| 3909 | /************************************************************************/ |
| 3910 | /******/ // The module cache |
| 3911 | /******/ var __webpack_module_cache__ = {}; |
| 3912 | /******/ |
| 3913 | /******/ // The require function |
| 3914 | /******/ function __webpack_require__(moduleId) { |
| 3915 | /******/ // Check if module is in cache |
| 3916 | /******/ var cachedModule = __webpack_module_cache__[moduleId]; |
| 3917 | /******/ if (cachedModule !== undefined) { |
| 3918 | /******/ return cachedModule.exports; |
| 3919 | /******/ } |
| 3920 | /******/ // Create a new module (and put it into the cache) |
| 3921 | /******/ var module = __webpack_module_cache__[moduleId] = { |
| 3922 | /******/ // no module.id needed |
| 3923 | /******/ // no module.loaded needed |
| 3924 | /******/ exports: {} |
| 3925 | /******/ }; |
| 3926 | /******/ |
| 3927 | /******/ // Execute the module function |
| 3928 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
| 3929 | /******/ |
| 3930 | /******/ // Return the exports of the module |
| 3931 | /******/ return module.exports; |
| 3932 | /******/ } |
| 3933 | /******/ |
| 3934 | /************************************************************************/ |
| 3935 | /******/ /* webpack/runtime/compat get default export */ |
| 3936 | /******/ (() => { |
| 3937 | /******/ // getDefaultExport function for compatibility with non-harmony modules |
| 3938 | /******/ __webpack_require__.n = (module) => { |
| 3939 | /******/ var getter = module && module.__esModule ? |
| 3940 | /******/ () => (module['default']) : |
| 3941 | /******/ () => (module); |
| 3942 | /******/ __webpack_require__.d(getter, { a: getter }); |
| 3943 | /******/ return getter; |
| 3944 | /******/ }; |
| 3945 | /******/ })(); |
| 3946 | /******/ |
| 3947 | /******/ /* webpack/runtime/define property getters */ |
| 3948 | /******/ (() => { |
| 3949 | /******/ // define getter functions for harmony exports |
| 3950 | /******/ __webpack_require__.d = (exports, definition) => { |
| 3951 | /******/ for(var key in definition) { |
| 3952 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
| 3953 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
| 3954 | /******/ } |
| 3955 | /******/ } |
| 3956 | /******/ }; |
| 3957 | /******/ })(); |
| 3958 | /******/ |
| 3959 | /******/ /* webpack/runtime/hasOwnProperty shorthand */ |
| 3960 | /******/ (() => { |
| 3961 | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) |
| 3962 | /******/ })(); |
| 3963 | /******/ |
| 3964 | /******/ /* webpack/runtime/make namespace object */ |
| 3965 | /******/ (() => { |
| 3966 | /******/ // define __esModule on exports |
| 3967 | /******/ __webpack_require__.r = (exports) => { |
| 3968 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { |
| 3969 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); |
| 3970 | /******/ } |
| 3971 | /******/ Object.defineProperty(exports, '__esModule', { value: true }); |
| 3972 | /******/ }; |
| 3973 | /******/ })(); |
| 3974 | /******/ |
| 3975 | /************************************************************************/ |
| 3976 | var __webpack_exports__ = {}; |
| 3977 | // This entry need to be wrapped in an IIFE because it need to be in strict mode. |
| 3978 | (() => { |
| 3979 | "use strict"; |
| 3980 | /*!**********************************************!*\ |
| 3981 | !*** ./assets/js/blocks/reviews/frontend.ts ***! |
| 3982 | \**********************************************/ |
| 3983 | __webpack_require__.r(__webpack_exports__); |
| 3984 | /* harmony import */ var _woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @woocommerce/base-utils */ "./assets/js/base/utils/render-frontend.tsx"); |
| 3985 | /* harmony import */ var _frontend_container_block__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./frontend-container-block */ "./assets/js/blocks/reviews/frontend-container-block.tsx"); |
| 3986 | /** |
| 3987 | * External dependencies |
| 3988 | */ |
| 3989 | |
| 3990 | |
| 3991 | /** |
| 3992 | * Internal dependencies |
| 3993 | */ |
| 3994 | |
| 3995 | const selector = ` |
| 3996 | .wp-block-woocommerce-all-reviews, |
| 3997 | .wp-block-woocommerce-reviews-by-product, |
| 3998 | .wp-block-woocommerce-reviews-by-category |
| 3999 | `; |
| 4000 | const getProps = el => { |
| 4001 | const showOrderby = el.dataset.showOrderby === 'true'; |
| 4002 | const showLoadMore = el.dataset.showLoadMore === 'true'; |
| 4003 | return { |
| 4004 | attributes: { |
| 4005 | showOrderby, |
| 4006 | showLoadMore, |
| 4007 | showReviewDate: el.classList.contains('has-date'), |
| 4008 | showReviewerName: el.classList.contains('has-name'), |
| 4009 | showReviewImage: el.classList.contains('has-image'), |
| 4010 | showReviewRating: el.classList.contains('has-rating'), |
| 4011 | showReviewContent: el.classList.contains('has-content'), |
| 4012 | showProductName: el.classList.contains('has-product-name') |
| 4013 | } |
| 4014 | }; |
| 4015 | }; |
| 4016 | (0,_woocommerce_base_utils__WEBPACK_IMPORTED_MODULE_0__.renderFrontend)({ |
| 4017 | selector, |
| 4018 | Block: _frontend_container_block__WEBPACK_IMPORTED_MODULE_1__["default"], |
| 4019 | getProps |
| 4020 | }); |
| 4021 | })(); |
| 4022 | |
| 4023 | /******/ })() |
| 4024 | ; |
| 4025 | //# sourceMappingURL=reviews-frontend.js.map |