@rebuy/rebuy 3.30.0 → 3.31.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.
@@ -4882,7 +4882,7 @@ var fetchDataSourceResults = async (input, ctx) => {
4882
4882
  var import_zod37 = require("zod");
4883
4883
  var SUPPLY_KEY = { production: "AQF5RKLR", staging: "Z56LQ7PS" };
4884
4884
  var OFFER_LIMIT = 4;
4885
- var SUPPORTED_COUNTRIES = /* @__PURE__ */ new Set(["US", "CA"]);
4885
+ var SUPPORTED_COUNTRIES = /* @__PURE__ */ new Set(["US", "CA", "GB"]);
4886
4886
  var MAX_TRANSACTION_ITEMS = 50;
4887
4887
  var TEST_CUSTOMER_EMAIL = "test@rebuyengine.com";
4888
4888
  var transactionItems = (input) => (input.transactionItems?.map(({ id, priceCents, quantity, title, type }) => ({
@@ -5013,7 +5013,23 @@ var safeTextValue = (raw, options) => {
5013
5013
  const converted = normalizeTextValue(raw, options);
5014
5014
  return checkForHTML(converted) ? converted : normalizeTextValue(htmlToPlainText(raw), options);
5015
5015
  };
5016
- var baseText = (raw) => ({ content: { en: safeTextValue(raw, AS_DOC) }, sectionType: SectionType.text });
5016
+ var headlineText = (raw) => {
5017
+ const doc = safeTextValue(raw, AS_DOC);
5018
+ return {
5019
+ content: {
5020
+ en: {
5021
+ ...doc,
5022
+ content: doc.content.map((paragraph) => ({
5023
+ ...paragraph,
5024
+ content: paragraph.content.map(
5025
+ (run) => run.marks?.some((mark) => mark.type === "bold") ? run : { ...run, marks: [{ type: "bold" }, ...run.marks ?? []] }
5026
+ )
5027
+ }))
5028
+ }
5029
+ },
5030
+ sectionType: SectionType.text
5031
+ };
5032
+ };
5017
5033
  var dspLabel = (raw, fallback) => ({
5018
5034
  buttonField: ButtonField.buttonLabel,
5019
5035
  content: { en: htmlToPlainText(raw) === "" ? fallback : safeTextValue(raw, AS_DOC) },
@@ -5099,7 +5115,7 @@ var disclaimerSections = (offer) => {
5099
5115
  };
5100
5116
  var composeOfferCard = (offer, input, storeName) => {
5101
5117
  const copy = {
5102
- sections: [baseText(offer.headline), smallText(offer.description)],
5118
+ sections: [headlineText(offer.headline), smallText(offer.description)],
5103
5119
  sectionType: SectionType.layout,
5104
5120
  spacing: Spacing.tight
5105
5121
  };
@@ -4831,7 +4831,7 @@ var fetchDataSourceResults = async (input, ctx) => {
4831
4831
  import { z as z37 } from "zod";
4832
4832
  var SUPPLY_KEY = { production: "AQF5RKLR", staging: "Z56LQ7PS" };
4833
4833
  var OFFER_LIMIT = 4;
4834
- var SUPPORTED_COUNTRIES = /* @__PURE__ */ new Set(["US", "CA"]);
4834
+ var SUPPORTED_COUNTRIES = /* @__PURE__ */ new Set(["US", "CA", "GB"]);
4835
4835
  var MAX_TRANSACTION_ITEMS = 50;
4836
4836
  var TEST_CUSTOMER_EMAIL = "test@rebuyengine.com";
4837
4837
  var transactionItems = (input) => (input.transactionItems?.map(({ id, priceCents, quantity, title, type }) => ({
@@ -4962,7 +4962,23 @@ var safeTextValue = (raw, options) => {
4962
4962
  const converted = normalizeTextValue(raw, options);
4963
4963
  return checkForHTML(converted) ? converted : normalizeTextValue(htmlToPlainText(raw), options);
4964
4964
  };
4965
- var baseText = (raw) => ({ content: { en: safeTextValue(raw, AS_DOC) }, sectionType: SectionType.text });
4965
+ var headlineText = (raw) => {
4966
+ const doc = safeTextValue(raw, AS_DOC);
4967
+ return {
4968
+ content: {
4969
+ en: {
4970
+ ...doc,
4971
+ content: doc.content.map((paragraph) => ({
4972
+ ...paragraph,
4973
+ content: paragraph.content.map(
4974
+ (run) => run.marks?.some((mark) => mark.type === "bold") ? run : { ...run, marks: [{ type: "bold" }, ...run.marks ?? []] }
4975
+ )
4976
+ }))
4977
+ }
4978
+ },
4979
+ sectionType: SectionType.text
4980
+ };
4981
+ };
4966
4982
  var dspLabel = (raw, fallback) => ({
4967
4983
  buttonField: ButtonField.buttonLabel,
4968
4984
  content: { en: htmlToPlainText(raw) === "" ? fallback : safeTextValue(raw, AS_DOC) },
@@ -5048,7 +5064,7 @@ var disclaimerSections = (offer) => {
5048
5064
  };
5049
5065
  var composeOfferCard = (offer, input, storeName) => {
5050
5066
  const copy = {
5051
- sections: [baseText(offer.headline), smallText(offer.description)],
5067
+ sections: [headlineText(offer.headline), smallText(offer.description)],
5052
5068
  sectionType: SectionType.layout,
5053
5069
  spacing: Spacing.tight
5054
5070
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rebuy/rebuy",
3
- "version": "3.30.0",
3
+ "version": "3.31.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.",