@templatical/editor 0.34.2 → 0.35.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/{AiChatSidebar-CkHJ28sf.js → AiChatSidebar-DPHbCGu4.js} +29 -21
- package/dist/{AiFeatureMenu-DWdKguDN.js → AiFeatureMenu--8z7qvg1.js} +4 -4
- package/dist/{BlockIssueBadge-DcyHTAqw.js → BlockIssueBadge-BGCsJqqM.js} +2 -2
- package/dist/BlockPreviewCanvas-DKspIy8V.js +131 -0
- package/dist/{CloudHeaderExtras-BJ3Cebhv.js → CloudHeaderExtras-CRUQvgSV.js} +2 -2
- package/dist/{CloudPanels-BGz9ygo6.js → CloudPanels-Bp5gFtaL.js} +3 -3
- package/dist/{CollaboratorBar-KphmSQeZ.js → CollaboratorBar-DvwZm5u7.js} +57 -49
- package/dist/{ColorPicker-C6EOwtHC.js → ColorPicker-DtozuN75.js} +1 -1
- package/dist/{CommentsPanel-DmWh8f08.js → CommentsPanel-3C-DsEjy.js} +1 -1
- package/dist/{CommentsSidebar-CL_tffzT.js → CommentsSidebar-go1FnjDW.js} +34 -25
- package/dist/{CountdownToolbar-B8J4i5Xp.js → CountdownToolbar-SLBuij7Q.js} +1 -1
- package/dist/{DesignReferenceSidebar-BDhEeaAh.js → DesignReferenceSidebar-rcE_BvUd.js} +55 -47
- package/dist/{IssuesPanel-CiOjeRFI.js → IssuesPanel-Cig46N1i.js} +23 -15
- package/dist/{MergeTagInput-RytOlh1A.js → MergeTagInput-D1hzsn2b.js} +42 -33
- package/dist/{MergeTagModeToggle-Bi-FydXj.js → MergeTagModeToggle-CH9wR5YF.js} +70 -58
- package/dist/{ParagraphEditor-C87tkmtE.js → ParagraphEditor-CT2AdMdZ.js} +365 -323
- package/dist/{RestoreVersionDialog-Db5rZRMA.js → RestoreVersionDialog-mdqgQxFR.js} +3 -3
- package/dist/{RichTextEditorContent-BmTcV2-a.js → RichTextEditorContent-riOB-rKD.js} +48 -36
- package/dist/{SaveBlockDialog-CDCzx6Bo.js → SaveBlockDialog-Cn2v4Lpj.js} +6 -6
- package/dist/{SavedBlocksBrowserModal-DQR6kJB1.js → SavedBlocksBrowserModal-BORqqASb.js} +7 -7
- package/dist/{SavedBlocksPanels-DFzV0CRD.js → SavedBlocksPanels-ffBnWuVU.js} +1 -1
- package/dist/{SavedBlocksPickBar-XyXmnSnO.js → SavedBlocksPickBar-BmQC2tWN.js} +2 -2
- package/dist/{TemplateScoringPanel-CpyEKMzC.js → TemplateScoringPanel-CxAtdreR.js} +36 -27
- package/dist/{TestEmailModal-DIfJy9eE.js → TestEmailModal-Cjn1padY.js} +7 -7
- package/dist/{TestEmailPanel-C8Wx5yPS.js → TestEmailPanel-Bf3XZ1jn.js} +1 -1
- package/dist/{TitleEditor-iNFOisr4.js → TitleEditor-pYEUX6lR.js} +5 -5
- package/dist/{TplModal-CowM3o_F.js → TplModal-DRx4ytx8.js} +1 -1
- package/dist/{VersionHistoryMenu-CV90OhXs.js → VersionHistoryMenu-CrNrGsaa.js} +21 -13
- package/dist/{VersionHistoryPanels-BE3pplJG.js → VersionHistoryPanels-CsuQk6W3.js} +1 -1
- package/dist/{VersionPreviewBanner-BwUWBtlH.js → VersionPreviewBanner-BqbO0Zss.js} +1 -1
- package/dist/blockTypeIcons-D_4HdaY9.js +175 -0
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-C0hfqt4U.js → ca-D9S-UCfZ.js} +2 -0
- package/dist/cdn/chunks/{AiChatSidebar-BEnIWn6s.js → AiChatSidebar-D0f74_nS.js} +3 -3
- package/dist/cdn/chunks/{AiChatSidebar-BEnIWn6s.js.map → AiChatSidebar-D0f74_nS.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-DMl23akc.js → AiFeatureMenu-DwGb3eF9.js} +3 -3
- package/dist/cdn/chunks/{AiFeatureMenu-DMl23akc.js.map → AiFeatureMenu-DwGb3eF9.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CloK4k3M.js → BlockIssueBadge-CosQgeJ-.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-CloK4k3M.js.map → BlockIssueBadge-CosQgeJ-.js.map} +1 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-CIpZ2a6g.js +133 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-CIpZ2a6g.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-b4KpVeUN.js → CloudHeaderExtras-CQzQwKFB.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-b4KpVeUN.js.map → CloudHeaderExtras-CQzQwKFB.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-DzwOq9lp.js → CloudPanels-BmexuLOU.js} +4 -4
- package/dist/cdn/chunks/{CloudPanels-DzwOq9lp.js.map → CloudPanels-BmexuLOU.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-WXKvpoGK.js → CollaboratorBar-DEICobpp.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-WXKvpoGK.js.map → CollaboratorBar-DEICobpp.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-BubTDiS1.js → ColorPicker-C7yC58FK.js} +2 -2
- package/dist/cdn/chunks/{ColorPicker-BubTDiS1.js.map → ColorPicker-C7yC58FK.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-DAA2VqX4.js → CommentsPanel-OjmKxLL7.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-DAA2VqX4.js.map → CommentsPanel-OjmKxLL7.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-Ci0M2ePp.js → CommentsSidebar-C4pWZGpy.js} +2 -2
- package/dist/cdn/chunks/{CommentsSidebar-Ci0M2ePp.js.map → CommentsSidebar-C4pWZGpy.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CzZq26Vp.js → CountdownToolbar-wlJOxyAl.js} +2 -2
- package/dist/cdn/chunks/{CountdownToolbar-CzZq26Vp.js.map → CountdownToolbar-wlJOxyAl.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-C_ehdX5C.js → DesignReferenceSidebar-DELhnh8h.js} +3 -3
- package/dist/cdn/chunks/{DesignReferenceSidebar-C_ehdX5C.js.map → DesignReferenceSidebar-DELhnh8h.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BXAN2_al.js → IssuesPanel-C9i3o8aE.js} +2 -2
- package/dist/cdn/chunks/{IssuesPanel-BXAN2_al.js.map → IssuesPanel-C9i3o8aE.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-1vcI9uQH.js → MergeTagInput-D76Kyvgu.js} +5 -5
- package/dist/cdn/chunks/{MergeTagInput-1vcI9uQH.js.map → MergeTagInput-D76Kyvgu.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-B_mUYJo4.js → MergeTagModeToggle-Dz3gxN2y.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-B_mUYJo4.js.map → MergeTagModeToggle-Dz3gxN2y.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DCDHMcmx.js → ParagraphEditor-DQn0HMfV.js} +176 -172
- package/dist/cdn/chunks/{ParagraphEditor-DCDHMcmx.js.map → ParagraphEditor-DQn0HMfV.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-BkSSwf-Q.js → RestoreVersionDialog-BdjOL8Oy.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-BkSSwf-Q.js.map → RestoreVersionDialog-BdjOL8Oy.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-S4KogjIj.js → RichTextEditorContent-Drzwgh0J.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-S4KogjIj.js.map → RichTextEditorContent-Drzwgh0J.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-BH774Nt0.js → SaveBlockDialog-B3rbmXSM.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-BH774Nt0.js.map → SaveBlockDialog-B3rbmXSM.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CSUqw_dD.js → SavedBlocksBrowserModal-CkUXlnd2.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-CSUqw_dD.js.map → SavedBlocksBrowserModal-CkUXlnd2.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-B6ApbCjG.js → SavedBlocksPanels-BPi3PZKP.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-B6ApbCjG.js.map → SavedBlocksPanels-BPi3PZKP.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-C9MXSRcR.js → SavedBlocksPickBar-BvB9A5W2.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-C9MXSRcR.js.map → SavedBlocksPickBar-BvB9A5W2.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-QVOxc9TZ.js → TemplateScoringPanel-BBCyLnOi.js} +2 -2
- package/dist/cdn/chunks/{TemplateScoringPanel-QVOxc9TZ.js.map → TemplateScoringPanel-BBCyLnOi.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-_CZvaO58.js → TestEmailModal-DAGTsBqi.js} +7 -7
- package/dist/cdn/chunks/{TestEmailModal-_CZvaO58.js.map → TestEmailModal-DAGTsBqi.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-DXLxvyrD.js → TestEmailPanel-BfenVvfx.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-DXLxvyrD.js.map → TestEmailPanel-BfenVvfx.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-BuCOahW3.js → TitleEditor-oQ4gr6wS.js} +5 -5
- package/dist/cdn/chunks/{TitleEditor-BuCOahW3.js.map → TitleEditor-oQ4gr6wS.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-CqY8R3hn.js → TplModal-DxOMcVwp.js} +2 -2
- package/dist/cdn/chunks/{TplModal-CqY8R3hn.js.map → TplModal-DxOMcVwp.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DDjIBvad.js → VersionHistoryMenu-BfVUvWHT.js} +4 -4
- package/dist/cdn/chunks/{VersionHistoryMenu-DDjIBvad.js.map → VersionHistoryMenu-BfVUvWHT.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BuTw04T5.js → VersionHistoryPanels-NpDb641L.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BuTw04T5.js.map → VersionHistoryPanels-NpDb641L.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-fGAv20qI.js → VersionPreviewBanner-Cpgt4xHc.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-fGAv20qI.js.map → VersionPreviewBanner-Cpgt4xHc.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-ZEzEpCti.js → blockTypeIcons-t9vvaiuH.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-ZEzEpCti.js.map → blockTypeIcons-t9vvaiuH.js.map} +1 -1
- package/dist/cdn/chunks/{ca-C0hfqt4U.js → ca-D9S-UCfZ.js} +3 -1
- package/dist/cdn/chunks/{ca-C0hfqt4U.js.map → ca-D9S-UCfZ.js.map} +1 -1
- package/dist/cdn/chunks/{cloud-BP5-6__d.js → cloud-CullB76F.js} +2 -2
- package/dist/cdn/chunks/{cloud-BP5-6__d.js.map → cloud-CullB76F.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-JFE-sxbT.js → createCloudRuntime-Cx2JpUYU.js} +4 -4
- package/dist/cdn/chunks/{createCloudRuntime-JFE-sxbT.js.map → createCloudRuntime-Cx2JpUYU.js.map} +1 -1
- package/dist/{de-C6J2Iae8.js → cdn/chunks/de-BUPszLpi.js} +4 -0
- package/dist/cdn/chunks/{de-C6J2Iae8.js.map → de-BUPszLpi.js.map} +1 -1
- package/dist/cdn/chunks/{en-BaUYOQi8.js → en-BbOC5x3w.js} +3 -1
- package/dist/cdn/chunks/en-BbOC5x3w.js.map +1 -0
- package/dist/cdn/chunks/en-rGHphLWo.js +2 -0
- package/dist/cdn/chunks/{es-CKDYfJYn.js → es-0bCDcT9p.js} +3 -1
- package/dist/cdn/chunks/{es-CKDYfJYn.js.map → es-0bCDcT9p.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-7z04EIGg.js → extensions-BpXY7jO5.js} +3 -3
- package/dist/cdn/chunks/{extensions-7z04EIGg.js.map → extensions-BpXY7jO5.js.map} +1 -1
- package/dist/{fr-L8DR73mK.js → cdn/chunks/fr-Brr8mJ9e.js} +4 -0
- package/dist/cdn/chunks/fr-Brr8mJ9e.js.map +1 -0
- package/dist/cdn/chunks/icons-BLxcQUck.js +1675 -0
- package/dist/cdn/chunks/icons-BLxcQUck.js.map +1 -0
- package/dist/cdn/chunks/{nl-GDWeuX18.js → nl-Co3_RL0M.js} +3 -1
- package/dist/cdn/chunks/nl-Co3_RL0M.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-LFB-e-0m.js → preRenderCustomBlocks-Bdpiiw4A.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-LFB-e-0m.js.map → preRenderCustomBlocks-Bdpiiw4A.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-B1AVVhWj.js → pt-BR-BECez5b0.js} +3 -1
- package/dist/cdn/chunks/{pt-BR-B1AVVhWj.js.map → pt-BR-BECez5b0.js.map} +1 -1
- package/dist/cdn/chunks/{src-CX_VHu8r.js → src-BC-eolWY.js} +161 -160
- package/dist/cdn/chunks/src-BC-eolWY.js.map +1 -0
- package/dist/cdn/chunks/{src-BM3f9I7t.js → src-CUvZWL6Y.js} +83 -83
- package/dist/cdn/chunks/src-CUvZWL6Y.js.map +1 -0
- package/dist/cdn/chunks/{src-Cxl-9O-L.js → src-CaXeO-gG.js} +17 -17
- package/dist/cdn/chunks/{src-Cxl-9O-L.js.map → src-CaXeO-gG.js.map} +1 -1
- package/dist/cdn/chunks/{src-CLoCCDfs.js → src-Dwgq7hf4.js} +71 -48
- package/dist/cdn/chunks/src-Dwgq7hf4.js.map +1 -0
- package/dist/cdn/chunks/{useEditorCore-ehUSEsbw.js → useEditorCore-D4MytYB9.js} +495 -485
- package/dist/cdn/chunks/useEditorCore-D4MytYB9.js.map +1 -0
- package/dist/cdn/chunks/{useMergeTag-TLhF2fGK.js → useMergeTag-CSocWpxV.js} +2 -2
- package/dist/cdn/chunks/{useMergeTag-TLhF2fGK.js.map → useMergeTag-CSocWpxV.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +920 -907
- package/dist/cdn/editor.js.map +1 -1
- package/dist/check-CY-Ec6FV.js +11 -0
- package/dist/chevron-down-BghbWA9p.js +11 -0
- package/dist/chevron-up-n3qFAPS3.js +11 -0
- package/dist/circle-alert-L5uGGFRP.js +30 -0
- package/dist/clock-Dgnwp18n.js +16 -0
- package/dist/{cloud-BMzRKCbk.js → cloud-B1c4XIsn.js} +1 -1
- package/dist/{createCloudRuntime-DbTFm1ES.js → createCloudRuntime-PevFSH74.js} +2 -2
- package/dist/createLucideIcon-05lB8iWe.js +96 -0
- package/dist/{cdn/chunks/de-C6J2Iae8.js → de-BUPszLpi.js} +2 -2
- package/dist/{dist-PL6vP4SC.js → dist-tGkjkX-v.js} +143 -122
- package/dist/{en-BaUYOQi8.js → en-BbOC5x3w.js} +2 -0
- package/dist/{es-CKDYfJYn.js → es-0bCDcT9p.js} +2 -0
- package/dist/{extensions-Mf8iHey9.js → extensions-Bawm4BOM.js} +2 -2
- package/dist/{cdn/chunks/fr-L8DR73mK.js → fr-Brr8mJ9e.js} +2 -2
- package/dist/image-up-ovhjl9u9.js +27 -0
- package/dist/info-c3KI927I.js +23 -0
- package/dist/loader-circle-B2Y8xZQb.js +12 -0
- package/dist/message-circle-B7K-naUa.js +11 -0
- package/dist/{nl-GDWeuX18.js → nl-Co3_RL0M.js} +2 -0
- package/dist/pencil-BhWTFcp4.js +14 -0
- package/dist/{preRenderCustomBlocks-CSIF-HyJ.js → preRenderCustomBlocks-DFXH54Zr.js} +1 -1
- package/dist/{pt-BR-B1AVVhWj.js → pt-BR-BECez5b0.js} +2 -0
- package/dist/refresh-cw-BqUR5vgO.js +37 -0
- package/dist/send-D1vvuW79.js +14 -0
- package/dist/shield-check-DjK54PnW.js +14 -0
- package/dist/sparkles-DNdS9V_3.js +28 -0
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1238 -1167
- package/dist/text-align-start-Bcmo_VUY.js +58 -0
- package/dist/trash-C9bMXvw4.js +30 -0
- package/dist/triangle-alert-Bn8Bd2Yv.js +22 -0
- package/dist/upload-DKgg1gno.js +21 -0
- package/dist/{useEditorCore-DdkQuTHl.js → useEditorCore-CYGvurZa.js} +1089 -1026
- package/dist/{useMergeTag-gSuYus-M.js → useMergeTag-C9GEpljB.js} +1 -1
- package/dist/{useScrollToBlock-CdI8fGqt.js → useScrollToBlock-oUx1HIZ2.js} +27 -23
- package/dist/x-BPKoRPTG.js +14 -0
- package/package.json +9 -9
- package/dist/BlockPreviewCanvas-B621ANn9.js +0 -129
- package/dist/blockTypeIcons-DQsKtHik.js +0 -134
- package/dist/cdn/chunks/BlockPreviewCanvas-DSiJFJa0.js +0 -131
- package/dist/cdn/chunks/BlockPreviewCanvas-DSiJFJa0.js.map +0 -1
- package/dist/cdn/chunks/en-BaUYOQi8.js.map +0 -1
- package/dist/cdn/chunks/en-mEKGL1PX.js +0 -2
- package/dist/cdn/chunks/fr-L8DR73mK.js.map +0 -1
- package/dist/cdn/chunks/icons-SP5Itd-A.js +0 -1218
- package/dist/cdn/chunks/icons-SP5Itd-A.js.map +0 -1
- package/dist/cdn/chunks/nl-GDWeuX18.js.map +0 -1
- package/dist/cdn/chunks/src-BM3f9I7t.js.map +0 -1
- package/dist/cdn/chunks/src-CLoCCDfs.js.map +0 -1
- package/dist/cdn/chunks/src-CX_VHu8r.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-ehUSEsbw.js.map +0 -1
- package/dist/check-JK8Uacq0.js +0 -7
- package/dist/chevron-down-a-fb_Ijn.js +0 -7
- package/dist/chevron-up-x4l0et_Y.js +0 -7
- package/dist/circle-alert-CJDW5LZo.js +0 -25
- package/dist/clock-BW6rXk2f.js +0 -12
- package/dist/createLucideIcon-Bvw1Zx56.js +0 -43
- package/dist/image-up-CuzFc1mu.js +0 -23
- package/dist/info-DybAwcA3.js +0 -19
- package/dist/loader-circle-t-SVgmJ3.js +0 -7
- package/dist/message-circle-DtwKrlhN.js +0 -7
- package/dist/pencil-2qhC-Y4q.js +0 -10
- package/dist/refresh-cw-C8SBuPdg.js +0 -29
- package/dist/send-BoqJliF6.js +0 -10
- package/dist/shield-check-D0dMaHtE.js +0 -10
- package/dist/sparkles-Dy2BJjiX.js +0 -23
- package/dist/text-align-start-DrxjxvIy.js +0 -43
- package/dist/trash-rYMzzHZd.js +0 -25
- package/dist/triangle-alert-DxnFj4-B.js +0 -17
- package/dist/upload-DZu1adQz.js +0 -17
- package/dist/x-DJOd1hS4.js +0 -10
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { $ as e, G as t,
|
|
1
|
+
import { $ as e, G as t, J as n, K as r, Q as i, R as a, U as o, W as s, X as c, Y as l, Z as u, et as d, it as f, q as p, rt as m, tt as h, v as g, y as _ } from "./src-Dwgq7hf4.js";
|
|
2
2
|
//#endregion
|
|
3
3
|
//#region ../renderer/src/render-context.ts
|
|
4
|
-
var
|
|
4
|
+
var v = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
5
5
|
name: "@templatical/renderer",
|
|
6
6
|
description: "Render Templatical email templates to MJML",
|
|
7
|
-
version: "0.
|
|
7
|
+
version: "0.35.0",
|
|
8
8
|
bugs: "https://github.com/templatical/sdk/issues",
|
|
9
9
|
dependencies: { "@templatical/types": "workspace:*" },
|
|
10
10
|
devDependencies: {
|
|
@@ -42,7 +42,7 @@ var _ = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
42
42
|
},
|
|
43
43
|
type: "module",
|
|
44
44
|
types: "./dist/index.d.ts"
|
|
45
|
-
}.version}/assets/social`,
|
|
45
|
+
}.version}/assets/social`, y = {
|
|
46
46
|
arial: "Arial, sans-serif",
|
|
47
47
|
helvetica: "Helvetica, sans-serif",
|
|
48
48
|
georgia: "Georgia, serif",
|
|
@@ -51,7 +51,7 @@ var _ = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
51
51
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
52
52
|
"courier new": "'Courier New', monospace",
|
|
53
53
|
tahoma: "Tahoma, sans-serif"
|
|
54
|
-
},
|
|
54
|
+
}, b = class e {
|
|
55
55
|
containerWidth;
|
|
56
56
|
customFonts;
|
|
57
57
|
defaultFallbackFont;
|
|
@@ -59,31 +59,32 @@ var _ = `https://cdn.jsdelivr.net/npm/@templatical/renderer@${{
|
|
|
59
59
|
customBlockHtml;
|
|
60
60
|
socialIconsBaseUrl;
|
|
61
61
|
blockRenderers;
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
contentDirection;
|
|
63
|
+
constructor(e, t, n, r, i = /* @__PURE__ */ new Map(), a = v, o = {}, s = "ltr") {
|
|
64
|
+
this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i, this.socialIconsBaseUrl = a, this.blockRenderers = o, this.contentDirection = s;
|
|
64
65
|
}
|
|
65
66
|
withContainerWidth(t) {
|
|
66
|
-
return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml, this.socialIconsBaseUrl, this.blockRenderers);
|
|
67
|
+
return new e(t, this.customFonts, this.defaultFallbackFont, this.allowHtmlBlocks, this.customBlockHtml, this.socialIconsBaseUrl, this.blockRenderers, this.contentDirection);
|
|
67
68
|
}
|
|
68
69
|
resolveFontFamily(e) {
|
|
69
70
|
for (let t of this.customFonts) if (t.name.toLowerCase() === e.toLowerCase()) {
|
|
70
71
|
let e = t.fallback ?? this.defaultFallbackFont;
|
|
71
72
|
return `'${t.name}', ${e}`;
|
|
72
73
|
}
|
|
73
|
-
return
|
|
74
|
+
return y[e.toLowerCase()] || e;
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
77
|
//#endregion
|
|
77
78
|
//#region ../renderer/src/visibility.ts
|
|
78
|
-
function
|
|
79
|
+
function x(e) {
|
|
79
80
|
let t = e.visibility;
|
|
80
81
|
return t ? !t.desktop && !t.mobile : !1;
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
-
let n = [
|
|
83
|
+
function S(e, t = []) {
|
|
84
|
+
let n = [C(e), ...t].filter((e) => e !== "").join(" ");
|
|
84
85
|
return n === "" ? "" : ` css-class="${n}"`;
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function C(e) {
|
|
87
88
|
let t = e.visibility;
|
|
88
89
|
if (!t) return "";
|
|
89
90
|
let n = [];
|
|
@@ -91,33 +92,33 @@ function S(e) {
|
|
|
91
92
|
}
|
|
92
93
|
//#endregion
|
|
93
94
|
//#region ../renderer/src/unrenderable.ts
|
|
94
|
-
var
|
|
95
|
-
function
|
|
95
|
+
var w = "templatical:unrenderable-block";
|
|
96
|
+
function T(e) {
|
|
96
97
|
return e.replace(/[<>]/g, "").replace(/-{2,}/g, "-");
|
|
97
98
|
}
|
|
98
|
-
function
|
|
99
|
-
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><!-- ${
|
|
99
|
+
function E(e) {
|
|
100
|
+
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><!-- ${w} type="${T(e.type)}" id="${T(e.id)}" --></mj-raw>`;
|
|
100
101
|
}
|
|
101
102
|
//#endregion
|
|
102
103
|
//#region ../renderer/src/escape.ts
|
|
103
|
-
var
|
|
104
|
+
var D = {
|
|
104
105
|
"&": "&",
|
|
105
106
|
"<": "<",
|
|
106
107
|
">": ">",
|
|
107
108
|
"\"": """,
|
|
108
109
|
"'": "'"
|
|
109
|
-
},
|
|
110
|
-
function O(e) {
|
|
111
|
-
return e === "" ? "" : e.replace(D, (e) => E[e] ?? e);
|
|
112
|
-
}
|
|
110
|
+
}, O = /[&<>"']/g;
|
|
113
111
|
function k(e) {
|
|
114
|
-
return e === "" ? "" : e.replace(
|
|
112
|
+
return e === "" ? "" : e.replace(O, (e) => D[e] ?? e);
|
|
115
113
|
}
|
|
116
114
|
function A(e) {
|
|
117
|
-
return e === "" ? "" :
|
|
115
|
+
return e === "" ? "" : e.replace(O, (e) => D[e] ?? e);
|
|
118
116
|
}
|
|
119
117
|
function j(e) {
|
|
120
|
-
return e === "" ? "" :
|
|
118
|
+
return e === "" ? "" : A(e).replace(/[;{}\r\n]/g, "");
|
|
119
|
+
}
|
|
120
|
+
function M(e) {
|
|
121
|
+
return e === "" ? "" : ee(e, (e) => N(e, "data-merge-tag") ?? N(e, "data-logic-merge-tag"));
|
|
121
122
|
}
|
|
122
123
|
function ee(e, t) {
|
|
123
124
|
let n = "", r = 0;
|
|
@@ -132,7 +133,7 @@ function ee(e, t) {
|
|
|
132
133
|
n += e.substring(r, i + 5), r = i + 5;
|
|
133
134
|
continue;
|
|
134
135
|
}
|
|
135
|
-
let o =
|
|
136
|
+
let o = g(e, i + 5);
|
|
136
137
|
if (o === -1) {
|
|
137
138
|
n += e.substring(r);
|
|
138
139
|
break;
|
|
@@ -151,45 +152,45 @@ function ee(e, t) {
|
|
|
151
152
|
}
|
|
152
153
|
return n;
|
|
153
154
|
}
|
|
154
|
-
function
|
|
155
|
-
return
|
|
155
|
+
function N(e, t) {
|
|
156
|
+
return _(e, t);
|
|
156
157
|
}
|
|
157
158
|
//#endregion
|
|
158
159
|
//#region ../renderer/src/padding.ts
|
|
159
|
-
function
|
|
160
|
+
function P(e) {
|
|
160
161
|
return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
|
|
161
162
|
}
|
|
162
163
|
//#endregion
|
|
163
164
|
//#region ../renderer/src/utils.ts
|
|
164
|
-
function
|
|
165
|
+
function F(e, t) {
|
|
165
166
|
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function I(e) {
|
|
168
169
|
return typeof e != "number" || !Number.isFinite(e) || e <= 0 ? "" : ` height="${e}px"`;
|
|
169
170
|
}
|
|
170
171
|
//#endregion
|
|
171
172
|
//#region ../renderer/src/rich-text.ts
|
|
172
|
-
var
|
|
173
|
-
function
|
|
174
|
-
return `${
|
|
173
|
+
var L = "tpl-rich-text";
|
|
174
|
+
function R(e) {
|
|
175
|
+
return `${L}-${e}`;
|
|
175
176
|
}
|
|
176
|
-
function te(e) {
|
|
177
|
-
let
|
|
177
|
+
function te(e, t = "ltr") {
|
|
178
|
+
let n = f, r = `.${L}`, i = [...new Set(e)].sort((e, t) => e - t).flatMap((e) => {
|
|
179
|
+
let t = `.${R(e)}`;
|
|
180
|
+
return [`${t} p { margin: 0 0 ${e}px; }`, `${t} p:last-child { margin-bottom: 0; }`];
|
|
181
|
+
}), a = t === "rtl" ? "padding-right" : "padding-left";
|
|
178
182
|
return [
|
|
179
|
-
...
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}),
|
|
183
|
-
`${n} ul, ${n} ol { margin: ${t.listMarginY}px 0; padding-left: ${t.listPaddingLeft}px; }`,
|
|
184
|
-
`${n} li { margin: ${t.listItemMarginY}px 0; }`
|
|
183
|
+
...i,
|
|
184
|
+
`${r} ul, ${r} ol { margin: ${n.listMarginY}px 0; ${a}: ${n.listPaddingLeft}px; }`,
|
|
185
|
+
`${r} li { margin: ${n.listItemMarginY}px 0; }`
|
|
185
186
|
].join("\n ");
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
-
return e ??
|
|
188
|
+
function z(e) {
|
|
189
|
+
return e ?? f.paragraphGap;
|
|
189
190
|
}
|
|
190
191
|
function ne(e) {
|
|
191
|
-
let t = [
|
|
192
|
-
if (e.type === "paragraph" && t.push(
|
|
192
|
+
let t = [f.paragraphGap], n = (e) => {
|
|
193
|
+
if (e.type === "paragraph" && t.push(z(e.paragraphSpacing)), c(e)) for (let t of e.children) for (let e of t) n(e);
|
|
193
194
|
};
|
|
194
195
|
for (let t of e) n(t);
|
|
195
196
|
return t;
|
|
@@ -197,8 +198,8 @@ function ne(e) {
|
|
|
197
198
|
//#endregion
|
|
198
199
|
//#region ../renderer/src/renderers/title.ts
|
|
199
200
|
function re(e, t) {
|
|
200
|
-
if (
|
|
201
|
-
let n =
|
|
201
|
+
if (x(e)) return "";
|
|
202
|
+
let n = P(e.styles.padding), r = F(e.styles.backgroundColor, "container"), i = ie(M(e.content)), a = m[e.level] ?? m[2], o = e.color ? `\n color="${A(e.color)}"` : "", s = e.textAlign, c = ae(e.fontFamily, t), l = S(e, [L, R(z(void 0))]), u = `h${m[e.level] ? e.level : 2}`;
|
|
202
203
|
return `<mj-text
|
|
203
204
|
font-size="${a}px"${o}
|
|
204
205
|
align="${s}"
|
|
@@ -216,23 +217,23 @@ function ae(e, t) {
|
|
|
216
217
|
//#endregion
|
|
217
218
|
//#region ../renderer/src/renderers/paragraph.ts
|
|
218
219
|
function oe(e, t) {
|
|
219
|
-
if (
|
|
220
|
-
let n =
|
|
220
|
+
if (x(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
|
|
221
|
+
let n = P(e.styles.padding), r = F(e.styles.backgroundColor, "container"), i = M(e.content), a = S(e, [L, R(z(e.paragraphSpacing))]);
|
|
221
222
|
return `<mj-text
|
|
222
|
-
line-height="1.5"
|
|
223
|
-
padding="${n}"${r}${
|
|
223
|
+
line-height="1.5"${t.contentDirection === "rtl" ? "\n align=\"right\"" : ""}
|
|
224
|
+
padding="${n}"${r}${a}
|
|
224
225
|
>${i}</mj-text>`;
|
|
225
226
|
}
|
|
226
227
|
//#endregion
|
|
227
228
|
//#region ../renderer/src/renderers/image.ts
|
|
228
|
-
function
|
|
229
|
-
if (
|
|
230
|
-
let n =
|
|
231
|
-
e.linkUrl && (c = ` href="${
|
|
232
|
-
let l =
|
|
229
|
+
function B(e, t) {
|
|
230
|
+
if (x(e) || e.src === "") return "";
|
|
231
|
+
let n = P(e.styles.padding), r = F(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = I(e.height), o = S(e), s = e.borderRadius && e.borderRadius > 0 ? ` border-radius="${e.borderRadius}px"` : "", c = "";
|
|
232
|
+
e.linkUrl && (c = ` href="${A(e.linkUrl)}"`, e.linkOpenInNewTab && (c += " target=\"_blank\" rel=\"noopener\""));
|
|
233
|
+
let l = A(e.src), u = e.decorative === !0;
|
|
233
234
|
return `<mj-image
|
|
234
235
|
src="${l}"
|
|
235
|
-
alt="${u ? "" :
|
|
236
|
+
alt="${u ? "" : A(e.alt)}"
|
|
236
237
|
width="${i}"${a}
|
|
237
238
|
align="${e.align}"
|
|
238
239
|
padding="${n}"${r}${s}${c}${o}${u ? " role=\"presentation\"" : ""}
|
|
@@ -240,9 +241,9 @@ function z(e, t) {
|
|
|
240
241
|
}
|
|
241
242
|
//#endregion
|
|
242
243
|
//#region ../renderer/src/renderers/button.ts
|
|
243
|
-
function
|
|
244
|
-
if (
|
|
245
|
-
let n =
|
|
244
|
+
function V(e, t) {
|
|
245
|
+
if (x(e)) return "";
|
|
246
|
+
let n = P(e.styles.padding), r = F(e.styles.backgroundColor, "container"), i = P(e.buttonPadding), a = e.url === "" ? "" : A(e.url), o = a === "" ? "" : ` href="${a}"`, s = A(e.backgroundColor), c = A(e.textColor), l = e.fontSize, u = e.borderRadius, d = k(e.text), f = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", p = H(e.fontFamily, t), m = U(e.width), h = S(e);
|
|
246
247
|
return `<mj-button${o}${f}
|
|
247
248
|
background-color="${s}"
|
|
248
249
|
color="${c}"
|
|
@@ -254,48 +255,48 @@ function B(e, t) {
|
|
|
254
255
|
padding="${n}"${r}${p}${m}${h}
|
|
255
256
|
>${d}</mj-button>`;
|
|
256
257
|
}
|
|
257
|
-
function
|
|
258
|
+
function H(e, t) {
|
|
258
259
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
259
260
|
}
|
|
260
|
-
function
|
|
261
|
+
function U(e) {
|
|
261
262
|
return e === void 0 ? "" : ` width="${e === "full" ? "100%" : `${e}px`}"`;
|
|
262
263
|
}
|
|
263
264
|
//#endregion
|
|
264
265
|
//#region ../renderer/src/renderers/divider.ts
|
|
265
|
-
function
|
|
266
|
-
if (
|
|
267
|
-
let n =
|
|
266
|
+
function W(e, t) {
|
|
267
|
+
if (x(e)) return "";
|
|
268
|
+
let n = P(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${A(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
|
|
268
269
|
return `<mj-divider
|
|
269
270
|
border-width="${e.thickness}px"
|
|
270
271
|
border-style="${e.lineStyle}"
|
|
271
|
-
border-color="${
|
|
272
|
+
border-color="${A(e.color)}"
|
|
272
273
|
width="${i}"
|
|
273
|
-
padding="${n}"${r}${
|
|
274
|
+
padding="${n}"${r}${S(e)}
|
|
274
275
|
/>`;
|
|
275
276
|
}
|
|
276
277
|
//#endregion
|
|
277
278
|
//#region ../renderer/src/renderers/spacer.ts
|
|
278
|
-
function
|
|
279
|
-
return
|
|
279
|
+
function G(e, t) {
|
|
280
|
+
return x(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${A(e.styles.backgroundColor)}"` : ""}${S(e)} />`;
|
|
280
281
|
}
|
|
281
282
|
//#endregion
|
|
282
283
|
//#region ../renderer/src/renderers/html.ts
|
|
283
|
-
function
|
|
284
|
-
if (
|
|
284
|
+
function K(e, t) {
|
|
285
|
+
if (x(e) || !t.allowHtmlBlocks) return "";
|
|
285
286
|
let n = e.content;
|
|
286
287
|
if (n === "") return "";
|
|
287
|
-
let r =
|
|
288
|
-
return `<mj-text padding="${
|
|
288
|
+
let r = S(e);
|
|
289
|
+
return `<mj-text padding="${P(e.styles.padding)}"${F(e.styles.backgroundColor, "container")}${r}>
|
|
289
290
|
${n}
|
|
290
291
|
</mj-text>`;
|
|
291
292
|
}
|
|
292
293
|
//#endregion
|
|
293
294
|
//#region ../renderer/src/renderers/social.ts
|
|
294
|
-
function
|
|
295
|
-
if (
|
|
295
|
+
function q(e, t) {
|
|
296
|
+
if (x(e)) return "";
|
|
296
297
|
let n = e.icons;
|
|
297
298
|
if (n.length === 0) return "";
|
|
298
|
-
let r =
|
|
299
|
+
let r = P(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${A(e.styles.backgroundColor)}"` : "", a = S(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
|
|
299
300
|
switch (s) {
|
|
300
301
|
case "small":
|
|
301
302
|
u = 24;
|
|
@@ -326,77 +327,77 @@ function K(e, t) {
|
|
|
326
327
|
padding="${r}"${i}${a}
|
|
327
328
|
>
|
|
328
329
|
${n.map((e, n) => {
|
|
329
|
-
let r = e.platform, i =
|
|
330
|
+
let r = e.platform, i = A(e.url), a = `${t.socialIconsBaseUrl}/${c}/${r}.png`, o = n === f - 1 ? 0 : l;
|
|
330
331
|
return `<mj-social-element src="${a}" href="${i}" icon-size="${u}px" padding="0 ${o}px 0 0" border-radius="${d}" background-color="transparent"></mj-social-element>`;
|
|
331
332
|
}).join("\n")}
|
|
332
333
|
</mj-social>`;
|
|
333
334
|
}
|
|
334
335
|
//#endregion
|
|
335
336
|
//#region ../renderer/src/renderers/menu.ts
|
|
336
|
-
function
|
|
337
|
-
if (
|
|
338
|
-
let n =
|
|
337
|
+
function se(e, t) {
|
|
338
|
+
if (x(e) || e.items.length === 0) return "";
|
|
339
|
+
let n = P(e.styles.padding), r = F(e.styles.backgroundColor, "container"), i = S(e), a = ue(e.fontFamily, t), o = e.textAlign;
|
|
339
340
|
return `<mj-text
|
|
340
|
-
font-size="${e.fontSize}px"${e.color ? `\n color="${
|
|
341
|
+
font-size="${e.fontSize}px"${e.color ? `\n color="${A(e.color)}"` : ""}
|
|
341
342
|
align="${o}"
|
|
342
343
|
line-height="1.5"
|
|
343
344
|
padding="${n}"${r}${a}${i}
|
|
344
|
-
>${
|
|
345
|
+
>${ce(e)}</mj-text>`;
|
|
345
346
|
}
|
|
346
|
-
function
|
|
347
|
-
let t = e.items, n =
|
|
348
|
-
for (let e = 0; e < s; e++) o.push(
|
|
347
|
+
function ce(e) {
|
|
348
|
+
let t = e.items, n = k(e.separator), r = j(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
|
|
349
|
+
for (let e = 0; e < s; e++) o.push(le(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
|
|
349
350
|
return o.join("");
|
|
350
351
|
}
|
|
351
|
-
function ce(e, t) {
|
|
352
|
-
let n = O(e.text), r = k(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
|
|
353
|
-
return i && o.unshift(`color: ${A(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
354
|
-
}
|
|
355
352
|
function le(e, t) {
|
|
353
|
+
let n = k(e.text), r = A(e.url), i = e.color ?? t, a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = ["text-decoration: none"];
|
|
354
|
+
return i && o.unshift(`color: ${j(i)}`), e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
355
|
+
}
|
|
356
|
+
function ue(e, t) {
|
|
356
357
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
357
358
|
}
|
|
358
359
|
//#endregion
|
|
359
360
|
//#region ../renderer/src/renderers/table.ts
|
|
360
|
-
function
|
|
361
|
-
if (
|
|
362
|
-
let n =
|
|
361
|
+
function de(e, t) {
|
|
362
|
+
if (x(e) || e.rows.length === 0) return "";
|
|
363
|
+
let n = P(e.styles.padding), r = F(e.styles.backgroundColor, "container"), i = S(e), a = he(e.fontFamily, t);
|
|
363
364
|
return `<mj-text
|
|
364
|
-
font-size="${e.fontSize}px"${e.color ? `\n color="${
|
|
365
|
+
font-size="${e.fontSize}px"${e.color ? `\n color="${A(e.color)}"` : ""}
|
|
365
366
|
align="${e.textAlign}"
|
|
366
367
|
line-height="1.5"
|
|
367
368
|
padding="${n}"${r}${a}${i}
|
|
368
|
-
>${
|
|
369
|
+
>${fe(e)}</mj-text>`;
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
-
let t =
|
|
371
|
+
function fe(e) {
|
|
372
|
+
let t = j(e.borderColor), n = e.borderWidth, r = "";
|
|
372
373
|
for (let i = 0; i < e.rows.length; i++) {
|
|
373
374
|
let a = e.rows[i];
|
|
374
|
-
r +=
|
|
375
|
+
r += pe(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
375
376
|
}
|
|
376
377
|
return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
|
|
377
378
|
}
|
|
378
|
-
function
|
|
379
|
+
function pe(e, t, n, r, i) {
|
|
379
380
|
let a = "";
|
|
380
|
-
for (let o of e.cells) a +=
|
|
381
|
+
for (let o of e.cells) a += me(o, t, n, r, i);
|
|
381
382
|
return `<tr>${a}</tr>`;
|
|
382
383
|
}
|
|
383
|
-
function
|
|
384
|
+
function me(e, t, n, r, i) {
|
|
384
385
|
let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
|
|
385
|
-
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${
|
|
386
|
-
let s = o.join("; "), c =
|
|
386
|
+
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${j(t.headerBackgroundColor)}`));
|
|
387
|
+
let s = o.join("; "), c = k(M(e.content)), l = n ? "th" : "td";
|
|
387
388
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
388
389
|
}
|
|
389
|
-
function
|
|
390
|
+
function he(e, t) {
|
|
390
391
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
391
392
|
}
|
|
392
393
|
//#endregion
|
|
393
394
|
//#region ../renderer/src/renderers/custom.ts
|
|
394
|
-
function
|
|
395
|
-
if (
|
|
395
|
+
function ge(e, t) {
|
|
396
|
+
if (x(e)) return "";
|
|
396
397
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
397
398
|
if (!n || n === "") return "";
|
|
398
|
-
let r =
|
|
399
|
-
return `<mj-text padding="${
|
|
399
|
+
let r = S(e);
|
|
400
|
+
return `<mj-text padding="${P(e.styles.padding)}"${F(e.styles.backgroundColor, "container")}${r}>
|
|
400
401
|
${n}
|
|
401
402
|
</mj-text>`;
|
|
402
403
|
}
|
|
@@ -439,28 +440,28 @@ function X(e, t) {
|
|
|
439
440
|
}
|
|
440
441
|
//#endregion
|
|
441
442
|
//#region ../renderer/src/renderers/section.ts
|
|
442
|
-
function
|
|
443
|
-
if (
|
|
444
|
-
let r = e.columns, i = J(r), a = Y(r, t.containerWidth), o =
|
|
443
|
+
function _e(e, t, n) {
|
|
444
|
+
if (x(e)) return "";
|
|
445
|
+
let r = e.columns, i = J(r), a = Y(r, t.containerWidth), o = P(e.styles.padding), s = F(e.styles.backgroundColor, "native"), l = S(e), u = e.borderRadius && e.borderRadius > 0 ? ` border-radius="${e.borderRadius}px"` : "", d = e.children, f = [];
|
|
445
446
|
for (let e = 0; e < d.length; e++) {
|
|
446
|
-
let r = d[e], o = i[e] ?? "100%", s = Math.floor(a[e] ?? t.containerWidth),
|
|
447
|
+
let r = d[e], o = i[e] ?? "100%", s = Math.floor(a[e] ?? t.containerWidth), l = ve(r, t.allowHtmlBlocks).filter((e) => !c(e)), u = t.withContainerWidth(s), p = l.map((e) => X(e, n(e, u))).filter((e) => e !== "").join("\n");
|
|
447
448
|
f.push(`<mj-column width="${o}">
|
|
448
449
|
${p === "" ? "<mj-text> </mj-text>" : p}
|
|
449
450
|
</mj-column>`);
|
|
450
451
|
}
|
|
451
|
-
let p = f.join("\n");
|
|
452
|
-
return `<mj-section${s} padding="${o}"${u}${
|
|
453
|
-
${e.stackOnMobile === !1 && f.length > 1 ? `<mj-group>
|
|
452
|
+
let p = f.join("\n"), m = t.contentDirection === "rtl" ? " direction=\"rtl\"" : "";
|
|
453
|
+
return `<mj-section${s} padding="${o}"${u}${l}${m}>
|
|
454
|
+
${e.stackOnMobile === !1 && f.length > 1 ? `<mj-group${m}>
|
|
454
455
|
${p}
|
|
455
456
|
</mj-group>` : p}
|
|
456
457
|
</mj-section>`;
|
|
457
458
|
}
|
|
458
|
-
function
|
|
459
|
+
function ve(e, t) {
|
|
459
460
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
460
461
|
}
|
|
461
462
|
//#endregion
|
|
462
463
|
//#region ../renderer/src/renderers/video.ts
|
|
463
|
-
function
|
|
464
|
+
function ye(e, t) {
|
|
464
465
|
if (t) return t;
|
|
465
466
|
if (!e) return null;
|
|
466
467
|
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})/]) {
|
|
@@ -470,93 +471,93 @@ function ve(e, t) {
|
|
|
470
471
|
let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
|
|
471
472
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
472
473
|
}
|
|
473
|
-
function
|
|
474
|
-
if (
|
|
475
|
-
let n =
|
|
474
|
+
function be(e, t) {
|
|
475
|
+
if (x(e)) return "";
|
|
476
|
+
let n = ye(e.url, e.thumbnailUrl);
|
|
476
477
|
if (!n) return "";
|
|
477
|
-
let r =
|
|
478
|
+
let r = P(e.styles.padding), i = F(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = I(e.height), s = S(e);
|
|
478
479
|
return `<mj-image
|
|
479
|
-
src="${
|
|
480
|
-
alt="${
|
|
480
|
+
src="${A(n)}"
|
|
481
|
+
alt="${A(e.alt)}"
|
|
481
482
|
width="${a}"${o}
|
|
482
483
|
align="${e.align}"
|
|
483
484
|
padding="${r}"
|
|
484
|
-
href="${
|
|
485
|
+
href="${A(e.url)}"
|
|
485
486
|
target="_blank"
|
|
486
487
|
rel="noopener"${i}${s}
|
|
487
488
|
/>`;
|
|
488
489
|
}
|
|
489
490
|
//#endregion
|
|
490
491
|
//#region ../renderer/src/renderers/index.ts
|
|
491
|
-
function Z(
|
|
492
|
-
let
|
|
493
|
-
return
|
|
492
|
+
function Z(a, f) {
|
|
493
|
+
let m = f.blockRenderers[a.type];
|
|
494
|
+
return m ? m(a, f) : c(a) ? _e(a, f, Z) : d(a) ? re(a, f) : l(a) ? oe(a, f) : p(a) ? B(a, f) : o(a) ? V(a, f) : t(a) ? W(a, f) : i(a) ? G(a, f) : r(a) ? K(a, f) : u(a) ? q(a, f) : n(a) ? se(a, f) : e(a) ? de(a, f) : h(a) ? be(a, f) : s(a) ? ge(a, f) : x(a) ? "" : E(a);
|
|
494
495
|
}
|
|
495
496
|
//#endregion
|
|
496
497
|
//#region ../renderer/src/index.ts
|
|
497
|
-
async function
|
|
498
|
-
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0,
|
|
499
|
-
return `<mjml lang="${
|
|
500
|
-
<mj-head>${
|
|
498
|
+
async function xe(e, t) {
|
|
499
|
+
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, o = we(t?.socialIconsBaseUrl ?? v), s = await Oe(e, t?.renderCustomBlock), c = ke(e, t?.getCustomBlockStylesheet), l = a(e.settings), u = new b(e.settings.width, n, r, i, s, o, t?.blockRenderers ?? {}, l), d = De(e.blocks, i), f = u.resolveFontFamily(e.settings.fontFamily), p = e.settings.backgroundColor, m = e.settings.textColor ? ` color="${A(e.settings.textColor)}"` : "", h = e.settings.linkColor ? j(e.settings.linkColor) : "inherit", g = e.settings.linkUnderline ? "underline" : "none", _ = d.map((e) => Q(e, u)).filter((e) => e !== "").join("\n"), y = Ee(n), x = Te(e.settings.preheaderText);
|
|
500
|
+
return `<mjml lang="${A(e.settings.locale)}" dir="${A(l)}">
|
|
501
|
+
<mj-head>${x}
|
|
501
502
|
<mj-attributes>
|
|
502
|
-
<mj-all font-family="${
|
|
503
|
-
<mj-text font-size="14px"${
|
|
503
|
+
<mj-all font-family="${f}" />
|
|
504
|
+
<mj-text font-size="14px"${m} />
|
|
504
505
|
<mj-section padding="0" />
|
|
505
506
|
<mj-column padding="0" />
|
|
506
507
|
<mj-image fluid-on-mobile="true" />
|
|
507
|
-
</mj-attributes>${
|
|
508
|
+
</mj-attributes>${y}
|
|
508
509
|
<mj-style inline="inline">
|
|
509
|
-
${te(ne(l)
|
|
510
|
+
${te(ne(d), l)}
|
|
510
511
|
</mj-style>
|
|
511
512
|
<mj-style>
|
|
512
|
-
a { color: ${
|
|
513
|
+
a { color: ${h}; text-decoration: ${g}; }
|
|
513
514
|
@media only screen and (max-width: 480px) {
|
|
514
515
|
.tpl-hide-mobile { display: none !important; mso-hide: all !important; }
|
|
515
516
|
}
|
|
516
517
|
@media only screen and (min-width: 481px) {
|
|
517
518
|
.tpl-hide-desktop { display: none !important; mso-hide: all !important; }
|
|
518
519
|
}
|
|
519
|
-
</mj-style>${
|
|
520
|
+
</mj-style>${Ae(c)}
|
|
520
521
|
</mj-head>
|
|
521
|
-
<mj-body width="${
|
|
522
|
-
${
|
|
522
|
+
<mj-body width="${u.containerWidth}px" background-color="${p}">
|
|
523
|
+
${_}
|
|
523
524
|
</mj-body>
|
|
524
525
|
</mjml>`;
|
|
525
526
|
}
|
|
526
|
-
function
|
|
527
|
-
if (
|
|
527
|
+
function Q(e, t) {
|
|
528
|
+
if (c(e)) {
|
|
528
529
|
let n = Z(e, t);
|
|
529
|
-
return X(e, e.wrapper && n !== "" ?
|
|
530
|
+
return X(e, e.wrapper && n !== "" ? Se(n, e.wrapper) : n);
|
|
530
531
|
}
|
|
531
|
-
return X(e,
|
|
532
|
+
return X(e, Ce(Z(e, t), t.contentDirection));
|
|
532
533
|
}
|
|
533
|
-
function
|
|
534
|
-
return `<mj-wrapper${
|
|
534
|
+
function Se(e, t) {
|
|
535
|
+
return `<mj-wrapper${F(t.backgroundColor, "native")}${` padding="${t.padding ? P(t.padding) : "0"}"`}${t.borderRadius && t.borderRadius > 0 ? ` border-radius="${t.borderRadius}px"` : ""}>
|
|
535
536
|
${e}
|
|
536
537
|
</mj-wrapper>`;
|
|
537
538
|
}
|
|
538
|
-
function
|
|
539
|
-
return e === "" ? "" : `<mj-section>
|
|
539
|
+
function Ce(e, t) {
|
|
540
|
+
return e === "" ? "" : `<mj-section${t === "rtl" ? " direction=\"rtl\"" : ""}>
|
|
540
541
|
<mj-column>
|
|
541
542
|
${e}
|
|
542
543
|
</mj-column>
|
|
543
544
|
</mj-section>`;
|
|
544
545
|
}
|
|
545
|
-
function
|
|
546
|
+
function we(e) {
|
|
546
547
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
547
548
|
}
|
|
548
|
-
function
|
|
549
|
+
function Te(e) {
|
|
549
550
|
if (!e) return "";
|
|
550
551
|
let t = e.trim();
|
|
551
|
-
return t === "" ? "" : `\n <mj-preview>${
|
|
552
|
+
return t === "" ? "" : `\n <mj-preview>${k(t)}</mj-preview>`;
|
|
552
553
|
}
|
|
553
|
-
function
|
|
554
|
-
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${
|
|
554
|
+
function Ee(e) {
|
|
555
|
+
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${A(e.name)}" href="${A(e.url)}" />`).join("");
|
|
555
556
|
}
|
|
556
|
-
function
|
|
557
|
+
function De(e, t) {
|
|
557
558
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
558
559
|
}
|
|
559
|
-
async function
|
|
560
|
+
async function Oe(e, t) {
|
|
560
561
|
let n = /* @__PURE__ */ new Map();
|
|
561
562
|
if (!t) return n;
|
|
562
563
|
let r = [];
|
|
@@ -567,14 +568,14 @@ async function De(e, t) {
|
|
|
567
568
|
}
|
|
568
569
|
function $(e, t) {
|
|
569
570
|
for (let n of e) {
|
|
570
|
-
if (
|
|
571
|
+
if (s(n)) {
|
|
571
572
|
t.push(n);
|
|
572
573
|
continue;
|
|
573
574
|
}
|
|
574
|
-
if (
|
|
575
|
+
if (c(n)) for (let e of n.children) $(e, t);
|
|
575
576
|
}
|
|
576
577
|
}
|
|
577
|
-
function
|
|
578
|
+
function ke(e, t) {
|
|
578
579
|
if (!t) return [];
|
|
579
580
|
let n = [];
|
|
580
581
|
if ($(e.blocks, n), n.length === 0) return [];
|
|
@@ -589,10 +590,10 @@ function Oe(e, t) {
|
|
|
589
590
|
}
|
|
590
591
|
return a;
|
|
591
592
|
}
|
|
592
|
-
function
|
|
593
|
+
function Ae(e) {
|
|
593
594
|
return e.length === 0 ? "" : e.map((e) => `\n <mj-style>\n${e}\n </mj-style>`).join("");
|
|
594
595
|
}
|
|
595
596
|
//#endregion
|
|
596
|
-
export {
|
|
597
|
+
export { v as DEFAULT_SOCIAL_ICONS_BASE_URL, L as RICH_TEXT_CSS_CLASS, b as RenderContext, w as UNRENDERABLE_MARKER_PREFIX, M as convertMergeTagsToValues, A as escapeAttr, k as escapeHtml, S as getCssClassAttr, C as getCssClasses, J as getWidthPercentages, Y as getWidthPixels, x as isHiddenOnAll, Z as renderBlock, xe as renderToMjml, E as renderUnrenderableBlock, z as resolveParagraphGap, R as richTextGapClass, P as toPaddingString };
|
|
597
598
|
|
|
598
|
-
//# sourceMappingURL=src-
|
|
599
|
+
//# sourceMappingURL=src-BC-eolWY.js.map
|