@charisol/plexo-sdk 1.0.13 → 1.0.15

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.js CHANGED
@@ -352,11 +352,20 @@ var t = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
352
352
  "htmlTitle"
353
353
  ]) s[e] === void 0 && (a[e] === void 0 ? n[e] !== void 0 && (s[e] = n[e]) : s[e] = a[e]);
354
354
  s.backgroundColor && !s.background ? s.background = s.backgroundColor : s.background && !s.backgroundColor && (s.backgroundColor = s.background), s.textColor && !s.color && (s.color = s.textColor);
355
- let c = t(s), l = typeof s.htmlTitle == "string" && s.htmlTitle.trim() ? s.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", u = i("id", s.htmlId), d = i("class", s.htmlClass), f = typeof s.customCss == "string" && s.customCss.trim() ? s.customCss.trim() : "", p = typeof s.customJs == "string" && s.customJs.trim() ? s.customJs.trim() : "", m = `<!DOCTYPE html>
355
+ let c = [
356
+ "htmlTitle",
357
+ "htmlId",
358
+ "htmlClass",
359
+ "customCss",
360
+ "customJs",
361
+ "textColor"
362
+ ], l = {};
363
+ for (let e of Object.keys(s)) c.includes(e) || (l[e] = s[e]);
364
+ let u = t(l), d = typeof s.htmlTitle == "string" && s.htmlTitle.trim() ? s.htmlTitle.trim() : typeof e?.name == "string" && e.name.trim() ? e.name.trim() : "Plexo Rendered Page", f = i("id", s.htmlId), p = i("class", s.htmlClass), m = typeof s.customCss == "string" && s.customCss.trim() ? s.customCss.trim() : "", h = typeof s.customJs == "string" && s.customJs.trim() ? s.customJs.trim() : "", g = `<!DOCTYPE html>
356
365
  <html>
357
366
  <head>
358
367
  <meta charset="utf-8">
359
- <title>${r(l)}</title>
368
+ <title>${r(d)}</title>
360
369
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
361
370
  <style>
362
371
  body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
@@ -375,15 +384,15 @@ var t = (e = {}) => !e || typeof e != "object" ? "" : Object.entries(e).filter((
375
384
  }
376
385
  }
377
386
  </style>
378
- ${f ? `<style>\n${f}\n </style>` : ""}
387
+ ${m ? `<style>\n${m}\n </style>` : ""}
379
388
  </head>
380
- <body${u}${d} style="${c}">
381
- <div style="max-width: 1200px; margin: 0 auto; width: 100%;">`, h = Array.isArray(a.rows) ? a.rows : Array.isArray(n.rows) ? n.rows : Array.isArray(e.rows) ? e.rows : [];
382
- for (let e of h) m += o(e);
383
- return m += `\n </div>
384
- ${p ? ` <script>\n${p}\n <\/script>` : ""}
389
+ <body${f}${p} style="${u}">
390
+ <div style="max-width: 1200px; margin: 0 auto; width: 100%;">`, _ = Array.isArray(a.rows) ? a.rows : Array.isArray(n.rows) ? n.rows : Array.isArray(e.rows) ? e.rows : [];
391
+ for (let e of _) g += o(e);
392
+ return g += `\n </div>
393
+ ${h ? ` <script>\n${h}\n <\/script>` : ""}
385
394
  </body>
386
- </html>`, m;
395
+ </html>`, g;
387
396
  };
388
397
  function c(e) {
389
398
  return s(e).replace(/<[^>]*>/g, " ").replace(/\s+/g, " ").trim();
@@ -13,7 +13,7 @@ var e = /* @__PURE__ */ new Set([
13
13
  }, a = (e, a) => {
14
14
  let o = i(e, a), s = n(e.style || {}), c = r(o.htmlClassNames, o.htmlClass, o.validationClass, o.validationClassName), l = t(o.name || o.fieldName || "field"), u = t(o.placeholder || ""), d = o.required ? " required" : "";
15
15
  if (a === "email") return `<mj-table><tr><td style="padding:10px 12px;border:1px solid #d1d5db;border-radius:6px;color:#64748b;${s}">${u || l}</td></tr></mj-table>`;
16
- let f = t(o.inputType || (e.type === "input" ? o.type || "text" : e.type)), p = o.htmlId ? ` id="${t(o.htmlId)}"` : "", m = c ? ` class="${t(c)}"` : "";
16
+ let f = t(o.inputType || o.type || (e.type === "input" ? o.kind || "text" : e.type)), p = o.htmlId ? ` id="${t(o.htmlId)}"` : "", m = c ? ` class="${t(c)}"` : "";
17
17
  return e.type === "textarea" ? `<textarea${p}${m} name="${l}" placeholder="${u}" style="${s}"${d}>${t(o.value || "")}</textarea>` : e.type === "select" ? `<select${p}${m} name="${l}" style="${s}"${d}>${(o.options || []).map((e) => `<option value="${t(e.value)}">${t(e.label)}</option>`).join("")}</select>` : `<input${p}${m} type="${f}" name="${l}" placeholder="${u}" value="${t(o.value || "")}" style="${s}"${d} />`;
18
18
  }, o = (e, o) => {
19
19
  let s = i(e, o), c = n(e.style || {}), l = r(s.htmlClassNames, s.htmlClass), u = s.htmlId ? ` id="${t(s.htmlId)}"` : "", d = l ? ` class="${t(l)}"` : "", f = t(s.actionUrl || s.action || "#"), p = t(s.method || "POST"), m = s.fields || [], h = t(s.submitLabel || "Submit");
package/dist/index.js CHANGED
@@ -827,6 +827,14 @@ var A = [
827
827
  label: "Email",
828
828
  value: "email"
829
829
  },
830
+ {
831
+ label: "Number",
832
+ value: "number"
833
+ },
834
+ {
835
+ label: "Date",
836
+ value: "date"
837
+ },
830
838
  {
831
839
  label: "Textarea",
832
840
  value: "textarea"
@@ -1370,6 +1378,31 @@ var A = [
1370
1378
  borderRadius: "12px",
1371
1379
  borderWidth: "1px",
1372
1380
  borderColor: "#e2e8f0"
1381
+ } : e === "number" ? {
1382
+ id: t,
1383
+ kind: e,
1384
+ name: "number",
1385
+ label: "Number",
1386
+ showLabel: !0,
1387
+ inheritStylesFromPrevious: !1,
1388
+ placeholder: "0",
1389
+ fontSize: "13px",
1390
+ labelFontWeight: "700",
1391
+ borderRadius: "12px",
1392
+ borderWidth: "1px",
1393
+ borderColor: "#e2e8f0"
1394
+ } : e === "date" ? {
1395
+ id: t,
1396
+ kind: e,
1397
+ name: "date",
1398
+ label: "Date",
1399
+ showLabel: !0,
1400
+ inheritStylesFromPrevious: !1,
1401
+ fontSize: "13px",
1402
+ labelFontWeight: "700",
1403
+ borderRadius: "12px",
1404
+ borderWidth: "1px",
1405
+ borderColor: "#e2e8f0"
1373
1406
  } : e === "textarea" ? {
1374
1407
  id: t,
1375
1408
  kind: e,
@@ -48159,7 +48192,11 @@ var oP = (e) => {
48159
48192
  }) : /* @__PURE__ */ E("span", { className: `flex h-3.5 w-3.5 items-center justify-center border border-slate-350 ${n.kind === "radio" ? "rounded-full" : "rounded-sm"}` }), e.label]
48160
48193
  }, e.value))
48161
48194
  }) : /* @__PURE__ */ E("input", {
48162
- type: n.kind === "email" ? "email" : "text",
48195
+ type: [
48196
+ "email",
48197
+ "number",
48198
+ "date"
48199
+ ].includes(n.kind) ? n.kind : "text",
48163
48200
  placeholder: n.placeholder || "Type here",
48164
48201
  className: `w-full border bg-white px-3.5 py-3 outline-none ${_ ? "" : "pointer-events-none"}`,
48165
48202
  style: {
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ColumnJSON, ElementJSON, RowJSON, TemplateJSON } from './types';
3
3
  export type StockProvider = 'all' | 'unsplash' | 'pexels' | 'pixabay';
4
- export type FormFieldKind = 'text' | 'email' | 'textarea' | 'select' | 'radio' | 'checkbox';
4
+ export type FormFieldKind = 'text' | 'email' | 'number' | 'date' | 'textarea' | 'select' | 'radio' | 'checkbox';
5
5
  export interface StockImageResult {
6
6
  id: string;
7
7
  src: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.0.13",
4
+ "version": "1.0.15",
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",