@charisol/plexo-sdk 1.4.36 → 1.4.38

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.
@@ -1,4 +1,4 @@
1
- import { a as e, s as t } from "./sanitizeCompiledHtml-D3k1f2jT.js";
1
+ import { a as e, s as t } from "./sanitizeCompiledHtml-CNjUXlMK.js";
2
2
  //#endregion
3
3
  //#region src/utilities/mjmlBrowser.ts
4
4
  var n = /* @__PURE__ */ t((/* @__PURE__ */ e(((e, t) => {
package/dist/sanitize.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as e, r as t, t as n } from "./sanitizeCompiledHtml-D3k1f2jT.js";
1
+ import { n as e, r as t, t as n } from "./sanitizeCompiledHtml-CNjUXlMK.js";
2
2
  export { n as ALLOWED_ATTR, e as ALLOWED_TAGS, t as sanitizeCompiledHtml };
@@ -5021,8 +5021,20 @@ var bn, xn = o((() => {
5021
5021
  };
5022
5022
  };
5023
5023
  };
5024
- })), rr = /* @__PURE__ */ u(nr(), 1);
5025
- function ir(e) {
5024
+ })), rr = /* @__PURE__ */ u(nr(), 1), ir = [
5025
+ "javascript:",
5026
+ "vbscript:",
5027
+ "data:"
5028
+ ];
5029
+ function ar(e) {
5030
+ let t = /url\(\s*(['"]?)([^'")]*)\1\s*\)/gi, n;
5031
+ for (; (n = t.exec(e)) !== null;) {
5032
+ let e = n[2].trim().toLowerCase();
5033
+ if (ir.some((t) => e.startsWith(t))) return !0;
5034
+ }
5035
+ return !1;
5036
+ }
5037
+ function or(e) {
5026
5038
  let t = e.split(";"), n = [], r = /* @__PURE__ */ new Set([
5027
5039
  "position",
5028
5040
  "z-index",
@@ -5040,19 +5052,15 @@ function ir(e) {
5040
5052
  let i = e.slice(0, t).trim().toLowerCase(), a = e.slice(t + 1).trim();
5041
5053
  if (r.has(i)) continue;
5042
5054
  let o = a.toLowerCase();
5043
- o.includes("javascript:") || o.includes("vbscript:") || o.includes("expression") || o.includes("url(") || o.includes("@import") || o.includes("-moz-binding") || o.includes("behavior") || /\\/g.test(a) || i.includes("margin") && a.includes("-") || n.push(`${i}: ${a}`);
5055
+ o.includes("javascript:") || o.includes("vbscript:") || o.includes("expression") || ar(a) || o.includes("@import") || o.includes("-moz-binding") || o.includes("behavior") || /\\/g.test(a) || i.includes("margin") && a.includes("-") || n.push(`${i}: ${a}`);
5044
5056
  }
5045
5057
  return n.join("; ");
5046
5058
  }
5047
- var ar = /* @__PURE__ */ "html.head.body.title.meta.style.link.div.span.p.h1.h2.h3.h4.h5.h6.a.img.button.svg.path.table.thead.tbody.tr.th.td.hr.br.ul.ol.li.section.article.main.header.footer.aside.g.circle.rect.line.polyline.polygon.ellipse.defs.lineargradient.radialgradient.stop.clippath.use.text.tspan.form.input.textarea.select.option.label.script.opt-in-embed-form".split("."), or = /* @__PURE__ */ "href.src.alt.class.id.style.title.target.rel.width.height.align.valign.cellpadding.cellspacing.border.viewbox.fill.stroke.d.xmlns.charset.name.content.lang.action.method.type.placeholder.required.value.page-id.property.cx.cy.r.rx.ry.x1.y1.x2.y2.points.transform.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.opacity.stop-color.stop-opacity.offset.clip-path.gradientunits.preserveaspectratio.text-anchor.dominant-baseline.font-size.letter-spacing.data-*".split("."), sr = [
5048
- "javascript:",
5049
- "vbscript:",
5050
- "data:"
5051
- ];
5052
- function cr(e) {
5059
+ var sr = /* @__PURE__ */ "html.head.body.title.meta.style.link.div.span.p.h1.h2.h3.h4.h5.h6.a.img.button.svg.path.table.thead.tbody.tr.th.td.hr.br.ul.ol.li.section.article.main.header.footer.aside.g.circle.rect.line.polyline.polygon.ellipse.defs.lineargradient.radialgradient.stop.clippath.use.text.tspan.form.input.textarea.select.option.label.script.opt-in-embed-form".split("."), cr = /* @__PURE__ */ "href.src.alt.class.id.style.title.target.rel.width.height.align.valign.cellpadding.cellspacing.border.viewbox.fill.stroke.d.xmlns.charset.name.content.lang.action.method.type.placeholder.required.value.page-id.property.cx.cy.r.rx.ry.x1.y1.x2.y2.points.transform.stroke-width.stroke-linecap.stroke-linejoin.stroke-dasharray.opacity.stop-color.stop-opacity.offset.clip-path.gradientunits.preserveaspectratio.text-anchor.dominant-baseline.font-size.letter-spacing.data-*.tabindex.autocomplete".split(".");
5060
+ function lr(e) {
5053
5061
  let t = /^\s*<!doctype\s+html\s*>/i.test(e), n = (0, rr.default)(e, {
5054
- allowedTags: ar,
5055
- allowedAttributes: { "*": or },
5062
+ allowedTags: sr,
5063
+ allowedAttributes: { "*": cr },
5056
5064
  allowVulnerableTags: !0,
5057
5065
  exclusiveFilter: (e) => e.tag === "script" && (e.attribs.src !== "https://static.maildrip.io/web-components/build/web-components.esm.js" || !!e.text?.trim()),
5058
5066
  transformTags: { "*": (e, t) => {
@@ -5069,11 +5077,11 @@ function cr(e) {
5069
5077
  let t = n[e];
5070
5078
  if (typeof t == "string") {
5071
5079
  let r = t.trim().toLowerCase();
5072
- sr.some((e) => r.startsWith(e)) && delete n[e];
5080
+ ir.some((e) => r.startsWith(e)) && delete n[e];
5073
5081
  }
5074
5082
  }
5075
5083
  if (typeof n.style == "string") {
5076
- let e = ir(n.style);
5084
+ let e = or(n.style);
5077
5085
  e ? n.style = e : delete n.style;
5078
5086
  }
5079
5087
  return {
@@ -5085,4 +5093,4 @@ function cr(e) {
5085
5093
  return t ? `<!DOCTYPE html>\n${n}` : n;
5086
5094
  }
5087
5095
  //#endregion
5088
- export { s as a, nr as i, ar as n, c as o, cr as r, u as s, or as t };
5096
+ export { s as a, nr as i, sr as n, c as o, lr as r, u as s, cr as t };
@@ -60,6 +60,7 @@ export declare const getFormDefaultStyle: () => {
60
60
  buttonFontSize: string;
61
61
  buttonFontWeight: string;
62
62
  };
63
+ export declare const FORM_HONEYPOT_FIELD_NAME = "_hp_field";
63
64
  export declare const FORM_NON_CSS_STYLE_KEYS: string[];
64
65
  export declare const compileToHTML: (rawTemplate: TemplateJSON | any, opts?: {
65
66
  canvasEditorPadding?: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@charisol/plexo-sdk",
3
3
  "private": false,
4
- "version": "1.4.36",
4
+ "version": "1.4.38",
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",