@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.cjs +15 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -2
- 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
|
}
|
|
@@ -18289,8 +18290,20 @@ function withPricingCollection(tree, mutate) {
|
|
|
18289
18290
|
const next = JSON.parse(JSON.stringify(tree));
|
|
18290
18291
|
const collection = findPricingCollection(next);
|
|
18291
18292
|
if (!collection || !collection.children) return null;
|
|
18293
|
+
for (const card of collection.children) {
|
|
18294
|
+
if (isPricingCard(card)) upgradeLegacyPricingSlots(card);
|
|
18295
|
+
}
|
|
18292
18296
|
return mutate(collection) ? next : null;
|
|
18293
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
|
+
}
|
|
18294
18307
|
function addPricingTier(tree) {
|
|
18295
18308
|
return withPricingCollection(tree, (collection) => {
|
|
18296
18309
|
const children = collection.children;
|
|
@@ -18412,7 +18425,7 @@ function pricingFeatureList(target) {
|
|
|
18412
18425
|
}));
|
|
18413
18426
|
}
|
|
18414
18427
|
if (typeof raw === "string") {
|
|
18415
|
-
return raw.split(
|
|
18428
|
+
return raw.split(/\n|<br\s*\/?>/i).map((line) => line.replace(/<[^>]+>/g, "").replace(/^[-*•]\s*/, "").trim().slice(0, 120)).filter(Boolean).map((text) => ({ text }));
|
|
18416
18429
|
}
|
|
18417
18430
|
return [];
|
|
18418
18431
|
}
|
|
@@ -31004,7 +31017,7 @@ function OhhwellsBridge() {
|
|
|
31004
31017
|
postToParent2({
|
|
31005
31018
|
type: "ow:ready",
|
|
31006
31019
|
version: "1",
|
|
31007
|
-
bridgeVersion: "0.1.
|
|
31020
|
+
bridgeVersion: "0.1.138",
|
|
31008
31021
|
path: pathname,
|
|
31009
31022
|
nodes: collectEditableNodes(editContentRef.current),
|
|
31010
31023
|
sections
|