@charisol/plexo-sdk 1.1.4 → 1.1.6
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/{compiler-BpXCk9OP.js → compiler-Dv-nnW6a.js} +65 -57
- package/dist/compiler.js +1 -1
- package/dist/compilerClient.js +51 -43
- package/dist/components/icons.d.ts +8 -0
- package/dist/components/sidebarTabs/ContentTab.d.ts +2 -0
- package/dist/{iconSvgStatic-CeiuMavi.js → iconSvgStatic-D5PrYZfC.js} +170 -71
- package/dist/index.js +14362 -14101
- package/dist/plexo-sdk.css +1 -1
- package/dist/utilities/elementResolvers.d.ts +14 -6
- package/dist/utilities/playground.helpers.d.ts +108 -0
- package/dist/utilities/playground.interfaces.d.ts +9 -0
- package/dist/utilities/socialBrandIcons.d.ts +17 -0
- package/dist/utilities/types.d.ts +1 -1
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, b as t, c as n, d as r, f as i, h as a, i as o, l as s, m as c, n as l, o as u, p as d, r as f, s as p, t as m } from "./iconSvgStatic-D5PrYZfC.js";
|
|
2
2
|
//#region src/utilities/playground.constants.ts
|
|
3
3
|
var h = (e) => `https://picsum.photos/seed/${encodeURIComponent(e)}/1200/800`, g = [
|
|
4
4
|
{
|
|
@@ -1122,18 +1122,18 @@ function Y(e, t, n) {
|
|
|
1122
1122
|
function X(e) {
|
|
1123
1123
|
return `<!-- Unsupported block ${String(e)} -->`;
|
|
1124
1124
|
}
|
|
1125
|
-
var Z = (
|
|
1126
|
-
if (!
|
|
1127
|
-
let h =
|
|
1125
|
+
var Z = (t) => {
|
|
1126
|
+
if (!t || typeof t != "object") return "";
|
|
1127
|
+
let h = t.style || {}, g = z(t.type === "form_container" ? {
|
|
1128
1128
|
...U(),
|
|
1129
1129
|
...h
|
|
1130
|
-
} : h), _ =
|
|
1131
|
-
switch (
|
|
1130
|
+
} : h), _ = t.attributes || {}, v = ` data-plexo-id="${W(t.id)}"`;
|
|
1131
|
+
switch (t.type) {
|
|
1132
1132
|
case "heading": return `<h2${v} style="margin-top: 0; margin-bottom: 8px; ${g}">${_.text || "Heading"}</h2>`;
|
|
1133
1133
|
case "paragraph": return `<p${v} style="margin-top: 0; margin-bottom: 12px; ${g}">${_.text || "Paragraph text content."}</p>`;
|
|
1134
1134
|
case "text": return `<div${v} style="${g}">${_.text || ""}</div>`;
|
|
1135
1135
|
case "button": {
|
|
1136
|
-
let n = t
|
|
1136
|
+
let n = e(t), r = z({
|
|
1137
1137
|
...h,
|
|
1138
1138
|
width: n.width,
|
|
1139
1139
|
height: n.height
|
|
@@ -1141,10 +1141,10 @@ var Z = (e) => {
|
|
|
1141
1141
|
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
1142
|
}
|
|
1143
1143
|
case "image": {
|
|
1144
|
-
let
|
|
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 = z({
|
|
1145
1145
|
...h,
|
|
1146
|
-
width:
|
|
1147
|
-
height:
|
|
1146
|
+
width: e.width,
|
|
1147
|
+
height: e.height
|
|
1148
1148
|
});
|
|
1149
1149
|
return `<img${v} src="${_.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${_.alt || ""}" style="${r} ${n}" />`;
|
|
1150
1150
|
}
|
|
@@ -1155,26 +1155,26 @@ var Z = (e) => {
|
|
|
1155
1155
|
<p style="margin: 0; color: #94a3b8; font-size: 14px;">${_.description || "Card description."}</p>
|
|
1156
1156
|
</div>`;
|
|
1157
1157
|
case "form_container": {
|
|
1158
|
-
let
|
|
1158
|
+
let e = {
|
|
1159
1159
|
...U(),
|
|
1160
1160
|
...h
|
|
1161
1161
|
}, n = {};
|
|
1162
|
-
for (let
|
|
1163
|
-
n.height = u(
|
|
1164
|
-
let r = z(n), i = p(Array.isArray(_.fields) ? _.fields : []), a =
|
|
1165
|
-
backgroundColor:
|
|
1166
|
-
color:
|
|
1167
|
-
borderRadius:
|
|
1168
|
-
paddingTop: o(
|
|
1169
|
-
paddingBottom: o(
|
|
1170
|
-
paddingLeft: o(
|
|
1171
|
-
paddingRight: o(
|
|
1172
|
-
marginTop: o(
|
|
1173
|
-
marginBottom: o(
|
|
1174
|
-
marginLeft: o(
|
|
1175
|
-
marginRight: o(
|
|
1176
|
-
fontSize:
|
|
1177
|
-
fontWeight:
|
|
1162
|
+
for (let t of Object.keys(e)) K.includes(t) || (n[t] = e[t]);
|
|
1163
|
+
n.height = u(t);
|
|
1164
|
+
let r = z(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 = z({
|
|
1165
|
+
backgroundColor: e.buttonBackgroundColor,
|
|
1166
|
+
color: e.buttonTextColor,
|
|
1167
|
+
borderRadius: e.buttonBorderRadius,
|
|
1168
|
+
paddingTop: o(e.buttonPaddingTop, e.buttonPadding, "top", "10px"),
|
|
1169
|
+
paddingBottom: o(e.buttonPaddingBottom, e.buttonPadding, "bottom", "10px"),
|
|
1170
|
+
paddingLeft: o(e.buttonPaddingLeft, e.buttonPadding, "left", "14px"),
|
|
1171
|
+
paddingRight: o(e.buttonPaddingRight, e.buttonPadding, "right", "14px"),
|
|
1172
|
+
marginTop: o(e.buttonMarginTop, e.buttonMargin, "top"),
|
|
1173
|
+
marginBottom: o(e.buttonMarginBottom, e.buttonMargin, "bottom"),
|
|
1174
|
+
marginLeft: o(e.buttonMarginLeft, e.buttonMargin, "left"),
|
|
1175
|
+
marginRight: o(e.buttonMarginRight, e.buttonMargin, "right"),
|
|
1176
|
+
fontSize: e.buttonFontSize,
|
|
1177
|
+
fontWeight: e.buttonFontWeight,
|
|
1178
1178
|
width: c,
|
|
1179
1179
|
height: d
|
|
1180
1180
|
});
|
|
@@ -1188,10 +1188,18 @@ var Z = (e) => {
|
|
|
1188
1188
|
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
1189
|
case "html": return `<div${v} style="${z({
|
|
1190
1190
|
...h,
|
|
1191
|
-
height: n(
|
|
1191
|
+
height: n(t, "auto")
|
|
1192
1192
|
})}">${_.htmlContent || _.text || ""}</div>`;
|
|
1193
|
+
case "blog_title":
|
|
1194
|
+
case "blog_content":
|
|
1195
|
+
case "blog_featured_image":
|
|
1196
|
+
case "blog_date":
|
|
1197
|
+
case "blog_author":
|
|
1198
|
+
case "blog_categories":
|
|
1199
|
+
case "blog_comments":
|
|
1200
|
+
case "blog_post_list": return `<div${v} data-plexo-blog-${t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true" style="${z(h)}"></div>`;
|
|
1193
1201
|
case "social": {
|
|
1194
|
-
let
|
|
1202
|
+
let e = i(t), n = h.textAlign === "center" ? "center" : h.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1195
1203
|
return `<div${v} style="${z({
|
|
1196
1204
|
padding: h.padding,
|
|
1197
1205
|
margin: h.margin,
|
|
@@ -1199,7 +1207,7 @@ var Z = (e) => {
|
|
|
1199
1207
|
flexWrap: "wrap",
|
|
1200
1208
|
gap: h.iconSpacing || "8px",
|
|
1201
1209
|
justifyContent: n
|
|
1202
|
-
})}">${
|
|
1210
|
+
})}">${e.map((e) => {
|
|
1203
1211
|
let t = z({
|
|
1204
1212
|
width: e.size,
|
|
1205
1213
|
height: e.size,
|
|
@@ -1216,14 +1224,14 @@ var Z = (e) => {
|
|
|
1216
1224
|
}).join("")}</div>`;
|
|
1217
1225
|
}
|
|
1218
1226
|
case "menu": {
|
|
1219
|
-
let
|
|
1227
|
+
let e = r(t), n = h.textAlign === "center" ? "center" : h.textAlign === "right" ? "flex-end" : "flex-start";
|
|
1220
1228
|
return `<div${v} style="${z({
|
|
1221
1229
|
...h,
|
|
1222
1230
|
display: "flex",
|
|
1223
1231
|
flexWrap: "wrap",
|
|
1224
1232
|
gap: "16px",
|
|
1225
1233
|
justifyContent: n
|
|
1226
|
-
})}">${
|
|
1234
|
+
})}">${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>`;
|
|
1227
1235
|
}
|
|
1228
1236
|
case "icon": {
|
|
1229
1237
|
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 = z({
|
|
@@ -1235,9 +1243,9 @@ var Z = (e) => {
|
|
|
1235
1243
|
return `<div style="${a}">${o ? `<a${v} href="${W(o)}" target="${_.openInNewTab ? "_blank" : "_self"}" style="text-decoration: none;">${s}</a>` : `<span${v}>${s}</span>`}</div>`;
|
|
1236
1244
|
}
|
|
1237
1245
|
case "table": {
|
|
1238
|
-
let
|
|
1239
|
-
let a = i ? "th" : "td", o = i ? h.headerBgColor || "#f8fafc" :
|
|
1240
|
-
return `<tr>${
|
|
1246
|
+
let e = d(t), n = `${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#cbd5e1"}`, r = (t, r, i) => {
|
|
1247
|
+
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";
|
|
1248
|
+
return `<tr>${t.map((e) => {
|
|
1241
1249
|
let t = z({
|
|
1242
1250
|
padding: h.cellPadding || "8px",
|
|
1243
1251
|
border: n,
|
|
@@ -1250,7 +1258,7 @@ var Z = (e) => {
|
|
|
1250
1258
|
});
|
|
1251
1259
|
return `<${a} style="${t}">${e || " "}</${a}>`;
|
|
1252
1260
|
}).join("")}</tr>`;
|
|
1253
|
-
}, i =
|
|
1261
|
+
}, 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 = z({
|
|
1254
1262
|
borderCollapse: "collapse",
|
|
1255
1263
|
width: "100%"
|
|
1256
1264
|
});
|
|
@@ -1270,7 +1278,7 @@ var Z = (e) => {
|
|
|
1270
1278
|
})}"><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>`;
|
|
1271
1279
|
}
|
|
1272
1280
|
case "timer": {
|
|
1273
|
-
let
|
|
1281
|
+
let e = _.showLabels !== !1, n = z({
|
|
1274
1282
|
fontFamily: h.digitsFontFamily,
|
|
1275
1283
|
fontSize: h.digitsFontSize || "40px",
|
|
1276
1284
|
color: h.digitsColor || "#1e293b",
|
|
@@ -1284,11 +1292,11 @@ var Z = (e) => {
|
|
|
1284
1292
|
borderRadius: h.borderRadius || "8px",
|
|
1285
1293
|
padding: h.padding || "16px",
|
|
1286
1294
|
textAlign: "center"
|
|
1287
|
-
}), a = (
|
|
1295
|
+
}), a = (t, i, a) => `<div style="display: inline-flex; flex-direction: column; align-items: center; padding: 0 10px;"><span data-unit="${t}" style="${n}">${a}</span>${e ? `<span style="${r}">${i}</span>` : ""}</div>`, o = c(_.targetDate), s = W(_.targetDate || "2026-12-31T23:59:59"), l = `<script>(function(){var wrap=document.querySelector(${JSON.stringify(`[data-plexo-id="${t.id}"]`)});if(!wrap)return;var target=new Date(wrap.getAttribute('data-plexo-target')).getTime();function pad(n){return String(n).padStart(2,'0');}function tick(){var diff=target-Date.now();var d=wrap.querySelector('[data-unit="days"]'),h=wrap.querySelector('[data-unit="hours"]'),m=wrap.querySelector('[data-unit="minutes"]'),s=wrap.querySelector('[data-unit="seconds"]');if(diff<=0){[d,h,m,s].forEach(function(n){if(n)n.textContent='00';});clearInterval(iv);return;}var total=Math.floor(diff/1000);if(d)d.textContent=pad(Math.floor(total/86400));if(h)h.textContent=pad(Math.floor(total%86400/3600));if(m)m.textContent=pad(Math.floor(total%3600/60));if(s)s.textContent=pad(total%60);}tick();var iv=setInterval(tick,1000);})();<\/script>`;
|
|
1288
1296
|
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>`;
|
|
1289
1297
|
}
|
|
1290
1298
|
case "carousel": {
|
|
1291
|
-
let
|
|
1299
|
+
let e = Array.isArray(_.images) ? _.images : [], n = z({
|
|
1292
1300
|
padding: h.padding || "10px",
|
|
1293
1301
|
margin: h.margin,
|
|
1294
1302
|
backgroundColor: h.backgroundColor,
|
|
@@ -1296,42 +1304,42 @@ var Z = (e) => {
|
|
|
1296
1304
|
overflow: "hidden",
|
|
1297
1305
|
borderRadius: "12px"
|
|
1298
1306
|
});
|
|
1299
|
-
if (
|
|
1300
|
-
let r = Math.min(
|
|
1301
|
-
return `<div${v} data-active-idx="${r}" style="${n}">${
|
|
1307
|
+
if (e.length === 0) return `<div${v} style="${n}"><div style="padding: 40px; text-align: center; color: #94a3b8;">No images in carousel</div></div>`;
|
|
1308
|
+
let r = Math.min(e.length - 1, Math.max(0, parseInt(String(_.activeIdx), 10) || 0)), i = e.map((e, t) => `<div data-slide-idx="${t}" style="display: ${t === r ? "block" : "none"};"><img src="${W(e.src)}" alt="${W(e.alt || e.caption || "")}" style="width: 100%; display: block;" />${e.caption ? `<div style="padding: 8px; text-align: center; background: rgba(15, 23, 42, 0.8); color: #fff; font-size: 12px; font-weight: 600;">${W(e.caption)}</div>` : ""}</div>`).join(""), a = e.length > 1 ? `<div style="display: flex; gap: 6px; justify-content: center; padding: 8px 0;">${e.map((e, t) => `<button type="button" data-dot-idx="${t}" style="width: 8px; height: 8px; border-radius: 9999px; border: none; background: ${t === r ? "#4f46e5" : "#cbd5e1"}; cursor: pointer;"></button>`).join("")}</div>` : "";
|
|
1309
|
+
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>`;
|
|
1302
1310
|
}
|
|
1303
1311
|
case "accordion": {
|
|
1304
|
-
let
|
|
1312
|
+
let e = f(t), n = _.mode === "multi" ? "multi" : "single", r = _.iconStyle || "chevron", i = _.iconPosition === "left", a = _.showDividers !== !1, o = _.animation !== "none", s = z({
|
|
1305
1313
|
border: `${h.borderWidth || "1px"} ${h.borderStyle || "solid"} ${h.borderColor || "#e2e8f0"}`,
|
|
1306
1314
|
borderRadius: h.borderRadius || "10px",
|
|
1307
1315
|
overflow: "hidden",
|
|
1308
1316
|
margin: h.margin
|
|
1309
1317
|
});
|
|
1310
|
-
return
|
|
1318
|
+
return e.length === 0 ? `<div${v} style="${s}"></div>` : `<div${v} data-acc-mode="${n}" data-acc-icon-style="${r}" style="${s}"><div class="plexo-acc-group">${Y(e, h, {
|
|
1311
1319
|
iconStyle: r,
|
|
1312
1320
|
iconOnLeft: i,
|
|
1313
1321
|
showDividers: a,
|
|
1314
1322
|
animated: o
|
|
1315
|
-
})}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${
|
|
1323
|
+
})}</div>${`<script>(function(){var root=document.querySelector(${JSON.stringify(`[data-plexo-id="${t.id}"]`)});if(!root)return;var mode=root.getAttribute('data-acc-mode')||'single';var iconStyle=root.getAttribute('data-acc-icon-style')||'chevron';function setIconState(icon,open){if(!icon)return;if(iconStyle==='plus'){icon.textContent=open?'−':'+';}else if(iconStyle==='arrow'){icon.style.transform=open?'rotate(90deg)':'';}else if(iconStyle==='chevron'){icon.style.transform=open?'rotate(180deg)':'';}}var headers=root.querySelectorAll('[data-acc-header]');headers.forEach(function(header){header.addEventListener('click',function(){var item=header.parentElement;var group=item.parentElement;var panel=item.children[1];var isOpen=header.getAttribute('data-acc-open')==='1';if(mode!=='multi'&&group){Array.prototype.forEach.call(group.children,function(sib){if(sib===item)return;var sh=sib.children[0];var sp=sib.children[1];if(sh){sh.setAttribute('data-acc-open','0');setIconState(sh.querySelector('[data-acc-icon]'),false);}if(sp)sp.style.gridTemplateRows='0fr';});}var next=!isOpen;header.setAttribute('data-acc-open',next?'1':'0');panel.style.gridTemplateRows=next?'1fr':'0fr';setIconState(header.querySelector('[data-acc-icon]'),next);});});})();<\/script>`}</div>`;
|
|
1316
1324
|
}
|
|
1317
|
-
default: return X(
|
|
1325
|
+
default: return X(t.type);
|
|
1318
1326
|
}
|
|
1319
|
-
}, Q = (
|
|
1320
|
-
if (!
|
|
1321
|
-
let r = R(
|
|
1322
|
-
if (!r) return `\n <!-- ROW SKIPPED (type="${typeof
|
|
1327
|
+
}, Q = (e, n) => {
|
|
1328
|
+
if (!e || typeof e != "object") return "";
|
|
1329
|
+
let r = R(e);
|
|
1330
|
+
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. -->`;
|
|
1323
1331
|
let i = z(r.style || {}), a = G("id", r.htmlId), o = G("class", r.htmlClass), s = r.id || `row-${Math.random().toString(36).substring(2, 9)}`;
|
|
1324
1332
|
H(n, s, r.style, "tablet", r.styleTablet), H(n, s, r.style, "mobile", r.styleMobile);
|
|
1325
1333
|
let c = `\n <!-- ROW START: ${r.id || "row"} -->`;
|
|
1326
1334
|
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}">`;
|
|
1327
1335
|
let l = Array.isArray(r.columns) ? r.columns : [];
|
|
1328
|
-
for (let
|
|
1329
|
-
if (!
|
|
1330
|
-
let r =
|
|
1331
|
-
H(n, s, r, "tablet",
|
|
1332
|
-
let l = Array.isArray(
|
|
1333
|
-
for (let r of
|
|
1334
|
-
...
|
|
1336
|
+
for (let e of l) {
|
|
1337
|
+
if (!e) continue;
|
|
1338
|
+
let r = e.styles || e.style || {}, i = z(r), a = G("id", e.attrs?.htmlId), o = e.attrs?.htmlClass ? ` ${e.attrs.htmlClass}` : "", s = e.id || `col-${Math.random().toString(36).substring(2, 9)}`;
|
|
1339
|
+
H(n, s, r, "tablet", e.stylesTablet), H(n, s, r, "mobile", e.stylesMobile), c += `\n <!-- COLUMN START: ${e.id || "col"} -->`, c += `\n <div data-plexo-id="${s}"${a} class="plexo-col${o}" style="box-sizing: border-box; padding-left: 8px; padding-right: 8px; width: ${e.width || "100%"}; ${i}">`;
|
|
1340
|
+
let l = Array.isArray(e.elements) ? e.elements : [], u = Array.isArray(e.nestedRows) ? e.nestedRows : [], d = new Map(l.map((e) => [e.id, e])), f = new Map(u.map((e) => [e.id, e]));
|
|
1341
|
+
for (let r of t({
|
|
1342
|
+
...e,
|
|
1335
1343
|
elements: l,
|
|
1336
1344
|
nestedRows: u
|
|
1337
1345
|
})) {
|
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-Dv-nnW6a.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/compilerClient.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e, b as t, d as n, f as r, h as i, l as a, m as o, n as s, p as c, t as l } from "./iconSvgStatic-D5PrYZfC.js";
|
|
2
2
|
//#region src/utilities/compilerClient.ts
|
|
3
3
|
var u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d = (e) => {
|
|
4
4
|
let t = "";
|
|
@@ -40,96 +40,104 @@ var u = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", d =
|
|
|
40
40
|
}, b = (e = {}) => {
|
|
41
41
|
let t = e.backgroundColor || e.background;
|
|
42
42
|
return t ? ` background-color="${p(String(t))}"` : "";
|
|
43
|
-
}, x = (
|
|
44
|
-
let f = g(
|
|
45
|
-
if (
|
|
46
|
-
if (
|
|
43
|
+
}, x = (t, u) => {
|
|
44
|
+
let f = g(t, u), b = m(t.style || {}), x = f.htmlId ? ` id="${p(f.htmlId)}"` : "", S = h(f.htmlClassNames, f.htmlClass, u === "landing_page" && f.hideOnMobile ? "hidden md:block" : ""), C = S ? ` class="${p(S)}"` : "", w = typeof f.customCss == "string" && f.customCss.trim() ? f.customCss.trim() : "", T = w && u === "landing_page" ? `<style>${w}</style>` : "";
|
|
45
|
+
if (t.type === "form_container") return `${T}${v(t, u)}`;
|
|
46
|
+
if (t.type === "input" || t.type === "select" || t.type === "textarea") return `${T}${_(t, u)}`;
|
|
47
47
|
if (u === "email") {
|
|
48
|
-
if (
|
|
49
|
-
let n = p(f.href || "#"), r = p(f.text || "Button"), i = t
|
|
48
|
+
if (t.type === "button") {
|
|
49
|
+
let n = p(f.href || "#"), r = p(f.text || "Button"), i = e(t).width, a = i === "auto" ? "" : ` width="${p(i)}"`;
|
|
50
50
|
return `<mj-button href="${n}" css-class="${f.hideOnDesktop ? "desktop-hide" : ""}" padding="0" inner-padding="10px 16px"${a}>${r}</mj-button>`;
|
|
51
51
|
}
|
|
52
|
-
if (
|
|
53
|
-
let
|
|
52
|
+
if (t.type === "image") {
|
|
53
|
+
let e = a(t), n = e.width && e.width !== "100%" ? ` width="${p(e.width)}"` : "", r = e.height && e.height !== "auto" ? ` height="${p(e.height)}"` : "";
|
|
54
54
|
return `<mj-image src="${p(f.src || "")}" alt="${p(f.alt || "")}"${n}${r} />`;
|
|
55
55
|
}
|
|
56
|
-
if (
|
|
57
|
-
let
|
|
58
|
-
if (!
|
|
56
|
+
if (t.type === "social") {
|
|
57
|
+
let e = r(t);
|
|
58
|
+
if (!e.length) return "";
|
|
59
59
|
let n = (e) => e === "square" ? "14px" : "9999px";
|
|
60
|
-
return `<mj-social font-size="13px" mode="horizontal">${
|
|
60
|
+
return `<mj-social font-size="13px" mode="horizontal">${e.map((e) => {
|
|
61
61
|
let t = `data:image/svg+xml;base64,${d(s(e.provider, e.color))}`;
|
|
62
62
|
return `<mj-social-element href="${p(e.url)}" src="${t}" background-color="${p(e.backgroundColor)}" icon-size="${p(e.size)}" border-radius="${n(e.iconType)}"></mj-social-element>`;
|
|
63
63
|
}).join("")}</mj-social>`;
|
|
64
64
|
}
|
|
65
|
-
if (
|
|
66
|
-
if (
|
|
67
|
-
let
|
|
68
|
-
let o = a ? "th" : "td", s = a ? n.headerBgColor || "#f8fafc" :
|
|
69
|
-
return `<tr>${
|
|
70
|
-
}, a = +!!
|
|
71
|
-
return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${
|
|
65
|
+
if (t.type === "menu") return `<mj-navbar hamburger="hamburger">${n(t).map((e) => `<mj-navbar-link href="${p(e.href)}">${p(e.label)}</mj-navbar-link>`).join("")}</mj-navbar>`;
|
|
66
|
+
if (t.type === "table") {
|
|
67
|
+
let e = c(t), n = t.style || {}, r = `${n.borderWidth || "1px"} ${n.borderStyle || "solid"} ${n.borderColor || "#cbd5e1"}`, i = (t, i, a) => {
|
|
68
|
+
let o = a ? "th" : "td", s = a ? n.headerBgColor || "#f8fafc" : e.striped && i % 2 == 1 ? "#f8fafc" : n.contentBgColor || "#ffffff", c = a ? n.headerTextColor || "#1e293b" : n.contentTextColor || "#475569";
|
|
69
|
+
return `<tr>${t.map((e) => `<${o} style="padding: ${n.cellPadding || "8px"}; border: ${r}; background-color: ${s}; color: ${c};">${p(e) || " "}</${o}>`).join("")}</tr>`;
|
|
70
|
+
}, a = +!!e.enableHeader, o = e.enableFooter ? e.cells.length - 1 : e.cells.length;
|
|
71
|
+
return `<mj-table><table role="presentation" style="border-collapse: collapse; width: 100%;">${e.enableHeader && e.cells.length > 0 ? `<thead>${i(e.cells[0], 0, !0)}</thead>` : ""}<tbody>${e.cells.slice(a, Math.max(a, o)).map((e, t) => i(e, t, !1)).join("")}</tbody>${e.enableFooter && e.cells.length > a ? `<tfoot>${i(e.cells[e.cells.length - 1], e.cells.length - 1, !1)}</tfoot>` : ""}</table></mj-table>`;
|
|
72
72
|
}
|
|
73
|
-
if (
|
|
73
|
+
if (t.type === "video") {
|
|
74
74
|
let e = i(f.videoUrl), t = f.linkType === "email" ? `mailto:${f.href || ""}` : f.href || f.videoUrl || "#";
|
|
75
75
|
return `<mj-image src="${p(e.thumbnailUrl)}" href="${p(t)}" alt="${p(f.alt || "Video preview")}" />`;
|
|
76
76
|
}
|
|
77
|
-
if (
|
|
77
|
+
if (t.type === "timer") {
|
|
78
78
|
let e = o(f.targetDate), t = f.showLabels !== !1;
|
|
79
79
|
return `<mj-text align="center"><div style="font-size: 28px; font-weight: 800;">${e.days}d ${e.hours}h ${e.minutes}m ${e.seconds}s</div>${t ? `<div style="font-size: 12px; color: #64748b;">Countdown to ${p(f.targetDate || "")}</div>` : ""}</mj-text>`;
|
|
80
80
|
}
|
|
81
|
-
if (
|
|
81
|
+
if (t.type === "carousel") {
|
|
82
82
|
let e = Array.isArray(f.images) ? f.images : [];
|
|
83
83
|
return e.length === 0 ? "<mj-text align=\"center\">No images in carousel</mj-text>" : `<mj-carousel>${e.map((e) => `<mj-carousel-image src="${p(e.src)}" alt="${p(e.alt || "")}" />`).join("")}</mj-carousel>`;
|
|
84
84
|
}
|
|
85
|
-
if (
|
|
86
|
-
let
|
|
87
|
-
return `<mj-text align="center">${l(f.iconName,
|
|
85
|
+
if (t.type === "icon") {
|
|
86
|
+
let e = parseInt(String(f.iconSize || 48), 10) || 48, n = t.style?.color || "#1e293b";
|
|
87
|
+
return `<mj-text align="center">${l(f.iconName, e, n)}</mj-text>`;
|
|
88
88
|
}
|
|
89
89
|
let u = f.hideOnDesktop ? "desktop-hide" : "";
|
|
90
|
-
if (
|
|
91
|
-
let
|
|
90
|
+
if (t.type === "heading" || t.type === "paragraph" || t.type === "text") {
|
|
91
|
+
let e = t.type === "heading" ? {
|
|
92
92
|
fontSize: "24px",
|
|
93
93
|
fontWeight: "700"
|
|
94
|
-
} : { fontSize: "14px" }, n = y(
|
|
94
|
+
} : { fontSize: "14px" }, n = y(t.style || {}, e);
|
|
95
95
|
return `<mj-text${n ? ` ${n}` : ""} css-class="${u}">${f.text || ""}</mj-text>`;
|
|
96
96
|
}
|
|
97
|
-
if (
|
|
98
|
-
let
|
|
99
|
-
return `<mj-spacer height="${p(String(
|
|
97
|
+
if (t.type === "spacer") {
|
|
98
|
+
let e = t.style?.height || "24px";
|
|
99
|
+
return `<mj-spacer height="${p(String(e))}" />`;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
let
|
|
103
|
-
return `<mj-divider border-width="${p(String(
|
|
101
|
+
if (t.type === "divider") {
|
|
102
|
+
let e = t.style || {};
|
|
103
|
+
return `<mj-divider border-width="${p(String(e.borderWidth || "1px"))}" border-style="${p(String(e.borderStyle || "solid"))}" border-color="${p(String(e.borderColor || "#334155"))}" />`;
|
|
104
104
|
}
|
|
105
|
-
return
|
|
105
|
+
return t.type === "card" ? `<mj-text css-class="${u}"><strong style="display:block;margin-bottom:8px;">${p(f.title || "Card Title")}</strong><span style="font-size:14px;color:#64748b;">${p(f.description || "Card description.")}</span></mj-text>` : t.type === "html" ? `<mj-text css-class="${u}">${f.htmlContent || f.text || ""}</mj-text>` : `<mj-text${x}${C} css-class="${u}">${p(f.text || f.htmlContent || "")}</mj-text>`;
|
|
106
106
|
}
|
|
107
|
-
switch (
|
|
107
|
+
switch (t.type) {
|
|
108
108
|
case "heading": return `${T}<h2${x}${C} style="${b}">${p(f.text || "Heading")}</h2>`;
|
|
109
109
|
case "paragraph":
|
|
110
110
|
case "text": return `${T}<p${x}${C} style="${b}">${p(f.text || "")}</p>`;
|
|
111
111
|
case "button": return `${T}<a${x}${C} href="${p(f.href || "#")}" style="${b}">${p(f.text || "Button")}</a>`;
|
|
112
112
|
case "image": return `${T}<img${x}${C} src="${p(f.src || "")}" alt="${p(f.alt || "")}" style="${b}" />`;
|
|
113
113
|
case "html": return `${T}<div${x}${C} style="${b}">${String(f.htmlContent || "")}</div>`;
|
|
114
|
+
case "blog_title":
|
|
115
|
+
case "blog_content":
|
|
116
|
+
case "blog_featured_image":
|
|
117
|
+
case "blog_date":
|
|
118
|
+
case "blog_author":
|
|
119
|
+
case "blog_categories":
|
|
120
|
+
case "blog_comments":
|
|
121
|
+
case "blog_post_list": return `${T}<div${x}${C} data-plexo-blog-${t.type.replace(/^blog_/, "").replace(/_([a-z])/g, (e, t) => t.toUpperCase())}="true" style="${b}"></div>`;
|
|
114
122
|
default: return `${T}<div${x}${C} style="${b}">${p(f.text || "")}</div>`;
|
|
115
123
|
}
|
|
116
|
-
}, S = (
|
|
124
|
+
}, S = (e, n) => {
|
|
117
125
|
if (n === "email") {
|
|
118
|
-
let r = new Map(
|
|
126
|
+
let r = new Map(e.elements.map((e) => [e.id, e])), i = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), a = t(e).map((e) => {
|
|
119
127
|
let t = r.get(e);
|
|
120
128
|
if (t) return x(t, n);
|
|
121
129
|
let a = i.get(e);
|
|
122
130
|
return a ? `<mj-raw>${C(a, "landing_page")}</mj-raw>` : "";
|
|
123
|
-
}).join(""), o = b(
|
|
124
|
-
return `<mj-column width="${p(
|
|
131
|
+
}).join(""), o = b(e.styles || {});
|
|
132
|
+
return `<mj-column width="${p(e.width || "100%")}"${o}>${a}</mj-column>`;
|
|
125
133
|
}
|
|
126
|
-
let r = m(
|
|
134
|
+
let r = m(e.styles || {}), i = new Map(e.elements.map((e) => [e.id, e])), a = new Map((Array.isArray(e.nestedRows) ? e.nestedRows : []).map((e) => [e.id, e])), o = t(e).map((e) => {
|
|
127
135
|
let t = i.get(e);
|
|
128
136
|
if (t) return x(t, n);
|
|
129
137
|
let r = a.get(e);
|
|
130
138
|
return r ? C(r, n) : "";
|
|
131
139
|
}).join("");
|
|
132
|
-
return `<div style="width:${p(
|
|
140
|
+
return `<div style="width:${p(e.width || "100%")};${r}">${o}</div>`;
|
|
133
141
|
}, C = (e, t) => t === "email" ? `<mj-section css-class="${e.style?.hideOnDesktop ? "desktop-hide" : ""}"${b(e.style || {})}>${e.columns.map((e) => S(e, t)).join("")}</mj-section>` : `<section style="display:flex;flex-wrap:wrap;${m(e.style || {})}">${e.columns.map((e) => S(e, t)).join("")}</section>`, w = (e, t) => {
|
|
134
142
|
let n = (e.body?.rows || []).map((e) => C(e, t)).join(""), r = m(e.body?.style || {});
|
|
135
143
|
return t === "email" ? `<mjml><mj-head><mj-style>.desktop-hide { display:none !important; max-height:0; overflow:hidden; }</mj-style></mj-head><mj-body><mj-section><mj-column><mj-text css-class="preheader" padding="0" font-size="1px" color="#ffffff"> </mj-text></mj-column></mj-section>${n}</mj-body></mjml>`.replace(/<span[^>]*data-merge-val="([^"]*)"[^>]*>[\s\S]*?<\/span>/gi, "$1") : `<!doctype html><html><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /></head><body style="${r}"><main>${n}</main></body></html>`;
|
|
@@ -59,4 +59,12 @@ export declare const ICONS: {
|
|
|
59
59
|
accessibility: React.JSX.Element;
|
|
60
60
|
settings: React.JSX.Element;
|
|
61
61
|
strataTab: React.JSX.Element;
|
|
62
|
+
blogTitle: React.JSX.Element;
|
|
63
|
+
blogContent: React.JSX.Element;
|
|
64
|
+
blogFeaturedImage: React.JSX.Element;
|
|
65
|
+
blogDate: React.JSX.Element;
|
|
66
|
+
blogAuthor: React.JSX.Element;
|
|
67
|
+
blogCategories: React.JSX.Element;
|
|
68
|
+
blogComments: React.JSX.Element;
|
|
69
|
+
blogPostList: React.JSX.Element;
|
|
62
70
|
};
|
|
@@ -5,6 +5,8 @@ interface ContentTabProps {
|
|
|
5
5
|
ICONS: Record<string, React.ReactNode>;
|
|
6
6
|
tierFeatures?: SdkTierFeatures;
|
|
7
7
|
templateKind?: "landing_page" | "email" | string;
|
|
8
|
+
/** Shows the "Blog" block group below the regular palette — see PlexoBuilderProps.isBlogLayout. */
|
|
9
|
+
isBlogLayout?: boolean;
|
|
8
10
|
onTapAdd?: (data: any) => void;
|
|
9
11
|
}
|
|
10
12
|
export declare const ContentTab: React.FC<ContentTabProps>;
|