@rebuy/rebuy 2.34.0 → 2.35.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.js +204 -23
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +204 -23
- package/dist/index.mjs.map +4 -4
- package/dist/schema/checkout-and-beyond/constants.js +2 -0
- package/dist/schema/checkout-and-beyond/constants.js.map +2 -2
- package/dist/schema/checkout-and-beyond/constants.mjs +2 -0
- package/dist/schema/checkout-and-beyond/constants.mjs.map +2 -2
- package/dist/schema/checkout-and-beyond/index.js +183 -6
- package/dist/schema/checkout-and-beyond/index.js.map +3 -3
- package/dist/schema/checkout-and-beyond/index.mjs +183 -6
- package/dist/schema/checkout-and-beyond/index.mjs.map +3 -3
- package/dist/schema/widget-data.js +197 -23
- package/dist/schema/widget-data.js.map +4 -4
- package/dist/schema/widget-data.mjs +197 -23
- package/dist/schema/widget-data.mjs.map +3 -3
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +27 -25
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +5 -0
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +25 -25
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +25 -25
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +3 -1
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts +124 -0
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts.map +1 -0
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +319 -2
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/index.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +25 -25
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +25 -25
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts.map +1 -1
- package/dist/server/index.js +193 -25
- package/dist/server/index.js.map +4 -4
- package/dist/server/index.mjs +193 -25
- package/dist/server/index.mjs.map +4 -4
- package/dist/transforms/index.js +193 -25
- package/dist/transforms/index.js.map +3 -3
- package/dist/transforms/index.mjs +193 -25
- package/dist/transforms/index.mjs.map +3 -3
- package/dist/transforms/smartCart/convertSmartCartProgressBarToV2.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -91,6 +91,7 @@ var borderWidths = ["base", "medium", "thick"];
|
|
|
91
91
|
var BorderWidth = freezeEnum(borderWidths);
|
|
92
92
|
var buttonActions = [
|
|
93
93
|
"acceptOffer",
|
|
94
|
+
"addGift",
|
|
94
95
|
"addToOrder",
|
|
95
96
|
"declineAllOffers",
|
|
96
97
|
"declineOffer",
|
|
@@ -100,6 +101,7 @@ var buttonActions = [
|
|
|
100
101
|
"goToPrevPage",
|
|
101
102
|
"goToURL",
|
|
102
103
|
"removeFromOrder",
|
|
104
|
+
"removeGift",
|
|
103
105
|
"selectVariant",
|
|
104
106
|
"showPagination",
|
|
105
107
|
"switchToSubscription",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/schema/widgets/checkout-and-beyond/common.ts"],
|
|
4
|
-
"sourcesContent": ["export const freezeEnum = <T extends readonly string[]>(values: T) =>\n Object.freeze(Object.fromEntries(values.map((v) => [v, v]))) as { readonly [K in T[number]]: K };\n\nexport const bannerColors = ['info', 'success', 'warning', 'critical'] as const;\nexport const BannerColor = freezeEnum(bannerColors);\nexport type BannerColor = (typeof bannerColors)[number];\n\nexport const borderRadii = ['none', 'small', 'base', 'large', 'fullyRounded'] as const;\nexport const BorderRadius = freezeEnum(borderRadii);\nexport type BorderRadius = (typeof borderRadii)[number];\n\nexport const borderStyles = ['none', 'base', 'dotted', 'dashed'] as const;\nexport const BorderStyle = freezeEnum(borderStyles);\nexport type BorderStyle = (typeof borderStyles)[number];\n\nexport const borderWidths = ['base', 'medium', 'thick'] as const;\nexport const BorderWidth = freezeEnum(borderWidths);\nexport type BorderWidth = (typeof borderWidths)[number];\n\nexport const buttonActions = [\n 'acceptOffer',\n 'addToOrder',\n 'declineAllOffers',\n 'declineOffer',\n 'displayContentInModal',\n 'displayContentInPopover',\n 'goToNextPage',\n 'goToPrevPage',\n 'goToURL',\n 'removeFromOrder',\n 'selectVariant',\n 'showPagination',\n 'switchToSubscription',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonAction = freezeEnum(buttonActions);\nexport type ButtonAction = (typeof buttonActions)[number];\n\nexport const buttonFields = [\n 'activePage',\n 'addedToCart',\n 'addingToCart',\n 'addToCart',\n 'buttonLabel',\n 'declineAllOffers',\n 'declineOffer',\n 'destinationUrl',\n 'inactivePage',\n 'overlayContent',\n 'payNow',\n 'progressReached',\n 'progressRemaining',\n 'redirectToCheckout',\n 'removeFromOrder',\n 'showVariant',\n 'showVariants',\n 'soldOut',\n 'subscriptionOption',\n 'switchToOneTimePurchase',\n 'switchToSubscriptionNoDiscount',\n 'switchToSubscriptionWithDiscount',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonField = freezeEnum(buttonFields);\nexport type ButtonField = (typeof buttonFields)[number];\n\nexport const buttonStyles = ['primary', 'secondary', 'plain', 'custom'] as const;\nexport const ButtonStyle = freezeEnum(buttonStyles);\nexport type ButtonStyle = (typeof buttonStyles)[number];\n\nexport const directions = ['columns', 'rows', 'grid'] as const;\nexport const Direction = freezeEnum(directions);\nexport type Direction = (typeof directions)[number];\n\nexport const discountSources = ['price', 'compare_at_price'] as const;\nexport const DiscountSource = freezeEnum(discountSources);\nexport type DiscountSource = (typeof discountSources)[number];\n\nexport const discountTypes = ['none', 'percentage', 'fixed', 'fixed_amount'] as const;\nexport const DiscountType = freezeEnum(discountTypes);\nexport type DiscountType = (typeof discountTypes)[number];\n\nexport const editorModes = [\n 'checkoutExtension',\n 'postPurchaseOffer',\n 'thankYouPage',\n 'orderStatusPage',\n 'ordersIndexPage',\n 'customerProfilePage',\n] as const;\n\nexport const EditorMode = freezeEnum(editorModes);\nexport type EditorMode = (typeof editorModes)[number];\n\nexport const horizontalAlignments = ['start', 'center', 'end'] as const;\nexport const HorizontalAlignment = freezeEnum(horizontalAlignments);\nexport type HorizontalAlignment = (typeof horizontalAlignments)[number];\n\nexport const languageKeys = [\n 'ar',\n 'cs',\n 'da',\n 'de',\n 'en',\n 'es',\n 'fi',\n 'fr',\n 'ga',\n 'he',\n 'hi',\n 'id',\n 'it',\n 'ja',\n 'ko',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'ru',\n 'sv',\n 'th',\n 'tr',\n 'uk',\n 'vi',\n 'zh',\n] as const;\n\nexport const LanguageKey = freezeEnum(languageKeys);\nexport type LanguageKey = (typeof languageKeys)[number];\n\nexport const objectFits = ['cover', 'contain'] as const;\nexport const ObjectFit = freezeEnum(objectFits);\nexport type ObjectFit = (typeof objectFits)[number];\n\nexport const popoverPositions = ['inlineStart', 'inlineEnd', 'blockStart', 'blockEnd'] as const;\nexport const PopoverPosition = freezeEnum(popoverPositions);\nexport type PopoverPosition = (typeof popoverPositions)[number];\n\nexport const popoverPositionMap = {\n bottom: 'blockEnd',\n left: 'inlineStart',\n right: 'inlineEnd',\n top: 'blockStart',\n} as const;\n\nexport const productTypes = ['one-time', 'subscription', 'both'] as const;\nexport const ProductType = freezeEnum(productTypes);\nexport type ProductType = (typeof productTypes)[number];\n\nexport const progressTierTypes = ['decorative', 'discount', 'product', 'shipping'] as const;\nexport const ProgressTierType = freezeEnum(progressTierTypes);\nexport type ProgressTierType = (typeof progressTierTypes)[number];\n\nexport const progressTierUnits = ['currency', 'item'] as const;\nexport const ProgressTierUnit = freezeEnum(progressTierUnits);\nexport type ProgressTierUnit = (typeof progressTierUnits)[number];\n\nexport const quantityInputs = ['select', 'number'] as const;\nexport const QuantityInput = freezeEnum(quantityInputs);\nexport type QuantityInput = (typeof quantityInputs)[number];\n\nexport const reviewsSizes = ['small', 'default', 'large'] as const;\nexport const ReviewsSize = freezeEnum(reviewsSizes);\nexport type ReviewsSize = (typeof reviewsSizes)[number];\n\nexport const sectionTypes = [\n 'banner',\n 'button',\n 'carousel',\n 'cartLine',\n 'dataSource',\n 'discount',\n 'image',\n 'layout',\n 'monetize',\n 'offers',\n 'product',\n 'products',\n 'progressBar',\n 'quantity',\n 'reviews',\n 'text',\n 'variants',\n] as const;\n\nexport const SectionType = freezeEnum(sectionTypes);\nexport type SectionType = (typeof sectionTypes)[number];\n\nexport const spacings = ['none', 'extraTight', 'tight', 'base', 'loose', 'extraLoose'] as const;\nexport const Spacing = freezeEnum(spacings);\nexport type Spacing = (typeof spacings)[number];\n\nexport const textAlignments = ['start', 'center', 'end'] as const;\nexport const TextAlignment = freezeEnum(textAlignments);\nexport type TextAlignment = (typeof textAlignments)[number];\n\nexport const textColorNames = ['base', 'subdued', 'accent', 'decorative', 'success', 'warning', 'critical'] as const;\nexport const TextColorName = freezeEnum(textColorNames);\nexport type TextColorName = (typeof textColorNames)[number];\n\nexport const textSizeNames = ['extraSmall', 'small', 'base', 'medium', 'large', 'extraLarge'] as const;\nexport const TextSizeName = freezeEnum(textSizeNames);\nexport type TextSizeName = (typeof textSizeNames)[number];\n\nexport const variantModes = ['multiple', 'single'] as const;\nexport const VariantMode = freezeEnum(variantModes);\nexport type VariantMode = (typeof variantModes)[number];\n\nexport const variantSelectors = ['menu', 'radio', 'button'] as const;\nexport const VariantSelector = freezeEnum(variantSelectors);\nexport type VariantSelector = (typeof variantSelectors)[number];\n\nexport const verticalAlignments = ['top', 'middle', 'bottom'] as const;\nexport const VerticalAlignment = freezeEnum(verticalAlignments);\nexport type VerticalAlignment = (typeof verticalAlignments)[number];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;A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freezeEnum = <T extends readonly string[]>(values: T) =>\n Object.freeze(Object.fromEntries(values.map((v) => [v, v]))) as { readonly [K in T[number]]: K };\n\nexport const bannerColors = ['info', 'success', 'warning', 'critical'] as const;\nexport const BannerColor = freezeEnum(bannerColors);\nexport type BannerColor = (typeof bannerColors)[number];\n\nexport const borderRadii = ['none', 'small', 'base', 'large', 'fullyRounded'] as const;\nexport const BorderRadius = freezeEnum(borderRadii);\nexport type BorderRadius = (typeof borderRadii)[number];\n\nexport const borderStyles = ['none', 'base', 'dotted', 'dashed'] as const;\nexport const BorderStyle = freezeEnum(borderStyles);\nexport type BorderStyle = (typeof borderStyles)[number];\n\nexport const borderWidths = ['base', 'medium', 'thick'] as const;\nexport const BorderWidth = freezeEnum(borderWidths);\nexport type BorderWidth = (typeof borderWidths)[number];\n\nexport const buttonActions = [\n 'acceptOffer',\n 'addGift',\n 'addToOrder',\n 'declineAllOffers',\n 'declineOffer',\n 'displayContentInModal',\n 'displayContentInPopover',\n 'goToNextPage',\n 'goToPrevPage',\n 'goToURL',\n 'removeFromOrder',\n 'removeGift',\n 'selectVariant',\n 'showPagination',\n 'switchToSubscription',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonAction = freezeEnum(buttonActions);\nexport type ButtonAction = (typeof buttonActions)[number];\n\nexport const buttonFields = [\n 'activePage',\n 'addedToCart',\n 'addingToCart',\n 'addToCart',\n 'buttonLabel',\n 'declineAllOffers',\n 'declineOffer',\n 'destinationUrl',\n 'inactivePage',\n 'overlayContent',\n 'payNow',\n 'progressReached',\n 'progressRemaining',\n 'redirectToCheckout',\n 'removeFromOrder',\n 'showVariant',\n 'showVariants',\n 'soldOut',\n 'subscriptionOption',\n 'switchToOneTimePurchase',\n 'switchToSubscriptionNoDiscount',\n 'switchToSubscriptionWithDiscount',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonField = freezeEnum(buttonFields);\nexport type ButtonField = (typeof buttonFields)[number];\n\nexport const buttonStyles = ['primary', 'secondary', 'plain', 'custom'] as const;\nexport const ButtonStyle = freezeEnum(buttonStyles);\nexport type ButtonStyle = (typeof buttonStyles)[number];\n\nexport const directions = ['columns', 'rows', 'grid'] as const;\nexport const Direction = freezeEnum(directions);\nexport type Direction = (typeof directions)[number];\n\nexport const discountSources = ['price', 'compare_at_price'] as const;\nexport const DiscountSource = freezeEnum(discountSources);\nexport type DiscountSource = (typeof discountSources)[number];\n\nexport const discountTypes = ['none', 'percentage', 'fixed', 'fixed_amount'] as const;\nexport const DiscountType = freezeEnum(discountTypes);\nexport type DiscountType = (typeof discountTypes)[number];\n\nexport const editorModes = [\n 'checkoutExtension',\n 'postPurchaseOffer',\n 'thankYouPage',\n 'orderStatusPage',\n 'ordersIndexPage',\n 'customerProfilePage',\n] as const;\n\nexport const EditorMode = freezeEnum(editorModes);\nexport type EditorMode = (typeof editorModes)[number];\n\nexport const horizontalAlignments = ['start', 'center', 'end'] as const;\nexport const HorizontalAlignment = freezeEnum(horizontalAlignments);\nexport type HorizontalAlignment = (typeof horizontalAlignments)[number];\n\nexport const languageKeys = [\n 'ar',\n 'cs',\n 'da',\n 'de',\n 'en',\n 'es',\n 'fi',\n 'fr',\n 'ga',\n 'he',\n 'hi',\n 'id',\n 'it',\n 'ja',\n 'ko',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'ru',\n 'sv',\n 'th',\n 'tr',\n 'uk',\n 'vi',\n 'zh',\n] as const;\n\nexport const LanguageKey = freezeEnum(languageKeys);\nexport type LanguageKey = (typeof languageKeys)[number];\n\nexport const objectFits = ['cover', 'contain'] as const;\nexport const ObjectFit = freezeEnum(objectFits);\nexport type ObjectFit = (typeof objectFits)[number];\n\nexport const popoverPositions = ['inlineStart', 'inlineEnd', 'blockStart', 'blockEnd'] as const;\nexport const PopoverPosition = freezeEnum(popoverPositions);\nexport type PopoverPosition = (typeof popoverPositions)[number];\n\nexport const popoverPositionMap = {\n bottom: 'blockEnd',\n left: 'inlineStart',\n right: 'inlineEnd',\n top: 'blockStart',\n} as const;\n\nexport const productTypes = ['one-time', 'subscription', 'both'] as const;\nexport const ProductType = freezeEnum(productTypes);\nexport type ProductType = (typeof productTypes)[number];\n\nexport const progressTierTypes = ['decorative', 'discount', 'product', 'shipping'] as const;\nexport const ProgressTierType = freezeEnum(progressTierTypes);\nexport type ProgressTierType = (typeof progressTierTypes)[number];\n\nexport const progressTierUnits = ['currency', 'item'] as const;\nexport const ProgressTierUnit = freezeEnum(progressTierUnits);\nexport type ProgressTierUnit = (typeof progressTierUnits)[number];\n\nexport const quantityInputs = ['select', 'number'] as const;\nexport const QuantityInput = freezeEnum(quantityInputs);\nexport type QuantityInput = (typeof quantityInputs)[number];\n\nexport const reviewsSizes = ['small', 'default', 'large'] as const;\nexport const ReviewsSize = freezeEnum(reviewsSizes);\nexport type ReviewsSize = (typeof reviewsSizes)[number];\n\nexport const sectionTypes = [\n 'banner',\n 'button',\n 'carousel',\n 'cartLine',\n 'dataSource',\n 'discount',\n 'image',\n 'layout',\n 'monetize',\n 'offers',\n 'product',\n 'products',\n 'progressBar',\n 'quantity',\n 'reviews',\n 'text',\n 'variants',\n] as const;\n\nexport const SectionType = freezeEnum(sectionTypes);\nexport type SectionType = (typeof sectionTypes)[number];\n\nexport const spacings = ['none', 'extraTight', 'tight', 'base', 'loose', 'extraLoose'] as const;\nexport const Spacing = freezeEnum(spacings);\nexport type Spacing = (typeof spacings)[number];\n\nexport const textAlignments = ['start', 'center', 'end'] as const;\nexport const TextAlignment = freezeEnum(textAlignments);\nexport type TextAlignment = (typeof textAlignments)[number];\n\nexport const textColorNames = ['base', 'subdued', 'accent', 'decorative', 'success', 'warning', 'critical'] as const;\nexport const TextColorName = freezeEnum(textColorNames);\nexport type TextColorName = (typeof textColorNames)[number];\n\nexport const textSizeNames = ['extraSmall', 'small', 'base', 'medium', 'large', 'extraLarge'] as const;\nexport const TextSizeName = freezeEnum(textSizeNames);\nexport type TextSizeName = (typeof textSizeNames)[number];\n\nexport const variantModes = ['multiple', 'single'] as const;\nexport const VariantMode = freezeEnum(variantModes);\nexport type VariantMode = (typeof variantModes)[number];\n\nexport const variantSelectors = ['menu', 'radio', 'button'] as const;\nexport const VariantSelector = freezeEnum(variantSelectors);\nexport type VariantSelector = (typeof variantSelectors)[number];\n\nexport const verticalAlignments = ['top', 'middle', 'bottom'] as const;\nexport const VerticalAlignment = freezeEnum(verticalAlignments);\nexport type VerticalAlignment = (typeof verticalAlignments)[number];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAO,IAAM,aAAa,CAA8B,WACpD,OAAO,OAAO,OAAO,YAAY,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAExD,IAAM,eAAe,CAAC,QAAQ,WAAW,WAAW,UAAU;AAC9D,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,cAAc,CAAC,QAAQ,SAAS,QAAQ,SAAS,cAAc;AACrE,IAAM,eAAe,WAAW,WAAW;AAG3C,IAAM,eAAe,CAAC,QAAQ,QAAQ,UAAU,QAAQ;AACxD,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,eAAe,CAAC,QAAQ,UAAU,OAAO;AAC/C,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,gBAAgB;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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AgB,CAAC,cAAc,SAAS,QAAQ,UAAU,SAAS,YAAY;AACrF,IAAM,eAAe,WAAW,aAAa;AAG7C,IAAM,eAAe,CAAC,YAAY,QAAQ;AAC1C,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,mBAAmB,CAAC,QAAQ,SAAS,QAAQ;AACnD,IAAM,kBAAkB,WAAW,gBAAgB;AAGnD,IAAM,qBAAqB,CAAC,OAAO,UAAU,QAAQ;AACrD,IAAM,oBAAoB,WAAW,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,6 +10,7 @@ var borderWidths = ["base", "medium", "thick"];
|
|
|
10
10
|
var BorderWidth = freezeEnum(borderWidths);
|
|
11
11
|
var buttonActions = [
|
|
12
12
|
"acceptOffer",
|
|
13
|
+
"addGift",
|
|
13
14
|
"addToOrder",
|
|
14
15
|
"declineAllOffers",
|
|
15
16
|
"declineOffer",
|
|
@@ -19,6 +20,7 @@ var buttonActions = [
|
|
|
19
20
|
"goToPrevPage",
|
|
20
21
|
"goToURL",
|
|
21
22
|
"removeFromOrder",
|
|
23
|
+
"removeGift",
|
|
22
24
|
"selectVariant",
|
|
23
25
|
"showPagination",
|
|
24
26
|
"switchToSubscription",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/schema/widgets/checkout-and-beyond/common.ts"],
|
|
4
|
-
"sourcesContent": ["export const freezeEnum = <T extends readonly string[]>(values: T) =>\n Object.freeze(Object.fromEntries(values.map((v) => [v, v]))) as { readonly [K in T[number]]: K };\n\nexport const bannerColors = ['info', 'success', 'warning', 'critical'] as const;\nexport const BannerColor = freezeEnum(bannerColors);\nexport type BannerColor = (typeof bannerColors)[number];\n\nexport const borderRadii = ['none', 'small', 'base', 'large', 'fullyRounded'] as const;\nexport const BorderRadius = freezeEnum(borderRadii);\nexport type BorderRadius = (typeof borderRadii)[number];\n\nexport const borderStyles = ['none', 'base', 'dotted', 'dashed'] as const;\nexport const BorderStyle = freezeEnum(borderStyles);\nexport type BorderStyle = (typeof borderStyles)[number];\n\nexport const borderWidths = ['base', 'medium', 'thick'] as const;\nexport const BorderWidth = freezeEnum(borderWidths);\nexport type BorderWidth = (typeof borderWidths)[number];\n\nexport const buttonActions = [\n 'acceptOffer',\n 'addToOrder',\n 'declineAllOffers',\n 'declineOffer',\n 'displayContentInModal',\n 'displayContentInPopover',\n 'goToNextPage',\n 'goToPrevPage',\n 'goToURL',\n 'removeFromOrder',\n 'selectVariant',\n 'showPagination',\n 'switchToSubscription',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonAction = freezeEnum(buttonActions);\nexport type ButtonAction = (typeof buttonActions)[number];\n\nexport const buttonFields = [\n 'activePage',\n 'addedToCart',\n 'addingToCart',\n 'addToCart',\n 'buttonLabel',\n 'declineAllOffers',\n 'declineOffer',\n 'destinationUrl',\n 'inactivePage',\n 'overlayContent',\n 'payNow',\n 'progressReached',\n 'progressRemaining',\n 'redirectToCheckout',\n 'removeFromOrder',\n 'showVariant',\n 'showVariants',\n 'soldOut',\n 'subscriptionOption',\n 'switchToOneTimePurchase',\n 'switchToSubscriptionNoDiscount',\n 'switchToSubscriptionWithDiscount',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonField = freezeEnum(buttonFields);\nexport type ButtonField = (typeof buttonFields)[number];\n\nexport const buttonStyles = ['primary', 'secondary', 'plain', 'custom'] as const;\nexport const ButtonStyle = freezeEnum(buttonStyles);\nexport type ButtonStyle = (typeof buttonStyles)[number];\n\nexport const directions = ['columns', 'rows', 'grid'] as const;\nexport const Direction = freezeEnum(directions);\nexport type Direction = (typeof directions)[number];\n\nexport const discountSources = ['price', 'compare_at_price'] as const;\nexport const DiscountSource = freezeEnum(discountSources);\nexport type DiscountSource = (typeof discountSources)[number];\n\nexport const discountTypes = ['none', 'percentage', 'fixed', 'fixed_amount'] as const;\nexport const DiscountType = freezeEnum(discountTypes);\nexport type DiscountType = (typeof discountTypes)[number];\n\nexport const editorModes = [\n 'checkoutExtension',\n 'postPurchaseOffer',\n 'thankYouPage',\n 'orderStatusPage',\n 'ordersIndexPage',\n 'customerProfilePage',\n] as const;\n\nexport const EditorMode = freezeEnum(editorModes);\nexport type EditorMode = (typeof editorModes)[number];\n\nexport const horizontalAlignments = ['start', 'center', 'end'] as const;\nexport const HorizontalAlignment = freezeEnum(horizontalAlignments);\nexport type HorizontalAlignment = (typeof horizontalAlignments)[number];\n\nexport const languageKeys = [\n 'ar',\n 'cs',\n 'da',\n 'de',\n 'en',\n 'es',\n 'fi',\n 'fr',\n 'ga',\n 'he',\n 'hi',\n 'id',\n 'it',\n 'ja',\n 'ko',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'ru',\n 'sv',\n 'th',\n 'tr',\n 'uk',\n 'vi',\n 'zh',\n] as const;\n\nexport const LanguageKey = freezeEnum(languageKeys);\nexport type LanguageKey = (typeof languageKeys)[number];\n\nexport const objectFits = ['cover', 'contain'] as const;\nexport const ObjectFit = freezeEnum(objectFits);\nexport type ObjectFit = (typeof objectFits)[number];\n\nexport const popoverPositions = ['inlineStart', 'inlineEnd', 'blockStart', 'blockEnd'] as const;\nexport const PopoverPosition = freezeEnum(popoverPositions);\nexport type PopoverPosition = (typeof popoverPositions)[number];\n\nexport const popoverPositionMap = {\n bottom: 'blockEnd',\n left: 'inlineStart',\n right: 'inlineEnd',\n top: 'blockStart',\n} as const;\n\nexport const productTypes = ['one-time', 'subscription', 'both'] as const;\nexport const ProductType = freezeEnum(productTypes);\nexport type ProductType = (typeof productTypes)[number];\n\nexport const progressTierTypes = ['decorative', 'discount', 'product', 'shipping'] as const;\nexport const ProgressTierType = freezeEnum(progressTierTypes);\nexport type ProgressTierType = (typeof progressTierTypes)[number];\n\nexport const progressTierUnits = ['currency', 'item'] as const;\nexport const ProgressTierUnit = freezeEnum(progressTierUnits);\nexport type ProgressTierUnit = (typeof progressTierUnits)[number];\n\nexport const quantityInputs = ['select', 'number'] as const;\nexport const QuantityInput = freezeEnum(quantityInputs);\nexport type QuantityInput = (typeof quantityInputs)[number];\n\nexport const reviewsSizes = ['small', 'default', 'large'] as const;\nexport const ReviewsSize = freezeEnum(reviewsSizes);\nexport type ReviewsSize = (typeof reviewsSizes)[number];\n\nexport const sectionTypes = [\n 'banner',\n 'button',\n 'carousel',\n 'cartLine',\n 'dataSource',\n 'discount',\n 'image',\n 'layout',\n 'monetize',\n 'offers',\n 'product',\n 'products',\n 'progressBar',\n 'quantity',\n 'reviews',\n 'text',\n 'variants',\n] as const;\n\nexport const SectionType = freezeEnum(sectionTypes);\nexport type SectionType = (typeof sectionTypes)[number];\n\nexport const spacings = ['none', 'extraTight', 'tight', 'base', 'loose', 'extraLoose'] as const;\nexport const Spacing = freezeEnum(spacings);\nexport type Spacing = (typeof spacings)[number];\n\nexport const textAlignments = ['start', 'center', 'end'] as const;\nexport const TextAlignment = freezeEnum(textAlignments);\nexport type TextAlignment = (typeof textAlignments)[number];\n\nexport const textColorNames = ['base', 'subdued', 'accent', 'decorative', 'success', 'warning', 'critical'] as const;\nexport const TextColorName = freezeEnum(textColorNames);\nexport type TextColorName = (typeof textColorNames)[number];\n\nexport const textSizeNames = ['extraSmall', 'small', 'base', 'medium', 'large', 'extraLarge'] as const;\nexport const TextSizeName = freezeEnum(textSizeNames);\nexport type TextSizeName = (typeof textSizeNames)[number];\n\nexport const variantModes = ['multiple', 'single'] as const;\nexport const VariantMode = freezeEnum(variantModes);\nexport type VariantMode = (typeof variantModes)[number];\n\nexport const variantSelectors = ['menu', 'radio', 'button'] as const;\nexport const VariantSelector = freezeEnum(variantSelectors);\nexport type VariantSelector = (typeof variantSelectors)[number];\n\nexport const verticalAlignments = ['top', 'middle', 'bottom'] as const;\nexport const VerticalAlignment = freezeEnum(verticalAlignments);\nexport type VerticalAlignment = (typeof verticalAlignments)[number];\n"],
|
|
5
|
-
"mappings": ";AAAO,IAAM,aAAa,CAA8B,WACpD,OAAO,OAAO,OAAO,YAAY,OA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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAEO,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,WAAW,CAAC,QAAQ,cAAc,SAAS,QAAQ,SAAS,YAAY;AAC9E,IAAM,UAAU,WAAW,QAAQ;AAGnC,IAAM,iBAAiB,CAAC,SAAS,UAAU,KAAK;AAChD,IAAM,gBAAgB,WAAW,cAAc;AAG/C,IAAM,iBAAiB,CAAC,QAAQ,WAAW,UAAU,cAAc,WAAW,WAAW,UAAU;AACnG,IAAM,gBAAgB,WAAW,cAAc;AAG/C,IAAM,gBAAgB,CAAC,cAAc,SAAS,QAAQ,UAAU,SAAS,YAAY;AACrF,IAAM,eAAe,WAAW,aAAa;AAG7C,IAAM,eAAe,CAAC,YAAY,QAAQ;AAC1C,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,mBAAmB,CAAC,QAAQ,SAAS,QAAQ;AACnD,IAAM,kBAAkB,WAAW,gBAAgB;AAGnD,IAAM,qBAAqB,CAAC,OAAO,UAAU,QAAQ;AACrD,IAAM,oBAAoB,WAAW,kBAAkB;",
|
|
4
|
+
"sourcesContent": ["export const freezeEnum = <T extends readonly string[]>(values: T) =>\n Object.freeze(Object.fromEntries(values.map((v) => [v, v]))) as { readonly [K in T[number]]: K };\n\nexport const bannerColors = ['info', 'success', 'warning', 'critical'] as const;\nexport const BannerColor = freezeEnum(bannerColors);\nexport type BannerColor = (typeof bannerColors)[number];\n\nexport const borderRadii = ['none', 'small', 'base', 'large', 'fullyRounded'] as const;\nexport const BorderRadius = freezeEnum(borderRadii);\nexport type BorderRadius = (typeof borderRadii)[number];\n\nexport const borderStyles = ['none', 'base', 'dotted', 'dashed'] as const;\nexport const BorderStyle = freezeEnum(borderStyles);\nexport type BorderStyle = (typeof borderStyles)[number];\n\nexport const borderWidths = ['base', 'medium', 'thick'] as const;\nexport const BorderWidth = freezeEnum(borderWidths);\nexport type BorderWidth = (typeof borderWidths)[number];\n\nexport const buttonActions = [\n 'acceptOffer',\n 'addGift',\n 'addToOrder',\n 'declineAllOffers',\n 'declineOffer',\n 'displayContentInModal',\n 'displayContentInPopover',\n 'goToNextPage',\n 'goToPrevPage',\n 'goToURL',\n 'removeFromOrder',\n 'removeGift',\n 'selectVariant',\n 'showPagination',\n 'switchToSubscription',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonAction = freezeEnum(buttonActions);\nexport type ButtonAction = (typeof buttonActions)[number];\n\nexport const buttonFields = [\n 'activePage',\n 'addedToCart',\n 'addingToCart',\n 'addToCart',\n 'buttonLabel',\n 'declineAllOffers',\n 'declineOffer',\n 'destinationUrl',\n 'inactivePage',\n 'overlayContent',\n 'payNow',\n 'progressReached',\n 'progressRemaining',\n 'redirectToCheckout',\n 'removeFromOrder',\n 'showVariant',\n 'showVariants',\n 'soldOut',\n 'subscriptionOption',\n 'switchToOneTimePurchase',\n 'switchToSubscriptionNoDiscount',\n 'switchToSubscriptionWithDiscount',\n 'undoAddToOrder',\n] as const;\n\nexport const ButtonField = freezeEnum(buttonFields);\nexport type ButtonField = (typeof buttonFields)[number];\n\nexport const buttonStyles = ['primary', 'secondary', 'plain', 'custom'] as const;\nexport const ButtonStyle = freezeEnum(buttonStyles);\nexport type ButtonStyle = (typeof buttonStyles)[number];\n\nexport const directions = ['columns', 'rows', 'grid'] as const;\nexport const Direction = freezeEnum(directions);\nexport type Direction = (typeof directions)[number];\n\nexport const discountSources = ['price', 'compare_at_price'] as const;\nexport const DiscountSource = freezeEnum(discountSources);\nexport type DiscountSource = (typeof discountSources)[number];\n\nexport const discountTypes = ['none', 'percentage', 'fixed', 'fixed_amount'] as const;\nexport const DiscountType = freezeEnum(discountTypes);\nexport type DiscountType = (typeof discountTypes)[number];\n\nexport const editorModes = [\n 'checkoutExtension',\n 'postPurchaseOffer',\n 'thankYouPage',\n 'orderStatusPage',\n 'ordersIndexPage',\n 'customerProfilePage',\n] as const;\n\nexport const EditorMode = freezeEnum(editorModes);\nexport type EditorMode = (typeof editorModes)[number];\n\nexport const horizontalAlignments = ['start', 'center', 'end'] as const;\nexport const HorizontalAlignment = freezeEnum(horizontalAlignments);\nexport type HorizontalAlignment = (typeof horizontalAlignments)[number];\n\nexport const languageKeys = [\n 'ar',\n 'cs',\n 'da',\n 'de',\n 'en',\n 'es',\n 'fi',\n 'fr',\n 'ga',\n 'he',\n 'hi',\n 'id',\n 'it',\n 'ja',\n 'ko',\n 'nl',\n 'no',\n 'pl',\n 'pt',\n 'ru',\n 'sv',\n 'th',\n 'tr',\n 'uk',\n 'vi',\n 'zh',\n] as const;\n\nexport const LanguageKey = freezeEnum(languageKeys);\nexport type LanguageKey = (typeof languageKeys)[number];\n\nexport const objectFits = ['cover', 'contain'] as const;\nexport const ObjectFit = freezeEnum(objectFits);\nexport type ObjectFit = (typeof objectFits)[number];\n\nexport const popoverPositions = ['inlineStart', 'inlineEnd', 'blockStart', 'blockEnd'] as const;\nexport const PopoverPosition = freezeEnum(popoverPositions);\nexport type PopoverPosition = (typeof popoverPositions)[number];\n\nexport const popoverPositionMap = {\n bottom: 'blockEnd',\n left: 'inlineStart',\n right: 'inlineEnd',\n top: 'blockStart',\n} as const;\n\nexport const productTypes = ['one-time', 'subscription', 'both'] as const;\nexport const ProductType = freezeEnum(productTypes);\nexport type ProductType = (typeof productTypes)[number];\n\nexport const progressTierTypes = ['decorative', 'discount', 'product', 'shipping'] as const;\nexport const ProgressTierType = freezeEnum(progressTierTypes);\nexport type ProgressTierType = (typeof progressTierTypes)[number];\n\nexport const progressTierUnits = ['currency', 'item'] as const;\nexport const ProgressTierUnit = freezeEnum(progressTierUnits);\nexport type ProgressTierUnit = (typeof progressTierUnits)[number];\n\nexport const quantityInputs = ['select', 'number'] as const;\nexport const QuantityInput = freezeEnum(quantityInputs);\nexport type QuantityInput = (typeof quantityInputs)[number];\n\nexport const reviewsSizes = ['small', 'default', 'large'] as const;\nexport const ReviewsSize = freezeEnum(reviewsSizes);\nexport type ReviewsSize = (typeof reviewsSizes)[number];\n\nexport const sectionTypes = [\n 'banner',\n 'button',\n 'carousel',\n 'cartLine',\n 'dataSource',\n 'discount',\n 'image',\n 'layout',\n 'monetize',\n 'offers',\n 'product',\n 'products',\n 'progressBar',\n 'quantity',\n 'reviews',\n 'text',\n 'variants',\n] as const;\n\nexport const SectionType = freezeEnum(sectionTypes);\nexport type SectionType = (typeof sectionTypes)[number];\n\nexport const spacings = ['none', 'extraTight', 'tight', 'base', 'loose', 'extraLoose'] as const;\nexport const Spacing = freezeEnum(spacings);\nexport type Spacing = (typeof spacings)[number];\n\nexport const textAlignments = ['start', 'center', 'end'] as const;\nexport const TextAlignment = freezeEnum(textAlignments);\nexport type TextAlignment = (typeof textAlignments)[number];\n\nexport const textColorNames = ['base', 'subdued', 'accent', 'decorative', 'success', 'warning', 'critical'] as const;\nexport const TextColorName = freezeEnum(textColorNames);\nexport type TextColorName = (typeof textColorNames)[number];\n\nexport const textSizeNames = ['extraSmall', 'small', 'base', 'medium', 'large', 'extraLarge'] as const;\nexport const TextSizeName = freezeEnum(textSizeNames);\nexport type TextSizeName = (typeof textSizeNames)[number];\n\nexport const variantModes = ['multiple', 'single'] as const;\nexport const VariantMode = freezeEnum(variantModes);\nexport type VariantMode = (typeof variantModes)[number];\n\nexport const variantSelectors = ['menu', 'radio', 'button'] as const;\nexport const VariantSelector = freezeEnum(variantSelectors);\nexport type VariantSelector = (typeof variantSelectors)[number];\n\nexport const verticalAlignments = ['top', 'middle', 'bottom'] as const;\nexport const VerticalAlignment = freezeEnum(verticalAlignments);\nexport type VerticalAlignment = (typeof verticalAlignments)[number];\n"],
|
|
5
|
+
"mappings": ";AAAO,IAAM,aAAa,CAA8B,WACpD,OAAO,OAAO,OAAO,YAAY,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAExD,IAAM,eAAe,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,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AAEO,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,WAAW,CAAC,QAAQ,cAAc,SAAS,QAAQ,SAAS,YAAY;AAC9E,IAAM,UAAU,WAAW,QAAQ;AAGnC,IAAM,iBAAiB,CAAC,SAAS,UAAU,KAAK;AAChD,IAAM,gBAAgB,WAAW,cAAc;AAG/C,IAAM,iBAAiB,CAAC,QAAQ,WAAW,UAAU,cAAc,WAAW,WAAW,UAAU;AACnG,IAAM,gBAAgB,WAAW,cAAc;AAG/C,IAAM,gBAAgB,CAAC,cAAc,SAAS,QAAQ,UAAU,SAAS,YAAY;AACrF,IAAM,eAAe,WAAW,aAAa;AAG7C,IAAM,eAAe,CAAC,YAAY,QAAQ;AAC1C,IAAM,cAAc,WAAW,YAAY;AAG3C,IAAM,mBAAmB,CAAC,QAAQ,SAAS,QAAQ;AACnD,IAAM,kBAAkB,WAAW,gBAAgB;AAGnD,IAAM,qBAAqB,CAAC,OAAO,UAAU,QAAQ;AACrD,IAAM,oBAAoB,WAAW,kBAAkB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -39,6 +39,7 @@ __export(checkout_and_beyond_exports, {
|
|
|
39
39
|
CABDiscountSection: () => CABDiscountSection,
|
|
40
40
|
CABExperiment: () => CABExperiment,
|
|
41
41
|
CABImageSection: () => CABImageSection,
|
|
42
|
+
CABImageSectionFields: () => CABImageSectionFields,
|
|
42
43
|
CABIntegrations: () => CABIntegrations,
|
|
43
44
|
CABLayoutSection: () => CABLayoutSection,
|
|
44
45
|
CABMonetizeSection: () => CABMonetizeSection,
|
|
@@ -70,6 +71,9 @@ __export(checkout_and_beyond_exports, {
|
|
|
70
71
|
HEX_COLOR_REGEX: () => HEX_COLOR_REGEX,
|
|
71
72
|
HTML_TAGS_REGEX: () => HTML_TAGS_REGEX,
|
|
72
73
|
HorizontalAlignment: () => HorizontalAlignment,
|
|
74
|
+
IconName: () => IconName,
|
|
75
|
+
IconSize: () => IconSize,
|
|
76
|
+
IconTone: () => IconTone,
|
|
73
77
|
LanguageKey: () => LanguageKey,
|
|
74
78
|
NO_HTML: () => NO_HTML,
|
|
75
79
|
OFFER_LABELS: () => OFFER_LABELS,
|
|
@@ -117,6 +121,9 @@ __export(checkout_and_beyond_exports, {
|
|
|
117
121
|
freezeEnum: () => freezeEnum,
|
|
118
122
|
hasHTMLInDoc: () => hasHTMLInDoc,
|
|
119
123
|
horizontalAlignments: () => horizontalAlignments,
|
|
124
|
+
iconNames: () => iconNames,
|
|
125
|
+
iconSizes: () => iconSizes,
|
|
126
|
+
iconTones: () => iconTones,
|
|
120
127
|
isBannerType: () => isBannerType,
|
|
121
128
|
isButtonType: () => isButtonType,
|
|
122
129
|
isCarouselType: () => isCarouselType,
|
|
@@ -175,6 +182,7 @@ var borderWidths = ["base", "medium", "thick"];
|
|
|
175
182
|
var BorderWidth = freezeEnum(borderWidths);
|
|
176
183
|
var buttonActions = [
|
|
177
184
|
"acceptOffer",
|
|
185
|
+
"addGift",
|
|
178
186
|
"addToOrder",
|
|
179
187
|
"declineAllOffers",
|
|
180
188
|
"declineOffer",
|
|
@@ -184,6 +192,7 @@ var buttonActions = [
|
|
|
184
192
|
"goToPrevPage",
|
|
185
193
|
"goToURL",
|
|
186
194
|
"removeFromOrder",
|
|
195
|
+
"removeGift",
|
|
187
196
|
"selectVariant",
|
|
188
197
|
"showPagination",
|
|
189
198
|
"switchToSubscription",
|
|
@@ -401,6 +410,90 @@ var import_zod4 = require("zod");
|
|
|
401
410
|
var import_uuid = require("uuid");
|
|
402
411
|
var import_zod2 = require("zod");
|
|
403
412
|
|
|
413
|
+
// src/schema/widgets/checkout-and-beyond/icons.ts
|
|
414
|
+
var iconNames = [
|
|
415
|
+
"alert-circle",
|
|
416
|
+
"alert-triangle",
|
|
417
|
+
"alert-triangle-filled",
|
|
418
|
+
"arrow-down",
|
|
419
|
+
"arrow-left",
|
|
420
|
+
"arrow-right",
|
|
421
|
+
"arrow-up",
|
|
422
|
+
"arrow-up-right",
|
|
423
|
+
"bag",
|
|
424
|
+
"bullet",
|
|
425
|
+
"calendar",
|
|
426
|
+
"camera",
|
|
427
|
+
"caret-down",
|
|
428
|
+
"cart",
|
|
429
|
+
"cash-dollar",
|
|
430
|
+
"categories",
|
|
431
|
+
"check",
|
|
432
|
+
"check-circle",
|
|
433
|
+
"check-circle-filled",
|
|
434
|
+
"chevron-down",
|
|
435
|
+
"chevron-left",
|
|
436
|
+
"chevron-right",
|
|
437
|
+
"chevron-up",
|
|
438
|
+
"circle",
|
|
439
|
+
"clipboard",
|
|
440
|
+
"clock",
|
|
441
|
+
"credit-card",
|
|
442
|
+
"delete",
|
|
443
|
+
"delivered",
|
|
444
|
+
"delivery",
|
|
445
|
+
"disabled",
|
|
446
|
+
"discount",
|
|
447
|
+
"edit",
|
|
448
|
+
"email",
|
|
449
|
+
"empty",
|
|
450
|
+
"external",
|
|
451
|
+
"filter",
|
|
452
|
+
"geolocation",
|
|
453
|
+
"gift-card",
|
|
454
|
+
"globe",
|
|
455
|
+
"grid",
|
|
456
|
+
"image",
|
|
457
|
+
"info",
|
|
458
|
+
"info-filled",
|
|
459
|
+
"list-bulleted",
|
|
460
|
+
"location",
|
|
461
|
+
"lock",
|
|
462
|
+
"map",
|
|
463
|
+
"menu",
|
|
464
|
+
"menu-horizontal",
|
|
465
|
+
"menu-vertical",
|
|
466
|
+
"minus",
|
|
467
|
+
"mobile",
|
|
468
|
+
"note",
|
|
469
|
+
"order",
|
|
470
|
+
"organization",
|
|
471
|
+
"plus",
|
|
472
|
+
"profile",
|
|
473
|
+
"question-circle",
|
|
474
|
+
"question-circle-filled",
|
|
475
|
+
"reorder",
|
|
476
|
+
"reset",
|
|
477
|
+
"return",
|
|
478
|
+
"savings",
|
|
479
|
+
"search",
|
|
480
|
+
"settings",
|
|
481
|
+
"star",
|
|
482
|
+
"star-filled",
|
|
483
|
+
"star-half",
|
|
484
|
+
"store",
|
|
485
|
+
"truck",
|
|
486
|
+
"upload",
|
|
487
|
+
"x",
|
|
488
|
+
"x-circle",
|
|
489
|
+
"x-circle-filled"
|
|
490
|
+
];
|
|
491
|
+
var IconName = freezeEnum(iconNames);
|
|
492
|
+
var iconSizes = ["base", "large", "large-100", "small", "small-100", "small-200"];
|
|
493
|
+
var IconSize = freezeEnum(iconSizes);
|
|
494
|
+
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
495
|
+
var IconTone = freezeEnum(iconTones);
|
|
496
|
+
|
|
404
497
|
// src/schema/widgets/checkout-and-beyond/regex.ts
|
|
405
498
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
406
499
|
var DYNAMIC_TOKEN_REGEX = /^\{\{\s*[A-Za-z]+\s*\}\}$/;
|
|
@@ -453,12 +546,39 @@ var convertNumericObjects = (input) => {
|
|
|
453
546
|
};
|
|
454
547
|
|
|
455
548
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
456
|
-
var
|
|
549
|
+
var CABImageSectionFields = import_zod2.z.object({
|
|
457
550
|
altText: import_zod2.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
458
|
-
|
|
551
|
+
/**
|
|
552
|
+
* Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any POSITIVE
|
|
553
|
+
* ratio — never limited to 1, but never `0`/negative either: a renderer dividing by it would get `Infinity`,
|
|
554
|
+
* and CSS `aspect-ratio` drops a negative value and silently reverts to natural size.
|
|
555
|
+
*/
|
|
556
|
+
aspectRatio: import_zod2.z.number().positive().nullable().default(null),
|
|
459
557
|
border: import_zod2.z.lazy(() => CABBorder),
|
|
460
558
|
buttonField: import_zod2.z.enum(buttonFields).optional(),
|
|
461
|
-
|
|
559
|
+
/**
|
|
560
|
+
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
561
|
+
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
562
|
+
* implementation — they were never significant to rendering (`icons`, plural, is NOT deprecated, just one of
|
|
563
|
+
* those inert legacy tags); `icon` is the first value that means anything.
|
|
564
|
+
*
|
|
565
|
+
* INVARIANT, encoded by the `.superRefine` below (a refined object IS a valid `z.discriminatedUnion` member
|
|
566
|
+
* in zod 4 — see `CABTextSection`): `category: 'icon'` ⇒ `source` is an icon name or `''` (icon not yet
|
|
567
|
+
* chosen); any other category ⇒ `source` is NOT a bare icon name, so it stays a URL/token/`''`.
|
|
568
|
+
*
|
|
569
|
+
* Encoded rather than left to the renderer because `source` is ONE union with no category gate, so widening
|
|
570
|
+
* it with `iconNames` also widened what a STORED payload may contain: 14 of the names are plain English
|
|
571
|
+
* words (`image`, `x`, `search`, `note`, `order`, `globe`, …), and a legacy `source: 'image'` used to fail
|
|
572
|
+
* parse — which `salvageSections` turns into a null-rendering stub PLUS a drift report. Ungated it would
|
|
573
|
+
* instead parse and reach the renderer as `<img src="image">`: a broken image, silently, where the old
|
|
574
|
+
* behavior degraded gracefully and told us about it. The client-assembled half of the invariant was never
|
|
575
|
+
* the risky half.
|
|
576
|
+
*/
|
|
577
|
+
category: import_zod2.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
578
|
+
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
579
|
+
iconSize: import_zod2.z.enum(iconSizes).nullable().default(null),
|
|
580
|
+
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
581
|
+
iconTone: import_zod2.z.enum(iconTones).nullable().default(null),
|
|
462
582
|
name: import_zod2.z.string().optional(),
|
|
463
583
|
naturalHeight: import_zod2.z.number().default(0),
|
|
464
584
|
naturalWidth: import_zod2.z.number().default(0),
|
|
@@ -470,9 +590,31 @@ var CABImageSection = import_zod2.z.object({
|
|
|
470
590
|
rule: CABRule.optional(),
|
|
471
591
|
sectionId: import_zod2.z.uuid().default(() => (0, import_uuid.v7)()),
|
|
472
592
|
sectionType: import_zod2.z.literal(SectionType.image).default(SectionType.image),
|
|
473
|
-
|
|
593
|
+
/**
|
|
594
|
+
* An image URL or dynamic token, an empty default, or — when `category: 'icon'` — an icon NAME. Icon mode
|
|
595
|
+
* takes a name or `''` only, NOT a token: no renderer resolves a token to an icon today, so accepting one
|
|
596
|
+
* would promise a capability that doesn't exist. Widen the refine's carve-out to `DYNAMIC_TOKEN_REGEX` when a
|
|
597
|
+
* server-chosen tier icon actually needs it.
|
|
598
|
+
*/
|
|
599
|
+
source: import_zod2.z.union([import_zod2.z.url(), import_zod2.z.literal(""), import_zod2.z.string().regex(DYNAMIC_TOKEN_REGEX), import_zod2.z.enum(iconNames)]).default(""),
|
|
474
600
|
width: import_zod2.z.number().default(100)
|
|
475
601
|
});
|
|
602
|
+
var iconNameSet = new Set(iconNames);
|
|
603
|
+
var isIconName = (source) => iconNameSet.has(source);
|
|
604
|
+
var CABImageSection = CABImageSectionFields.superRefine(({ category, source }, ctx) => {
|
|
605
|
+
if (category === "icon" && source !== "" && !isIconName(source))
|
|
606
|
+
ctx.addIssue({
|
|
607
|
+
code: "custom",
|
|
608
|
+
message: "icon-mode source must be an icon name",
|
|
609
|
+
path: ["source"]
|
|
610
|
+
});
|
|
611
|
+
if (category !== "icon" && isIconName(source))
|
|
612
|
+
ctx.addIssue({
|
|
613
|
+
code: "custom",
|
|
614
|
+
message: "source must be a URL or dynamic token unless category is `icon`",
|
|
615
|
+
path: ["source"]
|
|
616
|
+
});
|
|
617
|
+
});
|
|
476
618
|
|
|
477
619
|
// src/schema/widgets/checkout-and-beyond/text.ts
|
|
478
620
|
var import_compat2 = require("es-toolkit/compat");
|
|
@@ -592,6 +734,21 @@ var CABButtonSection = import_zod4.z.object({
|
|
|
592
734
|
sectionId: import_zod4.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
593
735
|
sections: import_zod4.z.union([import_zod4.z.array(CABButtonContent), import_zod4.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
594
736
|
sectionType: import_zod4.z.literal(SectionType.button).default(SectionType.button),
|
|
737
|
+
/**
|
|
738
|
+
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift. The
|
|
739
|
+
* client resolves the tier's gift (productId) from the progress-bar context by this `tierId` — the button node
|
|
740
|
+
* stays data, no bespoke per-tier wiring. Absent on non-gift buttons (offer add/remove, navigation, links).
|
|
741
|
+
*
|
|
742
|
+
* Deliberately NOT `CABTextTier` (the shape `CABTextSection.tier` uses): a gift button acts on a tier the bar
|
|
743
|
+
* already resolved, so it needs the id and nothing else. Reusing the text tier would make `threshold`
|
|
744
|
+
* required, leave `tierId` optional, and DEFAULT `tierType` to `'shipping'` — a schema-supplied wrong answer
|
|
745
|
+
* on a gift button. Unknown keys are stripped, so a client spreading a whole tier in still parses.
|
|
746
|
+
*
|
|
747
|
+
* `.min(1)` because an empty id IS the silently-id-less state this shape exists to prevent: the client's
|
|
748
|
+
* lookup finds no tier and the click resolves to nothing. Safe to bound — the field is new, so there are no
|
|
749
|
+
* stored payloads to grandfather, and the producer is client code, not a merchant form.
|
|
750
|
+
*/
|
|
751
|
+
tier: import_zod4.z.object({ tierId: import_zod4.z.string().min(1) }).optional(),
|
|
595
752
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
596
753
|
trackingUrl: import_zod4.z.string().optional()
|
|
597
754
|
});
|
|
@@ -965,8 +1122,12 @@ var CABProgressTier = import_zod13.z.object({
|
|
|
965
1122
|
}).optional(),
|
|
966
1123
|
/**
|
|
967
1124
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
968
|
-
* type default
|
|
969
|
-
*
|
|
1125
|
+
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
1126
|
+
* the gift PRODUCT title, which the converter can't supply (config carries only product IDs), so the
|
|
1127
|
+
* client resolves it (authoritative Shopify title, React parity) with its own localized generic fallback.
|
|
1128
|
+
* Localized content; absent OR blank ⇒ no label under the tier's icon (the converter's `toTierMeta` already
|
|
1129
|
+
* turns a blank label into an absent key, and a client-authored blank means the same thing — the renderer
|
|
1130
|
+
* emits no caption slot rather than an empty one). Plain text — a compact icon+label.
|
|
970
1131
|
*/
|
|
971
1132
|
label: import_zod13.z.record(import_zod13.z.string(), import_zod13.z.string()).optional(),
|
|
972
1133
|
/**
|
|
@@ -1261,6 +1422,22 @@ var CABBannerSection = import_zod19.z.lazy(
|
|
|
1261
1422
|
buttonField: import_zod19.z.enum(buttonFields).optional(),
|
|
1262
1423
|
color: import_zod19.z.enum(bannerColors).default("info"),
|
|
1263
1424
|
dismissible: import_zod19.z.boolean().default(true),
|
|
1425
|
+
/**
|
|
1426
|
+
* The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent OR
|
|
1427
|
+
* blank ⇒ no heading; the renderer emits no heading slot for `''` rather than an empty one.
|
|
1428
|
+
*
|
|
1429
|
+
* Merchant-composed buyer-facing plain text, so it rejects HTML at the boundary the same way
|
|
1430
|
+
* `CABImageSection.altText` and `CABTextSection.content` do (the unchecked localized records elsewhere —
|
|
1431
|
+
* `progressBar`'s gift labels, `reviews`' plurals — are converter/constant-sourced, not merchant input).
|
|
1432
|
+
*
|
|
1433
|
+
* The refinement is a last-resort ASSERTION, not the normalization boundary: `normalizeTextContent` only
|
|
1434
|
+
* rewrites `sectionType: 'text'` nodes' `content`, so nothing strips markup or canonicalizes `{token}`
|
|
1435
|
+
* here. A producer must strip upstream the way `composeOffer` does for `altText`. Get it wrong and
|
|
1436
|
+
* `salvageSections` stubs the whole banner (children included) with a drift report — degraded, reported,
|
|
1437
|
+
* not a 500. Nothing emits `heading` yet; the first converter that maps merchant banner copy into it
|
|
1438
|
+
* either strips first or teaches `normalizeTextContent` to strip this field.
|
|
1439
|
+
*/
|
|
1440
|
+
heading: import_zod19.z.record(import_zod19.z.string(), import_zod19.z.string().refine(checkForHTML, NO_HTML)).optional(),
|
|
1264
1441
|
sectionType: import_zod19.z.literal(SectionType.banner).default(SectionType.banner)
|
|
1265
1442
|
})
|
|
1266
1443
|
);
|