@ohhwells/bridge 0.1.137 → 0.1.139

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.js CHANGED
@@ -5832,6 +5832,7 @@ function applyStylesToDom(store) {
5832
5832
  section.setAttribute("data-ohw-style-bgcolor", "");
5833
5833
  }
5834
5834
  if (override.cardBackgroundColor !== void 0 && !isDrawerMarker) {
5835
+ detectItemGroups(section);
5835
5836
  section.style.setProperty("--ohw-card-bg", override.cardBackgroundColor);
5836
5837
  section.setAttribute("data-ohw-style-cardbg", "");
5837
5838
  }
@@ -18197,8 +18198,20 @@ function withPricingCollection(tree, mutate) {
18197
18198
  const next = JSON.parse(JSON.stringify(tree));
18198
18199
  const collection = findPricingCollection(next);
18199
18200
  if (!collection || !collection.children) return null;
18201
+ for (const card of collection.children) {
18202
+ if (isPricingCard(card)) upgradeLegacyPricingSlots(card);
18203
+ }
18200
18204
  return mutate(collection) ? next : null;
18201
18205
  }
18206
+ function upgradeLegacyPricingSlots(card) {
18207
+ const slots = card.slots = card.slots ?? {};
18208
+ if (typeof slots.features === "string") {
18209
+ const rows = pricingFeatureList(card);
18210
+ if (rows.length > 0) slots.features = rows.slice(0, PRICING_FEATURES_MAX);
18211
+ }
18212
+ if (slots.featured === true) slots.featured = { enabled: true };
18213
+ else if (slots.featured === false) delete slots.featured;
18214
+ }
18202
18215
  function addPricingTier(tree) {
18203
18216
  return withPricingCollection(tree, (collection) => {
18204
18217
  const children = collection.children;
@@ -18320,7 +18333,7 @@ function pricingFeatureList(target) {
18320
18333
  }));
18321
18334
  }
18322
18335
  if (typeof raw === "string") {
18323
- return raw.split("\n").map((line) => line.replace(/^[-*•]\s*/, "").trim()).filter(Boolean).map((text) => ({ text }));
18336
+ return raw.split(/\n|<br\s*\/?>/i).map((line) => line.replace(/<[^>]+>/g, "").replace(/^[-*•]\s*/, "").trim().slice(0, 120)).filter(Boolean).map((text) => ({ text }));
18324
18337
  }
18325
18338
  return [];
18326
18339
  }
@@ -30918,7 +30931,7 @@ function OhhwellsBridge() {
30918
30931
  postToParent2({
30919
30932
  type: "ow:ready",
30920
30933
  version: "1",
30921
- bridgeVersion: "0.1.136",
30934
+ bridgeVersion: "0.1.138",
30922
30935
  path: pathname,
30923
30936
  nodes: collectEditableNodes(editContentRef.current),
30924
30937
  sections