@templatical/editor 0.9.1 → 0.10.1

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.
Files changed (148) hide show
  1. package/dist/{AiChatSidebar-BUKj9n02.js → AiChatSidebar-Dz5bH1z3.js} +13 -13
  2. package/dist/{AiFeatureMenu-Co14YVJt.js → AiFeatureMenu-D2Xn0jFx.js} +7 -7
  3. package/dist/{BlockIssueBadge-DThKKeub.js → BlockIssueBadge-CnqD1cGo.js} +5 -5
  4. package/dist/{CloudEditor-DHB1FoQD.js → CloudEditor-BizZwsfD.js} +237 -233
  5. package/dist/{CollaboratorBar-Bc6q0gB9.js → CollaboratorBar-Bn2JDu6l.js} +4 -4
  6. package/dist/{CommentsSidebar-DiH4R4F0.js → CommentsSidebar-BAG6rdVC.js} +12 -12
  7. package/dist/{CountdownBlock-BTPefclD.js → CountdownBlock-B_Hr9Bm9.js} +3 -3
  8. package/dist/{CountdownToolbar-Dvr2icg-.js → CountdownToolbar-DaqDLKLk.js} +3 -3
  9. package/dist/{DesignReferenceSidebar-BP32MgpS.js → DesignReferenceSidebar-I9LWjvrj.js} +9 -9
  10. package/dist/{IssuesPanel-B1LT91IX.js → IssuesPanel-B32Ifp4x.js} +8 -8
  11. package/dist/{LoadingTrack-xCOLUR3o.js → LoadingTrack-UTqOUN4O.js} +1 -1
  12. package/dist/{ModuleBrowserModal-CWegFoOA.js → ModuleBrowserModal-DodRped1.js} +10 -10
  13. package/dist/{ModulePreviewCanvas-D9WUSSRT.js → ModulePreviewCanvas-DhcnddJF.js} +3 -3
  14. package/dist/{NumberWithSuffix-CxUBW_V2.js → NumberWithSuffix-DB7GyyCI.js} +3 -3
  15. package/dist/{ParagraphEditor-DrAz2yot.js → ParagraphEditor-pJA9BHAL.js} +26 -26
  16. package/dist/{RichTextEditorContent-gR169m1-.js → RichTextEditorContent-dTGSUff_.js} +6 -6
  17. package/dist/{SaveModuleDialog-DWidA0c9.js → SaveModuleDialog-D634e99d.js} +7 -7
  18. package/dist/{SnapshotHistory-CIo2Jaw-.js → SnapshotHistory-m_nGAHlb.js} +9 -9
  19. package/dist/{TemplateScoringPanel-seBvvn8O.js → TemplateScoringPanel-BOQh9neV.js} +14 -14
  20. package/dist/{TestEmailModal-BuCuWp3N.js → TestEmailModal-DOcwoKkc.js} +5 -5
  21. package/dist/{TitleEditor-BmW0uMl7.js → TitleEditor-t6JMWamY.js} +12 -12
  22. package/dist/{TplModal-YFpBaiLj.js → TplModal-BAtbfDB0.js} +4 -4
  23. package/dist/{blockTypeIcons-DCkHXPhx.js → blockTypeIcons-C4lXx3Au.js} +2 -2
  24. package/dist/bundle-stats.json +6 -6
  25. package/dist/cdn/chunks/{AiFeatureMenu-Dayzk2H7.js → AiFeatureMenu-BeOyHAoZ.js} +3 -3
  26. package/dist/cdn/chunks/{AiFeatureMenu-Dayzk2H7.js.map → AiFeatureMenu-BeOyHAoZ.js.map} +1 -1
  27. package/dist/cdn/chunks/{BlockIssueBadge-D_US2wqo.js → BlockIssueBadge-C6YilQdl.js} +5 -5
  28. package/dist/cdn/chunks/{BlockIssueBadge-D_US2wqo.js.map → BlockIssueBadge-C6YilQdl.js.map} +1 -1
  29. package/dist/cdn/chunks/{CloudEditor-CrZk-OwQ.js → CloudEditor-DEA37rdW.js} +178 -174
  30. package/dist/cdn/chunks/CloudEditor-DEA37rdW.js.map +1 -0
  31. package/dist/cdn/chunks/{CollaboratorBar-C4CFs5EJ.js → CollaboratorBar-CKW7jOW4.js} +4 -4
  32. package/dist/cdn/chunks/{CollaboratorBar-C4CFs5EJ.js.map → CollaboratorBar-CKW7jOW4.js.map} +1 -1
  33. package/dist/cdn/chunks/{CountdownBlock-D6lCXhZA.js → CountdownBlock-DU9ga9Ki.js} +3 -3
  34. package/dist/cdn/chunks/{CountdownBlock-D6lCXhZA.js.map → CountdownBlock-DU9ga9Ki.js.map} +1 -1
  35. package/dist/cdn/chunks/{CountdownToolbar-BsGUxoRv.js → CountdownToolbar-BHWsxth7.js} +4 -4
  36. package/dist/cdn/chunks/{CountdownToolbar-BsGUxoRv.js.map → CountdownToolbar-BHWsxth7.js.map} +1 -1
  37. package/dist/cdn/chunks/{IssuesPanel-DeHTmRDz.js → IssuesPanel-BkYhij39.js} +9 -9
  38. package/dist/cdn/chunks/{IssuesPanel-DeHTmRDz.js.map → IssuesPanel-BkYhij39.js.map} +1 -1
  39. package/dist/cdn/chunks/{ModuleBrowserModal-Cgjz4xAz.js → ModuleBrowserModal-D51w942J.js} +9 -9
  40. package/dist/cdn/chunks/{ModuleBrowserModal-Cgjz4xAz.js.map → ModuleBrowserModal-D51w942J.js.map} +1 -1
  41. package/dist/cdn/chunks/{ModulePreviewCanvas-CeS9PsAA.js → ModulePreviewCanvas-BqTqcKHS.js} +3 -3
  42. package/dist/cdn/chunks/{ModulePreviewCanvas-CeS9PsAA.js.map → ModulePreviewCanvas-BqTqcKHS.js.map} +1 -1
  43. package/dist/cdn/chunks/{NumberWithSuffix-Bp-idLCc.js → NumberWithSuffix-DuUcF2zG.js} +3 -3
  44. package/dist/cdn/chunks/{NumberWithSuffix-Bp-idLCc.js.map → NumberWithSuffix-DuUcF2zG.js.map} +1 -1
  45. package/dist/cdn/chunks/{ParagraphEditor-fM9aFu8T.js → ParagraphEditor-Bqjn3ZNm.js} +45 -45
  46. package/dist/cdn/chunks/{ParagraphEditor-fM9aFu8T.js.map → ParagraphEditor-Bqjn3ZNm.js.map} +1 -1
  47. package/dist/cdn/chunks/{RichTextEditorContent-DwNPE5H5.js → RichTextEditorContent-mIkkb5EK.js} +4 -4
  48. package/dist/cdn/chunks/{RichTextEditorContent-DwNPE5H5.js.map → RichTextEditorContent-mIkkb5EK.js.map} +1 -1
  49. package/dist/cdn/chunks/{SaveModuleDialog-BrtDXzIz.js → SaveModuleDialog-Felfmkcj.js} +5 -5
  50. package/dist/cdn/chunks/{SaveModuleDialog-BrtDXzIz.js.map → SaveModuleDialog-Felfmkcj.js.map} +1 -1
  51. package/dist/cdn/chunks/{TitleEditor-D0rSnye0.js → TitleEditor-Dcldr8D6.js} +12 -12
  52. package/dist/cdn/chunks/{TitleEditor-D0rSnye0.js.map → TitleEditor-Dcldr8D6.js.map} +1 -1
  53. package/dist/cdn/chunks/blockTypeIcons-D05Wqf5u.js +22 -0
  54. package/dist/cdn/chunks/{blockTypeIcons-YOEe5mDE.js.map → blockTypeIcons-D05Wqf5u.js.map} +1 -1
  55. package/dist/{de-CATfXDKV.js → cdn/chunks/de-DIAGP7yH.js} +2 -6
  56. package/dist/cdn/chunks/de-DIAGP7yH.js.map +1 -0
  57. package/dist/cdn/chunks/{draggable-BwWMFq33.js → draggable-J_1CPXYc.js} +1254 -1253
  58. package/dist/cdn/chunks/draggable-J_1CPXYc.js.map +1 -0
  59. package/dist/{en-CwCAgYL5.js → cdn/chunks/en-nqIW8Q9W.js} +2 -6
  60. package/dist/cdn/chunks/en-nqIW8Q9W.js.map +1 -0
  61. package/dist/cdn/chunks/{extensions-GYsbQFPr.js → extensions-CNmpC18A.js} +127 -124
  62. package/dist/cdn/chunks/{extensions-GYsbQFPr.js.map → extensions-CNmpC18A.js.map} +1 -1
  63. package/dist/cdn/chunks/{features-D-2kVhHY.js → features-_ar9QbVv.js} +1006 -979
  64. package/dist/cdn/chunks/features-_ar9QbVv.js.map +1 -0
  65. package/dist/cdn/chunks/{icons-fZoyKV_s.js → icons-CnwCLJX-.js} +19 -33
  66. package/dist/cdn/chunks/icons-CnwCLJX-.js.map +1 -0
  67. package/dist/cdn/chunks/{media-library-CO2WOETY.js → media-library-9jyt7Bf9.js} +83 -79
  68. package/dist/cdn/chunks/media-library-9jyt7Bf9.js.map +1 -0
  69. package/dist/{pt-BR-D3Mg7AKe.js → cdn/chunks/pt-BR-DCNnLLx9.js} +2 -6
  70. package/dist/cdn/chunks/pt-BR-DCNnLLx9.js.map +1 -0
  71. package/dist/cdn/chunks/{quality-BxPiS-wv.js → quality-CO9mj_RH.js} +494 -484
  72. package/dist/cdn/chunks/quality-CO9mj_RH.js.map +1 -0
  73. package/dist/cdn/chunks/{renderer-CfHPFI5v.js → renderer-m6XTCWCL.js} +135 -117
  74. package/dist/cdn/chunks/renderer-m6XTCWCL.js.map +1 -0
  75. package/dist/cdn/chunks/{src-ftxPuuQh.js → src-DfMSYqvE.js} +9 -9
  76. package/dist/cdn/chunks/{src-ftxPuuQh.js.map → src-DfMSYqvE.js.map} +1 -1
  77. package/dist/cdn/chunks/{styles-CVUvPdKD.js → styles-1uFWdD5T.js} +1045 -1074
  78. package/dist/cdn/chunks/styles-1uFWdD5T.js.map +1 -0
  79. package/dist/cdn/chunks/{tiptap-BBbH3IT9.js → tiptap-CJbIm_hE.js} +5 -5
  80. package/dist/cdn/chunks/{tiptap-BBbH3IT9.js.map → tiptap-CJbIm_hE.js.map} +1 -1
  81. package/dist/cdn/editor.css +1 -1
  82. package/dist/cdn/editor.js +109 -100
  83. package/dist/cdn/editor.js.map +1 -1
  84. package/dist/{check-ChQyfxJ3.js → check-Bs6_uQpm.js} +1 -1
  85. package/dist/{chevron-down-DJjo0jSV.js → chevron-down-so1rnGwF.js} +1 -1
  86. package/dist/{circle-alert-CPH6l3Lc.js → circle-alert-CrKv0AuW.js} +1 -1
  87. package/dist/{clock-DHl_BIkU.js → clock-Cpx6GYpa.js} +1 -1
  88. package/dist/{cloud-VxYMtfXC.js → cloud-bHhCNRZa.js} +80 -74
  89. package/dist/{createLucideIcon-XgXOJ05E.js → createLucideIcon-DFBxEm5K.js} +3 -3
  90. package/dist/{cdn/chunks/de-CATfXDKV.js → de-DIAGP7yH.js} +0 -8
  91. package/dist/{dist-C0jo8wtG.js → dist-0RguD1vS.js} +1 -1
  92. package/dist/{dist-CNLAS2v2.js → dist-2-A7SaKm.js} +3 -3
  93. package/dist/{dist-UK-lbEBc.js → dist-74n2Mqc6.js} +1 -1
  94. package/dist/{dist-BzuC8o3y.js → dist-B3CcePtK.js} +3 -3
  95. package/dist/{dist-D8C6jIXM.js → dist-BejBMbBX.js} +3 -3
  96. package/dist/{dist-CIV3Brg-.js → dist-BufRk8ZY.js} +4 -6
  97. package/dist/{dist-DILjuzSv.js → dist-Bvje_Tqb.js} +1 -1
  98. package/dist/{dist-BDgf2G-V.js → dist-BxHa6kIT.js} +3 -3
  99. package/dist/{dist-CUpJmrjt.js → dist-CIK3BYgh.js} +1 -1
  100. package/dist/{dist-C8wMh_gi.js → dist-CMkZaqX1.js} +1 -1
  101. package/dist/{dist-BxP6TB0l.js → dist-CoaWXQ7N.js} +1 -1
  102. package/dist/{dist-D5lmdi1F.js → dist-D1YvgM6p.js} +1 -1
  103. package/dist/{dist-DYO-w_Jf.js → dist-DJ5YJLXn.js} +1 -1
  104. package/dist/{dist-DXaxGLsw.js → dist-DwEpKyry.js} +1 -1
  105. package/dist/{cdn/chunks/en-CwCAgYL5.js → en-nqIW8Q9W.js} +0 -8
  106. package/dist/{extensions-Mj2-D8uK.js → extensions-C810eSzv.js} +107 -104
  107. package/dist/{image-up-CPBCOMit.js → image-up-kMLE5GsI.js} +1 -1
  108. package/dist/index.d.ts +8 -0
  109. package/dist/{info-DIY9mguM.js → info-xqRxLfNz.js} +1 -1
  110. package/dist/keys-BoYBr3PU.js +10 -0
  111. package/dist/{list-checks-CSCyu3fH.js → list-checks-C81htkBJ.js} +1 -1
  112. package/dist/{loader-circle-Rz_4vJLH.js → loader-circle-C6cZPIum.js} +1 -1
  113. package/dist/{message-circle-D-umK_MU.js → message-circle-dqOBRe07.js} +1 -1
  114. package/dist/{cdn/chunks/pt-BR-D3Mg7AKe.js → pt-BR-DCNnLLx9.js} +0 -8
  115. package/dist/{refresh-cw-CvWF4jfR.js → refresh-cw-DCjNd6o0.js} +1 -1
  116. package/dist/{scan-line-wanvAFDr.js → scan-line-DXz0nZVJ.js} +1 -1
  117. package/dist/{send-BhbhbIFT.js → send-C4uH_WaI.js} +1 -1
  118. package/dist/{shield-check-CXPPMWth.js → shield-check-B3U68ssA.js} +1 -1
  119. package/dist/{sparkles-CrUN0KWY.js → sparkles-CsDweGUy.js} +1 -1
  120. package/dist/style.css +1 -1
  121. package/dist/{styles-CxwIlb7Y.js → styles-CBlNpqL9.js} +1031 -1074
  122. package/dist/templatical-editor.js +116 -107
  123. package/dist/{text-align-end-Bkq8oBrD.js → text-align-start-BkKQePFp.js} +11 -11
  124. package/dist/{trash-2-BpY5BCLT.js → trash-2-BIOkaEz1.js} +1 -1
  125. package/dist/{triangle-alert-MwJBKR2e.js → triangle-alert-Bbgu6uUG.js} +1 -1
  126. package/dist/{useAliveFlag-BLyG8L4d.js → useAliveFlag-Bc99FWyR.js} +1 -1
  127. package/dist/{useCloudI18n-DKWJg6rJ.js → useCloudI18n-DiwsLi6z.js} +2 -2
  128. package/dist/{useEditorCore-CEkf_VWX.js → useEditorCore-7c1QpPlw.js} +717 -694
  129. package/dist/{useI18n-Besvmtxy.js → useI18n-DskZMfRJ.js} +2 -2
  130. package/dist/{useMergeTag-WNzaCpXR.js → useMergeTag-Co4xYwG6.js} +4 -4
  131. package/dist/usePopoverRoot-DYH_gX8o.js +8 -0
  132. package/dist/{vue.runtime.esm-bundler-BDSGA5hA.js → vue.runtime.esm-bundler-D0Hg03Ub.js} +1289 -1288
  133. package/dist/{x-rcnxRG8Y.js → x-DWU6NCuE.js} +1 -1
  134. package/package.json +10 -10
  135. package/dist/cdn/chunks/CloudEditor-CrZk-OwQ.js.map +0 -1
  136. package/dist/cdn/chunks/blockTypeIcons-YOEe5mDE.js +0 -22
  137. package/dist/cdn/chunks/de-CATfXDKV.js.map +0 -1
  138. package/dist/cdn/chunks/draggable-BwWMFq33.js.map +0 -1
  139. package/dist/cdn/chunks/en-CwCAgYL5.js.map +0 -1
  140. package/dist/cdn/chunks/features-D-2kVhHY.js.map +0 -1
  141. package/dist/cdn/chunks/icons-fZoyKV_s.js.map +0 -1
  142. package/dist/cdn/chunks/media-library-CO2WOETY.js.map +0 -1
  143. package/dist/cdn/chunks/pt-BR-D3Mg7AKe.js.map +0 -1
  144. package/dist/cdn/chunks/quality-BxPiS-wv.js.map +0 -1
  145. package/dist/cdn/chunks/renderer-CfHPFI5v.js.map +0 -1
  146. package/dist/cdn/chunks/styles-CVUvPdKD.js.map +0 -1
  147. package/dist/keys-BiQlvx51.js +0 -10
  148. package/dist/usePopoverRoot-CKt956u-.js +0 -8
