@aswin.dev/editor 0.6.3 → 0.7.0
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/AccessibilityPanel-CvQGLdu6.js +108 -0
- package/dist/AiChatSidebar-B3SJIKG_.js +229 -0
- package/dist/AiFeatureMenu-BLLKoOos.js +63 -0
- package/dist/BlockA11yBadge-CXDLqkcJ.js +34 -0
- package/dist/CloudEditor-BCz1ZTYC.js +1172 -0
- package/dist/CollaboratorBar-DuPYW5iF.js +95 -0
- package/dist/CommentsSidebar-B1pvJdqF.js +441 -0
- package/dist/CountdownBlock-BNSj1jvJ.js +92 -0
- package/dist/CountdownToolbar-ClJr2GzL.js +210 -0
- package/dist/DesignReferenceSidebar-B8V_F2yF.js +276 -0
- package/dist/LoadingTrack-B0CWFHXQ.js +10 -0
- package/dist/ModuleBrowserModal-DrUFMTDx.js +206 -0
- package/dist/ModulePreviewCanvas-CHdOwV_4.js +106 -0
- package/dist/NumberWithSuffix-DkXUez9t.js +422 -0
- package/dist/ParagraphEditor-D75wl3BX.js +695 -0
- package/dist/RichTextEditorContent-DYkIauIk.js +137 -0
- package/dist/SaveModuleDialog-FZ9lxY7_.js +123 -0
- package/dist/SnapshotHistory-BR3eV120.js +127 -0
- package/dist/TemplateScoringPanel-4GTNHej5.js +256 -0
- package/dist/TestEmailModal--ue5w9fT.js +94 -0
- package/dist/TitleEditor-fStSADI-.js +172 -0
- package/dist/TplModal-BwSfxIHf.js +44 -0
- package/dist/_plugin-vue_export-helper-B0hnzhyu.js +8 -0
- package/dist/accessibility-e8JYu_zd.js +27 -0
- package/dist/blockTypeIcons-BcTrDjmH.js +126 -0
- package/dist/bundle-stats.json +10 -0
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js +97 -0
- package/dist/cdn/chunks/AccessibilityPanel-B6DOjojm.js.map +1 -0
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js +59 -0
- package/dist/cdn/chunks/AiFeatureMenu-qEdB2fZJ.js.map +1 -0
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js +33 -0
- package/dist/cdn/chunks/BlockA11yBadge-DcEZftf6.js.map +1 -0
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js +1143 -0
- package/dist/cdn/chunks/CloudEditor-D2GsEC_n.js.map +1 -0
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js +51 -0
- package/dist/cdn/chunks/CollaboratorBar--nO7TX6b.js.map +1 -0
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js +93 -0
- package/dist/cdn/chunks/CountdownBlock-5YdT1uUu.js.map +1 -0
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +212 -0
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js.map +1 -0
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js +195 -0
- package/dist/cdn/chunks/ModuleBrowserModal-DxoPp81s.js.map +1 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js +107 -0
- package/dist/cdn/chunks/ModulePreviewCanvas-CoLdb4ar.js.map +1 -0
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js +423 -0
- package/dist/cdn/chunks/NumberWithSuffix-CE3NrZhH.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js +544 -0
- package/dist/cdn/chunks/ParagraphEditor-B6Ygu-Mq.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js +106 -0
- package/dist/cdn/chunks/RichTextEditorContent-DL_y2SrR.js.map +1 -0
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js +119 -0
- package/dist/cdn/chunks/SaveModuleDialog-B0TnO_o9.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js +171 -0
- package/dist/cdn/chunks/TitleEditor-BHpfxvwy.js.map +1 -0
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js +22 -0
- package/dist/cdn/chunks/blockTypeIcons-BzzY9_kA.js.map +1 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js +89 -0
- package/dist/cdn/chunks/de-Ce-LbJ2J.js.map +1 -0
- package/dist/cdn/chunks/de-D8CnZxV9.js +523 -0
- package/dist/cdn/chunks/de-D8CnZxV9.js.map +1 -0
- package/dist/cdn/chunks/de-RQrZR56a.js +209 -0
- package/dist/cdn/chunks/de-RQrZR56a.js.map +1 -0
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +11572 -0
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +1 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js +19 -0
- package/dist/cdn/chunks/emojiData-EMFlj6FJ.js.map +1 -0
- package/dist/cdn/chunks/en-8FHaQv4V.js +523 -0
- package/dist/cdn/chunks/en-8FHaQv4V.js.map +1 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js +209 -0
- package/dist/cdn/chunks/en-Bl1ecfRF.js.map +1 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js +89 -0
- package/dist/cdn/chunks/en-DiCWK5fG.js.map +1 -0
- package/dist/cdn/chunks/extensions-DIxF31tA.js +598 -0
- package/dist/cdn/chunks/extensions-DIxF31tA.js.map +1 -0
- package/dist/cdn/chunks/features-DEMb13KS.js +6814 -0
- package/dist/cdn/chunks/features-DEMb13KS.js.map +1 -0
- package/dist/cdn/chunks/icons-CsLTcirh.js +700 -0
- package/dist/cdn/chunks/icons-CsLTcirh.js.map +1 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js +3279 -0
- package/dist/cdn/chunks/liquid.browser-lQbkge2E.js.map +1 -0
- package/dist/cdn/chunks/media-library-CVaNvhpM.js +6014 -0
- package/dist/cdn/chunks/media-library-CVaNvhpM.js.map +1 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js +2508 -0
- package/dist/cdn/chunks/pusher-CDbNlZBE.js.map +1 -0
- package/dist/cdn/chunks/quality-BaBfc54_.js +1456 -0
- package/dist/cdn/chunks/quality-BaBfc54_.js.map +1 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js +32 -0
- package/dist/cdn/chunks/readableTextColor-DhoK4XiZ.js.map +1 -0
- package/dist/cdn/chunks/renderer-CUxvx7ro.js +548 -0
- package/dist/cdn/chunks/renderer-CUxvx7ro.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +20 -0
- package/dist/cdn/chunks/src-CRaqN-p8.js +497 -0
- package/dist/cdn/chunks/src-CRaqN-p8.js.map +1 -0
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js +57 -0
- package/dist/cdn/chunks/styleConstants-DP1VOca8.js.map +1 -0
- package/dist/cdn/chunks/styles-BHJULjNR.js +2947 -0
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +1 -0
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js +14654 -0
- package/dist/cdn/chunks/tiptap-ZhwKyFp7.js.map +1 -0
- package/dist/cdn/editor.css +2 -0
- package/dist/cdn/editor.js +250 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-Da05j8yl.js +7 -0
- package/dist/chevron-down-R2uY34iD.js +7 -0
- package/dist/circle-alert-DZuGWPX-.js +25 -0
- package/dist/clock-CRp2sIub.js +12 -0
- package/dist/cloud-DEk_b4CR.js +1733 -0
- package/dist/createLucideIcon-C3pa2siy.js +43 -0
- package/dist/de-Brqvgr43.js +521 -0
- package/dist/de-DCaaCE5s.js +207 -0
- package/dist/dist-B1IR0bpH.js +326 -0
- package/dist/dist-BFawx6IS.js +519 -0
- package/dist/dist-BaQIYPsn.js +35 -0
- package/dist/dist-Cp0zXPAD.js +189 -0
- package/dist/dist-D6uC2xhi.js +5 -0
- package/dist/dist-D90y8dvT.js +2082 -0
- package/dist/dist-DDJIWTRY.js +776 -0
- package/dist/dist-DJmnUmW9.js +362 -0
- package/dist/dist-DjviJBCi.js +74 -0
- package/dist/dist-KoBJjK1G.js +61 -0
- package/dist/dist-aRzjfSRN.js +35 -0
- package/dist/dist-iLBdeBDR.js +10658 -0
- package/dist/dist-us-RpCWN.js +47 -0
- package/dist/dist-wzMIGj-D.js +5 -0
- package/dist/emojiData-PQyVa4bU.js +17 -0
- package/dist/en-DXCyK4-X.js +207 -0
- package/dist/en-WDVp87TE.js +521 -0
- package/dist/extensions-CUcl9Ok4.js +799 -0
- package/dist/formatRelativeTime-BOEf47hq.js +12 -0
- package/dist/image-up-MBZKKg9p.js +23 -0
- package/dist/index.d.ts +275 -0
- package/dist/info-CJEC7piy.js +19 -0
- package/dist/keys-ciNfSSGj.js +10 -0
- package/dist/liquid.browser-CdMv1BTn.js +3277 -0
- package/dist/loader-circle-DsY5Yg33.js +7 -0
- package/dist/message-circle-yElBbR2C.js +7 -0
- package/dist/readableTextColor-CY3SiRnt.js +30 -0
- package/dist/refresh-cw-CE_AGtn8.js +29 -0
- package/dist/rolldown-runtime-BZGGJVDF.js +20 -0
- package/dist/scan-line-D0vcUekt.js +25 -0
- package/dist/send-DH4oDQqC.js +10 -0
- package/dist/shield-check-CfJgs2Hd.js +10 -0
- package/dist/sparkles-CvRXGqFs.js +23 -0
- package/dist/style.css +2 -0
- package/dist/styleConstants-fWzlIIwN.js +55 -0
- package/dist/styles-DEXEkBvg.js +3176 -0
- package/dist/templatical-editor.js +249 -0
- package/dist/text-align-start-BT9VUDxK.js +43 -0
- package/dist/timeouts-BSGxjuUF.js +4 -0
- package/dist/trash-2-DbP2Y6t2.js +25 -0
- package/dist/triangle-alert-aOXceTSe.js +17 -0
- package/dist/useCloudI18n-BuIwR6OE.js +23 -0
- package/dist/useEditorCore-C6ost42Q.js +9342 -0
- package/dist/useI18n-lb2DHDiu.js +17 -0
- package/dist/useMergeTag-CBwKnnNB.js +34 -0
- package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +5775 -0
- package/dist/x-u2oVmjN_.js +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { H as e, L as t, M as n, Mt as r, Ot as i, P as a, Q as o, S as s, V as ee, _ as c, b as l, d as u, g as te, h as d, it as f, m as p, o as ne, p as m, s as re, u as h, x as ie, z as ae } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
2
|
+
import "./useEditorCore-C6ost42Q.js";
|
|
3
|
+
import { C as oe, O as g, m as se } from "./keys-ciNfSSGj.js";
|
|
4
|
+
import { t as ce } from "./useI18n-lb2DHDiu.js";
|
|
5
|
+
import { t as _ } from "./createLucideIcon-C3pa2siy.js";
|
|
6
|
+
import { n as v, t as y } from "./blockTypeIcons-BcTrDjmH.js";
|
|
7
|
+
import { t as le } from "./trash-2-DbP2Y6t2.js";
|
|
8
|
+
import { t as ue } from "./x-u2oVmjN_.js";
|
|
9
|
+
import { n as de } from "./useCloudI18n-BuIwR6OE.js";
|
|
10
|
+
import { t as fe } from "./TplModal-BwSfxIHf.js";
|
|
11
|
+
var pe = _("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
|
+
}]]), me = {
|
|
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
|
+
}, he = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, b = {
|
|
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)]" }, z = {
|
|
46
|
+
key: 0,
|
|
47
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
|
|
48
|
+
}, _e = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, ve = {
|
|
49
|
+
key: 1,
|
|
50
|
+
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
|
|
51
|
+
}, ye = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, be = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, xe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Se = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Ce = ["value"], we = { class: "tpl:flex tpl:gap-2" }, Te = ["disabled"], B = /* @__PURE__ */ s({
|
|
52
|
+
__name: "ModuleBrowserModal",
|
|
53
|
+
props: { visible: { type: Boolean } },
|
|
54
|
+
emits: ["close", "insert"],
|
|
55
|
+
setup(s, { emit: _ }) {
|
|
56
|
+
let B = s, V = _, Ee = ie(() => import("./ModulePreviewCanvas-CHdOwV_4.js")), { t: De } = ce(), { t: H } = de(), U = g(oe, "ModuleBrowserModal"), W = g(se, "ModuleBrowserModal"), G = o(""), K = o(null), q = o(null), J = o("end"), Y = m(() => {
|
|
57
|
+
let e = U.modules.value;
|
|
58
|
+
if (!G.value) return e;
|
|
59
|
+
let t = G.value.toLowerCase();
|
|
60
|
+
return e.filter((e) => e.name.toLowerCase().includes(t));
|
|
61
|
+
}), X = m(() => K.value ? U.modules.value.find((e) => e.id === K.value) ?? null : null), Oe = m(() => {
|
|
62
|
+
let e = [{
|
|
63
|
+
value: "beginning",
|
|
64
|
+
label: H.modules.insertAtBeginning
|
|
65
|
+
}], t = W.content.value.blocks;
|
|
66
|
+
for (let n = 0; n < t.length; n++) {
|
|
67
|
+
let r = t[n], i = r.type, a = De.blocks[i] ?? r.type;
|
|
68
|
+
e.push({
|
|
69
|
+
value: r.id,
|
|
70
|
+
label: H.modules.insertAfterBlock.replace("{block}", `${a} ${n + 1}`)
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return e.push({
|
|
74
|
+
value: "end",
|
|
75
|
+
label: H.modules.insertAtEnd
|
|
76
|
+
}), e;
|
|
77
|
+
}), ke = m(() => {
|
|
78
|
+
if (J.value === "end") return;
|
|
79
|
+
if (J.value === "beginning") return 0;
|
|
80
|
+
let e = W.content.value.blocks.findIndex((e) => e.id === J.value);
|
|
81
|
+
if (e !== -1) return e + 1;
|
|
82
|
+
});
|
|
83
|
+
ae(() => B.visible, (e) => {
|
|
84
|
+
if (e) {
|
|
85
|
+
G.value = "", K.value = null, q.value = null;
|
|
86
|
+
let e = W.state.selectedBlockId;
|
|
87
|
+
e ? J.value = W.content.value.blocks.findIndex((t) => t.id === e) === -1 ? "end" : e : J.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) && y[r.type] && (n.add(r.type), t.push({
|
|
93
|
+
type: r.type,
|
|
94
|
+
icon: y[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 U.deleteModule(e), K.value === e && (K.value = null);
|
|
105
|
+
} finally {
|
|
106
|
+
q.value = null;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function Q() {
|
|
110
|
+
X.value && V("insert", X.value, ke.value);
|
|
111
|
+
}
|
|
112
|
+
function $() {
|
|
113
|
+
V("close");
|
|
114
|
+
}
|
|
115
|
+
function Me(e) {
|
|
116
|
+
e.key === "Escape" && $(), e.key === "Enter" && X.value && (e.preventDefault(), Q());
|
|
117
|
+
}
|
|
118
|
+
return (o, m) => (n(), d(fe, {
|
|
119
|
+
visible: s.visible,
|
|
120
|
+
onClose: $,
|
|
121
|
+
onKeydown: Me
|
|
122
|
+
}, {
|
|
123
|
+
default: ee(() => [p("div", me, [
|
|
124
|
+
p("div", he, [p("h3", b, r(f(H).modules.browse), 1), p("button", {
|
|
125
|
+
"aria-label": f(H).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
|
+
}, [l(f(ue), {
|
|
129
|
+
size: 16,
|
|
130
|
+
"stroke-width": 2
|
|
131
|
+
})], 8, x)]),
|
|
132
|
+
p("div", S, [p("div", C, [p("div", w, [p("div", T, [l(f(pe), {
|
|
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
|
+
}), e(p("input", {
|
|
137
|
+
"onUpdate:modelValue": m[0] ||= (e) => G.value = e,
|
|
138
|
+
type: "text",
|
|
139
|
+
placeholder: f(H).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), [[re, G.value]])])]), p("div", D, [Y.value.length > 0 ? (n(), c("div", O, [(n(!0), c(u, null, a(Y.value, (e) => (n(), c("button", {
|
|
142
|
+
key: e.id,
|
|
143
|
+
type: "button",
|
|
144
|
+
"aria-pressed": K.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: i({
|
|
147
|
+
borderColor: K.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
148
|
+
backgroundColor: K.value === e.id ? "var(--tpl-primary-light)" : "transparent"
|
|
149
|
+
}),
|
|
150
|
+
onClick: (t) => K.value = e.id
|
|
151
|
+
}, [p("div", A, [p("span", j, r(e.name), 1), p("span", M, r(f(H).modules.blockCount.replace("{count}", String(e.content.length))), 1)]), p("div", N, [
|
|
152
|
+
(n(!0), c(u, null, a(Ae(e), (e) => (n(), d(t(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 ? (n(), c("span", P, " +" + r(Z(e)), 1)) : te("", !0),
|
|
159
|
+
q.value === e.id ? (n(), c("button", {
|
|
160
|
+
key: 1,
|
|
161
|
+
"aria-label": f(H).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: h((t) => je(e.id), ["stop"])
|
|
165
|
+
}, r(f(H).modules.deleteConfirm), 9, F)) : (n(), c("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": f(H).modules.delete,
|
|
169
|
+
title: f(H).modules.delete,
|
|
170
|
+
onClick: h((t) => q.value = e.id, ["stop"])
|
|
171
|
+
}, [l(f(le), {
|
|
172
|
+
size: 12,
|
|
173
|
+
"stroke-width": 1.5
|
|
174
|
+
})], 8, I))
|
|
175
|
+
])], 12, k))), 128))])) : (n(), c("div", L, [l(f(v), {
|
|
176
|
+
size: 32,
|
|
177
|
+
"stroke-width": 1,
|
|
178
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
179
|
+
}), p("p", R, r(G.value ? f(H).modules.noModules : f(H).modules.noModulesHint), 1)]))])]), p("div", ge, [X.value ? (n(), c("div", z, [p("div", _e, [l(f(Ee), { blocks: X.value.content }, null, 8, ["blocks"])])])) : (n(), c("div", ve, [l(f(v), {
|
|
180
|
+
size: 32,
|
|
181
|
+
"stroke-width": 1,
|
|
182
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
183
|
+
}), p("p", ye, r(f(H).modules.selectToPreview), 1)]))])]),
|
|
184
|
+
p("div", be, [p("div", xe, [p("label", Se, r(f(H).modules.insertPosition), 1), e(p("select", {
|
|
185
|
+
"onUpdate:modelValue": m[1] ||= (e) => J.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
|
+
}, [(n(!0), c(u, null, a(Oe.value, (e) => (n(), c("option", {
|
|
188
|
+
key: e.value,
|
|
189
|
+
value: e.value
|
|
190
|
+
}, r(e.label), 9, Ce))), 128))], 512), [[ne, J.value]])]), p("div", we, [p("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
|
+
}, r(f(H).modules.close), 1), p("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: !X.value,
|
|
198
|
+
onClick: Q
|
|
199
|
+
}, r(f(H).modules.insert), 9, Te)])])
|
|
200
|
+
])]),
|
|
201
|
+
_: 1
|
|
202
|
+
}, 8, ["visible"]));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
//#endregion
|
|
206
|
+
export { B as default };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { E as e, I as t, L as n, M as r, Ot as i, P as a, S as o, _ as s, d as c, h as l, it as u, m as d, p as f } from "./vue.runtime.esm-bundler-DpvJL-nX.js";
|
|
2
|
+
import { N as p, _ as m, a as h, f as g, g as _, h as v, i as y, m as b, n as x, p as S, r as C, u as w, v as T, y as E } from "./useEditorCore-C6ost42Q.js";
|
|
3
|
+
import { s as D } from "./keys-ciNfSSGj.js";
|
|
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__ */ o({
|
|
6
|
+
name: "PreviewSectionBlock",
|
|
7
|
+
__name: "PreviewSectionBlock",
|
|
8
|
+
props: {
|
|
9
|
+
block: {},
|
|
10
|
+
viewport: {}
|
|
11
|
+
},
|
|
12
|
+
setup(o) {
|
|
13
|
+
let A = {
|
|
14
|
+
title: w,
|
|
15
|
+
paragraph: b,
|
|
16
|
+
image: _,
|
|
17
|
+
video: x,
|
|
18
|
+
button: p,
|
|
19
|
+
divider: T,
|
|
20
|
+
social: h,
|
|
21
|
+
menu: v,
|
|
22
|
+
table: C,
|
|
23
|
+
spacer: y,
|
|
24
|
+
html: m,
|
|
25
|
+
custom: E
|
|
26
|
+
}, j = o, M = e(D, null), N = f(() => {
|
|
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 = f(() => {
|
|
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 S(e, M, A);
|
|
48
|
+
}
|
|
49
|
+
return (e, o) => {
|
|
50
|
+
let f = t("PreviewSectionBlock", !0);
|
|
51
|
+
return r(), s("div", O, [d("div", k, [(r(!0), s(c, null, a(P.value, (e, t) => (r(), s("div", {
|
|
52
|
+
key: t,
|
|
53
|
+
style: i({ width: N.value[t] })
|
|
54
|
+
}, [(r(!0), s(c, null, a(F(t), (e) => (r(), s("div", {
|
|
55
|
+
key: e.id,
|
|
56
|
+
style: i(u(g)(e))
|
|
57
|
+
}, [e.type === "section" ? (r(), l(f, {
|
|
58
|
+
key: 0,
|
|
59
|
+
block: e,
|
|
60
|
+
viewport: "desktop"
|
|
61
|
+
}, null, 8, ["block"])) : (r(), l(n(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__ */ o({
|
|
75
|
+
__name: "ModulePreviewCanvas",
|
|
76
|
+
props: { blocks: {} },
|
|
77
|
+
setup(t) {
|
|
78
|
+
let o = e(D), d = {
|
|
79
|
+
section: A,
|
|
80
|
+
title: w,
|
|
81
|
+
paragraph: b,
|
|
82
|
+
image: _,
|
|
83
|
+
video: x,
|
|
84
|
+
button: p,
|
|
85
|
+
divider: T,
|
|
86
|
+
social: h,
|
|
87
|
+
menu: v,
|
|
88
|
+
table: C,
|
|
89
|
+
spacer: y,
|
|
90
|
+
html: m,
|
|
91
|
+
custom: E
|
|
92
|
+
};
|
|
93
|
+
function f(e) {
|
|
94
|
+
return S(e, o, d);
|
|
95
|
+
}
|
|
96
|
+
return (e, o) => (r(), s("div", j, [(r(!0), s(c, null, a(t.blocks, (e) => (r(), s("div", {
|
|
97
|
+
key: e.id,
|
|
98
|
+
style: i(u(g)(e))
|
|
99
|
+
}, [(r(), l(n(f(e)), {
|
|
100
|
+
block: e,
|
|
101
|
+
viewport: "desktop"
|
|
102
|
+
}, null, 8, ["block"]))], 4))), 128))]));
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
//#endregion
|
|
106
|
+
export { M as default };
|