@templatical/editor 0.8.3 → 0.8.5
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-CXpsSTbt.js → AiChatSidebar-uhkhnXQd.js} +14 -14
- package/dist/{AiFeatureMenu-De9ow6Ej.js → AiFeatureMenu-DXNKvXP5.js} +8 -8
- package/dist/{BlockIssueBadge-FEuyG1p0.js → BlockIssueBadge-DM-vXeD6.js} +5 -5
- package/dist/{CloudEditor-Ccoru8Up.js → CloudEditor-BSkPQjwo.js} +23 -23
- package/dist/{CollaboratorBar-CmHq6XiL.js → CollaboratorBar-CP76Sh6c.js} +5 -5
- package/dist/{CommentsSidebar-DaWP5ZGl.js → CommentsSidebar-_llWQ4VT.js} +14 -14
- package/dist/{CountdownBlock-C51M6s-J.js → CountdownBlock-I99sC0C5.js} +4 -4
- package/dist/{CountdownToolbar-C2QkG8S0.js → CountdownToolbar-BUhOUiQ9.js} +4 -4
- package/dist/{DesignReferenceSidebar-BwIRFmpA.js → DesignReferenceSidebar-CfJqJ7l6.js} +11 -11
- package/dist/{IssuesPanel-B6ukjc1i.js → IssuesPanel-4MKZe8yP.js} +8 -8
- package/dist/{LoadingTrack-CZ6tO326.js → LoadingTrack-xCOLUR3o.js} +2 -2
- package/dist/{ModuleBrowserModal-0n6DoZtA.js → ModuleBrowserModal-BFQTm6uY.js} +11 -11
- package/dist/{ModulePreviewCanvas-DEtTEvMM.js → ModulePreviewCanvas-DeqMpo73.js} +3 -3
- package/dist/{NumberWithSuffix-wOM0319c.js → NumberWithSuffix-CxMFy_j3.js} +4 -4
- package/dist/{ParagraphEditor-PQZp1plL.js → ParagraphEditor-DqomSbW3.js} +28 -28
- package/dist/{RichTextEditorContent-C02UzFoS.js → RichTextEditorContent-B_KCY6T1.js} +6 -6
- package/dist/{SaveModuleDialog-WWMn87Oi.js → SaveModuleDialog-DKcpPeWd.js} +7 -7
- package/dist/{SnapshotHistory-Dy_Iy7VG.js → SnapshotHistory-Z9RQj53S.js} +10 -10
- package/dist/{TemplateScoringPanel-BpQgtaDl.js → TemplateScoringPanel-BIwEwFxD.js} +15 -15
- package/dist/{TestEmailModal--4EVFj1A.js → TestEmailModal-C8DhylO1.js} +5 -5
- package/dist/{TitleEditor-C6z6Jzeg.js → TitleEditor-CgLrn6R3.js} +15 -15
- package/dist/{TplModal-D5xlYbls.js → TplModal-CbwRwmR3.js} +4 -4
- package/dist/{blockTypeIcons-jZR-IBPY.js → blockTypeIcons-CccKujXP.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiFeatureMenu-8gbvVwXD.js → AiFeatureMenu-ChNv7XXj.js} +3 -3
- package/dist/cdn/chunks/{AiFeatureMenu-8gbvVwXD.js.map → AiFeatureMenu-ChNv7XXj.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CYoY-wyI.js → BlockIssueBadge-BovmWgok.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-CYoY-wyI.js.map → BlockIssueBadge-BovmWgok.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-DGAV0qxk.js → CloudEditor-CHF_P5OL.js} +9 -9
- package/dist/cdn/chunks/{CloudEditor-DGAV0qxk.js.map → CloudEditor-CHF_P5OL.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-BrzkrQJM.js → CollaboratorBar-Bjr5YSh0.js} +5 -5
- package/dist/cdn/chunks/{CollaboratorBar-BrzkrQJM.js.map → CollaboratorBar-Bjr5YSh0.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-BSEKrpZY.js → CountdownBlock-KyzvhjMF.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-BSEKrpZY.js.map → CountdownBlock-KyzvhjMF.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-DME9toD5.js → CountdownToolbar-bJtMHGYz.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-DME9toD5.js.map → CountdownToolbar-bJtMHGYz.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-BqGOXisb.js → IssuesPanel-DFSYTQXy.js} +4 -4
- package/dist/cdn/chunks/{IssuesPanel-BqGOXisb.js.map → IssuesPanel-DFSYTQXy.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-Bz2oCRS9.js → ModuleBrowserModal-DS0BGRhZ.js} +6 -6
- package/dist/cdn/chunks/{ModuleBrowserModal-Bz2oCRS9.js.map → ModuleBrowserModal-DS0BGRhZ.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-8i2U3rd6.js → ModulePreviewCanvas-Dwn2cA5a.js} +3 -3
- package/dist/cdn/chunks/{ModulePreviewCanvas-8i2U3rd6.js.map → ModulePreviewCanvas-Dwn2cA5a.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-C6HZCvvh.js → NumberWithSuffix-BNBeHv0P.js} +4 -4
- package/dist/cdn/chunks/{NumberWithSuffix-C6HZCvvh.js.map → NumberWithSuffix-BNBeHv0P.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DfKVmv1W.js → ParagraphEditor-C4TrTIOm.js} +21 -21
- package/dist/cdn/chunks/ParagraphEditor-C4TrTIOm.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-B-HY9asd.js → RichTextEditorContent-HNFFL4aK.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-B-HY9asd.js.map → RichTextEditorContent-HNFFL4aK.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-BgwBxW_S.js → SaveModuleDialog-CbHqqeID.js} +3 -3
- package/dist/cdn/chunks/{SaveModuleDialog-BgwBxW_S.js.map → SaveModuleDialog-CbHqqeID.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-C2p3SosJ.js → TitleEditor-gr-eBUq_.js} +12 -12
- package/dist/cdn/chunks/TitleEditor-gr-eBUq_.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-Bck6aYVw.js → blockTypeIcons-BUlgu9JL.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-Bck6aYVw.js.map → blockTypeIcons-BUlgu9JL.js.map} +1 -1
- package/dist/cdn/chunks/{de-RQrZR56a.js → de-CTYXVU9v.js} +1 -1
- package/dist/cdn/chunks/{de-RQrZR56a.js.map → de-CTYXVU9v.js.map} +1 -1
- package/dist/cdn/chunks/{de-DG1WWVXM.js → de-DFYCT4QU.js} +1 -1
- package/dist/cdn/chunks/{de-DG1WWVXM.js.map → de-DFYCT4QU.js.map} +1 -1
- package/dist/cdn/chunks/{de-BBEGQDsd.js → de-ED7c5RpG.js} +1 -2
- package/dist/cdn/chunks/{de-BBEGQDsd.js.map → de-ED7c5RpG.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-CLpL3kf8.js → draggable-BwWMFq33.js} +2 -2
- package/dist/cdn/chunks/{draggable-CLpL3kf8.js.map → draggable-BwWMFq33.js.map} +1 -1
- package/dist/cdn/chunks/{emojiData-EMFlj6FJ.js → emojiData-6m0DBh7O.js} +1 -1
- package/dist/cdn/chunks/{emojiData-EMFlj6FJ.js.map → emojiData-6m0DBh7O.js.map} +1 -1
- package/dist/cdn/chunks/{en-Bl1ecfRF.js → en-BtmIaJeb.js} +1 -1
- package/dist/cdn/chunks/{en-Bl1ecfRF.js.map → en-BtmIaJeb.js.map} +1 -1
- package/dist/cdn/chunks/{en-BE6OV83-.js → en-DE_y1YWU.js} +1 -1
- package/dist/cdn/chunks/{en-BE6OV83-.js.map → en-DE_y1YWU.js.map} +1 -1
- package/dist/cdn/chunks/{en-CHha-_ta.js → en-ivilDUn0.js} +1 -2
- package/dist/cdn/chunks/{en-CHha-_ta.js.map → en-ivilDUn0.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-DdH6DxVo.js → extensions-DK_lVs7A.js} +4 -4
- package/dist/cdn/chunks/{extensions-DdH6DxVo.js.map → extensions-DK_lVs7A.js.map} +1 -1
- package/dist/cdn/chunks/{features-BOcQhi9B.js → features-LiilsBqW.js} +1037 -1004
- package/dist/cdn/chunks/features-LiilsBqW.js.map +1 -0
- package/dist/cdn/chunks/{icons-BVyDCkxF.js → icons-Bn2SIR30.js} +2 -2
- package/dist/cdn/chunks/{icons-BVyDCkxF.js.map → icons-Bn2SIR30.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-cpFt-Vmw.js → liquid.browser-rMoPo2t_.js} +1 -1
- package/dist/cdn/chunks/{liquid.browser-cpFt-Vmw.js.map → liquid.browser-rMoPo2t_.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CPZI4Yxq.js → media-library-Bb2PavAd.js} +5 -5
- package/dist/cdn/chunks/{media-library-CPZI4Yxq.js.map → media-library-Bb2PavAd.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-CQl2JxRp.js → pt-BR-B2ZvFlRL.js} +1 -1
- package/dist/cdn/chunks/{pt-BR-CQl2JxRp.js.map → pt-BR-B2ZvFlRL.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-CFomv2R8.js → pt-BR-B5tm2iBl.js} +1 -2
- package/dist/cdn/chunks/{pt-BR-CFomv2R8.js.map → pt-BR-B5tm2iBl.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-BYRTP5Ww.js → pt-BR-BibOQm-o.js} +1 -1
- package/dist/cdn/chunks/{pt-BR-BYRTP5Ww.js.map → pt-BR-BibOQm-o.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-bjpcqCZG.js → pusher-CHo5Cua0.js} +2 -2
- package/dist/cdn/chunks/{pusher-bjpcqCZG.js.map → pusher-CHo5Cua0.js.map} +1 -1
- package/dist/cdn/chunks/{quality-Cytz80Z5.js → quality-Bpj6kNxR.js} +181 -155
- package/dist/cdn/chunks/{quality-Cytz80Z5.js.map → quality-Bpj6kNxR.js.map} +1 -1
- package/dist/cdn/chunks/{readableTextColor-DhoK4XiZ.js → readableTextColor-f8Kykfnh.js} +1 -1
- package/dist/cdn/chunks/{readableTextColor-DhoK4XiZ.js.map → readableTextColor-f8Kykfnh.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-Bsqzjvsr.js → renderer-CYYyu-Di.js} +133 -99
- package/dist/cdn/chunks/{renderer-Bsqzjvsr.js.map → renderer-CYYyu-Di.js.map} +1 -1
- package/dist/cdn/chunks/{src-BRhJ_W0W.js → src-CQjZnxvw.js} +8 -8
- package/dist/cdn/chunks/{src-BRhJ_W0W.js.map → src-CQjZnxvw.js.map} +1 -1
- package/dist/cdn/chunks/{styleConstants-DP1VOca8.js → styleConstants-lGobwiLH.js} +1 -1
- package/dist/cdn/chunks/{styleConstants-DP1VOca8.js.map → styleConstants-lGobwiLH.js.map} +1 -1
- package/dist/cdn/chunks/{styles-MrOGXwzJ.js → styles-5g8XOS68.js} +11 -11
- package/dist/cdn/chunks/{styles-MrOGXwzJ.js.map → styles-5g8XOS68.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-BCvhHXDe.js → tiptap-BBbH3IT9.js} +856 -732
- package/dist/cdn/chunks/tiptap-BBbH3IT9.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +13 -13
- package/dist/{check-DwVS7v3N.js → check-ChQyfxJ3.js} +1 -1
- package/dist/{chevron-down-CytfFjil.js → chevron-down-DJjo0jSV.js} +1 -1
- package/dist/{circle-alert-9J8Q4fwU.js → circle-alert-CPH6l3Lc.js} +1 -1
- package/dist/{clock-CL2fYWmc.js → clock-DHl_BIkU.js} +1 -1
- package/dist/{cloud-DHsOqOnH.js → cloud-VxYMtfXC.js} +2 -2
- package/dist/{createLucideIcon-DTECxBv6.js → createLucideIcon-XgXOJ05E.js} +1 -1
- package/dist/{de-KFqjrxG3.js → de-ED7c5RpG.js} +0 -1
- package/dist/{dist-B5FKze93.js → dist-BDgf2G-V.js} +453 -314
- package/dist/{dist-BoGj0ys1.js → dist-BxP6TB0l.js} +2 -2
- package/dist/{dist-DpF3BN6Y.js → dist-BzuC8o3y.js} +451 -459
- package/dist/{dist-DiYYRj9J.js → dist-C0jo8wtG.js} +2 -2
- package/dist/{dist-3RAjjDZq.js → dist-C8wMh_gi.js} +2 -2
- package/dist/{dist-DJmnUmW9.js → dist-CIV3Brg-.js} +37 -4
- package/dist/{dist-BjSjVZRA.js → dist-CUpJmrjt.js} +2 -2
- package/dist/dist-D5lmdi1F.js +5 -0
- package/dist/{dist-D8IxYzaU.js → dist-D8C6jIXM.js} +170 -177
- package/dist/dist-DILjuzSv.js +5 -0
- package/dist/{dist-DPiqL9q5.js → dist-DXaxGLsw.js} +33 -33
- package/dist/{dist-qFGe50Kc.js → dist-DYO-w_Jf.js} +2 -2
- package/dist/{dist-CkhqaMca.js → dist-HO0vjY5Z.js} +1 -1
- package/dist/{dist-DgD8K8y0.js → dist-UK-lbEBc.js} +2 -2
- package/dist/{en-CNm94YYD.js → en-ivilDUn0.js} +0 -1
- package/dist/{extensions-BTheidN4.js → extensions-DeNHyWwh.js} +29 -29
- package/dist/{formatRelativeTime-bvx5sFh5.js → formatRelativeTime-CyDg5cDD.js} +1 -1
- package/dist/{image-up-YgXg9o1y.js → image-up-CPBCOMit.js} +1 -1
- package/dist/{info-W-213KLD.js → info-DIY9mguM.js} +1 -1
- package/dist/{keys-XS_XrjqL.js → keys-B8K7Z7Ef.js} +1 -1
- package/dist/{list-checks-BQrZlWzC.js → list-checks-CSCyu3fH.js} +1 -1
- package/dist/{loader-circle-BQPHssrF.js → loader-circle-Rz_4vJLH.js} +1 -1
- package/dist/{message-circle-iMgHXBeH.js → message-circle-D-umK_MU.js} +1 -1
- package/dist/{pt-BR-gxZZAUWp.js → pt-BR-B5tm2iBl.js} +0 -1
- package/dist/{refresh-cw-DFozdLYp.js → refresh-cw-CvWF4jfR.js} +1 -1
- package/dist/{scan-line-D3NN0Gre.js → scan-line-wanvAFDr.js} +1 -1
- package/dist/{send-DBhq0GU2.js → send-BhbhbIFT.js} +1 -1
- package/dist/{shield-check-DquM3-E5.js → shield-check-CXPPMWth.js} +1 -1
- package/dist/{sparkles-CTGknLJy.js → sparkles-CrUN0KWY.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-DfdDKEGV.js → styles-Bgqv7rLA.js} +29 -29
- package/dist/templatical-editor.js +13 -13
- package/dist/{text-align-end-BPOHCD7K.js → text-align-end-Bkq8oBrD.js} +1 -1
- package/dist/{trash-2-VyX2kcG0.js → trash-2-BpY5BCLT.js} +1 -1
- package/dist/{triangle-alert-HIqW9Hwv.js → triangle-alert-MwJBKR2e.js} +1 -1
- package/dist/{useAliveFlag-t3e0dokQ.js → useAliveFlag-BLyG8L4d.js} +1 -1
- package/dist/{useCloudI18n-oETj4WiF.js → useCloudI18n-DFzVgYhJ.js} +2 -2
- package/dist/{useEditorCore-YaOoz7QB.js → useEditorCore-CaOVDL_m.js} +20 -20
- package/dist/{useI18n-tMHqPsE4.js → useI18n-CBbStVlD.js} +2 -2
- package/dist/{useMergeTag-Bv8ASt6n.js → useMergeTag-RWsgUcSh.js} +3 -3
- package/dist/usePopoverRoot-62PlZQQ3.js +8 -0
- package/dist/{vue.runtime.esm-bundler-xiAB6UTz.js → vue.runtime.esm-bundler-BDSGA5hA.js} +1 -1
- package/dist/{x-C1j-AamY.js → x-rcnxRG8Y.js} +1 -1
- package/package.json +23 -23
- package/dist/cdn/chunks/ParagraphEditor-DfKVmv1W.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-C2p3SosJ.js.map +0 -1
- package/dist/cdn/chunks/features-BOcQhi9B.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BCvhHXDe.js.map +0 -1
- package/dist/dist-BWVK8w_m.js +0 -5
- package/dist/dist-UekZXGFH.js +0 -5
- package/dist/usePopoverRoot-Bs6kLsI3.js +0 -8
- /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-B3ysoDQm.js} +0 -0
- /package/dist/cdn/chunks/{rolldown-runtime-C266TIVP.js → rolldown-runtime-Dqa2HsxW.js} +0 -0
- /package/dist/{de-GOtR9DwW.js → de-CTYXVU9v.js} +0 -0
- /package/dist/{emojiData-DrBuvEoP.js → emojiData-6m0DBh7O.js} +0 -0
- /package/dist/{en-dFFQVzNn.js → en-BtmIaJeb.js} +0 -0
- /package/dist/{liquid.browser-Dc30h4PN.js → liquid.browser-IgQrXHPQ.js} +0 -0
- /package/dist/{pt-BR-iOr79aDg.js → pt-BR-B2ZvFlRL.js} +0 -0
- /package/dist/{readableTextColor-CXzrEnNb.js → readableTextColor-f8Kykfnh.js} +0 -0
- /package/dist/{rolldown-runtime-CAFD8bLK.js → rolldown-runtime-Dy4uBu1J.js} +0 -0
- /package/dist/{styleConstants-DkfOPzGu.js → styleConstants-lGobwiLH.js} +0 -0
- /package/dist/{timeouts-BSGxjuUF.js → timeouts-Bmi_yePw.js} +0 -0
package/dist/cdn/chunks/{readableTextColor-DhoK4XiZ.js.map → readableTextColor-f8Kykfnh.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readableTextColor-
|
|
1
|
+
{"version":3,"file":"readableTextColor-f8Kykfnh.js","names":[],"sources":["../../../src/utils/readableTextColor.ts"],"sourcesContent":["/**\n * Pick the text color with the highest WCAG contrast against a background.\n * Inputs must be #rgb or #rrggbb. Returns `light` on unrecognized input.\n */\nexport function readableTextColor(\n background: string,\n options: { light?: string; dark?: string } = {},\n): string {\n const light = options.light ?? \"#ffffff\";\n const dark = options.dark ?? \"#1f1f1f\";\n\n const rgb = parseHexRgb(background);\n if (!rgb) return light;\n\n const bgLuminance = relativeLuminance(rgb);\n const lightRgb = parseHexRgb(light);\n const darkRgb = parseHexRgb(dark);\n const lightLuminance = lightRgb ? relativeLuminance(lightRgb) : 1;\n const darkLuminance = darkRgb ? relativeLuminance(darkRgb) : 0;\n\n const contrastLight = contrastRatio(bgLuminance, lightLuminance);\n const contrastDark = contrastRatio(bgLuminance, darkLuminance);\n\n return contrastLight >= contrastDark ? light : dark;\n}\n\nfunction parseHexRgb(hex: string): [number, number, number] | null {\n const match = hex.trim().match(/^#?([\\da-f]{3}|[\\da-f]{6})$/i);\n if (!match) return null;\n let value = match[1];\n if (value.length === 3) {\n value = value\n .split(\"\")\n .map((c) => c + c)\n .join(\"\");\n }\n return [\n parseInt(value.slice(0, 2), 16),\n parseInt(value.slice(2, 4), 16),\n parseInt(value.slice(4, 6), 16),\n ];\n}\n\nfunction relativeLuminance([r, g, b]: [number, number, number]): number {\n const toLinear = (channel: number): number => {\n const normalized = channel / 255;\n return normalized <= 0.03928\n ? normalized / 12.92\n : Math.pow((normalized + 0.055) / 1.055, 2.4);\n };\n return 0.2126 * toLinear(r) + 0.7152 * toLinear(g) + 0.0722 * toLinear(b);\n}\n\nfunction contrastRatio(l1: number, l2: number): number {\n const [lighter, darker] = l1 >= l2 ? [l1, l2] : [l2, l1];\n return (lighter + 0.05) / (darker + 0.05);\n}\n"],"mappings":";AAIA,SAAgB,EACd,GACA,IAA6C,CAAC,GACtC;CACR,IAAM,IAAQ,EAAQ,SAAS,WACzB,IAAO,EAAQ,QAAQ,WAEvB,IAAM,EAAY,CAAU;CAClC,IAAI,CAAC,GAAK,OAAO;CAEjB,IAAM,IAAc,EAAkB,CAAG,GACnC,IAAW,EAAY,CAAK,GAC5B,IAAU,EAAY,CAAI,GAC1B,IAAiB,IAAW,EAAkB,CAAQ,IAAI,GAC1D,IAAgB,IAAU,EAAkB,CAAO,IAAI;CAK7D,OAHsB,EAAc,GAAa,CAG1C,KAFc,EAAc,GAAa,CAExB,IAAe,IAAQ;AACjD;AAEA,SAAS,EAAY,GAA8C;CACjE,IAAM,IAAQ,EAAI,KAAK,EAAE,MAAM,8BAA8B;CAC7D,IAAI,CAAC,GAAO,OAAO;CACnB,IAAI,IAAQ,EAAM;CAOlB,OANI,EAAM,WAAW,MACnB,IAAQ,EACL,MAAM,EAAE,EACR,KAAK,MAAM,IAAI,CAAC,EAChB,KAAK,EAAE,IAEL;EACL,SAAS,EAAM,MAAM,GAAG,CAAC,GAAG,EAAE;EAC9B,SAAS,EAAM,MAAM,GAAG,CAAC,GAAG,EAAE;EAC9B,SAAS,EAAM,MAAM,GAAG,CAAC,GAAG,EAAE;CAChC;AACF;AAEA,SAAS,EAAkB,CAAC,GAAG,GAAG,IAAsC;CACtE,IAAM,KAAY,MAA4B;EAC5C,IAAM,IAAa,IAAU;EAC7B,OAAO,KAAc,SACjB,IAAa,UACH,IAAa,QAAS,UAAO;CAC7C;CACA,OAAO,QAAS,EAAS,CAAC,IAAI,QAAS,EAAS,CAAC,IAAI,QAAS,EAAS,CAAC;AAC1E;AAEA,SAAS,EAAc,GAAY,GAAoB;CACrD,IAAM,CAAC,GAAS,KAAU,KAAM,IAAK,CAAC,GAAI,CAAE,IAAI,CAAC,GAAI,CAAE;CACvD,QAAQ,IAAU,QAAS,IAAS;AACtC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { n as e } from "./rolldown-runtime-
|
|
2
|
-
import { An as t, Cn as n, Dn as r, En as i, Fn as a, In as o, Mn as s, Nn as c, On as l, Pn as u, Tn as d, jn as f, kn as p, wn as m } from "./features-
|
|
1
|
+
import { n as e } from "./rolldown-runtime-Dqa2HsxW.js";
|
|
2
|
+
import { An as t, Cn as n, Dn as r, En as i, Fn as a, In as o, Mn as s, Nn as c, On as l, Pn as u, Tn as d, jn as f, kn as p, wn as m } from "./features-LiilsBqW.js";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region ../renderer/src/render-context.ts
|
|
5
5
|
var h = `https://unpkg.com/@templatical/renderer@${{
|
|
6
6
|
name: "@templatical/renderer",
|
|
7
7
|
description: "Render Templatical email templates to MJML",
|
|
8
|
-
version: "0.8.
|
|
8
|
+
version: "0.8.5",
|
|
9
9
|
bugs: "https://github.com/templatical/sdk/issues",
|
|
10
10
|
dependencies: { "@templatical/types": "workspace:*" },
|
|
11
11
|
devDependencies: {
|
|
12
12
|
"@resvg/resvg-js": "^2.6.2",
|
|
13
|
-
mjml: "^5.2.
|
|
13
|
+
mjml: "^5.2.2",
|
|
14
14
|
tsup: "^8.5.1",
|
|
15
15
|
typescript: "^6.0.3",
|
|
16
|
-
vitest: "^4.1.
|
|
16
|
+
vitest: "^4.1.7"
|
|
17
17
|
},
|
|
18
18
|
exports: { ".": {
|
|
19
19
|
types: "./dist/index.d.ts",
|
|
@@ -90,31 +90,65 @@ function S(e) {
|
|
|
90
90
|
return e === "" ? "" : x(e).replace(/[;{}\r\n]/g, "");
|
|
91
91
|
}
|
|
92
92
|
function C(e) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
return e === "" ? "" : w(e, (e) => T(e, "data-merge-tag") ?? T(e, "data-logic-merge-tag"));
|
|
94
|
+
}
|
|
95
|
+
function w(e, t) {
|
|
96
|
+
let n = "", r = 0;
|
|
97
|
+
for (; r < e.length;) {
|
|
98
|
+
let i = e.indexOf("<span", r);
|
|
99
|
+
if (i === -1) {
|
|
100
|
+
n += e.substring(r);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
let a = e[i + 5];
|
|
104
|
+
if (a !== ">" && a !== " " && a !== " " && a !== "\n" && a !== "\r" && a !== "/") {
|
|
105
|
+
n += e.substring(r, i + 5), r = i + 5;
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
108
|
+
let o = e.indexOf(">", i + 5);
|
|
109
|
+
if (o === -1) {
|
|
110
|
+
n += e.substring(r);
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
let s = e.indexOf("</span>", o + 1);
|
|
114
|
+
if (s === -1) {
|
|
115
|
+
n += e.substring(r);
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
let c = t(e.substring(i + 5, o));
|
|
119
|
+
if (c === null) {
|
|
120
|
+
n += e.substring(r, i + 5), r = i + 5;
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
n += e.substring(r, i), n += c, r = s + 7;
|
|
124
|
+
}
|
|
125
|
+
return n;
|
|
126
|
+
}
|
|
127
|
+
function T(e, t) {
|
|
128
|
+
let n = RegExp(`(?:^|\\s)${t}="([^"<>]*)"`).exec(e);
|
|
129
|
+
return n ? n[1] : null;
|
|
96
130
|
}
|
|
97
131
|
//#endregion
|
|
98
132
|
//#region ../renderer/src/padding.ts
|
|
99
|
-
function
|
|
133
|
+
function E(e) {
|
|
100
134
|
return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
|
|
101
135
|
}
|
|
102
136
|
//#endregion
|
|
103
137
|
//#region ../renderer/src/utils.ts
|
|
104
|
-
function
|
|
138
|
+
function D(e, t) {
|
|
105
139
|
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
|
|
106
140
|
}
|
|
107
141
|
//#endregion
|
|
108
142
|
//#region ../renderer/src/visibility.ts
|
|
109
|
-
function
|
|
143
|
+
function O(e) {
|
|
110
144
|
let t = e.visibility;
|
|
111
145
|
return t ? !t.desktop && !t.tablet && !t.mobile : !1;
|
|
112
146
|
}
|
|
113
|
-
function
|
|
114
|
-
let t =
|
|
147
|
+
function k(e) {
|
|
148
|
+
let t = A(e);
|
|
115
149
|
return t === "" ? "" : ` css-class="${t}"`;
|
|
116
150
|
}
|
|
117
|
-
function
|
|
151
|
+
function A(e) {
|
|
118
152
|
let t = e.visibility;
|
|
119
153
|
if (!t) return "";
|
|
120
154
|
let n = [];
|
|
@@ -123,8 +157,8 @@ function O(e) {
|
|
|
123
157
|
//#endregion
|
|
124
158
|
//#region ../renderer/src/renderers/title.ts
|
|
125
159
|
function ee(e, t) {
|
|
126
|
-
if (
|
|
127
|
-
let n =
|
|
160
|
+
if (O(e)) return "";
|
|
161
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = te(C(e.content)), a = o[e.level] ?? o[2], s = x(e.color), c = e.textAlign, l = ne(e.fontFamily, t), u = k(e), d = `h${o[e.level] ? e.level : 2}`;
|
|
128
162
|
return `<mj-text
|
|
129
163
|
font-size="${a}px"
|
|
130
164
|
color="${s}"
|
|
@@ -133,28 +167,28 @@ function ee(e, t) {
|
|
|
133
167
|
padding="${n}"${r}${l}${u}
|
|
134
168
|
><${d} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${d}></mj-text>`;
|
|
135
169
|
}
|
|
136
|
-
function
|
|
170
|
+
function te(e) {
|
|
137
171
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
138
172
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
139
173
|
}
|
|
140
|
-
function
|
|
174
|
+
function ne(e, t) {
|
|
141
175
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
142
176
|
}
|
|
143
177
|
//#endregion
|
|
144
178
|
//#region ../renderer/src/renderers/paragraph.ts
|
|
145
|
-
function
|
|
146
|
-
if (
|
|
147
|
-
let n =
|
|
179
|
+
function re(e, t) {
|
|
180
|
+
if (O(e) || e.content.replace(/<\/?p\b[^<>]*>/gi, "").trim() === "") return "";
|
|
181
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = C(e.content);
|
|
148
182
|
return `<mj-text
|
|
149
183
|
line-height="1.5"
|
|
150
|
-
padding="${n}"${r}${
|
|
184
|
+
padding="${n}"${r}${k(e)}
|
|
151
185
|
>${i}</mj-text>`;
|
|
152
186
|
}
|
|
153
187
|
//#endregion
|
|
154
188
|
//#region ../renderer/src/renderers/image.ts
|
|
155
|
-
function
|
|
156
|
-
if (
|
|
157
|
-
let n =
|
|
189
|
+
function j(e, t) {
|
|
190
|
+
if (O(e) || e.src === "") return "";
|
|
191
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = k(e), o = "";
|
|
158
192
|
e.linkUrl && (o = ` href="${x(e.linkUrl)}"`, e.linkOpenInNewTab && (o += " target=\"_blank\" rel=\"noopener\""));
|
|
159
193
|
let s = x(e.src), c = e.decorative === !0;
|
|
160
194
|
return `<mj-image
|
|
@@ -167,9 +201,9 @@ function re(e, t) {
|
|
|
167
201
|
}
|
|
168
202
|
//#endregion
|
|
169
203
|
//#region ../renderer/src/renderers/button.ts
|
|
170
|
-
function
|
|
171
|
-
if (
|
|
172
|
-
let n =
|
|
204
|
+
function M(e, t) {
|
|
205
|
+
if (O(e)) return "";
|
|
206
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = E(e.buttonPadding), a = e.url === "" ? "" : x(e.url), o = a === "" ? "" : ` href="${a}"`, s = x(e.backgroundColor), c = x(e.textColor), l = e.fontSize, u = e.borderRadius, d = b(e.text);
|
|
173
207
|
return `<mj-button${o}${e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : ""}
|
|
174
208
|
background-color="${s}"
|
|
175
209
|
color="${c}"
|
|
@@ -177,46 +211,46 @@ function A(e, t) {
|
|
|
177
211
|
font-weight="bold"
|
|
178
212
|
border-radius="${u}px"
|
|
179
213
|
inner-padding="${i}"
|
|
180
|
-
padding="${n}"${r}${
|
|
214
|
+
padding="${n}"${r}${N(e.fontFamily, t)}${k(e)}
|
|
181
215
|
>${d}</mj-button>`;
|
|
182
216
|
}
|
|
183
|
-
function
|
|
217
|
+
function N(e, t) {
|
|
184
218
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
185
219
|
}
|
|
186
220
|
//#endregion
|
|
187
221
|
//#region ../renderer/src/renderers/divider.ts
|
|
188
|
-
function
|
|
189
|
-
if (
|
|
190
|
-
let n =
|
|
222
|
+
function P(e, t) {
|
|
223
|
+
if (O(e)) return "";
|
|
224
|
+
let n = E(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
|
|
191
225
|
return `<mj-divider
|
|
192
226
|
border-width="${e.thickness}px"
|
|
193
227
|
border-style="${e.lineStyle}"
|
|
194
228
|
border-color="${x(e.color)}"
|
|
195
229
|
width="${i}"
|
|
196
|
-
padding="${n}"${r}${
|
|
230
|
+
padding="${n}"${r}${k(e)}
|
|
197
231
|
/>`;
|
|
198
232
|
}
|
|
199
233
|
//#endregion
|
|
200
234
|
//#region ../renderer/src/renderers/spacer.ts
|
|
201
|
-
function
|
|
202
|
-
return
|
|
235
|
+
function F(e, t) {
|
|
236
|
+
return O(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${k(e)} />`;
|
|
203
237
|
}
|
|
204
238
|
//#endregion
|
|
205
239
|
//#region ../renderer/src/renderers/html.ts
|
|
206
|
-
function
|
|
207
|
-
if (
|
|
240
|
+
function I(e, t) {
|
|
241
|
+
if (O(e) || !t.allowHtmlBlocks) return "";
|
|
208
242
|
let n = e.content;
|
|
209
|
-
return n === "" ? "" : `<mj-text${
|
|
243
|
+
return n === "" ? "" : `<mj-text${k(e)}>
|
|
210
244
|
${n}
|
|
211
245
|
</mj-text>`;
|
|
212
246
|
}
|
|
213
247
|
//#endregion
|
|
214
248
|
//#region ../renderer/src/renderers/social.ts
|
|
215
|
-
function
|
|
216
|
-
if (
|
|
249
|
+
function L(e, t) {
|
|
250
|
+
if (O(e)) return "";
|
|
217
251
|
let n = e.icons;
|
|
218
252
|
if (n.length === 0) return "";
|
|
219
|
-
let r =
|
|
253
|
+
let r = E(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = k(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
|
|
220
254
|
switch (s) {
|
|
221
255
|
case "small":
|
|
222
256
|
u = 24;
|
|
@@ -258,78 +292,78 @@ ${n.map((e, n) => {
|
|
|
258
292
|
}
|
|
259
293
|
//#endregion
|
|
260
294
|
//#region ../renderer/src/renderers/menu.ts
|
|
261
|
-
function
|
|
262
|
-
if (
|
|
263
|
-
let n =
|
|
295
|
+
function R(e, t) {
|
|
296
|
+
if (O(e) || e.items.length === 0) return "";
|
|
297
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = V(e.fontFamily, t), o = e.textAlign;
|
|
264
298
|
return `<mj-text
|
|
265
299
|
font-size="${e.fontSize}px"
|
|
266
300
|
color="${x(e.color)}"
|
|
267
301
|
align="${o}"
|
|
268
302
|
line-height="1.5"
|
|
269
303
|
padding="${n}"${r}${a}${i}
|
|
270
|
-
>${
|
|
304
|
+
>${z(e)}</mj-text>`;
|
|
271
305
|
}
|
|
272
|
-
function
|
|
306
|
+
function z(e) {
|
|
273
307
|
let t = e.items, n = b(e.separator), r = S(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
|
|
274
|
-
for (let e = 0; e < s; e++) o.push(
|
|
308
|
+
for (let e = 0; e < s; e++) o.push(B(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
|
|
275
309
|
return o.join("");
|
|
276
310
|
}
|
|
277
|
-
function
|
|
311
|
+
function B(e, t) {
|
|
278
312
|
let n = b(e.text), r = x(e.url), i = S(e.color ?? t), a = e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : "", o = [`color: ${i}`, "text-decoration: none"];
|
|
279
313
|
return e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
280
314
|
}
|
|
281
|
-
function
|
|
315
|
+
function V(e, t) {
|
|
282
316
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
283
317
|
}
|
|
284
318
|
//#endregion
|
|
285
319
|
//#region ../renderer/src/renderers/table.ts
|
|
286
|
-
function
|
|
287
|
-
if (
|
|
288
|
-
let n =
|
|
320
|
+
function H(e, t) {
|
|
321
|
+
if (O(e) || e.rows.length === 0) return "";
|
|
322
|
+
let n = E(e.styles.padding), r = D(e.styles.backgroundColor, "container"), i = k(e), a = K(e.fontFamily, t);
|
|
289
323
|
return `<mj-text
|
|
290
324
|
font-size="${e.fontSize}px"
|
|
291
325
|
color="${x(e.color)}"
|
|
292
326
|
align="${e.textAlign}"
|
|
293
327
|
line-height="1.5"
|
|
294
328
|
padding="${n}"${r}${a}${i}
|
|
295
|
-
>${
|
|
329
|
+
>${U(e)}</mj-text>`;
|
|
296
330
|
}
|
|
297
|
-
function
|
|
331
|
+
function U(e) {
|
|
298
332
|
let t = S(e.borderColor), n = e.borderWidth, r = "";
|
|
299
333
|
for (let i = 0; i < e.rows.length; i++) {
|
|
300
334
|
let a = e.rows[i];
|
|
301
|
-
r +=
|
|
335
|
+
r += W(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
302
336
|
}
|
|
303
337
|
return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
|
|
304
338
|
}
|
|
305
|
-
function
|
|
339
|
+
function W(e, t, n, r, i) {
|
|
306
340
|
let a = "";
|
|
307
|
-
for (let o of e.cells) a +=
|
|
341
|
+
for (let o of e.cells) a += G(o, t, n, r, i);
|
|
308
342
|
return `<tr>${a}</tr>`;
|
|
309
343
|
}
|
|
310
|
-
function
|
|
344
|
+
function G(e, t, n, r, i) {
|
|
311
345
|
let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
|
|
312
346
|
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${S(t.headerBackgroundColor)}`));
|
|
313
347
|
let s = o.join("; "), c = C(e.content), l = n ? "th" : "td";
|
|
314
348
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
315
349
|
}
|
|
316
|
-
function
|
|
350
|
+
function K(e, t) {
|
|
317
351
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
318
352
|
}
|
|
319
353
|
//#endregion
|
|
320
354
|
//#region ../renderer/src/renderers/custom.ts
|
|
321
|
-
function
|
|
322
|
-
if (
|
|
355
|
+
function ie(e, t) {
|
|
356
|
+
if (O(e)) return "";
|
|
323
357
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
324
358
|
if (!n || n === "") return "";
|
|
325
|
-
let r =
|
|
326
|
-
return `<mj-text${
|
|
359
|
+
let r = k(e);
|
|
360
|
+
return `<mj-text${D(e.styles?.backgroundColor, "container")}${r}>
|
|
327
361
|
${n}
|
|
328
362
|
</mj-text>`;
|
|
329
363
|
}
|
|
330
364
|
//#endregion
|
|
331
365
|
//#region ../renderer/src/columns.ts
|
|
332
|
-
function
|
|
366
|
+
function q(e) {
|
|
333
367
|
switch (e) {
|
|
334
368
|
case "2": return ["50%", "50%"];
|
|
335
369
|
case "3": return [
|
|
@@ -342,7 +376,7 @@ function K(e) {
|
|
|
342
376
|
default: return ["100%"];
|
|
343
377
|
}
|
|
344
378
|
}
|
|
345
|
-
function
|
|
379
|
+
function J(e, t) {
|
|
346
380
|
switch (e) {
|
|
347
381
|
case "2": return [t * .5, t * .5];
|
|
348
382
|
case "3": return [
|
|
@@ -357,11 +391,11 @@ function q(e, t) {
|
|
|
357
391
|
}
|
|
358
392
|
//#endregion
|
|
359
393
|
//#region ../renderer/src/renderers/section.ts
|
|
360
|
-
function
|
|
361
|
-
if (
|
|
362
|
-
let i = e.columns, a =
|
|
394
|
+
function Y(e, n, r) {
|
|
395
|
+
if (O(e)) return "";
|
|
396
|
+
let i = e.columns, a = q(i), o = J(i, n.containerWidth), s = E(e.styles.padding), c = D(e.styles.backgroundColor, "native"), l = k(e), u = e.children, d = [];
|
|
363
397
|
for (let e = 0; e < u.length; e++) {
|
|
364
|
-
let i = u[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? n.containerWidth), l =
|
|
398
|
+
let i = u[e], s = a[e] ?? "100%", c = Math.floor(o[e] ?? n.containerWidth), l = ae(i, n.allowHtmlBlocks).filter((e) => !t(e)), f = n.withContainerWidth(c), p = l.map((e) => r(e, f)).filter((e) => e !== "").join("\n");
|
|
365
399
|
d.push(`<mj-column width="${s}">
|
|
366
400
|
${p === "" ? "<mj-text> </mj-text>" : p}
|
|
367
401
|
</mj-column>`);
|
|
@@ -370,12 +404,12 @@ ${p === "" ? "<mj-text> </mj-text>" : p}
|
|
|
370
404
|
${d.join("\n")}
|
|
371
405
|
</mj-section>`;
|
|
372
406
|
}
|
|
373
|
-
function
|
|
407
|
+
function ae(e, t) {
|
|
374
408
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
375
409
|
}
|
|
376
410
|
//#endregion
|
|
377
411
|
//#region ../renderer/src/renderers/video.ts
|
|
378
|
-
function
|
|
412
|
+
function oe(e, t) {
|
|
379
413
|
if (t) return t;
|
|
380
414
|
if (!e) return null;
|
|
381
415
|
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})/]) {
|
|
@@ -385,11 +419,11 @@ function X(e, t) {
|
|
|
385
419
|
let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
|
|
386
420
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
387
421
|
}
|
|
388
|
-
function
|
|
389
|
-
if (
|
|
390
|
-
let n =
|
|
422
|
+
function se(e, t) {
|
|
423
|
+
if (O(e)) return "";
|
|
424
|
+
let n = oe(e.url, e.thumbnailUrl);
|
|
391
425
|
if (!n) return "";
|
|
392
|
-
let r =
|
|
426
|
+
let r = E(e.styles.padding), i = D(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = k(e);
|
|
393
427
|
return `<mj-image
|
|
394
428
|
src="${x(n)}"
|
|
395
429
|
alt="${x(e.alt)}"
|
|
@@ -403,28 +437,28 @@ function ie(e, t) {
|
|
|
403
437
|
}
|
|
404
438
|
//#endregion
|
|
405
439
|
//#region ../renderer/src/renderers/index.ts
|
|
406
|
-
function
|
|
407
|
-
return t(e) ?
|
|
440
|
+
function X(e, o) {
|
|
441
|
+
return t(e) ? Y(e, o, X) : u(e) ? ee(e, o) : p(e) ? re(e, o) : r(e) ? j(e, o) : n(e) ? M(e, o) : d(e) ? P(e, o) : s(e) ? F(e, o) : i(e) ? I(e, o) : f(e) ? L(e, o) : l(e) ? R(e, o) : c(e) ? H(e, o) : a(e) ? se(e, o) : m(e) ? ie(e, o) : "";
|
|
408
442
|
}
|
|
409
443
|
//#endregion
|
|
410
444
|
//#region ../renderer/src/index.ts
|
|
411
|
-
var
|
|
445
|
+
var ce = /* @__PURE__ */ e({
|
|
412
446
|
DEFAULT_SOCIAL_ICONS_BASE_URL: () => h,
|
|
413
447
|
RenderContext: () => _,
|
|
414
448
|
convertMergeTagsToValues: () => C,
|
|
415
449
|
escapeAttr: () => x,
|
|
416
450
|
escapeHtml: () => b,
|
|
417
|
-
getCssClassAttr: () =>
|
|
418
|
-
getCssClasses: () =>
|
|
419
|
-
getWidthPercentages: () =>
|
|
420
|
-
getWidthPixels: () =>
|
|
421
|
-
isHiddenOnAll: () =>
|
|
422
|
-
renderBlock: () =>
|
|
423
|
-
renderToMjml: () =>
|
|
424
|
-
toPaddingString: () =>
|
|
451
|
+
getCssClassAttr: () => k,
|
|
452
|
+
getCssClasses: () => A,
|
|
453
|
+
getWidthPercentages: () => q,
|
|
454
|
+
getWidthPixels: () => J,
|
|
455
|
+
isHiddenOnAll: () => O,
|
|
456
|
+
renderBlock: () => X,
|
|
457
|
+
renderToMjml: () => Z,
|
|
458
|
+
toPaddingString: () => E
|
|
425
459
|
});
|
|
426
|
-
async function
|
|
427
|
-
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a =
|
|
460
|
+
async function Z(e, t) {
|
|
461
|
+
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = de(t?.socialIconsBaseUrl ?? h), o = await he(e, t?.renderCustomBlock), s = new _(e.settings.width, n, r, i, o, a), c = me(e.blocks, i), l = s.resolveFontFamily(e.settings.fontFamily), u = e.settings.backgroundColor, d = c.map((e) => le(e, s)).filter((e) => e !== "").join("\n"), f = pe(n), p = fe(e.settings.preheaderText);
|
|
428
462
|
return `<mjml lang="${x(e.settings.locale)}">
|
|
429
463
|
<mj-head>${p}
|
|
430
464
|
<mj-attributes>
|
|
@@ -452,8 +486,8 @@ ${d}
|
|
|
452
486
|
</mj-body>
|
|
453
487
|
</mjml>`;
|
|
454
488
|
}
|
|
455
|
-
function
|
|
456
|
-
return t(e) ? Q(e,
|
|
489
|
+
function le(e, n) {
|
|
490
|
+
return t(e) ? Q(e, X(e, n)) : Q(e, ue(X(e, n)));
|
|
457
491
|
}
|
|
458
492
|
function Q(e, t) {
|
|
459
493
|
if (t === "") return "";
|
|
@@ -462,28 +496,28 @@ function Q(e, t) {
|
|
|
462
496
|
` + t + `
|
|
463
497
|
<mj-raw>${n.after}</mj-raw>` : t;
|
|
464
498
|
}
|
|
465
|
-
function
|
|
499
|
+
function ue(e) {
|
|
466
500
|
return e === "" ? "" : `<mj-section>
|
|
467
501
|
<mj-column>
|
|
468
502
|
${e}
|
|
469
503
|
</mj-column>
|
|
470
504
|
</mj-section>`;
|
|
471
505
|
}
|
|
472
|
-
function
|
|
506
|
+
function de(e) {
|
|
473
507
|
return e.endsWith("/") ? e.slice(0, -1) : e;
|
|
474
508
|
}
|
|
475
|
-
function
|
|
509
|
+
function fe(e) {
|
|
476
510
|
if (!e) return "";
|
|
477
511
|
let t = e.trim();
|
|
478
512
|
return t === "" ? "" : `\n <mj-preview>${b(t)}</mj-preview>`;
|
|
479
513
|
}
|
|
480
|
-
function
|
|
514
|
+
function pe(e) {
|
|
481
515
|
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${x(e.name)}" href="${x(e.url)}" />`).join("");
|
|
482
516
|
}
|
|
483
|
-
function
|
|
517
|
+
function me(e, t) {
|
|
484
518
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
485
519
|
}
|
|
486
|
-
async function
|
|
520
|
+
async function he(e, t) {
|
|
487
521
|
let n = /* @__PURE__ */ new Map();
|
|
488
522
|
if (!t) return n;
|
|
489
523
|
let r = [];
|
|
@@ -502,6 +536,6 @@ function $(e, n) {
|
|
|
502
536
|
}
|
|
503
537
|
}
|
|
504
538
|
//#endregion
|
|
505
|
-
export {
|
|
539
|
+
export { ce as t };
|
|
506
540
|
|
|
507
|
-
//# sourceMappingURL=renderer-
|
|
541
|
+
//# sourceMappingURL=renderer-CYYyu-Di.js.map
|