@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
package/dist/index.cjs
CHANGED
|
@@ -1916,6 +1916,12 @@ var buttonActions = [
|
|
|
1916
1916
|
"addToOrder",
|
|
1917
1917
|
"declineAllOffers",
|
|
1918
1918
|
"declineOffer",
|
|
1919
|
+
/**
|
|
1920
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
1921
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
1922
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
1923
|
+
*/
|
|
1924
|
+
"declineThese",
|
|
1919
1925
|
"displayContentInModal",
|
|
1920
1926
|
"displayContentInPopover",
|
|
1921
1927
|
"goToNextPage",
|
|
@@ -1937,6 +1943,7 @@ var buttonFields = [
|
|
|
1937
1943
|
"buttonLabel",
|
|
1938
1944
|
"declineAllOffers",
|
|
1939
1945
|
"declineOffer",
|
|
1946
|
+
"declineThese",
|
|
1940
1947
|
"destinationUrl",
|
|
1941
1948
|
"inactivePage",
|
|
1942
1949
|
"overlayContent",
|
|
@@ -4536,7 +4543,9 @@ var CABLayoutSection = import_zod67.z.object({
|
|
|
4536
4543
|
direction: import_zod67.z.enum(directions).default(Direction.rows),
|
|
4537
4544
|
/**
|
|
4538
4545
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4539
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
4546
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
4547
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
4548
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
4540
4549
|
*/
|
|
4541
4550
|
frame: import_zod67.z.enum(layoutFrames).optional(),
|
|
4542
4551
|
grid: import_zod67.z.object({
|
package/dist/index.mjs
CHANGED
|
@@ -1433,6 +1433,12 @@ var buttonActions = [
|
|
|
1433
1433
|
"addToOrder",
|
|
1434
1434
|
"declineAllOffers",
|
|
1435
1435
|
"declineOffer",
|
|
1436
|
+
/**
|
|
1437
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
1438
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
1439
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
1440
|
+
*/
|
|
1441
|
+
"declineThese",
|
|
1436
1442
|
"displayContentInModal",
|
|
1437
1443
|
"displayContentInPopover",
|
|
1438
1444
|
"goToNextPage",
|
|
@@ -1454,6 +1460,7 @@ var buttonFields = [
|
|
|
1454
1460
|
"buttonLabel",
|
|
1455
1461
|
"declineAllOffers",
|
|
1456
1462
|
"declineOffer",
|
|
1463
|
+
"declineThese",
|
|
1457
1464
|
"destinationUrl",
|
|
1458
1465
|
"inactivePage",
|
|
1459
1466
|
"overlayContent",
|
|
@@ -4053,7 +4060,9 @@ var CABLayoutSection = z67.object({
|
|
|
4053
4060
|
direction: z67.enum(directions).default(Direction.rows),
|
|
4054
4061
|
/**
|
|
4055
4062
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
4056
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
4063
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
4064
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
4065
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
4057
4066
|
*/
|
|
4058
4067
|
frame: z67.enum(layoutFrames).optional(),
|
|
4059
4068
|
grid: z67.object({
|
|
@@ -120,6 +120,12 @@ var buttonActions = [
|
|
|
120
120
|
"addToOrder",
|
|
121
121
|
"declineAllOffers",
|
|
122
122
|
"declineOffer",
|
|
123
|
+
/**
|
|
124
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
125
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
126
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
127
|
+
*/
|
|
128
|
+
"declineThese",
|
|
123
129
|
"displayContentInModal",
|
|
124
130
|
"displayContentInPopover",
|
|
125
131
|
"goToNextPage",
|
|
@@ -141,6 +147,7 @@ var buttonFields = [
|
|
|
141
147
|
"buttonLabel",
|
|
142
148
|
"declineAllOffers",
|
|
143
149
|
"declineOffer",
|
|
150
|
+
"declineThese",
|
|
144
151
|
"destinationUrl",
|
|
145
152
|
"inactivePage",
|
|
146
153
|
"overlayContent",
|
|
@@ -14,6 +14,12 @@ var buttonActions = [
|
|
|
14
14
|
"addToOrder",
|
|
15
15
|
"declineAllOffers",
|
|
16
16
|
"declineOffer",
|
|
17
|
+
/**
|
|
18
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
19
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
20
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
21
|
+
*/
|
|
22
|
+
"declineThese",
|
|
17
23
|
"displayContentInModal",
|
|
18
24
|
"displayContentInPopover",
|
|
19
25
|
"goToNextPage",
|
|
@@ -35,6 +41,7 @@ var buttonFields = [
|
|
|
35
41
|
"buttonLabel",
|
|
36
42
|
"declineAllOffers",
|
|
37
43
|
"declineOffer",
|
|
44
|
+
"declineThese",
|
|
38
45
|
"destinationUrl",
|
|
39
46
|
"inactivePage",
|
|
40
47
|
"overlayContent",
|
|
@@ -232,6 +232,12 @@ var buttonActions = [
|
|
|
232
232
|
"addToOrder",
|
|
233
233
|
"declineAllOffers",
|
|
234
234
|
"declineOffer",
|
|
235
|
+
/**
|
|
236
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
237
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
238
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
239
|
+
*/
|
|
240
|
+
"declineThese",
|
|
235
241
|
"displayContentInModal",
|
|
236
242
|
"displayContentInPopover",
|
|
237
243
|
"goToNextPage",
|
|
@@ -253,6 +259,7 @@ var buttonFields = [
|
|
|
253
259
|
"buttonLabel",
|
|
254
260
|
"declineAllOffers",
|
|
255
261
|
"declineOffer",
|
|
262
|
+
"declineThese",
|
|
256
263
|
"destinationUrl",
|
|
257
264
|
"inactivePage",
|
|
258
265
|
"overlayContent",
|
|
@@ -1712,7 +1719,9 @@ var CABLayoutSection = import_zod21.z.object({
|
|
|
1712
1719
|
direction: import_zod21.z.enum(directions).default(Direction.rows),
|
|
1713
1720
|
/**
|
|
1714
1721
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1715
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
1722
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
1723
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
1724
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
1716
1725
|
*/
|
|
1717
1726
|
frame: import_zod21.z.enum(layoutFrames).optional(),
|
|
1718
1727
|
grid: import_zod21.z.object({
|
|
@@ -17,6 +17,12 @@ var buttonActions = [
|
|
|
17
17
|
"addToOrder",
|
|
18
18
|
"declineAllOffers",
|
|
19
19
|
"declineOffer",
|
|
20
|
+
/**
|
|
21
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
22
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
23
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
24
|
+
*/
|
|
25
|
+
"declineThese",
|
|
20
26
|
"displayContentInModal",
|
|
21
27
|
"displayContentInPopover",
|
|
22
28
|
"goToNextPage",
|
|
@@ -38,6 +44,7 @@ var buttonFields = [
|
|
|
38
44
|
"buttonLabel",
|
|
39
45
|
"declineAllOffers",
|
|
40
46
|
"declineOffer",
|
|
47
|
+
"declineThese",
|
|
41
48
|
"destinationUrl",
|
|
42
49
|
"inactivePage",
|
|
43
50
|
"overlayContent",
|
|
@@ -1497,7 +1504,9 @@ var CABLayoutSection = z21.object({
|
|
|
1497
1504
|
direction: z21.enum(directions).default(Direction.rows),
|
|
1498
1505
|
/**
|
|
1499
1506
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1500
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
1507
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
1508
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
1509
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
1501
1510
|
*/
|
|
1502
1511
|
frame: z21.enum(layoutFrames).optional(),
|
|
1503
1512
|
grid: z21.object({
|
|
@@ -49,6 +49,7 @@ export declare const PostPurchaseOfferPresentation: z.ZodObject<{
|
|
|
49
49
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
50
50
|
declineAllOffers: "declineAllOffers";
|
|
51
51
|
declineOffer: "declineOffer";
|
|
52
|
+
declineThese: "declineThese";
|
|
52
53
|
removeFromOrder: "removeFromOrder";
|
|
53
54
|
undoAddToOrder: "undoAddToOrder";
|
|
54
55
|
activePage: "activePage";
|
|
@@ -440,6 +441,7 @@ export declare const OfferPresentationResponseSchema: z.ZodObject<{
|
|
|
440
441
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
441
442
|
declineAllOffers: "declineAllOffers";
|
|
442
443
|
declineOffer: "declineOffer";
|
|
444
|
+
declineThese: "declineThese";
|
|
443
445
|
removeFromOrder: "removeFromOrder";
|
|
444
446
|
undoAddToOrder: "undoAddToOrder";
|
|
445
447
|
activePage: "activePage";
|
|
@@ -332,6 +332,7 @@ export declare const PostPurchaseProductCollectionView: z.ZodObject<{
|
|
|
332
332
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
333
333
|
declineAllOffers: "declineAllOffers";
|
|
334
334
|
declineOffer: "declineOffer";
|
|
335
|
+
declineThese: "declineThese";
|
|
335
336
|
removeFromOrder: "removeFromOrder";
|
|
336
337
|
undoAddToOrder: "undoAddToOrder";
|
|
337
338
|
activePage: "activePage";
|
|
@@ -796,6 +797,7 @@ export declare const PostPurchaseProductCollectionView: z.ZodObject<{
|
|
|
796
797
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
797
798
|
declineAllOffers: "declineAllOffers";
|
|
798
799
|
declineOffer: "declineOffer";
|
|
800
|
+
declineThese: "declineThese";
|
|
799
801
|
removeFromOrder: "removeFromOrder";
|
|
800
802
|
undoAddToOrder: "undoAddToOrder";
|
|
801
803
|
activePage: "activePage";
|
|
@@ -336,6 +336,7 @@ export declare const PostPurchaseProductView: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
336
336
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
337
337
|
declineAllOffers: "declineAllOffers";
|
|
338
338
|
declineOffer: "declineOffer";
|
|
339
|
+
declineThese: "declineThese";
|
|
339
340
|
removeFromOrder: "removeFromOrder";
|
|
340
341
|
undoAddToOrder: "undoAddToOrder";
|
|
341
342
|
activePage: "activePage";
|
|
@@ -800,6 +801,7 @@ export declare const PostPurchaseProductView: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
800
801
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
801
802
|
declineAllOffers: "declineAllOffers";
|
|
802
803
|
declineOffer: "declineOffer";
|
|
804
|
+
declineThese: "declineThese";
|
|
803
805
|
removeFromOrder: "removeFromOrder";
|
|
804
806
|
undoAddToOrder: "undoAddToOrder";
|
|
805
807
|
activePage: "activePage";
|
|
@@ -51,6 +51,12 @@ var buttonActions = [
|
|
|
51
51
|
"addToOrder",
|
|
52
52
|
"declineAllOffers",
|
|
53
53
|
"declineOffer",
|
|
54
|
+
/**
|
|
55
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
56
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
57
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
58
|
+
*/
|
|
59
|
+
"declineThese",
|
|
54
60
|
"displayContentInModal",
|
|
55
61
|
"displayContentInPopover",
|
|
56
62
|
"goToNextPage",
|
|
@@ -72,6 +78,7 @@ var buttonFields = [
|
|
|
72
78
|
"buttonLabel",
|
|
73
79
|
"declineAllOffers",
|
|
74
80
|
"declineOffer",
|
|
81
|
+
"declineThese",
|
|
75
82
|
"destinationUrl",
|
|
76
83
|
"inactivePage",
|
|
77
84
|
"overlayContent",
|
|
@@ -1533,7 +1540,9 @@ var CABLayoutSection = import_zod24.z.object({
|
|
|
1533
1540
|
direction: import_zod24.z.enum(directions).default(Direction.rows),
|
|
1534
1541
|
/**
|
|
1535
1542
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1536
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
1543
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
1544
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
1545
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
1537
1546
|
*/
|
|
1538
1547
|
frame: import_zod24.z.enum(layoutFrames).optional(),
|
|
1539
1548
|
grid: import_zod24.z.object({
|
|
@@ -26,6 +26,12 @@ var buttonActions = [
|
|
|
26
26
|
"addToOrder",
|
|
27
27
|
"declineAllOffers",
|
|
28
28
|
"declineOffer",
|
|
29
|
+
/**
|
|
30
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
31
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
32
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
33
|
+
*/
|
|
34
|
+
"declineThese",
|
|
29
35
|
"displayContentInModal",
|
|
30
36
|
"displayContentInPopover",
|
|
31
37
|
"goToNextPage",
|
|
@@ -47,6 +53,7 @@ var buttonFields = [
|
|
|
47
53
|
"buttonLabel",
|
|
48
54
|
"declineAllOffers",
|
|
49
55
|
"declineOffer",
|
|
56
|
+
"declineThese",
|
|
50
57
|
"destinationUrl",
|
|
51
58
|
"inactivePage",
|
|
52
59
|
"overlayContent",
|
|
@@ -1508,7 +1515,9 @@ var CABLayoutSection = z24.object({
|
|
|
1508
1515
|
direction: z24.enum(directions).default(Direction.rows),
|
|
1509
1516
|
/**
|
|
1510
1517
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1511
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
1518
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
1519
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
1520
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
1512
1521
|
*/
|
|
1513
1522
|
frame: z24.enum(layoutFrames).optional(),
|
|
1514
1523
|
grid: z24.object({
|
|
@@ -87,6 +87,7 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
87
87
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
88
88
|
declineAllOffers: "declineAllOffers";
|
|
89
89
|
declineOffer: "declineOffer";
|
|
90
|
+
declineThese: "declineThese";
|
|
90
91
|
removeFromOrder: "removeFromOrder";
|
|
91
92
|
undoAddToOrder: "undoAddToOrder";
|
|
92
93
|
activePage: "activePage";
|
|
@@ -453,6 +454,7 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
453
454
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
454
455
|
declineAllOffers: "declineAllOffers";
|
|
455
456
|
declineOffer: "declineOffer";
|
|
457
|
+
declineThese: "declineThese";
|
|
456
458
|
removeFromOrder: "removeFromOrder";
|
|
457
459
|
undoAddToOrder: "undoAddToOrder";
|
|
458
460
|
activePage: "activePage";
|
|
@@ -796,6 +798,7 @@ export declare const WidgetData: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
796
798
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
797
799
|
declineAllOffers: "declineAllOffers";
|
|
798
800
|
declineOffer: "declineOffer";
|
|
801
|
+
declineThese: "declineThese";
|
|
799
802
|
removeFromOrder: "removeFromOrder";
|
|
800
803
|
undoAddToOrder: "undoAddToOrder";
|
|
801
804
|
activePage: "activePage";
|
|
@@ -261,6 +261,7 @@ export declare const CABBannerSection: z.ZodLazy<z.ZodObject<{
|
|
|
261
261
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
262
262
|
declineAllOffers: "declineAllOffers";
|
|
263
263
|
declineOffer: "declineOffer";
|
|
264
|
+
declineThese: "declineThese";
|
|
264
265
|
removeFromOrder: "removeFromOrder";
|
|
265
266
|
undoAddToOrder: "undoAddToOrder";
|
|
266
267
|
activePage: "activePage";
|
|
@@ -12,6 +12,7 @@ export declare const CABButtonSection: z.ZodObject<{
|
|
|
12
12
|
addToOrder: "addToOrder";
|
|
13
13
|
declineAllOffers: "declineAllOffers";
|
|
14
14
|
declineOffer: "declineOffer";
|
|
15
|
+
declineThese: "declineThese";
|
|
15
16
|
displayContentInModal: "displayContentInModal";
|
|
16
17
|
displayContentInPopover: "displayContentInPopover";
|
|
17
18
|
goToNextPage: "goToNextPage";
|
|
@@ -45,6 +45,7 @@ export declare const CABCarouselSection: z.ZodLazy<z.ZodObject<{
|
|
|
45
45
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
46
46
|
declineAllOffers: "declineAllOffers";
|
|
47
47
|
declineOffer: "declineOffer";
|
|
48
|
+
declineThese: "declineThese";
|
|
48
49
|
removeFromOrder: "removeFromOrder";
|
|
49
50
|
undoAddToOrder: "undoAddToOrder";
|
|
50
51
|
activePage: "activePage";
|
|
@@ -44,6 +44,7 @@ export declare const CABCartLineSection: z.ZodLazy<z.ZodObject<{
|
|
|
44
44
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
45
45
|
declineAllOffers: "declineAllOffers";
|
|
46
46
|
declineOffer: "declineOffer";
|
|
47
|
+
declineThese: "declineThese";
|
|
47
48
|
removeFromOrder: "removeFromOrder";
|
|
48
49
|
undoAddToOrder: "undoAddToOrder";
|
|
49
50
|
activePage: "activePage";
|
|
@@ -31,13 +31,14 @@ export declare const BorderWidth: {
|
|
|
31
31
|
readonly thick: "thick";
|
|
32
32
|
};
|
|
33
33
|
export type BorderWidth = (typeof borderWidths)[number];
|
|
34
|
-
export declare const buttonActions: readonly ["acceptOffer", "addGift", "addToOrder", "declineAllOffers", "declineOffer", "displayContentInModal", "displayContentInPopover", "goToNextPage", "goToPrevPage", "goToURL", "removeFromOrder", "removeGift", "selectVariant", "showPagination", "switchToSubscription", "undoAddToOrder"];
|
|
34
|
+
export declare const buttonActions: readonly ["acceptOffer", "addGift", "addToOrder", "declineAllOffers", "declineOffer", "declineThese", "displayContentInModal", "displayContentInPopover", "goToNextPage", "goToPrevPage", "goToURL", "removeFromOrder", "removeGift", "selectVariant", "showPagination", "switchToSubscription", "undoAddToOrder"];
|
|
35
35
|
export declare const ButtonAction: {
|
|
36
36
|
readonly acceptOffer: "acceptOffer";
|
|
37
37
|
readonly addGift: "addGift";
|
|
38
38
|
readonly addToOrder: "addToOrder";
|
|
39
39
|
readonly declineAllOffers: "declineAllOffers";
|
|
40
40
|
readonly declineOffer: "declineOffer";
|
|
41
|
+
readonly declineThese: "declineThese";
|
|
41
42
|
readonly displayContentInModal: "displayContentInModal";
|
|
42
43
|
readonly displayContentInPopover: "displayContentInPopover";
|
|
43
44
|
readonly goToNextPage: "goToNextPage";
|
|
@@ -51,10 +52,11 @@ export declare const ButtonAction: {
|
|
|
51
52
|
readonly undoAddToOrder: "undoAddToOrder";
|
|
52
53
|
};
|
|
53
54
|
export type ButtonAction = (typeof buttonActions)[number];
|
|
54
|
-
export declare const buttonFields: readonly ["activePage", "addedToCart", "addingToCart", "addToCart", "buttonLabel", "declineAllOffers", "declineOffer", "destinationUrl", "inactivePage", "overlayContent", "payNow", "progressReached", "progressRemaining", "redirectToCheckout", "removeFromOrder", "showVariant", "showVariants", "soldOut", "subscriptionOption", "switchToOneTimePurchase", "switchToSubscriptionNoDiscount", "switchToSubscriptionWithDiscount", "undoAddToOrder"];
|
|
55
|
+
export declare const buttonFields: readonly ["activePage", "addedToCart", "addingToCart", "addToCart", "buttonLabel", "declineAllOffers", "declineOffer", "declineThese", "destinationUrl", "inactivePage", "overlayContent", "payNow", "progressReached", "progressRemaining", "redirectToCheckout", "removeFromOrder", "showVariant", "showVariants", "soldOut", "subscriptionOption", "switchToOneTimePurchase", "switchToSubscriptionNoDiscount", "switchToSubscriptionWithDiscount", "undoAddToOrder"];
|
|
55
56
|
export declare const ButtonField: {
|
|
56
57
|
readonly declineAllOffers: "declineAllOffers";
|
|
57
58
|
readonly declineOffer: "declineOffer";
|
|
59
|
+
readonly declineThese: "declineThese";
|
|
58
60
|
readonly removeFromOrder: "removeFromOrder";
|
|
59
61
|
readonly undoAddToOrder: "undoAddToOrder";
|
|
60
62
|
readonly activePage: "activePage";
|
|
@@ -31,6 +31,7 @@ export declare const CABImageSectionFields: z.ZodObject<{
|
|
|
31
31
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
32
32
|
declineAllOffers: "declineAllOffers";
|
|
33
33
|
declineOffer: "declineOffer";
|
|
34
|
+
declineThese: "declineThese";
|
|
34
35
|
removeFromOrder: "removeFromOrder";
|
|
35
36
|
undoAddToOrder: "undoAddToOrder";
|
|
36
37
|
activePage: "activePage";
|
|
@@ -389,6 +390,7 @@ export declare const CABImageSection: z.ZodObject<{
|
|
|
389
390
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
390
391
|
declineAllOffers: "declineAllOffers";
|
|
391
392
|
declineOffer: "declineOffer";
|
|
393
|
+
declineThese: "declineThese";
|
|
392
394
|
removeFromOrder: "removeFromOrder";
|
|
393
395
|
undoAddToOrder: "undoAddToOrder";
|
|
394
396
|
activePage: "activePage";
|
|
@@ -46,6 +46,7 @@ export declare const CABLayoutSection: z.ZodObject<{
|
|
|
46
46
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
47
47
|
declineAllOffers: "declineAllOffers";
|
|
48
48
|
declineOffer: "declineOffer";
|
|
49
|
+
declineThese: "declineThese";
|
|
49
50
|
removeFromOrder: "removeFromOrder";
|
|
50
51
|
undoAddToOrder: "undoAddToOrder";
|
|
51
52
|
activePage: "activePage";
|
|
@@ -44,6 +44,7 @@ export declare const CABOffersSection: z.ZodLazy<z.ZodObject<{
|
|
|
44
44
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
45
45
|
declineAllOffers: "declineAllOffers";
|
|
46
46
|
declineOffer: "declineOffer";
|
|
47
|
+
declineThese: "declineThese";
|
|
47
48
|
removeFromOrder: "removeFromOrder";
|
|
48
49
|
undoAddToOrder: "undoAddToOrder";
|
|
49
50
|
activePage: "activePage";
|
|
@@ -116,6 +116,7 @@ export declare const CABProgressBarSection: z.ZodLazy<z.ZodObject<{
|
|
|
116
116
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
117
117
|
declineAllOffers: "declineAllOffers";
|
|
118
118
|
declineOffer: "declineOffer";
|
|
119
|
+
declineThese: "declineThese";
|
|
119
120
|
removeFromOrder: "removeFromOrder";
|
|
120
121
|
undoAddToOrder: "undoAddToOrder";
|
|
121
122
|
activePage: "activePage";
|
|
@@ -105,6 +105,7 @@ export declare const CABRootSection: z.ZodObject<{
|
|
|
105
105
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
106
106
|
declineAllOffers: "declineAllOffers";
|
|
107
107
|
declineOffer: "declineOffer";
|
|
108
|
+
declineThese: "declineThese";
|
|
108
109
|
removeFromOrder: "removeFromOrder";
|
|
109
110
|
undoAddToOrder: "undoAddToOrder";
|
|
110
111
|
activePage: "activePage";
|
|
@@ -117,6 +117,7 @@ export declare const CABTextSection: z.ZodObject<{
|
|
|
117
117
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
118
118
|
declineAllOffers: "declineAllOffers";
|
|
119
119
|
declineOffer: "declineOffer";
|
|
120
|
+
declineThese: "declineThese";
|
|
120
121
|
removeFromOrder: "removeFromOrder";
|
|
121
122
|
undoAddToOrder: "undoAddToOrder";
|
|
122
123
|
activePage: "activePage";
|
|
@@ -130,6 +130,7 @@ export declare const ContentBlock: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
130
130
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
131
131
|
declineAllOffers: "declineAllOffers";
|
|
132
132
|
declineOffer: "declineOffer";
|
|
133
|
+
declineThese: "declineThese";
|
|
133
134
|
removeFromOrder: "removeFromOrder";
|
|
134
135
|
undoAddToOrder: "undoAddToOrder";
|
|
135
136
|
activePage: "activePage";
|
|
@@ -95,6 +95,7 @@ export declare const LineItemEditor: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
95
95
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
96
96
|
declineAllOffers: "declineAllOffers";
|
|
97
97
|
declineOffer: "declineOffer";
|
|
98
|
+
declineThese: "declineThese";
|
|
98
99
|
removeFromOrder: "removeFromOrder";
|
|
99
100
|
undoAddToOrder: "undoAddToOrder";
|
|
100
101
|
activePage: "activePage";
|
|
@@ -42,6 +42,7 @@ export declare const RebuyButton: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
42
42
|
buttonField: z.ZodOptional<z.ZodEnum<{
|
|
43
43
|
declineAllOffers: "declineAllOffers";
|
|
44
44
|
declineOffer: "declineOffer";
|
|
45
|
+
declineThese: "declineThese";
|
|
45
46
|
removeFromOrder: "removeFromOrder";
|
|
46
47
|
undoAddToOrder: "undoAddToOrder";
|
|
47
48
|
activePage: "activePage";
|
package/dist/server/index.cjs
CHANGED
|
@@ -542,6 +542,12 @@ var buttonActions = [
|
|
|
542
542
|
"addToOrder",
|
|
543
543
|
"declineAllOffers",
|
|
544
544
|
"declineOffer",
|
|
545
|
+
/**
|
|
546
|
+
* Post-purchase only: declines every remaining member of the Offer shown and follows the flow, as legacy's
|
|
547
|
+
* "Decline All" did (L59). Conversion emits this for the legacy button; `declineAllOffers` stays the
|
|
548
|
+
* CAB-native action that ends the session, for widgets authored in the new editor.
|
|
549
|
+
*/
|
|
550
|
+
"declineThese",
|
|
545
551
|
"displayContentInModal",
|
|
546
552
|
"displayContentInPopover",
|
|
547
553
|
"goToNextPage",
|
|
@@ -563,6 +569,7 @@ var buttonFields = [
|
|
|
563
569
|
"buttonLabel",
|
|
564
570
|
"declineAllOffers",
|
|
565
571
|
"declineOffer",
|
|
572
|
+
"declineThese",
|
|
566
573
|
"destinationUrl",
|
|
567
574
|
"inactivePage",
|
|
568
575
|
"overlayContent",
|
|
@@ -1953,7 +1960,9 @@ var CABLayoutSection = import_zod22.z.object({
|
|
|
1953
1960
|
direction: import_zod22.z.enum(directions).default(Direction.rows),
|
|
1954
1961
|
/**
|
|
1955
1962
|
* Platform chrome around the section, not a layout behavior: `callout` is a subdued box with block borders
|
|
1956
|
-
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content
|
|
1963
|
+
* (the legacy post-purchase callout banner), `offer-content` the post-purchase offer's own content column
|
|
1964
|
+
* (legacy `ComponentSectionLayout`), which the converter puts around the text, image and image-with-text
|
|
1965
|
+
* blocks. The offers section is never framed: the renderers place it in that column themselves.
|
|
1957
1966
|
*/
|
|
1958
1967
|
frame: import_zod22.z.enum(layoutFrames).optional(),
|
|
1959
1968
|
grid: import_zod22.z.object({
|
|
@@ -5022,15 +5031,19 @@ var convertProductInformation = (raw, report, widgetSettings) => {
|
|
|
5022
5031
|
CABLayoutSection.parse({
|
|
5023
5032
|
alignment: { horizontal: "center" },
|
|
5024
5033
|
direction: "grid",
|
|
5025
|
-
|
|
5034
|
+
/**
|
|
5035
|
+
* One full-width track, uncapped. Legacy `ProductImage` set its 250-pixel, 90% track
|
|
5036
|
+
* only on the small viewport, so on medium and large the image filled its column; the
|
|
5037
|
+
* schema has no per-viewport tracks, so it fills its column at every viewport.
|
|
5038
|
+
*/
|
|
5039
|
+
grid: { columns: ["100%"] },
|
|
5026
5040
|
sections: [
|
|
5027
5041
|
CABImageSection.parse({
|
|
5028
5042
|
altText: "{{productTitle}}",
|
|
5029
5043
|
source: "{{productImage}}",
|
|
5030
5044
|
...thumbnails(settings)
|
|
5031
5045
|
})
|
|
5032
|
-
]
|
|
5033
|
-
width: 90
|
|
5046
|
+
]
|
|
5034
5047
|
})
|
|
5035
5048
|
]
|
|
5036
5049
|
}),
|
|
@@ -5120,7 +5133,7 @@ var convertTextBlock = (raw, report) => {
|
|
|
5120
5133
|
const section = CABTextSection.safeParse({ content: { en: content } });
|
|
5121
5134
|
return section.success ? [section.data] : omit(field);
|
|
5122
5135
|
});
|
|
5123
|
-
return sections.length ? [CABLayoutSection.parse({ alignment: { horizontal }, sections })] : [];
|
|
5136
|
+
return sections.length ? [CABLayoutSection.parse({ alignment: { horizontal }, frame: "offer-content", sections })] : [];
|
|
5124
5137
|
};
|
|
5125
5138
|
|
|
5126
5139
|
// src/transforms/postPurchase/convertTimerBlock.ts
|
|
@@ -8428,6 +8441,26 @@ var OfferPresentationResponseSchema = import_zod89.z.object({
|
|
|
8428
8441
|
successful: import_zod89.z.literal(true)
|
|
8429
8442
|
});
|
|
8430
8443
|
|
|
8444
|
+
// src/transforms/postPurchase/declineTheseButton.ts
|
|
8445
|
+
var DECLINE_ALL = { en: "Decline All" };
|
|
8446
|
+
var declineTheseButton = (label2) => CABLayoutSection.parse({
|
|
8447
|
+
frame: "offer-content",
|
|
8448
|
+
sections: [
|
|
8449
|
+
CABButtonSection.parse({
|
|
8450
|
+
action: "declineThese",
|
|
8451
|
+
buttonStyle: "secondary",
|
|
8452
|
+
sections: [labelSlot("declineThese", DECLINE_ALL, label2)]
|
|
8453
|
+
})
|
|
8454
|
+
]
|
|
8455
|
+
});
|
|
8456
|
+
var withDeclineThese = (sections, placement, label2) => {
|
|
8457
|
+
const isRegion = ({ sectionType }) => sectionType === "offers";
|
|
8458
|
+
if (!placement || placement === "none" || !sections.some(isRegion)) return sections;
|
|
8459
|
+
const above = () => placement === "above" || placement === "both" ? [declineTheseButton(label2)] : [];
|
|
8460
|
+
const below = () => placement === "below" || placement === "both" ? [declineTheseButton(label2)] : [];
|
|
8461
|
+
return sections.flatMap((section) => isRegion(section) ? [...above(), section, ...below()] : [section]);
|
|
8462
|
+
};
|
|
8463
|
+
|
|
8431
8464
|
// src/server/preparePostPurchaseOfferPresentation.ts
|
|
8432
8465
|
var FrameSettings = PostPurchaseSettings.pick({ language: true, offersLayout: true, productOptions: true }).extend({
|
|
8433
8466
|
blocks: import_zod90.z.array(import_zod90.z.unknown()).optional()
|
|
@@ -8439,7 +8472,7 @@ var preparePostPurchaseOfferPresentation = (widgetId, settings, response, report
|
|
|
8439
8472
|
const effective = FrameSettings.parse((0, import_compat8.merge)({}, original, metadata.widget));
|
|
8440
8473
|
let sections = null;
|
|
8441
8474
|
try {
|
|
8442
|
-
|
|
8475
|
+
const tree = convertMessagePreview(
|
|
8443
8476
|
widgetId,
|
|
8444
8477
|
{
|
|
8445
8478
|
...merged,
|
|
@@ -8448,14 +8481,21 @@ var preparePostPurchaseOfferPresentation = (widgetId, settings, response, report
|
|
|
8448
8481
|
},
|
|
8449
8482
|
report
|
|
8450
8483
|
);
|
|
8484
|
+
sections = {
|
|
8485
|
+
...tree,
|
|
8486
|
+
sections: withDeclineThese(
|
|
8487
|
+
tree.sections,
|
|
8488
|
+
effective.productOptions.showDeclineAll,
|
|
8489
|
+
effective.language.global.declineAll
|
|
8490
|
+
)
|
|
8491
|
+
};
|
|
8451
8492
|
} catch (error) {
|
|
8452
8493
|
if (!(error instanceof NotFoundError)) throw error;
|
|
8453
8494
|
}
|
|
8454
8495
|
return PostPurchaseOfferPresentation.parse({
|
|
8455
8496
|
labels: effective.language.global,
|
|
8456
8497
|
layout: effective.offersLayout,
|
|
8457
|
-
sections
|
|
8458
|
-
showDeclineAll: effective.productOptions.showDeclineAll
|
|
8498
|
+
sections
|
|
8459
8499
|
});
|
|
8460
8500
|
};
|
|
8461
8501
|
|