@@ -1,17 +1,16 @@
1
1
  import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
2
- import { An as t, Dn as n, En as r, Fn as i, In as a, Ln as o, Mn as s, Nn as c, On as l, Pn as u, Rn as d, Tn as f, jn as p, kn as m } from "./features-D-2kVhHY.js";
2
+ import { An as t, Dn as n, En as r, Fn as i, In as a, Ln as o, Mn as s, Nn as c, On as l, Pn as u, Rn as d, jn as f, kn as p, zn as m } from "./features-_ar9QbVv.js";
3
3
  //#endregion
4
4
  //#region ../renderer/src/render-context.ts
5
5
  var h = `https://unpkg.com/@templatical/renderer@${{
6
6
  name: "@templatical/renderer",
7
7
  description: "Render Templatical email templates to MJML",
8
- version: "0.9.1",
8
+ version: "0.10.1",
9
9
  bugs: "https://github.com/templatical/sdk/issues",
10
10
  dependencies: { "@templatical/types": "workspace:*" },
11
11
  devDependencies: {
12
12
  "@resvg/resvg-js": "^2.6.2",
13
- mjml: "^5.2.2",
14
- tsup: "^8.5.1",
13
+ mjml: "^5.3.0",
15
14
  typescript: "^6.0.3",
16
15
  vitest: "^4.1.7"
17
16
  },
@@ -38,7 +37,7 @@ var h = `https://unpkg.com/@templatical/renderer@${{
38
37
  directory: "packages/renderer"
