@aswin.dev/editor 0.6.3 → 0.7.1
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/README.md +3 -3
- package/dist/AccessibilityPanel-COL6Wm7p.js +108 -0
- package/dist/AiChatSidebar-DWGPVtvC.js +229 -0
- package/dist/AiFeatureMenu-duUFSfDf.js +63 -0
- package/dist/BlockA11yBadge-Qs6HtXid.js +34 -0
- package/dist/CloudEditor-CFldoCOb.js +1207 -0
- package/dist/CollaboratorBar-Bw-lbt61.js +95 -0
- package/dist/CommentsSidebar-BaD5F53-.js +436 -0
- package/dist/CountdownBlock-DaYGxKqo.js +92 -0
- package/dist/CountdownToolbar-Dg4F8MTk.js +210 -0
- package/dist/DesignReferenceSidebar-BSH7uNP_.js +276 -0
- package/dist/LoadingTrack-Ba2pfF57.js +10 -0
- package/dist/ModuleBrowserModal-6phxZSKI.js +206 -0
- package/dist/ModulePreviewCanvas-BW8L3eQX.js +108 -0
- package/dist/NumberWithSuffix-BpUzQOJt.js +422 -0
- package/dist/ParagraphEditor-DNSzAB-I.js +695 -0
- package/dist/RichTextEditorContent-CrqPQdnk.js +137 -0
- package/dist/SaveModuleDialog-zMQTpez7.js +123 -0
- package/dist/SnapshotHistory-Do-A5rYU.js +122 -0
- package/dist/TemplateScoringPanel-CS7o62zS.js +256 -0
- package/dist/TestEmailModal-DGj_9V1u.js +94 -0
- package/dist/TitleEditor-C7IDnAoS.js +172 -0
- package/dist/TplModal-BAsVzcTb.js +44 -0
- package/dist/_plugin-vue_export-helper-BVAJ4lgT.js +8 -0
- package/dist/accessibility-BU09xZrQ.js +27 -0
- package/dist/blockTypeIcons-C6LDKvmd.js +140 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/check-DJrpDKO_.js +7 -0
- package/dist/chevron-down-C5oBUhT8.js +7 -0
- package/dist/chevron-right-BqCptpdp.js +10 -0
- package/dist/circle-alert-ZQQc98HC.js +25 -0
- package/dist/clock-ik2pRJKG.js +12 -0
- package/dist/cloud-6ZmAvF0j.js +1791 -0
- package/dist/createLucideIcon-ClREiSx3.js +43 -0
- package/dist/de-DWcgp-7T.js +729 -0
- package/dist/de-GOtR9DwW.js +207 -0
- package/dist/dist-BUzw1buG.js +35 -0
- package/dist/dist-BZyY-SS4.js +74 -0
- package/dist/dist-BadNx4qo.js +5 -0
- package/dist/dist-BesOh2mk.js +35 -0
- package/dist/dist-Bz3M4RXG.js +2082 -0
- package/dist/dist-C04s_fLA.js +563 -0
- package/dist/dist-C3T2AKtB.js +776 -0
- package/dist/dist-C9ckKEZL.js +519 -0
- package/dist/dist-CBItRG-Z.js +47 -0
- package/dist/dist-COSzWQUs.js +5 -0
- package/dist/dist-CivF9P8b.js +382 -0
- package/dist/dist-DXa1uAMh.js +10658 -0
- package/dist/dist-DtiDUrX-.js +189 -0
- package/dist/dist-Dzt5foyL.js +61 -0
- package/dist/emojiData-DrBuvEoP.js +17 -0
- package/dist/en-Cxd4fhNm.js +729 -0
- package/dist/en-dFFQVzNn.js +207 -0
- package/dist/extensions-D__hOlV1.js +799 -0
- package/dist/formatRelativeTime-BhhO8yCl.js +12 -0
- package/dist/image-up-DT7gcJLN.js +23 -0
- package/dist/index.d.ts +352 -0
- package/dist/info-BSPGcsSM.js +19 -0
- package/dist/keys-CvX8D-8C.js +10 -0
- package/dist/liquid.browser-BvCyLQII.js +3277 -0
- package/dist/loader-circle-Balo8p3d.js +7 -0
- package/dist/message-circle-B39qAHxs.js +7 -0
- package/dist/pencil-BZJPNYWR.js +10 -0
- package/dist/readableTextColor-DVuzNX1y.js +30 -0
- package/dist/refresh-cw-DwDqGUM0.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-CzfFJO1o.js +25 -0
- package/dist/send-D2eSo4GH.js +10 -0
- package/dist/shield-check-jkpgcC0-.js +10 -0
- package/dist/sparkles-Chm5CZfb.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-34eUKPOZ.js +55 -0
- package/dist/styles-B4tjX5SP.js +5224 -0
- package/dist/templatical-editor.js +312 -0
- package/dist/text-align-start-CzBnJsW8.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-CtK2apEH.js +25 -0
- package/dist/triangle-alert-KpDVNbpn.js +17 -0
- package/dist/useCloudI18n-DOKSZql1.js +23 -0
- package/dist/useEditorCore-wslttMH-.js +9517 -0
- package/dist/useI18n-C2xQZ6K9.js +17 -0
- package/dist/useMergeTag-DX0XG5V9.js +34 -0
- package/dist/vue.runtime.esm-bundler-CjauPXjj.js +5775 -0
- package/dist/x-BkaOMosX.js +10 -0
- package/package.json +10 -10
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { C as e, F as t, Ft as n, N as r, R as i, S as a, U as ee, V as o, W as s, _ as te, c as ne, d as c, et as l, f as u, g as d, h as f, jt as re, m as p, s as ie, st as m, v as h, x as g } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import "./useEditorCore-wslttMH-.js";
|
|
3
|
+
import { A as _, T as ae, m as oe } from "./keys-CvX8D-8C.js";
|
|
4
|
+
import { t as se } from "./useI18n-C2xQZ6K9.js";
|
|
5
|
+
import { t as v } from "./createLucideIcon-ClREiSx3.js";
|
|
6
|
+
import { n as y, t as b } from "./blockTypeIcons-C6LDKvmd.js";
|
|
7
|
+
import { t as ce } from "./trash-2-CtK2apEH.js";
|
|
8
|
+
import { t as le } from "./x-BkaOMosX.js";
|
|
9
|
+
import { n as ue } from "./useCloudI18n-DOKSZql1.js";
|
|
10
|
+
import { t as de } from "./TplModal-BAsVzcTb.js";
|
|
11
|
+
var fe = v("search", [["path", {
|
|
12
|
+
d: "m21 21-4.34-4.34",
|
|
13
|
+
key: "14j7rj"
|
|
14
|
+
}], ["circle", {
|
|
15
|
+
cx: "11",
|
|
16
|
+
cy: "11",
|
|
17
|
+
r: "8",
|
|
18
|
+
key: "4ej97u"
|
|
19
|
+
}]]), pe = {
|
|
20
|
+
role: "dialog",
|
|
21
|
+
"aria-modal": "true",
|
|
22
|
+
"aria-labelledby": "tpl-module-browser-title",
|
|
23
|
+
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)]",
|
|
24
|
+
style: {
|
|
25
|
+
"background-color": "var(--tpl-bg-elevated)",
|
|
26
|
+
"box-shadow": "var(--tpl-shadow-xl)",
|
|
27
|
+
"max-height": "90vh"
|
|
28
|
+
}
|
|
29
|
+
}, me = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, he = {
|
|
30
|
+
id: "tpl-module-browser-title",
|
|
31
|
+
class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
32
|
+
}, x = ["aria-label"], S = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, C = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, w = { class: "tpl:px-4 tpl:pt-4 tpl:pb-3" }, T = { class: "tpl:relative" }, E = ["placeholder"], D = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, O = {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "tpl:flex tpl:flex-col tpl:gap-1"
|
|
35
|
+
}, k = ["aria-pressed", "onClick"], A = { class: "tpl:flex tpl:items-center tpl:gap-2" }, j = { class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, M = { 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)]" }, N = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, P = {
|
|
36
|
+
key: 0,
|
|
37
|
+
class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
|
|
38
|
+
}, F = ["aria-label", "onClick"], I = [
|
|
39
|
+
"aria-label",
|
|
40
|
+
"title",
|
|
41
|
+
"onClick"
|
|
42
|
+
], L = {
|
|
43
|
+
key: 1,
|
|
44
|
+
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
|
|
45
|
+
}, R = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, ge = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, _e = {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
|
|
48
|
+
}, ve = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, ye = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
|
|
51
|
+
}, be = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, xe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, Se = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Ce = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, we = ["value"], Te = { class: "tpl:flex tpl:gap-2" }, Ee = ["disabled"], z = /* @__PURE__ */ e({
|
|
52
|
+
__name: "ModuleBrowserModal",
|
|
53
|
+
props: { visible: { type: Boolean } },
|
|
54
|
+
emits: ["close", "insert"],
|
|
55
|
+
setup(e, { emit: v }) {
|
|
56
|
+
let z = e, B = v, De = a(() => import("./ModulePreviewCanvas-BW8L3eQX.js")), { t: Oe } = se(), { t: V } = ue(), H = _(ae, "ModuleBrowserModal"), U = _(oe, "ModuleBrowserModal"), W = l(""), G = l(null), K = l(null), q = l("end"), J = p(() => {
|
|
57
|
+
let e = H.modules.value;
|
|
58
|
+
if (!W.value) return e;
|
|
59
|
+
let t = W.value.toLowerCase();
|
|
60
|
+
return e.filter((e) => e.name.toLowerCase().includes(t));
|
|
61
|
+
}), Y = p(() => G.value ? H.modules.value.find((e) => e.id === G.value) ?? null : null), X = p(() => {
|
|
62
|
+
let e = [{
|
|
63
|
+
value: "beginning",
|
|
64
|
+
label: V.modules.insertAtBeginning
|
|
65
|
+
}], t = U.content.value.blocks;
|
|
66
|
+
for (let n = 0; n < t.length; n++) {
|
|
67
|
+
let r = t[n], i = r.type, a = Oe.blocks[i] ?? r.type;
|
|
68
|
+
e.push({
|
|
69
|
+
value: r.id,
|
|
70
|
+
label: V.modules.insertAfterBlock.replace("{block}", `${a} ${n + 1}`)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return e.push({
|
|
74
|
+
value: "end",
|
|
75
|
+
label: V.modules.insertAtEnd
|
|
76
|
+
}), e;
|
|
77
|
+
}), ke = p(() => {
|
|
78
|
+
if (q.value === "end") return;
|
|
79
|
+
if (q.value === "beginning") return 0;
|
|
80
|
+
let e = U.content.value.blocks.findIndex((e) => e.id === q.value);
|
|
81
|
+
if (e !== -1) return e + 1;
|
|
82
|
+
});
|
|
83
|
+
o(() => z.visible, (e) => {
|
|
84
|
+
if (e) {
|
|
85
|
+
W.value = "", G.value = null, K.value = null;
|
|
86
|
+
let e = U.state.selectedBlockId;
|
|
87
|
+
e ? q.value = U.content.value.blocks.findIndex((t) => t.id === e) === -1 ? "end" : e : q.value = "end";
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
function Ae(e) {
|
|
91
|
+
let t = [], n = /* @__PURE__ */ new Set();
|
|
92
|
+
for (let r of e.content) if (!n.has(r.type) && b[r.type] && (n.add(r.type), t.push({
|
|
93
|
+
type: r.type,
|
|
94
|
+
icon: b[r.type]
|
|
95
|
+
})), t.length >= 5) break;
|
|
96
|
+
return t;
|
|
97
|
+
}
|
|
98
|
+
function Z(e) {
|
|
99
|
+
let t = new Set(e.content.map((e) => e.type));
|
|
100
|
+
return Math.max(0, t.size - 5);
|
|
101
|
+
}
|
|
102
|
+
async function je(e) {
|
|
103
|
+
try {
|
|
104
|
+
await H.deleteModule(e), G.value === e && (G.value = null);
|
|
105
|
+
} finally {
|
|
106
|
+
K.value = null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function Q() {
|
|
110
|
+
Y.value && B("insert", Y.value, ke.value);
|
|
111
|
+
}
|
|
112
|
+
function $() {
|
|
113
|
+
B("close");
|
|
114
|
+
}
|
|
115
|
+
function Me(e) {
|
|
116
|
+
e.key === "Escape" && $(), e.key === "Enter" && Y.value && (e.preventDefault(), Q());
|
|
117
|
+
}
|
|
118
|
+
return (a, o) => (r(), d(de, {
|
|
119
|
+
visible: e.visible,
|
|
120
|
+
onClose: $,
|
|
121
|
+
onKeydown: Me
|
|
122
|
+
}, {
|
|
123
|
+
default: ee(() => [f("div", pe, [
|
|
124
|
+
f("div", me, [f("h3", he, n(m(V).modules.browse), 1), f("button", {
|
|
125
|
+
"aria-label": m(V).modules.close,
|
|
126
|
+
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)]",
|
|
127
|
+
onClick: $
|
|
128
|
+
}, [g(m(le), {
|
|
129
|
+
size: 16,
|
|
130
|
+
"stroke-width": 2
|
|
131
|
+
})], 8, x)]),
|
|
132
|
+
f("div", S, [f("div", C, [f("div", w, [f("div", T, [g(m(fe), {
|
|
133
|
+
size: 14,
|
|
134
|
+
"stroke-width": 2,
|
|
135
|
+
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)]"
|
|
136
|
+
}), s(f("input", {
|
|
137
|
+
"onUpdate:modelValue": o[0] ||= (e) => W.value = e,
|
|
138
|
+
type: "text",
|
|
139
|
+
placeholder: m(V).modules.search,
|
|
140
|
+
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)]"
|
|
141
|
+
}, null, 8, E), [[ne, W.value]])])]), f("div", D, [J.value.length > 0 ? (r(), h("div", O, [(r(!0), h(u, null, t(J.value, (e) => (r(), h("button", {
|
|
142
|
+
key: e.id,
|
|
143
|
+
type: "button",
|
|
144
|
+
"aria-pressed": G.value === e.id,
|
|
145
|
+
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]",
|
|
146
|
+
style: re({
|
|
147
|
+
borderColor: G.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
148
|
+
backgroundColor: G.value === e.id ? "var(--tpl-primary-light)" : "transparent"
|
|
149
|
+
}),
|
|
150
|
+
onClick: (t) => G.value = e.id
|
|
151
|
+
}, [f("div", A, [f("span", j, n(e.name), 1), f("span", M, n(m(V).modules.blockCount.replace("{count}", String(e.content.length))), 1)]), f("div", N, [
|
|
152
|
+
(r(!0), h(u, null, t(Ae(e), (e) => (r(), d(i(e.icon), {
|
|
153
|
+
key: e.type,
|
|
154
|
+
size: 14,
|
|
155
|
+
"stroke-width": 1.5,
|
|
156
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
157
|
+
}))), 128)),
|
|
158
|
+
Z(e) > 0 ? (r(), h("span", P, " +" + n(Z(e)), 1)) : te("", !0),
|
|
159
|
+
K.value === e.id ? (r(), h("button", {
|
|
160
|
+
key: 1,
|
|
161
|
+
"aria-label": m(V).modules.deleteConfirm,
|
|
162
|
+
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)]",
|
|
163
|
+
style: { "background-color": "transparent" },
|
|
164
|
+
onClick: c((t) => je(e.id), ["stop"])
|
|
165
|
+
}, n(m(V).modules.deleteConfirm), 9, F)) : (r(), h("button", {
|
|
166
|
+
key: 2,
|
|
167
|
+
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)]",
|
|
168
|
+
"aria-label": m(V).modules.delete,
|
|
169
|
+
title: m(V).modules.delete,
|
|
170
|
+
onClick: c((t) => K.value = e.id, ["stop"])
|
|
171
|
+
}, [g(m(ce), {
|
|
172
|
+
size: 12,
|
|
173
|
+
"stroke-width": 1.5
|
|
174
|
+
})], 8, I))
|
|
175
|
+
])], 12, k))), 128))])) : (r(), h("div", L, [g(m(y), {
|
|
176
|
+
size: 32,
|
|
177
|
+
"stroke-width": 1,
|
|
178
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
179
|
+
}), f("p", R, n(W.value ? m(V).modules.noModules : m(V).modules.noModulesHint), 1)]))])]), f("div", ge, [Y.value ? (r(), h("div", _e, [f("div", ve, [g(m(De), { blocks: Y.value.content }, null, 8, ["blocks"])])])) : (r(), h("div", ye, [g(m(y), {
|
|
180
|
+
size: 32,
|
|
181
|
+
"stroke-width": 1,
|
|
182
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
183
|
+
}), f("p", be, n(m(V).modules.selectToPreview), 1)]))])]),
|
|
184
|
+
f("div", xe, [f("div", Se, [f("label", Ce, n(m(V).modules.insertPosition), 1), s(f("select", {
|
|
185
|
+
"onUpdate:modelValue": o[1] ||= (e) => q.value = e,
|
|
186
|
+
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)]"
|
|
187
|
+
}, [(r(!0), h(u, null, t(X.value, (e) => (r(), h("option", {
|
|
188
|
+
key: e.value,
|
|
189
|
+
value: e.value
|
|
190
|
+
}, n(e.label), 9, we))), 128))], 512), [[ie, q.value]])]), f("div", Te, [f("button", {
|
|
191
|
+
type: "button",
|
|
192
|
+
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)]",
|
|
193
|
+
onClick: $
|
|
194
|
+
}, n(m(V).modules.close), 1), f("button", {
|
|
195
|
+
type: "button",
|
|
196
|
+
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)]",
|
|
197
|
+
disabled: !Y.value,
|
|
198
|
+
onClick: Q
|
|
199
|
+
}, n(m(V).modules.insert), 9, Ee)])])
|
|
200
|
+
])]),
|
|
201
|
+
_: 1
|
|
202
|
+
}, 8, ["visible"]));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
//#endregion
|
|
206
|
+
export { z as default };
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { C as e, D as t, F as n, L as r, N as i, R as a, f as o, g as s, h as c, jt as l, m as u, st as d, v as f } from "./vue.runtime.esm-bundler-CjauPXjj.js";
|
|
2
|
+
import { P as p, _ as m, a as h, b as g, f as _, g as v, h as y, i as b, m as x, n as S, p as C, r as w, u as T, v as E, y as D } from "./useEditorCore-wslttMH-.js";
|
|
3
|
+
import { s as O } from "./keys-CvX8D-8C.js";
|
|
4
|
+
//#region src/components/blocks/PreviewSectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var k = { class: "tpl:w-full" }, A = { class: "tpl:flex tpl:gap-0" }, j = /* @__PURE__ */ e({
|
|
6
|
+
name: "PreviewSectionBlock",
|
|
7
|
+
__name: "PreviewSectionBlock",
|
|
8
|
+
props: {
|
|
9
|
+
block: {},
|
|
10
|
+
viewport: {}
|
|
11
|
+
},
|
|
12
|
+
setup(e) {
|
|
13
|
+
let j = {
|
|
14
|
+
title: T,
|
|
15
|
+
paragraph: x,
|
|
16
|
+
image: m,
|
|
17
|
+
video: S,
|
|
18
|
+
button: p,
|
|
19
|
+
input: v,
|
|
20
|
+
divider: D,
|
|
21
|
+
social: h,
|
|
22
|
+
menu: y,
|
|
23
|
+
table: w,
|
|
24
|
+
spacer: b,
|
|
25
|
+
html: E,
|
|
26
|
+
custom: g
|
|
27
|
+
}, M = e, N = t(O, null), P = u(() => {
|
|
28
|
+
switch (M.block.columns) {
|
|
29
|
+
case "2": return ["50%", "50%"];
|
|
30
|
+
case "3": return [
|
|
31
|
+
"33.33%",
|
|
32
|
+
"33.33%",
|
|
33
|
+
"33.33%"
|
|
34
|
+
];
|
|
35
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
36
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
37
|
+
default: return ["100%"];
|
|
38
|
+
}
|
|
39
|
+
}), F = u(() => {
|
|
40
|
+
let e = P.value.length, t = [...M.block.children];
|
|
41
|
+
for (; t.length < e;) t.push([]);
|
|
42
|
+
return t.slice(0, e);
|
|
43
|
+
});
|
|
44
|
+
function I(e) {
|
|
45
|
+
return F.value[e] || [];
|
|
46
|
+
}
|
|
47
|
+
function L(e) {
|
|
48
|
+
return C(e, N, j);
|
|
49
|
+
}
|
|
50
|
+
return (e, t) => {
|
|
51
|
+
let u = r("PreviewSectionBlock", !0);
|
|
52
|
+
return i(), f("div", k, [c("div", A, [(i(!0), f(o, null, n(F.value, (e, t) => (i(), f("div", {
|
|
53
|
+
key: t,
|
|
54
|
+
style: l({ width: P.value[t] })
|
|
55
|
+
}, [(i(!0), f(o, null, n(I(t), (e) => (i(), f("div", {
|
|
56
|
+
key: e.id,
|
|
57
|
+
style: l(d(_)(e))
|
|
58
|
+
}, [e.type === "section" ? (i(), s(u, {
|
|
59
|
+
key: 0,
|
|
60
|
+
block: e,
|
|
61
|
+
viewport: "desktop"
|
|
62
|
+
}, null, 8, ["block"])) : (i(), s(a(L(e)), {
|
|
63
|
+
key: 1,
|
|
64
|
+
block: e,
|
|
65
|
+
viewport: "desktop"
|
|
66
|
+
}, null, 8, ["block"]))], 4))), 128))], 4))), 128))])]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}), M = {
|
|
70
|
+
class: "tpl:pointer-events-none tpl:mx-auto tpl:w-[600px] tpl:select-none tpl:rounded-lg",
|
|
71
|
+
style: {
|
|
72
|
+
"background-color": "var(--tpl-canvas-bg)",
|
|
73
|
+
"box-shadow": "var(--tpl-shadow-sm)"
|
|
74
|
+
}
|
|
75
|
+
}, N = /* @__PURE__ */ e({
|
|
76
|
+
__name: "ModulePreviewCanvas",
|
|
77
|
+
props: { blocks: {} },
|
|
78
|
+
setup(e) {
|
|
79
|
+
let r = t(O), c = {
|
|
80
|
+
section: j,
|
|
81
|
+
title: T,
|
|
82
|
+
paragraph: x,
|
|
83
|
+
image: m,
|
|
84
|
+
video: S,
|
|
85
|
+
button: p,
|
|
86
|
+
input: v,
|
|
87
|
+
divider: D,
|
|
88
|
+
social: h,
|
|
89
|
+
menu: y,
|
|
90
|
+
table: w,
|
|
91
|
+
spacer: b,
|
|
92
|
+
html: E,
|
|
93
|
+
custom: g
|
|
94
|
+
};
|
|
95
|
+
function u(e) {
|
|
96
|
+
return C(e, r, c);
|
|
97
|
+
}
|
|
98
|
+
return (t, r) => (i(), f("div", M, [(i(!0), f(o, null, n(e.blocks, (e) => (i(), f("div", {
|
|
99
|
+
key: e.id,
|
|
100
|
+
style: l(d(_)(e))
|
|
101
|
+
}, [(i(), s(a(u(e)), {
|
|
102
|
+
block: e,
|
|
103
|
+
viewport: "desktop"
|
|
104
|
+
}, null, 8, ["block"]))], 4))), 128))]));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
//#endregion
|
|
108
|
+
export { N as default };
|