@rebuy/rebuy 3.62.2 → 3.64.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 +10 -1
- package/dist/index.mjs +10 -1
- package/dist/schema/checkout-and-beyond/constants.cjs +7 -0
- package/dist/schema/checkout-and-beyond/constants.mjs +7 -0
- package/dist/schema/checkout-and-beyond/index.cjs +10 -1
- package/dist/schema/checkout-and-beyond/index.mjs +10 -1
- package/dist/schema/postPurchaseOfferPresentation.d.ts +2 -0
- package/dist/schema/postPurchaseProductCollectionView.d.ts +2 -0
- package/dist/schema/postPurchaseProductView.d.ts +2 -0
- package/dist/schema/widget-data.cjs +10 -1
- package/dist/schema/widget-data.mjs +10 -1
- package/dist/schema/widgetData.d.ts +3 -0
- package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/button.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/common.d.ts +4 -2
- package/dist/schema/widgets/checkout-and-beyond/image.d.ts +2 -0
- package/dist/schema/widgets/checkout-and-beyond/layout.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/root.d.ts +1 -0
- package/dist/schema/widgets/checkout-and-beyond/text.d.ts +1 -0
- package/dist/schema/widgets/contentBlock.d.ts +1 -0
- package/dist/schema/widgets/lineItemEditor.d.ts +1 -0
- package/dist/schema/widgets/rebuyButton.d.ts +1 -0
- package/dist/server/index.cjs +48 -8
- package/dist/server/index.mjs +48 -8
- package/dist/server/postPurchaseSts.d.ts +4 -4
- package/dist/server/preparePostPurchaseAdmissionView.d.ts +2 -2
- package/dist/server/preparePostPurchaseCollectionGroup.d.ts +2 -2
- package/dist/server/preparePostPurchaseCollectionView.d.ts +2 -2
- package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +2 -2
- package/dist/server/preparePostPurchaseGroupDefault.d.ts +2 -2
- package/dist/server/preparePostPurchaseGroupView.d.ts +2 -2
- package/dist/server/preparePostPurchaseMemberView.d.ts +8 -8
- package/dist/server/preparePostPurchaseOfferPresentation.d.ts +1 -1
- package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +2 -2
- package/dist/server/preparePostPurchaseQuantityView.d.ts +2 -2
- package/dist/server/preparePostPurchaseStsMember.d.ts +2 -2
- package/dist/transforms/index.cjs +18 -5
- package/dist/transforms/index.mjs +18 -5
- package/dist/transforms/postPurchase/convertProductInformation.d.ts +2 -1
- package/dist/transforms/postPurchase/declineTheseButton.d.ts +104 -0
- package/dist/transforms/postPurchase/productCardPay.d.ts +1 -1
- package/dist/transforms/productCard/addToOrderButton.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { type CABSection } from '../../schema/widgets/checkout-and-beyond/shared';
|
|
2
|
+
import { type PostPurchaseSettings } from '../../schema/widgets/post-purchase-offer/postPurchaseSettings';
|
|
3
|
+
type Placement = PostPurchaseSettings['productOptions']['showDeclineAll'];
|
|
4
|
+
/**
|
|
5
|
+
* Legacy's step-level "Decline All" (L59, `DeclineAllButton`): a secondary `declineThese` button labelled by
|
|
6
|
+
* the merchant's `declineAll` in a `declineThese` slot, framed as the offer's content column like legacy's
|
|
7
|
+
* 350-pixel column. It declines the Offer's remaining members and follows the flow, as legacy did; the
|
|
8
|
+
* session-ending `declineAllOffers` is never what conversion produces (Mindy, 2026-11-03).
|
|
9
|
+
*/
|
|
10
|
+
export declare const declineTheseButton: (label: string | undefined) => {
|
|
11
|
+
alignment: {
|
|
12
|
+
horizontal: "start" | "center" | "end";
|
|
13
|
+
vertical: "top" | "middle" | "bottom";
|
|
14
|
+
};
|
|
15
|
+
border: {
|
|
16
|
+
radius: "small" | "none" | "base" | "large" | "fullyRounded";
|
|
17
|
+
style: "none" | "base" | "dotted" | "dashed";
|
|
18
|
+
width: "base" | "medium" | "thick";
|
|
19
|
+
};
|
|
20
|
+
direction: "columns" | "rows" | "grid";
|
|
21
|
+
padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
|
|
22
|
+
sectionId: string;
|
|
23
|
+
sections: never[] | CABSection[];
|
|
24
|
+
sectionType: "layout";
|
|
25
|
+
spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
|
|
26
|
+
width: number;
|
|
27
|
+
buttonField?: "declineAllOffers" | "declineOffer" | "declineThese" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount" | undefined;
|
|
28
|
+
frame?: "callout" | "offer-content" | undefined;
|
|
29
|
+
grid?: {
|
|
30
|
+
columns: (string | number)[];
|
|
31
|
+
rows: (string | number)[];
|
|
32
|
+
} | undefined;
|
|
33
|
+
name?: string | undefined;
|
|
34
|
+
viewUrl?: string | undefined;
|
|
35
|
+
wrapping?: {
|
|
36
|
+
breakAt: number;
|
|
37
|
+
maxPerLine: number;
|
|
38
|
+
} | undefined;
|
|
39
|
+
mutators?: {
|
|
40
|
+
effect: "set_false" | "set_true" | "toggle";
|
|
41
|
+
variable: string;
|
|
42
|
+
when: {
|
|
43
|
+
operator: "is_empty" | "is_not_empty";
|
|
44
|
+
type: "content";
|
|
45
|
+
} | {
|
|
46
|
+
operator: "equals" | "greater_than" | "less_than";
|
|
47
|
+
type: "result_count";
|
|
48
|
+
value: number;
|
|
49
|
+
} | {
|
|
50
|
+
operator: "contains" | "does_not_contain";
|
|
51
|
+
type: "result_tag";
|
|
52
|
+
value: string;
|
|
53
|
+
} | {
|
|
54
|
+
event: "item_added" | "quantity_changed" | "variant_selected";
|
|
55
|
+
type: "event";
|
|
56
|
+
};
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
variables?: ({
|
|
59
|
+
defaultValue: string;
|
|
60
|
+
name: string;
|
|
61
|
+
type: "text";
|
|
62
|
+
seed?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
defaultValue: number;
|
|
65
|
+
name: string;
|
|
66
|
+
type: "number";
|
|
67
|
+
seed?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
defaultValue: boolean;
|
|
70
|
+
name: string;
|
|
71
|
+
type: "boolean";
|
|
72
|
+
seed?: {
|
|
73
|
+
dataSourceId: number | null;
|
|
74
|
+
ruleset: {
|
|
75
|
+
exitIfMatched: boolean;
|
|
76
|
+
logic: {
|
|
77
|
+
rules: {
|
|
78
|
+
operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
|
|
79
|
+
products: never[] | unknown[];
|
|
80
|
+
type: "product" | "date" | "cart" | "cart_count" | "cart_item_count" | "cart_line_count" | "cart_subtotal" | "collection" | "customer" | "customer_order_count" | "customer_tag" | "customer_total_spent" | "product_tag" | "product_title" | "product_type" | "product_vendor";
|
|
81
|
+
value: string;
|
|
82
|
+
}[];
|
|
83
|
+
}[];
|
|
84
|
+
output: {
|
|
85
|
+
key: string;
|
|
86
|
+
type: "data_json";
|
|
87
|
+
value: string;
|
|
88
|
+
}[];
|
|
89
|
+
}[];
|
|
90
|
+
} | undefined;
|
|
91
|
+
})[] | undefined;
|
|
92
|
+
visibility?: {
|
|
93
|
+
variable: string;
|
|
94
|
+
visibleWhen: boolean;
|
|
95
|
+
} | undefined;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Places the button where `productOptions.showDeclineAll` put legacy's: above and/or below every product
|
|
99
|
+
* region (each `offers` section a product information block converts to), as legacy drew one `ProductOffers`
|
|
100
|
+
* with its own Decline All per block. A frame without a product region, or a placement of `none`, carries no
|
|
101
|
+
* button and is returned as it came.
|
|
102
|
+
*/
|
|
103
|
+
export declare const withDeclineThese: (sections: CABSection[], placement: Placement, label: string | undefined) => CABSection[];
|
|
104
|
+
export {};
|
|
@@ -4,7 +4,7 @@ import { type ProductCardSettings } from '../../transforms/postPurchase/productC
|
|
|
4
4
|
* merchant's `notAvailable`, over the checkout card's localized `soldOut` defaults.
|
|
5
5
|
*/
|
|
6
6
|
export declare const soldOutSlot: ({ language }: ProductCardSettings) => {
|
|
7
|
-
buttonField: "declineAllOffers" | "declineOffer" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount";
|
|
7
|
+
buttonField: "declineAllOffers" | "declineOffer" | "declineThese" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount";
|
|
8
8
|
content: Record<string, string> & {
|
|
9
9
|
en: string;
|
|
10
10
|
};
|
|
@@ -8,7 +8,7 @@ import { type ButtonField } from '../../schema/widgets/checkout-and-beyond/commo
|
|
|
8
8
|
export declare const labelSlot: (buttonField: ButtonField, defaults: Record<string, string> & {
|
|
9
9
|
en: string;
|
|
10
10
|
}, override: string | undefined, knownTokens?: readonly string[], legacyDefaults?: readonly string[]) => {
|
|
11
|
-
buttonField: "declineAllOffers" | "declineOffer" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount";
|
|
11
|
+
buttonField: "declineAllOffers" | "declineOffer" | "declineThese" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount";
|
|
12
12
|
content: Record<string, string> & {
|
|
13
13
|
en: string;
|
|
14
14
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rebuy/rebuy",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.64.0",
|
|
4
4
|
"description": "Shared zod schemas, legacy-to-CAB widget transforms, and server orchestrators for Rebuy's Shopify consumers (rebuy-api, admin-nextjs, rebuy-shopify-extensions)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Rebuy, Inc.",
|