2021-11-02 14:42:07 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import { __ } from '@wordpress/i18n';
|
2022-06-29 07:42:02 +00:00
|
|
|
|
2022-09-06 09:52:33 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
import { TemplateDetails } from './types';
|
|
|
|
|
2023-02-27 14:34:18 +00:00
|
|
|
export const BLOCK_SLUG = 'woocommerce/legacy-template';
|
|
|
|
export const TYPES = {
|
|
|
|
singleProduct: 'single-product',
|
|
|
|
productCatalog: 'product-catalog',
|
|
|
|
productTaxonomy: 'product-taxonomy',
|
|
|
|
productSearchResults: 'product-search-results',
|
2023-06-29 13:41:22 +00:00
|
|
|
orderConfirmation: 'order-confirmation',
|
|
|
|
checkoutHeader: 'checkout-header',
|
2023-02-27 14:34:18 +00:00
|
|
|
};
|
|
|
|
export const PLACEHOLDERS = {
|
|
|
|
singleProduct: 'single-product',
|
|
|
|
archiveProduct: 'archive-product',
|
2023-06-29 13:41:22 +00:00
|
|
|
orderConfirmation: 'fallback',
|
|
|
|
checkoutHeader: 'checkout-header',
|
2023-02-27 14:34:18 +00:00
|
|
|
};
|
|
|
|
|
2022-09-06 09:52:33 +00:00
|
|
|
export const TEMPLATES: TemplateDetails = {
|
2021-11-03 16:55:52 +00:00
|
|
|
'single-product': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.singleProduct,
|
2023-12-12 23:05:20 +00:00
|
|
|
title: __( 'WooCommerce Single Product Block', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.singleProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
|
|
|
'archive-product': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productCatalog,
|
2023-12-12 23:05:20 +00:00
|
|
|
title: __( 'WooCommerce Product Grid Block', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
|
|
|
'taxonomy-product_cat': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productTaxonomy,
|
2023-12-12 23:05:20 +00:00
|
|
|
title: __( 'WooCommerce Product Taxonomy Block', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
|
|
|
'taxonomy-product_tag': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productTaxonomy,
|
2023-12-12 23:05:20 +00:00
|
|
|
title: __( 'WooCommerce Product Tag Block', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2021-11-03 16:55:52 +00:00
|
|
|
},
|
2022-11-16 13:37:41 +00:00
|
|
|
'taxonomy-product_attribute': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productTaxonomy,
|
2023-12-12 23:05:20 +00:00
|
|
|
title: __( 'WooCommerce Product Attribute Block', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2022-11-16 13:37:41 +00:00
|
|
|
},
|
2023-07-31 10:23:49 +00:00
|
|
|
// Since that it is a fallback value, it has to be the last one.
|
|
|
|
'taxonomy-product': {
|
|
|
|
type: TYPES.productTaxonomy,
|
|
|
|
title: __(
|
|
|
|
"WooCommerce Product's Custom Taxonomy Block",
|
2023-12-12 22:12:36 +00:00
|
|
|
'woocommerce'
|
2023-07-31 10:23:49 +00:00
|
|
|
),
|
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
|
|
|
},
|
2022-06-29 07:42:02 +00:00
|
|
|
'product-search-results': {
|
2023-02-27 14:34:18 +00:00
|
|
|
type: TYPES.productSearchResults,
|
2023-12-12 23:05:20 +00:00
|
|
|
title: __( 'WooCommerce Product Search Results Block', 'woocommerce' ),
|
2023-02-27 14:34:18 +00:00
|
|
|
placeholder: PLACEHOLDERS.archiveProduct,
|
2022-06-29 07:42:02 +00:00
|
|
|
},
|
2023-06-29 13:41:22 +00:00
|
|
|
'checkout-header': {
|
|
|
|
type: TYPES.checkoutHeader,
|
2023-12-12 22:12:36 +00:00
|
|
|
title: __( 'Checkout Header', 'woocommerce' ),
|
2023-06-29 13:41:22 +00:00
|
|
|
placeholder: 'checkout-header',
|
|
|
|
},
|
|
|
|
'order-confirmation': {
|
|
|
|
type: TYPES.orderConfirmation,
|
2023-12-12 22:12:36 +00:00
|
|
|
title: __( 'Order Confirmation Block', 'woocommerce' ),
|
2023-06-29 13:41:22 +00:00
|
|
|
placeholder: PLACEHOLDERS.orderConfirmation,
|
|
|
|
},
|
2021-11-02 14:42:07 +00:00
|
|
|
};
|