platform-types 1.10.752 → 1.10.753
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.STOREFRONT_PREVIEW_PROTOCOL_ERRORS = exports.STOREFRONT_PREVIEW_READ_OPERATIONS = exports.STOREFRONT_BENEFIT_ICONS = exports.STOREFRONT_RESERVED_SLUGS = exports.STOREFRONT_CONTACT_FIELDS = exports.STOREFRONT_PROTECTED_BUILTIN_DESTINATIONS = exports.STOREFRONT_BUILTIN_DESTINATIONS = exports.STOREFRONT_SECTION_TYPES = exports.isStorefrontPageSlug = exports.STOREFRONT_PAGE_SLUG_RE = exports.STOREFRONT_DESIGN_LIMITS = exports.STOREFRONT_SOCIAL_HOSTS = void 0;
|
|
3
|
+
exports.STOREFRONT_PREVIEW_PROTOCOL_ERRORS = exports.STOREFRONT_PREVIEW_READ_OPERATIONS = exports.STOREFRONT_BENEFIT_ICONS = exports.STOREFRONT_RESERVED_SLUGS = exports.STOREFRONT_CONTACT_FIELDS = exports.STOREFRONT_PROTECTED_BUILTIN_DESTINATIONS = exports.STOREFRONT_BUILTIN_DESTINATIONS = exports.STOREFRONT_REPEATABLE_SECTION_TYPES = exports.STOREFRONT_SECTION_TYPES = exports.isStorefrontPageSlug = exports.STOREFRONT_PAGE_SLUG_RE = exports.STOREFRONT_DESIGN_LIMITS = exports.STOREFRONT_SOCIAL_HOSTS = void 0;
|
|
4
4
|
exports.createStorefrontDesignV1 = createStorefrontDesignV1;
|
|
5
5
|
exports.parseStorefrontPreviewDocument = parseStorefrontPreviewDocument;
|
|
6
6
|
exports.parseStorefrontPreviewMessage = parseStorefrontPreviewMessage;
|
|
@@ -19,6 +19,12 @@ exports.STOREFRONT_DESIGN_LIMITS = {
|
|
|
19
19
|
pageAliases: 20,
|
|
20
20
|
pageAliasMetadataBytes: 64 * 1024,
|
|
21
21
|
sectionsPerPage: 10,
|
|
22
|
+
/**
|
|
23
|
+
* How many sections of one `STOREFRONT_REPEATABLE_SECTION_TYPES` type a page may hold, disabled
|
|
24
|
+
* sections included; a fifth is `SECTION_TYPE_LIMIT` at its `type` path. Every other type is
|
|
25
|
+
* once per page (a second is `DUPLICATE`), and `sectionsPerPage` still caps the whole page.
|
|
26
|
+
*/
|
|
27
|
+
repeatableSectionsPerType: 4,
|
|
22
28
|
productCountMin: 4,
|
|
23
29
|
productCountMax: 24,
|
|
24
30
|
productCountDefault: 8,
|
|
@@ -76,6 +82,17 @@ exports.STOREFRONT_SECTION_TYPES = [
|
|
|
76
82
|
'contact',
|
|
77
83
|
'paymentDelivery',
|
|
78
84
|
];
|
|
85
|
+
/**
|
|
86
|
+
* The section types a page may repeat, each up to `STOREFRONT_DESIGN_LIMITS.repeatableSectionsPerType`
|
|
87
|
+
* times (disabled sections count), so a Home can show offers and new arrivals together. Every other
|
|
88
|
+
* type is once per page. Draft save and publish both enforce it; the editor reads the same list.
|
|
89
|
+
*/
|
|
90
|
+
exports.STOREFRONT_REPEATABLE_SECTION_TYPES = [
|
|
91
|
+
'products',
|
|
92
|
+
'banner',
|
|
93
|
+
'imageText',
|
|
94
|
+
'text',
|
|
95
|
+
];
|
|
79
96
|
/**
|
|
80
97
|
* The storefront routes a design link may target by name. `incomes` is the
|
|
81
98
|
* always-available recency listing (`/products/incomes`); `new` is the separate
|
|
@@ -13,6 +13,12 @@ export declare const STOREFRONT_DESIGN_LIMITS: {
|
|
|
13
13
|
readonly pageAliases: 20;
|
|
14
14
|
readonly pageAliasMetadataBytes: number;
|
|
15
15
|
readonly sectionsPerPage: 10;
|
|
16
|
+
/**
|
|
17
|
+
* How many sections of one `STOREFRONT_REPEATABLE_SECTION_TYPES` type a page may hold, disabled
|
|
18
|
+
* sections included; a fifth is `SECTION_TYPE_LIMIT` at its `type` path. Every other type is
|
|
19
|
+
* once per page (a second is `DUPLICATE`), and `sectionsPerPage` still caps the whole page.
|
|
20
|
+
*/
|
|
21
|
+
readonly repeatableSectionsPerType: 4;
|
|
16
22
|
readonly productCountMin: 4;
|
|
17
23
|
readonly productCountMax: 24;
|
|
18
24
|
readonly productCountDefault: 8;
|
|
@@ -58,6 +64,13 @@ export declare const STOREFRONT_DESIGN_LIMITS: {
|
|
|
58
64
|
export declare const STOREFRONT_PAGE_SLUG_RE: RegExp;
|
|
59
65
|
export declare const isStorefrontPageSlug: (value: unknown) => value is string;
|
|
60
66
|
export declare const STOREFRONT_SECTION_TYPES: readonly ["banner", "imageText", "products", "categories", "brands", "text", "faq", "benefits", "contact", "paymentDelivery"];
|
|
67
|
+
/**
|
|
68
|
+
* The section types a page may repeat, each up to `STOREFRONT_DESIGN_LIMITS.repeatableSectionsPerType`
|
|
69
|
+
* times (disabled sections count), so a Home can show offers and new arrivals together. Every other
|
|
70
|
+
* type is once per page. Draft save and publish both enforce it; the editor reads the same list.
|
|
71
|
+
*/
|
|
72
|
+
export declare const STOREFRONT_REPEATABLE_SECTION_TYPES: readonly ["products", "banner", "imageText", "text"];
|
|
73
|
+
export type StorefrontRepeatableSectionType = (typeof STOREFRONT_REPEATABLE_SECTION_TYPES)[number];
|
|
61
74
|
/**
|
|
62
75
|
* The storefront routes a design link may target by name. `incomes` is the
|
|
63
76
|
* always-available recency listing (`/products/incomes`); `new` is the separate
|
|
@@ -333,8 +346,12 @@ declare global {
|
|
|
333
346
|
seo: StorefrontDesignSeo;
|
|
334
347
|
literalOverrides: Record<string, string>;
|
|
335
348
|
}
|
|
336
|
-
/**
|
|
337
|
-
|
|
349
|
+
/**
|
|
350
|
+
* `TOO_LARGE` at path `''` means the whole stored draft would exceed its row budget, not one field.
|
|
351
|
+
* At `<page>.sections.<index>.type`, `DUPLICATE` is a second section of a once-per-page type and
|
|
352
|
+
* `SECTION_TYPE_LIMIT` is a section past `repeatableSectionsPerType` of a repeatable type.
|
|
353
|
+
*/
|
|
354
|
+
type StorefrontDesignFieldErrorCode = 'INVALID' | 'REQUIRED' | 'UNKNOWN_KEY' | 'DUPLICATE' | 'SECTION_TYPE_LIMIT' | 'RESERVED_SLUG' | 'ALIAS_CONFLICT' | 'ALIAS_LIMIT' | 'DANGLING_REFERENCE' | 'MAPPING_CONFLICT' | 'TOO_LARGE';
|
|
338
355
|
interface StorefrontDesignFieldError {
|
|
339
356
|
path: string;
|
|
340
357
|
code: StorefrontDesignFieldErrorCode;
|
package/dist/storefrontDesign.js
CHANGED
|
@@ -12,6 +12,12 @@ export const STOREFRONT_DESIGN_LIMITS = {
|
|
|
12
12
|
pageAliases: 20,
|
|
13
13
|
pageAliasMetadataBytes: 64 * 1024,
|
|
14
14
|
sectionsPerPage: 10,
|
|
15
|
+
/**
|
|
16
|
+
* How many sections of one `STOREFRONT_REPEATABLE_SECTION_TYPES` type a page may hold, disabled
|
|
17
|
+
* sections included; a fifth is `SECTION_TYPE_LIMIT` at its `type` path. Every other type is
|
|
18
|
+
* once per page (a second is `DUPLICATE`), and `sectionsPerPage` still caps the whole page.
|
|
19
|
+
*/
|
|
20
|
+
repeatableSectionsPerType: 4,
|
|
15
21
|
productCountMin: 4,
|
|
16
22
|
productCountMax: 24,
|
|
17
23
|
productCountDefault: 8,
|
|
@@ -68,6 +74,17 @@ export const STOREFRONT_SECTION_TYPES = [
|
|
|
68
74
|
'contact',
|
|
69
75
|
'paymentDelivery',
|
|
70
76
|
];
|
|
77
|
+
/**
|
|
78
|
+
* The section types a page may repeat, each up to `STOREFRONT_DESIGN_LIMITS.repeatableSectionsPerType`
|
|
79
|
+
* times (disabled sections count), so a Home can show offers and new arrivals together. Every other
|
|
80
|
+
* type is once per page. Draft save and publish both enforce it; the editor reads the same list.
|
|
81
|
+
*/
|
|
82
|
+
export const STOREFRONT_REPEATABLE_SECTION_TYPES = [
|
|
83
|
+
'products',
|
|
84
|
+
'banner',
|
|
85
|
+
'imageText',
|
|
86
|
+
'text',
|
|
87
|
+
];
|
|
71
88
|
/**
|
|
72
89
|
* The storefront routes a design link may target by name. `incomes` is the
|
|
73
90
|
* always-available recency listing (`/products/incomes`); `new` is the separate
|