@templatical/editor 0.54.1 → 0.55.0

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 (172) hide show
  1. package/dist/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-D5QosKvB.js} +1 -1
  2. package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-D1W_lrI_.js} +1 -1
  3. package/dist/{AiRewriteMenu-arKoTjsQ.js → AiRewriteMenu-BwztoMov.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-BTieuBmH.js → BlockPreviewCanvas-C23A6FRm.js} +6 -6
  5. package/dist/{CloudPanels-Hxdp0doU.js → CloudPanels-Baoaj6Xf.js} +1 -1
  6. package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
  7. package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-nmFhWG1p.js} +1 -1
  8. package/dist/{LanguageMenu-BpxbIJEx.js → LanguageMenu-DcABUYop.js} +5 -5
  9. package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
  10. package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-JJeZbFkD.js} +1 -1
  11. package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
  12. package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
  13. package/dist/{ParagraphEditor-B38t4E2p.js → ParagraphEditor-VXYwGoz_.js} +8 -8
  14. package/dist/{RestoreVersionDialog-n7FSmWXB.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
  15. package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
  16. package/dist/{SaveBlockDialog-B94NpmDV.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-C1vSc8iM.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
  18. package/dist/{SavedBlocksPanels-DLDmIYeL.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-ngf2sFEs.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
  20. package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-C_LHLm5M.js} +4 -4
  21. package/dist/{TestEmailModal-CB_9I1bl.js → TestEmailModal-CLIRn7eL.js} +5 -5
  22. package/dist/{TestEmailPanel-BUq-dbXQ.js → TestEmailPanel-frdtjC8h.js} +1 -1
  23. package/dist/{TitleEditor-BLP41rwy.js → TitleEditor-D5kC56Jl.js} +4 -4
  24. package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-D904Yw_R.js} +747 -699
  25. package/dist/{TplModal-DFKqmJQz.js → TplModal-BBdotDf1.js} +1 -1
  26. package/dist/{VersionHistoryPanels-DPxj3mec.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
  27. package/dist/{WrapperBlock-BdVIuGMR.js → WrapperBlock-BAT3T0Cz.js} +3 -3
  28. package/dist/{blockTypeIcons-BUyPZ7Su.js → blockTypeIcons-CoRQV_hP.js} +1 -1
  29. package/dist/bundle-stats.json +6 -6
  30. package/dist/{cdn/chunks/ca-DOuIxWRv.js → ca-DIkMxYCN.js} +10 -3
  31. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
  32. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
  33. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-B9vm_L-8.js} +2 -2
  34. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
  35. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
  36. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
  38. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
  39. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js → CloudPanels-CQ0vNgsH.js} +2 -2
  40. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
  41. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
  42. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
  43. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-BoHeIjvw.js} +3 -3
  44. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
  45. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js → LanguageMenu-BnYN5N1h.js} +7 -7
  46. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
  47. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
  48. package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
  49. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-BELdMRni.js} +2 -2
  50. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
  51. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
  52. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
  53. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
  54. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
  55. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js → ParagraphEditor-Cal9hY3U.js} +9 -9
  56. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
  57. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
  58. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
  59. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
  60. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
  61. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js → SaveBlockDialog-C6N9RFls.js} +5 -5
  62. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
  64. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
  65. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
  66. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
  68. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
  69. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-CpoKZ8oV.js} +5 -5
  70. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
  71. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js → TestEmailModal-DI3z__Bd.js} +8 -8
  72. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
  73. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
  74. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
  75. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js → TitleEditor-C2syRLdZ.js} +4 -4
  76. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
  77. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-NEE8qxYh.js} +754 -706
  78. package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
  79. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js → TplModal-B1MgvtX8.js} +2 -2
  80. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js.map → TplModal-B1MgvtX8.js.map} +1 -1
  81. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
  82. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
  83. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js → WrapperBlock-DFY-7YSs.js} +4 -4
  84. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js.map → WrapperBlock-DFY-7YSs.js.map} +1 -1
  85. package/dist/{ca-DOuIxWRv.js → cdn/chunks/ca-DIkMxYCN.js} +12 -1
  86. package/dist/cdn/chunks/{ca-DOuIxWRv.js.map → ca-DIkMxYCN.js.map} +1 -1
  87. package/dist/cdn/chunks/{composables-Jc3uZuLs.js → composables-nyxwrM27.js} +619 -597
  88. package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
  89. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
  90. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js.map → createCloudRuntime-DJkDGKQ_.js.map} +1 -1
  91. package/dist/{de-DaOUfYBX.js → cdn/chunks/de-Cc6Ue0UD.js} +12 -1
  92. package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +1 -0
  93. package/dist/cdn/chunks/{en-C0pHHMiR.js → en-BX4FujAQ.js} +11 -2
  94. package/dist/cdn/chunks/en-BX4FujAQ.js.map +1 -0
  95. package/dist/{es-CxyEKr6n.js → cdn/chunks/es-Do5b-MKU.js} +12 -1
  96. package/dist/cdn/chunks/es-Do5b-MKU.js.map +1 -0
  97. package/dist/cdn/chunks/{extensions-DcMKZpzh.js → extensions-BcwkOjVq.js} +76 -70
  98. package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +1 -0
  99. package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-S1n2Ebzp.js} +12 -1
  100. package/dist/cdn/chunks/fr-S1n2Ebzp.js.map +1 -0
  101. package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +11 -2
  102. package/dist/cdn/chunks/ja-DLwcq4bA.js.map +1 -0
  103. package/dist/{nl-DkrB-VKZ.js → cdn/chunks/nl-0JSWaZpT.js} +12 -1
  104. package/dist/cdn/chunks/nl-0JSWaZpT.js.map +1 -0
  105. package/dist/{normalizeMergeTagMarkup-CUCo7B5X.js → cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js} +102 -90
  106. package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
  107. package/dist/{preRenderCustomBlocks-Bs3N9no-.js → cdn/chunks/preRenderCustomBlocks-Cj0XYwuh.js} +3 -1
  108. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.js.map → preRenderCustomBlocks-Cj0XYwuh.js.map} +1 -1
  109. package/dist/{pt-BR-CY5Ye7eP.js → cdn/chunks/pt-BR-D3VlIMDZ.js} +12 -1
  110. package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +1 -0
  111. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js → sanitizeHtml-GxJCxKcP.js} +3 -3
  112. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
  113. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-B5zrrV8-.js} +387 -386
  114. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
  115. package/dist/cdn/chunks/{src-A_cKeTM_.js → src-Diw9SLIe.js} +673 -554
  116. package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
  117. package/dist/cdn/chunks/src-UR3AQocX.js +683 -0
  118. package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
  119. package/dist/cdn/chunks/{src-BQUv2CYU.js → src-v47QHNmB.js} +808 -645
  120. package/dist/cdn/chunks/src-v47QHNmB.js.map +1 -0
  121. package/dist/cdn/chunks/useLocalizedDisplay-DekV8qar.js +33 -0
  122. package/dist/cdn/chunks/{useLocalizedDisplay-aGfnO90D.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
  123. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-Cbp3I7UN.js} +2 -2
  124. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
  125. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-1lrpNyR5.js} +4 -4
  126. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
  127. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-DZfmiv8V.js} +2 -2
  128. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
  129. package/dist/cdn/editor.css +1 -1
  130. package/dist/cdn/editor.js +285 -285
  131. package/dist/cdn/editor.js.map +1 -1
  132. package/dist/{composables-XjYKaKhY.js → composables-DPgNn9GZ.js} +963 -941
  133. package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
  134. package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
  135. package/dist/{dist-Cdkm20M6.js → dist-CBdk1Vcb.js} +978 -815
  136. package/dist/{en-C0pHHMiR.js → en-BX4FujAQ.js} +10 -1
  137. package/dist/{cdn/chunks/es-CxyEKr6n.js → es-Do5b-MKU.js} +10 -3
  138. package/dist/{extensions-BJ184osp.js → extensions-QFAARrjF.js} +336 -330
  139. package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-S1n2Ebzp.js} +10 -3
  140. package/dist/index.d.ts +14 -1
  141. package/dist/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +10 -1
  142. package/dist/{cdn/chunks/nl-DkrB-VKZ.js → nl-0JSWaZpT.js} +10 -3
  143. package/dist/{cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-BS0nRvhq.js} +97 -89
  144. package/dist/{cdn/chunks/preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-CiKvKd8V.js} +4 -6
  145. package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
  146. package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-USjTyALR.js} +5 -5
  147. package/dist/{socialIcons-TFiOkpoU.js → socialIcons-NvIg5ahU.js} +401 -400
  148. package/dist/style.css +1 -1
  149. package/dist/templatical-editor.js +190 -190
  150. package/dist/useLocalizedDisplay-LdjosX4w.js +31 -0
  151. package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-D8zgkXfb.js} +1 -1
  152. package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-k7Kr0nMd.js} +3 -3
  153. package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-Bzeg_gfH.js} +1 -1
  154. package/package.json +7 -7
  155. package/dist/cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js.map +0 -1
  156. package/dist/cdn/chunks/Toolbar-BlWVQRcA.js.map +0 -1
  157. package/dist/cdn/chunks/composables-Jc3uZuLs.js.map +0 -1
  158. package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
  159. package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
  160. package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
  161. package/dist/cdn/chunks/extensions-DcMKZpzh.js.map +0 -1
  162. package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
  163. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
  164. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
  165. package/dist/cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js.map +0 -1
  166. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
  167. package/dist/cdn/chunks/src-8bYYJPCt.js +0 -671
  168. package/dist/cdn/chunks/src-8bYYJPCt.js.map +0 -1
  169. package/dist/cdn/chunks/src-A_cKeTM_.js.map +0 -1
  170. package/dist/cdn/chunks/src-BQUv2CYU.js.map +0 -1
  171. package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js +0 -33
  172. package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
