@charisol/plexo-sdk 1.1.11 → 1.1.13
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.
|
@@ -640,7 +640,7 @@ var ee = {
|
|
|
640
640
|
scale: .7,
|
|
641
641
|
floorPx: 14
|
|
642
642
|
}
|
|
643
|
-
},
|
|
643
|
+
}, te = {
|
|
644
644
|
tablet: {
|
|
645
645
|
thresholdPx: 320,
|
|
646
646
|
scale: .8,
|
|
@@ -651,7 +651,7 @@ var ee = {
|
|
|
651
651
|
scale: .55,
|
|
652
652
|
floorPx: 140
|
|
653
653
|
}
|
|
654
|
-
},
|
|
654
|
+
}, E = {
|
|
655
655
|
tablet: {
|
|
656
656
|
thresholdPx: 48,
|
|
657
657
|
scale: .75,
|
|
@@ -662,7 +662,7 @@ var ee = {
|
|
|
662
662
|
scale: .55,
|
|
663
663
|
floorPx: 16
|
|
664
664
|
}
|
|
665
|
-
},
|
|
665
|
+
}, D = {
|
|
666
666
|
tablet: {
|
|
667
667
|
thresholdPx: 500,
|
|
668
668
|
scale: 1,
|
|
@@ -673,11 +673,11 @@ var ee = {
|
|
|
673
673
|
scale: 1,
|
|
674
674
|
floorPx: 0
|
|
675
675
|
}
|
|
676
|
-
},
|
|
676
|
+
}, O = ["fontSize"], k = [
|
|
677
677
|
"height",
|
|
678
678
|
"minHeight",
|
|
679
679
|
"maxHeight"
|
|
680
|
-
],
|
|
680
|
+
], A = [
|
|
681
681
|
"padding",
|
|
682
682
|
"paddingTop",
|
|
683
683
|
"paddingBottom",
|
|
@@ -686,8 +686,8 @@ var ee = {
|
|
|
686
686
|
"margin",
|
|
687
687
|
"marginTop",
|
|
688
688
|
"marginBottom"
|
|
689
|
-
],
|
|
690
|
-
function
|
|
689
|
+
], j = ["width", "maxWidth"];
|
|
690
|
+
function M(e) {
|
|
691
691
|
if (typeof e == "number" && Number.isFinite(e)) return e;
|
|
692
692
|
if (typeof e != "string") return null;
|
|
693
693
|
let t = e.trim().match(/^(-?\d+(?:\.\d+)?)px$/);
|
|
@@ -695,48 +695,48 @@ function N(e) {
|
|
|
695
695
|
let n = parseFloat(t[1]);
|
|
696
696
|
return Number.isFinite(n) ? n : null;
|
|
697
697
|
}
|
|
698
|
-
function
|
|
698
|
+
function N(e, t) {
|
|
699
699
|
return e < t.thresholdPx ? null : Math.max(Math.round(e * t.scale), t.floorPx);
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function P(e, t) {
|
|
702
702
|
if (!e || typeof e != "object") return {};
|
|
703
703
|
let n = {};
|
|
704
|
-
for (let r of
|
|
705
|
-
let i =
|
|
704
|
+
for (let r of O) {
|
|
705
|
+
let i = M(e[r]);
|
|
706
706
|
if (i === null) continue;
|
|
707
|
-
let a =
|
|
707
|
+
let a = N(i, ee[t]);
|
|
708
708
|
a !== null && (n[r] = `${a}px`);
|
|
709
709
|
}
|
|
710
|
-
for (let r of
|
|
711
|
-
let i =
|
|
710
|
+
for (let r of k) {
|
|
711
|
+
let i = M(e[r]);
|
|
712
712
|
if (i === null) continue;
|
|
713
|
-
let a =
|
|
713
|
+
let a = N(i, te[t]);
|
|
714
714
|
a !== null && (n[r] = `${a}px`);
|
|
715
715
|
}
|
|
716
|
-
for (let r of
|
|
717
|
-
let i =
|
|
716
|
+
for (let r of A) {
|
|
717
|
+
let i = M(e[r]);
|
|
718
718
|
if (i === null) continue;
|
|
719
|
-
let a =
|
|
719
|
+
let a = N(i, E[t]);
|
|
720
720
|
a !== null && (n[r] = `${a}px`);
|
|
721
721
|
}
|
|
722
|
-
for (let r of
|
|
723
|
-
let i =
|
|
724
|
-
i !== null && i >=
|
|
722
|
+
for (let r of j) {
|
|
723
|
+
let i = M(e[r]);
|
|
724
|
+
i !== null && i >= D[t].thresholdPx && (n[r] = "100%");
|
|
725
725
|
}
|
|
726
726
|
return n;
|
|
727
727
|
}
|
|
728
|
-
function
|
|
728
|
+
function F(e, t, n) {
|
|
729
729
|
let r = e || {};
|
|
730
730
|
return n ? {
|
|
731
731
|
...r,
|
|
732
|
-
...
|
|
732
|
+
...P(r, n),
|
|
733
733
|
...t || {}
|
|
734
734
|
} : r;
|
|
735
735
|
}
|
|
736
736
|
//#endregion
|
|
737
737
|
//#region src/utilities/compiler.ts
|
|
738
|
-
var
|
|
739
|
-
function
|
|
738
|
+
var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif";
|
|
739
|
+
function L(e) {
|
|
740
740
|
if (!e || typeof e != "object") return null;
|
|
741
741
|
if (Array.isArray(e.columns) && e.columns.length > 0) return e;
|
|
742
742
|
let t = (e.type || "").toLowerCase(), n = e.props || e.content || e.attributes || e.data || e.payload || e, r = e.style || {};
|
|
@@ -990,7 +990,7 @@ function R(e) {
|
|
|
990
990
|
}
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
|
-
var
|
|
993
|
+
var R = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter(([e, t]) => t != null && t !== "").map(([e, t]) => {
|
|
994
994
|
let n = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = t;
|
|
995
995
|
return typeof t == "number" && [
|
|
996
996
|
"padding",
|
|
@@ -1001,24 +1001,32 @@ var z = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
1001
1001
|
"width",
|
|
1002
1002
|
"height"
|
|
1003
1003
|
].some((t) => e.toLowerCase().includes(t)) && (r = `${t}px`), `${n}: ${r};`;
|
|
1004
|
-
}).join(" "),
|
|
1005
|
-
function
|
|
1004
|
+
}).join(" "), z = (e = {}) => R(e).replace(/;(\s|$)/g, " !important;$1");
|
|
1005
|
+
function B(e) {
|
|
1006
1006
|
if (typeof e != "string") return !1;
|
|
1007
1007
|
let t = e.toLowerCase();
|
|
1008
1008
|
return t.includes("javascript:") || t.includes("vbscript:") || t.includes("expression") || t.includes("url(") || t.includes("@import") || t.includes("-moz-binding") || t.includes("behavior") || t.includes("</style") || /\\/.test(e);
|
|
1009
1009
|
}
|
|
1010
|
-
function
|
|
1010
|
+
function V(e, t, n, r, i) {
|
|
1011
1011
|
let a = {
|
|
1012
|
-
...
|
|
1012
|
+
...P(n, r),
|
|
1013
1013
|
...i || {}
|
|
1014
1014
|
};
|
|
1015
|
-
for (let e of Object.keys(a))
|
|
1015
|
+
for (let e of Object.keys(a)) B(a[e]) && delete a[e];
|
|
1016
1016
|
if (Object.keys(a).length === 0) return;
|
|
1017
|
-
let o =
|
|
1017
|
+
let o = z(a);
|
|
1018
1018
|
if (!o) return;
|
|
1019
1019
|
let s = String(t).replace(/["\\]/g, "");
|
|
1020
1020
|
e[r].push(`[data-plexo-id="${s}"] { ${o} }`);
|
|
1021
1021
|
}
|
|
1022
|
+
function H(e, t) {
|
|
1023
|
+
if (e.type !== "menu" || !t || t.textAlign === void 0) return t;
|
|
1024
|
+
let n = t.textAlign === "center" ? "center" : t.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1025
|
+
return {
|
|
1026
|
+
...t,
|
|
1027
|
+
justifyContent: n
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1022
1030
|
var U = () => ({
|
|
1023
1031
|
backgroundColor: "#ffffff",
|
|
1024
1032
|
borderRadius: "20px",
|
|
@@ -1068,7 +1076,7 @@ var U = () => ({
|
|
|
1068
1076
|
"buttonAlign"
|
|
1069
1077
|
], q = (e) => {
|
|
1070
1078
|
if (!e || typeof e != "object") return "";
|
|
1071
|
-
let t = e.kind || "text", n = W(e.name || e.label || "field"), r = e.required ? " required" : "", i =
|
|
1079
|
+
let t = e.kind || "text", n = W(e.name || e.label || "field"), r = e.required ? " required" : "", i = R({
|
|
1072
1080
|
fontSize: e.fontSize || "13px",
|
|
1073
1081
|
borderRadius: e.borderRadius || "12px",
|
|
1074
1082
|
borderWidth: e.borderWidth || "1px",
|
|
@@ -1088,7 +1096,7 @@ function J(e, t, n) {
|
|
|
1088
1096
|
}
|
|
1089
1097
|
function Y(e, t, n) {
|
|
1090
1098
|
return e.map((r, i) => {
|
|
1091
|
-
let a = i === e.length - 1, o =
|
|
1099
|
+
let a = i === e.length - 1, o = R({ borderBottom: n.showDividers && !a ? `1px solid ${t.dividerColor || "#e2e8f0"}` : void 0 }), s = R({
|
|
1092
1100
|
display: "flex",
|
|
1093
1101
|
alignItems: "center",
|
|
1094
1102
|
gap: "8px",
|
|
@@ -1105,12 +1113,12 @@ function Y(e, t, n) {
|
|
|
1105
1113
|
border: "none",
|
|
1106
1114
|
font: "inherit",
|
|
1107
1115
|
background: void 0
|
|
1108
|
-
}), c =
|
|
1116
|
+
}), c = R({
|
|
1109
1117
|
display: "grid",
|
|
1110
1118
|
gridTemplateRows: r.defaultOpen ? "1fr" : "0fr",
|
|
1111
1119
|
transition: n.animated ? "grid-template-rows 0.25s ease" : void 0,
|
|
1112
1120
|
backgroundColor: t.contentBackgroundColor || "#ffffff"
|
|
1113
|
-
}), l =
|
|
1121
|
+
}), l = R({
|
|
1114
1122
|
padding: t.contentPadding || "14px",
|
|
1115
1123
|
color: t.contentTextColor || "#475569",
|
|
1116
1124
|
fontSize: t.contentFontSize || "13px",
|
|
@@ -1124,7 +1132,7 @@ function X(e) {
|
|
|
1124
1132
|
}
|
|
1125
1133
|
var Z = (t) => {
|
|
1126
1134
|
if (!t || typeof t != "object") return "";
|
|
1127
|
-
let h = t.style || {}, g =
|
|
1135
|
+
let h = t.style || {}, g = R(t.type === "form_container" ? {
|
|
1128
1136
|
...U(),
|
|
1129
1137
|
...h
|
|
1130
1138
|
} : h), _ = t.attributes || {}, v = ` data-plexo-id="${W(t.id)}"`;
|
|
@@ -1133,7 +1141,7 @@ var Z = (t) => {
|
|
|
1133
1141
|
case "paragraph": return `<p${v} style="margin-top: 0; margin-bottom: 12px; ${g}">${_.text || "Paragraph text content."}</p>`;
|
|
1134
1142
|
case "text": return `<div${v} style="${g}">${_.text || ""}</div>`;
|
|
1135
1143
|
case "button": {
|
|
1136
|
-
let n = e(t), r =
|
|
1144
|
+
let n = e(t), r = R({
|
|
1137
1145
|
...h,
|
|
1138
1146
|
width: n.width,
|
|
1139
1147
|
height: n.height
|
|
@@ -1141,7 +1149,7 @@ var Z = (t) => {
|
|
|
1141
1149
|
return `<div style="text-align: ${h.textAlign || "center"};"><a${v} href="${_.href || "#"}" target="${_.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${r}">${_.text || "Button"}</a></div>`;
|
|
1142
1150
|
}
|
|
1143
1151
|
case "image": {
|
|
1144
|
-
let e = s(t), n = h.textAlign === "center" ? "margin: 0 auto; display: block;" : h.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", r =
|
|
1152
|
+
let e = s(t), n = h.textAlign === "center" ? "margin: 0 auto; display: block;" : h.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;", r = R({
|
|
1145
1153
|
...h,
|
|
1146
1154
|
width: e.width,
|
|
1147
1155
|
height: e.height
|
|
@@ -1161,7 +1169,7 @@ var Z = (t) => {
|
|
|
1161
1169
|
}, n = {};
|
|
1162
1170
|
for (let t of Object.keys(e)) K.includes(t) || (n[t] = e[t]);
|
|
1163
1171
|
n.height = u(t);
|
|
1164
|
-
let r =
|
|
1172
|
+
let r = R(n), i = p(Array.isArray(_.fields) ? _.fields : []), a = e.fieldSpacing || "12px", s = i.map((e) => `<div style="margin-bottom: ${a};">${q(e)}</div>`).join(""), c = _.buttonAutoWidth === !1 ? e.buttonWidth || "100%" : "auto", l = e.buttonAlign === "left" ? "flex-start" : e.buttonAlign === "right" ? "flex-end" : "center", d = _.buttonAutoHeight === !1 && e.buttonHeight || "auto", f = R({
|
|
1165
1173
|
backgroundColor: e.buttonBackgroundColor,
|
|
1166
1174
|
color: e.buttonTextColor,
|
|
1167
1175
|
borderRadius: e.buttonBorderRadius,
|
|
@@ -1186,7 +1194,7 @@ var Z = (t) => {
|
|
|
1186
1194
|
}
|
|
1187
1195
|
case "textarea": return `<textarea${v} name="${W(_.name || _.fieldName || "field")}" placeholder="${W(_.placeholder || "")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${g}"${_.required ? " required" : ""}></textarea>`;
|
|
1188
1196
|
case "select": return `<select${v} name="${W(_.name || _.fieldName || "field")}" style="width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #334155; ${g}"${_.required ? " required" : ""}>${(Array.isArray(_.options) ? _.options : []).map((e) => `<option value="${W(e?.value ?? "")}">${e?.label ?? e?.value ?? ""}</option>`).join("")}</select>`;
|
|
1189
|
-
case "html": return `<div${v} style="${
|
|
1197
|
+
case "html": return `<div${v} style="${R({
|
|
1190
1198
|
...h,
|
|
1191
1199
|
height: n(t, "auto")
|
|
1192
1200
|
})}">${_.htmlContent || _.text || ""}</div>`;
|
|
@@ -1198,12 +1206,12 @@ var Z = (t) => {
|
|
|
1198
1206
|
case "blog_categories":
|
|
1199
1207
|
case "blog_comments":
|
|
1200
1208
|
case "blog_post_list": {
|
|
1201
|
-
let e = t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), n =
|
|
1209
|
+
let e = t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase()), n = R(h);
|
|
1202
1210
|
return `<div${v} data-plexo-blog-${e}="true"${G("data-plexo-blog-prefix", _.prefix)} style="${n}"></div>`;
|
|
1203
1211
|
}
|
|
1204
1212
|
case "social": {
|
|
1205
1213
|
let e = i(t), n = h.textAlign === "center" ? "center" : h.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1206
|
-
return `<div${v} style="${
|
|
1214
|
+
return `<div${v} style="${R({
|
|
1207
1215
|
padding: h.padding,
|
|
1208
1216
|
margin: h.margin,
|
|
1209
1217
|
display: "flex",
|
|
@@ -1211,7 +1219,7 @@ var Z = (t) => {
|
|
|
1211
1219
|
gap: h.iconSpacing || "8px",
|
|
1212
1220
|
justifyContent: n
|
|
1213
1221
|
})}">${e.map((e) => {
|
|
1214
|
-
let t =
|
|
1222
|
+
let t = R({
|
|
1215
1223
|
width: e.size,
|
|
1216
1224
|
height: e.size,
|
|
1217
1225
|
padding: "8px",
|
|
@@ -1228,7 +1236,7 @@ var Z = (t) => {
|
|
|
1228
1236
|
}
|
|
1229
1237
|
case "menu": {
|
|
1230
1238
|
let e = r(t), n = h.textAlign === "center" ? "center" : h.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1231
|
-
return `<div${v} style="${
|
|
1239
|
+
return `<div${v} style="${R({
|
|
1232
1240
|
...h,
|
|
1233
1241
|
display: "flex",
|
|
1234
1242
|
flexWrap: "wrap",
|
|
@@ -1237,7 +1245,7 @@ var Z = (t) => {
|
|
|
1237
1245
|
})}">${e.map((e) => `<a href="${W(e.href)}" style="text-decoration: none; color: inherit; font-weight: ${h.fontWeight || 600};">${W(e.label)}</a>`).join("")}</div>`;
|
|
1238
1246
|
}
|
|
1239
1247
|
case "icon": {
|
|
1240
|
-
let e = h.fontSize || `${_.iconSize || 48}px`, t = h.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(_.iconName, n, t), i = h.textAlign === "right" ? "flex-end" : h.textAlign === "left" ? "flex-start" : "center", a =
|
|
1248
|
+
let e = h.fontSize || `${_.iconSize || 48}px`, t = h.color || "#1e293b", n = parseInt(String(e), 10) || 48, r = m(_.iconName, n, t), i = h.textAlign === "right" ? "flex-end" : h.textAlign === "left" ? "flex-start" : "center", a = R({
|
|
1241
1249
|
padding: h.padding,
|
|
1242
1250
|
margin: h.margin,
|
|
1243
1251
|
display: "flex",
|
|
@@ -1249,7 +1257,7 @@ var Z = (t) => {
|
|
|
1249
1257
|
let e = d(t), n = `${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#cbd5e1"}`, r = (t, r, i) => {
|
|
1250
1258
|
let a = i ? "th" : "td", o = i ? h.headerBgColor || "#f8fafc" : e.striped && r % 2 == 1 ? "#f8fafc" : h.contentBgColor || "#ffffff", s = i ? h.headerTextColor || "#1e293b" : h.contentTextColor || "#475569", c = i ? h.headerTextAlign || "left" : h.contentTextAlign || "left";
|
|
1251
1259
|
return `<tr>${t.map((e) => {
|
|
1252
|
-
let t =
|
|
1260
|
+
let t = R({
|
|
1253
1261
|
padding: h.cellPadding || "8px",
|
|
1254
1262
|
border: n,
|
|
1255
1263
|
backgroundColor: o,
|
|
@@ -1261,11 +1269,11 @@ var Z = (t) => {
|
|
|
1261
1269
|
});
|
|
1262
1270
|
return `<${a} style="${t}">${e || " "}</${a}>`;
|
|
1263
1271
|
}).join("")}</tr>`;
|
|
1264
|
-
}, i = e.enableHeader && e.cells.length > 0 ? `<thead>${r(e.cells[0], 0, !0)}</thead>` : "", a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.cells.slice(a, Math.max(a, o)).map((e, t) => r(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > a ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l =
|
|
1272
|
+
}, i = e.enableHeader && e.cells.length > 0 ? `<thead>${r(e.cells[0], 0, !0)}</thead>` : "", a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length, s = e.cells.slice(a, Math.max(a, o)).map((e, t) => r(e, t, !1)).join(""), c = e.enableFooter && e.cells.length > a ? `<tfoot>${r(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : "", l = R({
|
|
1265
1273
|
borderCollapse: "collapse",
|
|
1266
1274
|
width: "100%"
|
|
1267
1275
|
});
|
|
1268
|
-
return `<div${v} style="${
|
|
1276
|
+
return `<div${v} style="${R({
|
|
1269
1277
|
padding: h.padding,
|
|
1270
1278
|
margin: h.margin,
|
|
1271
1279
|
overflowX: "auto"
|
|
@@ -1273,7 +1281,7 @@ var Z = (t) => {
|
|
|
1273
1281
|
}
|
|
1274
1282
|
case "video": {
|
|
1275
1283
|
let e = a(_.videoUrl), t = _.linkType === "email" ? `mailto:${_.href || ""}` : _.href || _.videoUrl || "#", n = _.target || "_blank";
|
|
1276
|
-
return `<div${v} style="${
|
|
1284
|
+
return `<div${v} style="${R({
|
|
1277
1285
|
padding: h.padding,
|
|
1278
1286
|
margin: h.margin,
|
|
1279
1287
|
borderRadius: h.borderRadius,
|
|
@@ -1281,16 +1289,16 @@ var Z = (t) => {
|
|
|
1281
1289
|
})}"><a href="${W(t)}" target="${W(n)}" style="position: relative; display: block; text-decoration: none;"><img src="${W(e.thumbnailUrl)}" alt="${W(_.alt || "Video preview")}" style="width: 100%; display: block;" /><span style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 56px; height: 56px; border-radius: 9999px; background: rgba(15, 23, 42, 0.75); display: flex; align-items: center; justify-content: center;"><span style="width: 0; height: 0; border-top: 10px solid transparent; border-bottom: 10px solid transparent; border-left: 16px solid #ffffff; margin-left: 4px;"></span></span></a></div>`;
|
|
1282
1290
|
}
|
|
1283
1291
|
case "timer": {
|
|
1284
|
-
let e = _.showLabels !== !1, n =
|
|
1292
|
+
let e = _.showLabels !== !1, n = R({
|
|
1285
1293
|
fontFamily: h.digitsFontFamily,
|
|
1286
1294
|
fontSize: h.digitsFontSize || "40px",
|
|
1287
1295
|
color: h.digitsColor || "#1e293b",
|
|
1288
1296
|
fontWeight: "800"
|
|
1289
|
-
}), r =
|
|
1297
|
+
}), r = R({
|
|
1290
1298
|
fontFamily: h.labelsFontFamily,
|
|
1291
1299
|
fontSize: h.labelsFontSize || "16px",
|
|
1292
1300
|
color: h.labelsColor || "#64748b"
|
|
1293
|
-
}), i =
|
|
1301
|
+
}), i = R({
|
|
1294
1302
|
backgroundColor: h.backgroundColor || "#f8fafc",
|
|
1295
1303
|
borderRadius: h.borderRadius || "8px",
|
|
1296
1304
|
padding: h.padding || "16px",
|
|
@@ -1299,7 +1307,7 @@ var Z = (t) => {
|
|
|
1299
1307
|
return `<div${v} data-plexo-target="${s}" style="${i}"><div>${a("days", "Days", o.days)}${a("hours", "Hours", o.hours)}${a("minutes", "Mins", o.minutes)}${a("seconds", "Secs", o.seconds)}</div>${l}</div>`;
|
|
1300
1308
|
}
|
|
1301
1309
|
case "carousel": {
|
|
1302
|
-
let e = Array.isArray(_.images) ? _.images : [], n =
|
|
1310
|
+
let e = Array.isArray(_.images) ? _.images : [], n = R({
|
|
1303
1311
|
padding: h.padding || "10px",
|
|
1304
1312
|
margin: h.margin,
|
|
1305
1313
|
backgroundColor: h.backgroundColor,
|
|
@@ -1312,7 +1320,7 @@ var Z = (t) => {
|
|
|
1312
1320
|
return `<div${v} data-active-idx="${r}" style="${n}">${e.length > 1 ? "<button type=\"button\" data-nav=\"prev\" style=\"position: absolute; left: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">‹</button><button type=\"button\" data-nav=\"next\" style=\"position: absolute; right: 8px; top: 40%; transform: translateY(-50%); border: none; background: rgba(15, 23, 42, 0.6); color: #fff; width: 28px; height: 28px; border-radius: 9999px; cursor: pointer;\">›</button>" : ""}${i}${a}${`<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${t.id}"]`)});if(!wrap)return;var slides=wrap.querySelectorAll('[data-slide-idx]');var dots=wrap.querySelectorAll('[data-dot-idx]');function show(n){var idx=(n+slides.length)%slides.length;slides.forEach(function(s,i){s.style.display=i===idx?'block':'none';});dots.forEach(function(d,i){d.style.background=i===idx?'#4f46e5':'#cbd5e1';});wrap.setAttribute('data-active-idx',String(idx));}var prev=wrap.querySelector('[data-nav="prev"]');var next=wrap.querySelector('[data-nav="next"]');if(prev)prev.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)-1);});if(next)next.addEventListener('click',function(){show(parseInt(wrap.getAttribute('data-active-idx')||'0',10)+1);});dots.forEach(function(d,i){d.addEventListener('click',function(){show(i);});});})();<\/script>`}</div>`;
|
|
1313
1321
|
}
|
|
1314
1322
|
case "accordion": {
|
|
1315
|
-
let e = f(t), n = _.mode === "multi" ? "multi" : "single", r = _.iconStyle || "chevron", i = _.iconPosition === "left", a = _.showDividers !== !1, o = _.animation !== "none", s =
|
|
1323
|
+
let e = f(t), n = _.mode === "multi" ? "multi" : "single", r = _.iconStyle || "chevron", i = _.iconPosition === "left", a = _.showDividers !== !1, o = _.animation !== "none", s = R({
|
|
1316
1324
|
border: `${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#e2e8f0"}`,
|
|
1317
1325
|
borderRadius: h.borderRadius || "10px",
|
|
1318
1326
|
overflow: "hidden",
|
|
@@ -1329,30 +1337,30 @@ var Z = (t) => {
|
|
|
1329
1337
|
}
|
|
1330
1338
|
}, Q = (e, n) => {
|
|
1331
1339
|
if (!e || typeof e != "object") return "";
|
|
1332
|
-
let r =
|
|
1340
|
+
let r = L(e);
|
|
1333
1341
|
if (!r) return `\n <!-- ROW SKIPPED (type="${typeof e.type == "string" ? e.type : "unknown"}"${e.id ? `, id="${e.id}"` : ""}): this row has no 'columns' array and its shorthand content (e.g. a list of items/links) can't be auto-converted without losing data. Provide a fully hydrated row with 'columns' and 'elements' instead. -->`;
|
|
1334
|
-
let i =
|
|
1335
|
-
|
|
1342
|
+
let i = R(r.style || {}), a = G("id", r.htmlId), o = G("class", r.htmlClass), s = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
1343
|
+
V(n, s, r.style, "tablet", r.styleTablet), V(n, s, r.style, "mobile", r.styleMobile);
|
|
1336
1344
|
let c = `\n <!-- ROW START: ${r.id || "row"} -->`;
|
|
1337
1345
|
c += `\n <div data-plexo-id="${s}"${a}${o} class="plexo-row" style="display: flex; flex-wrap: wrap; margin-left: -8px; margin-right: -8px; ${i}">`;
|
|
1338
1346
|
let l = Array.isArray(r.columns) ? r.columns : [];
|
|
1339
1347
|
for (let e of l) {
|
|
1340
1348
|
if (!e) continue;
|
|
1341
|
-
let r = e.styles || e.style || {}, i =
|
|
1342
|
-
|
|
1343
|
-
let
|
|
1349
|
+
let r = e.styles || e.style || {}, i = R(r), a = r.gap || "16px", o = G("id", e.attrs?.htmlId), s = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", l = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
1350
|
+
V(n, l, r, "tablet", e.stylesTablet), V(n, l, r, "mobile", e.stylesMobile), c += `\n <!-- COLUMN START: ${e.id || "col"} -->`, c += `\n <div data-plexo-id="${l}"${o} class="plexo-col${s}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; --plexo-col-gap: ${a}; ${i}">`;
|
|
1351
|
+
let u = Array.isArray(e.elements) ? e.elements : [], d = Array.isArray(e.nestedRows) ? e.nestedRows : [], f = new Map(u.map((e) => [e.id, e])), p = new Map(d.map((e) => [e.id, e]));
|
|
1344
1352
|
for (let r of t({
|
|
1345
1353
|
...e,
|
|
1346
|
-
elements:
|
|
1347
|
-
nestedRows:
|
|
1354
|
+
elements: u,
|
|
1355
|
+
nestedRows: d
|
|
1348
1356
|
})) {
|
|
1349
|
-
let e =
|
|
1357
|
+
let e = f.get(r);
|
|
1350
1358
|
if (e) {
|
|
1351
|
-
let t = e.attributes || {}, r = typeof t.htmlClassNames == "string" ? t.htmlClassNames : typeof t.htmlClass == "string" ? t.htmlClass : typeof t.className == "string" ? t.className : "", i = G("id", t.htmlId),
|
|
1352
|
-
|
|
1359
|
+
let t = e.attributes || {}, r = typeof t.htmlClassNames == "string" ? t.htmlClassNames : typeof t.htmlClass == "string" ? t.htmlClass : typeof t.className == "string" ? t.className : "", i = G("id", t.htmlId), o = G("class", r), s = e.style?.display, l = s === "inline-block" || s === "inline" || s === "inline-flex" ? `margin-bottom: ${a}; display: ${s}; vertical-align: top;` : `margin-bottom: ${a};`;
|
|
1360
|
+
V(n, e.id, e.style, "tablet", H(e, e.styleTablet)), V(n, e.id, e.style, "mobile", H(e, e.styleMobile)), c += `\n <div${i}${o} style="${l}">`, c += `\n ${Z(e)}`, c += "\n </div>";
|
|
1353
1361
|
continue;
|
|
1354
1362
|
}
|
|
1355
|
-
let t =
|
|
1363
|
+
let t = p.get(r);
|
|
1356
1364
|
t && (c += Q(t, n));
|
|
1357
1365
|
}
|
|
1358
1366
|
c += "\n </div>";
|
|
@@ -1386,7 +1394,7 @@ var Z = (t) => {
|
|
|
1386
1394
|
"favicon"
|
|
1387
1395
|
], a = {};
|
|
1388
1396
|
for (let e of Object.keys(r)) i.includes(e) || (a[e] = r[e]);
|
|
1389
|
-
let o =
|
|
1397
|
+
let o = R(a), s = typeof r.htmlTitle == "string" && r.htmlTitle.trim() ? r.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", c = G("id", r.htmlId), l = G("class", r.htmlClass), u = typeof r.customCss == "string" && r.customCss.trim() ? r.customCss.trim() : "", d = typeof r.customJs == "string" && r.customJs.trim() ? r.customJs.trim() : "", f = typeof r.favicon == "string" && r.favicon.trim() ? r.favicon.trim() : "", p = Array.isArray(n.rows) ? n.rows : Array.isArray(t.rows) ? t.rows : Array.isArray(e.rows) ? e.rows : [], m = T(w(p, [r.fontFamily])), h = {
|
|
1390
1398
|
tablet: [],
|
|
1391
1399
|
mobile: []
|
|
1392
1400
|
}, g = "";
|
|
@@ -1400,7 +1408,7 @@ var Z = (t) => {
|
|
|
1400
1408
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
1401
1409
|
${m ? `<link rel="stylesheet" href="${m}">` : ""}
|
|
1402
1410
|
<style>
|
|
1403
|
-
body { margin: 0; font-family: ${
|
|
1411
|
+
body { margin: 0; font-family: ${I}; }
|
|
1404
1412
|
.plexo-row {
|
|
1405
1413
|
display: flex;
|
|
1406
1414
|
flex-wrap: wrap;
|
|
@@ -1417,7 +1425,7 @@ var Z = (t) => {
|
|
|
1417
1425
|
.plexo-col {
|
|
1418
1426
|
width: 100% !important;
|
|
1419
1427
|
max-width: 100% !important;
|
|
1420
|
-
margin-bottom: 16px;
|
|
1428
|
+
margin-bottom: var(--plexo-col-gap, 16px);
|
|
1421
1429
|
}${v}
|
|
1422
1430
|
}
|
|
1423
1431
|
</style>
|
|
@@ -1430,14 +1438,14 @@ ${d ? ` <script>\n${d}\n <\/script>` : ""}
|
|
|
1430
1438
|
</body>
|
|
1431
1439
|
</html>`, y = y.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1"), y;
|
|
1432
1440
|
};
|
|
1433
|
-
function
|
|
1441
|
+
function ne(e) {
|
|
1434
1442
|
return $(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
|
|
1435
1443
|
}
|
|
1436
|
-
function
|
|
1444
|
+
function re(e) {
|
|
1437
1445
|
return $(e);
|
|
1438
1446
|
}
|
|
1439
|
-
function
|
|
1447
|
+
function ie(e) {
|
|
1440
1448
|
return e;
|
|
1441
1449
|
}
|
|
1442
1450
|
//#endregion
|
|
1443
|
-
export { S as _,
|
|
1451
|
+
export { S as _, re as a, g as b, U as c, F as d, T as f, b as g, _ as h, $ as i, z as l, x as m, K as n, ne as o, w as p, V as r, L as s, I as t, ie as u, v, h as x, y };
|
package/dist/compiler.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./compiler-
|
|
1
|
+
import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./compiler-BgBUwMe0.js";
|
|
2
2
|
export { c as DEFAULT_BODY_FONT_FAMILY, i as FORM_NON_CSS_STYLE_KEYS, o as collectResponsiveRule, n as compileToHTML, e as compileToHTMLWithStrataAuto, a as compileToPlainText, s as convertSectionRowToPlexoRow, t as getFormDefaultStyle, r as getInlineStylesImportant, l as injectStrataBundle };
|
package/dist/components/properties/accordionSections/BlogFeaturedImagePropertiesAccordion.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* blog_featured_image substitutes a real per-post <img> (lib/pub/blogLayoutFragments.tsx)
|
|
4
|
+
* that defaults to full width + auto height on the host — no style controls existed at all
|
|
5
|
+
* before this, matching the gap blog_comments/blog_post_list had. Same fix: CSS custom
|
|
6
|
+
* properties (var(--plexo-featuredimage-*, <fallback>)) inherited from this marker div,
|
|
7
|
+
* written here via the same onTransientStyleChange path every other style control uses.
|
|
8
|
+
*/
|
|
9
|
+
export declare const BlogFeaturedImagePropertiesAccordion: React.FC<any>;
|