@ohhwells/bridge 0.1.138 → 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
@@ -18198,8 +18198,20 @@ function withPricingCollection(tree, mutate) {
18198
18198
  const next = JSON.parse(JSON.stringify(tree));
18199
18199
  const collection = findPricingCollection(next);
18200
18200
  if (!collection || !collection.children) return null;
18201
+ for (const card of collection.children) {
18202
+ if (isPricingCard(card)) upgradeLegacyPricingSlots(card);
18203
+ }
18201
18204
  return mutate(collection) ? next : null;
18202
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
+ }
18203
18215
  function addPricingTier(tree) {
18204
18216
  return withPricingCollection(tree, (collection) => {
18205
18217
  const children = collection.children;
@@ -18321,7 +18333,7 @@ function pricingFeatureList(target) {
18321
18333
  }));
18322
18334
  }
18323
18335
  if (typeof raw === "string") {
18324
- 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 }));
18325
18337
  }
18326
18338
  return [];
18327
18339
  }
@@ -30919,7 +30931,7 @@ function OhhwellsBridge() {
30919
30931
  postToParent2({
30920
30932
  type: "ow:ready",
30921
30933
  version: "1",
30922
- bridgeVersion: "0.1.137",
30934
+ bridgeVersion: "0.1.138",
30923
30935
  path: pathname,
30924
30936
  nodes: collectEditableNodes(editContentRef.current),
30925
30937
  sections