@templatical/editor 0.54.2 → 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-BBKVJ6HA.js → AiAltTextPopover-D5QosKvB.js} +1 -1
- package/dist/{AiAltTextReview-BuVbeQh-.js → AiAltTextReview-D1W_lrI_.js} +1 -1
- package/dist/{AiRewriteMenu-ZpYJfm-O.js → AiRewriteMenu-BwztoMov.js} +4 -4
- package/dist/{BlockPreviewCanvas-DtOo5y3U.js → BlockPreviewCanvas-C23A6FRm.js} +4 -4
- package/dist/{CloudPanels-DQRWMc59.js → CloudPanels-Baoaj6Xf.js} +1 -1
- package/dist/{CountdownToolbar-DTpMEDyh.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
- package/dist/{IssuesPanel-BZn7-p9e.js → IssuesPanel-nmFhWG1p.js} +1 -1
- package/dist/{LanguageMenu-OOmQWVzO.js → LanguageMenu-DcABUYop.js} +3 -3
- package/dist/{LogicTagInsertButton-XESwnJia.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
- package/dist/{MergeTagInput-CAsBRoSm.js → MergeTagInput-JJeZbFkD.js} +1 -1
- package/dist/{MergeTagModeToggle-bOf27Hg1.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
- package/dist/{MergeTagTextarea-DH_6JFui.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
- package/dist/{ParagraphEditor-XGUkV5Uw.js → ParagraphEditor-VXYwGoz_.js} +8 -8
- package/dist/{RestoreVersionDialog-C72kWccI.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
- package/dist/{RichTextEditorContent-BZN8KRvR.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
- package/dist/{SaveBlockDialog-CKOnTMTU.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
- package/dist/{SavedBlocksBrowserModal-BrlNxqDH.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
- package/dist/{SavedBlocksPanels--lPR6gdh.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
- package/dist/{SavedBlocksPickBar-4ON4_KKl.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
- package/dist/{TemplateSettings-BE0jZmRJ.js → TemplateSettings-C_LHLm5M.js} +4 -4
- package/dist/{TestEmailModal-BKmNGrZN.js → TestEmailModal-CLIRn7eL.js} +5 -5
- package/dist/{TestEmailPanel-DT1wllX3.js → TestEmailPanel-frdtjC8h.js} +1 -1
- package/dist/{TitleEditor-HjVZuUTB.js → TitleEditor-D5kC56Jl.js} +4 -4
- package/dist/{Toolbar-BppchV2k.js → Toolbar-D904Yw_R.js} +551 -503
- package/dist/{TplModal-BFWOoK8l.js → TplModal-BBdotDf1.js} +1 -1
- package/dist/{VersionHistoryPanels-D4yNVLvq.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
- package/dist/{WrapperBlock-BUzQTZuu.js → WrapperBlock-BAT3T0Cz.js} +3 -3
- package/dist/{blockTypeIcons-D91v9k0x.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-CAI18sdv.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js → AiAltTextReview-B9vm_L-8.js} +2 -2
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js → CloudPanels-CQ0vNgsH.js} +2 -2
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js → IssuesPanel-BoHeIjvw.js} +3 -3
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js → LanguageMenu-BnYN5N1h.js} +7 -7
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
- package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js → MergeTagInput-BELdMRni.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js → ParagraphEditor-Cal9hY3U.js} +9 -9
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js → SaveBlockDialog-C6N9RFls.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js → TemplateSettings-CpoKZ8oV.js} +5 -5
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js → TestEmailModal-DI3z__Bd.js} +8 -8
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js → TitleEditor-C2syRLdZ.js} +4 -4
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-Cv6Rv1S-.js → Toolbar-NEE8qxYh.js} +754 -706
- package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js → TplModal-B1MgvtX8.js} +2 -2
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js.map → TplModal-B1MgvtX8.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js → WrapperBlock-DFY-7YSs.js} +4 -4
- package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.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-BxikPuC1.js → composables-nyxwrM27.js} +610 -594
- package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.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-DuDWpKo7.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/cdn/chunks/{normalizeMergeTagMarkup-Bn_hl4jd.js → normalizeMergeTagMarkup-BrGw5jxk.js} +99 -89
- package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js → preRenderCustomBlocks-Cj0XYwuh.js} +4 -4
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.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-DfXoetOm.js → sanitizeHtml-GxJCxKcP.js} +3 -3
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js → socialIcons-B5zrrV8-.js} +387 -386
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
- package/dist/cdn/chunks/{src-712f3ofG.js → src-Diw9SLIe.js} +673 -554
- package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
- package/dist/cdn/chunks/{src-B2tQbzf6.js → src-UR3AQocX.js} +221 -215
- package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
- package/dist/cdn/chunks/{src-ZFw5fg_z.js → src-v47QHNmB.js} +809 -659
- package/dist/cdn/chunks/src-v47QHNmB.js.map +1 -0
- package/dist/cdn/chunks/useLocalizedDisplay-DekV8qar.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-DiNjT22M.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js → useLogicTag-Cbp3I7UN.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js → useMergeTag-1lrpNyR5.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js → withCurrentFont-DZfmiv8V.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
- package/dist/cdn/editor.js +284 -284
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{composables-BbPFRlBf.js → composables-DPgNn9GZ.js} +929 -913
- package/dist/{createCloudRuntime-Dlrg88gS.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
- package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
- package/dist/{dist-C34cYI5S.js → dist-CBdk1Vcb.js} +963 -813
- 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-xCiyqSg7.js → extensions-QFAARrjF.js} +338 -332
- 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/{normalizeMergeTagMarkup-C7FGNURu.js → normalizeMergeTagMarkup-BS0nRvhq.js} +89 -79
- package/dist/{preRenderCustomBlocks-DvbRa3L3.js → preRenderCustomBlocks-CiKvKd8V.js} +1 -1
- package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
- package/dist/{sanitizeHtml-D_ab7dD6.js → sanitizeHtml-USjTyALR.js} +1 -1
- package/dist/{socialIcons-DhAolBjt.js → socialIcons-NvIg5ahU.js} +338 -337
- package/dist/templatical-editor.js +41 -41
- package/dist/{useLocalizedDisplay-C9MBFUr4.js → useLocalizedDisplay-LdjosX4w.js} +1 -1
- package/dist/{useLogicTag-BmuakZBd.js → useLogicTag-D8zgkXfb.js} +1 -1
- package/dist/{useMergeTag-DC4a8b_v.js → useMergeTag-k7Kr0nMd.js} +1 -1
- package/dist/{withCurrentFont-BSxJai99.js → withCurrentFont-Bzeg_gfH.js} +1 -1
- package/package.json +7 -7
- package/dist/cdn/chunks/LogicTagInsertButton-PDKuo2J3.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-Cv6Rv1S-.js.map +0 -1
- package/dist/cdn/chunks/composables-BxikPuC1.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-DuDWpKo7.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-Bn_hl4jd.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
- package/dist/cdn/chunks/src-712f3ofG.js.map +0 -1
- package/dist/cdn/chunks/src-B2tQbzf6.js.map +0 -1
- package/dist/cdn/chunks/src-ZFw5fg_z.js.map +0 -1
- package/dist/cdn/chunks/useLocalizedDisplay-DiNjT22M.js +0 -33
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
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
2
|
// ../renderer/src/render-context.ts
|
|
3
|
-
var
|
|
3
|
+
var C = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
4
4
|
name: "@templatical/renderer",
|
|
5
5
|
description: "Render Templatical email templates to MJML",
|
|
6
|
-
version: "0.
|
|
6
|
+
version: "0.55.0",
|
|
7
7
|
bugs: "https://github.com/templatical/sdk/issues",
|
|
8
8
|
dependencies: { "@templatical/types": "workspace:*" },
|
|
9
9
|
devDependencies: {
|
|
@@ -11,6 +11,7 @@ var w = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
11
11
|
"@resvg/resvg-js": "^2.6.2",
|
|
12
12
|
liquidjs: "^10.30.1",
|
|
13
13
|
mjml: "^5.4.1",
|
|
14
|
+
"mjml-browser": "^5.4.1",
|
|
14
15
|
typescript: "^6.0.3",
|
|
15
16
|
vitest: "^5.0.5"
|
|
16
17
|
},
|
|
@@ -45,7 +46,7 @@ var w = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
45
46
|
},
|
|
46
47
|
type: "module",
|
|
47
48
|
types: "./dist/index.d.ts"
|
|
48
|
-
}.version}/assets/social`,
|
|
49
|
+
}.version}/assets/social`, w = class e {
|
|
49
50
|
containerWidth;
|
|
50
51
|
customFonts;
|
|
51
52
|
defaultFallbackFont;
|
|
@@ -55,14 +56,14 @@ var w = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
55
56
|
blockRenderers;
|
|
56
57
|
contentDirection;
|
|
57
58
|
contentWidth;
|
|
58
|
-
constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a =
|
|
59
|
+
constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = C, o = {}, s = "ltr", c) {
|
|
59
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;
|
|
60
61
|
}
|
|
61
62
|
withContainerWidth(t, n = t) {
|
|
62
63
|
return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml, this.socialIconsBaseUrl, this.blockRenderers, this.contentDirection, n);
|
|
63
64
|
}
|
|
64
65
|
resolveFontFamily(e) {
|
|
65
|
-
return
|
|
66
|
+
return b(e, {
|
|
66
67
|
customFonts: this.customFonts,
|
|
67
68
|
defaultFallback: this.defaultFallbackFont
|
|
68
69
|
});
|
|
@@ -73,72 +74,74 @@ var w = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
73
74
|
">": ">",
|
|
74
75
|
"\"": """,
|
|
75
76
|
"'": "'"
|
|
76
|
-
},
|
|
77
|
+
}, fe = /[&<>"']/g;
|
|
78
|
+
function E(e) {
|
|
79
|
+
return e === "" ? "" : e.replace(fe, (e) => T[e] ?? e);
|
|
80
|
+
}
|
|
77
81
|
function D(e) {
|
|
78
|
-
return e === "" ? "" : e.replace(
|
|
82
|
+
return e === "" ? "" : e.replace(fe, (e) => T[e] ?? e);
|
|
79
83
|
}
|
|
80
84
|
function O(e) {
|
|
81
|
-
return e === "" ? "" : e.replace(
|
|
85
|
+
return e === "" ? "" : D(e.replace(/[;{}\r\n]/g, ""));
|
|
82
86
|
}
|
|
87
|
+
var pe = /[&<>"]/g;
|
|
83
88
|
function k(e) {
|
|
84
|
-
return e
|
|
85
|
-
}
|
|
86
|
-
var fe = /[&<>"]/g;
|
|
87
|
-
function A(e) {
|
|
88
|
-
return e.replace(fe, (e) => T[e] ?? e);
|
|
89
|
+
return e.replace(pe, (e) => T[e] ?? e);
|
|
89
90
|
}
|
|
90
91
|
// ../renderer/src/visibility.ts
|
|
91
|
-
function
|
|
92
|
+
function A(e) {
|
|
92
93
|
let t = e.visibility;
|
|
93
94
|
return t ? !t.desktop && !t.mobile : !1;
|
|
94
95
|
}
|
|
95
|
-
function
|
|
96
|
-
let n = [
|
|
97
|
-
return n === "" ? "" : ` css-class="${
|
|
96
|
+
function j(e, t = []) {
|
|
97
|
+
let n = [M(e), ...t].filter((e) => e !== "").join(" ");
|
|
98
|
+
return n === "" ? "" : ` css-class="${D(n)}"`;
|
|
98
99
|
}
|
|
99
|
-
function
|
|
100
|
+
function M(e) {
|
|
100
101
|
let t = e.visibility;
|
|
101
102
|
if (!t) return "";
|
|
102
103
|
let n = [];
|
|
103
104
|
return t.desktop || n.push("tpl-hide-desktop"), t.mobile || n.push("tpl-hide-mobile"), n.join(" ");
|
|
104
105
|
}
|
|
105
106
|
// ../renderer/src/unrenderable.ts
|
|
106
|
-
var
|
|
107
|
-
function
|
|
107
|
+
var N = "templatical:unrenderable-block";
|
|
108
|
+
function P(e) {
|
|
108
109
|
return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
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><!-- ${
|
|
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>`;
|
|
112
113
|
}
|
|
113
114
|
// ../renderer/src/padding.ts
|
|
114
|
-
function
|
|
115
|
-
return
|
|
115
|
+
function I(e) {
|
|
116
|
+
return D(`${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`);
|
|
116
117
|
}
|
|
117
118
|
// ../renderer/src/utils.ts
|
|
118
|
-
function
|
|
119
|
-
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${
|
|
119
|
+
function L(e, t) {
|
|
120
|
+
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${O(e)}"` : "";
|
|
120
121
|
}
|
|
121
|
-
function
|
|
122
|
+
function R(e) {
|
|
122
123
|
return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
|
|
123
124
|
}
|
|
124
125
|
function z(e, t) {
|
|
125
|
-
let n = (e) => Math.trunc(e ?? 0), r = (e) =>
|
|
126
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => h(e) === null ? 0 : Math.trunc(e.width);
|
|
126
127
|
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
127
128
|
}
|
|
128
129
|
function B(e, t) {
|
|
130
|
+
if (e.fluidOnMobile === !0) return " fluid-on-mobile=\"true\"";
|
|
131
|
+
if (e.fluidOnMobile === !1) return "";
|
|
129
132
|
let n = Math.floor(t.contentWidth) - z(e.styles.padding, e.border);
|
|
130
133
|
return e.width === "full" || e.width >= n ? " fluid-on-mobile=\"true\"" : "";
|
|
131
134
|
}
|
|
132
135
|
function V(e) {
|
|
133
|
-
return Object.entries(
|
|
136
|
+
return Object.entries(ce(e)).map(([e, t]) => ` ${e}="${O(t)}"`).join("");
|
|
134
137
|
}
|
|
135
138
|
function H(e) {
|
|
136
|
-
let t =
|
|
137
|
-
return t === null ? "" : ` border-radius="${
|
|
139
|
+
let t = s(e);
|
|
140
|
+
return t === null ? "" : ` border-radius="${O(t)}"`;
|
|
138
141
|
}
|
|
139
142
|
function U(e) {
|
|
140
|
-
let t =
|
|
141
|
-
return t === null ? "" : ` background-url="${
|
|
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)}"`;
|
|
142
145
|
}
|
|
143
146
|
// ../renderer/src/rich-text.ts
|
|
144
147
|
var W = "tpl-rich-text";
|
|
@@ -146,7 +149,7 @@ function G(e) {
|
|
|
146
149
|
return `${W}-${e}`;
|
|
147
150
|
}
|
|
148
151
|
function me(e, t = "ltr") {
|
|
149
|
-
let n =
|
|
152
|
+
let n = S, r = `.${W}`, i = [...new Set(e)].sort((e, t) => e - t).flatMap((e) => {
|
|
150
153
|
let t = `.${G(e)}`;
|
|
151
154
|
return [`${t} p { margin: 0 0 ${e}px; }`, `${t} p:last-child { margin-bottom: 0; }`];
|
|
152
155
|
}), a = t === "rtl" ? "padding-right" : "padding-left";
|
|
@@ -157,15 +160,15 @@ function me(e, t = "ltr") {
|
|
|
157
160
|
].join("\n ");
|
|
158
161
|
}
|
|
159
162
|
function K(e) {
|
|
160
|
-
return e ??
|
|
163
|
+
return e ?? S.paragraphGap;
|
|
161
164
|
}
|
|
162
|
-
function he(
|
|
163
|
-
let
|
|
164
|
-
if (
|
|
165
|
-
else if (
|
|
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);
|
|
166
169
|
};
|
|
167
|
-
for (let
|
|
168
|
-
return
|
|
170
|
+
for (let e of t) i(e);
|
|
171
|
+
return r;
|
|
169
172
|
}
|
|
170
173
|
var ge = {
|
|
171
174
|
apos: "'",
|
|
@@ -210,7 +213,7 @@ function be(e) {
|
|
|
210
213
|
}
|
|
211
214
|
return e;
|
|
212
215
|
}
|
|
213
|
-
function
|
|
216
|
+
function xe(e) {
|
|
214
217
|
if (!e.includes("&")) return e;
|
|
215
218
|
let t = "", n = 0, r = e.indexOf("<");
|
|
216
219
|
for (; r !== -1;) {
|
|
@@ -218,7 +221,7 @@ function J(e) {
|
|
|
218
221
|
r = e.indexOf("<", r + 1);
|
|
219
222
|
continue;
|
|
220
223
|
}
|
|
221
|
-
let i =
|
|
224
|
+
let i = _(e, r + 1);
|
|
222
225
|
if (i === -1) break;
|
|
223
226
|
let a = e.slice(r, i), o = be(a);
|
|
224
227
|
o !== a && (t += e.slice(n, r) + o, n = i), r = e.indexOf("<", i);
|
|
@@ -226,114 +229,117 @@ function J(e) {
|
|
|
226
229
|
return t + e.slice(n);
|
|
227
230
|
}
|
|
228
231
|
// ../renderer/src/renderers/title.ts
|
|
229
|
-
function
|
|
230
|
-
if (
|
|
231
|
-
let n =
|
|
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}`;
|
|
232
235
|
return `<mj-text
|
|
233
236
|
font-size="${a}px"${o}
|
|
234
237
|
align="${s}"
|
|
235
|
-
line-height="${
|
|
238
|
+
line-height="${ue}"
|
|
236
239
|
padding="${n}"${r}${c}${l}
|
|
237
|
-
><${
|
|
240
|
+
><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit;font-weight:700">${i}</${u}></mj-text>`;
|
|
238
241
|
}
|
|
239
|
-
function
|
|
242
|
+
function Ce(e) {
|
|
240
243
|
let t = /^\s*<p\b/.exec(e);
|
|
241
244
|
if (!t) return e;
|
|
242
|
-
let n =
|
|
245
|
+
let n = _(e, t[0].length);
|
|
243
246
|
if (n === -1) return e;
|
|
244
247
|
let r = /<\/p>\s*$/.exec(e);
|
|
245
248
|
if (!r || r.index <= n) return e;
|
|
246
249
|
let i = e.slice(n + 1, r.index);
|
|
247
250
|
return /<\/p>\s*<p\b/i.test(i) ? e : i;
|
|
248
251
|
}
|
|
249
|
-
function
|
|
250
|
-
return e ? ` font-family="${
|
|
252
|
+
function we(e, t) {
|
|
253
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
251
254
|
}
|
|
252
255
|
// ../renderer/src/renderers/paragraph.ts
|
|
253
|
-
function
|
|
254
|
-
if (
|
|
255
|
-
let n =
|
|
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))]);
|
|
256
259
|
return `<mj-text
|
|
257
260
|
line-height="1.5"${t.contentDirection === "rtl" ? "\n align=\"right\"" : ""}
|
|
258
261
|
padding="${n}"${r}${a}
|
|
259
262
|
>${i}</mj-text>`;
|
|
260
263
|
}
|
|
261
264
|
// ../renderer/src/renderers/image.ts
|
|
262
|
-
function
|
|
263
|
-
if (
|
|
264
|
-
let n =
|
|
265
|
-
e.linkUrl && (u = ` href="${
|
|
266
|
-
let d =
|
|
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;
|
|
267
270
|
return `<mj-image
|
|
268
271
|
src="${d}"
|
|
269
|
-
alt="${f ? "" :
|
|
272
|
+
alt="${f ? "" : D(e.alt)}"
|
|
270
273
|
width="${i}"${a}${o}
|
|
271
|
-
align="${
|
|
274
|
+
align="${D(e.align)}"
|
|
272
275
|
padding="${n}"${r}${l}${c}${u}${s}${f ? " role=\"presentation\"" : ""}
|
|
273
276
|
/>`;
|
|
274
277
|
}
|
|
275
278
|
// ../renderer/src/renderers/button.ts
|
|
276
|
-
var
|
|
277
|
-
function
|
|
278
|
-
if (
|
|
279
|
-
let n =
|
|
280
|
-
return `<mj-button${o}${
|
|
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}
|
|
281
284
|
background-color="${s}"
|
|
282
285
|
color="${c}"
|
|
283
|
-
font-size="${
|
|
284
|
-
font-weight="
|
|
285
|
-
border-radius="${
|
|
286
|
+
font-size="${D(String(l))}px"
|
|
287
|
+
font-weight="${u}"
|
|
288
|
+
border-radius="${d}"${_}
|
|
286
289
|
inner-padding="${i}"
|
|
287
|
-
align="${
|
|
288
|
-
padding="${n}"${r}${
|
|
289
|
-
>${
|
|
290
|
-
}
|
|
291
|
-
function De(e) {
|
|
292
|
-
return e.trim() === "" ? "transparent" : O(e);
|
|
290
|
+
align="${v}"
|
|
291
|
+
padding="${n}"${r}${m}${h}${g}
|
|
292
|
+
>${f}</mj-button>`;
|
|
293
293
|
}
|
|
294
|
-
function Oe(e
|
|
295
|
-
return e ?
|
|
294
|
+
function Oe(e) {
|
|
295
|
+
return e.trim() === "" ? "transparent" : D(e);
|
|
296
296
|
}
|
|
297
297
|
function ke(e) {
|
|
298
|
-
return
|
|
298
|
+
return e === "regular" ? "400" : e === "medium" ? "500" : e === "bold" ? "700" : "bold";
|
|
299
299
|
}
|
|
300
|
-
function Ae(e) {
|
|
301
|
-
return e
|
|
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`)}"`;
|
|
302
308
|
}
|
|
303
309
|
// ../renderer/src/renderers/divider.ts
|
|
304
|
-
function
|
|
305
|
-
if (
|
|
306
|
-
let n =
|
|
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);
|
|
307
313
|
return `<mj-divider
|
|
308
|
-
border-width="${
|
|
314
|
+
border-width="${D(String(a))}px"
|
|
309
315
|
border-style="${o}"
|
|
310
316
|
border-color="${s}"
|
|
311
|
-
width="${
|
|
317
|
+
width="${D(i)}"
|
|
312
318
|
padding="${n}"${r}${c}
|
|
313
319
|
/>`;
|
|
314
320
|
}
|
|
315
321
|
// ../renderer/src/renderers/spacer.ts
|
|
316
|
-
function
|
|
317
|
-
if (
|
|
318
|
-
let n = e.height, r = e.styles.backgroundColor ? ` container-background-color="${
|
|
319
|
-
return `<mj-spacer height="${
|
|
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} />`;
|
|
320
326
|
}
|
|
321
327
|
// ../renderer/src/renderers/html.ts
|
|
322
|
-
function
|
|
323
|
-
if (
|
|
328
|
+
function Fe(e, t) {
|
|
329
|
+
if (A(e) || !t.allowHtmlBlocks) return "";
|
|
324
330
|
let n = e.content;
|
|
325
331
|
if (n === "") return "";
|
|
326
|
-
let r =
|
|
327
|
-
return `<mj-text padding="${
|
|
332
|
+
let r = j(e);
|
|
333
|
+
return `<mj-text padding="${I(e.styles.padding)}"${L(e.styles.backgroundColor, "container")}${r}>
|
|
328
334
|
${n}
|
|
329
335
|
</mj-text>`;
|
|
330
336
|
}
|
|
331
337
|
// ../renderer/src/renderers/social.ts
|
|
332
|
-
function
|
|
333
|
-
if (
|
|
338
|
+
function Ie(e, t) {
|
|
339
|
+
if (A(e)) return "";
|
|
334
340
|
let n = e.icons;
|
|
335
341
|
if (n.length === 0) return "";
|
|
336
|
-
let r =
|
|
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;
|
|
337
343
|
switch (s) {
|
|
338
344
|
case "small":
|
|
339
345
|
d = 24;
|
|
@@ -364,79 +370,79 @@ function Pe(e, t) {
|
|
|
364
370
|
padding="${r}"${i}${a}
|
|
365
371
|
>
|
|
366
372
|
${n.map((e, n) => {
|
|
367
|
-
let r =
|
|
368
|
-
return `<mj-social-element src="${a}" href="${i}" icon-size="${d}px" padding="0 ${
|
|
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>`;
|
|
369
375
|
}).join("\n")}
|
|
370
376
|
</mj-social>`;
|
|
371
377
|
}
|
|
372
378
|
// ../renderer/src/renderers/menu.ts
|
|
373
|
-
function
|
|
374
|
-
if (
|
|
375
|
-
let n =
|
|
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);
|
|
376
382
|
return `<mj-text
|
|
377
|
-
font-size="${
|
|
383
|
+
font-size="${D(String(s))}px"${c}
|
|
378
384
|
align="${o}"
|
|
379
385
|
line-height="1.5"
|
|
380
386
|
padding="${n}"${r}${a}${i}
|
|
381
387
|
>${l}</mj-text>`;
|
|
382
388
|
}
|
|
383
|
-
function
|
|
384
|
-
let t = e.items, n =
|
|
385
|
-
for (let e = 0; e < s; e++) o.push(
|
|
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>`);
|
|
386
392
|
return o.join("");
|
|
387
393
|
}
|
|
388
|
-
function
|
|
389
|
-
let n =
|
|
390
|
-
return i && o.unshift(`color: ${
|
|
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>`;
|
|
391
397
|
}
|
|
392
|
-
function
|
|
393
|
-
return e ? ` font-family="${
|
|
398
|
+
function Be(e, t) {
|
|
399
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
394
400
|
}
|
|
395
401
|
// ../renderer/src/renderers/table.ts
|
|
396
|
-
function
|
|
397
|
-
if (
|
|
398
|
-
let n =
|
|
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);
|
|
399
405
|
return `<mj-text
|
|
400
|
-
font-size="${
|
|
406
|
+
font-size="${D(String(o))}px"${s}
|
|
401
407
|
align="${c}"
|
|
402
408
|
line-height="1.5"
|
|
403
409
|
padding="${n}"${r}${a}${i}
|
|
404
410
|
>${l}</mj-text>`;
|
|
405
411
|
}
|
|
406
|
-
function
|
|
407
|
-
let t =
|
|
412
|
+
function He(e) {
|
|
413
|
+
let t = O(e.borderColor), n = e.borderWidth, r = "";
|
|
408
414
|
for (let i = 0; i < e.rows.length; i++) {
|
|
409
415
|
let a = e.rows[i];
|
|
410
|
-
r +=
|
|
416
|
+
r += Ue(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
411
417
|
}
|
|
412
418
|
return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
|
|
413
419
|
}
|
|
414
|
-
function
|
|
420
|
+
function Ue(e, t, n, r, i) {
|
|
415
421
|
let a = "";
|
|
416
|
-
for (let o of e.cells) a +=
|
|
422
|
+
for (let o of e.cells) a += We(o, t, n, r, i);
|
|
417
423
|
return `<tr>${a}</tr>`;
|
|
418
424
|
}
|
|
419
|
-
function
|
|
420
|
-
let a = t.cellPadding, o = [`border: ${
|
|
421
|
-
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${
|
|
422
|
-
let s = o.join("; "), c =
|
|
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";
|
|
423
429
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
424
430
|
}
|
|
425
|
-
function
|
|
426
|
-
return e ? ` font-family="${
|
|
431
|
+
function Ge(e, t) {
|
|
432
|
+
return e ? ` font-family="${k(t.resolveFontFamily(e))}"` : "";
|
|
427
433
|
}
|
|
428
434
|
// ../renderer/src/renderers/custom.ts
|
|
429
|
-
function
|
|
430
|
-
if (
|
|
435
|
+
function Ke(e, t) {
|
|
436
|
+
if (A(e)) return "";
|
|
431
437
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
432
438
|
if (!n || n === "") return "";
|
|
433
|
-
let r =
|
|
434
|
-
return `<mj-text padding="${
|
|
439
|
+
let r = j(e);
|
|
440
|
+
return `<mj-text padding="${I(e.styles.padding)}"${L(e.styles.backgroundColor, "container")}${r}>
|
|
435
441
|
${n}
|
|
436
442
|
</mj-text>`;
|
|
437
443
|
}
|
|
438
444
|
// ../renderer/src/columns.ts
|
|
439
|
-
function
|
|
445
|
+
function qe(e) {
|
|
440
446
|
switch (e) {
|
|
441
447
|
case "2": return ["50%", "50%"];
|
|
442
448
|
case "3": return [
|
|
@@ -449,7 +455,7 @@ function X(e) {
|
|
|
449
455
|
default: return ["100%"];
|
|
450
456
|
}
|
|
451
457
|
}
|
|
452
|
-
function
|
|
458
|
+
function Je(e, t) {
|
|
453
459
|
switch (e) {
|
|
454
460
|
case "2": return [t * .5, t * .5];
|
|
455
461
|
case "3": return [
|
|
@@ -463,7 +469,7 @@ function Ge(e, t) {
|
|
|
463
469
|
}
|
|
464
470
|
}
|
|
465
471
|
// ../renderer/src/hero-geometry.ts
|
|
466
|
-
function
|
|
472
|
+
function Ye(e, t, n) {
|
|
467
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));
|
|
468
474
|
return {
|
|
469
475
|
mode: "fixed-height",
|
|
@@ -473,7 +479,7 @@ function Ke(e, t, n) {
|
|
|
473
479
|
};
|
|
474
480
|
}
|
|
475
481
|
// ../renderer/src/display-condition.ts
|
|
476
|
-
function
|
|
482
|
+
function Y(e, t) {
|
|
477
483
|
if (t === "") return "";
|
|
478
484
|
let n = e.displayCondition;
|
|
479
485
|
return n ? `<mj-raw>${n.before}</mj-raw>
|
|
@@ -481,35 +487,35 @@ function Z(e, t) {
|
|
|
481
487
|
<mj-raw>${n.after}</mj-raw>` : t;
|
|
482
488
|
}
|
|
483
489
|
// ../renderer/src/renderers/section.ts
|
|
484
|
-
function
|
|
485
|
-
if (
|
|
486
|
-
let
|
|
487
|
-
if (
|
|
488
|
-
let
|
|
489
|
-
for (let e = 0; e <
|
|
490
|
-
let
|
|
491
|
-
|
|
492
|
-
${
|
|
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}
|
|
493
499
|
</mj-column>`);
|
|
494
500
|
}
|
|
495
|
-
let
|
|
496
|
-
return `<mj-section${
|
|
497
|
-
${e.stackOnMobile === !1 &&
|
|
498
|
-
${
|
|
499
|
-
</mj-group>` :
|
|
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}
|
|
500
506
|
</mj-section>`;
|
|
501
507
|
}
|
|
502
|
-
function
|
|
503
|
-
let
|
|
504
|
-
return `<mj-hero mode="${
|
|
505
|
-
${
|
|
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}
|
|
506
512
|
</mj-hero>`;
|
|
507
513
|
}
|
|
508
|
-
function
|
|
514
|
+
function Qe(e, t) {
|
|
509
515
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
510
516
|
}
|
|
511
517
|
// ../renderer/src/renderers/video.ts
|
|
512
|
-
function
|
|
518
|
+
function $e(e, t) {
|
|
513
519
|
if (t) return t;
|
|
514
520
|
if (!e) return null;
|
|
515
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})/]) {
|
|
@@ -519,85 +525,85 @@ function Xe(e, t) {
|
|
|
519
525
|
let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
|
|
520
526
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
521
527
|
}
|
|
522
|
-
function
|
|
523
|
-
if (
|
|
524
|
-
let n =
|
|
528
|
+
function et(e, t) {
|
|
529
|
+
if (A(e)) return "";
|
|
530
|
+
let n = $e(e.url, e.thumbnailUrl);
|
|
525
531
|
if (!n) return "";
|
|
526
|
-
let r =
|
|
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);
|
|
527
533
|
return `<mj-image
|
|
528
|
-
src="${
|
|
529
|
-
alt="${
|
|
534
|
+
src="${D(n)}"
|
|
535
|
+
alt="${D(e.alt)}"
|
|
530
536
|
width="${a}"${o}${s}
|
|
531
|
-
align="${
|
|
537
|
+
align="${D(e.align)}"
|
|
532
538
|
padding="${r}"
|
|
533
|
-
href="${
|
|
539
|
+
href="${D(e.url)}"
|
|
534
540
|
target="_blank"
|
|
535
541
|
rel="noopener"${i}${c}
|
|
536
542
|
/>`;
|
|
537
543
|
}
|
|
538
544
|
// ../renderer/src/renderers/index.ts
|
|
539
|
-
function
|
|
540
|
-
let a =
|
|
541
|
-
return a ? a(e,
|
|
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);
|
|
542
548
|
}
|
|
543
549
|
// ../renderer/src/index.ts
|
|
544
|
-
var
|
|
545
|
-
async function
|
|
550
|
+
var tt = `.${J} a { display: block !important; }`;
|
|
551
|
+
async function nt(e, n) {
|
|
546
552
|
if (n?.customBlocks !== void 0 && n.renderCustomBlock !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with renderCustomBlock");
|
|
547
553
|
if (n?.customBlocks !== void 0 && n.getCustomBlockStylesheet !== void 0) throw TypeError("[Templatical] customBlocks cannot be combined with getCustomBlockStylesheet");
|
|
548
|
-
let r = n?.locale ??
|
|
549
|
-
return `<mjml lang="${
|
|
550
|
-
<mj-head>${
|
|
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}
|
|
551
557
|
<mj-attributes>
|
|
552
|
-
<mj-all font-family="${
|
|
553
|
-
<mj-text font-size="14px"${
|
|
558
|
+
<mj-all font-family="${k(g)}" />
|
|
559
|
+
<mj-text font-size="14px"${y} />
|
|
554
560
|
<mj-section padding="0" />
|
|
555
561
|
<mj-column padding="0" />
|
|
556
|
-
</mj-attributes>${
|
|
562
|
+
</mj-attributes>${te}
|
|
557
563
|
<mj-style inline="inline">
|
|
558
|
-
${me(he(
|
|
559
|
-
${
|
|
564
|
+
${me(he(h), p)}
|
|
565
|
+
${tt}
|
|
560
566
|
</mj-style>
|
|
561
567
|
<mj-style>
|
|
562
|
-
a { color: ${
|
|
568
|
+
a { color: ${b}; text-decoration: ${x}; }
|
|
563
569
|
@media only screen and (max-width: 480px) {
|
|
564
570
|
.tpl-hide-mobile { display: none !important; mso-hide: all !important; }
|
|
565
571
|
}
|
|
566
572
|
@media only screen and (min-width: 481px) {
|
|
567
573
|
.tpl-hide-desktop { display: none !important; mso-hide: all !important; }
|
|
568
574
|
}
|
|
569
|
-
</mj-style>${
|
|
575
|
+
</mj-style>${ft(f)}
|
|
570
576
|
</mj-head>
|
|
571
|
-
<mj-body width="${
|
|
572
|
-
${
|
|
577
|
+
<mj-body width="${D(String(m.containerWidth))}px" background-color="${O(_)}">
|
|
578
|
+
${ee}
|
|
573
579
|
</mj-body>
|
|
574
580
|
</mjml>`;
|
|
575
581
|
}
|
|
576
|
-
function
|
|
577
|
-
if (
|
|
578
|
-
let
|
|
579
|
-
return
|
|
580
|
-
backgroundColor:
|
|
581
|
-
padding:
|
|
582
|
-
borderRadius:
|
|
583
|
-
backgroundImage:
|
|
584
|
-
},
|
|
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));
|
|
585
591
|
}
|
|
586
|
-
if (
|
|
587
|
-
let
|
|
588
|
-
return
|
|
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);
|
|
589
595
|
}
|
|
590
|
-
return
|
|
596
|
+
return Y(t, at(X(t, r), r.contentDirection));
|
|
591
597
|
}
|
|
592
|
-
function
|
|
598
|
+
function Z(e, t) {
|
|
593
599
|
return e.withContainerWidth(e.containerWidth, Math.floor(e.contentWidth) - z(t));
|
|
594
600
|
}
|
|
595
|
-
function
|
|
596
|
-
return `<mj-wrapper${
|
|
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\"" : ""}>
|
|
597
603
|
${e}
|
|
598
604
|
</mj-wrapper>`;
|
|
599
605
|
}
|
|
600
|
-
function
|
|
606
|
+
function at(e, t) {
|
|
601
607
|
if (e === "") return "";
|
|
602
608
|
let n = t === "rtl" ? " direction=\"rtl\"" : "";
|
|
603
609
|
return `<mj-section${n}>
|
|
@@ -606,21 +612,21 @@ ${e}
|
|
|
606
612
|
</mj-column>
|
|
607
613
|
</mj-section>`;
|
|
608
614
|
}
|
|
609
|
-
function
|
|
615
|
+
function ot(e) {
|
|
610
616
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
611
617
|
}
|
|
612
|
-
function
|
|
618
|
+
function st(e) {
|
|
613
619
|
if (!e) return "";
|
|
614
620
|
let t = e.trim();
|
|
615
|
-
return t === "" ? "" : `\n <mj-preview>${
|
|
621
|
+
return t === "" ? "" : `\n <mj-preview>${E(t)}</mj-preview>`;
|
|
616
622
|
}
|
|
617
|
-
function
|
|
618
|
-
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${
|
|
623
|
+
function ct(e) {
|
|
624
|
+
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${D(e.name)}" href="${D(e.url)}" />`).join("");
|
|
619
625
|
}
|
|
620
|
-
function
|
|
626
|
+
function Q(e, t) {
|
|
621
627
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
622
628
|
}
|
|
623
|
-
async function
|
|
629
|
+
async function lt(e, t) {
|
|
624
630
|
let n = /* @__PURE__ */ new Map();
|
|
625
631
|
if (!t) return n;
|
|
626
632
|
let r = [];
|
|
@@ -629,7 +635,7 @@ async function ct(e, t) {
|
|
|
629
635
|
for (let e = 0; e < r.length; e++) n.set(r[e].id, i[e]);
|
|
630
636
|
return n;
|
|
631
637
|
}
|
|
632
|
-
async function
|
|
638
|
+
async function ut(e, t) {
|
|
633
639
|
let n = /* @__PURE__ */ new Map(), r = [];
|
|
634
640
|
if ($(e.blocks, r), r.length === 0) return n;
|
|
635
641
|
let i;
|
|
@@ -638,9 +644,9 @@ async function lt(e, t) {
|
|
|
638
644
|
} catch {
|
|
639
645
|
throw Error("[Templatical] customBlocks requires the optional liquidjs package.");
|
|
640
646
|
}
|
|
641
|
-
let
|
|
647
|
+
let o = a(i), s = new Map(t.map((e) => [e.type, e])), c = await Promise.all(r.map(async (e) => {
|
|
642
648
|
let t = s.get(e.customType);
|
|
643
|
-
return t ? String(await
|
|
649
|
+
return t ? String(await o.parseAndRender(t.template, e.fieldValues)) : void 0;
|
|
644
650
|
}));
|
|
645
651
|
for (let e = 0; e < r.length; e++) {
|
|
646
652
|
let t = c[e];
|
|
@@ -648,12 +654,12 @@ async function lt(e, t) {
|
|
|
648
654
|
}
|
|
649
655
|
return n;
|
|
650
656
|
}
|
|
651
|
-
function $(
|
|
652
|
-
for (let
|
|
653
|
-
else if (
|
|
654
|
-
else
|
|
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);
|
|
655
661
|
}
|
|
656
|
-
function
|
|
662
|
+
function dt(e, t, n) {
|
|
657
663
|
let r = [];
|
|
658
664
|
if ($(e.blocks, r), r.length === 0) return [];
|
|
659
665
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -669,9 +675,9 @@ function ut(e, t, n) {
|
|
|
669
675
|
}
|
|
670
676
|
return s;
|
|
671
677
|
}
|
|
672
|
-
function
|
|
678
|
+
function ft(e) {
|
|
673
679
|
return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
|
|
674
680
|
}
|
|
675
|
-
export {
|
|
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 };
|
|
676
682
|
|
|
677
|
-
//# sourceMappingURL=src-
|
|
683
|
+
//# sourceMappingURL=src-UR3AQocX.js.map
|