@rebuy/rebuy 3.5.0 → 3.6.0
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.
- package/dist/index.cjs +740 -647
- package/dist/index.mjs +740 -647
- package/dist/schema/checkout-and-beyond/constants.cjs +16 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +16 -0
- package/dist/schema/checkout-and-beyond/index.cjs +454 -362
- package/dist/schema/checkout-and-beyond/index.mjs +454 -362
- package/dist/schema/widget-data.cjs +508 -435
- package/dist/schema/widget-data.mjs +508 -435
- package/dist/schema/widgetData.d.ts +438 -147
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +154 -49
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +29 -0
- package/dist/schema/widgets/checkout-and-beyond/discount.d.ts +146 -0
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +294 -100
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +148 -52
- package/dist/schema/widgets/checkout-and-beyond/monetize.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/product.d.ts +146 -0
- package/dist/schema/widgets/checkout-and-beyond/products.d.ts +292 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +145 -48
- package/dist/schema/widgets/checkout-and-beyond/quantity.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/reviews.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/rule.d.ts +140 -68
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +146 -49
- package/dist/schema/widgets/checkout-and-beyond/variables.d.ts +470 -0
- package/dist/schema/widgets/checkout-and-beyond/variants.d.ts +146 -49
- package/dist/schema/widgets/contentBlock.d.ts +146 -49
- package/dist/schema/widgets/lineItemEditor.d.ts +146 -49
- package/dist/schema/widgets/rebuyButton.d.ts +146 -49
- package/dist/server/index.cjs +492 -416
- package/dist/server/index.mjs +492 -416
- package/dist/transforms/index.cjs +393 -317
- package/dist/transforms/index.mjs +393 -317
- package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -40,6 +40,7 @@ __export(src_exports, {
|
|
|
40
40
|
CABDataSourceSection: () => CABDataSourceSection,
|
|
41
41
|
CABDiscount: () => CABDiscount,
|
|
42
42
|
CABDiscountSection: () => CABDiscountSection,
|
|
43
|
+
CABEventTrigger: () => CABEventTrigger,
|
|
43
44
|
CABExperiment: () => CABExperiment,
|
|
44
45
|
CABImageSection: () => CABImageSection,
|
|
45
46
|
CABImageSectionFields: () => CABImageSectionFields,
|
|
@@ -52,16 +53,26 @@ __export(src_exports, {
|
|
|
52
53
|
CABProgressBarSection: () => CABProgressBarSection,
|
|
53
54
|
CABProgressTier: () => CABProgressTier,
|
|
54
55
|
CABQuantitySection: () => CABQuantitySection,
|
|
56
|
+
CABResultCountTrigger: () => CABResultCountTrigger,
|
|
57
|
+
CABResultTagTrigger: () => CABResultTagTrigger,
|
|
55
58
|
CABReviewsSection: () => CABReviewsSection,
|
|
56
59
|
CABRootSection: () => CABRootSection,
|
|
57
|
-
|
|
60
|
+
CABRuleset: () => CABRuleset,
|
|
61
|
+
CABRulesetEntry: () => CABRulesetEntry,
|
|
58
62
|
CABSection: () => CABSection,
|
|
59
63
|
CABTextSection: () => CABTextSection,
|
|
60
64
|
CABTextTier: () => CABTextTier,
|
|
61
65
|
CABTracking: () => CABTracking,
|
|
62
66
|
CABUILabels: () => CABUILabels,
|
|
67
|
+
CABVariable: () => CABVariable,
|
|
68
|
+
CABVariableEffect: () => CABVariableEffect,
|
|
69
|
+
CABVariableFields: () => CABVariableFields,
|
|
70
|
+
CABVariableMutator: () => CABVariableMutator,
|
|
71
|
+
CABVariableSeed: () => CABVariableSeed,
|
|
72
|
+
CABVariableTrigger: () => CABVariableTrigger,
|
|
63
73
|
CABVariantContent: () => CABVariantContent,
|
|
64
74
|
CABVariantsSection: () => CABVariantsSection,
|
|
75
|
+
CABVisibility: () => CABVisibility,
|
|
65
76
|
COMBINED_ENDPOINTS: () => COMBINED_ENDPOINTS,
|
|
66
77
|
CabActiveExperiment: () => CabActiveExperiment,
|
|
67
78
|
CabShopConfig: () => CabShopConfig,
|
|
@@ -96,6 +107,7 @@ __export(src_exports, {
|
|
|
96
107
|
LineItemEditorSwitchLanguageV1: () => LineItemEditorSwitchLanguageV1,
|
|
97
108
|
LineItemEditorV1: () => LineItemEditorV1,
|
|
98
109
|
Metadata: () => Metadata,
|
|
110
|
+
MutatorEvent: () => MutatorEvent,
|
|
99
111
|
NO_HTML: () => NO_HTML,
|
|
100
112
|
OFFER_LABELS: () => OFFER_LABELS,
|
|
101
113
|
ObjectFit: () => ObjectFit,
|
|
@@ -122,6 +134,8 @@ __export(src_exports, {
|
|
|
122
134
|
RebuyClient: () => RebuyClient,
|
|
123
135
|
RebuyMonetize: () => RebuyMonetize,
|
|
124
136
|
RebuyMonetizeV1: () => RebuyMonetizeV1,
|
|
137
|
+
ResultCountOperator: () => ResultCountOperator,
|
|
138
|
+
ResultTagOperator: () => ResultTagOperator,
|
|
125
139
|
ReviewsSize: () => ReviewsSize,
|
|
126
140
|
RuleCondition: () => RuleCondition,
|
|
127
141
|
RuleLogicBlock: () => RuleLogicBlock,
|
|
@@ -151,6 +165,7 @@ __export(src_exports, {
|
|
|
151
165
|
TiptapText: () => TiptapText,
|
|
152
166
|
UI_LABELS: () => UI_LABELS,
|
|
153
167
|
UserConfig: () => UserConfig,
|
|
168
|
+
VariableEffect: () => VariableEffect,
|
|
154
169
|
VariantMode: () => VariantMode,
|
|
155
170
|
VariantSelector: () => VariantSelector,
|
|
156
171
|
VerticalAlignment: () => VerticalAlignment,
|
|
@@ -222,6 +237,7 @@ __export(src_exports, {
|
|
|
222
237
|
isTimerBlock: () => isTimerBlock,
|
|
223
238
|
isVariantsType: () => isVariantsType,
|
|
224
239
|
languageKeys: () => languageKeys,
|
|
240
|
+
mutatorEvents: () => mutatorEvents,
|
|
225
241
|
objectFits: () => objectFits,
|
|
226
242
|
offersDirections: () => offersDirections,
|
|
227
243
|
popoverPositionMap: () => popoverPositionMap,
|
|
@@ -232,6 +248,8 @@ __export(src_exports, {
|
|
|
232
248
|
progressTierUnits: () => progressTierUnits,
|
|
233
249
|
quantityInputs: () => quantityInputs,
|
|
234
250
|
queryStringToObject: () => queryStringToObject,
|
|
251
|
+
resultCountOperators: () => resultCountOperators,
|
|
252
|
+
resultTagOperators: () => resultTagOperators,
|
|
235
253
|
reviewsSizes: () => reviewsSizes,
|
|
236
254
|
ruleOperators: () => ruleOperators,
|
|
237
255
|
ruleTypes: () => ruleTypes,
|
|
@@ -250,6 +268,7 @@ __export(src_exports, {
|
|
|
250
268
|
textSizeNames: () => textSizeNames,
|
|
251
269
|
utmObjectFromString: () => utmObjectFromString,
|
|
252
270
|
uuid: () => uuid,
|
|
271
|
+
variableEffects: () => variableEffects,
|
|
253
272
|
variantAvailable: () => variantAvailable,
|
|
254
273
|
variantMinMaxPriceObject: () => variantMinMaxPriceObject,
|
|
255
274
|
variantModes: () => variantModes,
|
|
@@ -1534,7 +1553,7 @@ var UserConfig = import_zod7.z.object({
|
|
|
1534
1553
|
});
|
|
1535
1554
|
|
|
1536
1555
|
// src/schema/widgetData.ts
|
|
1537
|
-
var
|
|
1556
|
+
var import_zod37 = require("zod");
|
|
1538
1557
|
|
|
1539
1558
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1540
1559
|
var import_zod8 = require("zod");
|
|
@@ -1650,6 +1669,8 @@ var languageKeys = [
|
|
|
1650
1669
|
"zh"
|
|
1651
1670
|
];
|
|
1652
1671
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1672
|
+
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1673
|
+
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1653
1674
|
var objectFits = ["cover", "contain"];
|
|
1654
1675
|
var ObjectFit = freezeEnum(objectFits);
|
|
1655
1676
|
var popoverPositions = ["inlineStart", "inlineEnd", "blockStart", "blockEnd"];
|
|
@@ -1668,6 +1689,10 @@ var progressTierUnits = ["currency", "item"];
|
|
|
1668
1689
|
var ProgressTierUnit = freezeEnum(progressTierUnits);
|
|
1669
1690
|
var quantityInputs = ["select", "number"];
|
|
1670
1691
|
var QuantityInput = freezeEnum(quantityInputs);
|
|
1692
|
+
var resultCountOperators = ["equals", "greater_than", "less_than"];
|
|
1693
|
+
var ResultCountOperator = freezeEnum(resultCountOperators);
|
|
1694
|
+
var resultTagOperators = ["contains", "does_not_contain"];
|
|
1695
|
+
var ResultTagOperator = freezeEnum(resultTagOperators);
|
|
1671
1696
|
var reviewsSizes = ["small", "default", "large"];
|
|
1672
1697
|
var ReviewsSize = freezeEnum(reviewsSizes);
|
|
1673
1698
|
var sectionTypes = [
|
|
@@ -1700,6 +1725,8 @@ var inlineTextSizeNames = ["extraSmall", "small", "base", "medium", "large", "ex
|
|
|
1700
1725
|
var InlineTextSizeName = freezeEnum(inlineTextSizeNames);
|
|
1701
1726
|
var textSizeNames = [...inlineTextSizeNames, "heading"];
|
|
1702
1727
|
var TextSizeName = freezeEnum(textSizeNames);
|
|
1728
|
+
var variableEffects = ["set_false", "set_true", "toggle"];
|
|
1729
|
+
var VariableEffect = freezeEnum(variableEffects);
|
|
1703
1730
|
var variantModes = ["multiple", "single"];
|
|
1704
1731
|
var VariantMode = freezeEnum(variantModes);
|
|
1705
1732
|
var variantSelectors = ["menu", "radio", "button"];
|
|
@@ -1789,87 +1816,20 @@ var CheckoutExtension = import_zod9.z.looseObject({
|
|
|
1789
1816
|
});
|
|
1790
1817
|
|
|
1791
1818
|
// src/schema/widgets/contentBlock.ts
|
|
1792
|
-
var
|
|
1819
|
+
var import_zod31 = require("zod");
|
|
1793
1820
|
|
|
1794
1821
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1795
|
-
var
|
|
1822
|
+
var import_zod30 = require("zod");
|
|
1796
1823
|
|
|
1797
1824
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1798
1825
|
var import_uuid13 = require("uuid");
|
|
1799
|
-
var
|
|
1800
|
-
|
|
1801
|
-
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1802
|
-
var import_zod10 = require("zod");
|
|
1803
|
-
var ruleTypes = [
|
|
1804
|
-
"cart",
|
|
1805
|
-
"cart_count",
|
|
1806
|
-
"cart_item_count",
|
|
1807
|
-
"cart_line_count",
|
|
1808
|
-
"cart_subtotal",
|
|
1809
|
-
"collection",
|
|
1810
|
-
"customer",
|
|
1811
|
-
"customer_order_count",
|
|
1812
|
-
"customer_tag",
|
|
1813
|
-
"customer_total_spent",
|
|
1814
|
-
"date",
|
|
1815
|
-
"product",
|
|
1816
|
-
"product_tag",
|
|
1817
|
-
"product_title",
|
|
1818
|
-
"product_type",
|
|
1819
|
-
"product_vendor"
|
|
1820
|
-
];
|
|
1821
|
-
var ruleType = import_zod10.z.enum(ruleTypes);
|
|
1822
|
-
var RuleType = ruleType.enum;
|
|
1823
|
-
var ruleOperators = [
|
|
1824
|
-
"after",
|
|
1825
|
-
"anything",
|
|
1826
|
-
"before",
|
|
1827
|
-
"contains",
|
|
1828
|
-
"contains_any",
|
|
1829
|
-
"does_not_contain",
|
|
1830
|
-
"does_not_contain_any",
|
|
1831
|
-
"equals",
|
|
1832
|
-
"does_not_equal",
|
|
1833
|
-
"greater_than",
|
|
1834
|
-
"less_than"
|
|
1835
|
-
];
|
|
1836
|
-
var ruleOperator = import_zod10.z.enum(ruleOperators);
|
|
1837
|
-
var RuleOperator = ruleOperator.enum;
|
|
1838
|
-
var RuleCondition = import_zod10.z.object({
|
|
1839
|
-
operator: import_zod10.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
1840
|
-
products: import_zod10.z.union([import_zod10.z.array(import_zod10.z.unknown()), import_zod10.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
1841
|
-
type: import_zod10.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
1842
|
-
value: import_zod10.z.coerce.string().default("")
|
|
1843
|
-
});
|
|
1844
|
-
var RuleLogicBlock = import_zod10.z.object({
|
|
1845
|
-
rules: import_zod10.z.array(RuleCondition).default(() => [])
|
|
1846
|
-
});
|
|
1847
|
-
var CABRule = import_zod10.z.object({
|
|
1848
|
-
dataSourceId: import_zod10.z.number().nullable().default(null),
|
|
1849
|
-
enabled: import_zod10.z.boolean().default(false),
|
|
1850
|
-
ruleset: import_zod10.z.union([
|
|
1851
|
-
import_zod10.z.array(
|
|
1852
|
-
import_zod10.z.object({
|
|
1853
|
-
exitIfMatched: import_zod10.z.boolean().default(true),
|
|
1854
|
-
logic: import_zod10.z.array(RuleLogicBlock).default(() => []),
|
|
1855
|
-
output: import_zod10.z.array(
|
|
1856
|
-
import_zod10.z.object({
|
|
1857
|
-
key: import_zod10.z.string().default("should_show"),
|
|
1858
|
-
type: import_zod10.z.literal("data_json").default("data_json"),
|
|
1859
|
-
value: import_zod10.z.string().default("true")
|
|
1860
|
-
})
|
|
1861
|
-
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1862
|
-
})
|
|
1863
|
-
),
|
|
1864
|
-
import_zod10.z.strictObject({}).transform(() => [])
|
|
1865
|
-
]).default(() => [])
|
|
1866
|
-
});
|
|
1826
|
+
var import_zod29 = require("zod");
|
|
1867
1827
|
|
|
1868
1828
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1869
|
-
var
|
|
1829
|
+
var import_zod28 = require("zod");
|
|
1870
1830
|
|
|
1871
1831
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1872
|
-
var
|
|
1832
|
+
var import_zod10 = require("zod");
|
|
1873
1833
|
|
|
1874
1834
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1875
1835
|
var import_es_toolkit3 = require("es-toolkit");
|
|
@@ -1946,11 +1906,11 @@ var isTextType = isSectionType(SectionType.text);
|
|
|
1946
1906
|
var isVariantsType = isSectionType(SectionType.variants);
|
|
1947
1907
|
|
|
1948
1908
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1949
|
-
var CABBannerSection =
|
|
1909
|
+
var CABBannerSection = import_zod10.z.lazy(
|
|
1950
1910
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1951
|
-
buttonField:
|
|
1952
|
-
color:
|
|
1953
|
-
dismissible:
|
|
1911
|
+
buttonField: import_zod10.z.enum(buttonFields).optional(),
|
|
1912
|
+
color: import_zod10.z.enum(bannerColors).default("info"),
|
|
1913
|
+
dismissible: import_zod10.z.boolean().default(true),
|
|
1954
1914
|
/**
|
|
1955
1915
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
1956
1916
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -1966,18 +1926,18 @@ var CABBannerSection = import_zod11.z.lazy(
|
|
|
1966
1926
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
1967
1927
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
1968
1928
|
*/
|
|
1969
|
-
heading:
|
|
1970
|
-
sectionType:
|
|
1929
|
+
heading: import_zod10.z.record(import_zod10.z.string(), import_zod10.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
1930
|
+
sectionType: import_zod10.z.literal(SectionType.banner).default(SectionType.banner)
|
|
1971
1931
|
})
|
|
1972
1932
|
);
|
|
1973
1933
|
|
|
1974
1934
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1975
1935
|
var import_uuid4 = require("uuid");
|
|
1976
|
-
var
|
|
1936
|
+
var import_zod15 = require("zod");
|
|
1977
1937
|
|
|
1978
1938
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1979
1939
|
var import_uuid2 = require("uuid");
|
|
1980
|
-
var
|
|
1940
|
+
var import_zod13 = require("zod");
|
|
1981
1941
|
|
|
1982
1942
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
1983
1943
|
var iconNames = [
|
|
@@ -2063,17 +2023,142 @@ var IconSize = freezeEnum(iconSizes);
|
|
|
2063
2023
|
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
2064
2024
|
var IconTone = freezeEnum(iconTones);
|
|
2065
2025
|
|
|
2026
|
+
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2027
|
+
var import_zod12 = require("zod");
|
|
2028
|
+
|
|
2029
|
+
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
2030
|
+
var import_zod11 = require("zod");
|
|
2031
|
+
var ruleTypes = [
|
|
2032
|
+
"cart",
|
|
2033
|
+
"cart_count",
|
|
2034
|
+
"cart_item_count",
|
|
2035
|
+
"cart_line_count",
|
|
2036
|
+
"cart_subtotal",
|
|
2037
|
+
"collection",
|
|
2038
|
+
"customer",
|
|
2039
|
+
"customer_order_count",
|
|
2040
|
+
"customer_tag",
|
|
2041
|
+
"customer_total_spent",
|
|
2042
|
+
"date",
|
|
2043
|
+
"product",
|
|
2044
|
+
"product_tag",
|
|
2045
|
+
"product_title",
|
|
2046
|
+
"product_type",
|
|
2047
|
+
"product_vendor"
|
|
2048
|
+
];
|
|
2049
|
+
var ruleType = import_zod11.z.enum(ruleTypes);
|
|
2050
|
+
var RuleType = ruleType.enum;
|
|
2051
|
+
var ruleOperators = [
|
|
2052
|
+
"after",
|
|
2053
|
+
"anything",
|
|
2054
|
+
"before",
|
|
2055
|
+
"contains",
|
|
2056
|
+
"contains_any",
|
|
2057
|
+
"does_not_contain",
|
|
2058
|
+
"does_not_contain_any",
|
|
2059
|
+
"equals",
|
|
2060
|
+
"does_not_equal",
|
|
2061
|
+
"greater_than",
|
|
2062
|
+
"less_than"
|
|
2063
|
+
];
|
|
2064
|
+
var ruleOperator = import_zod11.z.enum(ruleOperators);
|
|
2065
|
+
var RuleOperator = ruleOperator.enum;
|
|
2066
|
+
var RuleCondition = import_zod11.z.object({
|
|
2067
|
+
operator: import_zod11.z.enum(ruleOperators).default(RuleOperator.anything),
|
|
2068
|
+
products: import_zod11.z.union([import_zod11.z.array(import_zod11.z.unknown()), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2069
|
+
type: import_zod11.z.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
2070
|
+
value: import_zod11.z.coerce.string().default("")
|
|
2071
|
+
});
|
|
2072
|
+
var RuleLogicBlock = import_zod11.z.object({
|
|
2073
|
+
rules: import_zod11.z.array(RuleCondition).default(() => [])
|
|
2074
|
+
});
|
|
2075
|
+
var CABRulesetEntry = import_zod11.z.object({
|
|
2076
|
+
exitIfMatched: import_zod11.z.boolean().default(true),
|
|
2077
|
+
logic: import_zod11.z.array(RuleLogicBlock).default(() => []),
|
|
2078
|
+
output: import_zod11.z.array(
|
|
2079
|
+
import_zod11.z.object({
|
|
2080
|
+
key: import_zod11.z.string().default("should_show"),
|
|
2081
|
+
type: import_zod11.z.literal("data_json").default("data_json"),
|
|
2082
|
+
value: import_zod11.z.string().default("true")
|
|
2083
|
+
})
|
|
2084
|
+
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
2085
|
+
});
|
|
2086
|
+
var CABRuleset = import_zod11.z.union([import_zod11.z.array(CABRulesetEntry), import_zod11.z.strictObject({}).transform(() => [])]).default(() => []);
|
|
2087
|
+
|
|
2088
|
+
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
2089
|
+
var variableEffect = import_zod12.z.enum(variableEffects);
|
|
2090
|
+
var CABVariableSeed = import_zod12.z.object({
|
|
2091
|
+
dataSourceId: import_zod12.z.number().nullable().default(null),
|
|
2092
|
+
ruleset: CABRuleset
|
|
2093
|
+
});
|
|
2094
|
+
var CABVariable = import_zod12.z.object({
|
|
2095
|
+
/**
|
|
2096
|
+
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
2097
|
+
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
2098
|
+
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
2099
|
+
*/
|
|
2100
|
+
defaultValue: import_zod12.z.boolean().optional(),
|
|
2101
|
+
name: import_zod12.z.string().min(1),
|
|
2102
|
+
seed: CABVariableSeed.optional()
|
|
2103
|
+
}).transform(({ defaultValue, ...variable }) => ({
|
|
2104
|
+
defaultValue: defaultValue ?? variable.seed === void 0,
|
|
2105
|
+
...variable
|
|
2106
|
+
}));
|
|
2107
|
+
var CABVariableEffect = import_zod12.z.object({
|
|
2108
|
+
effect: variableEffect.default(VariableEffect.toggle),
|
|
2109
|
+
variable: import_zod12.z.string().min(1)
|
|
2110
|
+
});
|
|
2111
|
+
var CABVisibility = import_zod12.z.object({
|
|
2112
|
+
variable: import_zod12.z.string().min(1),
|
|
2113
|
+
visibleWhen: import_zod12.z.boolean().default(true)
|
|
2114
|
+
});
|
|
2115
|
+
var resultCountOperator = import_zod12.z.enum(resultCountOperators);
|
|
2116
|
+
var resultTagOperator = import_zod12.z.enum(resultTagOperators);
|
|
2117
|
+
var mutatorEvent = import_zod12.z.enum(mutatorEvents);
|
|
2118
|
+
var CABResultCountTrigger = import_zod12.z.object({
|
|
2119
|
+
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
2120
|
+
type: import_zod12.z.literal("result_count"),
|
|
2121
|
+
value: import_zod12.z.number().default(0)
|
|
2122
|
+
});
|
|
2123
|
+
var CABResultTagTrigger = import_zod12.z.object({
|
|
2124
|
+
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
2125
|
+
type: import_zod12.z.literal("result_tag"),
|
|
2126
|
+
value: import_zod12.z.string().min(1)
|
|
2127
|
+
});
|
|
2128
|
+
var CABEventTrigger = import_zod12.z.object({
|
|
2129
|
+
event: mutatorEvent,
|
|
2130
|
+
type: import_zod12.z.literal("event")
|
|
2131
|
+
});
|
|
2132
|
+
var CABVariableTrigger = import_zod12.z.discriminatedUnion("type", [
|
|
2133
|
+
CABEventTrigger,
|
|
2134
|
+
CABResultCountTrigger,
|
|
2135
|
+
CABResultTagTrigger
|
|
2136
|
+
]);
|
|
2137
|
+
var CABVariableMutator = import_zod12.z.object({
|
|
2138
|
+
effect: variableEffect.default(VariableEffect.set_false),
|
|
2139
|
+
variable: import_zod12.z.string().min(1),
|
|
2140
|
+
when: CABVariableTrigger
|
|
2141
|
+
});
|
|
2142
|
+
var CABVariableFields = {
|
|
2143
|
+
mutators: import_zod12.z.array(CABVariableMutator).optional(),
|
|
2144
|
+
variables: import_zod12.z.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
2145
|
+
message: "variable names must be unique within a section"
|
|
2146
|
+
}).optional(),
|
|
2147
|
+
visibility: CABVisibility.optional()
|
|
2148
|
+
};
|
|
2149
|
+
|
|
2066
2150
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
2067
|
-
var CABImageSectionFields =
|
|
2068
|
-
|
|
2151
|
+
var CABImageSectionFields = import_zod13.z.object({
|
|
2152
|
+
...CABVariableFields,
|
|
2153
|
+
altText: import_zod13.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
2069
2154
|
/**
|
|
2070
2155
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
2071
2156
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
2072
2157
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
2073
2158
|
*/
|
|
2074
|
-
aspectRatio:
|
|
2075
|
-
border:
|
|
2076
|
-
buttonField:
|
|
2159
|
+
aspectRatio: import_zod13.z.number().positive().nullable().default(null),
|
|
2160
|
+
border: import_zod13.z.lazy(() => CABBorder),
|
|
2161
|
+
buttonField: import_zod13.z.enum(buttonFields).optional(),
|
|
2077
2162
|
/**
|
|
2078
2163
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
2079
2164
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -2092,30 +2177,29 @@ var CABImageSectionFields = import_zod12.z.object({
|
|
|
2092
2177
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
2093
2178
|
* the risky half.
|
|
2094
2179
|
*/
|
|
2095
|
-
category:
|
|
2180
|
+
category: import_zod13.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
2096
2181
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
2097
|
-
iconSize:
|
|
2182
|
+
iconSize: import_zod13.z.enum(iconSizes).nullable().default(null),
|
|
2098
2183
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
2099
|
-
iconTone:
|
|
2100
|
-
name:
|
|
2101
|
-
naturalHeight:
|
|
2102
|
-
naturalWidth:
|
|
2184
|
+
iconTone: import_zod13.z.enum(iconTones).nullable().default(null),
|
|
2185
|
+
name: import_zod13.z.string().optional(),
|
|
2186
|
+
naturalHeight: import_zod13.z.number().default(0),
|
|
2187
|
+
naturalWidth: import_zod13.z.number().default(0),
|
|
2103
2188
|
/**
|
|
2104
2189
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
2105
2190
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
2106
2191
|
*/
|
|
2107
|
-
objectFit:
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
sectionType: import_zod12.z.literal(SectionType.image).default(SectionType.image),
|
|
2192
|
+
objectFit: import_zod13.z.enum(objectFits).default(ObjectFit.contain),
|
|
2193
|
+
sectionId: import_zod13.z.uuid().default(() => (0, import_uuid2.v7)()),
|
|
2194
|
+
sectionType: import_zod13.z.literal(SectionType.image).default(SectionType.image),
|
|
2111
2195
|
/**
|
|
2112
2196
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
2113
2197
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
2114
2198
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
2115
2199
|
* server-chosen tier icon actually needs it.
|
|
2116
2200
|
*/
|
|
2117
|
-
source:
|
|
2118
|
-
width:
|
|
2201
|
+
source: import_zod13.z.union([import_zod13.z.url(), import_zod13.z.literal(""), import_zod13.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod13.z.enum(iconNames)]).default(""),
|
|
2202
|
+
width: import_zod13.z.number().default(100)
|
|
2119
2203
|
});
|
|
2120
2204
|
var iconNameSet = new Set(iconNames);
|
|
2121
2205
|
var isIconName = (source) => iconNameSet.has(source);
|
|
@@ -2137,71 +2221,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
|
|
|
2137
2221
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
2138
2222
|
var import_compat2 = require("es-toolkit/compat");
|
|
2139
2223
|
var import_uuid3 = require("uuid");
|
|
2140
|
-
var
|
|
2141
|
-
var enumOrOmit = (...vals) =>
|
|
2142
|
-
var TiptapText =
|
|
2143
|
-
marks:
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
attrs:
|
|
2150
|
-
class:
|
|
2151
|
-
href:
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2224
|
+
var import_zod14 = require("zod");
|
|
2225
|
+
var enumOrOmit = (...vals) => import_zod14.z.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
2226
|
+
var TiptapText = import_zod14.z.object({
|
|
2227
|
+
marks: import_zod14.z.union([
|
|
2228
|
+
import_zod14.z.array(
|
|
2229
|
+
import_zod14.z.discriminatedUnion("type", [
|
|
2230
|
+
import_zod14.z.object({ type: import_zod14.z.literal("bold") }),
|
|
2231
|
+
import_zod14.z.object({ type: import_zod14.z.literal("italic") }),
|
|
2232
|
+
import_zod14.z.object({
|
|
2233
|
+
attrs: import_zod14.z.object({
|
|
2234
|
+
class: import_zod14.z.string().nullable(),
|
|
2235
|
+
href: import_zod14.z.union([
|
|
2236
|
+
import_zod14.z.url(),
|
|
2237
|
+
import_zod14.z.literal("#"),
|
|
2238
|
+
import_zod14.z.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
2239
|
+
import_zod14.z.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
2156
2240
|
]),
|
|
2157
|
-
rel:
|
|
2158
|
-
target:
|
|
2241
|
+
rel: import_zod14.z.string().default("noopener noreferrer nofollow"),
|
|
2242
|
+
target: import_zod14.z.string().default("_blank")
|
|
2159
2243
|
}),
|
|
2160
|
-
type:
|
|
2244
|
+
type: import_zod14.z.literal("link")
|
|
2161
2245
|
}),
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
attrs:
|
|
2246
|
+
import_zod14.z.object({ type: import_zod14.z.literal("strike") }),
|
|
2247
|
+
import_zod14.z.object({
|
|
2248
|
+
attrs: import_zod14.z.object({
|
|
2165
2249
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
2166
2250
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
2167
2251
|
}),
|
|
2168
|
-
type:
|
|
2252
|
+
type: import_zod14.z.literal("textStyle")
|
|
2169
2253
|
})
|
|
2170
2254
|
])
|
|
2171
2255
|
),
|
|
2172
|
-
|
|
2256
|
+
import_zod14.z.strictObject({}).transform(() => [])
|
|
2173
2257
|
]).optional(),
|
|
2174
|
-
text:
|
|
2175
|
-
type:
|
|
2258
|
+
text: import_zod14.z.string().default(""),
|
|
2259
|
+
type: import_zod14.z.literal("text").default("text")
|
|
2176
2260
|
});
|
|
2177
|
-
var TiptapParagraph =
|
|
2178
|
-
attrs:
|
|
2261
|
+
var TiptapParagraph = import_zod14.z.object({
|
|
2262
|
+
attrs: import_zod14.z.object({
|
|
2179
2263
|
textAlign: enumOrOmit(...textAlignments)
|
|
2180
2264
|
}).default({ textAlign: TextAlignment.start }),
|
|
2181
|
-
content:
|
|
2182
|
-
type:
|
|
2265
|
+
content: import_zod14.z.union([import_zod14.z.array(TiptapText), import_zod14.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2266
|
+
type: import_zod14.z.literal("paragraph").default("paragraph")
|
|
2183
2267
|
});
|
|
2184
|
-
var TiptapDocument =
|
|
2185
|
-
attrs:
|
|
2268
|
+
var TiptapDocument = import_zod14.z.object({
|
|
2269
|
+
attrs: import_zod14.z.object({
|
|
2186
2270
|
blockSpacing: enumOrOmit(...spacings)
|
|
2187
2271
|
}).default({ blockSpacing: Spacing.base }),
|
|
2188
|
-
content:
|
|
2189
|
-
type:
|
|
2272
|
+
content: import_zod14.z.union([import_zod14.z.array(TiptapParagraph), import_zod14.z.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
2273
|
+
type: import_zod14.z.literal("doc").default("doc")
|
|
2190
2274
|
});
|
|
2191
|
-
var CABTextTier =
|
|
2192
|
-
threshold:
|
|
2193
|
-
thresholds:
|
|
2194
|
-
tierId:
|
|
2195
|
-
tierType:
|
|
2275
|
+
var CABTextTier = import_zod14.z.object({
|
|
2276
|
+
threshold: import_zod14.z.number().int().nonnegative(),
|
|
2277
|
+
thresholds: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.number().int().nonnegative()).default(() => ({})),
|
|
2278
|
+
tierId: import_zod14.z.string().optional(),
|
|
2279
|
+
tierType: import_zod14.z.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
2196
2280
|
});
|
|
2197
|
-
var CABTextSection =
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
sectionId:
|
|
2204
|
-
sectionType:
|
|
2281
|
+
var CABTextSection = import_zod14.z.object({
|
|
2282
|
+
...CABVariableFields,
|
|
2283
|
+
buttonField: import_zod14.z.enum(buttonFields).optional(),
|
|
2284
|
+
content: import_zod14.z.record(import_zod14.z.string(), import_zod14.z.union([import_zod14.z.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
2285
|
+
name: import_zod14.z.string().optional(),
|
|
2286
|
+
optionId: import_zod14.z.number().optional(),
|
|
2287
|
+
sectionId: import_zod14.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
2288
|
+
sectionType: import_zod14.z.literal(SectionType.text).default(SectionType.text),
|
|
2205
2289
|
tier: CABTextTier.optional()
|
|
2206
2290
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
2207
2291
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -2223,35 +2307,35 @@ var CABTextSection = import_zod13.z.object({
|
|
|
2223
2307
|
});
|
|
2224
2308
|
|
|
2225
2309
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
2226
|
-
var CABButtonContent =
|
|
2227
|
-
() =>
|
|
2310
|
+
var CABButtonContent = import_zod15.z.lazy(
|
|
2311
|
+
() => import_zod15.z.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
2228
2312
|
);
|
|
2229
|
-
var CABButtonSection =
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2313
|
+
var CABButtonSection = import_zod15.z.object({
|
|
2314
|
+
...CABVariableFields,
|
|
2315
|
+
action: import_zod15.z.union([import_zod15.z.literal(""), import_zod15.z.enum(buttonActions)]).default(""),
|
|
2316
|
+
buttonStyle: import_zod15.z.enum(buttonStyles).default(ButtonStyle.primary),
|
|
2317
|
+
custom: import_zod15.z.object({
|
|
2318
|
+
color: import_zod15.z.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
2319
|
+
height: import_zod15.z.number().default(52),
|
|
2320
|
+
width: import_zod15.z.number().default(300)
|
|
2236
2321
|
}).default({
|
|
2237
2322
|
color: "#005bd3",
|
|
2238
2323
|
height: 52,
|
|
2239
2324
|
width: 300
|
|
2240
2325
|
}),
|
|
2241
|
-
disableDowngrade:
|
|
2242
|
-
name:
|
|
2243
|
-
optionId:
|
|
2244
|
-
popover:
|
|
2245
|
-
alignment:
|
|
2246
|
-
position:
|
|
2326
|
+
disableDowngrade: import_zod15.z.boolean().default(false),
|
|
2327
|
+
name: import_zod15.z.string().optional(),
|
|
2328
|
+
optionId: import_zod15.z.number().optional(),
|
|
2329
|
+
popover: import_zod15.z.object({
|
|
2330
|
+
alignment: import_zod15.z.enum(textAlignments).default(TextAlignment.center),
|
|
2331
|
+
position: import_zod15.z.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
2247
2332
|
}).optional().default(() => ({
|
|
2248
2333
|
alignment: TextAlignment.center,
|
|
2249
2334
|
position: PopoverPosition.blockStart
|
|
2250
2335
|
})),
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
sectionType: import_zod14.z.literal(SectionType.button).default(SectionType.button),
|
|
2336
|
+
sectionId: import_zod15.z.uuid().default(() => (0, import_uuid4.v7)()),
|
|
2337
|
+
sections: import_zod15.z.union([import_zod15.z.array(CABButtonContent), import_zod15.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2338
|
+
sectionType: import_zod15.z.literal(SectionType.button).default(SectionType.button),
|
|
2255
2339
|
/**
|
|
2256
2340
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
2257
2341
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -2266,86 +2350,93 @@ var CABButtonSection = import_zod14.z.object({
|
|
|
2266
2350
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
2267
2351
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
2268
2352
|
*/
|
|
2269
|
-
tier:
|
|
2353
|
+
tier: import_zod15.z.object({ tierId: import_zod15.z.string().min(1) }).optional(),
|
|
2270
2354
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2271
|
-
trackingUrl:
|
|
2355
|
+
trackingUrl: import_zod15.z.string().optional(),
|
|
2356
|
+
/**
|
|
2357
|
+
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
2358
|
+
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
2359
|
+
*/
|
|
2360
|
+
variableEffects: import_zod15.z.array(CABVariableEffect).optional()
|
|
2272
2361
|
});
|
|
2273
2362
|
|
|
2274
2363
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2275
|
-
var
|
|
2364
|
+
var import_zod20 = require("zod");
|
|
2276
2365
|
|
|
2277
2366
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2278
|
-
var
|
|
2367
|
+
var import_zod19 = require("zod");
|
|
2279
2368
|
|
|
2280
2369
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
2281
2370
|
var import_uuid5 = require("uuid");
|
|
2282
|
-
var
|
|
2283
|
-
var CABDiscount =
|
|
2284
|
-
amount:
|
|
2285
|
-
discountedBy:
|
|
2286
|
-
discountedFrom:
|
|
2287
|
-
type:
|
|
2371
|
+
var import_zod16 = require("zod");
|
|
2372
|
+
var CABDiscount = import_zod16.z.object({
|
|
2373
|
+
amount: import_zod16.z.union([import_zod16.z.number(), import_zod16.z.string()]).catch(0),
|
|
2374
|
+
discountedBy: import_zod16.z.string().optional(),
|
|
2375
|
+
discountedFrom: import_zod16.z.enum(discountSources).optional().catch(void 0),
|
|
2376
|
+
type: import_zod16.z.enum(discountTypes).catch("none")
|
|
2288
2377
|
});
|
|
2289
|
-
var CABIntegrations =
|
|
2290
|
-
judgeme:
|
|
2291
|
-
junip:
|
|
2292
|
-
klaviyo:
|
|
2293
|
-
loox:
|
|
2294
|
-
okendo:
|
|
2295
|
-
opinew:
|
|
2296
|
-
reviewsio:
|
|
2297
|
-
stamped:
|
|
2298
|
-
yotpo:
|
|
2378
|
+
var CABIntegrations = import_zod16.z.object({
|
|
2379
|
+
judgeme: import_zod16.z.boolean().default(false),
|
|
2380
|
+
junip: import_zod16.z.boolean().default(false),
|
|
2381
|
+
klaviyo: import_zod16.z.boolean().default(false),
|
|
2382
|
+
loox: import_zod16.z.boolean().default(false),
|
|
2383
|
+
okendo: import_zod16.z.boolean().default(false),
|
|
2384
|
+
opinew: import_zod16.z.boolean().default(false),
|
|
2385
|
+
reviewsio: import_zod16.z.boolean().default(false),
|
|
2386
|
+
stamped: import_zod16.z.boolean().default(false),
|
|
2387
|
+
yotpo: import_zod16.z.boolean().default(false)
|
|
2299
2388
|
});
|
|
2300
|
-
var CABDataSourceSection =
|
|
2301
|
-
dataSourceId:
|
|
2302
|
-
dataSourcePath:
|
|
2389
|
+
var CABDataSourceSection = import_zod16.z.object({
|
|
2390
|
+
dataSourceId: import_zod16.z.number().nullable().default(null),
|
|
2391
|
+
dataSourcePath: import_zod16.z.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
2303
2392
|
discount: CABDiscount.optional(),
|
|
2304
2393
|
integrations: CABIntegrations.optional(),
|
|
2305
|
-
limit:
|
|
2306
|
-
matchVariant:
|
|
2307
|
-
matchVariantOutOfStock:
|
|
2308
|
-
name:
|
|
2309
|
-
productType:
|
|
2310
|
-
sectionId:
|
|
2311
|
-
sectionType:
|
|
2394
|
+
limit: import_zod16.z.number().default(1),
|
|
2395
|
+
matchVariant: import_zod16.z.boolean().default(false),
|
|
2396
|
+
matchVariantOutOfStock: import_zod16.z.boolean().default(false),
|
|
2397
|
+
name: import_zod16.z.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
2398
|
+
productType: import_zod16.z.enum(productTypes).optional(),
|
|
2399
|
+
sectionId: import_zod16.z.uuid().default(() => (0, import_uuid5.v7)()),
|
|
2400
|
+
sectionType: import_zod16.z.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
2312
2401
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
2313
|
-
subscriptionIsDefault:
|
|
2314
|
-
treatAsGwp:
|
|
2402
|
+
subscriptionIsDefault: import_zod16.z.boolean().default(false),
|
|
2403
|
+
treatAsGwp: import_zod16.z.boolean().default(false)
|
|
2315
2404
|
});
|
|
2316
2405
|
|
|
2317
2406
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2318
2407
|
var import_uuid7 = require("uuid");
|
|
2319
|
-
var
|
|
2408
|
+
var import_zod18 = require("zod");
|
|
2320
2409
|
|
|
2321
2410
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
2322
2411
|
var import_uuid6 = require("uuid");
|
|
2323
|
-
var
|
|
2324
|
-
var CABVariantContent =
|
|
2325
|
-
() =>
|
|
2412
|
+
var import_zod17 = require("zod");
|
|
2413
|
+
var CABVariantContent = import_zod17.z.lazy(
|
|
2414
|
+
() => import_zod17.z.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
2326
2415
|
);
|
|
2327
|
-
var CABProductSection =
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2416
|
+
var CABProductSection = import_zod17.z.object({
|
|
2417
|
+
...CABVariableFields,
|
|
2418
|
+
name: import_zod17.z.string().optional(),
|
|
2419
|
+
productId: import_zod17.z.number().nullable().default(null),
|
|
2420
|
+
sectionId: import_zod17.z.uuid().default(() => (0, import_uuid6.v7)()),
|
|
2421
|
+
sections: import_zod17.z.union([import_zod17.z.array(CABVariantContent), import_zod17.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2422
|
+
sectionType: import_zod17.z.literal(SectionType.product).default(SectionType.product),
|
|
2423
|
+
selectors: import_zod17.z.record(import_zod17.z.string(), import_zod17.z.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
2424
|
+
variantMode: import_zod17.z.enum(variantModes).default(VariantMode.multiple)
|
|
2335
2425
|
});
|
|
2336
2426
|
|
|
2337
2427
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2338
|
-
var CABProductsSection =
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2428
|
+
var CABProductsSection = import_zod18.z.object({
|
|
2429
|
+
...CABVariableFields,
|
|
2430
|
+
name: import_zod18.z.string().optional(),
|
|
2431
|
+
sectionId: import_zod18.z.uuid().default(() => (0, import_uuid7.v7)()),
|
|
2432
|
+
sections: import_zod18.z.union([import_zod18.z.array(import_zod18.z.lazy(() => CABProductSection)), import_zod18.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2433
|
+
sectionType: import_zod18.z.literal(SectionType.products).default(SectionType.products)
|
|
2343
2434
|
});
|
|
2344
2435
|
|
|
2345
2436
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2346
|
-
var CABOffersSection =
|
|
2437
|
+
var CABOffersSection = import_zod19.z.lazy(
|
|
2347
2438
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2348
|
-
sections:
|
|
2439
|
+
sections: import_zod19.z.union([import_zod19.z.array(import_zod19.z.lazy(() => CABSection)), import_zod19.z.strictObject({}).transform(() => [])]).default(() => [
|
|
2349
2440
|
CABBannerSection.parse({
|
|
2350
2441
|
buttonField: "undoAddToOrder",
|
|
2351
2442
|
color: "success",
|
|
@@ -2359,64 +2450,65 @@ var CABOffersSection = import_zod18.z.lazy(
|
|
|
2359
2450
|
CABDataSourceSection.parse({}),
|
|
2360
2451
|
CABProductsSection.parse({})
|
|
2361
2452
|
]),
|
|
2362
|
-
sectionType:
|
|
2453
|
+
sectionType: import_zod19.z.literal(SectionType.offers).default(SectionType.offers)
|
|
2363
2454
|
})
|
|
2364
2455
|
);
|
|
2365
2456
|
|
|
2366
2457
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2367
|
-
var CABCarouselSection =
|
|
2458
|
+
var CABCarouselSection = import_zod20.z.lazy(
|
|
2368
2459
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2369
|
-
autoAdvanceInterval:
|
|
2370
|
-
itemsAtOnce:
|
|
2460
|
+
autoAdvanceInterval: import_zod20.z.number().default(0),
|
|
2461
|
+
itemsAtOnce: import_zod20.z.number().min(1).default(1),
|
|
2371
2462
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
2372
|
-
offersDirection:
|
|
2373
|
-
sections:
|
|
2374
|
-
sectionType:
|
|
2463
|
+
offersDirection: import_zod20.z.enum(offersDirections).default("vertical"),
|
|
2464
|
+
sections: import_zod20.z.union([import_zod20.z.array(import_zod20.z.lazy(() => CABSection)), import_zod20.z.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
2465
|
+
sectionType: import_zod20.z.literal(SectionType.carousel).default(SectionType.carousel)
|
|
2375
2466
|
})
|
|
2376
2467
|
);
|
|
2377
2468
|
|
|
2378
2469
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
2379
|
-
var
|
|
2380
|
-
var CABCartLineSection =
|
|
2470
|
+
var import_zod21 = require("zod");
|
|
2471
|
+
var CABCartLineSection = import_zod21.z.lazy(
|
|
2381
2472
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2382
|
-
sections:
|
|
2383
|
-
sectionType:
|
|
2473
|
+
sections: import_zod21.z.union([import_zod21.z.array(import_zod21.z.lazy(() => CABSection)), import_zod21.z.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
2474
|
+
sectionType: import_zod21.z.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
2384
2475
|
})
|
|
2385
2476
|
);
|
|
2386
2477
|
|
|
2387
2478
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
2388
2479
|
var import_uuid8 = require("uuid");
|
|
2389
|
-
var
|
|
2390
|
-
var CABDiscountSection =
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2480
|
+
var import_zod22 = require("zod");
|
|
2481
|
+
var CABDiscountSection = import_zod22.z.object({
|
|
2482
|
+
...CABVariableFields,
|
|
2483
|
+
amount: import_zod22.z.union([import_zod22.z.number(), import_zod22.z.string()]).catch(0),
|
|
2484
|
+
discountedBy: import_zod22.z.string().optional(),
|
|
2485
|
+
discountedFrom: import_zod22.z.enum(discountSources).optional().catch(void 0),
|
|
2486
|
+
message: import_zod22.z.string().optional(),
|
|
2487
|
+
name: import_zod22.z.string().optional(),
|
|
2488
|
+
quantity: import_zod22.z.number().default(1),
|
|
2489
|
+
sectionId: import_zod22.z.uuid().default(() => (0, import_uuid8.v7)()),
|
|
2490
|
+
sectionType: import_zod22.z.literal(SectionType.discount).default(SectionType.discount),
|
|
2491
|
+
type: import_zod22.z.enum(discountTypes).catch("none")
|
|
2400
2492
|
});
|
|
2401
2493
|
|
|
2402
2494
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2403
2495
|
var import_uuid9 = require("uuid");
|
|
2404
|
-
var
|
|
2405
|
-
var CABMonetizeSection =
|
|
2406
|
-
|
|
2496
|
+
var import_zod23 = require("zod");
|
|
2497
|
+
var CABMonetizeSection = import_zod23.z.object({
|
|
2498
|
+
...CABVariableFields,
|
|
2499
|
+
name: import_zod23.z.string().optional(),
|
|
2407
2500
|
/** Privacy Policy footer href (the widget's `privacy_policy_url` setting); the client relays it to `/cab/monetize`. */
|
|
2408
|
-
privacyPolicyUrl:
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
sectionType: import_zod22.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2501
|
+
privacyPolicyUrl: import_zod23.z.string().optional(),
|
|
2502
|
+
sectionId: import_zod23.z.uuid().default(() => (0, import_uuid9.v7)()),
|
|
2503
|
+
sectionType: import_zod23.z.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2412
2504
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
2413
|
-
subVertical:
|
|
2505
|
+
subVertical: import_zod23.z.string().optional(),
|
|
2414
2506
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
2415
|
-
vertical:
|
|
2507
|
+
vertical: import_zod23.z.string().optional()
|
|
2416
2508
|
});
|
|
2417
2509
|
|
|
2418
2510
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2419
|
-
var
|
|
2511
|
+
var import_zod24 = require("zod");
|
|
2420
2512
|
|
|
2421
2513
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
2422
2514
|
var GIFT_LABELS = {
|
|
@@ -2535,21 +2627,21 @@ var GIFT_LABELS = {
|
|
|
2535
2627
|
};
|
|
2536
2628
|
|
|
2537
2629
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2538
|
-
var CABProgressTier =
|
|
2630
|
+
var CABProgressTier = import_zod24.z.object({
|
|
2539
2631
|
/**
|
|
2540
2632
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
2541
2633
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
2542
2634
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
2543
2635
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
2544
2636
|
*/
|
|
2545
|
-
discount:
|
|
2637
|
+
discount: import_zod24.z.object({ amount: import_zod24.z.number().nonnegative(), type: import_zod24.z.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
2546
2638
|
/**
|
|
2547
2639
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
2548
2640
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
2549
2641
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
2550
2642
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
2551
2643
|
*/
|
|
2552
|
-
filterOosVariants:
|
|
2644
|
+
filterOosVariants: import_zod24.z.boolean().default(false),
|
|
2553
2645
|
/**
|
|
2554
2646
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2555
2647
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -2557,10 +2649,10 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2557
2649
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2558
2650
|
* tree is complete.
|
|
2559
2651
|
*/
|
|
2560
|
-
gift:
|
|
2561
|
-
productId:
|
|
2562
|
-
title:
|
|
2563
|
-
variantIds:
|
|
2652
|
+
gift: import_zod24.z.object({
|
|
2653
|
+
productId: import_zod24.z.number().int().positive(),
|
|
2654
|
+
title: import_zod24.z.string().optional(),
|
|
2655
|
+
variantIds: import_zod24.z.array(import_zod24.z.number().int().positive()).default(() => [])
|
|
2564
2656
|
}).optional(),
|
|
2565
2657
|
/**
|
|
2566
2658
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
@@ -2571,35 +2663,35 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2571
2663
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
2572
2664
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
2573
2665
|
*/
|
|
2574
|
-
label:
|
|
2666
|
+
label: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).optional(),
|
|
2575
2667
|
/**
|
|
2576
2668
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
2577
2669
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
2578
2670
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
2579
2671
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
2580
2672
|
*/
|
|
2581
|
-
productTierImage:
|
|
2673
|
+
productTierImage: import_zod24.z.boolean().default(false),
|
|
2582
2674
|
/**
|
|
2583
2675
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
2584
2676
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
2585
2677
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
2586
2678
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
2587
2679
|
*/
|
|
2588
|
-
threshold:
|
|
2680
|
+
threshold: import_zod24.z.number().int().nonnegative(),
|
|
2589
2681
|
/**
|
|
2590
2682
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2591
2683
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2592
2684
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2593
2685
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2594
2686
|
*/
|
|
2595
|
-
thresholds:
|
|
2687
|
+
thresholds: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.number().int().nonnegative()).default(() => ({})),
|
|
2596
2688
|
/**
|
|
2597
2689
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2598
2690
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2599
2691
|
* shipping bar (single unlabeled tier, no gift).
|
|
2600
2692
|
*/
|
|
2601
|
-
tierId:
|
|
2602
|
-
tierType:
|
|
2693
|
+
tierId: import_zod24.z.string().optional(),
|
|
2694
|
+
tierType: import_zod24.z.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
2603
2695
|
/**
|
|
2604
2696
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
2605
2697
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -2610,9 +2702,9 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2610
2702
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
2611
2703
|
* template text supplies grammatically-neutral wording around the token.
|
|
2612
2704
|
*/
|
|
2613
|
-
unit:
|
|
2705
|
+
unit: import_zod24.z.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
2614
2706
|
});
|
|
2615
|
-
var CABProgressBarSection =
|
|
2707
|
+
var CABProgressBarSection = import_zod24.z.lazy(
|
|
2616
2708
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2617
2709
|
/**
|
|
2618
2710
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -2621,35 +2713,35 @@ var CABProgressBarSection = import_zod23.z.lazy(
|
|
|
2621
2713
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
2622
2714
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
2623
2715
|
*/
|
|
2624
|
-
barId:
|
|
2716
|
+
barId: import_zod24.z.string().optional(),
|
|
2625
2717
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2626
|
-
countryCodes:
|
|
2718
|
+
countryCodes: import_zod24.z.array(import_zod24.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2627
2719
|
/**
|
|
2628
2720
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2629
2721
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2630
2722
|
*/
|
|
2631
|
-
excludeCountryCodes:
|
|
2723
|
+
excludeCountryCodes: import_zod24.z.array(import_zod24.z.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2632
2724
|
/**
|
|
2633
2725
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
2634
2726
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
2635
2727
|
* adds the cart's discount allocations back to the live subtotal.
|
|
2636
2728
|
*/
|
|
2637
|
-
excludeDiscountInSubtotal:
|
|
2729
|
+
excludeDiscountInSubtotal: import_zod24.z.boolean().default(false),
|
|
2638
2730
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2639
|
-
excludedVariantIds:
|
|
2731
|
+
excludedVariantIds: import_zod24.z.array(import_zod24.z.number().int().positive()).default(() => []),
|
|
2640
2732
|
/**
|
|
2641
2733
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2642
2734
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2643
2735
|
*/
|
|
2644
|
-
freeShippingOnSubscription:
|
|
2736
|
+
freeShippingOnSubscription: import_zod24.z.boolean().default(false),
|
|
2645
2737
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
2646
|
-
giftAreaTitle:
|
|
2738
|
+
giftAreaTitle: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
2647
2739
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2648
|
-
giftLabels:
|
|
2649
|
-
addGift:
|
|
2650
|
-
remove:
|
|
2651
|
-
selectOptions:
|
|
2652
|
-
yourGift:
|
|
2740
|
+
giftLabels: import_zod24.z.object({
|
|
2741
|
+
addGift: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
2742
|
+
remove: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
2743
|
+
selectOptions: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
2744
|
+
yourGift: import_zod24.z.record(import_zod24.z.string(), import_zod24.z.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2653
2745
|
}).default(() => ({
|
|
2654
2746
|
addGift: { ...GIFT_LABELS.addGift },
|
|
2655
2747
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -2657,37 +2749,38 @@ var CABProgressBarSection = import_zod23.z.lazy(
|
|
|
2657
2749
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2658
2750
|
})),
|
|
2659
2751
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
2660
|
-
name:
|
|
2752
|
+
name: import_zod24.z.string().default("Order progress"),
|
|
2661
2753
|
/**
|
|
2662
2754
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2663
2755
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2664
2756
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2665
2757
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2666
2758
|
*/
|
|
2667
|
-
progressColor:
|
|
2668
|
-
sectionType:
|
|
2759
|
+
progressColor: import_zod24.z.string().optional(),
|
|
2760
|
+
sectionType: import_zod24.z.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2669
2761
|
/**
|
|
2670
2762
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
2671
2763
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
2672
2764
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
2673
2765
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
2674
2766
|
*/
|
|
2675
|
-
tiers:
|
|
2767
|
+
tiers: import_zod24.z.union([import_zod24.z.array(CABProgressTier), import_zod24.z.strictObject({}).transform(() => [])]).default(() => [])
|
|
2676
2768
|
})
|
|
2677
2769
|
);
|
|
2678
2770
|
|
|
2679
2771
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
2680
2772
|
var import_uuid10 = require("uuid");
|
|
2681
|
-
var
|
|
2682
|
-
var CABQuantitySection =
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2773
|
+
var import_zod25 = require("zod");
|
|
2774
|
+
var CABQuantitySection = import_zod25.z.object({
|
|
2775
|
+
...CABVariableFields,
|
|
2776
|
+
errorMessages: import_zod25.z.record(
|
|
2777
|
+
import_zod25.z.string(),
|
|
2778
|
+
import_zod25.z.object({
|
|
2686
2779
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
2687
|
-
increment:
|
|
2688
|
-
max:
|
|
2689
|
-
min:
|
|
2690
|
-
neg:
|
|
2780
|
+
increment: import_zod25.z.string().optional(),
|
|
2781
|
+
max: import_zod25.z.string().optional(),
|
|
2782
|
+
min: import_zod25.z.string().optional(),
|
|
2783
|
+
neg: import_zod25.z.string().optional()
|
|
2691
2784
|
})
|
|
2692
2785
|
).default({
|
|
2693
2786
|
en: {
|
|
@@ -2697,19 +2790,18 @@ var CABQuantitySection = import_zod24.z.object({
|
|
|
2697
2790
|
neg: "Quantity cannot be negative"
|
|
2698
2791
|
}
|
|
2699
2792
|
}),
|
|
2700
|
-
inputType:
|
|
2701
|
-
max:
|
|
2702
|
-
min:
|
|
2793
|
+
inputType: import_zod25.z.enum(quantityInputs).default(QuantityInput.select),
|
|
2794
|
+
max: import_zod25.z.number().min(1).max(100).default(10),
|
|
2795
|
+
min: import_zod25.z.number().min(1).default(1),
|
|
2703
2796
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
2704
|
-
name:
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
sectionType: import_zod24.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2797
|
+
name: import_zod25.z.string().default("Quantity"),
|
|
2798
|
+
sectionId: import_zod25.z.uuid().default(() => (0, import_uuid10.v7)()),
|
|
2799
|
+
sectionType: import_zod25.z.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2708
2800
|
});
|
|
2709
2801
|
|
|
2710
2802
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2711
2803
|
var import_uuid11 = require("uuid");
|
|
2712
|
-
var
|
|
2804
|
+
var import_zod26 = require("zod");
|
|
2713
2805
|
|
|
2714
2806
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
2715
2807
|
var REVIEW_LABELS = {
|
|
@@ -2772,50 +2864,50 @@ var REVIEW_LABELS = {
|
|
|
2772
2864
|
};
|
|
2773
2865
|
|
|
2774
2866
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2775
|
-
var CABReviewsSection =
|
|
2776
|
-
|
|
2867
|
+
var CABReviewsSection = import_zod26.z.object({
|
|
2868
|
+
...CABVariableFields,
|
|
2869
|
+
color: import_zod26.z.string().default("#fadb14"),
|
|
2777
2870
|
/**
|
|
2778
2871
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
2779
2872
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
2780
2873
|
* or merchant work.
|
|
2781
2874
|
*/
|
|
2782
|
-
countLabels:
|
|
2783
|
-
one:
|
|
2784
|
-
other:
|
|
2875
|
+
countLabels: import_zod26.z.object({
|
|
2876
|
+
one: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
2877
|
+
other: import_zod26.z.record(import_zod26.z.string(), import_zod26.z.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
2785
2878
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
2786
|
-
name:
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
size: import_zod25.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2879
|
+
name: import_zod26.z.string().optional(),
|
|
2880
|
+
sectionId: import_zod26.z.uuid().default(() => (0, import_uuid11.v7)()),
|
|
2881
|
+
sectionType: import_zod26.z.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2882
|
+
size: import_zod26.z.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2791
2883
|
});
|
|
2792
2884
|
|
|
2793
2885
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2794
2886
|
var import_compat3 = require("es-toolkit/compat");
|
|
2795
2887
|
var import_uuid12 = require("uuid");
|
|
2796
|
-
var
|
|
2797
|
-
var CABVariantsSection =
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
sectionId:
|
|
2802
|
-
sectionType:
|
|
2803
|
-
selector:
|
|
2804
|
-
variantMode:
|
|
2888
|
+
var import_zod27 = require("zod");
|
|
2889
|
+
var CABVariantsSection = import_zod27.z.object({
|
|
2890
|
+
...CABVariableFields,
|
|
2891
|
+
hideOutOfStockVariants: import_zod27.z.boolean().default(false),
|
|
2892
|
+
name: import_zod27.z.string().optional(),
|
|
2893
|
+
sectionId: import_zod27.z.uuid().default(() => (0, import_uuid12.v7)()),
|
|
2894
|
+
sectionType: import_zod27.z.literal(SectionType.variants).default(SectionType.variants),
|
|
2895
|
+
selector: import_zod27.z.enum((0, import_compat3.slice)(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2896
|
+
variantMode: import_zod27.z.enum(variantModes).default(VariantMode.multiple)
|
|
2805
2897
|
});
|
|
2806
2898
|
|
|
2807
2899
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2808
|
-
var CABBorder =
|
|
2809
|
-
radius:
|
|
2810
|
-
style:
|
|
2811
|
-
width:
|
|
2900
|
+
var CABBorder = import_zod28.z.object({
|
|
2901
|
+
radius: import_zod28.z.enum(borderRadii).default(BorderRadius.base),
|
|
2902
|
+
style: import_zod28.z.enum(borderStyles).default(BorderStyle.none),
|
|
2903
|
+
width: import_zod28.z.enum(borderWidths).default(BorderWidth.base)
|
|
2812
2904
|
}).default({
|
|
2813
2905
|
radius: BorderRadius.base,
|
|
2814
2906
|
style: BorderStyle.none,
|
|
2815
2907
|
width: BorderWidth.base
|
|
2816
2908
|
});
|
|
2817
|
-
var CABSection =
|
|
2818
|
-
() =>
|
|
2909
|
+
var CABSection = import_zod28.z.lazy(
|
|
2910
|
+
() => import_zod28.z.discriminatedUnion("sectionType", [
|
|
2819
2911
|
CABBannerSection,
|
|
2820
2912
|
CABButtonSection,
|
|
2821
2913
|
CABCarouselSection,
|
|
@@ -2837,32 +2929,32 @@ var CABSection = import_zod27.z.lazy(
|
|
|
2837
2929
|
);
|
|
2838
2930
|
|
|
2839
2931
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2840
|
-
var GridItem =
|
|
2841
|
-
var CABLayoutSection =
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2932
|
+
var GridItem = import_zod29.z.union([import_zod29.z.literal("auto"), import_zod29.z.literal("fill"), import_zod29.z.string().regex(/^\d+%$/), import_zod29.z.number()]);
|
|
2933
|
+
var CABLayoutSection = import_zod29.z.object({
|
|
2934
|
+
...CABVariableFields,
|
|
2935
|
+
alignment: import_zod29.z.object({
|
|
2936
|
+
horizontal: import_zod29.z.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2937
|
+
vertical: import_zod29.z.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2845
2938
|
}).default({
|
|
2846
2939
|
horizontal: HorizontalAlignment.start,
|
|
2847
2940
|
vertical: VerticalAlignment.top
|
|
2848
2941
|
}),
|
|
2849
|
-
border:
|
|
2850
|
-
buttonField:
|
|
2851
|
-
direction:
|
|
2852
|
-
grid:
|
|
2853
|
-
columns:
|
|
2854
|
-
rows:
|
|
2942
|
+
border: import_zod29.z.lazy(() => CABBorder),
|
|
2943
|
+
buttonField: import_zod29.z.enum(buttonFields).optional(),
|
|
2944
|
+
direction: import_zod29.z.enum(directions).default(Direction.rows),
|
|
2945
|
+
grid: import_zod29.z.object({
|
|
2946
|
+
columns: import_zod29.z.union([import_zod29.z.array(GridItem), import_zod29.z.undefined()]).default(() => ["auto"]),
|
|
2947
|
+
rows: import_zod29.z.union([import_zod29.z.array(GridItem), import_zod29.z.undefined()]).default(() => ["auto"])
|
|
2855
2948
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2856
|
-
name:
|
|
2857
|
-
padding:
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
spacing: import_zod28.z.enum(spacings).default(Spacing.base),
|
|
2949
|
+
name: import_zod29.z.string().optional(),
|
|
2950
|
+
padding: import_zod29.z.enum(spacings).default(Spacing.none),
|
|
2951
|
+
sectionId: import_zod29.z.uuid().default(() => (0, import_uuid13.v7)()),
|
|
2952
|
+
sections: import_zod29.z.union([import_zod29.z.array(import_zod29.z.lazy(() => CABSection)), import_zod29.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2953
|
+
sectionType: import_zod29.z.literal(SectionType.layout).default(SectionType.layout),
|
|
2954
|
+
spacing: import_zod29.z.enum(spacings).default(Spacing.base),
|
|
2863
2955
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2864
|
-
viewUrl:
|
|
2865
|
-
width:
|
|
2956
|
+
viewUrl: import_zod29.z.string().optional(),
|
|
2957
|
+
width: import_zod29.z.number().default(100)
|
|
2866
2958
|
});
|
|
2867
2959
|
|
|
2868
2960
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -2879,8 +2971,8 @@ var UI_LABELS = {
|
|
|
2879
2971
|
};
|
|
2880
2972
|
|
|
2881
2973
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2882
|
-
var localized = (fallback) =>
|
|
2883
|
-
var CABUILabels =
|
|
2974
|
+
var localized = (fallback) => import_zod30.z.record(import_zod30.z.string(), import_zod30.z.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
2975
|
+
var CABUILabels = import_zod30.z.object({
|
|
2884
2976
|
currentPage: localized(UI_LABELS.currentPage),
|
|
2885
2977
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
2886
2978
|
nextPage: localized(UI_LABELS.nextPage),
|
|
@@ -2901,154 +2993,154 @@ var CABUILabels = import_zod29.z.object({
|
|
|
2901
2993
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
2902
2994
|
updating: { ...UI_LABELS.updating }
|
|
2903
2995
|
}));
|
|
2904
|
-
var TargetArea =
|
|
2905
|
-
fill:
|
|
2906
|
-
flip:
|
|
2907
|
-
icon:
|
|
2908
|
-
label:
|
|
2909
|
-
width:
|
|
2996
|
+
var TargetArea = import_zod30.z.object({
|
|
2997
|
+
fill: import_zod30.z.boolean().optional(),
|
|
2998
|
+
flip: import_zod30.z.enum(["both", "horizontal", "vertical"]).optional(),
|
|
2999
|
+
icon: import_zod30.z.string(),
|
|
3000
|
+
label: import_zod30.z.string(),
|
|
3001
|
+
width: import_zod30.z.string()
|
|
2910
3002
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2911
|
-
var CABTracking =
|
|
2912
|
-
enableAttribution:
|
|
2913
|
-
enableSource:
|
|
2914
|
-
enableWidget:
|
|
3003
|
+
var CABTracking = import_zod30.z.object({
|
|
3004
|
+
enableAttribution: import_zod30.z.boolean().nullish().transform((value) => value ?? true),
|
|
3005
|
+
enableSource: import_zod30.z.boolean().nullish().transform((value) => value ?? true),
|
|
3006
|
+
enableWidget: import_zod30.z.boolean().nullish().transform((value) => value ?? true)
|
|
2915
3007
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2916
|
-
var CABExperiment =
|
|
2917
|
-
elementId:
|
|
2918
|
-
experimentId:
|
|
2919
|
-
experimentType:
|
|
2920
|
-
selectedId:
|
|
3008
|
+
var CABExperiment = import_zod30.z.object({
|
|
3009
|
+
elementId: import_zod30.z.number(),
|
|
3010
|
+
experimentId: import_zod30.z.number(),
|
|
3011
|
+
experimentType: import_zod30.z.string(),
|
|
3012
|
+
selectedId: import_zod30.z.number()
|
|
2921
3013
|
});
|
|
2922
3014
|
var CABRootSection = CABLayoutSection.extend({
|
|
2923
|
-
editorMode:
|
|
3015
|
+
editorMode: import_zod30.z.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2924
3016
|
experiment: CABExperiment.optional(),
|
|
2925
3017
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
2926
3018
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
2927
|
-
previewMode:
|
|
2928
|
-
storeId:
|
|
3019
|
+
previewMode: import_zod30.z.boolean().nullish().transform((value) => value ?? false),
|
|
3020
|
+
storeId: import_zod30.z.number().nullable().default(null),
|
|
2929
3021
|
targetArea: TargetArea.nullable(),
|
|
2930
3022
|
tracking: CABTracking,
|
|
2931
|
-
type:
|
|
3023
|
+
type: import_zod30.z.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2932
3024
|
uiLabels: CABUILabels,
|
|
2933
|
-
version:
|
|
2934
|
-
widgetId:
|
|
3025
|
+
version: import_zod30.z.literal(2).default(2),
|
|
3026
|
+
widgetId: import_zod30.z.number().nullable().default(null)
|
|
2935
3027
|
});
|
|
2936
3028
|
|
|
2937
3029
|
// src/schema/widgets/contentBlock.ts
|
|
2938
|
-
var ContentBlockV1 =
|
|
2939
|
-
blockSpacing:
|
|
2940
|
-
imageBlocks:
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
altText:
|
|
2944
|
-
description:
|
|
2945
|
-
id:
|
|
2946
|
-
imagePlacement:
|
|
2947
|
-
imageSize:
|
|
2948
|
-
imageUrl:
|
|
2949
|
-
textAlignment:
|
|
3030
|
+
var ContentBlockV1 = import_zod31.z.object({
|
|
3031
|
+
blockSpacing: import_zod31.z.enum(spacings).optional(),
|
|
3032
|
+
imageBlocks: import_zod31.z.union([
|
|
3033
|
+
import_zod31.z.array(
|
|
3034
|
+
import_zod31.z.object({
|
|
3035
|
+
altText: import_zod31.z.string().nullable(),
|
|
3036
|
+
description: import_zod31.z.string().nullable(),
|
|
3037
|
+
id: import_zod31.z.uuid(),
|
|
3038
|
+
imagePlacement: import_zod31.z.enum(["top", "right", "bottom", "left"]),
|
|
3039
|
+
imageSize: import_zod31.z.number(),
|
|
3040
|
+
imageUrl: import_zod31.z.url(),
|
|
3041
|
+
textAlignment: import_zod31.z.enum(["left", "center", "right"]),
|
|
2950
3042
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
2951
|
-
textSize:
|
|
3043
|
+
textSize: import_zod31.z.enum(inlineTextSizeNames)
|
|
2952
3044
|
})
|
|
2953
3045
|
),
|
|
2954
|
-
|
|
3046
|
+
import_zod31.z.strictObject({}).transform(() => [])
|
|
2955
3047
|
]).optional(),
|
|
2956
|
-
imageLayout:
|
|
2957
|
-
language:
|
|
2958
|
-
description:
|
|
2959
|
-
superTitle:
|
|
2960
|
-
title:
|
|
3048
|
+
imageLayout: import_zod31.z.enum(["row", "column"]).optional(),
|
|
3049
|
+
language: import_zod31.z.object({
|
|
3050
|
+
description: import_zod31.z.string(),
|
|
3051
|
+
superTitle: import_zod31.z.string(),
|
|
3052
|
+
title: import_zod31.z.string()
|
|
2961
3053
|
}),
|
|
2962
|
-
previewMode:
|
|
2963
|
-
type:
|
|
2964
|
-
version:
|
|
3054
|
+
previewMode: import_zod31.z.boolean(),
|
|
3055
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
3056
|
+
version: import_zod31.z.literal(1)
|
|
2965
3057
|
});
|
|
2966
|
-
var ContentBlock =
|
|
3058
|
+
var ContentBlock = import_zod31.z.discriminatedUnion("version", [
|
|
2967
3059
|
ContentBlockV1,
|
|
2968
3060
|
CABRootSection.extend({
|
|
2969
|
-
type:
|
|
3061
|
+
type: import_zod31.z.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2970
3062
|
})
|
|
2971
3063
|
]);
|
|
2972
3064
|
|
|
2973
3065
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2974
|
-
var
|
|
2975
|
-
var GiftWithPurchase =
|
|
2976
|
-
type:
|
|
3066
|
+
var import_zod32 = require("zod");
|
|
3067
|
+
var GiftWithPurchase = import_zod32.z.looseObject({
|
|
3068
|
+
type: import_zod32.z.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
2977
3069
|
});
|
|
2978
3070
|
|
|
2979
3071
|
// src/schema/widgets/lineItemEditor.ts
|
|
2980
|
-
var
|
|
2981
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
2982
|
-
downgradeToOneTimeLabel:
|
|
3072
|
+
var import_zod33 = require("zod");
|
|
3073
|
+
var LineItemEditorSwitchLanguageV1 = import_zod33.z.object({
|
|
3074
|
+
downgradeToOneTimeLabel: import_zod33.z.string().optional(),
|
|
2983
3075
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
2984
|
-
subscriptionOptionLabel:
|
|
2985
|
-
upgradeToSubscriptionLabel:
|
|
2986
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
3076
|
+
subscriptionOptionLabel: import_zod33.z.string().optional(),
|
|
3077
|
+
upgradeToSubscriptionLabel: import_zod33.z.string().optional(),
|
|
3078
|
+
upgradeToSubscriptionWithoutDiscountLabel: import_zod33.z.string().optional()
|
|
2987
3079
|
});
|
|
2988
|
-
var LineItemEditorV1 =
|
|
3080
|
+
var LineItemEditorV1 = import_zod33.z.object({
|
|
2989
3081
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
2990
|
-
button:
|
|
2991
|
-
previewMode:
|
|
2992
|
-
switchToSubscription:
|
|
2993
|
-
disableDowngrade:
|
|
3082
|
+
button: import_zod33.z.object({ kind: import_zod33.z.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
3083
|
+
previewMode: import_zod33.z.boolean().optional(),
|
|
3084
|
+
switchToSubscription: import_zod33.z.object({
|
|
3085
|
+
disableDowngrade: import_zod33.z.boolean().optional(),
|
|
2994
3086
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
2995
3087
|
}).optional(),
|
|
2996
|
-
switchToSubscriptionEnabled:
|
|
2997
|
-
tracking:
|
|
2998
|
-
enableAttribution:
|
|
2999
|
-
enableSource:
|
|
3000
|
-
enableWidget:
|
|
3088
|
+
switchToSubscriptionEnabled: import_zod33.z.boolean().optional(),
|
|
3089
|
+
tracking: import_zod33.z.object({
|
|
3090
|
+
enableAttribution: import_zod33.z.boolean().optional(),
|
|
3091
|
+
enableSource: import_zod33.z.boolean().optional(),
|
|
3092
|
+
enableWidget: import_zod33.z.boolean().optional()
|
|
3001
3093
|
}).optional(),
|
|
3002
|
-
type:
|
|
3003
|
-
version:
|
|
3094
|
+
type: import_zod33.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
3095
|
+
version: import_zod33.z.literal(1)
|
|
3004
3096
|
});
|
|
3005
|
-
var LineItemEditor =
|
|
3097
|
+
var LineItemEditor = import_zod33.z.discriminatedUnion("version", [
|
|
3006
3098
|
LineItemEditorV1,
|
|
3007
3099
|
CABRootSection.extend({
|
|
3008
|
-
type:
|
|
3100
|
+
type: import_zod33.z.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
3009
3101
|
})
|
|
3010
3102
|
]);
|
|
3011
3103
|
|
|
3012
3104
|
// src/schema/widgets/progressBar.ts
|
|
3013
|
-
var
|
|
3014
|
-
var ProgressBar =
|
|
3015
|
-
type:
|
|
3105
|
+
var import_zod34 = require("zod");
|
|
3106
|
+
var ProgressBar = import_zod34.z.looseObject({
|
|
3107
|
+
type: import_zod34.z.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
3016
3108
|
});
|
|
3017
3109
|
|
|
3018
3110
|
// src/schema/widgets/rebuyButton.ts
|
|
3019
|
-
var
|
|
3020
|
-
var RebuyButtonV1 =
|
|
3021
|
-
type:
|
|
3022
|
-
version:
|
|
3111
|
+
var import_zod35 = require("zod");
|
|
3112
|
+
var RebuyButtonV1 = import_zod35.z.looseObject({
|
|
3113
|
+
type: import_zod35.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
3114
|
+
version: import_zod35.z.literal(1)
|
|
3023
3115
|
});
|
|
3024
|
-
var RebuyButton =
|
|
3116
|
+
var RebuyButton = import_zod35.z.discriminatedUnion("version", [
|
|
3025
3117
|
RebuyButtonV1,
|
|
3026
3118
|
CABRootSection.extend({
|
|
3027
|
-
type:
|
|
3119
|
+
type: import_zod35.z.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
3028
3120
|
})
|
|
3029
3121
|
]);
|
|
3030
3122
|
|
|
3031
3123
|
// src/schema/widgets/rebuyMonetize.ts
|
|
3032
|
-
var
|
|
3033
|
-
var RebuyMonetize =
|
|
3034
|
-
type:
|
|
3124
|
+
var import_zod36 = require("zod");
|
|
3125
|
+
var RebuyMonetize = import_zod36.z.looseObject({
|
|
3126
|
+
type: import_zod36.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
3035
3127
|
});
|
|
3036
|
-
var RebuyMonetizeV1 =
|
|
3037
|
-
name:
|
|
3038
|
-
previewMode:
|
|
3128
|
+
var RebuyMonetizeV1 = import_zod36.z.object({
|
|
3129
|
+
name: import_zod36.z.string().nullable().optional(),
|
|
3130
|
+
previewMode: import_zod36.z.boolean().optional(),
|
|
3039
3131
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
3040
|
-
privacyPolicyUrl:
|
|
3132
|
+
privacyPolicyUrl: import_zod36.z.string().nullable().optional(),
|
|
3041
3133
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
3042
|
-
subVertical:
|
|
3043
|
-
tracking:
|
|
3044
|
-
enableAttribution:
|
|
3045
|
-
enableSource:
|
|
3046
|
-
enableWidget:
|
|
3134
|
+
subVertical: import_zod36.z.string().nullable().optional(),
|
|
3135
|
+
tracking: import_zod36.z.object({
|
|
3136
|
+
enableAttribution: import_zod36.z.boolean().optional(),
|
|
3137
|
+
enableSource: import_zod36.z.boolean().optional(),
|
|
3138
|
+
enableWidget: import_zod36.z.boolean().optional()
|
|
3047
3139
|
}).optional(),
|
|
3048
|
-
type:
|
|
3049
|
-
version:
|
|
3140
|
+
type: import_zod36.z.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
3141
|
+
version: import_zod36.z.literal(1),
|
|
3050
3142
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
3051
|
-
vertical:
|
|
3143
|
+
vertical: import_zod36.z.string().nullable().optional()
|
|
3052
3144
|
});
|
|
3053
3145
|
|
|
3054
3146
|
// src/schema/widgetData.ts
|
|
@@ -3062,7 +3154,7 @@ var extensionWidgetTypes = [
|
|
|
3062
3154
|
WidgetType.ui_extension_line_item_editor,
|
|
3063
3155
|
WidgetType.ui_extension_progress_bar
|
|
3064
3156
|
];
|
|
3065
|
-
var WidgetData =
|
|
3157
|
+
var WidgetData = import_zod37.z.discriminatedUnion("type", [
|
|
3066
3158
|
ABTestingPlaceholder,
|
|
3067
3159
|
CheckoutExtension,
|
|
3068
3160
|
ContentBlock,
|
|
@@ -3391,15 +3483,15 @@ var SWITCH_LABELS = {
|
|
|
3391
3483
|
|
|
3392
3484
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3393
3485
|
var import_compat4 = require("es-toolkit/compat");
|
|
3394
|
-
var
|
|
3395
|
-
var strictNumber =
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3486
|
+
var import_zod38 = require("zod");
|
|
3487
|
+
var strictNumber = import_zod38.z.union([
|
|
3488
|
+
import_zod38.z.number(),
|
|
3489
|
+
import_zod38.z.string().transform((value) => (0, import_compat4.toNumber)((0, import_compat4.replace)((0, import_compat4.toString)(value), /[^0-9.]/g, "")) || 0),
|
|
3490
|
+
import_zod38.z.unknown().transform(() => 0)
|
|
3399
3491
|
]);
|
|
3400
3492
|
|
|
3401
3493
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3402
|
-
var
|
|
3494
|
+
var import_zod39 = require("zod");
|
|
3403
3495
|
var blockTypes = [
|
|
3404
3496
|
"callout_banner",
|
|
3405
3497
|
"image",
|
|
@@ -3410,144 +3502,144 @@ var blockTypes = [
|
|
|
3410
3502
|
"text",
|
|
3411
3503
|
"timer"
|
|
3412
3504
|
];
|
|
3413
|
-
var blockType =
|
|
3505
|
+
var blockType = import_zod39.z.enum(blockTypes);
|
|
3414
3506
|
var BlockType = blockType.enum;
|
|
3415
3507
|
|
|
3416
3508
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3417
3509
|
var import_compat5 = require("es-toolkit/compat");
|
|
3418
3510
|
var import_uuid14 = require("uuid");
|
|
3419
|
-
var
|
|
3420
|
-
var TextAlignment2 =
|
|
3421
|
-
var TextSize =
|
|
3422
|
-
|
|
3423
|
-
|
|
3511
|
+
var import_zod40 = require("zod");
|
|
3512
|
+
var TextAlignment2 = import_zod40.z.union([import_zod40.z.enum(["leading", "center", "trailing"]), import_zod40.z.unknown().transform(() => "leading")]);
|
|
3513
|
+
var TextSize = import_zod40.z.union([
|
|
3514
|
+
import_zod40.z.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3515
|
+
import_zod40.z.unknown().transform(() => "medium")
|
|
3424
3516
|
]);
|
|
3425
|
-
var CalloutBannerBlock =
|
|
3426
|
-
id:
|
|
3427
|
-
name:
|
|
3428
|
-
settings:
|
|
3429
|
-
superTitle:
|
|
3430
|
-
title:
|
|
3517
|
+
var CalloutBannerBlock = import_zod40.z.object({
|
|
3518
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3519
|
+
name: import_zod40.z.string().optional(),
|
|
3520
|
+
settings: import_zod40.z.object({
|
|
3521
|
+
superTitle: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3522
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3431
3523
|
}),
|
|
3432
|
-
styles:
|
|
3433
|
-
superTitleEmphasized:
|
|
3524
|
+
styles: import_zod40.z.object({
|
|
3525
|
+
superTitleEmphasized: import_zod40.z.boolean().default(false),
|
|
3434
3526
|
superTitleSize: TextSize.default("large"),
|
|
3435
3527
|
textAlignment: TextAlignment2.default("center"),
|
|
3436
|
-
titleEmphasized:
|
|
3528
|
+
titleEmphasized: import_zod40.z.boolean().default(true),
|
|
3437
3529
|
titleSize: TextSize.default("large")
|
|
3438
3530
|
}),
|
|
3439
|
-
type:
|
|
3531
|
+
type: import_zod40.z.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3440
3532
|
});
|
|
3441
|
-
var ImageBlock =
|
|
3442
|
-
id:
|
|
3443
|
-
name:
|
|
3444
|
-
settings:
|
|
3445
|
-
|
|
3533
|
+
var ImageBlock = import_zod40.z.object({
|
|
3534
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3535
|
+
name: import_zod40.z.string().optional(),
|
|
3536
|
+
settings: import_zod40.z.union([
|
|
3537
|
+
import_zod40.z.object({
|
|
3446
3538
|
/** This isn't used in the post-purchase offer widget */
|
|
3447
|
-
alt:
|
|
3448
|
-
image:
|
|
3449
|
-
imageSize:
|
|
3450
|
-
imageType:
|
|
3539
|
+
alt: import_zod40.z.string().optional().default(""),
|
|
3540
|
+
image: import_zod40.z.union([import_zod40.z.literal(""), import_zod40.z.url()]).default(""),
|
|
3541
|
+
imageSize: import_zod40.z.number().default(20),
|
|
3542
|
+
imageType: import_zod40.z.enum(["URL", "UPLOAD"]).default("URL")
|
|
3451
3543
|
}),
|
|
3452
|
-
|
|
3544
|
+
import_zod40.z.array(import_zod40.z.never()).transform(() => ({}))
|
|
3453
3545
|
]),
|
|
3454
|
-
type:
|
|
3546
|
+
type: import_zod40.z.literal(BlockType.image).default(BlockType.image)
|
|
3455
3547
|
});
|
|
3456
|
-
var ImageContentBlock =
|
|
3457
|
-
id:
|
|
3458
|
-
name:
|
|
3459
|
-
settings:
|
|
3460
|
-
alt:
|
|
3461
|
-
description:
|
|
3548
|
+
var ImageContentBlock = import_zod40.z.object({
|
|
3549
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3550
|
+
name: import_zod40.z.string().optional(),
|
|
3551
|
+
settings: import_zod40.z.object({
|
|
3552
|
+
alt: import_zod40.z.string().optional().default(""),
|
|
3553
|
+
description: import_zod40.z.union([import_zod40.z.string(), TiptapDocument, import_zod40.z.null()]).default(
|
|
3462
3554
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
3463
3555
|
),
|
|
3464
3556
|
descriptionSize: TextSize.default("medium"),
|
|
3465
3557
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3466
|
-
image:
|
|
3467
|
-
imagePlacement:
|
|
3468
|
-
imageSize:
|
|
3469
|
-
superTitle:
|
|
3558
|
+
image: import_zod40.z.union([import_zod40.z.literal(""), import_zod40.z.url()]).default(""),
|
|
3559
|
+
imagePlacement: import_zod40.z.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3560
|
+
imageSize: import_zod40.z.number().default(20),
|
|
3561
|
+
superTitle: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3470
3562
|
superTitleSize: TextSize.default("medium"),
|
|
3471
3563
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3472
|
-
swapContent:
|
|
3473
|
-
title:
|
|
3564
|
+
swapContent: import_zod40.z.boolean().optional().default(false),
|
|
3565
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3474
3566
|
titleSize: TextSize.default("medium")
|
|
3475
3567
|
}),
|
|
3476
|
-
type:
|
|
3568
|
+
type: import_zod40.z.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3477
3569
|
});
|
|
3478
|
-
var PayButtonBlock =
|
|
3479
|
-
id:
|
|
3480
|
-
name:
|
|
3481
|
-
settings:
|
|
3482
|
-
|
|
3483
|
-
label:
|
|
3570
|
+
var PayButtonBlock = import_zod40.z.object({
|
|
3571
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3572
|
+
name: import_zod40.z.string().optional(),
|
|
3573
|
+
settings: import_zod40.z.union([
|
|
3574
|
+
import_zod40.z.object({
|
|
3575
|
+
label: import_zod40.z.string().default("Pay Now")
|
|
3484
3576
|
}),
|
|
3485
|
-
|
|
3577
|
+
import_zod40.z.array(import_zod40.z.never()).transform(() => ({
|
|
3486
3578
|
label: "Pay Now"
|
|
3487
3579
|
}))
|
|
3488
3580
|
]),
|
|
3489
|
-
styles:
|
|
3490
|
-
|
|
3491
|
-
buttonWidth:
|
|
3581
|
+
styles: import_zod40.z.union([
|
|
3582
|
+
import_zod40.z.object({
|
|
3583
|
+
buttonWidth: import_zod40.z.number().min(10).max(100).default(50)
|
|
3492
3584
|
}),
|
|
3493
|
-
|
|
3585
|
+
import_zod40.z.array(import_zod40.z.never()).transform(() => ({
|
|
3494
3586
|
buttonWidth: 50
|
|
3495
3587
|
}))
|
|
3496
3588
|
]),
|
|
3497
|
-
type:
|
|
3589
|
+
type: import_zod40.z.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3498
3590
|
});
|
|
3499
|
-
var ProductInformationBlock =
|
|
3591
|
+
var ProductInformationBlock = import_zod40.z.object({
|
|
3500
3592
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3501
|
-
hideProductImage:
|
|
3502
|
-
id:
|
|
3503
|
-
name:
|
|
3504
|
-
type:
|
|
3593
|
+
hideProductImage: import_zod40.z.boolean().optional().default(false),
|
|
3594
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3595
|
+
name: import_zod40.z.string().optional(),
|
|
3596
|
+
type: import_zod40.z.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3505
3597
|
});
|
|
3506
|
-
var SeparatorBlock =
|
|
3507
|
-
id:
|
|
3508
|
-
name:
|
|
3509
|
-
type:
|
|
3598
|
+
var SeparatorBlock = import_zod40.z.object({
|
|
3599
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3600
|
+
name: import_zod40.z.string().optional(),
|
|
3601
|
+
type: import_zod40.z.literal(BlockType.separator).default(BlockType.separator)
|
|
3510
3602
|
});
|
|
3511
|
-
var TextBlock =
|
|
3512
|
-
id:
|
|
3513
|
-
name:
|
|
3514
|
-
settings:
|
|
3515
|
-
description:
|
|
3603
|
+
var TextBlock = import_zod40.z.object({
|
|
3604
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3605
|
+
name: import_zod40.z.string().optional(),
|
|
3606
|
+
settings: import_zod40.z.object({
|
|
3607
|
+
description: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).optional().default(
|
|
3516
3608
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."
|
|
3517
3609
|
),
|
|
3518
3610
|
/** This isn't used in the post-purchase offer widget */
|
|
3519
3611
|
descriptionSize: TextSize.default("medium"),
|
|
3520
3612
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3521
|
-
superTitle:
|
|
3613
|
+
superTitle: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default("Super Title"),
|
|
3522
3614
|
/** This isn't used in the post-purchase offer widget */
|
|
3523
3615
|
superTitleSize: TextSize.default("medium"),
|
|
3524
|
-
title:
|
|
3616
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3525
3617
|
/** This isn't used in the post-purchase offer widget */
|
|
3526
3618
|
titleSize: TextSize.default("medium")
|
|
3527
3619
|
}),
|
|
3528
|
-
type:
|
|
3620
|
+
type: import_zod40.z.literal(BlockType.text).default(BlockType.text)
|
|
3529
3621
|
});
|
|
3530
|
-
var TimerBlock =
|
|
3531
|
-
id:
|
|
3532
|
-
name:
|
|
3533
|
-
settings:
|
|
3534
|
-
durationMinutes:
|
|
3535
|
-
durationSeconds:
|
|
3536
|
-
endOffer:
|
|
3537
|
-
title:
|
|
3622
|
+
var TimerBlock = import_zod40.z.object({
|
|
3623
|
+
id: import_zod40.z.string().optional().default(() => (0, import_uuid14.v4)()),
|
|
3624
|
+
name: import_zod40.z.string().optional(),
|
|
3625
|
+
settings: import_zod40.z.object({
|
|
3626
|
+
durationMinutes: import_zod40.z.number().min(0).default(10),
|
|
3627
|
+
durationSeconds: import_zod40.z.union([import_zod40.z.number().min(0), import_zod40.z.unknown().transform(() => 0)]).default(0),
|
|
3628
|
+
endOffer: import_zod40.z.boolean().default(true),
|
|
3629
|
+
title: import_zod40.z.union([import_zod40.z.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3538
3630
|
}),
|
|
3539
|
-
styles:
|
|
3631
|
+
styles: import_zod40.z.object({
|
|
3540
3632
|
textAlignment: TextAlignment2.default("center"),
|
|
3541
|
-
timerBackgroundColor:
|
|
3542
|
-
timerEmphasized:
|
|
3633
|
+
timerBackgroundColor: import_zod40.z.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
3634
|
+
timerEmphasized: import_zod40.z.union([import_zod40.z.boolean(), import_zod40.z.unknown().transform(() => true)]).default(true),
|
|
3543
3635
|
timerSize: TextSize.default("medium"),
|
|
3544
|
-
timerWidth:
|
|
3545
|
-
titleEmphasized:
|
|
3636
|
+
timerWidth: import_zod40.z.number().min(10).max(100).optional().default(100),
|
|
3637
|
+
titleEmphasized: import_zod40.z.union([import_zod40.z.boolean(), import_zod40.z.unknown().transform(() => true)]).default(false),
|
|
3546
3638
|
titleSize: TextSize.default("medium")
|
|
3547
3639
|
}),
|
|
3548
|
-
type:
|
|
3640
|
+
type: import_zod40.z.literal(BlockType.timer).default(BlockType.timer)
|
|
3549
3641
|
});
|
|
3550
|
-
var PostPurchaseBlock =
|
|
3642
|
+
var PostPurchaseBlock = import_zod40.z.discriminatedUnion("type", [
|
|
3551
3643
|
CalloutBannerBlock,
|
|
3552
3644
|
ImageBlock,
|
|
3553
3645
|
ImageContentBlock,
|
|
@@ -3567,68 +3659,68 @@ var isTextBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)
|
|
|
3567
3659
|
var isTimerBlock = (block) => (0, import_compat5.isEqual)((0, import_compat5.get)(block, "type"), BlockType.timer);
|
|
3568
3660
|
|
|
3569
3661
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3570
|
-
var
|
|
3662
|
+
var import_zod43 = require("zod");
|
|
3571
3663
|
|
|
3572
3664
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3573
|
-
var
|
|
3665
|
+
var import_zod42 = require("zod");
|
|
3574
3666
|
|
|
3575
3667
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3576
|
-
var
|
|
3577
|
-
var PostPurchaseSettings =
|
|
3578
|
-
advance:
|
|
3579
|
-
blocks:
|
|
3668
|
+
var import_zod41 = require("zod");
|
|
3669
|
+
var PostPurchaseSettings = import_zod41.z.object({
|
|
3670
|
+
advance: import_zod41.z.object({ removePartialOrder: import_zod41.z.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
3671
|
+
blocks: import_zod41.z.union([import_zod41.z.array(PostPurchaseBlock), import_zod41.z.unknown().transform(() => [])]).default(() => [
|
|
3580
3672
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3581
3673
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3582
3674
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3583
3675
|
]),
|
|
3584
|
-
columnLayout:
|
|
3585
|
-
discount:
|
|
3676
|
+
columnLayout: import_zod41.z.boolean().optional(),
|
|
3677
|
+
discount: import_zod41.z.object({
|
|
3586
3678
|
amount: strictNumber.default(30),
|
|
3587
|
-
shouldShowSavingText:
|
|
3588
|
-
type:
|
|
3679
|
+
shouldShowSavingText: import_zod41.z.boolean().optional().default(true),
|
|
3680
|
+
type: import_zod41.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3589
3681
|
}),
|
|
3590
|
-
discountedFrom:
|
|
3591
|
-
endpoint:
|
|
3592
|
-
integrations:
|
|
3593
|
-
judgeme:
|
|
3594
|
-
junip:
|
|
3595
|
-
klaviyo:
|
|
3596
|
-
loox:
|
|
3597
|
-
okendo:
|
|
3598
|
-
opinew:
|
|
3599
|
-
reviewsio:
|
|
3600
|
-
stamped:
|
|
3601
|
-
yotpo:
|
|
3682
|
+
discountedFrom: import_zod41.z.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
3683
|
+
endpoint: import_zod41.z.string().optional(),
|
|
3684
|
+
integrations: import_zod41.z.object({
|
|
3685
|
+
judgeme: import_zod41.z.boolean().default(false),
|
|
3686
|
+
junip: import_zod41.z.boolean().optional().default(false),
|
|
3687
|
+
klaviyo: import_zod41.z.boolean().default(false),
|
|
3688
|
+
loox: import_zod41.z.boolean().default(false),
|
|
3689
|
+
okendo: import_zod41.z.boolean().default(false),
|
|
3690
|
+
opinew: import_zod41.z.boolean().optional().default(false),
|
|
3691
|
+
reviewsio: import_zod41.z.boolean().optional().default(false),
|
|
3692
|
+
stamped: import_zod41.z.boolean().default(false),
|
|
3693
|
+
yotpo: import_zod41.z.boolean().default(false)
|
|
3602
3694
|
}),
|
|
3603
|
-
key:
|
|
3604
|
-
language:
|
|
3605
|
-
description:
|
|
3606
|
-
descriptionEnabled:
|
|
3607
|
-
descriptionRte:
|
|
3608
|
-
content:
|
|
3609
|
-
type:
|
|
3695
|
+
key: import_zod41.z.string().optional(),
|
|
3696
|
+
language: import_zod41.z.object({
|
|
3697
|
+
description: import_zod41.z.union([import_zod41.z.string(), import_zod41.z.unknown().transform(() => "")]).default(""),
|
|
3698
|
+
descriptionEnabled: import_zod41.z.boolean().optional().default(false),
|
|
3699
|
+
descriptionRte: import_zod41.z.object({
|
|
3700
|
+
content: import_zod41.z.array(import_zod41.z.unknown()),
|
|
3701
|
+
type: import_zod41.z.string()
|
|
3610
3702
|
}).optional(),
|
|
3611
|
-
descriptionSpacing:
|
|
3612
|
-
displayCtaPrice:
|
|
3613
|
-
global:
|
|
3614
|
-
declineAll:
|
|
3615
|
-
declineThisOffer:
|
|
3616
|
-
free:
|
|
3617
|
-
notAvailable:
|
|
3618
|
-
payNow:
|
|
3619
|
-
payNowUpgradeToSubscription:
|
|
3620
|
-
quantity:
|
|
3703
|
+
descriptionSpacing: import_zod41.z.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
3704
|
+
displayCtaPrice: import_zod41.z.boolean().default(true),
|
|
3705
|
+
global: import_zod41.z.object({
|
|
3706
|
+
declineAll: import_zod41.z.string().optional().default("Decline All"),
|
|
3707
|
+
declineThisOffer: import_zod41.z.string().default("Decline this offer"),
|
|
3708
|
+
free: import_zod41.z.string().optional().default("Free"),
|
|
3709
|
+
notAvailable: import_zod41.z.string().optional().default("Not available"),
|
|
3710
|
+
payNow: import_zod41.z.string().default("Pay Now"),
|
|
3711
|
+
payNowUpgradeToSubscription: import_zod41.z.string().optional().default("Upgrade to Subscription"),
|
|
3712
|
+
quantity: import_zod41.z.string().default("Quantity"),
|
|
3621
3713
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3622
|
-
recurringShipping:
|
|
3623
|
-
recurringSubtotal:
|
|
3624
|
-
reviewsPlural:
|
|
3625
|
-
reviewsSingular:
|
|
3626
|
-
save:
|
|
3627
|
-
shipping:
|
|
3628
|
-
subscriptionOption:
|
|
3629
|
-
subtotal:
|
|
3630
|
-
taxes:
|
|
3631
|
-
total:
|
|
3714
|
+
recurringShipping: import_zod41.z.string().optional().default("Recurring shipping"),
|
|
3715
|
+
recurringSubtotal: import_zod41.z.string().default("Recurring subtotal"),
|
|
3716
|
+
reviewsPlural: import_zod41.z.string().optional().default("Reviews"),
|
|
3717
|
+
reviewsSingular: import_zod41.z.string().optional().default("Review"),
|
|
3718
|
+
save: import_zod41.z.union([import_zod41.z.string(), import_zod41.z.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
3719
|
+
shipping: import_zod41.z.string().default("Shipping"),
|
|
3720
|
+
subscriptionOption: import_zod41.z.string().optional().default("Subscribe and Save"),
|
|
3721
|
+
subtotal: import_zod41.z.string().default("Subtotal"),
|
|
3722
|
+
taxes: import_zod41.z.string().default("Taxes"),
|
|
3723
|
+
total: import_zod41.z.string().default("Total")
|
|
3632
3724
|
}).optional().default(() => ({
|
|
3633
3725
|
declineAll: "Decline All",
|
|
3634
3726
|
declineThisOffer: "Decline this offer",
|
|
@@ -3649,70 +3741,70 @@ var PostPurchaseSettings = import_zod40.z.object({
|
|
|
3649
3741
|
taxes: "Taxes",
|
|
3650
3742
|
total: "Total"
|
|
3651
3743
|
})),
|
|
3652
|
-
globalTranslation:
|
|
3744
|
+
globalTranslation: import_zod41.z.string().optional().default("english")
|
|
3653
3745
|
}),
|
|
3654
|
-
metafields:
|
|
3746
|
+
metafields: import_zod41.z.boolean().default(false),
|
|
3655
3747
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3656
|
-
offer:
|
|
3657
|
-
count:
|
|
3748
|
+
offer: import_zod41.z.object({
|
|
3749
|
+
count: import_zod41.z.number().default(1)
|
|
3658
3750
|
}),
|
|
3659
|
-
offersLayout:
|
|
3660
|
-
itemsPerPage:
|
|
3661
|
-
type:
|
|
3751
|
+
offersLayout: import_zod41.z.object({
|
|
3752
|
+
itemsPerPage: import_zod41.z.number().optional(),
|
|
3753
|
+
type: import_zod41.z.enum(["list", "grid", "carousel"]).default("list")
|
|
3662
3754
|
}).optional().default({
|
|
3663
3755
|
type: "list"
|
|
3664
3756
|
}),
|
|
3665
3757
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3666
|
-
previewMode:
|
|
3667
|
-
productLimit:
|
|
3668
|
-
productOptions:
|
|
3758
|
+
previewMode: import_zod41.z.boolean().default(false),
|
|
3759
|
+
productLimit: import_zod41.z.number().optional().default(1),
|
|
3760
|
+
productOptions: import_zod41.z.object({
|
|
3669
3761
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3670
|
-
hideOutOfStockVariants:
|
|
3671
|
-
matchVariant:
|
|
3672
|
-
showDeclineAll:
|
|
3673
|
-
showShipping:
|
|
3674
|
-
showSubtotal:
|
|
3675
|
-
showTaxes:
|
|
3676
|
-
showTotal:
|
|
3677
|
-
showVariantSelectors:
|
|
3678
|
-
variantSelectorDisplayMode:
|
|
3762
|
+
hideOutOfStockVariants: import_zod41.z.boolean().optional().default(false),
|
|
3763
|
+
matchVariant: import_zod41.z.boolean().optional().default(true),
|
|
3764
|
+
showDeclineAll: import_zod41.z.enum(["above", "below", "both", "none"]).optional(),
|
|
3765
|
+
showShipping: import_zod41.z.boolean().optional().default(true),
|
|
3766
|
+
showSubtotal: import_zod41.z.boolean().optional().default(true),
|
|
3767
|
+
showTaxes: import_zod41.z.boolean().optional().default(true),
|
|
3768
|
+
showTotal: import_zod41.z.boolean().optional().default(true),
|
|
3769
|
+
showVariantSelectors: import_zod41.z.boolean().optional().default(true),
|
|
3770
|
+
variantSelectorDisplayMode: import_zod41.z.enum(["separate", "single"]).optional().default("separate")
|
|
3679
3771
|
}),
|
|
3680
|
-
productType:
|
|
3681
|
-
productTypeSelector:
|
|
3682
|
-
quantityInputs:
|
|
3683
|
-
defaultQuantity:
|
|
3684
|
-
enabled:
|
|
3685
|
-
maxValue:
|
|
3686
|
-
minValue:
|
|
3772
|
+
productType: import_zod41.z.union([import_zod41.z.enum(["one-time", "subscription", "both"]), import_zod41.z.literal("").transform(() => "one-time")]).default("one-time"),
|
|
3773
|
+
productTypeSelector: import_zod41.z.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
3774
|
+
quantityInputs: import_zod41.z.object({
|
|
3775
|
+
defaultQuantity: import_zod41.z.union([import_zod41.z.number(), import_zod41.z.null().transform(() => 1)]).default(1),
|
|
3776
|
+
enabled: import_zod41.z.boolean().default(true),
|
|
3777
|
+
maxValue: import_zod41.z.union([import_zod41.z.number(), import_zod41.z.null().transform(() => 15)]).default(15),
|
|
3778
|
+
minValue: import_zod41.z.union([import_zod41.z.number().min(0), import_zod41.z.unknown().transform(() => 0)]).default(1)
|
|
3687
3779
|
}),
|
|
3688
|
-
shipping:
|
|
3780
|
+
shipping: import_zod41.z.object({
|
|
3689
3781
|
amount: strictNumber.default(10),
|
|
3690
3782
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3691
|
-
enabled:
|
|
3692
|
-
title:
|
|
3693
|
-
type:
|
|
3783
|
+
enabled: import_zod41.z.boolean().default(true),
|
|
3784
|
+
title: import_zod41.z.string().optional().default("Shipping Fees"),
|
|
3785
|
+
type: import_zod41.z.enum(["free", "fixed_amount"]).default("free")
|
|
3694
3786
|
}),
|
|
3695
|
-
styles:
|
|
3696
|
-
starColor:
|
|
3697
|
-
starSize:
|
|
3698
|
-
starStrokeColor:
|
|
3699
|
-
strokeWidth:
|
|
3787
|
+
styles: import_zod41.z.object({
|
|
3788
|
+
starColor: import_zod41.z.string().optional().default("#fadb14"),
|
|
3789
|
+
starSize: import_zod41.z.union([import_zod41.z.enum(["small", "medium", "large"]), import_zod41.z.unknown().transform(() => "large")]).optional().default("large"),
|
|
3790
|
+
starStrokeColor: import_zod41.z.string().optional().default("#fadb14"),
|
|
3791
|
+
strokeWidth: import_zod41.z.string().optional().default("1")
|
|
3700
3792
|
}).optional(),
|
|
3701
|
-
subImages:
|
|
3702
|
-
subscription:
|
|
3703
|
-
discount:
|
|
3793
|
+
subImages: import_zod41.z.number().nullish().default(8),
|
|
3794
|
+
subscription: import_zod41.z.object({
|
|
3795
|
+
discount: import_zod41.z.object({
|
|
3704
3796
|
amount: strictNumber.default(30),
|
|
3705
|
-
shouldShowSavingText:
|
|
3706
|
-
type:
|
|
3797
|
+
shouldShowSavingText: import_zod41.z.boolean().optional().default(true),
|
|
3798
|
+
type: import_zod41.z.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3707
3799
|
}),
|
|
3708
|
-
shipping:
|
|
3800
|
+
shipping: import_zod41.z.object({
|
|
3709
3801
|
amount: strictNumber.default(1),
|
|
3710
3802
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3711
|
-
enabled:
|
|
3803
|
+
enabled: import_zod41.z.boolean().default(true),
|
|
3712
3804
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3713
3805
|
recurringAmount: strictNumber.default(2),
|
|
3714
|
-
shippingTitle:
|
|
3715
|
-
type:
|
|
3806
|
+
shippingTitle: import_zod41.z.string().default("Shipping Fees"),
|
|
3807
|
+
type: import_zod41.z.enum(["free", "fixed_amount"]).default("free")
|
|
3716
3808
|
})
|
|
3717
3809
|
}).optional().default({
|
|
3718
3810
|
discount: {
|
|
@@ -3730,15 +3822,15 @@ var PostPurchaseSettings = import_zod40.z.object({
|
|
|
3730
3822
|
type: "free"
|
|
3731
3823
|
}
|
|
3732
3824
|
}),
|
|
3733
|
-
subscriptionIsDefault:
|
|
3825
|
+
subscriptionIsDefault: import_zod41.z.boolean().optional(),
|
|
3734
3826
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3735
|
-
template:
|
|
3736
|
-
type:
|
|
3737
|
-
upgradeToSubscription:
|
|
3738
|
-
acceptButtonText:
|
|
3739
|
-
allow:
|
|
3740
|
-
emailRefundNotice:
|
|
3741
|
-
errorBannerText:
|
|
3827
|
+
template: import_zod41.z.string().optional().default(""),
|
|
3828
|
+
type: import_zod41.z.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
3829
|
+
upgradeToSubscription: import_zod41.z.object({
|
|
3830
|
+
acceptButtonText: import_zod41.z.string().optional().default("Upgrade"),
|
|
3831
|
+
allow: import_zod41.z.boolean().optional().default(false),
|
|
3832
|
+
emailRefundNotice: import_zod41.z.boolean().optional().default(false),
|
|
3833
|
+
errorBannerText: import_zod41.z.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3742
3834
|
}).optional().default(() => ({
|
|
3743
3835
|
acceptButtonText: "Upgrade",
|
|
3744
3836
|
allow: false,
|
|
@@ -3748,32 +3840,32 @@ var PostPurchaseSettings = import_zod40.z.object({
|
|
|
3748
3840
|
});
|
|
3749
3841
|
|
|
3750
3842
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3751
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3752
|
-
id:
|
|
3753
|
-
name:
|
|
3843
|
+
var PostPurchaseWidgetLinkedFlow = import_zod42.z.object({
|
|
3844
|
+
id: import_zod42.z.number(),
|
|
3845
|
+
name: import_zod42.z.string()
|
|
3754
3846
|
});
|
|
3755
|
-
var PostPurchaseWidget =
|
|
3756
|
-
classification:
|
|
3757
|
-
createdAtTime:
|
|
3758
|
-
customEndpointName:
|
|
3759
|
-
id:
|
|
3760
|
-
lastViewed:
|
|
3761
|
-
linkedCustomEndpointId:
|
|
3762
|
-
linkedFlows:
|
|
3763
|
-
name:
|
|
3764
|
-
owner:
|
|
3847
|
+
var PostPurchaseWidget = import_zod42.z.object({
|
|
3848
|
+
classification: import_zod42.z.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
3849
|
+
createdAtTime: import_zod42.z.iso.datetime({ offset: true }).optional(),
|
|
3850
|
+
customEndpointName: import_zod42.z.string().nullish(),
|
|
3851
|
+
id: import_zod42.z.number().default(0),
|
|
3852
|
+
lastViewed: import_zod42.z.iso.datetime({ offset: true }).nullish(),
|
|
3853
|
+
linkedCustomEndpointId: import_zod42.z.number().nullish(),
|
|
3854
|
+
linkedFlows: import_zod42.z.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
3855
|
+
name: import_zod42.z.string().default(""),
|
|
3856
|
+
owner: import_zod42.z.number().nullish(),
|
|
3765
3857
|
settings: PostPurchaseSettings
|
|
3766
3858
|
});
|
|
3767
3859
|
|
|
3768
3860
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3769
|
-
var PostPurchaseOffer =
|
|
3770
|
-
|
|
3771
|
-
errors:
|
|
3772
|
-
message:
|
|
3773
|
-
successful:
|
|
3861
|
+
var PostPurchaseOffer = import_zod43.z.discriminatedUnion("successful", [
|
|
3862
|
+
import_zod43.z.strictObject({
|
|
3863
|
+
errors: import_zod43.z.array(import_zod43.z.object({ message: import_zod43.z.string() })),
|
|
3864
|
+
message: import_zod43.z.string(),
|
|
3865
|
+
successful: import_zod43.z.literal(false)
|
|
3774
3866
|
}),
|
|
3775
|
-
|
|
3776
|
-
successful:
|
|
3867
|
+
import_zod43.z.strictObject({
|
|
3868
|
+
successful: import_zod43.z.literal(true),
|
|
3777
3869
|
widget: PostPurchaseWidget
|
|
3778
3870
|
})
|
|
3779
3871
|
]);
|
|
@@ -4686,6 +4778,7 @@ var convertOfferToV2 = ({ id, name, settings }) => {
|
|
|
4686
4778
|
sectionType: "carousel"
|
|
4687
4779
|
};
|
|
4688
4780
|
return CABRootSection.parse({
|
|
4781
|
+
alignment: { horizontal: "center", vertical: "top" },
|
|
4689
4782
|
direction: "rows",
|
|
4690
4783
|
editorMode: LOCATION_TO_EDITOR_MODE[settings.location ?? "checkout"],
|
|
4691
4784
|
// The widget name is required by the admin save schema; carry the legacy widget's name through.
|