@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,351 +0,0 @@
|
|
|
1
|
-
import { defineComponent as P, inject as b, ref as g, computed as R, watch as A, openBlock as n, createBlock as W, Transition as Z, withCtx as X, createElementBlock as d, createElementVNode as e, createVNode as c, unref as o, toDisplayString as p, normalizeStyle as k, createTextVNode as _, withDirectives as J, normalizeClass as K, vModelText as Q, createCommentVNode as h } from "vue";
|
|
2
|
-
import { c as w, I as F, X as B, L as Y, C as tt, t as et } from "./index-D-iD-7lO.js";
|
|
3
|
-
import { useDesignReference as lt } from "@templatical/core/cloud";
|
|
4
|
-
/**
|
|
5
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the ISC license.
|
|
8
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
const at = w("FileImageIcon", [
|
|
11
|
-
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
12
|
-
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
13
|
-
["circle", { cx: "10", cy: "12", r: "2", key: "737tya" }],
|
|
14
|
-
["path", { d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22", key: "wt3hpn" }]
|
|
15
|
-
]);
|
|
16
|
-
/**
|
|
17
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the ISC license.
|
|
20
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/
|
|
22
|
-
const H = w("FileTextIcon", [
|
|
23
|
-
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
24
|
-
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
25
|
-
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
26
|
-
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
27
|
-
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
28
|
-
]);
|
|
29
|
-
/**
|
|
30
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the ISC license.
|
|
33
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/
|
|
35
|
-
const pt = w("UploadIcon", [
|
|
36
|
-
["path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4", key: "ih7n3h" }],
|
|
37
|
-
["polyline", { points: "17 8 12 3 7 8", key: "t8dd8p" }],
|
|
38
|
-
["line", { x1: "12", x2: "12", y1: "3", y2: "15", key: "widbto" }]
|
|
39
|
-
]), rt = {
|
|
40
|
-
key: 0,
|
|
41
|
-
class: "tpl-design-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-[45] tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
|
|
42
|
-
}, ot = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, st = {
|
|
43
|
-
class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium",
|
|
44
|
-
style: { color: "var(--tpl-primary)" }
|
|
45
|
-
}, nt = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, it = {
|
|
46
|
-
key: 0,
|
|
47
|
-
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
48
|
-
}, dt = { class: "tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3" }, ct = {
|
|
49
|
-
class: "tpl:text-sm",
|
|
50
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
51
|
-
}, ut = {
|
|
52
|
-
key: 1,
|
|
53
|
-
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
54
|
-
}, vt = {
|
|
55
|
-
class: "tpl:flex tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1",
|
|
56
|
-
style: { "background-color": "var(--tpl-bg-hover)" }
|
|
57
|
-
}, ft = {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
60
|
-
}, mt = {
|
|
61
|
-
class: "tpl:relative tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)]",
|
|
62
|
-
style: { border: "1px solid var(--tpl-border)", "background-color": "var(--tpl-bg)" }
|
|
63
|
-
}, gt = ["src", "alt"], xt = {
|
|
64
|
-
key: 1,
|
|
65
|
-
class: "tpl:flex tpl:h-32 tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2"
|
|
66
|
-
}, yt = {
|
|
67
|
-
class: "tpl:text-xs",
|
|
68
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
69
|
-
}, ht = {
|
|
70
|
-
class: "tpl:text-center tpl:text-xs",
|
|
71
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
72
|
-
}, bt = {
|
|
73
|
-
class: "tpl:text-center tpl:text-[11px]",
|
|
74
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
75
|
-
}, kt = ["accept"], _t = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, wt = {
|
|
76
|
-
class: "tpl:text-xs tpl:font-medium",
|
|
77
|
-
style: { color: "var(--tpl-text-muted)" }
|
|
78
|
-
}, Ct = ["placeholder"], zt = {
|
|
79
|
-
key: 0,
|
|
80
|
-
class: "tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:px-3 tpl:py-3",
|
|
81
|
-
style: { "background-color": "var(--tpl-warning-light)", border: "1px solid var(--tpl-warning)" }
|
|
82
|
-
}, jt = {
|
|
83
|
-
class: "tpl:text-xs tpl:leading-snug",
|
|
84
|
-
style: { color: "var(--tpl-text)" }
|
|
85
|
-
}, Tt = { class: "tpl:flex tpl:gap-2" }, Dt = {
|
|
86
|
-
key: 1,
|
|
87
|
-
class: "tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs",
|
|
88
|
-
style: { "background-color": "var(--tpl-danger-light)", color: "var(--tpl-danger)" }
|
|
89
|
-
}, It = ["disabled"], Lt = {
|
|
90
|
-
class: "tpl:m-0 tpl:pt-1 tpl:text-center tpl:text-[11px]",
|
|
91
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
92
|
-
}, Ut = /* @__PURE__ */ P({
|
|
93
|
-
__name: "DesignReferenceSidebar",
|
|
94
|
-
props: {
|
|
95
|
-
visible: { type: Boolean },
|
|
96
|
-
hasExistingBlocks: { type: Boolean }
|
|
97
|
-
},
|
|
98
|
-
emits: ["close", "apply"],
|
|
99
|
-
setup(C, { emit: S }) {
|
|
100
|
-
const z = C, j = S, T = b("translations"), V = b("editor"), $ = b("authManager"), v = lt({
|
|
101
|
-
authManager: $,
|
|
102
|
-
getTemplateId: () => {
|
|
103
|
-
var t;
|
|
104
|
-
return ((t = V.state.template) == null ? void 0 : t.id) ?? null;
|
|
105
|
-
},
|
|
106
|
-
onApply: (t) => j("apply", t)
|
|
107
|
-
}), r = g("image"), i = g(null), y = g(""), u = g(null), m = g(!1), x = g(!1), l = R(() => T.designReference), D = R(() => v.isGenerating.value ? !1 : i.value !== null);
|
|
108
|
-
function I(t) {
|
|
109
|
-
r.value = t, U();
|
|
110
|
-
}
|
|
111
|
-
function q(t) {
|
|
112
|
-
var f;
|
|
113
|
-
const a = t.target, s = (f = a.files) == null ? void 0 : f[0];
|
|
114
|
-
s && L(s), a.value = "";
|
|
115
|
-
}
|
|
116
|
-
function L(t) {
|
|
117
|
-
if (t.size > 10 * 1024 * 1024) {
|
|
118
|
-
v.error.value = l.value.fileTooLarge;
|
|
119
|
-
return;
|
|
120
|
-
}
|
|
121
|
-
if (r.value === "image") {
|
|
122
|
-
if (!["image/png", "image/jpeg", "image/jpg", "image/webp"].includes(t.type)) {
|
|
123
|
-
v.error.value = l.value.invalidFileType;
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
} else if (r.value === "pdf" && t.type !== "application/pdf") {
|
|
127
|
-
v.error.value = l.value.invalidFileType;
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
i.value = t, v.error.value = null, u.value && URL.revokeObjectURL(u.value), t.type.startsWith("image/") ? u.value = URL.createObjectURL(t) : u.value = null;
|
|
131
|
-
}
|
|
132
|
-
function U() {
|
|
133
|
-
u.value && (URL.revokeObjectURL(u.value), u.value = null), i.value = null;
|
|
134
|
-
}
|
|
135
|
-
function E(t) {
|
|
136
|
-
t.preventDefault(), x.value = !0;
|
|
137
|
-
}
|
|
138
|
-
function G() {
|
|
139
|
-
x.value = !1;
|
|
140
|
-
}
|
|
141
|
-
function N(t) {
|
|
142
|
-
var s, f;
|
|
143
|
-
t.preventDefault(), x.value = !1;
|
|
144
|
-
const a = (f = (s = t.dataTransfer) == null ? void 0 : s.files) == null ? void 0 : f[0];
|
|
145
|
-
a && L(a);
|
|
146
|
-
}
|
|
147
|
-
function M() {
|
|
148
|
-
if (!D.value)
|
|
149
|
-
return;
|
|
150
|
-
if (z.hasExistingBlocks && !m.value) {
|
|
151
|
-
m.value = !0;
|
|
152
|
-
return;
|
|
153
|
-
}
|
|
154
|
-
m.value = !1;
|
|
155
|
-
const t = {};
|
|
156
|
-
y.value.trim() && (t.prompt = y.value.trim()), r.value === "image" && i.value ? t.imageUpload = i.value : r.value === "pdf" && i.value && (t.pdfUpload = i.value), v.generate(t);
|
|
157
|
-
}
|
|
158
|
-
function O() {
|
|
159
|
-
m.value = !1;
|
|
160
|
-
}
|
|
161
|
-
return A(
|
|
162
|
-
() => z.visible,
|
|
163
|
-
(t) => {
|
|
164
|
-
t || (m.value = !1);
|
|
165
|
-
}
|
|
166
|
-
), (t, a) => (n(), W(Z, {
|
|
167
|
-
"enter-active-class": "tpl-design-slide-enter-active",
|
|
168
|
-
"enter-from-class": "tpl:translate-x-full",
|
|
169
|
-
"enter-to-class": "tpl:translate-x-0",
|
|
170
|
-
"leave-active-class": "tpl-design-slide-leave-active",
|
|
171
|
-
"leave-from-class": "tpl:translate-x-0",
|
|
172
|
-
"leave-to-class": "tpl:translate-x-full"
|
|
173
|
-
}, {
|
|
174
|
-
default: X(() => [
|
|
175
|
-
C.visible ? (n(), d("div", rt, [
|
|
176
|
-
e("div", ot, [
|
|
177
|
-
e("div", st, [
|
|
178
|
-
c(o(F), {
|
|
179
|
-
size: 13,
|
|
180
|
-
"stroke-width": 2
|
|
181
|
-
}),
|
|
182
|
-
e("span", null, p(l.value.title), 1)
|
|
183
|
-
]),
|
|
184
|
-
e("button", {
|
|
185
|
-
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150",
|
|
186
|
-
style: { color: "var(--tpl-text-muted)" },
|
|
187
|
-
onClick: a[0] || (a[0] = (s) => j("close"))
|
|
188
|
-
}, [
|
|
189
|
-
c(o(B), {
|
|
190
|
-
size: 14,
|
|
191
|
-
"stroke-width": 2
|
|
192
|
-
})
|
|
193
|
-
])
|
|
194
|
-
]),
|
|
195
|
-
e("div", nt, [
|
|
196
|
-
o(v).isGenerating.value ? (n(), d("div", it, [
|
|
197
|
-
e("div", dt, [
|
|
198
|
-
c(Y),
|
|
199
|
-
e("p", ct, p(l.value.generating), 1)
|
|
200
|
-
])
|
|
201
|
-
])) : (n(), d("div", ut, [
|
|
202
|
-
e("div", vt, [
|
|
203
|
-
e("button", {
|
|
204
|
-
class: "tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
205
|
-
style: k({
|
|
206
|
-
backgroundColor: r.value === "image" ? "var(--tpl-bg)" : "transparent",
|
|
207
|
-
color: r.value === "image" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
208
|
-
boxShadow: r.value === "image" ? "var(--tpl-shadow)" : "none"
|
|
209
|
-
}),
|
|
210
|
-
onClick: a[1] || (a[1] = (s) => I("image"))
|
|
211
|
-
}, [
|
|
212
|
-
c(o(at), {
|
|
213
|
-
size: 12,
|
|
214
|
-
"stroke-width": 2
|
|
215
|
-
}),
|
|
216
|
-
_(" " + p(l.value.uploadImage), 1)
|
|
217
|
-
], 4),
|
|
218
|
-
e("button", {
|
|
219
|
-
class: "tpl:flex tpl:flex-1 tpl:items-center tpl:justify-center tpl:gap-1.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-2 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
220
|
-
style: k({
|
|
221
|
-
backgroundColor: r.value === "pdf" ? "var(--tpl-bg)" : "transparent",
|
|
222
|
-
color: r.value === "pdf" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
223
|
-
boxShadow: r.value === "pdf" ? "var(--tpl-shadow)" : "none"
|
|
224
|
-
}),
|
|
225
|
-
onClick: a[2] || (a[2] = (s) => I("pdf"))
|
|
226
|
-
}, [
|
|
227
|
-
c(o(H), {
|
|
228
|
-
size: 12,
|
|
229
|
-
"stroke-width": 2
|
|
230
|
-
}),
|
|
231
|
-
_(" " + p(l.value.uploadPdf), 1)
|
|
232
|
-
], 4)
|
|
233
|
-
]),
|
|
234
|
-
e("div", null, [
|
|
235
|
-
i.value ? (n(), d("div", ft, [
|
|
236
|
-
e("div", mt, [
|
|
237
|
-
u.value ? (n(), d("img", {
|
|
238
|
-
key: 0,
|
|
239
|
-
src: u.value,
|
|
240
|
-
alt: i.value.name,
|
|
241
|
-
class: "tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain"
|
|
242
|
-
}, null, 8, gt)) : (n(), d("div", xt, [
|
|
243
|
-
c(o(H), {
|
|
244
|
-
size: 32,
|
|
245
|
-
"stroke-width": 1.5,
|
|
246
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
247
|
-
}),
|
|
248
|
-
e("span", yt, p(i.value.name), 1)
|
|
249
|
-
])),
|
|
250
|
-
e("button", {
|
|
251
|
-
class: "tpl:absolute tpl:top-2 tpl:right-2 tpl:rounded-full tpl:p-1 tpl:transition-colors tpl:duration-150",
|
|
252
|
-
style: { "background-color": "var(--tpl-bg)", color: "var(--tpl-text-muted)", "box-shadow": "var(--tpl-shadow)" },
|
|
253
|
-
onClick: U
|
|
254
|
-
}, [
|
|
255
|
-
c(o(B), {
|
|
256
|
-
size: 12,
|
|
257
|
-
"stroke-width": 2
|
|
258
|
-
})
|
|
259
|
-
])
|
|
260
|
-
])
|
|
261
|
-
])) : (n(), d("div", {
|
|
262
|
-
key: 1,
|
|
263
|
-
class: "tpl-design-dropzone tpl:flex tpl:cursor-pointer tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:border-2 tpl:border-dashed tpl:px-4 tpl:py-8 tpl:transition-colors tpl:duration-150",
|
|
264
|
-
style: k({
|
|
265
|
-
borderColor: x.value ? "var(--tpl-primary)" : "var(--tpl-border-light)",
|
|
266
|
-
backgroundColor: x.value ? "var(--tpl-primary-light)" : "var(--tpl-bg)"
|
|
267
|
-
}),
|
|
268
|
-
onClick: a[3] || (a[3] = (s) => {
|
|
269
|
-
var f;
|
|
270
|
-
return (f = t.$refs.fileInput) == null ? void 0 : f.click();
|
|
271
|
-
}),
|
|
272
|
-
onDragover: E,
|
|
273
|
-
onDragleave: G,
|
|
274
|
-
onDrop: N
|
|
275
|
-
}, [
|
|
276
|
-
c(o(pt), {
|
|
277
|
-
size: 24,
|
|
278
|
-
"stroke-width": 1.5,
|
|
279
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
280
|
-
}),
|
|
281
|
-
e("span", ht, p(l.value.dropHint), 1),
|
|
282
|
-
e("span", bt, p(r.value === "image" ? l.value.acceptedImages : l.value.acceptedPdf), 1)
|
|
283
|
-
], 36)),
|
|
284
|
-
e("input", {
|
|
285
|
-
ref: "fileInput",
|
|
286
|
-
type: "file",
|
|
287
|
-
class: "tpl:hidden",
|
|
288
|
-
accept: r.value === "image" ? "image/png,image/jpeg,image/webp" : "application/pdf",
|
|
289
|
-
onChange: q
|
|
290
|
-
}, null, 40, kt)
|
|
291
|
-
]),
|
|
292
|
-
e("div", _t, [
|
|
293
|
-
e("label", wt, p(l.value.promptLabel), 1),
|
|
294
|
-
J(e("textarea", {
|
|
295
|
-
"onUpdate:modelValue": a[4] || (a[4] = (s) => y.value = s),
|
|
296
|
-
class: K(["tpl:min-h-[72px] tpl:w-full tpl:resize-none tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:px-3 tpl:py-2 tpl:font-sans tpl:text-sm tpl:outline-none tpl:transition-colors tpl:duration-150", ["tpl-design-prompt-input"]]),
|
|
297
|
-
style: { "border-color": "var(--tpl-border)", color: "var(--tpl-text)", "background-color": "var(--tpl-bg)" },
|
|
298
|
-
placeholder: l.value.promptPlaceholder,
|
|
299
|
-
rows: "3"
|
|
300
|
-
}, null, 8, Ct), [
|
|
301
|
-
[Q, y.value]
|
|
302
|
-
])
|
|
303
|
-
]),
|
|
304
|
-
m.value ? (n(), d("div", zt, [
|
|
305
|
-
e("p", jt, p(l.value.replaceWarning), 1),
|
|
306
|
-
e("div", Tt, [
|
|
307
|
-
e("button", {
|
|
308
|
-
class: "tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150",
|
|
309
|
-
style: { "background-color": "transparent", color: "var(--tpl-text-muted)", border: "1px solid var(--tpl-border)" },
|
|
310
|
-
onClick: O
|
|
311
|
-
}, p(l.value.replaceCancel), 1),
|
|
312
|
-
e("button", {
|
|
313
|
-
class: "tpl:flex-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-3 tpl:py-1.5 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90",
|
|
314
|
-
style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
|
|
315
|
-
onClick: M
|
|
316
|
-
}, p(l.value.replaceConfirm), 1)
|
|
317
|
-
])
|
|
318
|
-
])) : h("", !0),
|
|
319
|
-
o(v).error.value ? (n(), d("div", Dt, [
|
|
320
|
-
c(o(tt), {
|
|
321
|
-
size: 14,
|
|
322
|
-
"stroke-width": 2,
|
|
323
|
-
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
324
|
-
}),
|
|
325
|
-
e("span", null, p(l.value.error), 1)
|
|
326
|
-
])) : h("", !0),
|
|
327
|
-
m.value ? h("", !0) : (n(), d("button", {
|
|
328
|
-
key: 2,
|
|
329
|
-
class: "tpl:flex tpl:w-full tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:px-4 tpl:py-2.5 tpl:text-sm tpl:font-medium tpl:transition-all tpl:duration-150 tpl:hover:opacity-90 tpl:disabled:cursor-not-allowed tpl:disabled:opacity-50",
|
|
330
|
-
style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
|
|
331
|
-
disabled: !D.value,
|
|
332
|
-
onClick: M
|
|
333
|
-
}, [
|
|
334
|
-
c(o(F), {
|
|
335
|
-
size: 16,
|
|
336
|
-
"stroke-width": 2
|
|
337
|
-
}),
|
|
338
|
-
_(" " + p(l.value.generate), 1)
|
|
339
|
-
], 8, It)),
|
|
340
|
-
e("p", Lt, p(o(T).aiMenu.disclaimer), 1)
|
|
341
|
-
]))
|
|
342
|
-
])
|
|
343
|
-
])) : h("", !0)
|
|
344
|
-
]),
|
|
345
|
-
_: 1
|
|
346
|
-
}));
|
|
347
|
-
}
|
|
348
|
-
}), Bt = /* @__PURE__ */ et(Ut, [["__scopeId", "data-v-c47a124b"]]);
|
|
349
|
-
export {
|
|
350
|
-
Bt as default
|
|
351
|
-
};
|
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { defineComponent as R, defineAsyncComponent as F, inject as B, ref as f, computed as h, watch as W, openBlock as p, createBlock as S, Teleport as X, createVNode as u, Transition as Y, withCtx as Z, createElementBlock as a, withModifiers as _, createElementVNode as e, toDisplayString as i, unref as n, withDirectives as j, vModelText as G, Fragment as g, renderList as w, normalizeStyle as J, resolveDynamicComponent as tt, createCommentVNode as V, vModelSelect as et } from "vue";
|
|
2
|
-
import { c as P, N as lt, O as ot, Q as st, U as nt, V as rt, W as pt, Y as at, Z as it, $ as ct, a0 as dt, a1 as ut, u as vt, X as xt, E as yt, a2 as D } from "./index-D-iD-7lO.js";
|
|
3
|
-
import "@templatical/types";
|
|
4
|
-
/**
|
|
5
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the ISC license.
|
|
8
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/
|
|
10
|
-
const mt = P("SearchIcon", [
|
|
11
|
-
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }],
|
|
12
|
-
["path", { d: "m21 21-4.3-4.3", key: "1qie3q" }]
|
|
13
|
-
]);
|
|
14
|
-
/**
|
|
15
|
-
* @license lucide-vue-next v0.475.0 - ISC
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the ISC license.
|
|
18
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
19
|
-
*/
|
|
20
|
-
const bt = P("TimerIcon", [
|
|
21
|
-
["line", { x1: "10", x2: "14", y1: "2", y2: "2", key: "14vaq8" }],
|
|
22
|
-
["line", { x1: "12", x2: "15", y1: "14", y2: "11", key: "17fdiu" }],
|
|
23
|
-
["circle", { cx: "12", cy: "14", r: "8", key: "1e1u0o" }]
|
|
24
|
-
]), E = {
|
|
25
|
-
section: ut,
|
|
26
|
-
image: dt,
|
|
27
|
-
text: ct,
|
|
28
|
-
button: it,
|
|
29
|
-
divider: at,
|
|
30
|
-
video: pt,
|
|
31
|
-
social: rt,
|
|
32
|
-
menu: nt,
|
|
33
|
-
table: st,
|
|
34
|
-
spacer: ot,
|
|
35
|
-
countdown: bt,
|
|
36
|
-
html: lt
|
|
37
|
-
}, ft = {
|
|
38
|
-
class: "tpl-scale-in tpl:mx-4 tpl:flex tpl:w-full tpl:max-w-[1000px] tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
|
|
39
|
-
style: { "background-color": "var(--tpl-bg-elevated)", "box-shadow": "var(--tpl-shadow-xl)", "max-height": "90vh" }
|
|
40
|
-
}, ht = {
|
|
41
|
-
class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4",
|
|
42
|
-
style: { "border-color": "var(--tpl-border)" }
|
|
43
|
-
}, kt = {
|
|
44
|
-
class: "tpl:text-sm tpl:font-semibold",
|
|
45
|
-
style: { color: "var(--tpl-text)" }
|
|
46
|
-
}, _t = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, gt = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, wt = { class: "tpl:px-4 tpl:pt-4 tpl:pb-3" }, Ct = { class: "tpl:relative" }, Mt = ["placeholder"], It = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, Tt = {
|
|
47
|
-
key: 0,
|
|
48
|
-
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
49
|
-
}, zt = ["onClick"], Bt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, St = {
|
|
50
|
-
class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold",
|
|
51
|
-
style: { color: "var(--tpl-text)" }
|
|
52
|
-
}, jt = {
|
|
53
|
-
class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
54
|
-
style: { "background-color": "var(--tpl-bg-hover)", color: "var(--tpl-text-muted)" }
|
|
55
|
-
}, Vt = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, Dt = {
|
|
56
|
-
key: 0,
|
|
57
|
-
class: "tpl:text-[10px]",
|
|
58
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
59
|
-
}, Et = ["onClick"], Pt = ["title", "onClick"], $t = {
|
|
60
|
-
key: 1,
|
|
61
|
-
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
|
|
62
|
-
}, Nt = {
|
|
63
|
-
class: "tpl:mt-2 tpl:text-xs",
|
|
64
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
65
|
-
}, qt = {
|
|
66
|
-
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l",
|
|
67
|
-
style: { "border-color": "var(--tpl-border)" }
|
|
68
|
-
}, At = {
|
|
69
|
-
key: 0,
|
|
70
|
-
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
|
|
71
|
-
}, Lt = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Ht = {
|
|
72
|
-
key: 1,
|
|
73
|
-
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
|
|
74
|
-
}, Kt = {
|
|
75
|
-
class: "tpl:mt-2 tpl:text-center tpl:text-xs",
|
|
76
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
77
|
-
}, Ut = {
|
|
78
|
-
class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3",
|
|
79
|
-
style: { "border-color": "var(--tpl-border)" }
|
|
80
|
-
}, Ot = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Qt = {
|
|
81
|
-
class: "tpl:shrink-0 tpl:text-xs",
|
|
82
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
83
|
-
}, Rt = ["value"], Ft = { class: "tpl:flex tpl:gap-2" }, Wt = ["disabled"], Gt = /* @__PURE__ */ R({
|
|
84
|
-
__name: "ModuleBrowserModal",
|
|
85
|
-
props: {
|
|
86
|
-
visible: { type: Boolean }
|
|
87
|
-
},
|
|
88
|
-
emits: ["close", "insert"],
|
|
89
|
-
setup(C, { emit: $ }) {
|
|
90
|
-
const N = C, M = $, q = F(
|
|
91
|
-
() => import("./ModulePreviewCanvas-Cdp484Ae.js")
|
|
92
|
-
), { t: r } = vt(), k = B("savedModulesHeadless"), y = B("editor"), v = f(""), c = f(null), m = f(null), d = f("end"), I = h(() => {
|
|
93
|
-
const l = k.modules.value;
|
|
94
|
-
if (!v.value) return l;
|
|
95
|
-
const o = v.value.toLowerCase();
|
|
96
|
-
return l.filter((t) => t.name.toLowerCase().includes(o));
|
|
97
|
-
}), x = h(() => c.value ? k.modules.value.find((l) => l.id === c.value) ?? null : null), A = h(() => {
|
|
98
|
-
const l = [
|
|
99
|
-
{ value: "beginning", label: r.modules.insertAtBeginning }
|
|
100
|
-
], o = y.content.value.blocks;
|
|
101
|
-
for (let t = 0; t < o.length; t++) {
|
|
102
|
-
const s = o[t], O = s.type, Q = r.blocks[O] ?? s.type;
|
|
103
|
-
l.push({
|
|
104
|
-
value: s.id,
|
|
105
|
-
label: r.modules.insertAfterBlock.replace("{block}", `${Q} ${t + 1}`)
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
return l.push({ value: "end", label: r.modules.insertAtEnd }), l;
|
|
109
|
-
}), L = h(() => {
|
|
110
|
-
if (d.value === "end") return;
|
|
111
|
-
if (d.value === "beginning") return 0;
|
|
112
|
-
const o = y.content.value.blocks.findIndex((t) => t.id === d.value);
|
|
113
|
-
if (o !== -1) return o + 1;
|
|
114
|
-
});
|
|
115
|
-
W(
|
|
116
|
-
() => N.visible,
|
|
117
|
-
(l) => {
|
|
118
|
-
if (l) {
|
|
119
|
-
v.value = "", c.value = null, m.value = null;
|
|
120
|
-
const o = y.state.selectedBlockId;
|
|
121
|
-
if (o) {
|
|
122
|
-
const t = y.content.value.blocks.findIndex(
|
|
123
|
-
(s) => s.id === o
|
|
124
|
-
);
|
|
125
|
-
d.value = t !== -1 ? o : "end";
|
|
126
|
-
} else
|
|
127
|
-
d.value = "end";
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
);
|
|
131
|
-
function H(l) {
|
|
132
|
-
const o = [], t = /* @__PURE__ */ new Set();
|
|
133
|
-
for (const s of l.content)
|
|
134
|
-
if (!t.has(s.type) && E[s.type] && (t.add(s.type), o.push({ type: s.type, icon: E[s.type] })), o.length >= 5) break;
|
|
135
|
-
return o;
|
|
136
|
-
}
|
|
137
|
-
function T(l) {
|
|
138
|
-
const o = new Set(l.content.map((t) => t.type));
|
|
139
|
-
return Math.max(0, o.size - 5);
|
|
140
|
-
}
|
|
141
|
-
async function K(l) {
|
|
142
|
-
try {
|
|
143
|
-
await k.deleteModule(l), c.value === l && (c.value = null);
|
|
144
|
-
} finally {
|
|
145
|
-
m.value = null;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
function z() {
|
|
149
|
-
x.value && M("insert", x.value, L.value);
|
|
150
|
-
}
|
|
151
|
-
function b() {
|
|
152
|
-
M("close");
|
|
153
|
-
}
|
|
154
|
-
function U(l) {
|
|
155
|
-
l.key === "Escape" && b(), l.key === "Enter" && x.value && (l.preventDefault(), z());
|
|
156
|
-
}
|
|
157
|
-
return (l, o) => (p(), S(X, { to: "body" }, [
|
|
158
|
-
u(Y, {
|
|
159
|
-
"enter-active-class": "tpl:transition tpl:duration-150",
|
|
160
|
-
"enter-from-class": "tpl:opacity-0",
|
|
161
|
-
"enter-to-class": "tpl:opacity-100",
|
|
162
|
-
"leave-active-class": "tpl:transition tpl:duration-100",
|
|
163
|
-
"leave-from-class": "tpl:opacity-100",
|
|
164
|
-
"leave-to-class": "tpl:opacity-0"
|
|
165
|
-
}, {
|
|
166
|
-
default: Z(() => [
|
|
167
|
-
C.visible ? (p(), a("div", {
|
|
168
|
-
key: 0,
|
|
169
|
-
class: "tpl tpl:fixed tpl:inset-0 tpl:z-[10000] tpl:flex tpl:items-center tpl:justify-center",
|
|
170
|
-
style: { "background-color": "var(--tpl-overlay)", "backdrop-filter": "blur(8px)", "-webkit-backdrop-filter": "blur(8px)" },
|
|
171
|
-
onClick: _(b, ["self"]),
|
|
172
|
-
onKeydown: U
|
|
173
|
-
}, [
|
|
174
|
-
e("div", ft, [
|
|
175
|
-
e("div", ht, [
|
|
176
|
-
e("h3", kt, i(n(r).modules.browse), 1),
|
|
177
|
-
e("button", {
|
|
178
|
-
class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:duration-100",
|
|
179
|
-
style: { color: "var(--tpl-text-dim)" },
|
|
180
|
-
onClick: b
|
|
181
|
-
}, [
|
|
182
|
-
u(n(xt), {
|
|
183
|
-
size: 16,
|
|
184
|
-
"stroke-width": 2
|
|
185
|
-
})
|
|
186
|
-
])
|
|
187
|
-
]),
|
|
188
|
-
e("div", _t, [
|
|
189
|
-
e("div", gt, [
|
|
190
|
-
e("div", wt, [
|
|
191
|
-
e("div", Ct, [
|
|
192
|
-
u(n(mt), {
|
|
193
|
-
size: 14,
|
|
194
|
-
"stroke-width": 2,
|
|
195
|
-
class: "tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2",
|
|
196
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
197
|
-
}),
|
|
198
|
-
j(e("input", {
|
|
199
|
-
"onUpdate:modelValue": o[0] || (o[0] = (t) => v.value = t),
|
|
200
|
-
type: "text",
|
|
201
|
-
placeholder: n(r).modules.search,
|
|
202
|
-
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none",
|
|
203
|
-
style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" }
|
|
204
|
-
}, null, 8, Mt), [
|
|
205
|
-
[G, v.value]
|
|
206
|
-
])
|
|
207
|
-
])
|
|
208
|
-
]),
|
|
209
|
-
e("div", It, [
|
|
210
|
-
I.value.length > 0 ? (p(), a("div", Tt, [
|
|
211
|
-
(p(!0), a(g, null, w(I.value, (t) => (p(), a("div", {
|
|
212
|
-
key: t.id,
|
|
213
|
-
class: "tpl:group/card tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:transition-all tpl:duration-[120ms]",
|
|
214
|
-
style: J({
|
|
215
|
-
borderColor: c.value === t.id ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
216
|
-
backgroundColor: c.value === t.id ? "var(--tpl-primary-light)" : "transparent"
|
|
217
|
-
}),
|
|
218
|
-
onClick: (s) => c.value = t.id
|
|
219
|
-
}, [
|
|
220
|
-
e("div", Bt, [
|
|
221
|
-
e("span", St, i(t.name), 1),
|
|
222
|
-
e("span", jt, i(n(r).modules.blockCount.replace(
|
|
223
|
-
"{count}",
|
|
224
|
-
String(t.content.length)
|
|
225
|
-
)), 1)
|
|
226
|
-
]),
|
|
227
|
-
e("div", Vt, [
|
|
228
|
-
(p(!0), a(g, null, w(H(t), (s) => (p(), S(tt(s.icon), {
|
|
229
|
-
key: s.type,
|
|
230
|
-
size: 14,
|
|
231
|
-
"stroke-width": 1.5,
|
|
232
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
233
|
-
}))), 128)),
|
|
234
|
-
T(t) > 0 ? (p(), a("span", Dt, " +" + i(T(t)), 1)) : V("", !0),
|
|
235
|
-
m.value === t.id ? (p(), a("button", {
|
|
236
|
-
key: 1,
|
|
237
|
-
class: "tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:duration-100",
|
|
238
|
-
style: { "border-color": "var(--tpl-danger)", color: "var(--tpl-danger)", "background-color": "transparent" },
|
|
239
|
-
onClick: _((s) => K(t.id), ["stop"])
|
|
240
|
-
}, i(n(r).modules.deleteConfirm), 9, Et)) : (p(), a("button", {
|
|
241
|
-
key: 2,
|
|
242
|
-
class: "tpl-module-delete-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:duration-100",
|
|
243
|
-
style: { color: "var(--tpl-text-dim)" },
|
|
244
|
-
title: n(r).modules.delete,
|
|
245
|
-
onClick: _((s) => m.value = t.id, ["stop"])
|
|
246
|
-
}, [
|
|
247
|
-
u(n(yt), {
|
|
248
|
-
size: 12,
|
|
249
|
-
"stroke-width": 1.5
|
|
250
|
-
})
|
|
251
|
-
], 8, Pt))
|
|
252
|
-
])
|
|
253
|
-
], 12, zt))), 128))
|
|
254
|
-
])) : (p(), a("div", $t, [
|
|
255
|
-
u(n(D), {
|
|
256
|
-
size: 32,
|
|
257
|
-
"stroke-width": 1,
|
|
258
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
259
|
-
}),
|
|
260
|
-
e("p", Nt, i(v.value ? n(r).modules.noModules : n(r).modules.noModulesHint), 1)
|
|
261
|
-
]))
|
|
262
|
-
])
|
|
263
|
-
]),
|
|
264
|
-
e("div", qt, [
|
|
265
|
-
x.value ? (p(), a("div", At, [
|
|
266
|
-
e("div", Lt, [
|
|
267
|
-
u(n(q), {
|
|
268
|
-
blocks: x.value.content
|
|
269
|
-
}, null, 8, ["blocks"])
|
|
270
|
-
])
|
|
271
|
-
])) : (p(), a("div", Ht, [
|
|
272
|
-
u(n(D), {
|
|
273
|
-
size: 32,
|
|
274
|
-
"stroke-width": 1,
|
|
275
|
-
style: { color: "var(--tpl-text-dim)" }
|
|
276
|
-
}),
|
|
277
|
-
e("p", Kt, i(n(r).modules.selectToPreview), 1)
|
|
278
|
-
]))
|
|
279
|
-
])
|
|
280
|
-
]),
|
|
281
|
-
e("div", Ut, [
|
|
282
|
-
e("div", Ot, [
|
|
283
|
-
e("label", Qt, i(n(r).modules.insertPosition), 1),
|
|
284
|
-
j(e("select", {
|
|
285
|
-
"onUpdate:modelValue": o[1] || (o[1] = (t) => d.value = t),
|
|
286
|
-
class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none",
|
|
287
|
-
style: { "border-color": "var(--tpl-border)", "background-color": "var(--tpl-bg)", color: "var(--tpl-text)" }
|
|
288
|
-
}, [
|
|
289
|
-
(p(!0), a(g, null, w(A.value, (t) => (p(), a("option", {
|
|
290
|
-
key: t.value,
|
|
291
|
-
value: t.value
|
|
292
|
-
}, i(t.label), 9, Rt))), 128))
|
|
293
|
-
], 512), [
|
|
294
|
-
[et, d.value]
|
|
295
|
-
])
|
|
296
|
-
]),
|
|
297
|
-
e("div", Ft, [
|
|
298
|
-
e("button", {
|
|
299
|
-
type: "button",
|
|
300
|
-
class: "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",
|
|
301
|
-
style: { "border-color": "var(--tpl-border)", color: "var(--tpl-text)", "background-color": "var(--tpl-bg)" },
|
|
302
|
-
onClick: b
|
|
303
|
-
}, i(n(r).modules.close), 1),
|
|
304
|
-
e("button", {
|
|
305
|
-
type: "button",
|
|
306
|
-
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",
|
|
307
|
-
style: { "background-color": "var(--tpl-primary)", color: "var(--tpl-bg)" },
|
|
308
|
-
disabled: !x.value,
|
|
309
|
-
onClick: z
|
|
310
|
-
}, i(n(r).modules.insert), 9, Wt)
|
|
311
|
-
])
|
|
312
|
-
])
|
|
313
|
-
])
|
|
314
|
-
], 32)) : V("", !0)
|
|
315
|
-
]),
|
|
316
|
-
_: 1
|
|
317
|
-
})
|
|
318
|
-
]));
|
|
319
|
-
}
|
|
320
|
-
});
|
|
321
|
-
export {
|
|
322
|
-
Gt as default
|
|
323
|
-
};
|