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