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,
|
2021-11-03 16:55:52 +00:00
|
|
|
title: __(
|
2022-01-05 18:18:23 +00:00
|
|
|
'WooCommerce Single Product Block',
|
2021-11-03 16:55:52 +00:00
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
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,
|
2021-11-03 16:55:52 +00:00
|
|
|
title: __(
|
2022-01-05 18:18:23 +00:00
|
|
|
'WooCommerce Product Grid Block',
|
2021-11-03 16:55:52 +00:00
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
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,
|
2021-11-03 16:55:52 +00:00
|
|
|
title: __(
|
2022-01-05 18:18:23 +00:00
|
|
|
'WooCommerce Product Taxonomy Block',
|
2021-11-03 16:55:52 +00:00
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
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,
|
2021-11-03 16:55:52 +00:00
|
|
|
title: __(
|
2022-01-05 18:18:23 +00:00
|
|
|
'WooCommerce Product Tag Block',
|
2021-11-03 16:55:52 +00:00
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
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,
|
2022-11-16 13:37:41 +00:00
|
|
|
title: __(
|
|
|
|
'WooCommerce Product Attribute Block',
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
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",
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
|
|
|
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,
|
2022-06-29 07:42:02 +00:00
|
|
|
title: __(
|
|
|
|
'WooCommerce Product Search Results Block',
|
|
|
|
'woo-gutenberg-products-block'
|
|
|
|
),
|
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,
|
|
|
|
title: __( 'Checkout Header', 'woo-gutenberg-products-block' ),
|
|
|
|
placeholder: 'checkout-header',
|
|
|
|
},
|
|
|
|
'order-confirmation': {
|
|
|
|
type: TYPES.orderConfirmation,
|
|
|
|
title: __( 'Order Confirmation Block', 'woo-gutenberg-products-block' ),
|
|
|
|
placeholder: PLACEHOLDERS.orderConfirmation,
|
|
|
|
},
|
2021-11-02 14:42:07 +00:00
|
|
|
};
|