@ohhwells/bridge 0.1.134-next.368 → 0.1.134-next.370
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 +13 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -18321,8 +18321,20 @@ function withPricingCollection(tree, mutate) {
|
|
|
18321
18321
|
const next = JSON.parse(JSON.stringify(tree));
|
|
18322
18322
|
const collection = findPricingCollection(next);
|
|
18323
18323
|
if (!collection || !collection.children) return null;
|
|
18324
|
+
for (const card of collection.children) {
|
|
18325
|
+
if (isPricingCard(card)) upgradeLegacyPricingSlots(card);
|
|
18326
|
+
}
|
|
18324
18327
|
return mutate(collection) ? next : null;
|
|
18325
18328
|
}
|
|
18329
|
+
function upgradeLegacyPricingSlots(card) {
|
|
18330
|
+
const slots = card.slots = card.slots ?? {};
|
|
18331
|
+
if (typeof slots.features === "string") {
|
|
18332
|
+
const rows = pricingFeatureList(card);
|
|
18333
|
+
if (rows.length > 0) slots.features = rows.slice(0, PRICING_FEATURES_MAX);
|
|
18334
|
+
}
|
|
18335
|
+
if (slots.featured === true) slots.featured = { enabled: true };
|
|
18336
|
+
else if (slots.featured === false) delete slots.featured;
|
|
18337
|
+
}
|
|
18326
18338
|
function addPricingTier(tree) {
|
|
18327
18339
|
return withPricingCollection(tree, (collection) => {
|
|
18328
18340
|
const children = collection.children;
|
|
@@ -18444,7 +18456,7 @@ function pricingFeatureList(target) {
|
|
|
18444
18456
|
}));
|
|
18445
18457
|
}
|
|
18446
18458
|
if (typeof raw === "string") {
|
|
18447
|
-
return raw.split(
|
|
18459
|
+
return raw.split(/\n|<br\s*\/?>/i).map((line) => line.replace(/<[^>]+>/g, "").replace(/^[-*•]\s*/, "").trim().slice(0, 120)).filter(Boolean).map((text) => ({ text }));
|
|
18448
18460
|
}
|
|
18449
18461
|
return [];
|
|
18450
18462
|
}
|