@aswin.dev/editor 0.7.0 → 0.7.2
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/LICENSE +56 -0
- package/README.md +3 -3
- package/dist/{AccessibilityPanel-CvQGLdu6.js → AccessibilityPanel-EmQ19wiS.js} +37 -37
- package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-DeB0w_32.js} +67 -81
- package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-DoLD5Cde.js} +22 -22
- package/dist/{BlockA11yBadge-CXDLqkcJ.js → BlockA11yBadge-DkNbDvJA.js} +12 -12
- package/dist/CloudEditor-zo9PjjvY.js +1214 -0
- package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-BsXMY-8e.js} +21 -21
- package/dist/CommentsSidebar-DIWIa4rS.js +436 -0
- package/dist/CountdownBlock-BCi7-DAM.js +92 -0
- package/dist/CountdownToolbar-BuS8p5ju.js +210 -0
- package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-RDlnhL-6.js} +58 -58
- package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-BJ59h9ok.js} +2 -2
- package/dist/ModuleBrowserModal-b7HbpByz.js +206 -0
- package/dist/ModulePreviewCanvas-D__YlOLS.js +108 -0
- package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Ca3vNY84.js} +87 -87
- package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-B1aYPO-6.js} +182 -182
- package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-BmEVMrkJ.js} +38 -38
- package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-ClovqI6h.js} +28 -28
- package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-DoqtH0cw.js} +45 -50
- package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-DQv2ZAiL.js} +75 -75
- package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-iIeYJYsj.js} +28 -28
- package/dist/{TitleEditor-fStSADI-.js → TitleEditor-CTDIwRF_.js} +68 -68
- package/dist/{TplModal-BwSfxIHf.js → TplModal-CBq1J1pG.js} +14 -14
- package/dist/{accessibility-e8JYu_zd.js → accessibility-BU09xZrQ.js} +1 -1
- package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-QkC6f5UE.js} +19 -5
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BeU8nz7A.js} +28 -28
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BeU8nz7A.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-B2mhscyP.js} +21 -21
- package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
- package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C4g77gF0.js} +11 -11
- package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-C4g77gF0.js.map} +1 -1
- package/dist/{CloudEditor-BCz1ZTYC.js → cdn/chunks/CloudEditor-Btyr0b0_.js} +486 -475
- package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-YBiIjiRh.js} +15 -15
- package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-B06UZoWe.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-C9XZr33O.js.map +1 -0
- package/dist/{ModuleBrowserModal-DrUFMTDx.js → cdn/chunks/ModuleBrowserModal-C2CDWKW6.js} +51 -62
- package/dist/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js +109 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-Drt8Evai.js.map +1 -0
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-Ty1bp9vB.js} +64 -64
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-Ty1bp9vB.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-BA1WbHI7.js} +188 -188
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-BA1WbHI7.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BtWCA_Oc.js} +30 -30
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BtWCA_Oc.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-AwL0tkCV.js} +21 -21
- package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
- package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-DbSyeixS.js} +65 -65
- package/dist/cdn/chunks/TitleEditor-DbSyeixS.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js +23 -0
- package/dist/cdn/chunks/blockTypeIcons-pQIkxJzc.js.map +1 -0
- package/dist/cdn/chunks/{de-D8CnZxV9.js → de-_tooy3Q8.js} +250 -2
- package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
- package/dist/cdn/chunks/{draggable-Bcb86AsV.js → draggable-C-1_gch3.js} +2 -2
- package/dist/cdn/chunks/{draggable-Bcb86AsV.js.map → draggable-C-1_gch3.js.map} +1 -1
- package/dist/cdn/chunks/{en-8FHaQv4V.js → en-CNqLoIm9.js} +250 -2
- package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-BVKQw_sp.js} +107 -107
- package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
- package/dist/cdn/chunks/{features-DEMb13KS.js → features-DIBEo4xl.js} +3388 -2289
- package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
- package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-C1Gg-ov-.js} +346 -54
- package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
- package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BTF_Ko70.js} +985 -985
- package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
- package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-C5AmotmP.js} +312 -312
- package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
- package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-D0L44Vlp.js} +236 -142
- package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
- package/dist/cdn/chunks/{src-CRaqN-p8.js → src-RKexlYjA.js} +161 -161
- package/dist/cdn/chunks/src-RKexlYjA.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js +57 -0
- package/dist/cdn/chunks/styleConstants-PgmvNBzQ.js.map +1 -0
- package/dist/cdn/chunks/styles-CQR6ed13.js +4976 -0
- package/dist/cdn/chunks/styles-CQR6ed13.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-CDzAbF2j.js} +43 -43
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-CDzAbF2j.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +211 -123
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Da05j8yl.js → check-DJrpDKO_.js} +1 -1
- package/dist/{chevron-down-R2uY34iD.js → chevron-down-C5oBUhT8.js} +1 -1
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/{circle-alert-DZuGWPX-.js → circle-alert-ZQQc98HC.js} +1 -1
- package/dist/{clock-CRp2sIub.js → clock-ik2pRJKG.js} +1 -1
- package/dist/{cloud-DEk_b4CR.js → cloud-DJG4tb4_.js} +485 -427
- package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-ClREiSx3.js} +6 -6
- package/dist/{de-Brqvgr43.js → de-2LEvILeZ.js} +249 -1
- package/dist/{dist-Cp0zXPAD.js → dist-BHAeXaUY.js} +1 -1
- package/dist/{dist-BaQIYPsn.js → dist-BSJvAvH3.js} +1 -1
- package/dist/{dist-wzMIGj-D.js → dist-BeFnymxK.js} +1 -1
- package/dist/dist-Bmir0gYb.js +1167 -0
- package/dist/{dist-DDJIWTRY.js → dist-BvPgo-UK.js} +1 -1
- package/dist/{dist-BFawx6IS.js → dist-CPVBKMmd.js} +51 -51
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/{dist-D6uC2xhi.js → dist-Df4ie7vZ.js} +1 -1
- package/dist/{dist-us-RpCWN.js → dist-DxOoemkW.js} +1 -1
- package/dist/{dist-KoBJjK1G.js → dist-HEQ52gTJ.js} +1 -1
- package/dist/{dist-DjviJBCi.js → dist-b-XUqAoF.js} +1 -1
- package/dist/{dist-D90y8dvT.js → dist-kZfaVUpW.js} +3 -3
- package/dist/{dist-aRzjfSRN.js → dist-wfAedlzi.js} +1 -1
- package/dist/{en-WDVp87TE.js → en-D2RU2Poj.js} +249 -1
- package/dist/{extensions-CUcl9Ok4.js → extensions-BQ1xXx3d.js} +103 -103
- package/dist/{image-up-MBZKKg9p.js → image-up-DT7gcJLN.js} +1 -1
- package/dist/index.d.ts +102 -14
- package/dist/{info-CJEC7piy.js → info-BSPGcsSM.js} +1 -1
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/{loader-circle-DsY5Yg33.js → loader-circle-Balo8p3d.js} +1 -1
- package/dist/{message-circle-yElBbR2C.js → message-circle-B39qAHxs.js} +1 -1
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-DwDqGUM0.js} +1 -1
- package/dist/{scan-line-D0vcUekt.js → scan-line-DlghmhNf.js} +1 -1
- package/dist/{send-DH4oDQqC.js → send-DDdhIRj8.js} +1 -1
- package/dist/{shield-check-CfJgs2Hd.js → shield-check-OSQ-JVTX.js} +1 -1
- package/dist/{sparkles-CvRXGqFs.js → sparkles-BN4a-CoF.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styleConstants-wWRbcuEK.js +55 -0
- package/dist/styles-CavWjvol.js +5487 -0
- package/dist/templatical-editor.js +211 -119
- package/dist/{text-align-start-BT9VUDxK.js → text-align-start-D1weisjS.js} +1 -1
- package/dist/{trash-2-DbP2Y6t2.js → trash-2-CMWvQ5KX.js} +1 -1
- package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DyidRNX_.js} +1 -1
- package/dist/undo-2-Cg8I7obC.js +16 -0
- package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-BTTNBk5i.js} +2 -2
- package/dist/{useEditorCore-C6ost42Q.js → useEditorCore-BGnzcT7p.js} +2424 -2249
- package/dist/{useI18n-lb2DHDiu.js → useI18n-C2xQZ6K9.js} +2 -2
- package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-CfuZq2fF.js} +4 -4
- package/dist/{vue.runtime.esm-bundler-DpvJL-nX.js → vue.runtime.esm-bundler-CjauPXjj.js} +1 -1
- package/dist/{x-u2oVmjN_.js → x-CgIhNcT9.js} +1 -1
- package/package.json +15 -15
- package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
- package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
- package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +0 -106
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +0 -1
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +0 -1143
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +0 -1
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +0 -1
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +0 -93
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +0 -1
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +0 -195
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +0 -1
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +0 -107
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +0 -1
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +0 -1
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +0 -22
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +0 -1
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +0 -1
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +0 -1
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +0 -1
- package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +0 -1
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +0 -1
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +0 -1
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +0 -1
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +0 -57
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +0 -1
- package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
- package/dist/dist-B1IR0bpH.js +0 -326
- package/dist/dist-DJmnUmW9.js +0 -362
- package/dist/keys-ciNfSSGj.js +0 -10
- package/dist/styleConstants-fWzlIIwN.js +0 -55
- package/dist/styles-DEXEkBvg.js +0 -3176
- /package/dist/{_plugin-vue_export-helper-B0hnzhyu.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
- /package/dist/{de-DCaaCE5s.js → de-D2npYjrZ.js} +0 -0
- /package/dist/{dist-iLBdeBDR.js → dist-DvHLtWVP.js} +0 -0
- /package/dist/{emojiData-PQyVa4bU.js → emojiData-DvQBBzmO.js} +0 -0
- /package/dist/{en-DXCyK4-X.js → en-ib-4h3_o.js} +0 -0
- /package/dist/{formatRelativeTime-BOEf47hq.js → formatRelativeTime-CFDZnEIs.js} +0 -0
- /package/dist/{liquid.browser-CdMv1BTn.js → liquid.browser-7Rv0QDiO.js} +0 -0
- /package/dist/{readableTextColor-CY3SiRnt.js → readableTextColor-C_9OpzBw.js} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BNuo_Jkg.js";
|
|
2
|
-
import {
|
|
2
|
+
import { $n as t, Bn as n, Gn as r, Hn as i, Jn as a, Kn as o, Qn as s, Un as c, Vn as l, Wn as u, Xn as d, Yn as f, Zn as p, er as m, qn as h } from "./features-DIBEo4xl.js";
|
|
3
3
|
//#region ../renderer/src/render-context.ts
|
|
4
|
-
var
|
|
4
|
+
var g = {
|
|
5
5
|
arial: "Arial, sans-serif",
|
|
6
6
|
helvetica: "Helvetica, sans-serif",
|
|
7
7
|
georgia: "Georgia, serif",
|
|
@@ -10,7 +10,7 @@ var h = {
|
|
|
10
10
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
11
11
|
"courier new": "'Courier New', monospace",
|
|
12
12
|
tahoma: "Tahoma, sans-serif"
|
|
13
|
-
},
|
|
13
|
+
}, _ = class e {
|
|
14
14
|
constructor(e, t, n, r, i = /* @__PURE__ */ new Map()) {
|
|
15
15
|
this.containerWidth = e, this.customFonts = t, this.defaultFallbackFont = n, this.allowHtmlBlocks = r, this.customBlockHtml = i;
|
|
16
16
|
}
|
|
@@ -22,50 +22,53 @@ var h = {
|
|
|
22
22
|
let e = t.fallback ?? this.defaultFallbackFont;
|
|
23
23
|
return `'${t.name}', ${e}`;
|
|
24
24
|
}
|
|
25
|
-
return
|
|
25
|
+
return g[e.toLowerCase()] || e;
|
|
26
26
|
}
|
|
27
|
-
},
|
|
27
|
+
}, v = {
|
|
28
28
|
"&": "&",
|
|
29
29
|
"<": "<",
|
|
30
30
|
">": ">",
|
|
31
31
|
"\"": """,
|
|
32
32
|
"'": "'"
|
|
33
|
-
},
|
|
34
|
-
function y(e) {
|
|
35
|
-
return e === "" ? "" : e.replace(v, (e) => _[e] ?? e);
|
|
36
|
-
}
|
|
33
|
+
}, y = /[&<>"']/g;
|
|
37
34
|
function b(e) {
|
|
38
|
-
return e === "" ? "" : e.replace(
|
|
35
|
+
return e === "" ? "" : e.replace(y, (e) => v[e] ?? e);
|
|
39
36
|
}
|
|
40
37
|
function x(e) {
|
|
41
|
-
return e === "" ? "" :
|
|
38
|
+
return e === "" ? "" : e.replace(y, (e) => v[e] ?? e);
|
|
42
39
|
}
|
|
43
40
|
function S(e) {
|
|
41
|
+
return e === "" ? "" : x(e).replace(/[;{}\r\n]/g, "");
|
|
42
|
+
}
|
|
43
|
+
function C(e) {
|
|
44
44
|
if (e === "") return "";
|
|
45
45
|
let t = e.replace(/<span[^>]*\bdata-merge-tag="([^"]*)"[^>]*>.*?<\/span>/gs, "$1");
|
|
46
46
|
return t = t.replace(/<span[^>]*\bdata-logic-merge-tag="([^"]*)"[^>]*>.*?<\/span>/gs, "$1"), t;
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region ../renderer/src/padding.ts
|
|
50
|
-
function
|
|
50
|
+
function w(e) {
|
|
51
51
|
return `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`;
|
|
52
52
|
}
|
|
53
|
+
function T(e) {
|
|
54
|
+
return w(e);
|
|
55
|
+
}
|
|
53
56
|
//#endregion
|
|
54
57
|
//#region ../renderer/src/utils.ts
|
|
55
|
-
function
|
|
58
|
+
function E(e, t) {
|
|
56
59
|
return e ? ` ${t === "native" ? "background-color" : "container-background-color"}="${e}"` : "";
|
|
57
60
|
}
|
|
58
61
|
//#endregion
|
|
59
62
|
//#region ../renderer/src/visibility.ts
|
|
60
|
-
function
|
|
63
|
+
function D(e) {
|
|
61
64
|
let t = e.visibility;
|
|
62
65
|
return t ? !t.desktop && !t.tablet && !t.mobile : !1;
|
|
63
66
|
}
|
|
64
|
-
function
|
|
65
|
-
let t =
|
|
67
|
+
function O(e) {
|
|
68
|
+
let t = k(e);
|
|
66
69
|
return t === "" ? "" : ` css-class="${t}"`;
|
|
67
70
|
}
|
|
68
|
-
function
|
|
71
|
+
function k(e) {
|
|
69
72
|
let t = e.visibility;
|
|
70
73
|
if (!t) return "";
|
|
71
74
|
let n = [];
|
|
@@ -73,97 +76,157 @@ function D(e) {
|
|
|
73
76
|
}
|
|
74
77
|
//#endregion
|
|
75
78
|
//#region ../renderer/src/renderers/title.ts
|
|
76
|
-
function
|
|
77
|
-
if (
|
|
78
|
-
let n =
|
|
79
|
+
function ee(e, t) {
|
|
80
|
+
if (D(e)) return "";
|
|
81
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = A(C(e.content)), a = m[e.level] ?? m[2], o = x(e.color), s = e.textAlign, c = j(e.fontFamily, t), l = O(e), u = `h${m[e.level] ? e.level : 2}`;
|
|
79
82
|
return `<mj-text
|
|
80
83
|
font-size="${a}px"
|
|
81
84
|
color="${o}"
|
|
82
85
|
align="${s}"
|
|
83
86
|
line-height="1.3"
|
|
84
|
-
padding="${n}"${r}${
|
|
85
|
-
><${
|
|
87
|
+
padding="${n}"${r}${c}${l}
|
|
88
|
+
><${u} style="margin:0;font-size:inherit;color:inherit;line-height:inherit">${i}</${u}></mj-text>`;
|
|
86
89
|
}
|
|
87
|
-
function
|
|
90
|
+
function A(e) {
|
|
88
91
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
89
92
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
90
93
|
}
|
|
91
|
-
function
|
|
94
|
+
function j(e, t) {
|
|
92
95
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
93
96
|
}
|
|
94
97
|
//#endregion
|
|
95
98
|
//#region ../renderer/src/renderers/paragraph.ts
|
|
96
99
|
function te(e, t) {
|
|
97
|
-
if (
|
|
98
|
-
let n =
|
|
100
|
+
if (D(e) || e.content.replace(/<\/?p[^>]*>/gi, "").trim() === "") return "";
|
|
101
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = C(e.content);
|
|
99
102
|
return `<mj-text
|
|
100
103
|
line-height="1.5"
|
|
101
|
-
padding="${n}"${r}${
|
|
104
|
+
padding="${n}"${r}${O(e)}
|
|
102
105
|
>${i}</mj-text>`;
|
|
103
106
|
}
|
|
104
107
|
//#endregion
|
|
105
108
|
//#region ../renderer/src/renderers/image.ts
|
|
106
109
|
function ne(e, t) {
|
|
107
|
-
if (
|
|
108
|
-
let n =
|
|
109
|
-
e.linkUrl && (o = ` href="${
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
src="${s}"
|
|
113
|
-
alt="${c ? "" : b(e.alt)}"
|
|
110
|
+
if (D(e) || e.src === "") return "";
|
|
111
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = e.width === "full" ? t.containerWidth + "px" : e.width + "px", a = O(e), o = "";
|
|
112
|
+
return e.linkUrl && (o = ` href="${x(e.linkUrl)}"`, e.linkOpenInNewTab && (o += " target=\"_blank\" rel=\"noopener\"")), `<mj-image
|
|
113
|
+
src="${x(e.src)}"
|
|
114
|
+
alt="${e.decorative === !0 ? "" : x(e.alt)}"
|
|
114
115
|
width="${i}"
|
|
115
116
|
align="${e.align}"
|
|
116
|
-
padding="${n}"${r}${o}${a}
|
|
117
|
+
padding="${n}"${r}${o}${a}
|
|
117
118
|
/>`;
|
|
118
119
|
}
|
|
119
120
|
//#endregion
|
|
121
|
+
//#region ../renderer/src/renderers/input.ts
|
|
122
|
+
function M(e, t) {
|
|
123
|
+
return e ? `font-family:${S(t.resolveFontFamily(e))};` : "";
|
|
124
|
+
}
|
|
125
|
+
function re(e, t, n) {
|
|
126
|
+
if (e <= 0) return "border:none;";
|
|
127
|
+
let r = `${e}px`, i = S(t);
|
|
128
|
+
return n === "all" ? `border:${r} solid ${i};` : `border-style:solid;border-color:${i};border-top-width:${n === "top" ? r : "0"};border-right-width:${n === "right" ? r : "0"};border-bottom-width:${n === "bottom" ? r : "0"};border-left-width:${n === "left" ? r : "0"};`;
|
|
129
|
+
}
|
|
130
|
+
function ie(e) {
|
|
131
|
+
return b(C(e));
|
|
132
|
+
}
|
|
133
|
+
function ae(e, t) {
|
|
134
|
+
if (D(e)) return "";
|
|
135
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = x(`tpl-in-${e.id}`), o = x(e.id), s = ie(e.label), c = C(e.placeholder), l = C(e.defaultValue ?? ""), u = T(e.labelMargin), d = w(e.labelPadding), f = [
|
|
136
|
+
"display:block;",
|
|
137
|
+
`margin:${u};`,
|
|
138
|
+
`padding:${d};`,
|
|
139
|
+
`font-size:${e.labelFontSize}px;`,
|
|
140
|
+
`font-weight:${e.labelFontWeight};`,
|
|
141
|
+
`color:${S(e.labelColor)};`,
|
|
142
|
+
`text-align:${e.labelTextAlign};`,
|
|
143
|
+
M(e.labelFontFamily, t)
|
|
144
|
+
].filter(Boolean).join(""), p = T(e.inputMargin), m = w(e.inputPadding), h = e.inputWidth === "full" ? "100%" : `${e.inputWidth}px`, g = re(e.inputBorderWidth ?? 0, e.inputBorderColor ?? "#d1d5db", e.inputBorderSides ?? "all"), _ = [
|
|
145
|
+
"box-sizing:border-box;",
|
|
146
|
+
`width:${h};`,
|
|
147
|
+
`margin:${p};`,
|
|
148
|
+
`padding:${m};`,
|
|
149
|
+
`background-color:${S(e.inputBackgroundColor)};`,
|
|
150
|
+
`color:${S(e.inputTextColor)};`,
|
|
151
|
+
`font-size:${e.inputFontSize}px;`,
|
|
152
|
+
`border-radius:${e.inputBorderRadius}px;`,
|
|
153
|
+
g,
|
|
154
|
+
M(e.inputFontFamily, t),
|
|
155
|
+
"outline:none;"
|
|
156
|
+
].join(""), v = x(e.inputType), y = e.required ? " required" : "", b = e.name.trim() === "" ? "" : ` name="${x(e.name.trim())}"`;
|
|
157
|
+
return `<mj-text
|
|
158
|
+
line-height="1.5"
|
|
159
|
+
padding="${n}"${r}${i}
|
|
160
|
+
>${`${`<style type="text/css">[data-tpl-input="${o}"]::placeholder{color:${S(e.inputPlaceholderColor)}!important;opacity:1;}</style>`}<label for="${a}" style="${f}">${s}</label><input id="${a}"${b} type="${v}" data-tpl-input="${o}" placeholder="${x(c)}" value="${x(l)}" style="${_}"${y} />`}</mj-text>`;
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
120
163
|
//#region ../renderer/src/renderers/button.ts
|
|
121
|
-
function
|
|
122
|
-
if (
|
|
123
|
-
let n =
|
|
124
|
-
return `<mj-button${o}${e.openInNewTab ? " target=\"_blank\" rel=\"noopener\"" : ""}
|
|
164
|
+
function oe(e, t) {
|
|
165
|
+
if (D(e)) return "";
|
|
166
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = w(e.buttonPadding), a = P(e), o = a === "" ? "" : ` href="${a}"`, s = x(e.backgroundColor), c = x(e.textColor), l = e.fontSize, u = e.borderRadius, d = b(e.text), f = e.clickAction ?? "none";
|
|
167
|
+
return `<mj-button${o}${e.openInNewTab && f !== "next_step" && f !== "previous_step" ? " target=\"_blank\" rel=\"noopener\"" : ""}
|
|
125
168
|
background-color="${s}"
|
|
126
169
|
color="${c}"
|
|
127
170
|
font-size="${l}px"
|
|
128
171
|
font-weight="bold"
|
|
129
172
|
border-radius="${u}px"
|
|
130
173
|
inner-padding="${i}"
|
|
131
|
-
padding="${n}"${r}${
|
|
174
|
+
padding="${n}"${r}${F(e.fontFamily, t)}${se(e)}${N(e)}
|
|
132
175
|
>${d}</mj-button>`;
|
|
133
176
|
}
|
|
134
|
-
function
|
|
177
|
+
function se(e) {
|
|
178
|
+
let t = [], n = k(e);
|
|
179
|
+
n && t.push(...n.split(/\s+/).filter(Boolean));
|
|
180
|
+
let r = e.clickAction ?? "none";
|
|
181
|
+
return r === "next_step" ? t.push("tpl-btn-next-step") : r === "previous_step" && t.push("tpl-btn-prev-step"), t.length === 0 ? "" : ` css-class="${x(t.join(" "))}"`;
|
|
182
|
+
}
|
|
183
|
+
function N(e) {
|
|
184
|
+
let t = e.borderWidth ?? 0;
|
|
185
|
+
if (t <= 0) return "";
|
|
186
|
+
let n = x(`${t}px solid ${e.borderColor ?? "#000000"}`), r = x("none"), i = e.borderSides ?? "all";
|
|
187
|
+
return i === "all" ? ` border="${n}"` : ` border-top="${i === "top" ? n : r}" border-right="${i === "right" ? n : r}" border-bottom="${i === "bottom" ? n : r}" border-left="${i === "left" ? n : r}"`;
|
|
188
|
+
}
|
|
189
|
+
function P(e) {
|
|
190
|
+
let t = e.clickAction ?? "none";
|
|
191
|
+
if (t === "scroll_anchor") {
|
|
192
|
+
let t = e.clickActionAnchorId?.trim().replace(/^#/, "") ?? "";
|
|
193
|
+
return t === "" ? e.url === "" ? "" : x(e.url) : x(`#${t}`);
|
|
194
|
+
}
|
|
195
|
+
return t === "none" || t === "load_page" ? e.url === "" ? "" : x(e.url) : t === "next_step" || t === "previous_step" || t === "close_popup" ? x(e.url === "" ? "#" : e.url) : "";
|
|
196
|
+
}
|
|
197
|
+
function F(e, t) {
|
|
135
198
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
136
199
|
}
|
|
137
200
|
//#endregion
|
|
138
201
|
//#region ../renderer/src/renderers/divider.ts
|
|
139
|
-
function
|
|
140
|
-
if (
|
|
141
|
-
let n =
|
|
202
|
+
function I(e, t) {
|
|
203
|
+
if (D(e)) return "";
|
|
204
|
+
let n = w(e.styles.padding), r = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", i = e.width === "full" ? "100%" : e.width + "px";
|
|
142
205
|
return `<mj-divider
|
|
143
206
|
border-width="${e.thickness}px"
|
|
144
207
|
border-style="${e.lineStyle}"
|
|
145
|
-
border-color="${
|
|
208
|
+
border-color="${x(e.color)}"
|
|
146
209
|
width="${i}"
|
|
147
|
-
padding="${n}"${r}${
|
|
210
|
+
padding="${n}"${r}${O(e)}
|
|
148
211
|
/>`;
|
|
149
212
|
}
|
|
150
213
|
//#endregion
|
|
151
214
|
//#region ../renderer/src/renderers/spacer.ts
|
|
152
|
-
function
|
|
153
|
-
return
|
|
215
|
+
function L(e, t) {
|
|
216
|
+
return D(e) ? "" : `<mj-spacer height="${e.height}px" padding="0"${e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : ""}${O(e)} />`;
|
|
154
217
|
}
|
|
155
218
|
//#endregion
|
|
156
219
|
//#region ../renderer/src/renderers/html.ts
|
|
157
|
-
function
|
|
158
|
-
if (
|
|
220
|
+
function R(e, t) {
|
|
221
|
+
if (D(e) || !t.allowHtmlBlocks) return "";
|
|
159
222
|
let n = e.content;
|
|
160
|
-
return n === "" ? "" : `<mj-text${
|
|
223
|
+
return n === "" ? "" : `<mj-text${O(e)}>
|
|
161
224
|
${n}
|
|
162
225
|
</mj-text>`;
|
|
163
226
|
}
|
|
164
227
|
//#endregion
|
|
165
228
|
//#region ../renderer/src/social-icons.ts
|
|
166
|
-
var
|
|
229
|
+
var z = {
|
|
167
230
|
facebook: {
|
|
168
231
|
path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",
|
|
169
232
|
color: "#1877F2"
|
|
@@ -229,8 +292,8 @@ var P = {
|
|
|
229
292
|
color: "#1769FF"
|
|
230
293
|
}
|
|
231
294
|
};
|
|
232
|
-
function
|
|
233
|
-
let r =
|
|
295
|
+
function B(e, t, n) {
|
|
296
|
+
let r = z[e], i = r?.path ?? "", a = r?.color ?? "#6B7280";
|
|
234
297
|
if (i === "") return "";
|
|
235
298
|
let o = t === "outlined" ? a : "#ffffff", s;
|
|
236
299
|
switch (t) {
|
|
@@ -255,11 +318,11 @@ function F(e, t, n) {
|
|
|
255
318
|
}
|
|
256
319
|
//#endregion
|
|
257
320
|
//#region ../renderer/src/renderers/social.ts
|
|
258
|
-
function
|
|
259
|
-
if (
|
|
321
|
+
function V(e, t) {
|
|
322
|
+
if (D(e)) return "";
|
|
260
323
|
let n = e.icons;
|
|
261
324
|
if (n.length === 0) return "";
|
|
262
|
-
let r =
|
|
325
|
+
let r = w(e.styles.padding), i = e.styles.backgroundColor ? ` container-background-color="${x(e.styles.backgroundColor)}"` : "", a = O(e), o = e.align, s = e.iconSize, c = e.iconStyle, l = e.spacing, u;
|
|
263
326
|
switch (s) {
|
|
264
327
|
case "small":
|
|
265
328
|
u = 24;
|
|
@@ -294,85 +357,85 @@ function I(e, t) {
|
|
|
294
357
|
padding="${r}"${i}${a}
|
|
295
358
|
>
|
|
296
359
|
${n.map((e, t) => {
|
|
297
|
-
let n = e.platform, r =
|
|
360
|
+
let n = e.platform, r = x(e.url), i = B(n, c, u), a = t === f - 1 ? 0 : l;
|
|
298
361
|
return `<mj-social-element src="${i}" href="${r}" icon-size="${u}px" padding="0 ${a}px 0 0" border-radius="${d}" background-color="transparent"></mj-social-element>`;
|
|
299
362
|
}).join("\n")}
|
|
300
363
|
</mj-social>`;
|
|
301
364
|
}
|
|
302
365
|
//#endregion
|
|
303
366
|
//#region ../renderer/src/renderers/menu.ts
|
|
304
|
-
function
|
|
305
|
-
if (
|
|
306
|
-
let n =
|
|
367
|
+
function H(e, t) {
|
|
368
|
+
if (D(e) || e.items.length === 0) return "";
|
|
369
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = G(e.fontFamily, t), o = e.textAlign;
|
|
307
370
|
return `<mj-text
|
|
308
371
|
font-size="${e.fontSize}px"
|
|
309
|
-
color="${
|
|
372
|
+
color="${x(e.color)}"
|
|
310
373
|
align="${o}"
|
|
311
374
|
line-height="1.5"
|
|
312
375
|
padding="${n}"${r}${a}${i}
|
|
313
|
-
>${
|
|
376
|
+
>${U(e)}</mj-text>`;
|
|
314
377
|
}
|
|
315
|
-
function
|
|
316
|
-
let t = e.items, n =
|
|
317
|
-
for (let e = 0; e < s; e++) o.push(
|
|
378
|
+
function U(e) {
|
|
379
|
+
let t = e.items, n = b(e.separator), r = S(e.separatorColor), i = e.spacing, a = e.linkColor ?? e.color, o = [], s = t.length;
|
|
380
|
+
for (let e = 0; e < s; e++) o.push(W(t[e], a)), e < s - 1 && o.push(`<span style="color: ${r}; padding: 0 ${i}px;">${n}</span>`);
|
|
318
381
|
return o.join("");
|
|
319
382
|
}
|
|
320
|
-
function
|
|
321
|
-
let n =
|
|
383
|
+
function W(e, t) {
|
|
384
|
+
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"];
|
|
322
385
|
return e.bold && o.push("font-weight: bold"), e.underline && o.push("text-decoration: underline"), `<a href="${r}" style="${o.join("; ")}"${a}>${n}</a>`;
|
|
323
386
|
}
|
|
324
|
-
function
|
|
387
|
+
function G(e, t) {
|
|
325
388
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
326
389
|
}
|
|
327
390
|
//#endregion
|
|
328
391
|
//#region ../renderer/src/renderers/table.ts
|
|
329
|
-
function
|
|
330
|
-
if (
|
|
331
|
-
let n =
|
|
392
|
+
function K(e, t) {
|
|
393
|
+
if (D(e) || e.rows.length === 0) return "";
|
|
394
|
+
let n = w(e.styles.padding), r = E(e.styles.backgroundColor, "container"), i = O(e), a = de(e.fontFamily, t);
|
|
332
395
|
return `<mj-text
|
|
333
396
|
font-size="${e.fontSize}px"
|
|
334
|
-
color="${
|
|
397
|
+
color="${x(e.color)}"
|
|
335
398
|
align="${e.textAlign}"
|
|
336
399
|
line-height="1.5"
|
|
337
400
|
padding="${n}"${r}${a}${i}
|
|
338
|
-
>${
|
|
401
|
+
>${ce(e)}</mj-text>`;
|
|
339
402
|
}
|
|
340
|
-
function
|
|
341
|
-
let t =
|
|
403
|
+
function ce(e) {
|
|
404
|
+
let t = S(e.borderColor), n = e.borderWidth, r = "";
|
|
342
405
|
for (let i = 0; i < e.rows.length; i++) {
|
|
343
406
|
let a = e.rows[i];
|
|
344
|
-
r +=
|
|
407
|
+
r += le(a, e, e.hasHeaderRow && i === 0, t, n);
|
|
345
408
|
}
|
|
346
409
|
return `<table style="width: 100%; border-collapse: collapse;">${r}</table>`;
|
|
347
410
|
}
|
|
348
|
-
function
|
|
411
|
+
function le(e, t, n, r, i) {
|
|
349
412
|
let a = "";
|
|
350
|
-
for (let o of e.cells) a +=
|
|
413
|
+
for (let o of e.cells) a += ue(o, t, n, r, i);
|
|
351
414
|
return `<tr>${a}</tr>`;
|
|
352
415
|
}
|
|
353
|
-
function
|
|
416
|
+
function ue(e, t, n, r, i) {
|
|
354
417
|
let a = t.cellPadding, o = [`border: ${i}px solid ${r}`, `padding: ${a}px`];
|
|
355
|
-
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${
|
|
356
|
-
let s = o.join("; "), c =
|
|
418
|
+
n && (o.push("font-weight: bold"), t.headerBackgroundColor && o.push(`background-color: ${S(t.headerBackgroundColor)}`));
|
|
419
|
+
let s = o.join("; "), c = C(e.content), l = n ? "th" : "td";
|
|
357
420
|
return `<${l} style="${s}">${c}</${l}>`;
|
|
358
421
|
}
|
|
359
|
-
function
|
|
422
|
+
function de(e, t) {
|
|
360
423
|
return e ? ` font-family="${t.resolveFontFamily(e)}"` : "";
|
|
361
424
|
}
|
|
362
425
|
//#endregion
|
|
363
426
|
//#region ../renderer/src/renderers/custom.ts
|
|
364
|
-
function
|
|
365
|
-
if (
|
|
427
|
+
function fe(e, t) {
|
|
428
|
+
if (D(e)) return "";
|
|
366
429
|
let n = t.customBlockHtml.get(e.id) ?? e.renderedHtml;
|
|
367
430
|
if (!n || n === "") return "";
|
|
368
|
-
let r =
|
|
369
|
-
return `<mj-text${
|
|
431
|
+
let r = O(e);
|
|
432
|
+
return `<mj-text${E(e.styles?.backgroundColor, "container")}${r}>
|
|
370
433
|
${n}
|
|
371
434
|
</mj-text>`;
|
|
372
435
|
}
|
|
373
436
|
//#endregion
|
|
374
437
|
//#region ../renderer/src/columns.ts
|
|
375
|
-
function
|
|
438
|
+
function q(e) {
|
|
376
439
|
switch (e) {
|
|
377
440
|
case "2": return ["50%", "50%"];
|
|
378
441
|
case "3": return [
|
|
@@ -385,7 +448,7 @@ function K(e) {
|
|
|
385
448
|
default: return ["100%"];
|
|
386
449
|
}
|
|
387
450
|
}
|
|
388
|
-
function
|
|
451
|
+
function J(e, t) {
|
|
389
452
|
switch (e) {
|
|
390
453
|
case "2": return [t * .5, t * .5];
|
|
391
454
|
case "3": return [
|
|
@@ -400,25 +463,25 @@ function q(e, t) {
|
|
|
400
463
|
}
|
|
401
464
|
//#endregion
|
|
402
465
|
//#region ../renderer/src/renderers/section.ts
|
|
403
|
-
function
|
|
404
|
-
if (
|
|
405
|
-
let r = e.columns, i =
|
|
466
|
+
function pe(e, t, n) {
|
|
467
|
+
if (D(e)) return "";
|
|
468
|
+
let r = e.columns, i = q(r), o = J(r, t.containerWidth), s = w(e.styles.padding), c = E(e.styles.backgroundColor, "native"), l = O(e), u = e.children, d = [];
|
|
406
469
|
for (let e = 0; e < u.length; e++) {
|
|
407
|
-
let r = u[e],
|
|
408
|
-
d.push(`<mj-column width="${
|
|
470
|
+
let r = u[e], s = i[e] ?? "100%", c = Math.floor(o[e] ?? t.containerWidth), l = me(r, t.allowHtmlBlocks).filter((e) => !a(e)), f = t.withContainerWidth(c), p = l.map((e) => n(e, f)).filter((e) => e !== "").join("\n");
|
|
471
|
+
d.push(`<mj-column width="${s}">
|
|
409
472
|
${p === "" ? "<mj-text> </mj-text>" : p}
|
|
410
473
|
</mj-column>`);
|
|
411
474
|
}
|
|
412
|
-
return `<mj-section${c} padding="${
|
|
475
|
+
return `<mj-section${c} padding="${s}"${l}>
|
|
413
476
|
${d.join("\n")}
|
|
414
477
|
</mj-section>`;
|
|
415
478
|
}
|
|
416
|
-
function
|
|
479
|
+
function me(e, t) {
|
|
417
480
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
418
481
|
}
|
|
419
482
|
//#endregion
|
|
420
483
|
//#region ../renderer/src/renderers/video.ts
|
|
421
|
-
function
|
|
484
|
+
function he(e, t) {
|
|
422
485
|
if (t) return t;
|
|
423
486
|
if (!e) return null;
|
|
424
487
|
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})/]) {
|
|
@@ -428,51 +491,51 @@ function ae(e, t) {
|
|
|
428
491
|
let n = e.match(/vimeo\.com\/(?:video\/)?(\d+)/);
|
|
429
492
|
return n ? `https://vumbnail.com/${n[1]}.jpg` : null;
|
|
430
493
|
}
|
|
431
|
-
function
|
|
432
|
-
if (
|
|
433
|
-
let n =
|
|
494
|
+
function ge(e, t) {
|
|
495
|
+
if (D(e)) return "";
|
|
496
|
+
let n = he(e.url, e.thumbnailUrl);
|
|
434
497
|
if (!n) return "";
|
|
435
|
-
let r =
|
|
498
|
+
let r = w(e.styles.padding), i = E(e.styles.backgroundColor, "container"), a = e.width === "full" ? t.containerWidth + "px" : e.width + "px", o = O(e);
|
|
436
499
|
return `<mj-image
|
|
437
|
-
src="${
|
|
438
|
-
alt="${
|
|
500
|
+
src="${x(n)}"
|
|
501
|
+
alt="${x(e.alt)}"
|
|
439
502
|
width="${a}"
|
|
440
503
|
align="${e.align}"
|
|
441
504
|
padding="${r}"
|
|
442
|
-
href="${
|
|
505
|
+
href="${x(e.url)}"
|
|
443
506
|
target="_blank"
|
|
444
507
|
rel="noopener"${i}${o}
|
|
445
508
|
/>`;
|
|
446
509
|
}
|
|
447
510
|
//#endregion
|
|
448
511
|
//#region ../renderer/src/renderers/index.ts
|
|
449
|
-
function
|
|
450
|
-
return
|
|
512
|
+
function Y(e, m) {
|
|
513
|
+
return a(e) ? pe(e, m, Y) : s(e) ? ee(e, m) : h(e) ? te(e, m) : u(e) ? ne(e, m) : r(e) ? ae(e, m) : n(e) ? oe(e, m) : i(e) ? I(e, m) : d(e) ? L(e, m) : c(e) ? R(e, m) : f(e) ? V(e, m) : o(e) ? H(e, m) : p(e) ? K(e, m) : t(e) ? ge(e, m) : l(e) ? fe(e, m) : "";
|
|
451
514
|
}
|
|
452
515
|
//#endregion
|
|
453
516
|
//#region ../renderer/src/index.ts
|
|
454
|
-
var
|
|
455
|
-
RenderContext: () =>
|
|
456
|
-
SOCIAL_ICONS: () =>
|
|
457
|
-
convertMergeTagsToValues: () =>
|
|
458
|
-
escapeAttr: () =>
|
|
459
|
-
escapeHtml: () =>
|
|
460
|
-
generateSocialIconDataUri: () =>
|
|
461
|
-
getCssClassAttr: () =>
|
|
462
|
-
getCssClasses: () =>
|
|
463
|
-
getWidthPercentages: () =>
|
|
464
|
-
getWidthPixels: () =>
|
|
465
|
-
isHiddenOnAll: () =>
|
|
466
|
-
renderBlock: () =>
|
|
467
|
-
renderToMjml: () =>
|
|
468
|
-
toPaddingString: () =>
|
|
517
|
+
var _e = /* @__PURE__ */ e({
|
|
518
|
+
RenderContext: () => _,
|
|
519
|
+
SOCIAL_ICONS: () => z,
|
|
520
|
+
convertMergeTagsToValues: () => C,
|
|
521
|
+
escapeAttr: () => x,
|
|
522
|
+
escapeHtml: () => b,
|
|
523
|
+
generateSocialIconDataUri: () => B,
|
|
524
|
+
getCssClassAttr: () => O,
|
|
525
|
+
getCssClasses: () => k,
|
|
526
|
+
getWidthPercentages: () => q,
|
|
527
|
+
getWidthPixels: () => J,
|
|
528
|
+
isHiddenOnAll: () => D,
|
|
529
|
+
renderBlock: () => Y,
|
|
530
|
+
renderToMjml: () => ve,
|
|
531
|
+
toPaddingString: () => w
|
|
469
532
|
});
|
|
470
|
-
async function
|
|
471
|
-
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = await
|
|
472
|
-
return `<mjml lang="${
|
|
533
|
+
async function ve(e, t) {
|
|
534
|
+
let n = t?.customFonts ?? [], r = t?.defaultFallbackFont ?? "Arial, sans-serif", i = t?.allowHtmlBlocks ?? !0, a = await Q(e, t?.renderCustomBlock), o = new _(e.settings.width, n, r, i, a), s = o.resolveFontFamily(e.settings.fontFamily), c = e.settings.backgroundColor, l = (e.canvasPages?.length ?? 0) > 0, u = ye(e, o, i), d = Ce(n), f = Se(e.settings.preheaderText), p = x(e.settings.locale), m = `width="${o.containerWidth}px" background-color="${c}"` + (l ? " css-class=\"tpl-canvas-multi\"" : "");
|
|
535
|
+
return `<mjml lang="${p}">
|
|
473
536
|
<mj-head>${f}
|
|
474
537
|
<mj-attributes>
|
|
475
|
-
<mj-all font-family="${
|
|
538
|
+
<mj-all font-family="${s}" />
|
|
476
539
|
<mj-text font-size="14px" />
|
|
477
540
|
<mj-section padding="0" />
|
|
478
541
|
<mj-column padding="0" />
|
|
@@ -488,47 +551,64 @@ async function ce(e, t) {
|
|
|
488
551
|
}
|
|
489
552
|
@media only screen and (min-width: 769px) {
|
|
490
553
|
.tpl-hide-desktop { display: none !important; mso-hide: all !important; }
|
|
491
|
-
}
|
|
554
|
+
}${l ? Ee() : ""}
|
|
492
555
|
</mj-style>
|
|
493
556
|
</mj-head>
|
|
494
|
-
<mj-body
|
|
495
|
-
${u}
|
|
557
|
+
<mj-body ${m}>
|
|
558
|
+
${u}${l ? `\n${De()}\n` : ""}
|
|
496
559
|
</mj-body>
|
|
497
560
|
</mjml>`;
|
|
498
561
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
562
|
+
function ye(e, t, n) {
|
|
563
|
+
let r = e.canvasPages;
|
|
564
|
+
if (r?.length) {
|
|
565
|
+
let e = [];
|
|
566
|
+
for (let i = 0; i < r.length; i++) {
|
|
567
|
+
let a = X(r[i].blocks ?? [], t, n);
|
|
568
|
+
if (a.trim() === "") continue;
|
|
569
|
+
let o = i === 0 ? `tpl-canvas-page tpl-canvas-page-idx-${i} tpl-canvas-page--current` : `tpl-canvas-page tpl-canvas-page-idx-${i}`;
|
|
570
|
+
e.push(`<mj-wrapper css-class="${x(o)}" padding="0">\n${a}\n</mj-wrapper>`);
|
|
571
|
+
}
|
|
572
|
+
return e.join("\n");
|
|
573
|
+
}
|
|
574
|
+
return X(e.blocks, t, n);
|
|
575
|
+
}
|
|
576
|
+
function X(e, t, n) {
|
|
577
|
+
return we(e, n).map((e) => be(e, t)).filter((e) => e !== "").join("\n");
|
|
578
|
+
}
|
|
579
|
+
function be(e, t) {
|
|
580
|
+
return a(e) ? Z(e, Y(e, t)) : Z(e, xe(Y(e, t)));
|
|
501
581
|
}
|
|
502
|
-
function
|
|
582
|
+
function Z(e, t) {
|
|
503
583
|
if (t === "") return "";
|
|
504
584
|
let n = e.displayCondition;
|
|
505
585
|
return n ? `<mj-raw>${n.before}</mj-raw>
|
|
506
586
|
` + t + `
|
|
507
587
|
<mj-raw>${n.after}</mj-raw>` : t;
|
|
508
588
|
}
|
|
509
|
-
function
|
|
589
|
+
function xe(e) {
|
|
510
590
|
return e === "" ? "" : `<mj-section>
|
|
511
591
|
<mj-column>
|
|
512
592
|
${e}
|
|
513
593
|
</mj-column>
|
|
514
594
|
</mj-section>`;
|
|
515
595
|
}
|
|
516
|
-
function
|
|
596
|
+
function Se(e) {
|
|
517
597
|
if (!e) return "";
|
|
518
598
|
let t = e.trim();
|
|
519
|
-
return t === "" ? "" : `\n <mj-preview>${
|
|
599
|
+
return t === "" ? "" : `\n <mj-preview>${b(t)}</mj-preview>`;
|
|
520
600
|
}
|
|
521
|
-
function
|
|
522
|
-
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${
|
|
601
|
+
function Ce(e) {
|
|
602
|
+
return e.length === 0 ? "" : e.map((e) => `\n <mj-font name="${x(e.name)}" href="${x(e.url)}" />`).join("");
|
|
523
603
|
}
|
|
524
|
-
function
|
|
604
|
+
function we(e, t) {
|
|
525
605
|
return t ? e : e.filter((e) => e.type !== "html");
|
|
526
606
|
}
|
|
527
|
-
async function
|
|
607
|
+
async function Q(e, t) {
|
|
528
608
|
let n = /* @__PURE__ */ new Map();
|
|
529
609
|
if (!t) return n;
|
|
530
610
|
let r = [];
|
|
531
|
-
if (
|
|
611
|
+
if (Te(e, r), r.length === 0) return n;
|
|
532
612
|
let i = await Promise.all(r.map((e) => t(e)));
|
|
533
613
|
for (let e = 0; e < r.length; e++) n.set(r[e].id, i[e]);
|
|
534
614
|
return n;
|
|
@@ -539,10 +619,24 @@ function $(e, t) {
|
|
|
539
619
|
t.push(n);
|
|
540
620
|
continue;
|
|
541
621
|
}
|
|
542
|
-
if (
|
|
622
|
+
if (a(n)) for (let e of n.children) $(e, t);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function Te(e, t) {
|
|
626
|
+
let n = e.canvasPages;
|
|
627
|
+
if (n?.length) {
|
|
628
|
+
for (let e of n) $(e.blocks ?? [], t);
|
|
629
|
+
return;
|
|
543
630
|
}
|
|
631
|
+
$(e.blocks, t);
|
|
632
|
+
}
|
|
633
|
+
function Ee() {
|
|
634
|
+
return "\n .tpl-canvas-multi .tpl-canvas-page { display: none !important; }\n .tpl-canvas-multi .tpl-canvas-page.tpl-canvas-page--current { display: block !important; }";
|
|
635
|
+
}
|
|
636
|
+
function De() {
|
|
637
|
+
return "<mj-raw>\n <script>\n (function () {\n var root = document.body;\n if (!root || !root.classList.contains(\"tpl-canvas-multi\")) return;\n root.addEventListener(\n \"click\",\n function (e) {\n var link = e.target.closest(\"a\");\n if (!link || !root.contains(link)) return;\n var isNext =\n link.classList.contains(\"tpl-btn-next-step\") ||\n !!link.closest(\"td.tpl-btn-next-step\");\n var isPrev =\n link.classList.contains(\"tpl-btn-prev-step\") ||\n !!link.closest(\"td.tpl-btn-prev-step\");\n if (!isNext && !isPrev) return;\n e.preventDefault();\n e.stopPropagation();\n var pages = Array.prototype.slice.call(\n root.querySelectorAll(\".tpl-canvas-page\"),\n );\n var cur = root.querySelector(\n \".tpl-canvas-page.tpl-canvas-page--current\",\n );\n var i = pages.indexOf(cur);\n if (i < 0) return;\n if (isNext) {\n if (i >= pages.length - 1) return;\n pages[i].classList.remove(\"tpl-canvas-page--current\");\n pages[i + 1].classList.add(\"tpl-canvas-page--current\");\n } else {\n if (i <= 0) return;\n pages[i].classList.remove(\"tpl-canvas-page--current\");\n pages[i - 1].classList.add(\"tpl-canvas-page--current\");\n }\n },\n true,\n );\n })();\n <\/script>\n </mj-raw>";
|
|
544
638
|
}
|
|
545
639
|
//#endregion
|
|
546
|
-
export {
|
|
640
|
+
export { _e as t };
|
|
547
641
|
|
|
548
|
-
//# sourceMappingURL=renderer-
|
|
642
|
+
//# sourceMappingURL=renderer-D0L44Vlp.js.map
|