@rebuy/rebuy 3.5.1 → 3.7.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 +762 -648
- package/dist/index.mjs +762 -648
- 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/metadata.d.ts +3 -1
- 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 +514 -417
- package/dist/server/index.mjs +514 -417
- package/dist/transforms/index.cjs +392 -317
- package/dist/transforms/index.mjs +392 -317
- package/dist/transforms/monetizeV1/convertMonetizeToV2.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1128,7 +1128,29 @@ var Metadata = z4.object({
|
|
|
1128
1128
|
unmatchedRules: z4.array(MatchedRule).optional(),
|
|
1129
1129
|
widget: z4.object({
|
|
1130
1130
|
discount: z4.object({ amount: z4.string(), type: z4.string() }).optional(),
|
|
1131
|
-
|
|
1131
|
+
/**
|
|
1132
|
+
* Data-source-authored text content, dual-purpose in the CAB renderer (rebuy-shopify-extensions'
|
|
1133
|
+
* `checkout-and-beyond`): every key becomes a `{{token}}` for the interpolation pass
|
|
1134
|
+
* (`extractDataVariables`), e.g. `{ superTitle: 'Limited drop' }` resolves `{{superTitle}}`
|
|
1135
|
+
* anywhere in the widget's copy, and the legacy add-to-order state keys (`extractLabelOverrides`)
|
|
1136
|
+
* plus `variantOption`/`variantOptions` (`extractVariantLabels`) additionally keep their
|
|
1137
|
+
* whole-label override behavior. The serve path passes metadata through verbatim
|
|
1138
|
+
* (`fetchDataSourceResults` only camelCases keys, which lands snake_case names in the canonical
|
|
1139
|
+
* token grammar); this schema is the contract of record. Parsing mirrors the renderer's
|
|
1140
|
+
* fail-safe: an entry whose value is not a string or finite number — a data-source author's
|
|
1141
|
+
* `null`, boolean, object, or a computed `NaN`/`Infinity` — is dropped at parse time rather
|
|
1142
|
+
* than failing the whole `Metadata` block or rendering `[object Object]` (or a literal `NaN`)
|
|
1143
|
+
* into buyer copy. Booleans stay excluded on purpose (unlike
|
|
1144
|
+
* `Output.value` above, this is buyer-facing copy); an empty string is kept — it deliberately
|
|
1145
|
+
* blanks a token.
|
|
1146
|
+
*/
|
|
1147
|
+
language: z4.record(z4.string(), z4.unknown()).transform(
|
|
1148
|
+
(raw) => Object.fromEntries(
|
|
1149
|
+
Object.entries(raw).filter(
|
|
1150
|
+
(entry) => typeof entry[1] === "string" || Number.isFinite(entry[1])
|
|
1151
|
+
)
|
|
1152
|
+
)
|
|
1153
|
+
).optional()
|
|
1132
1154
|
}).optional()
|
|
1133
1155
|
});
|
|
1134
1156
|
|
|
@@ -1272,7 +1294,7 @@ var UserConfig = z7.object({
|
|
|
1272
1294
|
});
|
|
1273
1295
|
|
|
1274
1296
|
// src/schema/widgetData.ts
|
|
1275
|
-
import { z as
|
|
1297
|
+
import { z as z37 } from "zod";
|
|
1276
1298
|
|
|
1277
1299
|
// src/schema/widgets/abTestingPlaceholder.ts
|
|
1278
1300
|
import { z as z8 } from "zod";
|
|
@@ -1388,6 +1410,8 @@ var languageKeys = [
|
|
|
1388
1410
|
"zh"
|
|
1389
1411
|
];
|
|
1390
1412
|
var LanguageKey = freezeEnum(languageKeys);
|
|
1413
|
+
var mutatorEvents = ["item_added", "quantity_changed", "variant_selected"];
|
|
1414
|
+
var MutatorEvent = freezeEnum(mutatorEvents);
|
|
1391
1415
|
var objectFits = ["cover", "contain"];
|
|
1392
1416
|
var ObjectFit = freezeEnum(objectFits);
|
|
1393
1417
|
var popoverPositions = ["inlineStart", "inlineEnd", "blockStart", "blockEnd"];
|
|
@@ -1406,6 +1430,10 @@ var progressTierUnits = ["currency", "item"];
|
|
|
1406
1430
|
var ProgressTierUnit = freezeEnum(progressTierUnits);
|
|
1407
1431
|
var quantityInputs = ["select", "number"];
|
|
1408
1432
|
var QuantityInput = freezeEnum(quantityInputs);
|
|
1433
|
+
var resultCountOperators = ["equals", "greater_than", "less_than"];
|
|
1434
|
+
var ResultCountOperator = freezeEnum(resultCountOperators);
|
|
1435
|
+
var resultTagOperators = ["contains", "does_not_contain"];
|
|
1436
|
+
var ResultTagOperator = freezeEnum(resultTagOperators);
|
|
1409
1437
|
var reviewsSizes = ["small", "default", "large"];
|
|
1410
1438
|
var ReviewsSize = freezeEnum(reviewsSizes);
|
|
1411
1439
|
var sectionTypes = [
|
|
@@ -1438,6 +1466,8 @@ var inlineTextSizeNames = ["extraSmall", "small", "base", "medium", "large", "ex
|
|
|
1438
1466
|
var InlineTextSizeName = freezeEnum(inlineTextSizeNames);
|
|
1439
1467
|
var textSizeNames = [...inlineTextSizeNames, "heading"];
|
|
1440
1468
|
var TextSizeName = freezeEnum(textSizeNames);
|
|
1469
|
+
var variableEffects = ["set_false", "set_true", "toggle"];
|
|
1470
|
+
var VariableEffect = freezeEnum(variableEffects);
|
|
1441
1471
|
var variantModes = ["multiple", "single"];
|
|
1442
1472
|
var VariantMode = freezeEnum(variantModes);
|
|
1443
1473
|
var variantSelectors = ["menu", "radio", "button"];
|
|
@@ -1527,87 +1557,20 @@ var CheckoutExtension = z9.looseObject({
|
|
|
1527
1557
|
});
|
|
1528
1558
|
|
|
1529
1559
|
// src/schema/widgets/contentBlock.ts
|
|
1530
|
-
import { z as
|
|
1560
|
+
import { z as z31 } from "zod";
|
|
1531
1561
|
|
|
1532
1562
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
1533
|
-
import { z as
|
|
1563
|
+
import { z as z30 } from "zod";
|
|
1534
1564
|
|
|
1535
1565
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
1536
1566
|
import { v7 as uuidv712 } from "uuid";
|
|
1537
|
-
import { z as
|
|
1538
|
-
|
|
1539
|
-
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1540
|
-
import { z as z10 } from "zod";
|
|
1541
|
-
var ruleTypes = [
|
|
1542
|
-
"cart",
|
|
1543
|
-
"cart_count",
|
|
1544
|
-
"cart_item_count",
|
|
1545
|
-
"cart_line_count",
|
|
1546
|
-
"cart_subtotal",
|
|
1547
|
-
"collection",
|
|
1548
|
-
"customer",
|
|
1549
|
-
"customer_order_count",
|
|
1550
|
-
"customer_tag",
|
|
1551
|
-
"customer_total_spent",
|
|
1552
|
-
"date",
|
|
1553
|
-
"product",
|
|
1554
|
-
"product_tag",
|
|
1555
|
-
"product_title",
|
|
1556
|
-
"product_type",
|
|
1557
|
-
"product_vendor"
|
|
1558
|
-
];
|
|
1559
|
-
var ruleType = z10.enum(ruleTypes);
|
|
1560
|
-
var RuleType = ruleType.enum;
|
|
1561
|
-
var ruleOperators = [
|
|
1562
|
-
"after",
|
|
1563
|
-
"anything",
|
|
1564
|
-
"before",
|
|
1565
|
-
"contains",
|
|
1566
|
-
"contains_any",
|
|
1567
|
-
"does_not_contain",
|
|
1568
|
-
"does_not_contain_any",
|
|
1569
|
-
"equals",
|
|
1570
|
-
"does_not_equal",
|
|
1571
|
-
"greater_than",
|
|
1572
|
-
"less_than"
|
|
1573
|
-
];
|
|
1574
|
-
var ruleOperator = z10.enum(ruleOperators);
|
|
1575
|
-
var RuleOperator = ruleOperator.enum;
|
|
1576
|
-
var RuleCondition = z10.object({
|
|
1577
|
-
operator: z10.enum(ruleOperators).default(RuleOperator.anything),
|
|
1578
|
-
products: z10.union([z10.array(z10.unknown()), z10.strictObject({}).transform(() => [])]).default(() => []),
|
|
1579
|
-
type: z10.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
1580
|
-
value: z10.coerce.string().default("")
|
|
1581
|
-
});
|
|
1582
|
-
var RuleLogicBlock = z10.object({
|
|
1583
|
-
rules: z10.array(RuleCondition).default(() => [])
|
|
1584
|
-
});
|
|
1585
|
-
var CABRule = z10.object({
|
|
1586
|
-
dataSourceId: z10.number().nullable().default(null),
|
|
1587
|
-
enabled: z10.boolean().default(false),
|
|
1588
|
-
ruleset: z10.union([
|
|
1589
|
-
z10.array(
|
|
1590
|
-
z10.object({
|
|
1591
|
-
exitIfMatched: z10.boolean().default(true),
|
|
1592
|
-
logic: z10.array(RuleLogicBlock).default(() => []),
|
|
1593
|
-
output: z10.array(
|
|
1594
|
-
z10.object({
|
|
1595
|
-
key: z10.string().default("should_show"),
|
|
1596
|
-
type: z10.literal("data_json").default("data_json"),
|
|
1597
|
-
value: z10.string().default("true")
|
|
1598
|
-
})
|
|
1599
|
-
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1600
|
-
})
|
|
1601
|
-
),
|
|
1602
|
-
z10.strictObject({}).transform(() => [])
|
|
1603
|
-
]).default(() => [])
|
|
1604
|
-
});
|
|
1567
|
+
import { z as z29 } from "zod";
|
|
1605
1568
|
|
|
1606
1569
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
1607
|
-
import { z as
|
|
1570
|
+
import { z as z28 } from "zod";
|
|
1608
1571
|
|
|
1609
1572
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1610
|
-
import { z as
|
|
1573
|
+
import { z as z10 } from "zod";
|
|
1611
1574
|
|
|
1612
1575
|
// src/schema/widgets/checkout-and-beyond/utils.ts
|
|
1613
1576
|
import { isPlainObject as isPlainObject2 } from "es-toolkit";
|
|
@@ -1684,11 +1647,11 @@ var isTextType = isSectionType(SectionType.text);
|
|
|
1684
1647
|
var isVariantsType = isSectionType(SectionType.variants);
|
|
1685
1648
|
|
|
1686
1649
|
// src/schema/widgets/checkout-and-beyond/banner.ts
|
|
1687
|
-
var CABBannerSection =
|
|
1650
|
+
var CABBannerSection = z10.lazy(
|
|
1688
1651
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
1689
|
-
buttonField:
|
|
1690
|
-
color:
|
|
1691
|
-
dismissible:
|
|
1652
|
+
buttonField: z10.enum(buttonFields).optional(),
|
|
1653
|
+
color: z10.enum(bannerColors).default("info"),
|
|
1654
|
+
dismissible: z10.boolean().default(true),
|
|
1692
1655
|
/**
|
|
1693
1656
|
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
1694
1657
|
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
@@ -1704,18 +1667,18 @@ var CABBannerSection = z11.lazy(
|
|
|
1704
1667
|
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
1705
1668
|
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
1706
1669
|
*/
|
|
1707
|
-
heading:
|
|
1708
|
-
sectionType:
|
|
1670
|
+
heading: z10.record(z10.string(), z10.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
1671
|
+
sectionType: z10.literal(SectionType.banner).default(SectionType.banner)
|
|
1709
1672
|
})
|
|
1710
1673
|
);
|
|
1711
1674
|
|
|
1712
1675
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1713
1676
|
import { v7 as uuidv73 } from "uuid";
|
|
1714
|
-
import { z as
|
|
1677
|
+
import { z as z15 } from "zod";
|
|
1715
1678
|
|
|
1716
1679
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1717
1680
|
import { v7 as uuidv7 } from "uuid";
|
|
1718
|
-
import { z as
|
|
1681
|
+
import { z as z13 } from "zod";
|
|
1719
1682
|
|
|
1720
1683
|
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
1721
1684
|
var iconNames = [
|
|
@@ -1801,17 +1764,142 @@ var IconSize = freezeEnum(iconSizes);
|
|
|
1801
1764
|
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
1802
1765
|
var IconTone = freezeEnum(iconTones);
|
|
1803
1766
|
|
|
1767
|
+
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
1768
|
+
import { z as z12 } from "zod";
|
|
1769
|
+
|
|
1770
|
+
// src/schema/widgets/checkout-and-beyond/rule.ts
|
|
1771
|
+
import { z as z11 } from "zod";
|
|
1772
|
+
var ruleTypes = [
|
|
1773
|
+
"cart",
|
|
1774
|
+
"cart_count",
|
|
1775
|
+
"cart_item_count",
|
|
1776
|
+
"cart_line_count",
|
|
1777
|
+
"cart_subtotal",
|
|
1778
|
+
"collection",
|
|
1779
|
+
"customer",
|
|
1780
|
+
"customer_order_count",
|
|
1781
|
+
"customer_tag",
|
|
1782
|
+
"customer_total_spent",
|
|
1783
|
+
"date",
|
|
1784
|
+
"product",
|
|
1785
|
+
"product_tag",
|
|
1786
|
+
"product_title",
|
|
1787
|
+
"product_type",
|
|
1788
|
+
"product_vendor"
|
|
1789
|
+
];
|
|
1790
|
+
var ruleType = z11.enum(ruleTypes);
|
|
1791
|
+
var RuleType = ruleType.enum;
|
|
1792
|
+
var ruleOperators = [
|
|
1793
|
+
"after",
|
|
1794
|
+
"anything",
|
|
1795
|
+
"before",
|
|
1796
|
+
"contains",
|
|
1797
|
+
"contains_any",
|
|
1798
|
+
"does_not_contain",
|
|
1799
|
+
"does_not_contain_any",
|
|
1800
|
+
"equals",
|
|
1801
|
+
"does_not_equal",
|
|
1802
|
+
"greater_than",
|
|
1803
|
+
"less_than"
|
|
1804
|
+
];
|
|
1805
|
+
var ruleOperator = z11.enum(ruleOperators);
|
|
1806
|
+
var RuleOperator = ruleOperator.enum;
|
|
1807
|
+
var RuleCondition = z11.object({
|
|
1808
|
+
operator: z11.enum(ruleOperators).default(RuleOperator.anything),
|
|
1809
|
+
products: z11.union([z11.array(z11.unknown()), z11.strictObject({}).transform(() => [])]).default(() => []),
|
|
1810
|
+
type: z11.enum(ruleTypes).default(RuleType.cart_subtotal),
|
|
1811
|
+
value: z11.coerce.string().default("")
|
|
1812
|
+
});
|
|
1813
|
+
var RuleLogicBlock = z11.object({
|
|
1814
|
+
rules: z11.array(RuleCondition).default(() => [])
|
|
1815
|
+
});
|
|
1816
|
+
var CABRulesetEntry = z11.object({
|
|
1817
|
+
exitIfMatched: z11.boolean().default(true),
|
|
1818
|
+
logic: z11.array(RuleLogicBlock).default(() => []),
|
|
1819
|
+
output: z11.array(
|
|
1820
|
+
z11.object({
|
|
1821
|
+
key: z11.string().default("should_show"),
|
|
1822
|
+
type: z11.literal("data_json").default("data_json"),
|
|
1823
|
+
value: z11.string().default("true")
|
|
1824
|
+
})
|
|
1825
|
+
).default(() => [{ key: "should_show", type: "data_json", value: "true" }])
|
|
1826
|
+
});
|
|
1827
|
+
var CABRuleset = z11.union([z11.array(CABRulesetEntry), z11.strictObject({}).transform(() => [])]).default(() => []);
|
|
1828
|
+
|
|
1829
|
+
// src/schema/widgets/checkout-and-beyond/variables.ts
|
|
1830
|
+
var variableEffect = z12.enum(variableEffects);
|
|
1831
|
+
var CABVariableSeed = z12.object({
|
|
1832
|
+
dataSourceId: z12.number().nullable().default(null),
|
|
1833
|
+
ruleset: CABRuleset
|
|
1834
|
+
});
|
|
1835
|
+
var CABVariable = z12.object({
|
|
1836
|
+
/**
|
|
1837
|
+
* Holds until the first seed verdict lands (and forever, for unseeded variables). Omitted, it derives
|
|
1838
|
+
* from seededness — `false` with a `seed` (visibility is EARNED), `true` without — via the transform
|
|
1839
|
+
* below; a cross-field default has no `.default()` spelling. An explicit value always wins.
|
|
1840
|
+
*/
|
|
1841
|
+
defaultValue: z12.boolean().optional(),
|
|
1842
|
+
name: z12.string().min(1),
|
|
1843
|
+
seed: CABVariableSeed.optional()
|
|
1844
|
+
}).transform(({ defaultValue, ...variable }) => ({
|
|
1845
|
+
defaultValue: defaultValue ?? variable.seed === void 0,
|
|
1846
|
+
...variable
|
|
1847
|
+
}));
|
|
1848
|
+
var CABVariableEffect = z12.object({
|
|
1849
|
+
effect: variableEffect.default(VariableEffect.toggle),
|
|
1850
|
+
variable: z12.string().min(1)
|
|
1851
|
+
});
|
|
1852
|
+
var CABVisibility = z12.object({
|
|
1853
|
+
variable: z12.string().min(1),
|
|
1854
|
+
visibleWhen: z12.boolean().default(true)
|
|
1855
|
+
});
|
|
1856
|
+
var resultCountOperator = z12.enum(resultCountOperators);
|
|
1857
|
+
var resultTagOperator = z12.enum(resultTagOperators);
|
|
1858
|
+
var mutatorEvent = z12.enum(mutatorEvents);
|
|
1859
|
+
var CABResultCountTrigger = z12.object({
|
|
1860
|
+
operator: resultCountOperator.default(ResultCountOperator.equals),
|
|
1861
|
+
type: z12.literal("result_count"),
|
|
1862
|
+
value: z12.number().default(0)
|
|
1863
|
+
});
|
|
1864
|
+
var CABResultTagTrigger = z12.object({
|
|
1865
|
+
operator: resultTagOperator.default(ResultTagOperator.contains),
|
|
1866
|
+
type: z12.literal("result_tag"),
|
|
1867
|
+
value: z12.string().min(1)
|
|
1868
|
+
});
|
|
1869
|
+
var CABEventTrigger = z12.object({
|
|
1870
|
+
event: mutatorEvent,
|
|
1871
|
+
type: z12.literal("event")
|
|
1872
|
+
});
|
|
1873
|
+
var CABVariableTrigger = z12.discriminatedUnion("type", [
|
|
1874
|
+
CABEventTrigger,
|
|
1875
|
+
CABResultCountTrigger,
|
|
1876
|
+
CABResultTagTrigger
|
|
1877
|
+
]);
|
|
1878
|
+
var CABVariableMutator = z12.object({
|
|
1879
|
+
effect: variableEffect.default(VariableEffect.set_false),
|
|
1880
|
+
variable: z12.string().min(1),
|
|
1881
|
+
when: CABVariableTrigger
|
|
1882
|
+
});
|
|
1883
|
+
var CABVariableFields = {
|
|
1884
|
+
mutators: z12.array(CABVariableMutator).optional(),
|
|
1885
|
+
variables: z12.array(CABVariable).refine((variables) => new Set(variables.map(({ name }) => name)).size === variables.length, {
|
|
1886
|
+
message: "variable names must be unique within a section"
|
|
1887
|
+
}).optional(),
|
|
1888
|
+
visibility: CABVisibility.optional()
|
|
1889
|
+
};
|
|
1890
|
+
|
|
1804
1891
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1805
|
-
var CABImageSectionFields =
|
|
1806
|
-
|
|
1892
|
+
var CABImageSectionFields = z13.object({
|
|
1893
|
+
...CABVariableFields,
|
|
1894
|
+
altText: z13.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1807
1895
|
/**
|
|
1808
1896
|
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
1809
1897
|
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
1810
1898
|
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
1811
1899
|
*/
|
|
1812
|
-
aspectRatio:
|
|
1813
|
-
border:
|
|
1814
|
-
buttonField:
|
|
1900
|
+
aspectRatio: z13.number().positive().nullable().default(null),
|
|
1901
|
+
border: z13.lazy(() => CABBorder),
|
|
1902
|
+
buttonField: z13.enum(buttonFields).optional(),
|
|
1815
1903
|
/**
|
|
1816
1904
|
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
1817
1905
|
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
@@ -1830,30 +1918,29 @@ var CABImageSectionFields = z12.object({
|
|
|
1830
1918
|
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
1831
1919
|
* the risky half.
|
|
1832
1920
|
*/
|
|
1833
|
-
category:
|
|
1921
|
+
category: z13.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
1834
1922
|
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
1835
|
-
iconSize:
|
|
1923
|
+
iconSize: z13.enum(iconSizes).nullable().default(null),
|
|
1836
1924
|
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
1837
|
-
iconTone:
|
|
1838
|
-
name:
|
|
1839
|
-
naturalHeight:
|
|
1840
|
-
naturalWidth:
|
|
1925
|
+
iconTone: z13.enum(iconTones).nullable().default(null),
|
|
1926
|
+
name: z13.string().optional(),
|
|
1927
|
+
naturalHeight: z13.number().default(0),
|
|
1928
|
+
naturalWidth: z13.number().default(0),
|
|
1841
1929
|
/**
|
|
1842
1930
|
* `contain` (the component default): dimensionless images render in s-image's 1/1 default frame, and
|
|
1843
1931
|
* `cover` would crop non-square art (payment badges lost their edges — 15993); `contain` letterboxes.
|
|
1844
1932
|
*/
|
|
1845
|
-
objectFit:
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
sectionType: z12.literal(SectionType.image).default(SectionType.image),
|
|
1933
|
+
objectFit: z13.enum(objectFits).default(ObjectFit.contain),
|
|
1934
|
+
sectionId: z13.uuid().default(() => uuidv7()),
|
|
1935
|
+
sectionType: z13.literal(SectionType.image).default(SectionType.image),
|
|
1849
1936
|
/**
|
|
1850
1937
|
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
1851
1938
|
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
1852
1939
|
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
1853
1940
|
* server-chosen tier icon actually needs it.
|
|
1854
1941
|
*/
|
|
1855
|
-
source:
|
|
1856
|
-
width:
|
|
1942
|
+
source: z13.union([z13.url(), z13.literal(""), z13.string().regex(DYNAMIC_TOKEN_REGEX), z13.enum(iconNames)]).default(""),
|
|
1943
|
+
width: z13.number().default(100)
|
|
1857
1944
|
});
|
|
1858
1945
|
var iconNameSet = new Set(iconNames);
|
|
1859
1946
|
var isIconName = (source) => iconNameSet.has(source);
|
|
@@ -1875,71 +1962,71 @@ var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, c
|
|
|
1875
1962
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
1876
1963
|
import { forEach, isString as isString2 } from "es-toolkit/compat";
|
|
1877
1964
|
import { v7 as uuidv72 } from "uuid";
|
|
1878
|
-
import { z as
|
|
1879
|
-
var enumOrOmit = (...vals) =>
|
|
1880
|
-
var TiptapText =
|
|
1881
|
-
marks:
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
attrs:
|
|
1888
|
-
class:
|
|
1889
|
-
href:
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1965
|
+
import { z as z14 } from "zod";
|
|
1966
|
+
var enumOrOmit = (...vals) => z14.string().transform((val) => vals.includes(val) ? val : void 0).optional();
|
|
1967
|
+
var TiptapText = z14.object({
|
|
1968
|
+
marks: z14.union([
|
|
1969
|
+
z14.array(
|
|
1970
|
+
z14.discriminatedUnion("type", [
|
|
1971
|
+
z14.object({ type: z14.literal("bold") }),
|
|
1972
|
+
z14.object({ type: z14.literal("italic") }),
|
|
1973
|
+
z14.object({
|
|
1974
|
+
attrs: z14.object({
|
|
1975
|
+
class: z14.string().nullable(),
|
|
1976
|
+
href: z14.union([
|
|
1977
|
+
z14.url(),
|
|
1978
|
+
z14.literal("#"),
|
|
1979
|
+
z14.string().regex(DYNAMIC_TOKEN_REGEX),
|
|
1980
|
+
z14.string().regex(ROOT_RELATIVE_PATH_REGEX)
|
|
1894
1981
|
]),
|
|
1895
|
-
rel:
|
|
1896
|
-
target:
|
|
1982
|
+
rel: z14.string().default("noopener noreferrer nofollow"),
|
|
1983
|
+
target: z14.string().default("_blank")
|
|
1897
1984
|
}),
|
|
1898
|
-
type:
|
|
1985
|
+
type: z14.literal("link")
|
|
1899
1986
|
}),
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
attrs:
|
|
1987
|
+
z14.object({ type: z14.literal("strike") }),
|
|
1988
|
+
z14.object({
|
|
1989
|
+
attrs: z14.object({
|
|
1903
1990
|
color: enumOrOmit(...textColorNames).default(TextColorName.base),
|
|
1904
1991
|
fontSize: enumOrOmit(...textSizeNames).default(TextSizeName.base)
|
|
1905
1992
|
}),
|
|
1906
|
-
type:
|
|
1993
|
+
type: z14.literal("textStyle")
|
|
1907
1994
|
})
|
|
1908
1995
|
])
|
|
1909
1996
|
),
|
|
1910
|
-
|
|
1997
|
+
z14.strictObject({}).transform(() => [])
|
|
1911
1998
|
]).optional(),
|
|
1912
|
-
text:
|
|
1913
|
-
type:
|
|
1999
|
+
text: z14.string().default(""),
|
|
2000
|
+
type: z14.literal("text").default("text")
|
|
1914
2001
|
});
|
|
1915
|
-
var TiptapParagraph =
|
|
1916
|
-
attrs:
|
|
2002
|
+
var TiptapParagraph = z14.object({
|
|
2003
|
+
attrs: z14.object({
|
|
1917
2004
|
textAlign: enumOrOmit(...textAlignments)
|
|
1918
2005
|
}).default({ textAlign: TextAlignment.start }),
|
|
1919
|
-
content:
|
|
1920
|
-
type:
|
|
2006
|
+
content: z14.union([z14.array(TiptapText), z14.strictObject({}).transform(() => [])]).default(() => []),
|
|
2007
|
+
type: z14.literal("paragraph").default("paragraph")
|
|
1921
2008
|
});
|
|
1922
|
-
var TiptapDocument =
|
|
1923
|
-
attrs:
|
|
2009
|
+
var TiptapDocument = z14.object({
|
|
2010
|
+
attrs: z14.object({
|
|
1924
2011
|
blockSpacing: enumOrOmit(...spacings)
|
|
1925
2012
|
}).default({ blockSpacing: Spacing.base }),
|
|
1926
|
-
content:
|
|
1927
|
-
type:
|
|
2013
|
+
content: z14.union([z14.array(TiptapParagraph), z14.strictObject({}).transform(() => [])]).default(() => [TiptapParagraph.parse({})]),
|
|
2014
|
+
type: z14.literal("doc").default("doc")
|
|
1928
2015
|
});
|
|
1929
|
-
var CABTextTier =
|
|
1930
|
-
threshold:
|
|
1931
|
-
thresholds:
|
|
1932
|
-
tierId:
|
|
1933
|
-
tierType:
|
|
2016
|
+
var CABTextTier = z14.object({
|
|
2017
|
+
threshold: z14.number().int().nonnegative(),
|
|
2018
|
+
thresholds: z14.record(z14.string(), z14.number().int().nonnegative()).default(() => ({})),
|
|
2019
|
+
tierId: z14.string().optional(),
|
|
2020
|
+
tierType: z14.enum(progressTierTypes).default(ProgressTierType.shipping)
|
|
1934
2021
|
});
|
|
1935
|
-
var CABTextSection =
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
sectionId:
|
|
1942
|
-
sectionType:
|
|
2022
|
+
var CABTextSection = z14.object({
|
|
2023
|
+
...CABVariableFields,
|
|
2024
|
+
buttonField: z14.enum(buttonFields).optional(),
|
|
2025
|
+
content: z14.record(z14.string(), z14.union([z14.string(), TiptapDocument]).refine(checkForHTML, NO_HTML).optional()).default({ en: TiptapDocument.parse({}) }).optional(),
|
|
2026
|
+
name: z14.string().optional(),
|
|
2027
|
+
optionId: z14.number().optional(),
|
|
2028
|
+
sectionId: z14.uuid().default(() => uuidv72()),
|
|
2029
|
+
sectionType: z14.literal(SectionType.text).default(SectionType.text),
|
|
1943
2030
|
tier: CABTextTier.optional()
|
|
1944
2031
|
}).superRefine(({ buttonField, content }, ctx) => {
|
|
1945
2032
|
if (buttonField === ButtonField.destinationUrl && content) {
|
|
@@ -1961,35 +2048,35 @@ var CABTextSection = z13.object({
|
|
|
1961
2048
|
});
|
|
1962
2049
|
|
|
1963
2050
|
// src/schema/widgets/checkout-and-beyond/button.ts
|
|
1964
|
-
var CABButtonContent =
|
|
1965
|
-
() =>
|
|
2051
|
+
var CABButtonContent = z15.lazy(
|
|
2052
|
+
() => z15.discriminatedUnion("sectionType", [CABImageSection, CABLayoutSection, CABTextSection])
|
|
1966
2053
|
);
|
|
1967
|
-
var CABButtonSection =
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2054
|
+
var CABButtonSection = z15.object({
|
|
2055
|
+
...CABVariableFields,
|
|
2056
|
+
action: z15.union([z15.literal(""), z15.enum(buttonActions)]).default(""),
|
|
2057
|
+
buttonStyle: z15.enum(buttonStyles).default(ButtonStyle.primary),
|
|
2058
|
+
custom: z15.object({
|
|
2059
|
+
color: z15.string().regex(HEX_COLOR_REGEX).default("#005bd3"),
|
|
2060
|
+
height: z15.number().default(52),
|
|
2061
|
+
width: z15.number().default(300)
|
|
1974
2062
|
}).default({
|
|
1975
2063
|
color: "#005bd3",
|
|
1976
2064
|
height: 52,
|
|
1977
2065
|
width: 300
|
|
1978
2066
|
}),
|
|
1979
|
-
disableDowngrade:
|
|
1980
|
-
name:
|
|
1981
|
-
optionId:
|
|
1982
|
-
popover:
|
|
1983
|
-
alignment:
|
|
1984
|
-
position:
|
|
2067
|
+
disableDowngrade: z15.boolean().default(false),
|
|
2068
|
+
name: z15.string().optional(),
|
|
2069
|
+
optionId: z15.number().optional(),
|
|
2070
|
+
popover: z15.object({
|
|
2071
|
+
alignment: z15.enum(textAlignments).default(TextAlignment.center),
|
|
2072
|
+
position: z15.enum(popoverPositions).default(PopoverPosition.blockStart)
|
|
1985
2073
|
}).optional().default(() => ({
|
|
1986
2074
|
alignment: TextAlignment.center,
|
|
1987
2075
|
position: PopoverPosition.blockStart
|
|
1988
2076
|
})),
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
sectionType: z14.literal(SectionType.button).default(SectionType.button),
|
|
2077
|
+
sectionId: z15.uuid().default(() => uuidv73()),
|
|
2078
|
+
sections: z15.union([z15.array(CABButtonContent), z15.strictObject({}).transform(() => [])]).default(() => []),
|
|
2079
|
+
sectionType: z15.literal(SectionType.button).default(SectionType.button),
|
|
1993
2080
|
/**
|
|
1994
2081
|
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
1995
2082
|
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
@@ -2004,86 +2091,93 @@ var CABButtonSection = z14.object({
|
|
|
2004
2091
|
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
2005
2092
|
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
2006
2093
|
*/
|
|
2007
|
-
tier:
|
|
2094
|
+
tier: z15.object({ tierId: z15.string().min(1) }).optional(),
|
|
2008
2095
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2009
|
-
trackingUrl:
|
|
2096
|
+
trackingUrl: z15.string().optional(),
|
|
2097
|
+
/**
|
|
2098
|
+
* Secondary effects applied to in-scope variables on click, alongside (never instead of) the primary
|
|
2099
|
+
* `action` — an `addToOrder` button can also flip a variable. Applied in array order.
|
|
2100
|
+
*/
|
|
2101
|
+
variableEffects: z15.array(CABVariableEffect).optional()
|
|
2010
2102
|
});
|
|
2011
2103
|
|
|
2012
2104
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2013
|
-
import { z as
|
|
2105
|
+
import { z as z20 } from "zod";
|
|
2014
2106
|
|
|
2015
2107
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2016
|
-
import { z as
|
|
2108
|
+
import { z as z19 } from "zod";
|
|
2017
2109
|
|
|
2018
2110
|
// src/schema/widgets/checkout-and-beyond/dataSource.ts
|
|
2019
2111
|
import { v7 as uuidv74 } from "uuid";
|
|
2020
|
-
import { z as
|
|
2021
|
-
var CABDiscount =
|
|
2022
|
-
amount:
|
|
2023
|
-
discountedBy:
|
|
2024
|
-
discountedFrom:
|
|
2025
|
-
type:
|
|
2112
|
+
import { z as z16 } from "zod";
|
|
2113
|
+
var CABDiscount = z16.object({
|
|
2114
|
+
amount: z16.union([z16.number(), z16.string()]).catch(0),
|
|
2115
|
+
discountedBy: z16.string().optional(),
|
|
2116
|
+
discountedFrom: z16.enum(discountSources).optional().catch(void 0),
|
|
2117
|
+
type: z16.enum(discountTypes).catch("none")
|
|
2026
2118
|
});
|
|
2027
|
-
var CABIntegrations =
|
|
2028
|
-
judgeme:
|
|
2029
|
-
junip:
|
|
2030
|
-
klaviyo:
|
|
2031
|
-
loox:
|
|
2032
|
-
okendo:
|
|
2033
|
-
opinew:
|
|
2034
|
-
reviewsio:
|
|
2035
|
-
stamped:
|
|
2036
|
-
yotpo:
|
|
2119
|
+
var CABIntegrations = z16.object({
|
|
2120
|
+
judgeme: z16.boolean().default(false),
|
|
2121
|
+
junip: z16.boolean().default(false),
|
|
2122
|
+
klaviyo: z16.boolean().default(false),
|
|
2123
|
+
loox: z16.boolean().default(false),
|
|
2124
|
+
okendo: z16.boolean().default(false),
|
|
2125
|
+
opinew: z16.boolean().default(false),
|
|
2126
|
+
reviewsio: z16.boolean().default(false),
|
|
2127
|
+
stamped: z16.boolean().default(false),
|
|
2128
|
+
yotpo: z16.boolean().default(false)
|
|
2037
2129
|
});
|
|
2038
|
-
var CABDataSourceSection =
|
|
2039
|
-
dataSourceId:
|
|
2040
|
-
dataSourcePath:
|
|
2130
|
+
var CABDataSourceSection = z16.object({
|
|
2131
|
+
dataSourceId: z16.number().nullable().default(null),
|
|
2132
|
+
dataSourcePath: z16.string().default(DEFAULT_ENDPOINTS[0].value),
|
|
2041
2133
|
discount: CABDiscount.optional(),
|
|
2042
2134
|
integrations: CABIntegrations.optional(),
|
|
2043
|
-
limit:
|
|
2044
|
-
matchVariant:
|
|
2045
|
-
matchVariantOutOfStock:
|
|
2046
|
-
name:
|
|
2047
|
-
productType:
|
|
2048
|
-
sectionId:
|
|
2049
|
-
sectionType:
|
|
2135
|
+
limit: z16.number().default(1),
|
|
2136
|
+
matchVariant: z16.boolean().default(false),
|
|
2137
|
+
matchVariantOutOfStock: z16.boolean().default(false),
|
|
2138
|
+
name: z16.string().default(DEFAULT_ENDPOINTS[0].label),
|
|
2139
|
+
productType: z16.enum(productTypes).optional(),
|
|
2140
|
+
sectionId: z16.uuid().default(() => uuidv74()),
|
|
2141
|
+
sectionType: z16.literal(SectionType.dataSource).default(SectionType.dataSource),
|
|
2050
2142
|
/** Default subscribe-vs-one-time for `productType: both` (legacy `subscription_is_default`). */
|
|
2051
|
-
subscriptionIsDefault:
|
|
2052
|
-
treatAsGwp:
|
|
2143
|
+
subscriptionIsDefault: z16.boolean().default(false),
|
|
2144
|
+
treatAsGwp: z16.boolean().default(false)
|
|
2053
2145
|
});
|
|
2054
2146
|
|
|
2055
2147
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2056
2148
|
import { v7 as uuidv76 } from "uuid";
|
|
2057
|
-
import { z as
|
|
2149
|
+
import { z as z18 } from "zod";
|
|
2058
2150
|
|
|
2059
2151
|
// src/schema/widgets/checkout-and-beyond/product.ts
|
|
2060
2152
|
import { v7 as uuidv75 } from "uuid";
|
|
2061
|
-
import { z as
|
|
2062
|
-
var CABVariantContent =
|
|
2063
|
-
() =>
|
|
2153
|
+
import { z as z17 } from "zod";
|
|
2154
|
+
var CABVariantContent = z17.lazy(
|
|
2155
|
+
() => z17.discriminatedUnion("sectionType", [CABButtonSection, CABTextSection])
|
|
2064
2156
|
);
|
|
2065
|
-
var CABProductSection =
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2157
|
+
var CABProductSection = z17.object({
|
|
2158
|
+
...CABVariableFields,
|
|
2159
|
+
name: z17.string().optional(),
|
|
2160
|
+
productId: z17.number().nullable().default(null),
|
|
2161
|
+
sectionId: z17.uuid().default(() => uuidv75()),
|
|
2162
|
+
sections: z17.union([z17.array(CABVariantContent), z17.strictObject({}).transform(() => [])]).default(() => []),
|
|
2163
|
+
sectionType: z17.literal(SectionType.product).default(SectionType.product),
|
|
2164
|
+
selectors: z17.record(z17.string(), z17.enum(variantSelectors).default(VariantSelector.menu)).default(() => ({})),
|
|
2165
|
+
variantMode: z17.enum(variantModes).default(VariantMode.multiple)
|
|
2073
2166
|
});
|
|
2074
2167
|
|
|
2075
2168
|
// src/schema/widgets/checkout-and-beyond/products.ts
|
|
2076
|
-
var CABProductsSection =
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2169
|
+
var CABProductsSection = z18.object({
|
|
2170
|
+
...CABVariableFields,
|
|
2171
|
+
name: z18.string().optional(),
|
|
2172
|
+
sectionId: z18.uuid().default(() => uuidv76()),
|
|
2173
|
+
sections: z18.union([z18.array(z18.lazy(() => CABProductSection)), z18.strictObject({}).transform(() => [])]).default(() => []),
|
|
2174
|
+
sectionType: z18.literal(SectionType.products).default(SectionType.products)
|
|
2081
2175
|
});
|
|
2082
2176
|
|
|
2083
2177
|
// src/schema/widgets/checkout-and-beyond/offers.ts
|
|
2084
|
-
var CABOffersSection =
|
|
2178
|
+
var CABOffersSection = z19.lazy(
|
|
2085
2179
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2086
|
-
sections:
|
|
2180
|
+
sections: z19.union([z19.array(z19.lazy(() => CABSection)), z19.strictObject({}).transform(() => [])]).default(() => [
|
|
2087
2181
|
CABBannerSection.parse({
|
|
2088
2182
|
buttonField: "undoAddToOrder",
|
|
2089
2183
|
color: "success",
|
|
@@ -2097,64 +2191,65 @@ var CABOffersSection = z18.lazy(
|
|
|
2097
2191
|
CABDataSourceSection.parse({}),
|
|
2098
2192
|
CABProductsSection.parse({})
|
|
2099
2193
|
]),
|
|
2100
|
-
sectionType:
|
|
2194
|
+
sectionType: z19.literal(SectionType.offers).default(SectionType.offers)
|
|
2101
2195
|
})
|
|
2102
2196
|
);
|
|
2103
2197
|
|
|
2104
2198
|
// src/schema/widgets/checkout-and-beyond/carousel.ts
|
|
2105
|
-
var CABCarouselSection =
|
|
2199
|
+
var CABCarouselSection = z20.lazy(
|
|
2106
2200
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2107
|
-
autoAdvanceInterval:
|
|
2108
|
-
itemsAtOnce:
|
|
2201
|
+
autoAdvanceInterval: z20.number().default(0),
|
|
2202
|
+
itemsAtOnce: z20.number().min(1).default(1),
|
|
2109
2203
|
/** Card arrangement for the offers child (`horizontal` = side-by-side) — NOT the carousel's own `direction`. */
|
|
2110
|
-
offersDirection:
|
|
2111
|
-
sections:
|
|
2112
|
-
sectionType:
|
|
2204
|
+
offersDirection: z20.enum(offersDirections).default("vertical"),
|
|
2205
|
+
sections: z20.union([z20.array(z20.lazy(() => CABSection)), z20.strictObject({}).transform(() => [])]).default(() => [CABOffersSection.parse({})]),
|
|
2206
|
+
sectionType: z20.literal(SectionType.carousel).default(SectionType.carousel)
|
|
2113
2207
|
})
|
|
2114
2208
|
);
|
|
2115
2209
|
|
|
2116
2210
|
// src/schema/widgets/checkout-and-beyond/cartLine.ts
|
|
2117
|
-
import { z as
|
|
2118
|
-
var CABCartLineSection =
|
|
2211
|
+
import { z as z21 } from "zod";
|
|
2212
|
+
var CABCartLineSection = z21.lazy(
|
|
2119
2213
|
() => CABLayoutSection.omit({ sections: true, sectionType: true }).extend({
|
|
2120
|
-
sections:
|
|
2121
|
-
sectionType:
|
|
2214
|
+
sections: z21.union([z21.array(z21.lazy(() => CABSection)), z21.strictObject({}).transform(() => [])]).default(() => [CABButtonSection.parse({ action: ButtonAction.switchToSubscription })]),
|
|
2215
|
+
sectionType: z21.literal(SectionType.cartLine).default(SectionType.cartLine)
|
|
2122
2216
|
})
|
|
2123
2217
|
);
|
|
2124
2218
|
|
|
2125
2219
|
// src/schema/widgets/checkout-and-beyond/discount.ts
|
|
2126
2220
|
import { v7 as uuidv77 } from "uuid";
|
|
2127
|
-
import { z as
|
|
2128
|
-
var CABDiscountSection =
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2221
|
+
import { z as z22 } from "zod";
|
|
2222
|
+
var CABDiscountSection = z22.object({
|
|
2223
|
+
...CABVariableFields,
|
|
2224
|
+
amount: z22.union([z22.number(), z22.string()]).catch(0),
|
|
2225
|
+
discountedBy: z22.string().optional(),
|
|
2226
|
+
discountedFrom: z22.enum(discountSources).optional().catch(void 0),
|
|
2227
|
+
message: z22.string().optional(),
|
|
2228
|
+
name: z22.string().optional(),
|
|
2229
|
+
quantity: z22.number().default(1),
|
|
2230
|
+
sectionId: z22.uuid().default(() => uuidv77()),
|
|
2231
|
+
sectionType: z22.literal(SectionType.discount).default(SectionType.discount),
|
|
2232
|
+
type: z22.enum(discountTypes).catch("none")
|
|
2138
2233
|
});
|
|
2139
2234
|
|
|
2140
2235
|
// src/schema/widgets/checkout-and-beyond/monetize.ts
|
|
2141
2236
|
import { v7 as uuidv78 } from "uuid";
|
|
2142
|
-
import { z as
|
|
2143
|
-
var CABMonetizeSection =
|
|
2144
|
-
|
|
2237
|
+
import { z as z23 } from "zod";
|
|
2238
|
+
var CABMonetizeSection = z23.object({
|
|
2239
|
+
...CABVariableFields,
|
|
2240
|
+
name: z23.string().optional(),
|
|
2145
2241
|
/** Privacy Policy footer href (the widget's `privacy_policy_url` setting); the client relays it to `/cab/monetize`. */
|
|
2146
|
-
privacyPolicyUrl:
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
sectionType: z22.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2242
|
+
privacyPolicyUrl: z23.string().optional(),
|
|
2243
|
+
sectionId: z23.uuid().default(() => uuidv78()),
|
|
2244
|
+
sectionType: z23.literal(SectionType.monetize).default(SectionType.monetize),
|
|
2150
2245
|
/** Ads-taxonomy sub-vertical id (the widget's `sub_vertical` setting); paired with `vertical`. */
|
|
2151
|
-
subVertical:
|
|
2246
|
+
subVertical: z23.string().optional(),
|
|
2152
2247
|
/** Ads-taxonomy vertical id (the widget's `vertical` setting) — with `subVertical`, the admin Monetize editor's two configurables. */
|
|
2153
|
-
vertical:
|
|
2248
|
+
vertical: z23.string().optional()
|
|
2154
2249
|
});
|
|
2155
2250
|
|
|
2156
2251
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2157
|
-
import { z as
|
|
2252
|
+
import { z as z24 } from "zod";
|
|
2158
2253
|
|
|
2159
2254
|
// src/schema/widgets/checkout-and-beyond/giftLabels.ts
|
|
2160
2255
|
var GIFT_LABELS = {
|
|
@@ -2273,21 +2368,21 @@ var GIFT_LABELS = {
|
|
|
2273
2368
|
};
|
|
2274
2369
|
|
|
2275
2370
|
// src/schema/widgets/checkout-and-beyond/progressBar.ts
|
|
2276
|
-
var CABProgressTier =
|
|
2371
|
+
var CABProgressTier = z24.object({
|
|
2277
2372
|
/**
|
|
2278
2373
|
* Order-discount tiers only (onsite `discount`): the reward the order-discount Function applies at
|
|
2279
2374
|
* cart time, carried so the client can resolve the `{{discountAmount}}` token in this tier's copy.
|
|
2280
2375
|
* `fixedAmount`: shop-currency CENTS (FX-scaled by the client, like {@link CABProgressTier.threshold});
|
|
2281
2376
|
* `percentage`: the whole-percent number rendered raw (`{n}%`). Absent on non-discount tiers.
|
|
2282
2377
|
*/
|
|
2283
|
-
discount:
|
|
2378
|
+
discount: z24.object({ amount: z24.number().nonnegative(), type: z24.enum(["fixedAmount", "percentage"]) }).optional(),
|
|
2284
2379
|
/**
|
|
2285
2380
|
* Smart-cart product (gift) tiers only (onsite `filter_oos_variants`): when set, the client drops this
|
|
2286
2381
|
* tier entirely once its gift has NO in-stock eligible variant — the milestone, fill slot and gift
|
|
2287
2382
|
* controls all disappear, mirroring onsite removing the tier from `bar.tiers` before it renders. Absent
|
|
2288
2383
|
* on shipping/discount/decorative tiers and left off by default (the tier renders regardless of stock).
|
|
2289
2384
|
*/
|
|
2290
|
-
filterOosVariants:
|
|
2385
|
+
filterOosVariants: z24.boolean().default(false),
|
|
2291
2386
|
/**
|
|
2292
2387
|
* Smart-cart product (gift) tiers only: the reward unlocked at this tier. The client enriches
|
|
2293
2388
|
* `productId`/`variantIds` to live variants (availability, price) and adds the chosen one to the cart
|
|
@@ -2295,10 +2390,10 @@ var CABProgressTier = z23.object({
|
|
|
2295
2390
|
* tiers and on tiers with no configured product. Cart add/remove is a later stage; carried here so the
|
|
2296
2391
|
* tree is complete.
|
|
2297
2392
|
*/
|
|
2298
|
-
gift:
|
|
2299
|
-
productId:
|
|
2300
|
-
title:
|
|
2301
|
-
variantIds:
|
|
2393
|
+
gift: z24.object({
|
|
2394
|
+
productId: z24.number().int().positive(),
|
|
2395
|
+
title: z24.string().optional(),
|
|
2396
|
+
variantIds: z24.array(z24.number().int().positive()).default(() => [])
|
|
2302
2397
|
}).optional(),
|
|
2303
2398
|
/**
|
|
2304
2399
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
@@ -2309,35 +2404,35 @@ var CABProgressTier = z23.object({
|
|
|
2309
2404
|
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
2310
2405
|
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
2311
2406
|
*/
|
|
2312
|
-
label:
|
|
2407
|
+
label: z24.record(z24.string(), z24.string()).optional(),
|
|
2313
2408
|
/**
|
|
2314
2409
|
* Smart-cart product (gift) tiers only (onsite `product_tier_image`): show the gift's product image in
|
|
2315
2410
|
* the step-row slot instead of the generic bag icon. The converter can't supply the image URL (config
|
|
2316
2411
|
* carries only product IDs), so the client resolves it (authoritative Shopify featured image, React
|
|
2317
2412
|
* parity) and falls back to the bag icon when the flag is off or no image resolves. Default false.
|
|
2318
2413
|
*/
|
|
2319
|
-
productTierImage:
|
|
2414
|
+
productTierImage: z24.boolean().default(false),
|
|
2320
2415
|
/**
|
|
2321
2416
|
* The tier's goal, measured per `unit`. `currency` (default): SHOP-currency cents — the canonical
|
|
2322
2417
|
* fallback: when the buyer's presentment currency has no entry in `thresholds`, the client
|
|
2323
2418
|
* multiplies this by the live FX rate (converter maps the v1 `unlock_price`, e.g. `75` → `7500`).
|
|
2324
2419
|
* `item`: a raw item count — no cents, no FX, no `thresholds` overrides.
|
|
2325
2420
|
*/
|
|
2326
|
-
threshold:
|
|
2421
|
+
threshold: z24.number().int().nonnegative(),
|
|
2327
2422
|
/**
|
|
2328
2423
|
* Per-presentment-currency goal overrides — lowercased ISO currency code → cents (e.g. `{ cad: 9900 }`).
|
|
2329
2424
|
* When the buyer's currency has an entry, the client uses it verbatim INSTEAD of FX-converting
|
|
2330
2425
|
* `threshold`, so merchants show intentional, clean per-market amounts (Shopify Markets) rather than a
|
|
2331
2426
|
* converted base. Defaults to `{}` — no overrides means always fall back to `threshold`.
|
|
2332
2427
|
*/
|
|
2333
|
-
thresholds:
|
|
2428
|
+
thresholds: z24.record(z24.string(), z24.number().int().nonnegative()).default(() => ({})),
|
|
2334
2429
|
/**
|
|
2335
2430
|
* Smart-cart tier identifier, mirrored onto the gift cart line's `_tier` attribute so the client can
|
|
2336
2431
|
* match an in-cart gift back to its tier (add on reach, remove on downgrade/decline). Absent on the
|
|
2337
2432
|
* shipping bar (single unlabeled tier, no gift).
|
|
2338
2433
|
*/
|
|
2339
|
-
tierId:
|
|
2340
|
-
tierType:
|
|
2434
|
+
tierId: z24.string().optional(),
|
|
2435
|
+
tierType: z24.enum(progressTierTypes).default(ProgressTierType.shipping),
|
|
2341
2436
|
/**
|
|
2342
2437
|
* What this tier's progress is measured in — PER TIER (onsite's `unlock_condition_type` model, NOT
|
|
2343
2438
|
* the React port's bar-level `tiers[0]` shortcut). `currency` compares money cents against the
|
|
@@ -2348,9 +2443,9 @@ var CABProgressTier = z23.object({
|
|
|
2348
2443
|
* count carries no injected noun (no English `item`/`items` inflection on localized copy); merchant
|
|
2349
2444
|
* template text supplies grammatically-neutral wording around the token.
|
|
2350
2445
|
*/
|
|
2351
|
-
unit:
|
|
2446
|
+
unit: z24.enum(progressTierUnits).default(ProgressTierUnit.currency)
|
|
2352
2447
|
});
|
|
2353
|
-
var CABProgressBarSection =
|
|
2448
|
+
var CABProgressBarSection = z24.lazy(
|
|
2354
2449
|
() => CABLayoutSection.omit({ sectionType: true }).extend({
|
|
2355
2450
|
/**
|
|
2356
2451
|
* The onsite bar id (smart-cart TPB bars only). The client mirrors it to the cart's `_barId` attribute
|
|
@@ -2359,35 +2454,35 @@ var CABProgressBarSection = z23.lazy(
|
|
|
2359
2454
|
* checkout reaches the extension without it, so the client writes it or the tier gift's 100% discount
|
|
2360
2455
|
* (and any tier order discount) never applies. Absent on the v1 shipping bar (no gift tiers, no id).
|
|
2361
2456
|
*/
|
|
2362
|
-
barId:
|
|
2457
|
+
barId: z24.string().optional(),
|
|
2363
2458
|
/** Empty = shown everywhere; otherwise uppercase ISO country codes. */
|
|
2364
|
-
countryCodes:
|
|
2459
|
+
countryCodes: z24.array(z24.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2365
2460
|
/**
|
|
2366
2461
|
* Uppercase ISO codes where a higher-precedence geo bar applies, so this (default, non-geo) bar is
|
|
2367
2462
|
* hidden there — replicates React `getbar`'s geo-match-over-default precedence. Empty = never excluded.
|
|
2368
2463
|
*/
|
|
2369
|
-
excludeCountryCodes:
|
|
2464
|
+
excludeCountryCodes: z24.array(z24.string().transform((code) => code.trim().toUpperCase())).default(() => []),
|
|
2370
2465
|
/**
|
|
2371
2466
|
* Measure progress against the PRE-discount subtotal (onsite `exclude_discount_in_subtotal`, and
|
|
2372
2467
|
* forced on for bars with a discount tier so its own reward can't un-reach the tier). The client
|
|
2373
2468
|
* adds the cart's discount allocations back to the live subtotal.
|
|
2374
2469
|
*/
|
|
2375
|
-
excludeDiscountInSubtotal:
|
|
2470
|
+
excludeDiscountInSubtotal: z24.boolean().default(false),
|
|
2376
2471
|
/** Variant ids the client subtracts from the adjusted subtotal (React `bar.excluded_products`). */
|
|
2377
|
-
excludedVariantIds:
|
|
2472
|
+
excludedVariantIds: z24.array(z24.number().int().positive()).default(() => []),
|
|
2378
2473
|
/**
|
|
2379
2474
|
* When the cart holds a subscription item, treat the bar as reached regardless of subtotal (React
|
|
2380
2475
|
* `free_shipping_on_subscription(s)`). `freeShippingOnAll` is already a zero-threshold tier instead.
|
|
2381
2476
|
*/
|
|
2382
|
-
freeShippingOnSubscription:
|
|
2477
|
+
freeShippingOnSubscription: z24.boolean().default(false),
|
|
2383
2478
|
/** Localized heading over the gift controls (onsite `gift_area_title`, default 'FREE GIFTS'). */
|
|
2384
|
-
giftAreaTitle:
|
|
2479
|
+
giftAreaTitle: z24.record(z24.string(), z24.string()).default(() => ({ en: "FREE GIFTS" })),
|
|
2385
2480
|
/** Localized gift-control labels (add/remove/heading); a tier's gift `title` beats `yourGift`. */
|
|
2386
|
-
giftLabels:
|
|
2387
|
-
addGift:
|
|
2388
|
-
remove:
|
|
2389
|
-
selectOptions:
|
|
2390
|
-
yourGift:
|
|
2481
|
+
giftLabels: z24.object({
|
|
2482
|
+
addGift: z24.record(z24.string(), z24.string()).default(() => ({ ...GIFT_LABELS.addGift })),
|
|
2483
|
+
remove: z24.record(z24.string(), z24.string()).default(() => ({ ...GIFT_LABELS.remove })),
|
|
2484
|
+
selectOptions: z24.record(z24.string(), z24.string()).default(() => ({ ...GIFT_LABELS.selectOptions })),
|
|
2485
|
+
yourGift: z24.record(z24.string(), z24.string()).default(() => ({ ...GIFT_LABELS.yourGift }))
|
|
2391
2486
|
}).default(() => ({
|
|
2392
2487
|
addGift: { ...GIFT_LABELS.addGift },
|
|
2393
2488
|
remove: { ...GIFT_LABELS.remove },
|
|
@@ -2395,37 +2490,38 @@ var CABProgressBarSection = z23.lazy(
|
|
|
2395
2490
|
yourGift: { ...GIFT_LABELS.yourGift }
|
|
2396
2491
|
})),
|
|
2397
2492
|
/** The bar's a11y label; the merchant names it in the editor, else this default (React parity). */
|
|
2398
|
-
name:
|
|
2493
|
+
name: z24.string().default("Order progress"),
|
|
2399
2494
|
/**
|
|
2400
2495
|
* Bar fill color. An explicit (widget-authored) value is used verbatim; when absent the server
|
|
2401
2496
|
* fills it with the live shop theme's `buttonBackground` (React `useRebuyTheme` parity). Still
|
|
2402
2497
|
* absent after that ⇒ the theme fetch failed and the client renders its platform-default bar —
|
|
2403
2498
|
* optional, not defaulted, so "merchant chose no color" stays distinguishable from any real value.
|
|
2404
2499
|
*/
|
|
2405
|
-
progressColor:
|
|
2406
|
-
sectionType:
|
|
2500
|
+
progressColor: z24.string().optional(),
|
|
2501
|
+
sectionType: z24.literal(SectionType.progressBar).default(SectionType.progressBar),
|
|
2407
2502
|
/**
|
|
2408
2503
|
* The bar's milestones in the merchant's CONFIGURED order — the renderer does NOT sort them (022
|
|
2409
2504
|
* O-B2: sorting by resolved threshold reversed configured milestones on out-of-order or mixed-unit
|
|
2410
2505
|
* count-vs-cents bars). Drives the fill (even slot per tier) and, for smart-cart product tiers, the
|
|
2411
2506
|
* gift add/remove. The visual tier display lives in `sections` (composable), NOT here.
|
|
2412
2507
|
*/
|
|
2413
|
-
tiers:
|
|
2508
|
+
tiers: z24.union([z24.array(CABProgressTier), z24.strictObject({}).transform(() => [])]).default(() => [])
|
|
2414
2509
|
})
|
|
2415
2510
|
);
|
|
2416
2511
|
|
|
2417
2512
|
// src/schema/widgets/checkout-and-beyond/quantity.ts
|
|
2418
2513
|
import { v7 as uuidv79 } from "uuid";
|
|
2419
|
-
import { z as
|
|
2420
|
-
var CABQuantitySection =
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2514
|
+
import { z as z25 } from "zod";
|
|
2515
|
+
var CABQuantitySection = z25.object({
|
|
2516
|
+
...CABVariableFields,
|
|
2517
|
+
errorMessages: z25.record(
|
|
2518
|
+
z25.string(),
|
|
2519
|
+
z25.object({
|
|
2424
2520
|
/** `{{step}}` is interpolated at render — the off-increment message React never gave a merchant key. */
|
|
2425
|
-
increment:
|
|
2426
|
-
max:
|
|
2427
|
-
min:
|
|
2428
|
-
neg:
|
|
2521
|
+
increment: z25.string().optional(),
|
|
2522
|
+
max: z25.string().optional(),
|
|
2523
|
+
min: z25.string().optional(),
|
|
2524
|
+
neg: z25.string().optional()
|
|
2429
2525
|
})
|
|
2430
2526
|
).default({
|
|
2431
2527
|
en: {
|
|
@@ -2435,19 +2531,18 @@ var CABQuantitySection = z24.object({
|
|
|
2435
2531
|
neg: "Quantity cannot be negative"
|
|
2436
2532
|
}
|
|
2437
2533
|
}),
|
|
2438
|
-
inputType:
|
|
2439
|
-
max:
|
|
2440
|
-
min:
|
|
2534
|
+
inputType: z25.enum(quantityInputs).default(QuantityInput.select),
|
|
2535
|
+
max: z25.number().min(1).max(100).default(10),
|
|
2536
|
+
min: z25.number().min(1).default(1),
|
|
2441
2537
|
/** The a11y label for the quantity control; the merchant names it in the editor, else this default. */
|
|
2442
|
-
name:
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
sectionType: z24.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2538
|
+
name: z25.string().default("Quantity"),
|
|
2539
|
+
sectionId: z25.uuid().default(() => uuidv79()),
|
|
2540
|
+
sectionType: z25.literal(SectionType.quantity).default(SectionType.quantity)
|
|
2446
2541
|
});
|
|
2447
2542
|
|
|
2448
2543
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2449
2544
|
import { v7 as uuidv710 } from "uuid";
|
|
2450
|
-
import { z as
|
|
2545
|
+
import { z as z26 } from "zod";
|
|
2451
2546
|
|
|
2452
2547
|
// src/schema/widgets/checkout-and-beyond/reviewLabels.ts
|
|
2453
2548
|
var REVIEW_LABELS = {
|
|
@@ -2510,50 +2605,50 @@ var REVIEW_LABELS = {
|
|
|
2510
2605
|
};
|
|
2511
2606
|
|
|
2512
2607
|
// src/schema/widgets/checkout-and-beyond/reviews.ts
|
|
2513
|
-
var CABReviewsSection =
|
|
2514
|
-
|
|
2608
|
+
var CABReviewsSection = z26.object({
|
|
2609
|
+
...CABVariableFields,
|
|
2610
|
+
color: z26.string().default("#fadb14"),
|
|
2515
2611
|
/**
|
|
2516
2612
|
* Localized review-count templates (`{{reviewCount}}`), one/other plural forms; the client picks the
|
|
2517
2613
|
* form via `Intl.PluralRules`. Defaults here (schema-first) so every tree localizes without converter
|
|
2518
2614
|
* or merchant work.
|
|
2519
2615
|
*/
|
|
2520
|
-
countLabels:
|
|
2521
|
-
one:
|
|
2522
|
-
other:
|
|
2616
|
+
countLabels: z26.object({
|
|
2617
|
+
one: z26.record(z26.string(), z26.string()).default(() => ({ ...REVIEW_LABELS.one })),
|
|
2618
|
+
other: z26.record(z26.string(), z26.string()).default(() => ({ ...REVIEW_LABELS.other }))
|
|
2523
2619
|
}).default(() => ({ one: { ...REVIEW_LABELS.one }, other: { ...REVIEW_LABELS.other } })),
|
|
2524
|
-
name:
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
size: z25.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2620
|
+
name: z26.string().optional(),
|
|
2621
|
+
sectionId: z26.uuid().default(() => uuidv710()),
|
|
2622
|
+
sectionType: z26.literal(SectionType.reviews).default(SectionType.reviews),
|
|
2623
|
+
size: z26.enum(reviewsSizes).default(ReviewsSize.default)
|
|
2529
2624
|
});
|
|
2530
2625
|
|
|
2531
2626
|
// src/schema/widgets/checkout-and-beyond/variants.ts
|
|
2532
2627
|
import { slice } from "es-toolkit/compat";
|
|
2533
2628
|
import { v7 as uuidv711 } from "uuid";
|
|
2534
|
-
import { z as
|
|
2535
|
-
var CABVariantsSection =
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
sectionId:
|
|
2540
|
-
sectionType:
|
|
2541
|
-
selector:
|
|
2542
|
-
variantMode:
|
|
2629
|
+
import { z as z27 } from "zod";
|
|
2630
|
+
var CABVariantsSection = z27.object({
|
|
2631
|
+
...CABVariableFields,
|
|
2632
|
+
hideOutOfStockVariants: z27.boolean().default(false),
|
|
2633
|
+
name: z27.string().optional(),
|
|
2634
|
+
sectionId: z27.uuid().default(() => uuidv711()),
|
|
2635
|
+
sectionType: z27.literal(SectionType.variants).default(SectionType.variants),
|
|
2636
|
+
selector: z27.enum(slice(variantSelectors, 0, 3)).default(VariantSelector.menu),
|
|
2637
|
+
variantMode: z27.enum(variantModes).default(VariantMode.multiple)
|
|
2543
2638
|
});
|
|
2544
2639
|
|
|
2545
2640
|
// src/schema/widgets/checkout-and-beyond/shared.ts
|
|
2546
|
-
var CABBorder =
|
|
2547
|
-
radius:
|
|
2548
|
-
style:
|
|
2549
|
-
width:
|
|
2641
|
+
var CABBorder = z28.object({
|
|
2642
|
+
radius: z28.enum(borderRadii).default(BorderRadius.base),
|
|
2643
|
+
style: z28.enum(borderStyles).default(BorderStyle.none),
|
|
2644
|
+
width: z28.enum(borderWidths).default(BorderWidth.base)
|
|
2550
2645
|
}).default({
|
|
2551
2646
|
radius: BorderRadius.base,
|
|
2552
2647
|
style: BorderStyle.none,
|
|
2553
2648
|
width: BorderWidth.base
|
|
2554
2649
|
});
|
|
2555
|
-
var CABSection =
|
|
2556
|
-
() =>
|
|
2650
|
+
var CABSection = z28.lazy(
|
|
2651
|
+
() => z28.discriminatedUnion("sectionType", [
|
|
2557
2652
|
CABBannerSection,
|
|
2558
2653
|
CABButtonSection,
|
|
2559
2654
|
CABCarouselSection,
|
|
@@ -2575,32 +2670,32 @@ var CABSection = z27.lazy(
|
|
|
2575
2670
|
);
|
|
2576
2671
|
|
|
2577
2672
|
// src/schema/widgets/checkout-and-beyond/layout.ts
|
|
2578
|
-
var GridItem =
|
|
2579
|
-
var CABLayoutSection =
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2673
|
+
var GridItem = z29.union([z29.literal("auto"), z29.literal("fill"), z29.string().regex(/^\d+%$/), z29.number()]);
|
|
2674
|
+
var CABLayoutSection = z29.object({
|
|
2675
|
+
...CABVariableFields,
|
|
2676
|
+
alignment: z29.object({
|
|
2677
|
+
horizontal: z29.enum(horizontalAlignments).default(HorizontalAlignment.start),
|
|
2678
|
+
vertical: z29.enum(verticalAlignments).default(VerticalAlignment.top)
|
|
2583
2679
|
}).default({
|
|
2584
2680
|
horizontal: HorizontalAlignment.start,
|
|
2585
2681
|
vertical: VerticalAlignment.top
|
|
2586
2682
|
}),
|
|
2587
|
-
border:
|
|
2588
|
-
buttonField:
|
|
2589
|
-
direction:
|
|
2590
|
-
grid:
|
|
2591
|
-
columns:
|
|
2592
|
-
rows:
|
|
2683
|
+
border: z29.lazy(() => CABBorder),
|
|
2684
|
+
buttonField: z29.enum(buttonFields).optional(),
|
|
2685
|
+
direction: z29.enum(directions).default(Direction.rows),
|
|
2686
|
+
grid: z29.object({
|
|
2687
|
+
columns: z29.union([z29.array(GridItem), z29.undefined()]).default(() => ["auto"]),
|
|
2688
|
+
rows: z29.union([z29.array(GridItem), z29.undefined()]).default(() => ["auto"])
|
|
2593
2689
|
}).default({ columns: ["auto"], rows: ["auto"] }).optional(),
|
|
2594
|
-
name:
|
|
2595
|
-
padding:
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
spacing: z28.enum(spacings).default(Spacing.base),
|
|
2690
|
+
name: z29.string().optional(),
|
|
2691
|
+
padding: z29.enum(spacings).default(Spacing.none),
|
|
2692
|
+
sectionId: z29.uuid().default(() => uuidv712()),
|
|
2693
|
+
sections: z29.union([z29.array(z29.lazy(() => CABSection)), z29.strictObject({}).transform(() => [])]).default(() => []),
|
|
2694
|
+
sectionType: z29.literal(SectionType.layout).default(SectionType.layout),
|
|
2695
|
+
spacing: z29.enum(spacings).default(Spacing.base),
|
|
2601
2696
|
/** Fire-and-forget impression pixel POSTed once when the section is shown (e.g. a Monetize offer view). */
|
|
2602
|
-
viewUrl:
|
|
2603
|
-
width:
|
|
2697
|
+
viewUrl: z29.string().optional(),
|
|
2698
|
+
width: z29.number().default(100)
|
|
2604
2699
|
});
|
|
2605
2700
|
|
|
2606
2701
|
// src/schema/widgets/checkout-and-beyond/uiLabels.ts
|
|
@@ -2617,8 +2712,8 @@ var UI_LABELS = {
|
|
|
2617
2712
|
};
|
|
2618
2713
|
|
|
2619
2714
|
// src/schema/widgets/checkout-and-beyond/root.ts
|
|
2620
|
-
var localized = (fallback) =>
|
|
2621
|
-
var CABUILabels =
|
|
2715
|
+
var localized = (fallback) => z30.record(z30.string(), z30.string()).default(() => ({ ...fallback })).transform((labels) => Object.keys(labels).length > 0 ? labels : { ...fallback });
|
|
2716
|
+
var CABUILabels = z30.object({
|
|
2622
2717
|
currentPage: localized(UI_LABELS.currentPage),
|
|
2623
2718
|
loadingOptions: localized(UI_LABELS.loadingOptions),
|
|
2624
2719
|
nextPage: localized(UI_LABELS.nextPage),
|
|
@@ -2639,154 +2734,154 @@ var CABUILabels = z29.object({
|
|
|
2639
2734
|
subscriptionOptions: { ...UI_LABELS.subscriptionOptions },
|
|
2640
2735
|
updating: { ...UI_LABELS.updating }
|
|
2641
2736
|
}));
|
|
2642
|
-
var TargetArea =
|
|
2643
|
-
fill:
|
|
2644
|
-
flip:
|
|
2645
|
-
icon:
|
|
2646
|
-
label:
|
|
2647
|
-
width:
|
|
2737
|
+
var TargetArea = z30.object({
|
|
2738
|
+
fill: z30.boolean().optional(),
|
|
2739
|
+
flip: z30.enum(["both", "horizontal", "vertical"]).optional(),
|
|
2740
|
+
icon: z30.string(),
|
|
2741
|
+
label: z30.string(),
|
|
2742
|
+
width: z30.string()
|
|
2648
2743
|
}).default(targetAreas[EditorMode.checkoutExtension][1]);
|
|
2649
|
-
var CABTracking =
|
|
2650
|
-
enableAttribution:
|
|
2651
|
-
enableSource:
|
|
2652
|
-
enableWidget:
|
|
2744
|
+
var CABTracking = z30.object({
|
|
2745
|
+
enableAttribution: z30.boolean().nullish().transform((value) => value ?? true),
|
|
2746
|
+
enableSource: z30.boolean().nullish().transform((value) => value ?? true),
|
|
2747
|
+
enableWidget: z30.boolean().nullish().transform((value) => value ?? true)
|
|
2653
2748
|
}).nullish().transform((value) => value ?? { enableAttribution: true, enableSource: true, enableWidget: true });
|
|
2654
|
-
var CABExperiment =
|
|
2655
|
-
elementId:
|
|
2656
|
-
experimentId:
|
|
2657
|
-
experimentType:
|
|
2658
|
-
selectedId:
|
|
2749
|
+
var CABExperiment = z30.object({
|
|
2750
|
+
elementId: z30.number(),
|
|
2751
|
+
experimentId: z30.number(),
|
|
2752
|
+
experimentType: z30.string(),
|
|
2753
|
+
selectedId: z30.number()
|
|
2659
2754
|
});
|
|
2660
2755
|
var CABRootSection = CABLayoutSection.extend({
|
|
2661
|
-
editorMode:
|
|
2756
|
+
editorMode: z30.enum(editorModes).default(EditorMode.checkoutExtension),
|
|
2662
2757
|
experiment: CABExperiment.optional(),
|
|
2663
2758
|
// Same rule as CABTracking above: the v1 converters pass raw legacy `previewMode` through, so a
|
|
2664
2759
|
// `null` must fall back rather than throw the widget; malformed values still throw.
|
|
2665
|
-
previewMode:
|
|
2666
|
-
storeId:
|
|
2760
|
+
previewMode: z30.boolean().nullish().transform((value) => value ?? false),
|
|
2761
|
+
storeId: z30.number().nullable().default(null),
|
|
2667
2762
|
targetArea: TargetArea.nullable(),
|
|
2668
2763
|
tracking: CABTracking,
|
|
2669
|
-
type:
|
|
2764
|
+
type: z30.enum(widgetTypes).default(WidgetType.ui_extension_content_block),
|
|
2670
2765
|
uiLabels: CABUILabels,
|
|
2671
|
-
version:
|
|
2672
|
-
widgetId:
|
|
2766
|
+
version: z30.literal(2).default(2),
|
|
2767
|
+
widgetId: z30.number().nullable().default(null)
|
|
2673
2768
|
});
|
|
2674
2769
|
|
|
2675
2770
|
// src/schema/widgets/contentBlock.ts
|
|
2676
|
-
var ContentBlockV1 =
|
|
2677
|
-
blockSpacing:
|
|
2678
|
-
imageBlocks:
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
altText:
|
|
2682
|
-
description:
|
|
2683
|
-
id:
|
|
2684
|
-
imagePlacement:
|
|
2685
|
-
imageSize:
|
|
2686
|
-
imageUrl:
|
|
2687
|
-
textAlignment:
|
|
2771
|
+
var ContentBlockV1 = z31.object({
|
|
2772
|
+
blockSpacing: z31.enum(spacings).optional(),
|
|
2773
|
+
imageBlocks: z31.union([
|
|
2774
|
+
z31.array(
|
|
2775
|
+
z31.object({
|
|
2776
|
+
altText: z31.string().nullable(),
|
|
2777
|
+
description: z31.string().nullable(),
|
|
2778
|
+
id: z31.uuid(),
|
|
2779
|
+
imagePlacement: z31.enum(["top", "right", "bottom", "left"]),
|
|
2780
|
+
imageSize: z31.number(),
|
|
2781
|
+
imageUrl: z31.url(),
|
|
2782
|
+
textAlignment: z31.enum(["left", "center", "right"]),
|
|
2688
2783
|
/** Inline scale only: an image caption can never be a block-level heading. */
|
|
2689
|
-
textSize:
|
|
2784
|
+
textSize: z31.enum(inlineTextSizeNames)
|
|
2690
2785
|
})
|
|
2691
2786
|
),
|
|
2692
|
-
|
|
2787
|
+
z31.strictObject({}).transform(() => [])
|
|
2693
2788
|
]).optional(),
|
|
2694
|
-
imageLayout:
|
|
2695
|
-
language:
|
|
2696
|
-
description:
|
|
2697
|
-
superTitle:
|
|
2698
|
-
title:
|
|
2789
|
+
imageLayout: z31.enum(["row", "column"]).optional(),
|
|
2790
|
+
language: z31.object({
|
|
2791
|
+
description: z31.string(),
|
|
2792
|
+
superTitle: z31.string(),
|
|
2793
|
+
title: z31.string()
|
|
2699
2794
|
}),
|
|
2700
|
-
previewMode:
|
|
2701
|
-
type:
|
|
2702
|
-
version:
|
|
2795
|
+
previewMode: z31.boolean(),
|
|
2796
|
+
type: z31.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block),
|
|
2797
|
+
version: z31.literal(1)
|
|
2703
2798
|
});
|
|
2704
|
-
var ContentBlock =
|
|
2799
|
+
var ContentBlock = z31.discriminatedUnion("version", [
|
|
2705
2800
|
ContentBlockV1,
|
|
2706
2801
|
CABRootSection.extend({
|
|
2707
|
-
type:
|
|
2802
|
+
type: z31.literal(WidgetType.ui_extension_content_block).default(WidgetType.ui_extension_content_block)
|
|
2708
2803
|
})
|
|
2709
2804
|
]);
|
|
2710
2805
|
|
|
2711
2806
|
// src/schema/widgets/giftWithPurchase.ts
|
|
2712
|
-
import { z as
|
|
2713
|
-
var GiftWithPurchase =
|
|
2714
|
-
type:
|
|
2807
|
+
import { z as z32 } from "zod";
|
|
2808
|
+
var GiftWithPurchase = z32.looseObject({
|
|
2809
|
+
type: z32.literal(WidgetType.gift_with_purchase).default(WidgetType.gift_with_purchase)
|
|
2715
2810
|
});
|
|
2716
2811
|
|
|
2717
2812
|
// src/schema/widgets/lineItemEditor.ts
|
|
2718
|
-
import { z as
|
|
2719
|
-
var LineItemEditorSwitchLanguageV1 =
|
|
2720
|
-
downgradeToOneTimeLabel:
|
|
2813
|
+
import { z as z33 } from "zod";
|
|
2814
|
+
var LineItemEditorSwitchLanguageV1 = z33.object({
|
|
2815
|
+
downgradeToOneTimeLabel: z33.string().optional(),
|
|
2721
2816
|
/** Frequency-option template (`{{frequency}}`/`{{interval}}`) for the plan select. */
|
|
2722
|
-
subscriptionOptionLabel:
|
|
2723
|
-
upgradeToSubscriptionLabel:
|
|
2724
|
-
upgradeToSubscriptionWithoutDiscountLabel:
|
|
2817
|
+
subscriptionOptionLabel: z33.string().optional(),
|
|
2818
|
+
upgradeToSubscriptionLabel: z33.string().optional(),
|
|
2819
|
+
upgradeToSubscriptionWithoutDiscountLabel: z33.string().optional()
|
|
2725
2820
|
});
|
|
2726
|
-
var LineItemEditorV1 =
|
|
2821
|
+
var LineItemEditorV1 = z33.object({
|
|
2727
2822
|
/** Legacy `getStyles` button style; the converter carries a valid kind, defaulting to `plain`. */
|
|
2728
|
-
button:
|
|
2729
|
-
previewMode:
|
|
2730
|
-
switchToSubscription:
|
|
2731
|
-
disableDowngrade:
|
|
2823
|
+
button: z33.object({ kind: z33.enum(["plain", "primary", "secondary"]).optional() }).optional(),
|
|
2824
|
+
previewMode: z33.boolean().optional(),
|
|
2825
|
+
switchToSubscription: z33.object({
|
|
2826
|
+
disableDowngrade: z33.boolean().optional(),
|
|
2732
2827
|
language: LineItemEditorSwitchLanguageV1.optional()
|
|
2733
2828
|
}).optional(),
|
|
2734
|
-
switchToSubscriptionEnabled:
|
|
2735
|
-
tracking:
|
|
2736
|
-
enableAttribution:
|
|
2737
|
-
enableSource:
|
|
2738
|
-
enableWidget:
|
|
2829
|
+
switchToSubscriptionEnabled: z33.boolean().optional(),
|
|
2830
|
+
tracking: z33.object({
|
|
2831
|
+
enableAttribution: z33.boolean().optional(),
|
|
2832
|
+
enableSource: z33.boolean().optional(),
|
|
2833
|
+
enableWidget: z33.boolean().optional()
|
|
2739
2834
|
}).optional(),
|
|
2740
|
-
type:
|
|
2741
|
-
version:
|
|
2835
|
+
type: z33.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor),
|
|
2836
|
+
version: z33.literal(1)
|
|
2742
2837
|
});
|
|
2743
|
-
var LineItemEditor =
|
|
2838
|
+
var LineItemEditor = z33.discriminatedUnion("version", [
|
|
2744
2839
|
LineItemEditorV1,
|
|
2745
2840
|
CABRootSection.extend({
|
|
2746
|
-
type:
|
|
2841
|
+
type: z33.literal(WidgetType.ui_extension_line_item_editor).default(WidgetType.ui_extension_line_item_editor)
|
|
2747
2842
|
})
|
|
2748
2843
|
]);
|
|
2749
2844
|
|
|
2750
2845
|
// src/schema/widgets/progressBar.ts
|
|
2751
|
-
import { z as
|
|
2752
|
-
var ProgressBar =
|
|
2753
|
-
type:
|
|
2846
|
+
import { z as z34 } from "zod";
|
|
2847
|
+
var ProgressBar = z34.looseObject({
|
|
2848
|
+
type: z34.literal(WidgetType.ui_extension_progress_bar).default(WidgetType.ui_extension_progress_bar)
|
|
2754
2849
|
});
|
|
2755
2850
|
|
|
2756
2851
|
// src/schema/widgets/rebuyButton.ts
|
|
2757
|
-
import { z as
|
|
2758
|
-
var RebuyButtonV1 =
|
|
2759
|
-
type:
|
|
2760
|
-
version:
|
|
2852
|
+
import { z as z35 } from "zod";
|
|
2853
|
+
var RebuyButtonV1 = z35.looseObject({
|
|
2854
|
+
type: z35.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button),
|
|
2855
|
+
version: z35.literal(1)
|
|
2761
2856
|
});
|
|
2762
|
-
var RebuyButton =
|
|
2857
|
+
var RebuyButton = z35.discriminatedUnion("version", [
|
|
2763
2858
|
RebuyButtonV1,
|
|
2764
2859
|
CABRootSection.extend({
|
|
2765
|
-
type:
|
|
2860
|
+
type: z35.literal(WidgetType.ui_extension_button).default(WidgetType.ui_extension_button)
|
|
2766
2861
|
})
|
|
2767
2862
|
]);
|
|
2768
2863
|
|
|
2769
2864
|
// src/schema/widgets/rebuyMonetize.ts
|
|
2770
|
-
import { z as
|
|
2771
|
-
var RebuyMonetize =
|
|
2772
|
-
type:
|
|
2865
|
+
import { z as z36 } from "zod";
|
|
2866
|
+
var RebuyMonetize = z36.looseObject({
|
|
2867
|
+
type: z36.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad)
|
|
2773
2868
|
});
|
|
2774
|
-
var RebuyMonetizeV1 =
|
|
2775
|
-
name:
|
|
2776
|
-
previewMode:
|
|
2869
|
+
var RebuyMonetizeV1 = z36.object({
|
|
2870
|
+
name: z36.string().nullable().optional(),
|
|
2871
|
+
previewMode: z36.boolean().optional(),
|
|
2777
2872
|
/** Privacy Policy footer href → the marker section's `privacyPolicyUrl`. */
|
|
2778
|
-
privacyPolicyUrl:
|
|
2873
|
+
privacyPolicyUrl: z36.string().nullable().optional(),
|
|
2779
2874
|
/** Ads-taxonomy sub-vertical id — one of the admin Monetize editor's two configurables. */
|
|
2780
|
-
subVertical:
|
|
2781
|
-
tracking:
|
|
2782
|
-
enableAttribution:
|
|
2783
|
-
enableSource:
|
|
2784
|
-
enableWidget:
|
|
2875
|
+
subVertical: z36.string().nullable().optional(),
|
|
2876
|
+
tracking: z36.object({
|
|
2877
|
+
enableAttribution: z36.boolean().optional(),
|
|
2878
|
+
enableSource: z36.boolean().optional(),
|
|
2879
|
+
enableWidget: z36.boolean().optional()
|
|
2785
2880
|
}).optional(),
|
|
2786
|
-
type:
|
|
2787
|
-
version:
|
|
2881
|
+
type: z36.literal(WidgetType.ui_extension_ad).default(WidgetType.ui_extension_ad),
|
|
2882
|
+
version: z36.literal(1),
|
|
2788
2883
|
/** Ads-taxonomy vertical id — one of the admin Monetize editor's two configurables. */
|
|
2789
|
-
vertical:
|
|
2884
|
+
vertical: z36.string().nullable().optional()
|
|
2790
2885
|
});
|
|
2791
2886
|
|
|
2792
2887
|
// src/schema/widgetData.ts
|
|
@@ -2800,7 +2895,7 @@ var extensionWidgetTypes = [
|
|
|
2800
2895
|
WidgetType.ui_extension_line_item_editor,
|
|
2801
2896
|
WidgetType.ui_extension_progress_bar
|
|
2802
2897
|
];
|
|
2803
|
-
var WidgetData =
|
|
2898
|
+
var WidgetData = z37.discriminatedUnion("type", [
|
|
2804
2899
|
ABTestingPlaceholder,
|
|
2805
2900
|
CheckoutExtension,
|
|
2806
2901
|
ContentBlock,
|
|
@@ -3129,15 +3224,15 @@ var SWITCH_LABELS = {
|
|
|
3129
3224
|
|
|
3130
3225
|
// src/schema/widgets/post-purchase-offer/common.ts
|
|
3131
3226
|
import { replace, toNumber, toString } from "es-toolkit/compat";
|
|
3132
|
-
import { z as
|
|
3133
|
-
var strictNumber =
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3227
|
+
import { z as z38 } from "zod";
|
|
3228
|
+
var strictNumber = z38.union([
|
|
3229
|
+
z38.number(),
|
|
3230
|
+
z38.string().transform((value) => toNumber(replace(toString(value), /[^0-9.]/g, "")) || 0),
|
|
3231
|
+
z38.unknown().transform(() => 0)
|
|
3137
3232
|
]);
|
|
3138
3233
|
|
|
3139
3234
|
// src/schema/widgets/post-purchase-offer/constants.ts
|
|
3140
|
-
import { z as
|
|
3235
|
+
import { z as z39 } from "zod";
|
|
3141
3236
|
var blockTypes = [
|
|
3142
3237
|
"callout_banner",
|
|
3143
3238
|
"image",
|
|
@@ -3148,144 +3243,144 @@ var blockTypes = [
|
|
|
3148
3243
|
"text",
|
|
3149
3244
|
"timer"
|
|
3150
3245
|
];
|
|
3151
|
-
var blockType =
|
|
3246
|
+
var blockType = z39.enum(blockTypes);
|
|
3152
3247
|
var BlockType = blockType.enum;
|
|
3153
3248
|
|
|
3154
3249
|
// src/schema/widgets/post-purchase-offer/postPurchaseBlocks.ts
|
|
3155
3250
|
import { get as get3, isEqual } from "es-toolkit/compat";
|
|
3156
3251
|
import { v4 as uuidv42 } from "uuid";
|
|
3157
|
-
import { z as
|
|
3158
|
-
var TextAlignment2 =
|
|
3159
|
-
var TextSize =
|
|
3160
|
-
|
|
3161
|
-
|
|
3252
|
+
import { z as z40 } from "zod";
|
|
3253
|
+
var TextAlignment2 = z40.union([z40.enum(["leading", "center", "trailing"]), z40.unknown().transform(() => "leading")]);
|
|
3254
|
+
var TextSize = z40.union([
|
|
3255
|
+
z40.enum(["xsmall", "small", "base", "default", "medium", "large", "xlarge"]),
|
|
3256
|
+
z40.unknown().transform(() => "medium")
|
|
3162
3257
|
]);
|
|
3163
|
-
var CalloutBannerBlock =
|
|
3164
|
-
id:
|
|
3165
|
-
name:
|
|
3166
|
-
settings:
|
|
3167
|
-
superTitle:
|
|
3168
|
-
title:
|
|
3258
|
+
var CalloutBannerBlock = z40.object({
|
|
3259
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3260
|
+
name: z40.string().optional(),
|
|
3261
|
+
settings: z40.object({
|
|
3262
|
+
superTitle: z40.union([z40.string(), TiptapDocument]).default(() => "Limited-time Offer"),
|
|
3263
|
+
title: z40.union([z40.string(), TiptapDocument]).default(() => "Add this customer favorite to your order")
|
|
3169
3264
|
}),
|
|
3170
|
-
styles:
|
|
3171
|
-
superTitleEmphasized:
|
|
3265
|
+
styles: z40.object({
|
|
3266
|
+
superTitleEmphasized: z40.boolean().default(false),
|
|
3172
3267
|
superTitleSize: TextSize.default("large"),
|
|
3173
3268
|
textAlignment: TextAlignment2.default("center"),
|
|
3174
|
-
titleEmphasized:
|
|
3269
|
+
titleEmphasized: z40.boolean().default(true),
|
|
3175
3270
|
titleSize: TextSize.default("large")
|
|
3176
3271
|
}),
|
|
3177
|
-
type:
|
|
3272
|
+
type: z40.literal(BlockType.callout_banner).default(BlockType.callout_banner)
|
|
3178
3273
|
});
|
|
3179
|
-
var ImageBlock =
|
|
3180
|
-
id:
|
|
3181
|
-
name:
|
|
3182
|
-
settings:
|
|
3183
|
-
|
|
3274
|
+
var ImageBlock = z40.object({
|
|
3275
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3276
|
+
name: z40.string().optional(),
|
|
3277
|
+
settings: z40.union([
|
|
3278
|
+
z40.object({
|
|
3184
3279
|
/** This isn't used in the post-purchase offer widget */
|
|
3185
|
-
alt:
|
|
3186
|
-
image:
|
|
3187
|
-
imageSize:
|
|
3188
|
-
imageType:
|
|
3280
|
+
alt: z40.string().optional().default(""),
|
|
3281
|
+
image: z40.union([z40.literal(""), z40.url()]).default(""),
|
|
3282
|
+
imageSize: z40.number().default(20),
|
|
3283
|
+
imageType: z40.enum(["URL", "UPLOAD"]).default("URL")
|
|
3189
3284
|
}),
|
|
3190
|
-
|
|
3285
|
+
z40.array(z40.never()).transform(() => ({}))
|
|
3191
3286
|
]),
|
|
3192
|
-
type:
|
|
3287
|
+
type: z40.literal(BlockType.image).default(BlockType.image)
|
|
3193
3288
|
});
|
|
3194
|
-
var ImageContentBlock =
|
|
3195
|
-
id:
|
|
3196
|
-
name:
|
|
3197
|
-
settings:
|
|
3198
|
-
alt:
|
|
3199
|
-
description:
|
|
3289
|
+
var ImageContentBlock = z40.object({
|
|
3290
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3291
|
+
name: z40.string().optional(),
|
|
3292
|
+
settings: z40.object({
|
|
3293
|
+
alt: z40.string().optional().default(""),
|
|
3294
|
+
description: z40.union([z40.string(), TiptapDocument, z40.null()]).default(
|
|
3200
3295
|
"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."
|
|
3201
3296
|
),
|
|
3202
3297
|
descriptionSize: TextSize.default("medium"),
|
|
3203
3298
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3204
|
-
image:
|
|
3205
|
-
imagePlacement:
|
|
3206
|
-
imageSize:
|
|
3207
|
-
superTitle:
|
|
3299
|
+
image: z40.union([z40.literal(""), z40.url()]).default(""),
|
|
3300
|
+
imagePlacement: z40.enum(["bottom", "left", "right", "top"]).optional().default("left"),
|
|
3301
|
+
imageSize: z40.number().default(20),
|
|
3302
|
+
superTitle: z40.union([z40.string(), TiptapDocument]).default("Lorem Ipsum!"),
|
|
3208
3303
|
superTitleSize: TextSize.default("medium"),
|
|
3209
3304
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3210
|
-
swapContent:
|
|
3211
|
-
title:
|
|
3305
|
+
swapContent: z40.boolean().optional().default(false),
|
|
3306
|
+
title: z40.union([z40.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet"),
|
|
3212
3307
|
titleSize: TextSize.default("medium")
|
|
3213
3308
|
}),
|
|
3214
|
-
type:
|
|
3309
|
+
type: z40.literal(BlockType.image_content).default(BlockType.image_content)
|
|
3215
3310
|
});
|
|
3216
|
-
var PayButtonBlock =
|
|
3217
|
-
id:
|
|
3218
|
-
name:
|
|
3219
|
-
settings:
|
|
3220
|
-
|
|
3221
|
-
label:
|
|
3311
|
+
var PayButtonBlock = z40.object({
|
|
3312
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3313
|
+
name: z40.string().optional(),
|
|
3314
|
+
settings: z40.union([
|
|
3315
|
+
z40.object({
|
|
3316
|
+
label: z40.string().default("Pay Now")
|
|
3222
3317
|
}),
|
|
3223
|
-
|
|
3318
|
+
z40.array(z40.never()).transform(() => ({
|
|
3224
3319
|
label: "Pay Now"
|
|
3225
3320
|
}))
|
|
3226
3321
|
]),
|
|
3227
|
-
styles:
|
|
3228
|
-
|
|
3229
|
-
buttonWidth:
|
|
3322
|
+
styles: z40.union([
|
|
3323
|
+
z40.object({
|
|
3324
|
+
buttonWidth: z40.number().min(10).max(100).default(50)
|
|
3230
3325
|
}),
|
|
3231
|
-
|
|
3326
|
+
z40.array(z40.never()).transform(() => ({
|
|
3232
3327
|
buttonWidth: 50
|
|
3233
3328
|
}))
|
|
3234
3329
|
]),
|
|
3235
|
-
type:
|
|
3330
|
+
type: z40.literal(BlockType.pay_button).default(BlockType.pay_button)
|
|
3236
3331
|
});
|
|
3237
|
-
var ProductInformationBlock =
|
|
3332
|
+
var ProductInformationBlock = z40.object({
|
|
3238
3333
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3239
|
-
hideProductImage:
|
|
3240
|
-
id:
|
|
3241
|
-
name:
|
|
3242
|
-
type:
|
|
3334
|
+
hideProductImage: z40.boolean().optional().default(false),
|
|
3335
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3336
|
+
name: z40.string().optional(),
|
|
3337
|
+
type: z40.literal(BlockType.product_information).default(BlockType.product_information)
|
|
3243
3338
|
});
|
|
3244
|
-
var SeparatorBlock =
|
|
3245
|
-
id:
|
|
3246
|
-
name:
|
|
3247
|
-
type:
|
|
3339
|
+
var SeparatorBlock = z40.object({
|
|
3340
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3341
|
+
name: z40.string().optional(),
|
|
3342
|
+
type: z40.literal(BlockType.separator).default(BlockType.separator)
|
|
3248
3343
|
});
|
|
3249
|
-
var TextBlock =
|
|
3250
|
-
id:
|
|
3251
|
-
name:
|
|
3252
|
-
settings:
|
|
3253
|
-
description:
|
|
3344
|
+
var TextBlock = z40.object({
|
|
3345
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3346
|
+
name: z40.string().optional(),
|
|
3347
|
+
settings: z40.object({
|
|
3348
|
+
description: z40.union([z40.string(), TiptapDocument]).optional().default(
|
|
3254
3349
|
"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."
|
|
3255
3350
|
),
|
|
3256
3351
|
/** This isn't used in the post-purchase offer widget */
|
|
3257
3352
|
descriptionSize: TextSize.default("medium"),
|
|
3258
3353
|
horizontalAlignment: TextAlignment2.default("leading"),
|
|
3259
|
-
superTitle:
|
|
3354
|
+
superTitle: z40.union([z40.string(), TiptapDocument]).default("Super Title"),
|
|
3260
3355
|
/** This isn't used in the post-purchase offer widget */
|
|
3261
3356
|
superTitleSize: TextSize.default("medium"),
|
|
3262
|
-
title:
|
|
3357
|
+
title: z40.union([z40.string(), TiptapDocument]).nullable().default("Lorem ipsum dolor sit amet."),
|
|
3263
3358
|
/** This isn't used in the post-purchase offer widget */
|
|
3264
3359
|
titleSize: TextSize.default("medium")
|
|
3265
3360
|
}),
|
|
3266
|
-
type:
|
|
3361
|
+
type: z40.literal(BlockType.text).default(BlockType.text)
|
|
3267
3362
|
});
|
|
3268
|
-
var TimerBlock =
|
|
3269
|
-
id:
|
|
3270
|
-
name:
|
|
3271
|
-
settings:
|
|
3272
|
-
durationMinutes:
|
|
3273
|
-
durationSeconds:
|
|
3274
|
-
endOffer:
|
|
3275
|
-
title:
|
|
3363
|
+
var TimerBlock = z40.object({
|
|
3364
|
+
id: z40.string().optional().default(() => uuidv42()),
|
|
3365
|
+
name: z40.string().optional(),
|
|
3366
|
+
settings: z40.object({
|
|
3367
|
+
durationMinutes: z40.number().min(0).default(10),
|
|
3368
|
+
durationSeconds: z40.union([z40.number().min(0), z40.unknown().transform(() => 0)]).default(0),
|
|
3369
|
+
endOffer: z40.boolean().default(true),
|
|
3370
|
+
title: z40.union([z40.string(), TiptapDocument]).default("Hurry \u2014 your special offer ends in:")
|
|
3276
3371
|
}),
|
|
3277
|
-
styles:
|
|
3372
|
+
styles: z40.object({
|
|
3278
3373
|
textAlignment: TextAlignment2.default("center"),
|
|
3279
|
-
timerBackgroundColor:
|
|
3280
|
-
timerEmphasized:
|
|
3374
|
+
timerBackgroundColor: z40.enum(["info", "warning", "success", "critical"]).default("warning"),
|
|
3375
|
+
timerEmphasized: z40.union([z40.boolean(), z40.unknown().transform(() => true)]).default(true),
|
|
3281
3376
|
timerSize: TextSize.default("medium"),
|
|
3282
|
-
timerWidth:
|
|
3283
|
-
titleEmphasized:
|
|
3377
|
+
timerWidth: z40.number().min(10).max(100).optional().default(100),
|
|
3378
|
+
titleEmphasized: z40.union([z40.boolean(), z40.unknown().transform(() => true)]).default(false),
|
|
3284
3379
|
titleSize: TextSize.default("medium")
|
|
3285
3380
|
}),
|
|
3286
|
-
type:
|
|
3381
|
+
type: z40.literal(BlockType.timer).default(BlockType.timer)
|
|
3287
3382
|
});
|
|
3288
|
-
var PostPurchaseBlock =
|
|
3383
|
+
var PostPurchaseBlock = z40.discriminatedUnion("type", [
|
|
3289
3384
|
CalloutBannerBlock,
|
|
3290
3385
|
ImageBlock,
|
|
3291
3386
|
ImageContentBlock,
|
|
@@ -3305,68 +3400,68 @@ var isTextBlock = (block) => isEqual(get3(block, "type"), BlockType.text);
|
|
|
3305
3400
|
var isTimerBlock = (block) => isEqual(get3(block, "type"), BlockType.timer);
|
|
3306
3401
|
|
|
3307
3402
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3308
|
-
import { z as
|
|
3403
|
+
import { z as z43 } from "zod";
|
|
3309
3404
|
|
|
3310
3405
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3311
|
-
import { z as
|
|
3406
|
+
import { z as z42 } from "zod";
|
|
3312
3407
|
|
|
3313
3408
|
// src/schema/widgets/post-purchase-offer/postPurchaseSettings.ts
|
|
3314
|
-
import { z as
|
|
3315
|
-
var PostPurchaseSettings =
|
|
3316
|
-
advance:
|
|
3317
|
-
blocks:
|
|
3409
|
+
import { z as z41 } from "zod";
|
|
3410
|
+
var PostPurchaseSettings = z41.object({
|
|
3411
|
+
advance: z41.object({ removePartialOrder: z41.boolean().default(true) }).optional().default(() => ({ removePartialOrder: true })),
|
|
3412
|
+
blocks: z41.union([z41.array(PostPurchaseBlock), z41.unknown().transform(() => [])]).default(() => [
|
|
3318
3413
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.timer }),
|
|
3319
3414
|
PostPurchaseBlock.parse({ settings: {}, styles: {}, type: BlockType.callout_banner }),
|
|
3320
3415
|
PostPurchaseBlock.parse({ type: BlockType.product_information })
|
|
3321
3416
|
]),
|
|
3322
|
-
columnLayout:
|
|
3323
|
-
discount:
|
|
3417
|
+
columnLayout: z41.boolean().optional(),
|
|
3418
|
+
discount: z41.object({
|
|
3324
3419
|
amount: strictNumber.default(30),
|
|
3325
|
-
shouldShowSavingText:
|
|
3326
|
-
type:
|
|
3420
|
+
shouldShowSavingText: z41.boolean().optional().default(true),
|
|
3421
|
+
type: z41.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3327
3422
|
}),
|
|
3328
|
-
discountedFrom:
|
|
3329
|
-
endpoint:
|
|
3330
|
-
integrations:
|
|
3331
|
-
judgeme:
|
|
3332
|
-
junip:
|
|
3333
|
-
klaviyo:
|
|
3334
|
-
loox:
|
|
3335
|
-
okendo:
|
|
3336
|
-
opinew:
|
|
3337
|
-
reviewsio:
|
|
3338
|
-
stamped:
|
|
3339
|
-
yotpo:
|
|
3423
|
+
discountedFrom: z41.enum(["price", "compare_at_price"]).optional().default("price"),
|
|
3424
|
+
endpoint: z41.string().optional(),
|
|
3425
|
+
integrations: z41.object({
|
|
3426
|
+
judgeme: z41.boolean().default(false),
|
|
3427
|
+
junip: z41.boolean().optional().default(false),
|
|
3428
|
+
klaviyo: z41.boolean().default(false),
|
|
3429
|
+
loox: z41.boolean().default(false),
|
|
3430
|
+
okendo: z41.boolean().default(false),
|
|
3431
|
+
opinew: z41.boolean().optional().default(false),
|
|
3432
|
+
reviewsio: z41.boolean().optional().default(false),
|
|
3433
|
+
stamped: z41.boolean().default(false),
|
|
3434
|
+
yotpo: z41.boolean().default(false)
|
|
3340
3435
|
}),
|
|
3341
|
-
key:
|
|
3342
|
-
language:
|
|
3343
|
-
description:
|
|
3344
|
-
descriptionEnabled:
|
|
3345
|
-
descriptionRte:
|
|
3346
|
-
content:
|
|
3347
|
-
type:
|
|
3436
|
+
key: z41.string().optional(),
|
|
3437
|
+
language: z41.object({
|
|
3438
|
+
description: z41.union([z41.string(), z41.unknown().transform(() => "")]).default(""),
|
|
3439
|
+
descriptionEnabled: z41.boolean().optional().default(false),
|
|
3440
|
+
descriptionRte: z41.object({
|
|
3441
|
+
content: z41.array(z41.unknown()),
|
|
3442
|
+
type: z41.string()
|
|
3348
3443
|
}).optional(),
|
|
3349
|
-
descriptionSpacing:
|
|
3350
|
-
displayCtaPrice:
|
|
3351
|
-
global:
|
|
3352
|
-
declineAll:
|
|
3353
|
-
declineThisOffer:
|
|
3354
|
-
free:
|
|
3355
|
-
notAvailable:
|
|
3356
|
-
payNow:
|
|
3357
|
-
payNowUpgradeToSubscription:
|
|
3358
|
-
quantity:
|
|
3444
|
+
descriptionSpacing: z41.enum(["none", "xtight", "tight", "default", "loose", "xloose"]).optional(),
|
|
3445
|
+
displayCtaPrice: z41.boolean().default(true),
|
|
3446
|
+
global: z41.object({
|
|
3447
|
+
declineAll: z41.string().optional().default("Decline All"),
|
|
3448
|
+
declineThisOffer: z41.string().default("Decline this offer"),
|
|
3449
|
+
free: z41.string().optional().default("Free"),
|
|
3450
|
+
notAvailable: z41.string().optional().default("Not available"),
|
|
3451
|
+
payNow: z41.string().default("Pay Now"),
|
|
3452
|
+
payNowUpgradeToSubscription: z41.string().optional().default("Upgrade to Subscription"),
|
|
3453
|
+
quantity: z41.string().default("Quantity"),
|
|
3359
3454
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3360
|
-
recurringShipping:
|
|
3361
|
-
recurringSubtotal:
|
|
3362
|
-
reviewsPlural:
|
|
3363
|
-
reviewsSingular:
|
|
3364
|
-
save:
|
|
3365
|
-
shipping:
|
|
3366
|
-
subscriptionOption:
|
|
3367
|
-
subtotal:
|
|
3368
|
-
taxes:
|
|
3369
|
-
total:
|
|
3455
|
+
recurringShipping: z41.string().optional().default("Recurring shipping"),
|
|
3456
|
+
recurringSubtotal: z41.string().default("Recurring subtotal"),
|
|
3457
|
+
reviewsPlural: z41.string().optional().default("Reviews"),
|
|
3458
|
+
reviewsSingular: z41.string().optional().default("Review"),
|
|
3459
|
+
save: z41.union([z41.string(), z41.unknown().transform(() => "Save")]).optional().default("Save"),
|
|
3460
|
+
shipping: z41.string().default("Shipping"),
|
|
3461
|
+
subscriptionOption: z41.string().optional().default("Subscribe and Save"),
|
|
3462
|
+
subtotal: z41.string().default("Subtotal"),
|
|
3463
|
+
taxes: z41.string().default("Taxes"),
|
|
3464
|
+
total: z41.string().default("Total")
|
|
3370
3465
|
}).optional().default(() => ({
|
|
3371
3466
|
declineAll: "Decline All",
|
|
3372
3467
|
declineThisOffer: "Decline this offer",
|
|
@@ -3387,70 +3482,70 @@ var PostPurchaseSettings = z40.object({
|
|
|
3387
3482
|
taxes: "Taxes",
|
|
3388
3483
|
total: "Total"
|
|
3389
3484
|
})),
|
|
3390
|
-
globalTranslation:
|
|
3485
|
+
globalTranslation: z41.string().optional().default("english")
|
|
3391
3486
|
}),
|
|
3392
|
-
metafields:
|
|
3487
|
+
metafields: z41.boolean().default(false),
|
|
3393
3488
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3394
|
-
offer:
|
|
3395
|
-
count:
|
|
3489
|
+
offer: z41.object({
|
|
3490
|
+
count: z41.number().default(1)
|
|
3396
3491
|
}),
|
|
3397
|
-
offersLayout:
|
|
3398
|
-
itemsPerPage:
|
|
3399
|
-
type:
|
|
3492
|
+
offersLayout: z41.object({
|
|
3493
|
+
itemsPerPage: z41.number().optional(),
|
|
3494
|
+
type: z41.enum(["list", "grid", "carousel"]).default("list")
|
|
3400
3495
|
}).optional().default({
|
|
3401
3496
|
type: "list"
|
|
3402
3497
|
}),
|
|
3403
3498
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3404
|
-
previewMode:
|
|
3405
|
-
productLimit:
|
|
3406
|
-
productOptions:
|
|
3499
|
+
previewMode: z41.boolean().default(false),
|
|
3500
|
+
productLimit: z41.number().optional().default(1),
|
|
3501
|
+
productOptions: z41.object({
|
|
3407
3502
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3408
|
-
hideOutOfStockVariants:
|
|
3409
|
-
matchVariant:
|
|
3410
|
-
showDeclineAll:
|
|
3411
|
-
showShipping:
|
|
3412
|
-
showSubtotal:
|
|
3413
|
-
showTaxes:
|
|
3414
|
-
showTotal:
|
|
3415
|
-
showVariantSelectors:
|
|
3416
|
-
variantSelectorDisplayMode:
|
|
3503
|
+
hideOutOfStockVariants: z41.boolean().optional().default(false),
|
|
3504
|
+
matchVariant: z41.boolean().optional().default(true),
|
|
3505
|
+
showDeclineAll: z41.enum(["above", "below", "both", "none"]).optional(),
|
|
3506
|
+
showShipping: z41.boolean().optional().default(true),
|
|
3507
|
+
showSubtotal: z41.boolean().optional().default(true),
|
|
3508
|
+
showTaxes: z41.boolean().optional().default(true),
|
|
3509
|
+
showTotal: z41.boolean().optional().default(true),
|
|
3510
|
+
showVariantSelectors: z41.boolean().optional().default(true),
|
|
3511
|
+
variantSelectorDisplayMode: z41.enum(["separate", "single"]).optional().default("separate")
|
|
3417
3512
|
}),
|
|
3418
|
-
productType:
|
|
3419
|
-
productTypeSelector:
|
|
3420
|
-
quantityInputs:
|
|
3421
|
-
defaultQuantity:
|
|
3422
|
-
enabled:
|
|
3423
|
-
maxValue:
|
|
3424
|
-
minValue:
|
|
3513
|
+
productType: z41.union([z41.enum(["one-time", "subscription", "both"]), z41.literal("").transform(() => "one-time")]).default("one-time"),
|
|
3514
|
+
productTypeSelector: z41.enum(["dropdown", "radio"]).optional().default("radio"),
|
|
3515
|
+
quantityInputs: z41.object({
|
|
3516
|
+
defaultQuantity: z41.union([z41.number(), z41.null().transform(() => 1)]).default(1),
|
|
3517
|
+
enabled: z41.boolean().default(true),
|
|
3518
|
+
maxValue: z41.union([z41.number(), z41.null().transform(() => 15)]).default(15),
|
|
3519
|
+
minValue: z41.union([z41.number().min(0), z41.unknown().transform(() => 0)]).default(1)
|
|
3425
3520
|
}),
|
|
3426
|
-
shipping:
|
|
3521
|
+
shipping: z41.object({
|
|
3427
3522
|
amount: strictNumber.default(10),
|
|
3428
3523
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3429
|
-
enabled:
|
|
3430
|
-
title:
|
|
3431
|
-
type:
|
|
3524
|
+
enabled: z41.boolean().default(true),
|
|
3525
|
+
title: z41.string().optional().default("Shipping Fees"),
|
|
3526
|
+
type: z41.enum(["free", "fixed_amount"]).default("free")
|
|
3432
3527
|
}),
|
|
3433
|
-
styles:
|
|
3434
|
-
starColor:
|
|
3435
|
-
starSize:
|
|
3436
|
-
starStrokeColor:
|
|
3437
|
-
strokeWidth:
|
|
3528
|
+
styles: z41.object({
|
|
3529
|
+
starColor: z41.string().optional().default("#fadb14"),
|
|
3530
|
+
starSize: z41.union([z41.enum(["small", "medium", "large"]), z41.unknown().transform(() => "large")]).optional().default("large"),
|
|
3531
|
+
starStrokeColor: z41.string().optional().default("#fadb14"),
|
|
3532
|
+
strokeWidth: z41.string().optional().default("1")
|
|
3438
3533
|
}).optional(),
|
|
3439
|
-
subImages:
|
|
3440
|
-
subscription:
|
|
3441
|
-
discount:
|
|
3534
|
+
subImages: z41.number().nullish().default(8),
|
|
3535
|
+
subscription: z41.object({
|
|
3536
|
+
discount: z41.object({
|
|
3442
3537
|
amount: strictNumber.default(30),
|
|
3443
|
-
shouldShowSavingText:
|
|
3444
|
-
type:
|
|
3538
|
+
shouldShowSavingText: z41.boolean().optional().default(true),
|
|
3539
|
+
type: z41.enum(["none", "fixed_amount", "percentage"]).default("none")
|
|
3445
3540
|
}),
|
|
3446
|
-
shipping:
|
|
3541
|
+
shipping: z41.object({
|
|
3447
3542
|
amount: strictNumber.default(1),
|
|
3448
3543
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3449
|
-
enabled:
|
|
3544
|
+
enabled: z41.boolean().default(true),
|
|
3450
3545
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3451
3546
|
recurringAmount: strictNumber.default(2),
|
|
3452
|
-
shippingTitle:
|
|
3453
|
-
type:
|
|
3547
|
+
shippingTitle: z41.string().default("Shipping Fees"),
|
|
3548
|
+
type: z41.enum(["free", "fixed_amount"]).default("free")
|
|
3454
3549
|
})
|
|
3455
3550
|
}).optional().default({
|
|
3456
3551
|
discount: {
|
|
@@ -3468,15 +3563,15 @@ var PostPurchaseSettings = z40.object({
|
|
|
3468
3563
|
type: "free"
|
|
3469
3564
|
}
|
|
3470
3565
|
}),
|
|
3471
|
-
subscriptionIsDefault:
|
|
3566
|
+
subscriptionIsDefault: z41.boolean().optional(),
|
|
3472
3567
|
/** This isn't configurable in the admin-nextjs editor */
|
|
3473
|
-
template:
|
|
3474
|
-
type:
|
|
3475
|
-
upgradeToSubscription:
|
|
3476
|
-
acceptButtonText:
|
|
3477
|
-
allow:
|
|
3478
|
-
emailRefundNotice:
|
|
3479
|
-
errorBannerText:
|
|
3568
|
+
template: z41.string().optional().default(""),
|
|
3569
|
+
type: z41.literal("shopify_post_purchase_extension").default("shopify_post_purchase_extension"),
|
|
3570
|
+
upgradeToSubscription: z41.object({
|
|
3571
|
+
acceptButtonText: z41.string().optional().default("Upgrade"),
|
|
3572
|
+
allow: z41.boolean().optional().default(false),
|
|
3573
|
+
emailRefundNotice: z41.boolean().optional().default(false),
|
|
3574
|
+
errorBannerText: z41.string().optional().default("This subscription cannot be added - limit one per order")
|
|
3480
3575
|
}).optional().default(() => ({
|
|
3481
3576
|
acceptButtonText: "Upgrade",
|
|
3482
3577
|
allow: false,
|
|
@@ -3486,32 +3581,32 @@ var PostPurchaseSettings = z40.object({
|
|
|
3486
3581
|
});
|
|
3487
3582
|
|
|
3488
3583
|
// src/schema/widgets/post-purchase-offer/postPurchaseWidget.ts
|
|
3489
|
-
var PostPurchaseWidgetLinkedFlow =
|
|
3490
|
-
id:
|
|
3491
|
-
name:
|
|
3584
|
+
var PostPurchaseWidgetLinkedFlow = z42.object({
|
|
3585
|
+
id: z42.number(),
|
|
3586
|
+
name: z42.string()
|
|
3492
3587
|
});
|
|
3493
|
-
var PostPurchaseWidget =
|
|
3494
|
-
classification:
|
|
3495
|
-
createdAtTime:
|
|
3496
|
-
customEndpointName:
|
|
3497
|
-
id:
|
|
3498
|
-
lastViewed:
|
|
3499
|
-
linkedCustomEndpointId:
|
|
3500
|
-
linkedFlows:
|
|
3501
|
-
name:
|
|
3502
|
-
owner:
|
|
3588
|
+
var PostPurchaseWidget = z42.object({
|
|
3589
|
+
classification: z42.literal("post_purchase_offer_page").default("post_purchase_offer_page"),
|
|
3590
|
+
createdAtTime: z42.iso.datetime({ offset: true }).optional(),
|
|
3591
|
+
customEndpointName: z42.string().nullish(),
|
|
3592
|
+
id: z42.number().default(0),
|
|
3593
|
+
lastViewed: z42.iso.datetime({ offset: true }).nullish(),
|
|
3594
|
+
linkedCustomEndpointId: z42.number().nullish(),
|
|
3595
|
+
linkedFlows: z42.array(PostPurchaseWidgetLinkedFlow).optional(),
|
|
3596
|
+
name: z42.string().default(""),
|
|
3597
|
+
owner: z42.number().nullish(),
|
|
3503
3598
|
settings: PostPurchaseSettings
|
|
3504
3599
|
});
|
|
3505
3600
|
|
|
3506
3601
|
// src/schema/widgets/post-purchase-offer/postPurchaseOffer.ts
|
|
3507
|
-
var PostPurchaseOffer =
|
|
3508
|
-
|
|
3509
|
-
errors:
|
|
3510
|
-
message:
|
|
3511
|
-
successful:
|
|
3602
|
+
var PostPurchaseOffer = z43.discriminatedUnion("successful", [
|
|
3603
|
+
z43.strictObject({
|
|
3604
|
+
errors: z43.array(z43.object({ message: z43.string() })),
|
|
3605
|
+
message: z43.string(),
|
|
3606
|
+
successful: z43.literal(false)
|
|
3512
3607
|
}),
|
|
3513
|
-
|
|
3514
|
-
successful:
|
|
3608
|
+
z43.strictObject({
|
|
3609
|
+
successful: z43.literal(true),
|
|
3515
3610
|
widget: PostPurchaseWidget
|
|
3516
3611
|
})
|
|
3517
3612
|
]);
|
|
@@ -4462,6 +4557,7 @@ export {
|
|
|
4462
4557
|
CABDataSourceSection,
|
|
4463
4558
|
CABDiscount,
|
|
4464
4559
|
CABDiscountSection,
|
|
4560
|
+
CABEventTrigger,
|
|
4465
4561
|
CABExperiment,
|
|
4466
4562
|
CABImageSection,
|
|
4467
4563
|
CABImageSectionFields,
|
|
@@ -4474,16 +4570,26 @@ export {
|
|
|
4474
4570
|
CABProgressBarSection,
|
|
4475
4571
|
CABProgressTier,
|
|
4476
4572
|
CABQuantitySection,
|
|
4573
|
+
CABResultCountTrigger,
|
|
4574
|
+
CABResultTagTrigger,
|
|
4477
4575
|
CABReviewsSection,
|
|
4478
4576
|
CABRootSection,
|
|
4479
|
-
|
|
4577
|
+
CABRuleset,
|
|
4578
|
+
CABRulesetEntry,
|
|
4480
4579
|
CABSection,
|
|
4481
4580
|
CABTextSection,
|
|
4482
4581
|
CABTextTier,
|
|
4483
4582
|
CABTracking,
|
|
4484
4583
|
CABUILabels,
|
|
4584
|
+
CABVariable,
|
|
4585
|
+
CABVariableEffect,
|
|
4586
|
+
CABVariableFields,
|
|
4587
|
+
CABVariableMutator,
|
|
4588
|
+
CABVariableSeed,
|
|
4589
|
+
CABVariableTrigger,
|
|
4485
4590
|
CABVariantContent,
|
|
4486
4591
|
CABVariantsSection,
|
|
4592
|
+
CABVisibility,
|
|
4487
4593
|
COMBINED_ENDPOINTS,
|
|
4488
4594
|
CabActiveExperiment,
|
|
4489
4595
|
CabShopConfig,
|
|
@@ -4518,6 +4624,7 @@ export {
|
|
|
4518
4624
|
LineItemEditorSwitchLanguageV1,
|
|
4519
4625
|
LineItemEditorV1,
|
|
4520
4626
|
Metadata,
|
|
4627
|
+
MutatorEvent,
|
|
4521
4628
|
NO_HTML,
|
|
4522
4629
|
OFFER_LABELS,
|
|
4523
4630
|
ObjectFit,
|
|
@@ -4544,6 +4651,8 @@ export {
|
|
|
4544
4651
|
RebuyClient,
|
|
4545
4652
|
RebuyMonetize,
|
|
4546
4653
|
RebuyMonetizeV1,
|
|
4654
|
+
ResultCountOperator,
|
|
4655
|
+
ResultTagOperator,
|
|
4547
4656
|
ReviewsSize,
|
|
4548
4657
|
RuleCondition,
|
|
4549
4658
|
RuleLogicBlock,
|
|
@@ -4573,6 +4682,7 @@ export {
|
|
|
4573
4682
|
TiptapText,
|
|
4574
4683
|
UI_LABELS,
|
|
4575
4684
|
UserConfig,
|
|
4685
|
+
VariableEffect,
|
|
4576
4686
|
VariantMode,
|
|
4577
4687
|
VariantSelector,
|
|
4578
4688
|
VerticalAlignment,
|
|
@@ -4644,6 +4754,7 @@ export {
|
|
|
4644
4754
|
isTimerBlock,
|
|
4645
4755
|
isVariantsType,
|
|
4646
4756
|
languageKeys,
|
|
4757
|
+
mutatorEvents,
|
|
4647
4758
|
objectFits,
|
|
4648
4759
|
offersDirections,
|
|
4649
4760
|
popoverPositionMap,
|
|
@@ -4654,6 +4765,8 @@ export {
|
|
|
4654
4765
|
progressTierUnits,
|
|
4655
4766
|
quantityInputs,
|
|
4656
4767
|
queryStringToObject,
|
|
4768
|
+
resultCountOperators,
|
|
4769
|
+
resultTagOperators,
|
|
4657
4770
|
reviewsSizes,
|
|
4658
4771
|
ruleOperators,
|
|
4659
4772
|
ruleTypes,
|
|
@@ -4672,6 +4785,7 @@ export {
|
|
|
4672
4785
|
textSizeNames,
|
|
4673
4786
|
utmObjectFromString,
|
|
4674
4787
|
uuid,
|
|
4788
|
+
variableEffects,
|
|
4675
4789
|
variantAvailable,
|
|
4676
4790
|
variantMinMaxPriceObject,
|
|
4677
4791
|
variantModes,
|