@rebuy/rebuy 3.35.0 → 3.37.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.
Files changed (42) hide show
  1. package/dist/index.cjs +799 -648
  2. package/dist/index.mjs +799 -648
  3. package/dist/schema/index.d.ts +4 -0
  4. package/dist/schema/postPurchaseGroup.d.ts +15 -0
  5. package/dist/schema/postPurchaseProduct.d.ts +102 -24
  6. package/dist/schema/postPurchaseProductCalculation.d.ts +87 -0
  7. package/dist/schema/postPurchaseProductCollectionView.d.ts +738 -3
  8. package/dist/schema/postPurchaseProductDisplay.d.ts +57 -16
  9. package/dist/schema/postPurchaseProductReviews.d.ts +36 -0
  10. package/dist/schema/postPurchaseProductView.d.ts +722 -0
  11. package/dist/schema/postPurchaseQuantity.d.ts +16 -3
  12. package/dist/schema/postPurchaseSubscriptionProduct.d.ts +98 -17
  13. package/dist/server/__fixtures__/postPurchaseGroup.d.ts +3 -0
  14. package/dist/server/__fixtures__/postPurchaseReviewProviders.d.ts +30 -0
  15. package/dist/server/__fixtures__/postPurchaseReviews.d.ts +67 -0
  16. package/dist/server/index.cjs +1014 -348
  17. package/dist/server/index.d.ts +13 -2
  18. package/dist/server/index.mjs +1014 -348
  19. package/dist/server/postPurchaseJudgeMeReviews.d.ts +6 -0
  20. package/dist/server/postPurchaseOkendoReviews.d.ts +6 -0
  21. package/dist/server/postPurchaseProductDisplay.d.ts +49 -7
  22. package/dist/server/postPurchaseReviewData.d.ts +7 -0
  23. package/dist/server/postPurchaseReviewFields.d.ts +7 -0
  24. package/dist/server/postPurchaseReviewProvider.d.ts +2 -0
  25. package/dist/server/postPurchaseReviews.d.ts +5 -0
  26. package/dist/server/postPurchaseScalarReviews.d.ts +6 -0
  27. package/dist/server/prepareNormalizedSubscription.d.ts +2 -2
  28. package/dist/server/preparePostPurchaseAdmissionView.d.ts +428 -0
  29. package/dist/server/preparePostPurchaseCollectionGroup.d.ts +468 -0
  30. package/dist/server/preparePostPurchaseCollectionView.d.ts +452 -0
  31. package/dist/server/preparePostPurchaseGroupAdmissionView.d.ts +469 -0
  32. package/dist/server/preparePostPurchaseGroupDefault.d.ts +469 -0
  33. package/dist/server/preparePostPurchaseGroupView.d.ts +468 -0
  34. package/dist/server/preparePostPurchaseMemberView.d.ts +1496 -0
  35. package/dist/server/preparePostPurchaseProduct.d.ts +8 -0
  36. package/dist/server/preparePostPurchaseQuantityAdmissionView.d.ts +450 -0
  37. package/dist/server/preparePostPurchaseQuantityView.d.ts +437 -0
  38. package/dist/server/preparePostPurchaseSubscription.d.ts +47 -5
  39. package/dist/server/preparePostPurchaseView.d.ts +8 -0
  40. package/dist/server/projectPostPurchaseProduct.d.ts +49 -6
  41. package/dist/transforms/postPurchase/convertDescriptionRte.d.ts +11 -0
  42. package/package.json +1 -1