@@ -1,671 +0,0 @@
1
- import { A as e, Ct as t, Dt as n, Et as r, O as i, Ot as a, Q as o, Rt as s, Tt as c, Yt as l, _n as u, _t as d, b as f, bn as p, bt as m, ct as h, fn as g, gn as _, gt as v, hn as y, ht as b, k as ee, nn as te, ot as x, pt as S, rt as C, sn as ne, vn as w, vt as re, wt as ie, x as ae, xt as T, y as oe, yn as se, yt as ce } from "./src-BQUv2CYU.js";
2
- // ../renderer/src/render-context.ts
3
- var E = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
4
- name: "@templatical/renderer",
5
- description: "Render Templatical email templates to MJML",
6
- version: "0.54.1",
7
- bugs: "https://github.com/templatical/sdk/issues",
8
- dependencies: { "@templatical/types": "workspace:*" },
9
- devDependencies: {
10
- "@jsquash/oxipng": "^2.3.0",
11
- "@resvg/resvg-js": "^2.6.2",
12
- liquidjs: "^10.30.1",
13
- mjml: "^5.4.1",
14
- typescript: "^6.0.3",
15
- vitest: "^5.0.5"
16
- },
17
- exports: { ".": {
18
- types: "./dist/index.d.ts",
19
- import: "./dist/index.js"
20
- } },
21
- files: ["dist", "assets"],
22
- homepage: "https://templatical.com",
23
- keywords: [
24
- "email",
25
- "email-template",
26
- "html-email",
27
- "mjml",
28
- "renderer",
29
- "templatical"
30
- ],
31
- license: "MIT",
32
- module: "./dist/index.js",
33
- peerDependencies: { liquidjs: "^10.30.1" },
34
- peerDependenciesMeta: { liquidjs: { optional: !0 } },
35
- publishConfig: { access: "public" },
36
- repository: {
37
- type: "git",
38
- url: "git+https://github.com/templatical/sdk.git",
39
- directory: "packages/renderer"
40
- },
41
- scripts: {
42
- build: "tsdown && node scripts/rasterize-social.mjs",
43
- test: "vitest run --config vitest.config.ts",
44
- typecheck: "tsc --noEmit"
45
- },
46
- type: "module",
47
- types: "./dist/index.d.ts"
48
- }.version}/assets/social`, D = class e {
49
- containerWidth;
50
- customFonts;
51
- defaultFallbackFont;
52
- allowHtmlBlocks;
53
- customBlockHtml;
54
- socialIconsBaseUrl;
55
- blockRenderers;
56
- contentDirection;
57
- contentWidth;
58
- constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = E, o = {}, s = "ltr", c) {
59
- this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i, this.socialIconsBaseUrl = a, this.blockRenderers = o, this.contentDirection = s, this.contentWidth = c ?? e;
60
- }
61
- withContainerWidth(t, n = t) {
62
- return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml, this.socialIconsBaseUrl, this.blockRenderers, this.contentDirection, n);
63
- }
64
- resolveFontFamily(e) {
65
- return oe(e, {
66
- customFonts: this.customFonts,
67
- defaultFallback: this.defaultFallbackFont
68
- });
69
- }
70
- };
71
- // ../renderer/src/visibility.ts
72
- function O(e) {
73
- let t = e.visibility;
74
- return t ? !t.desktop && !t.mobile : !1;
75
- }
76
- function k(e, t = []) {
77
- let n = [le(e), ...t].filter((e) => e !== "").join(" ");
78
- return n === "" ? "" : ` css-class="${n}"`;
79
- }
80
- function le(e) {
81
- let t = e.visibility;
82
- if (!t) return "";
83
- let n = [];
84
- return t.desktop || n.push("tpl-hide-desktop"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
85
- }
86
- // ../renderer/src/unrenderable.ts
87
- var ue = "templatical:unrenderable-block";
88
- function de(e) {
89
- return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
90
- }
91
- function A(e) {
92
- return console.warn(`[Templatical] No renderer for block type "${e.type}" (id: ${e.id}). A placeholder comment was emitted in its place. Pass a \`blockRenderers\` entry for this type to render it.`), `<mj-raw><!-- ${ue} type="${de(e.type)}" id="${de(e.id)}" --></mj-raw>`;
93
- }
94
- // ../renderer/src/escape.ts
95
- var j = {
96
- "&": "&amp;",
97
- "<": "&lt;",
98
- ">": "&gt;",
99
- "\"": "&quot;",
100
- "'": "&#039;"
101
- }, M = /[&<>"']/g;
102
- function N(e) {
103
- return e === "" ? "" : e.replace(M, (e) => j[e] ?? e);
104
- }
105
- function P(e) {
106
- return e === "" ? "" : e.replace(M, (e) => j[e] ?? e);
107
- }
108
- function F(e) {
109
- return e === "" ? "" : P(e).replace(/[;{}\r\n]/g, "");
110
- }
111
- var fe = /[&<>"]/g;
112
- function I(e) {
113
- return e.replace(fe, (e) => j[e] ?? e);
114
- }
115
- // ../renderer/src/padding.ts
116
- function L(e) {
117
- return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
118
- }
119
- // ../renderer/src/utils.ts
120
- function R(e, t) {
121
- return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
122
- }
123
- function pe(e) {
124
- return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
125
- }
126
- function z(e, t) {
127
- let n = (e) => Math.trunc(e ?? 0), r = (e) => w(e) === null ? 0 : Math.trunc(e.width);
128
- return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
129
- }
130
- function B(e, t) {
131
- let n = Math.floor(t.contentWidth) - z(e.styles.padding, e.border);
132
- return e.width === "full" || e.width >= n ? " fluid-on-mobile=\"true\"" : "";
133
- }
134
- function V(e) {
135
- return Object.entries(se(e)).map(([e, t]) => ` ${e}="${F(t)}"`).join("");
136
- }
137
- function H(e) {
138
- let t = p(e);
139
- return t === null ? "" : ` border-radius="${t}"`;
140
- }
141
- function U(e) {
142
- let t = g(e);
143
- return t === null ? "" : ` background-url="${P(t.url)}" background-size="${t.size}" background-position="${t.position}" background-repeat="${t.repeat}"`;
144
- }
145
- // ../renderer/src/rich-text.ts
146
- var W = "tpl-rich-text";
147
- function G(e) {
148
- return `${W}-${e}`;
149
- }
150
- function me(e, t = "ltr") {
151
- let n = _, r = `.${W}`, i = [...new Set(e)].sort((e, t) => e - t).flatMap((e) => {
152
- let t = `.${G(e)}`;
153
- return [`${t} p { margin: 0 0 ${e}px; }`, `${t} p:last-child { margin-bottom: 0; }`];
154
- }), a = t === "rtl" ? "padding-right" : "padding-left";
155
- return [
156
- ...i,
157
- `${r} ul, ${r} ol { margin: ${n.listMarginY}px 0; ${a}: ${n.listPaddingLeft}px; }`,
158
- `${r} li { margin: ${n.listItemMarginY}px 0; }`
159
- ].join("\n ");
160
- }
161
- function K(e) {
162
- return e ?? _.paragraphGap;
163
- }
164
- function he(e) {
165
- let t = [_.paragraphGap], n = (e) => {
166
- if (e.type === "paragraph" && t.push(K(e.paragraphSpacing)), T(e)) for (let t of e.children) for (let e of t) n(e);
167
- else if (a(e)) for (let t of e.children) n(t);
168
- };
169
- for (let t of e) n(t);
170
- return t;
171
- }
172
- var ge = {
173
- apos: "'",
174
- quot: "\"",
175
- nbsp: "\xA0"
176
- }, _e = /&(?:#(\d+)|#x([0-9a-f]+)|(apos|quot|nbsp));/gi, ve = /[a-z]/i, q = /[ \t\n\f\r]/;
177
- function ye(e, t, n, r, i) {
178
- let a;
179
- if (i !== void 0) a = ge[i.toLowerCase()];
180
- else {
181
- let t = Number(n ?? `0x${r}`);
182
- if (!(t > 0 && t <= 1114111 && !(t >= 55296 && t <= 57343))) return e;
183
- a = String.fromCodePoint(t);
184
- }
185
- return a === "&" ? "&amp;" : a === "<" || a === ">" ? e : a === t ? t === "\"" ? "'" : "\"" : a;
186
- }
187
- function be(e) {
188
- let t = 1;
189
- for (; t < e.length && !q.test(e[t]) && e[t] !== "/";) t++;
190
- for (; t < e.length;) {
191
- for (; t < e.length && (q.test(e[t]) || e[t] === "/");) t++;
192
- let n = t;
193
- for (; t < e.length && !/[\s=/]/.test(e[t]);) t++;
194
- let r = e.slice(n, t).toLowerCase();
195
- if (r === "") {
196
- t++;
197
- continue;
198
- }
199
- for (; t < e.length && q.test(e[t]);) t++;
200
- if (e[t] !== "=") continue;
201
- for (t++; t < e.length && q.test(e[t]);) t++;
202
- let i = e[t];
203
- if (i === "\"" || i === "'") {
204
- let n = e.indexOf(i, t + 1);
205
- if (n === -1) return e;
206
- if (r === "style") {
207
- let r = e.slice(t + 1, n).replace(_e, (e, t, n, r) => ye(e, i, t, n, r));
208
- return `${e.slice(0, t + 1)}${r}${e.slice(n)}`;
209
- }
210
- t = n + 1;
211
- } else for (; t < e.length && !q.test(e[t]);) t++;
212
- }
213
- return e;
214
- }
215
- function J(e) {
216
- if (!e.includes("&")) return e;
217
- let t = "", n = 0, r = e.indexOf("<");
218
- for (; r !== -1;) {
219
- if (!ve.test(e.charAt(r + 1))) {
220
- r = e.indexOf("<", r + 1);
221
- continue;
222
- }
223
- let i = x(e, r + 1);
224
- if (i === -1) break;
225
- let a = e.slice(r, i), o = be(a);
226
- o !== a && (t += e.slice(n, r) + o, n = i), r = e.indexOf("<", i);
227
- }
228
- return t + e.slice(n);
229
- }
230
- // ../renderer/src/renderers/title.ts
231
- function xe(e, t) {
232
- if (O(e)) return "";
233
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = Se(J(f(C(e.content)))), a = y[e.level] ?? y[2], o = e.color ? `\n color="${P(e.color)}"` : "", s = e.textAlign, c = Ce(e.fontFamily, t), l = k(e, [W, G(K(void 0))]), d = `h${y[e.level] ? e.level : 2}`;
234
- return `<mj-text
235
- font-size="${a}px"${o}
236
- align="${s}"
237
- line-height="${u}"
238
- padding="${n}"${r}${c}${l}
239
- ><${d} style="margin:0;font-size:inherit;color:inherit;line-height:inherit;font-weight:700">${i}</${d}></mj-text>`;
240
- }
241
- function Se(e) {
242
- let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
243
- return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
244
- }
245
- function Ce(e, t) {
246
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
247
- }
248
- // ../renderer/src/renderers/paragraph.ts
249
- function we(e, t) {
250
- if (O(e) || ae(e.content)) return "";
251
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = J(f(C(e.content))), a = k(e, [W, G(K(e.paragraphSpacing))]);
252
- return `<mj-text
253
- line-height="1.5"${t.contentDirection === "rtl" ? "\n align=\"right\"" : ""}
254
- padding="${n}"${r}${a}
255
- >${i}</mj-text>`;
256
- }
257
- // ../renderer/src/renderers/image.ts
258
- function Te(e, t) {
259
- if (O(e) || e.src === "") return "";
260
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = pe(e.height), o = B(e, t), s = k(e), c = H(e.borderRadius), l = V(e.border), u = "";
261
- e.linkUrl && (u = ` href="${P(e.linkUrl)}"`, e.linkOpenInNewTab && (u += " target=\"_blank\" rel=\"noopener\""));
262
- let d = P(e.src), f = e.decorative === !0;
263
- return `<mj-image
264
- src="${d}"
265
- alt="${f ? "" : P(e.alt)}"
266
- width="${i}"${a}${o}
267
- align="${e.align}"
268
- padding="${n}"${r}${l}${c}${u}${s}${f ? " role=\"presentation\"" : ""}
269
- />`;
270
- }
271
- // ../renderer/src/renderers/button.ts
272
- var Y = "tpl-button-full";
273
- function Ee(e, t) {
274
- if (O(e)) return "";
275
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = L(e.buttonPadding), a = e.url === "" ? "" : P(e.url), o = a === "" ? "" : ` href="${a}"`, s = De(e.backgroundColor), c = P(e.textColor), l = e.fontSize, u = ke(e.borderRadius), d = N(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = Oe(e.fontFamily, t), m = Ae(e.width), h = k(e, e.width === "full" ? [Y] : []);
276
- return `<mj-button${o}${f}
277
- background-color="${s}"
278
- color="${c}"
279
- font-size="${l}px"
280
- font-weight="bold"
281
- border-radius="${u}"${V(e.border)}
282
- inner-padding="${i}"
283
- align="${e.align ?? "center"}"
284
- padding="${n}"${r}${p}${m}${h}
285
- >${d}</mj-button>`;
286
- }
287
- function De(e) {
288
- return e.trim() === "" ? "transparent" : P(e);
289
- }
290
- function Oe(e, t) {
291
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
292
- }
293
- function ke(e) {
294
- return typeof e == "number" ? `${e}px` : p(e) ?? "0px";
295
- }
296
- function Ae(e) {
297
- return e === void 0 ? "" : ` width="${e === "full" ? "100%" : `${e}px`}"`;
298
- }
299
- // ../renderer/src/renderers/divider.ts
300
- function je(e, t) {
301
- if (O(e)) return "";
302
- let n = L(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${P(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : typeof e.width == "number" ? `${e.width}px` : e.width;
303
- return `<mj-divider
304
- border-width="${e.thickness}px"
305
- border-style="${e.lineStyle}"
306
- border-color="${P(e.color)}"
307
- width="${i}"
308
- padding="${n}"${r}${k(e)}
309
- />`;
310
- }
311
- // ../renderer/src/renderers/spacer.ts
312
- function Me(e, t) {
313
- return O(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${P(e.styles.backgroundColor)}"` : ""}${k(e)} />`;
314
- }
315
- // ../renderer/src/renderers/html.ts
316
- function Ne(e, t) {
317
- if (O(e) || !t.allowHtmlBlocks) return "";
318
- let n = e.content;
319
- if (n === "") return "";
320
- let r = k(e);
321
- return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
322
- ${n}
323
- </mj-text>`;
324
- }
325
- // ../renderer/src/renderers/social.ts
326
- function Pe(e, t) {
327
- if (O(e)) return "";
328
- let n = e.icons;
329
- if (n.length === 0) return "";
330
- let r = L(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${P(e.styles.backgroundColor)}"` : "", a = k(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = te(c, e.iconTone), u = e.spacing, d;
331
- switch (s) {
332
- case "small":
333
- d = 24;
334
- break;
335
- case "large":
336
- d = 48;
337
- break;
338
- default: d = 32;
339
- }
340
- let f;
341
- switch (c) {
342
- case "circle":
343
- f = "50%";
344
- break;
345
- case "rounded":
346
- f = "8px";
347
- break;
348
- case "square":
349
- f = "0";
350
- break;
351
- default: f = "4px";
352
- }
353
- let p = n.length;
354
- return `<mj-social
355
- mode="horizontal"
356
- align="${o}"
357
- icon-padding="0"
358
- padding="${r}"${i}${a}
359
- >
360
- ${n.map((e, n) => {
361
- let r = e.platform, i = P(e.url), a = `${t.socialIconsBaseUrl}/${l}/${r}.png`, o = n === p - 1 ? 0 : u;
362
- return `<mj-social-element src="${a}" href="${i}" icon-size="${d}px" padding="0 ${o}px 0 0" border-radius="${f}" background-color="transparent"></mj-social-element>`;
363
- }).join("\n")}
364
- </mj-social>`;
365
- }
366
- // ../renderer/src/renderers/menu.ts
367
- function Fe(e, t) {
368
- if (O(e) || e.items.length === 0) return "";
369
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = k(e), a = Re(e.fontFamily, t), o = e.textAlign;
370
- return `<mj-text
371
- font-size="${e.fontSize}px"${e.color ? `\n color="${P(e.color)}"` : ""}
372
- align="${o}"
373
- line-height="1.5"
374
- padding="${n}"${r}${a}${i}
375
- >${Ie(e)}</mj-text>`;
376
- }
377
- function Ie(e) {
378
- let t = e.items, n = N(e.separator), r = F(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
379
- for (let e = 0; e < s; e++) o.push(Le(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
380
- return o.join("");
381
- }
382
- function Le(e, t) {
383
- let n = N(e.text), r = P(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
384
- return i && o.unshift(`color: ${F(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
385
- }
386
- function Re(e, t) {
387
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
388
- }
389
- // ../renderer/src/renderers/table.ts
390
- function ze(e, t) {
391
- if (O(e) || e.rows.length === 0) return "";
392
- let n = L(e.styles.padding), r = R(e.styles.backgroundColor, "container"), i = k(e), a = Ue(e.fontFamily, t);
393
- return `<mj-text
394
- font-size="${e.fontSize}px"${e.color ? `\n color="${P(e.color)}"` : ""}
395
- align="${e.textAlign}"
396
- line-height="1.5"
397
- padding="${n}"${r}${a}${i}
398
- >${Be(e)}</mj-text>`;
399
- }
400
- function Be(e) {
401
- let t = F(e.borderColor), n = e.borderWidth, r = "";
402
- for (let i = 0; i < e.rows.length; i++) {
403
- let a = e.rows[i];
404
- r += Ve(a, e, e.hasHeaderRow && i === 0, t, n);
405
- }
406
- return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
407
- }
408
- function Ve(e, t, n, r, i) {
409
- let a = "";
410
- for (let o of e.cells) a += He(o, t, n, r, i);
411
- return `<tr>${a}</tr>`;
412
- }
413
- function He(e, t, n, r, i) {
414
- let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
415
- n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${F(t.headerBackgroundColor)}`));
416
- let s = o.join("; "), c = N(C(e.content)), l = n ? "th" : "td";
417
- return `<${l} style="${s}">${c}</${l}>`;
418
- }
419
- function Ue(e, t) {
420
- return e ? ` font-family="${I(t.resolveFontFamily(e))}"` : "";
421
- }
422
- // ../renderer/src/renderers/custom.ts
423
- function We(e, t) {
424
- if (O(e)) return "";
425
- let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
426
- if (!n || n === "") return "";
427
- let r = k(e);
428
- return `<mj-text padding="${L(e.styles.padding)}"${R(e.styles.backgroundColor, "container")}${r}>
429
- ${n}
430
- </mj-text>`;
431
- }
432
- // ../renderer/src/columns.ts
433
- function Ge(e) {
434
- switch (e) {
435
- case "2": return ["50%", "50%"];
436
- case "3": return [
437
- "33.33%",
438
- "33.33%",
439
- "33.34%"
440
- ];
441
- case "1-2": return ["33.33%", "66.67%"];
442
- case "2-1": return ["66.67%", "33.33%"];
443
- default: return ["100%"];
444
- }
445
- }
446
- function Ke(e, t) {
447
- switch (e) {
448
- case "2": return [t * .5, t * .5];
449
- case "3": return [
450
- t / 3,
451
- t / 3,
452
- t / 3
453
- ];
454
- case "1-2": return [t / 3, t * 2 / 3];
455
- case "2-1": return [t * 2 / 3, t / 3];
456
- default: return [t];
457
- }
458
- }
459
- // ../renderer/src/hero-geometry.ts
460
- function qe(e, t, n) {
461
- let r = Math.max(1, Math.round(t)), i = e.aspectRatio === null ? null : Math.max(1, Math.round(r * e.aspectRatio)), a = Math.max(e.height === "image" ? i ?? r : e.height, Math.trunc(n.top) + Math.trunc(n.bottom));
462
- return {
463
- mode: "fixed-height",
464
- height: a,
465
- backgroundWidth: r,
466
- backgroundHeight: i ?? a
467
- };
468
- }
469
- // ../renderer/src/display-condition.ts
470
- function X(e, t) {
471
- if (t === "") return "";
472
- let n = e.displayCondition;
473
- return n ? `<mj-raw>${n.before}</mj-raw>
474
- ` + t + `
475
- <mj-raw>${n.after}</mj-raw>` : t;
476
- }
477
- // ../renderer/src/renderers/section.ts
478
- function Je(e, t, n) {
479
- if (O(e)) return "";
480
- let r = ne(e);
481
- if (r?.applied) return Ye(e, r, t, n);
482
- let i = e.columns, a = Ge(i), o = Ke(i, t.containerWidth), s = Math.floor(t.contentWidth) - z(e.styles.padding, e.border), c = a.map((e) => Math.floor(s * parseFloat(e) / 100)), l = L(e.styles.padding), u = R(e.styles.backgroundColor, "native"), d = U(e.backgroundImage), f = k(e), p = H(e.borderRadius), m = V(e.border), h = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "", g = e.children, _ = [];
483
- for (let e = 0; e < g.length; e++) {
484
- let r = g[e], i = a[e] ?? "100%", l = Math.floor(o[e] ?? t.containerWidth), u = Xe(r, t.allowHtmlBlocks).filter((e) => !T(e)), d = t.withContainerWidth(l, c[e] ?? s), f = u.map((e) => X(e, n(e, d))).filter((e) => e !== "").join("\n");
485
- _.push(`<mj-column width="${i}"${h}>
486
- ${f === "" ? "<mj-text>&nbsp;</mj-text>" : f}
487
- </mj-column>`);
488
- }
489
- let v = _.join("\n");
490
- return `<mj-section${u}${d} padding="${l}"${m}${p}${f}${h}>
491
- ${e.stackOnMobile === !1 && _.length > 1 ? `<mj-group${h}>
492
- ${v}
493
- </mj-group>` : v}
494
- </mj-section>`;
495
- }
496
- function Ye(e, t, n, r) {
497
- let i = Math.floor(n.contentWidth), a = qe(t, i, e.styles.padding), o = R(e.styles.backgroundColor, "native") || " background-color=\"transparent\"", s = L(e.styles.padding), c = H(e.borderRadius), l = k(e), u = n.withContainerWidth(i, i - z(e.styles.padding)), d = Xe(e.children[0] ?? [], n.allowHtmlBlocks).filter((e) => !T(e)).map((e) => X(e, r(e, u))).filter((e) => e !== "").join("\n");
498
- return `<mj-hero mode="${a.mode}" height="${a.height}px" background-url="${P(t.image.url)}" background-width="${a.backgroundWidth}px" background-height="${a.backgroundHeight}px" background-position="${t.image.position}"${o} padding="${s}" vertical-align="${t.verticalAlign}"${c}${l}>
499
- ${d}
500
- </mj-hero>`;
501
- }
502
- function Xe(e, t) {
503
- return t ? e : e.filter((e) => e.type !== "html");
504
- }
505
- // ../renderer/src/renderers/video.ts
506
- function Ze(e, t) {
507
- if (t) return t;
508
- if (!e) return null;
509
- for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/]) {
510
- let n = e.match(t);
511
- if (n) return `https://img.youtube.com/vi/${n[1]}/maxresdefault.jpg`;
512
- }
513
- let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
514
- return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
515
- }
516
- function Qe(e, t) {
517
- if (O(e)) return "";
518
- let n = Ze(e.url, e.thumbnailUrl);
519
- if (!n) return "";
520
- let r = L(e.styles.padding), i = R(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = pe(e.height), s = B(e, t), c = k(e);
521
- return `<mj-image
522
- src="${P(n)}"
523
- alt="${P(e.alt)}"
524
- width="${a}"${o}${s}
525
- align="${e.align}"
526
- padding="${r}"
527
- href="${P(e.url)}"
528
- target="_blank"
529
- rel="noopener"${i}${c}
530
- />`;
531
- }
532
- // ../renderer/src/renderers/index.ts
533
- function Z(e, i) {
534
- let a = i.blockRenderers[e.type];
535
- return a ? a(e, i) : T(e) ? Je(e, i, Z) : r(e) ? xe(e, i) : m(e) ? we(e, i) : re(e) ? Te(e, i) : S(e) ? Ee(e, i) : v(e) ? je(e, i) : ie(e) ? Me(e, i) : d(e) ? Ne(e, i) : t(e) ? Pe(e, i) : ce(e) ? Fe(e, i) : c(e) ? ze(e, i) : n(e) ? Qe(e, i) : b(e) ? We(e, i) : O(e) ? "" : A(e);
536
- }
537
- // ../renderer/src/index.ts
538
- var $e = `.${Y} a { display: block !important; }`;
539
- async function et(t, n) {
540
- if (n?.customBlocks !== void 0 && n.renderCustomBlock !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with renderCustomBlock");
541
- if (n?.customBlocks !== void 0 && n.getCustomBlockStylesheet !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with getCustomBlockStylesheet");
542
- let r = n?.locale ?? s(t), a = l(t, r), o = n?.layout ? i(l(n.layout, r, { missing: "default" }), a) : (ee(a), e(a), a), c = n?.customFonts ?? [], u = n?.defaultFallbackFont ?? "Arial, sans-serif", d = n?.allowHtmlBlocks ?? !0, f = it(n?.socialIconsBaseUrl ?? E), p = n?.customBlocks === void 0 ? await ct(o, n?.renderCustomBlock) : await lt(o, n.customBlocks), m = ut(o, n?.getCustomBlockStylesheet, n?.customBlocks === void 0 ? void 0 : new Map(n.customBlocks.map((e) => [e.type, e]))), g = h(o.settings), _ = new D(o.settings.width, c, u, d, p, f, n?.blockRenderers ?? {}, g), v = st(o.blocks, d), y = _.resolveFontFamily(o.settings.fontFamily), b = o.settings.backgroundColor, te = o.settings.textColor ? ` color="${P(o.settings.textColor)}"` : "", x = o.settings.linkColor ? F(o.settings.linkColor) : "inherit", S = o.settings.linkUnderline ? "underline" : "none", C = v.map((e) => Q(e, _)).filter((e) => e !== "").join("\n"), ne = ot(c), w = at(o.settings.preheaderText);
543
- return `<mjml lang="${P(o.settings.locale)}" dir="${P(g)}">
544
- <mj-head>${w}
545
- <mj-attributes>
546
- <mj-all font-family="${I(y)}" />
547
- <mj-text font-size="14px"${te} />
548
- <mj-section padding="0" />
549
- <mj-column padding="0" />
550
- </mj-attributes>${ne}
551
- <mj-style inline="inline">
552
- ${me(he(v), g)}
553
- ${$e}
554
- </mj-style>
555
- <mj-style>
556
- a { color: ${x}; text-decoration: ${S}; }
557
- @media only screen and (max-width: 480px) {
558
- .tpl-hide-mobile { display: none !important; mso-hide: all !important; }
559
- }
560
- @media only screen and (min-width: 481px) {
561
- .tpl-hide-desktop { display: none !important; mso-hide: all !important; }
562
- }
563
- </mj-style>${dt(m)}
564
- </mj-head>
565
- <mj-body width="${_.containerWidth}px" background-color="${b}">
566
- ${C}
567
- </mj-body>
568
- </mjml>`;
569
- }
570
- function Q(e, t) {
571
- if (a(e)) {
572
- let n = tt(t, e.styles.padding);
573
- return X(e, nt(st(e.children, t.allowHtmlBlocks).map((e) => Q(e, n)).filter((e) => e !== "").join("\n"), {
574
- backgroundColor: e.styles.backgroundColor,
575
- padding: e.styles.padding,
576
- borderRadius: e.borderRadius,
577
- backgroundImage: e.backgroundImage
578
- }, t.contentDirection));
579
- }
580
- if (T(e)) {
581
- let n = Z(e, e.wrapper ? tt(t, e.wrapper.padding) : t);
582
- return X(e, e.wrapper && n !== "" ? nt(n, e.wrapper, t.contentDirection) : n);
583
- }
584
- return X(e, rt(Z(e, t), t.contentDirection));
585
- }
586
- function tt(e, t) {
587
- return e.withContainerWidth(e.containerWidth, Math.floor(e.contentWidth) - z(t));
588
- }
589
- function nt(e, t, n) {
590
- return `<mj-wrapper${R(t.backgroundColor, "native")}${U(t.backgroundImage)}${` padding="${t.padding ? L(t.padding) : "0"}"`}${H(t.borderRadius)}${n === "rtl" ? " direction=\"rtl\"" : ""}>
591
- ${e}
592
- </mj-wrapper>`;
593
- }
594
- function rt(e, t) {
595
- if (e === "") return "";
596
- let n = t === "rtl" ? " direction=\"rtl\"" : "";
597
- return `<mj-section${n}>
598
- <mj-column${n}>
599
- ${e}
600
- </mj-column>
601
- </mj-section>`;
602
- }
603
- function it(e) {
604
- return e.endsWith("/") ? e.slice(0, -1) : e;
605
- }
606
- function at(e) {
607
- if (!e) return "";
608
- let t = e.trim();
609
- return t === "" ? "" : `\n <mj-preview>${N(t)}</mj-preview>`;
610
- }
611
- function ot(e) {
612
- return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${P(e.name)}" href="${P(e.url)}" />`).join("");
613
- }
614
- function st(e, t) {
615
- return t ? e : e.filter((e) => e.type !== "html");
616
- }
617
- async function ct(e, t) {
618
- let n = /* @__PURE__ */ new Map();
619
- if (!t) return n;
620
- let r = [];
621
- if ($(e.blocks, r), r.length === 0) return n;
622
- let i = await Promise.all(r.map((e) => t(e)));
623
- for (let e = 0; e < r.length; e++) n.set(r[e].id, i[e]);
624
- return n;
625
- }
626
- async function lt(e, t) {
627
- let n = /* @__PURE__ */ new Map(), r = [];
628
- if ($(e.blocks, r), r.length === 0) return n;
629
- let i;
630
- try {
631
- i = await import("./liquid.browser-rubac0VA.js");
632
- } catch {
633
- throw Error("[Templatical] customBlocks requires the optional liquidjs package.");
634
- }
635
- let a = o(i), s = new Map(t.map((e) => [e.type, e])), c = await Promise.all(r.map(async (e) => {
636
- let t = s.get(e.customType);
637
- return t ? String(await a.parseAndRender(t.template, e.fieldValues)) : void 0;
638
- }));
639
- for (let e = 0; e < r.length; e++) {
640
- let t = c[e];
641
- t !== void 0 && n.set(r[e].id, t);
642
- }
643
- return n;
644
- }
645
- function $(e, t) {
646
- for (let n of e) if (b(n)) t.push(n);
647
- else if (T(n)) for (let e of n.children) $(e, t);
648
- else a(n) && $(n.children, t);
649
- }
650
- function ut(e, t, n) {
651
- let r = [];
652
- if ($(e.blocks, r), r.length === 0) return [];
653
- let i = /* @__PURE__ */ new Map();
654
- if (!t) for (let e of r) e.renderedStylesheet && !i.has(e.customType) && i.set(e.customType, e.renderedStylesheet);
655
- let a = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), s = [];
656
- for (let e of r) {
657
- if (a.has(e.customType)) continue;
658
- a.add(e.customType);
659
- let r = n?.get(e.customType), c = t ? t(e.customType) : r ? r.stylesheet : i.get(e.customType);
660
- if (!c) continue;
661
- let l = c.trim();
662
- l === "" || o.has(l) || (o.add(l), s.push(l));
663
- }
664
- return s;
665
- }
666
- function dt(e) {
667
- return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
668
- }
669
- export { Y as BUTTON_FULL_WIDTH_CSS_CLASS, E as DEFAULT_SOCIAL_ICONS_BASE_URL, W as RICH_TEXT_CSS_CLASS, D as RenderContext, ue as UNRENDERABLE_MARKER_PREFIX, C as convertMergeTagsToValues, P as escapeAttr, N as escapeHtml, B as fluidOnMobileAttr, k as getCssClassAttr, le as getCssClasses, Ge as getWidthPercentages, Ke as getWidthPixels, O as isHiddenOnAll, Z as renderBlock, et as renderToMjml, A as renderUnrenderableBlock, K as resolveParagraphGap, G as richTextGapClass, L as toPaddingString };
670
-
671
- //# sourceMappingURL=src-8bYYJPCt.js.map