39
38
  },
40
39
  scripts: {
41
- build: "tsup && node scripts/rasterize-social.mjs",
40
+ build: "tsdown && node scripts/rasterize-social.mjs",
42
41
  test: "vitest run --config vitest.config.ts",
43
42
  typecheck: "tsc --noEmit"
44
43
  },
@@ -90,9 +89,9 @@ function S(e) {
90
89
  return e === "" ? "" : x(e).replace(/[;{}\r\n]/g, "");
91
90
  }
92
91
  function C(e) {
93
- return e === "" ? "" : ee(e, (e) => w(e, "data-merge-tag") ?? w(e, "data-logic-merge-tag"));
92
+ return e === "" ? "" : w(e, (e) => T(e, "data-merge-tag") ?? T(e, "data-logic-merge-tag"));
94
93
  }
95
- function ee(e, t) {
94
+ function w(e, t) {
96
95
  let n = "", r = 0;
97
96
  for (; r < e.length;) {
98
97
  let i = e.indexOf("<span", r);
@@ -124,41 +123,41 @@ function ee(e, t) {
124
123
  }
125
124
  return n;
126
125
  }
127
- function w(e, t) {
126
+ function T(e, t) {
128
127
  let n = RegExp(`(?:^|\\s)${t}="([^"<>]*)"`).exec(e);
129
128
  return n ? n[1] : null;
130
129
  }
131
130
  //#endregion
132
131
  //#region ../renderer/src/padding.ts
133
- function T(e) {
132
+ function E(e) {
134
133
  return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
135
134
  }
136
135
  //#endregion
137
136
  //#region ../renderer/src/utils.ts
138
- function E(e, t) {
137
+ function D(e, t) {
139
138
  return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
140
139
  }
141
140
  //#endregion
142
141
  //#region ../renderer/src/visibility.ts
143
- function D(e) {
142
+ function O(e) {
144
143
  let t = e.visibility;
145
- return t ? !t.desktop && !t.tablet && !t.mobile : !1;
144
+ return t ? !t.desktop && !t.mobile : !1;
146
145
  }
147
- function O(e) {
148
- let t = k(e);
146
+ function k(e) {
147
+ let t = A(e);
149
148
  return t === "" ? "" : ` css-class="${t}"`;
150
149
  }
151
- function k(e) {
150
+ function A(e) {
152
151
  let t = e.visibility;
153
152
  if (!t) return "";
154
153
  let n = [];
155
- return t.desktop || n.push("tpl-hide-desktop"), t.tablet || n.push("tpl-hide-tablet"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
154
+ return t.desktop || n.push("tpl-hide-desktop"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
156
155
  }
157
156
  //#endregion
158
157
  //#region ../renderer/src/renderers/title.ts
159
- function te(e, t) {
160
- if (D(e)) return "";
161
- let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = ne(C(e.content)), a = d[e.level] ?? d[2], o = x(e.color), s = e.textAlign, c = re(e.fontFamily, t), l = O(e), u = `h${d[e.level] ? e.level : 2}`;
158
+ function j(e, t) {
159
+ if (O(e)) return "";
160
+ let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = ee(C(e.content)), a = m[e.level] ?? m[2], o = x(e.color), s = e.textAlign, c = te(e.fontFamily, t), l = k(e), u = `h${m[e.level] ? e.level : 2}`;
162
161
  return `<mj-text
163
162
  font-size="${a}px"
164
163
  color="${o}"
@@ -167,28 +166,28 @@ function te(e, t) {
167
166
  padding="${n}"${r}${c}${l}
168
167
  ><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${u}></mj-text>`;
169
168
  }
170
- function ne(e) {
169
+ function ee(e) {
171
170
  let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
172
171
  return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
173
172
  }
174
- function re(e, t) {
173
+ function te(e, t) {
175
174
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
176
175
  }
177
176
  //#endregion
178
177
  //#region ../renderer/src/renderers/paragraph.ts
179
- function A(e, t) {
180
- if (D(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
181
- let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = C(e.content);
178
+ function ne(e, t) {
179
+ if (O(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
180
+ let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = C(e.content);
182
181
  return `<mj-text
183
182
  line-height="1.5"
184
- padding="${n}"${r}${O(e)}
183
+ padding="${n}"${r}${k(e)}
185
184
  >${i}</mj-text>`;
186
185
  }
187
186
  //#endregion
188
187
  //#region ../renderer/src/renderers/image.ts
189
- function j(e, t) {
190
- if (D(e) || e.src === "") return "";
191
- let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = O(e), o = "";
188
+ function M(e, t) {
189
+ if (O(e) || e.src === "") return "";
190
+ let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = k(e), o = "";
192
191
  e.linkUrl && (o = ` href="${x(e.linkUrl)}"`, e.linkOpenInNewTab && (o += " target=\"_blank\" rel=\"noopener\""));
193
192
  let s = x(e.src), c = e.decorative === !0;
194
193
  return `<mj-image
@@ -201,9 +200,9 @@ function j(e, t) {
201
200
  }
202
201
  //#endregion
203
202
  //#region ../renderer/src/renderers/button.ts
204
- function M(e, t) {
205
- if (D(e)) return "";
206
- let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = T(e.buttonPadding), a = e.url === "" ? "" : x(e.url), o = a === "" ? "" : ` href="${a}"`, s = x(e.backgroundColor), c = x(e.textColor), l = e.fontSize, u = e.borderRadius, d = b(e.text);
203
+ function N(e, t) {
204
+ if (O(e)) return "";
205
+ let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = E(e.buttonPadding), a = e.url === "" ? "" : x(e.url), o = a === "" ? "" : ` href="${a}"`, s = x(e.backgroundColor), c = x(e.textColor), l = e.fontSize, u = e.borderRadius, d = b(e.text);
207
206
  return `<mj-button${o}${e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : ""}
208
207
  background-color="${s}"
209
208
  color="${c}"
@@ -211,46 +210,48 @@ function M(e, t) {
211
210
  font-weight="bold"
212
211
  border-radius="${u}px"
213
212
  inner-padding="${i}"
214
- padding="${n}"${r}${N(e.fontFamily, t)}${O(e)}
213
+ padding="${n}"${r}${P(e.fontFamily, t)}${k(e)}
215
214
  >${d}</mj-button>`;
216
215
  }
217
- function N(e, t) {
216
+ function P(e, t) {
218
217
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
219
218
  }
220
219
  //#endregion
221
220
  //#region ../renderer/src/renderers/divider.ts
222
- function P(e, t) {
223
- if (D(e)) return "";
224
- let n = T(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
221
+ function F(e, t) {
222
+ if (O(e)) return "";
223
+ let n = E(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
225
224
  return `<mj-divider
226
225
  border-width="${e.thickness}px"
227
226
  border-style="${e.lineStyle}"
228
227
  border-color="${x(e.color)}"
229
228
  width="${i}"
230
- padding="${n}"${r}${O(e)}
229
+ padding="${n}"${r}${k(e)}
231
230
  />`;
232
231
  }
233
232
  //#endregion
234
233
  //#region ../renderer/src/renderers/spacer.ts
235
- function F(e, t) {
236
- return D(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${O(e)} />`;
234
+ function I(e, t) {
235
+ return O(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${k(e)} />`;
237
236
  }
238
237
  //#endregion
239
238
  //#region ../renderer/src/renderers/html.ts
240
- function I(e, t) {
241
- if (D(e) || !t.allowHtmlBlocks) return "";
239
+ function L(e, t) {
240
+ if (O(e) || !t.allowHtmlBlocks) return "";
242
241
  let n = e.content;
243
- return n === "" ? "" : `<mj-text${O(e)}>
242
+ if (n === "") return "";
243
+ let r = k(e);
244
+ return `<mj-text padding="${E(e.styles.padding)}"${D(e.styles.backgroundColor, "container")}${r}>
244
245
  ${n}
245
246
  </mj-text>`;
246
247
  }
247
248
  //#endregion
248
249
  //#region ../renderer/src/renderers/social.ts
249
- function L(e, t) {
250
- if (D(e)) return "";
250
+ function R(e, t) {
251
+ if (O(e)) return "";
251
252
  let n = e.icons;
252
253
  if (n.length === 0) return "";
253
- let r = T(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = O(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
254
+ let r = E(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = k(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
254
255
  switch (s) {
255
256
  case "small":
256
257
  u = 24;
@@ -292,78 +293,78 @@ ${n.map((e, n) => {
292
293
  }
293
294
  //#endregion
294
295
  //#region ../renderer/src/renderers/menu.ts
295
- function R(e, t) {
296
- if (D(e) || e.items.length === 0) return "";
297
- let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = V(e.fontFamily, t), o = e.textAlign;
296
+ function z(e, t) {
297
+ if (O(e) || e.items.length === 0) return "";
298
+ let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = H(e.fontFamily, t), o = e.textAlign;
298
299
  return `<mj-text
299
300
  font-size="${e.fontSize}px"
300
301
  color="${x(e.color)}"
301
302
  align="${o}"
302
303
  line-height="1.5"
303
304
  padding="${n}"${r}${a}${i}
304
- >${z(e)}</mj-text>`;
305
+ >${B(e)}</mj-text>`;
305
306
  }
306
- function z(e) {
307
+ function B(e) {
307
308
  let t = e.items, n = b(e.separator), r = S(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
308
- for (let e = 0; e < s; e++) o.push(B(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
309
+ for (let e = 0; e < s; e++) o.push(V(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
309
310
  return o.join("");
310
311
  }
311
- function B(e, t) {
312
+ function V(e, t) {
312
313
  let n = b(e.text), r = x(e.url), i = S(e.color ?? t), a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = [`color: ${i}`, "text-decoration: none"];
313
314
  return e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
314
315
  }
315
- function V(e, t) {
316
+ function H(e, t) {
316
317
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
317
318
  }
318
319
  //#endregion
319
320
  //#region ../renderer/src/renderers/table.ts
320
- function H(e, t) {
321
- if (D(e) || e.rows.length === 0) return "";
322
- let n = T(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = ie(e.fontFamily, t);
321
+ function U(e, t) {
322
+ if (O(e) || e.rows.length === 0) return "";
323
+ let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = q(e.fontFamily, t);
323
324
  return `<mj-text
324
325
  font-size="${e.fontSize}px"
325
326
  color="${x(e.color)}"
326
327
  align="${e.textAlign}"
327
328
  line-height="1.5"
328
329
  padding="${n}"${r}${a}${i}
329
- >${U(e)}</mj-text>`;
330
+ >${W(e)}</mj-text>`;
330
331
  }
331
- function U(e) {
332
+ function W(e) {
332
333
  let t = S(e.borderColor), n = e.borderWidth, r = "";
333
334
  for (let i = 0; i < e.rows.length; i++) {
334
335
  let a = e.rows[i];
335
- r += W(a, e, e.hasHeaderRow && i === 0, t, n);
336
+ r += G(a, e, e.hasHeaderRow && i === 0, t, n);
336
337
  }
337
338
  return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
338
339
  }
339
- function W(e, t, n, r, i) {
340
+ function G(e, t, n, r, i) {
340
341
  let a = "";
341
- for (let o of e.cells) a += G(o, t, n, r, i);
342
+ for (let o of e.cells) a += K(o, t, n, r, i);
342
343
  return `<tr>${a}</tr>`;
343
344
  }
344
- function G(e, t, n, r, i) {
345
+ function K(e, t, n, r, i) {
345
346
  let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
346
347
  n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${S(t.headerBackgroundColor)}`));
347
348
  let s = o.join("; "), c = C(e.content), l = n ? "th" : "td";
348
349
  return `<${l} style="${s}">${c}</${l}>`;
349
350
  }
350
- function ie(e, t) {
351
+ function q(e, t) {
351
352
  return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
352
353
  }
353
354
  //#endregion
354
355
  //#region ../renderer/src/renderers/custom.ts
355
- function K(e, t) {
356
- if (D(e)) return "";
356
+ function re(e, t) {
357
+ if (O(e)) return "";
357
358
  let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
358
359
  if (!n || n === "") return "";
359
- let r = O(e);
360
- return `<mj-text${E(e.styles?.backgroundColor, "container")}${r}>
360
+ let r = k(e);
361
+ return `<mj-text padding="${E(e.styles.padding)}"${D(e.styles.backgroundColor, "container")}${r}>
361
362
  ${n}
362
363
  </mj-text>`;
363
364
  }
364
365
  //#endregion
365
366
  //#region ../renderer/src/columns.ts
366
- function q(e) {
367
+ function J(e) {
367
368
  switch (e) {
368
369
  case "2": return ["50%", "50%"];
369
370
  case "3": return [
@@ -376,7 +377,7 @@ function q(e) {
376
377
  default: return ["100%"];
377
378
  }
378
379
  }
379
- function J(e, t) {
380
+ function Y(e, t) {
380
381
  switch (e) {
381
382
  case "2": return [t * .5, t * .5];
382
383
  case "3": return [
@@ -390,17 +391,26 @@ function J(e, t) {
390
391
  }
391
392
  }
392
393
  //#endregion
394
+ //#region ../renderer/src/display-condition.ts
395
+ function X(e, t) {
396
+ if (t === "") return "";
397
+ let n = e.displayCondition;
398
+ return n ? `<mj-raw>${n.before}</mj-raw>
399
+ ` + t + `
400
+ <mj-raw>${n.after}</mj-raw>` : t;
401
+ }
402
+ //#endregion
393
403
  //#region ../renderer/src/renderers/section.ts
394
- function Y(e, t, n) {
395
- if (D(e)) return "";
396
- let r = e.columns, i = q(r), a = J(r, t.containerWidth), o = T(e.styles.padding), c = E(e.styles.backgroundColor, "native"), l = O(e), u = e.children, d = [];
404
+ function ie(e, t, n) {
405
+ if (O(e)) return "";
406
+ let r = e.columns, i = J(r), a = Y(r, t.containerWidth), o = E(e.styles.padding), s = D(e.styles.backgroundColor, "native"), l = k(e), u = e.children, d = [];
397
407
  for (let e = 0; e < u.length; e++) {
398
- let r = u[e], o = i[e] ?? "100%", c = Math.floor(a[e] ?? t.containerWidth), l = ae(r, t.allowHtmlBlocks).filter((e) => !s(e)), f = t.withContainerWidth(c), p = l.map((e) => n(e, f)).filter((e) => e !== "").join("\n");
408
+ let r = u[e], o = i[e] ?? "100%", s = Math.floor(a[e] ?? t.containerWidth), l = ae(r, t.allowHtmlBlocks).filter((e) => !c(e)), f = t.withContainerWidth(s), p = l.map((e) => X(e, n(e, f))).filter((e) => e !== "").join("\n");
399
409
  d.push(`<mj-column width="${o}">
400
410
  ${p === "" ? "<mj-text>&nbsp;</mj-text>" : p}
401
411
  </mj-column>`);
402
412
  }
403
- return `<mj-section${c} padding="${o}"${l}>
413
+ return `<mj-section${s} padding="${o}"${l}>
404
414
  ${d.join("\n")}
405
415
  </mj-section>`;
406
416
  }
@@ -420,10 +430,10 @@ function oe(e, t) {
420
430
  return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
421
431
  }
422
432
  function se(e, t) {
423
- if (D(e)) return "";
433
+ if (O(e)) return "";
424
434
  let n = oe(e.url, e.thumbnailUrl);
425
435
  if (!n) return "";
426
- let r = T(e.styles.padding), i = E(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = O(e);
436
+ let r = E(e.styles.padding), i = D(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = k(e);
427
437
  return `<mj-image
428
438
  src="${x(n)}"
429
439
  alt="${x(e.alt)}"
@@ -437,8 +447,8 @@ function se(e, t) {
437
447
  }
438
448
  //#endregion
439
449
  //#region ../renderer/src/renderers/index.ts
440
- function X(e, d) {
441
- return s(e) ? Y(e, d, X) : a(e) ? te(e, d) : p(e) ? A(e, d) : m(e) ? j(e, d) : f(e) ? M(e, d) : n(e) ? P(e, d) : u(e) ? F(e, d) : l(e) ? I(e, d) : c(e) ? L(e, d) : t(e) ? R(e, d) : i(e) ? H(e, d) : o(e) ? se(e, d) : r(e) ? K(e, d) : "";
450
+ function Z(e, m) {
451
+ return c(e) ? ie(e, m, Z) : o(e) ? j(e, m) : s(e) ? ne(e, m) : t(e) ? M(e, m) : r(e) ? N(e, m) : l(e) ? F(e, m) : i(e) ? I(e, m) : p(e) ? L(e, m) : u(e) ? R(e, m) : f(e) ? z(e, m) : a(e) ? U(e, m) : d(e) ? se(e, m) : n(e) ? re(e, m) : "";
442
452
  }
443
453
  //#endregion
444
454
  //#region ../renderer/src/index.ts
@@ -448,73 +458,63 @@ var ce = /* @__PURE__ */ e({
448
458
  convertMergeTagsToValues: () => C,
449
459
  escapeAttr: () => x,
450
460
  escapeHtml: () => b,
451
- getCssClassAttr: () => O,
452
- getCssClasses: () => k,
453
- getWidthPercentages: () => q,
454
- getWidthPixels: () => J,
455
- isHiddenOnAll: () => D,
456
- renderBlock: () => X,
457
- renderToMjml: () => Z,
458
- toPaddingString: () => T
461
+ getCssClassAttr: () => k,
462
+ getCssClasses: () => A,
463
+ getWidthPercentages: () => J,
464
+ getWidthPixels: () => Y,
465
+ isHiddenOnAll: () => O,
466
+ renderBlock: () => Z,
467
+ renderToMjml: () => le,
468
+ toPaddingString: () => E
459
469
  });
460
- async function Z(e, t) {
461
- let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = de(t?.socialIconsBaseUrl ?? h), o = await he(e, t?.renderCustomBlock), s = new _(e.settings.width, n, r, i, o, a), c = me(e.blocks, i), l = s.resolveFontFamily(e.settings.fontFamily), u = e.settings.backgroundColor, d = c.map((e) => le(e, s)).filter((e) => e !== "").join("\n"), f = pe(n), p = fe(e.settings.preheaderText);
470
+ async function le(e, t) {
471
+ let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = fe(t?.socialIconsBaseUrl ?? h), o = await he(e, t?.renderCustomBlock), s = ge(e, t?.getCustomBlockStylesheet), c = new _(e.settings.width, n, r, i, o, a), l = Q(e.blocks, i), u = c.resolveFontFamily(e.settings.fontFamily), d = e.settings.backgroundColor, f = l.map((e) => ue(e, c)).filter((e) => e !== "").join("\n"), p = me(n), m = pe(e.settings.preheaderText);
462
472
  return `<mjml lang="${x(e.settings.locale)}">
463
- <mj-head>${p}
473
+ <mj-head>${m}
464
474
  <mj-attributes>
465
- <mj-all font-family="${l}" />
475
+ <mj-all font-family="${u}" />
466
476
  <mj-text font-size="14px" />
467
477
  <mj-section padding="0" />
468
478
  <mj-column padding="0" />
469
479
  <mj-image fluid-on-mobile="true" />
470
- </mj-attributes>${f}
480
+ </mj-attributes>${p}
471
481
  <mj-style>
472
482
  a { color: inherit; text-decoration: none; }
473
483
  @media only screen and (max-width: 480px) {
474
484
  .tpl-hide-mobile { display: none !important; mso-hide: all !important; }
475
485
  }
476
- @media only screen and (min-width: 481px) and (max-width: 768px) {
477
- .tpl-hide-tablet { display: none !important; mso-hide: all !important; }
478
- }
479
- @media only screen and (min-width: 769px) {
486
+ @media only screen and (min-width: 481px) {
480
487
  .tpl-hide-desktop { display: none !important; mso-hide: all !important; }
481
488
  }
482
- </mj-style>
489
+ </mj-style>${_e(s)}
483
490
  </mj-head>
484
- <mj-body width="${s.containerWidth}px" background-color="${u}">
485
- ${d}
491
+ <mj-body width="${c.containerWidth}px" background-color="${d}">
492
+ ${f}
486
493
  </mj-body>
487
494
  </mjml>`;
488
495
  }
489
- function le(e, t) {
490
- return s(e) ? Q(e, X(e, t)) : Q(e, ue(X(e, t)));
496
+ function ue(e, t) {
497
+ return c(e) ? X(e, Z(e, t)) : X(e, de(Z(e, t)));
491
498
  }
492
- function Q(e, t) {
493
- if (t === "") return "";
494
- let n = e.displayCondition;
495
- return n ? `<mj-raw>${n.before}</mj-raw>
496
- ` + t + `
497
- <mj-raw>${n.after}</mj-raw>` : t;
498
- }
499
- function ue(e) {
499
+ function de(e) {
500
500
  return e === "" ? "" : `<mj-section>
501
501
  <mj-column>
502
502
  ${e}
503
503
  </mj-column>
504
504
  </mj-section>`;
505
505
  }
506
- function de(e) {
506
+ function fe(e) {
507
507
  return e.endsWith("/") ? e.slice(0, -1) : e;
508
508
  }
509
- function fe(e) {
509
+ function pe(e) {
510
510
  if (!e) return "";
511
511
  let t = e.trim();
512
512
  return t === "" ? "" : `\n <mj-preview>${b(t)}</mj-preview>`;
513
513
  }
514
- function pe(e) {
514
+ function me(e) {
515
515
  return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${x(e.name)}" href="${x(e.url)}" />`).join("");
516
516
  }
517
- function me(e, t) {
517
+ function Q(e, t) {
518
518
  return t ? e : e.filter((e) => e.type !== "html");
519
519
  }
520
520
  async function he(e, t) {
@@ -527,15 +527,33 @@ async function he(e, t) {
527
527
  return n;
528
528
  }
529
529
  function $(e, t) {
530
- for (let n of e) {
531
- if (r(n)) {
532
- t.push(n);
530
+ for (let r of e) {
531
+ if (n(r)) {
532
+ t.push(r);
533
533
  continue;
534
534
  }
535
- if (s(n)) for (let e of n.children) $(e, t);
535
+ if (c(r)) for (let e of r.children) $(e, t);
536
536
  }
537
537
  }
538
+ function ge(e, t) {
539
+ if (!t) return [];
540
+ let n = [];
541
+ if ($(e.blocks, n), n.length === 0) return [];
542
+ let r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = [];
543
+ for (let e of n) {
544
+ if (r.has(e.customType)) continue;
545
+ r.add(e.customType);
546
+ let n = t(e.customType);
547
+ if (!n) continue;
548
+ let o = n.trim();
549
+ o === "" || i.has(o) || (i.add(o), a.push(o));
550
+ }
551
+ return a;
552
+ }
553
+ function _e(e) {
554
+ return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
555
+ }
538
556
  //#endregion
539
557
  export { ce as t };
540
558
 
541
- //# sourceMappingURL=renderer-CfHPFI5v.js.map
559
+ //# sourceMappingURL=renderer-m6XTCWCL.js.map