@@ -0,0 +1,437 @@
1
+ import type { PostPurchaseExcludedProductIds } from '../schema/postPurchaseProductCollectionView';
2
+ import { PostPurchaseQuantityChoice } from '../schema/postPurchaseQuantity';
3
+ import type { PostPurchaseVariantDefaultContext } from '../schema/postPurchaseVariantDefaultContext';
4
+ import type { Reporter } from '../server/shared';
5
+ /** Explicit pure capability; existing consumer preparation keeps its fixed-quantity guards. */
6
+ export declare const preparePostPurchaseQuantityView: (widgetId: number, settings: unknown, response: unknown, requested: PostPurchaseQuantityChoice, report?: Reporter, excludedProductIds?: PostPurchaseExcludedProductIds, defaults?: PostPurchaseVariantDefaultContext) => {
7
+ quantityPolicy: {
8
+ enabled: boolean;
9
+ initialQuantity: number;
10
+ maxValue: number;
11
+ minValue: number;
12
+ };
13
+ productId: number;
14
+ productIndex: number;
15
+ view: {
16
+ preparation: {
17
+ labels: {
18
+ declineAll: string;
19
+ free: string;
20
+ payNow: string;
21
+ quantity: string;
22
+ recurringShipping: string;
23
+ recurringSubtotal: string;
24
+ save: string;
25
+ shipping: string;
26
+ subtotal: string;
27
+ taxes: string;
28
+ total: string;
29
+ };
30
+ product: {
31
+ title: string;
32
+ id: number;
33
+ variant: {
34
+ title: string;
35
+ compareAtPrice: string | null;
36
+ id: number;
37
+ price: string;
38
+ };
39
+ image?: {
40
+ src: string;
41
+ } | null | undefined;
42
+ description?: string | null | undefined;
43
+ };
44
+ selection: {
45
+ productId: number;
46
+ quantity: number;
47
+ variantId: number;
48
+ sellingPlanId?: number | undefined;
49
+ };
50
+ status: "prepared";
51
+ terms: {
52
+ discount: {
53
+ amount: number;
54
+ title: string;
55
+ type: "none" | "fixed_amount" | "percentage";
56
+ };
57
+ shipping: {
58
+ amount: number;
59
+ title: string;
60
+ type: "fixed_amount" | "free";
61
+ };
62
+ subscription?: {
63
+ initialShippingPrice: number;
64
+ intervalLabel: string;
65
+ name: string;
66
+ recurringShippingPrice: number;
67
+ shippingOption: {
68
+ presentmentTitle: string;
69
+ title: string;
70
+ };
71
+ adjustment?: {
72
+ amount: number;
73
+ type: "price" | "fixed_amount" | "percentage";
74
+ } | undefined;
75
+ } | undefined;
76
+ };
77
+ display: {
78
+ discountedFrom: "price" | "compare_at_price";
79
+ language: {
80
+ description: string;
81
+ descriptionEnabled: boolean;
82
+ };
83
+ primaryImage: {
84
+ description: string;
85
+ source: string;
86
+ };
87
+ productOptions: {
88
+ showShipping: boolean;
89
+ showSubtotal: boolean;
90
+ showTaxes: boolean;
91
+ showTotal: boolean;
92
+ showVariantSelectors: boolean;
93
+ showDeclineAll?: "none" | "both" | "above" | "below" | undefined;
94
+ };
95
+ responseDescription: string;
96
+ reviews: {
97
+ color: string;
98
+ rating: number;
99
+ reviewCount: number;
100
+ reviewsPlural: string;
101
+ reviewsSingular: string;
102
+ size: "small" | "large" | "medium";
103
+ strokeColor: string;
104
+ strokeWidth: number;
105
+ } | null;
106
+ shouldShowSavingText: boolean;
107
+ description: string | null;
108
+ descriptionDocument?: {
109
+ attrs: {
110
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
111
+ };
112
+ content: never[] | {
113
+ attrs: {
114
+ textAlign?: "start" | "center" | "end" | undefined;
115
+ };
116
+ content: never[] | {
117
+ text: string;
118
+ type: "text";
119
+ marks?: never[] | ({
120
+ type: "bold";
121
+ } | {
122
+ type: "italic";
123
+ } | {
124
+ attrs: {
125
+ class: string | null;
126
+ href: string;
127
+ rel: string;
128
+ target: string;
129
+ };
130
+ type: "link";
131
+ } | {
132
+ type: "strike";
133
+ } | {
134
+ attrs: {
135
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
136
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
137
+ };
138
+ type: "textStyle";
139
+ })[] | undefined;
140
+ }[];
141
+ type: "paragraph";
142
+ }[];
143
+ type: "doc";
144
+ } | undefined;
145
+ gallery?: {
146
+ images: {
147
+ description: string;
148
+ id: number;
149
+ source: string;
150
+ thumbnail: string;
151
+ }[];
152
+ selectedImageId?: number | undefined;
153
+ } | undefined;
154
+ };
155
+ };
156
+ sections: {
157
+ alignment: {
158
+ horizontal: "start" | "center" | "end";
159
+ vertical: "top" | "middle" | "bottom";
160
+ };
161
+ border: {
162
+ radius: "small" | "none" | "base" | "large" | "fullyRounded";
163
+ style: "none" | "base" | "dotted" | "dashed";
164
+ width: "base" | "medium" | "thick";
165
+ };
166
+ direction: "columns" | "rows" | "grid";
167
+ padding: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
168
+ sectionId: string;
169
+ sections: never[] | import("..").CABSection[];
170
+ sectionType: "layout";
171
+ spacing: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose";
172
+ width: number;
173
+ editorMode: "checkoutExtension" | "postPurchaseOffer" | "thankYouPage" | "orderStatusPage" | "ordersIndexPage" | "customerProfilePage";
174
+ previewMode: boolean;
175
+ storeId: number | null;
176
+ targetArea: {
177
+ icon: string;
178
+ label: string;
179
+ width: string;
180
+ fill?: boolean | undefined;
181
+ flip?: "vertical" | "horizontal" | "both" | undefined;
182
+ } | null;
183
+ tracking: {
184
+ enableAttribution: boolean;
185
+ enableSource: boolean;
186
+ enableWidget: boolean;
187
+ };
188
+ type: "product" | "bundle_builder" | "cart" | "cart_subscription" | "dynamic_bundle" | "gift_with_purchase" | "placeholder" | "pre_purchase" | "product_addon" | "product_upsell" | "recharge_checkout" | "recharge_customer_portal" | "recharge_post_purchase" | "shopify_checkout" | "shopify_checkout_extension" | "shopify_post_purchase" | "shopify_post_purchase_extension" | "switch_to_subscription" | "ui_extension_ad" | "ui_extension_button" | "ui_extension_content_block" | "ui_extension_line_item_editor" | "ui_extension_progress_bar";
189
+ uiLabels: {
190
+ currentPage: Record<string, string>;
191
+ guest: Record<string, string>;
192
+ loadingOptions: Record<string, string>;
193
+ nextPage: Record<string, string>;
194
+ offerCarousel: Record<string, string>;
195
+ offerDialog: Record<string, string>;
196
+ page: Record<string, string>;
197
+ previousPage: Record<string, string>;
198
+ selected: Record<string, string>;
199
+ subscriptionOptions: Record<string, string>;
200
+ updating: Record<string, string>;
201
+ };
202
+ version: 2;
203
+ widgetId: number | null;
204
+ buttonField?: "declineAllOffers" | "declineOffer" | "removeFromOrder" | "undoAddToOrder" | "activePage" | "addedToCart" | "addingToCart" | "addToCart" | "buttonLabel" | "destinationUrl" | "inactivePage" | "overlayContent" | "payNow" | "progressReached" | "progressRemaining" | "redirectToCheckout" | "showVariant" | "showVariants" | "soldOut" | "subscriptionOption" | "switchToOneTimePurchase" | "switchToSubscriptionNoDiscount" | "switchToSubscriptionWithDiscount" | undefined;
205
+ frame?: "callout" | "offer-content" | undefined;
206
+ grid?: {
207
+ columns: (string | number)[];
208
+ rows: (string | number)[];
209
+ } | undefined;
210
+ name?: string | undefined;
211
+ viewUrl?: string | undefined;
212
+ wrapping?: {
213
+ breakAt: number;
214
+ maxPerLine: number;
215
+ } | undefined;
216
+ mutators?: {
217
+ effect: "set_false" | "set_true" | "toggle";
218
+ variable: string;
219
+ when: {
220
+ operator: "is_empty" | "is_not_empty";
221
+ type: "content";
222
+ } | {
223
+ operator: "equals" | "greater_than" | "less_than";
224
+ type: "result_count";
225
+ value: number;
226
+ } | {
227
+ operator: "contains" | "does_not_contain";
228
+ type: "result_tag";
229
+ value: string;
230
+ } | {
231
+ event: "item_added" | "quantity_changed" | "variant_selected";
232
+ type: "event";
233
+ };
234
+ }[] | undefined;
235
+ variables?: ({
236
+ defaultValue: string;
237
+ name: string;
238
+ type: "text";
239
+ seed?: undefined;
240
+ } | {
241
+ defaultValue: number;
242
+ name: string;
243
+ type: "number";
244
+ seed?: undefined;
245
+ } | {
246
+ defaultValue: boolean;
247
+ name: string;
248
+ type: "boolean";
249
+ seed?: {
250
+ dataSourceId: number | null;
251
+ ruleset: {
252
+ exitIfMatched: boolean;
253
+ logic: {
254
+ rules: {
255
+ operator: "equals" | "greater_than" | "less_than" | "contains" | "does_not_contain" | "after" | "anything" | "before" | "contains_any" | "does_not_contain_any" | "does_not_equal";
256
+ products: never[] | unknown[];
257
+ 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";
258
+ value: string;
259
+ }[];
260
+ }[];
261
+ output: {
262
+ key: string;
263
+ type: "data_json";
264
+ value: string;
265
+ }[];
266
+ }[];
267
+ } | undefined;
268
+ })[] | undefined;
269
+ visibility?: {
270
+ variable: string;
271
+ visibleWhen: boolean;
272
+ } | undefined;
273
+ experiment?: {
274
+ elementId: number;
275
+ experimentId: number;
276
+ experimentType: string;
277
+ selectedId: number;
278
+ } | undefined;
279
+ };
280
+ groupCatalog?: {
281
+ memberProductId: number;
282
+ options: {
283
+ productId: number;
284
+ title: string;
285
+ variantCatalog: {
286
+ displayMode: "single" | "separate";
287
+ options: {
288
+ name: string;
289
+ values: string[];
290
+ id: number;
291
+ position: number;
292
+ }[];
293
+ productId: number;
294
+ showSelectors: boolean;
295
+ variants: {
296
+ available: boolean;
297
+ id: number;
298
+ title: string;
299
+ option1?: string | undefined;
300
+ option2?: string | null | undefined;
301
+ option3?: string | null | undefined;
302
+ imageId?: number | null | undefined;
303
+ }[];
304
+ };
305
+ }[];
306
+ } | undefined;
307
+ initialVariant?: {
308
+ variantId: number;
309
+ } | undefined;
310
+ planCatalog?: {
311
+ plans: {
312
+ id: number;
313
+ intervalLabel: string;
314
+ name: string;
315
+ adjustment?: {
316
+ amount: number;
317
+ type: "price" | "fixed_amount" | "percentage";
318
+ } | undefined;
319
+ intervalFrequency?: string | undefined;
320
+ }[];
321
+ productId: number;
322
+ requiresSellingPlan: boolean;
323
+ variantId: number;
324
+ } | null | undefined;
325
+ purchaseOptions?: {
326
+ defaultChoice: {
327
+ mode: "one-time";
328
+ } | {
329
+ mode: "subscription";
330
+ sellingPlanId: number;
331
+ };
332
+ modes: ("one-time" | "subscription")[];
333
+ selector: "radio" | "dropdown";
334
+ } | undefined;
335
+ variantCatalog?: {
336
+ displayMode: "single" | "separate";
337
+ options: {
338
+ name: string;
339
+ values: string[];
340
+ id: number;
341
+ position: number;
342
+ }[];
343
+ productId: number;
344
+ showSelectors: boolean;
345
+ variants: {
346
+ available: boolean;
347
+ id: number;
348
+ title: string;
349
+ option1?: string | undefined;
350
+ option2?: string | null | undefined;
351
+ option3?: string | null | undefined;
352
+ imageId?: number | null | undefined;
353
+ }[];
354
+ } | undefined;
355
+ } | {
356
+ preparation: {
357
+ reason: string;
358
+ status: "unsupported";
359
+ };
360
+ sections: null;
361
+ groupCatalog?: {
362
+ memberProductId: number;
363
+ options: {
364
+ productId: number;
365
+ title: string;
366
+ variantCatalog: {
367
+ displayMode: "single" | "separate";
368
+ options: {
369
+ name: string;
370
+ values: string[];
371
+ id: number;
372
+ position: number;
373
+ }[];
374
+ productId: number;
375
+ showSelectors: boolean;
376
+ variants: {
377
+ available: boolean;
378
+ id: number;
379
+ title: string;
380
+ option1?: string | undefined;
381
+ option2?: string | null | undefined;
382
+ option3?: string | null | undefined;
383
+ imageId?: number | null | undefined;
384
+ }[];
385
+ };
386
+ }[];
387
+ } | undefined;
388
+ initialVariant?: {
389
+ variantId: number;
390
+ } | undefined;
391
+ planCatalog?: {
392
+ plans: {
393
+ id: number;
394
+ intervalLabel: string;
395
+ name: string;
396
+ adjustment?: {
397
+ amount: number;
398
+ type: "price" | "fixed_amount" | "percentage";
399
+ } | undefined;
400
+ intervalFrequency?: string | undefined;
401
+ }[];
402
+ productId: number;
403
+ requiresSellingPlan: boolean;
404
+ variantId: number;
405
+ } | null | undefined;
406
+ purchaseOptions?: {
407
+ defaultChoice: {
408
+ mode: "one-time";
409
+ } | {
410
+ mode: "subscription";
411
+ sellingPlanId: number;
412
+ };
413
+ modes: ("one-time" | "subscription")[];
414
+ selector: "radio" | "dropdown";
415
+ } | undefined;
416
+ variantCatalog?: {
417
+ displayMode: "single" | "separate";
418
+ options: {
419
+ name: string;
420
+ values: string[];
421
+ id: number;
422
+ position: number;
423
+ }[];
424
+ productId: number;
425
+ showSelectors: boolean;
426
+ variants: {
427
+ available: boolean;
428
+ id: number;
429
+ title: string;
430
+ option1?: string | undefined;
431
+ option2?: string | null | undefined;
432
+ option3?: string | null | undefined;
433
+ imageId?: number | null | undefined;
434
+ }[];
435
+ } | undefined;
436
+ };
437
+ } | null;
@@ -6,11 +6,6 @@ export declare const preparePostPurchaseSubscription: (settings: unknown, respon
6
6
  language: {
7
7
  description: string;
8
8
  descriptionEnabled: boolean;
9
- descriptionRte?: {
10
- content: unknown[];
11
- type: string;
12
- } | undefined;
13
- descriptionSpacing?: "default" | "none" | "tight" | "loose" | "xtight" | "xloose" | undefined;
14
9
  };
15
10
  primaryImage: {
16
11
  description: string;
@@ -25,7 +20,54 @@ export declare const preparePostPurchaseSubscription: (settings: unknown, respon
25
20
  showDeclineAll?: "none" | "both" | "above" | "below" | undefined;
26
21
  };
27
22
  responseDescription: string;
23
+ reviews: {
24
+ color: string;
25
+ rating: number;
26
+ reviewCount: number;
27
+ reviewsPlural: string;
28
+ reviewsSingular: string;
29
+ size: "small" | "large" | "medium";
30
+ strokeColor: string;
31
+ strokeWidth: number;
32
+ } | null;
28
33
  shouldShowSavingText: boolean;
34
+ descriptionDocument?: {
35
+ attrs: {
36
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
37
+ };
38
+ content: never[] | {
39
+ attrs: {
40
+ textAlign?: "start" | "center" | "end" | undefined;
41
+ };
42
+ content: never[] | {
43
+ text: string;
44
+ type: "text";
45
+ marks?: never[] | ({
46
+ type: "bold";
47
+ } | {
48
+ type: "italic";
49
+ } | {
50
+ attrs: {
51
+ class: string | null;
52
+ href: string;
53
+ rel: string;
54
+ target: string;
55
+ };
56
+ type: "link";
57
+ } | {
58
+ type: "strike";
59
+ } | {
60
+ attrs: {
61
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
62
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
63
+ };
64
+ type: "textStyle";
65
+ })[] | undefined;
66
+ }[];
67
+ type: "paragraph";
68
+ }[];
69
+ type: "doc";
70
+ } | undefined;
29
71
  gallery?: {
30
72
  images: {
31
73
  description: string;
@@ -0,0 +1,8 @@
1
+ import type { PostPurchaseChoice } from '../schema/postPurchaseChoice';
2
+ import { PostPurchaseProductView } from '../schema/postPurchaseProductView';
3
+ import { normalizePostPurchaseProduct } from '../server/normalizePostPurchaseProduct';
4
+ import type { PostPurchaseQuantity } from '../server/readPostPurchaseQuantity';
5
+ import type { Reporter } from '../server/shared';
6
+ /** Convert from the same effective settings snapshot; no product values enter the section tree. */
7
+ export declare const prepareNormalizedPostPurchaseView: (widgetId: number, normalized: ReturnType<typeof normalizePostPurchaseProduct>, report?: Reporter, choice?: PostPurchaseChoice, quantity?: PostPurchaseQuantity, allowCollection?: boolean) => PostPurchaseProductView;
8
+ export declare const preparePostPurchaseView: (widgetId: number, settings: unknown, response: unknown, report?: Reporter, choice?: PostPurchaseChoice) => PostPurchaseProductView;
@@ -1,21 +1,27 @@
1
1
  import type { normalizePostPurchaseProduct } from '../server/normalizePostPurchaseProduct';
2
2
  import type { PostPurchaseQuantity } from '../server/readPostPurchaseQuantity';
3
+ import type { Reporter } from '../server/shared';
3
4
  /**
4
5
  * Both fixed purchase kinds project the same product and effective display after eligibility. Without a
5
6
  * read quantity the selection falls back to `readPostPurchaseQuantity`'s initial quantity (metadata, then the
6
7
  * picker default, then 1).
7
8
  */
8
- export declare const projectPostPurchaseProduct: ({ data, effective, metadata, original }: ReturnType<typeof normalizePostPurchaseProduct>, selectedQuantity?: PostPurchaseQuantity) => {
9
+ export declare const projectPostPurchaseProduct: ({ data, effective, metadata, original }: ReturnType<typeof normalizePostPurchaseProduct>, report?: Reporter, selectedQuantity?: PostPurchaseQuantity) => {
9
10
  display: {
11
+ reviews: {
12
+ color: string;
13
+ rating: number;
14
+ reviewCount: number;
15
+ reviewsPlural: string;
16
+ reviewsSingular: string;
17
+ size: "small" | "large" | "medium";
18
+ strokeColor: string;
19
+ strokeWidth: number;
20
+ } | null;
10
21
  discountedFrom: "price" | "compare_at_price";
11
22
  language: {
12
23
  description: string;
13
24
  descriptionEnabled: boolean;
14
- descriptionRte?: {
15
- content: unknown[];
16
- type: string;
17
- } | undefined;
18
- descriptionSpacing?: "default" | "none" | "tight" | "loose" | "xtight" | "xloose" | undefined;
19
25
  };
20
26
  primaryImage: {
21
27
  description: string;
@@ -31,6 +37,43 @@ export declare const projectPostPurchaseProduct: ({ data, effective, metadata, o
31
37
  };
32
38
  responseDescription: string;
33
39
  shouldShowSavingText: boolean;
40
+ descriptionDocument?: {
41
+ attrs: {
42
+ blockSpacing?: "none" | "base" | "extraTight" | "tight" | "loose" | "extraLoose" | undefined;
43
+ };
44
+ content: never[] | {
45
+ attrs: {
46
+ textAlign?: "start" | "center" | "end" | undefined;
47
+ };
48
+ content: never[] | {
49
+ text: string;
50
+ type: "text";
51
+ marks?: never[] | ({
52
+ type: "bold";
53
+ } | {
54
+ type: "italic";
55
+ } | {
56
+ attrs: {
57
+ class: string | null;
58
+ href: string;
59
+ rel: string;
60
+ target: string;
61
+ };
62
+ type: "link";
63
+ } | {
64
+ type: "strike";
65
+ } | {
66
+ attrs: {
67
+ color: "success" | "warning" | "critical" | "base" | "decorative" | "subdued" | "accent";
68
+ fontSize: "small" | "base" | "large" | "medium" | "extraSmall" | "extraLarge" | "heading";
69
+ };
70
+ type: "textStyle";
71
+ })[] | undefined;
72
+ }[];
73
+ type: "paragraph";
74
+ }[];
75
+ type: "doc";
76
+ } | undefined;
34
77
  gallery?: {
35
78
  images: {
36
79
  description: string;
@@ -0,0 +1,11 @@
1
+ import { TiptapDocument } from '../../schema/widgets/checkout-and-beyond/text';
2
+ import { type PostPurchaseSettings } from '../../schema/widgets/post-purchase-offer/postPurchaseSettings';
3
+ type Language = PostPurchaseSettings['language'];
4
+ /**
5
+ * Converts the post-purchase editor's custom `descriptionRte` (the first Tiptap attempt: `ShopifyTextBlock`
6
+ * nodes and one `ShopifyTextInline` mark) into the standard CAB `TiptapDocument`, so renderers draw one shape.
7
+ * The legacy renderer drew only `ShopifyTextBlock`/`text`, so any other node is dropped; an empty block stays
8
+ * an empty paragraph (legacy drew it as a blank line); a missing spacing is legacy's `none`.
9
+ */
10
+ export declare const convertDescriptionRte: (rte: NonNullable<Language["descriptionRte"]>, spacing: Language["descriptionSpacing"]) => TiptapDocument;
11
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.35.0",
3
+ "version": "3.37.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.",