@templatical/editor 0.0.1 → 0.0.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/dist/AiChatSidebar-busJk9hm.js +214 -0
- package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
- package/dist/CloudEditor-BDnHd6Um.js +919 -0
- package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
- package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
- package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
- package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
- package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
- package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
- package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
- package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
- package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
- package/dist/TestEmailModal-Dpq1is9S.js +94 -0
- package/dist/TitleEditor-CLcDdcWI.js +167 -0
- package/dist/TplModal-CGzRjR96.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BpPTqcok.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.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-ea_ewKUl.js +2 -0
- package/dist/cdn/chunks/extensions-ea_ewKUl.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-CNejCb-L.js +2 -0
- package/dist/cdn/chunks/styleConstants-CNejCb-L.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-CwuxQuvh.js +2 -0
- package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.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-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DmpMJbmZ.js +513 -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-CKM99njP.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-CJsFtdbZ.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-Dwa2PmdD.js +10 -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-D4SOZGBV.js +94 -0
- package/dist/styles-DSw1VNU3.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-Cc4RCwWq.js +5556 -0
- package/dist/useI18n-DUirdXEX.js +17 -0
- package/dist/useMergeTag-DVnlvPYJ.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
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import "./timeouts-CmBrLeZA.js";
|
|
2
|
+
import { f as e, r as t } from "./keys-Dwa2PmdD.js";
|
|
3
|
+
import { t as n } from "./useI18n-DUirdXEX.js";
|
|
4
|
+
import { n as r, t as i } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
5
|
+
import { t as ee } from "./circle-alert-E2vYPs5r.js";
|
|
6
|
+
import { t as a } from "./image-up-X4xIq4ea.js";
|
|
7
|
+
import { t as o } from "./x-CGlq2XQe.js";
|
|
8
|
+
import { t as te } from "./LoadingTrack-vK8W2PJf.js";
|
|
9
|
+
import { Transition as ne, computed as re, createBlock as ie, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as u, createVNode as d, defineComponent as f, inject as p, normalizeClass as ae, normalizeStyle as m, openBlock as h, ref as g, toDisplayString as _, unref as v, vModelText as y, watch as oe, withCtx as se, withDirectives as ce } from "vue";
|
|
10
|
+
import { useDesignReference as le } from "@templatical/core/cloud";
|
|
11
|
+
var ue = r("file-image", [
|
|
12
|
+
["path", {
|
|
13
|
+
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
14
|
+
key: "1oefj6"
|
|
15
|
+
}],
|
|
16
|
+
["path", {
|
|
17
|
+
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
18
|
+
key: "wfsgrz"
|
|
19
|
+
}],
|
|
20
|
+
["circle", {
|
|
21
|
+
cx: "10",
|
|
22
|
+
cy: "12",
|
|
23
|
+
r: "2",
|
|
24
|
+
key: "737tya"
|
|
25
|
+
}],
|
|
26
|
+
["path", {
|
|
27
|
+
d: "m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",
|
|
28
|
+
key: "wt3hpn"
|
|
29
|
+
}]
|
|
30
|
+
]), b = r("file-text", [
|
|
31
|
+
["path", {
|
|
32
|
+
d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
|
|
33
|
+
key: "1oefj6"
|
|
34
|
+
}],
|
|
35
|
+
["path", {
|
|
36
|
+
d: "M14 2v5a1 1 0 0 0 1 1h5",
|
|
37
|
+
key: "wfsgrz"
|
|
38
|
+
}],
|
|
39
|
+
["path", {
|
|
40
|
+
d: "M10 9H8",
|
|
41
|
+
key: "b1mrlr"
|
|
42
|
+
}],
|
|
43
|
+
["path", {
|
|
44
|
+
d: "M16 13H8",
|
|
45
|
+
key: "t4e002"
|
|
46
|
+
}],
|
|
47
|
+
["path", {
|
|
48
|
+
d: "M16 17H8",
|
|
49
|
+
key: "z1uh3a"
|
|
50
|
+
}]
|
|
51
|
+
]), de = r("upload", [
|
|
52
|
+
["path", {
|
|
53
|
+
d: "M12 3v12",
|
|
54
|
+
key: "1x0j5s"
|
|
55
|
+
}],
|
|
56
|
+
["path", {
|
|
57
|
+
d: "m17 8-5-5-5 5",
|
|
58
|
+
key: "7q97r8"
|
|
59
|
+
}],
|
|
60
|
+
["path", {
|
|
61
|
+
d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",
|
|
62
|
+
key: "ih7n3h"
|
|
63
|
+
}]
|
|
64
|
+
]), fe = {
|
|
65
|
+
key: 0,
|
|
66
|
+
class: "tpl-design-sidebar tpl:absolute tpl:top-14 tpl:right-0 tpl:bottom-0 tpl:z-panel tpl:flex tpl:w-[360px] tpl:flex-col tpl:border-l tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)]"
|
|
67
|
+
}, pe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-3" }, me = { class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:text-sm tpl:font-medium tpl:text-[var(--tpl-primary)]" }, he = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, x = {
|
|
68
|
+
key: 0,
|
|
69
|
+
class: "tpl:flex tpl:h-full tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:text-center"
|
|
70
|
+
}, S = { class: "tpl:flex tpl:w-full tpl:flex-col tpl:items-center tpl:gap-3" }, C = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, w = {
|
|
71
|
+
key: 1,
|
|
72
|
+
class: "tpl:flex tpl:flex-col tpl:gap-4"
|
|
73
|
+
}, T = { class: "tpl:flex tpl:gap-1 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-hover)]" }, E = {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: "tpl:flex tpl:flex-col tpl:gap-2"
|
|
76
|
+
}, D = { class: "tpl:relative tpl:overflow-hidden tpl:rounded-[var(--tpl-radius)] tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)]" }, O = ["src", "alt"], k = {
|
|
77
|
+
key: 1,
|
|
78
|
+
class: "tpl:flex tpl:h-32 tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2"
|
|
79
|
+
}, A = { class: "tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, j = { class: "tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-muted)]" }, M = { class: "tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, N = ["accept"], P = { class: "tpl:flex tpl:flex-col tpl:gap-1.5" }, F = { class: "tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-text-muted)]" }, I = ["placeholder"], L = {
|
|
80
|
+
key: 0,
|
|
81
|
+
class: "tpl:flex tpl:flex-col tpl:gap-2 tpl:rounded-[var(--tpl-radius)] tpl:px-3 tpl:py-3 tpl:bg-[var(--tpl-warning-light)] tpl:border tpl:border-[var(--tpl-warning)]"
|
|
82
|
+
}, R = { class: "tpl:text-xs tpl:leading-snug tpl:text-[var(--tpl-text)]" }, ge = { class: "tpl:flex tpl:gap-2" }, _e = {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: "tpl:flex tpl:items-start tpl:gap-2 tpl:rounded-lg tpl:px-3 tpl:py-2 tpl:text-xs tpl:bg-[var(--tpl-danger-light)] tpl:text-[var(--tpl-danger)]"
|
|
85
|
+
}, ve = ["disabled"], ye = { class: "tpl:m-0 tpl:pt-1 tpl:text-center tpl:text-[11px] tpl:text-[var(--tpl-text-dim)]" }, z = /* @__PURE__ */ i(/* @__PURE__ */ f({
|
|
86
|
+
__name: "DesignReferenceSidebar",
|
|
87
|
+
props: {
|
|
88
|
+
visible: { type: Boolean },
|
|
89
|
+
hasExistingBlocks: { type: Boolean }
|
|
90
|
+
},
|
|
91
|
+
emits: ["close", "apply"],
|
|
92
|
+
setup(r, { emit: i }) {
|
|
93
|
+
let f = r, z = i, { t: B } = n(), be = p(e), V = le({
|
|
94
|
+
authManager: p(t),
|
|
95
|
+
getTemplateId: () => be.state.template?.id ?? null,
|
|
96
|
+
onApply: (e) => z("apply", e)
|
|
97
|
+
}), H = g(null), U = g("image"), W = g(null), G = g(""), K = g(null), q = g(!1), J = g(!1), Y = re(() => V.isGenerating.value ? !1 : W.value !== null);
|
|
98
|
+
function X(e) {
|
|
99
|
+
U.value = e, Q();
|
|
100
|
+
}
|
|
101
|
+
function xe(e) {
|
|
102
|
+
let t = e.target, n = t.files?.[0];
|
|
103
|
+
n && Z(n), t.value = "";
|
|
104
|
+
}
|
|
105
|
+
function Z(e) {
|
|
106
|
+
if (e.size > 10485760) {
|
|
107
|
+
V.error.value = B.designReference.fileTooLarge;
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (U.value === "image") {
|
|
111
|
+
if (![
|
|
112
|
+
"image/png",
|
|
113
|
+
"image/jpeg",
|
|
114
|
+
"image/jpg",
|
|
115
|
+
"image/webp"
|
|
116
|
+
].includes(e.type)) {
|
|
117
|
+
V.error.value = B.designReference.invalidFileType;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
} else if (U.value === "pdf" && e.type !== "application/pdf") {
|
|
121
|
+
V.error.value = B.designReference.invalidFileType;
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
W.value = e, V.error.value = null, K.value && URL.revokeObjectURL(K.value), e.type.startsWith("image/") ? K.value = URL.createObjectURL(e) : K.value = null;
|
|
125
|
+
}
|
|
126
|
+
function Q() {
|
|
127
|
+
K.value &&= (URL.revokeObjectURL(K.value), null), W.value = null;
|
|
128
|
+
}
|
|
129
|
+
function Se(e) {
|
|
130
|
+
e.preventDefault(), J.value = !0;
|
|
131
|
+
}
|
|
132
|
+
function Ce() {
|
|
133
|
+
J.value = !1;
|
|
134
|
+
}
|
|
135
|
+
function we(e) {
|
|
136
|
+
e.preventDefault(), J.value = !1;
|
|
137
|
+
let t = e.dataTransfer?.files?.[0];
|
|
138
|
+
t && Z(t);
|
|
139
|
+
}
|
|
140
|
+
function $() {
|
|
141
|
+
if (!Y.value) return;
|
|
142
|
+
if (f.hasExistingBlocks && !q.value) {
|
|
143
|
+
q.value = !0;
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
q.value = !1;
|
|
147
|
+
let e = {};
|
|
148
|
+
G.value.trim() && (e.prompt = G.value.trim()), U.value === "image" && W.value ? e.imageUpload = W.value : U.value === "pdf" && W.value && (e.pdfUpload = W.value), V.generate(e);
|
|
149
|
+
}
|
|
150
|
+
function Te() {
|
|
151
|
+
q.value = !1;
|
|
152
|
+
}
|
|
153
|
+
return oe(() => f.visible, (e) => {
|
|
154
|
+
e || (q.value = !1);
|
|
155
|
+
}), (e, t) => (h(), ie(ne, {
|
|
156
|
+
"enter-active-class": "tpl-design-slide-enter-active",
|
|
157
|
+
"enter-from-class": "tpl:translate-x-full",
|
|
158
|
+
"enter-to-class": "tpl:translate-x-0",
|
|
159
|
+
"leave-active-class": "tpl-design-slide-leave-active",
|
|
160
|
+
"leave-from-class": "tpl:translate-x-0",
|
|
161
|
+
"leave-to-class": "tpl:translate-x-full"
|
|
162
|
+
}, {
|
|
163
|
+
default: se(() => [r.visible ? (h(), c("div", fe, [l("div", pe, [l("div", me, [d(v(a), {
|
|
164
|
+
size: 13,
|
|
165
|
+
"stroke-width": 2
|
|
166
|
+
}), l("span", null, _(v(B).designReference.title), 1)]), l("button", {
|
|
167
|
+
class: "tpl:rounded-md tpl:p-0.5 tpl:transition-colors tpl:duration-150 tpl:text-[var(--tpl-text-muted)]",
|
|
168
|
+
onClick: t[0] ||= (e) => z("close")
|
|
169
|
+
}, [d(v(o), {
|
|
170
|
+
size: 14,
|
|
171
|
+
"stroke-width": 2
|
|
172
|
+
})])]), l("div", he, [v(V).isGenerating.value ? (h(), c("div", x, [l("div", S, [d(te), l("p", C, _(v(B).designReference.generating), 1)])])) : (h(), c("div", w, [
|
|
173
|
+
l("div", T, [l("button", {
|
|
174
|
+
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",
|
|
175
|
+
style: m({
|
|
176
|
+
backgroundColor: U.value === "image" ? "var(--tpl-bg)" : "transparent",
|
|
177
|
+
color: U.value === "image" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
178
|
+
boxShadow: U.value === "image" ? "var(--tpl-shadow)" : "none"
|
|
179
|
+
}),
|
|
180
|
+
onClick: t[1] ||= (e) => X("image")
|
|
181
|
+
}, [d(v(ue), {
|
|
182
|
+
size: 12,
|
|
183
|
+
"stroke-width": 2
|
|
184
|
+
}), u(" " + _(v(B).designReference.uploadImage), 1)], 4), l("button", {
|
|
185
|
+
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",
|
|
186
|
+
style: m({
|
|
187
|
+
backgroundColor: U.value === "pdf" ? "var(--tpl-bg)" : "transparent",
|
|
188
|
+
color: U.value === "pdf" ? "var(--tpl-primary)" : "var(--tpl-text-muted)",
|
|
189
|
+
boxShadow: U.value === "pdf" ? "var(--tpl-shadow)" : "none"
|
|
190
|
+
}),
|
|
191
|
+
onClick: t[2] ||= (e) => X("pdf")
|
|
192
|
+
}, [d(v(b), {
|
|
193
|
+
size: 12,
|
|
194
|
+
"stroke-width": 2
|
|
195
|
+
}), u(" " + _(v(B).designReference.uploadPdf), 1)], 4)]),
|
|
196
|
+
l("div", null, [W.value ? (h(), c("div", E, [l("div", D, [K.value ? (h(), c("img", {
|
|
197
|
+
key: 0,
|
|
198
|
+
src: K.value,
|
|
199
|
+
alt: W.value.name,
|
|
200
|
+
class: "tpl:h-auto tpl:max-h-48 tpl:w-full tpl:object-contain"
|
|
201
|
+
}, null, 8, O)) : (h(), c("div", k, [d(v(b), {
|
|
202
|
+
size: 32,
|
|
203
|
+
"stroke-width": 1.5,
|
|
204
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
205
|
+
}), l("span", A, _(W.value.name), 1)])), l("button", {
|
|
206
|
+
class: "tpl:absolute tpl:top-2 tpl:right-2 tpl:rounded-full tpl:p-1 tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text-muted)] tpl:shadow-[var(--tpl-shadow)]",
|
|
207
|
+
onClick: Q
|
|
208
|
+
}, [d(v(o), {
|
|
209
|
+
size: 12,
|
|
210
|
+
"stroke-width": 2
|
|
211
|
+
})])])])) : (h(), c("div", {
|
|
212
|
+
key: 1,
|
|
213
|
+
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",
|
|
214
|
+
style: m({
|
|
215
|
+
borderColor: J.value ? "var(--tpl-primary)" : "var(--tpl-border-light)",
|
|
216
|
+
backgroundColor: J.value ? "var(--tpl-primary-light)" : "var(--tpl-bg)"
|
|
217
|
+
}),
|
|
218
|
+
onClick: t[3] ||= (e) => H.value?.click(),
|
|
219
|
+
onDragover: Se,
|
|
220
|
+
onDragleave: Ce,
|
|
221
|
+
onDrop: we
|
|
222
|
+
}, [
|
|
223
|
+
d(v(de), {
|
|
224
|
+
size: 24,
|
|
225
|
+
"stroke-width": 1.5,
|
|
226
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
227
|
+
}),
|
|
228
|
+
l("span", j, _(v(B).designReference.dropHint), 1),
|
|
229
|
+
l("span", M, _(U.value === "image" ? v(B).designReference.acceptedImages : v(B).designReference.acceptedPdf), 1)
|
|
230
|
+
], 36)), l("input", {
|
|
231
|
+
ref_key: "fileInput",
|
|
232
|
+
ref: H,
|
|
233
|
+
type: "file",
|
|
234
|
+
class: "tpl:hidden",
|
|
235
|
+
accept: U.value === "image" ? "image/png,image/jpeg,image/webp" : "application/pdf",
|
|
236
|
+
onChange: xe
|
|
237
|
+
}, null, 40, N)]),
|
|
238
|
+
l("div", P, [l("label", F, _(v(B).designReference.promptLabel), 1), ce(l("textarea", {
|
|
239
|
+
"onUpdate:modelValue": t[4] ||= (e) => G.value = e,
|
|
240
|
+
class: ae(["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:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]", ["tpl-design-prompt-input"]]),
|
|
241
|
+
placeholder: v(B).designReference.promptPlaceholder,
|
|
242
|
+
rows: "3"
|
|
243
|
+
}, null, 8, I), [[y, G.value]])]),
|
|
244
|
+
q.value ? (h(), c("div", L, [l("p", R, _(v(B).designReference.replaceWarning), 1), l("div", ge, [l("button", {
|
|
245
|
+
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:text-[var(--tpl-text-muted)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
246
|
+
style: { "background-color": "transparent" },
|
|
247
|
+
onClick: Te
|
|
248
|
+
}, _(v(B).designReference.replaceCancel), 1), l("button", {
|
|
249
|
+
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 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
250
|
+
onClick: $
|
|
251
|
+
}, _(v(B).designReference.replaceConfirm), 1)])])) : s("", !0),
|
|
252
|
+
v(V).error.value ? (h(), c("div", _e, [d(v(ee), {
|
|
253
|
+
size: 14,
|
|
254
|
+
"stroke-width": 2,
|
|
255
|
+
class: "tpl:mt-0.5 tpl:shrink-0"
|
|
256
|
+
}), l("span", null, _(v(B).designReference.error), 1)])) : s("", !0),
|
|
257
|
+
q.value ? s("", !0) : (h(), c("button", {
|
|
258
|
+
key: 2,
|
|
259
|
+
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 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
260
|
+
disabled: !Y.value,
|
|
261
|
+
onClick: $
|
|
262
|
+
}, [d(v(a), {
|
|
263
|
+
size: 16,
|
|
264
|
+
"stroke-width": 2
|
|
265
|
+
}), u(" " + _(v(B).designReference.generate), 1)], 8, ve)),
|
|
266
|
+
l("p", ye, _(v(B).aiMenu.disclaimer), 1)
|
|
267
|
+
]))])])) : s("", !0)]),
|
|
268
|
+
_: 1
|
|
269
|
+
}));
|
|
270
|
+
}
|
|
271
|
+
}), [["__scopeId", "data-v-1c8d2ac8"]]);
|
|
272
|
+
//#endregion
|
|
273
|
+
export { z as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as e } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
2
|
+
import { createElementBlock as t, openBlock as n } from "vue";
|
|
3
|
+
//#region src/components/LoadingTrack.vue
|
|
4
|
+
var r = {}, i = { class: "tpl-loading-track" };
|
|
5
|
+
function a(e, r) {
|
|
6
|
+
return n(), t("div", i);
|
|
7
|
+
}
|
|
8
|
+
var o = /* @__PURE__ */ e(r, [["render", a], ["__scopeId", "data-v-1ed538ec"]]);
|
|
9
|
+
//#endregion
|
|
10
|
+
export { o as t };
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import "./useEditorCore-Cc4RCwWq.js";
|
|
2
|
+
import { f as e, y as t } from "./keys-Dwa2PmdD.js";
|
|
3
|
+
import { t as n } from "./useI18n-DUirdXEX.js";
|
|
4
|
+
import { n as r } from "./_plugin-vue_export-helper-B1-bu7yR.js";
|
|
5
|
+
import { n as i, t as a } from "./blockTypeIcons-BpPTqcok.js";
|
|
6
|
+
import { t as ee } from "./trash-2-OwjZ-guZ.js";
|
|
7
|
+
import { t as te } from "./x-CGlq2XQe.js";
|
|
8
|
+
import { t as ne } from "./TplModal-CGzRjR96.js";
|
|
9
|
+
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as re, createElementBlock as l, createElementVNode as u, createVNode as d, defineAsyncComponent as ie, defineComponent as f, inject as p, normalizeStyle as ae, openBlock as m, ref as h, renderList as g, resolveDynamicComponent as oe, toDisplayString as _, unref as v, vModelSelect as se, vModelText as ce, watch as le, withCtx as ue, withDirectives as y, withModifiers as b } from "vue";
|
|
10
|
+
var de = r("search", [["path", {
|
|
11
|
+
d: "m21 21-4.34-4.34",
|
|
12
|
+
key: "14j7rj"
|
|
13
|
+
}], ["circle", {
|
|
14
|
+
cx: "11",
|
|
15
|
+
cy: "11",
|
|
16
|
+
r: "8",
|
|
17
|
+
key: "4ej97u"
|
|
18
|
+
}]]), fe = {
|
|
19
|
+
role: "dialog",
|
|
20
|
+
"aria-modal": "true",
|
|
21
|
+
"aria-labelledby": "tpl-module-browser-title",
|
|
22
|
+
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)]",
|
|
23
|
+
style: {
|
|
24
|
+
"background-color": "var(--tpl-bg-elevated)",
|
|
25
|
+
"box-shadow": "var(--tpl-shadow-xl)",
|
|
26
|
+
"max-height": "90vh"
|
|
27
|
+
}
|
|
28
|
+
}, pe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, me = {
|
|
29
|
+
id: "tpl-module-browser-title",
|
|
30
|
+
class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
31
|
+
}, he = ["aria-label"], x = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, S = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, C = { class: "tpl:px-4 tpl:pt-4 tpl:pb-3" }, w = { class: "tpl:relative" }, T = ["placeholder"], E = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, D = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
34
|
+
}, O = ["aria-pressed", "onClick"], k = { class: "tpl:flex tpl:items-center tpl:gap-2" }, A = { class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, j = { class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]" }, M = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, N = {
|
|
35
|
+
key: 0,
|
|
36
|
+
class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
|
|
37
|
+
}, P = ["aria-label", "onClick"], F = [
|
|
38
|
+
"aria-label",
|
|
39
|
+
"title",
|
|
40
|
+
"onClick"
|
|
41
|
+
], I = {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
|
|
44
|
+
}, L = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, R = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, ge = {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
|
|
47
|
+
}, _e = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, z = {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
|
|
50
|
+
}, ve = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, ye = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, be = { class: "tpl:flex tpl:items-center tpl:gap-2" }, xe = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Se = ["value"], Ce = { class: "tpl:flex tpl:gap-2" }, we = ["disabled"], B = /* @__PURE__ */ f({
|
|
51
|
+
__name: "ModuleBrowserModal",
|
|
52
|
+
props: { visible: { type: Boolean } },
|
|
53
|
+
emits: ["close", "insert"],
|
|
54
|
+
setup(r, { emit: f }) {
|
|
55
|
+
let B = r, V = f, Te = ie(() => import("./ModulePreviewCanvas-BcBJLnwL.js")), { t: H } = n(), U = p(t), W = p(e), G = h(""), K = h(null), q = h(null), J = h("end"), Y = s(() => {
|
|
56
|
+
let e = U.modules.value;
|
|
57
|
+
if (!G.value) return e;
|
|
58
|
+
let t = G.value.toLowerCase();
|
|
59
|
+
return e.filter((e) => e.name.toLowerCase().includes(t));
|
|
60
|
+
}), X = s(() => K.value ? U.modules.value.find((e) => e.id === K.value) ?? null : null), Ee = s(() => {
|
|
61
|
+
let e = [{
|
|
62
|
+
value: "beginning",
|
|
63
|
+
label: H.modules.insertAtBeginning
|
|
64
|
+
}], t = W.content.value.blocks;
|
|
65
|
+
for (let n = 0; n < t.length; n++) {
|
|
66
|
+
let r = t[n], i = r.type, a = H.blocks[i] ?? r.type;
|
|
67
|
+
e.push({
|
|
68
|
+
value: r.id,
|
|
69
|
+
label: H.modules.insertAfterBlock.replace("{block}", `${a} ${n + 1}`)
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return e.push({
|
|
73
|
+
value: "end",
|
|
74
|
+
label: H.modules.insertAtEnd
|
|
75
|
+
}), e;
|
|
76
|
+
}), De = s(() => {
|
|
77
|
+
if (J.value === "end") return;
|
|
78
|
+
if (J.value === "beginning") return 0;
|
|
79
|
+
let e = W.content.value.blocks.findIndex((e) => e.id === J.value);
|
|
80
|
+
if (e !== -1) return e + 1;
|
|
81
|
+
});
|
|
82
|
+
le(() => B.visible, (e) => {
|
|
83
|
+
if (e) {
|
|
84
|
+
G.value = "", K.value = null, q.value = null;
|
|
85
|
+
let e = W.state.selectedBlockId;
|
|
86
|
+
e ? J.value = W.content.value.blocks.findIndex((t) => t.id === e) === -1 ? "end" : e : J.value = "end";
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
function Oe(e) {
|
|
90
|
+
let t = [], n = /* @__PURE__ */ new Set();
|
|
91
|
+
for (let r of e.content) if (!n.has(r.type) && a[r.type] && (n.add(r.type), t.push({
|
|
92
|
+
type: r.type,
|
|
93
|
+
icon: a[r.type]
|
|
94
|
+
})), t.length >= 5) break;
|
|
95
|
+
return t;
|
|
96
|
+
}
|
|
97
|
+
function Z(e) {
|
|
98
|
+
let t = new Set(e.content.map((e) => e.type));
|
|
99
|
+
return Math.max(0, t.size - 5);
|
|
100
|
+
}
|
|
101
|
+
async function ke(e) {
|
|
102
|
+
try {
|
|
103
|
+
await U.deleteModule(e), K.value === e && (K.value = null);
|
|
104
|
+
} finally {
|
|
105
|
+
q.value = null;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
function Q() {
|
|
109
|
+
X.value && V("insert", X.value, De.value);
|
|
110
|
+
}
|
|
111
|
+
function $() {
|
|
112
|
+
V("close");
|
|
113
|
+
}
|
|
114
|
+
function Ae(e) {
|
|
115
|
+
e.key === "Escape" && $(), e.key === "Enter" && X.value && (e.preventDefault(), Q());
|
|
116
|
+
}
|
|
117
|
+
return (e, t) => (m(), c(ne, {
|
|
118
|
+
visible: r.visible,
|
|
119
|
+
onClose: $,
|
|
120
|
+
onKeydown: Ae
|
|
121
|
+
}, {
|
|
122
|
+
default: ue(() => [u("div", fe, [
|
|
123
|
+
u("div", pe, [u("h3", me, _(v(H).modules.browse), 1), u("button", {
|
|
124
|
+
"aria-label": v(H).modules.close,
|
|
125
|
+
class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:duration-100 tpl:text-[var(--tpl-text-dim)]",
|
|
126
|
+
onClick: $
|
|
127
|
+
}, [d(v(te), {
|
|
128
|
+
size: 16,
|
|
129
|
+
"stroke-width": 2
|
|
130
|
+
})], 8, he)]),
|
|
131
|
+
u("div", x, [u("div", S, [u("div", C, [u("div", w, [d(v(de), {
|
|
132
|
+
size: 14,
|
|
133
|
+
"stroke-width": 2,
|
|
134
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]"
|
|
135
|
+
}), y(u("input", {
|
|
136
|
+
"onUpdate:modelValue": t[0] ||= (e) => G.value = e,
|
|
137
|
+
type: "text",
|
|
138
|
+
placeholder: v(H).modules.search,
|
|
139
|
+
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
140
|
+
}, null, 8, T), [[ce, G.value]])])]), u("div", E, [Y.value.length > 0 ? (m(), l("div", D, [(m(!0), l(o, null, g(Y.value, (e) => (m(), l("button", {
|
|
141
|
+
key: e.id,
|
|
142
|
+
type: "button",
|
|
143
|
+
"aria-pressed": K.value === e.id,
|
|
144
|
+
class: "tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]",
|
|
145
|
+
style: ae({
|
|
146
|
+
borderColor: K.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
147
|
+
backgroundColor: K.value === e.id ? "var(--tpl-primary-light)" : "transparent"
|
|
148
|
+
}),
|
|
149
|
+
onClick: (t) => K.value = e.id
|
|
150
|
+
}, [u("div", k, [u("span", A, _(e.name), 1), u("span", j, _(v(H).modules.blockCount.replace("{count}", String(e.content.length))), 1)]), u("div", M, [
|
|
151
|
+
(m(!0), l(o, null, g(Oe(e), (e) => (m(), c(oe(e.icon), {
|
|
152
|
+
key: e.type,
|
|
153
|
+
size: 14,
|
|
154
|
+
"stroke-width": 1.5,
|
|
155
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
156
|
+
}))), 128)),
|
|
157
|
+
Z(e) > 0 ? (m(), l("span", N, " +" + _(Z(e)), 1)) : re("", !0),
|
|
158
|
+
q.value === e.id ? (m(), l("button", {
|
|
159
|
+
key: 1,
|
|
160
|
+
"aria-label": v(H).modules.deleteConfirm,
|
|
161
|
+
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 tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]",
|
|
162
|
+
style: { "background-color": "transparent" },
|
|
163
|
+
onClick: b((t) => ke(e.id), ["stop"])
|
|
164
|
+
}, _(v(H).modules.deleteConfirm), 9, P)) : (m(), l("button", {
|
|
165
|
+
key: 2,
|
|
166
|
+
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 tpl:text-[var(--tpl-text-dim)]",
|
|
167
|
+
"aria-label": v(H).modules.delete,
|
|
168
|
+
title: v(H).modules.delete,
|
|
169
|
+
onClick: b((t) => q.value = e.id, ["stop"])
|
|
170
|
+
}, [d(v(ee), {
|
|
171
|
+
size: 12,
|
|
172
|
+
"stroke-width": 1.5
|
|
173
|
+
})], 8, F))
|
|
174
|
+
])], 12, O))), 128))])) : (m(), l("div", I, [d(v(i), {
|
|
175
|
+
size: 32,
|
|
176
|
+
"stroke-width": 1,
|
|
177
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
178
|
+
}), u("p", L, _(G.value ? v(H).modules.noModules : v(H).modules.noModulesHint), 1)]))])]), u("div", R, [X.value ? (m(), l("div", ge, [u("div", _e, [d(v(Te), { blocks: X.value.content }, null, 8, ["blocks"])])])) : (m(), l("div", z, [d(v(i), {
|
|
179
|
+
size: 32,
|
|
180
|
+
"stroke-width": 1,
|
|
181
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
182
|
+
}), u("p", ve, _(v(H).modules.selectToPreview), 1)]))])]),
|
|
183
|
+
u("div", ye, [u("div", be, [u("label", xe, _(v(H).modules.insertPosition), 1), y(u("select", {
|
|
184
|
+
"onUpdate:modelValue": t[1] ||= (e) => J.value = e,
|
|
185
|
+
class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
186
|
+
}, [(m(!0), l(o, null, g(Ee.value, (e) => (m(), l("option", {
|
|
187
|
+
key: e.value,
|
|
188
|
+
value: e.value
|
|
189
|
+
}, _(e.label), 9, Se))), 128))], 512), [[se, J.value]])]), u("div", Ce, [u("button", {
|
|
190
|
+
type: "button",
|
|
191
|
+
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 tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]",
|
|
192
|
+
onClick: $
|
|
193
|
+
}, _(v(H).modules.close), 1), u("button", {
|
|
194
|
+
type: "button",
|
|
195
|
+
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 tpl:bg-[var(--tpl-primary)] tpl:text-[var(--tpl-bg)]",
|
|
196
|
+
disabled: !X.value,
|
|
197
|
+
onClick: Q
|
|
198
|
+
}, _(v(H).modules.insert), 9, we)])])
|
|
199
|
+
])]),
|
|
200
|
+
_: 1
|
|
201
|
+
}, 8, ["visible"]));
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
//#endregion
|
|
205
|
+
export { B as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { P as e, _ as t, a as n, f as r, g as i, h as a, i as o, m as s, n as c, p as l, r as u, u as d, v as f, y as p } from "./useEditorCore-Cc4RCwWq.js";
|
|
2
|
+
import { o as m } from "./keys-Dwa2PmdD.js";
|
|
3
|
+
import { Fragment as h, computed as g, createBlock as _, createElementBlock as v, createElementVNode as y, defineComponent as b, inject as x, normalizeStyle as S, openBlock as C, renderList as w, resolveComponent as T, resolveDynamicComponent as E, unref as D } from "vue";
|
|
4
|
+
//#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var O = { class: "tpl:w-full" }, k = { class: "tpl:flex tpl:gap-0" }, A = /* @__PURE__ */ b({
|
|
6
|
+
name: "PreviewSectionBlock",
|
|
7
|
+
__name: "PreviewSectionBlock",
|
|
8
|
+
props: {
|
|
9
|
+
block: {},
|
|
10
|
+
viewport: {}
|
|
11
|
+
},
|
|
12
|
+
setup(b) {
|
|
13
|
+
let A = {
|
|
14
|
+
title: d,
|
|
15
|
+
paragraph: s,
|
|
16
|
+
image: i,
|
|
17
|
+
video: c,
|
|
18
|
+
button: e,
|
|
19
|
+
divider: f,
|
|
20
|
+
social: n,
|
|
21
|
+
menu: a,
|
|
22
|
+
table: u,
|
|
23
|
+
spacer: o,
|
|
24
|
+
html: t,
|
|
25
|
+
custom: p
|
|
26
|
+
}, j = b, M = x(m, null), N = g(() => {
|
|
27
|
+
switch (j.block.columns) {
|
|
28
|
+
case "2": return ["50%", "50%"];
|
|
29
|
+
case "3": return [
|
|
30
|
+
"33.33%",
|
|
31
|
+
"33.33%",
|
|
32
|
+
"33.33%"
|
|
33
|
+
];
|
|
34
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
35
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
36
|
+
default: return ["100%"];
|
|
37
|
+
}
|
|
38
|
+
}), P = g(() => {
|
|
39
|
+
let e = N.value.length, t = [...j.block.children];
|
|
40
|
+
for (; t.length < e;) t.push([]);
|
|
41
|
+
return t.slice(0, e);
|
|
42
|
+
});
|
|
43
|
+
function F(e) {
|
|
44
|
+
return P.value[e] || [];
|
|
45
|
+
}
|
|
46
|
+
function I(e) {
|
|
47
|
+
return l(e, M, A);
|
|
48
|
+
}
|
|
49
|
+
return (e, t) => {
|
|
50
|
+
let n = T("PreviewSectionBlock", !0);
|
|
51
|
+
return C(), v("div", O, [y("div", k, [(C(!0), v(h, null, w(P.value, (e, t) => (C(), v("div", {
|
|
52
|
+
key: t,
|
|
53
|
+
style: S({ width: N.value[t] })
|
|
54
|
+
}, [(C(!0), v(h, null, w(F(t), (e) => (C(), v("div", {
|
|
55
|
+
key: e.id,
|
|
56
|
+
style: S(D(r)(e))
|
|
57
|
+
}, [e.type === "section" ? (C(), _(n, {
|
|
58
|
+
key: 0,
|
|
59
|
+
block: e,
|
|
60
|
+
viewport: "desktop"
|
|
61
|
+
}, null, 8, ["block"])) : (C(), _(E(I(e)), {
|
|
62
|
+
key: 1,
|
|
63
|
+
block: e,
|
|
64
|
+
viewport: "desktop"
|
|
65
|
+
}, null, 8, ["block"]))], 4))), 128))], 4))), 128))])]);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
}), j = {
|
|
69
|
+
class: "tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg",
|
|
70
|
+
style: {
|
|
71
|
+
"background-color": "var(--tpl-canvas-bg)",
|
|
72
|
+
"box-shadow": "var(--tpl-shadow-sm)"
|
|
73
|
+
}
|
|
74
|
+
}, M = /* @__PURE__ */ b({
|
|
75
|
+
__name: "ModulePreviewCanvas",
|
|
76
|
+
props: { blocks: {} },
|
|
77
|
+
setup(g) {
|
|
78
|
+
let y = x(m), b = {
|
|
79
|
+
section: A,
|
|
80
|
+
title: d,
|
|
81
|
+
paragraph: s,
|
|
82
|
+
image: i,
|
|
83
|
+
video: c,
|
|
84
|
+
button: e,
|
|
85
|
+
divider: f,
|
|
86
|
+
social: n,
|
|
87
|
+
menu: a,
|
|
88
|
+
table: u,
|
|
89
|
+
spacer: o,
|
|
90
|
+
html: t,
|
|
91
|
+
custom: p
|
|
92
|
+
};
|
|
93
|
+
function T(e) {
|
|
94
|
+
return l(e, y, b);
|
|
95
|
+
}
|
|
96
|
+
return (e, t) => (C(), v("div", j, [(C(!0), v(h, null, w(g.blocks, (e) => (C(), v("div", {
|
|
97
|
+
key: e.id,
|
|
98
|
+
style: S(D(r)(e))
|
|
99
|
+
}, [(C(), _(E(T(e)), {
|
|
100
|
+
block: e,
|
|
101
|
+
viewport: "desktop"
|
|
102
|
+
}, null, 8, ["block"]))], 4))), 128))]));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
export { M as default };
|