@ohhwells/bridge 0.1.134-next.366 → 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 +14 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -5924,6 +5924,7 @@ function applyStylesToDom(store) {
|
|
|
5924
5924
|
section.setAttribute("data-ohw-style-bgcolor", "");
|
|
5925
5925
|
}
|
|
5926
5926
|
if (override.cardBackgroundColor !== void 0 && !isDrawerMarker) {
|
|
5927
|
+
detectItemGroups(section);
|
|
5927
5928
|
section.style.setProperty("--ohw-card-bg", override.cardBackgroundColor);
|
|
5928
5929
|
section.setAttribute("data-ohw-style-cardbg", "");
|
|
5929
5930
|
}
|
|
@@ -18320,8 +18321,20 @@ function withPricingCollection(tree, mutate) {
|
|
|
18320
18321
|
const next = JSON.parse(JSON.stringify(tree));
|
|
18321
18322
|
const collection = findPricingCollection(next);
|
|
18322
18323
|
if (!collection || !collection.children) return null;
|
|
18324
|
+
for (const card of collection.children) {
|
|
18325
|
+
if (isPricingCard(card)) upgradeLegacyPricingSlots(card);
|
|
18326
|
+
}
|
|
18323
18327
|
return mutate(collection) ? next : null;
|
|
18324
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
|
+
}
|
|
18325
18338
|
function addPricingTier(tree) {
|
|
18326
18339
|
return withPricingCollection(tree, (collection) => {
|
|
18327
18340
|
const children = collection.children;
|
|
@@ -18443,7 +18456,7 @@ function pricingFeatureList(target) {
|
|
|
18443
18456
|
}));
|
|
18444
18457
|
}
|
|
18445
18458
|
if (typeof raw === "string") {
|
|
18446
|
-
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 }));
|
|
18447
18460
|
}
|
|
18448
18461
|
return [];
|
|
18449
18462
|
}
|