@rebuy/rebuy 2.34.0-rc.2 → 2.34.0-rc.3
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 +42 -4
- package/dist/index.js.map +2 -2
- package/dist/index.mjs +42 -4
- package/dist/index.mjs.map +2 -2
- 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 +42 -4
- package/dist/schema/checkout-and-beyond/index.js.map +2 -2
- package/dist/schema/checkout-and-beyond/index.mjs +42 -4
- package/dist/schema/checkout-and-beyond/index.mjs.map +2 -2
- package/dist/schema/widget-data.js +36 -4
- package/dist/schema/widget-data.js.map +2 -2
- package/dist/schema/widget-data.mjs +36 -4
- package/dist/schema/widget-data.mjs.map +2 -2
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +13 -0
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts.map +1 -1
- 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 +42 -3
- package/dist/schema/widgets/checkout-and-beyond/icons.d.ts.map +1 -1
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +18 -1
- 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/progressBar.d.ts.map +1 -1
- package/dist/server/index.js +36 -4
- package/dist/server/index.js.map +2 -2
- package/dist/server/index.mjs +36 -4
- package/dist/server/index.mjs.map +2 -2
- package/dist/transforms/index.js +36 -4
- package/dist/transforms/index.js.map +2 -2
- package/dist/transforms/index.mjs +36 -4
- package/dist/transforms/index.mjs.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -83,6 +83,9 @@ __export(src_exports, {
|
|
|
83
83
|
HEX_COLOR_REGEX: () => HEX_COLOR_REGEX,
|
|
84
84
|
HTML_TAGS_REGEX: () => HTML_TAGS_REGEX,
|
|
85
85
|
HorizontalAlignment: () => HorizontalAlignment,
|
|
86
|
+
IconName: () => IconName,
|
|
87
|
+
IconSize: () => IconSize,
|
|
88
|
+
IconTone: () => IconTone,
|
|
86
89
|
Identity: () => Identity,
|
|
87
90
|
ImageBlock: () => ImageBlock,
|
|
88
91
|
ImageContentBlock: () => ImageContentBlock,
|
|
@@ -177,6 +180,9 @@ __export(src_exports, {
|
|
|
177
180
|
getIdFromGraphUrl: () => getIdFromGraphUrl,
|
|
178
181
|
hasHTMLInDoc: () => hasHTMLInDoc,
|
|
179
182
|
horizontalAlignments: () => horizontalAlignments,
|
|
183
|
+
iconNames: () => iconNames,
|
|
184
|
+
iconSizes: () => iconSizes,
|
|
185
|
+
iconTones: () => iconTones,
|
|
180
186
|
isBannerType: () => isBannerType,
|
|
181
187
|
isBase64Encoded: () => isBase64Encoded,
|
|
182
188
|
isButtonType: () => isButtonType,
|
|
@@ -1515,6 +1521,7 @@ var borderWidths = ["base", "medium", "thick"];
|
|
|
1515
1521
|
var BorderWidth = freezeEnum(borderWidths);
|
|
1516
1522
|
var buttonActions = [
|
|
1517
1523
|
"acceptOffer",
|
|
1524
|
+
"addGift",
|
|
1518
1525
|
"addToOrder",
|
|
1519
1526
|
"declineAllOffers",
|
|
1520
1527
|
"declineOffer",
|
|
@@ -1524,6 +1531,7 @@ var buttonActions = [
|
|
|
1524
1531
|
"goToPrevPage",
|
|
1525
1532
|
"goToURL",
|
|
1526
1533
|
"removeFromOrder",
|
|
1534
|
+
"removeGift",
|
|
1527
1535
|
"selectVariant",
|
|
1528
1536
|
"showPagination",
|
|
1529
1537
|
"switchToSubscription",
|
|
@@ -1827,6 +1835,8 @@ var CABBannerSection = import_zod11.z.lazy(
|
|
|
1827
1835
|
buttonField: import_zod11.z.enum(buttonFields).optional(),
|
|
1828
1836
|
color: import_zod11.z.enum(bannerColors).default("info"),
|
|
1829
1837
|
dismissible: import_zod11.z.boolean().default(true),
|
|
1838
|
+
/** The `s-banner` heading — localized content (a buyer can see a merchant-composed banner). Absent ⇒ no heading. */
|
|
1839
|
+
heading: import_zod11.z.record(import_zod11.z.string(), import_zod11.z.string()).optional(),
|
|
1830
1840
|
sectionType: import_zod11.z.literal(SectionType.banner).default(SectionType.banner)
|
|
1831
1841
|
})
|
|
1832
1842
|
);
|
|
@@ -1918,6 +1928,10 @@ var iconNames = [
|
|
|
1918
1928
|
"x-circle-filled"
|
|
1919
1929
|
];
|
|
1920
1930
|
var IconName = freezeEnum(iconNames);
|
|
1931
|
+
var iconSizes = ["base", "large", "large-100", "small", "small-100", "small-200"];
|
|
1932
|
+
var IconSize = freezeEnum(iconSizes);
|
|
1933
|
+
var iconTones = ["auto", "critical", "custom", "info", "neutral", "success", "warning"];
|
|
1934
|
+
var IconTone = freezeEnum(iconTones);
|
|
1921
1935
|
|
|
1922
1936
|
// src/schema/widgets/checkout-and-beyond/regex.ts
|
|
1923
1937
|
var ARRAY_INDEX_STRING = /^(0|[1-9]\d*)$/;
|
|
@@ -1973,11 +1987,26 @@ var convertNumericObjects = (input) => {
|
|
|
1973
1987
|
// src/schema/widgets/checkout-and-beyond/image.ts
|
|
1974
1988
|
var CABImageSection = import_zod12.z.object({
|
|
1975
1989
|
altText: import_zod12.z.string().refine(checkForHTML, NO_HTML).default(""),
|
|
1976
|
-
|
|
1990
|
+
/** Image width÷height (e.g. `46` for the progress-bar fill); `null` renders at natural size. Any ratio — never limited to 1. */
|
|
1991
|
+
aspectRatio: import_zod12.z.number().nullable().default(null),
|
|
1977
1992
|
border: import_zod12.z.lazy(() => CABBorder),
|
|
1978
1993
|
buttonField: import_zod12.z.enum(buttonFields).optional(),
|
|
1979
|
-
/**
|
|
1994
|
+
/**
|
|
1995
|
+
* `icon` renders `source` as a single `s-icon` by name (the uber-image path covers icons too), reading
|
|
1996
|
+
* `iconSize`/`iconTone`. The other values are a harmless informational holdover from the previous
|
|
1997
|
+
* implementation — they were never significant to rendering (`icons`, plural, is NOT deprecated, just one of
|
|
1998
|
+
* those inert legacy tags); `icon` is the first value that means anything.
|
|
1999
|
+
*
|
|
2000
|
+
* INVARIANT (not schema-encoded — `CABImageSection` is a discriminated-union member, so it can't carry a
|
|
2001
|
+
* `.refine`): `category: 'icon'` ⇔ `source` is an icon name; any other category ⇒ `source` is a URL/token.
|
|
2002
|
+
* The renderer enforces it by branching on `category`, and icon-mode sources are client-assembled from known
|
|
2003
|
+
* `iconNames` constants (never merchant/server data), so a mismatched pairing can't arise in practice.
|
|
2004
|
+
*/
|
|
1980
2005
|
category: import_zod12.z.enum(["gallery", "icon", "icons", "payment-methods", "secure-checkout"]).nullable().default(null),
|
|
2006
|
+
/** `icon`-mode only: the `s-icon` `size`; `null` ⇒ the component default (`base`). Ignored by image treatments. */
|
|
2007
|
+
iconSize: import_zod12.z.enum(iconSizes).nullable().default(null),
|
|
2008
|
+
/** `icon`-mode only: the `s-icon` `tone`; `null` ⇒ the component default (`auto`). Ignored by image treatments. */
|
|
2009
|
+
iconTone: import_zod12.z.enum(iconTones).nullable().default(null),
|
|
1981
2010
|
name: import_zod12.z.string().optional(),
|
|
1982
2011
|
naturalHeight: import_zod12.z.number().default(0),
|
|
1983
2012
|
naturalWidth: import_zod12.z.number().default(0),
|
|
@@ -2112,6 +2141,13 @@ var CABButtonSection = import_zod14.z.object({
|
|
|
2112
2141
|
sectionId: import_zod14.z.uuid().default(() => (0, import_uuid3.v7)()),
|
|
2113
2142
|
sections: import_zod14.z.union([import_zod14.z.array(CABButtonContent), import_zod14.z.strictObject({}).transform(() => [])]).default(() => []),
|
|
2114
2143
|
sectionType: import_zod14.z.literal(SectionType.button).default(SectionType.button),
|
|
2144
|
+
/**
|
|
2145
|
+
* The smart-cart tier this button acts on (`addGift`/`removeGift`): scopes the click to one tier's gift,
|
|
2146
|
+
* the same way {@link CABTextSection} carries a `tier`. The client resolves the tier's gift (productId) from
|
|
2147
|
+
* the progress-bar context by this `tierId` — the button node stays data, no bespoke per-tier wiring. Absent
|
|
2148
|
+
* on non-gift buttons (offer add/remove, navigation, links).
|
|
2149
|
+
*/
|
|
2150
|
+
tier: CABTextTier.optional(),
|
|
2115
2151
|
/** Fire-and-forget pixel POSTed when the button is clicked (e.g. a Monetize decline). */
|
|
2116
2152
|
trackingUrl: import_zod14.z.string().optional()
|
|
2117
2153
|
});
|
|
@@ -2407,8 +2443,10 @@ var CABProgressTier = import_zod23.z.object({
|
|
|
2407
2443
|
}).optional(),
|
|
2408
2444
|
/**
|
|
2409
2445
|
* The step-row label at this tier's slot (onsite `getTierLabel`): the merchant custom label, else the
|
|
2410
|
-
* type default
|
|
2411
|
-
*
|
|
2446
|
+
* type default — 'Free Shipping' or '{n}% Discount'. A PRODUCT tier gets NO converter label: its name is
|
|
2447
|
+
* the gift PRODUCT title, which the converter can't supply (config carries only product IDs), so the
|
|
2448
|
+
* client resolves it (authoritative Shopify title, React parity) with its own localized generic fallback.
|
|
2449
|
+
* Localized content; absent ⇒ no label under the tier's icon. Plain text — a compact icon+label.
|
|
2412
2450
|
*/
|
|
2413
2451
|
label: import_zod23.z.record(import_zod23.z.string(), import_zod23.z.string()).optional(),
|
|
2414
2452
|
/**
|