@aswin.dev/editor 0.7.1 → 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/dist/{AccessibilityPanel-COL6Wm7p.js → AccessibilityPanel-EmQ19wiS.js} +1 -1
- package/dist/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-DeB0w_32.js} +38 -52
- package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-DoLD5Cde.js} +5 -5
- package/dist/{BlockA11yBadge-Qs6HtXid.js → BlockA11yBadge-DkNbDvJA.js} +1 -1
- package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-zo9PjjvY.js} +255 -248
- package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-BsXMY-8e.js} +3 -3
- package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DIWIa4rS.js} +6 -6
- package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-BuS8p5ju.js} +2 -2
- package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-RDlnhL-6.js} +5 -5
- package/dist/{LoadingTrack-Ba2pfF57.js → LoadingTrack-BJ59h9ok.js} +1 -1
- package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-b7HbpByz.js} +7 -7
- package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-D__YlOLS.js} +1 -1
- package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-Ca3vNY84.js} +1 -1
- package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-B1aYPO-6.js} +18 -18
- package/dist/{RichTextEditorContent-CrqPQdnk.js → RichTextEditorContent-BmEVMrkJ.js} +1 -1
- package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-ClovqI6h.js} +3 -3
- package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-DoqtH0cw.js} +3 -3
- package/dist/{TemplateScoringPanel-CS7o62zS.js → TemplateScoringPanel-DQv2ZAiL.js} +7 -7
- package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-iIeYJYsj.js} +3 -3
- package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CTDIwRF_.js} +7 -7
- package/dist/{TplModal-BAsVzcTb.js → TplModal-CBq1J1pG.js} +1 -1
- package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-QkC6f5UE.js} +1 -1
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/AccessibilityPanel-BeU8nz7A.js +97 -0
- package/dist/cdn/chunks/AccessibilityPanel-BeU8nz7A.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-B2mhscyP.js.map +1 -0
- package/dist/cdn/chunks/BlockA11yBadge-C4g77gF0.js +33 -0
- package/dist/cdn/chunks/BlockA11yBadge-C4g77gF0.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js +1183 -0
- package/dist/cdn/chunks/CloudEditor-Btyr0b0_.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar-YBiIjiRh.js +51 -0
- 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/cdn/chunks/ModuleBrowserModal-C2CDWKW6.js +195 -0
- 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-Ty1bp9vB.js +423 -0
- package/dist/cdn/chunks/NumberWithSuffix-Ty1bp9vB.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-BA1WbHI7.js +544 -0
- package/dist/cdn/chunks/ParagraphEditor-BA1WbHI7.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-BtWCA_Oc.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-BtWCA_Oc.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-AwL0tkCV.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-DbSyeixS.js +171 -0
- 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-Ce-LbJ2J.js +89 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
- package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
- package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
- package/dist/cdn/chunks/de-_tooy3Q8.js +771 -0
- package/dist/cdn/chunks/de-_tooy3Q8.js.map +1 -0
- package/dist/cdn/chunks/draggable-C-1_gch3.js +11572 -0
- package/dist/cdn/chunks/draggable-C-1_gch3.js.map +1 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
- package/dist/cdn/chunks/en-CNqLoIm9.js +771 -0
- package/dist/cdn/chunks/en-CNqLoIm9.js.map +1 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
- package/dist/cdn/chunks/extensions-BVKQw_sp.js +598 -0
- package/dist/cdn/chunks/extensions-BVKQw_sp.js.map +1 -0
- package/dist/cdn/chunks/features-DIBEo4xl.js +7913 -0
- package/dist/cdn/chunks/features-DIBEo4xl.js.map +1 -0
- package/dist/cdn/chunks/icons-C1Gg-ov-.js +992 -0
- package/dist/cdn/chunks/icons-C1Gg-ov-.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
- package/dist/cdn/chunks/media-library-BTF_Ko70.js +6014 -0
- package/dist/cdn/chunks/media-library-BTF_Ko70.js.map +1 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
- package/dist/cdn/chunks/quality-C5AmotmP.js +1456 -0
- package/dist/cdn/chunks/quality-C5AmotmP.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
- package/dist/cdn/chunks/renderer-D0L44Vlp.js +642 -0
- package/dist/cdn/chunks/renderer-D0L44Vlp.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
- package/dist/cdn/chunks/src-RKexlYjA.js +497 -0
- 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-CDzAbF2j.js +14654 -0
- package/dist/cdn/chunks/tiptap-CDzAbF2j.js.map +1 -0
- package/dist/cdn/editor.css +2 -0
- package/dist/cdn/editor.js +338 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/{cloud-6ZmAvF0j.js → cloud-DJG4tb4_.js} +1 -1
- package/dist/{de-DWcgp-7T.js → de-2LEvILeZ.js} +40 -0
- package/dist/{dist-DtiDUrX-.js → dist-BHAeXaUY.js} +1 -1
- package/dist/{dist-BUzw1buG.js → dist-BSJvAvH3.js} +1 -1
- package/dist/{dist-COSzWQUs.js → dist-BeFnymxK.js} +1 -1
- package/dist/dist-Bmir0gYb.js +1167 -0
- package/dist/{dist-C3T2AKtB.js → dist-BvPgo-UK.js} +1 -1
- package/dist/{dist-C9ckKEZL.js → dist-CPVBKMmd.js} +1 -1
- package/dist/{dist-BadNx4qo.js → dist-Df4ie7vZ.js} +1 -1
- package/dist/{dist-CBItRG-Z.js → dist-DxOoemkW.js} +1 -1
- package/dist/{dist-Dzt5foyL.js → dist-HEQ52gTJ.js} +1 -1
- package/dist/{dist-BZyY-SS4.js → dist-b-XUqAoF.js} +1 -1
- package/dist/{dist-Bz3M4RXG.js → dist-kZfaVUpW.js} +3 -3
- package/dist/{dist-BesOh2mk.js → dist-wfAedlzi.js} +1 -1
- package/dist/{en-Cxd4fhNm.js → en-D2RU2Poj.js} +40 -0
- package/dist/{extensions-D__hOlV1.js → extensions-BQ1xXx3d.js} +21 -21
- package/dist/index.d.ts +17 -6
- package/dist/style.css +1 -1
- package/dist/{styles-B4tjX5SP.js → styles-CavWjvol.js} +1573 -1310
- package/dist/templatical-editor.js +161 -132
- package/dist/undo-2-Cg8I7obC.js +16 -0
- package/dist/{useEditorCore-wslttMH-.js → useEditorCore-BGnzcT7p.js} +37 -37
- package/dist/{useMergeTag-DX0XG5V9.js → useMergeTag-CfuZq2fF.js} +3 -3
- package/package.json +12 -12
- package/dist/dist-C04s_fLA.js +0 -563
- /package/dist/{CountdownBlock-DaYGxKqo.js → CountdownBlock-BCi7-DAM.js} +0 -0
- /package/dist/{_plugin-vue_export-helper-BVAJ4lgT.js → _plugin-vue_export-helper-Bwh4ceeO.js} +0 -0
- /package/dist/{de-GOtR9DwW.js → de-D2npYjrZ.js} +0 -0
- /package/dist/{dist-DXa1uAMh.js → dist-DvHLtWVP.js} +0 -0
- /package/dist/{emojiData-DrBuvEoP.js → emojiData-DvQBBzmO.js} +0 -0
- /package/dist/{en-dFFQVzNn.js → en-ib-4h3_o.js} +0 -0
- /package/dist/{formatRelativeTime-BhhO8yCl.js → formatRelativeTime-CFDZnEIs.js} +0 -0
- /package/dist/{liquid.browser-BvCyLQII.js → liquid.browser-7Rv0QDiO.js} +0 -0
- /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
- /package/dist/{scan-line-CzfFJO1o.js → scan-line-DlghmhNf.js} +0 -0
- /package/dist/{send-D2eSo4GH.js → send-DDdhIRj8.js} +0 -0
- /package/dist/{shield-check-jkpgcC0-.js → shield-check-OSQ-JVTX.js} +0 -0
- /package/dist/{sparkles-Chm5CZfb.js → sparkles-BN4a-CoF.js} +0 -0
- /package/dist/{styleConstants-34eUKPOZ.js → styleConstants-wWRbcuEK.js} +0 -0
- /package/dist/{text-align-start-CzBnJsW8.js → text-align-start-D1weisjS.js} +0 -0
- /package/dist/{trash-2-CtK2apEH.js → trash-2-CMWvQ5KX.js} +0 -0
- /package/dist/{triangle-alert-KpDVNbpn.js → triangle-alert-DyidRNX_.js} +0 -0
- /package/dist/{useCloudI18n-DOKSZql1.js → useCloudI18n-BTTNBk5i.js} +0 -0
- /package/dist/{x-BkaOMosX.js → x-CgIhNcT9.js} +0 -0
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { At as e, C as t, Ft as n, M as r, N as i, P as a, T as o, U as s, W as c, _ as l, b as u, et as d, f, g as p, h as m, j as
|
|
2
|
-
import { r as
|
|
3
|
-
import { f as
|
|
4
|
-
import { L as
|
|
5
|
-
import { w as
|
|
6
|
-
import { a as
|
|
7
|
-
import { t as
|
|
1
|
+
import { At as e, C as t, Ft as n, M as r, N as i, P as a, T as o, U as s, W as c, _ as l, b as u, et as d, f, g as p, h as m, j as h, jt as g, l as _, m as v, n as y, st as b, t as ee, v as x, x as S } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { r as C } from "./timeouts-BSGxjuUF.js";
|
|
3
|
+
import { f as te, r as ne } from "./dist-Bmir0gYb.js";
|
|
4
|
+
import { L as w, S as T, t as re, z as ie } from "./useEditorCore-BGnzcT7p.js";
|
|
5
|
+
import { w as ae } from "./keys-CvX8D-8C.js";
|
|
6
|
+
import { a as oe, c as se, d as ce, f as le, g as ue, h as de, i as fe, l as pe, m as me, n as he, o as E, p as D, r as O, s as k, t as A, u as j } from "./styles-CavWjvol.js";
|
|
7
|
+
import { t as M } from "./_plugin-vue_export-helper-Bwh4ceeO.js";
|
|
8
8
|
//#region src/Editor.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var N = ["data-tpl-theme"], P = {
|
|
10
10
|
class: "tpl-header tpl:absolute tpl:top-0 tpl:right-0 tpl:left-0 tpl:z-50 tpl:grid tpl:h-14 tpl:grid-cols-[1fr_auto_1fr] tpl:items-center tpl:px-4 tpl:shadow-[var(--tpl-shadow-md)] tpl:border-b tpl:border-[var(--tpl-border)]",
|
|
11
11
|
style: {
|
|
12
12
|
"background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)",
|
|
13
13
|
"backdrop-filter": "blur(12px)",
|
|
14
14
|
"-webkit-backdrop-filter": "blur(12px)"
|
|
15
15
|
}
|
|
16
|
-
},
|
|
16
|
+
}, F = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, I = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, L = { class: "tpl:flex tpl:justify-center tpl:p-8" }, R = ["aria-label"], z = /* @__PURE__ */ M(/* @__PURE__ */ t({
|
|
17
17
|
__name: "Editor",
|
|
18
18
|
props: {
|
|
19
19
|
config: {},
|
|
@@ -21,109 +21,114 @@ var M = ["data-tpl-theme"], N = {
|
|
|
21
21
|
fontsManager: {}
|
|
22
22
|
},
|
|
23
23
|
setup(t, { expose: o }) {
|
|
24
|
-
let
|
|
25
|
-
content:
|
|
26
|
-
templateDefaults:
|
|
27
|
-
}),
|
|
28
|
-
editor:
|
|
24
|
+
let y = d(null), C = t, T = ie({
|
|
25
|
+
content: C.config.content,
|
|
26
|
+
templateDefaults: C.config.templateDefaults
|
|
27
|
+
}), E = re({
|
|
28
|
+
editor: T,
|
|
29
29
|
config: {
|
|
30
|
-
uiTheme:
|
|
31
|
-
theme:
|
|
32
|
-
blockDefaults:
|
|
33
|
-
customBlocks:
|
|
34
|
-
mergeTags:
|
|
35
|
-
displayConditions:
|
|
36
|
-
onRequestMedia:
|
|
37
|
-
editorType:
|
|
38
|
-
accessibility:
|
|
39
|
-
onSave:
|
|
30
|
+
uiTheme: C.config.uiTheme,
|
|
31
|
+
theme: C.config.theme,
|
|
32
|
+
blockDefaults: C.config.blockDefaults,
|
|
33
|
+
customBlocks: C.config.customBlocks,
|
|
34
|
+
mergeTags: C.config.mergeTags,
|
|
35
|
+
displayConditions: C.config.displayConditions,
|
|
36
|
+
onRequestMedia: C.config.onRequestMedia,
|
|
37
|
+
editorType: C.config.editorType,
|
|
38
|
+
accessibility: de(C.config),
|
|
39
|
+
onSave: C.config.onSave ? () => C.config.onSave(JSON.parse(JSON.stringify(T.state.content))) : void 0
|
|
40
40
|
},
|
|
41
|
-
translations:
|
|
42
|
-
fontsManager:
|
|
43
|
-
autoSaveOptions:
|
|
41
|
+
translations: C.translations,
|
|
42
|
+
fontsManager: C.fontsManager,
|
|
43
|
+
autoSaveOptions: C.config.onChange ? { onChange: () => C.config.onChange(JSON.parse(JSON.stringify(T.state.content))) } : null
|
|
44
44
|
});
|
|
45
|
-
|
|
46
|
-
if (await
|
|
47
|
-
let e =
|
|
48
|
-
|
|
45
|
+
h(async () => {
|
|
46
|
+
if (await C.fontsManager.loadCustomFonts(), w(C.config.editorType) === "popup" && !T.content.value.settings.popup) {
|
|
47
|
+
let e = te();
|
|
48
|
+
T.updateSettings({
|
|
49
49
|
popup: e,
|
|
50
|
-
width:
|
|
50
|
+
width: ne[e.design.sizePreset]
|
|
51
51
|
});
|
|
52
52
|
}
|
|
53
53
|
}), r(() => {
|
|
54
|
-
|
|
54
|
+
C.fontsManager.cleanupFontLinks(), E.destroy();
|
|
55
55
|
});
|
|
56
|
-
let
|
|
57
|
-
a(
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
if (!
|
|
56
|
+
let M = d("blocks");
|
|
57
|
+
a(ae, M);
|
|
58
|
+
let z = v(() => w(C.config.editorType) === "popup"), B = v(() => z.value && M.value === "displayRules"), V = v(() => z.value && M.value === "schedule"), H = v(() => M.value === "design"), U = v(() => z.value && (B.value || V.value || H.value)), W = v(() => {
|
|
59
|
+
if (T.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
|
|
60
|
+
if (!z.value) return ["tpl:left-12", "tpl:right-[320px]"];
|
|
61
61
|
let e;
|
|
62
|
-
e =
|
|
63
|
-
let t =
|
|
62
|
+
e = M.value === "blocks" ? "tpl:left-[272px]" : H.value ? "tpl:left-[392px]" : "tpl:left-[72px]";
|
|
63
|
+
let t = U.value ? "tpl:right-0" : "tpl:right-[320px]";
|
|
64
64
|
return [e, t];
|
|
65
|
-
}),
|
|
65
|
+
}), G = v(() => B.value || V.value);
|
|
66
66
|
return o({
|
|
67
|
-
getContent: () =>
|
|
68
|
-
setContent: (e) =>
|
|
69
|
-
setTheme: (e) =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
67
|
+
getContent: () => T.content.value,
|
|
68
|
+
setContent: (e) => T.setContent(e),
|
|
69
|
+
setTheme: (e) => T.setUiTheme(e),
|
|
70
|
+
undo: () => E.history.undo(),
|
|
71
|
+
redo: () => E.history.redo(),
|
|
72
|
+
canUndo: () => E.history.canUndo.value,
|
|
73
|
+
canRedo: () => E.history.canRedo.value,
|
|
74
|
+
renderCustomBlock: E.registry.renderCustomBlock,
|
|
75
|
+
startTour: (e) => y.value?.start(e),
|
|
76
|
+
dismissTour: () => y.value?.dismiss(),
|
|
77
|
+
resetTourDismissed: () => fe(C.config.tour),
|
|
78
|
+
isTourDismissed: () => C.config.tour ? oe(C.config.tour) : !0
|
|
79
|
+
}), (r, a) => (i(), x("div", {
|
|
80
|
+
class: e(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": b(T).state.darkMode }]),
|
|
81
|
+
"data-tpl-theme": b(E).resolvedTheme.value,
|
|
82
|
+
style: g(b(E).themeStyles.value)
|
|
79
83
|
}, [
|
|
80
|
-
m("header",
|
|
84
|
+
m("header", P, [
|
|
81
85
|
a[5] ||= m("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
|
|
82
|
-
m("div",
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
m("div", F, [
|
|
87
|
+
S(ce),
|
|
88
|
+
S(j, {
|
|
89
|
+
viewport: b(T).state.viewport,
|
|
90
|
+
onChange: b(T).setViewport
|
|
86
91
|
}, null, 8, ["viewport", "onChange"]),
|
|
87
|
-
|
|
88
|
-
"dark-mode":
|
|
89
|
-
onChange:
|
|
92
|
+
S(se, {
|
|
93
|
+
"dark-mode": b(T).state.darkMode,
|
|
94
|
+
onChange: b(T).setDarkMode
|
|
90
95
|
}, null, 8, ["dark-mode", "onChange"]),
|
|
91
|
-
|
|
92
|
-
"preview-mode":
|
|
93
|
-
onChange:
|
|
96
|
+
S(pe, {
|
|
97
|
+
"preview-mode": b(T).state.previewMode,
|
|
98
|
+
onChange: b(T).setPreviewMode
|
|
94
99
|
}, null, 8, ["preview-mode", "onChange"])
|
|
95
100
|
]),
|
|
96
101
|
a[6] ||= m("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
|
|
97
102
|
]),
|
|
98
|
-
c(
|
|
103
|
+
c(S(D, null, null, 512), [[_, !b(T).state.previewMode]]),
|
|
99
104
|
m("div", {
|
|
100
|
-
class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...
|
|
101
|
-
style:
|
|
105
|
+
class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...W.value, "tpl:top-14"]]),
|
|
106
|
+
style: g({
|
|
102
107
|
transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
103
|
-
backgroundColor:
|
|
108
|
+
backgroundColor: G.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
|
|
104
109
|
})
|
|
105
|
-
}, [
|
|
110
|
+
}, [z.value && M.value === "displayRules" ? (i(), p(he, { key: 0 })) : z.value && M.value === "schedule" ? (i(), p(A, {
|
|
106
111
|
key: 1,
|
|
107
112
|
layout: "standalone"
|
|
108
|
-
})) : (i(),
|
|
109
|
-
default: s(() => [
|
|
113
|
+
})) : (i(), x(f, { key: 2 }, [m("div", I, [S(ee, { name: "tpl-restore-btn" }, {
|
|
114
|
+
default: s(() => [b(E).conditionPreview.hasHiddenBlocks.value ? (i(), x("button", {
|
|
110
115
|
key: 0,
|
|
111
116
|
class: "tpl:absolute tpl:left-1/2 tpl:top-2 tpl:-translate-x-1/2 tpl:inline-flex tpl:items-center tpl:gap-1.5 tpl:rounded-full tpl:border tpl:px-3.5 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:whitespace-nowrap tpl:shadow-md tpl:hover:opacity-80 tpl:bg-[var(--tpl-warning-light)] tpl:text-[var(--tpl-warning)] tpl:border-[var(--tpl-warning)]",
|
|
112
117
|
style: { "backdrop-filter": "blur(8px)" },
|
|
113
|
-
onClick: a[0] ||= (e) =>
|
|
114
|
-
}, [
|
|
118
|
+
onClick: a[0] ||= (e) => b(E).conditionPreview.reset()
|
|
119
|
+
}, [S(b(ue), {
|
|
115
120
|
size: 13,
|
|
116
121
|
"stroke-width": 2
|
|
117
|
-
}), u(" " + n(
|
|
122
|
+
}), u(" " + n(b(E).t.blockSettings.restoreHiddenBlocks), 1)])) : l("", !0)]),
|
|
118
123
|
_: 1
|
|
119
|
-
})]), m("div",
|
|
120
|
-
viewport:
|
|
121
|
-
content:
|
|
122
|
-
"selected-block-id":
|
|
123
|
-
"dark-mode":
|
|
124
|
-
"preview-mode":
|
|
124
|
+
})]), m("div", L, [S(me, {
|
|
125
|
+
viewport: b(T).state.viewport,
|
|
126
|
+
content: b(T).content.value,
|
|
127
|
+
"selected-block-id": b(T).state.selectedBlockId,
|
|
128
|
+
"dark-mode": b(T).state.darkMode,
|
|
129
|
+
"preview-mode": b(T).state.previewMode,
|
|
125
130
|
"multi-page-canvas": t.config.multiPageCanvas ?? !1,
|
|
126
|
-
onSelectBlock:
|
|
131
|
+
onSelectBlock: b(T).selectBlock
|
|
127
132
|
}, null, 8, [
|
|
128
133
|
"viewport",
|
|
129
134
|
"content",
|
|
@@ -133,62 +138,62 @@ var M = ["data-tpl-theme"], N = {
|
|
|
133
138
|
"multi-page-canvas",
|
|
134
139
|
"onSelectBlock"
|
|
135
140
|
])])], 64))], 6),
|
|
136
|
-
t.config.branding === !1 ? l("", !0) : (i(), p(
|
|
141
|
+
t.config.branding === !1 ? l("", !0) : (i(), p(k, {
|
|
137
142
|
key: 0,
|
|
138
|
-
"position-class":
|
|
143
|
+
"position-class": W.value
|
|
139
144
|
}, null, 8, ["position-class"])),
|
|
140
145
|
m("div", {
|
|
141
146
|
class: "tpl-sr-only",
|
|
142
147
|
role: "status",
|
|
143
148
|
"aria-live": "polite",
|
|
144
149
|
"aria-atomic": "true",
|
|
145
|
-
"aria-label":
|
|
146
|
-
}, n(
|
|
147
|
-
c(
|
|
148
|
-
"selected-block":
|
|
149
|
-
settings:
|
|
150
|
-
onUpdateBlock: a[1] ||= (e) =>
|
|
150
|
+
"aria-label": b(E).t.landmarks.reorderAnnouncements
|
|
151
|
+
}, n(b(E).keyboardReorder.announcement.value), 9, R),
|
|
152
|
+
c(S(le, {
|
|
153
|
+
"selected-block": b(T).selectedBlock.value,
|
|
154
|
+
settings: b(T).content.value.settings,
|
|
155
|
+
onUpdateBlock: a[1] ||= (e) => b(T).updateBlock(b(T).state.selectedBlockId, e),
|
|
151
156
|
onDeleteBlock: a[2] ||= () => {
|
|
152
|
-
|
|
157
|
+
b(T).state.selectedBlockId && b(E).blockActions.deleteBlock(b(T).state.selectedBlockId);
|
|
153
158
|
},
|
|
154
159
|
onDuplicateBlock: a[3] ||= () => {
|
|
155
|
-
|
|
160
|
+
b(T).selectedBlock.value && b(E).blockActions.duplicateBlock(b(T).selectedBlock.value);
|
|
156
161
|
},
|
|
157
|
-
onUpdateSettings: a[4] ||= (e) =>
|
|
158
|
-
}, null, 8, ["selected-block", "settings"]), [[
|
|
159
|
-
t.config.tour ? (i(), p(
|
|
162
|
+
onUpdateSettings: a[4] ||= (e) => b(T).updateSettings(e)
|
|
163
|
+
}, null, 8, ["selected-block", "settings"]), [[_, !b(T).state.previewMode && !U.value]]),
|
|
164
|
+
t.config.tour ? (i(), p(O, {
|
|
160
165
|
key: 1,
|
|
161
166
|
ref_key: "editorTourRef",
|
|
162
|
-
ref:
|
|
167
|
+
ref: y,
|
|
163
168
|
"tour-config": t.config.tour,
|
|
164
|
-
"dark-mode":
|
|
169
|
+
"dark-mode": b(T).state.darkMode
|
|
165
170
|
}, null, 8, ["tour-config", "dark-mode"])) : l("", !0)
|
|
166
|
-
], 14,
|
|
171
|
+
], 14, N));
|
|
167
172
|
}
|
|
168
|
-
}), [["__scopeId", "data-v-
|
|
169
|
-
"./locales/de.ts": () => import("./de-
|
|
170
|
-
"./locales/en.ts": () => import("./en-
|
|
171
|
-
}),
|
|
172
|
-
"./locales/cloud/de.ts": () => import("./de-
|
|
173
|
-
"./locales/cloud/en.ts": () => import("./en-
|
|
173
|
+
}), [["__scopeId", "data-v-040fed1e"]]), B = /* @__PURE__ */ Object.assign({
|
|
174
|
+
"./locales/de.ts": () => import("./de-2LEvILeZ.js"),
|
|
175
|
+
"./locales/en.ts": () => import("./en-D2RU2Poj.js")
|
|
176
|
+
}), V = /* @__PURE__ */ Object.assign({
|
|
177
|
+
"./locales/cloud/de.ts": () => import("./de-D2npYjrZ.js"),
|
|
178
|
+
"./locales/cloud/en.ts": () => import("./en-ib-4h3_o.js")
|
|
174
179
|
});
|
|
175
|
-
function
|
|
180
|
+
function H(e) {
|
|
176
181
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
177
182
|
}
|
|
178
|
-
var
|
|
179
|
-
function
|
|
183
|
+
var U = H(B), W = H(V);
|
|
184
|
+
function G(e) {
|
|
180
185
|
return e.split("-")[0].toLowerCase();
|
|
181
186
|
}
|
|
182
|
-
function
|
|
183
|
-
let n =
|
|
187
|
+
function K(e, t) {
|
|
188
|
+
let n = G(e);
|
|
184
189
|
return t.includes(n) ? n : "en";
|
|
185
190
|
}
|
|
186
|
-
async function
|
|
187
|
-
let t =
|
|
191
|
+
async function q(e) {
|
|
192
|
+
let t = B[`./locales/${K(e, U)}.ts`];
|
|
188
193
|
return (await t()).default;
|
|
189
194
|
}
|
|
190
195
|
async function ge(e) {
|
|
191
|
-
let t =
|
|
196
|
+
let t = V[`./locales/cloud/${K(e, W)}.ts`];
|
|
192
197
|
return (await t()).default;
|
|
193
198
|
}
|
|
194
199
|
//#endregion
|
|
@@ -204,59 +209,71 @@ async function _e(e) {
|
|
|
204
209
|
}
|
|
205
210
|
//#endregion
|
|
206
211
|
//#region src/index.ts
|
|
207
|
-
var
|
|
208
|
-
async function
|
|
212
|
+
var J = null, Y = d(null);
|
|
213
|
+
async function ve(e) {
|
|
209
214
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
210
215
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
211
|
-
let n = await
|
|
212
|
-
|
|
213
|
-
return () => o(
|
|
216
|
+
let n = await q(e.locale ?? "en"), r = T(e.fonts);
|
|
217
|
+
J && Q(), J = y({ setup() {
|
|
218
|
+
return () => o(z, {
|
|
214
219
|
config: e,
|
|
215
220
|
translations: n,
|
|
216
221
|
fontsManager: r,
|
|
217
|
-
ref:
|
|
222
|
+
ref: Y
|
|
218
223
|
});
|
|
219
|
-
} }),
|
|
224
|
+
} }), J.mount(t);
|
|
220
225
|
let i = {
|
|
221
226
|
getContent() {
|
|
222
|
-
return
|
|
227
|
+
return Y.value ? JSON.parse(JSON.stringify(Y.value.getContent())) : JSON.parse(JSON.stringify(e.content));
|
|
223
228
|
},
|
|
224
229
|
setContent(t) {
|
|
225
|
-
|
|
230
|
+
Y.value && Y.value.setContent(t), e.content = t;
|
|
226
231
|
},
|
|
227
232
|
setTheme(e) {
|
|
228
|
-
|
|
233
|
+
Y.value && Y.value.setTheme(e);
|
|
229
234
|
},
|
|
230
235
|
unmount: Q,
|
|
231
236
|
startTour(e) {
|
|
232
|
-
|
|
237
|
+
Y.value?.startTour?.(e);
|
|
233
238
|
},
|
|
234
239
|
dismissTour() {
|
|
235
|
-
|
|
240
|
+
Y.value?.dismissTour?.();
|
|
236
241
|
},
|
|
237
242
|
resetTourDismissed() {
|
|
238
|
-
|
|
243
|
+
Y.value?.resetTourDismissed?.();
|
|
239
244
|
},
|
|
240
245
|
isTourDismissed() {
|
|
241
|
-
return
|
|
246
|
+
return Y.value?.isTourDismissed?.() ?? !0;
|
|
247
|
+
},
|
|
248
|
+
undo() {
|
|
249
|
+
Y.value?.undo?.();
|
|
250
|
+
},
|
|
251
|
+
redo() {
|
|
252
|
+
Y.value?.redo?.();
|
|
253
|
+
},
|
|
254
|
+
canUndo() {
|
|
255
|
+
return Y.value?.canUndo?.() ?? !1;
|
|
256
|
+
},
|
|
257
|
+
canRedo() {
|
|
258
|
+
return Y.value?.canRedo?.() ?? !1;
|
|
242
259
|
},
|
|
243
260
|
renderCustomBlock(e) {
|
|
244
|
-
return
|
|
261
|
+
return Y.value ? Y.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
|
|
245
262
|
},
|
|
246
263
|
toMjml: () => _e(i)
|
|
247
264
|
};
|
|
248
265
|
return i;
|
|
249
266
|
}
|
|
250
267
|
var X = null, Z = d(null);
|
|
251
|
-
async function
|
|
268
|
+
async function ye(e) {
|
|
252
269
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
253
270
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
254
|
-
let { default: n } = await import("./CloudEditor-
|
|
271
|
+
let { default: n } = await import("./CloudEditor-zo9PjjvY.js"), [r, i] = await Promise.all([q(e.locale ?? "en"), ge(e.locale ?? "en")]), a = T(e.fonts);
|
|
255
272
|
return X && $(), await new Promise((s, c) => {
|
|
256
273
|
let l = setTimeout(() => {
|
|
257
274
|
c(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
|
|
258
|
-
},
|
|
259
|
-
X =
|
|
275
|
+
}, C);
|
|
276
|
+
X = y({ setup() {
|
|
260
277
|
return () => o(n, {
|
|
261
278
|
config: e,
|
|
262
279
|
translations: r,
|
|
@@ -291,6 +308,18 @@ async function ve(e) {
|
|
|
291
308
|
isTourDismissed() {
|
|
292
309
|
return Z.value?.isTourDismissed?.() ?? !0;
|
|
293
310
|
},
|
|
311
|
+
undo() {
|
|
312
|
+
Z.value?.undo?.();
|
|
313
|
+
},
|
|
314
|
+
redo() {
|
|
315
|
+
Z.value?.redo?.();
|
|
316
|
+
},
|
|
317
|
+
canUndo() {
|
|
318
|
+
return Z.value?.canUndo?.() ?? !1;
|
|
319
|
+
},
|
|
320
|
+
canRedo() {
|
|
321
|
+
return Z.value?.canRedo?.() ?? !1;
|
|
322
|
+
},
|
|
294
323
|
create(e) {
|
|
295
324
|
return Z.value ? Z.value.create(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Cloud editor not ready"));
|
|
296
325
|
},
|
|
@@ -303,10 +332,10 @@ async function ve(e) {
|
|
|
303
332
|
};
|
|
304
333
|
}
|
|
305
334
|
function Q() {
|
|
306
|
-
|
|
335
|
+
J && (J.unmount(), J = null, Y.value = null);
|
|
307
336
|
}
|
|
308
337
|
function $() {
|
|
309
338
|
X && (X.unmount(), X = null, Z.value = null);
|
|
310
339
|
}
|
|
311
340
|
//#endregion
|
|
312
|
-
export {
|
|
341
|
+
export { E as DEFAULT_EDITOR_TOUR_STORAGE_KEY, ve as init, ye as initCloud, Q as unmount, T as useFonts };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as e } from "./createLucideIcon-ClREiSx3.js";
|
|
2
|
+
var t = e("redo-2", [["path", {
|
|
3
|
+
d: "m15 14 5-5-5-5",
|
|
4
|
+
key: "12vg1m"
|
|
5
|
+
}], ["path", {
|
|
6
|
+
d: "M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
|
|
7
|
+
key: "6uklza"
|
|
8
|
+
}]]), n = e("undo-2", [["path", {
|
|
9
|
+
d: "M9 14 4 9l5-5",
|
|
10
|
+
key: "102s5s"
|
|
11
|
+
}], ["path", {
|
|
12
|
+
d: "M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
|
|
13
|
+
key: "f3b9sd"
|
|
14
|
+
}]]);
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t as n, n as t };
|