@aswin.dev/editor 0.7.1 → 0.7.3
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/{AiChatSidebar-DWGPVtvC.js → AiChatSidebar-Dt5pvG5t.js} +37 -51
- package/dist/{AiFeatureMenu-duUFSfDf.js → AiFeatureMenu-BipxcGap.js} +1 -1
- package/dist/{CloudEditor-CFldoCOb.js → CloudEditor-CnUX0IOW.js} +283 -239
- package/dist/{CollaboratorBar-Bw-lbt61.js → CollaboratorBar-NaaZTjbs.js} +2 -2
- package/dist/{CommentsSidebar-BaD5F53-.js → CommentsSidebar-DE6ZsM4D.js} +9 -10
- package/dist/CountdownBlock-Ba3T-i2X.js +1536 -0
- package/dist/{CountdownToolbar-Dg4F8MTk.js → CountdownToolbar-CbhSp_uq.js} +1 -1
- package/dist/{DesignReferenceSidebar-BSH7uNP_.js → DesignReferenceSidebar-CZg97bbj.js} +1 -1
- package/dist/{ModuleBrowserModal-6phxZSKI.js → ModuleBrowserModal-D2EVdexc.js} +4 -4
- package/dist/{ModulePreviewCanvas-BW8L3eQX.js → ModulePreviewCanvas-P3N-nxkU.js} +52 -47
- package/dist/{NumberWithSuffix-BpUzQOJt.js → NumberWithSuffix-CihczoAd.js} +1 -1
- package/dist/{ParagraphEditor-DNSzAB-I.js → ParagraphEditor-BbRuKhWv.js} +7 -7
- package/dist/{SaveModuleDialog-zMQTpez7.js → SaveModuleDialog-DLZa3m3O.js} +2 -2
- package/dist/{SnapshotHistory-Do-A5rYU.js → SnapshotHistory-Csg1_jXi.js} +3 -3
- package/dist/{TestEmailModal-DGj_9V1u.js → TestEmailModal-m3okLbJz.js} +2 -2
- package/dist/{TitleEditor-C7IDnAoS.js → TitleEditor-CtJIS5ER.js} +2 -2
- package/dist/{TplModal-BAsVzcTb.js → TplModal-CQCrKeKP.js} +1 -1
- package/dist/{blockTypeIcons-C6LDKvmd.js → blockTypeIcons-Dah0pgt-.js} +50 -19
- package/dist/bundle-stats.json +8 -8
- package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js +97 -0
- package/dist/cdn/chunks/AccessibilityPanel-Bt_fD7QT.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-Bn-0rgfr.js.map +1 -0
- package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js +33 -0
- package/dist/cdn/chunks/BlockA11yBadge-Cj18Iw0p.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-56lVcdot.js +1220 -0
- package/dist/cdn/chunks/CloudEditor-56lVcdot.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js +51 -0
- package/dist/cdn/chunks/CollaboratorBar-B7DCV3xp.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-BtaD3d3-.js.map +1 -0
- package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js +195 -0
- package/dist/cdn/chunks/ModuleBrowserModal-CiIY7ZGv.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js +113 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-M7_OGV2m.js.map +1 -0
- package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js +423 -0
- package/dist/cdn/chunks/NumberWithSuffix-DfVBnsgc.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js +544 -0
- package/dist/cdn/chunks/ParagraphEditor-1XJOpiLX.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-C2q8sbp2.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-BNxh1jPT.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js +171 -0
- package/dist/cdn/chunks/TitleEditor-IF7VzLTk.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js +24 -0
- package/dist/cdn/chunks/blockTypeIcons-tPBKQ8WC.js.map +1 -0
- package/dist/cdn/chunks/de-B05yW8Gi.js +840 -0
- package/dist/cdn/chunks/de-B05yW8Gi.js.map +1 -0
- package/dist/cdn/chunks/de-BPHtelu7.js +209 -0
- package/dist/cdn/chunks/de-BPHtelu7.js.map +1 -0
- package/dist/cdn/chunks/de-BRDqJwJe.js +89 -0
- package/dist/cdn/chunks/de-BRDqJwJe.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-DUHzsh4j.js +19 -0
- package/dist/cdn/chunks/emojiData-DUHzsh4j.js.map +1 -0
- package/dist/cdn/chunks/en-BII7695P.js +840 -0
- package/dist/cdn/chunks/en-BII7695P.js.map +1 -0
- package/dist/cdn/chunks/en-Cdj_Ikl1.js +89 -0
- package/dist/cdn/chunks/en-Cdj_Ikl1.js.map +1 -0
- package/dist/cdn/chunks/en-DejwuJhw.js +209 -0
- package/dist/cdn/chunks/en-DejwuJhw.js.map +1 -0
- package/dist/cdn/chunks/extensions-B0eT-yjf.js +598 -0
- package/dist/cdn/chunks/extensions-B0eT-yjf.js.map +1 -0
- package/dist/cdn/chunks/features-BrvE2Fzv.js +9677 -0
- package/dist/cdn/chunks/features-BrvE2Fzv.js.map +1 -0
- package/dist/cdn/chunks/icons-C7wtAD8p.js +1043 -0
- package/dist/cdn/chunks/icons-C7wtAD8p.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-CllF-us3.js +3279 -0
- package/dist/cdn/chunks/liquid.browser-CllF-us3.js.map +1 -0
- package/dist/cdn/chunks/media-library-Cl5XuaKy.js +6030 -0
- package/dist/cdn/chunks/media-library-Cl5XuaKy.js.map +1 -0
- package/dist/cdn/chunks/pusher-i7-OBujc.js +2508 -0
- package/dist/cdn/chunks/pusher-i7-OBujc.js.map +1 -0
- package/dist/cdn/chunks/quality-Va91a3N8.js +1456 -0
- package/dist/cdn/chunks/quality-Va91a3N8.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-si0Zgxeb.js +642 -0
- package/dist/cdn/chunks/renderer-si0Zgxeb.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
- package/dist/cdn/chunks/src-BLyYIbdZ.js +497 -0
- package/dist/cdn/chunks/src-BLyYIbdZ.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-DfcU8u_r.js +57 -0
- package/dist/cdn/chunks/styleConstants-DfcU8u_r.js.map +1 -0
- package/dist/cdn/chunks/styles-C6BQLT9F.js +5807 -0
- package/dist/cdn/chunks/styles-C6BQLT9F.js.map +1 -0
- package/dist/cdn/chunks/tiptap-D8whBv5F.js +14654 -0
- package/dist/cdn/chunks/tiptap-D8whBv5F.js.map +1 -0
- package/dist/cdn/editor.css +2 -0
- package/dist/cdn/editor.js +367 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/{cloud-6ZmAvF0j.js → cloud-BoS0J0vs.js} +1 -1
- package/dist/{de-DWcgp-7T.js → de-C74F9xK3.js} +112 -3
- package/dist/dist-C2grMquk.js +1261 -0
- package/dist/{dist-CivF9P8b.js → dist-Djgi0A6k.js} +92 -77
- package/dist/{en-Cxd4fhNm.js → en-B24jVTeO.js} +112 -3
- package/dist/{extensions-D__hOlV1.js → extensions-DsmjHqBF.js} +14 -14
- package/dist/index.d.ts +21 -10
- package/dist/{pencil-BZJPNYWR.js → pencil-Bpimrzzw.js} +5 -2
- package/dist/style.css +1 -1
- package/dist/styles-BMFMtR9R.js +6341 -0
- package/dist/templatical-editor.js +197 -139
- package/dist/undo-2-m1EUDbUg.js +16 -0
- package/dist/{useEditorCore-wslttMH-.js → useEditorCore-CtNAo0uy.js} +2154 -2025
- package/dist/useMergeTag-2vTcVpNo.js +34 -0
- package/package.json +12 -12
- package/dist/CountdownBlock-DaYGxKqo.js +0 -92
- package/dist/check-DJrpDKO_.js +0 -7
- package/dist/dist-C04s_fLA.js +0 -563
- package/dist/styles-B4tjX5SP.js +0 -5224
- package/dist/useMergeTag-DX0XG5V9.js +0 -34
- /package/dist/{clock-ik2pRJKG.js → clock-Ba4p3rJM.js} +0 -0
- /package/dist/{readableTextColor-DVuzNX1y.js → readableTextColor-C_9OpzBw.js} +0 -0
|
@@ -1,19 +1,25 @@
|
|
|
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
|
|
2
|
-
import { r as
|
|
3
|
-
import { f as
|
|
4
|
-
import {
|
|
5
|
-
import { w
|
|
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 ee, et as u, f as te, g as d, h as f, j as ne, jt as p, l as m, m as h, n as g, st as _, t as re, v, x as y, y as ie } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { r as b } from "./timeouts-BSGxjuUF.js";
|
|
3
|
+
import { f as ae, r as x } from "./dist-C2grMquk.js";
|
|
4
|
+
import { B as oe, C as S, R as C, t as se } from "./useEditorCore-CtNAo0uy.js";
|
|
5
|
+
import { w } from "./keys-CvX8D-8C.js";
|
|
6
|
+
import { _ as T, a as ce, c as le, d as ue, f as de, g as fe, h as E, i as pe, l as me, m as D, n as he, o as O, p as k, r as A, s as j, t as M, u as N } from "./styles-BMFMtR9R.js";
|
|
7
|
+
import { t as P } from "./_plugin-vue_export-helper-BVAJ4lgT.js";
|
|
8
8
|
//#region src/Editor.vue?vue&type=script&setup=true&lang.ts
|
|
9
|
-
var
|
|
9
|
+
var F = ["data-tpl-theme"], I = {
|
|
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
|
+
}, L = { class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-10" }, R = { class: "tpl:sticky tpl:top-0 tpl:z-40 tpl:h-0" }, ge = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "tpl:flex tpl:w-full tpl:flex-col tpl:gap-3 tpl:px-4 tpl:pt-4 tpl:pb-6"
|
|
19
|
+
}, _e = { class: "tpl-popup-browser-frame tpl:flex tpl:min-h-[calc(100vh-11rem)] tpl:w-full tpl:flex-col tpl:overflow-hidden tpl:rounded-xl tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-xl)]" }, ve = {
|
|
20
|
+
key: 1,
|
|
21
|
+
class: "tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3 tpl:p-8"
|
|
22
|
+
}, ye = ["aria-label"], z = /* @__PURE__ */ P(/* @__PURE__ */ t({
|
|
17
23
|
__name: "Editor",
|
|
18
24
|
props: {
|
|
19
25
|
config: {},
|
|
@@ -21,109 +27,118 @@ var M = ["data-tpl-theme"], N = {
|
|
|
21
27
|
fontsManager: {}
|
|
22
28
|
},
|
|
23
29
|
setup(t, { expose: o }) {
|
|
24
|
-
let
|
|
25
|
-
content:
|
|
26
|
-
templateDefaults:
|
|
27
|
-
}),
|
|
28
|
-
editor:
|
|
30
|
+
let g = u(null), b = t, S = oe({
|
|
31
|
+
content: b.config.content,
|
|
32
|
+
templateDefaults: b.config.templateDefaults
|
|
33
|
+
}), O = se({
|
|
34
|
+
editor: S,
|
|
29
35
|
config: {
|
|
30
|
-
uiTheme:
|
|
31
|
-
theme:
|
|
32
|
-
blockDefaults:
|
|
33
|
-
customBlocks:
|
|
34
|
-
mergeTags:
|
|
35
|
-
displayConditions:
|
|
36
|
-
onRequestMedia:
|
|
37
|
-
editorType:
|
|
38
|
-
accessibility:
|
|
39
|
-
onSave:
|
|
36
|
+
uiTheme: b.config.uiTheme,
|
|
37
|
+
theme: b.config.theme,
|
|
38
|
+
blockDefaults: b.config.blockDefaults,
|
|
39
|
+
customBlocks: b.config.customBlocks,
|
|
40
|
+
mergeTags: b.config.mergeTags,
|
|
41
|
+
displayConditions: b.config.displayConditions,
|
|
42
|
+
onRequestMedia: b.config.onRequestMedia,
|
|
43
|
+
editorType: b.config.editorType,
|
|
44
|
+
accessibility: fe(b.config),
|
|
45
|
+
onSave: b.config.onSave ? () => b.config.onSave(JSON.parse(JSON.stringify(S.state.content))) : void 0
|
|
40
46
|
},
|
|
41
|
-
translations:
|
|
42
|
-
fontsManager:
|
|
43
|
-
autoSaveOptions:
|
|
47
|
+
translations: b.translations,
|
|
48
|
+
fontsManager: b.fontsManager,
|
|
49
|
+
autoSaveOptions: b.config.onChange ? { onChange: () => b.config.onChange(JSON.parse(JSON.stringify(S.state.content))) } : null
|
|
44
50
|
});
|
|
45
|
-
|
|
46
|
-
if (await
|
|
47
|
-
let e =
|
|
48
|
-
|
|
51
|
+
ne(async () => {
|
|
52
|
+
if (await b.fontsManager.loadCustomFonts(), C(b.config.editorType) === "popup" && !S.content.value.settings.popup) {
|
|
53
|
+
let e = ae();
|
|
54
|
+
S.updateSettings({
|
|
49
55
|
popup: e,
|
|
50
|
-
width:
|
|
56
|
+
width: x[e.design.sizePreset]
|
|
51
57
|
});
|
|
52
58
|
}
|
|
53
59
|
}), r(() => {
|
|
54
|
-
|
|
60
|
+
b.fontsManager.cleanupFontLinks(), O.destroy();
|
|
55
61
|
});
|
|
56
|
-
let
|
|
57
|
-
a(
|
|
58
|
-
let
|
|
59
|
-
if (
|
|
60
|
-
if (!
|
|
62
|
+
let P = u("blocks");
|
|
63
|
+
a(w, P);
|
|
64
|
+
let z = h(() => C(b.config.editorType) === "popup"), B = h(() => z.value && P.value === "displayRules"), V = h(() => z.value && P.value === "schedule"), H = h(() => P.value === "design"), U = h(() => z.value && (B.value || V.value || H.value)), W = h(() => {
|
|
65
|
+
if (S.state.previewMode) return ["tpl:left-0", "tpl:right-0"];
|
|
66
|
+
if (!z.value) return ["tpl:left-12", "tpl:right-[320px]"];
|
|
61
67
|
let e;
|
|
62
|
-
e =
|
|
63
|
-
let t =
|
|
68
|
+
e = P.value === "blocks" ? "tpl:left-[272px]" : H.value ? "tpl:left-[392px]" : "tpl:left-[72px]";
|
|
69
|
+
let t = U.value ? "tpl:right-0" : "tpl:right-[320px]";
|
|
64
70
|
return [e, t];
|
|
65
|
-
}),
|
|
71
|
+
}), G = h(() => B.value || V.value);
|
|
66
72
|
return o({
|
|
67
|
-
getContent: () =>
|
|
68
|
-
setContent: (e) =>
|
|
69
|
-
setTheme: (e) =>
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
getContent: () => S.content.value,
|
|
74
|
+
setContent: (e) => S.setContent(e),
|
|
75
|
+
setTheme: (e) => S.setUiTheme(e),
|
|
76
|
+
undo: () => O.history.undo(),
|
|
77
|
+
redo: () => O.history.redo(),
|
|
78
|
+
canUndo: () => O.history.canUndo.value,
|
|
79
|
+
canRedo: () => O.history.canRedo.value,
|
|
80
|
+
renderCustomBlock: O.registry.renderCustomBlock,
|
|
81
|
+
startTour: (e) => g.value?.start(e),
|
|
82
|
+
dismissTour: () => g.value?.dismiss(),
|
|
83
|
+
resetTourDismissed: () => pe(b.config.tour),
|
|
84
|
+
isTourDismissed: () => b.config.tour ? ce(b.config.tour) : !0
|
|
85
|
+
}), (r, a) => (i(), v("div", {
|
|
86
|
+
class: e(["tpl tpl:relative tpl:h-full tpl:overflow-hidden", { "tpl:dark": _(S).state.darkMode }]),
|
|
87
|
+
"data-tpl-theme": _(O).resolvedTheme.value,
|
|
88
|
+
style: p(_(O).themeStyles.value)
|
|
79
89
|
}, [
|
|
80
|
-
|
|
81
|
-
a[5] ||=
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
90
|
+
f("header", I, [
|
|
91
|
+
a[5] ||= f("div", { class: "tpl:flex tpl:items-center tpl:gap-2.5" }, null, -1),
|
|
92
|
+
f("div", L, [
|
|
93
|
+
y(ue),
|
|
94
|
+
y(N, {
|
|
95
|
+
viewport: _(S).state.viewport,
|
|
96
|
+
onChange: _(S).setViewport
|
|
86
97
|
}, null, 8, ["viewport", "onChange"]),
|
|
87
|
-
|
|
88
|
-
"dark-mode":
|
|
89
|
-
onChange:
|
|
98
|
+
y(le, {
|
|
99
|
+
"dark-mode": _(S).state.darkMode,
|
|
100
|
+
onChange: _(S).setDarkMode
|
|
90
101
|
}, null, 8, ["dark-mode", "onChange"]),
|
|
91
|
-
|
|
92
|
-
"preview-mode":
|
|
93
|
-
onChange:
|
|
102
|
+
y(me, {
|
|
103
|
+
"preview-mode": _(S).state.previewMode,
|
|
104
|
+
onChange: _(S).setPreviewMode
|
|
94
105
|
}, null, 8, ["preview-mode", "onChange"])
|
|
95
106
|
]),
|
|
96
|
-
a[6] ||=
|
|
107
|
+
a[6] ||= f("div", { class: "tpl:flex tpl:min-w-[200px] tpl:items-center tpl:justify-end tpl:gap-3" }, null, -1)
|
|
97
108
|
]),
|
|
98
|
-
c(
|
|
99
|
-
|
|
100
|
-
class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...
|
|
101
|
-
style:
|
|
109
|
+
c(y(k, null, null, 512), [[m, !_(S).state.previewMode]]),
|
|
110
|
+
f("div", {
|
|
111
|
+
class: e(["tpl-body tpl:absolute tpl:bottom-0 tpl:overflow-auto", [...W.value, "tpl:top-14"]]),
|
|
112
|
+
style: p({
|
|
102
113
|
transition: "all 300ms cubic-bezier(0.34, 1.56, 0.64, 1)",
|
|
103
|
-
backgroundColor:
|
|
114
|
+
backgroundColor: G.value ? "var(--tpl-bg)" : "var(--tpl-canvas-bg)"
|
|
104
115
|
})
|
|
105
|
-
}, [
|
|
116
|
+
}, [z.value && P.value === "displayRules" ? (i(), d(he, { key: 0 })) : z.value && P.value === "schedule" ? (i(), d(M, {
|
|
106
117
|
key: 1,
|
|
107
118
|
layout: "standalone"
|
|
108
|
-
})) : (i(),
|
|
109
|
-
default: s(() => [
|
|
119
|
+
})) : (i(), v(te, { key: 2 }, [f("div", R, [y(re, { name: "tpl-restore-btn" }, {
|
|
120
|
+
default: s(() => [_(O).conditionPreview.hasHiddenBlocks.value ? (i(), v("button", {
|
|
110
121
|
key: 0,
|
|
111
122
|
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
123
|
style: { "backdrop-filter": "blur(8px)" },
|
|
113
|
-
onClick: a[0] ||= (e) =>
|
|
114
|
-
}, [
|
|
124
|
+
onClick: a[0] ||= (e) => _(O).conditionPreview.reset()
|
|
125
|
+
}, [y(_(T), {
|
|
115
126
|
size: 13,
|
|
116
127
|
"stroke-width": 2
|
|
117
|
-
}),
|
|
128
|
+
}), ee(" " + n(_(O).t.blockSettings.restoreHiddenBlocks), 1)])) : l("", !0)]),
|
|
118
129
|
_: 1
|
|
119
|
-
})]),
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
"
|
|
124
|
-
|
|
130
|
+
})]), z.value ? (i(), v("div", ge, [y(D, {
|
|
131
|
+
"preview-mode": _(S).state.previewMode,
|
|
132
|
+
"multi-page-canvas": t.config.multiPageCanvas ?? !1
|
|
133
|
+
}, null, 8, ["preview-mode", "multi-page-canvas"]), f("div", _e, [a[7] ||= ie("<div class=\"tpl-popup-browser-bar tpl:relative tpl:flex tpl:h-9 tpl:items-center tpl:gap-1.5 tpl:border-b tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-3\" aria-hidden=\"true\" data-v-186f5453><span class=\"tpl:block tpl:size-3 tpl:rounded-full\" style=\"background-color:#ff5f57;\" data-v-186f5453></span><span class=\"tpl:block tpl:size-3 tpl:rounded-full\" style=\"background-color:#febc2e;\" data-v-186f5453></span><span class=\"tpl:block tpl:size-3 tpl:rounded-full\" style=\"background-color:#28c840;\" data-v-186f5453></span><div class=\"tpl:pointer-events-none tpl:absolute tpl:left-1/2 tpl:top-1/2 tpl:-translate-x-1/2 tpl:-translate-y-1/2 tpl:rounded-md tpl:bg-[var(--tpl-bg)] tpl:px-3 tpl:py-0.5 tpl:text-[11px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:tracking-tight\" data-v-186f5453> yourstore.com </div></div>", 1), y(E, {
|
|
134
|
+
class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:flex-col",
|
|
135
|
+
viewport: _(S).state.viewport,
|
|
136
|
+
content: _(S).content.value,
|
|
137
|
+
"selected-block-id": _(S).state.selectedBlockId,
|
|
138
|
+
"dark-mode": _(S).state.darkMode,
|
|
139
|
+
"preview-mode": _(S).state.previewMode,
|
|
125
140
|
"multi-page-canvas": t.config.multiPageCanvas ?? !1,
|
|
126
|
-
onSelectBlock:
|
|
141
|
+
onSelectBlock: _(S).selectBlock
|
|
127
142
|
}, null, 8, [
|
|
128
143
|
"viewport",
|
|
129
144
|
"content",
|
|
@@ -132,68 +147,87 @@ var M = ["data-tpl-theme"], N = {
|
|
|
132
147
|
"preview-mode",
|
|
133
148
|
"multi-page-canvas",
|
|
134
149
|
"onSelectBlock"
|
|
135
|
-
])])]
|
|
136
|
-
|
|
150
|
+
])])])) : (i(), v("div", ve, [y(D, {
|
|
151
|
+
"preview-mode": _(S).state.previewMode,
|
|
152
|
+
"multi-page-canvas": t.config.multiPageCanvas ?? !1
|
|
153
|
+
}, null, 8, ["preview-mode", "multi-page-canvas"]), y(E, {
|
|
154
|
+
viewport: _(S).state.viewport,
|
|
155
|
+
content: _(S).content.value,
|
|
156
|
+
"selected-block-id": _(S).state.selectedBlockId,
|
|
157
|
+
"dark-mode": _(S).state.darkMode,
|
|
158
|
+
"preview-mode": _(S).state.previewMode,
|
|
159
|
+
"multi-page-canvas": t.config.multiPageCanvas ?? !1,
|
|
160
|
+
onSelectBlock: _(S).selectBlock
|
|
161
|
+
}, null, 8, [
|
|
162
|
+
"viewport",
|
|
163
|
+
"content",
|
|
164
|
+
"selected-block-id",
|
|
165
|
+
"dark-mode",
|
|
166
|
+
"preview-mode",
|
|
167
|
+
"multi-page-canvas",
|
|
168
|
+
"onSelectBlock"
|
|
169
|
+
])]))], 64))], 6),
|
|
170
|
+
t.config.branding === !1 ? l("", !0) : (i(), d(j, {
|
|
137
171
|
key: 0,
|
|
138
|
-
"position-class":
|
|
172
|
+
"position-class": W.value
|
|
139
173
|
}, null, 8, ["position-class"])),
|
|
140
|
-
|
|
174
|
+
f("div", {
|
|
141
175
|
class: "tpl-sr-only",
|
|
142
176
|
role: "status",
|
|
143
177
|
"aria-live": "polite",
|
|
144
178
|
"aria-atomic": "true",
|
|
145
|
-
"aria-label":
|
|
146
|
-
}, n(
|
|
147
|
-
c(
|
|
148
|
-
"selected-block":
|
|
149
|
-
settings:
|
|
150
|
-
onUpdateBlock: a[1] ||= (e) =>
|
|
179
|
+
"aria-label": _(O).t.landmarks.reorderAnnouncements
|
|
180
|
+
}, n(_(O).keyboardReorder.announcement.value), 9, ye),
|
|
181
|
+
c(y(de, {
|
|
182
|
+
"selected-block": _(S).selectedBlock.value,
|
|
183
|
+
settings: _(S).content.value.settings,
|
|
184
|
+
onUpdateBlock: a[1] ||= (e) => _(S).updateBlock(_(S).state.selectedBlockId, e),
|
|
151
185
|
onDeleteBlock: a[2] ||= () => {
|
|
152
|
-
|
|
186
|
+
_(S).state.selectedBlockId && _(O).blockActions.deleteBlock(_(S).state.selectedBlockId);
|
|
153
187
|
},
|
|
154
188
|
onDuplicateBlock: a[3] ||= () => {
|
|
155
|
-
|
|
189
|
+
_(S).selectedBlock.value && _(O).blockActions.duplicateBlock(_(S).selectedBlock.value);
|
|
156
190
|
},
|
|
157
|
-
onUpdateSettings: a[4] ||= (e) =>
|
|
158
|
-
}, null, 8, ["selected-block", "settings"]), [[
|
|
159
|
-
t.config.tour ? (i(),
|
|
191
|
+
onUpdateSettings: a[4] ||= (e) => _(S).updateSettings(e)
|
|
192
|
+
}, null, 8, ["selected-block", "settings"]), [[m, !_(S).state.previewMode && !U.value]]),
|
|
193
|
+
t.config.tour ? (i(), d(A, {
|
|
160
194
|
key: 1,
|
|
161
195
|
ref_key: "editorTourRef",
|
|
162
|
-
ref:
|
|
196
|
+
ref: g,
|
|
163
197
|
"tour-config": t.config.tour,
|
|
164
|
-
"dark-mode":
|
|
198
|
+
"dark-mode": _(S).state.darkMode
|
|
165
199
|
}, null, 8, ["tour-config", "dark-mode"])) : l("", !0)
|
|
166
|
-
], 14,
|
|
200
|
+
], 14, F));
|
|
167
201
|
}
|
|
168
|
-
}), [["__scopeId", "data-v-
|
|
169
|
-
"./locales/de.ts": () => import("./de-
|
|
170
|
-
"./locales/en.ts": () => import("./en-
|
|
171
|
-
}),
|
|
202
|
+
}), [["__scopeId", "data-v-186f5453"]]), B = /* @__PURE__ */ Object.assign({
|
|
203
|
+
"./locales/de.ts": () => import("./de-C74F9xK3.js"),
|
|
204
|
+
"./locales/en.ts": () => import("./en-B24jVTeO.js")
|
|
205
|
+
}), V = /* @__PURE__ */ Object.assign({
|
|
172
206
|
"./locales/cloud/de.ts": () => import("./de-GOtR9DwW.js"),
|
|
173
207
|
"./locales/cloud/en.ts": () => import("./en-dFFQVzNn.js")
|
|
174
208
|
});
|
|
175
|
-
function
|
|
209
|
+
function H(e) {
|
|
176
210
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
177
211
|
}
|
|
178
|
-
var
|
|
179
|
-
function
|
|
212
|
+
var U = H(B), W = H(V);
|
|
213
|
+
function G(e) {
|
|
180
214
|
return e.split("-")[0].toLowerCase();
|
|
181
215
|
}
|
|
182
|
-
function
|
|
183
|
-
let n =
|
|
216
|
+
function K(e, t) {
|
|
217
|
+
let n = G(e);
|
|
184
218
|
return t.includes(n) ? n : "en";
|
|
185
219
|
}
|
|
186
|
-
async function
|
|
187
|
-
let t =
|
|
220
|
+
async function q(e) {
|
|
221
|
+
let t = B[`./locales/${K(e, U)}.ts`];
|
|
188
222
|
return (await t()).default;
|
|
189
223
|
}
|
|
190
|
-
async function
|
|
191
|
-
let t =
|
|
224
|
+
async function be(e) {
|
|
225
|
+
let t = V[`./locales/cloud/${K(e, W)}.ts`];
|
|
192
226
|
return (await t()).default;
|
|
193
227
|
}
|
|
194
228
|
//#endregion
|
|
195
229
|
//#region src/utils/toMjml.ts
|
|
196
|
-
async function
|
|
230
|
+
async function xe(e) {
|
|
197
231
|
let t;
|
|
198
232
|
try {
|
|
199
233
|
t = await import("@aswin.dev/renderer");
|
|
@@ -204,59 +238,71 @@ async function _e(e) {
|
|
|
204
238
|
}
|
|
205
239
|
//#endregion
|
|
206
240
|
//#region src/index.ts
|
|
207
|
-
var
|
|
208
|
-
async function
|
|
241
|
+
var J = null, Y = u(null);
|
|
242
|
+
async function Se(e) {
|
|
209
243
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
210
244
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
211
|
-
let n = await
|
|
212
|
-
|
|
213
|
-
return () => o(
|
|
245
|
+
let n = await q(e.locale ?? "en"), r = S(e.fonts);
|
|
246
|
+
J && Q(), J = g({ setup() {
|
|
247
|
+
return () => o(z, {
|
|
214
248
|
config: e,
|
|
215
249
|
translations: n,
|
|
216
250
|
fontsManager: r,
|
|
217
|
-
ref:
|
|
251
|
+
ref: Y
|
|
218
252
|
});
|
|
219
|
-
} }),
|
|
253
|
+
} }), J.mount(t);
|
|
220
254
|
let i = {
|
|
221
255
|
getContent() {
|
|
222
|
-
return
|
|
256
|
+
return Y.value ? JSON.parse(JSON.stringify(Y.value.getContent())) : JSON.parse(JSON.stringify(e.content));
|
|
223
257
|
},
|
|
224
258
|
setContent(t) {
|
|
225
|
-
|
|
259
|
+
Y.value && Y.value.setContent(t), e.content = t;
|
|
226
260
|
},
|
|
227
261
|
setTheme(e) {
|
|
228
|
-
|
|
262
|
+
Y.value && Y.value.setTheme(e);
|
|
229
263
|
},
|
|
230
264
|
unmount: Q,
|
|
231
265
|
startTour(e) {
|
|
232
|
-
|
|
266
|
+
Y.value?.startTour?.(e);
|
|
233
267
|
},
|
|
234
268
|
dismissTour() {
|
|
235
|
-
|
|
269
|
+
Y.value?.dismissTour?.();
|
|
236
270
|
},
|
|
237
271
|
resetTourDismissed() {
|
|
238
|
-
|
|
272
|
+
Y.value?.resetTourDismissed?.();
|
|
239
273
|
},
|
|
240
274
|
isTourDismissed() {
|
|
241
|
-
return
|
|
275
|
+
return Y.value?.isTourDismissed?.() ?? !0;
|
|
276
|
+
},
|
|
277
|
+
undo() {
|
|
278
|
+
Y.value?.undo?.();
|
|
279
|
+
},
|
|
280
|
+
redo() {
|
|
281
|
+
Y.value?.redo?.();
|
|
282
|
+
},
|
|
283
|
+
canUndo() {
|
|
284
|
+
return Y.value?.canUndo?.() ?? !1;
|
|
285
|
+
},
|
|
286
|
+
canRedo() {
|
|
287
|
+
return Y.value?.canRedo?.() ?? !1;
|
|
242
288
|
},
|
|
243
289
|
renderCustomBlock(e) {
|
|
244
|
-
return
|
|
290
|
+
return Y.value ? Y.value.renderCustomBlock(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Editor not ready"));
|
|
245
291
|
},
|
|
246
|
-
toMjml: () =>
|
|
292
|
+
toMjml: () => xe(i)
|
|
247
293
|
};
|
|
248
294
|
return i;
|
|
249
295
|
}
|
|
250
|
-
var X = null, Z =
|
|
251
|
-
async function
|
|
296
|
+
var X = null, Z = u(null);
|
|
297
|
+
async function Ce(e) {
|
|
252
298
|
let t = typeof e.container == "string" ? document.querySelector(e.container) : e.container;
|
|
253
299
|
if (!t) throw Error(`[Templatical] Container element not found: ${e.container}`);
|
|
254
|
-
let { default: n } = await import("./CloudEditor-
|
|
300
|
+
let { default: n } = await import("./CloudEditor-CnUX0IOW.js"), [r, i] = await Promise.all([q(e.locale ?? "en"), be(e.locale ?? "en")]), a = S(e.fonts);
|
|
255
301
|
return X && $(), await new Promise((s, c) => {
|
|
256
302
|
let l = setTimeout(() => {
|
|
257
303
|
c(/* @__PURE__ */ Error("[Templatical] Cloud editor initialization timed out"));
|
|
258
|
-
},
|
|
259
|
-
X =
|
|
304
|
+
}, b);
|
|
305
|
+
X = g({ setup() {
|
|
260
306
|
return () => o(n, {
|
|
261
307
|
config: e,
|
|
262
308
|
translations: r,
|
|
@@ -291,6 +337,18 @@ async function ve(e) {
|
|
|
291
337
|
isTourDismissed() {
|
|
292
338
|
return Z.value?.isTourDismissed?.() ?? !0;
|
|
293
339
|
},
|
|
340
|
+
undo() {
|
|
341
|
+
Z.value?.undo?.();
|
|
342
|
+
},
|
|
343
|
+
redo() {
|
|
344
|
+
Z.value?.redo?.();
|
|
345
|
+
},
|
|
346
|
+
canUndo() {
|
|
347
|
+
return Z.value?.canUndo?.() ?? !1;
|
|
348
|
+
},
|
|
349
|
+
canRedo() {
|
|
350
|
+
return Z.value?.canRedo?.() ?? !1;
|
|
351
|
+
},
|
|
294
352
|
create(e) {
|
|
295
353
|
return Z.value ? Z.value.create(e) : Promise.reject(/* @__PURE__ */ Error("[Templatical] Cloud editor not ready"));
|
|
296
354
|
},
|
|
@@ -303,10 +361,10 @@ async function ve(e) {
|
|
|
303
361
|
};
|
|
304
362
|
}
|
|
305
363
|
function Q() {
|
|
306
|
-
|
|
364
|
+
J && (J.unmount(), J = null, Y.value = null);
|
|
307
365
|
}
|
|
308
366
|
function $() {
|
|
309
367
|
X && (X.unmount(), X = null, Z.value = null);
|
|
310
368
|
}
|
|
311
369
|
//#endregion
|
|
312
|
-
export {
|
|
370
|
+
export { O as DEFAULT_EDITOR_TOUR_STORAGE_KEY, Se as init, Ce as initCloud, Q as unmount, S 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 };
|