@templatical/editor 0.6.4 → 0.6.5
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 → AccessibilityPanel-B2MT0M58.js} +34 -34
- package/dist/{AiChatSidebar-B3SJIKG_.js → AiChatSidebar-w5ek3Z76.js} +62 -62
- package/dist/{AiFeatureMenu-BLLKoOos.js → AiFeatureMenu-uXTxJh06.js} +20 -20
- package/dist/{cdn/chunks/BlockA11yBadge-DcEZftf6.js → BlockA11yBadge-C0S6kPC4.js} +10 -9
- package/dist/{CloudEditor-nzrRhHIi.js → CloudEditor-_GaYluN7.js} +441 -441
- package/dist/{CollaboratorBar-DuPYW5iF.js → CollaboratorBar-C4eXJkXW.js} +20 -20
- package/dist/CommentsSidebar-BQROg36f.js +441 -0
- package/dist/{cdn/chunks/CountdownBlock-5YdT1uUu.js → CountdownBlock-Bxqe7zwL.js} +21 -22
- package/dist/CountdownToolbar-CpFAnjSo.js +210 -0
- package/dist/{DesignReferenceSidebar-B8V_F2yF.js → DesignReferenceSidebar-CfqpcWX6.js} +52 -52
- package/dist/{LoadingTrack-B0CWFHXQ.js → LoadingTrack-CFkDkjBb.js} +1 -1
- package/dist/{ModuleBrowserModal-DrUFMTDx.js → ModuleBrowserModal-EDKHLJtb.js} +79 -79
- package/dist/{ModulePreviewCanvas-CHdOwV_4.js → ModulePreviewCanvas-MQxat34K.js} +29 -29
- package/dist/{NumberWithSuffix-DkXUez9t.js → NumberWithSuffix-Dw8dN1Pt.js} +88 -88
- package/dist/{ParagraphEditor-D75wl3BX.js → ParagraphEditor-C8IP9HOZ.js} +218 -218
- package/dist/{RichTextEditorContent-DYkIauIk.js → RichTextEditorContent-CK3Om7ES.js} +38 -38
- package/dist/{SaveModuleDialog-FZ9lxY7_.js → SaveModuleDialog-Bgu0FVr6.js} +34 -34
- package/dist/{SnapshotHistory-BR3eV120.js → SnapshotHistory-aSULEKUJ.js} +33 -33
- package/dist/{TemplateScoringPanel-4GTNHej5.js → TemplateScoringPanel-BIAeCAEP.js} +82 -82
- package/dist/{TestEmailModal--ue5w9fT.js → TestEmailModal-wcbmmWCs.js} +30 -30
- package/dist/{TitleEditor-fStSADI-.js → TitleEditor-21D8_OUQ.js} +67 -67
- package/dist/{TplModal-BwSfxIHf.js → TplModal-CINtyB6Y.js} +14 -14
- package/dist/{accessibility-e8JYu_zd.js → accessibility-BgUEA-Ai.js} +1 -1
- package/dist/{blockTypeIcons-BcTrDjmH.js → blockTypeIcons-DKetBdJx.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js → AccessibilityPanel-BMSGhaNU.js} +34 -34
- package/dist/cdn/chunks/{AccessibilityPanel-B6DOjojm.js.map → AccessibilityPanel-BMSGhaNU.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js → AiFeatureMenu-hNba-JqQ.js} +16 -16
- package/dist/cdn/chunks/{AiFeatureMenu-qEdB2fZJ.js.map → AiFeatureMenu-hNba-JqQ.js.map} +1 -1
- package/dist/{BlockA11yBadge-CXDLqkcJ.js → cdn/chunks/BlockA11yBadge-BIR88CvN.js} +11 -12
- package/dist/cdn/chunks/{BlockA11yBadge-DcEZftf6.js.map → BlockA11yBadge-BIR88CvN.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-dwzWDF_n.js → CloudEditor-D2G2nNpQ.js} +425 -425
- package/dist/cdn/chunks/{CloudEditor-dwzWDF_n.js.map → CloudEditor-D2G2nNpQ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js → CollaboratorBar-Btzom8dY.js} +20 -20
- package/dist/cdn/chunks/{CollaboratorBar--nO7TX6b.js.map → CollaboratorBar-Btzom8dY.js.map} +1 -1
- package/dist/cdn/chunks/CountdownBlock-BJSAJlJ1.js +93 -0
- package/dist/cdn/chunks/{CountdownBlock-5YdT1uUu.js.map → CountdownBlock-BJSAJlJ1.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DbknNrIi.js +212 -0
- package/dist/cdn/chunks/{CountdownToolbar-DXPXrbAA.js.map → CountdownToolbar-DbknNrIi.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DxoPp81s.js → ModuleBrowserModal-BvAuW8O5.js} +43 -43
- package/dist/cdn/chunks/{ModuleBrowserModal-DxoPp81s.js.map → ModuleBrowserModal-BvAuW8O5.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-CoLdb4ar.js → ModulePreviewCanvas-CYtt0boo.js} +23 -23
- package/dist/cdn/chunks/{ModulePreviewCanvas-CoLdb4ar.js.map → ModulePreviewCanvas-CYtt0boo.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js → NumberWithSuffix-CVfo9ztG.js} +108 -108
- package/dist/cdn/chunks/{NumberWithSuffix-CE3NrZhH.js.map → NumberWithSuffix-CVfo9ztG.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js → ParagraphEditor-DCo58JP8.js} +187 -187
- package/dist/cdn/chunks/{ParagraphEditor-B6Ygu-Mq.js.map → ParagraphEditor-DCo58JP8.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js → RichTextEditorContent-BzCThv84.js} +33 -33
- package/dist/cdn/chunks/{RichTextEditorContent-DL_y2SrR.js.map → RichTextEditorContent-BzCThv84.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js → SaveModuleDialog-S2Lix1LD.js} +27 -27
- package/dist/cdn/chunks/{SaveModuleDialog-B0TnO_o9.js.map → SaveModuleDialog-S2Lix1LD.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js → TitleEditor-CYzAMuUW.js} +66 -66
- package/dist/cdn/chunks/{TitleEditor-BHpfxvwy.js.map → TitleEditor-CYzAMuUW.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-BzzY9_kA.js → blockTypeIcons-DOzUHoor.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-BzzY9_kA.js.map → blockTypeIcons-DOzUHoor.js.map} +1 -1
- package/dist/cdn/chunks/draggable-CNhyCGIO.js +4804 -0
- package/dist/cdn/chunks/draggable-CNhyCGIO.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DIxF31tA.js → extensions-wafZZ0-_.js} +95 -95
- package/dist/cdn/chunks/{extensions-DIxF31tA.js.map → extensions-wafZZ0-_.js.map} +1 -1
- package/dist/cdn/chunks/{features-DEMb13KS.js → features-B4tNvoi4.js} +2260 -2267
- package/dist/cdn/chunks/features-B4tNvoi4.js.map +1 -0
- package/dist/cdn/chunks/{icons-CsLTcirh.js → icons-B5nBFtvb.js} +2 -2
- package/dist/cdn/chunks/{icons-CsLTcirh.js.map → icons-B5nBFtvb.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CVaNvhpM.js → media-library-BLaoBxHe.js} +1397 -1397
- package/dist/cdn/chunks/{media-library-CVaNvhpM.js.map → media-library-BLaoBxHe.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CDbNlZBE.js → pusher-bjpcqCZG.js} +2 -2
- package/dist/cdn/chunks/{pusher-CDbNlZBE.js.map → pusher-bjpcqCZG.js.map} +1 -1
- package/dist/cdn/chunks/{quality-BaBfc54_.js → quality-D920ZxXf.js} +3 -3
- package/dist/cdn/chunks/{quality-BaBfc54_.js.map → quality-D920ZxXf.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-CUxvx7ro.js → renderer-Yk30CckU.js} +3 -3
- package/dist/cdn/chunks/{renderer-CUxvx7ro.js.map → renderer-Yk30CckU.js.map} +1 -1
- package/dist/{rolldown-runtime-BZGGJVDF.js → cdn/chunks/rolldown-runtime-C266TIVP.js} +5 -5
- package/dist/cdn/chunks/{src-CRaqN-p8.js → src-kLJg7Y0m.js} +171 -171
- package/dist/cdn/chunks/{src-CRaqN-p8.js.map → src-kLJg7Y0m.js.map} +1 -1
- package/dist/cdn/chunks/styles-DrVLif14.js +2944 -0
- package/dist/cdn/chunks/styles-DrVLif14.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js → tiptap-IyIsncxY.js} +45 -46
- package/dist/cdn/chunks/{tiptap-ZhwKyFp7.js.map → tiptap-IyIsncxY.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +122 -122
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Da05j8yl.js → check-Bg5yrRmX.js} +1 -1
- package/dist/{chevron-down-R2uY34iD.js → chevron-down-tee-ghFi.js} +1 -1
- package/dist/{circle-alert-DZuGWPX-.js → circle-alert-C0L9pUQ4.js} +1 -1
- package/dist/{clock-CRp2sIub.js → clock-CDlEdqiP.js} +1 -1
- package/dist/{cloud-DEk_b4CR.js → cloud-a3VovHva.js} +145 -145
- package/dist/{createLucideIcon-C3pa2siy.js → createLucideIcon-Di4mqmGn.js} +9 -9
- package/dist/{dist-B1IR0bpH.js → dist-BzRLLpfq.js} +107 -107
- package/dist/{dist-BFawx6IS.js → dist-Pk4MhWMP.js} +35 -35
- package/dist/{extensions-CUcl9Ok4.js → extensions-BF39Siqk.js} +103 -103
- package/dist/{image-up-MBZKKg9p.js → image-up-1D_3XDdO.js} +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/{info-CJEC7piy.js → info-DTGrc0Bx.js} +1 -1
- package/dist/{keys-ciNfSSGj.js → keys-Bqs_0du9.js} +1 -1
- package/dist/{loader-circle-DsY5Yg33.js → loader-circle-_9bP23op.js} +1 -1
- package/dist/{message-circle-yElBbR2C.js → message-circle-gzy2ZGJ3.js} +1 -1
- package/dist/{refresh-cw-CE_AGtn8.js → refresh-cw-BNAhAmtL.js} +1 -1
- package/dist/rolldown-runtime-CAFD8bLK.js +11 -0
- package/dist/{scan-line-D0vcUekt.js → scan-line-DUEg6DoT.js} +1 -1
- package/dist/{send-DH4oDQqC.js → send-BatIZC9a.js} +1 -1
- package/dist/{shield-check-CfJgs2Hd.js → shield-check-C5Gv2cM1.js} +1 -1
- package/dist/{sparkles-CvRXGqFs.js → sparkles-D1IGi_cC.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styles-CwJQsnSp.js +3173 -0
- package/dist/templatical-editor.js +99 -99
- package/dist/{text-align-start-BT9VUDxK.js → text-align-start-DG3aAH7Y.js} +1 -1
- package/dist/{trash-2-DbP2Y6t2.js → trash-2-424iqbpN.js} +1 -1
- package/dist/{triangle-alert-aOXceTSe.js → triangle-alert-DWQySIE2.js} +1 -1
- package/dist/{useCloudI18n-BuIwR6OE.js → useCloudI18n-CL_AwWwi.js} +4 -4
- package/dist/useEditorCore-DLd-5qMg.js +3784 -0
- package/dist/{useI18n-lb2DHDiu.js → useI18n-CgmQftNf.js} +4 -4
- package/dist/{useMergeTag-CBwKnnNB.js → useMergeTag-vpwrZ9eQ.js} +3 -3
- package/dist/vue.runtime.esm-bundler-Bxqkjqhc.js +4300 -0
- package/dist/{x-u2oVmjN_.js → x-Dlaenqta.js} +1 -1
- package/package.json +8 -8
- package/dist/CommentsSidebar-B1pvJdqF.js +0 -441
- package/dist/CountdownBlock-BNSj1jvJ.js +0 -92
- package/dist/CountdownToolbar-ClJr2GzL.js +0 -210
- package/dist/cdn/chunks/CountdownToolbar-DXPXrbAA.js +0 -212
- package/dist/cdn/chunks/draggable-Bcb86AsV.js +0 -11572
- package/dist/cdn/chunks/draggable-Bcb86AsV.js.map +0 -1
- package/dist/cdn/chunks/features-DEMb13KS.js.map +0 -1
- package/dist/cdn/chunks/rolldown-runtime-BNuo_Jkg.js +0 -20
- package/dist/cdn/chunks/styles-BHJULjNR.js +0 -2947
- package/dist/cdn/chunks/styles-BHJULjNR.js.map +0 -1
- package/dist/styles-DEXEkBvg.js +0 -3176
- package/dist/useEditorCore-C6ost42Q.js +0 -9342
- package/dist/vue.runtime.esm-bundler-DpvJL-nX.js +0 -5775
|
@@ -0,0 +1,3784 @@
|
|
|
1
|
+
import { A as e, B as t, D as n, E as r, F as i, G as a, J as o, L as s, M as c, N as l, O as u, Q as d, S as f, U as p, V as m, X as h, Y as g, _, at as v, b as y, c as b, d as x, et as S, f as C, h as w, it as T, j as E, k as ee, l as D, m as O, nt as k, o as te, ot as A, p as ne, q as re, rt as j, s as ie, st as M, v as N, w as ae, x as oe, y as se, z as ce } from "./vue.runtime.esm-bundler-Bxqkjqhc.js";
|
|
2
|
+
import { A as le, S as ue, T as de, _ as fe, a as pe, b as me, c as he, d as ge, f as _e, g as ve, h as ye, j as be, k as xe, l as Se, m as Ce, o as we, p as Te, s as Ee, t as De, u as Oe, v as ke, x as Ae, y as je } from "./dist-DJmnUmW9.js";
|
|
3
|
+
import { a as Me, c as Ne, i as Pe, l as Fe, n as Ie, r as Le, s as Re } from "./dist-BzRLLpfq.js";
|
|
4
|
+
import { D as ze, E as Be, O as Ve, S as He, T as Ue, _ as We, a as Ge, b as Ke, c as qe, d as Je, f as Ye, g as Xe, h as Ze, m as Qe, o as $e, p as et, r as tt, s as nt, t as rt, v as it, x as at, y as ot } from "./keys-Bqs_0du9.js";
|
|
5
|
+
import { t as st } from "./useI18n-CgmQftNf.js";
|
|
6
|
+
import { t as P } from "./createLucideIcon-Di4mqmGn.js";
|
|
7
|
+
import { t as ct } from "./message-circle-gzy2ZGJ3.js";
|
|
8
|
+
import { t as lt } from "./trash-2-424iqbpN.js";
|
|
9
|
+
import { t as ut } from "./triangle-alert-DWQySIE2.js";
|
|
10
|
+
import { t as dt } from "./LoadingTrack-CFkDkjBb.js";
|
|
11
|
+
import { t as ft } from "./_plugin-vue_export-helper-B0hnzhyu.js";
|
|
12
|
+
import "./useCloudI18n-CL_AwWwi.js";
|
|
13
|
+
import { t as pt } from "./useMergeTag-vpwrZ9eQ.js";
|
|
14
|
+
//#region ../core/dist/index.js
|
|
15
|
+
function mt(e) {
|
|
16
|
+
let t = o({
|
|
17
|
+
content: e.content ?? Oe(e.defaultFontFamily, e.templateDefaults),
|
|
18
|
+
selectedBlockId: null,
|
|
19
|
+
viewport: "desktop",
|
|
20
|
+
darkMode: !1,
|
|
21
|
+
previewMode: !1,
|
|
22
|
+
isDirty: !1,
|
|
23
|
+
uiTheme: "auto"
|
|
24
|
+
}), n = m({
|
|
25
|
+
get: () => t.content,
|
|
26
|
+
set: (e) => {
|
|
27
|
+
t.content = e, t.isDirty = !0;
|
|
28
|
+
}
|
|
29
|
+
}), r = m(() => t.selectedBlockId ? i(t.content.blocks, t.selectedBlockId) : null);
|
|
30
|
+
function i(e, t) {
|
|
31
|
+
for (let n of e) {
|
|
32
|
+
if (n.id === t) return n;
|
|
33
|
+
if (n.type === "section") for (let e of n.children) {
|
|
34
|
+
let n = i(e, t);
|
|
35
|
+
if (n) return n;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function a(e, t, n = { blocks: e }) {
|
|
41
|
+
for (let r = 0; r < e.length; r++) {
|
|
42
|
+
let i = e[r];
|
|
43
|
+
if (i.id === t) return n;
|
|
44
|
+
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
45
|
+
let n = a(i.children[e], t, {
|
|
46
|
+
blocks: i.children[e],
|
|
47
|
+
sectionId: i.id,
|
|
48
|
+
columnIndex: e
|
|
49
|
+
});
|
|
50
|
+
if (n) return n;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
function s(t) {
|
|
56
|
+
return e.lockedBlocks?.value.has(t) ?? !1;
|
|
57
|
+
}
|
|
58
|
+
function c(e, n = !0) {
|
|
59
|
+
t.content = e, n && (t.isDirty = !0);
|
|
60
|
+
}
|
|
61
|
+
function l(e) {
|
|
62
|
+
e && s(e) || (t.selectedBlockId = e);
|
|
63
|
+
}
|
|
64
|
+
function u(e) {
|
|
65
|
+
t.viewport = e;
|
|
66
|
+
}
|
|
67
|
+
function d(e) {
|
|
68
|
+
t.darkMode = e;
|
|
69
|
+
}
|
|
70
|
+
function f(e) {
|
|
71
|
+
t.uiTheme = e;
|
|
72
|
+
}
|
|
73
|
+
function p(e) {
|
|
74
|
+
t.previewMode = e, e && (t.selectedBlockId = null);
|
|
75
|
+
}
|
|
76
|
+
function h(e, n) {
|
|
77
|
+
if (s(e)) return;
|
|
78
|
+
let r = i(t.content.blocks, e);
|
|
79
|
+
r && (Object.assign(r, n), t.isDirty = !0);
|
|
80
|
+
}
|
|
81
|
+
function _(e) {
|
|
82
|
+
t.content.settings = {
|
|
83
|
+
...t.content.settings,
|
|
84
|
+
...e
|
|
85
|
+
}, t.isDirty = !0;
|
|
86
|
+
}
|
|
87
|
+
function v(e, n, r = 0, a) {
|
|
88
|
+
if (n) {
|
|
89
|
+
if (s(n)) return;
|
|
90
|
+
let o = i(t.content.blocks, n);
|
|
91
|
+
if (o && o.type === "section") {
|
|
92
|
+
o.children[r] = o.children[r] || [];
|
|
93
|
+
let t = o.children[r];
|
|
94
|
+
a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
|
|
95
|
+
}
|
|
96
|
+
} else a !== void 0 && a < t.content.blocks.length ? t.content.blocks.splice(a, 0, e) : t.content.blocks.push(e);
|
|
97
|
+
t.isDirty = !0;
|
|
98
|
+
}
|
|
99
|
+
function y(e) {
|
|
100
|
+
if (s(e)) return;
|
|
101
|
+
let n = a(t.content.blocks, e);
|
|
102
|
+
if (n) {
|
|
103
|
+
let r = n.blocks.findIndex((t) => t.id === e);
|
|
104
|
+
r !== -1 && (n.blocks.splice(r, 1), t.selectedBlockId === e && (t.selectedBlockId = null), t.isDirty = !0);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function b(e, n, r, o = 0) {
|
|
108
|
+
if (s(e) || r && s(r)) return;
|
|
109
|
+
let c = a(t.content.blocks, e);
|
|
110
|
+
if (!c) return;
|
|
111
|
+
let l = c.blocks.findIndex((t) => t.id === e);
|
|
112
|
+
if (l === -1) return;
|
|
113
|
+
let u;
|
|
114
|
+
if (r) {
|
|
115
|
+
let e = i(t.content.blocks, r);
|
|
116
|
+
if (!e || e.type !== "section") return;
|
|
117
|
+
e.children[o] = e.children[o] || [], u = e.children[o];
|
|
118
|
+
} else u = t.content.blocks;
|
|
119
|
+
let [d] = c.blocks.splice(l, 1);
|
|
120
|
+
u.splice(n, 0, d), t.isDirty = !0;
|
|
121
|
+
}
|
|
122
|
+
function x() {
|
|
123
|
+
t.isDirty = !0;
|
|
124
|
+
}
|
|
125
|
+
return {
|
|
126
|
+
state: g(t),
|
|
127
|
+
content: n,
|
|
128
|
+
selectedBlock: r,
|
|
129
|
+
isBlockLocked: s,
|
|
130
|
+
setContent: c,
|
|
131
|
+
selectBlock: l,
|
|
132
|
+
setViewport: u,
|
|
133
|
+
setDarkMode: d,
|
|
134
|
+
setUiTheme: f,
|
|
135
|
+
setPreviewMode: p,
|
|
136
|
+
updateBlock: h,
|
|
137
|
+
updateSettings: _,
|
|
138
|
+
addBlock: v,
|
|
139
|
+
removeBlock: y,
|
|
140
|
+
moveBlock: b,
|
|
141
|
+
markDirty: x
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
var ht = 50, gt = 300, _t = 1500;
|
|
145
|
+
function vt(e) {
|
|
146
|
+
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i = ht } = e, a = h([]), o = h([]), s = h(!1), c = null, l = null, u = m(() => a.value.length > 0), d = m(() => o.value.length > 0);
|
|
147
|
+
function f() {
|
|
148
|
+
return JSON.parse(JSON.stringify(t.value));
|
|
149
|
+
}
|
|
150
|
+
function p(e) {
|
|
151
|
+
a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
|
|
152
|
+
}
|
|
153
|
+
function g() {
|
|
154
|
+
l &&= (clearTimeout(l.timeoutId), null);
|
|
155
|
+
}
|
|
156
|
+
function _() {
|
|
157
|
+
r?.() || (g(), p(f()), o.value = []);
|
|
158
|
+
}
|
|
159
|
+
function v(e) {
|
|
160
|
+
if (!r?.()) {
|
|
161
|
+
if (l && l.blockId === e) {
|
|
162
|
+
clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
|
|
163
|
+
l = null;
|
|
164
|
+
}, gt);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
g(), p(f()), o.value = [], l = {
|
|
168
|
+
blockId: e,
|
|
169
|
+
timeoutId: setTimeout(() => {
|
|
170
|
+
l = null;
|
|
171
|
+
}, gt)
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
function y() {
|
|
176
|
+
s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
177
|
+
s.value = !1, c = null;
|
|
178
|
+
}, _t);
|
|
179
|
+
}
|
|
180
|
+
function b() {
|
|
181
|
+
if (a.value.length === 0) return;
|
|
182
|
+
g();
|
|
183
|
+
let e = a.value.pop();
|
|
184
|
+
o.value.push(f()), n(e, !0), y();
|
|
185
|
+
}
|
|
186
|
+
function x() {
|
|
187
|
+
if (o.value.length === 0) return;
|
|
188
|
+
g();
|
|
189
|
+
let e = o.value.pop();
|
|
190
|
+
a.value.push(f()), n(e, !0), y();
|
|
191
|
+
}
|
|
192
|
+
function S() {
|
|
193
|
+
a.value = [], o.value = [], g();
|
|
194
|
+
}
|
|
195
|
+
function C() {
|
|
196
|
+
S(), c &&= (clearTimeout(c), null);
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
canUndo: u,
|
|
200
|
+
canRedo: d,
|
|
201
|
+
isNavigating: s,
|
|
202
|
+
undo: b,
|
|
203
|
+
redo: x,
|
|
204
|
+
record: _,
|
|
205
|
+
recordDebounced: v,
|
|
206
|
+
clear: S,
|
|
207
|
+
destroy: C
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function yt(e) {
|
|
211
|
+
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i } = e;
|
|
212
|
+
function a(n, r, a) {
|
|
213
|
+
let o = we(n, e.blockDefaults);
|
|
214
|
+
return t(o, r, a), i(o.id), o;
|
|
215
|
+
}
|
|
216
|
+
function o(e, n, r) {
|
|
217
|
+
let a = JSON.parse(JSON.stringify(e));
|
|
218
|
+
return a.id = ue(), a.type === "section" && (a.children = a.children.map((e) => e.map((e) => {
|
|
219
|
+
let t = JSON.parse(JSON.stringify(e));
|
|
220
|
+
return t.id = ue(), t;
|
|
221
|
+
}))), t(a, n, r), i(a.id), a;
|
|
222
|
+
}
|
|
223
|
+
function s(e) {
|
|
224
|
+
n(e);
|
|
225
|
+
}
|
|
226
|
+
function c(e, t, n) {
|
|
227
|
+
r(e, { [t]: n });
|
|
228
|
+
}
|
|
229
|
+
return {
|
|
230
|
+
createAndAddBlock: a,
|
|
231
|
+
duplicateBlock: o,
|
|
232
|
+
deleteBlock: s,
|
|
233
|
+
updateBlockProperty: c
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function bt(e) {
|
|
237
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = 1e3, enabled: a = !0 } = e, o = null, s = !1;
|
|
238
|
+
function c() {
|
|
239
|
+
return typeof a == "function" ? a() : a;
|
|
240
|
+
}
|
|
241
|
+
function l() {
|
|
242
|
+
s = !0, d();
|
|
243
|
+
}
|
|
244
|
+
function u() {
|
|
245
|
+
s = !1;
|
|
246
|
+
}
|
|
247
|
+
function d() {
|
|
248
|
+
o &&= (clearTimeout(o), null);
|
|
249
|
+
}
|
|
250
|
+
function f() {
|
|
251
|
+
d(), n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
252
|
+
}
|
|
253
|
+
function p() {
|
|
254
|
+
!c() || s || (d(), o = setTimeout(() => {
|
|
255
|
+
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
256
|
+
}, i));
|
|
257
|
+
}
|
|
258
|
+
let m = T(t, () => {
|
|
259
|
+
c() && !s && n() && p();
|
|
260
|
+
}, { deep: !0 });
|
|
261
|
+
function h() {
|
|
262
|
+
m(), d();
|
|
263
|
+
}
|
|
264
|
+
return {
|
|
265
|
+
flush: f,
|
|
266
|
+
cancel: d,
|
|
267
|
+
pause: l,
|
|
268
|
+
resume: u,
|
|
269
|
+
destroy: h
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
function xt(e) {
|
|
273
|
+
let t = o(/* @__PURE__ */ new Set()), n = m(() => t.size > 0);
|
|
274
|
+
function r(e) {
|
|
275
|
+
return t.has(e);
|
|
276
|
+
}
|
|
277
|
+
function i(n) {
|
|
278
|
+
t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
|
|
279
|
+
}
|
|
280
|
+
function a() {
|
|
281
|
+
t.clear();
|
|
282
|
+
}
|
|
283
|
+
return {
|
|
284
|
+
isHidden: r,
|
|
285
|
+
toggleBlock: i,
|
|
286
|
+
reset: a,
|
|
287
|
+
hasHiddenBlocks: n
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
function St(e) {
|
|
291
|
+
let t = h(!1), n = h(!1), r = m(() => !!e.definition.value?.dataSource), i = m(() => r.value && !e.block.value.dataSourceFetched);
|
|
292
|
+
async function a() {
|
|
293
|
+
let r = e.definition.value;
|
|
294
|
+
if (r?.dataSource) {
|
|
295
|
+
t.value = !0, n.value = !1;
|
|
296
|
+
try {
|
|
297
|
+
let t = await r.dataSource.onFetch({
|
|
298
|
+
fieldValues: { ...e.block.value.fieldValues },
|
|
299
|
+
blockId: e.block.value.id
|
|
300
|
+
});
|
|
301
|
+
if (t == null) return;
|
|
302
|
+
let n = { ...e.block.value.fieldValues };
|
|
303
|
+
for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
|
|
304
|
+
e.onUpdate(n, !0);
|
|
305
|
+
} catch (e) {
|
|
306
|
+
console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
|
|
307
|
+
} finally {
|
|
308
|
+
t.value = !1;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
return {
|
|
313
|
+
isFetching: t,
|
|
314
|
+
fetchError: n,
|
|
315
|
+
fetch: a,
|
|
316
|
+
hasDataSource: r,
|
|
317
|
+
needsFetch: i
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
function Ct(e, t) {
|
|
321
|
+
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
322
|
+
e.addBlock = (r, i, a, o) => {
|
|
323
|
+
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
324
|
+
}, e.removeBlock = (n) => {
|
|
325
|
+
e.isBlockLocked(n) || (t.record(), r(n));
|
|
326
|
+
}, e.moveBlock = (n, r, a, o) => {
|
|
327
|
+
e.isBlockLocked(n) || a && e.isBlockLocked(a) || (t.record(), i(n, r, a, o));
|
|
328
|
+
}, e.updateBlock = (n, r) => {
|
|
329
|
+
e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r));
|
|
330
|
+
}, e.updateSettings = (e) => {
|
|
331
|
+
t.record(), o(e);
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/composables/useAccessibilityLint.ts
|
|
336
|
+
function wt(e) {
|
|
337
|
+
let t = h([]), n = h(!1), r = h(!1), i = d(null), a = e.options.disabled === !0, o = null, c = !1;
|
|
338
|
+
a || l();
|
|
339
|
+
async function l() {
|
|
340
|
+
try {
|
|
341
|
+
let t = await import("@templatical/quality");
|
|
342
|
+
if (c) return;
|
|
343
|
+
i.value = t.lintAccessibility, n.value = !0, u(), o = Fe(e.content, u, {
|
|
344
|
+
debounce: e.debounce ?? 500,
|
|
345
|
+
deep: !0
|
|
346
|
+
});
|
|
347
|
+
} catch {
|
|
348
|
+
if (c) return;
|
|
349
|
+
r.value = !0;
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
function u() {
|
|
353
|
+
i.value && (t.value = i.value(e.content.value, e.options));
|
|
354
|
+
}
|
|
355
|
+
let f = s(() => e.options, () => {
|
|
356
|
+
i.value && u();
|
|
357
|
+
}, { deep: !0 });
|
|
358
|
+
function p(t) {
|
|
359
|
+
t.fix && t.fix.apply({
|
|
360
|
+
updateBlock: e.updateBlock,
|
|
361
|
+
updateSettings: e.updateSettings
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
function m() {
|
|
365
|
+
c = !0, o?.(), f();
|
|
366
|
+
}
|
|
367
|
+
return {
|
|
368
|
+
issues: t,
|
|
369
|
+
ready: n,
|
|
370
|
+
unavailable: r,
|
|
371
|
+
applyFix: p,
|
|
372
|
+
destroy: m
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/utils/blockTypeLabels.ts
|
|
377
|
+
function Tt(e, t) {
|
|
378
|
+
return t.blocks[e] ?? e;
|
|
379
|
+
}
|
|
380
|
+
//#endregion
|
|
381
|
+
//#region src/composables/useKeyboardReorder.ts
|
|
382
|
+
function Et(e, t) {
|
|
383
|
+
let n = h(null), r = h(""), i = null;
|
|
384
|
+
function a(t) {
|
|
385
|
+
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
386
|
+
if (r !== -1) return {
|
|
387
|
+
index: r,
|
|
388
|
+
total: n.length
|
|
389
|
+
};
|
|
390
|
+
for (let e of n) {
|
|
391
|
+
if (e.type !== "section") continue;
|
|
392
|
+
let n = e;
|
|
393
|
+
for (let e = 0; e < n.children.length; e++) {
|
|
394
|
+
let r = n.children[e], i = r.findIndex((e) => e.id === t);
|
|
395
|
+
if (i !== -1) return {
|
|
396
|
+
index: i,
|
|
397
|
+
total: r.length,
|
|
398
|
+
sectionId: n.id,
|
|
399
|
+
columnIndex: e
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
function o(n) {
|
|
406
|
+
let r = a(n);
|
|
407
|
+
if (!r) return "";
|
|
408
|
+
let i = (r.sectionId ? s(r.sectionId, r.columnIndex ?? 0) : e.content.value.blocks)?.[r.index];
|
|
409
|
+
return i ? Tt(i.type, t.t) : "";
|
|
410
|
+
}
|
|
411
|
+
function s(t, n) {
|
|
412
|
+
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
413
|
+
}
|
|
414
|
+
function c(e) {
|
|
415
|
+
r.value = "", queueMicrotask(() => {
|
|
416
|
+
r.value = e;
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
function l(e) {
|
|
420
|
+
return n.value === e;
|
|
421
|
+
}
|
|
422
|
+
function u(e) {
|
|
423
|
+
let r = a(e);
|
|
424
|
+
r && (n.value = e, i = r, c(t.format(t.t.blockActions.lifted, {
|
|
425
|
+
block: o(e),
|
|
426
|
+
position: String(r.index + 1),
|
|
427
|
+
total: String(r.total)
|
|
428
|
+
})));
|
|
429
|
+
}
|
|
430
|
+
function d(n, r) {
|
|
431
|
+
let i = a(n);
|
|
432
|
+
if (!i) return;
|
|
433
|
+
let s = i.index + r;
|
|
434
|
+
s < 0 || s >= i.total || (e.moveBlock(n, s, i.sectionId, i.columnIndex), c(t.format(t.t.blockActions.moved, {
|
|
435
|
+
block: o(n),
|
|
436
|
+
position: String(s + 1),
|
|
437
|
+
total: String(i.total)
|
|
438
|
+
})));
|
|
439
|
+
}
|
|
440
|
+
function f(e) {
|
|
441
|
+
d(e, -1);
|
|
442
|
+
}
|
|
443
|
+
function p(e) {
|
|
444
|
+
d(e, 1);
|
|
445
|
+
}
|
|
446
|
+
function m(e) {
|
|
447
|
+
let r = a(e);
|
|
448
|
+
r && c(t.format(t.t.blockActions.dropped, {
|
|
449
|
+
block: o(e),
|
|
450
|
+
position: String(r.index + 1),
|
|
451
|
+
total: String(r.total)
|
|
452
|
+
})), n.value = null, i = null;
|
|
453
|
+
}
|
|
454
|
+
function g() {
|
|
455
|
+
let r = n.value;
|
|
456
|
+
if (r && i) {
|
|
457
|
+
let n = a(r), s = !!n && (n.sectionId !== i.sectionId || n.columnIndex !== i.columnIndex), l = !!n && n.index !== i.index;
|
|
458
|
+
n && (s || l) && e.moveBlock(r, i.index, i.sectionId, i.columnIndex), c(t.format(t.t.blockActions.cancelled, {
|
|
459
|
+
block: o(r),
|
|
460
|
+
position: String(i.index + 1)
|
|
461
|
+
}));
|
|
462
|
+
}
|
|
463
|
+
n.value = null, i = null;
|
|
464
|
+
}
|
|
465
|
+
return {
|
|
466
|
+
liftedBlockId: n,
|
|
467
|
+
announcement: r,
|
|
468
|
+
isLifted: l,
|
|
469
|
+
lift: u,
|
|
470
|
+
cancel: g,
|
|
471
|
+
moveUp: f,
|
|
472
|
+
moveDown: p,
|
|
473
|
+
drop: m
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
//#endregion
|
|
477
|
+
//#region src/composables/useUiTheme.ts
|
|
478
|
+
function Dt(e) {
|
|
479
|
+
let t = Pe("(prefers-color-scheme: dark)");
|
|
480
|
+
return { resolvedTheme: x(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
481
|
+
}
|
|
482
|
+
//#endregion
|
|
483
|
+
//#region src/composables/useThemeStyles.ts
|
|
484
|
+
var Ot = {
|
|
485
|
+
bg: "--tpl-bg",
|
|
486
|
+
bgElevated: "--tpl-bg-elevated",
|
|
487
|
+
bgHover: "--tpl-bg-hover",
|
|
488
|
+
bgActive: "--tpl-bg-active",
|
|
489
|
+
border: "--tpl-border",
|
|
490
|
+
borderLight: "--tpl-border-light",
|
|
491
|
+
text: "--tpl-text",
|
|
492
|
+
textMuted: "--tpl-text-muted",
|
|
493
|
+
textDim: "--tpl-text-dim",
|
|
494
|
+
primary: "--tpl-primary",
|
|
495
|
+
primaryHover: "--tpl-primary-hover",
|
|
496
|
+
primaryLight: "--tpl-primary-light",
|
|
497
|
+
secondary: "--tpl-secondary",
|
|
498
|
+
secondaryHover: "--tpl-secondary-hover",
|
|
499
|
+
secondaryLight: "--tpl-secondary-light",
|
|
500
|
+
success: "--tpl-success",
|
|
501
|
+
successLight: "--tpl-success-light",
|
|
502
|
+
warning: "--tpl-warning",
|
|
503
|
+
warningLight: "--tpl-warning-light",
|
|
504
|
+
danger: "--tpl-danger",
|
|
505
|
+
dangerLight: "--tpl-danger-light",
|
|
506
|
+
canvasBg: "--tpl-canvas-bg"
|
|
507
|
+
};
|
|
508
|
+
function kt({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
509
|
+
return { themeStyles: x(() => {
|
|
510
|
+
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
511
|
+
if (a) for (let [e, t] of Object.entries(Ot)) {
|
|
512
|
+
let n = a[e];
|
|
513
|
+
n && (r[t] = n);
|
|
514
|
+
}
|
|
515
|
+
return n && Object.assign(r, n()), r;
|
|
516
|
+
}) };
|
|
517
|
+
}
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/utils/logger.ts
|
|
520
|
+
var At = "[Templatical]";
|
|
521
|
+
function jt() {
|
|
522
|
+
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
523
|
+
}
|
|
524
|
+
var Mt = {
|
|
525
|
+
warn(...e) {
|
|
526
|
+
console.warn(At, ...e);
|
|
527
|
+
},
|
|
528
|
+
error(...e) {
|
|
529
|
+
console.error(At, ...e);
|
|
530
|
+
},
|
|
531
|
+
debug(...e) {
|
|
532
|
+
jt() || console.debug(At, ...e);
|
|
533
|
+
},
|
|
534
|
+
info(...e) {
|
|
535
|
+
jt() || console.info(At, ...e);
|
|
536
|
+
}
|
|
537
|
+
};
|
|
538
|
+
//#endregion
|
|
539
|
+
//#region src/composables/useBlockRegistry.ts
|
|
540
|
+
function Nt() {
|
|
541
|
+
let e = d(/* @__PURE__ */ new Map());
|
|
542
|
+
function t(t, n) {
|
|
543
|
+
e.value.set(t, n), k(e);
|
|
544
|
+
}
|
|
545
|
+
function n(t, n) {
|
|
546
|
+
let r = `custom:${t.type}`, i = {
|
|
547
|
+
component: n,
|
|
548
|
+
createBlock: () => Se(t),
|
|
549
|
+
sidebarItem: {
|
|
550
|
+
type: r,
|
|
551
|
+
label: t.name,
|
|
552
|
+
icon: t.icon,
|
|
553
|
+
description: t.description,
|
|
554
|
+
isCustom: !0
|
|
555
|
+
},
|
|
556
|
+
definition: t
|
|
557
|
+
};
|
|
558
|
+
e.value.set(r, i), k(e);
|
|
559
|
+
}
|
|
560
|
+
function r(t) {
|
|
561
|
+
if (t.type === "custom") {
|
|
562
|
+
let n = `custom:${t.customType}`;
|
|
563
|
+
return e.value.get(n)?.component;
|
|
564
|
+
}
|
|
565
|
+
return e.value.get(t.type)?.component;
|
|
566
|
+
}
|
|
567
|
+
function i(t) {
|
|
568
|
+
return e.value.get(t)?.createBlock();
|
|
569
|
+
}
|
|
570
|
+
function a() {
|
|
571
|
+
let t = [], n = [];
|
|
572
|
+
for (let r of e.value.values()) r.sidebarItem.isCustom ? n.push(r.sidebarItem) : t.push(r.sidebarItem);
|
|
573
|
+
return [...t, ...n];
|
|
574
|
+
}
|
|
575
|
+
function o(t) {
|
|
576
|
+
let n = `custom:${t}`;
|
|
577
|
+
return e.value.get(n)?.definition;
|
|
578
|
+
}
|
|
579
|
+
function s(e) {
|
|
580
|
+
return `<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`;
|
|
581
|
+
}
|
|
582
|
+
async function c(e) {
|
|
583
|
+
let t = o(e.customType);
|
|
584
|
+
if (!t) return s("Block definition not found");
|
|
585
|
+
try {
|
|
586
|
+
let { Liquid: n } = await import("./liquid.browser-CdMv1BTn.js");
|
|
587
|
+
return await new n({
|
|
588
|
+
strictVariables: !1,
|
|
589
|
+
strictFilters: !1
|
|
590
|
+
}).parseAndRender(t.template, e.fieldValues);
|
|
591
|
+
} catch (t) {
|
|
592
|
+
return Mt.error(`Failed to render custom block "${e.customType}":`, t), s(`Render error: ${e.customType}`);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function l(t) {
|
|
596
|
+
return e.value.has(t);
|
|
597
|
+
}
|
|
598
|
+
return {
|
|
599
|
+
registerBuiltIn: t,
|
|
600
|
+
registerCustom: n,
|
|
601
|
+
getComponent: r,
|
|
602
|
+
createBlock: i,
|
|
603
|
+
getSidebarItems: a,
|
|
604
|
+
getDefinition: o,
|
|
605
|
+
renderCustomBlock: c,
|
|
606
|
+
isRegistered: l
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
//#endregion
|
|
610
|
+
//#region src/utils/registerBuiltInBlocks.ts
|
|
611
|
+
var Pt = [
|
|
612
|
+
{
|
|
613
|
+
type: "section",
|
|
614
|
+
label: "Section",
|
|
615
|
+
createBlock: ve
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
type: "title",
|
|
619
|
+
label: "Title",
|
|
620
|
+
createBlock: me
|
|
621
|
+
},
|
|
622
|
+
{
|
|
623
|
+
type: "paragraph",
|
|
624
|
+
label: "Paragraph",
|
|
625
|
+
createBlock: ye
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
type: "image",
|
|
629
|
+
label: "Image",
|
|
630
|
+
createBlock: Te
|
|
631
|
+
},
|
|
632
|
+
{
|
|
633
|
+
type: "button",
|
|
634
|
+
label: "Button",
|
|
635
|
+
createBlock: Ee
|
|
636
|
+
},
|
|
637
|
+
{
|
|
638
|
+
type: "divider",
|
|
639
|
+
label: "Divider",
|
|
640
|
+
createBlock: ge
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
type: "video",
|
|
644
|
+
label: "Video",
|
|
645
|
+
createBlock: Ae
|
|
646
|
+
},
|
|
647
|
+
{
|
|
648
|
+
type: "social",
|
|
649
|
+
label: "Social",
|
|
650
|
+
createBlock: fe
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
type: "menu",
|
|
654
|
+
label: "Menu",
|
|
655
|
+
createBlock: Ce
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
type: "table",
|
|
659
|
+
label: "Table",
|
|
660
|
+
createBlock: je
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
type: "spacer",
|
|
664
|
+
label: "Spacer",
|
|
665
|
+
createBlock: ke
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
type: "html",
|
|
669
|
+
label: "HTML",
|
|
670
|
+
createBlock: _e
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
type: "countdown",
|
|
674
|
+
label: "Countdown",
|
|
675
|
+
createBlock: he
|
|
676
|
+
}
|
|
677
|
+
];
|
|
678
|
+
function Ft(e, t) {
|
|
679
|
+
for (let n of Pt) {
|
|
680
|
+
let r = t[n.type];
|
|
681
|
+
r && e.registerBuiltIn(n.type, {
|
|
682
|
+
component: r,
|
|
683
|
+
createBlock: n.createBlock,
|
|
684
|
+
sidebarItem: {
|
|
685
|
+
type: n.type,
|
|
686
|
+
label: n.label,
|
|
687
|
+
isCustom: !1
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
//#endregion
|
|
693
|
+
//#region src/utils/keyboardShortcuts.ts
|
|
694
|
+
function It(e) {
|
|
695
|
+
let t = e.target;
|
|
696
|
+
return t.isContentEditable || t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.tagName === "SELECT";
|
|
697
|
+
}
|
|
698
|
+
function Lt(e, t) {
|
|
699
|
+
let n = e.metaKey || e.ctrlKey;
|
|
700
|
+
if (n && e.key.toLowerCase() === "s") {
|
|
701
|
+
e.preventDefault(), t.onSave?.();
|
|
702
|
+
return;
|
|
703
|
+
}
|
|
704
|
+
if (n && e.key.toLowerCase() === "z") {
|
|
705
|
+
if (It(e)) return;
|
|
706
|
+
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
if (e.key === "Escape") {
|
|
710
|
+
t.selectBlock(null);
|
|
711
|
+
return;
|
|
712
|
+
}
|
|
713
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !It(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
714
|
+
}
|
|
715
|
+
//#endregion
|
|
716
|
+
//#region src/components/blocks/ButtonBlock.vue?vue&type=script&setup=true&lang.ts
|
|
717
|
+
var Rt = { class: "tpl:text-center" }, zt = ["href"], Bt = /* @__PURE__ */ y({
|
|
718
|
+
__name: "ButtonBlock",
|
|
719
|
+
props: {
|
|
720
|
+
block: {},
|
|
721
|
+
viewport: {}
|
|
722
|
+
},
|
|
723
|
+
setup(t) {
|
|
724
|
+
let n = t, r = x(() => {
|
|
725
|
+
let e = {
|
|
726
|
+
display: "inline-block",
|
|
727
|
+
padding: `${n.block.buttonPadding.top}px ${n.block.buttonPadding.right}px ${n.block.buttonPadding.bottom}px ${n.block.buttonPadding.left}px`,
|
|
728
|
+
backgroundColor: n.block.backgroundColor,
|
|
729
|
+
color: n.block.textColor,
|
|
730
|
+
fontSize: `${n.block.fontSize}px`,
|
|
731
|
+
fontWeight: "bold",
|
|
732
|
+
textDecoration: "none",
|
|
733
|
+
borderRadius: `${n.block.borderRadius}px`,
|
|
734
|
+
textAlign: "center"
|
|
735
|
+
};
|
|
736
|
+
return n.block.fontFamily && (e.fontFamily = n.block.fontFamily), e;
|
|
737
|
+
});
|
|
738
|
+
return (n, i) => (e(), w("div", Rt, [C("a", {
|
|
739
|
+
href: t.block.url || "#",
|
|
740
|
+
style: A(r.value),
|
|
741
|
+
class: "tpl:cursor-default",
|
|
742
|
+
onClick: i[0] ||= b(() => {}, ["prevent"])
|
|
743
|
+
}, M(t.block.text), 13, zt)]));
|
|
744
|
+
}
|
|
745
|
+
}), Vt = P("bookmark", [["path", {
|
|
746
|
+
d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",
|
|
747
|
+
key: "oz39mx"
|
|
748
|
+
}]]), Ht = P("box", [
|
|
749
|
+
["path", {
|
|
750
|
+
d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
|
|
751
|
+
key: "hh9hay"
|
|
752
|
+
}],
|
|
753
|
+
["path", {
|
|
754
|
+
d: "m3.3 7 8.7 5 8.7-5",
|
|
755
|
+
key: "g66t2b"
|
|
756
|
+
}],
|
|
757
|
+
["path", {
|
|
758
|
+
d: "M12 22V12",
|
|
759
|
+
key: "d0xqtd"
|
|
760
|
+
}]
|
|
761
|
+
]), Ut = P("code", [["path", {
|
|
762
|
+
d: "m16 18 6-6-6-6",
|
|
763
|
+
key: "eg8j8"
|
|
764
|
+
}], ["path", {
|
|
765
|
+
d: "m8 6-6 6 6 6",
|
|
766
|
+
key: "ppft3o"
|
|
767
|
+
}]]), Wt = P("copy", [["rect", {
|
|
768
|
+
width: "14",
|
|
769
|
+
height: "14",
|
|
770
|
+
x: "8",
|
|
771
|
+
y: "8",
|
|
772
|
+
rx: "2",
|
|
773
|
+
ry: "2",
|
|
774
|
+
key: "17jyea"
|
|
775
|
+
}], ["path", {
|
|
776
|
+
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
777
|
+
key: "zix9uf"
|
|
778
|
+
}]]), Gt = P("eye-off", [
|
|
779
|
+
["path", {
|
|
780
|
+
d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
|
|
781
|
+
key: "ct8e1f"
|
|
782
|
+
}],
|
|
783
|
+
["path", {
|
|
784
|
+
d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
|
|
785
|
+
key: "151rxh"
|
|
786
|
+
}],
|
|
787
|
+
["path", {
|
|
788
|
+
d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
|
|
789
|
+
key: "13bj9a"
|
|
790
|
+
}],
|
|
791
|
+
["path", {
|
|
792
|
+
d: "m2 2 20 20",
|
|
793
|
+
key: "1ooewy"
|
|
794
|
+
}]
|
|
795
|
+
]), Kt = P("funnel", [["path", {
|
|
796
|
+
d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
|
|
797
|
+
key: "sc7q7i"
|
|
798
|
+
}]]), qt = P("grip-vertical", [
|
|
799
|
+
["circle", {
|
|
800
|
+
cx: "9",
|
|
801
|
+
cy: "12",
|
|
802
|
+
r: "1",
|
|
803
|
+
key: "1vctgf"
|
|
804
|
+
}],
|
|
805
|
+
["circle", {
|
|
806
|
+
cx: "9",
|
|
807
|
+
cy: "5",
|
|
808
|
+
r: "1",
|
|
809
|
+
key: "hp0tcf"
|
|
810
|
+
}],
|
|
811
|
+
["circle", {
|
|
812
|
+
cx: "9",
|
|
813
|
+
cy: "19",
|
|
814
|
+
r: "1",
|
|
815
|
+
key: "fkjjf6"
|
|
816
|
+
}],
|
|
817
|
+
["circle", {
|
|
818
|
+
cx: "15",
|
|
819
|
+
cy: "12",
|
|
820
|
+
r: "1",
|
|
821
|
+
key: "1tmaij"
|
|
822
|
+
}],
|
|
823
|
+
["circle", {
|
|
824
|
+
cx: "15",
|
|
825
|
+
cy: "5",
|
|
826
|
+
r: "1",
|
|
827
|
+
key: "19l28e"
|
|
828
|
+
}],
|
|
829
|
+
["circle", {
|
|
830
|
+
cx: "15",
|
|
831
|
+
cy: "19",
|
|
832
|
+
r: "1",
|
|
833
|
+
key: "f4zoj3"
|
|
834
|
+
}]
|
|
835
|
+
]), Jt = P("image", [
|
|
836
|
+
["rect", {
|
|
837
|
+
width: "18",
|
|
838
|
+
height: "18",
|
|
839
|
+
x: "3",
|
|
840
|
+
y: "3",
|
|
841
|
+
rx: "2",
|
|
842
|
+
ry: "2",
|
|
843
|
+
key: "1m3agn"
|
|
844
|
+
}],
|
|
845
|
+
["circle", {
|
|
846
|
+
cx: "9",
|
|
847
|
+
cy: "9",
|
|
848
|
+
r: "2",
|
|
849
|
+
key: "af1f0g"
|
|
850
|
+
}],
|
|
851
|
+
["path", {
|
|
852
|
+
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
853
|
+
key: "1xmnt7"
|
|
854
|
+
}]
|
|
855
|
+
]), Yt = P("navigation", [["polygon", {
|
|
856
|
+
points: "3 11 22 2 13 21 11 13 3 11",
|
|
857
|
+
key: "1ltx0t"
|
|
858
|
+
}]]), Xt = P("puzzle", [["path", {
|
|
859
|
+
d: "M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",
|
|
860
|
+
key: "w46dr5"
|
|
861
|
+
}]]), Zt = P("share-2", [
|
|
862
|
+
["circle", {
|
|
863
|
+
cx: "18",
|
|
864
|
+
cy: "5",
|
|
865
|
+
r: "3",
|
|
866
|
+
key: "gq8acd"
|
|
867
|
+
}],
|
|
868
|
+
["circle", {
|
|
869
|
+
cx: "6",
|
|
870
|
+
cy: "12",
|
|
871
|
+
r: "3",
|
|
872
|
+
key: "w7nqdw"
|
|
873
|
+
}],
|
|
874
|
+
["circle", {
|
|
875
|
+
cx: "18",
|
|
876
|
+
cy: "19",
|
|
877
|
+
r: "3",
|
|
878
|
+
key: "1xt0gg"
|
|
879
|
+
}],
|
|
880
|
+
["line", {
|
|
881
|
+
x1: "8.59",
|
|
882
|
+
x2: "15.42",
|
|
883
|
+
y1: "13.51",
|
|
884
|
+
y2: "17.49",
|
|
885
|
+
key: "47mynk"
|
|
886
|
+
}],
|
|
887
|
+
["line", {
|
|
888
|
+
x1: "15.41",
|
|
889
|
+
x2: "8.59",
|
|
890
|
+
y1: "6.51",
|
|
891
|
+
y2: "10.49",
|
|
892
|
+
key: "1n3mei"
|
|
893
|
+
}]
|
|
894
|
+
]), Qt = P("table", [
|
|
895
|
+
["path", {
|
|
896
|
+
d: "M12 3v18",
|
|
897
|
+
key: "108xh3"
|
|
898
|
+
}],
|
|
899
|
+
["rect", {
|
|
900
|
+
width: "18",
|
|
901
|
+
height: "18",
|
|
902
|
+
x: "3",
|
|
903
|
+
y: "3",
|
|
904
|
+
rx: "2",
|
|
905
|
+
key: "afitv7"
|
|
906
|
+
}],
|
|
907
|
+
["path", {
|
|
908
|
+
d: "M3 9h18",
|
|
909
|
+
key: "1pudct"
|
|
910
|
+
}],
|
|
911
|
+
["path", {
|
|
912
|
+
d: "M3 15h18",
|
|
913
|
+
key: "5xshup"
|
|
914
|
+
}]
|
|
915
|
+
]), $t = P("video", [["path", {
|
|
916
|
+
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
917
|
+
key: "ftymec"
|
|
918
|
+
}], ["rect", {
|
|
919
|
+
x: "2",
|
|
920
|
+
y: "6",
|
|
921
|
+
width: "14",
|
|
922
|
+
height: "12",
|
|
923
|
+
rx: "2",
|
|
924
|
+
key: "158x01"
|
|
925
|
+
}]]), en = ["innerHTML"], tn = [
|
|
926
|
+
"src",
|
|
927
|
+
"width",
|
|
928
|
+
"height"
|
|
929
|
+
], nn = /* @__PURE__ */ y({
|
|
930
|
+
__name: "CustomBlockIcon",
|
|
931
|
+
props: {
|
|
932
|
+
icon: {},
|
|
933
|
+
size: {}
|
|
934
|
+
},
|
|
935
|
+
setup(t) {
|
|
936
|
+
let n = t, r = x(() => n.size ?? 20), i = x(() => n.icon && (n.icon.trimStart().startsWith("<svg") || n.icon.trimStart().startsWith("<SVG"))), a = x(() => n.icon && !i.value && (n.icon.startsWith("http") || n.icon.startsWith("/")));
|
|
937
|
+
return (n, o) => i.value ? (e(), w("span", {
|
|
938
|
+
key: 0,
|
|
939
|
+
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
940
|
+
style: A({
|
|
941
|
+
width: `${r.value}px`,
|
|
942
|
+
height: `${r.value}px`
|
|
943
|
+
}),
|
|
944
|
+
innerHTML: t.icon
|
|
945
|
+
}, null, 12, en)) : a.value ? (e(), w("img", {
|
|
946
|
+
key: 1,
|
|
947
|
+
src: t.icon,
|
|
948
|
+
width: r.value,
|
|
949
|
+
height: r.value,
|
|
950
|
+
class: "tpl:inline-block",
|
|
951
|
+
alt: ""
|
|
952
|
+
}, null, 8, tn)) : (e(), ne(j(Ht), {
|
|
953
|
+
key: 2,
|
|
954
|
+
size: r.value,
|
|
955
|
+
"stroke-width": 1.5
|
|
956
|
+
}, null, 8, ["size"]));
|
|
957
|
+
}
|
|
958
|
+
}), rn = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
959
|
+
function an(e, t) {
|
|
960
|
+
let n = null, r = null, i = null;
|
|
961
|
+
function a() {
|
|
962
|
+
return e.value ? Array.from(e.value.querySelectorAll(rn)).filter((e) => e.offsetParent !== null) : [];
|
|
963
|
+
}
|
|
964
|
+
function o(e) {
|
|
965
|
+
if (e.key !== "Tab") return;
|
|
966
|
+
let t = a();
|
|
967
|
+
if (t.length === 0) return;
|
|
968
|
+
let n = t[0], r = t[t.length - 1];
|
|
969
|
+
e.shiftKey ? document.activeElement === n && (e.preventDefault(), r.focus()) : document.activeElement === r && (e.preventDefault(), n.focus());
|
|
970
|
+
}
|
|
971
|
+
function c() {
|
|
972
|
+
let t = r !== null || i !== null;
|
|
973
|
+
t && l({ restoreFocus: !1 }), t || (n = document.activeElement), i = requestAnimationFrame(() => {
|
|
974
|
+
i = null;
|
|
975
|
+
let t = a();
|
|
976
|
+
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
977
|
+
}), r = Le(e, "keydown", o);
|
|
978
|
+
}
|
|
979
|
+
function l(e = {}) {
|
|
980
|
+
let t = e.restoreFocus !== !1;
|
|
981
|
+
i !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(i), i = null), r?.(), r = null, t && n && n.focus && (n.focus(), n = null);
|
|
982
|
+
}
|
|
983
|
+
let u = s([t, e], ([e, t]) => {
|
|
984
|
+
e && t ? c() : l();
|
|
985
|
+
}, { flush: "post" });
|
|
986
|
+
re(() => {
|
|
987
|
+
u(), l();
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region src/composables/useEmoji.ts
|
|
992
|
+
function on() {
|
|
993
|
+
let [e, t] = Ne(!1), n = d([]), r = !1;
|
|
994
|
+
re(() => {
|
|
995
|
+
r = !0;
|
|
996
|
+
}), s(e, async (e) => {
|
|
997
|
+
if (e && n.value.length === 0) {
|
|
998
|
+
let { emojiCategories: e } = await import("./emojiData-PQyVa4bU.js");
|
|
999
|
+
if (r) return;
|
|
1000
|
+
n.value = e;
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
1003
|
+
function i() {
|
|
1004
|
+
t();
|
|
1005
|
+
}
|
|
1006
|
+
function a() {
|
|
1007
|
+
e.value = !1;
|
|
1008
|
+
}
|
|
1009
|
+
return {
|
|
1010
|
+
categories: n,
|
|
1011
|
+
isOpen: e,
|
|
1012
|
+
toggle: i,
|
|
1013
|
+
close: a
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
//#endregion
|
|
1017
|
+
//#region src/composables/useDragDrop.ts
|
|
1018
|
+
function sn(e) {
|
|
1019
|
+
let { onBlockMove: t, onBlockAdd: n } = e, r = h(!1), i = h(null), a = h(null);
|
|
1020
|
+
function o(e) {
|
|
1021
|
+
r.value = !0, i.value = e;
|
|
1022
|
+
}
|
|
1023
|
+
function s() {
|
|
1024
|
+
r.value = !1, i.value = null, a.value = null;
|
|
1025
|
+
}
|
|
1026
|
+
function c(e) {
|
|
1027
|
+
a.value = e;
|
|
1028
|
+
}
|
|
1029
|
+
function l(e, r, a, o) {
|
|
1030
|
+
i.value && (e.findIndex((e) => e.id === i.value.id) === -1 ? n(i.value, a, o) : t(i.value.id, r, a, o), s());
|
|
1031
|
+
}
|
|
1032
|
+
function u(e, n, i) {
|
|
1033
|
+
return {
|
|
1034
|
+
group: e,
|
|
1035
|
+
animation: 150,
|
|
1036
|
+
ghostClass: "tpl-ghost",
|
|
1037
|
+
dragClass: "tpl-drag",
|
|
1038
|
+
handle: ".tpl-drag-handle",
|
|
1039
|
+
onStart: (e) => {
|
|
1040
|
+
e.item.dataset.blockId && (r.value = !0);
|
|
1041
|
+
},
|
|
1042
|
+
onEnd: () => {
|
|
1043
|
+
s();
|
|
1044
|
+
},
|
|
1045
|
+
onAdd: (e) => {
|
|
1046
|
+
let r = e.item.dataset.blockId;
|
|
1047
|
+
r && t(r, e.newIndex, n, i);
|
|
1048
|
+
},
|
|
1049
|
+
onUpdate: (e) => {
|
|
1050
|
+
let r = e.item.dataset.blockId;
|
|
1051
|
+
r && t(r, e.newIndex, n, i);
|
|
1052
|
+
}
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
return {
|
|
1056
|
+
isDragging: r,
|
|
1057
|
+
draggedBlock: i,
|
|
1058
|
+
dropTargetId: a,
|
|
1059
|
+
startDrag: o,
|
|
1060
|
+
endDrag: s,
|
|
1061
|
+
setDropTarget: c,
|
|
1062
|
+
handleDrop: l,
|
|
1063
|
+
getSortableOptions: u
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
//#endregion
|
|
1067
|
+
//#region src/composables/useFonts.ts
|
|
1068
|
+
var cn = [
|
|
1069
|
+
{
|
|
1070
|
+
value: "Arial",
|
|
1071
|
+
label: "Arial"
|
|
1072
|
+
},
|
|
1073
|
+
{
|
|
1074
|
+
value: "Helvetica",
|
|
1075
|
+
label: "Helvetica"
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
value: "Georgia",
|
|
1079
|
+
label: "Georgia"
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
value: "Times New Roman",
|
|
1083
|
+
label: "Times New Roman"
|
|
1084
|
+
},
|
|
1085
|
+
{
|
|
1086
|
+
value: "Verdana",
|
|
1087
|
+
label: "Verdana"
|
|
1088
|
+
},
|
|
1089
|
+
{
|
|
1090
|
+
value: "Trebuchet MS",
|
|
1091
|
+
label: "Trebuchet MS"
|
|
1092
|
+
},
|
|
1093
|
+
{
|
|
1094
|
+
value: "Courier New",
|
|
1095
|
+
label: "Courier New"
|
|
1096
|
+
}
|
|
1097
|
+
], ln = {
|
|
1098
|
+
arial: "Arial, sans-serif",
|
|
1099
|
+
helvetica: "Helvetica, sans-serif",
|
|
1100
|
+
georgia: "Georgia, serif",
|
|
1101
|
+
"times new roman": "'Times New Roman', serif",
|
|
1102
|
+
verdana: "Verdana, sans-serif",
|
|
1103
|
+
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1104
|
+
"courier new": "'Courier New', monospace"
|
|
1105
|
+
}, un = "Arial, sans-serif";
|
|
1106
|
+
function dn(e) {
|
|
1107
|
+
let t = h(e?.customFonts ?? []), n = h(!0), r = h(!1), i = x(() => e?.defaultFallback ?? un);
|
|
1108
|
+
function a(e) {
|
|
1109
|
+
n.value = e;
|
|
1110
|
+
}
|
|
1111
|
+
let o = x(() => {
|
|
1112
|
+
let e = [...cn];
|
|
1113
|
+
if (!n.value) return e.sort((e, t) => e.label.localeCompare(t.label));
|
|
1114
|
+
let r = t.value.map((e) => ({
|
|
1115
|
+
value: e.name,
|
|
1116
|
+
label: e.name,
|
|
1117
|
+
isCustom: !0
|
|
1118
|
+
})), i = [...e, ...r];
|
|
1119
|
+
return i.sort((e, t) => e.label.localeCompare(t.label)), i;
|
|
1120
|
+
});
|
|
1121
|
+
function s(e) {
|
|
1122
|
+
return o.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1123
|
+
}
|
|
1124
|
+
function c(e) {
|
|
1125
|
+
return cn.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1126
|
+
}
|
|
1127
|
+
function l() {
|
|
1128
|
+
if (e?.defaultFont) {
|
|
1129
|
+
if (!n.value && !c(e.defaultFont)) return un;
|
|
1130
|
+
if (s(e.defaultFont)) {
|
|
1131
|
+
let t = o.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1132
|
+
if (t) return t.value;
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
return un;
|
|
1136
|
+
}
|
|
1137
|
+
let u = x(() => l());
|
|
1138
|
+
function d(e) {
|
|
1139
|
+
if (!e) return i.value;
|
|
1140
|
+
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1141
|
+
if (n) {
|
|
1142
|
+
let e = n.fallback ?? i.value;
|
|
1143
|
+
return `'${n.name}', ${e}`;
|
|
1144
|
+
}
|
|
1145
|
+
return ln[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1146
|
+
}
|
|
1147
|
+
let f = [];
|
|
1148
|
+
async function m() {
|
|
1149
|
+
if (t.value.length === 0) {
|
|
1150
|
+
r.value = !0;
|
|
1151
|
+
return;
|
|
1152
|
+
}
|
|
1153
|
+
let e = t.value.map(async (e) => {
|
|
1154
|
+
try {
|
|
1155
|
+
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
1156
|
+
let t = document.createElement("link");
|
|
1157
|
+
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), f.push(t), await new Promise((n, r) => {
|
|
1158
|
+
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1159
|
+
});
|
|
1160
|
+
} catch (t) {
|
|
1161
|
+
Mt.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
await Promise.allSettled(e), r.value = !0;
|
|
1165
|
+
}
|
|
1166
|
+
function g() {
|
|
1167
|
+
for (let e of f) e.remove();
|
|
1168
|
+
f.length = 0;
|
|
1169
|
+
}
|
|
1170
|
+
return p() && re(g), {
|
|
1171
|
+
fonts: o,
|
|
1172
|
+
defaultFont: u,
|
|
1173
|
+
defaultFallback: i,
|
|
1174
|
+
customFonts: t,
|
|
1175
|
+
customFontsEnabled: n,
|
|
1176
|
+
isLoaded: r,
|
|
1177
|
+
setCustomFontsEnabled: a,
|
|
1178
|
+
loadCustomFonts: m,
|
|
1179
|
+
cleanupFontLinks: g,
|
|
1180
|
+
getFontWithFallback: d,
|
|
1181
|
+
getDefaultFont: l
|
|
1182
|
+
};
|
|
1183
|
+
}
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region src/composables/useRichTextLinkDialog.ts
|
|
1186
|
+
function fn(e) {
|
|
1187
|
+
let t = h(!1), n = h(""), r = h(null);
|
|
1188
|
+
an(r, t);
|
|
1189
|
+
function i() {
|
|
1190
|
+
n.value = e.value?.getAttributes("link").href || "", t.value = !0;
|
|
1191
|
+
}
|
|
1192
|
+
function a() {
|
|
1193
|
+
if (n.value) {
|
|
1194
|
+
let t = o(n.value);
|
|
1195
|
+
e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).run();
|
|
1196
|
+
}
|
|
1197
|
+
c();
|
|
1198
|
+
}
|
|
1199
|
+
function o(e) {
|
|
1200
|
+
return /^[a-z][a-z0-9+.-]*:/i.test(e) || e.startsWith("#") ? e : `https://${e}`;
|
|
1201
|
+
}
|
|
1202
|
+
function s() {
|
|
1203
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), c();
|
|
1204
|
+
}
|
|
1205
|
+
function c() {
|
|
1206
|
+
t.value = !1, n.value = "";
|
|
1207
|
+
}
|
|
1208
|
+
function l(e) {
|
|
1209
|
+
e.key === "Enter" ? (e.preventDefault(), a()) : e.key === "Escape" && c();
|
|
1210
|
+
}
|
|
1211
|
+
return {
|
|
1212
|
+
showLinkDialog: t,
|
|
1213
|
+
linkUrl: n,
|
|
1214
|
+
linkDialogRef: r,
|
|
1215
|
+
openLinkDialog: i,
|
|
1216
|
+
insertLink: a,
|
|
1217
|
+
removeLink: s,
|
|
1218
|
+
closeLinkDialog: c,
|
|
1219
|
+
handleLinkKeydown: l
|
|
1220
|
+
};
|
|
1221
|
+
}
|
|
1222
|
+
//#endregion
|
|
1223
|
+
//#region src/composables/useRichTextEditor.ts
|
|
1224
|
+
function pn(e) {
|
|
1225
|
+
let t = ae(Qe, null), { mergeTags: r, canRequestMergeTag: i, isRequesting: o, requestMergeTag: c, syntax: l, autocomplete: u } = pt(), f = ae(Be, null), p = (a(f) ? f.value : f)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", m = de(l), g = d(null), { showLinkDialog: _, linkUrl: v, linkDialogRef: y, openLinkDialog: b, insertLink: x, removeLink: S, closeLinkDialog: C, handleLinkKeydown: w } = fn(g), { start: T, stop: E } = Re(() => g.value?.commands.focus("end"), 0, { immediate: !1 }), ee = d(null), D = h(!0), O = h(null), k = !1;
|
|
1226
|
+
async function te() {
|
|
1227
|
+
O.value = null, D.value = !0;
|
|
1228
|
+
try {
|
|
1229
|
+
let { TiptapEditor: n, EC: i, extensions: a } = await e.loadExtensions({
|
|
1230
|
+
mergeTags: r,
|
|
1231
|
+
syntax: l,
|
|
1232
|
+
triggerChar: m,
|
|
1233
|
+
autocompleteEnabled: u,
|
|
1234
|
+
suggestionEmptyText: p
|
|
1235
|
+
});
|
|
1236
|
+
if (k) return;
|
|
1237
|
+
ee.value = i;
|
|
1238
|
+
let o = /* @__PURE__ */ new Map();
|
|
1239
|
+
a.forEach((e, t) => o.set(e.name, t));
|
|
1240
|
+
let s = new n({
|
|
1241
|
+
extensions: a.filter((e, t) => o.get(e.name) === t),
|
|
1242
|
+
content: e.blockContent(),
|
|
1243
|
+
editable: !0,
|
|
1244
|
+
onUpdate: ({ editor: n }) => {
|
|
1245
|
+
k || t && t.updateBlock(e.blockId(), { content: n.getHTML() });
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
if (k) {
|
|
1249
|
+
s.destroy();
|
|
1250
|
+
return;
|
|
1251
|
+
}
|
|
1252
|
+
g.value = s, D.value = !1, T();
|
|
1253
|
+
} catch (t) {
|
|
1254
|
+
if (k) return;
|
|
1255
|
+
Mt.error(`[${e.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, t), O.value = t instanceof Error ? t.message : "Failed to load editor", D.value = !1;
|
|
1256
|
+
}
|
|
1257
|
+
}
|
|
1258
|
+
function A() {
|
|
1259
|
+
g.value?.destroy(), g.value = null, te();
|
|
1260
|
+
}
|
|
1261
|
+
te();
|
|
1262
|
+
let ne = s(() => e.blockContent(), (e) => {
|
|
1263
|
+
g.value && g.value.getHTML() !== e && g.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1264
|
+
});
|
|
1265
|
+
function re(t) {
|
|
1266
|
+
if (o.value) return;
|
|
1267
|
+
let n = t.target;
|
|
1268
|
+
e.onClickOutsideSideEffect?.(n), !(n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog")) && e.onDone();
|
|
1269
|
+
}
|
|
1270
|
+
Le(document, "mousedown", re), n(() => {
|
|
1271
|
+
k = !0, ne(), E(), g.value?.destroy();
|
|
1272
|
+
});
|
|
1273
|
+
async function j() {
|
|
1274
|
+
let e = await c();
|
|
1275
|
+
k || (e && g.value ? g.value.chain().focus().insertMergeTag({
|
|
1276
|
+
label: e.label,
|
|
1277
|
+
value: e.value
|
|
1278
|
+
}).run() : g.value?.commands.focus());
|
|
1279
|
+
}
|
|
1280
|
+
return {
|
|
1281
|
+
editor: g,
|
|
1282
|
+
EditorContent: ee,
|
|
1283
|
+
isLoading: D,
|
|
1284
|
+
initError: O,
|
|
1285
|
+
retry: A,
|
|
1286
|
+
showLinkDialog: _,
|
|
1287
|
+
linkUrl: v,
|
|
1288
|
+
linkDialogRef: y,
|
|
1289
|
+
mergeTags: r,
|
|
1290
|
+
canRequestMergeTag: i,
|
|
1291
|
+
isRequestingMergeTag: o,
|
|
1292
|
+
syntax: l,
|
|
1293
|
+
openLinkDialog: b,
|
|
1294
|
+
insertLink: x,
|
|
1295
|
+
removeLink: S,
|
|
1296
|
+
closeLinkDialog: C,
|
|
1297
|
+
handleLinkKeydown: w,
|
|
1298
|
+
handleAddMergeTag: j
|
|
1299
|
+
};
|
|
1300
|
+
}
|
|
1301
|
+
//#endregion
|
|
1302
|
+
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1303
|
+
var mn = { class: "tpl:w-full" }, hn = {
|
|
1304
|
+
key: 0,
|
|
1305
|
+
class: "tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]"
|
|
1306
|
+
}, gn = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, _n = {
|
|
1307
|
+
key: 1,
|
|
1308
|
+
class: "tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]"
|
|
1309
|
+
}, vn = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, yn = {
|
|
1310
|
+
key: 2,
|
|
1311
|
+
class: "tpl:relative"
|
|
1312
|
+
}, bn = ["innerHTML"], xn = {
|
|
1313
|
+
key: 0,
|
|
1314
|
+
class: "tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",
|
|
1315
|
+
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1316
|
+
}, Sn = /* @__PURE__ */ y({
|
|
1317
|
+
__name: "CustomBlock",
|
|
1318
|
+
props: {
|
|
1319
|
+
block: {},
|
|
1320
|
+
viewport: {}
|
|
1321
|
+
},
|
|
1322
|
+
emits: ["fetchData"],
|
|
1323
|
+
setup(t, { emit: n }) {
|
|
1324
|
+
let r = t, i = n, { t: a } = st(), o = ae(nt, null), c = h(""), l = h(!1), d = x(() => o?.getDefinition(r.block.customType)), f = x(() => !!d.value), { isFetching: p, fetch: m, needsFetch: g, hasDataSource: v } = St({
|
|
1325
|
+
definition: d,
|
|
1326
|
+
block: x(() => r.block),
|
|
1327
|
+
onUpdate: (e, t) => {
|
|
1328
|
+
i("fetchData", {
|
|
1329
|
+
fieldValues: e,
|
|
1330
|
+
dataSourceFetched: t
|
|
1331
|
+
});
|
|
1332
|
+
}
|
|
1333
|
+
});
|
|
1334
|
+
async function y() {
|
|
1335
|
+
if (o) {
|
|
1336
|
+
l.value = !1;
|
|
1337
|
+
try {
|
|
1338
|
+
let e = await o.renderCustomBlock(r.block);
|
|
1339
|
+
e.includes("Template render error:") && (l.value = !0), c.value = e;
|
|
1340
|
+
} catch {
|
|
1341
|
+
l.value = !0, c.value = "";
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
let S = Me(y, 150);
|
|
1346
|
+
return u(() => {
|
|
1347
|
+
y();
|
|
1348
|
+
}), s(() => r.block.fieldValues, () => {
|
|
1349
|
+
S();
|
|
1350
|
+
}, { deep: !0 }), (t, n) => (e(), w("div", mn, [f.value ? l.value ? (e(), w("div", _n, [N(j(ut), {
|
|
1351
|
+
size: 24,
|
|
1352
|
+
class: "tpl:text-[var(--tpl-danger)]"
|
|
1353
|
+
}), C("span", vn, M(j(a).customBlocks.renderError), 1)])) : (e(), w("div", yn, [C("div", { innerHTML: c.value }, null, 8, bn), j(v) && j(g) ? (e(), w("div", xn, [j(p) ? (e(), ne(dt, {
|
|
1354
|
+
key: 1,
|
|
1355
|
+
class: "tpl:w-48"
|
|
1356
|
+
})) : (e(), w("button", {
|
|
1357
|
+
key: 0,
|
|
1358
|
+
type: "button",
|
|
1359
|
+
class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-sm tpl:transition-all tpl:duration-150 hover:tpl:border-[var(--tpl-primary)] hover:tpl:shadow-md tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
1360
|
+
onClick: n[0] ||= b((...e) => j(m) && j(m)(...e), ["stop"])
|
|
1361
|
+
}, [d.value?.icon ? (e(), ne(nn, {
|
|
1362
|
+
key: 0,
|
|
1363
|
+
icon: d.value.icon,
|
|
1364
|
+
size: 16
|
|
1365
|
+
}, null, 8, ["icon"])) : O("", !0), _(" " + M(d.value?.dataSource?.label || j(a).customBlocks.dataSource.fetchButton), 1)]))])) : O("", !0)])) : (e(), w("div", hn, [N(j(Xt), {
|
|
1366
|
+
size: 24,
|
|
1367
|
+
class: "tpl:text-[var(--tpl-warning)]"
|
|
1368
|
+
}), C("span", gn, M(j(a).customBlocks.definitionNotFound), 1)]))]));
|
|
1369
|
+
}
|
|
1370
|
+
}), Cn = { class: "tpl:w-full" }, wn = /* @__PURE__ */ y({
|
|
1371
|
+
__name: "DividerBlock",
|
|
1372
|
+
props: {
|
|
1373
|
+
block: {},
|
|
1374
|
+
viewport: {}
|
|
1375
|
+
},
|
|
1376
|
+
setup(t) {
|
|
1377
|
+
let n = t, r = x(() => ({
|
|
1378
|
+
borderTop: `${n.block.thickness}px ${n.block.lineStyle} ${n.block.color}`,
|
|
1379
|
+
width: n.block.width === "full" ? "100%" : `${n.block.width}px`,
|
|
1380
|
+
margin: n.block.width === "full" ? "0" : "0 auto"
|
|
1381
|
+
}));
|
|
1382
|
+
return (t, n) => (e(), w("div", Cn, [C("hr", {
|
|
1383
|
+
class: "tpl:m-0 tpl:border-none",
|
|
1384
|
+
style: A(r.value)
|
|
1385
|
+
}, null, 4)]));
|
|
1386
|
+
}
|
|
1387
|
+
}), Tn = { class: "tpl:w-full" }, En = { class: "tpl:flex tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]" }, Dn = {
|
|
1388
|
+
key: 0,
|
|
1389
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1390
|
+
}, On = {
|
|
1391
|
+
key: 1,
|
|
1392
|
+
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1393
|
+
}, kn = /* @__PURE__ */ y({
|
|
1394
|
+
__name: "HtmlBlock",
|
|
1395
|
+
props: {
|
|
1396
|
+
block: {},
|
|
1397
|
+
viewport: {}
|
|
1398
|
+
},
|
|
1399
|
+
setup(t) {
|
|
1400
|
+
let n = t, { t: r } = st(), i = x(() => n.block.content.trim().length > 0);
|
|
1401
|
+
return (t, n) => (e(), w("div", Tn, [C("div", En, [N(j(Ut), {
|
|
1402
|
+
size: 24,
|
|
1403
|
+
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1404
|
+
}), i.value ? (e(), w("span", Dn, M(j(r).html.preview), 1)) : (e(), w("span", On, M(j(r).html.empty), 1))])]));
|
|
1405
|
+
}
|
|
1406
|
+
}), An = ["href"], jn = ["src", "alt"], Mn = ["src", "alt"], Nn = {
|
|
1407
|
+
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1408
|
+
style: { opacity: "0.7" }
|
|
1409
|
+
}, Pn = ["href"], Fn = ["src", "alt"], In = ["src", "alt"], Ln = {
|
|
1410
|
+
key: 3,
|
|
1411
|
+
class: "tpl:flex tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
|
|
1412
|
+
}, Rn = ["aria-label"], zn = { key: 1 }, Bn = /* @__PURE__ */ y({
|
|
1413
|
+
__name: "ImageBlock",
|
|
1414
|
+
props: {
|
|
1415
|
+
block: {},
|
|
1416
|
+
viewport: {}
|
|
1417
|
+
},
|
|
1418
|
+
emits: ["update"],
|
|
1419
|
+
setup(t, { emit: n }) {
|
|
1420
|
+
let r = t, i = n, { t: a } = st(), { syntax: o } = pt(), s = ae(at, null), c = x(() => !!s);
|
|
1421
|
+
async function l() {
|
|
1422
|
+
let e = await s?.({ accept: ["images"] });
|
|
1423
|
+
if (e) {
|
|
1424
|
+
let t = { src: e.url };
|
|
1425
|
+
e.alt && (t.alt = e.alt), i("update", t);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
let u = x(() => ({ textAlign: r.block.align })), d = x(() => ({
|
|
1429
|
+
maxWidth: "100%",
|
|
1430
|
+
width: r.block.width === "full" ? "100%" : `${r.block.width}px`,
|
|
1431
|
+
display: "block",
|
|
1432
|
+
margin: r.block.align === "center" ? "0 auto" : void 0,
|
|
1433
|
+
marginLeft: r.block.align === "right" ? "auto" : void 0
|
|
1434
|
+
})), f = x(() => pe(r.block.src, o));
|
|
1435
|
+
return (n, r) => (e(), w("div", {
|
|
1436
|
+
class: "tpl:w-full",
|
|
1437
|
+
style: A(u.value)
|
|
1438
|
+
}, [t.block.src && f.value && t.block.placeholderUrl ? (e(), w(D, { key: 0 }, [t.block.linkUrl ? (e(), w("a", {
|
|
1439
|
+
key: 0,
|
|
1440
|
+
href: t.block.linkUrl,
|
|
1441
|
+
target: "_blank",
|
|
1442
|
+
rel: "noopener noreferrer",
|
|
1443
|
+
onClick: r[0] ||= b(() => {}, ["prevent"])
|
|
1444
|
+
}, [C("img", {
|
|
1445
|
+
class: "tpl:border-0",
|
|
1446
|
+
loading: "lazy",
|
|
1447
|
+
src: t.block.placeholderUrl,
|
|
1448
|
+
alt: t.block.alt || j(a).image.altTextPlaceholder,
|
|
1449
|
+
style: A(d.value)
|
|
1450
|
+
}, null, 12, jn)], 8, An)) : (e(), w("img", {
|
|
1451
|
+
key: 1,
|
|
1452
|
+
class: "tpl:border-0",
|
|
1453
|
+
src: t.block.placeholderUrl,
|
|
1454
|
+
alt: t.block.alt,
|
|
1455
|
+
style: A(d.value)
|
|
1456
|
+
}, null, 12, Mn))], 64)) : t.block.src && f.value ? (e(), w("div", {
|
|
1457
|
+
key: 1,
|
|
1458
|
+
class: "tpl:!flex tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
|
|
1459
|
+
style: A([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, d.value])
|
|
1460
|
+
}, [N(j(Jt), {
|
|
1461
|
+
size: 32,
|
|
1462
|
+
"stroke-width": 1.5,
|
|
1463
|
+
class: "tpl:text-[var(--tpl-primary)]",
|
|
1464
|
+
style: { opacity: "0.5" }
|
|
1465
|
+
}), C("span", Nn, M(t.block.src), 1)], 4)) : t.block.src ? (e(), w(D, { key: 2 }, [t.block.linkUrl ? (e(), w("a", {
|
|
1466
|
+
key: 0,
|
|
1467
|
+
href: t.block.linkUrl,
|
|
1468
|
+
target: "_blank",
|
|
1469
|
+
rel: "noopener noreferrer",
|
|
1470
|
+
onClick: r[1] ||= b(() => {}, ["prevent"])
|
|
1471
|
+
}, [C("img", {
|
|
1472
|
+
class: "tpl:border-0",
|
|
1473
|
+
loading: "lazy",
|
|
1474
|
+
src: t.block.src,
|
|
1475
|
+
alt: t.block.alt || j(a).image.altTextPlaceholder,
|
|
1476
|
+
style: A(d.value)
|
|
1477
|
+
}, null, 12, Fn)], 8, Pn)) : (e(), w("img", {
|
|
1478
|
+
key: 1,
|
|
1479
|
+
class: "tpl:border-0",
|
|
1480
|
+
src: t.block.src,
|
|
1481
|
+
alt: t.block.alt,
|
|
1482
|
+
style: A(d.value)
|
|
1483
|
+
}, null, 12, In))], 64)) : (e(), w("div", Ln, [c.value ? (e(), w("button", {
|
|
1484
|
+
key: 0,
|
|
1485
|
+
"aria-label": j(a).image.browseMedia,
|
|
1486
|
+
class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:duration-150 tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
1487
|
+
onClick: b(l, ["stop"])
|
|
1488
|
+
}, [N(j(Jt), {
|
|
1489
|
+
size: 14,
|
|
1490
|
+
"stroke-width": 1.5
|
|
1491
|
+
}), _(" " + M(j(a).image.browseMedia), 1)], 8, Rn)) : (e(), w("span", zn, M(j(a).image.clickToAdd), 1))]))], 4));
|
|
1492
|
+
}
|
|
1493
|
+
}), Vn = { class: "tpl:w-full" }, Hn = ["href"], Un = {
|
|
1494
|
+
key: 1,
|
|
1495
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
1496
|
+
}, Wn = /* @__PURE__ */ y({
|
|
1497
|
+
__name: "MenuBlock",
|
|
1498
|
+
props: {
|
|
1499
|
+
block: {},
|
|
1500
|
+
viewport: {}
|
|
1501
|
+
},
|
|
1502
|
+
setup(t) {
|
|
1503
|
+
let n = t, { t: r } = st(), i = x(() => ({
|
|
1504
|
+
display: "flex",
|
|
1505
|
+
flexWrap: "wrap",
|
|
1506
|
+
gap: `0 ${n.block.spacing}px`,
|
|
1507
|
+
justifyContent: n.block.textAlign === "left" ? "flex-start" : n.block.textAlign === "right" ? "flex-end" : "center",
|
|
1508
|
+
fontSize: `${n.block.fontSize}px`,
|
|
1509
|
+
fontFamily: n.block.fontFamily || "inherit",
|
|
1510
|
+
alignItems: "center"
|
|
1511
|
+
})), a = x(() => n.block.items.length > 0);
|
|
1512
|
+
function o(e) {
|
|
1513
|
+
return e || n.block.linkColor || n.block.color;
|
|
1514
|
+
}
|
|
1515
|
+
return (n, s) => (e(), w("div", Vn, [a.value ? (e(), w("div", {
|
|
1516
|
+
key: 0,
|
|
1517
|
+
style: A(i.value)
|
|
1518
|
+
}, [(e(!0), w(D, null, c(t.block.items, (n, r) => (e(), w(D, { key: n.id }, [C("a", {
|
|
1519
|
+
href: n.url || "#",
|
|
1520
|
+
class: "tpl:cursor-default tpl:no-underline",
|
|
1521
|
+
style: A({
|
|
1522
|
+
color: o(n.color),
|
|
1523
|
+
fontWeight: n.bold ? "bold" : "normal",
|
|
1524
|
+
textDecoration: n.underline ? "underline" : "none"
|
|
1525
|
+
}),
|
|
1526
|
+
onClick: s[0] ||= b(() => {}, ["prevent"])
|
|
1527
|
+
}, M(n.text || "..."), 13, Hn), r < t.block.items.length - 1 ? (e(), w("span", {
|
|
1528
|
+
key: 0,
|
|
1529
|
+
style: A({
|
|
1530
|
+
color: t.block.separatorColor,
|
|
1531
|
+
padding: `0 ${t.block.spacing}px`
|
|
1532
|
+
})
|
|
1533
|
+
}, M(t.block.separator), 5)) : O("", !0)], 64))), 128))], 4)) : (e(), w("div", Un, [N(j(Yt), { size: 16 }), C("span", null, M(j(r).menu.addLinks), 1)]))]));
|
|
1534
|
+
}
|
|
1535
|
+
});
|
|
1536
|
+
//#endregion
|
|
1537
|
+
//#region src/composables/useEditableTextBlock.ts
|
|
1538
|
+
function Gn(e) {
|
|
1539
|
+
let t = ae(it, []), { syntax: n } = pt(), r = x(() => xe(le(e(), t), n)), i = h(!1), a = h(null), { top: o, left: s } = Ie(a), c = x(() => ({
|
|
1540
|
+
top: o.value - 8,
|
|
1541
|
+
left: s.value
|
|
1542
|
+
}));
|
|
1543
|
+
function l() {
|
|
1544
|
+
i.value = !0;
|
|
1545
|
+
}
|
|
1546
|
+
function u() {
|
|
1547
|
+
i.value = !1;
|
|
1548
|
+
}
|
|
1549
|
+
return {
|
|
1550
|
+
isEditing: i,
|
|
1551
|
+
blockRef: a,
|
|
1552
|
+
toolbarPosition: c,
|
|
1553
|
+
resolvedContent: r,
|
|
1554
|
+
handleDoubleClick: l,
|
|
1555
|
+
handleEditorDone: u
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
//#endregion
|
|
1559
|
+
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1560
|
+
var Kn = ["innerHTML"], qn = /* @__PURE__ */ y({
|
|
1561
|
+
__name: "ParagraphBlock",
|
|
1562
|
+
props: {
|
|
1563
|
+
block: {},
|
|
1564
|
+
viewport: {}
|
|
1565
|
+
},
|
|
1566
|
+
setup(t) {
|
|
1567
|
+
let n = t, r = se(() => import("./ParagraphEditor-C8IP9HOZ.js")), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Gn(() => n.block.content);
|
|
1568
|
+
return (n, u) => (e(), w("div", {
|
|
1569
|
+
ref_key: "blockRef",
|
|
1570
|
+
ref: a,
|
|
1571
|
+
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1572
|
+
onDblclick: u[0] ||= (...e) => j(c) && j(c)(...e)
|
|
1573
|
+
}, [j(i) ? (e(), ne(j(r), {
|
|
1574
|
+
key: 0,
|
|
1575
|
+
block: t.block,
|
|
1576
|
+
"toolbar-position": j(o),
|
|
1577
|
+
onDone: j(l)
|
|
1578
|
+
}, null, 8, [
|
|
1579
|
+
"block",
|
|
1580
|
+
"toolbar-position",
|
|
1581
|
+
"onDone"
|
|
1582
|
+
])) : (e(), w("div", {
|
|
1583
|
+
key: 1,
|
|
1584
|
+
class: "tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_li]:tpl:my-1 [&_ol]:tpl:my-2 [&_ol]:tpl:pl-6 [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0 [&_s]:tpl:line-through [&_sub]:tpl:align-sub [&_sub]:tpl:text-[0.75em] [&_sup]:tpl:align-super [&_sup]:tpl:text-[0.75em] [&_ul]:tpl:my-2 [&_ul]:tpl:pl-6",
|
|
1585
|
+
innerHTML: j(s)
|
|
1586
|
+
}, null, 8, Kn))], 544));
|
|
1587
|
+
}
|
|
1588
|
+
});
|
|
1589
|
+
//#endregion
|
|
1590
|
+
//#region src/utils/blockComponentResolver.ts
|
|
1591
|
+
function Jn(e, t, n) {
|
|
1592
|
+
if (t) {
|
|
1593
|
+
let n = t.getComponent(e);
|
|
1594
|
+
if (n) return n;
|
|
1595
|
+
}
|
|
1596
|
+
return n[e.type] ?? null;
|
|
1597
|
+
}
|
|
1598
|
+
function Yn(e) {
|
|
1599
|
+
let { padding: t, margin: n, backgroundColor: r } = e.styles;
|
|
1600
|
+
return {
|
|
1601
|
+
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
1602
|
+
margin: `${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,
|
|
1603
|
+
backgroundColor: r || "transparent"
|
|
1604
|
+
};
|
|
1605
|
+
}
|
|
1606
|
+
//#endregion
|
|
1607
|
+
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
1608
|
+
var Xn = ["data-block-id", "data-block-type"], Zn = ["aria-label"], Qn = [
|
|
1609
|
+
"aria-label",
|
|
1610
|
+
"aria-pressed",
|
|
1611
|
+
"title"
|
|
1612
|
+
], $n = ["aria-label", "title"], er = ["aria-label", "title"], tr = ["aria-label", "title"], nr = {
|
|
1613
|
+
key: 1,
|
|
1614
|
+
class: "tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"
|
|
1615
|
+
}, rr = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, ir = {
|
|
1616
|
+
key: 2,
|
|
1617
|
+
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
1618
|
+
}, ar = ["aria-label", "title"], or = {
|
|
1619
|
+
key: 3,
|
|
1620
|
+
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
1621
|
+
}, sr = ["aria-label"], cr = /* @__PURE__ */ ft(/* @__PURE__ */ y({
|
|
1622
|
+
__name: "BlockWrapper",
|
|
1623
|
+
props: {
|
|
1624
|
+
block: {},
|
|
1625
|
+
isSelected: { type: Boolean },
|
|
1626
|
+
viewport: {},
|
|
1627
|
+
previewMode: { type: Boolean }
|
|
1628
|
+
},
|
|
1629
|
+
emits: ["select"],
|
|
1630
|
+
setup(t, { emit: n }) {
|
|
1631
|
+
let i = se(() => import("./BlockA11yBadge-C0S6kPC4.js")), a = t, o = n, { t: s, format: c } = st(), u = ae(We, null), d = h(null), f = x(() => u?.liftedBlockId.value === a.block.id), p = x(() => f.value ? c(s.blockActions.dragLifted, { block: a.block.type }) : s.blockActions.drag);
|
|
1632
|
+
async function m() {
|
|
1633
|
+
await r(), d.value?.focus();
|
|
1634
|
+
}
|
|
1635
|
+
function g(e) {
|
|
1636
|
+
if (u) {
|
|
1637
|
+
if (e.key === " " || e.key === "Enter") {
|
|
1638
|
+
e.preventDefault(), e.stopPropagation(), f.value ? u.drop(a.block.id) : u.lift(a.block.id);
|
|
1639
|
+
return;
|
|
1640
|
+
}
|
|
1641
|
+
if (f.value) {
|
|
1642
|
+
if (e.key === "Escape") {
|
|
1643
|
+
e.preventDefault(), e.stopPropagation(), u.cancel(), m();
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1646
|
+
if (e.key === "ArrowUp") {
|
|
1647
|
+
e.preventDefault(), e.stopPropagation(), u.moveUp(a.block.id), m();
|
|
1648
|
+
return;
|
|
1649
|
+
}
|
|
1650
|
+
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), u.moveDown(a.block.id), m());
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
let y = x(() => !a.viewport || !a.block.visibility ? !1 : a.block.visibility[a.viewport] === !1), S = x(() => a.viewport ? {
|
|
1655
|
+
desktop: s.viewport.desktop,
|
|
1656
|
+
tablet: s.viewport.tablet,
|
|
1657
|
+
mobile: s.viewport.mobile
|
|
1658
|
+
}[a.viewport] ?? a.viewport : ""), T = x(() => !!a.block.displayCondition), E = ae(Ge, null), ee = ae(Je, null), D = ae(qe, {}), k = x(() => !!D.savedModules), te = x(() => D.comments?.getBlockCount(a.block.id) ?? 0), ne = x(() => Yn(a.block));
|
|
1659
|
+
function re(e) {
|
|
1660
|
+
a.previewMode || (e.stopPropagation(), o("select"));
|
|
1661
|
+
}
|
|
1662
|
+
function ie() {
|
|
1663
|
+
E?.deleteBlock(a.block.id);
|
|
1664
|
+
}
|
|
1665
|
+
function oe() {
|
|
1666
|
+
E?.duplicateBlock(a.block);
|
|
1667
|
+
}
|
|
1668
|
+
function ce() {
|
|
1669
|
+
D.savedModules?.openSaveDialog(a.block.id);
|
|
1670
|
+
}
|
|
1671
|
+
function le() {
|
|
1672
|
+
ee?.toggleBlock(a.block.id);
|
|
1673
|
+
}
|
|
1674
|
+
return (n, r) => (e(), w("div", {
|
|
1675
|
+
class: v(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow tpl:duration-150", {
|
|
1676
|
+
"tpl-block--selected": t.isSelected,
|
|
1677
|
+
"tpl-block--idle": !t.isSelected,
|
|
1678
|
+
"tpl-block--lifted": f.value
|
|
1679
|
+
}]),
|
|
1680
|
+
style: A(ne.value),
|
|
1681
|
+
"data-block-id": t.block.id,
|
|
1682
|
+
"data-block-type": t.block.type,
|
|
1683
|
+
draggable: "false",
|
|
1684
|
+
onClick: re
|
|
1685
|
+
}, [
|
|
1686
|
+
N(j(i), { "block-id": t.block.id }, null, 8, ["block-id"]),
|
|
1687
|
+
t.isSelected ? (e(), w("div", {
|
|
1688
|
+
key: 0,
|
|
1689
|
+
role: "toolbar",
|
|
1690
|
+
"aria-label": j(s).blockActions.drag,
|
|
1691
|
+
class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:-right-2 tpl:top-1/2 tpl:z-10 tpl:flex tpl:-translate-y-1/2 tpl:translate-x-full tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
|
|
1692
|
+
}, [
|
|
1693
|
+
C("button", {
|
|
1694
|
+
ref_key: "dragButtonRef",
|
|
1695
|
+
ref: d,
|
|
1696
|
+
class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150 tpl:active:cursor-grabbing",
|
|
1697
|
+
"aria-label": p.value,
|
|
1698
|
+
"aria-pressed": f.value,
|
|
1699
|
+
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
1700
|
+
title: j(s).blockActions.drag,
|
|
1701
|
+
onKeydown: g
|
|
1702
|
+
}, [N(j(qt), {
|
|
1703
|
+
size: 14,
|
|
1704
|
+
"stroke-width": 1.5
|
|
1705
|
+
})], 40, Qn),
|
|
1706
|
+
C("button", {
|
|
1707
|
+
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150",
|
|
1708
|
+
"aria-label": j(s).blockActions.duplicate,
|
|
1709
|
+
title: j(s).blockActions.duplicate,
|
|
1710
|
+
onClick: b(oe, ["stop"])
|
|
1711
|
+
}, [N(j(Wt), {
|
|
1712
|
+
size: 14,
|
|
1713
|
+
"stroke-width": 1.5
|
|
1714
|
+
})], 8, $n),
|
|
1715
|
+
k.value ? (e(), w("button", {
|
|
1716
|
+
key: 0,
|
|
1717
|
+
class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150",
|
|
1718
|
+
"aria-label": j(s).blockActions.saveAsModule,
|
|
1719
|
+
title: j(s).blockActions.saveAsModule,
|
|
1720
|
+
onClick: b(ce, ["stop"])
|
|
1721
|
+
}, [N(j(Vt), {
|
|
1722
|
+
size: 14,
|
|
1723
|
+
"stroke-width": 1.5
|
|
1724
|
+
})], 8, er)) : O("", !0),
|
|
1725
|
+
C("button", {
|
|
1726
|
+
class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:duration-150",
|
|
1727
|
+
"aria-label": j(s).blockActions.delete,
|
|
1728
|
+
title: j(s).blockActions.delete,
|
|
1729
|
+
onClick: b(ie, ["stop"])
|
|
1730
|
+
}, [N(j(lt), {
|
|
1731
|
+
size: 14,
|
|
1732
|
+
"stroke-width": 1.5
|
|
1733
|
+
})], 8, tr)
|
|
1734
|
+
], 8, Zn)) : O("", !0),
|
|
1735
|
+
y.value ? (e(), w("div", nr, [C("span", rr, [N(j(Gt), {
|
|
1736
|
+
size: 12,
|
|
1737
|
+
"stroke-width": 1.5
|
|
1738
|
+
}), _(" " + M(j(c)(j(s).blockActions.hiddenOnViewport, { viewport: S.value })), 1)])])) : O("", !0),
|
|
1739
|
+
T.value && !y.value ? (e(), w("div", ir, [C("button", {
|
|
1740
|
+
class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
1741
|
+
"aria-label": j(s).blockActions.conditionToggle,
|
|
1742
|
+
title: t.block.displayCondition?.label,
|
|
1743
|
+
onClick: b(le, ["stop"])
|
|
1744
|
+
}, [N(j(Kt), {
|
|
1745
|
+
size: 12,
|
|
1746
|
+
"stroke-width": 2
|
|
1747
|
+
})], 8, ar)])) : O("", !0),
|
|
1748
|
+
te.value > 0 && !y.value ? (e(), w("div", or, [C("button", {
|
|
1749
|
+
class: "tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:duration-150 tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]",
|
|
1750
|
+
"aria-label": j(c)(j(s).blockActions.comments, { count: String(te.value) }),
|
|
1751
|
+
onClick: r[0] ||= b((e) => j(D).comments?.openForBlock(t.block.id), ["stop"])
|
|
1752
|
+
}, [N(j(ct), {
|
|
1753
|
+
size: 12,
|
|
1754
|
+
"stroke-width": 2.5
|
|
1755
|
+
}), _(" " + M(te.value), 1)], 8, sr)])) : O("", !0),
|
|
1756
|
+
l(n.$slots, "default", {}, void 0, !0)
|
|
1757
|
+
], 14, Xn));
|
|
1758
|
+
}
|
|
1759
|
+
}), [["__scopeId", "data-v-850614e7"]]), lr = ["innerHTML"], ur = /* @__PURE__ */ y({
|
|
1760
|
+
__name: "TitleBlock",
|
|
1761
|
+
props: {
|
|
1762
|
+
block: {},
|
|
1763
|
+
viewport: {}
|
|
1764
|
+
},
|
|
1765
|
+
setup(t) {
|
|
1766
|
+
let n = t, r = se(() => import("./TitleEditor-21D8_OUQ.js")), { isEditing: i, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Gn(() => n.block.content), u = x(() => {
|
|
1767
|
+
let e = {
|
|
1768
|
+
fontSize: `${De[n.block.level]}px`,
|
|
1769
|
+
color: n.block.color,
|
|
1770
|
+
textAlign: n.block.textAlign
|
|
1771
|
+
};
|
|
1772
|
+
return n.block.fontFamily && (e.fontFamily = n.block.fontFamily), e;
|
|
1773
|
+
});
|
|
1774
|
+
return (n, d) => (e(), w("div", {
|
|
1775
|
+
ref_key: "blockRef",
|
|
1776
|
+
ref: a,
|
|
1777
|
+
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1778
|
+
style: A(u.value),
|
|
1779
|
+
onDblclick: d[0] ||= (...e) => j(c) && j(c)(...e)
|
|
1780
|
+
}, [j(i) ? (e(), ne(j(r), {
|
|
1781
|
+
key: 0,
|
|
1782
|
+
block: t.block,
|
|
1783
|
+
"toolbar-position": j(o),
|
|
1784
|
+
onDone: j(l)
|
|
1785
|
+
}, null, 8, [
|
|
1786
|
+
"block",
|
|
1787
|
+
"toolbar-position",
|
|
1788
|
+
"onDone"
|
|
1789
|
+
])) : (e(), w("div", {
|
|
1790
|
+
key: 1,
|
|
1791
|
+
class: "tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0",
|
|
1792
|
+
innerHTML: j(s)
|
|
1793
|
+
}, null, 8, lr))], 36));
|
|
1794
|
+
}
|
|
1795
|
+
}), dr = Object.defineProperty, fr = Object.getOwnPropertySymbols, pr = Object.prototype.hasOwnProperty, mr = Object.prototype.propertyIsEnumerable, hr = (e, t, n) => t in e ? dr(e, t, {
|
|
1796
|
+
enumerable: !0,
|
|
1797
|
+
configurable: !0,
|
|
1798
|
+
writable: !0,
|
|
1799
|
+
value: n
|
|
1800
|
+
}) : e[t] = n, gr = (e, t) => {
|
|
1801
|
+
for (var n in t ||= {}) pr.call(t, n) && hr(e, n, t[n]);
|
|
1802
|
+
if (fr) for (var n of fr(t)) mr.call(t, n) && hr(e, n, t[n]);
|
|
1803
|
+
return e;
|
|
1804
|
+
}, _r = (e, t) => {
|
|
1805
|
+
var n = {};
|
|
1806
|
+
for (var r in e) pr.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
1807
|
+
if (e != null && fr) for (var r of fr(e)) t.indexOf(r) < 0 && mr.call(e, r) && (n[r] = e[r]);
|
|
1808
|
+
return n;
|
|
1809
|
+
}, vr = "[vue-draggable-plus]: ";
|
|
1810
|
+
function yr(e) {
|
|
1811
|
+
console.warn(vr + e);
|
|
1812
|
+
}
|
|
1813
|
+
function br(e) {
|
|
1814
|
+
console.error(vr + e);
|
|
1815
|
+
}
|
|
1816
|
+
function xr(e, t, n) {
|
|
1817
|
+
return n >= 0 && n < e.length && e.splice(n, 0, e.splice(t, 1)[0]), e;
|
|
1818
|
+
}
|
|
1819
|
+
function Sr(e) {
|
|
1820
|
+
return e.replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
|
|
1821
|
+
}
|
|
1822
|
+
function Cr(e) {
|
|
1823
|
+
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[Sr(n)] = e[n]), t), {});
|
|
1824
|
+
}
|
|
1825
|
+
function wr(e, t) {
|
|
1826
|
+
return Array.isArray(e) && e.splice(t, 1), e;
|
|
1827
|
+
}
|
|
1828
|
+
function Tr(e, t, n) {
|
|
1829
|
+
return Array.isArray(e) && e.splice(t, 0, n), e;
|
|
1830
|
+
}
|
|
1831
|
+
function Er(e) {
|
|
1832
|
+
return e === void 0;
|
|
1833
|
+
}
|
|
1834
|
+
function Dr(e) {
|
|
1835
|
+
return typeof e == "string";
|
|
1836
|
+
}
|
|
1837
|
+
function Or(e, t, n) {
|
|
1838
|
+
let r = e.children[n];
|
|
1839
|
+
e.insertBefore(t, r);
|
|
1840
|
+
}
|
|
1841
|
+
function kr(e) {
|
|
1842
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
1843
|
+
}
|
|
1844
|
+
function Ar(e, t = document) {
|
|
1845
|
+
let n = null;
|
|
1846
|
+
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n || yr(`Element not found: ${e}`), n;
|
|
1847
|
+
}
|
|
1848
|
+
function jr(e, t, n = null) {
|
|
1849
|
+
return function(...r) {
|
|
1850
|
+
return e.apply(n, r), t.apply(n, r);
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
function Mr(e, t) {
|
|
1854
|
+
let n = gr({}, e);
|
|
1855
|
+
return Object.keys(t).forEach((r) => {
|
|
1856
|
+
n[r] ? n[r] = jr(e[r], t[r]) : n[r] = t[r];
|
|
1857
|
+
}), n;
|
|
1858
|
+
}
|
|
1859
|
+
function Nr(e) {
|
|
1860
|
+
return e instanceof HTMLElement;
|
|
1861
|
+
}
|
|
1862
|
+
function Pr(e, t) {
|
|
1863
|
+
Object.keys(e).forEach((n) => {
|
|
1864
|
+
t(n, e[n]);
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
function Fr(e) {
|
|
1868
|
+
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
1869
|
+
}
|
|
1870
|
+
var Ir = Object.assign;
|
|
1871
|
+
function Lr(e, t) {
|
|
1872
|
+
var n = Object.keys(e);
|
|
1873
|
+
if (Object.getOwnPropertySymbols) {
|
|
1874
|
+
var r = Object.getOwnPropertySymbols(e);
|
|
1875
|
+
t && (r = r.filter(function(t) {
|
|
1876
|
+
return Object.getOwnPropertyDescriptor(e, t).enumerable;
|
|
1877
|
+
})), n.push.apply(n, r);
|
|
1878
|
+
}
|
|
1879
|
+
return n;
|
|
1880
|
+
}
|
|
1881
|
+
function Rr(e) {
|
|
1882
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1883
|
+
var n = arguments[t] == null ? {} : arguments[t];
|
|
1884
|
+
t % 2 ? Lr(Object(n), !0).forEach(function(t) {
|
|
1885
|
+
Br(e, t, n[t]);
|
|
1886
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Lr(Object(n)).forEach(function(t) {
|
|
1887
|
+
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
1888
|
+
});
|
|
1889
|
+
}
|
|
1890
|
+
return e;
|
|
1891
|
+
}
|
|
1892
|
+
function zr(e) {
|
|
1893
|
+
"@babel/helpers - typeof";
|
|
1894
|
+
return zr = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
1895
|
+
return typeof e;
|
|
1896
|
+
} : function(e) {
|
|
1897
|
+
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
1898
|
+
}, zr(e);
|
|
1899
|
+
}
|
|
1900
|
+
function Br(e, t, n) {
|
|
1901
|
+
return t in e ? Object.defineProperty(e, t, {
|
|
1902
|
+
value: n,
|
|
1903
|
+
enumerable: !0,
|
|
1904
|
+
configurable: !0,
|
|
1905
|
+
writable: !0
|
|
1906
|
+
}) : e[t] = n, e;
|
|
1907
|
+
}
|
|
1908
|
+
function Vr() {
|
|
1909
|
+
return Vr = Object.assign || function(e) {
|
|
1910
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
1911
|
+
var n = arguments[t];
|
|
1912
|
+
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
1913
|
+
}
|
|
1914
|
+
return e;
|
|
1915
|
+
}, Vr.apply(this, arguments);
|
|
1916
|
+
}
|
|
1917
|
+
function Hr(e, t) {
|
|
1918
|
+
if (e == null) return {};
|
|
1919
|
+
var n = {}, r = Object.keys(e), i, a;
|
|
1920
|
+
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
1921
|
+
return n;
|
|
1922
|
+
}
|
|
1923
|
+
function Ur(e, t) {
|
|
1924
|
+
if (e == null) return {};
|
|
1925
|
+
var n = Hr(e, t), r, i;
|
|
1926
|
+
if (Object.getOwnPropertySymbols) {
|
|
1927
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
1928
|
+
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
1929
|
+
}
|
|
1930
|
+
return n;
|
|
1931
|
+
}
|
|
1932
|
+
var Wr = "1.15.2";
|
|
1933
|
+
function Gr(e) {
|
|
1934
|
+
if (typeof window < "u" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
1935
|
+
}
|
|
1936
|
+
var Kr = Gr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), qr = Gr(/Edge/i), Jr = Gr(/firefox/i), Yr = Gr(/safari/i) && !Gr(/chrome/i) && !Gr(/android/i), Xr = Gr(/iP(ad|od|hone)/i), Zr = Gr(/chrome/i) && Gr(/android/i), Qr = {
|
|
1937
|
+
capture: !1,
|
|
1938
|
+
passive: !1
|
|
1939
|
+
};
|
|
1940
|
+
function F(e, t, n) {
|
|
1941
|
+
e.addEventListener(t, n, !Kr && Qr);
|
|
1942
|
+
}
|
|
1943
|
+
function I(e, t, n) {
|
|
1944
|
+
e.removeEventListener(t, n, !Kr && Qr);
|
|
1945
|
+
}
|
|
1946
|
+
function $r(e, t) {
|
|
1947
|
+
if (t) {
|
|
1948
|
+
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
1949
|
+
if (e.matches) return e.matches(t);
|
|
1950
|
+
if (e.msMatchesSelector) return e.msMatchesSelector(t);
|
|
1951
|
+
if (e.webkitMatchesSelector) return e.webkitMatchesSelector(t);
|
|
1952
|
+
} catch {
|
|
1953
|
+
return !1;
|
|
1954
|
+
}
|
|
1955
|
+
return !1;
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
function ei(e) {
|
|
1959
|
+
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
1960
|
+
}
|
|
1961
|
+
function ti(e, t, n, r) {
|
|
1962
|
+
if (e) {
|
|
1963
|
+
n ||= document;
|
|
1964
|
+
do {
|
|
1965
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && $r(e, t) : $r(e, t)) || r && e === n) return e;
|
|
1966
|
+
if (e === n) break;
|
|
1967
|
+
} while (e = ei(e));
|
|
1968
|
+
}
|
|
1969
|
+
return null;
|
|
1970
|
+
}
|
|
1971
|
+
var ni = /\s+/g;
|
|
1972
|
+
function L(e, t, n) {
|
|
1973
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(ni, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(ni, " "));
|
|
1974
|
+
}
|
|
1975
|
+
function R(e, t, n) {
|
|
1976
|
+
var r = e && e.style;
|
|
1977
|
+
if (r) {
|
|
1978
|
+
if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
|
|
1979
|
+
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
function ri(e, t) {
|
|
1983
|
+
var n = "";
|
|
1984
|
+
if (typeof e == "string") n = e;
|
|
1985
|
+
else do {
|
|
1986
|
+
var r = R(e, "transform");
|
|
1987
|
+
r && r !== "none" && (n = r + " " + n);
|
|
1988
|
+
} while (!t && (e = e.parentNode));
|
|
1989
|
+
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
1990
|
+
return i && new i(n);
|
|
1991
|
+
}
|
|
1992
|
+
function ii(e, t, n) {
|
|
1993
|
+
if (e) {
|
|
1994
|
+
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
1995
|
+
if (n) for (; i < a; i++) n(r[i], i);
|
|
1996
|
+
return r;
|
|
1997
|
+
}
|
|
1998
|
+
return [];
|
|
1999
|
+
}
|
|
2000
|
+
function ai() {
|
|
2001
|
+
return document.scrollingElement || document.documentElement;
|
|
2002
|
+
}
|
|
2003
|
+
function z(e, t, n, r, i) {
|
|
2004
|
+
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
2005
|
+
var a, o, s, c, l, u, d;
|
|
2006
|
+
if (e !== window && e.parentNode && e !== ai() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !Kr)) do
|
|
2007
|
+
if (i && i.getBoundingClientRect && (R(i, "transform") !== "none" || n && R(i, "position") !== "static")) {
|
|
2008
|
+
var f = i.getBoundingClientRect();
|
|
2009
|
+
o -= f.top + parseInt(R(i, "border-top-width")), s -= f.left + parseInt(R(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
2010
|
+
break;
|
|
2011
|
+
}
|
|
2012
|
+
while (i = i.parentNode);
|
|
2013
|
+
if (r && e !== window) {
|
|
2014
|
+
var p = ri(i || e), m = p && p.a, h = p && p.d;
|
|
2015
|
+
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
2016
|
+
}
|
|
2017
|
+
return {
|
|
2018
|
+
top: o,
|
|
2019
|
+
left: s,
|
|
2020
|
+
bottom: c,
|
|
2021
|
+
right: l,
|
|
2022
|
+
width: d,
|
|
2023
|
+
height: u
|
|
2024
|
+
};
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
2027
|
+
function oi(e, t, n) {
|
|
2028
|
+
for (var r = di(e, !0), i = z(e)[t]; r;) {
|
|
2029
|
+
var a = z(r)[n], o = void 0;
|
|
2030
|
+
if (o = i >= a, !o) return r;
|
|
2031
|
+
if (r === ai()) break;
|
|
2032
|
+
r = di(r, !1);
|
|
2033
|
+
}
|
|
2034
|
+
return !1;
|
|
2035
|
+
}
|
|
2036
|
+
function si(e, t, n, r) {
|
|
2037
|
+
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
2038
|
+
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && ti(o[a], n.draggable, e, !1)) {
|
|
2039
|
+
if (i === t) return o[a];
|
|
2040
|
+
i++;
|
|
2041
|
+
}
|
|
2042
|
+
a++;
|
|
2043
|
+
}
|
|
2044
|
+
return null;
|
|
2045
|
+
}
|
|
2046
|
+
function ci(e, t) {
|
|
2047
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || R(n, "display") === "none" || t && !$r(n, t));) n = n.previousElementSibling;
|
|
2048
|
+
return n || null;
|
|
2049
|
+
}
|
|
2050
|
+
function B(e, t) {
|
|
2051
|
+
var n = 0;
|
|
2052
|
+
if (!e || !e.parentNode) return -1;
|
|
2053
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || $r(e, t)) && n++;
|
|
2054
|
+
return n;
|
|
2055
|
+
}
|
|
2056
|
+
function li(e) {
|
|
2057
|
+
var t = 0, n = 0, r = ai();
|
|
2058
|
+
if (e) do {
|
|
2059
|
+
var i = ri(e), a = i.a, o = i.d;
|
|
2060
|
+
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
2061
|
+
} while (e !== r && (e = e.parentNode));
|
|
2062
|
+
return [t, n];
|
|
2063
|
+
}
|
|
2064
|
+
function ui(e, t) {
|
|
2065
|
+
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
2066
|
+
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
2067
|
+
}
|
|
2068
|
+
return -1;
|
|
2069
|
+
}
|
|
2070
|
+
function di(e, t) {
|
|
2071
|
+
if (!e || !e.getBoundingClientRect) return ai();
|
|
2072
|
+
var n = e, r = !1;
|
|
2073
|
+
do
|
|
2074
|
+
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
2075
|
+
var i = R(n);
|
|
2076
|
+
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
2077
|
+
if (!n.getBoundingClientRect || n === document.body) return ai();
|
|
2078
|
+
if (r || t) return n;
|
|
2079
|
+
r = !0;
|
|
2080
|
+
}
|
|
2081
|
+
}
|
|
2082
|
+
while (n = n.parentNode);
|
|
2083
|
+
return ai();
|
|
2084
|
+
}
|
|
2085
|
+
function fi(e, t) {
|
|
2086
|
+
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
2087
|
+
return e;
|
|
2088
|
+
}
|
|
2089
|
+
function pi(e, t) {
|
|
2090
|
+
return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
|
|
2091
|
+
}
|
|
2092
|
+
var mi;
|
|
2093
|
+
function hi(e, t) {
|
|
2094
|
+
return function() {
|
|
2095
|
+
if (!mi) {
|
|
2096
|
+
var n = arguments, r = this;
|
|
2097
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), mi = setTimeout(function() {
|
|
2098
|
+
mi = void 0;
|
|
2099
|
+
}, t);
|
|
2100
|
+
}
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
function gi() {
|
|
2104
|
+
clearTimeout(mi), mi = void 0;
|
|
2105
|
+
}
|
|
2106
|
+
function _i(e, t, n) {
|
|
2107
|
+
e.scrollLeft += t, e.scrollTop += n;
|
|
2108
|
+
}
|
|
2109
|
+
function vi(e) {
|
|
2110
|
+
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
2111
|
+
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
2112
|
+
}
|
|
2113
|
+
function yi(e, t, n) {
|
|
2114
|
+
var r = {};
|
|
2115
|
+
return Array.from(e.children).forEach(function(i) {
|
|
2116
|
+
if (!(!ti(i, t.draggable, e, !1) || i.animated || i === n)) {
|
|
2117
|
+
var a = z(i);
|
|
2118
|
+
r.left = Math.min(r.left ?? Infinity, a.left), r.top = Math.min(r.top ?? Infinity, a.top), r.right = Math.max(r.right ?? -Infinity, a.right), r.bottom = Math.max(r.bottom ?? -Infinity, a.bottom);
|
|
2119
|
+
}
|
|
2120
|
+
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
2121
|
+
}
|
|
2122
|
+
var V = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
2123
|
+
function bi() {
|
|
2124
|
+
var e = [], t;
|
|
2125
|
+
return {
|
|
2126
|
+
captureAnimationState: function() {
|
|
2127
|
+
e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
|
|
2128
|
+
if (!(R(t, "display") === "none" || t === Q.ghost)) {
|
|
2129
|
+
e.push({
|
|
2130
|
+
target: t,
|
|
2131
|
+
rect: z(t)
|
|
2132
|
+
});
|
|
2133
|
+
var n = Rr({}, e[e.length - 1].rect);
|
|
2134
|
+
if (t.thisAnimationDuration) {
|
|
2135
|
+
var r = ri(t, !0);
|
|
2136
|
+
r && (n.top -= r.f, n.left -= r.e);
|
|
2137
|
+
}
|
|
2138
|
+
t.fromRect = n;
|
|
2139
|
+
}
|
|
2140
|
+
});
|
|
2141
|
+
},
|
|
2142
|
+
addAnimationState: function(t) {
|
|
2143
|
+
e.push(t);
|
|
2144
|
+
},
|
|
2145
|
+
removeAnimationState: function(t) {
|
|
2146
|
+
e.splice(ui(e, { target: t }), 1);
|
|
2147
|
+
},
|
|
2148
|
+
animateAll: function(n) {
|
|
2149
|
+
var r = this;
|
|
2150
|
+
if (!this.options.animation) {
|
|
2151
|
+
clearTimeout(t), typeof n == "function" && n();
|
|
2152
|
+
return;
|
|
2153
|
+
}
|
|
2154
|
+
var i = !1, a = 0;
|
|
2155
|
+
e.forEach(function(e) {
|
|
2156
|
+
var t = 0, n = e.target, o = n.fromRect, s = z(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = ri(n, !0);
|
|
2157
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && pi(c, s) && !pi(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = Si(u, c, l, r.options)), pi(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() {
|
|
2158
|
+
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
2159
|
+
}, t), n.thisAnimationDuration = t);
|
|
2160
|
+
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
2161
|
+
typeof n == "function" && n();
|
|
2162
|
+
}, a) : typeof n == "function" && n(), e = [];
|
|
2163
|
+
},
|
|
2164
|
+
animate: function(e, t, n, r) {
|
|
2165
|
+
if (r) {
|
|
2166
|
+
R(e, "transition", ""), R(e, "transform", "");
|
|
2167
|
+
var i = ri(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
2168
|
+
e.animatingX = !!s, e.animatingY = !!c, R(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = xi(e), R(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), R(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
2169
|
+
R(e, "transition", ""), R(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
2170
|
+
}, r);
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2173
|
+
};
|
|
2174
|
+
}
|
|
2175
|
+
function xi(e) {
|
|
2176
|
+
return e.offsetWidth;
|
|
2177
|
+
}
|
|
2178
|
+
function Si(e, t, n, r) {
|
|
2179
|
+
return Math.sqrt((t.top - e.top) ** 2 + (t.left - e.left) ** 2) / Math.sqrt((t.top - n.top) ** 2 + (t.left - n.left) ** 2) * r.animation;
|
|
2180
|
+
}
|
|
2181
|
+
var Ci = [], wi = { initializeByDefault: !0 }, Ti = {
|
|
2182
|
+
mount: function(e) {
|
|
2183
|
+
for (var t in wi) wi.hasOwnProperty(t) && !(t in e) && (e[t] = wi[t]);
|
|
2184
|
+
Ci.forEach(function(t) {
|
|
2185
|
+
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
2186
|
+
}), Ci.push(e);
|
|
2187
|
+
},
|
|
2188
|
+
pluginEvent: function(e, t, n) {
|
|
2189
|
+
var r = this;
|
|
2190
|
+
this.eventCanceled = !1, n.cancel = function() {
|
|
2191
|
+
r.eventCanceled = !0;
|
|
2192
|
+
};
|
|
2193
|
+
var i = e + "Global";
|
|
2194
|
+
Ci.forEach(function(r) {
|
|
2195
|
+
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](Rr({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](Rr({ sortable: t }, n)));
|
|
2196
|
+
});
|
|
2197
|
+
},
|
|
2198
|
+
initializePlugins: function(e, t, n, r) {
|
|
2199
|
+
for (var i in Ci.forEach(function(r) {
|
|
2200
|
+
var i = r.pluginName;
|
|
2201
|
+
if (!(!e.options[i] && !r.initializeByDefault)) {
|
|
2202
|
+
var a = new r(e, t, e.options);
|
|
2203
|
+
a.sortable = e, a.options = e.options, e[i] = a, Vr(n, a.defaults);
|
|
2204
|
+
}
|
|
2205
|
+
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
2206
|
+
var a = this.modifyOption(e, i, e.options[i]);
|
|
2207
|
+
a !== void 0 && (e.options[i] = a);
|
|
2208
|
+
}
|
|
2209
|
+
},
|
|
2210
|
+
getEventProperties: function(e, t) {
|
|
2211
|
+
var n = {};
|
|
2212
|
+
return Ci.forEach(function(r) {
|
|
2213
|
+
typeof r.eventProperties == "function" && Vr(n, r.eventProperties.call(t[r.pluginName], e));
|
|
2214
|
+
}), n;
|
|
2215
|
+
},
|
|
2216
|
+
modifyOption: function(e, t, n) {
|
|
2217
|
+
var r;
|
|
2218
|
+
return Ci.forEach(function(i) {
|
|
2219
|
+
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
2220
|
+
}), r;
|
|
2221
|
+
}
|
|
2222
|
+
};
|
|
2223
|
+
function Ei(e) {
|
|
2224
|
+
var t = e.sortable, n = e.rootEl, r = e.name, i = e.targetEl, a = e.cloneEl, o = e.toEl, s = e.fromEl, c = e.oldIndex, l = e.newIndex, u = e.oldDraggableIndex, d = e.newDraggableIndex, f = e.originalEvent, p = e.putSortable, m = e.extraEventProperties;
|
|
2225
|
+
if (t ||= n && n[V], t) {
|
|
2226
|
+
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
2227
|
+
window.CustomEvent && !Kr && !qr ? h = new CustomEvent(r, {
|
|
2228
|
+
bubbles: !0,
|
|
2229
|
+
cancelable: !0
|
|
2230
|
+
}) : (h = document.createEvent("Event"), h.initEvent(r, !0, !0)), h.to = o || n, h.from = s || n, h.item = i || n, h.clone = a, h.oldIndex = c, h.newIndex = l, h.oldDraggableIndex = u, h.newDraggableIndex = d, h.originalEvent = f, h.pullMode = p ? p.lastPutMode : void 0;
|
|
2231
|
+
var v = Rr(Rr({}, m), Ti.getEventProperties(r, t));
|
|
2232
|
+
for (var y in v) h[y] = v[y];
|
|
2233
|
+
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
2234
|
+
}
|
|
2235
|
+
}
|
|
2236
|
+
var Di = ["evt"], H = function(e, t) {
|
|
2237
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = Ur(n, Di);
|
|
2238
|
+
Ti.pluginEvent.bind(Q)(e, t, Rr({
|
|
2239
|
+
dragEl: W,
|
|
2240
|
+
parentEl: G,
|
|
2241
|
+
ghostEl: K,
|
|
2242
|
+
rootEl: q,
|
|
2243
|
+
nextEl: Oi,
|
|
2244
|
+
lastDownEl: ki,
|
|
2245
|
+
cloneEl: J,
|
|
2246
|
+
cloneHidden: Ai,
|
|
2247
|
+
dragStarted: Wi,
|
|
2248
|
+
putSortable: X,
|
|
2249
|
+
activeSortable: Q.active,
|
|
2250
|
+
originalEvent: r,
|
|
2251
|
+
oldIndex: ji,
|
|
2252
|
+
oldDraggableIndex: Mi,
|
|
2253
|
+
newIndex: Y,
|
|
2254
|
+
newDraggableIndex: Ni,
|
|
2255
|
+
hideGhostForTarget: ca,
|
|
2256
|
+
unhideGhostForTarget: la,
|
|
2257
|
+
cloneNowHidden: function() {
|
|
2258
|
+
Ai = !0;
|
|
2259
|
+
},
|
|
2260
|
+
cloneNowShown: function() {
|
|
2261
|
+
Ai = !1;
|
|
2262
|
+
},
|
|
2263
|
+
dispatchSortableEvent: function(e) {
|
|
2264
|
+
U({
|
|
2265
|
+
sortable: t,
|
|
2266
|
+
name: e,
|
|
2267
|
+
originalEvent: r
|
|
2268
|
+
});
|
|
2269
|
+
}
|
|
2270
|
+
}, i));
|
|
2271
|
+
};
|
|
2272
|
+
function U(e) {
|
|
2273
|
+
Ei(Rr({
|
|
2274
|
+
putSortable: X,
|
|
2275
|
+
cloneEl: J,
|
|
2276
|
+
targetEl: W,
|
|
2277
|
+
rootEl: q,
|
|
2278
|
+
oldIndex: ji,
|
|
2279
|
+
oldDraggableIndex: Mi,
|
|
2280
|
+
newIndex: Y,
|
|
2281
|
+
newDraggableIndex: Ni
|
|
2282
|
+
}, e));
|
|
2283
|
+
}
|
|
2284
|
+
var W, G, K, q, Oi, ki, J, Ai, ji, Y, Mi, Ni, Pi, X, Fi = !1, Ii = !1, Li = [], Ri, zi, Bi, Vi, Hi, Ui, Wi, Gi, Ki, qi = !1, Ji = !1, Yi, Z, Xi = [], Zi = !1, Qi = [], $i = typeof document < "u", ea = Xr, ta = qr || Kr ? "cssFloat" : "float", na = $i && !Zr && !Xr && "draggable" in document.createElement("div"), ra = function() {
|
|
2285
|
+
if ($i) {
|
|
2286
|
+
if (Kr) return !1;
|
|
2287
|
+
var e = document.createElement("x");
|
|
2288
|
+
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
2289
|
+
}
|
|
2290
|
+
}(), ia = function(e, t) {
|
|
2291
|
+
var n = R(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = si(e, 0, t), a = si(e, 1, t), o = i && R(i), s = a && R(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + z(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + z(a).width;
|
|
2292
|
+
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
2293
|
+
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
2294
|
+
if (i && o.float && o.float !== "none") {
|
|
2295
|
+
var u = o.float === "left" ? "left" : "right";
|
|
2296
|
+
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
2297
|
+
}
|
|
2298
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[ta] === "none" || a && n[ta] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
2299
|
+
}, aa = function(e, t, n) {
|
|
2300
|
+
var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height;
|
|
2301
|
+
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
2302
|
+
}, oa = function(e, t) {
|
|
2303
|
+
var n;
|
|
2304
|
+
return Li.some(function(r) {
|
|
2305
|
+
var i = r[V].options.emptyInsertThreshold;
|
|
2306
|
+
if (!(!i || ci(r))) {
|
|
2307
|
+
var a = z(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
2308
|
+
if (o && s) return n = r;
|
|
2309
|
+
}
|
|
2310
|
+
}), n;
|
|
2311
|
+
}, sa = function(e) {
|
|
2312
|
+
function t(e, n) {
|
|
2313
|
+
return function(r, i, a, o) {
|
|
2314
|
+
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
2315
|
+
if (e == null && (n || s)) return !0;
|
|
2316
|
+
if (e == null || e === !1) return !1;
|
|
2317
|
+
if (n && e === "clone") return e;
|
|
2318
|
+
if (typeof e == "function") return t(e(r, i, a, o), n)(r, i, a, o);
|
|
2319
|
+
var c = (n ? r : i).options.group.name;
|
|
2320
|
+
return e === !0 || typeof e == "string" && e === c || e.join && e.indexOf(c) > -1;
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2323
|
+
var n = {}, r = e.group;
|
|
2324
|
+
(!r || zr(r) != "object") && (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n;
|
|
2325
|
+
}, ca = function() {
|
|
2326
|
+
!ra && K && R(K, "display", "none");
|
|
2327
|
+
}, la = function() {
|
|
2328
|
+
!ra && K && R(K, "display", "");
|
|
2329
|
+
};
|
|
2330
|
+
$i && !Zr && document.addEventListener("click", function(e) {
|
|
2331
|
+
if (Ii) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Ii = !1, !1;
|
|
2332
|
+
}, !0);
|
|
2333
|
+
var ua = function(e) {
|
|
2334
|
+
if (W) {
|
|
2335
|
+
e = e.touches ? e.touches[0] : e;
|
|
2336
|
+
var t = oa(e.clientX, e.clientY);
|
|
2337
|
+
if (t) {
|
|
2338
|
+
var n = {};
|
|
2339
|
+
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
2340
|
+
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[V]._onDragOver(n);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
}, da = function(e) {
|
|
2344
|
+
W && W.parentNode[V]._isOutsideThisEl(e.target);
|
|
2345
|
+
};
|
|
2346
|
+
function Q(e, t) {
|
|
2347
|
+
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
2348
|
+
this.el = e, this.options = t = Vr({}, t), e[V] = this;
|
|
2349
|
+
var n = {
|
|
2350
|
+
group: null,
|
|
2351
|
+
sort: !0,
|
|
2352
|
+
disabled: !1,
|
|
2353
|
+
store: null,
|
|
2354
|
+
handle: null,
|
|
2355
|
+
draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
|
|
2356
|
+
swapThreshold: 1,
|
|
2357
|
+
invertSwap: !1,
|
|
2358
|
+
invertedSwapThreshold: null,
|
|
2359
|
+
removeCloneOnHide: !0,
|
|
2360
|
+
direction: function() {
|
|
2361
|
+
return ia(e, this.options);
|
|
2362
|
+
},
|
|
2363
|
+
ghostClass: "sortable-ghost",
|
|
2364
|
+
chosenClass: "sortable-chosen",
|
|
2365
|
+
dragClass: "sortable-drag",
|
|
2366
|
+
ignore: "a, img",
|
|
2367
|
+
filter: null,
|
|
2368
|
+
preventOnFilter: !0,
|
|
2369
|
+
animation: 0,
|
|
2370
|
+
easing: null,
|
|
2371
|
+
setData: function(e, t) {
|
|
2372
|
+
e.setData("Text", t.textContent);
|
|
2373
|
+
},
|
|
2374
|
+
dropBubble: !1,
|
|
2375
|
+
dragoverBubble: !1,
|
|
2376
|
+
dataIdAttr: "data-id",
|
|
2377
|
+
delay: 0,
|
|
2378
|
+
delayOnTouchOnly: !1,
|
|
2379
|
+
touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
|
|
2380
|
+
forceFallback: !1,
|
|
2381
|
+
fallbackClass: "sortable-fallback",
|
|
2382
|
+
fallbackOnBody: !1,
|
|
2383
|
+
fallbackTolerance: 0,
|
|
2384
|
+
fallbackOffset: {
|
|
2385
|
+
x: 0,
|
|
2386
|
+
y: 0
|
|
2387
|
+
},
|
|
2388
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !Yr,
|
|
2389
|
+
emptyInsertThreshold: 5
|
|
2390
|
+
};
|
|
2391
|
+
for (var r in Ti.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
2392
|
+
for (var i in sa(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
2393
|
+
this.nativeDraggable = t.forceFallback ? !1 : na, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? F(e, "pointerdown", this._onTapStart) : (F(e, "mousedown", this._onTapStart), F(e, "touchstart", this._onTapStart)), this.nativeDraggable && (F(e, "dragover", this), F(e, "dragenter", this)), Li.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), Vr(this, bi());
|
|
2394
|
+
}
|
|
2395
|
+
Q.prototype = {
|
|
2396
|
+
constructor: Q,
|
|
2397
|
+
_isOutsideThisEl: function(e) {
|
|
2398
|
+
!this.el.contains(e) && e !== this.el && (Gi = null);
|
|
2399
|
+
},
|
|
2400
|
+
_getDirection: function(e, t) {
|
|
2401
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, W) : this.options.direction;
|
|
2402
|
+
},
|
|
2403
|
+
_onTapStart: function(e) {
|
|
2404
|
+
if (e.cancelable) {
|
|
2405
|
+
var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
|
|
2406
|
+
if (xa(n), !W && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && Yr && s && s.tagName.toUpperCase() === "SELECT") && (s = ti(s, r.draggable, n, !1), !(s && s.animated) && ki !== s)) {
|
|
2407
|
+
if (ji = B(s), Mi = B(s, r.draggable), typeof l == "function") {
|
|
2408
|
+
if (l.call(this, e, s, this)) {
|
|
2409
|
+
U({
|
|
2410
|
+
sortable: t,
|
|
2411
|
+
rootEl: c,
|
|
2412
|
+
name: "filter",
|
|
2413
|
+
targetEl: s,
|
|
2414
|
+
toEl: n,
|
|
2415
|
+
fromEl: n
|
|
2416
|
+
}), H("filter", t, { evt: e }), i && e.cancelable && e.preventDefault();
|
|
2417
|
+
return;
|
|
2418
|
+
}
|
|
2419
|
+
} else if (l && (l = l.split(",").some(function(r) {
|
|
2420
|
+
if (r = ti(c, r.trim(), n, !1), r) return U({
|
|
2421
|
+
sortable: t,
|
|
2422
|
+
rootEl: r,
|
|
2423
|
+
name: "filter",
|
|
2424
|
+
targetEl: s,
|
|
2425
|
+
fromEl: n,
|
|
2426
|
+
toEl: n
|
|
2427
|
+
}), H("filter", t, { evt: e }), !0;
|
|
2428
|
+
}), l)) {
|
|
2429
|
+
i && e.cancelable && e.preventDefault();
|
|
2430
|
+
return;
|
|
2431
|
+
}
|
|
2432
|
+
r.handle && !ti(c, r.handle, n, !1) || this._prepareDragStart(e, o, s);
|
|
2433
|
+
}
|
|
2434
|
+
}
|
|
2435
|
+
},
|
|
2436
|
+
_prepareDragStart: function(e, t, n) {
|
|
2437
|
+
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
2438
|
+
if (n && !W && n.parentNode === i) {
|
|
2439
|
+
var c = z(n);
|
|
2440
|
+
if (q = i, W = n, G = W.parentNode, Oi = W.nextSibling, ki = n, Pi = a.group, Q.dragged = W, Ri = {
|
|
2441
|
+
target: W,
|
|
2442
|
+
clientX: (t || e).clientX,
|
|
2443
|
+
clientY: (t || e).clientY
|
|
2444
|
+
}, Hi = Ri.clientX - c.left, Ui = Ri.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, W.style["will-change"] = "all", s = function() {
|
|
2445
|
+
if (H("delayEnded", r, { evt: e }), Q.eventCanceled) {
|
|
2446
|
+
r._onDrop();
|
|
2447
|
+
return;
|
|
2448
|
+
}
|
|
2449
|
+
r._disableDelayedDragEvents(), !Jr && r.nativeDraggable && (W.draggable = !0), r._triggerDragStart(e, t), U({
|
|
2450
|
+
sortable: r,
|
|
2451
|
+
name: "choose",
|
|
2452
|
+
originalEvent: e
|
|
2453
|
+
}), L(W, a.chosenClass, !0);
|
|
2454
|
+
}, a.ignore.split(",").forEach(function(e) {
|
|
2455
|
+
ii(W, e.trim(), ma);
|
|
2456
|
+
}), F(o, "dragover", ua), F(o, "mousemove", ua), F(o, "touchmove", ua), F(o, "mouseup", r._onDrop), F(o, "touchend", r._onDrop), F(o, "touchcancel", r._onDrop), Jr && this.nativeDraggable && (this.options.touchStartThreshold = 4, W.draggable = !0), H("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(qr || Kr))) {
|
|
2457
|
+
if (Q.eventCanceled) {
|
|
2458
|
+
this._onDrop();
|
|
2459
|
+
return;
|
|
2460
|
+
}
|
|
2461
|
+
F(o, "mouseup", r._disableDelayedDrag), F(o, "touchend", r._disableDelayedDrag), F(o, "touchcancel", r._disableDelayedDrag), F(o, "mousemove", r._delayedDragTouchMoveHandler), F(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && F(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
|
|
2462
|
+
} else s();
|
|
2463
|
+
}
|
|
2464
|
+
},
|
|
2465
|
+
_delayedDragTouchMoveHandler: function(e) {
|
|
2466
|
+
var t = e.touches ? e.touches[0] : e;
|
|
2467
|
+
Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
|
|
2468
|
+
},
|
|
2469
|
+
_disableDelayedDrag: function() {
|
|
2470
|
+
W && ma(W), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
2471
|
+
},
|
|
2472
|
+
_disableDelayedDragEvents: function() {
|
|
2473
|
+
var e = this.el.ownerDocument;
|
|
2474
|
+
I(e, "mouseup", this._disableDelayedDrag), I(e, "touchend", this._disableDelayedDrag), I(e, "touchcancel", this._disableDelayedDrag), I(e, "mousemove", this._delayedDragTouchMoveHandler), I(e, "touchmove", this._delayedDragTouchMoveHandler), I(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
2475
|
+
},
|
|
2476
|
+
_triggerDragStart: function(e, t) {
|
|
2477
|
+
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? F(document, "pointermove", this._onTouchMove) : t ? F(document, "touchmove", this._onTouchMove) : F(document, "mousemove", this._onTouchMove) : (F(W, "dragend", this), F(q, "dragstart", this._onDragStart));
|
|
2478
|
+
try {
|
|
2479
|
+
document.selection ? Sa(function() {
|
|
2480
|
+
document.selection.empty();
|
|
2481
|
+
}) : window.getSelection().removeAllRanges();
|
|
2482
|
+
} catch {}
|
|
2483
|
+
},
|
|
2484
|
+
_dragStarted: function(e, t) {
|
|
2485
|
+
if (Fi = !1, q && W) {
|
|
2486
|
+
H("dragStarted", this, { evt: t }), this.nativeDraggable && F(document, "dragover", da);
|
|
2487
|
+
var n = this.options;
|
|
2488
|
+
!e && L(W, n.dragClass, !1), L(W, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), U({
|
|
2489
|
+
sortable: this,
|
|
2490
|
+
name: "start",
|
|
2491
|
+
originalEvent: t
|
|
2492
|
+
});
|
|
2493
|
+
} else this._nulling();
|
|
2494
|
+
},
|
|
2495
|
+
_emulateDragOver: function() {
|
|
2496
|
+
if (zi) {
|
|
2497
|
+
this._lastX = zi.clientX, this._lastY = zi.clientY, ca();
|
|
2498
|
+
for (var e = document.elementFromPoint(zi.clientX, zi.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(zi.clientX, zi.clientY), e !== t);) t = e;
|
|
2499
|
+
if (W.parentNode[V]._isOutsideThisEl(e), t) do {
|
|
2500
|
+
if (t[V]) {
|
|
2501
|
+
var n = void 0;
|
|
2502
|
+
if (n = t[V]._onDragOver({
|
|
2503
|
+
clientX: zi.clientX,
|
|
2504
|
+
clientY: zi.clientY,
|
|
2505
|
+
target: e,
|
|
2506
|
+
rootEl: t
|
|
2507
|
+
}), n && !this.options.dragoverBubble) break;
|
|
2508
|
+
}
|
|
2509
|
+
e = t;
|
|
2510
|
+
} while (t = t.parentNode);
|
|
2511
|
+
la();
|
|
2512
|
+
}
|
|
2513
|
+
},
|
|
2514
|
+
_onTouchMove: function(e) {
|
|
2515
|
+
if (Ri) {
|
|
2516
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = K && ri(K, !0), o = K && a && a.a, s = K && a && a.d, c = ea && Z && li(Z), l = (i.clientX - Ri.clientX + r.x) / (o || 1) + (c ? c[0] - Xi[0] : 0) / (o || 1), u = (i.clientY - Ri.clientY + r.y) / (s || 1) + (c ? c[1] - Xi[1] : 0) / (s || 1);
|
|
2517
|
+
if (!Q.active && !Fi) {
|
|
2518
|
+
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
2519
|
+
this._onDragStart(e, !0);
|
|
2520
|
+
}
|
|
2521
|
+
if (K) {
|
|
2522
|
+
a ? (a.e += l - (Bi || 0), a.f += u - (Vi || 0)) : a = {
|
|
2523
|
+
a: 1,
|
|
2524
|
+
b: 0,
|
|
2525
|
+
c: 0,
|
|
2526
|
+
d: 1,
|
|
2527
|
+
e: l,
|
|
2528
|
+
f: u
|
|
2529
|
+
};
|
|
2530
|
+
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
2531
|
+
R(K, "webkitTransform", d), R(K, "mozTransform", d), R(K, "msTransform", d), R(K, "transform", d), Bi = l, Vi = u, zi = i;
|
|
2532
|
+
}
|
|
2533
|
+
e.cancelable && e.preventDefault();
|
|
2534
|
+
}
|
|
2535
|
+
},
|
|
2536
|
+
_appendGhost: function() {
|
|
2537
|
+
if (!K) {
|
|
2538
|
+
var e = this.options.fallbackOnBody ? document.body : q, t = z(W, !0, ea, !0, e), n = this.options;
|
|
2539
|
+
if (ea) {
|
|
2540
|
+
for (Z = e; R(Z, "position") === "static" && R(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
2541
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = ai()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = ai(), Xi = li(Z);
|
|
2542
|
+
}
|
|
2543
|
+
K = W.cloneNode(!0), L(K, n.ghostClass, !1), L(K, n.fallbackClass, !0), L(K, n.dragClass, !0), R(K, "transition", ""), R(K, "transform", ""), R(K, "box-sizing", "border-box"), R(K, "margin", 0), R(K, "top", t.top), R(K, "left", t.left), R(K, "width", t.width), R(K, "height", t.height), R(K, "opacity", "0.8"), R(K, "position", ea ? "absolute" : "fixed"), R(K, "zIndex", "100000"), R(K, "pointerEvents", "none"), Q.ghost = K, e.appendChild(K), R(K, "transform-origin", Hi / parseInt(K.style.width) * 100 + "% " + Ui / parseInt(K.style.height) * 100 + "%");
|
|
2544
|
+
}
|
|
2545
|
+
},
|
|
2546
|
+
_onDragStart: function(e, t) {
|
|
2547
|
+
var n = this, r = e.dataTransfer, i = n.options;
|
|
2548
|
+
if (H("dragStart", this, { evt: e }), Q.eventCanceled) {
|
|
2549
|
+
this._onDrop();
|
|
2550
|
+
return;
|
|
2551
|
+
}
|
|
2552
|
+
H("setupClone", this), Q.eventCanceled || (J = vi(W), J.removeAttribute("id"), J.draggable = !1, J.style["will-change"] = "", this._hideClone(), L(J, this.options.chosenClass, !1), Q.clone = J), n.cloneId = Sa(function() {
|
|
2553
|
+
H("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || q.insertBefore(J, W), n._hideClone(), U({
|
|
2554
|
+
sortable: n,
|
|
2555
|
+
name: "clone"
|
|
2556
|
+
}));
|
|
2557
|
+
}), !t && L(W, i.dragClass, !0), t ? (Ii = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (I(document, "mouseup", n._onDrop), I(document, "touchend", n._onDrop), I(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, W)), F(document, "drop", n), R(W, "transform", "translateZ(0)")), Fi = !0, n._dragStartId = Sa(n._dragStarted.bind(n, t, e)), F(document, "selectstart", n), Wi = !0, Yr && R(document.body, "user-select", "none");
|
|
2558
|
+
},
|
|
2559
|
+
_onDragOver: function(e) {
|
|
2560
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = Pi === s, u = o.sort, d = X || c, f, p = this, m = !1;
|
|
2561
|
+
if (Zi) return;
|
|
2562
|
+
function h(o, s) {
|
|
2563
|
+
H(o, p, Rr({
|
|
2564
|
+
evt: e,
|
|
2565
|
+
isOwner: l,
|
|
2566
|
+
axis: f ? "vertical" : "horizontal",
|
|
2567
|
+
revert: a,
|
|
2568
|
+
dragRect: r,
|
|
2569
|
+
targetRect: i,
|
|
2570
|
+
canSort: u,
|
|
2571
|
+
fromSortable: d,
|
|
2572
|
+
target: n,
|
|
2573
|
+
completed: _,
|
|
2574
|
+
onMove: function(n, i) {
|
|
2575
|
+
return pa(q, t, W, r, n, z(n), e, i);
|
|
2576
|
+
},
|
|
2577
|
+
changed: v
|
|
2578
|
+
}, s));
|
|
2579
|
+
}
|
|
2580
|
+
function g() {
|
|
2581
|
+
h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
|
|
2582
|
+
}
|
|
2583
|
+
function _(r) {
|
|
2584
|
+
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (L(W, X ? X.options.ghostClass : c.options.ghostClass, !1), L(W, o.ghostClass, !0)), X !== p && p !== Q.active ? X = p : p === Q.active && X && (X = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
2585
|
+
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
2586
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === W && !W.animated || n === t && !n.animated) && (Gi = null), !o.dragoverBubble && !e.rootEl && n !== document && (W.parentNode[V]._isOutsideThisEl(e.target), !r && ua(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
2587
|
+
}
|
|
2588
|
+
function v() {
|
|
2589
|
+
Y = B(W), Ni = B(W, o.draggable), U({
|
|
2590
|
+
sortable: p,
|
|
2591
|
+
name: "change",
|
|
2592
|
+
toEl: t,
|
|
2593
|
+
newIndex: Y,
|
|
2594
|
+
newDraggableIndex: Ni,
|
|
2595
|
+
originalEvent: e
|
|
2596
|
+
});
|
|
2597
|
+
}
|
|
2598
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = ti(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
2599
|
+
if (W.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
2600
|
+
if (Ii = !1, c && !o.disabled && (l ? u || (a = G !== q) : X === this || (this.lastPutMode = Pi.checkPull(this, c, W, e)) && s.checkPut(this, c, W, e))) {
|
|
2601
|
+
if (f = this._getDirection(e, n) === "vertical", r = z(W), h("dragOverValid"), Q.eventCanceled) return m;
|
|
2602
|
+
if (a) return G = q, g(), this._hideClone(), h("revert"), Q.eventCanceled || (Oi ? q.insertBefore(W, Oi) : q.appendChild(W)), _(!0);
|
|
2603
|
+
var y = ci(t, o.draggable);
|
|
2604
|
+
if (!y || _a(e, f, this) && !y.animated) {
|
|
2605
|
+
if (y === W) return _(!1);
|
|
2606
|
+
if (y && t === e.target && (n = y), n && (i = z(n)), pa(q, t, W, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(W, y.nextSibling) : t.appendChild(W), G = t, v(), _(!0);
|
|
2607
|
+
} else if (y && ga(e, f, this)) {
|
|
2608
|
+
var b = si(t, 0, o, !0);
|
|
2609
|
+
if (b === W) return _(!1);
|
|
2610
|
+
if (n = b, i = z(n), pa(q, t, W, r, n, i, e, !1) !== !1) return g(), t.insertBefore(W, b), G = t, v(), _(!0);
|
|
2611
|
+
} else if (n.parentNode === t) {
|
|
2612
|
+
i = z(n);
|
|
2613
|
+
var x = 0, S, C = W.parentNode !== t, w = !aa(W.animated && W.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = oi(n, "top", "top") || oi(W, "top", "top"), ee = E ? E.scrollTop : void 0;
|
|
2614
|
+
Gi !== n && (S = i[T], qi = !1, Ji = !w && o.invertSwap || C), x = va(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Ji, Gi === n);
|
|
2615
|
+
var D;
|
|
2616
|
+
if (x !== 0) {
|
|
2617
|
+
var O = B(W);
|
|
2618
|
+
do
|
|
2619
|
+
O -= x, D = G.children[O];
|
|
2620
|
+
while (D && (R(D, "display") === "none" || D === K));
|
|
2621
|
+
}
|
|
2622
|
+
if (x === 0 || D === n) return _(!1);
|
|
2623
|
+
Gi = n, Ki = x;
|
|
2624
|
+
var k = n.nextElementSibling, te = !1;
|
|
2625
|
+
te = x === 1;
|
|
2626
|
+
var A = pa(q, t, W, r, n, i, e, te);
|
|
2627
|
+
if (A !== !1) return (A === 1 || A === -1) && (te = A === 1), Zi = !0, setTimeout(ha, 30), g(), te && !k ? t.appendChild(W) : n.parentNode.insertBefore(W, te ? k : n), E && _i(E, 0, ee - E.scrollTop), G = W.parentNode, S !== void 0 && !Ji && (Yi = Math.abs(S - z(n)[T])), v(), _(!0);
|
|
2628
|
+
}
|
|
2629
|
+
if (t.contains(W)) return _(!1);
|
|
2630
|
+
}
|
|
2631
|
+
return !1;
|
|
2632
|
+
},
|
|
2633
|
+
_ignoreWhileAnimating: null,
|
|
2634
|
+
_offMoveEvents: function() {
|
|
2635
|
+
I(document, "mousemove", this._onTouchMove), I(document, "touchmove", this._onTouchMove), I(document, "pointermove", this._onTouchMove), I(document, "dragover", ua), I(document, "mousemove", ua), I(document, "touchmove", ua);
|
|
2636
|
+
},
|
|
2637
|
+
_offUpEvents: function() {
|
|
2638
|
+
var e = this.el.ownerDocument;
|
|
2639
|
+
I(e, "mouseup", this._onDrop), I(e, "touchend", this._onDrop), I(e, "pointerup", this._onDrop), I(e, "touchcancel", this._onDrop), I(document, "selectstart", this);
|
|
2640
|
+
},
|
|
2641
|
+
_onDrop: function(e) {
|
|
2642
|
+
var t = this.el, n = this.options;
|
|
2643
|
+
if (Y = B(W), Ni = B(W, n.draggable), H("drop", this, { evt: e }), G = W && W.parentNode, Y = B(W), Ni = B(W, n.draggable), Q.eventCanceled) {
|
|
2644
|
+
this._nulling();
|
|
2645
|
+
return;
|
|
2646
|
+
}
|
|
2647
|
+
Fi = !1, Ji = !1, qi = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Ca(this.cloneId), Ca(this._dragStartId), this.nativeDraggable && (I(document, "drop", this), I(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Yr && R(document.body, "user-select", ""), R(W, "transform", ""), e && (Wi && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), K && K.parentNode && K.parentNode.removeChild(K), (q === G || X && X.lastPutMode !== "clone") && J && J.parentNode && J.parentNode.removeChild(J), W && (this.nativeDraggable && I(W, "dragend", this), ma(W), W.style["will-change"] = "", Wi && !Fi && L(W, X ? X.options.ghostClass : this.options.ghostClass, !1), L(W, this.options.chosenClass, !1), U({
|
|
2648
|
+
sortable: this,
|
|
2649
|
+
name: "unchoose",
|
|
2650
|
+
toEl: G,
|
|
2651
|
+
newIndex: null,
|
|
2652
|
+
newDraggableIndex: null,
|
|
2653
|
+
originalEvent: e
|
|
2654
|
+
}), q === G ? Y !== ji && Y >= 0 && (U({
|
|
2655
|
+
sortable: this,
|
|
2656
|
+
name: "update",
|
|
2657
|
+
toEl: G,
|
|
2658
|
+
originalEvent: e
|
|
2659
|
+
}), U({
|
|
2660
|
+
sortable: this,
|
|
2661
|
+
name: "sort",
|
|
2662
|
+
toEl: G,
|
|
2663
|
+
originalEvent: e
|
|
2664
|
+
})) : (Y >= 0 && (U({
|
|
2665
|
+
rootEl: G,
|
|
2666
|
+
name: "add",
|
|
2667
|
+
toEl: G,
|
|
2668
|
+
fromEl: q,
|
|
2669
|
+
originalEvent: e
|
|
2670
|
+
}), U({
|
|
2671
|
+
sortable: this,
|
|
2672
|
+
name: "remove",
|
|
2673
|
+
toEl: G,
|
|
2674
|
+
originalEvent: e
|
|
2675
|
+
}), U({
|
|
2676
|
+
rootEl: G,
|
|
2677
|
+
name: "sort",
|
|
2678
|
+
toEl: G,
|
|
2679
|
+
fromEl: q,
|
|
2680
|
+
originalEvent: e
|
|
2681
|
+
}), U({
|
|
2682
|
+
sortable: this,
|
|
2683
|
+
name: "sort",
|
|
2684
|
+
toEl: G,
|
|
2685
|
+
originalEvent: e
|
|
2686
|
+
})), X && X.save()), Q.active && ((Y == null || Y === -1) && (Y = ji, Ni = Mi), U({
|
|
2687
|
+
sortable: this,
|
|
2688
|
+
name: "end",
|
|
2689
|
+
toEl: G,
|
|
2690
|
+
originalEvent: e
|
|
2691
|
+
}), this.save()))), this._nulling();
|
|
2692
|
+
},
|
|
2693
|
+
_nulling: function() {
|
|
2694
|
+
H("nulling", this), q = W = G = K = Oi = J = ki = Ai = Ri = zi = Wi = Y = Ni = ji = Mi = Gi = Ki = X = Pi = Q.dragged = Q.ghost = Q.clone = Q.active = null, Qi.forEach(function(e) {
|
|
2695
|
+
e.checked = !0;
|
|
2696
|
+
}), Qi.length = Bi = Vi = 0;
|
|
2697
|
+
},
|
|
2698
|
+
handleEvent: function(e) {
|
|
2699
|
+
switch (e.type) {
|
|
2700
|
+
case "drop":
|
|
2701
|
+
case "dragend":
|
|
2702
|
+
this._onDrop(e);
|
|
2703
|
+
break;
|
|
2704
|
+
case "dragenter":
|
|
2705
|
+
case "dragover":
|
|
2706
|
+
W && (this._onDragOver(e), fa(e));
|
|
2707
|
+
break;
|
|
2708
|
+
case "selectstart":
|
|
2709
|
+
e.preventDefault();
|
|
2710
|
+
break;
|
|
2711
|
+
}
|
|
2712
|
+
},
|
|
2713
|
+
toArray: function() {
|
|
2714
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], ti(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || ba(t));
|
|
2715
|
+
return e;
|
|
2716
|
+
},
|
|
2717
|
+
sort: function(e, t) {
|
|
2718
|
+
var n = {}, r = this.el;
|
|
2719
|
+
this.toArray().forEach(function(e, t) {
|
|
2720
|
+
var i = r.children[t];
|
|
2721
|
+
ti(i, this.options.draggable, r, !1) && (n[e] = i);
|
|
2722
|
+
}, this), t && this.captureAnimationState(), e.forEach(function(e) {
|
|
2723
|
+
n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
|
|
2724
|
+
}), t && this.animateAll();
|
|
2725
|
+
},
|
|
2726
|
+
save: function() {
|
|
2727
|
+
var e = this.options.store;
|
|
2728
|
+
e && e.set && e.set(this);
|
|
2729
|
+
},
|
|
2730
|
+
closest: function(e, t) {
|
|
2731
|
+
return ti(e, t || this.options.draggable, this.el, !1);
|
|
2732
|
+
},
|
|
2733
|
+
option: function(e, t) {
|
|
2734
|
+
var n = this.options;
|
|
2735
|
+
if (t === void 0) return n[e];
|
|
2736
|
+
var r = Ti.modifyOption(this, e, t);
|
|
2737
|
+
r === void 0 ? n[e] = t : n[e] = r, e === "group" && sa(n);
|
|
2738
|
+
},
|
|
2739
|
+
destroy: function() {
|
|
2740
|
+
H("destroy", this);
|
|
2741
|
+
var e = this.el;
|
|
2742
|
+
e[V] = null, I(e, "mousedown", this._onTapStart), I(e, "touchstart", this._onTapStart), I(e, "pointerdown", this._onTapStart), this.nativeDraggable && (I(e, "dragover", this), I(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
2743
|
+
e.removeAttribute("draggable");
|
|
2744
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), Li.splice(Li.indexOf(this.el), 1), this.el = e = null;
|
|
2745
|
+
},
|
|
2746
|
+
_hideClone: function() {
|
|
2747
|
+
if (!Ai) {
|
|
2748
|
+
if (H("hideClone", this), Q.eventCanceled) return;
|
|
2749
|
+
R(J, "display", "none"), this.options.removeCloneOnHide && J.parentNode && J.parentNode.removeChild(J), Ai = !0;
|
|
2750
|
+
}
|
|
2751
|
+
},
|
|
2752
|
+
_showClone: function(e) {
|
|
2753
|
+
if (e.lastPutMode !== "clone") {
|
|
2754
|
+
this._hideClone();
|
|
2755
|
+
return;
|
|
2756
|
+
}
|
|
2757
|
+
if (Ai) {
|
|
2758
|
+
if (H("showClone", this), Q.eventCanceled) return;
|
|
2759
|
+
W.parentNode == q && !this.options.group.revertClone ? q.insertBefore(J, W) : Oi ? q.insertBefore(J, Oi) : q.appendChild(J), this.options.group.revertClone && this.animate(W, J), R(J, "display", ""), Ai = !1;
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
};
|
|
2763
|
+
function fa(e) {
|
|
2764
|
+
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
2765
|
+
}
|
|
2766
|
+
function pa(e, t, n, r, i, a, o, s) {
|
|
2767
|
+
var c, l = e[V], u = l.options.onMove, d;
|
|
2768
|
+
return window.CustomEvent && !Kr && !qr ? c = new CustomEvent("move", {
|
|
2769
|
+
bubbles: !0,
|
|
2770
|
+
cancelable: !0
|
|
2771
|
+
}) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || z(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
2772
|
+
}
|
|
2773
|
+
function ma(e) {
|
|
2774
|
+
e.draggable = !1;
|
|
2775
|
+
}
|
|
2776
|
+
function ha() {
|
|
2777
|
+
Zi = !1;
|
|
2778
|
+
}
|
|
2779
|
+
function ga(e, t, n) {
|
|
2780
|
+
var r = z(si(n.el, 0, n.options, !0)), i = yi(n.el, n.options, K), a = 10;
|
|
2781
|
+
return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left;
|
|
2782
|
+
}
|
|
2783
|
+
function _a(e, t, n) {
|
|
2784
|
+
var r = z(ci(n.el, n.options.draggable)), i = yi(n.el, n.options, K), a = 10;
|
|
2785
|
+
return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top;
|
|
2786
|
+
}
|
|
2787
|
+
function va(e, t, n, r, i, a, o, s) {
|
|
2788
|
+
var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1;
|
|
2789
|
+
if (!o) {
|
|
2790
|
+
if (s && Yi < l * i) {
|
|
2791
|
+
if (!qi && (Ki === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (qi = !0), qi) f = !0;
|
|
2792
|
+
else if (Ki === 1 ? c < u + Yi : c > d - Yi) return -Ki;
|
|
2793
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return ya(t);
|
|
2794
|
+
}
|
|
2795
|
+
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
2796
|
+
}
|
|
2797
|
+
function ya(e) {
|
|
2798
|
+
return B(W) < B(e) ? 1 : -1;
|
|
2799
|
+
}
|
|
2800
|
+
function ba(e) {
|
|
2801
|
+
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
2802
|
+
return r.toString(36);
|
|
2803
|
+
}
|
|
2804
|
+
function xa(e) {
|
|
2805
|
+
Qi.length = 0;
|
|
2806
|
+
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
2807
|
+
var r = t[n];
|
|
2808
|
+
r.checked && Qi.push(r);
|
|
2809
|
+
}
|
|
2810
|
+
}
|
|
2811
|
+
function Sa(e) {
|
|
2812
|
+
return setTimeout(e, 0);
|
|
2813
|
+
}
|
|
2814
|
+
function Ca(e) {
|
|
2815
|
+
return clearTimeout(e);
|
|
2816
|
+
}
|
|
2817
|
+
$i && F(document, "touchmove", function(e) {
|
|
2818
|
+
(Q.active || Fi) && e.cancelable && e.preventDefault();
|
|
2819
|
+
}), Q.utils = {
|
|
2820
|
+
on: F,
|
|
2821
|
+
off: I,
|
|
2822
|
+
css: R,
|
|
2823
|
+
find: ii,
|
|
2824
|
+
is: function(e, t) {
|
|
2825
|
+
return !!ti(e, t, e, !1);
|
|
2826
|
+
},
|
|
2827
|
+
extend: fi,
|
|
2828
|
+
throttle: hi,
|
|
2829
|
+
closest: ti,
|
|
2830
|
+
toggleClass: L,
|
|
2831
|
+
clone: vi,
|
|
2832
|
+
index: B,
|
|
2833
|
+
nextTick: Sa,
|
|
2834
|
+
cancelNextTick: Ca,
|
|
2835
|
+
detectDirection: ia,
|
|
2836
|
+
getChild: si
|
|
2837
|
+
}, Q.get = function(e) {
|
|
2838
|
+
return e[V];
|
|
2839
|
+
}, Q.mount = function() {
|
|
2840
|
+
var e = [...arguments];
|
|
2841
|
+
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
2842
|
+
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
2843
|
+
e.utils && (Q.utils = Rr(Rr({}, Q.utils), e.utils)), Ti.mount(e);
|
|
2844
|
+
});
|
|
2845
|
+
}, Q.create = function(e, t) {
|
|
2846
|
+
return new Q(e, t);
|
|
2847
|
+
}, Q.version = Wr;
|
|
2848
|
+
var $ = [], wa, Ta, Ea = !1, Da, Oa, ka, Aa;
|
|
2849
|
+
function ja() {
|
|
2850
|
+
function e() {
|
|
2851
|
+
for (var e in this.defaults = {
|
|
2852
|
+
scroll: !0,
|
|
2853
|
+
forceAutoScrollFallback: !1,
|
|
2854
|
+
scrollSensitivity: 30,
|
|
2855
|
+
scrollSpeed: 10,
|
|
2856
|
+
bubbleScroll: !0
|
|
2857
|
+
}, this) e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
|
|
2858
|
+
}
|
|
2859
|
+
return e.prototype = {
|
|
2860
|
+
dragStarted: function(e) {
|
|
2861
|
+
var t = e.originalEvent;
|
|
2862
|
+
this.sortable.nativeDraggable ? F(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? F(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? F(document, "touchmove", this._handleFallbackAutoScroll) : F(document, "mousemove", this._handleFallbackAutoScroll);
|
|
2863
|
+
},
|
|
2864
|
+
dragOverCompleted: function(e) {
|
|
2865
|
+
var t = e.originalEvent;
|
|
2866
|
+
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
2867
|
+
},
|
|
2868
|
+
drop: function() {
|
|
2869
|
+
this.sortable.nativeDraggable ? I(document, "dragover", this._handleAutoScroll) : (I(document, "pointermove", this._handleFallbackAutoScroll), I(document, "touchmove", this._handleFallbackAutoScroll), I(document, "mousemove", this._handleFallbackAutoScroll)), Na(), Ma(), gi();
|
|
2870
|
+
},
|
|
2871
|
+
nulling: function() {
|
|
2872
|
+
ka = Ta = wa = Ea = Aa = Da = Oa = null, $.length = 0;
|
|
2873
|
+
},
|
|
2874
|
+
_handleFallbackAutoScroll: function(e) {
|
|
2875
|
+
this._handleAutoScroll(e, !0);
|
|
2876
|
+
},
|
|
2877
|
+
_handleAutoScroll: function(e, t) {
|
|
2878
|
+
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
2879
|
+
if (ka = e, t || this.options.forceAutoScrollFallback || qr || Kr || Yr) {
|
|
2880
|
+
Pa(e, this.options, a, t);
|
|
2881
|
+
var o = di(a, !0);
|
|
2882
|
+
Ea && (!Aa || r !== Da || i !== Oa) && (Aa && Na(), Aa = setInterval(function() {
|
|
2883
|
+
var a = di(document.elementFromPoint(r, i), !0);
|
|
2884
|
+
a !== o && (o = a, Ma()), Pa(e, n.options, a, t);
|
|
2885
|
+
}, 10), Da = r, Oa = i);
|
|
2886
|
+
} else {
|
|
2887
|
+
if (!this.options.bubbleScroll || di(a, !0) === ai()) {
|
|
2888
|
+
Ma();
|
|
2889
|
+
return;
|
|
2890
|
+
}
|
|
2891
|
+
Pa(e, this.options, di(a, !1), !1);
|
|
2892
|
+
}
|
|
2893
|
+
}
|
|
2894
|
+
}, Vr(e, {
|
|
2895
|
+
pluginName: "scroll",
|
|
2896
|
+
initializeByDefault: !0
|
|
2897
|
+
});
|
|
2898
|
+
}
|
|
2899
|
+
function Ma() {
|
|
2900
|
+
$.forEach(function(e) {
|
|
2901
|
+
clearInterval(e.pid);
|
|
2902
|
+
}), $ = [];
|
|
2903
|
+
}
|
|
2904
|
+
function Na() {
|
|
2905
|
+
clearInterval(Aa);
|
|
2906
|
+
}
|
|
2907
|
+
var Pa = hi(function(e, t, n, r) {
|
|
2908
|
+
if (t.scroll) {
|
|
2909
|
+
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = ai(), l = !1, u;
|
|
2910
|
+
Ta !== n && (Ta = n, Ma(), wa = t.scroll, u = t.scrollFn, wa === !0 && (wa = di(n, !0)));
|
|
2911
|
+
var d = 0, f = wa;
|
|
2912
|
+
do {
|
|
2913
|
+
var p = f, m = z(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, T = R(p), E = p.scrollLeft, ee = p.scrollTop;
|
|
2914
|
+
p === c ? (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll" || T.overflowX === "visible"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll" || T.overflowY === "visible")) : (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll"));
|
|
2915
|
+
var D = x && (Math.abs(v - i) <= o && E + y < C) - (Math.abs(_ - i) <= o && !!E), O = S && (Math.abs(g - a) <= o && ee + b < w) - (Math.abs(h - a) <= o && !!ee);
|
|
2916
|
+
if (!$[d]) for (var k = 0; k <= d; k++) $[k] || ($[k] = {});
|
|
2917
|
+
($[d].vx != D || $[d].vy != O || $[d].el !== p) && ($[d].el = p, $[d].vx = D, $[d].vy = O, clearInterval($[d].pid), (D != 0 || O != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
2918
|
+
r && this.layer === 0 && Q.active._onTouchMove(ka);
|
|
2919
|
+
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
2920
|
+
typeof u == "function" && u.call(Q.dragged.parentNode[V], n, t, e, ka, $[this.layer].el) !== "continue" || _i($[this.layer].el, n, t);
|
|
2921
|
+
}.bind({ layer: d }), 24))), d++;
|
|
2922
|
+
} while (t.bubbleScroll && f !== c && (f = di(f, !1)));
|
|
2923
|
+
Ea = l;
|
|
2924
|
+
}
|
|
2925
|
+
}, 30), Fa = function(e) {
|
|
2926
|
+
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
2927
|
+
if (t) {
|
|
2928
|
+
var c = n || i;
|
|
2929
|
+
o();
|
|
2930
|
+
var l = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, u = document.elementFromPoint(l.clientX, l.clientY);
|
|
2931
|
+
s(), c && !c.el.contains(u) && (a("spill"), this.onSpill({
|
|
2932
|
+
dragEl: r,
|
|
2933
|
+
putSortable: n
|
|
2934
|
+
}));
|
|
2935
|
+
}
|
|
2936
|
+
};
|
|
2937
|
+
function Ia() {}
|
|
2938
|
+
Ia.prototype = {
|
|
2939
|
+
startIndex: null,
|
|
2940
|
+
dragStart: function(e) {
|
|
2941
|
+
var t = e.oldDraggableIndex;
|
|
2942
|
+
this.startIndex = t;
|
|
2943
|
+
},
|
|
2944
|
+
onSpill: function(e) {
|
|
2945
|
+
var t = e.dragEl, n = e.putSortable;
|
|
2946
|
+
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
2947
|
+
var r = si(this.sortable.el, this.startIndex, this.options);
|
|
2948
|
+
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
2949
|
+
},
|
|
2950
|
+
drop: Fa
|
|
2951
|
+
}, Vr(Ia, { pluginName: "revertOnSpill" });
|
|
2952
|
+
function La() {}
|
|
2953
|
+
La.prototype = {
|
|
2954
|
+
onSpill: function(e) {
|
|
2955
|
+
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
2956
|
+
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
2957
|
+
},
|
|
2958
|
+
drop: Fa
|
|
2959
|
+
}, Vr(La, { pluginName: "removeOnSpill" }), Q.mount(new ja()), Q.mount(La, Ia);
|
|
2960
|
+
function Ra(e) {
|
|
2961
|
+
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
2962
|
+
}
|
|
2963
|
+
function za(e) {
|
|
2964
|
+
oe() && ee(e);
|
|
2965
|
+
}
|
|
2966
|
+
function Ba(e) {
|
|
2967
|
+
oe() ? u(e) : r(e);
|
|
2968
|
+
}
|
|
2969
|
+
var Va = null, Ha = null;
|
|
2970
|
+
function Ua(e = null, t = null) {
|
|
2971
|
+
Va = e, Ha = t;
|
|
2972
|
+
}
|
|
2973
|
+
function Wa() {
|
|
2974
|
+
return {
|
|
2975
|
+
data: Va,
|
|
2976
|
+
clonedData: Ha
|
|
2977
|
+
};
|
|
2978
|
+
}
|
|
2979
|
+
var Ga = Symbol("cloneElement");
|
|
2980
|
+
function Ka(...e) {
|
|
2981
|
+
let t = oe()?.proxy, n = null, i = e[0], [, o, c] = e;
|
|
2982
|
+
Array.isArray(j(o)) || (c = o, o = null);
|
|
2983
|
+
let l = null, { immediate: u = !0, clone: d = Ra, forceFallback: f, fallbackOnBody: p, customUpdate: m } = j(c) ?? {};
|
|
2984
|
+
function h(e) {
|
|
2985
|
+
let { from: t, oldIndex: r, item: i } = e, a = Array.from(t.childNodes);
|
|
2986
|
+
n = f && !p ? a.slice(0, -1) : a;
|
|
2987
|
+
let s = j(j(o)?.[r]), c = d(s);
|
|
2988
|
+
Ua(s, c), i[Ga] = c;
|
|
2989
|
+
}
|
|
2990
|
+
function g(e) {
|
|
2991
|
+
let t = e.item[Ga];
|
|
2992
|
+
if (!Er(t)) {
|
|
2993
|
+
if (kr(e.item), a(o)) {
|
|
2994
|
+
let n = [...j(o)];
|
|
2995
|
+
o.value = Tr(n, e.newDraggableIndex, t);
|
|
2996
|
+
return;
|
|
2997
|
+
}
|
|
2998
|
+
Tr(j(o), e.newDraggableIndex, t);
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
function _(e) {
|
|
3002
|
+
let { from: t, item: n, oldIndex: r, oldDraggableIndex: i, pullMode: s, clone: c } = e;
|
|
3003
|
+
if (Or(t, n, r), s === "clone") {
|
|
3004
|
+
kr(c);
|
|
3005
|
+
return;
|
|
3006
|
+
}
|
|
3007
|
+
if (a(o)) {
|
|
3008
|
+
let e = [...j(o)];
|
|
3009
|
+
o.value = wr(e, i);
|
|
3010
|
+
return;
|
|
3011
|
+
}
|
|
3012
|
+
wr(j(o), i);
|
|
3013
|
+
}
|
|
3014
|
+
function v(e) {
|
|
3015
|
+
if (m) {
|
|
3016
|
+
m(e);
|
|
3017
|
+
return;
|
|
3018
|
+
}
|
|
3019
|
+
let { from: t, item: n, oldIndex: r, oldDraggableIndex: i, newDraggableIndex: s } = e;
|
|
3020
|
+
if (kr(n), Or(t, n, r), a(o)) {
|
|
3021
|
+
let e = [...j(o)];
|
|
3022
|
+
o.value = xr(e, i, s);
|
|
3023
|
+
return;
|
|
3024
|
+
}
|
|
3025
|
+
xr(j(o), i, s);
|
|
3026
|
+
}
|
|
3027
|
+
function y(e) {
|
|
3028
|
+
let { newIndex: t, oldIndex: i, from: a, to: o } = e, s = null, c = t === i && a === o;
|
|
3029
|
+
try {
|
|
3030
|
+
if (c) {
|
|
3031
|
+
let e = null;
|
|
3032
|
+
n?.some((t, r) => {
|
|
3033
|
+
if (e && n?.length !== o.childNodes.length) return a.insertBefore(e, t.nextSibling), !0;
|
|
3034
|
+
let i = o.childNodes[r];
|
|
3035
|
+
e = o?.replaceChild(t, i);
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
} catch (e) {
|
|
3039
|
+
s = e;
|
|
3040
|
+
} finally {
|
|
3041
|
+
n = null;
|
|
3042
|
+
}
|
|
3043
|
+
r(() => {
|
|
3044
|
+
if (Ua(), s) throw s;
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
let b = {
|
|
3048
|
+
onUpdate: v,
|
|
3049
|
+
onStart: h,
|
|
3050
|
+
onAdd: g,
|
|
3051
|
+
onRemove: _,
|
|
3052
|
+
onEnd: y
|
|
3053
|
+
};
|
|
3054
|
+
function x(e) {
|
|
3055
|
+
let n = j(i);
|
|
3056
|
+
return e ||= Dr(n) ? Ar(n, t?.$el) : n, e && !Nr(e) && (e = e.$el), e || br("Root element not found"), e;
|
|
3057
|
+
}
|
|
3058
|
+
function S() {
|
|
3059
|
+
let e = j(c) ?? {}, { immediate: t, clone: n } = e, r = _r(e, ["immediate", "clone"]);
|
|
3060
|
+
return Pr(r, (e, t) => {
|
|
3061
|
+
Fr(e) && (r[e] = (e, ...n) => (Ir(e, Wa()), t(e, ...n)));
|
|
3062
|
+
}), Mr(o === null ? {} : b, r);
|
|
3063
|
+
}
|
|
3064
|
+
let C = (e) => {
|
|
3065
|
+
e = x(e), l && w.destroy(), l = new Q(e, S());
|
|
3066
|
+
};
|
|
3067
|
+
s(() => c, () => {
|
|
3068
|
+
l && Pr(S(), (e, t) => {
|
|
3069
|
+
l?.option(e, t);
|
|
3070
|
+
});
|
|
3071
|
+
}, { deep: !0 });
|
|
3072
|
+
let w = {
|
|
3073
|
+
option: (e, t) => l?.option(e, t),
|
|
3074
|
+
destroy: () => {
|
|
3075
|
+
l?.destroy(), l = null;
|
|
3076
|
+
},
|
|
3077
|
+
save: () => l?.save(),
|
|
3078
|
+
toArray: () => l?.toArray(),
|
|
3079
|
+
closest: (...e) => l?.closest(...e)
|
|
3080
|
+
};
|
|
3081
|
+
return Ba(() => {
|
|
3082
|
+
u && C();
|
|
3083
|
+
}), za(w.destroy), gr({
|
|
3084
|
+
start: C,
|
|
3085
|
+
pause: () => w?.option("disabled", !0),
|
|
3086
|
+
resume: () => w?.option("disabled", !1)
|
|
3087
|
+
}, w);
|
|
3088
|
+
}
|
|
3089
|
+
var qa = [
|
|
3090
|
+
"update",
|
|
3091
|
+
"start",
|
|
3092
|
+
"add",
|
|
3093
|
+
"remove",
|
|
3094
|
+
"choose",
|
|
3095
|
+
"unchoose",
|
|
3096
|
+
"end",
|
|
3097
|
+
"sort",
|
|
3098
|
+
"filter",
|
|
3099
|
+
"clone",
|
|
3100
|
+
"move",
|
|
3101
|
+
"change"
|
|
3102
|
+
], Ja = y({
|
|
3103
|
+
name: "VueDraggable",
|
|
3104
|
+
model: {
|
|
3105
|
+
prop: "modelValue",
|
|
3106
|
+
event: "update:modelValue"
|
|
3107
|
+
},
|
|
3108
|
+
props: [
|
|
3109
|
+
"clone",
|
|
3110
|
+
"animation",
|
|
3111
|
+
"ghostClass",
|
|
3112
|
+
"group",
|
|
3113
|
+
"sort",
|
|
3114
|
+
"disabled",
|
|
3115
|
+
"store",
|
|
3116
|
+
"handle",
|
|
3117
|
+
"draggable",
|
|
3118
|
+
"swapThreshold",
|
|
3119
|
+
"invertSwap",
|
|
3120
|
+
"invertedSwapThreshold",
|
|
3121
|
+
"removeCloneOnHide",
|
|
3122
|
+
"direction",
|
|
3123
|
+
"chosenClass",
|
|
3124
|
+
"dragClass",
|
|
3125
|
+
"ignore",
|
|
3126
|
+
"filter",
|
|
3127
|
+
"preventOnFilter",
|
|
3128
|
+
"easing",
|
|
3129
|
+
"setData",
|
|
3130
|
+
"dropBubble",
|
|
3131
|
+
"dragoverBubble",
|
|
3132
|
+
"dataIdAttr",
|
|
3133
|
+
"delay",
|
|
3134
|
+
"delayOnTouchOnly",
|
|
3135
|
+
"touchStartThreshold",
|
|
3136
|
+
"forceFallback",
|
|
3137
|
+
"fallbackClass",
|
|
3138
|
+
"fallbackOnBody",
|
|
3139
|
+
"fallbackTolerance",
|
|
3140
|
+
"fallbackOffset",
|
|
3141
|
+
"supportPointer",
|
|
3142
|
+
"emptyInsertThreshold",
|
|
3143
|
+
"scroll",
|
|
3144
|
+
"forceAutoScrollFallback",
|
|
3145
|
+
"scrollSensitivity",
|
|
3146
|
+
"scrollSpeed",
|
|
3147
|
+
"bubbleScroll",
|
|
3148
|
+
"modelValue",
|
|
3149
|
+
"tag",
|
|
3150
|
+
"target",
|
|
3151
|
+
"customUpdate",
|
|
3152
|
+
...qa.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
|
|
3153
|
+
],
|
|
3154
|
+
emits: ["update:modelValue", ...qa],
|
|
3155
|
+
setup(e, { slots: t, emit: n, expose: r, attrs: i }) {
|
|
3156
|
+
let a = qa.reduce((e, t) => {
|
|
3157
|
+
let r = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
3158
|
+
return e[r] = (...e) => n(t, ...e), e;
|
|
3159
|
+
}, {}), s = x(() => {
|
|
3160
|
+
let t = S(e), { modelValue: n } = t, r = _r(t, ["modelValue"]), o = Object.entries(r).reduce((e, [t, n]) => {
|
|
3161
|
+
let r = j(n);
|
|
3162
|
+
return r !== void 0 && (e[t] = r), e;
|
|
3163
|
+
}, {});
|
|
3164
|
+
return gr(gr({}, a), Cr(gr(gr({}, i), o)));
|
|
3165
|
+
}), c = x({
|
|
3166
|
+
get: () => e.modelValue,
|
|
3167
|
+
set: (e) => n("update:modelValue", e)
|
|
3168
|
+
}), l = h(), u = o(Ka(e.target || l, c, s));
|
|
3169
|
+
return r(u), () => f(e.tag || "div", { ref: l }, (t?.default)?.call(t, u));
|
|
3170
|
+
}
|
|
3171
|
+
}), Ya = {
|
|
3172
|
+
mounted: "mounted",
|
|
3173
|
+
unmounted: "unmounted"
|
|
3174
|
+
};
|
|
3175
|
+
Ya.mounted, Ya.unmounted;
|
|
3176
|
+
//#endregion
|
|
3177
|
+
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3178
|
+
var Xa = { class: "tpl:w-full" }, Za = { class: "tpl:flex tpl:gap-0" }, Qa = {
|
|
3179
|
+
key: 0,
|
|
3180
|
+
"data-testid": "section-drop-hint",
|
|
3181
|
+
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
3182
|
+
}, $a = /* @__PURE__ */ y({
|
|
3183
|
+
__name: "SectionBlock",
|
|
3184
|
+
props: {
|
|
3185
|
+
block: {},
|
|
3186
|
+
viewport: {}
|
|
3187
|
+
},
|
|
3188
|
+
setup(n) {
|
|
3189
|
+
let r = {
|
|
3190
|
+
title: ur,
|
|
3191
|
+
paragraph: qn,
|
|
3192
|
+
image: Bn,
|
|
3193
|
+
button: Bt,
|
|
3194
|
+
divider: wn,
|
|
3195
|
+
custom: Sn
|
|
3196
|
+
}, a = n, { t: o } = st(), s = Ve(Qe, "SectionBlock"), l = ae(Je, null), u = ae(nt, null), d = x(() => {
|
|
3197
|
+
switch (a.block.columns) {
|
|
3198
|
+
case "2": return ["50%", "50%"];
|
|
3199
|
+
case "3": return [
|
|
3200
|
+
"33.33%",
|
|
3201
|
+
"33.33%",
|
|
3202
|
+
"33.33%"
|
|
3203
|
+
];
|
|
3204
|
+
case "1-2": return ["33.33%", "66.67%"];
|
|
3205
|
+
case "2-1": return ["66.67%", "33.33%"];
|
|
3206
|
+
default: return ["100%"];
|
|
3207
|
+
}
|
|
3208
|
+
}), f = x(() => {
|
|
3209
|
+
let e = d.value.length, t = [...a.block.children];
|
|
3210
|
+
for (; t.length < e;) t.push([]);
|
|
3211
|
+
return t.slice(0, e);
|
|
3212
|
+
});
|
|
3213
|
+
function p(e) {
|
|
3214
|
+
return f.value[e] || [];
|
|
3215
|
+
}
|
|
3216
|
+
function m(e, t) {
|
|
3217
|
+
let n = [...a.block.children];
|
|
3218
|
+
for (; n.length <= e;) n.push([]);
|
|
3219
|
+
n[e] = t, s.updateBlock(a.block.id, { children: n });
|
|
3220
|
+
}
|
|
3221
|
+
function h(e) {
|
|
3222
|
+
return Jn(e, u, r);
|
|
3223
|
+
}
|
|
3224
|
+
function g(e, t) {
|
|
3225
|
+
e.type === "custom" && s.updateBlock(e.id, {
|
|
3226
|
+
fieldValues: t.fieldValues,
|
|
3227
|
+
dataSourceFetched: t.dataSourceFetched
|
|
3228
|
+
});
|
|
3229
|
+
}
|
|
3230
|
+
return (r, a) => (e(), w("div", Xa, [C("div", Za, [(e(!0), w(D, null, c(f.value, (r, a) => (e(), w("div", {
|
|
3231
|
+
key: a,
|
|
3232
|
+
class: v(["tpl:relative tpl:min-h-[60px] tpl:rounded", p(a).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
3233
|
+
style: A({ width: d.value[a] })
|
|
3234
|
+
}, [N(j(Ja), {
|
|
3235
|
+
"model-value": p(a),
|
|
3236
|
+
group: {
|
|
3237
|
+
name: "blocks",
|
|
3238
|
+
pull: !0,
|
|
3239
|
+
put: (e, t, n) => n.dataset.blockType !== "section"
|
|
3240
|
+
},
|
|
3241
|
+
animation: 150,
|
|
3242
|
+
"ghost-class": "tpl-ghost",
|
|
3243
|
+
"empty-insert-threshold": 20,
|
|
3244
|
+
class: "tpl:min-h-[60px]",
|
|
3245
|
+
"onUpdate:modelValue": (e) => m(a, e)
|
|
3246
|
+
}, {
|
|
3247
|
+
default: ce(() => [(e(!0), w(D, null, c(p(a), (r) => t((e(), w("div", { key: r.id }, [N(cr, {
|
|
3248
|
+
block: r,
|
|
3249
|
+
"is-selected": j(s).state.selectedBlockId === r.id,
|
|
3250
|
+
viewport: n.viewport,
|
|
3251
|
+
onSelect: (e) => j(s).selectBlock(r.id)
|
|
3252
|
+
}, {
|
|
3253
|
+
default: ce(() => [(e(), ne(i(h(r)), {
|
|
3254
|
+
block: r,
|
|
3255
|
+
viewport: n.viewport,
|
|
3256
|
+
onFetchData: (e) => g(r, e)
|
|
3257
|
+
}, null, 40, [
|
|
3258
|
+
"block",
|
|
3259
|
+
"viewport",
|
|
3260
|
+
"onFetchData"
|
|
3261
|
+
]))]),
|
|
3262
|
+
_: 2
|
|
3263
|
+
}, 1032, [
|
|
3264
|
+
"block",
|
|
3265
|
+
"is-selected",
|
|
3266
|
+
"viewport",
|
|
3267
|
+
"onSelect"
|
|
3268
|
+
])])), [[te, !j(l)?.isHidden(r.id)]])), 128))]),
|
|
3269
|
+
_: 2
|
|
3270
|
+
}, 1032, [
|
|
3271
|
+
"model-value",
|
|
3272
|
+
"group",
|
|
3273
|
+
"onUpdate:modelValue"
|
|
3274
|
+
]), p(a).length === 0 ? (e(), w("div", Qa, [C("span", null, M(j(o).section.dropHere), 1)])) : O("", !0)], 6))), 128))])]));
|
|
3275
|
+
}
|
|
3276
|
+
}), eo = {
|
|
3277
|
+
facebook: {
|
|
3278
|
+
name: "Facebook",
|
|
3279
|
+
color: "#1877F2",
|
|
3280
|
+
path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
3281
|
+
},
|
|
3282
|
+
twitter: {
|
|
3283
|
+
name: "X",
|
|
3284
|
+
color: "#000000",
|
|
3285
|
+
path: "M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
|
|
3286
|
+
},
|
|
3287
|
+
instagram: {
|
|
3288
|
+
name: "Instagram",
|
|
3289
|
+
color: "#E4405F",
|
|
3290
|
+
path: "M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z"
|
|
3291
|
+
},
|
|
3292
|
+
linkedin: {
|
|
3293
|
+
name: "LinkedIn",
|
|
3294
|
+
color: "#0A66C2",
|
|
3295
|
+
path: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
|
|
3296
|
+
},
|
|
3297
|
+
youtube: {
|
|
3298
|
+
name: "YouTube",
|
|
3299
|
+
color: "#FF0000",
|
|
3300
|
+
path: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
|
|
3301
|
+
},
|
|
3302
|
+
tiktok: {
|
|
3303
|
+
name: "TikTok",
|
|
3304
|
+
color: "#000000",
|
|
3305
|
+
path: "M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z"
|
|
3306
|
+
},
|
|
3307
|
+
pinterest: {
|
|
3308
|
+
name: "Pinterest",
|
|
3309
|
+
color: "#BD081C",
|
|
3310
|
+
path: "M12 0C5.373 0 0 5.372 0 12c0 5.084 3.163 9.426 7.627 11.174-.105-.949-.2-2.405.042-3.441.218-.937 1.407-5.965 1.407-5.965s-.359-.719-.359-1.782c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738.098.119.112.224.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146C9.57 23.812 10.763 24 12 24c6.627 0 12-5.373 12-12 0-6.628-5.373-12-12-12z"
|
|
3311
|
+
},
|
|
3312
|
+
email: {
|
|
3313
|
+
name: "Email",
|
|
3314
|
+
color: "#6B7280",
|
|
3315
|
+
path: "M1.5 8.67v8.58a3 3 0 003 3h15a3 3 0 003-3V8.67l-8.928 5.493a3 3 0 01-3.144 0L1.5 8.67z M22.5 6.908V6.75a3 3 0 00-3-3h-15a3 3 0 00-3 3v.158l9.714 5.978a1.5 1.5 0 001.572 0L22.5 6.908z"
|
|
3316
|
+
},
|
|
3317
|
+
whatsapp: {
|
|
3318
|
+
name: "WhatsApp",
|
|
3319
|
+
color: "#25D366",
|
|
3320
|
+
path: "M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"
|
|
3321
|
+
},
|
|
3322
|
+
telegram: {
|
|
3323
|
+
name: "Telegram",
|
|
3324
|
+
color: "#26A5E4",
|
|
3325
|
+
path: "M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z"
|
|
3326
|
+
},
|
|
3327
|
+
discord: {
|
|
3328
|
+
name: "Discord",
|
|
3329
|
+
color: "#5865F2",
|
|
3330
|
+
path: "M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189z"
|
|
3331
|
+
},
|
|
3332
|
+
snapchat: {
|
|
3333
|
+
name: "Snapchat",
|
|
3334
|
+
color: "#FFFC00",
|
|
3335
|
+
path: "M12.017 0C5.396 0 .029 5.367.029 11.987c0 5.079 3.158 9.417 7.618 11.162-.105-.949-.199-2.403.041-3.439.219-.937 1.406-5.957 1.406-5.957s-.359-.72-.359-1.781c0-1.668.967-2.914 2.171-2.914 1.023 0 1.518.769 1.518 1.69 0 1.029-.655 2.568-.994 3.995-.283 1.194.599 2.169 1.777 2.169 2.133 0 3.772-2.249 3.772-5.495 0-2.873-2.064-4.882-5.012-4.882-3.414 0-5.418 2.561-5.418 5.207 0 1.031.397 2.138.893 2.738a.36.36 0 01.083.345l-.333 1.36c-.053.22-.174.267-.402.161-1.499-.698-2.436-2.889-2.436-4.649 0-3.785 2.75-7.262 7.929-7.262 4.163 0 7.398 2.967 7.398 6.931 0 4.136-2.607 7.464-6.227 7.464-1.216 0-2.359-.631-2.75-1.378l-.748 2.853c-.271 1.043-1.002 2.35-1.492 3.146 1.124.347 2.317.535 3.554.535 6.627 0 12.017-5.373 12.017-12.001C24.034 5.367 18.644 0 12.017 0z"
|
|
3336
|
+
},
|
|
3337
|
+
reddit: {
|
|
3338
|
+
name: "Reddit",
|
|
3339
|
+
color: "#FF4500",
|
|
3340
|
+
path: "M12 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0zm5.01 4.744c.688 0 1.25.561 1.25 1.249a1.25 1.25 0 0 1-2.498.056l-2.597-.547-.8 3.747c1.824.07 3.48.632 4.674 1.488.308-.309.73-.491 1.207-.491.968 0 1.754.786 1.754 1.754 0 .716-.435 1.333-1.01 1.614a3.111 3.111 0 0 1 .042.52c0 2.694-3.13 4.87-7.004 4.87-3.874 0-7.004-2.176-7.004-4.87 0-.183.015-.366.043-.534A1.748 1.748 0 0 1 4.028 12c0-.968.786-1.754 1.754-1.754.463 0 .898.196 1.207.49 1.207-.883 2.878-1.43 4.744-1.487l.885-4.182a.342.342 0 0 1 .14-.197.35.35 0 0 1 .238-.042l2.906.617a1.214 1.214 0 0 1 1.108-.701zM9.25 12C8.561 12 8 12.562 8 13.25c0 .687.561 1.248 1.25 1.248.687 0 1.248-.561 1.248-1.249 0-.688-.561-1.249-1.249-1.249zm5.5 0c-.687 0-1.248.561-1.248 1.25 0 .687.561 1.248 1.249 1.248.688 0 1.249-.561 1.249-1.249 0-.687-.562-1.249-1.25-1.249zm-5.466 3.99a.327.327 0 0 0-.231.094.33.33 0 0 0 0 .463c.842.842 2.484.913 2.961.913.477 0 2.105-.056 2.961-.913a.361.361 0 0 0 .029-.463.33.33 0 0 0-.464 0c-.547.533-1.684.73-2.512.73-.828 0-1.979-.196-2.512-.73a.326.326 0 0 0-.232-.095z"
|
|
3341
|
+
},
|
|
3342
|
+
github: {
|
|
3343
|
+
name: "GitHub",
|
|
3344
|
+
color: "#181717",
|
|
3345
|
+
path: "M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
|
|
3346
|
+
},
|
|
3347
|
+
dribbble: {
|
|
3348
|
+
name: "Dribbble",
|
|
3349
|
+
color: "#EA4C89",
|
|
3350
|
+
path: "M12 24C5.385 24 0 18.615 0 12S5.385 0 12 0s12 5.385 12 12-5.385 12-12 12zm10.12-10.358c-.35-.11-3.17-.953-6.384-.438 1.34 3.684 1.887 6.684 1.992 7.308 2.3-1.555 3.936-4.02 4.392-6.87zm-6.115 7.808c-.153-.9-.75-4.032-2.19-7.77l-.066.02c-5.79 2.015-7.86 6.025-8.04 6.4 1.73 1.358 3.92 2.166 6.29 2.166 1.42 0 2.77-.29 4-.814zm-11.62-2.58c.232-.4 3.045-5.055 8.332-6.765.135-.045.27-.084.405-.12-.26-.585-.54-1.167-.832-1.74C7.17 11.775 2.206 11.71 1.756 11.7l-.004.312c0 2.633.998 5.037 2.634 6.855zm-2.42-8.955c.46.008 4.683.026 9.477-1.248-1.698-3.018-3.53-5.558-3.8-5.928-2.868 1.35-5.01 3.99-5.676 7.17zM9.6 2.052c.282.38 2.145 2.914 3.822 6 3.645-1.365 5.19-3.44 5.373-3.702-1.81-1.61-4.19-2.586-6.795-2.586-.825 0-1.63.1-2.4.285zm10.335 3.483c-.218.29-1.935 2.493-5.724 4.04.24.49.47.985.68 1.486.08.18.15.36.22.53 3.41-.43 6.8.26 7.14.33-.02-2.42-.88-4.64-2.31-6.38z"
|
|
3351
|
+
},
|
|
3352
|
+
behance: {
|
|
3353
|
+
name: "Behance",
|
|
3354
|
+
color: "#1769FF",
|
|
3355
|
+
path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
|
|
3356
|
+
}
|
|
3357
|
+
}, to = {
|
|
3358
|
+
small: 24,
|
|
3359
|
+
medium: 32,
|
|
3360
|
+
large: 48
|
|
3361
|
+
}, no = [
|
|
3362
|
+
"facebook",
|
|
3363
|
+
"twitter",
|
|
3364
|
+
"instagram",
|
|
3365
|
+
"linkedin",
|
|
3366
|
+
"youtube",
|
|
3367
|
+
"tiktok",
|
|
3368
|
+
"pinterest",
|
|
3369
|
+
"email",
|
|
3370
|
+
"whatsapp",
|
|
3371
|
+
"telegram",
|
|
3372
|
+
"discord",
|
|
3373
|
+
"snapchat",
|
|
3374
|
+
"reddit",
|
|
3375
|
+
"github",
|
|
3376
|
+
"dribbble",
|
|
3377
|
+
"behance"
|
|
3378
|
+
], ro = [
|
|
3379
|
+
"width",
|
|
3380
|
+
"height",
|
|
3381
|
+
"fill"
|
|
3382
|
+
], io = ["d"], ao = /* @__PURE__ */ y({
|
|
3383
|
+
__name: "SocialIconSvg",
|
|
3384
|
+
props: {
|
|
3385
|
+
platform: {},
|
|
3386
|
+
iconStyle: {},
|
|
3387
|
+
iconSize: {}
|
|
3388
|
+
},
|
|
3389
|
+
setup(t) {
|
|
3390
|
+
let n = t, r = x(() => eo[n.platform]), i = x(() => to[n.iconSize]), a = x(() => {
|
|
3391
|
+
let e = {
|
|
3392
|
+
display: "inline-flex",
|
|
3393
|
+
alignItems: "center",
|
|
3394
|
+
justifyContent: "center",
|
|
3395
|
+
width: `${i.value}px`,
|
|
3396
|
+
height: `${i.value}px`
|
|
3397
|
+
};
|
|
3398
|
+
switch (n.iconStyle) {
|
|
3399
|
+
case "solid": return {
|
|
3400
|
+
...e,
|
|
3401
|
+
backgroundColor: r.value.color,
|
|
3402
|
+
borderRadius: "4px"
|
|
3403
|
+
};
|
|
3404
|
+
case "outlined": return {
|
|
3405
|
+
...e,
|
|
3406
|
+
backgroundColor: "transparent",
|
|
3407
|
+
border: `2px solid ${r.value.color}`,
|
|
3408
|
+
borderRadius: "4px"
|
|
3409
|
+
};
|
|
3410
|
+
case "rounded": return {
|
|
3411
|
+
...e,
|
|
3412
|
+
backgroundColor: r.value.color,
|
|
3413
|
+
borderRadius: "8px"
|
|
3414
|
+
};
|
|
3415
|
+
case "square": return {
|
|
3416
|
+
...e,
|
|
3417
|
+
backgroundColor: r.value.color,
|
|
3418
|
+
borderRadius: "0"
|
|
3419
|
+
};
|
|
3420
|
+
case "circle": return {
|
|
3421
|
+
...e,
|
|
3422
|
+
backgroundColor: r.value.color,
|
|
3423
|
+
borderRadius: "50%"
|
|
3424
|
+
};
|
|
3425
|
+
default: return e;
|
|
3426
|
+
}
|
|
3427
|
+
}), o = x(() => Math.floor(i.value * .6)), s = x(() => n.iconStyle === "outlined" ? r.value.color : "#ffffff");
|
|
3428
|
+
return (t, n) => (e(), w("span", { style: A(a.value) }, [(e(), w("svg", {
|
|
3429
|
+
width: o.value,
|
|
3430
|
+
height: o.value,
|
|
3431
|
+
viewBox: "0 0 24 24",
|
|
3432
|
+
fill: s.value,
|
|
3433
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
3434
|
+
}, [C("path", { d: r.value.path }, null, 8, io)], 8, ro))], 4));
|
|
3435
|
+
}
|
|
3436
|
+
}), oo = { class: "tpl:w-full" }, so = ["href"], co = {
|
|
3437
|
+
key: 1,
|
|
3438
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
3439
|
+
}, lo = /* @__PURE__ */ y({
|
|
3440
|
+
__name: "SocialIconsBlock",
|
|
3441
|
+
props: {
|
|
3442
|
+
block: {},
|
|
3443
|
+
viewport: {}
|
|
3444
|
+
},
|
|
3445
|
+
setup(t) {
|
|
3446
|
+
let n = t, { t: r } = st(), i = x(() => ({
|
|
3447
|
+
display: "flex",
|
|
3448
|
+
flexWrap: "wrap",
|
|
3449
|
+
gap: `${n.block.spacing}px`,
|
|
3450
|
+
justifyContent: n.block.align === "left" ? "flex-start" : n.block.align === "right" ? "flex-end" : "center"
|
|
3451
|
+
})), a = x(() => n.block.icons.length > 0);
|
|
3452
|
+
return (n, o) => (e(), w("div", oo, [a.value ? (e(), w("div", {
|
|
3453
|
+
key: 0,
|
|
3454
|
+
style: A(i.value)
|
|
3455
|
+
}, [(e(!0), w(D, null, c(t.block.icons, (n) => (e(), w("a", {
|
|
3456
|
+
key: n.id,
|
|
3457
|
+
href: n.url || "#",
|
|
3458
|
+
class: "tpl:cursor-default",
|
|
3459
|
+
onClick: o[0] ||= b(() => {}, ["prevent"])
|
|
3460
|
+
}, [N(ao, {
|
|
3461
|
+
platform: n.platform,
|
|
3462
|
+
"icon-style": t.block.iconStyle,
|
|
3463
|
+
"icon-size": t.block.iconSize
|
|
3464
|
+
}, null, 8, [
|
|
3465
|
+
"platform",
|
|
3466
|
+
"icon-style",
|
|
3467
|
+
"icon-size"
|
|
3468
|
+
])], 8, so))), 128))], 4)) : (e(), w("div", co, [N(j(Zt), { size: 16 }), C("span", null, M(j(r).social.addIcons), 1)]))]));
|
|
3469
|
+
}
|
|
3470
|
+
}), uo = { class: "tpl:w-full" }, fo = {
|
|
3471
|
+
key: 0,
|
|
3472
|
+
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3473
|
+
style: {
|
|
3474
|
+
"background-color": "var(--tpl-bg-hover)",
|
|
3475
|
+
color: "var(--tpl-text-dim)"
|
|
3476
|
+
}
|
|
3477
|
+
}, po = /* @__PURE__ */ y({
|
|
3478
|
+
__name: "SpacerBlock",
|
|
3479
|
+
props: {
|
|
3480
|
+
block: {},
|
|
3481
|
+
viewport: {}
|
|
3482
|
+
},
|
|
3483
|
+
setup(t) {
|
|
3484
|
+
let n = t, r = Ve(Qe, "SpacerBlock"), i = x(() => ({
|
|
3485
|
+
height: `${n.block.height}px`,
|
|
3486
|
+
minHeight: `${n.block.height}px`,
|
|
3487
|
+
...r.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3488
|
+
}));
|
|
3489
|
+
return (n, a) => (e(), w("div", uo, [C("div", {
|
|
3490
|
+
style: A(i.value),
|
|
3491
|
+
class: v(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !j(r).state.previewMode }])
|
|
3492
|
+
}, [j(r).state.previewMode ? O("", !0) : (e(), w("span", fo, M(t.block.height) + "px ", 1))], 6)]));
|
|
3493
|
+
}
|
|
3494
|
+
}), mo = { class: "tpl:w-full" }, ho = { key: 0 }, go = [
|
|
3495
|
+
"aria-label",
|
|
3496
|
+
"data-placeholder",
|
|
3497
|
+
"onBlur"
|
|
3498
|
+
], _o = [
|
|
3499
|
+
"aria-label",
|
|
3500
|
+
"data-placeholder",
|
|
3501
|
+
"onBlur"
|
|
3502
|
+
], vo = {
|
|
3503
|
+
key: 1,
|
|
3504
|
+
class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
|
|
3505
|
+
}, yo = /* @__PURE__ */ ft(/* @__PURE__ */ y({
|
|
3506
|
+
__name: "TableBlock",
|
|
3507
|
+
props: {
|
|
3508
|
+
block: {},
|
|
3509
|
+
viewport: {}
|
|
3510
|
+
},
|
|
3511
|
+
setup(n) {
|
|
3512
|
+
let r = {
|
|
3513
|
+
mounted(e, t) {
|
|
3514
|
+
e.textContent = t.value ?? "";
|
|
3515
|
+
},
|
|
3516
|
+
updated(e, t) {
|
|
3517
|
+
t.value !== t.oldValue && e.ownerDocument.activeElement !== e && (e.textContent = t.value ?? "");
|
|
3518
|
+
}
|
|
3519
|
+
}, i = n, { t: a } = st(), o = Ve(Qe, "TableBlock"), s = x(() => i.block.rows.length > 0), l = x(() => ({
|
|
3520
|
+
width: "100%",
|
|
3521
|
+
borderCollapse: "collapse",
|
|
3522
|
+
fontSize: `${i.block.fontSize}px`,
|
|
3523
|
+
color: i.block.color,
|
|
3524
|
+
textAlign: i.block.textAlign,
|
|
3525
|
+
fontFamily: i.block.fontFamily || "inherit"
|
|
3526
|
+
})), u = x(() => ({
|
|
3527
|
+
border: `${i.block.borderWidth}px solid ${i.block.borderColor}`,
|
|
3528
|
+
padding: `${i.block.cellPadding}px`,
|
|
3529
|
+
textAlign: i.block.textAlign
|
|
3530
|
+
})), d = x(() => ({
|
|
3531
|
+
...u.value,
|
|
3532
|
+
fontWeight: "bold",
|
|
3533
|
+
backgroundColor: i.block.headerBackgroundColor || "transparent"
|
|
3534
|
+
})), f = x(() => i.block.hasHeaderRow && i.block.rows.length > 0 ? i.block.rows[0] : null), p = x(() => i.block.hasHeaderRow ? i.block.rows.slice(1) : i.block.rows);
|
|
3535
|
+
function m() {
|
|
3536
|
+
o.selectBlock(i.block.id);
|
|
3537
|
+
}
|
|
3538
|
+
function h(e, t, n) {
|
|
3539
|
+
let r = n.target.innerText.trim(), a = i.block.rows.map((n) => n.id === e ? {
|
|
3540
|
+
...n,
|
|
3541
|
+
cells: n.cells.map((e) => e.id === t ? {
|
|
3542
|
+
...e,
|
|
3543
|
+
content: r
|
|
3544
|
+
} : e)
|
|
3545
|
+
} : n);
|
|
3546
|
+
o.updateBlock(i.block.id, { rows: a });
|
|
3547
|
+
}
|
|
3548
|
+
return (n, i) => (e(), w("div", mo, [s.value ? (e(), w("table", {
|
|
3549
|
+
key: 0,
|
|
3550
|
+
style: A(l.value),
|
|
3551
|
+
class: "tpl-table-editable"
|
|
3552
|
+
}, [f.value ? (e(), w("thead", ho, [C("tr", null, [(e(!0), w(D, null, c(f.value.cells, (n) => t((e(), w("th", {
|
|
3553
|
+
key: n.id,
|
|
3554
|
+
style: A(d.value),
|
|
3555
|
+
"aria-label": j(a).table.cellPlaceholder,
|
|
3556
|
+
contenteditable: "true",
|
|
3557
|
+
"data-placeholder": j(a).table.cellPlaceholder,
|
|
3558
|
+
onBlur: (e) => h(f.value.id, n.id, e),
|
|
3559
|
+
onKeydown: i[0] ||= ie(b((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3560
|
+
onClick: b(m, ["stop"])
|
|
3561
|
+
}, null, 44, go)), [[r, n.content]])), 128))])])) : O("", !0), C("tbody", null, [(e(!0), w(D, null, c(p.value, (n) => (e(), w("tr", { key: n.id }, [(e(!0), w(D, null, c(n.cells, (o) => t((e(), w("td", {
|
|
3562
|
+
key: o.id,
|
|
3563
|
+
style: A(u.value),
|
|
3564
|
+
"aria-label": j(a).table.cellPlaceholder,
|
|
3565
|
+
contenteditable: "true",
|
|
3566
|
+
"data-placeholder": j(a).table.cellPlaceholder,
|
|
3567
|
+
onBlur: (e) => h(n.id, o.id, e),
|
|
3568
|
+
onKeydown: i[1] ||= ie(b((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3569
|
+
onClick: b(m, ["stop"])
|
|
3570
|
+
}, null, 44, _o)), [[r, o.content]])), 128))]))), 128))])], 4)) : (e(), w("div", vo, [N(j(Qt), { size: 16 }), C("span", null, M(j(a).table.empty), 1)]))]));
|
|
3571
|
+
}
|
|
3572
|
+
}), [["__scopeId", "data-v-4f49860b"]]), bo = /* @__PURE__ */ y({
|
|
3573
|
+
__name: "VideoPlayButton",
|
|
3574
|
+
props: { hoverEffect: {
|
|
3575
|
+
type: Boolean,
|
|
3576
|
+
default: !1
|
|
3577
|
+
} },
|
|
3578
|
+
setup(t) {
|
|
3579
|
+
return (n, r) => (e(), w("div", { class: v(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", t.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...r[0] ||= [C("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-white/90 tpl:shadow-lg" }, [C("svg", {
|
|
3580
|
+
class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
|
|
3581
|
+
width: "28",
|
|
3582
|
+
height: "28",
|
|
3583
|
+
viewBox: "0 0 24 24",
|
|
3584
|
+
fill: "currentColor"
|
|
3585
|
+
}, [C("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
|
|
3586
|
+
}
|
|
3587
|
+
});
|
|
3588
|
+
//#endregion
|
|
3589
|
+
//#region src/utils/videoThumbnail.ts
|
|
3590
|
+
function xo(e) {
|
|
3591
|
+
if (!e) return {
|
|
3592
|
+
platform: "unknown",
|
|
3593
|
+
videoId: null,
|
|
3594
|
+
thumbnailUrl: null
|
|
3595
|
+
};
|
|
3596
|
+
for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/i, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/i]) {
|
|
3597
|
+
let n = e.match(t);
|
|
3598
|
+
if (n) {
|
|
3599
|
+
let e = n[1];
|
|
3600
|
+
return {
|
|
3601
|
+
platform: "youtube",
|
|
3602
|
+
videoId: e,
|
|
3603
|
+
thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
|
|
3604
|
+
};
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
|
|
3608
|
+
if (t) {
|
|
3609
|
+
let e = t[1];
|
|
3610
|
+
return {
|
|
3611
|
+
platform: "vimeo",
|
|
3612
|
+
videoId: e,
|
|
3613
|
+
thumbnailUrl: `https://vumbnail.com/${e}.jpg`
|
|
3614
|
+
};
|
|
3615
|
+
}
|
|
3616
|
+
return {
|
|
3617
|
+
platform: "unknown",
|
|
3618
|
+
videoId: null,
|
|
3619
|
+
thumbnailUrl: null
|
|
3620
|
+
};
|
|
3621
|
+
}
|
|
3622
|
+
function So(e, t) {
|
|
3623
|
+
return t || xo(e).thumbnailUrl;
|
|
3624
|
+
}
|
|
3625
|
+
//#endregion
|
|
3626
|
+
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3627
|
+
var Co = ["src", "alt"], wo = {
|
|
3628
|
+
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
3629
|
+
style: { opacity: "0.7" }
|
|
3630
|
+
}, To = ["href"], Eo = ["src", "alt"], Do = ["src", "alt"], Oo = {
|
|
3631
|
+
key: 3,
|
|
3632
|
+
class: "tpl:flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
|
|
3633
|
+
}, ko = /* @__PURE__ */ y({
|
|
3634
|
+
__name: "VideoBlock",
|
|
3635
|
+
props: {
|
|
3636
|
+
block: {},
|
|
3637
|
+
viewport: {}
|
|
3638
|
+
},
|
|
3639
|
+
setup(t) {
|
|
3640
|
+
let n = t, { t: r } = st(), { syntax: i } = pt(), a = x(() => pe(n.block.url, i) || pe(n.block.thumbnailUrl, i)), o = x(() => a.value ? null : So(n.block.url, n.block.thumbnailUrl)), s = x(() => ({ textAlign: n.block.align })), c = x(() => ({
|
|
3641
|
+
maxWidth: "100%",
|
|
3642
|
+
width: n.block.width === "full" ? "100%" : `${n.block.width}px`,
|
|
3643
|
+
display: "block",
|
|
3644
|
+
margin: n.block.align === "center" ? "0 auto" : void 0,
|
|
3645
|
+
marginLeft: n.block.align === "right" ? "auto" : void 0
|
|
3646
|
+
})), l = x(() => pe(n.block.url, i) ? n.block.url : n.block.thumbnailUrl);
|
|
3647
|
+
return (n, i) => (e(), w("div", {
|
|
3648
|
+
class: "tpl:w-full",
|
|
3649
|
+
style: A(s.value)
|
|
3650
|
+
}, [a.value && t.block.placeholderUrl ? (e(), w("div", {
|
|
3651
|
+
key: 0,
|
|
3652
|
+
class: "tpl:relative tpl:inline-block",
|
|
3653
|
+
style: A(c.value)
|
|
3654
|
+
}, [C("img", {
|
|
3655
|
+
class: "tpl:w-full tpl:border-0",
|
|
3656
|
+
src: t.block.placeholderUrl,
|
|
3657
|
+
alt: t.block.alt
|
|
3658
|
+
}, null, 8, Co), N(bo)], 4)) : a.value ? (e(), w("div", {
|
|
3659
|
+
key: 1,
|
|
3660
|
+
class: "tpl:relative tpl:!flex tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
|
|
3661
|
+
style: A([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, c.value])
|
|
3662
|
+
}, [N(j($t), {
|
|
3663
|
+
size: 36,
|
|
3664
|
+
"stroke-width": 1.5,
|
|
3665
|
+
class: "tpl:text-[var(--tpl-primary)]",
|
|
3666
|
+
style: { opacity: "0.5" }
|
|
3667
|
+
}), C("span", wo, M(l.value), 1)], 4)) : o.value ? (e(), w(D, { key: 2 }, [t.block.url ? (e(), w("a", {
|
|
3668
|
+
key: 0,
|
|
3669
|
+
href: t.block.url,
|
|
3670
|
+
target: "_blank",
|
|
3671
|
+
rel: "noopener noreferrer",
|
|
3672
|
+
class: "tpl:group tpl:relative tpl:inline-block",
|
|
3673
|
+
style: A(c.value),
|
|
3674
|
+
onClick: i[0] ||= b(() => {}, ["prevent"])
|
|
3675
|
+
}, [C("img", {
|
|
3676
|
+
class: "tpl:w-full tpl:border-0",
|
|
3677
|
+
src: o.value,
|
|
3678
|
+
alt: t.block.alt
|
|
3679
|
+
}, null, 8, Eo), N(bo, { "hover-effect": "" })], 12, To)) : (e(), w("div", {
|
|
3680
|
+
key: 1,
|
|
3681
|
+
class: "tpl:relative tpl:inline-block",
|
|
3682
|
+
style: A(c.value)
|
|
3683
|
+
}, [C("img", {
|
|
3684
|
+
class: "tpl:w-full tpl:border-0",
|
|
3685
|
+
src: o.value,
|
|
3686
|
+
alt: t.block.alt
|
|
3687
|
+
}, null, 8, Do), N(bo)], 4))], 64)) : (e(), w("div", Oo, [N(j($t), {
|
|
3688
|
+
size: 40,
|
|
3689
|
+
"stroke-width": 1.5,
|
|
3690
|
+
class: "tpl:text-[var(--tpl-border-light)]"
|
|
3691
|
+
}), C("span", null, M(j(r).video.addVideo), 1)]))], 4));
|
|
3692
|
+
}
|
|
3693
|
+
}), Ao = {
|
|
3694
|
+
section: $a,
|
|
3695
|
+
title: ur,
|
|
3696
|
+
paragraph: qn,
|
|
3697
|
+
image: Bn,
|
|
3698
|
+
button: Bt,
|
|
3699
|
+
divider: wn,
|
|
3700
|
+
video: ko,
|
|
3701
|
+
social: lo,
|
|
3702
|
+
menu: Wn,
|
|
3703
|
+
table: yo,
|
|
3704
|
+
spacer: po,
|
|
3705
|
+
html: kn,
|
|
3706
|
+
countdown: se(() => import("./CountdownBlock-Bxqe7zwL.js").then((e) => e.n))
|
|
3707
|
+
};
|
|
3708
|
+
function jo(e) {
|
|
3709
|
+
let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: o } = st(r);
|
|
3710
|
+
t.setUiTheme(n.uiTheme ?? "auto");
|
|
3711
|
+
let { resolvedTheme: c } = Dt(x(() => t.state.uiTheme)), l = h(n.theme ?? {}), { themeStyles: u } = kt({
|
|
3712
|
+
themeOverrides: l,
|
|
3713
|
+
resolvedTheme: c,
|
|
3714
|
+
extraStyles: e.themeExtraStyles
|
|
3715
|
+
}), d = vt({
|
|
3716
|
+
content: t.content,
|
|
3717
|
+
setContent: (e, n) => t.setContent(e, n),
|
|
3718
|
+
...e.historyOptions
|
|
3719
|
+
});
|
|
3720
|
+
Ct(t, d);
|
|
3721
|
+
let f = yt({
|
|
3722
|
+
addBlock: t.addBlock,
|
|
3723
|
+
removeBlock: t.removeBlock,
|
|
3724
|
+
updateBlock: t.updateBlock,
|
|
3725
|
+
selectBlock: t.selectBlock,
|
|
3726
|
+
blockDefaults: n.blockDefaults
|
|
3727
|
+
}), p = xt(t), m = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? bt({
|
|
3728
|
+
content: t.content,
|
|
3729
|
+
isDirty: () => t.state.isDirty,
|
|
3730
|
+
...e.autoSaveOptions
|
|
3731
|
+
}) : null, g = null;
|
|
3732
|
+
m && (g = s(d.isNavigating, (e) => {
|
|
3733
|
+
e ? m.pause() : m.resume();
|
|
3734
|
+
}));
|
|
3735
|
+
let _ = Et(t, {
|
|
3736
|
+
t: a,
|
|
3737
|
+
format: o
|
|
3738
|
+
}), v = Nt();
|
|
3739
|
+
if (Ft(v, Ao), n.customBlocks?.length) for (let e of n.customBlocks) v.registerCustom(e, Sn);
|
|
3740
|
+
function y(e) {
|
|
3741
|
+
for (let t of e) v.registerCustom(t, Sn);
|
|
3742
|
+
}
|
|
3743
|
+
function b(r) {
|
|
3744
|
+
Lt(r, {
|
|
3745
|
+
history: d,
|
|
3746
|
+
selectBlock: (e) => t.selectBlock(e),
|
|
3747
|
+
getSelectedBlockId: () => t.state.selectedBlockId,
|
|
3748
|
+
removeBlock: (e) => t.removeBlock(e),
|
|
3749
|
+
onSave: n.onSave,
|
|
3750
|
+
onBeforeUndo: e.keyboardOptions?.onBeforeUndo
|
|
3751
|
+
});
|
|
3752
|
+
}
|
|
3753
|
+
Le(document, "keydown", b), E(Be, r), E(Qe, t), E(Xe, d), E(Ge, f), E(Je, p), E(Ze, i), E(Ue, u), E(ze, c), E($e, n.blockDefaults), E(nt, v), E(Ye, n.customBlocks ?? []);
|
|
3754
|
+
let S = be(n.mergeTags?.syntax);
|
|
3755
|
+
E(it, n.mergeTags?.tags ?? []), E(Ke, S), E(He, n.mergeTags?.onRequest ?? null), E(ot, n.mergeTags?.autocomplete !== !1), E(at, n.onRequestMedia ?? null), E(et, n.displayConditions?.conditions ?? []), E(tt, n.displayConditions?.allowCustom ?? !1), E(qe, e.capabilities ?? {}), E(We, _);
|
|
3756
|
+
let C = n.accessibility?.disabled === !0 ? null : wt({
|
|
3757
|
+
content: t.content,
|
|
3758
|
+
options: n.accessibility ?? {},
|
|
3759
|
+
updateBlock: t.updateBlock,
|
|
3760
|
+
updateSettings: t.updateSettings
|
|
3761
|
+
});
|
|
3762
|
+
E(rt, C);
|
|
3763
|
+
function w() {
|
|
3764
|
+
g?.(), C?.destroy(), m?.destroy(), d.destroy();
|
|
3765
|
+
}
|
|
3766
|
+
return {
|
|
3767
|
+
t: a,
|
|
3768
|
+
format: o,
|
|
3769
|
+
history: d,
|
|
3770
|
+
blockActions: f,
|
|
3771
|
+
conditionPreview: p,
|
|
3772
|
+
autoSave: m,
|
|
3773
|
+
resolvedTheme: c,
|
|
3774
|
+
themeStyles: u,
|
|
3775
|
+
themeOverrides: l,
|
|
3776
|
+
registry: v,
|
|
3777
|
+
keyboardReorder: _,
|
|
3778
|
+
accessibilityLint: C,
|
|
3779
|
+
registerCustomBlocks: y,
|
|
3780
|
+
destroy: w
|
|
3781
|
+
};
|
|
3782
|
+
}
|
|
3783
|
+
//#endregion
|
|
3784
|
+
export { Gt as A, on as C, Zt as D, Qt as E, Tt as F, St as I, mt as L, Ut as M, Bt as N, Yt as O, Mt as P, sn as S, nn as T, kn as _, lo as a, pn as b, $a as c, cr as d, Yn as f, Bn as g, Wn as h, po as i, Wt as j, Jt as k, Ja as l, qn as m, ko as n, eo as o, Jn as p, yo as r, no as s, jo as t, ur as u, wn as v, an as w, dn as x, Sn as y };
|