@templatical/editor 0.0.1 → 0.0.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/dist/AiChatSidebar-XBj5Rw2l.js +214 -0
- package/dist/AiFeatureMenu-my1mZ9DL.js +63 -0
- package/dist/CloudEditor-BVjgKwq3.js +940 -0
- package/dist/CollaboratorBar-BZq_Gv38.js +91 -0
- package/dist/CommentsSidebar-D9oxqO6l.js +439 -0
- package/dist/DesignReferenceSidebar-CyHq4SWt.js +272 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-Cus2Hdwl.js +205 -0
- package/dist/ModulePreviewCanvas-DaByXKY_.js +106 -0
- package/dist/ParagraphEditor-BSyk5B6S.js +670 -0
- package/dist/RichTextEditorContent-BRpjJ6SV.js +133 -0
- package/dist/SaveModuleDialog-BIZBQrd8.js +122 -0
- package/dist/SnapshotHistory-Ds1-QNbx.js +126 -0
- package/dist/TemplateScoringPanel-C8XSk_Ys.js +249 -0
- package/dist/TestEmailModal-CCVfaFgV.js +94 -0
- package/dist/TitleEditor-V4qaEULF.js +167 -0
- package/dist/TplModal-LT3FXlgs.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BujoY5Dl.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js +3 -0
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js.map +1 -0
- package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
- package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
- package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
- package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
- package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
- package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
- package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
- package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
- package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
- package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
- package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
- package/dist/cdn/chunks/extensions-BfjbWqOx.js +2 -0
- package/dist/cdn/chunks/extensions-BfjbWqOx.js.map +1 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js +2 -0
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js.map +1 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js +2 -0
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js +2 -0
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js.map +1 -0
- package/dist/cdn/editor.css +1 -0
- package/dist/cdn/editor.js +2 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-B7kDuZmP.js +7 -0
- package/dist/chevron-down-DJLW2Q9Z.js +7 -0
- package/dist/circle-alert-E2vYPs5r.js +25 -0
- package/dist/clock-lWIIQA3C.js +12 -0
- package/dist/de-B4Ob4vCo.js +682 -0
- package/dist/dist-4LiM9FDd.js +35 -0
- package/dist/dist-Bu7veieH.js +776 -0
- package/dist/dist-C1BIRHCQ.js +61 -0
- package/dist/dist-CG-vEqSU.js +314 -0
- package/dist/dist-C_ymrGFi.js +10625 -0
- package/dist/dist-ChAGLpWo.js +35 -0
- package/dist/dist-DNjZKe2Z.js +513 -0
- package/dist/dist-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DrvKRSU6.js +47 -0
- package/dist/dist-Dxnd0GRf.js +5 -0
- package/dist/dist-DysAFIPy.js +2054 -0
- package/dist/emojiData-BfWQS72m.js +17 -0
- package/dist/en-YXsspZJG.js +682 -0
- package/dist/extensions-BA4NshZQ.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-ikyi28RU.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-8B5MFafK.js +4 -0
- package/dist/liquid.browser-BemTg3sZ.js +3272 -0
- package/dist/loader-circle-BTQQxC3l.js +7 -0
- package/dist/message-circle-Blgm6V_h.js +7 -0
- package/dist/refresh-cw-Bb4PEeW1.js +44 -0
- package/dist/scan-line-7lZPfOdm.js +25 -0
- package/dist/send-C0ltAQrv.js +10 -0
- package/dist/shield-check-f-qv4RKs.js +10 -0
- package/dist/sparkles-KhBCGlqB.js +23 -0
- package/dist/styleConstants-CgtFM9hQ.js +43 -0
- package/dist/styles-hQgJKM4i.js +3406 -0
- package/dist/templatical-editor.css +2 -1
- package/dist/templatical-editor.js +242 -9
- package/dist/templatical-editor.umd.cjs +112 -524
- package/dist/timeouts-CmBrLeZA.js +4 -0
- package/dist/trash-2-OwjZ-guZ.js +25 -0
- package/dist/triangle-alert-DOSRIUYZ.js +17 -0
- package/dist/useEditorCore-DVp5qmtC.js +5552 -0
- package/dist/useI18n-DzH4KXDk.js +17 -0
- package/dist/useMergeTag-D9zQVE-e.js +33 -0
- package/dist/x-CGlq2XQe.js +10 -0
- package/package.json +30 -20
- package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
- package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
- package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
- package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
- package/dist/CommentsSidebar-PVUlloyB.js +0 -655
- package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
- package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
- package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
- package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
- package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
- package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
- package/dist/TestEmailModal-Cwre5elw.js +0 -128
- package/dist/TextEditor-BuUOIByX.js +0 -780
- package/dist/de-BWIAblxs.js +0 -685
- package/dist/en-cYyUzNV1.js +0 -685
- package/dist/index-0tWUczNu.js +0 -47
- package/dist/index-4okvXjqk.js +0 -41
- package/dist/index-BSc6h5zo.js +0 -967
- package/dist/index-CrvwWlhN.js +0 -41
- package/dist/index-D-iD-7lO.js +0 -10961
- package/dist/index-D-ygXbc8.js +0 -2452
- package/dist/index-DbrWKz-e.js +0 -1415
- package/dist/index-DeUeHy6g.js +0 -422
- package/dist/index-Ude6e9RU.js +0 -41
- package/dist/index-ZQzHBwkr.js +0 -12767
- package/dist/liquid.browser-CeNxS2GL.js +0 -3493
- package/dist/loader-circle-tM9j2mRh.js +0 -13
- package/dist/shield-check-Ngi9jAQc.js +0 -20
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { defineComponent as x, inject as y, computed as b, resolveComponent as D, openBlock as n, createElementBlock as c, createElementVNode as F, Fragment as g, renderList as f, normalizeStyle as k, createBlock as v, resolveDynamicComponent as h } from "vue";
|
|
2
|
-
import { r as w, k as C, j as B, T as S, i as P, h as R, f as W, e as j, g as E, d as T, b as z } from "./index-D-iD-7lO.js";
|
|
3
|
-
const L = { class: "tpl:w-full" }, M = { class: "tpl:flex tpl:gap-0" }, N = /* @__PURE__ */ x({
|
|
4
|
-
name: "PreviewSectionBlock",
|
|
5
|
-
__name: "PreviewSectionBlock",
|
|
6
|
-
props: {
|
|
7
|
-
block: {},
|
|
8
|
-
viewport: {}
|
|
9
|
-
},
|
|
10
|
-
setup(m) {
|
|
11
|
-
const u = m, i = y("blockRegistry"), p = b(() => {
|
|
12
|
-
switch (u.block.columns) {
|
|
13
|
-
case "2":
|
|
14
|
-
return ["50%", "50%"];
|
|
15
|
-
case "3":
|
|
16
|
-
return ["33.33%", "33.33%", "33.33%"];
|
|
17
|
-
case "1-2":
|
|
18
|
-
return ["33.33%", "66.67%"];
|
|
19
|
-
case "2-1":
|
|
20
|
-
return ["66.67%", "33.33%"];
|
|
21
|
-
default:
|
|
22
|
-
return ["100%"];
|
|
23
|
-
}
|
|
24
|
-
}), s = b(() => {
|
|
25
|
-
const o = p.value.length, e = [...u.block.children];
|
|
26
|
-
for (; e.length < o; )
|
|
27
|
-
e.push([]);
|
|
28
|
-
return e.slice(0, o);
|
|
29
|
-
});
|
|
30
|
-
function r(o) {
|
|
31
|
-
return s.value[o] || [];
|
|
32
|
-
}
|
|
33
|
-
function t(o) {
|
|
34
|
-
if (i) {
|
|
35
|
-
const e = i.getComponent(o);
|
|
36
|
-
if (e)
|
|
37
|
-
return e;
|
|
38
|
-
}
|
|
39
|
-
switch (o.type) {
|
|
40
|
-
case "text":
|
|
41
|
-
return z;
|
|
42
|
-
case "image":
|
|
43
|
-
return T;
|
|
44
|
-
case "video":
|
|
45
|
-
return E;
|
|
46
|
-
case "button":
|
|
47
|
-
return j;
|
|
48
|
-
case "divider":
|
|
49
|
-
return W;
|
|
50
|
-
case "social":
|
|
51
|
-
return R;
|
|
52
|
-
case "menu":
|
|
53
|
-
return P;
|
|
54
|
-
case "table":
|
|
55
|
-
return S;
|
|
56
|
-
case "spacer":
|
|
57
|
-
return B;
|
|
58
|
-
case "html":
|
|
59
|
-
return C;
|
|
60
|
-
case "custom":
|
|
61
|
-
return w;
|
|
62
|
-
default:
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
function d(o) {
|
|
67
|
-
const { padding: e, margin: a, backgroundColor: $ } = o.styles;
|
|
68
|
-
return {
|
|
69
|
-
padding: `${e.top}px ${e.right}px ${e.bottom}px ${e.left}px`,
|
|
70
|
-
margin: `${a.top}px ${a.right}px ${a.bottom}px ${a.left}px`,
|
|
71
|
-
backgroundColor: $ || "transparent"
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
return (o, e) => {
|
|
75
|
-
const a = D("PreviewSectionBlock", !0);
|
|
76
|
-
return n(), c("div", L, [
|
|
77
|
-
F("div", M, [
|
|
78
|
-
(n(!0), c(g, null, f(s.value, ($, _) => (n(), c("div", {
|
|
79
|
-
key: _,
|
|
80
|
-
style: k({ width: p.value[_] })
|
|
81
|
-
}, [
|
|
82
|
-
(n(!0), c(g, null, f(r(_), (l) => (n(), c("div", {
|
|
83
|
-
key: l.id,
|
|
84
|
-
style: k(d(l))
|
|
85
|
-
}, [
|
|
86
|
-
l.type === "section" ? (n(), v(a, {
|
|
87
|
-
key: 0,
|
|
88
|
-
block: l,
|
|
89
|
-
viewport: "desktop"
|
|
90
|
-
}, null, 8, ["block"])) : (n(), v(h(t(l)), {
|
|
91
|
-
key: 1,
|
|
92
|
-
block: l,
|
|
93
|
-
viewport: "desktop"
|
|
94
|
-
}, null, 8, ["block"]))
|
|
95
|
-
], 4))), 128))
|
|
96
|
-
], 4))), 128))
|
|
97
|
-
])
|
|
98
|
-
]);
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}), V = {
|
|
102
|
-
class: "tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg tpl:bg-white",
|
|
103
|
-
style: { "box-shadow": "var(--tpl-shadow-sm)" }
|
|
104
|
-
}, G = /* @__PURE__ */ x({
|
|
105
|
-
__name: "ModulePreviewCanvas",
|
|
106
|
-
props: {
|
|
107
|
-
blocks: {}
|
|
108
|
-
},
|
|
109
|
-
setup(m) {
|
|
110
|
-
const u = y("blockRegistry");
|
|
111
|
-
function i(s) {
|
|
112
|
-
if (u) {
|
|
113
|
-
const r = u.getComponent(s);
|
|
114
|
-
if (r)
|
|
115
|
-
return r;
|
|
116
|
-
}
|
|
117
|
-
switch (s.type) {
|
|
118
|
-
case "section":
|
|
119
|
-
return N;
|
|
120
|
-
case "text":
|
|
121
|
-
return z;
|
|
122
|
-
case "image":
|
|
123
|
-
return T;
|
|
124
|
-
case "video":
|
|
125
|
-
return E;
|
|
126
|
-
case "button":
|
|
127
|
-
return j;
|
|
128
|
-
case "divider":
|
|
129
|
-
return W;
|
|
130
|
-
case "social":
|
|
131
|
-
return R;
|
|
132
|
-
case "menu":
|
|
133
|
-
return P;
|
|
134
|
-
case "table":
|
|
135
|
-
return S;
|
|
136
|
-
case "spacer":
|
|
137
|
-
return B;
|
|
138
|
-
case "html":
|
|
139
|
-
return C;
|
|
140
|
-
case "custom":
|
|
141
|
-
return w;
|
|
142
|
-
default:
|
|
143
|
-
return null;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
function p(s) {
|
|
147
|
-
const { padding: r, margin: t, backgroundColor: d } = s.styles;
|
|
148
|
-
return {
|
|
149
|
-
padding: `${r.top}px ${r.right}px ${r.bottom}px ${r.left}px`,
|
|
150
|
-
margin: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
151
|
-
backgroundColor: d || "transparent"
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
return (s, r) => (n(), c("div", V, [
|
|
155
|
-
(n(!0), c(g, null, f(m.blocks, (t) => (n(), c("div", {
|
|
156
|
-
key: t.id,
|
|
157
|
-
style: k(p(t))
|
|
158
|
-
}, [
|
|
159
|
-
(n(), v(h(i(t)), {
|
|
160
|
-
block: t,
|
|
161
|
-
viewport: "desktop"
|
|
162
|
-
}, null, 8, ["block"]))
|
|
163
|
-
], 4))), 128))
|
|
164
|
-
]));
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
export {
|
|
168
|
-
G as default
|
|
169
|
-
};
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
import { defineComponent as E, inject as g, ref as v, computed as w, watch as K, openBlock as d, createBlock as T, Teleport as j, createVNode as S, Transition as I, withCtx as $, createElementBlock as c, withModifiers as A, createElementVNode as e, toDisplayString as r, unref as p, withDirectives as F, vModelText as H, Fragment as P, renderList as U, normalizeStyle as q, createTextVNode as B, createCommentVNode as C, normalizeClass as G } from "vue";
|
|
2
|
-
import { u as J } from "./index-D-iD-7lO.js";
|
|
3
|
-
import "@templatical/types";
|
|
4
|
-
import { L as O } from "./loader-circle-tM9j2mRh.js";
|
|
5
|
-
const Q = {
|
|
6
|
-
class: "tpl-scale-in tpl:mx-4 tpl:w-full tpl:max-w-sm tpl:rounded-[var(--tpl-radius-lg)] tpl:p-5",
|
|
7
|
-
style: { "background-color": "var(--tpl-bg-elevated)", "box-shadow": "var(--tpl-shadow-xl)" }
|
|
8
|
-
}, R = {
|
|
9
|
-
class: "tpl:mb-4 tpl:text-sm tpl:font-semibold",
|
|
10
|
-
style: { color: "var(--tpl-text)" }
|
|
11
|
-
}, W = { class: "tpl:mb-3" }, X = {
|
|
12
|
-
class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium",
|
|
13
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
14
|
-
}, Y = ["placeholder", "disabled"], Z = { class: "tpl:mb-3" }, tt = {
|
|
15
|
-
class: "tpl:mb-1.5 tpl:block tpl:text-sm tpl:font-medium",
|
|
16
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
17
|
-
}, et = {
|
|
18
|
-
class: "tpl:max-h-40 tpl:space-y-1 tpl:overflow-y-auto tpl:rounded-md tpl:border tpl:p-2",
|
|
19
|
-
style: { "border-color": "var(--tpl-border)" }
|
|
20
|
-
}, lt = ["checked", "disabled", "onChange"], ot = {
|
|
21
|
-
key: 0,
|
|
22
|
-
class: "tpl:mb-3 tpl:text-xs",
|
|
23
|
-
style: { color: "var(--tpl-danger)" }
|
|
24
|
-
}, st = { class: "tpl:flex tpl:justify-end tpl:gap-2" }, at = ["disabled"], rt = ["disabled"], pt = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "tpl:flex tpl:items-center tpl:gap-1.5"
|
|
27
|
-
}, nt = { key: 1 }, mt = /* @__PURE__ */ E({
|
|
28
|
-
__name: "SaveModuleDialog",
|
|
29
|
-
props: {
|
|
30
|
-
visible: { type: Boolean },
|
|
31
|
-
preSelectedBlockId: {}
|
|
32
|
-
},
|
|
33
|
-
emits: ["close", "saved"],
|
|
34
|
-
setup(f, { emit: M }) {
|
|
35
|
-
const m = f, b = M, { t: a } = J(), N = g("editor"), z = g("savedModulesHeadless"), i = v(""), n = v(/* @__PURE__ */ new Set()), o = v(!1), u = v(null), h = w(() => N.content.value.blocks);
|
|
36
|
-
function L(t, l) {
|
|
37
|
-
const s = t.type;
|
|
38
|
-
return `${a.blocks[s] ?? t.type} ${l + 1}`;
|
|
39
|
-
}
|
|
40
|
-
K(
|
|
41
|
-
() => m.visible,
|
|
42
|
-
(t) => {
|
|
43
|
-
t && (i.value = "", u.value = null, n.value = new Set(
|
|
44
|
-
m.preSelectedBlockId ? [m.preSelectedBlockId] : []
|
|
45
|
-
));
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
function V(t) {
|
|
49
|
-
const l = new Set(n.value);
|
|
50
|
-
l.has(t) ? l.delete(t) : l.add(t), n.value = l;
|
|
51
|
-
}
|
|
52
|
-
const x = w(
|
|
53
|
-
() => i.value.trim().length > 0 && n.value.size > 0 && !o.value
|
|
54
|
-
);
|
|
55
|
-
async function _() {
|
|
56
|
-
if (x.value) {
|
|
57
|
-
o.value = !0, u.value = null;
|
|
58
|
-
try {
|
|
59
|
-
const t = h.value.filter(
|
|
60
|
-
(l) => n.value.has(l.id)
|
|
61
|
-
);
|
|
62
|
-
await z.createModule(i.value.trim(), t), b("saved"), b("close");
|
|
63
|
-
} catch (t) {
|
|
64
|
-
u.value = t.message;
|
|
65
|
-
} finally {
|
|
66
|
-
o.value = !1;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function y() {
|
|
71
|
-
o.value || b("close");
|
|
72
|
-
}
|
|
73
|
-
function D(t) {
|
|
74
|
-
t.key === "Enter" && !t.shiftKey && (t.preventDefault(), _()), t.key === "Escape" && y();
|
|
75
|
-
}
|
|
76
|
-
return (t, l) => (d(), T(j, { to: "body" }, [
|
|
77
|
-
S(I, {
|
|
78
|
-
"enter-active-class": "tpl:transition tpl:duration-150",
|
|
79
|
-
"enter-from-class": "tpl:opacity-0",
|
|
80
|
-
"enter-to-class": "tpl:opacity-100",
|
|
81
|
-
"leave-active-class": "tpl:transition tpl:duration-100",
|
|
82
|
-
"leave-from-class": "tpl:opacity-100",
|
|
83
|
-
"leave-to-class": "tpl:opacity-0"
|
|
84
|
-
}, {
|
|
85
|
-
default: $(() => [
|
|
86
|
-
f.visible ? (d(), c("div", {
|
|
87
|
-
key: 0,
|
|
88
|
-
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
89
|
-
style: { "background-color": "var(--tpl-overlay)", "backdrop-filter": "blur(8px)", "-webkit-backdrop-filter": "blur(8px)" },
|
|
90
|
-
onClick: A(y, ["self"]),
|
|
91
|
-
onKeydown: D
|
|
92
|
-
}, [
|
|
93
|
-
e("div", Q, [
|
|
94
|
-
e("h3", R, r(p(a).modules.saveAsModule), 1),
|
|
95
|
-
e("div", W, [
|
|
96
|
-
e("label", X, r(p(a).modules.moduleName), 1),
|
|
97
|
-
F(e("input", {
|
|
98
|
-
"onUpdate:modelValue": l[0] || (l[0] = (s) => i.value = s),
|
|
99
|
-
type: "text",
|
|
100
|
-
placeholder: p(a).modules.moduleNamePlaceholder,
|
|
101
|
-
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:px-3 tpl:py-1 tpl:text-sm tpl:shadow-xs tpl:outline-none",
|
|
102
|
-
style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" },
|
|
103
|
-
disabled: o.value
|
|
104
|
-
}, null, 8, Y), [
|
|
105
|
-
[H, i.value]
|
|
106
|
-
])
|
|
107
|
-
]),
|
|
108
|
-
e("div", Z, [
|
|
109
|
-
e("label", tt, r(p(a).modules.selectBlocks), 1),
|
|
110
|
-
e("div", et, [
|
|
111
|
-
(d(!0), c(P, null, U(h.value, (s, k) => (d(), c("label", {
|
|
112
|
-
key: s.id,
|
|
113
|
-
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-sm tpl:px-2 tpl:py-1.5 tpl:text-sm tpl:transition-colors tpl:duration-100",
|
|
114
|
-
style: q({
|
|
115
|
-
color: "var(--tpl-text)",
|
|
116
|
-
backgroundColor: n.value.has(s.id) ? "var(--tpl-primary-light)" : "transparent"
|
|
117
|
-
})
|
|
118
|
-
}, [
|
|
119
|
-
e("input", {
|
|
120
|
-
type: "checkbox",
|
|
121
|
-
checked: n.value.has(s.id),
|
|
122
|
-
class: "tpl:accent-[var(--tpl-primary)]",
|
|
123
|
-
disabled: o.value,
|
|
124
|
-
onChange: (dt) => V(s.id)
|
|
125
|
-
}, null, 40, lt),
|
|
126
|
-
B(" " + r(L(s, k)), 1)
|
|
127
|
-
], 4))), 128))
|
|
128
|
-
])
|
|
129
|
-
]),
|
|
130
|
-
u.value ? (d(), c("p", ot, r(u.value), 1)) : C("", !0),
|
|
131
|
-
e("div", st, [
|
|
132
|
-
e("button", {
|
|
133
|
-
type: "button",
|
|
134
|
-
class: G(["tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150", {
|
|
135
|
-
"tpl:cursor-not-allowed tpl:opacity-50": o.value
|
|
136
|
-
}]),
|
|
137
|
-
style: { "border-color": "var(--tpl-border)", color: "var(--tpl-text)", "background-color": "var(--tpl-bg)" },
|
|
138
|
-
disabled: o.value,
|
|
139
|
-
onClick: y
|
|
140
|
-
}, r(p(a).modules.cancel), 11, at),
|
|
141
|
-
e("button", {
|
|
142
|
-
type: "button",
|
|
143
|
-
class: "tpl:cursor-pointer tpl:rounded-md tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-xs tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
144
|
-
style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
|
|
145
|
-
disabled: !x.value,
|
|
146
|
-
onClick: _
|
|
147
|
-
}, [
|
|
148
|
-
o.value ? (d(), c("span", pt, [
|
|
149
|
-
S(p(O), {
|
|
150
|
-
class: "tpl:animate-spin",
|
|
151
|
-
size: 12,
|
|
152
|
-
"stroke-width": 2
|
|
153
|
-
}),
|
|
154
|
-
B(" " + r(p(a).modules.saving), 1)
|
|
155
|
-
])) : (d(), c("span", nt, r(p(a).modules.save), 1))
|
|
156
|
-
], 8, rt)
|
|
157
|
-
])
|
|
158
|
-
])
|
|
159
|
-
], 32)) : C("", !0)
|
|
160
|
-
]),
|
|
161
|
-
_: 1
|
|
162
|
-
})
|
|
163
|
-
]));
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
export {
|
|
167
|
-
mt as default
|
|
168
|
-
};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, ref as g, watch as M, computed as H, openBlock as s, createElementBlock as r, createElementVNode as i, withModifiers as y, unref as e, createVNode as d, normalizeClass as O, Transition as T, withCtx as A, toDisplayString as f, Fragment as V, renderList as E, createCommentVNode as z } from "vue";
|
|
2
|
-
import { c as L, u as F, o as G, F as q } from "./index-D-iD-7lO.js";
|
|
3
|
-
import "@templatical/types";
|
|
4
|
-
import { C as $ } from "./CloudEditor-Wdfv_9xn.js";
|
|
5
|
-
import { L as J } from "./loader-circle-tM9j2mRh.js";
|
|
6
|
-
/**
|
|
7
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the ISC license.
|
|
10
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
const K = L("ChevronLeftIcon", [
|
|
13
|
-
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]
|
|
14
|
-
]);
|
|
15
|
-
/**
|
|
16
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the ISC license.
|
|
19
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
20
|
-
*/
|
|
21
|
-
const P = L("ChevronRightIcon", [
|
|
22
|
-
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]
|
|
23
|
-
]), Q = ["disabled", "title"], U = ["title"], W = {
|
|
24
|
-
key: 0,
|
|
25
|
-
class: "tpl-scale-in tpl:absolute tpl:top-full tpl:left-1/2 tpl:z-50 tpl:mt-2 tpl:w-72 tpl:-translate-x-1/2 tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)]",
|
|
26
|
-
style: { "background-color": "var(--tpl-bg-elevated)", border: "1px solid var(--tpl-border)", "box-shadow": "var(--tpl-shadow-lg)", "backdrop-filter": "blur(8px)", "-webkit-backdrop-filter": "blur(8px)" }
|
|
27
|
-
}, X = {
|
|
28
|
-
class: "tpl:border-b tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-semibold",
|
|
29
|
-
style: { color: "var(--tpl-text)", "border-color": "var(--tpl-border)" }
|
|
30
|
-
}, Y = {
|
|
31
|
-
key: 0,
|
|
32
|
-
class: "tpl:flex tpl:items-center tpl:justify-center tpl:py-8"
|
|
33
|
-
}, Z = {
|
|
34
|
-
key: 1,
|
|
35
|
-
class: "tpl:px-3 tpl:py-6 tpl:text-center tpl:text-xs",
|
|
36
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
37
|
-
}, tt = {
|
|
38
|
-
key: 2,
|
|
39
|
-
class: "tpl:max-h-64 tpl:overflow-y-auto"
|
|
40
|
-
}, et = ["disabled", "onClick"], ot = { class: "tpl:flex tpl:flex-col tpl:gap-0.5" }, lt = {
|
|
41
|
-
class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-xs tpl:font-medium",
|
|
42
|
-
style: { color: "var(--tpl-text)" }
|
|
43
|
-
}, st = {
|
|
44
|
-
key: 0,
|
|
45
|
-
class: "tpl:rounded tpl:px-1 tpl:py-0.5 tpl:text-[10px] tpl:font-normal",
|
|
46
|
-
style: { "background-color": "var(--tpl-bg-active)", color: "var(--tpl-text-muted)" }
|
|
47
|
-
}, rt = ["disabled", "title"], ct = /* @__PURE__ */ B({
|
|
48
|
-
__name: "SnapshotHistory",
|
|
49
|
-
props: {
|
|
50
|
-
snapshots: {},
|
|
51
|
-
isLoading: { type: Boolean },
|
|
52
|
-
isRestoring: { type: Boolean }
|
|
53
|
-
},
|
|
54
|
-
emits: ["load", "navigate"],
|
|
55
|
-
setup(c, { emit: R }) {
|
|
56
|
-
const t = c, u = R, { t: o, format: b } = F(), n = g(!1), x = g(null), l = g(-1);
|
|
57
|
-
M(
|
|
58
|
-
() => t.snapshots.length,
|
|
59
|
-
() => {
|
|
60
|
-
l.value = -1;
|
|
61
|
-
}
|
|
62
|
-
);
|
|
63
|
-
const w = H(() => l.value > 0 && t.snapshots.length > 0 && !t.isRestoring), k = H(() => l.value < t.snapshots.length - 1 && t.snapshots.length > 0 && !t.isRestoring);
|
|
64
|
-
function D() {
|
|
65
|
-
w.value && (l.value--, u("navigate", t.snapshots[l.value]));
|
|
66
|
-
}
|
|
67
|
-
function I() {
|
|
68
|
-
k.value && (l.value++, u("navigate", t.snapshots[l.value]));
|
|
69
|
-
}
|
|
70
|
-
function N() {
|
|
71
|
-
n.value = !n.value, n.value && t.snapshots.length === 0 && u("load");
|
|
72
|
-
}
|
|
73
|
-
function S(h) {
|
|
74
|
-
const a = t.snapshots.findIndex((p) => p.id === h);
|
|
75
|
-
a !== -1 && (l.value = a, u("navigate", t.snapshots[a])), n.value = !1;
|
|
76
|
-
}
|
|
77
|
-
function j(h) {
|
|
78
|
-
const a = new Date(h), v = (/* @__PURE__ */ new Date()).getTime() - a.getTime(), m = Math.floor(v / 6e4), _ = Math.floor(v / 36e5), C = Math.floor(v / 864e5);
|
|
79
|
-
return m < 1 ? o.snapshotHistory.justNow : m < 60 ? b(o.snapshotHistory.minutesAgo, { minutes: m }) : _ < 24 ? b(o.snapshotHistory.hoursAgo, { hours: _ }) : C < 7 ? b(o.snapshotHistory.daysAgo, { days: C }) : a.toLocaleDateString(void 0, {
|
|
80
|
-
month: "short",
|
|
81
|
-
day: "numeric",
|
|
82
|
-
hour: "2-digit",
|
|
83
|
-
minute: "2-digit"
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
return G(x, () => {
|
|
87
|
-
n.value = !1;
|
|
88
|
-
}), (h, a) => (s(), r("div", {
|
|
89
|
-
ref_key: "dropdownRef",
|
|
90
|
-
ref: x,
|
|
91
|
-
class: "tpl:relative tpl:flex tpl:items-center tpl:gap-0.5"
|
|
92
|
-
}, [
|
|
93
|
-
i("button", {
|
|
94
|
-
class: "tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent",
|
|
95
|
-
style: { color: "var(--tpl-text-muted)" },
|
|
96
|
-
disabled: !k.value,
|
|
97
|
-
title: e(o).snapshotHistory.olderSnapshot,
|
|
98
|
-
onClick: y(I, ["stop"])
|
|
99
|
-
}, [
|
|
100
|
-
d(e(K), {
|
|
101
|
-
size: 14,
|
|
102
|
-
"stroke-width": 2
|
|
103
|
-
})
|
|
104
|
-
], 8, Q),
|
|
105
|
-
i("button", {
|
|
106
|
-
class: "tpl:flex tpl:h-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:px-1.5 tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)]",
|
|
107
|
-
style: { color: "var(--tpl-text-muted)" },
|
|
108
|
-
title: e(o).snapshotHistory.tooltip,
|
|
109
|
-
onClick: y(N, ["stop"])
|
|
110
|
-
}, [
|
|
111
|
-
d(e($), {
|
|
112
|
-
size: 16,
|
|
113
|
-
"stroke-width": 1.5
|
|
114
|
-
}),
|
|
115
|
-
d(e(q), {
|
|
116
|
-
class: O(["tpl:transition-transform tpl:duration-150", { "tpl:rotate-180": n.value }]),
|
|
117
|
-
size: 10,
|
|
118
|
-
"stroke-width": 2
|
|
119
|
-
}, null, 8, ["class"])
|
|
120
|
-
], 8, U),
|
|
121
|
-
d(T, { name: "tpl-dropdown" }, {
|
|
122
|
-
default: A(() => [
|
|
123
|
-
n.value ? (s(), r("div", W, [
|
|
124
|
-
i("div", X, f(e(o).snapshotHistory.dropdownTitle), 1),
|
|
125
|
-
c.isLoading ? (s(), r("div", Y, [
|
|
126
|
-
d(e(J), {
|
|
127
|
-
class: "tpl:animate-spin",
|
|
128
|
-
size: 20,
|
|
129
|
-
"stroke-width": 2,
|
|
130
|
-
style: { color: "var(--tpl-primary)" }
|
|
131
|
-
})
|
|
132
|
-
])) : c.snapshots.length === 0 ? (s(), r("div", Z, f(e(o).snapshotHistory.noSnapshots), 1)) : (s(), r("div", tt, [
|
|
133
|
-
(s(!0), r(V, null, E(c.snapshots, (p) => (s(), r("button", {
|
|
134
|
-
key: p.id,
|
|
135
|
-
class: "tpl:flex tpl:w-full tpl:cursor-pointer tpl:items-center tpl:border-b tpl:border-l-2 tpl:border-l-transparent tpl:px-3 tpl:py-2.5 tpl:text-left tpl:transition-all tpl:duration-150 last:tpl:border-b-0 hover:tpl:border-l-[var(--tpl-primary)] hover:tpl:bg-[var(--tpl-bg-hover)]",
|
|
136
|
-
style: { "background-color": "transparent", "border-bottom-color": "var(--tpl-border-light)" },
|
|
137
|
-
disabled: c.isRestoring,
|
|
138
|
-
onClick: (v) => S(p.id)
|
|
139
|
-
}, [
|
|
140
|
-
i("div", ot, [
|
|
141
|
-
i("div", lt, [
|
|
142
|
-
i("span", null, f(j(p.created_at)), 1),
|
|
143
|
-
p.is_autosave ? (s(), r("span", st, f(e(o).snapshotHistory.auto), 1)) : z("", !0)
|
|
144
|
-
])
|
|
145
|
-
])
|
|
146
|
-
], 8, et))), 128))
|
|
147
|
-
]))
|
|
148
|
-
])) : z("", !0)
|
|
149
|
-
]),
|
|
150
|
-
_: 1
|
|
151
|
-
}),
|
|
152
|
-
i("button", {
|
|
153
|
-
class: "tpl:flex tpl:size-7 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-[var(--tpl-radius-sm)] tpl:border-none tpl:bg-transparent tpl:transition-colors tpl:duration-150 hover:tpl:bg-[var(--tpl-bg-hover)] disabled:tpl:cursor-not-allowed disabled:tpl:opacity-30 disabled:hover:tpl:bg-transparent",
|
|
154
|
-
style: { color: "var(--tpl-text-muted)" },
|
|
155
|
-
disabled: !w.value,
|
|
156
|
-
title: e(o).snapshotHistory.newerSnapshot,
|
|
157
|
-
onClick: y(D, ["stop"])
|
|
158
|
-
}, [
|
|
159
|
-
d(e(P), {
|
|
160
|
-
size: 14,
|
|
161
|
-
"stroke-width": 2
|
|
162
|
-
})
|
|
163
|
-
], 8, rt)
|
|
164
|
-
], 512));
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
export {
|
|
168
|
-
ct as default
|
|
169
|
-
};
|