@charisol/plexo-sdk 1.0.30 → 1.0.31

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.
@@ -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": 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>`;
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; ${c}">${r.submitLabel || "Submit"}</button></form>`;
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-Bn4rYU81.js";
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 };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { c as e, d as t, f as n, g as r, h as i, i as a, l as o, m as s, n as c, o as l, r as u, s as d, u as f } from "./compiler-Bn4rYU81.js";
1
+ import { c as e, d as t, f as n, g as r, h as i, i as a, l as o, m as s, n as c, o as l, r as u, s as d, u as f } from "./compiler-0uSlsR6R.js";
2
2
  import { parseJsonToTargetFormat as p } from "./compilerClient.js";
3
3
  import m, { createContext as h, createElement as g, forwardRef as _, useCallback as v, useContext as y, useEffect as b, useImperativeHandle as x, useMemo as ee, useRef as S, useState as C } from "react";
4
4
  import { DndContext as w, DragOverlay as T, PointerSensor as te, TouchSensor as ne, useDraggable as re, useDroppable as ie, useSensor as ae, useSensors as oe } from "@dnd-kit/core";
@@ -45174,13 +45174,13 @@ var aP = (e) => {
45174
45174
  children: "Auto On"
45175
45175
  }), /* @__PURE__ */ D("button", {
45176
45176
  type: "button",
45177
- onClick: () => o("autoWidth", !n.autoWidth),
45178
- className: `plexo-switch-track plexo-switch-track-sm ${n.autoWidth ? "plexo-switch-track-on" : "plexo-switch-track-off"}`,
45179
- children: /* @__PURE__ */ D("span", { className: `plexo-switch-thumb plexo-switch-thumb-sm ${n.autoWidth ? "plexo-switch-thumb-on-sm" : "plexo-switch-thumb-off"}` })
45177
+ onClick: () => o("autoWidth", n.autoWidth === !1),
45178
+ className: `plexo-switch-track plexo-switch-track-sm ${n.autoWidth === !1 ? "plexo-switch-track-off" : "plexo-switch-track-on"}`,
45179
+ children: /* @__PURE__ */ D("span", { className: `plexo-switch-thumb plexo-switch-thumb-sm ${n.autoWidth === !1 ? "plexo-switch-thumb-off" : "plexo-switch-thumb-on-sm"}` })
45180
45180
  })]
45181
45181
  })]
45182
45182
  }),
45183
- !n.autoWidth && /* @__PURE__ */ D(p, {
45183
+ n.autoWidth === !1 && /* @__PURE__ */ D(p, {
45184
45184
  label: "Custom Width",
45185
45185
  value: r.width || "100%",
45186
45186
  units: [
@@ -45906,13 +45906,13 @@ var aP = (e) => {
45906
45906
  children: "Auto On"
45907
45907
  }), /* @__PURE__ */ D("button", {
45908
45908
  type: "button",
45909
- onClick: () => s("buttonAutoWidth", !r.buttonAutoWidth),
45910
- className: `plexo-switch-track plexo-switch-track-sm ${r.buttonAutoWidth ? "plexo-switch-track-on" : "plexo-switch-track-off"}`,
45911
- children: /* @__PURE__ */ D("span", { className: `plexo-switch-thumb plexo-switch-thumb-sm ${r.buttonAutoWidth ? "plexo-switch-thumb-on-sm" : "plexo-switch-thumb-off"}` })
45909
+ onClick: () => s("buttonAutoWidth", r.buttonAutoWidth === !1),
45910
+ className: `plexo-switch-track plexo-switch-track-sm ${r.buttonAutoWidth === !1 ? "plexo-switch-track-off" : "plexo-switch-track-on"}`,
45911
+ children: /* @__PURE__ */ D("span", { className: `plexo-switch-thumb plexo-switch-thumb-sm ${r.buttonAutoWidth === !1 ? "plexo-switch-thumb-off" : "plexo-switch-thumb-on-sm"}` })
45912
45912
  })]
45913
45913
  })]
45914
45914
  }),
45915
- !r.buttonAutoWidth && /* @__PURE__ */ D(m, {
45915
+ r.buttonAutoWidth === !1 && /* @__PURE__ */ D(m, {
45916
45916
  label: "Button Width",
45917
45917
  value: i.buttonWidth || "100%",
45918
45918
  unit: "%",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.0.30",
4
+ "version": "1.0.31",
5
5
  "description": "Plexo visual email and landing page builder SDK — drag-and-drop template editor with AI integration.",
6
6
  "keywords": [
7
7
  "email-builder",