@rebuy/rebuy 3.29.0 → 3.30.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 (47) hide show
  1. package/dist/index.cjs +1543 -1346
  2. package/dist/index.mjs +1537 -1340
  3. package/dist/schema/index.d.ts +7 -0
  4. package/dist/schema/postPurchaseProductCollectionView.d.ts +8 -0
  5. package/dist/schema/postPurchaseProductDisplay.d.ts +59 -0
  6. package/dist/schema/postPurchaseProductGallery.d.ts +11 -0
  7. package/dist/schema/postPurchaseProductSettings.d.ts +117 -0
  8. package/dist/schema/postPurchaseProductSource.d.ts +65 -0
  9. package/dist/schema/postPurchaseVariantCatalog.d.ts +41 -0
  10. package/dist/schema/postPurchaseVariantDefault.d.ts +36 -0
  11. package/dist/schema/shopConfig.d.ts +2 -2
  12. package/dist/schema/userConfig.d.ts +2 -2
  13. package/dist/schema/widgetData.d.ts +2 -2
  14. package/dist/schema/widgets/checkout-and-beyond/banner.d.ts +29 -29
  15. package/dist/schema/widgets/checkout-and-beyond/carousel.d.ts +29 -29
  16. package/dist/schema/widgets/checkout-and-beyond/cartLine.d.ts +29 -29
  17. package/dist/schema/widgets/checkout-and-beyond/common.d.ts +5 -5
  18. package/dist/schema/widgets/checkout-and-beyond/offers.d.ts +29 -29
  19. package/dist/schema/widgets/checkout-and-beyond/progressBar.d.ts +29 -29
  20. package/dist/schema/widgets/checkout-and-beyond/root.d.ts +1 -1
  21. package/dist/schema/widgets/contentBlock.d.ts +4 -4
  22. package/dist/schema/widgets/post-purchase-offer/constants.d.ts +4 -4
  23. package/dist/schema/widgets/post-purchase-offer/postPurchaseBlocks.d.ts +2 -2
  24. package/dist/schema/widgets/post-purchase-offer/postPurchaseOffer.d.ts +2 -2
  25. package/dist/schema/widgets/post-purchase-offer/postPurchaseSettings.d.ts +2 -2
  26. package/dist/schema/widgets/post-purchase-offer/postPurchaseWidget.d.ts +2 -2
  27. package/dist/server/__fixtures__/postPurchaseProduct.d.ts +137 -0
  28. package/dist/server/__fixtures__/postPurchaseVariantDefaults.d.ts +26 -0
  29. package/dist/server/__fixtures__/postPurchaseVariants.d.ts +47 -0
  30. package/dist/server/index.cjs +6 -2
  31. package/dist/server/index.mjs +6 -2
  32. package/dist/server/matchPostPurchaseVariantDefault.d.ts +17 -0
  33. package/dist/server/normalizePostPurchaseCollection.d.ts +250 -0
  34. package/dist/server/normalizePostPurchaseProduct.d.ts +202 -0
  35. package/dist/server/postPurchasePrimaryImage.d.ts +6 -0
  36. package/dist/server/postPurchaseProductDisplay.d.ts +41 -0
  37. package/dist/server/postPurchaseProductEligibility.d.ts +8 -0
  38. package/dist/server/postPurchaseProductGallery.d.ts +5 -0
  39. package/dist/server/postPurchaseVariantAvailable.d.ts +12 -0
  40. package/dist/server/postPurchaseVariantCatalog.d.ts +3 -0
  41. package/dist/server/projectPostPurchaseProduct.d.ts +127 -0
  42. package/dist/server/resolvePostPurchaseVariantDefault.d.ts +10 -0
  43. package/dist/transforms/index.cjs +7 -3
  44. package/dist/transforms/index.mjs +7 -3
  45. package/dist/transforms/offerV1/offerTemplateSeed.d.ts +8 -5
  46. package/dist/transforms/postPurchase/imageContentSettings.d.ts +1 -1
  47. package/package.json +1 -1
