initial commit
This commit is contained in:
assets
css
_animation.scss_fonts.scss_mixins.scss_variables.scssactivation-rtl.cssactivation.cssactivation.scssadmin-rtl.cssadmin.cssadmin.scssauth-rtl.cssauth.cssauth.scssdashboard-rtl.cssdashboard-setup-rtl.cssdashboard-setup.cssdashboard-setup.scssdashboard.cssdashboard.scsshelper-rtl.csshelper.csshelper.scssmarketplace-suggestions-rtl.cssmarketplace-suggestions.cssmarketplace-suggestions.scssmenu-rtl.cssmenu.cssmenu.scssnetwork-order-widget-rtl.cssnetwork-order-widget.cssnetwork-order-widget.scss
jquery-ui
images
ui-bg_flat_0_aaaaaa_40x100.pngui-bg_flat_75_ffffff_40x100.pngui-bg_glass_55_fbf9ee_1x400.pngui-bg_glass_65_ffffff_1x400.pngui-bg_glass_75_dadada_1x400.pngui-bg_glass_75_e6e6e6_1x400.pngui-bg_glass_95_fef1ec_1x400.pngui-bg_highlight-soft_75_cccccc_1x100.pngui-icons_222222_256x240.pngui-icons_2e83ff_256x240.pngui-icons_454545_256x240.pngui-icons_888888_256x240.pngui-icons_cd0a0a_256x240.png
jquery-ui-rtl.cssjquery-ui.cssjquery-ui.min.cssphotoswipe
prettyPhoto-rtl.cssprettyPhoto.cssprettyPhoto.scssprivacy-rtl.cssprivacy.cssprivacy.scssreports-print-rtl.cssreports-print.cssreports-print.scssselect2.cssselect2.scsstwenty-nineteen-rtl.csstwenty-nineteen.csstwenty-nineteen.scsstwenty-seventeen-rtl.csstwenty-seventeen.csstwenty-seventeen.scsstwenty-twenty-one-admin-rtl.csstwenty-twenty-one-admin.csstwenty-twenty-one-admin.scsstwenty-twenty-one-rtl.csstwenty-twenty-one.csstwenty-twenty-one.scsstwenty-twenty-rtl.csstwenty-twenty.csstwenty-twenty.scsswc-setup-rtl.csswc-setup.csswc-setup.scsswoocommerce-layout-rtl.csswoocommerce-layout.csswoocommerce-layout.scsswoocommerce-rtl.csswoocommerce-smallscreen-rtl.csswoocommerce-smallscreen.csswoocommerce-smallscreen.scsswoocommerce.csswoocommerce.scssfonts
images
calendar.pngdashboard-widget-setup.pngeway-logo.jpghelp.pngjetpack_horizontal_logo.pngjetpack_vertical_logo.pngklarna-black.pngmarketplace-header-bg@2x.pngmercadopago.pngobw-facebook-icon.svgobw-mailchimp-icon.svgobw-shipstation-icon.pngobw-storefront-icon.svgobw-taxes-icon.svgobw-woocommerce-admin-icon.svgobw-woocommerce-services-icon.pngpayfast.pngpaypal-braintree.pngpaypal.pngplaceholder-attachment.pngplaceholder.pngselect2-spinner.gifselect2.pngselect2x2.pngsquare-black.pngstorefront-bg.jpgstorefront-intro.pngstorefront.pngstripe.pngwcpayments-icon-secure.pngwcs-dhlexpress-logo.pngwcs-extensions-banner-3x.jpgwcs-notice.pngwcs-usps-logo.pngwoocommerce_logo.pngwoocommerce_logo.svgwpspin-2x.gifwpspin.gif
icons
credit-cards
amex.pngamex.svgdiners.pngdiners.svgdiscover.pngdiscover.svgjcb.pngjcb.svglaser.pnglaser.svgmaestro.pngmaestro.svgmastercard.pngmastercard.svgvisa.pngvisa.svg
edit.pnggridicons-checkmark.svggridicons-chevron-down.svgloader.svgstar-golden.svgstar-gray.svgstar-half-filled.svgjs
accounting
admin
api-keys.jsapi-keys.min.jsbackbone-modal.jsbackbone-modal.min.jsmarketplace-suggestions.jsmarketplace-suggestions.min.jsmeta-boxes-coupon.jsmeta-boxes-coupon.min.jsmeta-boxes-order.jsmeta-boxes-order.min.jsmeta-boxes-product-variation.jsmeta-boxes-product-variation.min.jsmeta-boxes-product.jsmeta-boxes-product.min.jsmeta-boxes.jsmeta-boxes.min.jsnetwork-orders.jsnetwork-orders.min.jsproduct-ordering.jsproduct-ordering.min.jsquick-edit.jsquick-edit.min.jsreports.jsreports.min.jssettings-views-html-settings-tax.jssettings-views-html-settings-tax.min.jssettings.jssettings.min.jssystem-status.jssystem-status.min.jsterm-ordering.jsterm-ordering.min.jsusers.jsusers.min.jswc-clipboard.jswc-clipboard.min.jswc-enhanced-select.jswc-enhanced-select.min.jswc-orders.jswc-orders.min.jswc-product-export.jswc-product-export.min.jswc-product-import.jswc-product-import.min.jswc-setup.jswc-setup.min.jswc-shipping-classes.jswc-shipping-classes.min.jswc-shipping-zone-methods.jswc-shipping-zone-methods.min.jswc-shipping-zones.jswc-shipping-zones.min.jswc-status-widget.jswc-status-widget.min.jswoocommerce_admin.jswoocommerce_admin.min.js
flexslider
frontend
add-payment-method.jsadd-payment-method.min.jsadd-to-cart-variation.jsadd-to-cart-variation.min.jsadd-to-cart.jsadd-to-cart.min.jsaddress-i18n.jsaddress-i18n.min.jscart-fragments.jscart-fragments.min.jscart.jscart.min.jscheckout.jscheckout.min.jscountry-select.jscountry-select.min.jscredit-card-form.jscredit-card-form.min.jsgeolocation.jsgeolocation.min.jslost-password.jslost-password.min.jspassword-strength-meter.jspassword-strength-meter.min.jsprice-slider.jsprice-slider.min.jssingle-product.jssingle-product.min.jstokenization-form.jstokenization-form.min.jswoocommerce.jswoocommerce.min.js
jquery-blockui
jquery-cookie
jquery-flot
jquery.flot.jsjquery.flot.min.jsjquery.flot.pie.jsjquery.flot.pie.min.jsjquery.flot.resize.jsjquery.flot.resize.min.jsjquery.flot.stack.jsjquery.flot.stack.min.jsjquery.flot.time.jsjquery.flot.time.min.js
jquery-payment
jquery-qrcode
jquery-serializejson
jquery-tiptip
jquery-ui-touch-punch
js-cookie
photoswipe
prettyPhoto
jquery.prettyPhoto.init.jsjquery.prettyPhoto.init.min.jsjquery.prettyPhoto.jsjquery.prettyPhoto.min.js
round
select2
selectWoo
stupidtable
zeroclipboard
zoom
i18n
includes
abstracts
abstract-wc-data.phpabstract-wc-deprecated-hooks.phpabstract-wc-integration.phpabstract-wc-log-handler.phpabstract-wc-object-query.phpabstract-wc-order.phpabstract-wc-payment-gateway.phpabstract-wc-payment-token.phpabstract-wc-privacy.phpabstract-wc-product.phpabstract-wc-session.phpabstract-wc-settings-api.phpabstract-wc-shipping-method.phpabstract-wc-widget.phpclass-wc-background-process.php
admin
class-wc-admin-addons.phpclass-wc-admin-api-keys-table-list.phpclass-wc-admin-api-keys.phpclass-wc-admin-assets.phpclass-wc-admin-attributes.phpclass-wc-admin-customize.phpclass-wc-admin-dashboard-setup.phpclass-wc-admin-dashboard.phpclass-wc-admin-duplicate-product.phpclass-wc-admin-exporters.phpclass-wc-admin-help.phpclass-wc-admin-importers.phpclass-wc-admin-log-table-list.phpclass-wc-admin-menus.phpclass-wc-admin-meta-boxes.phpclass-wc-admin-notices.phpclass-wc-admin-permalink-settings.phpclass-wc-admin-pointers.phpclass-wc-admin-post-types.phpclass-wc-admin-profile.phpclass-wc-admin-reports.phpclass-wc-admin-settings.phpclass-wc-admin-setup-wizard.phpclass-wc-admin-status.phpclass-wc-admin-taxonomies.phpclass-wc-admin-webhooks-table-list.phpclass-wc-admin-webhooks.phpclass-wc-admin.php
helper
class-wc-helper-api.phpclass-wc-helper-compat.phpclass-wc-helper-options.phpclass-wc-helper-plugin-info.phpclass-wc-helper-updater.phpclass-wc-helper.php
views
importers
list-tables
abstract-class-wc-admin-list-table.phpclass-wc-admin-list-table-coupons.phpclass-wc-admin-list-table-orders.phpclass-wc-admin-list-table-products.php
marketplace-suggestions
meta-boxes
class-wc-meta-box-coupon-data.phpclass-wc-meta-box-order-actions.phpclass-wc-meta-box-order-data.phpclass-wc-meta-box-order-downloads.phpclass-wc-meta-box-order-items.phpclass-wc-meta-box-order-notes.phpclass-wc-meta-box-product-data.phpclass-wc-meta-box-product-images.phpclass-wc-meta-box-product-reviews.phpclass-wc-meta-box-product-short-description.php
views
html-order-download-permission.phphtml-order-fee.phphtml-order-item-meta.phphtml-order-item.phphtml-order-items.phphtml-order-notes.phphtml-order-refund.phphtml-order-shipping.phphtml-product-attribute.phphtml-product-data-advanced.phphtml-product-data-attributes.phphtml-product-data-general.phphtml-product-data-inventory.phphtml-product-data-linked-products.phphtml-product-data-panel.phphtml-product-data-shipping.phphtml-product-data-variations.phphtml-product-download.phphtml-product-variation-download.phphtml-variation-admin.php
notes
plugin-updates
class-wc-plugin-updates.phpclass-wc-plugins-screen-updates.phpclass-wc-updates-screen-updates.php
views
reports
class-wc-admin-report.phpclass-wc-report-coupon-usage.phpclass-wc-report-customer-list.phpclass-wc-report-customers.phpclass-wc-report-downloads.phpclass-wc-report-low-in-stock.phpclass-wc-report-most-stocked.phpclass-wc-report-out-of-stock.phpclass-wc-report-sales-by-category.phpclass-wc-report-sales-by-date.phpclass-wc-report-sales-by-product.phpclass-wc-report-stock.phpclass-wc-report-taxes-by-code.phpclass-wc-report-taxes-by-date.php
settings
class-wc-settings-accounts.phpclass-wc-settings-advanced.phpclass-wc-settings-checkout.phpclass-wc-settings-emails.phpclass-wc-settings-general.phpclass-wc-settings-integrations.phpclass-wc-settings-page.phpclass-wc-settings-payment-gateways.phpclass-wc-settings-products.phpclass-wc-settings-shipping.phpclass-wc-settings-tax.php
views
views
html-admin-dashboard-setup.phphtml-admin-page-addons.phphtml-admin-page-product-export.phphtml-admin-page-reports.phphtml-admin-page-status-logs-db.phphtml-admin-page-status-logs.phphtml-admin-page-status-report.phphtml-admin-page-status-tools.phphtml-admin-page-status.phphtml-admin-settings.phphtml-bulk-edit-product.phphtml-email-template-preview.phphtml-notice-base-table-missing.phphtml-notice-custom.phphtml-notice-install.phphtml-notice-legacy-shipping.phphtml-notice-maxmind-license-key.phphtml-notice-no-shipping-methods.phphtml-notice-redirect-only-download.phphtml-notice-regenerating-lookup-table.phphtml-notice-regenerating-thumbnails.phphtml-notice-secure-connection.phphtml-notice-template-check.phphtml-notice-update.phphtml-notice-updated.phphtml-notice-updating.phphtml-notice-uploads-directory-is-unprotected.phphtml-notice-wp-php-minimum-requirements.phphtml-quick-edit-product.phphtml-report-by-date.php
wc-admin-functions.phpwc-meta-box-functions.phpblocks
class-wc-ajax.phpclass-wc-api.phpclass-wc-auth.phpclass-wc-autoloader.phpclass-wc-background-emailer.phpclass-wc-background-updater.phpclass-wc-breadcrumb.phpclass-wc-cache-helper.phpclass-wc-cart-fees.phpclass-wc-cart-session.phpclass-wc-cart-totals.phpclass-wc-cart.phpclass-wc-checkout.phpclass-wc-cli.phpclass-wc-comments.phpclass-wc-countries.phpclass-wc-coupon.phpclass-wc-customer-download-log.phpclass-wc-customer-download.phpclass-wc-customer.phpclass-wc-data-exception.phpclass-wc-data-store.phpclass-wc-datetime.phpclass-wc-deprecated-action-hooks.phpclass-wc-deprecated-filter-hooks.phpclass-wc-discounts.phpclass-wc-download-handler.phpclass-wc-emails.phpclass-wc-embed.phpclass-wc-form-handler.phpclass-wc-frontend-scripts.phpclass-wc-geo-ip.phpclass-wc-geolite-integration.phpclass-wc-geolocation.phpclass-wc-https.phpclass-wc-install.phpclass-wc-integrations.phpclass-wc-log-levels.phpclass-wc-logger.phpclass-wc-meta-data.phpclass-wc-order-factory.phpclass-wc-order-item-coupon.phpclass-wc-order-item-fee.phpclass-wc-order-item-meta.phpclass-wc-order-item-product.phpclass-wc-order-item-shipping.phpclass-wc-order-item-tax.phpclass-wc-order-item.phpclass-wc-order-query.phpclass-wc-order-refund.phpclass-wc-order.phpclass-wc-payment-gateways.phpclass-wc-payment-tokens.phpclass-wc-post-data.phpclass-wc-post-types.phpclass-wc-privacy-background-process.phpclass-wc-privacy-erasers.phpclass-wc-privacy-exporters.phpclass-wc-privacy.phpclass-wc-product-attribute.phpclass-wc-product-download.phpclass-wc-product-external.phpclass-wc-product-factory.phpclass-wc-product-grouped.phpclass-wc-product-query.phpclass-wc-product-simple.phpclass-wc-product-variable.phpclass-wc-product-variation.phpclass-wc-query.phpclass-wc-rate-limiter.phpclass-wc-regenerate-images-request.phpclass-wc-regenerate-images.phpclass-wc-register-wp-admin-settings.phpclass-wc-rest-authentication.phpclass-wc-rest-exception.phpclass-wc-session-handler.phpclass-wc-shipping-rate.phpclass-wc-shipping-zone.phpclass-wc-shipping-zones.phpclass-wc-shipping.phpclass-wc-shortcodes.phpclass-wc-structured-data.phpclass-wc-tax.phpclass-wc-template-loader.phpclass-wc-tracker.phpclass-wc-validation.phpclass-wc-webhook.phpclass-woocommerce.phpcli
class-wc-cli-rest-command.phpclass-wc-cli-runner.phpclass-wc-cli-tool-command.phpclass-wc-cli-tracker-command.phpclass-wc-cli-update-command.php
customizer
data-stores
abstract-wc-order-data-store-cpt.phpabstract-wc-order-item-type-data-store.phpclass-wc-coupon-data-store-cpt.phpclass-wc-customer-data-store-session.phpclass-wc-customer-data-store.phpclass-wc-customer-download-data-store.phpclass-wc-customer-download-log-data-store.phpclass-wc-data-store-wp.phpclass-wc-order-data-store-cpt.phpclass-wc-order-item-coupon-data-store.phpclass-wc-order-item-data-store.phpclass-wc-order-item-fee-data-store.phpclass-wc-order-item-product-data-store.phpclass-wc-order-item-shipping-data-store.phpclass-wc-order-item-tax-data-store.phpclass-wc-order-refund-data-store-cpt.phpclass-wc-payment-token-data-store.phpclass-wc-product-data-store-cpt.phpclass-wc-product-grouped-data-store-cpt.phpclass-wc-product-variable-data-store-cpt.phpclass-wc-product-variation-data-store-cpt.phpclass-wc-shipping-zone-data-store.phpclass-wc-webhook-data-store.php
emails
class-wc-email-cancelled-order.phpclass-wc-email-customer-completed-order.phpclass-wc-email-customer-invoice.phpclass-wc-email-customer-new-account.phpclass-wc-email-customer-note.phpclass-wc-email-customer-on-hold-order.phpclass-wc-email-customer-processing-order.phpclass-wc-email-customer-refunded-order.phpclass-wc-email-customer-reset-password.phpclass-wc-email-failed-order.phpclass-wc-email-new-order.phpclass-wc-email.php
export
gateways
bacs
cheque
class-wc-payment-gateway-cc.phpclass-wc-payment-gateway-echeck.phpcod
paypal
import
integrations
maxmind-geolocation
interfaces
class-wc-abstract-order-data-store-interface.phpclass-wc-coupon-data-store-interface.phpclass-wc-customer-data-store-interface.phpclass-wc-customer-download-data-store-interface.phpclass-wc-customer-download-log-data-store-interface.phpclass-wc-importer-interface.phpclass-wc-log-handler-interface.phpclass-wc-logger-interface.phpclass-wc-object-data-store-interface.phpclass-wc-order-data-store-interface.phpclass-wc-order-item-data-store-interface.phpclass-wc-order-item-product-data-store-interface.phpclass-wc-order-item-type-data-store-interface.phpclass-wc-order-refund-data-store-interface.phpclass-wc-payment-token-data-store-interface.phpclass-wc-product-data-store-interface.phpclass-wc-product-variable-data-store-interface.phpclass-wc-queue-interface.phpclass-wc-shipping-zone-data-store-interface.phpclass-wc-webhooks-data-store-interface.php
legacy
abstract-wc-legacy-order.phpabstract-wc-legacy-payment-token.phpabstract-wc-legacy-product.php
api
class-wc-rest-legacy-coupons-controller.phpclass-wc-rest-legacy-orders-controller.phpclass-wc-rest-legacy-products-controller.php
class-wc-legacy-api.phpclass-wc-legacy-cart.phpclass-wc-legacy-coupon.phpclass-wc-legacy-customer.phpclass-wc-legacy-shipping-zone.phpclass-wc-legacy-webhook.phpv1
class-wc-api-authentication.phpclass-wc-api-coupons.phpclass-wc-api-customers.phpclass-wc-api-json-handler.phpclass-wc-api-orders.phpclass-wc-api-products.phpclass-wc-api-reports.phpclass-wc-api-resource.phpclass-wc-api-server.phpclass-wc-api-xml-handler.phpinterface-wc-api-handler.php
v2
class-wc-api-authentication.phpclass-wc-api-coupons.phpclass-wc-api-customers.phpclass-wc-api-exception.phpclass-wc-api-json-handler.phpclass-wc-api-orders.phpclass-wc-api-products.phpclass-wc-api-reports.phpclass-wc-api-resource.phpclass-wc-api-server.phpclass-wc-api-webhooks.phpinterface-wc-api-handler.php
v3
class-wc-api-authentication.phpclass-wc-api-coupons.phpclass-wc-api-customers.phpclass-wc-api-exception.phpclass-wc-api-json-handler.phpclass-wc-api-orders.phpclass-wc-api-products.phpclass-wc-api-reports.phpclass-wc-api-resource.phpclass-wc-api-server.phpclass-wc-api-taxes.phpclass-wc-api-webhooks.phpinterface-wc-api-handler.php
libraries
log-handlers
payment-tokens
queue
rest-api
Controllers
Telemetry
Version1
class-wc-rest-coupons-v1-controller.phpclass-wc-rest-customer-downloads-v1-controller.phpclass-wc-rest-customers-v1-controller.phpclass-wc-rest-order-notes-v1-controller.phpclass-wc-rest-order-refunds-v1-controller.phpclass-wc-rest-orders-v1-controller.phpclass-wc-rest-product-attribute-terms-v1-controller.phpclass-wc-rest-product-attributes-v1-controller.phpclass-wc-rest-product-categories-v1-controller.phpclass-wc-rest-product-reviews-v1-controller.phpclass-wc-rest-product-shipping-classes-v1-controller.phpclass-wc-rest-product-tags-v1-controller.phpclass-wc-rest-products-v1-controller.phpclass-wc-rest-report-sales-v1-controller.phpclass-wc-rest-report-top-sellers-v1-controller.phpclass-wc-rest-reports-v1-controller.phpclass-wc-rest-tax-classes-v1-controller.phpclass-wc-rest-taxes-v1-controller.phpclass-wc-rest-webhook-deliveries-v1-controller.phpclass-wc-rest-webhooks-v1-controller.php
Version2
class-wc-rest-coupons-v2-controller.phpclass-wc-rest-customer-downloads-v2-controller.phpclass-wc-rest-customers-v2-controller.phpclass-wc-rest-network-orders-v2-controller.phpclass-wc-rest-order-notes-v2-controller.phpclass-wc-rest-order-refunds-v2-controller.phpclass-wc-rest-orders-v2-controller.phpclass-wc-rest-payment-gateways-v2-controller.phpclass-wc-rest-product-attribute-terms-v2-controller.phpclass-wc-rest-product-attributes-v2-controller.phpclass-wc-rest-product-categories-v2-controller.phpclass-wc-rest-product-reviews-v2-controller.phpclass-wc-rest-product-shipping-classes-v2-controller.phpclass-wc-rest-product-tags-v2-controller.phpclass-wc-rest-product-variations-v2-controller.phpclass-wc-rest-products-v2-controller.phpclass-wc-rest-report-sales-v2-controller.phpclass-wc-rest-report-top-sellers-v2-controller.phpclass-wc-rest-reports-v2-controller.phpclass-wc-rest-setting-options-v2-controller.phpclass-wc-rest-settings-v2-controller.phpclass-wc-rest-shipping-methods-v2-controller.phpclass-wc-rest-shipping-zone-locations-v2-controller.phpclass-wc-rest-shipping-zone-methods-v2-controller.phpclass-wc-rest-shipping-zones-v2-controller.phpclass-wc-rest-system-status-tools-v2-controller.phpclass-wc-rest-system-status-v2-controller.phpclass-wc-rest-tax-classes-v2-controller.phpclass-wc-rest-taxes-v2-controller.phpclass-wc-rest-webhook-deliveries-v2-controller.phpclass-wc-rest-webhooks-v2-controller.php
Version3
class-wc-rest-controller.phpclass-wc-rest-coupons-controller.phpclass-wc-rest-crud-controller.phpclass-wc-rest-customer-downloads-controller.phpclass-wc-rest-customers-controller.phpclass-wc-rest-data-continents-controller.phpclass-wc-rest-data-controller.phpclass-wc-rest-data-countries-controller.phpclass-wc-rest-data-currencies-controller.phpclass-wc-rest-network-orders-controller.phpclass-wc-rest-order-notes-controller.phpclass-wc-rest-order-refunds-controller.phpclass-wc-rest-orders-controller.phpclass-wc-rest-payment-gateways-controller.phpclass-wc-rest-posts-controller.phpclass-wc-rest-product-attribute-terms-controller.phpclass-wc-rest-product-attributes-controller.phpclass-wc-rest-product-categories-controller.phpclass-wc-rest-product-reviews-controller.phpclass-wc-rest-product-shipping-classes-controller.phpclass-wc-rest-product-tags-controller.phpclass-wc-rest-product-variations-controller.phpclass-wc-rest-products-controller.phpclass-wc-rest-report-coupons-totals-controller.phpclass-wc-rest-report-customers-totals-controller.phpclass-wc-rest-report-orders-totals-controller.phpclass-wc-rest-report-products-totals-controller.phpclass-wc-rest-report-reviews-totals-controller.phpclass-wc-rest-report-sales-controller.phpclass-wc-rest-report-top-sellers-controller.phpclass-wc-rest-reports-controller.phpclass-wc-rest-setting-options-controller.phpclass-wc-rest-settings-controller.phpclass-wc-rest-shipping-methods-controller.phpclass-wc-rest-shipping-zone-locations-controller.phpclass-wc-rest-shipping-zone-methods-controller.phpclass-wc-rest-shipping-zones-controller-base.phpclass-wc-rest-shipping-zones-controller.phpclass-wc-rest-system-status-controller.phpclass-wc-rest-system-status-tools-controller.phpclass-wc-rest-tax-classes-controller.phpclass-wc-rest-taxes-controller.phpclass-wc-rest-terms-controller.phpclass-wc-rest-webhooks-controller.php
Utilities
shipping
flat-rate
free-shipping
legacy-flat-rate
legacy-free-shipping
legacy-international-delivery
legacy-local-delivery
legacy-local-pickup
local-pickup
shortcodes
class-wc-shortcode-cart.phpclass-wc-shortcode-checkout.phpclass-wc-shortcode-my-account.phpclass-wc-shortcode-order-tracking.phpclass-wc-shortcode-products.php
theme-support
class-wc-twenty-eleven.phpclass-wc-twenty-fifteen.phpclass-wc-twenty-fourteen.phpclass-wc-twenty-nineteen.phpclass-wc-twenty-seventeen.phpclass-wc-twenty-sixteen.phpclass-wc-twenty-ten.phpclass-wc-twenty-thirteen.phpclass-wc-twenty-twelve.phpclass-wc-twenty-twenty-one.phpclass-wc-twenty-twenty.php
tracks
class-wc-site-tracking.phpclass-wc-tracks-client.phpclass-wc-tracks-event.phpclass-wc-tracks-footer-pixel.phpclass-wc-tracks.php
events
class-wc-admin-setup-wizard-tracking.phpclass-wc-coupon-tracking.phpclass-wc-coupons-tracking.phpclass-wc-extensions-tracking.phpclass-wc-importer-tracking.phpclass-wc-order-tracking.phpclass-wc-orders-tracking.phpclass-wc-products-tracking.phpclass-wc-settings-tracking.phpclass-wc-status-tracking.php
traits
walkers
class-product-cat-dropdown-walker.phpclass-product-cat-list-walker.phpclass-wc-product-cat-dropdown-walker.phpclass-wc-product-cat-list-walker.php
wc-account-functions.phpwc-attribute-functions.phpwc-cart-functions.phpwc-conditional-functions.phpwc-core-functions.phpwc-coupon-functions.phpwc-deprecated-functions.phpwc-formatting-functions.phpwc-notice-functions.phpwc-order-functions.phpwc-order-item-functions.phpwc-page-functions.phpwc-product-functions.phpwc-rest-functions.phpwc-stock-functions.phpwc-template-functions.phpwc-template-hooks.phpwc-term-functions.phpwc-update-functions.phpwc-user-functions.phpwc-webhook-functions.phpwc-widget-functions.phpwccom-site
class-wc-wccom-site-installer-requirements-check.phpclass-wc-wccom-site-installer.phpclass-wc-wccom-site.php
rest-api
widgets
class-wc-widget-cart.phpclass-wc-widget-layered-nav-filters.phpclass-wc-widget-layered-nav.phpclass-wc-widget-price-filter.phpclass-wc-widget-product-categories.phpclass-wc-widget-product-search.phpclass-wc-widget-product-tag-cloud.phpclass-wc-widget-products.phpclass-wc-widget-rating-filter.phpclass-wc-widget-recent-reviews.phpclass-wc-widget-recently-viewed.phpclass-wc-widget-top-rated-products.php
lib/packages/League/Container
Argument
ArgumentResolverInterface.phpArgumentResolverTrait.phpClassName.phpClassNameInterface.phpClassNameWithOptionalValue.phpRawArgument.phpRawArgumentInterface.php
Container.phpContainerAwareInterface.phpContainerAwareTrait.phpDefinition
Exception
Inflector
ReflectionContainer.phpServiceProvider
packages
action-scheduler
action-scheduler.php
classes
ActionScheduler_ActionClaim.phpActionScheduler_ActionFactory.phpActionScheduler_AdminView.phpActionScheduler_AsyncRequest_QueueRunner.phpActionScheduler_Compatibility.phpActionScheduler_DataController.phpActionScheduler_DateTime.phpActionScheduler_Exception.phpActionScheduler_FatalErrorMonitor.phpActionScheduler_InvalidActionException.phpActionScheduler_ListTable.phpActionScheduler_LogEntry.phpActionScheduler_NullLogEntry.phpActionScheduler_OptionLock.phpActionScheduler_QueueCleaner.phpActionScheduler_QueueRunner.phpActionScheduler_Versions.phpActionScheduler_WPCommentCleaner.phpActionScheduler_wcSystemStatus.php
WP_CLI
ActionScheduler_WPCLI_QueueRunner.phpActionScheduler_WPCLI_Scheduler_command.phpMigration_Command.phpProgressBar.php
abstracts
ActionScheduler.phpActionScheduler_Abstract_ListTable.phpActionScheduler_Abstract_QueueRunner.phpActionScheduler_Abstract_RecurringSchedule.phpActionScheduler_Abstract_Schedule.phpActionScheduler_Abstract_Schema.phpActionScheduler_Lock.phpActionScheduler_Logger.phpActionScheduler_Store.phpActionScheduler_TimezoneHelper.php
actions
ActionScheduler_Action.phpActionScheduler_CanceledAction.phpActionScheduler_FinishedAction.phpActionScheduler_NullAction.php
data-stores
ActionScheduler_DBLogger.phpActionScheduler_DBStore.phpActionScheduler_HybridStore.phpActionScheduler_wpCommentLogger.phpActionScheduler_wpPostStore.phpActionScheduler_wpPostStore_PostStatusRegistrar.phpActionScheduler_wpPostStore_PostTypeRegistrar.phpActionScheduler_wpPostStore_TaxonomyRegistrar.php
migration
ActionMigrator.phpActionScheduler_DBStoreMigrator.phpBatchFetcher.phpConfig.phpController.phpDryRun_ActionMigrator.phpDryRun_LogMigrator.phpLogMigrator.phpRunner.phpScheduler.php
schedules
ActionScheduler_CanceledSchedule.phpActionScheduler_CronSchedule.phpActionScheduler_IntervalSchedule.phpActionScheduler_NullSchedule.phpActionScheduler_Schedule.phpActionScheduler_SimpleSchedule.php
schema
deprecated
ActionScheduler_Abstract_QueueRunner_Deprecated.phpActionScheduler_AdminView_Deprecated.phpActionScheduler_Schedule_Deprecated.phpActionScheduler_Store_Deprecated.phpfunctions.php
functions.phplib
WP_Async_Request.php
license.txtreadme.txtcron-expression
CronExpression.phpCronExpression_AbstractField.phpCronExpression_DayOfMonthField.phpCronExpression_DayOfWeekField.phpCronExpression_FieldFactory.phpCronExpression_FieldInterface.phpCronExpression_HoursField.phpCronExpression_MinutesField.phpCronExpression_MonthField.phpCronExpression_YearField.phpLICENSE
woocommerce-admin
chunk-src-version-param.js
dist
activity-panels-help
activity-panels-inbox
analytics-report-categories
analytics-report-customers
analytics-report-orders
analytics-report-products
analytics-report-stock
analytics-report
analytics-settings
app
beta-features-tracking-modal
chunks
0.js0.style.css1.js1.js.LICENSE.txt11.style.css12.style.css14.style.css17.style.css2.js25.style.css26.style.css3.js31.style.css32.style.css34.style.css4.style.css45.style.css47.style.css48.style.css49.style.css5.style.css50.style.css51.style.css6.style.css7.style.css9.style.cssactivity-panels-help.jsactivity-panels-inbox.jsanalytics-report-categories.jsanalytics-report-coupons.jsanalytics-report-customers.jsanalytics-report-downloads.jsanalytics-report-orders.jsanalytics-report-products.jsanalytics-report-revenue.jsanalytics-report-stock.jsanalytics-report-taxes.jsanalytics-report-variations.jsanalytics-report.jsanalytics-settings.jscustomizable-dashboard.jsdashboard-charts.jsdashboard.jshomescreen.jsleaderboards.jsmarketing-overview.jspayment-recommendations.jsprofile-wizard.jsshipping-recommendations.jsstore-alerts.jsstore-performance.jstask-list.jswcpay-usage-modal.js
components
csv-export
currency
customer-effort-score
dashboard-charts
dashboard
data
date
experimental
explat
homescreen
leaderboards
marketing-coupons
marketing-overview
navigation-opt-out
navigation
notices
number
onboarding
payment-method-promotions
payment-recommendations
print-shipping-label-banner
profile-wizard
shipping-recommendations
store-alerts
store-performance
task-list
tracks
undefined
wp-admin-scripts
beta-features-tracking-modal.asset.phpbeta-features-tracking-modal.jsmarketing-coupons.asset.phpmarketing-coupons.jsmarketing-coupons.js.LICENSE.txtnavigation-opt-out.asset.phpnavigation-opt-out.jsonboarding-homepage-notice.asset.phponboarding-homepage-notice.jsonboarding-product-import-notice.asset.phponboarding-product-import-notice.jsonboarding-product-notice.asset.phponboarding-product-notice.jsonboarding-tax-notice.asset.phponboarding-tax-notice.jspayment-method-promotions.asset.phppayment-method-promotions.jspayment-method-promotions.js.LICENSE.txtprint-shipping-label-banner.asset.phpprint-shipping-label-banner.js
images
admin_notes
empty-content.svgmarketing
onboarding
bacs.svgcod.svgcreative-mail-by-constant-contact.pngcreativemail.pngeway.pngfb-woocommerce.pngg-shopping.pnggoogle-listings-and-ads.pngmailchimp-for-woocommerce.pngmailchimp.pngmailpoet.pngmercadopago.pngmollie.svgother-small.jpgpaystack.pngpayu.svgrazorpay.svgwcpay.svg
shippingillustration.svgincludes
class-experimental-abtest.phpconnect-existing-pages.phpcore-functions.php
emails
html-admin-report-export-download.phphtml-merchant-notification.phpplain-admin-report-export-download.phpplain-merchant-notification.php
feature-config.phppage-controller-functions.phpwc-admin-update-functions.phplanguages
license.txtlint-staged.config.jsreadme.txtsrc
API
Coupons.phpCustomAttributeTraits.phpCustomers.phpData.phpDataCountries.phpDataDownloadIPs.phpFeatures.phpInit.phpLeaderboards.phpMarketing.phpMarketingOverview.phpNavigationFavorites.phpNoteActions.phpNotes.phpOnboardingFreeExtensions.phpOnboardingPayments.phpOnboardingProductTypes.phpOnboardingProfile.phpOnboardingTasks.phpOnboardingThemes.phpOptions.phpOrders.phpPlugins.phpProductAttributeTerms.phpProductAttributes.phpProductCategories.phpProductReviews.phpProductVariations.phpProducts.phpProductsLowInStock.php
CategoryLookup.phpReports
Cache.php
SettingOptions.phpTaxes.phpCategories
Controller.phpCoupons
Customers
DataStore.phpDataStoreInterface.phpDownloads
Export
ExportableInterface.phpExportableTraits.phpImport
Orders
ParameterException.phpPerformanceIndicators
Products
Query.phpRevenue
Segmenter.phpSqlQuery.phpStock
Taxes
TimeInterval.phpVariations
Templates
Themes.phpComposer
DateTimeProvider
DeprecatedClassFacade.phpEvents.phpFeaturePlugin.phpFeatures
ActivityPanels.phpAnalytics.phpCoupons.phpCouponsMovedTrait.phpCustomerEffortScoreTracks.phpFeatures.phpHomescreen.phpMarketing.phpMobileAppBanner.php
Install.phpLoader.phpNavigation
Onboarding.phpOnboardingTasks
PaymentGatewaySuggestions
DataSourcePoller.phpDefaultPaymentGateways.phpEvaluateSuggestion.phpInit.phpPaymentGatewaysController.php
RemoteFreeExtensions
RemoteInboxNotifications.phpSettings.phpShippingLabelBanner.phpShippingLabelBannerDisplayRules.phpTransientNotices.phpWcPayPromotion
Marketing
Notes
AddFirstProduct.phpAddingAndManangingProducts.phpChooseNiche.phpChoosingTheme.phpCouponPageMoved.phpCustomizeStoreWithBlocks.phpCustomizingProductCatalog.phpDataStore.phpDeactivatePlugin.phpDeprecatedNotes.phpDrawAttention.phpEUVATNumber.phpEditProductsOnTheMove.phpFilterByProductVariationsInReports.phpFirstDownlaodableProduct.phpFirstProduct.phpGettingStartedInEcommerceWebinar.phpGivingFeedbackNotes.phpInsightFirstProductAndPayment.phpInsightFirstSale.phpInstallJPAndWCSPlugins.phpLaunchChecklist.phpLearnMoreAboutVariableProducts.phpManageOrdersOnTheGo.phpManageStoreActivityFromHomeScreen.phpMarketing.phpMarketingJetpack.php
MerchantEmailNotifications
MigrateFromShopify.phpMobileApp.phpNavigationFeedback.phpNavigationFeedbackFollowUp.phpNavigationNudge.phpNeedSomeInspiration.phpNewSalesRecord.phpNote.phpNoteTraits.phpNotes.phpNotesUnavailableException.phpOnboardingPayments.phpOnboardingTraits.phpOnlineClothingStore.phpOrderMilestones.phpPerformanceOnMobile.phpPersonalizeStore.phpRealTimeOrderAlerts.phpSellingOnlineCourses.phpSetUpAdditionalPaymentTypes.phpStartDropshippingBusiness.phpTestCheckout.phpTrackingOptIn.phpUnsecuredReportFiles.phpWelcomeToWooCommerceForStoreUsers.phpWooCommercePayments.phpWooCommerceSubscriptions.phpWooSubscriptionsNotes.phpOverrides
PageController.phpPaymentPlugins.phpPluginsHelper.phpPluginsInstaller.phpPluginsProvider
RemoteInboxNotifications
BaseLocationCountryRuleProcessor.phpBaseLocationStateRuleProcessor.phpComparisonOperation.phpDataSourcePoller.phpEvaluateAndGetStatus.phpEvaluationLogger.phpFailRuleProcessor.phpGetRuleProcessor.phpIsEcommerceRuleProcessor.phpNotRuleProcessor.phpNoteStatusRuleProcessor.phpOnboardingProfileRuleProcessor.phpOptionRuleProcessor.phpOrRuleProcessor.phpOrderCountRuleProcessor.phpOrdersProvider.phpPassRuleProcessor.phpPluginVersionRuleProcessor.phpPluginsActivatedRuleProcessor.phpProductCountRuleProcessor.phpPublishAfterTimeRuleProcessor.phpPublishBeforeTimeRuleProcessor.phpRemoteInboxNotificationsEngine.phpRuleEvaluator.phpRuleProcessorInterface.phpSpecRunner.phpStoredStateRuleProcessor.phpStoredStateSetupForProducts.phpTransformerInterface.phpTransformerService.php
ReportCSVEmail.phpReportCSVExporter.phpReportExporter.phpReportsSync.phpTransformers
WCAdminActiveForProvider.phpWCAdminActiveForRuleProcessor.phpWooCommerceAdminUpdatedRuleProcessor.phpSchedulers
CustomersScheduler.phpImportInterface.phpImportScheduler.phpMailchimpScheduler.phpOrdersScheduler.phpSchedulerTraits.php
Survey.phpWCAdminHelper.phpWCAdminSharedSettings.phptypings
uninstall.phpunminify.jsvendor
autoload.phpautoload_packages.php
woocommerce-admin.phpautomattic
jetpack-autoloader
LICENSE.txt
src
AutoloadFileWriter.phpAutoloadGenerator.phpAutoloadProcessor.phpCustomAutoloaderPlugin.phpManifestGenerator.phpautoload.phpclass-autoloader-handler.phpclass-autoloader-locator.phpclass-autoloader.phpclass-container.phpclass-hook-manager.phpclass-latest-autoloader-guard.phpclass-manifest-reader.phpclass-path-processor.phpclass-php-autoloader.phpclass-plugin-locator.phpclass-plugins-handler.phpclass-shutdown-handler.phpclass-version-loader.phpclass-version-selector.php
composer
ClassLoader.phpInstalledVersions.phpLICENSEautoload_classmap.phpautoload_namespaces.phpautoload_psr4.phpautoload_real.phpautoload_static.phpinstalled.jsoninstalled.php
installers
LICENSEphpstan.neon.distbootstrap.php
jetpack_autoload_classmap.phpjetpack_autoload_psr4.phpplatform_check.phpsrc
Composer
Installers
AglInstaller.phpAimeosInstaller.phpAnnotateCmsInstaller.phpAsgardInstaller.phpAttogramInstaller.phpBaseInstaller.phpBitrixInstaller.phpBonefishInstaller.phpCakePHPInstaller.phpChefInstaller.phpCiviCrmInstaller.phpClanCatsFrameworkInstaller.phpCockpitInstaller.phpCodeIgniterInstaller.phpConcrete5Installer.phpCraftInstaller.phpCroogoInstaller.phpDecibelInstaller.phpDframeInstaller.phpDokuWikiInstaller.phpDolibarrInstaller.phpDrupalInstaller.phpElggInstaller.phpEliasisInstaller.phpExpressionEngineInstaller.phpEzPlatformInstaller.phpFuelInstaller.phpFuelphpInstaller.phpGravInstaller.phpHuradInstaller.phpImageCMSInstaller.phpInstaller.phpItopInstaller.phpJoomlaInstaller.phpKanboardInstaller.phpKirbyInstaller.phpKnownInstaller.phpKodiCMSInstaller.phpKohanaInstaller.phpLanManagementSystemInstaller.phpLaravelInstaller.phpLavaLiteInstaller.phpLithiumInstaller.phpMODULEWorkInstaller.phpMODXEvoInstaller.phpMagentoInstaller.phpMajimaInstaller.phpMakoInstaller.phpMantisBTInstaller.phpMauticInstaller.phpMayaInstaller.phpMediaWikiInstaller.phpMiaoxingInstaller.phpMicroweberInstaller.phpModxInstaller.phpMoodleInstaller.phpOctoberInstaller.phpOntoWikiInstaller.phpOsclassInstaller.phpOxidInstaller.phpPPIInstaller.phpPantheonInstaller.phpPhiftyInstaller.phpPhpBBInstaller.phpPimcoreInstaller.phpPiwikInstaller.phpPlentymarketsInstaller.phpPlugin.phpPortoInstaller.phpPrestashopInstaller.phpProcessWireInstaller.phpPuppetInstaller.phpPxcmsInstaller.phpRadPHPInstaller.phpReIndexInstaller.phpRedaxo5Installer.phpRedaxoInstaller.phpRoundcubeInstaller.phpSMFInstaller.phpShopwareInstaller.phpSilverStripeInstaller.phpSiteDirectInstaller.phpStarbugInstaller.phpSyDESInstaller.phpSyliusInstaller.phpSymfony1Installer.phpTYPO3CmsInstaller.phpTYPO3FlowInstaller.phpTaoInstaller.phpTastyIgniterInstaller.phpTheliaInstaller.phpTuskInstaller.phpUserFrostingInstaller.phpVanillaInstaller.phpVgmcpInstaller.phpWHMCSInstaller.phpWinterInstaller.phpWolfCMSInstaller.phpWordPressInstaller.phpYawikInstaller.phpZendInstaller.phpZikulaInstaller.php
jetpack-autoloader
class-autoloader-handler.phpclass-autoloader-locator.phpclass-autoloader.phpclass-container.phpclass-hook-manager.phpclass-latest-autoloader-guard.phpclass-manifest-reader.phpclass-path-processor.phpclass-php-autoloader.phpclass-plugin-locator.phpclass-plugins-handler.phpclass-shutdown-handler.phpclass-version-loader.phpclass-version-selector.php
woocommerce-blocks
LICENSEindex.tscontainer-width-context.jseditor-context.jsindex.jsquery-state-context.jsindex.js
assets
css
js
atomic
blocks
component-init.jsindex.js
product-elements
add-to-cart
attributes.jsblock.jsconstants.jsedit.jsfrontend.jsindex.js
product-types
shared
style.scssbutton
category-list
image
price
rating
sale-badge
save.jsshared
sku
stock-indicator
summary
tag-list
title
utils
base
components
block-error-boundary
button
cart-checkout
address-form
form-step
index.jsorder-summary
payment-method-icons
payment-method-label
place-order-button
policies
product-backorder-badge
product-badge
product-details
product-image
product-low-stock-badge
product-metadata
product-sale-badge
product-summary
return-to-cart-button
shipping-calculator
shipping-location
shipping-rates-control-package
shipping-rates-control
totals
checkbox-control
checkbox-list
chip
combobox
country-input
CountryInputProps.tsbilling-country-input.tsxcountry-input.tsxindex.tsshipping-country-input.tsx
stories
style.scssdrawer
dropdown-selector
filter-element-label
filter-submit-button
form
formatted-monetary-amount
label
load-more-button
loading-mask
pagination
price-slider
product-list
container.jsindex.jsno-matching-products.jsno-products.js
product-list-item
product-list.jsproduct-sort-select
style.scssproduct-name
product-price
quantity-selector
radio-control-accordion
radio-control
read-more
reviews
sidebar-layout
sort-select
spinner
state-input
summary
tabs
text-input
textarea
title
context
event-emit
hooks
cart
collections
index.jspayment-methods
shipping
test
use-checkout-submit.jsuse-query-state.jsuse-store-notices.jsuse-store-products.jsuse-store-snackbar-notices.js
use-checkout-address.jsuse-checkout-extension-data.tsuse-checkout-notices.jsuse-checkout-submit.jsuse-customer-data.tsuse-emit-response.tsuse-query-state.jsuse-store-add-to-cart.tsuse-store-events.tsuse-store-notices.tsuse-store-products.jsuse-store-snackbar-notices.jsuse-validation.tsproviders
add-to-cart-form
cart-checkout
cart
checkout-processor.jscheckout-provider.jscheckout-state
customer
index.jspayment-methods
actions.tsconstants.tsevent-emit.tsindex.tspayment-method-data-context.tsxreducer.ts
test
types.tsuse-active-payment-method.tsuse-payment-method-dispatchers.tsuse-payment-method-registration.tsutils.tsshipping
utils.tsstore-notices
store-snackbar-notices
validation
test
utils.jshocs
hooks
index.js
test
use-container-queries.tsuse-local-storage-state.tsuse-position-relative-to-viewport.jsuse-previous.tsuse-shallow-equal.tsuse-throw-error.tsutils
blocks-registry
block-components
get-registered-block-components.jsindex.jsregister-block-component.jsregistered-block-components-init.js
index.jstest
payment-methods
blocks
active-filters
attribute-filter
cart-checkout
cart-i2
attributes.jsblock.jsstyle.scsstypes.tsuse-forced-layout.tsuse-view-switcher.tsx
checkout-button
columns
context.tsedit.tsxeditor-utils.tseditor.scssempty-cart-edit
frontend.jsfull-cart
hacks.tsindex.jsinner-blocks
cart-express-payment-block
cart-items-block
cart-line-items-block
cart-order-summary-block
cart-totals-block
empty-cart-block
filled-cart-block
index.tsxproceed-to-checkout-block
register-components.tscart
attributes.jsblock.js
checkout-button
edit.jseditor.scssempty-cart-edit
frontend.jsfull-cart
index.jsstyle.scsstest
checkout
attributes.tsblock.tsx
checkout-order-error
columns
context.tsedit.tsxeditor-utils.tsempty-cart
form-step
frontend.tsxhacks.tsindex.tsxinner-blocks
checkout-actions-block
checkout-billing-address-block
checkout-contact-information-block
checkout-express-payment-block
checkout-fields-block
checkout-order-note-block
checkout-order-summary-block
checkout-payment-block
checkout-shipping-address-block
checkout-shipping-methods-block
checkout-terms-block
checkout-totals-block
index.tsxregister-components.tsorder-notes
phone-number
styles
types.tsuse-forced-layout.tsutils.tsmini-cart
block.tsxcomponent-frontend.tsxedit.tsxfrontend.tsindex.tsxstyle.scsswith-mini-cart-conditional-hydration.tsx
payment-methods
featured-category
featured-product
handpicked-products
price-filter
product-best-sellers
product-categories
product-category
product-new
product-on-sale
product-search
product-tag
product-top-rated
products-by-attribute
products
reviews
all-reviews
attributes.jsedit-utils.jseditor-block.jseditor-container-block.jseditor.scssexample.jsfrontend-block.jsfrontend-container-block.jsfrontend.jsreviews-by-category
reviews-by-product
save.jsutils.jssingle-product
stock-filter
data
cart
collections
constants.tsdefault-states.tsindex.tsquery-state
schema
shared-controls.tstypes.tsutils
editor-components
block-title
compatibility-notices
edit-product-link
error-placeholder
expandable-search-list-item
external-link-card
feedback-prompt
grid-content-control
grid-layout-control
heading-toolbar
page-selector
product-attribute-term-control
product-category-control
product-control
product-orderby-control
product-tag-control
products-control
text-toolbar-button
toggle-button-control
utils
view-switcher
extensions
google-analytics
filters
global.d.tshocs
index.js
test
with-categories.jswith-category.jswith-product-variations.jswith-product.jswith-searched-products.jswith-transform-single-select-to-multiple-select.js
with-attributes.jswith-categories.jswith-category.jswith-product-variations.jswith-product.jswith-rest-api-hydration.jswith-searched-products.tsxwith-store-cart-api-hydration.jswith-transform-single-select-to-multiple-select.jsicons
icon
index.jslibrary
address.jsarrow-back.jsarrow-down-alt2.jsasterisk.jsatom.jsbank.jsbarcode.jsbill.jsbookmark.jsbox.jscard.jscart.jscheck-payment.jschevron-down.jschevron-right.jschevron-up.jscomment.jscontact.jsdiscussion.jsdone.jsexclamation.jsexternal.jseye.jsfields.jsfilled-cart.jsfolder-starred.jsfolder.jsform-step.jsgrid.jsheading.jsimage.jslist.jsmore.jsno-alt.jsnotes.jsnotice.jsradio-selected.jsradio-unselected.jsreader.jsremove-cart.jsrestore.jsreview.jssearch.jsserver.jsstar.jsstonks.jstag.jstags.jsthumb-up.jstoggle.jstotals.jstruck.jswidgets.jswoo.js
stories
middleware
payment-method-extensions
payment-methods
bacs
cheque
cod
paypal
stripe
credit-card
constants.jselements.jsindex.jspayment-method.jsuse-checkout-subscriptions.jsuse-element-options.jsuse-payment-intents.jsuse-payment-processing.js
index.jspayment-request
apple-pay-preview.jsconstants.jsindex.jspayment-request-express.jsuse-checkout-subscriptions.jsuse-event-handlers.jsuse-initialization.js
stripe-utils
previews
cart.tscategories.jsgrid-block.jsindex.jsproducts.jsreviews.jssaved-payment-methods.jsshipping-rates.tssingle-product-block.js
settings
blocks
shared
shared
context
hocs
types
index.ts
type-defs
add-to-cart-form.jsaddress-fields.jsbilling.jscart-response.tscart.jscart.tscontexts.jscontexts.tscurrency.tsevents.tshooks.jshooks.tsindex.tsobjects.tspayments.tsproduct-response.tsregistered-payment-method-props.jssettings.jsshipping.jsshipping.ts
type-guards
utils
build
active-filters-frontend.asset.phpactive-filters-frontend.jsactive-filters.asset.phpactive-filters.jsall-products-frontend.asset.phpall-products-frontend.jsall-products.asset.phpall-products.jsall-reviews.asset.phpall-reviews.jsattribute-filter-frontend.asset.phpattribute-filter-frontend.jsattribute-filter.asset.phpattribute-filter.jsblocks-checkout.asset.phpblocks-checkout.jsadd-to-cart-frontend.jswc-blocks-data.asset.phpwc-blocks-data.jswc-blocks-editor-style-rtl.csswc-blocks-editor-style.csswc-blocks-google-analytics.asset.phpwc-blocks-google-analytics.jswc-blocks-middleware.asset.phpwc-blocks-middleware.jswc-blocks-registry.asset.phpwc-blocks-registry.jswc-blocks-shared-context.asset.phpwc-blocks-shared-context.jswc-blocks-shared-hocs.asset.phpwc-blocks-shared-hocs.jswc-blocks-style-rtl.csswc-blocks-style.csswc-blocks-vendors-style-rtl.csswc-blocks-vendors-style.csswc-blocks-vendors.jswc-blocks.asset.phpwc-blocks.jswc-payment-method-bacs.asset.phpwc-payment-method-bacs.jswc-payment-method-cheque.asset.phpwc-payment-method-cheque.jswc-payment-method-cod.asset.phpwc-payment-method-cod.jswc-payment-method-paypal.asset.phpwc-payment-method-paypal.jswc-payment-method-stripe.asset.phpwc-payment-method-stripe.jswc-settings.asset.phpwc-settings.js
global.d.tsatomic-block-components
add-to-cart--atomic-block-components
add-to-cart-frontend.jsadd-to-cart.jsbutton-frontend.jsbutton.jscategory-list-frontend.jscategory-list.jsimage-frontend.jsimage.jsprice-frontend.jsprice.jsrating-frontend.jsrating.jssale-badge-frontend.jssale-badge.jssku-frontend.jssku.jsstock-indicator-frontend.jsstock-indicator.jssummary-frontend.jssummary.jstag-list-frontend.jstag-list.jstitle-frontend.jstitle.jscart-blocks
checkout-button-frontend.jsempty-cart-frontend.jsexpress-payment-frontend.jsfilled-cart-frontend.jsitems-frontend.jsline-items-frontend.jsorder-summary-frontend.jstotals-frontend.js
cart-frontend.asset.phpcart-frontend.jscart-i2-frontend.asset.phpcart-i2-frontend.jscart-i2.asset.phpcart-i2.jscart.asset.phpcart.jsexpress-payment--checkout-blocks
express-payment--checkout-blocks
order-summary--checkout-blocks
billing-address--checkout-blocks
checkout-blocks
actions-frontend.jsbilling-address-frontend.jscontact-information-frontend.jsexpress-payment-frontend.jsfields-frontend.jsorder-note-frontend.jsorder-summary-frontend.jspayment-frontend.jsshipping-address-frontend.jsshipping-methods-frontend.jsterms-frontend.jstotals-frontend.js
checkout-frontend.asset.phpcheckout-frontend.jscheckout.asset.phpcheckout.jsfeatured-category.asset.phpfeatured-category.jsfeatured-product.asset.phpfeatured-product.jshandpicked-products.asset.phphandpicked-products.jsmini-cart-component-frontend.asset.phpmini-cart-component-frontend.jsmini-cart-frontend.asset.phpmini-cart-frontend.jsmini-cart.asset.phpmini-cart.jsprice-filter-frontend.asset.phpprice-filter-frontend.jsprice-filter.asset.phpprice-filter.jsprice-format.asset.phpprice-format.jsproduct-best-sellers.asset.phpproduct-best-sellers.jsproduct-categories.asset.phpproduct-categories.jsproduct-category.asset.phpproduct-category.jsproduct-new.asset.phpproduct-new.jsproduct-on-sale.asset.phpproduct-on-sale.jsproduct-search.asset.phpproduct-search.jsproduct-tag.asset.phpproduct-tag.jsproduct-top-rated.asset.phpproduct-top-rated.jsproducts-by-attribute.asset.phpproducts-by-attribute.jsreviews-by-category.asset.phpreviews-by-category.jsreviews-by-product.asset.phpreviews-by-product.jsreviews-frontend.asset.phpreviews-frontend.jssingle-product-frontend.asset.phpsingle-product-frontend.jssingle-product.asset.phpsingle-product.jsstock-filter-frontend.asset.phpstock-filter-frontend.jsstock-filter.asset.phpstock-filter.jsvendors--atomic-block-components
add-to-cart--cart-blocks
order-summary--checkout-blocks
price--cart-blocks
line-items--cart-blocks
vendors--cart-blocks
line-items--checkout-blocks
order-summary--checkout-blocks
billing-address--checkout-blocks
images
block-error.svg
payment-methods
alipay.svgamex.svgbancontact.svgdiners.svgdiscover.svgeps.svggiropay.svgideal.svgjcb.svglaser.svgmaestro.svgmastercard.svgmultibanco.svgp24.svgsepa.svgsofort.svgunionpay.svgvisa.svgwechat.svg
previews
packages
checkout
blocks-registry
button
discounts-meta
error-boundary
index.jslabel
order-meta
order-shipping-packages
panel
registry
slot
style.scsstotals
utils
wrapper
prices
patches
readme.txtsrc
Assets.php
Assets
AssetsController.phpBlockTypes
AbstractBlock.phpAbstractDynamicBlock.phpAbstractProductGrid.phpActiveFilters.phpAllProducts.phpAllReviews.phpAtomicBlock.phpAttributeFilter.phpCart.phpCartI2.phpCheckout.phpFeaturedCategory.phpFeaturedProduct.phpHandpickedProducts.phpMiniCart.phpPriceFilter.phpProductBestSellers.phpProductCategories.phpProductCategory.phpProductNew.phpProductOnSale.phpProductSearch.phpProductTag.phpProductTopRated.phpProductsByAttribute.phpReviewsByCategory.phpReviewsByProduct.phpSingleProduct.phpStockFilter.php
BlockTypesController.phpDomain
InboxNotifications.phpInstaller.phpIntegrations
Library.phpPackage.phpPayments
Api.php
Integrations
PaymentContext.phpPaymentMethodRegistry.phpPaymentMethodTypeInterface.phpPaymentResult.phpRegistry
RestApi.phpStoreApi
Formatters.php
Formatters
Routes
AbstractCartRoute.phpAbstractRoute.phpAbstractTermsRoute.phpBatch.phpCart.phpCartAddItem.phpCartApplyCoupon.phpCartCoupons.phpCartCouponsByCode.phpCartExtensions.phpCartItems.phpCartItemsByKey.phpCartRemoveCoupon.phpCartRemoveItem.phpCartSelectShippingRate.phpCartUpdateCustomer.phpCartUpdateItem.phpCheckout.phpProductAttributeTerms.phpProductAttributes.phpProductAttributesById.phpProductCategories.phpProductCategoriesById.phpProductCollectionData.phpProductReviews.phpProductTags.phpProducts.phpProductsById.phpRouteException.phpRouteInterface.php
RoutesController.phpSchemaController.phpSchemas
AbstractAddressSchema.phpAbstractSchema.phpBillingAddressSchema.phpCartCouponSchema.phpCartExtensionsSchema.phpCartFeeSchema.phpCartItemSchema.phpCartSchema.phpCartShippingRateSchema.phpCheckoutSchema.phpErrorSchema.phpImageAttachmentSchema.phpOrderCouponSchema.phpProductAttributeSchema.phpProductCategorySchema.phpProductCollectionDataSchema.phpProductReviewSchema.phpProductSchema.phpShippingAddressSchema.phpTermSchema.php
Utilities
Utils
templates
vendor
autoload.phpautoload_packages.php
woocommerce-gutenberg-products-block.phpautomattic
jetpack-autoloader
LICENSE.txt
src
AutoloadFileWriter.phpAutoloadGenerator.phpAutoloadProcessor.phpCustomAutoloaderPlugin.phpManifestGenerator.phpautoload.phpclass-autoloader-handler.phpclass-autoloader-locator.phpclass-autoloader.phpclass-container.phpclass-hook-manager.phpclass-latest-autoloader-guard.phpclass-manifest-reader.phpclass-path-processor.phpclass-php-autoloader.phpclass-plugin-locator.phpclass-plugins-handler.phpclass-shutdown-handler.phpclass-version-loader.phpclass-version-selector.php
composer
ClassLoader.phpInstalledVersions.phpLICENSEautoload_classmap.phpautoload_namespaces.phpautoload_psr4.phpautoload_real.phpautoload_static.phpinstalled.jsoninstalled.php
installers
LICENSEphpstan.neon.distbootstrap.php
jetpack_autoload_classmap.phpjetpack_autoload_psr4.phpsrc
Composer
Installers
AglInstaller.phpAimeosInstaller.phpAnnotateCmsInstaller.phpAsgardInstaller.phpAttogramInstaller.phpBaseInstaller.phpBitrixInstaller.phpBonefishInstaller.phpCakePHPInstaller.phpChefInstaller.phpCiviCrmInstaller.phpClanCatsFrameworkInstaller.phpCockpitInstaller.phpCodeIgniterInstaller.phpConcrete5Installer.phpCraftInstaller.phpCroogoInstaller.phpDecibelInstaller.phpDframeInstaller.phpDokuWikiInstaller.phpDolibarrInstaller.phpDrupalInstaller.phpElggInstaller.phpEliasisInstaller.phpExpressionEngineInstaller.phpEzPlatformInstaller.phpFuelInstaller.phpFuelphpInstaller.phpGravInstaller.phpHuradInstaller.phpImageCMSInstaller.phpInstaller.phpItopInstaller.phpJoomlaInstaller.phpKanboardInstaller.phpKirbyInstaller.phpKnownInstaller.phpKodiCMSInstaller.phpKohanaInstaller.phpLanManagementSystemInstaller.phpLaravelInstaller.phpLavaLiteInstaller.phpLithiumInstaller.phpMODULEWorkInstaller.phpMODXEvoInstaller.phpMagentoInstaller.phpMajimaInstaller.phpMakoInstaller.phpMantisBTInstaller.phpMauticInstaller.phpMayaInstaller.phpMediaWikiInstaller.phpMiaoxingInstaller.phpMicroweberInstaller.phpModxInstaller.phpMoodleInstaller.phpOctoberInstaller.phpOntoWikiInstaller.phpOsclassInstaller.phpOxidInstaller.phpPPIInstaller.phpPhiftyInstaller.phpPhpBBInstaller.phpPimcoreInstaller.phpPiwikInstaller.phpPlentymarketsInstaller.phpPlugin.phpPortoInstaller.phpPrestashopInstaller.phpProcessWireInstaller.phpPuppetInstaller.phpPxcmsInstaller.phpRadPHPInstaller.phpReIndexInstaller.phpRedaxo5Installer.phpRedaxoInstaller.phpRoundcubeInstaller.phpSMFInstaller.phpShopwareInstaller.phpSilverStripeInstaller.phpSiteDirectInstaller.phpStarbugInstaller.phpSyDESInstaller.phpSyliusInstaller.phpSymfony1Installer.phpTYPO3CmsInstaller.phpTYPO3FlowInstaller.phpTaoInstaller.phpTastyIgniterInstaller.phpTheliaInstaller.phpTuskInstaller.phpUserFrostingInstaller.phpVanillaInstaller.phpVgmcpInstaller.phpWHMCSInstaller.phpWinterInstaller.phpWolfCMSInstaller.phpWordPressInstaller.phpYawikInstaller.phpZendInstaller.phpZikulaInstaller.php
jetpack-autoloader
class-autoloader-handler.phpclass-autoloader-locator.phpclass-autoloader.phpclass-container.phpclass-hook-manager.phpclass-latest-autoloader-guard.phpclass-manifest-reader.phpclass-path-processor.phpclass-php-autoloader.phpclass-plugin-locator.phpclass-plugins-handler.phpclass-shutdown-handler.phpclass-version-loader.phpclass-version-selector.php
sample-data
src
Autoloader.php
Checkout
Container.phpInternal
AssignDefaultCategory.php
Packages.phpDependencyManagement
AbstractServiceProvider.phpContainerException.phpDefinition.phpExtendedContainer.php
DownloadPermissionsAdjuster.phpServiceProviders
ProductAttributesLookup
RestApiUtil.phpRestockRefundedItemsAdjuster.phpWCCom
Proxies
Utilities
templates
archive-product.phptaxonomy-product-cat.phptaxonomy-product-tag.php
uninstall.phpauth
cart
cart-empty.phpcart-item-data.phpcart-shipping.phpcart-totals.phpcart.phpcross-sells.phpmini-cart.phpproceed-to-checkout-button.phpshipping-calculator.php
checkout
cart-errors.phpform-billing.phpform-checkout.phpform-coupon.phpform-login.phpform-pay.phpform-shipping.phporder-receipt.phppayment-method.phppayment.phpreview-order.phpterms.phpthankyou.php
content-product-cat.phpcontent-product.phpcontent-single-product.phpcontent-widget-price-filter.phpcontent-widget-product.phpcontent-widget-reviews.phpemails
admin-cancelled-order.phpadmin-failed-order.phpadmin-new-order.phpcustomer-completed-order.phpcustomer-invoice.phpcustomer-new-account.phpcustomer-note.phpcustomer-on-hold-order.phpcustomer-processing-order.phpcustomer-refunded-order.phpcustomer-reset-password.phpemail-addresses.phpemail-customer-details.phpemail-downloads.phpemail-footer.phpemail-header.phpemail-order-details.phpemail-order-items.phpemail-styles.php
plain
admin-cancelled-order.phpadmin-failed-order.phpadmin-new-order.phpcustomer-completed-order.phpcustomer-invoice.phpcustomer-new-account.phpcustomer-note.phpcustomer-on-hold-order.phpcustomer-processing-order.phpcustomer-refunded-order.phpcustomer-reset-password.phpemail-addresses.phpemail-customer-details.phpemail-downloads.phpemail-order-details.phpemail-order-items.php
global
loop
add-to-cart.phploop-end.phploop-start.phpno-products-found.phporderby.phppagination.phpprice.phprating.phpresult-count.phpsale-flash.php
myaccount
dashboard.phpdownloads.phpform-add-payment-method.phpform-edit-account.phpform-edit-address.phpform-login.phpform-lost-password.phpform-reset-password.phplost-password-confirmation.phpmy-account.phpmy-address.phpmy-downloads.phpmy-orders.phpnavigation.phporders.phppayment-methods.phpview-order.php
notices
order
form-tracking.phporder-again.phporder-details-customer.phporder-details-item.phporder-details.phporder-downloads.phptracking.php
product-searchform.phpsingle-product-reviews.phpsingle-product.phpsingle-product
add-to-cart
meta.phpphotoswipe.phpprice.phpproduct-attributes.phpproduct-image.phpproduct-thumbnails.phprating.phprelated.phpreview-meta.phpreview-rating.phpreview.phpsale-flash.phpshare.phpshort-description.phpstock.phptabs
title.phpup-sells.phpvendor
autoload.phpautoload_packages.php
woocommerce.phpautomattic
jetpack-autoloader
src
AutoloadFileWriter.phpAutoloadGenerator.phpAutoloadProcessor.phpCustomAutoloaderPlugin.phpManifestGenerator.phpautoload.phpclass-autoloader-handler.phpclass-autoloader-locator.phpclass-autoloader.phpclass-container.phpclass-hook-manager.phpclass-latest-autoloader-guard.phpclass-manifest-reader.phpclass-path-processor.phpclass-php-autoloader.phpclass-plugin-locator.phpclass-plugins-handler.phpclass-shutdown-handler.phpclass-version-loader.phpclass-version-selector.php
jetpack-constants
composer
ClassLoader.phpLICENSEautoload_classmap.phpautoload_namespaces.phpautoload_psr4.phpautoload_real.phpautoload_static.phpinstalled.json
installers
LICENSEphpstan.neon.distbootstrap.php
jetpack_autoload_classmap.phpsrc
Composer
Installers
AglInstaller.phpAimeosInstaller.phpAnnotateCmsInstaller.phpAsgardInstaller.phpAttogramInstaller.phpBaseInstaller.phpBitrixInstaller.phpBonefishInstaller.phpCakePHPInstaller.phpChefInstaller.phpCiviCrmInstaller.phpClanCatsFrameworkInstaller.phpCockpitInstaller.phpCodeIgniterInstaller.phpConcrete5Installer.phpCraftInstaller.phpCroogoInstaller.phpDecibelInstaller.phpDframeInstaller.phpDokuWikiInstaller.phpDolibarrInstaller.phpDrupalInstaller.phpElggInstaller.phpEliasisInstaller.phpExpressionEngineInstaller.phpEzPlatformInstaller.phpFuelInstaller.phpFuelphpInstaller.phpGravInstaller.phpHuradInstaller.phpImageCMSInstaller.phpInstaller.phpItopInstaller.phpJoomlaInstaller.phpKanboardInstaller.phpKirbyInstaller.phpKnownInstaller.phpKodiCMSInstaller.phpKohanaInstaller.phpLanManagementSystemInstaller.phpLaravelInstaller.phpLavaLiteInstaller.phpLithiumInstaller.phpMODULEWorkInstaller.phpMODXEvoInstaller.phpMagentoInstaller.phpMajimaInstaller.phpMakoInstaller.phpMantisBTInstaller.phpMauticInstaller.phpMayaInstaller.phpMediaWikiInstaller.phpMiaoxingInstaller.phpMicroweberInstaller.phpModxInstaller.phpMoodleInstaller.phpOctoberInstaller.phpOntoWikiInstaller.phpOsclassInstaller.phpOxidInstaller.phpPPIInstaller.phpPantheonInstaller.phpPhiftyInstaller.phpPhpBBInstaller.phpPimcoreInstaller.phpPiwikInstaller.phpPlentymarketsInstaller.phpPlugin.phpPortoInstaller.phpPrestashopInstaller.phpProcessWireInstaller.phpPuppetInstaller.phpPxcmsInstaller.phpRadPHPInstaller.phpReIndexInstaller.phpRedaxo5Installer.phpRedaxoInstaller.phpRoundcubeInstaller.phpSMFInstaller.phpShopwareInstaller.phpSilverStripeInstaller.phpSiteDirectInstaller.phpStarbugInstaller.phpSyDESInstaller.phpSyliusInstaller.phpSymfony1Installer.phpTYPO3CmsInstaller.phpTYPO3FlowInstaller.phpTaoInstaller.phpTastyIgniterInstaller.phpTheliaInstaller.phpTuskInstaller.phpUserFrostingInstaller.phpVanillaInstaller.phpVgmcpInstaller.phpWHMCSInstaller.phpWinterInstaller.phpWolfCMSInstaller.phpWordPressInstaller.phpYawikInstaller.phpZendInstaller.phpZikulaInstaller.php
jetpack-autoloader
class-autoloader-handler.phpclass-autoloader-locator.phpclass-autoloader.phpclass-container.phpclass-hook-manager.phpclass-latest-autoloader-guard.phpclass-manifest-reader.phpclass-path-processor.phpclass-php-autoloader.phpclass-plugin-locator.phpclass-plugins-handler.phpclass-shutdown-handler.phpclass-version-loader.phpclass-version-selector.php
maxmind-db
reader
pelago
emogrifier
psr
container
symfony
css-selector
CssSelectorConverter.php
Exception
ExceptionInterface.phpExpressionErrorException.phpInternalErrorException.phpParseException.phpSyntaxErrorException.php
LICENSENode
AbstractNode.phpAttributeNode.phpClassNode.phpCombinedSelectorNode.phpElementNode.phpFunctionNode.phpHashNode.phpNegationNode.phpNodeInterface.phpPseudoNode.phpSelectorNode.phpSpecificity.php
Parser
Handler
CommentHandler.phpHandlerInterface.phpHashHandler.phpIdentifierHandler.phpNumberHandler.phpStringHandler.phpWhitespaceHandler.php
Parser.phpParserInterface.phpReader.phpShortcut
Token.phpTokenStream.phpTokenizer
Tests
CssSelectorConverterTest.php
Node
AbstractNodeTest.phpAttributeNodeTest.phpClassNodeTest.phpCombinedSelectorNodeTest.phpElementNodeTest.phpFunctionNodeTest.phpHashNodeTest.phpNegationNodeTest.phpPseudoNodeTest.phpSelectorNodeTest.phpSpecificityTest.php
Parser
Handler
AbstractHandlerTest.phpCommentHandlerTest.phpHashHandlerTest.phpIdentifierHandlerTest.phpNumberHandlerTest.phpStringHandlerTest.phpWhitespaceHandlerTest.php
ParserTest.phpReaderTest.phpShortcut
TokenStreamTest.phpXPath
XPath
50
packages/woocommerce-blocks/assets/js/blocks-registry/block-components/get-registered-block-components.js
Normal file
50
packages/woocommerce-blocks/assets/js/blocks-registry/block-components/get-registered-block-components.js
Normal file
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import deprecated from '@wordpress/deprecated';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { registeredBlockComponents } from './registered-block-components-init';
|
||||
|
||||
/**
|
||||
* Get all Registered Block Components.
|
||||
*
|
||||
* WooCommerce Blocks allows React Components to be used on the frontend of the store in place of
|
||||
* Blocks instead of just serving static content.
|
||||
*
|
||||
* This gets all registered Block Components so we know which Blocks map to which React Components.
|
||||
*
|
||||
* @param {string} context Current context (a named parent Block). If Block Components were only
|
||||
* registered under a certain context, those Components will be returned,
|
||||
* as well as any Components registered under all contexts.
|
||||
* @return {Object} List of React Components registered under the provided context.
|
||||
*/
|
||||
export function getRegisteredBlockComponents( context ) {
|
||||
const parentInnerBlocks =
|
||||
typeof registeredBlockComponents[ context ] === 'object' &&
|
||||
Object.keys( registeredBlockComponents[ context ] ).length > 0
|
||||
? registeredBlockComponents[ context ]
|
||||
: {};
|
||||
|
||||
return {
|
||||
...parentInnerBlocks,
|
||||
...registeredBlockComponents.any,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of getRegisteredBlockComponents kept for backwards compatibility.
|
||||
*
|
||||
* @param {string} main Name of the parent block to retrieve children of.
|
||||
* @return {Object} List of registered inner blocks.
|
||||
*/
|
||||
export function getRegisteredInnerBlocks( main ) {
|
||||
deprecated( 'getRegisteredInnerBlocks', {
|
||||
version: '2.8.0',
|
||||
alternative: 'getRegisteredBlockComponents',
|
||||
plugin: 'WooCommerce Blocks',
|
||||
} );
|
||||
return getRegisteredBlockComponents( main );
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
export * from './get-registered-block-components';
|
||||
export * from './register-block-component';
|
106
packages/woocommerce-blocks/assets/js/blocks-registry/block-components/register-block-component.js
Normal file
106
packages/woocommerce-blocks/assets/js/blocks-registry/block-components/register-block-component.js
Normal file
@ -0,0 +1,106 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import deprecated from '@wordpress/deprecated';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { registeredBlockComponents } from './registered-block-components-init';
|
||||
|
||||
/**
|
||||
* Register a Block Component.
|
||||
*
|
||||
* WooCommerce Blocks allows React Components to be used on the frontend of the store in place of
|
||||
* Blocks instead of just serving static content.
|
||||
*
|
||||
* Registering a Block Component allows you to define which React Component should be used in place
|
||||
* of a registered Block. The Component, when rendered, will be passed all Block Attributes.
|
||||
*
|
||||
* @param {Object} options Options to use when registering the block.
|
||||
* @param {Function} options.component React component that will be rendered, or the return value from React.lazy if
|
||||
* dynamically imported.
|
||||
* @param {string} options.blockName Name of the block that this component belongs to.
|
||||
* @param {string} [options.context] To make this component available only under a certain context
|
||||
* (named parent Block) define it here. If left blank, the
|
||||
* Component will be available for all contexts.
|
||||
*/
|
||||
export function registerBlockComponent( options ) {
|
||||
if ( ! options.context ) {
|
||||
options.context = 'any';
|
||||
}
|
||||
assertOption( options, 'context', 'string' );
|
||||
assertOption( options, 'blockName', 'string' );
|
||||
assertBlockComponent( options, 'component' );
|
||||
|
||||
const { context, blockName, component } = options;
|
||||
|
||||
if ( ! registeredBlockComponents[ context ] ) {
|
||||
registeredBlockComponents[ context ] = {};
|
||||
}
|
||||
|
||||
registeredBlockComponents[ context ][ blockName ] = component;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asserts that an option is a valid react element or lazy callback. Otherwise, throws an error.
|
||||
*
|
||||
* @throws Will throw an error if the type of the option doesn't match the expected type.
|
||||
* @param {Object} options Object containing the option to validate.
|
||||
* @param {string} optionName Name of the option to validate.
|
||||
*/
|
||||
const assertBlockComponent = ( options, optionName ) => {
|
||||
if ( options[ optionName ] ) {
|
||||
if ( typeof options[ optionName ] === 'function' ) {
|
||||
return;
|
||||
}
|
||||
if (
|
||||
options[ optionName ].$$typeof &&
|
||||
options[ optionName ].$$typeof === Symbol.for( 'react.lazy' )
|
||||
) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw new Error(
|
||||
`Incorrect value for the ${ optionName } argument when registering a block component. Component must be a valid React Element or Lazy callback.`
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Asserts that an option is of the given type. Otherwise, throws an error.
|
||||
*
|
||||
* @throws Will throw an error if the type of the option doesn't match the expected type.
|
||||
* @param {Object} options Object containing the option to validate.
|
||||
* @param {string} optionName Name of the option to validate.
|
||||
* @param {string} expectedType Type expected for the option.
|
||||
*/
|
||||
const assertOption = ( options, optionName, expectedType ) => {
|
||||
const actualType = typeof options[ optionName ];
|
||||
if ( actualType !== expectedType ) {
|
||||
throw new Error(
|
||||
`Incorrect value for the ${ optionName } argument when registering a block component. It was a ${ actualType }, but must be a ${ expectedType }.`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Alias of registerBlockComponent kept for backwards compatibility.
|
||||
*
|
||||
* @param {Object} options Options to use when registering the block.
|
||||
* @param {string} options.main Name of the parent block.
|
||||
* @param {string} options.blockName Name of the child block being registered.
|
||||
* @param {Function} options.component React component used to render the child block.
|
||||
*/
|
||||
export function registerInnerBlock( options ) {
|
||||
deprecated( 'registerInnerBlock', {
|
||||
version: '2.8.0',
|
||||
alternative: 'registerBlockComponent',
|
||||
plugin: 'WooCommerce Blocks',
|
||||
hint: '"main" has been replaced with "context" and is now optional.',
|
||||
} );
|
||||
assertOption( options, 'main', 'string' );
|
||||
registerBlockComponent( {
|
||||
...options,
|
||||
context: options.main,
|
||||
} );
|
||||
}
|
3
packages/woocommerce-blocks/assets/js/blocks-registry/block-components/registered-block-components-init.js
Normal file
3
packages/woocommerce-blocks/assets/js/blocks-registry/block-components/registered-block-components-init.js
Normal file
@ -0,0 +1,3 @@
|
||||
const registeredBlockComponents = {};
|
||||
|
||||
export { registeredBlockComponents };
|
@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import {
|
||||
getRegisteredBlockComponents,
|
||||
registerBlockComponent,
|
||||
registerInnerBlock,
|
||||
getRegisteredInnerBlocks,
|
||||
} from '../index';
|
||||
|
||||
describe( 'blocks registry', () => {
|
||||
const context = '@woocommerce/all-products';
|
||||
const blockName = '@woocommerce-extension/price-level';
|
||||
const component = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
describe( 'registerBlockComponent', () => {
|
||||
const invokeTest = ( args ) => () => {
|
||||
return registerBlockComponent( args );
|
||||
};
|
||||
it( 'throws an error when registered block is missing `blockName`', () => {
|
||||
expect( invokeTest( { context, blockName: null } ) ).toThrowError(
|
||||
/blockName/
|
||||
);
|
||||
} );
|
||||
it( 'throws an error when registered block is missing `component`', () => {
|
||||
expect(
|
||||
invokeTest( { context, blockName, component: null } )
|
||||
).toThrowError( /component/ );
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( 'getRegisteredBlockComponents', () => {
|
||||
it( 'gets an empty object when context has no inner blocks', () => {
|
||||
expect(
|
||||
getRegisteredBlockComponents( '@woocommerce/all-products' )
|
||||
).toEqual( {} );
|
||||
} );
|
||||
it( 'gets a block that was successfully registered', () => {
|
||||
registerBlockComponent( { context, blockName, component } );
|
||||
expect(
|
||||
getRegisteredBlockComponents( '@woocommerce/all-products' )
|
||||
).toEqual( { [ blockName ]: component } );
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( 'registerInnerBlock (deprecated)', () => {
|
||||
const invokeTest = ( args ) => () => {
|
||||
registerInnerBlock( args );
|
||||
};
|
||||
|
||||
it( 'throws an error when registered block is missing `main`', () => {
|
||||
const options = { main: null };
|
||||
expect( invokeTest( options ) ).toThrowError( /main/ );
|
||||
expect( console ).toHaveWarned();
|
||||
} );
|
||||
it( 'throws an error when registered block is missing `blockName`', () => {
|
||||
const options = { main: context, blockName: null };
|
||||
expect( invokeTest( options ) ).toThrowError( /blockName/ );
|
||||
} );
|
||||
it( 'throws an error when registered block is missing `component`', () => {
|
||||
const options = { main: context, blockName, component: null };
|
||||
expect( invokeTest( options ) ).toThrowError( /component/ );
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( 'getRegisteredInnerBlocks (deprecated)', () => {
|
||||
it( 'gets an empty object when parent has no inner blocks', () => {
|
||||
expect(
|
||||
getRegisteredInnerBlocks( '@woocommerce/test-parent' )
|
||||
).toEqual( {} );
|
||||
expect( console ).toHaveWarned();
|
||||
} );
|
||||
it( 'gets a block that was successfully registered', () => {
|
||||
registerBlockComponent( { context, blockName, component } );
|
||||
expect(
|
||||
getRegisteredInnerBlocks( '@woocommerce/all-products' )
|
||||
).toEqual( {
|
||||
[ blockName ]: component,
|
||||
} );
|
||||
} );
|
||||
} );
|
||||
} );
|
@ -0,0 +1,2 @@
|
||||
export * from './payment-methods';
|
||||
export * from './block-components';
|
@ -0,0 +1,66 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { isValidElement } from '@wordpress/element';
|
||||
import type { ReactNode } from 'react';
|
||||
import type {
|
||||
PaymentMethodConfiguration,
|
||||
ExpressPaymentMethodConfiguration,
|
||||
} from '@woocommerce/type-defs/payments';
|
||||
|
||||
export const assertValidPaymentMethodComponent = (
|
||||
component: () => unknown,
|
||||
componentName: string
|
||||
): void => {
|
||||
if ( typeof component !== 'function' ) {
|
||||
throw new TypeError(
|
||||
`The ${ componentName } property for the payment method must be a functional component`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const assertValidElement = (
|
||||
element: ReactNode,
|
||||
elementName: string
|
||||
): void => {
|
||||
if ( element !== null && ! isValidElement( element ) ) {
|
||||
throw new TypeError(
|
||||
`The ${ elementName } property for the payment method must be a React element or null.`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const assertValidElementOrString = (
|
||||
element: ReactNode,
|
||||
elementName: string
|
||||
): void => {
|
||||
if (
|
||||
element !== null &&
|
||||
! isValidElement( element ) &&
|
||||
typeof element !== 'string'
|
||||
) {
|
||||
throw new TypeError(
|
||||
`The ${ elementName } property for the payment method must be a React element, a string, or null.`
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const assertConfigHasProperties = (
|
||||
config: ExpressPaymentMethodConfiguration | PaymentMethodConfiguration,
|
||||
expectedProperties: string[] = []
|
||||
): void => {
|
||||
const missingProperties = expectedProperties.reduce(
|
||||
( acc: string[], property: string ) => {
|
||||
if ( ! config.hasOwnProperty( property ) ) {
|
||||
acc.push( property );
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
[]
|
||||
);
|
||||
if ( missingProperties.length > 0 ) {
|
||||
const message =
|
||||
'The payment method configuration object is missing the following properties:';
|
||||
throw new TypeError( message + missingProperties.join( ', ' ) );
|
||||
}
|
||||
};
|
82
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/express-payment-method-config.ts
Normal file
82
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/express-payment-method-config.ts
Normal file
@ -0,0 +1,82 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import type { ReactNode } from 'react';
|
||||
import type {
|
||||
ExpressPaymentMethodConfiguration,
|
||||
Supports,
|
||||
CanMakePaymentCallback,
|
||||
ExpressPaymentMethodConfigInstance,
|
||||
} from '@woocommerce/type-defs/payments';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCanMakePayment } from './payment-method-config-helper';
|
||||
import { assertConfigHasProperties, assertValidElement } from './assertions';
|
||||
|
||||
export default class ExpressPaymentMethodConfig
|
||||
implements ExpressPaymentMethodConfigInstance {
|
||||
public name: string;
|
||||
public content: ReactNode;
|
||||
public edit: ReactNode;
|
||||
public paymentMethodId?: string;
|
||||
public supports: Supports;
|
||||
public canMakePaymentFromConfig: CanMakePaymentCallback;
|
||||
|
||||
constructor( config: ExpressPaymentMethodConfiguration ) {
|
||||
// validate config
|
||||
ExpressPaymentMethodConfig.assertValidConfig( config );
|
||||
this.name = config.name;
|
||||
this.content = config.content;
|
||||
this.edit = config.edit;
|
||||
this.paymentMethodId = config.paymentMethodId || this.name;
|
||||
this.supports = {
|
||||
features: config?.supports?.features || [ 'products' ],
|
||||
};
|
||||
this.canMakePaymentFromConfig = config.canMakePayment;
|
||||
}
|
||||
|
||||
// canMakePayment is calculated each time based on data that modifies outside of the class (eg: cart data).
|
||||
get canMakePayment(): CanMakePaymentCallback {
|
||||
return getCanMakePayment(
|
||||
this.canMakePaymentFromConfig,
|
||||
this.supports.features,
|
||||
this.name
|
||||
);
|
||||
}
|
||||
|
||||
static assertValidConfig = (
|
||||
config: ExpressPaymentMethodConfiguration
|
||||
): void => {
|
||||
assertConfigHasProperties( config, [ 'name', 'content', 'edit' ] );
|
||||
if ( typeof config.name !== 'string' ) {
|
||||
throw new TypeError(
|
||||
'The name property for the express payment method must be a string'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.paymentMethodId !== 'string' &&
|
||||
typeof config.paymentMethodId !== 'undefined'
|
||||
) {
|
||||
throw new Error(
|
||||
'The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.supports?.features !== 'undefined' &&
|
||||
! Array.isArray( config.supports?.features )
|
||||
) {
|
||||
throw new Error(
|
||||
'The features property for the payment method must be an array or undefined.'
|
||||
);
|
||||
}
|
||||
assertValidElement( config.content, 'content' );
|
||||
assertValidElement( config.edit, 'edit' );
|
||||
if ( typeof config.canMakePayment !== 'function' ) {
|
||||
throw new TypeError(
|
||||
'The canMakePayment property for the express payment method must be a function.'
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
23
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/extensions-config.ts
Normal file
23
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/extensions-config.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { CanMakePaymentExtensionCallback } from '@woocommerce/type-defs/payments';
|
||||
|
||||
type CanMakePaymentExtensionCallbacks = Record<
|
||||
string,
|
||||
CanMakePaymentExtensionCallback
|
||||
>;
|
||||
export type NamespacedCanMakePaymentExtensionsCallbacks = Record<
|
||||
string,
|
||||
CanMakePaymentExtensionCallbacks
|
||||
>;
|
||||
export type ExtensionNamespace = keyof NamespacedCanMakePaymentExtensionsCallbacks;
|
||||
export type PaymentMethodName = keyof CanMakePaymentExtensionCallbacks;
|
||||
|
||||
// Keeps callbacks registered by extensions for different payment methods
|
||||
// eslint-disable-next-line prefer-const
|
||||
export const canMakePaymentExtensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks = {};
|
||||
|
||||
export const extensionsConfig = {
|
||||
canMakePayment: canMakePaymentExtensionsCallbacks,
|
||||
};
|
@ -0,0 +1 @@
|
||||
export * from './registry';
|
90
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/payment-method-config-helper.ts
Normal file
90
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/payment-method-config-helper.ts
Normal file
@ -0,0 +1,90 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import type {
|
||||
CanMakePaymentCallback,
|
||||
CanMakePaymentExtensionCallback,
|
||||
} from '@woocommerce/type-defs/payments';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import {
|
||||
NamespacedCanMakePaymentExtensionsCallbacks,
|
||||
PaymentMethodName,
|
||||
ExtensionNamespace,
|
||||
extensionsConfig,
|
||||
} from './extensions-config';
|
||||
|
||||
// Filter out payment methods by supported features and cart requirement.
|
||||
export const canMakePaymentWithFeaturesCheck = (
|
||||
canMakePayment: CanMakePaymentCallback,
|
||||
features: string[]
|
||||
): CanMakePaymentCallback => ( canPayArgument ) => {
|
||||
const requirements = canPayArgument?.paymentRequirements || [];
|
||||
const featuresSupportRequirements = requirements.every( ( requirement ) =>
|
||||
features.includes( requirement )
|
||||
);
|
||||
return featuresSupportRequirements && canMakePayment( canPayArgument );
|
||||
};
|
||||
|
||||
// Filter out payment methods by callbacks registered by extensions.
|
||||
export const canMakePaymentWithExtensions = (
|
||||
canMakePayment: CanMakePaymentCallback,
|
||||
extensionsCallbacks: NamespacedCanMakePaymentExtensionsCallbacks,
|
||||
paymentMethodName: PaymentMethodName
|
||||
): CanMakePaymentCallback => ( canPayArgument ) => {
|
||||
// Validate whether the payment method is available based on its own criteria first.
|
||||
let canPay = canMakePayment( canPayArgument );
|
||||
|
||||
if ( canPay ) {
|
||||
// Gather all callbacks for paymentMethodName.
|
||||
const namespacedCallbacks: Record<
|
||||
ExtensionNamespace,
|
||||
CanMakePaymentExtensionCallback
|
||||
> = {};
|
||||
|
||||
Object.entries( extensionsCallbacks ).forEach(
|
||||
( [ namespace, callbacks ] ) => {
|
||||
namespacedCallbacks[ namespace ] =
|
||||
callbacks[ paymentMethodName ];
|
||||
}
|
||||
);
|
||||
|
||||
canPay = Object.keys( namespacedCallbacks ).every( ( namespace ) => {
|
||||
try {
|
||||
return namespacedCallbacks[ namespace ]( canPayArgument );
|
||||
} catch ( err ) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
`Error when executing callback for ${ paymentMethodName } in ${ namespace }`,
|
||||
err
|
||||
);
|
||||
// .every() expects a return value at the end of every arrow function and
|
||||
// this ensures that the error is ignored when computing the whole result.
|
||||
return true;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
return canPay;
|
||||
};
|
||||
|
||||
export const getCanMakePayment = (
|
||||
canMakePayment: CanMakePaymentCallback,
|
||||
features: string[],
|
||||
paymentMethodName: string
|
||||
): CanMakePaymentCallback => {
|
||||
const canPay = canMakePaymentWithFeaturesCheck( canMakePayment, features );
|
||||
// Loop through all callbacks to check if there are any registered for this payment method.
|
||||
return ( Object.values( extensionsConfig.canMakePayment ) as Record<
|
||||
PaymentMethodName,
|
||||
CanMakePaymentCallback
|
||||
>[] ).some( ( callbacks ) => paymentMethodName in callbacks )
|
||||
? canMakePaymentWithExtensions(
|
||||
canPay,
|
||||
extensionsConfig.canMakePayment,
|
||||
paymentMethodName
|
||||
)
|
||||
: canPay;
|
||||
};
|
167
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/payment-method-config.tsx
Normal file
167
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/payment-method-config.tsx
Normal file
@ -0,0 +1,167 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import deprecated from '@wordpress/deprecated';
|
||||
import type { ReactNode } from 'react';
|
||||
import type {
|
||||
PaymentMethodConfiguration,
|
||||
Supports,
|
||||
CanMakePaymentCallback,
|
||||
PaymentMethodConfigInstance,
|
||||
PaymentMethodIcons,
|
||||
} from '@woocommerce/type-defs/payments';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { getCanMakePayment } from './payment-method-config-helper';
|
||||
import {
|
||||
assertConfigHasProperties,
|
||||
assertValidElement,
|
||||
assertValidElementOrString,
|
||||
} from './assertions';
|
||||
|
||||
const NullComponent = () => {
|
||||
return null;
|
||||
};
|
||||
|
||||
export default class PaymentMethodConfig
|
||||
implements PaymentMethodConfigInstance {
|
||||
public name: string;
|
||||
public content: ReactNode;
|
||||
public edit: ReactNode;
|
||||
public paymentMethodId?: string;
|
||||
public supports: Supports;
|
||||
public icons: null | PaymentMethodIcons;
|
||||
public label: ReactNode;
|
||||
public ariaLabel: string;
|
||||
public placeOrderButtonLabel?: string;
|
||||
public savedTokenComponent?: ReactNode | null;
|
||||
public canMakePaymentFromConfig: CanMakePaymentCallback;
|
||||
|
||||
constructor( config: PaymentMethodConfiguration ) {
|
||||
// validate config
|
||||
PaymentMethodConfig.assertValidConfig( config );
|
||||
this.name = config.name;
|
||||
this.label = config.label;
|
||||
this.placeOrderButtonLabel = config.placeOrderButtonLabel;
|
||||
this.ariaLabel = config.ariaLabel;
|
||||
this.content = config.content;
|
||||
this.savedTokenComponent = config.savedTokenComponent;
|
||||
this.icons = config.icons || null;
|
||||
this.edit = config.edit;
|
||||
this.paymentMethodId = config.paymentMethodId || this.name;
|
||||
this.supports = {
|
||||
showSavedCards:
|
||||
config?.supports?.showSavedCards ||
|
||||
config?.supports?.savePaymentInfo || // Kept for backward compatibility if methods still pass this when registering.
|
||||
false,
|
||||
showSaveOption: config?.supports?.showSaveOption || false,
|
||||
features: config?.supports?.features || [ 'products' ],
|
||||
};
|
||||
this.canMakePaymentFromConfig = config.canMakePayment;
|
||||
}
|
||||
|
||||
// canMakePayment is calculated each time based on data that modifies outside of the class (eg: cart data).
|
||||
get canMakePayment(): CanMakePaymentCallback {
|
||||
return getCanMakePayment(
|
||||
this.canMakePaymentFromConfig,
|
||||
this.supports.features,
|
||||
this.name
|
||||
);
|
||||
}
|
||||
|
||||
static assertValidConfig = ( config: PaymentMethodConfiguration ): void => {
|
||||
// set default for optional
|
||||
config.savedTokenComponent = config.savedTokenComponent || (
|
||||
<NullComponent />
|
||||
);
|
||||
assertConfigHasProperties( config, [
|
||||
'name',
|
||||
'label',
|
||||
'ariaLabel',
|
||||
'content',
|
||||
'edit',
|
||||
'canMakePayment',
|
||||
] );
|
||||
if ( typeof config.name !== 'string' ) {
|
||||
throw new Error(
|
||||
'The name property for the payment method must be a string'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.icons !== 'undefined' &&
|
||||
! Array.isArray( config.icons ) &&
|
||||
config.icons !== null
|
||||
) {
|
||||
throw new Error(
|
||||
'The icons property for the payment method must be an array or null.'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.paymentMethodId !== 'string' &&
|
||||
typeof config.paymentMethodId !== 'undefined'
|
||||
) {
|
||||
throw new Error(
|
||||
'The paymentMethodId property for the payment method must be a string or undefined (in which case it will be the value of the name property).'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.placeOrderButtonLabel !== 'string' &&
|
||||
typeof config.placeOrderButtonLabel !== 'undefined'
|
||||
) {
|
||||
throw new TypeError(
|
||||
'The placeOrderButtonLabel property for the payment method must be a string'
|
||||
);
|
||||
}
|
||||
assertValidElementOrString( config.label, 'label' );
|
||||
assertValidElement( config.content, 'content' );
|
||||
assertValidElement( config.edit, 'edit' );
|
||||
assertValidElement( config.savedTokenComponent, 'savedTokenComponent' );
|
||||
if ( typeof config.ariaLabel !== 'string' ) {
|
||||
throw new TypeError(
|
||||
'The ariaLabel property for the payment method must be a string'
|
||||
);
|
||||
}
|
||||
if ( typeof config.canMakePayment !== 'function' ) {
|
||||
throw new TypeError(
|
||||
'The canMakePayment property for the payment method must be a function.'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.supports?.showSavedCards !== 'undefined' &&
|
||||
typeof config.supports?.showSavedCards !== 'boolean'
|
||||
) {
|
||||
throw new TypeError(
|
||||
'If the payment method includes the `supports.showSavedCards` property, it must be a boolean'
|
||||
);
|
||||
}
|
||||
if ( typeof config.supports?.savePaymentInfo !== 'undefined' ) {
|
||||
deprecated(
|
||||
'Passing savePaymentInfo when registering a payment method.',
|
||||
{
|
||||
alternative: 'Pass showSavedCards and showSaveOption',
|
||||
plugin: 'woocommerce-gutenberg-products-block',
|
||||
link:
|
||||
'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3686',
|
||||
}
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.supports?.features !== 'undefined' &&
|
||||
! Array.isArray( config.supports?.features )
|
||||
) {
|
||||
throw new Error(
|
||||
'The features property for the payment method must be an array or undefined.'
|
||||
);
|
||||
}
|
||||
if (
|
||||
typeof config.supports?.showSaveOption !== 'undefined' &&
|
||||
typeof config.supports?.showSaveOption !== 'boolean'
|
||||
) {
|
||||
throw new TypeError(
|
||||
'If the payment method includes the `supports.showSaveOption` property, it must be a boolean'
|
||||
);
|
||||
}
|
||||
};
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import deprecated from '@wordpress/deprecated';
|
||||
import type {
|
||||
PaymentMethodConfiguration,
|
||||
ExpressPaymentMethodConfiguration,
|
||||
CanMakePaymentExtensionCallback,
|
||||
PaymentMethodConfigInstance,
|
||||
PaymentMethods,
|
||||
ExpressPaymentMethods,
|
||||
} from '@woocommerce/type-defs/payments';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { default as PaymentMethodConfig } from './payment-method-config';
|
||||
import { default as ExpressPaymentMethodConfig } from './express-payment-method-config';
|
||||
import { canMakePaymentExtensionsCallbacks } from './extensions-config';
|
||||
|
||||
type LegacyRegisterPaymentMethodFunction = ( config: unknown ) => unknown;
|
||||
type LegacyRegisterExpessPaymentMethodFunction = ( config: unknown ) => unknown;
|
||||
|
||||
const paymentMethods: PaymentMethods = {};
|
||||
const expressPaymentMethods: ExpressPaymentMethods = {};
|
||||
|
||||
/**
|
||||
* Register a regular payment method.
|
||||
*/
|
||||
export const registerPaymentMethod = (
|
||||
options: PaymentMethodConfiguration | LegacyRegisterPaymentMethodFunction
|
||||
): void => {
|
||||
let paymentMethodConfig: PaymentMethodConfigInstance | unknown;
|
||||
if ( typeof options === 'function' ) {
|
||||
// Legacy fallback for previous API, where client passes a function:
|
||||
// registerPaymentMethod( ( Config ) => new Config( options ) );
|
||||
paymentMethodConfig = options( PaymentMethodConfig );
|
||||
deprecated( 'Passing a callback to registerPaymentMethod()', {
|
||||
alternative: 'a config options object',
|
||||
plugin: 'woocommerce-gutenberg-products-block',
|
||||
link:
|
||||
'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404',
|
||||
} );
|
||||
} else {
|
||||
paymentMethodConfig = new PaymentMethodConfig( options );
|
||||
}
|
||||
if ( paymentMethodConfig instanceof PaymentMethodConfig ) {
|
||||
paymentMethods[ paymentMethodConfig.name ] = paymentMethodConfig;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Register an express payment method.
|
||||
*/
|
||||
export const registerExpressPaymentMethod = (
|
||||
options:
|
||||
| ExpressPaymentMethodConfiguration
|
||||
| LegacyRegisterExpessPaymentMethodFunction
|
||||
): void => {
|
||||
let paymentMethodConfig;
|
||||
if ( typeof options === 'function' ) {
|
||||
// Legacy fallback for previous API, where client passes a function:
|
||||
// registerExpressPaymentMethod( ( Config ) => new Config( options ) );
|
||||
paymentMethodConfig = options( ExpressPaymentMethodConfig );
|
||||
deprecated( 'Passing a callback to registerExpressPaymentMethod()', {
|
||||
alternative: 'a config options object',
|
||||
plugin: 'woocommerce-gutenberg-products-block',
|
||||
link:
|
||||
'https://github.com/woocommerce/woocommerce-gutenberg-products-block/pull/3404',
|
||||
} );
|
||||
} else {
|
||||
paymentMethodConfig = new ExpressPaymentMethodConfig( options );
|
||||
}
|
||||
if ( paymentMethodConfig instanceof ExpressPaymentMethodConfig ) {
|
||||
expressPaymentMethods[ paymentMethodConfig.name ] = paymentMethodConfig;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Allows extension to register callbacks for specific payment methods to determine if they can make payments
|
||||
*/
|
||||
export const registerPaymentMethodExtensionCallbacks = (
|
||||
namespace: string,
|
||||
callbacks: Record< string, CanMakePaymentExtensionCallback >
|
||||
): void => {
|
||||
if ( canMakePaymentExtensionsCallbacks[ namespace ] ) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
`The namespace provided to registerPaymentMethodExtensionCallbacks must be unique. Callbacks have already been registered for the ${ namespace } namespace.`
|
||||
);
|
||||
} else {
|
||||
// Set namespace up as an empty object.
|
||||
canMakePaymentExtensionsCallbacks[ namespace ] = {};
|
||||
|
||||
Object.entries( callbacks ).forEach(
|
||||
( [ paymentMethodName, callback ] ) => {
|
||||
if ( typeof callback === 'function' ) {
|
||||
canMakePaymentExtensionsCallbacks[ namespace ][
|
||||
paymentMethodName
|
||||
] = callback;
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
console.error(
|
||||
`All callbacks provided to registerPaymentMethodExtensionCallbacks must be functions. The callback for the ${ paymentMethodName } payment method in the ${ namespace } namespace was not a function.`
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
export const __experimentalDeRegisterPaymentMethod = (
|
||||
paymentMethodName: string
|
||||
): void => {
|
||||
delete paymentMethods[ paymentMethodName ];
|
||||
};
|
||||
|
||||
export const __experimentalDeRegisterExpressPaymentMethod = (
|
||||
paymentMethodName: string
|
||||
): void => {
|
||||
delete expressPaymentMethods[ paymentMethodName ];
|
||||
};
|
||||
|
||||
export const getPaymentMethods = (): PaymentMethods => {
|
||||
return paymentMethods;
|
||||
};
|
||||
|
||||
export const getExpressPaymentMethods = (): ExpressPaymentMethods => {
|
||||
return expressPaymentMethods;
|
||||
};
|
205
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/payment-method-config-helper.ts
Normal file
205
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/payment-method-config-helper.ts
Normal file
@ -0,0 +1,205 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { registerPaymentMethodExtensionCallbacks } from '@woocommerce/blocks-registry';
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import * as helpers from '../payment-method-config-helper';
|
||||
import { canMakePaymentExtensionsCallbacks } from '../extensions-config';
|
||||
|
||||
const canMakePaymentArgument = {
|
||||
cartTotals: {
|
||||
total_items: '1488',
|
||||
total_items_tax: '312',
|
||||
total_fees: '0',
|
||||
total_fees_tax: '0',
|
||||
total_discount: '0',
|
||||
total_discount_tax: '0',
|
||||
total_shipping: '0',
|
||||
total_shipping_tax: '0',
|
||||
total_price: '1800',
|
||||
total_tax: '312',
|
||||
tax_lines: [
|
||||
{
|
||||
name: 'BTW',
|
||||
price: '312',
|
||||
rate: '21%',
|
||||
},
|
||||
],
|
||||
currency_code: 'EUR',
|
||||
currency_symbol: '€',
|
||||
currency_minor_unit: 2,
|
||||
currency_decimal_separator: ',',
|
||||
currency_thousand_separator: '.',
|
||||
currency_prefix: '€',
|
||||
currency_suffix: '',
|
||||
},
|
||||
cartNeedsShipping: true,
|
||||
billingData: {
|
||||
first_name: 'name',
|
||||
last_name: 'Name',
|
||||
company: '',
|
||||
address_1: 'fdsfdsfdsf',
|
||||
address_2: '',
|
||||
city: 'Berlin',
|
||||
state: '',
|
||||
postcode: 'xxxxx',
|
||||
country: 'DE',
|
||||
email: 'name.Name@test.com',
|
||||
phone: '1234',
|
||||
},
|
||||
shippingAddress: {
|
||||
first_name: 'name',
|
||||
last_name: 'Name',
|
||||
company: '',
|
||||
address_1: 'fdsfdsfdsf',
|
||||
address_2: '',
|
||||
city: 'Berlin',
|
||||
state: '',
|
||||
postcode: 'xxxxx',
|
||||
country: 'DE',
|
||||
phone: '1234',
|
||||
},
|
||||
selectedShippingMethods: {
|
||||
'0': 'free_shipping:1',
|
||||
},
|
||||
paymentRequirements: [ 'products' ],
|
||||
};
|
||||
describe( 'payment-method-config-helper', () => {
|
||||
const trueCallback = jest.fn().mockReturnValue( true );
|
||||
const falseCallback = jest.fn().mockReturnValue( false );
|
||||
const bacsCallback = jest.fn().mockReturnValue( false );
|
||||
const throwsCallback = jest.fn().mockImplementation( () => {
|
||||
throw new Error();
|
||||
} );
|
||||
beforeAll( () => {
|
||||
// Register extension callbacks for two payment methods.
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'woocommerce-marketplace-extension',
|
||||
{
|
||||
// cod: one extension returns true, the other returns false.
|
||||
cod: trueCallback,
|
||||
// cheque: returns true only if arg.billingData.postcode is 12345.
|
||||
cheque: ( arg ) => arg.billingData.postcode === '12345',
|
||||
// bacs: both extensions return false.
|
||||
bacs: bacsCallback,
|
||||
// woopay: both extensions return true.
|
||||
woopay: trueCallback,
|
||||
// testpay: one callback errors, one returns true
|
||||
testpay: throwsCallback,
|
||||
}
|
||||
);
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'other-woocommerce-marketplace-extension',
|
||||
{
|
||||
cod: falseCallback,
|
||||
woopay: trueCallback,
|
||||
testpay: trueCallback,
|
||||
bacs: bacsCallback,
|
||||
}
|
||||
);
|
||||
} );
|
||||
|
||||
beforeEach( () => {
|
||||
trueCallback.mockClear();
|
||||
throwsCallback.mockClear();
|
||||
falseCallback.mockClear();
|
||||
bacsCallback.mockClear();
|
||||
} );
|
||||
describe( 'getCanMakePayment', () => {
|
||||
it( 'returns callback canMakePaymentWithFeaturesCheck if no extension callback is detected', () => {
|
||||
// Define arguments from a payment method ('missing-payment-method') with no registered extension callbacks.
|
||||
const args = {
|
||||
canMakePayment: jest.fn().mockImplementation( () => true ),
|
||||
features: [ 'products' ],
|
||||
paymentMethodName: 'missing-payment-method',
|
||||
};
|
||||
|
||||
const canMakePayment = helpers.getCanMakePayment(
|
||||
args.canMakePayment,
|
||||
args.features,
|
||||
args.paymentMethodName
|
||||
)( canMakePaymentArgument );
|
||||
|
||||
// Expect that the result of getCanMakePayment is the result of
|
||||
// the payment method's own canMakePayment, as no extension callbacks are called.
|
||||
expect( canMakePayment ).toEqual( args.canMakePayment() );
|
||||
} );
|
||||
|
||||
it( 'returns callbacks from the extensions when they are defined', () => {
|
||||
// Define arguments from a payment method (bacs) with registered extension callbacks.
|
||||
const args = {
|
||||
canMakePaymentConfiguration: jest
|
||||
.fn()
|
||||
.mockImplementation( () => true ),
|
||||
features: [ 'products' ],
|
||||
paymentMethodName: 'bacs',
|
||||
};
|
||||
|
||||
const canMakePayment = helpers.getCanMakePayment(
|
||||
args.canMakePaymentConfiguration,
|
||||
args.features,
|
||||
args.paymentMethodName
|
||||
)( canMakePaymentArgument );
|
||||
|
||||
// Expect that the result of getCanMakePayment is not the result of
|
||||
// the payment method's own canMakePayment (args.canMakePaymentConfiguration),
|
||||
// but of the registered bacsCallback.
|
||||
expect( canMakePayment ).toBe( bacsCallback() );
|
||||
} );
|
||||
} );
|
||||
|
||||
describe( 'canMakePaymentWithExtensions', () => {
|
||||
it( "Returns false without executing the registered callbacks, if the payment method's canMakePayment callback returns false.", () => {
|
||||
const canMakePayment = () => false;
|
||||
const canMakePaymentWithExtensionsResult = helpers.canMakePaymentWithExtensions(
|
||||
canMakePayment,
|
||||
canMakePaymentExtensionsCallbacks,
|
||||
'cod'
|
||||
)( canMakePaymentArgument );
|
||||
expect( canMakePaymentWithExtensionsResult ).toBe( false );
|
||||
expect( trueCallback ).not.toHaveBeenCalled();
|
||||
} );
|
||||
|
||||
it( 'Returns early when a registered callback returns false, without executing all the registered callbacks', () => {
|
||||
helpers.canMakePaymentWithExtensions(
|
||||
() => true,
|
||||
canMakePaymentExtensionsCallbacks,
|
||||
'bacs'
|
||||
)( canMakePaymentArgument );
|
||||
expect( bacsCallback ).toHaveBeenCalledTimes( 1 );
|
||||
} );
|
||||
|
||||
it( 'Returns true if all extension callbacks return true', () => {
|
||||
const result = helpers.canMakePaymentWithExtensions(
|
||||
() => true,
|
||||
canMakePaymentExtensionsCallbacks,
|
||||
'woopay'
|
||||
)( canMakePaymentArgument );
|
||||
expect( result ).toBe( true );
|
||||
} );
|
||||
|
||||
it( 'Passes canPayArg to the callback', () => {
|
||||
helpers.canMakePaymentWithExtensions(
|
||||
() => true,
|
||||
canMakePaymentExtensionsCallbacks,
|
||||
'woopay'
|
||||
)( canMakePaymentArgument );
|
||||
expect( trueCallback ).toHaveBeenCalledWith(
|
||||
canMakePaymentArgument
|
||||
);
|
||||
} );
|
||||
|
||||
it( 'Allows all valid callbacks to run, even if one causes an error', () => {
|
||||
helpers.canMakePaymentWithExtensions(
|
||||
() => true,
|
||||
canMakePaymentExtensionsCallbacks,
|
||||
'testpay'
|
||||
)( canMakePaymentArgument );
|
||||
expect( console ).toHaveErrored();
|
||||
expect( throwsCallback ).toHaveBeenCalledTimes( 1 );
|
||||
expect( trueCallback ).toHaveBeenCalledTimes( 1 );
|
||||
} );
|
||||
} );
|
||||
} );
|
61
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/payment-method-config.tsx
Normal file
61
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/payment-method-config.tsx
Normal file
@ -0,0 +1,61 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { registerPaymentMethodExtensionCallbacks } from '@woocommerce/blocks-registry';
|
||||
import type { PaymentMethodConfigInstance } from '@woocommerce/type-defs/payments';
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import PaymentMethodConfig from '../payment-method-config';
|
||||
import * as paymentMethodConfigHelpers from '../payment-method-config-helper';
|
||||
|
||||
describe( 'PaymentMethodConfig', () => {
|
||||
let paymentMethod: PaymentMethodConfigInstance;
|
||||
const extensionsCallbackSpy = jest.spyOn(
|
||||
paymentMethodConfigHelpers,
|
||||
'canMakePaymentWithExtensions'
|
||||
);
|
||||
beforeEach( () => {
|
||||
paymentMethod = new PaymentMethodConfig( {
|
||||
name: 'test-payment-method',
|
||||
label: 'Test payment method',
|
||||
ariaLabel: 'Test payment method',
|
||||
content: <div>Test payment content</div>,
|
||||
edit: <div>Test payment edit</div>,
|
||||
canMakePayment: () => true,
|
||||
supports: { features: [ 'products' ] },
|
||||
} );
|
||||
} );
|
||||
|
||||
it( 'Uses canMakePaymentWithExtensions as the canMakePayment function if an extension registers a callback', () => {
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'woocommerce-marketplace-extension',
|
||||
{
|
||||
'unrelated-payment-method': () => true,
|
||||
}
|
||||
);
|
||||
|
||||
// At this point, since no extensions have registered a callback for
|
||||
// test-payment-method we can expect the canMakePayment getter NOT
|
||||
// to execute canMakePaymentWithExtensions.
|
||||
// Disable no-unused-expressions because we just want to test the getter
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
paymentMethod.canMakePayment;
|
||||
expect( extensionsCallbackSpy ).toHaveBeenCalledTimes( 0 );
|
||||
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'other-woocommerce-marketplace-extension',
|
||||
{
|
||||
'test-payment-method': () => true,
|
||||
}
|
||||
);
|
||||
|
||||
// Now, because an extension _has_ registered a callback for test-payment-method
|
||||
// The getter will use canMakePaymentWithExtensions to create the
|
||||
// canMakePayment function.
|
||||
// Disable no-unused-expressions because we just want to test the getter
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
paymentMethod.canMakePayment;
|
||||
expect( extensionsCallbackSpy ).toHaveBeenCalledTimes( 1 );
|
||||
} );
|
||||
} );
|
97
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/registry.ts
Normal file
97
packages/woocommerce-blocks/assets/js/blocks-registry/payment-methods/test/registry.ts
Normal file
@ -0,0 +1,97 @@
|
||||
/**
|
||||
* External dependencies
|
||||
*/
|
||||
import { registerPaymentMethodExtensionCallbacks } from '@woocommerce/blocks-registry';
|
||||
|
||||
/**
|
||||
* Internal dependencies
|
||||
*/
|
||||
import { canMakePaymentExtensionsCallbacks } from '../extensions-config';
|
||||
|
||||
describe( 'registerPaymentMethodExtensionCallbacks', () => {
|
||||
it( 'Logs an error to console if namespace is already registered', () => {
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'woocommerce-marketplace-extension',
|
||||
{
|
||||
cod: () => false,
|
||||
}
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
expect( console ).not.toHaveErrored();
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'woocommerce-marketplace-extension',
|
||||
{
|
||||
cod: () => false,
|
||||
}
|
||||
);
|
||||
expect( console ).toHaveErrored();
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
expect( console.error ).toHaveBeenCalledTimes( 1 );
|
||||
} );
|
||||
|
||||
it( 'Does not overwrite a namespace if a second extensions tries to register with the same name', () => {
|
||||
const firstCodCallback = jest.fn().mockReturnValue( false );
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'overwrite-marketplace-extension',
|
||||
{
|
||||
cod: firstCodCallback,
|
||||
}
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
expect( console ).not.toHaveErrored();
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'overwrite-marketplace-extension',
|
||||
{
|
||||
cod: () => false,
|
||||
}
|
||||
);
|
||||
|
||||
expect(
|
||||
canMakePaymentExtensionsCallbacks[
|
||||
'overwrite-marketplace-extension'
|
||||
].cod
|
||||
).toEqual( firstCodCallback );
|
||||
} );
|
||||
|
||||
it( 'Logs an error if a supplied callback is not a function and does not register the callback for that method', () => {
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'other-woocommerce-marketplace-extension',
|
||||
{
|
||||
cod: false,
|
||||
cheque: () => true,
|
||||
}
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-console
|
||||
expect( console ).toHaveErrored();
|
||||
expect( canMakePaymentExtensionsCallbacks ).toHaveProperty(
|
||||
'other-woocommerce-marketplace-extension'
|
||||
);
|
||||
expect(
|
||||
canMakePaymentExtensionsCallbacks[
|
||||
'other-woocommerce-marketplace-extension'
|
||||
]
|
||||
).not.toHaveProperty( 'cod' );
|
||||
expect(
|
||||
canMakePaymentExtensionsCallbacks[
|
||||
'other-woocommerce-marketplace-extension'
|
||||
]
|
||||
).toHaveProperty( 'cheque' );
|
||||
} );
|
||||
|
||||
it( 'Adds the namespace and callbacks to the canMakePaymentExtensionCallbacks object', () => {
|
||||
// We are using a new namespace here because canMakePaymentExtensionsCallbacks cannot be reset between tests.
|
||||
registerPaymentMethodExtensionCallbacks(
|
||||
'third-woocommerce-marketplace-extension',
|
||||
{
|
||||
cod: () => false,
|
||||
}
|
||||
);
|
||||
expect( canMakePaymentExtensionsCallbacks ).toHaveProperty(
|
||||
'third-woocommerce-marketplace-extension'
|
||||
);
|
||||
} );
|
||||
} );
|
Reference in New Issue
Block a user