@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.cjs CHANGED
@@ -18290,8 +18290,20 @@ function withPricingCollection(tree, mutate) {
18290
18290
  const next = JSON.parse(JSON.stringify(tree));
18291
18291
  const collection = findPricingCollection(next);
18292
18292
  if (!collection || !collection.children) return null;
18293
+ for (const card of collection.children) {
18294
+ if (isPricingCard(card)) upgradeLegacyPricingSlots(card);
18295
+ }
18293
18296
  return mutate(collection) ? next : null;
18294
18297
  }
18298
+ function upgradeLegacyPricingSlots(card) {
18299
+ const slots = card.slots = card.slots ?? {};
18300
+ if (typeof slots.features === "string") {
18301
+ const rows = pricingFeatureList(card);
18302
+ if (rows.length > 0) slots.features = rows.slice(0, PRICING_FEATURES_MAX);
18303
+ }
18304
+ if (slots.featured === true) slots.featured = { enabled: true };
18305
+ else if (slots.featured === false) delete slots.featured;
18306
+ }
18295
18307
  function addPricingTier(tree) {
18296
18308
  return withPricingCollection(tree, (collection) => {
18297
18309
  const children = collection.children;
@@ -18413,7 +18425,7 @@ function pricingFeatureList(target) {
18413
18425
  }));
18414
18426
  }
18415
18427
  if (typeof raw === "string") {
18416
- return raw.split("\n").map((line) => line.replace(/^[-*•]\s*/, "").trim()).filter(Boolean).map((text) => ({ text }));
18428
+ return raw.split(/\n|<br\s*\/?>/i).map((line) => line.replace(/<[^>]+>/g, "").replace(/^[-*•]\s*/, "").trim().slice(0, 120)).filter(Boolean).map((text) => ({ text }));
18417
18429
  }
18418
18430
  return [];
18419
18431
  }
@@ -31005,7 +31017,7 @@ function OhhwellsBridge() {
31005
31017
  postToParent2({
31006
31018
  type: "ow:ready",
31007
31019
  version: "1",
31008
- bridgeVersion: "0.1.137",
31020
+ bridgeVersion: "0.1.138",
31009
31021
  path: pathname,
31010
31022
  nodes: collectEditableNodes(editContentRef.current),
31011
31023
  sections