@@ -2780,7 +2780,7 @@ var OFFER_TEMPLATE_SEED = {
2780
2780
  marks: [
2781
2781
  {
2782
2782
  attrs: {
2783
- color: "accent",
2783
+ color: "base",
2784
2784
  fontSize: "medium"
2785
2785
  },
2786
2786
  type: "textStyle"
@@ -3041,9 +3041,13 @@ var buildPriceContent = () => ({
3041
3041
  content: [
3042
3042
  {
3043
3043
  content: [
3044
- /** Legacy renders the price in the checkout's brand color (`<Text appearance="accent">`). */
3044
+ /**
3045
+ * Regular text color, not legacy's `<Text appearance="accent">`: the checkout's web components
3046
+ * can't render app text in the accent color, and `accent`'s nearest tint shows default blue on
3047
+ * most stores (REB-24049).
3048
+ */
3045
3049
  {
3046
- marks: [{ attrs: { color: "accent", fontSize: "base" }, type: "textStyle" }],
3050
+ marks: [{ attrs: { color: "base", fontSize: "base" }, type: "textStyle" }],
3047
3051
  text: "{{variantPrice}}",
3048
3052
  type: "text"
3049
3053
  },
@@ -2719,7 +2719,7 @@ var OFFER_TEMPLATE_SEED = {
2719
2719
  marks: [
2720
2720
  {
2721
2721
  attrs: {
2722
- color: "accent",
2722
+ color: "base",
2723
2723
  fontSize: "medium"
2724
2724
  },
2725
2725
  type: "textStyle"
@@ -2980,9 +2980,13 @@ var buildPriceContent = () => ({
2980
2980
  content: [
2981
2981
  {
2982
2982
  content: [
2983
- /** Legacy renders the price in the checkout's brand color (`<Text appearance="accent">`). */
2983
+ /**
2984
+ * Regular text color, not legacy's `<Text appearance="accent">`: the checkout's web components
2985
+ * can't render app text in the accent color, and `accent`'s nearest tint shows default blue on
2986
+ * most stores (REB-24049).
2987
+ */
2984
2988
  {
2985
- marks: [{ attrs: { color: "accent", fontSize: "base" }, type: "textStyle" }],
2989
+ marks: [{ attrs: { color: "base", fontSize: "base" }, type: "textStyle" }],
2986
2990
  text: "{{variantPrice}}",
2987
2991
  type: "text"
2988
2992
  },
@@ -4,11 +4,14 @@
4
4
  * offers section), so the export originally carried that widget type + the test store's data source;
5
5
  * those have been cleaned here to read as a real offer template. `buildOfferTemplate` still strips any
6
6
  * residual section ids (so each created widget gets fresh ones) and injects the per-widget name +
7
- * editor mode at runtime. Regenerate by re-exporting + the generator script, not by hand — with ONE
8
- * hand-completed exception a re-export must preserve: the add button's `addedToCart`/`soldOut`/
9
- * `redirectToCheckout` slots (`OFFER_LABELS` defaults). The editor export carried only
10
- * `addingToCart`/`addToCart`, which left the sold-out/added/Buy-Now states falling back to the add
11
- * label at runtime (guarded by a `buildOfferTemplate` test).
7
+ * editor mode at runtime. Regenerate by re-exporting + the generator script, not by hand — with TWO
8
+ * hand-completed exceptions a re-export must preserve, each guarded by a `buildOfferTemplate` test:
9
+ * - the add button's `addedToCart`/`soldOut`/`redirectToCheckout` slots (`OFFER_LABELS` defaults). The
10
+ * editor export carried only `addingToCart`/`addToCart`, which left the sold-out/added/Buy-Now states
11
+ * falling back to the add label at runtime.
12
+ * - the `{{variantPrice}}` run's color is `base`, not the exported `accent`: the checkout's web
13
+ * components can't render app text in the accent color, and its nearest tint shows default blue on
14
+ * most stores (REB-24049).
12
15
  */
13
16
  export declare const OFFER_TEMPLATE_SEED: {
14
17
  alignment: {
@@ -40,8 +40,8 @@ export declare const ImageContentSettings: z.ZodObject<{
40
40
  imagePlacement: z.ZodNullable<z.ZodOptional<z.ZodEnum<{
41
41
  top: "top";
42
42
  bottom: "bottom";
43
- right: "right";
44
43
  left: "left";
44
+ right: "right";
45
45
  }>>>;
46
46
  imageSize: z.ZodPipe<z.ZodDefault<z.ZodNumber>, z.ZodNumber>;
47
47
  superTitle: z.ZodOptional<z.ZodUnknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.29.0",
3
+ "version": "3.30.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.",