@charisol/plexo-sdk 1.0.30 → 1.0.32
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-Bn4rYU81.js → compiler-0uSlsR6R.js} +14 -5
- package/dist/compiler.js +1 -1
- package/dist/index.js +11600 -11597
- package/dist/plexo-sdk.css +1 -1
- package/dist/utilities/playground.interfaces.d.ts +11 -0
- package/package.json +1 -1
|
@@ -931,7 +931,9 @@ var p = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
931
931
|
"buttonPaddingLeft",
|
|
932
932
|
"buttonPaddingRight",
|
|
933
933
|
"buttonFontSize",
|
|
934
|
-
"buttonFontWeight"
|
|
934
|
+
"buttonFontWeight",
|
|
935
|
+
"buttonWidth",
|
|
936
|
+
"buttonAlign"
|
|
935
937
|
], v = (e) => {
|
|
936
938
|
if (!e || typeof e != "object") return "";
|
|
937
939
|
let t = e.kind || "text", n = h(e.name || e.label || "field"), r = e.required ? " required" : "", i = p({
|
|
@@ -956,7 +958,13 @@ var p = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
956
958
|
case "heading": return `<h2 style="margin-top: 0; margin-bottom: 8px; ${n}">${r.text || "Heading"}</h2>`;
|
|
957
959
|
case "paragraph": return `<p style="margin-top: 0; margin-bottom: 12px; ${n}">${r.text || "Paragraph text content."}</p>`;
|
|
958
960
|
case "text": return `<div style="${n}">${r.text || ""}</div>`;
|
|
959
|
-
case "button":
|
|
961
|
+
case "button": {
|
|
962
|
+
let e = r.autoWidth === !1 ? t.width || "100%" : "auto", n = p({
|
|
963
|
+
...t,
|
|
964
|
+
width: e
|
|
965
|
+
});
|
|
966
|
+
return `<div style="text-align: ${t.textAlign || "center"};"><a href="${r.href || "#"}" target="${r.openInNewTab ? "_blank" : "_self"}" style="display: inline-block; text-decoration: none; ${n}">${r.text || "Button"}</a></div>`;
|
|
967
|
+
}
|
|
960
968
|
case "image": {
|
|
961
969
|
let e = t.textAlign === "center" ? "margin: 0 auto; display: block;" : t.textAlign === "right" ? "margin-left: auto; display: block;" : "display: inline-block;";
|
|
962
970
|
return `<img src="${r.src || "https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe"}" alt="${r.alt || ""}" style="${n} ${e}" />`;
|
|
@@ -973,7 +981,7 @@ var p = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
973
981
|
...t
|
|
974
982
|
}, n = {};
|
|
975
983
|
for (let t of Object.keys(e)) _.includes(t) || (n[t] = e[t]);
|
|
976
|
-
let i = p(n), a = Array.isArray(r.fields) ? r.fields : [], o = e.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${v(e)}</div>`).join(""), c = p({
|
|
984
|
+
let i = p(n), a = Array.isArray(r.fields) ? r.fields : [], o = e.fieldSpacing || "12px", s = a.map((e) => `<div style="margin-bottom: ${o};">${v(e)}</div>`).join(""), c = r.buttonAutoWidth === !1 ? e.buttonWidth || "100%" : "auto", l = e.buttonAlign === "left" ? "flex-start" : e.buttonAlign === "right" ? "flex-end" : "center", u = p({
|
|
977
985
|
backgroundColor: e.buttonBackgroundColor,
|
|
978
986
|
color: e.buttonTextColor,
|
|
979
987
|
borderRadius: e.buttonBorderRadius,
|
|
@@ -982,9 +990,10 @@ var p = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
|
|
|
982
990
|
paddingLeft: e.buttonPaddingLeft,
|
|
983
991
|
paddingRight: e.buttonPaddingRight,
|
|
984
992
|
fontSize: e.buttonFontSize,
|
|
985
|
-
fontWeight: e.buttonFontWeight
|
|
993
|
+
fontWeight: e.buttonFontWeight,
|
|
994
|
+
width: c
|
|
986
995
|
});
|
|
987
|
-
return `<form action="${h(r.actionUrl || r.action || "#")}" method="${h(r.method || "POST")}" style="${i}">${s}<button type="submit" style="border: 0; cursor: pointer; ${
|
|
996
|
+
return `<form action="${h(r.actionUrl || r.action || "#")}" method="${h(r.method || "POST")}" style="${i}">${s}<div style="display: flex; width: 100%; justify-content: ${l};"><button type="submit" style="border: 0; cursor: pointer; ${u}">${r.submitLabel || "Submit"}</button></div></form>`;
|
|
988
997
|
}
|
|
989
998
|
case "input": {
|
|
990
999
|
let e = r.inputType || r.type || "text", t = h(r.name || r.fieldName || "field"), i = h(r.placeholder || ""), a = r.required ? " required" : "";
|
package/dist/compiler.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, t as a } from "./compiler-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./compiler-0uSlsR6R.js";
|
|
2
2
|
export { a as DEFAULT_BODY_FONT_FAMILY, n as compileToHTML, i as compileToHTMLWithStrataAuto, t as compileToPlainText, e as convertSectionRowToPlexoRow, r as injectStrataBundle };
|