@templatical/editor 0.14.0 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-J8iO_sX7.js → AiChatSidebar-BIKvYREk.js} +57 -56
- package/dist/{AiFeatureMenu-F2diEDgV.js → AiFeatureMenu-QbD82crt.js} +20 -20
- package/dist/{BlockIssueBadge-a-qlByxF.js → BlockIssueBadge-B3xVgMTh.js} +11 -11
- package/dist/{CloudEditor-CDjtwb4i.js → CloudEditor-DptuSf7A.js} +470 -468
- package/dist/{CollaboratorBar-B_EnJLtW.js → CollaboratorBar-DrA_K69w.js} +20 -20
- package/dist/{CommentsSidebar-DaP9BA_r.js → CommentsSidebar-D_tSGvTX.js} +154 -153
- package/dist/CountdownBlock-apiYUhkQ.js +92 -0
- package/dist/CountdownToolbar-CS0axcjz.js +210 -0
- package/dist/{DesignReferenceSidebar-BHRlTqlT.js → DesignReferenceSidebar-DWYK9nTk.js} +58 -57
- package/dist/{IssuesPanel-u7ee3Wrl.js → IssuesPanel-CR1MPaDE.js} +40 -40
- package/dist/{LoadingTrack-CV3ID80N.js → LoadingTrack-DsecR8Rw.js} +1 -1
- package/dist/MergeTagSuggestion-CH2SUxBo.js +1327 -0
- package/dist/{ModuleBrowserModal-DOsdaS6s.js → ModuleBrowserModal-D45rBj5C.js} +60 -59
- package/dist/{ModulePreviewCanvas-Cx4MOJ0X.js → ModulePreviewCanvas-BiQ6B2-l.js} +29 -29
- package/dist/{NumberWithSuffix-D2mW_DhT.js → NumberWithSuffix-CrA6quxx.js} +143 -142
- package/dist/{ParagraphEditor-DMzkVnST.js → ParagraphEditor-1NaUJpZO.js} +247 -246
- package/dist/{RichTextEditorContent-CRCxCwKf.js → RichTextEditorContent-BqLHIZY7.js} +45 -44
- package/dist/{SaveModuleDialog-DuEKgumL.js → SaveModuleDialog-B0sPOTgO.js} +38 -37
- package/dist/{SnapshotHistory-CVgiNJtE.js → SnapshotHistory-DslVzmSb.js} +34 -33
- package/dist/{TemplateScoringPanel-lm0_9nYi.js → TemplateScoringPanel-CZ62rGHz.js} +83 -82
- package/dist/{TestEmailModal-WBMdiW5S.js → TestEmailModal-DWGniJVu.js} +22 -21
- package/dist/{TitleEditor-eyT0h-Sa.js → TitleEditor-D4t_gZZJ.js} +44 -44
- package/dist/{TplModal-tjQ7OB0g.js → TplModal-Br2VG6cn.js} +14 -13
- package/dist/{blockTypeIcons-DdB3uTKD.js → blockTypeIcons-CXhCS5WV.js} +2 -2
- package/dist/bundle-stats.json +8 -8
- package/dist/cdn/chunks/{AiFeatureMenu-D7rB2SBs.js → AiFeatureMenu-3Slo_LGA.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-D7rB2SBs.js.map → AiFeatureMenu-3Slo_LGA.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-DHOe0pgx.js → BlockIssueBadge-BxwEiiF3.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-DHOe0pgx.js.map → BlockIssueBadge-BxwEiiF3.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-DNed_Ym0.js → CloudEditor-DFIFWD9G.js} +89 -89
- package/dist/cdn/chunks/{CloudEditor-DNed_Ym0.js.map → CloudEditor-DFIFWD9G.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-sj_9Lee3.js → CollaboratorBar-Cu3vuN66.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-sj_9Lee3.js.map → CollaboratorBar-Cu3vuN66.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-C1Ikjpn4.js → CountdownBlock-BEVAJQtQ.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-C1Ikjpn4.js.map → CountdownBlock-BEVAJQtQ.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-j1G_X8rB.js → CountdownToolbar-CI2sQZv5.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-j1G_X8rB.js.map → CountdownToolbar-CI2sQZv5.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CTOf3PsH.js → IssuesPanel-BdeDoTcn.js} +4 -4
- package/dist/cdn/chunks/{IssuesPanel-CTOf3PsH.js.map → IssuesPanel-BdeDoTcn.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js +213 -0
- package/dist/cdn/chunks/MergeTagSuggestion-BsCAo4Co.js.map +1 -0
- package/dist/cdn/chunks/{ModuleBrowserModal-DCh88-rr.js → ModuleBrowserModal-Dz-I5zfj.js} +6 -6
- package/dist/cdn/chunks/{ModuleBrowserModal-DCh88-rr.js.map → ModuleBrowserModal-Dz-I5zfj.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-DJqvTKmg.js → ModulePreviewCanvas-BfinyuAN.js} +3 -3
- package/dist/cdn/chunks/{ModulePreviewCanvas-DJqvTKmg.js.map → ModulePreviewCanvas-BfinyuAN.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-Bu45XWSl.js → NumberWithSuffix-CDjEa08X.js} +6 -6
- package/dist/cdn/chunks/{NumberWithSuffix-Bu45XWSl.js.map → NumberWithSuffix-CDjEa08X.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DwZqLJp2.js → ParagraphEditor-B3fG0vge.js} +22 -22
- package/dist/cdn/chunks/{ParagraphEditor-DwZqLJp2.js.map → ParagraphEditor-B3fG0vge.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-CIuZ-2DV.js → RichTextEditorContent-C6YPCp9j.js} +4 -4
- package/dist/cdn/chunks/{RichTextEditorContent-CIuZ-2DV.js.map → RichTextEditorContent-C6YPCp9j.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-Bep0X2s_.js → SaveModuleDialog-C6UIIVAM.js} +3 -3
- package/dist/cdn/chunks/{SaveModuleDialog-Bep0X2s_.js.map → SaveModuleDialog-C6UIIVAM.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DO1-h3RY.js → TitleEditor-BiZbLYF1.js} +10 -10
- package/dist/cdn/chunks/{TitleEditor-DO1-h3RY.js.map → TitleEditor-BiZbLYF1.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-8o24HVJu.js → blockTypeIcons-BernVG06.js} +3 -3
- package/dist/cdn/chunks/{blockTypeIcons-8o24HVJu.js.map → blockTypeIcons-BernVG06.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-kPCz_3zM.js → draggable-kG-D5Xsm.js} +6 -6
- package/dist/cdn/chunks/draggable-kG-D5Xsm.js.map +1 -0
- package/dist/cdn/chunks/extensions-Drp8UDc6.js +421 -0
- package/dist/cdn/chunks/extensions-Drp8UDc6.js.map +1 -0
- package/dist/cdn/chunks/{features-CkTMVylx.js → features-Dpczf9Su.js} +884 -835
- package/dist/cdn/chunks/features-Dpczf9Su.js.map +1 -0
- package/dist/cdn/chunks/{icons-9zjCuoJx.js → icons-CuxnJiGQ.js} +26 -26
- package/dist/cdn/chunks/{icons-9zjCuoJx.js.map → icons-CuxnJiGQ.js.map} +1 -1
- package/dist/cdn/chunks/{liquid.browser-DKKBzRQu.js → liquid.browser-BJOEu6Cg.js} +693 -678
- package/dist/cdn/chunks/liquid.browser-BJOEu6Cg.js.map +1 -0
- package/dist/cdn/chunks/{media-library-DMRIPx4g.js → media-library-CiYl_BO7.js} +33 -33
- package/dist/cdn/chunks/{media-library-DMRIPx4g.js.map → media-library-CiYl_BO7.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CdEqyLwF.js → pusher-CIwiKF8H.js} +4 -4
- package/dist/cdn/chunks/{pusher-CdEqyLwF.js.map → pusher-CIwiKF8H.js.map} +1 -1
- package/dist/cdn/chunks/{quality-CyeUgs_c.js → quality-CNjGxBG0.js} +112 -112
- package/dist/cdn/chunks/{quality-CyeUgs_c.js.map → quality-CNjGxBG0.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BIKUEKDD.js → renderer-CFkg8h-K.js} +20 -20
- package/dist/cdn/chunks/renderer-CFkg8h-K.js.map +1 -0
- package/dist/cdn/chunks/{src-pDy_imWG.js → src-DRpKu4Dy.js} +5 -5
- package/dist/cdn/chunks/{src-pDy_imWG.js.map → src-DRpKu4Dy.js.map} +1 -1
- package/dist/cdn/chunks/{styles-D4Bd3SCx.js → styles-B7wryV0l.js} +1484 -1344
- package/dist/cdn/chunks/styles-B7wryV0l.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-BlLFFU3M.js → tiptap-DF9PEiqH.js} +6859 -6823
- package/dist/cdn/chunks/tiptap-DF9PEiqH.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +35 -35
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CYJwFmjy.js → check-rl7ok6uJ.js} +1 -1
- package/dist/{chevron-down-C5l-DzAA.js → chevron-down-BKe__NOD.js} +1 -1
- package/dist/{circle-alert-wf5HUFZY.js → circle-alert-C8xmpMsK.js} +1 -1
- package/dist/{clock-Bj0bQw-K.js → clock-BW4JuDCN.js} +1 -1
- package/dist/{cloud-CoFDm9YA.js → cloud-BQusL53H.js} +208 -208
- package/dist/createLucideIcon-Dx-EjR9r.js +43 -0
- package/dist/{dist-CLpPNKy9.js → dist-B5Sov3sS.js} +7 -7
- package/dist/dist-BEWiuOMi.js +251 -0
- package/dist/{dist-CrQZ_af9.js → dist-BFmE-7hB.js} +2 -2
- package/dist/{dist-U5vfDdYI.js → dist-BMoa33wT.js} +2 -2
- package/dist/{dist-BctFrpeA.js → dist-BibU4HNl.js} +74 -65
- package/dist/{dist-Dd3ibRZm.js → dist-BsCGIDSt.js} +103 -102
- package/dist/dist-CNLKj9wa.js +5 -0
- package/dist/{dist-BX3gGwL8.js → dist-CNXDNYQn.js} +728 -694
- package/dist/{dist-Bn703mnA.js → dist-COG3IdPK.js} +3 -3
- package/dist/{dist-B7w6xTU6.js → dist-CQZxDvFw.js} +3 -3
- package/dist/{dist-34OcyoK1.js → dist-CRsjOQM-.js} +2 -2
- package/dist/dist-CTT6WYJ6.js +134 -0
- package/dist/dist-Cqa6aeAJ.js +5 -0
- package/dist/{dist-ChMninLH.js → dist-SXJJ2v41.js} +2 -2
- package/dist/{dist-CyjyYg52.js → dist-itdjZraK.js} +28 -23
- package/dist/extensions-DwaZAqm6.js +423 -0
- package/dist/{image-up-x8-WXfsx.js → image-up-BwBCmQ4P.js} +1 -1
- package/dist/{info-RS_fGcGi.js → info-TCn7uWR5.js} +1 -1
- package/dist/{keys-DgYXDafq.js → keys-Cv8-8GsD.js} +1 -1
- package/dist/{liquid.browser-CVjP5Mex.js → liquid.browser-DZLtv26k.js} +692 -677
- package/dist/{list-checks-Bf7XdDyv.js → list-checks-CSrOWNgq.js} +1 -1
- package/dist/{loader-circle-CLZ0_FvW.js → loader-circle-BLmicnPG.js} +1 -1
- package/dist/{message-circle-B-1bN9ab.js → message-circle-C9hHMQCI.js} +1 -1
- package/dist/{refresh-cw-CWKWqJYG.js → refresh-cw-D1JQ1LNa.js} +1 -1
- package/dist/runtime-dom.esm-bundler-BzuoCyNp.js +523 -0
- package/dist/{scan-line-BtK5dEai.js → scan-line-DgijVq9y.js} +1 -1
- package/dist/{send-Cn1IUdzh.js → send-DjPdq69F.js} +1 -1
- package/dist/{shield-check-CrvMk4Ea.js → shield-check-Bqluu8FS.js} +1 -1
- package/dist/{sparkles-CgfjwvnG.js → sparkles-M4azPVSP.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/styles-D7fQ7f_1.js +4164 -0
- package/dist/templatical-editor.js +127 -126
- package/dist/{text-align-start-C3r_Rnvy.js → text-align-start-CMya5pCQ.js} +11 -11
- package/dist/{trash-2-CjERg4x9.js → trash-2-C-81rkLS.js} +1 -1
- package/dist/{triangle-alert-Chkny574.js → triangle-alert-BuRWnynk.js} +1 -1
- package/dist/{upload-e5kDRkPb.js → upload-CWBIoLd4.js} +1 -1
- package/dist/{useAliveFlag-cUQj9rmB.js → useAliveFlag-CECL_OUb.js} +1 -1
- package/dist/{useCloudI18n-CYJKqXtI.js → useCloudI18n-AKCy98qD.js} +2 -2
- package/dist/{useEditorCore-8JxXDOA4.js → useEditorCore-vcWLdnjN.js} +1406 -1364
- package/dist/{useI18n-BWqM8i78.js → useI18n-C-TDeJBt.js} +2 -2
- package/dist/{useMergeTag-NHC4ylza.js → useMergeTag-DSrBY0-2.js} +5 -5
- package/dist/usePopoverRoot-DKUDnr55.js +8 -0
- package/dist/{vue.runtime.esm-bundler-BPa483TZ.js → vue.runtime.esm-bundler-l0XAqiyv.js} +626 -1147
- package/dist/{x-DiPIbccg.js → x-CQSvXnGR.js} +1 -1
- package/package.json +26 -26
- package/dist/CountdownBlock-DtAokAVw.js +0 -92
- package/dist/CountdownToolbar-Dtqgwy0g.js +0 -210
- package/dist/cdn/chunks/draggable-kPCz_3zM.js.map +0 -1
- package/dist/cdn/chunks/extensions-iwBXnEwq.js +0 -605
- package/dist/cdn/chunks/extensions-iwBXnEwq.js.map +0 -1
- package/dist/cdn/chunks/features-CkTMVylx.js.map +0 -1
- package/dist/cdn/chunks/liquid.browser-DKKBzRQu.js.map +0 -1
- package/dist/cdn/chunks/renderer-BIKUEKDD.js.map +0 -1
- package/dist/cdn/chunks/styles-D4Bd3SCx.js.map +0 -1
- package/dist/cdn/chunks/tiptap-BlLFFU3M.js.map +0 -1
- package/dist/createLucideIcon-Bad2kKE0.js +0 -43
- package/dist/dist-CADDCv0o.js +0 -5
- package/dist/dist-CGvz7vkq.js +0 -5
- package/dist/dist-DuCzdgDA.js +0 -382
- package/dist/extensions-J439b7y7.js +0 -1720
- package/dist/styles-BUwDOWd3.js +0 -4022
- package/dist/usePopoverRoot-B1sdY4es.js +0 -8
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { t as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import "./
|
|
15
|
-
import { t as
|
|
16
|
-
import
|
|
1
|
+
import { $ as e, A as t, B as n, D as r, Dt as i, E as a, Et as o, H as s, I as c, J as l, K as u, N as d, O as f, Ot as p, R as m, T as h, W as g, Y as _, Z as v, _ as y, c as b, d as x, et as S, g as C, h as w, j as T, k as E, l as D, m as O, nt as k, q as ee, r as A, rt as te, s as j, tt as ne, u as M, v as re, w as ie, x as N, y as ae, z as oe } from "./vue.runtime.esm-bundler-l0XAqiyv.js";
|
|
2
|
+
import { c as P, o as se, s as ce } from "./runtime-dom.esm-bundler-BzuoCyNp.js";
|
|
3
|
+
import { A as le, C as ue, D as de, M as fe, N as pe, O as me, P as he, S as ge, T as _e, _ as ve, b as ye, c as be, d as xe, f as Se, g as Ce, h as we, j as Te, k as Ee, l as De, m as Oe, n as ke, o as Ae, p as je, r as Me, s as Ne, t as Pe, u as Fe, v as Ie, w as Le, x as Re, y as ze } from "./dist-BibU4HNl.js";
|
|
4
|
+
import { f as Be, g as Ve, h as He, m as Ue } from "./dist-CTT6WYJ6.js";
|
|
5
|
+
import { a as We, i as Ge, n as Ke, r as qe } from "./dist-BEWiuOMi.js";
|
|
6
|
+
import { A as Je, C as Ye, D as Xe, E as Ze, F as Qe, I as $e, L as et, N as tt, O as nt, P as rt, S as it, T as at, _ as ot, a as st, b as ct, d as lt, f as ut, g as dt, h as ft, i as pt, k as mt, m as ht, n as gt, o as _t, p as vt, s as yt, u as bt, v as xt, w as St, x as Ct, y as wt } from "./keys-Cv8-8GsD.js";
|
|
7
|
+
import { t as Tt } from "./useI18n-C-TDeJBt.js";
|
|
8
|
+
import { t as F } from "./createLucideIcon-Dx-EjR9r.js";
|
|
9
|
+
import { t as Et } from "./loader-circle-BLmicnPG.js";
|
|
10
|
+
import { t as Dt } from "./message-circle-C9hHMQCI.js";
|
|
11
|
+
import { t as Ot } from "./trash-2-C-81rkLS.js";
|
|
12
|
+
import { t as kt } from "./triangle-alert-BuRWnynk.js";
|
|
13
|
+
import { t as At } from "./upload-CWBIoLd4.js";
|
|
14
|
+
import { t as jt } from "./LoadingTrack-DsecR8Rw.js";
|
|
15
|
+
import { t as Mt } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
16
|
+
import "./useCloudI18n-AKCy98qD.js";
|
|
17
|
+
import { t as Nt } from "./useMergeTag-DSrBY0-2.js";
|
|
18
|
+
import { t as Pt } from "./useAliveFlag-CECL_OUb.js";
|
|
17
19
|
//#region ../core/dist/index.js
|
|
18
|
-
function
|
|
20
|
+
function Ft(e) {
|
|
19
21
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
let t =
|
|
23
|
-
content: e.content ??
|
|
23
|
+
function It(e) {
|
|
24
|
+
let t = ee({
|
|
25
|
+
content: e.content ?? xe(e.defaultFontFamily, e.templateDefaults),
|
|
24
26
|
selectedBlockId: null,
|
|
25
27
|
viewport: "desktop",
|
|
26
28
|
darkMode: !1,
|
|
27
29
|
previewMode: !1,
|
|
28
30
|
isDirty: !1,
|
|
29
31
|
uiTheme: "auto"
|
|
30
|
-
}),
|
|
32
|
+
}), r = n({
|
|
31
33
|
get: () => t.content,
|
|
32
34
|
set: (e) => {
|
|
33
35
|
t.content = e, t.isDirty = !0;
|
|
34
36
|
}
|
|
35
|
-
}),
|
|
36
|
-
function
|
|
37
|
+
}), i = n(() => t.selectedBlockId ? a(t.content.blocks, t.selectedBlockId) : null);
|
|
38
|
+
function a(e, t) {
|
|
37
39
|
for (let n of e) {
|
|
38
40
|
if (n.id === t) return n;
|
|
39
41
|
if (n.type === "section") for (let e of n.children) {
|
|
40
|
-
let n =
|
|
42
|
+
let n = a(e, t);
|
|
41
43
|
if (n) return n;
|
|
42
44
|
}
|
|
43
45
|
}
|
|
44
46
|
return null;
|
|
45
47
|
}
|
|
46
|
-
function
|
|
47
|
-
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n)
|
|
48
|
+
function o(e, t) {
|
|
49
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) o(e, t);
|
|
48
50
|
}
|
|
49
51
|
function s(e, t, n = { blocks: e }) {
|
|
50
52
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -64,7 +66,7 @@ function Nt(e) {
|
|
|
64
66
|
function c(t) {
|
|
65
67
|
return e.lockedBlocks?.value.has(t) ?? !1;
|
|
66
68
|
}
|
|
67
|
-
function
|
|
69
|
+
function u(e) {
|
|
68
70
|
let n = s(t.content.blocks, e);
|
|
69
71
|
if (!n) return null;
|
|
70
72
|
let r = n.blocks.findIndex((t) => t.id === e);
|
|
@@ -74,51 +76,51 @@ function Nt(e) {
|
|
|
74
76
|
index: r
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
|
-
function
|
|
79
|
+
function d(e, n = !0) {
|
|
78
80
|
t.content = e, n && (t.isDirty = !0);
|
|
79
81
|
}
|
|
80
|
-
function
|
|
82
|
+
function f(e) {
|
|
81
83
|
e && c(e) || (t.selectedBlockId = e);
|
|
82
84
|
}
|
|
83
|
-
function
|
|
85
|
+
function p(e) {
|
|
84
86
|
t.viewport = e;
|
|
85
87
|
}
|
|
86
|
-
function
|
|
88
|
+
function m(e) {
|
|
87
89
|
t.darkMode = e;
|
|
88
90
|
}
|
|
89
91
|
function h(e) {
|
|
90
92
|
t.uiTheme = e;
|
|
91
93
|
}
|
|
92
|
-
function
|
|
94
|
+
function g(e) {
|
|
93
95
|
t.previewMode = e, e && (t.selectedBlockId = null);
|
|
94
96
|
}
|
|
95
|
-
function
|
|
97
|
+
function _(e, n) {
|
|
96
98
|
if (c(e)) return;
|
|
97
|
-
let r =
|
|
99
|
+
let r = a(t.content.blocks, e);
|
|
98
100
|
r && (Object.assign(r, n), t.isDirty = !0);
|
|
99
101
|
}
|
|
100
|
-
function
|
|
102
|
+
function v(e) {
|
|
101
103
|
t.content.settings = {
|
|
102
104
|
...t.content.settings,
|
|
103
105
|
...e
|
|
104
106
|
}, t.isDirty = !0;
|
|
105
107
|
}
|
|
106
|
-
function
|
|
108
|
+
function y(e, n, r = 0, i) {
|
|
107
109
|
if (!(n && e.type === "section")) {
|
|
108
110
|
if (n) {
|
|
109
111
|
if (c(n)) return;
|
|
110
|
-
let o =
|
|
112
|
+
let o = a(t.content.blocks, n);
|
|
111
113
|
if (o && o.type === "section") {
|
|
112
|
-
if (r < 0 || r >=
|
|
114
|
+
if (r < 0 || r >= Ft(o.columns)) return;
|
|
113
115
|
o.children[r] = o.children[r] || [];
|
|
114
116
|
let t = o.children[r];
|
|
115
|
-
|
|
117
|
+
i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
|
|
116
118
|
}
|
|
117
|
-
} else
|
|
119
|
+
} else i !== void 0 && i < t.content.blocks.length ? t.content.blocks.splice(i, 0, e) : t.content.blocks.push(e);
|
|
118
120
|
t.isDirty = !0;
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
|
-
function
|
|
123
|
+
function b(e) {
|
|
122
124
|
if (c(e)) return;
|
|
123
125
|
let n = s(t.content.blocks, e);
|
|
124
126
|
if (n) {
|
|
@@ -127,13 +129,13 @@ function Nt(e) {
|
|
|
127
129
|
let [e] = n.blocks.splice(r, 1);
|
|
128
130
|
if (t.selectedBlockId) {
|
|
129
131
|
let n = /* @__PURE__ */ new Set();
|
|
130
|
-
|
|
132
|
+
o(e, n), n.has(t.selectedBlockId) && (t.selectedBlockId = null);
|
|
131
133
|
}
|
|
132
134
|
t.isDirty = !0;
|
|
133
135
|
}
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
|
-
function
|
|
138
|
+
function x(e, n, r, i = 0) {
|
|
137
139
|
if (c(e) || r && c(r)) return;
|
|
138
140
|
let o = s(t.content.blocks, e);
|
|
139
141
|
if (!o) return;
|
|
@@ -141,129 +143,129 @@ function Nt(e) {
|
|
|
141
143
|
if (l === -1 || r && o.blocks[l].type === "section") return;
|
|
142
144
|
let u;
|
|
143
145
|
if (r) {
|
|
144
|
-
let e =
|
|
145
|
-
if (!e || e.type !== "section" ||
|
|
146
|
-
e.children[
|
|
146
|
+
let e = a(t.content.blocks, r);
|
|
147
|
+
if (!e || e.type !== "section" || i < 0 || i >= Ft(e.columns)) return;
|
|
148
|
+
e.children[i] = e.children[i] || [], u = e.children[i];
|
|
147
149
|
} else u = t.content.blocks;
|
|
148
150
|
let [d] = o.blocks.splice(l, 1);
|
|
149
151
|
u.splice(n, 0, d), t.isDirty = !0;
|
|
150
152
|
}
|
|
151
|
-
function
|
|
153
|
+
function S() {
|
|
152
154
|
t.isDirty = !0;
|
|
153
155
|
}
|
|
154
156
|
return {
|
|
155
|
-
state:
|
|
156
|
-
content:
|
|
157
|
-
selectedBlock:
|
|
157
|
+
state: l(t),
|
|
158
|
+
content: r,
|
|
159
|
+
selectedBlock: i,
|
|
158
160
|
isBlockLocked: c,
|
|
159
|
-
setContent:
|
|
160
|
-
selectBlock:
|
|
161
|
-
setViewport:
|
|
162
|
-
setDarkMode:
|
|
161
|
+
setContent: d,
|
|
162
|
+
selectBlock: f,
|
|
163
|
+
setViewport: p,
|
|
164
|
+
setDarkMode: m,
|
|
163
165
|
setUiTheme: h,
|
|
164
|
-
setPreviewMode:
|
|
165
|
-
updateBlock:
|
|
166
|
-
updateSettings:
|
|
167
|
-
addBlock:
|
|
168
|
-
removeBlock:
|
|
169
|
-
moveBlock:
|
|
170
|
-
markDirty:
|
|
171
|
-
findBlockLocation:
|
|
166
|
+
setPreviewMode: g,
|
|
167
|
+
updateBlock: _,
|
|
168
|
+
updateSettings: v,
|
|
169
|
+
addBlock: y,
|
|
170
|
+
removeBlock: b,
|
|
171
|
+
moveBlock: x,
|
|
172
|
+
markDirty: S,
|
|
173
|
+
findBlockLocation: u
|
|
172
174
|
};
|
|
173
175
|
}
|
|
174
|
-
var
|
|
175
|
-
function
|
|
176
|
-
let { content: t, setContent:
|
|
177
|
-
function
|
|
178
|
-
return
|
|
176
|
+
var Lt = 50, Rt = 300, zt = 1500;
|
|
177
|
+
function Bt(e) {
|
|
178
|
+
let { content: t, setContent: r, isRemoteOperation: i, maxSize: a = Lt } = e, o = _([]), s = _([]), c = _(!1), l = null, u = null, d = n(() => o.value.length > 0), f = n(() => s.value.length > 0);
|
|
179
|
+
function p() {
|
|
180
|
+
return he(t.value);
|
|
179
181
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
182
|
+
function m(e) {
|
|
183
|
+
o.value.push(e), o.value.length > a && o.value.splice(0, o.value.length - a);
|
|
182
184
|
}
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
+
function h() {
|
|
186
|
+
u &&= (clearTimeout(u.timeoutId), null);
|
|
185
187
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
188
|
+
function g() {
|
|
189
|
+
i?.() || (h(), m(p()), s.value = []);
|
|
188
190
|
}
|
|
189
191
|
function v(e) {
|
|
190
|
-
if (!
|
|
191
|
-
if (
|
|
192
|
-
clearTimeout(
|
|
193
|
-
|
|
194
|
-
},
|
|
192
|
+
if (!i?.()) {
|
|
193
|
+
if (u && u.blockId === e) {
|
|
194
|
+
clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
|
|
195
|
+
u = null;
|
|
196
|
+
}, Rt);
|
|
195
197
|
return;
|
|
196
198
|
}
|
|
197
|
-
|
|
199
|
+
h(), m(p()), s.value = [], u = {
|
|
198
200
|
blockId: e,
|
|
199
201
|
timeoutId: setTimeout(() => {
|
|
200
|
-
|
|
201
|
-
},
|
|
202
|
+
u = null;
|
|
203
|
+
}, Rt)
|
|
202
204
|
};
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
function y() {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
},
|
|
208
|
+
c.value = !0, l && clearTimeout(l), l = setTimeout(() => {
|
|
209
|
+
c.value = !1, l = null;
|
|
210
|
+
}, zt);
|
|
209
211
|
}
|
|
210
212
|
function b() {
|
|
211
|
-
if (a.value.length === 0) return;
|
|
212
|
-
g();
|
|
213
|
-
let e = a.value.pop();
|
|
214
|
-
o.value.push(f()), n(e, !0), y();
|
|
215
|
-
}
|
|
216
|
-
function x() {
|
|
217
213
|
if (o.value.length === 0) return;
|
|
218
|
-
|
|
214
|
+
h();
|
|
219
215
|
let e = o.value.pop();
|
|
220
|
-
|
|
216
|
+
s.value.push(p()), r(e, !0), y();
|
|
217
|
+
}
|
|
218
|
+
function x() {
|
|
219
|
+
if (s.value.length === 0) return;
|
|
220
|
+
h();
|
|
221
|
+
let e = s.value.pop();
|
|
222
|
+
o.value.push(p()), r(e, !0), y();
|
|
221
223
|
}
|
|
222
224
|
function S() {
|
|
223
|
-
|
|
225
|
+
o.value = [], s.value = [], h();
|
|
224
226
|
}
|
|
225
227
|
function C() {
|
|
226
|
-
S(),
|
|
228
|
+
S(), l &&= (clearTimeout(l), null);
|
|
227
229
|
}
|
|
228
230
|
return {
|
|
229
|
-
canUndo:
|
|
230
|
-
canRedo:
|
|
231
|
-
isNavigating:
|
|
231
|
+
canUndo: d,
|
|
232
|
+
canRedo: f,
|
|
233
|
+
isNavigating: c,
|
|
232
234
|
undo: b,
|
|
233
235
|
redo: x,
|
|
234
|
-
record:
|
|
236
|
+
record: g,
|
|
235
237
|
recordDebounced: v,
|
|
236
238
|
clear: S,
|
|
237
239
|
destroy: C
|
|
238
240
|
};
|
|
239
241
|
}
|
|
240
|
-
function
|
|
242
|
+
function Vt(e) {
|
|
241
243
|
e.type === "table" ? e.rows = e.rows.map((e) => ({
|
|
242
244
|
...e,
|
|
243
|
-
id:
|
|
245
|
+
id: ue(),
|
|
244
246
|
cells: e.cells.map((e) => ({
|
|
245
247
|
...e,
|
|
246
|
-
id:
|
|
248
|
+
id: ue()
|
|
247
249
|
}))
|
|
248
250
|
})) : e.type === "social" ? e.icons = e.icons.map((e) => ({
|
|
249
251
|
...e,
|
|
250
|
-
id:
|
|
252
|
+
id: ue()
|
|
251
253
|
})) : e.type === "menu" && (e.items = e.items.map((e) => ({
|
|
252
254
|
...e,
|
|
253
|
-
id:
|
|
255
|
+
id: ue()
|
|
254
256
|
})));
|
|
255
257
|
}
|
|
256
|
-
function
|
|
258
|
+
function Ht(e) {
|
|
257
259
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
258
260
|
function o(n, r, a) {
|
|
259
|
-
let o =
|
|
261
|
+
let o = Ne(n, e.blockDefaults);
|
|
260
262
|
return t(o, r, a), i(o.id), o;
|
|
261
263
|
}
|
|
262
264
|
function s(e, n, r) {
|
|
263
265
|
let o = JSON.parse(JSON.stringify(e));
|
|
264
|
-
if (o.id =
|
|
266
|
+
if (o.id = ue(), Vt(o), o.type === "section" && (o.children = o.children.map((e) => e.map((e) => {
|
|
265
267
|
let t = JSON.parse(JSON.stringify(e));
|
|
266
|
-
return t.id =
|
|
268
|
+
return t.id = ue(), Vt(t), t;
|
|
267
269
|
}))), n !== void 0 || r !== void 0) t(o, n, r);
|
|
268
270
|
else {
|
|
269
271
|
let i = a?.(e.id) ?? null;
|
|
@@ -284,7 +286,7 @@ function zt(e) {
|
|
|
284
286
|
updateBlockProperty: l
|
|
285
287
|
};
|
|
286
288
|
}
|
|
287
|
-
function
|
|
289
|
+
function Ut(e) {
|
|
288
290
|
let { content: t, isDirty: n, onChange: r, debounce: i = 1e3, enabled: a = !0 } = e, o = null, s = !1;
|
|
289
291
|
function c() {
|
|
290
292
|
return typeof a == "function" ? a() : a;
|
|
@@ -306,7 +308,7 @@ function Bt(e) {
|
|
|
306
308
|
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
307
309
|
}, i));
|
|
308
310
|
}
|
|
309
|
-
let m =
|
|
311
|
+
let m = te(t, () => {
|
|
310
312
|
c() && !s && n() && p();
|
|
311
313
|
}, { deep: !0 });
|
|
312
314
|
function h() {
|
|
@@ -320,41 +322,41 @@ function Bt(e) {
|
|
|
320
322
|
destroy: h
|
|
321
323
|
};
|
|
322
324
|
}
|
|
323
|
-
function
|
|
324
|
-
let t =
|
|
325
|
-
function
|
|
325
|
+
function Wt(e) {
|
|
326
|
+
let t = ee(/* @__PURE__ */ new Set()), r = n(() => t.size > 0);
|
|
327
|
+
function i(e) {
|
|
326
328
|
return t.has(e);
|
|
327
329
|
}
|
|
328
|
-
function
|
|
330
|
+
function a(n) {
|
|
329
331
|
t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
|
|
330
332
|
}
|
|
331
|
-
function
|
|
333
|
+
function o() {
|
|
332
334
|
t.clear();
|
|
333
335
|
}
|
|
334
336
|
return {
|
|
335
|
-
isHidden:
|
|
336
|
-
toggleBlock:
|
|
337
|
-
reset:
|
|
338
|
-
hasHiddenBlocks:
|
|
337
|
+
isHidden: i,
|
|
338
|
+
toggleBlock: a,
|
|
339
|
+
reset: o,
|
|
340
|
+
hasHiddenBlocks: r
|
|
339
341
|
};
|
|
340
342
|
}
|
|
341
|
-
function
|
|
342
|
-
let t =
|
|
343
|
-
async function
|
|
344
|
-
let
|
|
345
|
-
if (
|
|
346
|
-
t.value = !0,
|
|
343
|
+
function Gt(e) {
|
|
344
|
+
let t = _(!1), r = _(!1), i = n(() => !!e.definition.value?.dataSource), a = n(() => i.value && !e.block.value.dataSourceFetched);
|
|
345
|
+
async function o() {
|
|
346
|
+
let n = e.definition.value;
|
|
347
|
+
if (n?.dataSource) {
|
|
348
|
+
t.value = !0, r.value = !1;
|
|
347
349
|
try {
|
|
348
|
-
let t = await
|
|
350
|
+
let t = await n.dataSource.onFetch({
|
|
349
351
|
fieldValues: { ...e.block.value.fieldValues },
|
|
350
352
|
blockId: e.block.value.id
|
|
351
353
|
});
|
|
352
354
|
if (t == null) return;
|
|
353
|
-
let
|
|
354
|
-
for (let e of Object.keys(
|
|
355
|
-
e.onUpdate(
|
|
355
|
+
let r = { ...e.block.value.fieldValues };
|
|
356
|
+
for (let e of Object.keys(r)) e in t && (r[e] = t[e]);
|
|
357
|
+
e.onUpdate(r, !0);
|
|
356
358
|
} catch (e) {
|
|
357
|
-
console.warn("[Templatical] Data source fetch error:", e),
|
|
359
|
+
console.warn("[Templatical] Data source fetch error:", e), r.value = !0;
|
|
358
360
|
} finally {
|
|
359
361
|
t.value = !1;
|
|
360
362
|
}
|
|
@@ -362,13 +364,13 @@ function Ht(e) {
|
|
|
362
364
|
}
|
|
363
365
|
return {
|
|
364
366
|
isFetching: t,
|
|
365
|
-
fetchError:
|
|
366
|
-
fetch:
|
|
367
|
-
hasDataSource:
|
|
368
|
-
needsFetch:
|
|
367
|
+
fetchError: r,
|
|
368
|
+
fetch: o,
|
|
369
|
+
hasDataSource: i,
|
|
370
|
+
needsFetch: a
|
|
369
371
|
};
|
|
370
372
|
}
|
|
371
|
-
function
|
|
373
|
+
function Kt(e, t) {
|
|
372
374
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
373
375
|
e.addBlock = (r, i, a, o) => {
|
|
374
376
|
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
@@ -384,27 +386,27 @@ function Ut(e, t) {
|
|
|
384
386
|
}
|
|
385
387
|
//#endregion
|
|
386
388
|
//#region src/utils/activeEditorTracker.ts
|
|
387
|
-
var
|
|
388
|
-
function
|
|
389
|
-
let e = ++
|
|
390
|
-
return
|
|
389
|
+
var qt = /* @__PURE__ */ new Set(), Jt = 0, Yt = 0;
|
|
390
|
+
function Xt() {
|
|
391
|
+
let e = ++Yt;
|
|
392
|
+
return qt.add(e), Jt === 0 && (Jt = e), {
|
|
391
393
|
id: e,
|
|
392
|
-
isActive: () =>
|
|
394
|
+
isActive: () => qt.size <= 1 || Jt === e,
|
|
393
395
|
claim: () => {
|
|
394
|
-
|
|
396
|
+
Jt = e;
|
|
395
397
|
},
|
|
396
398
|
dispose: () => {
|
|
397
|
-
if (
|
|
398
|
-
let e = Array.from(
|
|
399
|
-
|
|
399
|
+
if (qt.delete(e), Jt === e) {
|
|
400
|
+
let e = Array.from(qt);
|
|
401
|
+
Jt = e[e.length - 1] ?? 0;
|
|
400
402
|
}
|
|
401
403
|
}
|
|
402
404
|
};
|
|
403
405
|
}
|
|
404
406
|
//#endregion
|
|
405
407
|
//#region src/composables/useMergeTagPicker.ts
|
|
406
|
-
function
|
|
407
|
-
let e =
|
|
408
|
+
function Zt() {
|
|
409
|
+
let e = _(!1), t = _([]), n = null;
|
|
408
410
|
function r(r) {
|
|
409
411
|
if (n) {
|
|
410
412
|
let e = n;
|
|
@@ -418,7 +420,7 @@ function Jt() {
|
|
|
418
420
|
let i = n;
|
|
419
421
|
n = null, e.value = !1, t.value = [], i && i(r);
|
|
420
422
|
}
|
|
421
|
-
return
|
|
423
|
+
return s() && u(() => {
|
|
422
424
|
if (n) {
|
|
423
425
|
let e = n;
|
|
424
426
|
n = null, e(null);
|
|
@@ -433,8 +435,8 @@ function Jt() {
|
|
|
433
435
|
}
|
|
434
436
|
//#endregion
|
|
435
437
|
//#region src/composables/useLogicTagPicker.ts
|
|
436
|
-
function
|
|
437
|
-
let e =
|
|
438
|
+
function Qt() {
|
|
439
|
+
let e = _(!1), t = _([]), n = _([]), r = null;
|
|
438
440
|
function i(i, a) {
|
|
439
441
|
if (r) {
|
|
440
442
|
let e = r;
|
|
@@ -448,7 +450,7 @@ function Yt() {
|
|
|
448
450
|
let a = r;
|
|
449
451
|
r = null, e.value = !1, t.value = [], n.value = [], a && a(i);
|
|
450
452
|
}
|
|
451
|
-
return
|
|
453
|
+
return s() && u(() => {
|
|
452
454
|
if (r) {
|
|
453
455
|
let e = r;
|
|
454
456
|
r = null, e(null);
|
|
@@ -464,58 +466,58 @@ function Yt() {
|
|
|
464
466
|
}
|
|
465
467
|
//#endregion
|
|
466
468
|
//#region src/composables/useTemplateLint.ts
|
|
467
|
-
function
|
|
468
|
-
return e ? e.disabled === !0
|
|
469
|
+
function $t(e) {
|
|
470
|
+
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
469
471
|
}
|
|
470
|
-
function
|
|
471
|
-
let t =
|
|
472
|
+
function en(e) {
|
|
473
|
+
let t = _([]), n = _(!1), r = _(!1), i = v(null), a = $t(e.options), o = null, s = !1;
|
|
472
474
|
a || l();
|
|
473
475
|
async function l() {
|
|
474
476
|
try {
|
|
475
477
|
let t = await import("@templatical/quality");
|
|
476
|
-
if (
|
|
477
|
-
i.value = { lintTemplate: t.lintTemplate }, n.value = !0, u(), o =
|
|
478
|
+
if (s) return;
|
|
479
|
+
i.value = { lintTemplate: t.lintTemplate }, n.value = !0, u(), o = Ve(e.content, u, {
|
|
478
480
|
debounce: e.debounce ?? 500,
|
|
479
481
|
deep: !0
|
|
480
482
|
});
|
|
481
483
|
} catch {
|
|
482
|
-
if (
|
|
484
|
+
if (s) return;
|
|
483
485
|
r.value = !0;
|
|
484
486
|
}
|
|
485
487
|
}
|
|
486
488
|
function u() {
|
|
487
489
|
i.value && (t.value = i.value.lintTemplate(e.content.value, e.options));
|
|
488
490
|
}
|
|
489
|
-
let
|
|
491
|
+
let d = c(() => e.options, () => {
|
|
490
492
|
i.value && u();
|
|
491
493
|
}, { deep: !0 });
|
|
492
|
-
function
|
|
494
|
+
function f(t) {
|
|
493
495
|
t.fix && t.fix.apply({
|
|
494
496
|
updateBlock: e.updateBlock,
|
|
495
497
|
updateSettings: e.updateSettings,
|
|
496
498
|
removeBlock: e.removeBlock
|
|
497
499
|
});
|
|
498
500
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
501
|
+
function p() {
|
|
502
|
+
s = !0, o?.(), d();
|
|
501
503
|
}
|
|
502
504
|
return {
|
|
503
505
|
issues: t,
|
|
504
506
|
ready: n,
|
|
505
507
|
unavailable: r,
|
|
506
|
-
applyFix:
|
|
507
|
-
destroy:
|
|
508
|
+
applyFix: f,
|
|
509
|
+
destroy: p
|
|
508
510
|
};
|
|
509
511
|
}
|
|
510
512
|
//#endregion
|
|
511
513
|
//#region src/utils/blockTypeLabels.ts
|
|
512
|
-
function
|
|
514
|
+
function tn(e, t) {
|
|
513
515
|
return t.blocks[e] ?? e;
|
|
514
516
|
}
|
|
515
517
|
//#endregion
|
|
516
518
|
//#region src/composables/useKeyboardReorder.ts
|
|
517
|
-
function
|
|
518
|
-
let n =
|
|
519
|
+
function nn(e, t) {
|
|
520
|
+
let n = _(null), r = _(""), i = null;
|
|
519
521
|
function a(t) {
|
|
520
522
|
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
521
523
|
if (r !== -1) return {
|
|
@@ -541,7 +543,7 @@ function $t(e, t) {
|
|
|
541
543
|
let r = a(n);
|
|
542
544
|
if (!r) return "";
|
|
543
545
|
let i = (r.sectionId ? s(r.sectionId, r.columnIndex ?? 0) : e.content.value.blocks)?.[r.index];
|
|
544
|
-
return i ?
|
|
546
|
+
return i ? tn(i.type, t.t) : "";
|
|
545
547
|
}
|
|
546
548
|
function s(t, n) {
|
|
547
549
|
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
@@ -586,7 +588,7 @@ function $t(e, t) {
|
|
|
586
588
|
total: String(r.total)
|
|
587
589
|
})), n.value = null, i = null;
|
|
588
590
|
}
|
|
589
|
-
function
|
|
591
|
+
function h() {
|
|
590
592
|
let r = n.value;
|
|
591
593
|
if (r && i) {
|
|
592
594
|
let n = a(r), s = !!n && (n.sectionId !== i.sectionId || n.columnIndex !== i.columnIndex), l = !!n && n.index !== i.index;
|
|
@@ -602,7 +604,7 @@ function $t(e, t) {
|
|
|
602
604
|
announcement: r,
|
|
603
605
|
isLifted: l,
|
|
604
606
|
lift: u,
|
|
605
|
-
cancel:
|
|
607
|
+
cancel: h,
|
|
606
608
|
moveUp: f,
|
|
607
609
|
moveDown: p,
|
|
608
610
|
drop: m
|
|
@@ -610,13 +612,13 @@ function $t(e, t) {
|
|
|
610
612
|
}
|
|
611
613
|
//#endregion
|
|
612
614
|
//#region src/composables/useUiTheme.ts
|
|
613
|
-
function
|
|
614
|
-
let t =
|
|
615
|
-
return { resolvedTheme:
|
|
615
|
+
function rn(e) {
|
|
616
|
+
let t = We("(prefers-color-scheme: dark)");
|
|
617
|
+
return { resolvedTheme: j(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
616
618
|
}
|
|
617
619
|
//#endregion
|
|
618
620
|
//#region src/composables/useThemeStyles.ts
|
|
619
|
-
var
|
|
621
|
+
var an = {
|
|
620
622
|
bg: "--tpl-bg",
|
|
621
623
|
bgElevated: "--tpl-bg-elevated",
|
|
622
624
|
bgHover: "--tpl-bg-hover",
|
|
@@ -640,10 +642,10 @@ var tn = {
|
|
|
640
642
|
dangerLight: "--tpl-danger-light",
|
|
641
643
|
canvasBg: "--tpl-canvas-bg"
|
|
642
644
|
};
|
|
643
|
-
function
|
|
644
|
-
return { themeStyles:
|
|
645
|
+
function on({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
646
|
+
return { themeStyles: j(() => {
|
|
645
647
|
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
646
|
-
if (a) for (let [e, t] of Object.entries(
|
|
648
|
+
if (a) for (let [e, t] of Object.entries(an)) {
|
|
647
649
|
let n = a[e];
|
|
648
650
|
n && (r[t] = n);
|
|
649
651
|
}
|
|
@@ -652,38 +654,38 @@ function nn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
|
652
654
|
}
|
|
653
655
|
//#endregion
|
|
654
656
|
//#region src/utils/logger.ts
|
|
655
|
-
var
|
|
656
|
-
function
|
|
657
|
+
var sn = "[Templatical]";
|
|
658
|
+
function cn() {
|
|
657
659
|
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
658
660
|
}
|
|
659
|
-
var
|
|
661
|
+
var ln = {
|
|
660
662
|
warn(...e) {
|
|
661
|
-
console.warn(
|
|
663
|
+
console.warn(sn, ...e);
|
|
662
664
|
},
|
|
663
665
|
error(...e) {
|
|
664
|
-
console.error(
|
|
666
|
+
console.error(sn, ...e);
|
|
665
667
|
},
|
|
666
668
|
debug(...e) {
|
|
667
|
-
|
|
669
|
+
cn() || console.debug(sn, ...e);
|
|
668
670
|
},
|
|
669
671
|
info(...e) {
|
|
670
|
-
|
|
672
|
+
cn() || console.info(sn, ...e);
|
|
671
673
|
}
|
|
672
674
|
};
|
|
673
675
|
//#endregion
|
|
674
676
|
//#region src/composables/useBlockRegistry.ts
|
|
675
|
-
function
|
|
676
|
-
let e =
|
|
677
|
+
function un() {
|
|
678
|
+
let e = v(/* @__PURE__ */ new Map());
|
|
677
679
|
function t(t, n) {
|
|
678
|
-
e.value.set(t, n),
|
|
680
|
+
e.value.set(t, n), ne(e);
|
|
679
681
|
}
|
|
680
682
|
function n(t, n) {
|
|
681
683
|
let r = `custom:${t.type}`, i = {
|
|
682
684
|
component: n,
|
|
683
|
-
createBlock: () =>
|
|
685
|
+
createBlock: () => Fe(t),
|
|
684
686
|
definition: t
|
|
685
687
|
};
|
|
686
|
-
e.value.set(r, i),
|
|
688
|
+
e.value.set(r, i), ne(e);
|
|
687
689
|
}
|
|
688
690
|
function r(t) {
|
|
689
691
|
if (t.type === "custom") {
|
|
@@ -706,13 +708,13 @@ function sn() {
|
|
|
706
708
|
let t = a(e.customType);
|
|
707
709
|
if (!t) return o("Block definition not found");
|
|
708
710
|
try {
|
|
709
|
-
let { Liquid: n } = await import("./liquid.browser-
|
|
711
|
+
let { Liquid: n } = await import("./liquid.browser-DZLtv26k.js");
|
|
710
712
|
return await new n({
|
|
711
713
|
strictVariables: !1,
|
|
712
714
|
strictFilters: !1
|
|
713
715
|
}).parseAndRender(t.template, e.fieldValues);
|
|
714
716
|
} catch (t) {
|
|
715
|
-
return
|
|
717
|
+
return ln.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
716
718
|
}
|
|
717
719
|
}
|
|
718
720
|
function c(t) {
|
|
@@ -730,9 +732,9 @@ function sn() {
|
|
|
730
732
|
}
|
|
731
733
|
//#endregion
|
|
732
734
|
//#region src/composables/useCustomBlockStylesheets.ts
|
|
733
|
-
function
|
|
734
|
-
return
|
|
735
|
-
let n =
|
|
735
|
+
function dn(e, t) {
|
|
736
|
+
return j(() => {
|
|
737
|
+
let n = fn(e.value.blocks);
|
|
736
738
|
if (n.size === 0) return [];
|
|
737
739
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
738
740
|
for (let e of n) {
|
|
@@ -744,81 +746,81 @@ function cn(e, t) {
|
|
|
744
746
|
return i;
|
|
745
747
|
});
|
|
746
748
|
}
|
|
747
|
-
function
|
|
749
|
+
function fn(e) {
|
|
748
750
|
let t = /* @__PURE__ */ new Set();
|
|
749
|
-
return
|
|
751
|
+
return pn(e, t), t;
|
|
750
752
|
}
|
|
751
|
-
function
|
|
753
|
+
function pn(e, t) {
|
|
752
754
|
for (let n of e) {
|
|
753
|
-
if (
|
|
755
|
+
if (me(n)) {
|
|
754
756
|
t.add(n.customType);
|
|
755
757
|
continue;
|
|
756
758
|
}
|
|
757
759
|
if (n.type === "section") {
|
|
758
760
|
let e = n.children;
|
|
759
761
|
if (!e) continue;
|
|
760
|
-
for (let n of e)
|
|
762
|
+
for (let n of e) pn(n, t);
|
|
761
763
|
}
|
|
762
764
|
}
|
|
763
765
|
}
|
|
764
766
|
//#endregion
|
|
765
767
|
//#region src/utils/registerBuiltInBlocks.ts
|
|
766
|
-
var
|
|
768
|
+
var mn = [
|
|
767
769
|
{
|
|
768
770
|
type: "section",
|
|
769
|
-
createBlock:
|
|
771
|
+
createBlock: ve
|
|
770
772
|
},
|
|
771
773
|
{
|
|
772
774
|
type: "title",
|
|
773
|
-
createBlock:
|
|
775
|
+
createBlock: Re
|
|
774
776
|
},
|
|
775
777
|
{
|
|
776
778
|
type: "paragraph",
|
|
777
|
-
createBlock:
|
|
779
|
+
createBlock: Ce
|
|
778
780
|
},
|
|
779
781
|
{
|
|
780
782
|
type: "image",
|
|
781
|
-
createBlock:
|
|
783
|
+
createBlock: Oe
|
|
782
784
|
},
|
|
783
785
|
{
|
|
784
786
|
type: "button",
|
|
785
|
-
createBlock:
|
|
787
|
+
createBlock: be
|
|
786
788
|
},
|
|
787
789
|
{
|
|
788
790
|
type: "divider",
|
|
789
|
-
createBlock:
|
|
791
|
+
createBlock: Se
|
|
790
792
|
},
|
|
791
793
|
{
|
|
792
794
|
type: "video",
|
|
793
|
-
createBlock:
|
|
795
|
+
createBlock: ge
|
|
794
796
|
},
|
|
795
797
|
{
|
|
796
798
|
type: "social",
|
|
797
|
-
createBlock:
|
|
799
|
+
createBlock: Ie
|
|
798
800
|
},
|
|
799
801
|
{
|
|
800
802
|
type: "menu",
|
|
801
|
-
createBlock:
|
|
803
|
+
createBlock: we
|
|
802
804
|
},
|
|
803
805
|
{
|
|
804
806
|
type: "table",
|
|
805
|
-
createBlock:
|
|
807
|
+
createBlock: ye
|
|
806
808
|
},
|
|
807
809
|
{
|
|
808
810
|
type: "spacer",
|
|
809
|
-
createBlock:
|
|
811
|
+
createBlock: ze
|
|
810
812
|
},
|
|
811
813
|
{
|
|
812
814
|
type: "html",
|
|
813
|
-
createBlock:
|
|
815
|
+
createBlock: je
|
|
814
816
|
},
|
|
815
817
|
{
|
|
816
818
|
type: "countdown",
|
|
817
|
-
createBlock:
|
|
819
|
+
createBlock: De
|
|
818
820
|
}
|
|
819
821
|
];
|
|
820
|
-
function
|
|
821
|
-
for (let n of
|
|
822
|
+
function hn(e, t) {
|
|
823
|
+
for (let n of mn) {
|
|
822
824
|
let r = t[n.type];
|
|
823
825
|
r && e.registerBuiltIn(n.type, {
|
|
824
826
|
component: r,
|
|
@@ -828,7 +830,7 @@ function fn(e, t) {
|
|
|
828
830
|
}
|
|
829
831
|
//#endregion
|
|
830
832
|
//#region src/utils/keyboardShortcuts.ts
|
|
831
|
-
function
|
|
833
|
+
function gn(e) {
|
|
832
834
|
for (let t of e.composedPath()) {
|
|
833
835
|
if (!(t instanceof HTMLElement)) continue;
|
|
834
836
|
if (t.isContentEditable) return !0;
|
|
@@ -837,14 +839,14 @@ function pn(e) {
|
|
|
837
839
|
}
|
|
838
840
|
return !1;
|
|
839
841
|
}
|
|
840
|
-
function
|
|
842
|
+
function _n(e, t) {
|
|
841
843
|
let n = e.metaKey || e.ctrlKey;
|
|
842
844
|
if (n && e.key.toLowerCase() === "s") {
|
|
843
845
|
e.preventDefault(), t.onSave?.();
|
|
844
846
|
return;
|
|
845
847
|
}
|
|
846
848
|
if (n && e.key.toLowerCase() === "z") {
|
|
847
|
-
if (
|
|
849
|
+
if (gn(e)) return;
|
|
848
850
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
849
851
|
return;
|
|
850
852
|
}
|
|
@@ -852,42 +854,82 @@ function mn(e, t) {
|
|
|
852
854
|
t.selectBlock(null);
|
|
853
855
|
return;
|
|
854
856
|
}
|
|
855
|
-
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !
|
|
857
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !gn(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
856
858
|
}
|
|
857
859
|
//#endregion
|
|
858
|
-
//#region src/
|
|
859
|
-
|
|
860
|
+
//#region src/utils/mergeTagLabelSegments.ts
|
|
861
|
+
function vn(e, t, n) {
|
|
862
|
+
if (!e) return [];
|
|
863
|
+
let r = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), i = [], a = 0, o;
|
|
864
|
+
for (; (o = r.exec(e)) !== null;) {
|
|
865
|
+
o.index > a && i.push({
|
|
866
|
+
type: "text",
|
|
867
|
+
value: e.slice(a, o.index)
|
|
868
|
+
});
|
|
869
|
+
let r = o[0];
|
|
870
|
+
le(r, n) ? i.push({
|
|
871
|
+
type: "tag",
|
|
872
|
+
value: _e(r, t)
|
|
873
|
+
}) : Ee(r, n) ? i.push({
|
|
874
|
+
type: "tag",
|
|
875
|
+
value: Le(r, n)
|
|
876
|
+
}) : i.push({
|
|
877
|
+
type: "text",
|
|
878
|
+
value: r
|
|
879
|
+
}), a = o.index + r.length;
|
|
880
|
+
}
|
|
881
|
+
return a < e.length && i.push({
|
|
882
|
+
type: "text",
|
|
883
|
+
value: e.slice(a)
|
|
884
|
+
}), i;
|
|
885
|
+
}
|
|
886
|
+
//#endregion
|
|
887
|
+
//#region src/components/MergeTagPreviewText.vue
|
|
888
|
+
var yn = y({
|
|
889
|
+
name: "MergeTagPreviewText",
|
|
890
|
+
props: { text: {
|
|
891
|
+
type: String,
|
|
892
|
+
required: !0
|
|
893
|
+
} },
|
|
894
|
+
setup(e) {
|
|
895
|
+
let t = N(it, []), n = N(at, Me.liquid), r = j(() => vn(e.text, t, n));
|
|
896
|
+
return () => r.value.map((e, t) => e.type === "tag" ? ae("span", {
|
|
897
|
+
key: t,
|
|
898
|
+
class: "tpl-merge-tag-label"
|
|
899
|
+
}, e.value) : e.value);
|
|
900
|
+
}
|
|
901
|
+
}), bn = { class: "tpl:text-center" }, xn = ["href"], Sn = /* @__PURE__ */ y({
|
|
860
902
|
__name: "ButtonBlock",
|
|
861
903
|
props: {
|
|
862
904
|
block: {},
|
|
863
905
|
viewport: {}
|
|
864
906
|
},
|
|
865
|
-
setup(
|
|
866
|
-
let
|
|
907
|
+
setup(e) {
|
|
908
|
+
let t = e, n = j(() => {
|
|
867
909
|
let e = {
|
|
868
910
|
display: "inline-block",
|
|
869
|
-
padding: `${
|
|
870
|
-
backgroundColor:
|
|
871
|
-
color:
|
|
872
|
-
fontSize: `${
|
|
911
|
+
padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
|
|
912
|
+
backgroundColor: t.block.backgroundColor,
|
|
913
|
+
color: t.block.textColor,
|
|
914
|
+
fontSize: `${t.block.fontSize}px`,
|
|
873
915
|
fontWeight: "bold",
|
|
874
916
|
textDecoration: "none",
|
|
875
|
-
borderRadius: `${
|
|
917
|
+
borderRadius: `${t.block.borderRadius}px`,
|
|
876
918
|
textAlign: "center"
|
|
877
919
|
};
|
|
878
|
-
return
|
|
920
|
+
return t.block.fontFamily && (e.fontFamily = t.block.fontFamily), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
|
|
879
921
|
});
|
|
880
|
-
return (
|
|
881
|
-
href:
|
|
882
|
-
style:
|
|
922
|
+
return (t, r) => (f(), x("div", bn, [b("a", {
|
|
923
|
+
href: e.block.url || "#",
|
|
924
|
+
style: i(n.value),
|
|
883
925
|
class: "tpl:cursor-default",
|
|
884
|
-
onClick:
|
|
885
|
-
},
|
|
926
|
+
onClick: r[0] ||= P(() => {}, ["prevent"])
|
|
927
|
+
}, [w(yn, { text: e.block.text }, null, 8, ["text"])], 12, xn)]));
|
|
886
928
|
}
|
|
887
|
-
}),
|
|
929
|
+
}), Cn = F("bookmark", [["path", {
|
|
888
930
|
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",
|
|
889
931
|
key: "oz39mx"
|
|
890
|
-
}]]),
|
|
932
|
+
}]]), wn = F("box", [
|
|
891
933
|
["path", {
|
|
892
934
|
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",
|
|
893
935
|
key: "hh9hay"
|
|
@@ -900,13 +942,13 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
900
942
|
d: "M12 22V12",
|
|
901
943
|
key: "d0xqtd"
|
|
902
944
|
}]
|
|
903
|
-
]),
|
|
945
|
+
]), Tn = F("code", [["path", {
|
|
904
946
|
d: "m16 18 6-6-6-6",
|
|
905
947
|
key: "eg8j8"
|
|
906
948
|
}], ["path", {
|
|
907
949
|
d: "m8 6-6 6 6 6",
|
|
908
950
|
key: "ppft3o"
|
|
909
|
-
}]]),
|
|
951
|
+
}]]), En = F("copy", [["rect", {
|
|
910
952
|
width: "14",
|
|
911
953
|
height: "14",
|
|
912
954
|
x: "8",
|
|
@@ -917,7 +959,7 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
917
959
|
}], ["path", {
|
|
918
960
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
919
961
|
key: "zix9uf"
|
|
920
|
-
}]]),
|
|
962
|
+
}]]), Dn = F("eye-off", [
|
|
921
963
|
["path", {
|
|
922
964
|
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",
|
|
923
965
|
key: "ct8e1f"
|
|
@@ -934,10 +976,10 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
934
976
|
d: "m2 2 20 20",
|
|
935
977
|
key: "1ooewy"
|
|
936
978
|
}]
|
|
937
|
-
]),
|
|
979
|
+
]), On = F("funnel", [["path", {
|
|
938
980
|
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",
|
|
939
981
|
key: "sc7q7i"
|
|
940
|
-
}]]),
|
|
982
|
+
}]]), kn = F("grip-vertical", [
|
|
941
983
|
["circle", {
|
|
942
984
|
cx: "9",
|
|
943
985
|
cy: "12",
|
|
@@ -974,7 +1016,7 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
974
1016
|
r: "1",
|
|
975
1017
|
key: "f4zoj3"
|
|
976
1018
|
}]
|
|
977
|
-
]),
|
|
1019
|
+
]), An = F("image", [
|
|
978
1020
|
["rect", {
|
|
979
1021
|
width: "18",
|
|
980
1022
|
height: "18",
|
|
@@ -994,13 +1036,13 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
994
1036
|
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
995
1037
|
key: "1xmnt7"
|
|
996
1038
|
}]
|
|
997
|
-
]),
|
|
1039
|
+
]), jn = F("navigation", [["polygon", {
|
|
998
1040
|
points: "3 11 22 2 13 21 11 13 3 11",
|
|
999
1041
|
key: "1ltx0t"
|
|
1000
|
-
}]]),
|
|
1042
|
+
}]]), Mn = F("puzzle", [["path", {
|
|
1001
1043
|
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",
|
|
1002
1044
|
key: "w46dr5"
|
|
1003
|
-
}]]),
|
|
1045
|
+
}]]), Nn = F("share-2", [
|
|
1004
1046
|
["circle", {
|
|
1005
1047
|
cx: "18",
|
|
1006
1048
|
cy: "5",
|
|
@@ -1033,7 +1075,7 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
1033
1075
|
y2: "10.49",
|
|
1034
1076
|
key: "1n3mei"
|
|
1035
1077
|
}]
|
|
1036
|
-
]),
|
|
1078
|
+
]), Pn = F("table", [
|
|
1037
1079
|
["path", {
|
|
1038
1080
|
d: "M12 3v18",
|
|
1039
1081
|
key: "108xh3"
|
|
@@ -1054,7 +1096,7 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
1054
1096
|
d: "M3 15h18",
|
|
1055
1097
|
key: "5xshup"
|
|
1056
1098
|
}]
|
|
1057
|
-
]),
|
|
1099
|
+
]), Fn = F("video", [["path", {
|
|
1058
1100
|
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
1059
1101
|
key: "ftymec"
|
|
1060
1102
|
}], ["rect", {
|
|
@@ -1064,54 +1106,54 @@ var hn = { class: "tpl:text-center" }, gn = ["href"], _n = /* @__PURE__ */ y({
|
|
|
1064
1106
|
height: "12",
|
|
1065
1107
|
rx: "2",
|
|
1066
1108
|
key: "158x01"
|
|
1067
|
-
}]]),
|
|
1109
|
+
}]]), In = ["innerHTML"], Ln = [
|
|
1068
1110
|
"src",
|
|
1069
1111
|
"width",
|
|
1070
1112
|
"height"
|
|
1071
|
-
],
|
|
1113
|
+
], Rn = /* @__PURE__ */ y({
|
|
1072
1114
|
__name: "CustomBlockIcon",
|
|
1073
1115
|
props: {
|
|
1074
1116
|
icon: {},
|
|
1075
1117
|
size: {}
|
|
1076
1118
|
},
|
|
1077
|
-
setup(
|
|
1078
|
-
let
|
|
1079
|
-
return (
|
|
1119
|
+
setup(e) {
|
|
1120
|
+
let t = e, n = j(() => t.size ?? 20), r = j(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), a = j(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/")));
|
|
1121
|
+
return (t, o) => r.value ? (f(), x("span", {
|
|
1080
1122
|
key: 0,
|
|
1081
1123
|
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
1082
|
-
style:
|
|
1083
|
-
width: `${
|
|
1084
|
-
height: `${
|
|
1124
|
+
style: i({
|
|
1125
|
+
width: `${n.value}px`,
|
|
1126
|
+
height: `${n.value}px`
|
|
1085
1127
|
}),
|
|
1086
|
-
innerHTML:
|
|
1087
|
-
}, null, 12,
|
|
1128
|
+
innerHTML: e.icon
|
|
1129
|
+
}, null, 12, In)) : a.value ? (f(), x("img", {
|
|
1088
1130
|
key: 1,
|
|
1089
|
-
src:
|
|
1090
|
-
width:
|
|
1091
|
-
height:
|
|
1131
|
+
src: e.icon,
|
|
1132
|
+
width: n.value,
|
|
1133
|
+
height: n.value,
|
|
1092
1134
|
class: "tpl:inline-block",
|
|
1093
1135
|
alt: ""
|
|
1094
|
-
}, null, 8,
|
|
1136
|
+
}, null, 8, Ln)) : (f(), D(k(wn), {
|
|
1095
1137
|
key: 2,
|
|
1096
|
-
size:
|
|
1138
|
+
size: n.value,
|
|
1097
1139
|
"stroke-width": 1.5
|
|
1098
1140
|
}, null, 8, ["size"]));
|
|
1099
1141
|
}
|
|
1100
1142
|
});
|
|
1101
1143
|
//#endregion
|
|
1102
1144
|
//#region src/composables/useEditorRoot.ts
|
|
1103
|
-
function
|
|
1104
|
-
return
|
|
1145
|
+
function zn() {
|
|
1146
|
+
return N(ft, document) ?? document;
|
|
1105
1147
|
}
|
|
1106
1148
|
//#endregion
|
|
1107
1149
|
//#region src/composables/useFocusTrap.ts
|
|
1108
|
-
var
|
|
1109
|
-
function
|
|
1110
|
-
let n =
|
|
1150
|
+
var Bn = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
1151
|
+
function Vn(e, t) {
|
|
1152
|
+
let n = zn(), r = null, i = null, a = null;
|
|
1111
1153
|
function o() {
|
|
1112
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
1154
|
+
return e.value ? Array.from(e.value.querySelectorAll(Bn)).filter((e) => e.offsetParent !== null) : [];
|
|
1113
1155
|
}
|
|
1114
|
-
function
|
|
1156
|
+
function s(e) {
|
|
1115
1157
|
if (e.key !== "Tab") return;
|
|
1116
1158
|
let t = o();
|
|
1117
1159
|
if (t.length === 0) return;
|
|
@@ -1120,30 +1162,30 @@ function In(e, t) {
|
|
|
1120
1162
|
}
|
|
1121
1163
|
function l() {
|
|
1122
1164
|
let t = i !== null || a !== null;
|
|
1123
|
-
t &&
|
|
1165
|
+
t && d({ restoreFocus: !1 }), t || (r = n.activeElement), a = requestAnimationFrame(() => {
|
|
1124
1166
|
a = null;
|
|
1125
1167
|
let t = o();
|
|
1126
1168
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
1127
|
-
}), i =
|
|
1169
|
+
}), i = Ge(e, "keydown", s);
|
|
1128
1170
|
}
|
|
1129
|
-
function
|
|
1171
|
+
function d(e = {}) {
|
|
1130
1172
|
let t = e.restoreFocus !== !1;
|
|
1131
1173
|
a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && r && r.focus && (r.focus(), r = null);
|
|
1132
1174
|
}
|
|
1133
|
-
let
|
|
1134
|
-
e && t ? l() :
|
|
1175
|
+
let f = c([t, e], ([e, t]) => {
|
|
1176
|
+
e && t ? l() : d();
|
|
1135
1177
|
}, { flush: "post" });
|
|
1136
|
-
|
|
1137
|
-
|
|
1178
|
+
u(() => {
|
|
1179
|
+
f(), d();
|
|
1138
1180
|
});
|
|
1139
1181
|
}
|
|
1140
1182
|
//#endregion
|
|
1141
1183
|
//#region src/composables/useEmoji.ts
|
|
1142
|
-
function
|
|
1143
|
-
let [e, t] =
|
|
1144
|
-
|
|
1184
|
+
function Hn() {
|
|
1185
|
+
let [e, t] = He(!1), n = v([]), r = !1;
|
|
1186
|
+
u(() => {
|
|
1145
1187
|
r = !0;
|
|
1146
|
-
}),
|
|
1188
|
+
}), c(e, async (e) => {
|
|
1147
1189
|
if (e && n.value.length === 0) {
|
|
1148
1190
|
let { emojiCategories: e } = await import("./emojiData-6m0DBh7O.js");
|
|
1149
1191
|
if (r) return;
|
|
@@ -1165,8 +1207,8 @@ function Ln() {
|
|
|
1165
1207
|
}
|
|
1166
1208
|
//#endregion
|
|
1167
1209
|
//#region src/composables/useDragDrop.ts
|
|
1168
|
-
function
|
|
1169
|
-
let { onBlockMove: t, onBlockAdd: n } = e, r =
|
|
1210
|
+
function Un(e) {
|
|
1211
|
+
let { onBlockMove: t, onBlockAdd: n } = e, r = _(!1), i = _(null), a = _(null);
|
|
1170
1212
|
function o(e) {
|
|
1171
1213
|
r.value = !0, i.value = e;
|
|
1172
1214
|
}
|
|
@@ -1215,7 +1257,7 @@ function Rn(e) {
|
|
|
1215
1257
|
}
|
|
1216
1258
|
//#endregion
|
|
1217
1259
|
//#region src/composables/useFonts.ts
|
|
1218
|
-
var
|
|
1260
|
+
var Wn = [
|
|
1219
1261
|
{
|
|
1220
1262
|
value: "Arial",
|
|
1221
1263
|
label: "Arial"
|
|
@@ -1244,7 +1286,7 @@ var zn = [
|
|
|
1244
1286
|
value: "Courier New",
|
|
1245
1287
|
label: "Courier New"
|
|
1246
1288
|
}
|
|
1247
|
-
],
|
|
1289
|
+
], Gn = {
|
|
1248
1290
|
arial: "Arial, sans-serif",
|
|
1249
1291
|
helvetica: "Helvetica, sans-serif",
|
|
1250
1292
|
georgia: "Georgia, serif",
|
|
@@ -1252,14 +1294,14 @@ var zn = [
|
|
|
1252
1294
|
verdana: "Verdana, sans-serif",
|
|
1253
1295
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1254
1296
|
"courier new": "'Courier New', monospace"
|
|
1255
|
-
},
|
|
1256
|
-
function
|
|
1257
|
-
let t =
|
|
1297
|
+
}, Kn = "Arial, sans-serif";
|
|
1298
|
+
function qn(e) {
|
|
1299
|
+
let t = _(e?.customFonts ?? []), n = _(!0), r = _(!1), i = j(() => e?.defaultFallback ?? Kn);
|
|
1258
1300
|
function a(e) {
|
|
1259
1301
|
n.value = e;
|
|
1260
1302
|
}
|
|
1261
|
-
let o =
|
|
1262
|
-
let e = [...
|
|
1303
|
+
let o = j(() => {
|
|
1304
|
+
let e = [...Wn];
|
|
1263
1305
|
if (!n.value) return e.sort((e, t) => e.label.localeCompare(t.label));
|
|
1264
1306
|
let r = t.value.map((e) => ({
|
|
1265
1307
|
value: e.name,
|
|
@@ -1268,75 +1310,75 @@ function Hn(e) {
|
|
|
1268
1310
|
})), i = [...e, ...r];
|
|
1269
1311
|
return i.sort((e, t) => e.label.localeCompare(t.label)), i;
|
|
1270
1312
|
});
|
|
1271
|
-
function
|
|
1313
|
+
function c(e) {
|
|
1272
1314
|
return o.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1273
1315
|
}
|
|
1274
|
-
function
|
|
1275
|
-
return
|
|
1316
|
+
function l(e) {
|
|
1317
|
+
return Wn.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1276
1318
|
}
|
|
1277
|
-
function
|
|
1319
|
+
function d() {
|
|
1278
1320
|
if (e?.defaultFont) {
|
|
1279
|
-
if (!n.value && !
|
|
1280
|
-
if (
|
|
1321
|
+
if (!n.value && !l(e.defaultFont)) return Kn;
|
|
1322
|
+
if (c(e.defaultFont)) {
|
|
1281
1323
|
let t = o.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1282
1324
|
if (t) return t.value;
|
|
1283
1325
|
}
|
|
1284
1326
|
}
|
|
1285
|
-
return
|
|
1327
|
+
return Kn;
|
|
1286
1328
|
}
|
|
1287
|
-
let
|
|
1288
|
-
function
|
|
1329
|
+
let f = j(() => d());
|
|
1330
|
+
function p(e) {
|
|
1289
1331
|
if (!e) return i.value;
|
|
1290
1332
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1291
1333
|
if (n) {
|
|
1292
1334
|
let e = n.fallback ?? i.value;
|
|
1293
1335
|
return `'${n.name}', ${e}`;
|
|
1294
1336
|
}
|
|
1295
|
-
return
|
|
1337
|
+
return Gn[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1296
1338
|
}
|
|
1297
|
-
let
|
|
1339
|
+
let m = [], h = !1;
|
|
1298
1340
|
async function g() {
|
|
1299
1341
|
if (t.value.length === 0) {
|
|
1300
|
-
|
|
1342
|
+
h || (r.value = !0);
|
|
1301
1343
|
return;
|
|
1302
1344
|
}
|
|
1303
1345
|
let e = t.value.map(async (e) => {
|
|
1304
1346
|
try {
|
|
1305
1347
|
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
1306
1348
|
let t = document.createElement("link");
|
|
1307
|
-
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name),
|
|
1349
|
+
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), m.push(t), await new Promise((n, r) => {
|
|
1308
1350
|
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1309
1351
|
});
|
|
1310
1352
|
} catch (t) {
|
|
1311
|
-
|
|
1353
|
+
ln.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1312
1354
|
}
|
|
1313
1355
|
});
|
|
1314
|
-
await Promise.allSettled(e), !
|
|
1356
|
+
await Promise.allSettled(e), !h && (r.value = !0);
|
|
1315
1357
|
}
|
|
1316
|
-
function
|
|
1317
|
-
for (let e of
|
|
1318
|
-
|
|
1358
|
+
function v() {
|
|
1359
|
+
for (let e of m) e.remove();
|
|
1360
|
+
m.length = 0;
|
|
1319
1361
|
}
|
|
1320
|
-
return
|
|
1321
|
-
|
|
1362
|
+
return s() && u(() => {
|
|
1363
|
+
h = !0, v();
|
|
1322
1364
|
}), {
|
|
1323
1365
|
fonts: o,
|
|
1324
|
-
defaultFont:
|
|
1366
|
+
defaultFont: f,
|
|
1325
1367
|
defaultFallback: i,
|
|
1326
1368
|
customFonts: t,
|
|
1327
1369
|
customFontsEnabled: n,
|
|
1328
1370
|
isLoaded: r,
|
|
1329
1371
|
setCustomFontsEnabled: a,
|
|
1330
1372
|
loadCustomFonts: g,
|
|
1331
|
-
cleanupFontLinks:
|
|
1332
|
-
getFontWithFallback:
|
|
1333
|
-
getDefaultFont:
|
|
1373
|
+
cleanupFontLinks: v,
|
|
1374
|
+
getFontWithFallback: p,
|
|
1375
|
+
getDefaultFont: d
|
|
1334
1376
|
};
|
|
1335
1377
|
}
|
|
1336
1378
|
//#endregion
|
|
1337
1379
|
//#region src/composables/useLogicTag.ts
|
|
1338
|
-
function
|
|
1339
|
-
let e =
|
|
1380
|
+
function Jn() {
|
|
1381
|
+
let e = N(ct, []), t = N(wt, []), n = N(at, Me.liquid), r = N(Ze, null), i = N(Ct, null), a = _(!1), o = !!r || e.length > 0 || t.length > 0, s = e.length > 0 || t.length > 0;
|
|
1340
1382
|
async function c() {
|
|
1341
1383
|
if (r) {
|
|
1342
1384
|
a.value = !0;
|
|
@@ -1367,12 +1409,12 @@ function Un() {
|
|
|
1367
1409
|
}
|
|
1368
1410
|
//#endregion
|
|
1369
1411
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
1370
|
-
function
|
|
1371
|
-
return
|
|
1412
|
+
function Yn(e, t, n) {
|
|
1413
|
+
return Ee(e, n) ? {
|
|
1372
1414
|
type: "logicMergeTagNode",
|
|
1373
1415
|
attrs: {
|
|
1374
1416
|
value: e,
|
|
1375
|
-
keyword:
|
|
1417
|
+
keyword: Le(e, n)
|
|
1376
1418
|
}
|
|
1377
1419
|
} : {
|
|
1378
1420
|
type: "mergeTagNode",
|
|
@@ -1384,15 +1426,15 @@ function Wn(e, t, n) {
|
|
|
1384
1426
|
}
|
|
1385
1427
|
//#endregion
|
|
1386
1428
|
//#region src/utils/insertLogicTag.ts
|
|
1387
|
-
function
|
|
1429
|
+
function Xn(e) {
|
|
1388
1430
|
return "before" in e && "after" in e;
|
|
1389
1431
|
}
|
|
1390
|
-
function
|
|
1391
|
-
if (!
|
|
1392
|
-
e.chain().focus().insertContent(
|
|
1432
|
+
function Zn(e, t, n) {
|
|
1433
|
+
if (!Xn(t)) {
|
|
1434
|
+
e.chain().focus().insertContent(Yn(t.value, t.label, n)).run();
|
|
1393
1435
|
return;
|
|
1394
1436
|
}
|
|
1395
|
-
let r =
|
|
1437
|
+
let r = Yn(t.before, t.label, n), i = Yn(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
1396
1438
|
if (a !== o) {
|
|
1397
1439
|
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
1398
1440
|
return;
|
|
@@ -1401,9 +1443,9 @@ function Kn(e, t, n) {
|
|
|
1401
1443
|
}
|
|
1402
1444
|
//#endregion
|
|
1403
1445
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
1404
|
-
function
|
|
1405
|
-
let t =
|
|
1406
|
-
|
|
1446
|
+
function Qn(e) {
|
|
1447
|
+
let t = _(!1), n = _(""), r = _(null);
|
|
1448
|
+
Vn(r, t);
|
|
1407
1449
|
function i() {
|
|
1408
1450
|
let r = e.value?.getAttributes("link").href || "";
|
|
1409
1451
|
n.value = r, t.value = !0;
|
|
@@ -1455,24 +1497,24 @@ function qn(e) {
|
|
|
1455
1497
|
}
|
|
1456
1498
|
//#endregion
|
|
1457
1499
|
//#region src/composables/useRichTextEditor.ts
|
|
1458
|
-
function
|
|
1459
|
-
let t =
|
|
1500
|
+
function $n(e) {
|
|
1501
|
+
let t = N(ht, null), { mergeTags: n, canRequestMergeTag: r, isRequesting: i, requestMergeTag: a, syntax: o, autocomplete: s } = Nt(), { canInsertLogicTag: l, isRequesting: u, requestLogicTag: d } = Jn(), f = N(Qe, null), p = (g(f) ? f.value : f)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", m = de(o), y = v(null), { showLinkDialog: b, linkUrl: x, linkDialogRef: S, openLinkDialog: C, insertLink: w, removeLink: T, closeLinkDialog: E, handleLinkKeydown: D } = Qn(y), { start: O, stop: k } = Ue(() => y.value?.commands.focus("end"), 0, { immediate: !1 }), ee = v(null), A = _(!0), te = _(null), j = !1;
|
|
1460
1502
|
async function ne() {
|
|
1461
|
-
|
|
1503
|
+
te.value = null, A.value = !0;
|
|
1462
1504
|
try {
|
|
1463
|
-
let { TiptapEditor:
|
|
1464
|
-
mergeTags:
|
|
1465
|
-
syntax:
|
|
1466
|
-
triggerChar:
|
|
1467
|
-
autocompleteEnabled:
|
|
1468
|
-
suggestionEmptyText:
|
|
1505
|
+
let { TiptapEditor: r, EC: i, extensions: a } = await e.loadExtensions({
|
|
1506
|
+
mergeTags: n,
|
|
1507
|
+
syntax: o,
|
|
1508
|
+
triggerChar: m,
|
|
1509
|
+
autocompleteEnabled: s,
|
|
1510
|
+
suggestionEmptyText: p
|
|
1469
1511
|
});
|
|
1470
1512
|
if (j) return;
|
|
1471
|
-
|
|
1472
|
-
let
|
|
1473
|
-
a.forEach((e, t) =>
|
|
1474
|
-
let
|
|
1475
|
-
extensions: a.filter((e, t) =>
|
|
1513
|
+
ee.value = i;
|
|
1514
|
+
let c = /* @__PURE__ */ new Map();
|
|
1515
|
+
a.forEach((e, t) => c.set(e.name, t));
|
|
1516
|
+
let l = new r({
|
|
1517
|
+
extensions: a.filter((e, t) => c.get(e.name) === t),
|
|
1476
1518
|
content: e.blockContent(),
|
|
1477
1519
|
editable: !0,
|
|
1478
1520
|
onUpdate: ({ editor: n }) => {
|
|
@@ -1480,103 +1522,103 @@ function Jn(e) {
|
|
|
1480
1522
|
}
|
|
1481
1523
|
});
|
|
1482
1524
|
if (j) {
|
|
1483
|
-
|
|
1525
|
+
l.destroy();
|
|
1484
1526
|
return;
|
|
1485
1527
|
}
|
|
1486
|
-
y.value =
|
|
1528
|
+
y.value = l, A.value = !1, O();
|
|
1487
1529
|
} catch (t) {
|
|
1488
1530
|
if (j) return;
|
|
1489
|
-
|
|
1531
|
+
ln.error(`[${e.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, t), te.value = t instanceof Error ? t.message : "Failed to load editor", A.value = !1;
|
|
1490
1532
|
}
|
|
1491
1533
|
}
|
|
1492
1534
|
function M() {
|
|
1493
1535
|
y.value?.destroy(), y.value = null, ne();
|
|
1494
1536
|
}
|
|
1495
1537
|
ne();
|
|
1496
|
-
let re =
|
|
1538
|
+
let re = c(() => e.blockContent(), (e) => {
|
|
1497
1539
|
y.value && y.value.getHTML() !== e && y.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1498
1540
|
});
|
|
1499
|
-
function
|
|
1500
|
-
if (
|
|
1541
|
+
function ie(t) {
|
|
1542
|
+
if (i.value || u.value) return;
|
|
1501
1543
|
let n = t.composedPath().find((e) => e instanceof HTMLElement);
|
|
1502
1544
|
n && (e.onClickOutsideSideEffect?.(n), !(n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog")) && e.onDone());
|
|
1503
1545
|
}
|
|
1504
|
-
|
|
1505
|
-
j = !0, re(),
|
|
1546
|
+
Ge(document, "mousedown", ie), h(() => {
|
|
1547
|
+
j = !0, re(), k(), y.value?.destroy();
|
|
1506
1548
|
});
|
|
1507
|
-
async function
|
|
1508
|
-
let e = await
|
|
1549
|
+
async function ae() {
|
|
1550
|
+
let e = await a();
|
|
1509
1551
|
j || (e && y.value ? y.value.chain().focus().insertMergeTag({
|
|
1510
1552
|
label: e.label,
|
|
1511
1553
|
value: e.value
|
|
1512
1554
|
}).run() : y.value?.commands.focus());
|
|
1513
1555
|
}
|
|
1514
|
-
async function
|
|
1515
|
-
let e = await
|
|
1516
|
-
j || (e && y.value ?
|
|
1556
|
+
async function oe() {
|
|
1557
|
+
let e = await d();
|
|
1558
|
+
j || (e && y.value ? Zn(y.value, e, o) : y.value?.commands.focus());
|
|
1517
1559
|
}
|
|
1518
1560
|
return {
|
|
1519
1561
|
editor: y,
|
|
1520
|
-
EditorContent:
|
|
1521
|
-
isLoading:
|
|
1522
|
-
initError:
|
|
1562
|
+
EditorContent: ee,
|
|
1563
|
+
isLoading: A,
|
|
1564
|
+
initError: te,
|
|
1523
1565
|
retry: M,
|
|
1524
1566
|
showLinkDialog: b,
|
|
1525
1567
|
linkUrl: x,
|
|
1526
1568
|
linkDialogRef: S,
|
|
1527
|
-
mergeTags:
|
|
1528
|
-
canRequestMergeTag:
|
|
1529
|
-
isRequestingMergeTag:
|
|
1530
|
-
syntax:
|
|
1531
|
-
canInsertLogicTag:
|
|
1532
|
-
isRequestingLogicTag:
|
|
1569
|
+
mergeTags: n,
|
|
1570
|
+
canRequestMergeTag: r,
|
|
1571
|
+
isRequestingMergeTag: i,
|
|
1572
|
+
syntax: o,
|
|
1573
|
+
canInsertLogicTag: l,
|
|
1574
|
+
isRequestingLogicTag: u,
|
|
1533
1575
|
openLinkDialog: C,
|
|
1534
1576
|
insertLink: w,
|
|
1535
1577
|
removeLink: T,
|
|
1536
1578
|
closeLinkDialog: E,
|
|
1537
|
-
handleLinkKeydown:
|
|
1538
|
-
handleAddMergeTag:
|
|
1539
|
-
handleAddLogicTag:
|
|
1579
|
+
handleLinkKeydown: D,
|
|
1580
|
+
handleAddMergeTag: ae,
|
|
1581
|
+
handleAddLogicTag: oe
|
|
1540
1582
|
};
|
|
1541
1583
|
}
|
|
1542
1584
|
//#endregion
|
|
1543
1585
|
//#region src/composables/useSmallScreenNotice.ts
|
|
1544
|
-
var
|
|
1545
|
-
function
|
|
1546
|
-
let t =
|
|
1586
|
+
var er = "(max-width: 767px)";
|
|
1587
|
+
function tr(e) {
|
|
1588
|
+
let t = We(er);
|
|
1547
1589
|
return {
|
|
1548
1590
|
isSmallScreen: t,
|
|
1549
|
-
showNotice:
|
|
1591
|
+
showNotice: j(() => (S(e) ?? !0) && t.value)
|
|
1550
1592
|
};
|
|
1551
1593
|
}
|
|
1552
1594
|
//#endregion
|
|
1553
1595
|
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1554
|
-
var
|
|
1596
|
+
var nr = { class: "tpl:w-full" }, rr = {
|
|
1555
1597
|
key: 0,
|
|
1556
1598
|
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)]"
|
|
1557
|
-
},
|
|
1599
|
+
}, ir = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ar = {
|
|
1558
1600
|
key: 1,
|
|
1559
1601
|
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)]"
|
|
1560
|
-
},
|
|
1602
|
+
}, or = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, sr = {
|
|
1561
1603
|
key: 2,
|
|
1562
1604
|
class: "tpl:relative"
|
|
1563
|
-
},
|
|
1605
|
+
}, cr = ["innerHTML"], lr = {
|
|
1564
1606
|
key: 0,
|
|
1565
1607
|
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]",
|
|
1566
1608
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1567
|
-
},
|
|
1609
|
+
}, ur = /* @__PURE__ */ y({
|
|
1568
1610
|
__name: "CustomBlock",
|
|
1569
1611
|
props: {
|
|
1570
1612
|
block: {},
|
|
1571
1613
|
viewport: {}
|
|
1572
1614
|
},
|
|
1573
1615
|
emits: ["fetchData"],
|
|
1574
|
-
setup(
|
|
1575
|
-
let
|
|
1576
|
-
definition:
|
|
1577
|
-
block:
|
|
1616
|
+
setup(e, { emit: t }) {
|
|
1617
|
+
let n = e, r = t, { t: i } = Tt(), o = N(_t, null), s = _(""), l = _(!1), u = j(() => o?.getDefinition(n.block.customType)), d = j(() => !!u.value), { isFetching: m, fetch: h, needsFetch: g, hasDataSource: v } = Gt({
|
|
1618
|
+
definition: u,
|
|
1619
|
+
block: j(() => n.block),
|
|
1578
1620
|
onUpdate: (e, t) => {
|
|
1579
|
-
|
|
1621
|
+
r("fetchData", {
|
|
1580
1622
|
fieldValues: e,
|
|
1581
1623
|
dataSourceFetched: t
|
|
1582
1624
|
});
|
|
@@ -1586,118 +1628,118 @@ var Zn = { class: "tpl:w-full" }, Qn = {
|
|
|
1586
1628
|
if (o) {
|
|
1587
1629
|
l.value = !1;
|
|
1588
1630
|
try {
|
|
1589
|
-
let e = await o.renderCustomBlock(
|
|
1590
|
-
e.includes("Template render error:") && (l.value = !0),
|
|
1631
|
+
let e = await o.renderCustomBlock(n.block);
|
|
1632
|
+
e.includes("Template render error:") && (l.value = !0), s.value = e;
|
|
1591
1633
|
} catch {
|
|
1592
|
-
l.value = !0,
|
|
1634
|
+
l.value = !0, s.value = "";
|
|
1593
1635
|
}
|
|
1594
1636
|
}
|
|
1595
1637
|
}
|
|
1596
|
-
let S =
|
|
1597
|
-
return
|
|
1638
|
+
let S = Be(y, 150);
|
|
1639
|
+
return a(() => {
|
|
1598
1640
|
y();
|
|
1599
|
-
}),
|
|
1641
|
+
}), c(() => n.block.fieldValues, () => {
|
|
1600
1642
|
S();
|
|
1601
|
-
}, { deep: !0 }), (
|
|
1643
|
+
}, { deep: !0 }), (e, t) => (f(), x("div", nr, [d.value ? l.value ? (f(), x("div", ar, [w(k(kt), {
|
|
1602
1644
|
size: 24,
|
|
1603
1645
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
1604
|
-
}),
|
|
1646
|
+
}), b("span", or, p(k(i).customBlocks.renderError), 1)])) : (f(), x("div", sr, [b("div", { innerHTML: s.value }, null, 8, cr), k(v) && k(g) ? (f(), x("div", lr, [k(m) ? (f(), D(jt, {
|
|
1605
1647
|
key: 1,
|
|
1606
1648
|
class: "tpl:w-48"
|
|
1607
|
-
})) : (
|
|
1649
|
+
})) : (f(), x("button", {
|
|
1608
1650
|
key: 0,
|
|
1609
1651
|
type: "button",
|
|
1610
1652
|
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)]",
|
|
1611
|
-
onClick:
|
|
1612
|
-
}, [
|
|
1653
|
+
onClick: t[0] ||= P((...e) => k(h) && k(h)(...e), ["stop"])
|
|
1654
|
+
}, [u.value?.icon ? (f(), D(Rn, {
|
|
1613
1655
|
key: 0,
|
|
1614
|
-
icon:
|
|
1656
|
+
icon: u.value.icon,
|
|
1615
1657
|
size: 16
|
|
1616
|
-
}, null, 8, ["icon"])) :
|
|
1658
|
+
}, null, 8, ["icon"])) : M("", !0), O(" " + p(u.value?.dataSource?.label || k(i).customBlocks.dataSource.fetchButton), 1)]))])) : M("", !0)])) : (f(), x("div", rr, [w(k(Mn), {
|
|
1617
1659
|
size: 24,
|
|
1618
1660
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
1619
|
-
}),
|
|
1661
|
+
}), b("span", ir, p(k(i).customBlocks.definitionNotFound), 1)]))]));
|
|
1620
1662
|
}
|
|
1621
|
-
}),
|
|
1663
|
+
}), dr = { class: "tpl:w-full" }, fr = /* @__PURE__ */ y({
|
|
1622
1664
|
__name: "DividerBlock",
|
|
1623
1665
|
props: {
|
|
1624
1666
|
block: {},
|
|
1625
1667
|
viewport: {}
|
|
1626
1668
|
},
|
|
1627
|
-
setup(
|
|
1628
|
-
let
|
|
1629
|
-
borderTop: `${
|
|
1630
|
-
width:
|
|
1631
|
-
margin:
|
|
1669
|
+
setup(e) {
|
|
1670
|
+
let t = e, n = j(() => ({
|
|
1671
|
+
borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
|
|
1672
|
+
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
1673
|
+
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
1632
1674
|
}));
|
|
1633
|
-
return (
|
|
1675
|
+
return (e, t) => (f(), x("div", dr, [b("hr", {
|
|
1634
1676
|
class: "tpl:m-0 tpl:border-none",
|
|
1635
|
-
style:
|
|
1677
|
+
style: i(n.value)
|
|
1636
1678
|
}, null, 4)]));
|
|
1637
1679
|
}
|
|
1638
|
-
}),
|
|
1680
|
+
}), pr = { class: "tpl:w-full" }, mr = { 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)]" }, hr = {
|
|
1639
1681
|
key: 0,
|
|
1640
1682
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1641
|
-
},
|
|
1683
|
+
}, gr = {
|
|
1642
1684
|
key: 1,
|
|
1643
1685
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1644
|
-
},
|
|
1686
|
+
}, _r = /* @__PURE__ */ y({
|
|
1645
1687
|
__name: "HtmlBlock",
|
|
1646
1688
|
props: {
|
|
1647
1689
|
block: {},
|
|
1648
1690
|
viewport: {}
|
|
1649
1691
|
},
|
|
1650
|
-
setup(
|
|
1651
|
-
let
|
|
1652
|
-
return (
|
|
1692
|
+
setup(e) {
|
|
1693
|
+
let t = e, { t: n } = Tt(), r = j(() => t.block.content.trim().length > 0);
|
|
1694
|
+
return (e, t) => (f(), x("div", pr, [b("div", mr, [w(k(Tn), {
|
|
1653
1695
|
size: 24,
|
|
1654
1696
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1655
|
-
}),
|
|
1697
|
+
}), r.value ? (f(), x("span", hr, p(k(n).html.preview), 1)) : (f(), x("span", gr, p(k(n).html.empty), 1))])]));
|
|
1656
1698
|
}
|
|
1657
|
-
}),
|
|
1658
|
-
function
|
|
1659
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0
|
|
1699
|
+
}), vr = "image/";
|
|
1700
|
+
function yr(e) {
|
|
1701
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || S(r), { isOverDropZone: a } = Ke(t, {
|
|
1660
1702
|
preventDefaultForUnhandled: !0,
|
|
1661
1703
|
onDrop: (e) => {
|
|
1662
1704
|
if (!i()) return;
|
|
1663
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
1705
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(vr));
|
|
1664
1706
|
t.length > 0 && n([t[0]]);
|
|
1665
1707
|
}
|
|
1666
1708
|
});
|
|
1667
|
-
return { isOver:
|
|
1709
|
+
return { isOver: j(() => i() && a.value) };
|
|
1668
1710
|
}
|
|
1669
1711
|
//#endregion
|
|
1670
1712
|
//#region src/components/blocks/ImageBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1671
|
-
var
|
|
1713
|
+
var br = {
|
|
1672
1714
|
key: 0,
|
|
1673
1715
|
class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]",
|
|
1674
1716
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
1675
|
-
},
|
|
1717
|
+
}, xr = ["href"], Sr = ["src", "alt"], Cr = ["src", "alt"], wr = {
|
|
1676
1718
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1677
1719
|
style: { opacity: "0.7" }
|
|
1678
|
-
},
|
|
1720
|
+
}, Tr = ["href"], Er = ["src", "alt"], Dr = ["src", "alt"], Or = {
|
|
1679
1721
|
key: 4,
|
|
1680
1722
|
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)]"
|
|
1681
|
-
},
|
|
1723
|
+
}, kr = ["aria-label"], Ar = { key: 1 }, jr = /* @__PURE__ */ y({
|
|
1682
1724
|
__name: "ImageBlock",
|
|
1683
1725
|
props: {
|
|
1684
1726
|
block: {},
|
|
1685
1727
|
viewport: {}
|
|
1686
1728
|
},
|
|
1687
1729
|
emits: ["update"],
|
|
1688
|
-
setup(
|
|
1689
|
-
let
|
|
1730
|
+
setup(e, { emit: t }) {
|
|
1731
|
+
let n = e, r = t, { t: a } = Tt(), { syntax: o } = Nt(), s = N(Xe, null), c = j(() => !!s), l = Pt();
|
|
1690
1732
|
async function u() {
|
|
1691
1733
|
let e = await s?.({ accept: ["images"] });
|
|
1692
1734
|
if (l.alive && e) {
|
|
1693
1735
|
let t = { src: e.url };
|
|
1694
|
-
e.alt && (t.alt = e.alt),
|
|
1736
|
+
e.alt && (t.alt = e.alt), r("update", t);
|
|
1695
1737
|
}
|
|
1696
1738
|
}
|
|
1697
|
-
let d =
|
|
1698
|
-
async function
|
|
1739
|
+
let d = _(), m = _(!1), h = j(() => c.value && !m.value && !C.value);
|
|
1740
|
+
async function g(e) {
|
|
1699
1741
|
if (s) {
|
|
1700
|
-
|
|
1742
|
+
m.value = !0;
|
|
1701
1743
|
try {
|
|
1702
1744
|
let t = await s({
|
|
1703
1745
|
accept: ["images"],
|
|
@@ -1706,106 +1748,106 @@ var hr = {
|
|
|
1706
1748
|
if (!l.alive) return;
|
|
1707
1749
|
if (t) {
|
|
1708
1750
|
let e = { src: t.url };
|
|
1709
|
-
t.alt && (e.alt = t.alt),
|
|
1751
|
+
t.alt && (e.alt = t.alt), r("update", e);
|
|
1710
1752
|
}
|
|
1711
1753
|
} finally {
|
|
1712
|
-
l.alive && (
|
|
1754
|
+
l.alive && (m.value = !1);
|
|
1713
1755
|
}
|
|
1714
1756
|
}
|
|
1715
1757
|
}
|
|
1716
|
-
let { isOver:
|
|
1758
|
+
let { isOver: v } = yr({
|
|
1717
1759
|
target: d,
|
|
1718
|
-
enabled:
|
|
1719
|
-
onFiles:
|
|
1720
|
-
}),
|
|
1721
|
-
let e =
|
|
1760
|
+
enabled: h,
|
|
1761
|
+
onFiles: g
|
|
1762
|
+
}), y = j(() => ({ textAlign: n.block.align })), S = j(() => {
|
|
1763
|
+
let e = n.block.align;
|
|
1722
1764
|
return {
|
|
1723
1765
|
maxWidth: "100%",
|
|
1724
|
-
width:
|
|
1766
|
+
width: n.block.width === "full" ? "100%" : `${n.block.width}px`,
|
|
1725
1767
|
display: "block",
|
|
1726
1768
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
1727
1769
|
marginRight: e === "center" ? "auto" : void 0
|
|
1728
1770
|
};
|
|
1729
|
-
}),
|
|
1730
|
-
return (
|
|
1771
|
+
}), C = j(() => Ae(n.block.src, o));
|
|
1772
|
+
return (t, n) => (f(), x("div", {
|
|
1731
1773
|
ref_key: "dropZoneRef",
|
|
1732
1774
|
ref: d,
|
|
1733
1775
|
"data-testid": "image-drop-zone",
|
|
1734
1776
|
class: "tpl:relative tpl:w-full",
|
|
1735
|
-
style:
|
|
1736
|
-
}, [
|
|
1777
|
+
style: i(y.value)
|
|
1778
|
+
}, [h.value && (k(v) || m.value) ? (f(), x("div", br, [m.value ? (f(), x(A, { key: 0 }, [w(k(Et), {
|
|
1737
1779
|
class: "tpl-spinner",
|
|
1738
1780
|
size: 20,
|
|
1739
1781
|
"stroke-width": 2
|
|
1740
|
-
}),
|
|
1782
|
+
}), O(" " + p(k(a).image.uploading), 1)], 64)) : (f(), x(A, { key: 1 }, [w(k(At), {
|
|
1741
1783
|
size: 20,
|
|
1742
1784
|
"stroke-width": 1.5
|
|
1743
|
-
}),
|
|
1785
|
+
}), O(" " + p(k(a).image.dropToUpload), 1)], 64))])) : M("", !0), e.block.src && C.value && e.block.placeholderUrl ? (f(), x(A, { key: 1 }, [e.block.linkUrl ? (f(), x("a", {
|
|
1744
1786
|
key: 0,
|
|
1745
|
-
href:
|
|
1787
|
+
href: e.block.linkUrl,
|
|
1746
1788
|
target: "_blank",
|
|
1747
1789
|
rel: "noopener noreferrer",
|
|
1748
|
-
onClick:
|
|
1749
|
-
}, [
|
|
1790
|
+
onClick: n[0] ||= P(() => {}, ["prevent"])
|
|
1791
|
+
}, [b("img", {
|
|
1750
1792
|
class: "tpl:border-0",
|
|
1751
1793
|
loading: "lazy",
|
|
1752
|
-
src:
|
|
1753
|
-
alt:
|
|
1754
|
-
style:
|
|
1755
|
-
}, null, 12,
|
|
1794
|
+
src: e.block.placeholderUrl,
|
|
1795
|
+
alt: e.block.alt || k(a).image.altTextPlaceholder,
|
|
1796
|
+
style: i(S.value)
|
|
1797
|
+
}, null, 12, Sr)], 8, xr)) : (f(), x("img", {
|
|
1756
1798
|
key: 1,
|
|
1757
1799
|
class: "tpl:border-0",
|
|
1758
|
-
src:
|
|
1759
|
-
alt:
|
|
1760
|
-
style:
|
|
1761
|
-
}, null, 12,
|
|
1800
|
+
src: e.block.placeholderUrl,
|
|
1801
|
+
alt: e.block.alt,
|
|
1802
|
+
style: i(S.value)
|
|
1803
|
+
}, null, 12, Cr))], 64)) : e.block.src && C.value ? (f(), x("div", {
|
|
1762
1804
|
key: 2,
|
|
1763
1805
|
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)]",
|
|
1764
|
-
style:
|
|
1765
|
-
}, [
|
|
1806
|
+
style: i([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, S.value])
|
|
1807
|
+
}, [w(k(An), {
|
|
1766
1808
|
size: 32,
|
|
1767
1809
|
"stroke-width": 1.5,
|
|
1768
1810
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
1769
1811
|
style: { opacity: "0.5" }
|
|
1770
|
-
}),
|
|
1812
|
+
}), b("span", wr, [w(yn, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (f(), x(A, { key: 3 }, [e.block.linkUrl ? (f(), x("a", {
|
|
1771
1813
|
key: 0,
|
|
1772
|
-
href:
|
|
1814
|
+
href: e.block.linkUrl,
|
|
1773
1815
|
target: "_blank",
|
|
1774
1816
|
rel: "noopener noreferrer",
|
|
1775
|
-
onClick:
|
|
1776
|
-
}, [
|
|
1817
|
+
onClick: n[1] ||= P(() => {}, ["prevent"])
|
|
1818
|
+
}, [b("img", {
|
|
1777
1819
|
class: "tpl:border-0",
|
|
1778
1820
|
loading: "lazy",
|
|
1779
|
-
src:
|
|
1780
|
-
alt:
|
|
1781
|
-
style:
|
|
1782
|
-
}, null, 12,
|
|
1821
|
+
src: e.block.src,
|
|
1822
|
+
alt: e.block.alt || k(a).image.altTextPlaceholder,
|
|
1823
|
+
style: i(S.value)
|
|
1824
|
+
}, null, 12, Er)], 8, Tr)) : (f(), x("img", {
|
|
1783
1825
|
key: 1,
|
|
1784
1826
|
class: "tpl:border-0",
|
|
1785
|
-
src:
|
|
1786
|
-
alt:
|
|
1787
|
-
style:
|
|
1788
|
-
}, null, 12,
|
|
1827
|
+
src: e.block.src,
|
|
1828
|
+
alt: e.block.alt,
|
|
1829
|
+
style: i(S.value)
|
|
1830
|
+
}, null, 12, Dr))], 64)) : (f(), x("div", Or, [c.value ? (f(), x("button", {
|
|
1789
1831
|
key: 0,
|
|
1790
|
-
"aria-label":
|
|
1832
|
+
"aria-label": k(a).image.browseMedia,
|
|
1791
1833
|
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)]",
|
|
1792
|
-
onClick:
|
|
1793
|
-
}, [
|
|
1834
|
+
onClick: P(u, ["stop"])
|
|
1835
|
+
}, [w(k(An), {
|
|
1794
1836
|
size: 14,
|
|
1795
1837
|
"stroke-width": 1.5
|
|
1796
|
-
}),
|
|
1838
|
+
}), O(" " + p(k(a).image.browseMedia), 1)], 8, kr)) : (f(), x("span", Ar, p(k(a).image.clickToAdd), 1))]))], 4));
|
|
1797
1839
|
}
|
|
1798
|
-
}),
|
|
1840
|
+
}), Mr = { class: "tpl:w-full" }, Nr = ["href"], Pr = {
|
|
1799
1841
|
key: 1,
|
|
1800
1842
|
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)]"
|
|
1801
|
-
},
|
|
1843
|
+
}, Fr = /* @__PURE__ */ y({
|
|
1802
1844
|
__name: "MenuBlock",
|
|
1803
1845
|
props: {
|
|
1804
1846
|
block: {},
|
|
1805
1847
|
viewport: {}
|
|
1806
1848
|
},
|
|
1807
|
-
setup(
|
|
1808
|
-
let n =
|
|
1849
|
+
setup(e) {
|
|
1850
|
+
let n = e, { t: r } = Tt(), a = j(() => ({
|
|
1809
1851
|
display: "flex",
|
|
1810
1852
|
flexWrap: "wrap",
|
|
1811
1853
|
gap: `0 ${n.block.spacing}px`,
|
|
@@ -1813,31 +1855,31 @@ var hr = {
|
|
|
1813
1855
|
fontSize: `${n.block.fontSize}px`,
|
|
1814
1856
|
fontFamily: n.block.fontFamily || "inherit",
|
|
1815
1857
|
alignItems: "center"
|
|
1816
|
-
})),
|
|
1817
|
-
function
|
|
1858
|
+
})), o = j(() => n.block.items.length > 0);
|
|
1859
|
+
function s(e) {
|
|
1818
1860
|
return e || n.block.linkColor || n.block.color;
|
|
1819
1861
|
}
|
|
1820
|
-
return (n,
|
|
1862
|
+
return (n, c) => (f(), x("div", Mr, [o.value ? (f(), x("div", {
|
|
1821
1863
|
key: 0,
|
|
1822
|
-
style:
|
|
1823
|
-
}, [(
|
|
1824
|
-
href:
|
|
1864
|
+
style: i(a.value)
|
|
1865
|
+
}, [(f(!0), x(A, null, t(e.block.items, (t, n) => (f(), x(A, { key: t.id }, [b("a", {
|
|
1866
|
+
href: t.url || "#",
|
|
1825
1867
|
class: "tpl:cursor-default tpl:no-underline",
|
|
1826
|
-
style:
|
|
1827
|
-
color:
|
|
1828
|
-
fontWeight:
|
|
1829
|
-
textDecoration:
|
|
1868
|
+
style: i({
|
|
1869
|
+
color: s(t.color),
|
|
1870
|
+
fontWeight: t.bold ? "bold" : "normal",
|
|
1871
|
+
textDecoration: t.underline ? "underline" : "none"
|
|
1830
1872
|
}),
|
|
1831
|
-
onClick:
|
|
1832
|
-
},
|
|
1873
|
+
onClick: c[0] ||= P(() => {}, ["prevent"])
|
|
1874
|
+
}, [w(yn, { text: t.text || "..." }, null, 8, ["text"])], 12, Nr), n < e.block.items.length - 1 ? (f(), x("span", {
|
|
1833
1875
|
key: 0,
|
|
1834
|
-
style:
|
|
1835
|
-
color:
|
|
1836
|
-
padding: `0 ${
|
|
1876
|
+
style: i({
|
|
1877
|
+
color: e.block.separatorColor,
|
|
1878
|
+
padding: `0 ${e.block.spacing}px`
|
|
1837
1879
|
})
|
|
1838
|
-
},
|
|
1880
|
+
}, p(e.block.separator), 5)) : M("", !0)], 64))), 128))], 4)) : (f(), x("div", Pr, [w(k(jn), { size: 16 }), b("span", null, p(k(r).menu.addLinks), 1)]))]));
|
|
1839
1881
|
}
|
|
1840
|
-
}),
|
|
1882
|
+
}), Ir = /* @__PURE__ */ new Set([
|
|
1841
1883
|
"http",
|
|
1842
1884
|
"https",
|
|
1843
1885
|
"mailto",
|
|
@@ -1847,7 +1889,7 @@ var hr = {
|
|
|
1847
1889
|
"sms",
|
|
1848
1890
|
"xmpp",
|
|
1849
1891
|
"cid"
|
|
1850
|
-
]),
|
|
1892
|
+
]), Lr = /* @__PURE__ */ new Set([
|
|
1851
1893
|
"SCRIPT",
|
|
1852
1894
|
"STYLE",
|
|
1853
1895
|
"IFRAME",
|
|
@@ -1857,7 +1899,7 @@ var hr = {
|
|
|
1857
1899
|
"META",
|
|
1858
1900
|
"BASE",
|
|
1859
1901
|
"FORM"
|
|
1860
|
-
]),
|
|
1902
|
+
]), Rr = /* @__PURE__ */ new Set([
|
|
1861
1903
|
"href",
|
|
1862
1904
|
"xlink:href",
|
|
1863
1905
|
"formaction",
|
|
@@ -1866,16 +1908,16 @@ var hr = {
|
|
|
1866
1908
|
"background",
|
|
1867
1909
|
"poster"
|
|
1868
1910
|
]);
|
|
1869
|
-
function
|
|
1911
|
+
function zr(e, t) {
|
|
1870
1912
|
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
1871
1913
|
if (!n || n.startsWith("#")) return !0;
|
|
1872
1914
|
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
1873
1915
|
if (!r) return !0;
|
|
1874
1916
|
let i = r[1].toLowerCase();
|
|
1875
|
-
return
|
|
1917
|
+
return Ir.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
1876
1918
|
}
|
|
1877
|
-
function
|
|
1878
|
-
if (
|
|
1919
|
+
function Br(e) {
|
|
1920
|
+
if (Lr.has(e.tagName)) {
|
|
1879
1921
|
e.remove();
|
|
1880
1922
|
return;
|
|
1881
1923
|
}
|
|
@@ -1887,29 +1929,29 @@ function Fr(e) {
|
|
|
1887
1929
|
e.removeAttribute(n);
|
|
1888
1930
|
continue;
|
|
1889
1931
|
}
|
|
1890
|
-
if (
|
|
1891
|
-
|
|
1932
|
+
if (Rr.has(t)) {
|
|
1933
|
+
zr(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
1892
1934
|
continue;
|
|
1893
1935
|
}
|
|
1894
1936
|
if (t === "src") {
|
|
1895
|
-
|
|
1937
|
+
zr(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
1896
1938
|
continue;
|
|
1897
1939
|
}
|
|
1898
1940
|
t === "srcdoc" && e.removeAttribute(n);
|
|
1899
1941
|
}
|
|
1900
1942
|
let n = Array.from(e.children);
|
|
1901
|
-
for (let e of n)
|
|
1943
|
+
for (let e of n) Br(e);
|
|
1902
1944
|
}
|
|
1903
|
-
function
|
|
1945
|
+
function Vr(e) {
|
|
1904
1946
|
if (typeof DOMParser > "u") return e;
|
|
1905
1947
|
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
1906
|
-
for (let e of n)
|
|
1948
|
+
for (let e of n) Br(e);
|
|
1907
1949
|
return t.innerHTML;
|
|
1908
1950
|
}
|
|
1909
1951
|
//#endregion
|
|
1910
1952
|
//#region src/composables/useEditableTextBlock.ts
|
|
1911
|
-
function
|
|
1912
|
-
let t =
|
|
1953
|
+
function Hr(e) {
|
|
1954
|
+
let t = N(it, []), { syntax: n } = Nt(), r = j(() => Vr(Te(fe(e(), t), n))), i = _(!1), a = _(null), { top: o, left: s } = qe(a), c = j(() => ({
|
|
1913
1955
|
top: o.value - 8,
|
|
1914
1956
|
left: s.value
|
|
1915
1957
|
}));
|
|
@@ -1930,72 +1972,72 @@ function Lr(e) {
|
|
|
1930
1972
|
}
|
|
1931
1973
|
//#endregion
|
|
1932
1974
|
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1933
|
-
var
|
|
1975
|
+
var Ur = ["innerHTML"], Wr = /* @__PURE__ */ y({
|
|
1934
1976
|
__name: "ParagraphBlock",
|
|
1935
1977
|
props: {
|
|
1936
1978
|
block: {},
|
|
1937
1979
|
viewport: {}
|
|
1938
1980
|
},
|
|
1939
|
-
setup(
|
|
1940
|
-
let
|
|
1941
|
-
return (
|
|
1981
|
+
setup(e) {
|
|
1982
|
+
let t = e, n = C(() => import("./ParagraphEditor-1NaUJpZO.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: s, handleEditorDone: c } = Hr(() => t.block.content);
|
|
1983
|
+
return (t, l) => (f(), x("div", {
|
|
1942
1984
|
ref_key: "blockRef",
|
|
1943
|
-
ref:
|
|
1985
|
+
ref: i,
|
|
1944
1986
|
class: "tpl:min-h-[1em] tpl:w-full",
|
|
1945
|
-
onDblclick:
|
|
1946
|
-
}, [
|
|
1987
|
+
onDblclick: l[0] ||= (...e) => k(s) && k(s)(...e)
|
|
1988
|
+
}, [k(r) ? (f(), D(k(n), {
|
|
1947
1989
|
key: 0,
|
|
1948
|
-
block:
|
|
1949
|
-
"toolbar-position":
|
|
1950
|
-
onDone:
|
|
1990
|
+
block: e.block,
|
|
1991
|
+
"toolbar-position": k(a),
|
|
1992
|
+
onDone: k(c)
|
|
1951
1993
|
}, null, 8, [
|
|
1952
1994
|
"block",
|
|
1953
1995
|
"toolbar-position",
|
|
1954
1996
|
"onDone"
|
|
1955
|
-
])) : (
|
|
1997
|
+
])) : (f(), x("div", {
|
|
1956
1998
|
key: 1,
|
|
1957
1999
|
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",
|
|
1958
|
-
innerHTML:
|
|
1959
|
-
}, null, 8,
|
|
2000
|
+
innerHTML: k(o)
|
|
2001
|
+
}, null, 8, Ur))], 544));
|
|
1960
2002
|
}
|
|
1961
2003
|
});
|
|
1962
2004
|
//#endregion
|
|
1963
2005
|
//#region src/utils/blockComponentResolver.ts
|
|
1964
|
-
function
|
|
2006
|
+
function Gr(e, t, n) {
|
|
1965
2007
|
if (t) {
|
|
1966
2008
|
let n = t.getComponent(e);
|
|
1967
2009
|
if (n) return n;
|
|
1968
2010
|
}
|
|
1969
2011
|
return n[e.type] ?? null;
|
|
1970
2012
|
}
|
|
1971
|
-
function
|
|
2013
|
+
function Kr(e) {
|
|
1972
2014
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
1973
2015
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
1974
2016
|
backgroundColor: n || "transparent"
|
|
1975
2017
|
};
|
|
1976
2018
|
return e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
1977
2019
|
}
|
|
1978
|
-
function
|
|
2020
|
+
function qr(e) {
|
|
1979
2021
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
1980
2022
|
let t = e.wrapper, n = {};
|
|
1981
2023
|
return t.backgroundColor && (n.backgroundColor = t.backgroundColor), t.padding && (n.padding = `${t.padding.top}px ${t.padding.right}px ${t.padding.bottom}px ${t.padding.left}px`), t.borderRadius && t.borderRadius > 0 && (n.borderRadius = `${t.borderRadius}px`), n;
|
|
1982
2024
|
}
|
|
1983
2025
|
//#endregion
|
|
1984
2026
|
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
1985
|
-
var
|
|
2027
|
+
var Jr = ["data-block-id", "data-block-type"], Yr = ["aria-label"], Xr = [
|
|
1986
2028
|
"aria-label",
|
|
1987
2029
|
"aria-pressed",
|
|
1988
2030
|
"title"
|
|
1989
|
-
],
|
|
2031
|
+
], Zr = ["aria-label", "title"], Qr = ["aria-label", "title"], $r = ["aria-label", "title"], ei = {
|
|
1990
2032
|
key: 1,
|
|
1991
2033
|
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"
|
|
1992
|
-
},
|
|
2034
|
+
}, ti = { 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)]" }, ni = {
|
|
1993
2035
|
key: 2,
|
|
1994
2036
|
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
1995
|
-
},
|
|
2037
|
+
}, ri = ["aria-label", "title"], ii = {
|
|
1996
2038
|
key: 3,
|
|
1997
2039
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
1998
|
-
},
|
|
2040
|
+
}, ai = ["aria-label"], oi = /*#__PURE__*/ Mt(/* @__PURE__ */ y({
|
|
1999
2041
|
__name: "BlockWrapper",
|
|
2000
2042
|
props: {
|
|
2001
2043
|
block: {},
|
|
@@ -2004,281 +2046,281 @@ var Ur = ["data-block-id", "data-block-type"], Wr = ["aria-label"], Gr = [
|
|
|
2004
2046
|
previewMode: { type: Boolean }
|
|
2005
2047
|
},
|
|
2006
2048
|
emits: ["select"],
|
|
2007
|
-
setup(
|
|
2008
|
-
let
|
|
2009
|
-
async function
|
|
2010
|
-
await
|
|
2049
|
+
setup(e, { emit: t }) {
|
|
2050
|
+
let n = C(() => import("./BlockIssueBadge-B3xVgMTh.js")), r = e, a = t, { t: s, format: c } = Tt(), l = N(xt, null), u = _(null), d = j(() => l?.liftedBlockId.value === r.block.id), m = j(() => d.value ? c(s.blockActions.dragLifted, { block: r.block.type }) : s.blockActions.drag);
|
|
2051
|
+
async function h() {
|
|
2052
|
+
await ie(), u.value?.focus();
|
|
2011
2053
|
}
|
|
2012
2054
|
function g(e) {
|
|
2013
|
-
if (
|
|
2055
|
+
if (l) {
|
|
2014
2056
|
if (e.key === " " || e.key === "Enter") {
|
|
2015
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2057
|
+
e.preventDefault(), e.stopPropagation(), d.value ? l.drop(r.block.id) : l.lift(r.block.id);
|
|
2016
2058
|
return;
|
|
2017
2059
|
}
|
|
2018
|
-
if (
|
|
2060
|
+
if (d.value) {
|
|
2019
2061
|
if (e.key === "Escape") {
|
|
2020
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2062
|
+
e.preventDefault(), e.stopPropagation(), l.cancel(), h();
|
|
2021
2063
|
return;
|
|
2022
2064
|
}
|
|
2023
2065
|
if (e.key === "ArrowUp") {
|
|
2024
|
-
e.preventDefault(), e.stopPropagation(),
|
|
2066
|
+
e.preventDefault(), e.stopPropagation(), l.moveUp(r.block.id), h();
|
|
2025
2067
|
return;
|
|
2026
2068
|
}
|
|
2027
|
-
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(),
|
|
2069
|
+
e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), l.moveDown(r.block.id), h());
|
|
2028
2070
|
}
|
|
2029
2071
|
}
|
|
2030
2072
|
}
|
|
2031
|
-
let
|
|
2073
|
+
let v = j(() => !r.viewport || !r.block.visibility ? !1 : r.block.visibility[r.viewport] === !1), y = j(() => r.previewMode === !0 && v.value), S = j(() => r.viewport ? {
|
|
2032
2074
|
desktop: s.viewport.desktop,
|
|
2033
2075
|
mobile: s.viewport.mobile
|
|
2034
|
-
}[
|
|
2035
|
-
let e =
|
|
2076
|
+
}[r.viewport] ?? r.viewport : ""), E = j(() => !!r.block.displayCondition), D = N(pt, null), ee = N(bt, null), A = N(yt, {}), te = j(() => !!A.savedModules), ne = j(() => A.comments?.getBlockCount(r.block.id) ?? 0), re = j(() => {
|
|
2077
|
+
let e = Kr(r.block), t = {
|
|
2036
2078
|
padding: e.padding,
|
|
2037
2079
|
backgroundColor: e.backgroundColor
|
|
2038
2080
|
};
|
|
2039
2081
|
return e.borderRadius && (t.borderRadius = e.borderRadius), t;
|
|
2040
|
-
}),
|
|
2041
|
-
function
|
|
2042
|
-
|
|
2043
|
-
}
|
|
2044
|
-
function ae() {
|
|
2045
|
-
ee?.deleteBlock(a.block.id);
|
|
2082
|
+
}), ae = j(() => qr(r.block));
|
|
2083
|
+
function oe(e) {
|
|
2084
|
+
r.previewMode || (e.stopPropagation(), a("select"));
|
|
2046
2085
|
}
|
|
2047
2086
|
function se() {
|
|
2048
|
-
|
|
2087
|
+
D?.deleteBlock(r.block.id);
|
|
2049
2088
|
}
|
|
2050
2089
|
function ce() {
|
|
2051
|
-
|
|
2090
|
+
D?.duplicateBlock(r.block);
|
|
2052
2091
|
}
|
|
2053
2092
|
function le() {
|
|
2054
|
-
|
|
2093
|
+
A.savedModules?.openSaveDialog(r.block.id);
|
|
2055
2094
|
}
|
|
2056
|
-
|
|
2095
|
+
function ue() {
|
|
2096
|
+
ee?.toggleBlock(r.block.id);
|
|
2097
|
+
}
|
|
2098
|
+
return (t, r) => y.value ? M("", !0) : (f(), x("div", {
|
|
2057
2099
|
key: 0,
|
|
2058
|
-
class:
|
|
2059
|
-
"tpl-block--selected":
|
|
2060
|
-
"tpl-block--idle": !
|
|
2061
|
-
"tpl-block--lifted":
|
|
2100
|
+
class: o(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow tpl:duration-150", {
|
|
2101
|
+
"tpl-block--selected": e.isSelected,
|
|
2102
|
+
"tpl-block--idle": !e.isSelected,
|
|
2103
|
+
"tpl-block--lifted": d.value
|
|
2062
2104
|
}]),
|
|
2063
|
-
"data-block-id":
|
|
2064
|
-
"data-block-type":
|
|
2065
|
-
onClick:
|
|
2105
|
+
"data-block-id": e.block.id,
|
|
2106
|
+
"data-block-type": e.block.type,
|
|
2107
|
+
onClick: oe
|
|
2066
2108
|
}, [
|
|
2067
|
-
|
|
2068
|
-
|
|
2109
|
+
w(k(n), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
2110
|
+
e.isSelected ? (f(), x("div", {
|
|
2069
2111
|
key: 0,
|
|
2070
2112
|
role: "toolbar",
|
|
2071
|
-
"aria-label":
|
|
2113
|
+
"aria-label": k(s).blockActions.drag,
|
|
2072
2114
|
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)]"
|
|
2073
2115
|
}, [
|
|
2074
|
-
|
|
2116
|
+
b("button", {
|
|
2075
2117
|
ref_key: "dragButtonRef",
|
|
2076
|
-
ref:
|
|
2118
|
+
ref: u,
|
|
2077
2119
|
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",
|
|
2078
|
-
"aria-label":
|
|
2079
|
-
"aria-pressed":
|
|
2120
|
+
"aria-label": m.value,
|
|
2121
|
+
"aria-pressed": d.value,
|
|
2080
2122
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2081
|
-
title:
|
|
2123
|
+
title: k(s).blockActions.drag,
|
|
2082
2124
|
onKeydown: g
|
|
2083
|
-
}, [
|
|
2125
|
+
}, [w(k(kn), {
|
|
2084
2126
|
size: 14,
|
|
2085
2127
|
"stroke-width": 1.5
|
|
2086
|
-
})], 40,
|
|
2087
|
-
|
|
2128
|
+
})], 40, Xr),
|
|
2129
|
+
b("button", {
|
|
2088
2130
|
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",
|
|
2089
|
-
"aria-label":
|
|
2090
|
-
title:
|
|
2091
|
-
onClick:
|
|
2092
|
-
}, [
|
|
2131
|
+
"aria-label": k(s).blockActions.duplicate,
|
|
2132
|
+
title: k(s).blockActions.duplicate,
|
|
2133
|
+
onClick: P(ce, ["stop"])
|
|
2134
|
+
}, [w(k(En), {
|
|
2093
2135
|
size: 14,
|
|
2094
2136
|
"stroke-width": 1.5
|
|
2095
|
-
})], 8,
|
|
2096
|
-
te.value ? (
|
|
2137
|
+
})], 8, Zr),
|
|
2138
|
+
te.value ? (f(), x("button", {
|
|
2097
2139
|
key: 0,
|
|
2098
2140
|
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",
|
|
2099
|
-
"aria-label":
|
|
2100
|
-
title:
|
|
2101
|
-
onClick:
|
|
2102
|
-
}, [
|
|
2141
|
+
"aria-label": k(s).blockActions.saveAsModule,
|
|
2142
|
+
title: k(s).blockActions.saveAsModule,
|
|
2143
|
+
onClick: P(le, ["stop"])
|
|
2144
|
+
}, [w(k(Cn), {
|
|
2103
2145
|
size: 14,
|
|
2104
2146
|
"stroke-width": 1.5
|
|
2105
|
-
})], 8,
|
|
2106
|
-
|
|
2147
|
+
})], 8, Qr)) : M("", !0),
|
|
2148
|
+
b("button", {
|
|
2107
2149
|
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",
|
|
2108
|
-
"aria-label":
|
|
2109
|
-
title:
|
|
2110
|
-
onClick:
|
|
2111
|
-
}, [
|
|
2150
|
+
"aria-label": k(s).blockActions.delete,
|
|
2151
|
+
title: k(s).blockActions.delete,
|
|
2152
|
+
onClick: P(se, ["stop"])
|
|
2153
|
+
}, [w(k(Ot), {
|
|
2112
2154
|
size: 14,
|
|
2113
2155
|
"stroke-width": 1.5
|
|
2114
|
-
})], 8,
|
|
2115
|
-
], 8,
|
|
2116
|
-
|
|
2156
|
+
})], 8, $r)
|
|
2157
|
+
], 8, Yr)) : M("", !0),
|
|
2158
|
+
v.value ? (f(), x("div", ei, [b("span", ti, [w(k(Dn), {
|
|
2117
2159
|
size: 12,
|
|
2118
2160
|
"stroke-width": 1.5
|
|
2119
|
-
}),
|
|
2120
|
-
E.value && !
|
|
2161
|
+
}), O(" " + p(k(c)(k(s).blockActions.hiddenOnViewport, { viewport: S.value })), 1)])])) : M("", !0),
|
|
2162
|
+
E.value && !v.value ? (f(), x("div", ni, [b("button", {
|
|
2121
2163
|
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)]",
|
|
2122
|
-
"aria-label":
|
|
2123
|
-
title:
|
|
2124
|
-
onClick:
|
|
2125
|
-
}, [
|
|
2164
|
+
"aria-label": k(s).blockActions.conditionToggle,
|
|
2165
|
+
title: e.block.displayCondition?.label,
|
|
2166
|
+
onClick: P(ue, ["stop"])
|
|
2167
|
+
}, [w(k(On), {
|
|
2126
2168
|
size: 12,
|
|
2127
2169
|
"stroke-width": 2
|
|
2128
|
-
})], 8,
|
|
2129
|
-
|
|
2170
|
+
})], 8, ri)])) : M("", !0),
|
|
2171
|
+
ne.value > 0 && !v.value ? (f(), x("div", ii, [b("button", {
|
|
2130
2172
|
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)]",
|
|
2131
|
-
"aria-label":
|
|
2132
|
-
onClick: r[0] ||=
|
|
2133
|
-
}, [
|
|
2173
|
+
"aria-label": k(c)(k(s).blockActions.comments, { count: String(ne.value) }),
|
|
2174
|
+
onClick: r[0] ||= P((t) => k(A).comments?.openForBlock(e.block.id), ["stop"])
|
|
2175
|
+
}, [w(k(Dt), {
|
|
2134
2176
|
size: 12,
|
|
2135
2177
|
"stroke-width": 2.5
|
|
2136
|
-
}),
|
|
2137
|
-
|
|
2178
|
+
}), O(" " + p(ne.value), 1)], 8, ai)])) : M("", !0),
|
|
2179
|
+
ae.value ? (f(), x("div", {
|
|
2138
2180
|
key: 4,
|
|
2139
2181
|
class: "tpl-section-wrapper",
|
|
2140
|
-
style:
|
|
2141
|
-
}, [
|
|
2182
|
+
style: i(ae.value)
|
|
2183
|
+
}, [b("div", {
|
|
2142
2184
|
class: "tpl-block-content",
|
|
2143
|
-
style:
|
|
2144
|
-
}, [
|
|
2185
|
+
style: i(re.value)
|
|
2186
|
+
}, [T(t.$slots, "default", {}, void 0, !0)], 4)], 4)) : (f(), x("div", {
|
|
2145
2187
|
key: 5,
|
|
2146
2188
|
class: "tpl-block-content",
|
|
2147
|
-
style:
|
|
2148
|
-
}, [
|
|
2149
|
-
], 10,
|
|
2189
|
+
style: i(re.value)
|
|
2190
|
+
}, [T(t.$slots, "default", {}, void 0, !0)], 4))
|
|
2191
|
+
], 10, Jr));
|
|
2150
2192
|
}
|
|
2151
2193
|
}), [["__scopeId", "data-v-7aeef19d"]]);
|
|
2152
2194
|
//#endregion
|
|
2153
2195
|
//#region src/utils/unwrapParagraph.ts
|
|
2154
|
-
function
|
|
2196
|
+
function si(e) {
|
|
2155
2197
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2156
2198
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2157
2199
|
}
|
|
2158
2200
|
//#endregion
|
|
2159
2201
|
//#region src/components/blocks/TitleBlock.vue
|
|
2160
|
-
var
|
|
2202
|
+
var ci = /* @__PURE__ */ y({
|
|
2161
2203
|
__name: "TitleBlock",
|
|
2162
2204
|
props: {
|
|
2163
2205
|
block: {},
|
|
2164
2206
|
viewport: {}
|
|
2165
2207
|
},
|
|
2166
|
-
setup(
|
|
2167
|
-
let
|
|
2208
|
+
setup(e) {
|
|
2209
|
+
let t = e, n = C(() => import("./TitleEditor-D4t_gZZJ.js")), { isEditing: r, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = Hr(() => t.block.content), u = j(() => {
|
|
2168
2210
|
let e = {
|
|
2169
|
-
fontSize: `${
|
|
2170
|
-
color:
|
|
2171
|
-
textAlign:
|
|
2211
|
+
fontSize: `${Pe[t.block.level]}px`,
|
|
2212
|
+
color: t.block.color,
|
|
2213
|
+
textAlign: t.block.textAlign
|
|
2172
2214
|
};
|
|
2173
|
-
return
|
|
2174
|
-
}),
|
|
2175
|
-
return (
|
|
2215
|
+
return t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
2216
|
+
}), p = j(() => `h${t.block.level}`), m = j(() => si(s.value));
|
|
2217
|
+
return (t, s) => (f(), x("div", {
|
|
2176
2218
|
ref_key: "blockRef",
|
|
2177
|
-
ref:
|
|
2219
|
+
ref: a,
|
|
2178
2220
|
class: "tpl:min-h-[1em] tpl:w-full",
|
|
2179
|
-
style:
|
|
2180
|
-
onDblclick:
|
|
2181
|
-
}, [
|
|
2221
|
+
style: i(u.value),
|
|
2222
|
+
onDblclick: s[0] ||= (...e) => k(c) && k(c)(...e)
|
|
2223
|
+
}, [k(r) ? (f(), D(k(n), {
|
|
2182
2224
|
key: 0,
|
|
2183
|
-
block:
|
|
2184
|
-
"toolbar-position":
|
|
2185
|
-
onDone:
|
|
2225
|
+
block: e.block,
|
|
2226
|
+
"toolbar-position": k(o),
|
|
2227
|
+
onDone: k(l)
|
|
2186
2228
|
}, null, 8, [
|
|
2187
2229
|
"block",
|
|
2188
2230
|
"toolbar-position",
|
|
2189
2231
|
"onDone"
|
|
2190
|
-
])) : (
|
|
2232
|
+
])) : (f(), D(d(p.value), {
|
|
2191
2233
|
key: 1,
|
|
2192
2234
|
class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-tight tpl:outline-none [&_a]:tpl:underline [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0",
|
|
2193
2235
|
style: { color: "inherit" },
|
|
2194
|
-
innerHTML:
|
|
2236
|
+
innerHTML: m.value
|
|
2195
2237
|
}, null, 8, ["innerHTML"]))], 36));
|
|
2196
2238
|
}
|
|
2197
2239
|
});
|
|
2198
2240
|
//#endregion
|
|
2199
2241
|
//#region src/utils/sectionColumnDrop.ts
|
|
2200
|
-
function
|
|
2242
|
+
function li(e) {
|
|
2201
2243
|
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2202
2244
|
}
|
|
2203
2245
|
//#endregion
|
|
2204
2246
|
//#region ../../node_modules/.pnpm/vue-draggable-plus@0.6.1_@types+sortablejs@1.15.9/node_modules/vue-draggable-plus/dist/vue-draggable-plus.js
|
|
2205
|
-
var
|
|
2247
|
+
var ui = Object.defineProperty, di = Object.getOwnPropertySymbols, fi = Object.prototype.hasOwnProperty, pi = Object.prototype.propertyIsEnumerable, mi = (e, t, n) => t in e ? ui(e, t, {
|
|
2206
2248
|
enumerable: !0,
|
|
2207
2249
|
configurable: !0,
|
|
2208
2250
|
writable: !0,
|
|
2209
2251
|
value: n
|
|
2210
|
-
}) : e[t] = n,
|
|
2211
|
-
for (var n in t ||= {})
|
|
2212
|
-
if (
|
|
2252
|
+
}) : e[t] = n, hi = (e, t) => {
|
|
2253
|
+
for (var n in t ||= {}) fi.call(t, n) && mi(e, n, t[n]);
|
|
2254
|
+
if (di) for (var n of di(t)) pi.call(t, n) && mi(e, n, t[n]);
|
|
2213
2255
|
return e;
|
|
2214
|
-
},
|
|
2256
|
+
}, gi = (e, t) => {
|
|
2215
2257
|
var n = {};
|
|
2216
|
-
for (var r in e)
|
|
2217
|
-
if (e != null &&
|
|
2258
|
+
for (var r in e) fi.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
2259
|
+
if (e != null && di) for (var r of di(e)) t.indexOf(r) < 0 && pi.call(e, r) && (n[r] = e[r]);
|
|
2218
2260
|
return n;
|
|
2219
|
-
},
|
|
2220
|
-
function
|
|
2221
|
-
console.warn(
|
|
2261
|
+
}, _i = "[vue-draggable-plus]: ";
|
|
2262
|
+
function vi(e) {
|
|
2263
|
+
console.warn(_i + e);
|
|
2222
2264
|
}
|
|
2223
|
-
function
|
|
2224
|
-
console.error(
|
|
2265
|
+
function yi(e) {
|
|
2266
|
+
console.error(_i + e);
|
|
2225
2267
|
}
|
|
2226
|
-
function
|
|
2268
|
+
function bi(e, t, n) {
|
|
2227
2269
|
return n >= 0 && n < e.length && e.splice(n, 0, e.splice(t, 1)[0]), e;
|
|
2228
2270
|
}
|
|
2229
|
-
function
|
|
2271
|
+
function xi(e) {
|
|
2230
2272
|
return e.replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
|
|
2231
2273
|
}
|
|
2232
|
-
function
|
|
2233
|
-
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[
|
|
2274
|
+
function Si(e) {
|
|
2275
|
+
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[xi(n)] = e[n]), t), {});
|
|
2234
2276
|
}
|
|
2235
|
-
function
|
|
2277
|
+
function Ci(e, t) {
|
|
2236
2278
|
return Array.isArray(e) && e.splice(t, 1), e;
|
|
2237
2279
|
}
|
|
2238
|
-
function
|
|
2280
|
+
function wi(e, t, n) {
|
|
2239
2281
|
return Array.isArray(e) && e.splice(t, 0, n), e;
|
|
2240
2282
|
}
|
|
2241
|
-
function
|
|
2283
|
+
function Ti(e) {
|
|
2242
2284
|
return e === void 0;
|
|
2243
2285
|
}
|
|
2244
|
-
function
|
|
2286
|
+
function Ei(e) {
|
|
2245
2287
|
return typeof e == "string";
|
|
2246
2288
|
}
|
|
2247
|
-
function
|
|
2289
|
+
function Di(e, t, n) {
|
|
2248
2290
|
let r = e.children[n];
|
|
2249
2291
|
e.insertBefore(t, r);
|
|
2250
2292
|
}
|
|
2251
|
-
function
|
|
2293
|
+
function Oi(e) {
|
|
2252
2294
|
e.parentNode && e.parentNode.removeChild(e);
|
|
2253
2295
|
}
|
|
2254
|
-
function
|
|
2296
|
+
function ki(e, t = document) {
|
|
2255
2297
|
let n = null;
|
|
2256
|
-
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n ||
|
|
2298
|
+
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n || vi(`Element not found: ${e}`), n;
|
|
2257
2299
|
}
|
|
2258
|
-
function
|
|
2300
|
+
function Ai(e, t, n = null) {
|
|
2259
2301
|
return function(...r) {
|
|
2260
2302
|
return e.apply(n, r), t.apply(n, r);
|
|
2261
2303
|
};
|
|
2262
2304
|
}
|
|
2263
|
-
function
|
|
2264
|
-
let n =
|
|
2305
|
+
function ji(e, t) {
|
|
2306
|
+
let n = hi({}, e);
|
|
2265
2307
|
return Object.keys(t).forEach((r) => {
|
|
2266
|
-
n[r] ? n[r] =
|
|
2308
|
+
n[r] ? n[r] = Ai(e[r], t[r]) : n[r] = t[r];
|
|
2267
2309
|
}), n;
|
|
2268
2310
|
}
|
|
2269
|
-
function
|
|
2311
|
+
function Mi(e) {
|
|
2270
2312
|
return e instanceof HTMLElement;
|
|
2271
2313
|
}
|
|
2272
|
-
function
|
|
2314
|
+
function Ni(e, t) {
|
|
2273
2315
|
Object.keys(e).forEach((n) => {
|
|
2274
2316
|
t(n, e[n]);
|
|
2275
2317
|
});
|
|
2276
2318
|
}
|
|
2277
|
-
function
|
|
2319
|
+
function Pi(e) {
|
|
2278
2320
|
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
2279
2321
|
}
|
|
2280
|
-
var
|
|
2281
|
-
function
|
|
2322
|
+
var Fi = Object.assign;
|
|
2323
|
+
function Ii(e, t) {
|
|
2282
2324
|
var n = Object.keys(e);
|
|
2283
2325
|
if (Object.getOwnPropertySymbols) {
|
|
2284
2326
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -2288,26 +2330,26 @@ function ji(e, t) {
|
|
|
2288
2330
|
}
|
|
2289
2331
|
return n;
|
|
2290
2332
|
}
|
|
2291
|
-
function
|
|
2333
|
+
function Li(e) {
|
|
2292
2334
|
for (var t = 1; t < arguments.length; t++) {
|
|
2293
2335
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
2294
|
-
t % 2 ?
|
|
2295
|
-
|
|
2296
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
2336
|
+
t % 2 ? Ii(Object(n), !0).forEach(function(t) {
|
|
2337
|
+
zi(e, t, n[t]);
|
|
2338
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Ii(Object(n)).forEach(function(t) {
|
|
2297
2339
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
2298
2340
|
});
|
|
2299
2341
|
}
|
|
2300
2342
|
return e;
|
|
2301
2343
|
}
|
|
2302
|
-
function
|
|
2344
|
+
function Ri(e) {
|
|
2303
2345
|
"@babel/helpers - typeof";
|
|
2304
|
-
return
|
|
2346
|
+
return Ri = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2305
2347
|
return typeof e;
|
|
2306
2348
|
} : function(e) {
|
|
2307
2349
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2308
|
-
},
|
|
2350
|
+
}, Ri(e);
|
|
2309
2351
|
}
|
|
2310
|
-
function
|
|
2352
|
+
function zi(e, t, n) {
|
|
2311
2353
|
return t in e ? Object.defineProperty(e, t, {
|
|
2312
2354
|
value: n,
|
|
2313
2355
|
enumerable: !0,
|
|
@@ -2315,45 +2357,45 @@ function Pi(e, t, n) {
|
|
|
2315
2357
|
writable: !0
|
|
2316
2358
|
}) : e[t] = n, e;
|
|
2317
2359
|
}
|
|
2318
|
-
function
|
|
2319
|
-
return
|
|
2360
|
+
function Bi() {
|
|
2361
|
+
return Bi = Object.assign || function(e) {
|
|
2320
2362
|
for (var t = 1; t < arguments.length; t++) {
|
|
2321
2363
|
var n = arguments[t];
|
|
2322
2364
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
2323
2365
|
}
|
|
2324
2366
|
return e;
|
|
2325
|
-
},
|
|
2367
|
+
}, Bi.apply(this, arguments);
|
|
2326
2368
|
}
|
|
2327
|
-
function
|
|
2369
|
+
function Vi(e, t) {
|
|
2328
2370
|
if (e == null) return {};
|
|
2329
2371
|
var n = {}, r = Object.keys(e), i, a;
|
|
2330
2372
|
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
2331
2373
|
return n;
|
|
2332
2374
|
}
|
|
2333
|
-
function
|
|
2375
|
+
function Hi(e, t) {
|
|
2334
2376
|
if (e == null) return {};
|
|
2335
|
-
var n =
|
|
2377
|
+
var n = Vi(e, t), r, i;
|
|
2336
2378
|
if (Object.getOwnPropertySymbols) {
|
|
2337
2379
|
var a = Object.getOwnPropertySymbols(e);
|
|
2338
2380
|
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
2339
2381
|
}
|
|
2340
2382
|
return n;
|
|
2341
2383
|
}
|
|
2342
|
-
var
|
|
2343
|
-
function
|
|
2384
|
+
var Ui = "1.15.2";
|
|
2385
|
+
function Wi(e) {
|
|
2344
2386
|
if (typeof window < "u" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
2345
2387
|
}
|
|
2346
|
-
var
|
|
2388
|
+
var Gi = Wi(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Ki = Wi(/Edge/i), qi = Wi(/firefox/i), Ji = Wi(/safari/i) && !Wi(/chrome/i) && !Wi(/android/i), Yi = Wi(/iP(ad|od|hone)/i), Xi = Wi(/chrome/i) && Wi(/android/i), Zi = {
|
|
2347
2389
|
capture: !1,
|
|
2348
2390
|
passive: !1
|
|
2349
2391
|
};
|
|
2350
|
-
function
|
|
2351
|
-
e.addEventListener(t, n, !
|
|
2392
|
+
function I(e, t, n) {
|
|
2393
|
+
e.addEventListener(t, n, !Gi && Zi);
|
|
2352
2394
|
}
|
|
2353
|
-
function
|
|
2354
|
-
e.removeEventListener(t, n, !
|
|
2395
|
+
function L(e, t, n) {
|
|
2396
|
+
e.removeEventListener(t, n, !Gi && Zi);
|
|
2355
2397
|
}
|
|
2356
|
-
function
|
|
2398
|
+
function Qi(e, t) {
|
|
2357
2399
|
if (t) {
|
|
2358
2400
|
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
2359
2401
|
if (e.matches) return e.matches(t);
|
|
@@ -2365,41 +2407,41 @@ function qi(e, t) {
|
|
|
2365
2407
|
return !1;
|
|
2366
2408
|
}
|
|
2367
2409
|
}
|
|
2368
|
-
function
|
|
2410
|
+
function $i(e) {
|
|
2369
2411
|
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
2370
2412
|
}
|
|
2371
|
-
function
|
|
2413
|
+
function ea(e, t, n, r) {
|
|
2372
2414
|
if (e) {
|
|
2373
2415
|
n ||= document;
|
|
2374
2416
|
do {
|
|
2375
|
-
if (t != null && (t[0] === ">" ? e.parentNode === n &&
|
|
2417
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && Qi(e, t) : Qi(e, t)) || r && e === n) return e;
|
|
2376
2418
|
if (e === n) break;
|
|
2377
|
-
} while (e =
|
|
2419
|
+
} while (e = $i(e));
|
|
2378
2420
|
}
|
|
2379
2421
|
return null;
|
|
2380
2422
|
}
|
|
2381
|
-
var
|
|
2382
|
-
function
|
|
2383
|
-
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(
|
|
2423
|
+
var ta = /\s+/g;
|
|
2424
|
+
function R(e, t, n) {
|
|
2425
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(ta, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(ta, " "));
|
|
2384
2426
|
}
|
|
2385
|
-
function
|
|
2427
|
+
function z(e, t, n) {
|
|
2386
2428
|
var r = e && e.style;
|
|
2387
2429
|
if (r) {
|
|
2388
2430
|
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];
|
|
2389
2431
|
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
2390
2432
|
}
|
|
2391
2433
|
}
|
|
2392
|
-
function
|
|
2434
|
+
function na(e, t) {
|
|
2393
2435
|
var n = "";
|
|
2394
2436
|
if (typeof e == "string") n = e;
|
|
2395
2437
|
else do {
|
|
2396
|
-
var r =
|
|
2438
|
+
var r = z(e, "transform");
|
|
2397
2439
|
r && r !== "none" && (n = r + " " + n);
|
|
2398
2440
|
} while (!t && (e = e.parentNode));
|
|
2399
2441
|
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
2400
2442
|
return i && new i(n);
|
|
2401
2443
|
}
|
|
2402
|
-
function
|
|
2444
|
+
function ra(e, t, n) {
|
|
2403
2445
|
if (e) {
|
|
2404
2446
|
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
2405
2447
|
if (n) for (; i < a; i++) n(r[i], i);
|
|
@@ -2407,21 +2449,21 @@ function Qi(e, t, n) {
|
|
|
2407
2449
|
}
|
|
2408
2450
|
return [];
|
|
2409
2451
|
}
|
|
2410
|
-
function
|
|
2452
|
+
function ia() {
|
|
2411
2453
|
return document.scrollingElement || document.documentElement;
|
|
2412
2454
|
}
|
|
2413
|
-
function
|
|
2455
|
+
function B(e, t, n, r, i) {
|
|
2414
2456
|
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
2415
2457
|
var a, o, s, c, l, u, d;
|
|
2416
|
-
if (e !== window && e.parentNode && e !==
|
|
2417
|
-
if (i && i.getBoundingClientRect && (
|
|
2458
|
+
if (e !== window && e.parentNode && e !== ia() ? (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, !Gi)) do
|
|
2459
|
+
if (i && i.getBoundingClientRect && (z(i, "transform") !== "none" || n && z(i, "position") !== "static")) {
|
|
2418
2460
|
var f = i.getBoundingClientRect();
|
|
2419
|
-
o -= f.top + parseInt(
|
|
2461
|
+
o -= f.top + parseInt(z(i, "border-top-width")), s -= f.left + parseInt(z(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
2420
2462
|
break;
|
|
2421
2463
|
}
|
|
2422
2464
|
while (i = i.parentNode);
|
|
2423
2465
|
if (r && e !== window) {
|
|
2424
|
-
var p =
|
|
2466
|
+
var p = na(i || e), m = p && p.a, h = p && p.d;
|
|
2425
2467
|
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
2426
2468
|
}
|
|
2427
2469
|
return {
|
|
@@ -2434,18 +2476,18 @@ function V(e, t, n, r, i) {
|
|
|
2434
2476
|
};
|
|
2435
2477
|
}
|
|
2436
2478
|
}
|
|
2437
|
-
function
|
|
2438
|
-
for (var r =
|
|
2439
|
-
var a =
|
|
2479
|
+
function aa(e, t, n) {
|
|
2480
|
+
for (var r = da(e, !0), i = B(e)[t]; r;) {
|
|
2481
|
+
var a = B(r)[n], o = void 0;
|
|
2440
2482
|
if (o = i >= a, !o) return r;
|
|
2441
|
-
if (r ===
|
|
2442
|
-
r =
|
|
2483
|
+
if (r === ia()) break;
|
|
2484
|
+
r = da(r, !1);
|
|
2443
2485
|
}
|
|
2444
2486
|
return !1;
|
|
2445
2487
|
}
|
|
2446
|
-
function
|
|
2488
|
+
function oa(e, t, n, r) {
|
|
2447
2489
|
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
2448
|
-
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) &&
|
|
2490
|
+
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && ea(o[a], n.draggable, e, !1)) {
|
|
2449
2491
|
if (i === t) return o[a];
|
|
2450
2492
|
i++;
|
|
2451
2493
|
}
|
|
@@ -2453,96 +2495,96 @@ function ta(e, t, n, r) {
|
|
|
2453
2495
|
}
|
|
2454
2496
|
return null;
|
|
2455
2497
|
}
|
|
2456
|
-
function
|
|
2457
|
-
for (var n = e.lastElementChild; n && (n === Q.ghost ||
|
|
2498
|
+
function sa(e, t) {
|
|
2499
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || z(n, "display") === "none" || t && !Qi(n, t));) n = n.previousElementSibling;
|
|
2458
2500
|
return n || null;
|
|
2459
2501
|
}
|
|
2460
|
-
function
|
|
2502
|
+
function ca(e, t) {
|
|
2461
2503
|
var n = 0;
|
|
2462
2504
|
if (!e || !e.parentNode) return -1;
|
|
2463
|
-
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t ||
|
|
2505
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || Qi(e, t)) && n++;
|
|
2464
2506
|
return n;
|
|
2465
2507
|
}
|
|
2466
|
-
function
|
|
2467
|
-
var t = 0, n = 0, r =
|
|
2508
|
+
function la(e) {
|
|
2509
|
+
var t = 0, n = 0, r = ia();
|
|
2468
2510
|
if (e) do {
|
|
2469
|
-
var i =
|
|
2511
|
+
var i = na(e), a = i.a, o = i.d;
|
|
2470
2512
|
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
2471
2513
|
} while (e !== r && (e = e.parentNode));
|
|
2472
2514
|
return [t, n];
|
|
2473
2515
|
}
|
|
2474
|
-
function
|
|
2516
|
+
function ua(e, t) {
|
|
2475
2517
|
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
2476
2518
|
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
2477
2519
|
}
|
|
2478
2520
|
return -1;
|
|
2479
2521
|
}
|
|
2480
|
-
function
|
|
2481
|
-
if (!e || !e.getBoundingClientRect) return
|
|
2522
|
+
function da(e, t) {
|
|
2523
|
+
if (!e || !e.getBoundingClientRect) return ia();
|
|
2482
2524
|
var n = e, r = !1;
|
|
2483
2525
|
do
|
|
2484
2526
|
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
2485
|
-
var i =
|
|
2527
|
+
var i = z(n);
|
|
2486
2528
|
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
2487
|
-
if (!n.getBoundingClientRect || n === document.body) return
|
|
2529
|
+
if (!n.getBoundingClientRect || n === document.body) return ia();
|
|
2488
2530
|
if (r || t) return n;
|
|
2489
2531
|
r = !0;
|
|
2490
2532
|
}
|
|
2491
2533
|
}
|
|
2492
2534
|
while (n = n.parentNode);
|
|
2493
|
-
return
|
|
2535
|
+
return ia();
|
|
2494
2536
|
}
|
|
2495
|
-
function
|
|
2537
|
+
function fa(e, t) {
|
|
2496
2538
|
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
2497
2539
|
return e;
|
|
2498
2540
|
}
|
|
2499
|
-
function
|
|
2541
|
+
function pa(e, t) {
|
|
2500
2542
|
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);
|
|
2501
2543
|
}
|
|
2502
|
-
var
|
|
2503
|
-
function
|
|
2544
|
+
var ma;
|
|
2545
|
+
function ha(e, t) {
|
|
2504
2546
|
return function() {
|
|
2505
|
-
if (!
|
|
2547
|
+
if (!ma) {
|
|
2506
2548
|
var n = arguments, r = this;
|
|
2507
|
-
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n),
|
|
2508
|
-
|
|
2549
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), ma = setTimeout(function() {
|
|
2550
|
+
ma = void 0;
|
|
2509
2551
|
}, t);
|
|
2510
2552
|
}
|
|
2511
2553
|
};
|
|
2512
2554
|
}
|
|
2513
|
-
function
|
|
2514
|
-
clearTimeout(
|
|
2555
|
+
function ga() {
|
|
2556
|
+
clearTimeout(ma), ma = void 0;
|
|
2515
2557
|
}
|
|
2516
|
-
function
|
|
2558
|
+
function _a(e, t, n) {
|
|
2517
2559
|
e.scrollLeft += t, e.scrollTop += n;
|
|
2518
2560
|
}
|
|
2519
|
-
function
|
|
2561
|
+
function va(e) {
|
|
2520
2562
|
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
2521
2563
|
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
2522
2564
|
}
|
|
2523
|
-
function
|
|
2565
|
+
function ya(e, t, n) {
|
|
2524
2566
|
var r = {};
|
|
2525
2567
|
return Array.from(e.children).forEach(function(i) {
|
|
2526
|
-
if (!(!
|
|
2527
|
-
var a =
|
|
2568
|
+
if (!(!ea(i, t.draggable, e, !1) || i.animated || i === n)) {
|
|
2569
|
+
var a = B(i);
|
|
2528
2570
|
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);
|
|
2529
2571
|
}
|
|
2530
2572
|
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
2531
2573
|
}
|
|
2532
|
-
var
|
|
2533
|
-
function
|
|
2574
|
+
var V = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
2575
|
+
function ba() {
|
|
2534
2576
|
var e = [], t;
|
|
2535
2577
|
return {
|
|
2536
2578
|
captureAnimationState: function() {
|
|
2537
2579
|
e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
|
|
2538
|
-
if (!(
|
|
2580
|
+
if (!(z(t, "display") === "none" || t === Q.ghost)) {
|
|
2539
2581
|
e.push({
|
|
2540
2582
|
target: t,
|
|
2541
|
-
rect:
|
|
2583
|
+
rect: B(t)
|
|
2542
2584
|
});
|
|
2543
|
-
var n =
|
|
2585
|
+
var n = Li({}, e[e.length - 1].rect);
|
|
2544
2586
|
if (t.thisAnimationDuration) {
|
|
2545
|
-
var r =
|
|
2587
|
+
var r = na(t, !0);
|
|
2546
2588
|
r && (n.top -= r.f, n.left -= r.e);
|
|
2547
2589
|
}
|
|
2548
2590
|
t.fromRect = n;
|
|
@@ -2553,7 +2595,7 @@ function ha() {
|
|
|
2553
2595
|
e.push(t);
|
|
2554
2596
|
},
|
|
2555
2597
|
removeAnimationState: function(t) {
|
|
2556
|
-
e.splice(
|
|
2598
|
+
e.splice(ua(e, { target: t }), 1);
|
|
2557
2599
|
},
|
|
2558
2600
|
animateAll: function(n) {
|
|
2559
2601
|
var r = this;
|
|
@@ -2563,8 +2605,8 @@ function ha() {
|
|
|
2563
2605
|
}
|
|
2564
2606
|
var i = !1, a = 0;
|
|
2565
2607
|
e.forEach(function(e) {
|
|
2566
|
-
var t = 0, n = e.target, o = n.fromRect, s =
|
|
2567
|
-
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration &&
|
|
2608
|
+
var t = 0, n = e.target, o = n.fromRect, s = B(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = na(n, !0);
|
|
2609
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && pa(c, s) && !pa(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = Sa(u, c, l, r.options)), pa(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() {
|
|
2568
2610
|
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
2569
2611
|
}, t), n.thisAnimationDuration = t);
|
|
2570
2612
|
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
@@ -2573,27 +2615,27 @@ function ha() {
|
|
|
2573
2615
|
},
|
|
2574
2616
|
animate: function(e, t, n, r) {
|
|
2575
2617
|
if (r) {
|
|
2576
|
-
|
|
2577
|
-
var i =
|
|
2578
|
-
e.animatingX = !!s, e.animatingY = !!c,
|
|
2579
|
-
|
|
2618
|
+
z(e, "transition", ""), z(e, "transform", "");
|
|
2619
|
+
var i = na(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
2620
|
+
e.animatingX = !!s, e.animatingY = !!c, z(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = xa(e), z(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), z(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
2621
|
+
z(e, "transition", ""), z(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
2580
2622
|
}, r);
|
|
2581
2623
|
}
|
|
2582
2624
|
}
|
|
2583
2625
|
};
|
|
2584
2626
|
}
|
|
2585
|
-
function
|
|
2627
|
+
function xa(e) {
|
|
2586
2628
|
return e.offsetWidth;
|
|
2587
2629
|
}
|
|
2588
|
-
function
|
|
2630
|
+
function Sa(e, t, n, r) {
|
|
2589
2631
|
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;
|
|
2590
2632
|
}
|
|
2591
|
-
var
|
|
2633
|
+
var Ca = [], wa = { initializeByDefault: !0 }, Ta = {
|
|
2592
2634
|
mount: function(e) {
|
|
2593
|
-
for (var t in
|
|
2594
|
-
|
|
2635
|
+
for (var t in wa) wa.hasOwnProperty(t) && !(t in e) && (e[t] = wa[t]);
|
|
2636
|
+
Ca.forEach(function(t) {
|
|
2595
2637
|
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
2596
|
-
}),
|
|
2638
|
+
}), Ca.push(e);
|
|
2597
2639
|
},
|
|
2598
2640
|
pluginEvent: function(e, t, n) {
|
|
2599
2641
|
var r = this;
|
|
@@ -2601,16 +2643,16 @@ var va = [], ya = { initializeByDefault: !0 }, ba = {
|
|
|
2601
2643
|
r.eventCanceled = !0;
|
|
2602
2644
|
};
|
|
2603
2645
|
var i = e + "Global";
|
|
2604
|
-
|
|
2605
|
-
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](
|
|
2646
|
+
Ca.forEach(function(r) {
|
|
2647
|
+
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](Li({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](Li({ sortable: t }, n)));
|
|
2606
2648
|
});
|
|
2607
2649
|
},
|
|
2608
2650
|
initializePlugins: function(e, t, n, r) {
|
|
2609
|
-
for (var i in
|
|
2651
|
+
for (var i in Ca.forEach(function(r) {
|
|
2610
2652
|
var i = r.pluginName;
|
|
2611
2653
|
if (!(!e.options[i] && !r.initializeByDefault)) {
|
|
2612
2654
|
var a = new r(e, t, e.options);
|
|
2613
|
-
a.sortable = e, a.options = e.options, e[i] = a,
|
|
2655
|
+
a.sortable = e, a.options = e.options, e[i] = a, Bi(n, a.defaults);
|
|
2614
2656
|
}
|
|
2615
2657
|
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
2616
2658
|
var a = this.modifyOption(e, i, e.options[i]);
|
|
@@ -2619,59 +2661,59 @@ var va = [], ya = { initializeByDefault: !0 }, ba = {
|
|
|
2619
2661
|
},
|
|
2620
2662
|
getEventProperties: function(e, t) {
|
|
2621
2663
|
var n = {};
|
|
2622
|
-
return
|
|
2623
|
-
typeof r.eventProperties == "function" &&
|
|
2664
|
+
return Ca.forEach(function(r) {
|
|
2665
|
+
typeof r.eventProperties == "function" && Bi(n, r.eventProperties.call(t[r.pluginName], e));
|
|
2624
2666
|
}), n;
|
|
2625
2667
|
},
|
|
2626
2668
|
modifyOption: function(e, t, n) {
|
|
2627
2669
|
var r;
|
|
2628
|
-
return
|
|
2670
|
+
return Ca.forEach(function(i) {
|
|
2629
2671
|
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
2630
2672
|
}), r;
|
|
2631
2673
|
}
|
|
2632
2674
|
};
|
|
2633
|
-
function
|
|
2675
|
+
function Ea(e) {
|
|
2634
2676
|
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;
|
|
2635
|
-
if (t ||= n && n[
|
|
2677
|
+
if (t ||= n && n[V], t) {
|
|
2636
2678
|
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
2637
|
-
window.CustomEvent && !
|
|
2679
|
+
window.CustomEvent && !Gi && !Ki ? h = new CustomEvent(r, {
|
|
2638
2680
|
bubbles: !0,
|
|
2639
2681
|
cancelable: !0
|
|
2640
2682
|
}) : (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;
|
|
2641
|
-
var v =
|
|
2683
|
+
var v = Li(Li({}, m), Ta.getEventProperties(r, t));
|
|
2642
2684
|
for (var y in v) h[y] = v[y];
|
|
2643
2685
|
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
2644
2686
|
}
|
|
2645
2687
|
}
|
|
2646
|
-
var
|
|
2647
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i =
|
|
2648
|
-
|
|
2649
|
-
dragEl:
|
|
2650
|
-
parentEl:
|
|
2651
|
-
ghostEl:
|
|
2652
|
-
rootEl:
|
|
2653
|
-
nextEl:
|
|
2654
|
-
lastDownEl:
|
|
2655
|
-
cloneEl:
|
|
2656
|
-
cloneHidden:
|
|
2657
|
-
dragStarted:
|
|
2688
|
+
var Da = ["evt"], H = function(e, t) {
|
|
2689
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = Hi(n, Da);
|
|
2690
|
+
Ta.pluginEvent.bind(Q)(e, t, Li({
|
|
2691
|
+
dragEl: W,
|
|
2692
|
+
parentEl: G,
|
|
2693
|
+
ghostEl: K,
|
|
2694
|
+
rootEl: q,
|
|
2695
|
+
nextEl: Oa,
|
|
2696
|
+
lastDownEl: ka,
|
|
2697
|
+
cloneEl: J,
|
|
2698
|
+
cloneHidden: Aa,
|
|
2699
|
+
dragStarted: Wa,
|
|
2658
2700
|
putSortable: X,
|
|
2659
2701
|
activeSortable: Q.active,
|
|
2660
2702
|
originalEvent: r,
|
|
2661
|
-
oldIndex:
|
|
2662
|
-
oldDraggableIndex:
|
|
2663
|
-
newIndex:
|
|
2664
|
-
newDraggableIndex:
|
|
2665
|
-
hideGhostForTarget:
|
|
2666
|
-
unhideGhostForTarget:
|
|
2703
|
+
oldIndex: ja,
|
|
2704
|
+
oldDraggableIndex: Ma,
|
|
2705
|
+
newIndex: Y,
|
|
2706
|
+
newDraggableIndex: Na,
|
|
2707
|
+
hideGhostForTarget: co,
|
|
2708
|
+
unhideGhostForTarget: lo,
|
|
2667
2709
|
cloneNowHidden: function() {
|
|
2668
|
-
|
|
2710
|
+
Aa = !0;
|
|
2669
2711
|
},
|
|
2670
2712
|
cloneNowShown: function() {
|
|
2671
|
-
|
|
2713
|
+
Aa = !1;
|
|
2672
2714
|
},
|
|
2673
2715
|
dispatchSortableEvent: function(e) {
|
|
2674
|
-
|
|
2716
|
+
U({
|
|
2675
2717
|
sortable: t,
|
|
2676
2718
|
name: e,
|
|
2677
2719
|
originalEvent: r
|
|
@@ -2679,46 +2721,46 @@ var Sa = ["evt"], U = function(e, t) {
|
|
|
2679
2721
|
}
|
|
2680
2722
|
}, i));
|
|
2681
2723
|
};
|
|
2682
|
-
function
|
|
2683
|
-
|
|
2724
|
+
function U(e) {
|
|
2725
|
+
Ea(Li({
|
|
2684
2726
|
putSortable: X,
|
|
2685
|
-
cloneEl:
|
|
2686
|
-
targetEl:
|
|
2687
|
-
rootEl:
|
|
2688
|
-
oldIndex:
|
|
2689
|
-
oldDraggableIndex:
|
|
2690
|
-
newIndex:
|
|
2691
|
-
newDraggableIndex:
|
|
2727
|
+
cloneEl: J,
|
|
2728
|
+
targetEl: W,
|
|
2729
|
+
rootEl: q,
|
|
2730
|
+
oldIndex: ja,
|
|
2731
|
+
oldDraggableIndex: Ma,
|
|
2732
|
+
newIndex: Y,
|
|
2733
|
+
newDraggableIndex: Na
|
|
2692
2734
|
}, e));
|
|
2693
2735
|
}
|
|
2694
|
-
var G, K, q,
|
|
2695
|
-
if (
|
|
2696
|
-
if (
|
|
2736
|
+
var W, G, K, q, Oa, ka, J, Aa, ja, Y, Ma, Na, Pa, X, Fa = !1, Ia = !1, La = [], Ra, za, Ba, Va, Ha, Ua, Wa, Ga, Ka, qa = !1, Ja = !1, Ya, Z, Xa = [], Za = !1, Qa = [], $a = typeof document < "u", eo = Yi, to = Ki || Gi ? "cssFloat" : "float", no = $a && !Xi && !Yi && "draggable" in document.createElement("div"), ro = function() {
|
|
2737
|
+
if ($a) {
|
|
2738
|
+
if (Gi) return !1;
|
|
2697
2739
|
var e = document.createElement("x");
|
|
2698
2740
|
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
2699
2741
|
}
|
|
2700
|
-
}(),
|
|
2701
|
-
var n =
|
|
2742
|
+
}(), io = function(e, t) {
|
|
2743
|
+
var n = z(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = oa(e, 0, t), a = oa(e, 1, t), o = i && z(i), s = a && z(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + B(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + B(a).width;
|
|
2702
2744
|
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
2703
2745
|
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
2704
2746
|
if (i && o.float && o.float !== "none") {
|
|
2705
2747
|
var u = o.float === "left" ? "left" : "right";
|
|
2706
2748
|
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
2707
2749
|
}
|
|
2708
|
-
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[
|
|
2709
|
-
},
|
|
2750
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[to] === "none" || a && n[to] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
2751
|
+
}, ao = function(e, t, n) {
|
|
2710
2752
|
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;
|
|
2711
2753
|
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
2712
|
-
},
|
|
2754
|
+
}, oo = function(e, t) {
|
|
2713
2755
|
var n;
|
|
2714
|
-
return
|
|
2715
|
-
var i = r[
|
|
2716
|
-
if (!(!i ||
|
|
2717
|
-
var a =
|
|
2756
|
+
return La.some(function(r) {
|
|
2757
|
+
var i = r[V].options.emptyInsertThreshold;
|
|
2758
|
+
if (!(!i || sa(r))) {
|
|
2759
|
+
var a = B(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
2718
2760
|
if (o && s) return n = r;
|
|
2719
2761
|
}
|
|
2720
2762
|
}), n;
|
|
2721
|
-
},
|
|
2763
|
+
}, so = function(e) {
|
|
2722
2764
|
function t(e, n) {
|
|
2723
2765
|
return function(r, i, a, o) {
|
|
2724
2766
|
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
@@ -2731,31 +2773,31 @@ var G, K, q, J, Ca, wa, Y, Ta, Ea, Da, Oa, ka, Aa, X, ja = !1, Ma = !1, Na = [],
|
|
|
2731
2773
|
};
|
|
2732
2774
|
}
|
|
2733
2775
|
var n = {}, r = e.group;
|
|
2734
|
-
(!r ||
|
|
2735
|
-
},
|
|
2736
|
-
|
|
2737
|
-
},
|
|
2738
|
-
|
|
2776
|
+
(!r || Ri(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;
|
|
2777
|
+
}, co = function() {
|
|
2778
|
+
!ro && K && z(K, "display", "none");
|
|
2779
|
+
}, lo = function() {
|
|
2780
|
+
!ro && K && z(K, "display", "");
|
|
2739
2781
|
};
|
|
2740
|
-
|
|
2741
|
-
if (
|
|
2782
|
+
$a && !Xi && document.addEventListener("click", function(e) {
|
|
2783
|
+
if (Ia) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), Ia = !1, !1;
|
|
2742
2784
|
}, !0);
|
|
2743
|
-
var
|
|
2744
|
-
if (
|
|
2785
|
+
var uo = function(e) {
|
|
2786
|
+
if (W) {
|
|
2745
2787
|
e = e.touches ? e.touches[0] : e;
|
|
2746
|
-
var t =
|
|
2788
|
+
var t = oo(e.clientX, e.clientY);
|
|
2747
2789
|
if (t) {
|
|
2748
2790
|
var n = {};
|
|
2749
2791
|
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
2750
|
-
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[
|
|
2792
|
+
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[V]._onDragOver(n);
|
|
2751
2793
|
}
|
|
2752
2794
|
}
|
|
2753
|
-
},
|
|
2754
|
-
|
|
2795
|
+
}, fo = function(e) {
|
|
2796
|
+
W && W.parentNode[V]._isOutsideThisEl(e.target);
|
|
2755
2797
|
};
|
|
2756
2798
|
function Q(e, t) {
|
|
2757
2799
|
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
2758
|
-
this.el = e, this.options = t =
|
|
2800
|
+
this.el = e, this.options = t = Bi({}, t), e[V] = this;
|
|
2759
2801
|
var n = {
|
|
2760
2802
|
group: null,
|
|
2761
2803
|
sort: !0,
|
|
@@ -2768,7 +2810,7 @@ function Q(e, t) {
|
|
|
2768
2810
|
invertedSwapThreshold: null,
|
|
2769
2811
|
removeCloneOnHide: !0,
|
|
2770
2812
|
direction: function() {
|
|
2771
|
-
return
|
|
2813
|
+
return io(e, this.options);
|
|
2772
2814
|
},
|
|
2773
2815
|
ghostClass: "sortable-ghost",
|
|
2774
2816
|
chosenClass: "sortable-chosen",
|
|
@@ -2795,80 +2837,80 @@ function Q(e, t) {
|
|
|
2795
2837
|
x: 0,
|
|
2796
2838
|
y: 0
|
|
2797
2839
|
},
|
|
2798
|
-
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !
|
|
2840
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !Ji,
|
|
2799
2841
|
emptyInsertThreshold: 5
|
|
2800
2842
|
};
|
|
2801
|
-
for (var r in
|
|
2802
|
-
for (var i in
|
|
2803
|
-
this.nativeDraggable = t.forceFallback
|
|
2843
|
+
for (var r in Ta.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
2844
|
+
for (var i in so(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
2845
|
+
this.nativeDraggable = !t.forceFallback && no, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? I(e, "pointerdown", this._onTapStart) : (I(e, "mousedown", this._onTapStart), I(e, "touchstart", this._onTapStart)), this.nativeDraggable && (I(e, "dragover", this), I(e, "dragenter", this)), La.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), Bi(this, ba());
|
|
2804
2846
|
}
|
|
2805
2847
|
Q.prototype = {
|
|
2806
2848
|
constructor: Q,
|
|
2807
2849
|
_isOutsideThisEl: function(e) {
|
|
2808
|
-
!this.el.contains(e) && e !== this.el && (
|
|
2850
|
+
!this.el.contains(e) && e !== this.el && (Ga = null);
|
|
2809
2851
|
},
|
|
2810
2852
|
_getDirection: function(e, t) {
|
|
2811
|
-
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t,
|
|
2853
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, W) : this.options.direction;
|
|
2812
2854
|
},
|
|
2813
2855
|
_onTapStart: function(e) {
|
|
2814
2856
|
if (e.cancelable) {
|
|
2815
2857
|
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;
|
|
2816
|
-
if (
|
|
2817
|
-
if (
|
|
2858
|
+
if (So(n), !W && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && Ji && s && s.tagName.toUpperCase() === "SELECT") && (s = ea(s, r.draggable, n, !1), !(s && s.animated) && ka !== s)) {
|
|
2859
|
+
if (ja = ca(s), Ma = ca(s, r.draggable), typeof l == "function") {
|
|
2818
2860
|
if (l.call(this, e, s, this)) {
|
|
2819
|
-
|
|
2861
|
+
U({
|
|
2820
2862
|
sortable: t,
|
|
2821
2863
|
rootEl: c,
|
|
2822
2864
|
name: "filter",
|
|
2823
2865
|
targetEl: s,
|
|
2824
2866
|
toEl: n,
|
|
2825
2867
|
fromEl: n
|
|
2826
|
-
}),
|
|
2868
|
+
}), H("filter", t, { evt: e }), i && e.cancelable && e.preventDefault();
|
|
2827
2869
|
return;
|
|
2828
2870
|
}
|
|
2829
2871
|
} else if (l && (l = l.split(",").some(function(r) {
|
|
2830
|
-
if (r =
|
|
2872
|
+
if (r = ea(c, r.trim(), n, !1), r) return U({
|
|
2831
2873
|
sortable: t,
|
|
2832
2874
|
rootEl: r,
|
|
2833
2875
|
name: "filter",
|
|
2834
2876
|
targetEl: s,
|
|
2835
2877
|
fromEl: n,
|
|
2836
2878
|
toEl: n
|
|
2837
|
-
}),
|
|
2879
|
+
}), H("filter", t, { evt: e }), !0;
|
|
2838
2880
|
}), l)) {
|
|
2839
2881
|
i && e.cancelable && e.preventDefault();
|
|
2840
2882
|
return;
|
|
2841
2883
|
}
|
|
2842
|
-
r.handle && !
|
|
2884
|
+
r.handle && !ea(c, r.handle, n, !1) || this._prepareDragStart(e, o, s);
|
|
2843
2885
|
}
|
|
2844
2886
|
}
|
|
2845
2887
|
},
|
|
2846
2888
|
_prepareDragStart: function(e, t, n) {
|
|
2847
2889
|
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
2848
|
-
if (n && !
|
|
2849
|
-
var c =
|
|
2850
|
-
if (
|
|
2851
|
-
target:
|
|
2890
|
+
if (n && !W && n.parentNode === i) {
|
|
2891
|
+
var c = B(n);
|
|
2892
|
+
if (q = i, W = n, G = W.parentNode, Oa = W.nextSibling, ka = n, Pa = a.group, Q.dragged = W, Ra = {
|
|
2893
|
+
target: W,
|
|
2852
2894
|
clientX: (t || e).clientX,
|
|
2853
2895
|
clientY: (t || e).clientY
|
|
2854
|
-
},
|
|
2855
|
-
if (
|
|
2896
|
+
}, Ha = Ra.clientX - c.left, Ua = Ra.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, W.style["will-change"] = "all", s = function() {
|
|
2897
|
+
if (H("delayEnded", r, { evt: e }), Q.eventCanceled) {
|
|
2856
2898
|
r._onDrop();
|
|
2857
2899
|
return;
|
|
2858
2900
|
}
|
|
2859
|
-
r._disableDelayedDragEvents(), !
|
|
2901
|
+
r._disableDelayedDragEvents(), !qi && r.nativeDraggable && (W.draggable = !0), r._triggerDragStart(e, t), U({
|
|
2860
2902
|
sortable: r,
|
|
2861
2903
|
name: "choose",
|
|
2862
2904
|
originalEvent: e
|
|
2863
|
-
}),
|
|
2905
|
+
}), R(W, a.chosenClass, !0);
|
|
2864
2906
|
}, a.ignore.split(",").forEach(function(e) {
|
|
2865
|
-
|
|
2866
|
-
}),
|
|
2907
|
+
ra(W, e.trim(), ho);
|
|
2908
|
+
}), I(o, "dragover", uo), I(o, "mousemove", uo), I(o, "touchmove", uo), I(o, "mouseup", r._onDrop), I(o, "touchend", r._onDrop), I(o, "touchcancel", r._onDrop), qi && this.nativeDraggable && (this.options.touchStartThreshold = 4, W.draggable = !0), H("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Ki || Gi))) {
|
|
2867
2909
|
if (Q.eventCanceled) {
|
|
2868
2910
|
this._onDrop();
|
|
2869
2911
|
return;
|
|
2870
2912
|
}
|
|
2871
|
-
|
|
2913
|
+
I(o, "mouseup", r._disableDelayedDrag), I(o, "touchend", r._disableDelayedDrag), I(o, "touchcancel", r._disableDelayedDrag), I(o, "mousemove", r._delayedDragTouchMoveHandler), I(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && I(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
|
|
2872
2914
|
} else s();
|
|
2873
2915
|
}
|
|
2874
2916
|
},
|
|
@@ -2877,25 +2919,25 @@ Q.prototype = {
|
|
|
2877
2919
|
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();
|
|
2878
2920
|
},
|
|
2879
2921
|
_disableDelayedDrag: function() {
|
|
2880
|
-
|
|
2922
|
+
W && ho(W), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
2881
2923
|
},
|
|
2882
2924
|
_disableDelayedDragEvents: function() {
|
|
2883
2925
|
var e = this.el.ownerDocument;
|
|
2884
|
-
|
|
2926
|
+
L(e, "mouseup", this._disableDelayedDrag), L(e, "touchend", this._disableDelayedDrag), L(e, "touchcancel", this._disableDelayedDrag), L(e, "mousemove", this._delayedDragTouchMoveHandler), L(e, "touchmove", this._delayedDragTouchMoveHandler), L(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
2885
2927
|
},
|
|
2886
2928
|
_triggerDragStart: function(e, t) {
|
|
2887
|
-
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ?
|
|
2929
|
+
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? I(document, "pointermove", this._onTouchMove) : t ? I(document, "touchmove", this._onTouchMove) : I(document, "mousemove", this._onTouchMove) : (I(W, "dragend", this), I(q, "dragstart", this._onDragStart));
|
|
2888
2930
|
try {
|
|
2889
|
-
document.selection ?
|
|
2931
|
+
document.selection ? Co(function() {
|
|
2890
2932
|
document.selection.empty();
|
|
2891
2933
|
}) : window.getSelection().removeAllRanges();
|
|
2892
2934
|
} catch {}
|
|
2893
2935
|
},
|
|
2894
2936
|
_dragStarted: function(e, t) {
|
|
2895
|
-
if (
|
|
2896
|
-
|
|
2937
|
+
if (Fa = !1, q && W) {
|
|
2938
|
+
H("dragStarted", this, { evt: t }), this.nativeDraggable && I(document, "dragover", fo);
|
|
2897
2939
|
var n = this.options;
|
|
2898
|
-
!e &&
|
|
2940
|
+
!e && R(W, n.dragClass, !1), R(W, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), U({
|
|
2899
2941
|
sortable: this,
|
|
2900
2942
|
name: "start",
|
|
2901
2943
|
originalEvent: t
|
|
@@ -2903,33 +2945,33 @@ Q.prototype = {
|
|
|
2903
2945
|
} else this._nulling();
|
|
2904
2946
|
},
|
|
2905
2947
|
_emulateDragOver: function() {
|
|
2906
|
-
if (
|
|
2907
|
-
this._lastX =
|
|
2908
|
-
for (var e = document.elementFromPoint(
|
|
2909
|
-
if (
|
|
2910
|
-
if (t[
|
|
2948
|
+
if (za) {
|
|
2949
|
+
this._lastX = za.clientX, this._lastY = za.clientY, co();
|
|
2950
|
+
for (var e = document.elementFromPoint(za.clientX, za.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(za.clientX, za.clientY), e !== t);) t = e;
|
|
2951
|
+
if (W.parentNode[V]._isOutsideThisEl(e), t) do {
|
|
2952
|
+
if (t[V]) {
|
|
2911
2953
|
var n = void 0;
|
|
2912
|
-
if (n = t[
|
|
2913
|
-
clientX:
|
|
2914
|
-
clientY:
|
|
2954
|
+
if (n = t[V]._onDragOver({
|
|
2955
|
+
clientX: za.clientX,
|
|
2956
|
+
clientY: za.clientY,
|
|
2915
2957
|
target: e,
|
|
2916
2958
|
rootEl: t
|
|
2917
2959
|
}), n && !this.options.dragoverBubble) break;
|
|
2918
2960
|
}
|
|
2919
2961
|
e = t;
|
|
2920
2962
|
} while (t = t.parentNode);
|
|
2921
|
-
|
|
2963
|
+
lo();
|
|
2922
2964
|
}
|
|
2923
2965
|
},
|
|
2924
2966
|
_onTouchMove: function(e) {
|
|
2925
|
-
if (
|
|
2926
|
-
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a =
|
|
2927
|
-
if (!Q.active && !
|
|
2967
|
+
if (Ra) {
|
|
2968
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = K && na(K, !0), o = K && a && a.a, s = K && a && a.d, c = eo && Z && la(Z), l = (i.clientX - Ra.clientX + r.x) / (o || 1) + (c ? c[0] - Xa[0] : 0) / (o || 1), u = (i.clientY - Ra.clientY + r.y) / (s || 1) + (c ? c[1] - Xa[1] : 0) / (s || 1);
|
|
2969
|
+
if (!Q.active && !Fa) {
|
|
2928
2970
|
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
2929
2971
|
this._onDragStart(e, !0);
|
|
2930
2972
|
}
|
|
2931
|
-
if (
|
|
2932
|
-
a ? (a.e += l - (
|
|
2973
|
+
if (K) {
|
|
2974
|
+
a ? (a.e += l - (Ba || 0), a.f += u - (Va || 0)) : a = {
|
|
2933
2975
|
a: 1,
|
|
2934
2976
|
b: 0,
|
|
2935
2977
|
c: 0,
|
|
@@ -2938,39 +2980,39 @@ Q.prototype = {
|
|
|
2938
2980
|
f: u
|
|
2939
2981
|
};
|
|
2940
2982
|
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
2941
|
-
|
|
2983
|
+
z(K, "webkitTransform", d), z(K, "mozTransform", d), z(K, "msTransform", d), z(K, "transform", d), Ba = l, Va = u, za = i;
|
|
2942
2984
|
}
|
|
2943
2985
|
e.cancelable && e.preventDefault();
|
|
2944
2986
|
}
|
|
2945
2987
|
},
|
|
2946
2988
|
_appendGhost: function() {
|
|
2947
|
-
if (!
|
|
2948
|
-
var e = this.options.fallbackOnBody ? document.body :
|
|
2949
|
-
if (
|
|
2950
|
-
for (Z = e;
|
|
2951
|
-
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z =
|
|
2989
|
+
if (!K) {
|
|
2990
|
+
var e = this.options.fallbackOnBody ? document.body : q, t = B(W, !0, eo, !0, e), n = this.options;
|
|
2991
|
+
if (eo) {
|
|
2992
|
+
for (Z = e; z(Z, "position") === "static" && z(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
2993
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = ia()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = ia(), Xa = la(Z);
|
|
2952
2994
|
}
|
|
2953
|
-
|
|
2995
|
+
K = W.cloneNode(!0), R(K, n.ghostClass, !1), R(K, n.fallbackClass, !0), R(K, n.dragClass, !0), z(K, "transition", ""), z(K, "transform", ""), z(K, "box-sizing", "border-box"), z(K, "margin", 0), z(K, "top", t.top), z(K, "left", t.left), z(K, "width", t.width), z(K, "height", t.height), z(K, "opacity", "0.8"), z(K, "position", eo ? "absolute" : "fixed"), z(K, "zIndex", "100000"), z(K, "pointerEvents", "none"), Q.ghost = K, e.appendChild(K), z(K, "transform-origin", Ha / parseInt(K.style.width) * 100 + "% " + Ua / parseInt(K.style.height) * 100 + "%");
|
|
2954
2996
|
}
|
|
2955
2997
|
},
|
|
2956
2998
|
_onDragStart: function(e, t) {
|
|
2957
2999
|
var n = this, r = e.dataTransfer, i = n.options;
|
|
2958
|
-
if (
|
|
3000
|
+
if (H("dragStart", this, { evt: e }), Q.eventCanceled) {
|
|
2959
3001
|
this._onDrop();
|
|
2960
3002
|
return;
|
|
2961
3003
|
}
|
|
2962
|
-
|
|
2963
|
-
|
|
3004
|
+
H("setupClone", this), Q.eventCanceled || (J = va(W), J.removeAttribute("id"), J.draggable = !1, J.style["will-change"] = "", this._hideClone(), R(J, this.options.chosenClass, !1), Q.clone = J), n.cloneId = Co(function() {
|
|
3005
|
+
H("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || q.insertBefore(J, W), n._hideClone(), U({
|
|
2964
3006
|
sortable: n,
|
|
2965
3007
|
name: "clone"
|
|
2966
3008
|
}));
|
|
2967
|
-
}), !t &&
|
|
3009
|
+
}), !t && R(W, i.dragClass, !0), t ? (Ia = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (L(document, "mouseup", n._onDrop), L(document, "touchend", n._onDrop), L(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, W)), I(document, "drop", n), z(W, "transform", "translateZ(0)")), Fa = !0, n._dragStartId = Co(n._dragStarted.bind(n, t, e)), I(document, "selectstart", n), Wa = !0, Ji && z(document.body, "user-select", "none");
|
|
2968
3010
|
},
|
|
2969
3011
|
_onDragOver: function(e) {
|
|
2970
|
-
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l =
|
|
2971
|
-
if (
|
|
3012
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = Pa === s, u = o.sort, d = X || c, f, p = this, m = !1;
|
|
3013
|
+
if (Za) return;
|
|
2972
3014
|
function h(o, s) {
|
|
2973
|
-
|
|
3015
|
+
H(o, p, Li({
|
|
2974
3016
|
evt: e,
|
|
2975
3017
|
isOwner: l,
|
|
2976
3018
|
axis: f ? "vertical" : "horizontal",
|
|
@@ -2982,7 +3024,7 @@ Q.prototype = {
|
|
|
2982
3024
|
target: n,
|
|
2983
3025
|
completed: _,
|
|
2984
3026
|
onMove: function(n, i) {
|
|
2985
|
-
return
|
|
3027
|
+
return mo(q, t, W, r, n, B(n), e, i);
|
|
2986
3028
|
},
|
|
2987
3029
|
changed: v
|
|
2988
3030
|
}, s));
|
|
@@ -2991,119 +3033,119 @@ Q.prototype = {
|
|
|
2991
3033
|
h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
|
|
2992
3034
|
}
|
|
2993
3035
|
function _(r) {
|
|
2994
|
-
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (
|
|
3036
|
+
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (R(W, X ? X.options.ghostClass : c.options.ghostClass, !1), R(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() {
|
|
2995
3037
|
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
2996
|
-
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n ===
|
|
3038
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === W && !W.animated || n === t && !n.animated) && (Ga = null), !o.dragoverBubble && !e.rootEl && n !== document && (W.parentNode[V]._isOutsideThisEl(e.target), !r && uo(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
2997
3039
|
}
|
|
2998
3040
|
function v() {
|
|
2999
|
-
|
|
3041
|
+
Y = ca(W), Na = ca(W, o.draggable), U({
|
|
3000
3042
|
sortable: p,
|
|
3001
3043
|
name: "change",
|
|
3002
3044
|
toEl: t,
|
|
3003
|
-
newIndex:
|
|
3004
|
-
newDraggableIndex:
|
|
3045
|
+
newIndex: Y,
|
|
3046
|
+
newDraggableIndex: Na,
|
|
3005
3047
|
originalEvent: e
|
|
3006
3048
|
});
|
|
3007
3049
|
}
|
|
3008
|
-
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n =
|
|
3009
|
-
if (
|
|
3010
|
-
if (
|
|
3011
|
-
if (f = this._getDirection(e, n) === "vertical", r =
|
|
3012
|
-
if (a) return
|
|
3013
|
-
var y =
|
|
3014
|
-
if (!y ||
|
|
3015
|
-
if (y ===
|
|
3016
|
-
if (y && t === e.target && (n = y), n && (i =
|
|
3017
|
-
} else if (y &&
|
|
3018
|
-
var b =
|
|
3019
|
-
if (b ===
|
|
3020
|
-
if (n = b, i =
|
|
3050
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = ea(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
3051
|
+
if (W.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
3052
|
+
if (Ia = !1, c && !o.disabled && (l ? u || (a = G !== q) : X === this || (this.lastPutMode = Pa.checkPull(this, c, W, e)) && s.checkPut(this, c, W, e))) {
|
|
3053
|
+
if (f = this._getDirection(e, n) === "vertical", r = B(W), h("dragOverValid"), Q.eventCanceled) return m;
|
|
3054
|
+
if (a) return G = q, g(), this._hideClone(), h("revert"), Q.eventCanceled || (Oa ? q.insertBefore(W, Oa) : q.appendChild(W)), _(!0);
|
|
3055
|
+
var y = sa(t, o.draggable);
|
|
3056
|
+
if (!y || vo(e, f, this) && !y.animated) {
|
|
3057
|
+
if (y === W) return _(!1);
|
|
3058
|
+
if (y && t === e.target && (n = y), n && (i = B(n)), mo(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);
|
|
3059
|
+
} else if (y && _o(e, f, this)) {
|
|
3060
|
+
var b = oa(t, 0, o, !0);
|
|
3061
|
+
if (b === W) return _(!1);
|
|
3062
|
+
if (n = b, i = B(n), mo(q, t, W, r, n, i, e, !1) !== !1) return g(), t.insertBefore(W, b), G = t, v(), _(!0);
|
|
3021
3063
|
} else if (n.parentNode === t) {
|
|
3022
|
-
i =
|
|
3023
|
-
var x = 0, S, C =
|
|
3024
|
-
|
|
3025
|
-
var
|
|
3064
|
+
i = B(n);
|
|
3065
|
+
var x = 0, S, C = W.parentNode !== t, w = !ao(W.animated && W.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = aa(n, "top", "top") || aa(W, "top", "top"), D = E ? E.scrollTop : void 0;
|
|
3066
|
+
Ga !== n && (S = i[T], qa = !1, Ja = !w && o.invertSwap || C), x = yo(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Ja, Ga === n);
|
|
3067
|
+
var O;
|
|
3026
3068
|
if (x !== 0) {
|
|
3027
|
-
var
|
|
3069
|
+
var k = ca(W);
|
|
3028
3070
|
do
|
|
3029
|
-
|
|
3030
|
-
while (
|
|
3071
|
+
k -= x, O = G.children[k];
|
|
3072
|
+
while (O && (z(O, "display") === "none" || O === K));
|
|
3031
3073
|
}
|
|
3032
|
-
if (x === 0 ||
|
|
3033
|
-
|
|
3034
|
-
var
|
|
3035
|
-
|
|
3036
|
-
var
|
|
3037
|
-
if (
|
|
3074
|
+
if (x === 0 || O === n) return _(!1);
|
|
3075
|
+
Ga = n, Ka = x;
|
|
3076
|
+
var ee = n.nextElementSibling, A = !1;
|
|
3077
|
+
A = x === 1;
|
|
3078
|
+
var te = mo(q, t, W, r, n, i, e, A);
|
|
3079
|
+
if (te !== !1) return (te === 1 || te === -1) && (A = te === 1), Za = !0, setTimeout(go, 30), g(), A && !ee ? t.appendChild(W) : n.parentNode.insertBefore(W, A ? ee : n), E && _a(E, 0, D - E.scrollTop), G = W.parentNode, S !== void 0 && !Ja && (Ya = Math.abs(S - B(n)[T])), v(), _(!0);
|
|
3038
3080
|
}
|
|
3039
|
-
if (t.contains(
|
|
3081
|
+
if (t.contains(W)) return _(!1);
|
|
3040
3082
|
}
|
|
3041
3083
|
return !1;
|
|
3042
3084
|
},
|
|
3043
3085
|
_ignoreWhileAnimating: null,
|
|
3044
3086
|
_offMoveEvents: function() {
|
|
3045
|
-
|
|
3087
|
+
L(document, "mousemove", this._onTouchMove), L(document, "touchmove", this._onTouchMove), L(document, "pointermove", this._onTouchMove), L(document, "dragover", uo), L(document, "mousemove", uo), L(document, "touchmove", uo);
|
|
3046
3088
|
},
|
|
3047
3089
|
_offUpEvents: function() {
|
|
3048
3090
|
var e = this.el.ownerDocument;
|
|
3049
|
-
|
|
3091
|
+
L(e, "mouseup", this._onDrop), L(e, "touchend", this._onDrop), L(e, "pointerup", this._onDrop), L(e, "touchcancel", this._onDrop), L(document, "selectstart", this);
|
|
3050
3092
|
},
|
|
3051
3093
|
_onDrop: function(e) {
|
|
3052
3094
|
var t = this.el, n = this.options;
|
|
3053
|
-
if (
|
|
3095
|
+
if (Y = ca(W), Na = ca(W, n.draggable), H("drop", this, { evt: e }), G = W && W.parentNode, Y = ca(W), Na = ca(W, n.draggable), Q.eventCanceled) {
|
|
3054
3096
|
this._nulling();
|
|
3055
3097
|
return;
|
|
3056
3098
|
}
|
|
3057
|
-
|
|
3099
|
+
Fa = !1, Ja = !1, qa = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), wo(this.cloneId), wo(this._dragStartId), this.nativeDraggable && (L(document, "drop", this), L(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), Ji && z(document.body, "user-select", ""), z(W, "transform", ""), e && (Wa && (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 && L(W, "dragend", this), ho(W), W.style["will-change"] = "", Wa && !Fa && R(W, X ? X.options.ghostClass : this.options.ghostClass, !1), R(W, this.options.chosenClass, !1), U({
|
|
3058
3100
|
sortable: this,
|
|
3059
3101
|
name: "unchoose",
|
|
3060
|
-
toEl:
|
|
3102
|
+
toEl: G,
|
|
3061
3103
|
newIndex: null,
|
|
3062
3104
|
newDraggableIndex: null,
|
|
3063
3105
|
originalEvent: e
|
|
3064
|
-
}),
|
|
3106
|
+
}), q === G ? Y !== ja && Y >= 0 && (U({
|
|
3065
3107
|
sortable: this,
|
|
3066
3108
|
name: "update",
|
|
3067
|
-
toEl:
|
|
3109
|
+
toEl: G,
|
|
3068
3110
|
originalEvent: e
|
|
3069
|
-
}),
|
|
3111
|
+
}), U({
|
|
3070
3112
|
sortable: this,
|
|
3071
3113
|
name: "sort",
|
|
3072
|
-
toEl:
|
|
3114
|
+
toEl: G,
|
|
3073
3115
|
originalEvent: e
|
|
3074
|
-
})) : (
|
|
3075
|
-
rootEl:
|
|
3116
|
+
})) : (Y >= 0 && (U({
|
|
3117
|
+
rootEl: G,
|
|
3076
3118
|
name: "add",
|
|
3077
|
-
toEl:
|
|
3078
|
-
fromEl:
|
|
3119
|
+
toEl: G,
|
|
3120
|
+
fromEl: q,
|
|
3079
3121
|
originalEvent: e
|
|
3080
|
-
}),
|
|
3122
|
+
}), U({
|
|
3081
3123
|
sortable: this,
|
|
3082
3124
|
name: "remove",
|
|
3083
|
-
toEl:
|
|
3125
|
+
toEl: G,
|
|
3084
3126
|
originalEvent: e
|
|
3085
|
-
}),
|
|
3086
|
-
rootEl:
|
|
3127
|
+
}), U({
|
|
3128
|
+
rootEl: G,
|
|
3087
3129
|
name: "sort",
|
|
3088
|
-
toEl:
|
|
3089
|
-
fromEl:
|
|
3130
|
+
toEl: G,
|
|
3131
|
+
fromEl: q,
|
|
3090
3132
|
originalEvent: e
|
|
3091
|
-
}),
|
|
3133
|
+
}), U({
|
|
3092
3134
|
sortable: this,
|
|
3093
3135
|
name: "sort",
|
|
3094
|
-
toEl:
|
|
3136
|
+
toEl: G,
|
|
3095
3137
|
originalEvent: e
|
|
3096
|
-
})), X && X.save()), Q.active && ((
|
|
3138
|
+
})), X && X.save()), Q.active && ((Y == null || Y === -1) && (Y = ja, Na = Ma), U({
|
|
3097
3139
|
sortable: this,
|
|
3098
3140
|
name: "end",
|
|
3099
|
-
toEl:
|
|
3141
|
+
toEl: G,
|
|
3100
3142
|
originalEvent: e
|
|
3101
3143
|
}), this.save()))), this._nulling();
|
|
3102
3144
|
},
|
|
3103
3145
|
_nulling: function() {
|
|
3104
|
-
|
|
3146
|
+
H("nulling", this), q = W = G = K = Oa = J = ka = Aa = Ra = za = Wa = Y = Na = ja = Ma = Ga = Ka = X = Pa = Q.dragged = Q.ghost = Q.clone = Q.active = null, Qa.forEach(function(e) {
|
|
3105
3147
|
e.checked = !0;
|
|
3106
|
-
}),
|
|
3148
|
+
}), Qa.length = Ba = Va = 0;
|
|
3107
3149
|
},
|
|
3108
3150
|
handleEvent: function(e) {
|
|
3109
3151
|
switch (e.type) {
|
|
@@ -3113,7 +3155,7 @@ Q.prototype = {
|
|
|
3113
3155
|
break;
|
|
3114
3156
|
case "dragenter":
|
|
3115
3157
|
case "dragover":
|
|
3116
|
-
|
|
3158
|
+
W && (this._onDragOver(e), po(e));
|
|
3117
3159
|
break;
|
|
3118
3160
|
case "selectstart":
|
|
3119
3161
|
e.preventDefault();
|
|
@@ -3121,14 +3163,14 @@ Q.prototype = {
|
|
|
3121
3163
|
}
|
|
3122
3164
|
},
|
|
3123
3165
|
toArray: function() {
|
|
3124
|
-
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r],
|
|
3166
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], ea(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || xo(t));
|
|
3125
3167
|
return e;
|
|
3126
3168
|
},
|
|
3127
3169
|
sort: function(e, t) {
|
|
3128
3170
|
var n = {}, r = this.el;
|
|
3129
3171
|
this.toArray().forEach(function(e, t) {
|
|
3130
3172
|
var i = r.children[t];
|
|
3131
|
-
|
|
3173
|
+
ea(i, this.options.draggable, r, !1) && (n[e] = i);
|
|
3132
3174
|
}, this), t && this.captureAnimationState(), e.forEach(function(e) {
|
|
3133
3175
|
n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
|
|
3134
3176
|
}), t && this.animateAll();
|
|
@@ -3138,25 +3180,25 @@ Q.prototype = {
|
|
|
3138
3180
|
e && e.set && e.set(this);
|
|
3139
3181
|
},
|
|
3140
3182
|
closest: function(e, t) {
|
|
3141
|
-
return
|
|
3183
|
+
return ea(e, t || this.options.draggable, this.el, !1);
|
|
3142
3184
|
},
|
|
3143
3185
|
option: function(e, t) {
|
|
3144
3186
|
var n = this.options;
|
|
3145
3187
|
if (t === void 0) return n[e];
|
|
3146
|
-
var r =
|
|
3147
|
-
r === void 0 ? n[e] = t : n[e] = r, e === "group" &&
|
|
3188
|
+
var r = Ta.modifyOption(this, e, t);
|
|
3189
|
+
r === void 0 ? n[e] = t : n[e] = r, e === "group" && so(n);
|
|
3148
3190
|
},
|
|
3149
3191
|
destroy: function() {
|
|
3150
|
-
|
|
3192
|
+
H("destroy", this);
|
|
3151
3193
|
var e = this.el;
|
|
3152
|
-
e[
|
|
3194
|
+
e[V] = null, L(e, "mousedown", this._onTapStart), L(e, "touchstart", this._onTapStart), L(e, "pointerdown", this._onTapStart), this.nativeDraggable && (L(e, "dragover", this), L(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
3153
3195
|
e.removeAttribute("draggable");
|
|
3154
|
-
}), this._onDrop(), this._disableDelayedDragEvents(),
|
|
3196
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), La.splice(La.indexOf(this.el), 1), this.el = e = null;
|
|
3155
3197
|
},
|
|
3156
3198
|
_hideClone: function() {
|
|
3157
|
-
if (!
|
|
3158
|
-
if (
|
|
3159
|
-
|
|
3199
|
+
if (!Aa) {
|
|
3200
|
+
if (H("hideClone", this), Q.eventCanceled) return;
|
|
3201
|
+
z(J, "display", "none"), this.options.removeCloneOnHide && J.parentNode && J.parentNode.removeChild(J), Aa = !0;
|
|
3160
3202
|
}
|
|
3161
3203
|
},
|
|
3162
3204
|
_showClone: function(e) {
|
|
@@ -3164,99 +3206,99 @@ Q.prototype = {
|
|
|
3164
3206
|
this._hideClone();
|
|
3165
3207
|
return;
|
|
3166
3208
|
}
|
|
3167
|
-
if (
|
|
3168
|
-
if (
|
|
3169
|
-
|
|
3209
|
+
if (Aa) {
|
|
3210
|
+
if (H("showClone", this), Q.eventCanceled) return;
|
|
3211
|
+
W.parentNode == q && !this.options.group.revertClone ? q.insertBefore(J, W) : Oa ? q.insertBefore(J, Oa) : q.appendChild(J), this.options.group.revertClone && this.animate(W, J), z(J, "display", ""), Aa = !1;
|
|
3170
3212
|
}
|
|
3171
3213
|
}
|
|
3172
3214
|
};
|
|
3173
|
-
function
|
|
3215
|
+
function po(e) {
|
|
3174
3216
|
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
3175
3217
|
}
|
|
3176
|
-
function
|
|
3177
|
-
var c, l = e[
|
|
3178
|
-
return window.CustomEvent && !
|
|
3218
|
+
function mo(e, t, n, r, i, a, o, s) {
|
|
3219
|
+
var c, l = e[V], u = l.options.onMove, d;
|
|
3220
|
+
return window.CustomEvent && !Gi && !Ki ? c = new CustomEvent("move", {
|
|
3179
3221
|
bubbles: !0,
|
|
3180
3222
|
cancelable: !0
|
|
3181
|
-
}) : (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 ||
|
|
3223
|
+
}) : (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 || B(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
3182
3224
|
}
|
|
3183
|
-
function
|
|
3225
|
+
function ho(e) {
|
|
3184
3226
|
e.draggable = !1;
|
|
3185
3227
|
}
|
|
3186
|
-
function
|
|
3187
|
-
|
|
3228
|
+
function go() {
|
|
3229
|
+
Za = !1;
|
|
3188
3230
|
}
|
|
3189
|
-
function
|
|
3190
|
-
var r =
|
|
3231
|
+
function _o(e, t, n) {
|
|
3232
|
+
var r = B(oa(n.el, 0, n.options, !0)), i = ya(n.el, n.options, K), a = 10;
|
|
3191
3233
|
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;
|
|
3192
3234
|
}
|
|
3193
|
-
function
|
|
3194
|
-
var r =
|
|
3235
|
+
function vo(e, t, n) {
|
|
3236
|
+
var r = B(sa(n.el, n.options.draggable)), i = ya(n.el, n.options, K), a = 10;
|
|
3195
3237
|
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;
|
|
3196
3238
|
}
|
|
3197
|
-
function
|
|
3239
|
+
function yo(e, t, n, r, i, a, o, s) {
|
|
3198
3240
|
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;
|
|
3199
3241
|
if (!o) {
|
|
3200
|
-
if (s &&
|
|
3201
|
-
if (!
|
|
3202
|
-
else if (
|
|
3203
|
-
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return
|
|
3242
|
+
if (s && Ya < l * i) {
|
|
3243
|
+
if (!qa && (Ka === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (qa = !0), qa) f = !0;
|
|
3244
|
+
else if (Ka === 1 ? c < u + Ya : c > d - Ya) return -Ka;
|
|
3245
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return bo(t);
|
|
3204
3246
|
}
|
|
3205
3247
|
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
3206
3248
|
}
|
|
3207
|
-
function
|
|
3208
|
-
return
|
|
3249
|
+
function bo(e) {
|
|
3250
|
+
return ca(W) < ca(e) ? 1 : -1;
|
|
3209
3251
|
}
|
|
3210
|
-
function
|
|
3252
|
+
function xo(e) {
|
|
3211
3253
|
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
3212
3254
|
return r.toString(36);
|
|
3213
3255
|
}
|
|
3214
|
-
function
|
|
3215
|
-
|
|
3256
|
+
function So(e) {
|
|
3257
|
+
Qa.length = 0;
|
|
3216
3258
|
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
3217
3259
|
var r = t[n];
|
|
3218
|
-
r.checked &&
|
|
3260
|
+
r.checked && Qa.push(r);
|
|
3219
3261
|
}
|
|
3220
3262
|
}
|
|
3221
|
-
function
|
|
3263
|
+
function Co(e) {
|
|
3222
3264
|
return setTimeout(e, 0);
|
|
3223
3265
|
}
|
|
3224
|
-
function
|
|
3266
|
+
function wo(e) {
|
|
3225
3267
|
return clearTimeout(e);
|
|
3226
3268
|
}
|
|
3227
|
-
|
|
3228
|
-
(Q.active ||
|
|
3269
|
+
$a && I(document, "touchmove", function(e) {
|
|
3270
|
+
(Q.active || Fa) && e.cancelable && e.preventDefault();
|
|
3229
3271
|
}), Q.utils = {
|
|
3230
|
-
on:
|
|
3231
|
-
off:
|
|
3232
|
-
css:
|
|
3233
|
-
find:
|
|
3272
|
+
on: I,
|
|
3273
|
+
off: L,
|
|
3274
|
+
css: z,
|
|
3275
|
+
find: ra,
|
|
3234
3276
|
is: function(e, t) {
|
|
3235
|
-
return !!
|
|
3277
|
+
return !!ea(e, t, e, !1);
|
|
3236
3278
|
},
|
|
3237
|
-
extend:
|
|
3238
|
-
throttle:
|
|
3239
|
-
closest:
|
|
3240
|
-
toggleClass:
|
|
3241
|
-
clone:
|
|
3242
|
-
index:
|
|
3243
|
-
nextTick:
|
|
3244
|
-
cancelNextTick:
|
|
3245
|
-
detectDirection:
|
|
3246
|
-
getChild:
|
|
3279
|
+
extend: fa,
|
|
3280
|
+
throttle: ha,
|
|
3281
|
+
closest: ea,
|
|
3282
|
+
toggleClass: R,
|
|
3283
|
+
clone: va,
|
|
3284
|
+
index: ca,
|
|
3285
|
+
nextTick: Co,
|
|
3286
|
+
cancelNextTick: wo,
|
|
3287
|
+
detectDirection: io,
|
|
3288
|
+
getChild: oa
|
|
3247
3289
|
}, Q.get = function(e) {
|
|
3248
|
-
return e[
|
|
3290
|
+
return e[V];
|
|
3249
3291
|
}, Q.mount = function() {
|
|
3250
3292
|
var e = [...arguments];
|
|
3251
3293
|
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
3252
3294
|
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
3253
|
-
e.utils && (Q.utils =
|
|
3295
|
+
e.utils && (Q.utils = Li(Li({}, Q.utils), e.utils)), Ta.mount(e);
|
|
3254
3296
|
});
|
|
3255
3297
|
}, Q.create = function(e, t) {
|
|
3256
3298
|
return new Q(e, t);
|
|
3257
|
-
}, Q.version =
|
|
3258
|
-
var $ = [],
|
|
3259
|
-
function
|
|
3299
|
+
}, Q.version = Ui;
|
|
3300
|
+
var $ = [], To, Eo, Do = !1, Oo, ko, Ao, jo;
|
|
3301
|
+
function Mo() {
|
|
3260
3302
|
function e() {
|
|
3261
3303
|
for (var e in this.defaults = {
|
|
3262
3304
|
scroll: !0,
|
|
@@ -3269,70 +3311,70 @@ function Oo() {
|
|
|
3269
3311
|
return e.prototype = {
|
|
3270
3312
|
dragStarted: function(e) {
|
|
3271
3313
|
var t = e.originalEvent;
|
|
3272
|
-
this.sortable.nativeDraggable ?
|
|
3314
|
+
this.sortable.nativeDraggable ? I(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? I(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? I(document, "touchmove", this._handleFallbackAutoScroll) : I(document, "mousemove", this._handleFallbackAutoScroll);
|
|
3273
3315
|
},
|
|
3274
3316
|
dragOverCompleted: function(e) {
|
|
3275
3317
|
var t = e.originalEvent;
|
|
3276
3318
|
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
3277
3319
|
},
|
|
3278
3320
|
drop: function() {
|
|
3279
|
-
this.sortable.nativeDraggable ?
|
|
3321
|
+
this.sortable.nativeDraggable ? L(document, "dragover", this._handleAutoScroll) : (L(document, "pointermove", this._handleFallbackAutoScroll), L(document, "touchmove", this._handleFallbackAutoScroll), L(document, "mousemove", this._handleFallbackAutoScroll)), Po(), No(), ga();
|
|
3280
3322
|
},
|
|
3281
3323
|
nulling: function() {
|
|
3282
|
-
|
|
3324
|
+
Ao = Eo = To = Do = jo = Oo = ko = null, $.length = 0;
|
|
3283
3325
|
},
|
|
3284
3326
|
_handleFallbackAutoScroll: function(e) {
|
|
3285
3327
|
this._handleAutoScroll(e, !0);
|
|
3286
3328
|
},
|
|
3287
3329
|
_handleAutoScroll: function(e, t) {
|
|
3288
3330
|
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
3289
|
-
if (
|
|
3290
|
-
|
|
3291
|
-
var o =
|
|
3292
|
-
|
|
3293
|
-
var a =
|
|
3294
|
-
a !== o && (o = a,
|
|
3295
|
-
}, 10),
|
|
3331
|
+
if (Ao = e, t || this.options.forceAutoScrollFallback || Ki || Gi || Ji) {
|
|
3332
|
+
Fo(e, this.options, a, t);
|
|
3333
|
+
var o = da(a, !0);
|
|
3334
|
+
Do && (!jo || r !== Oo || i !== ko) && (jo && Po(), jo = setInterval(function() {
|
|
3335
|
+
var a = da(document.elementFromPoint(r, i), !0);
|
|
3336
|
+
a !== o && (o = a, No()), Fo(e, n.options, a, t);
|
|
3337
|
+
}, 10), Oo = r, ko = i);
|
|
3296
3338
|
} else {
|
|
3297
|
-
if (!this.options.bubbleScroll ||
|
|
3298
|
-
|
|
3339
|
+
if (!this.options.bubbleScroll || da(a, !0) === ia()) {
|
|
3340
|
+
No();
|
|
3299
3341
|
return;
|
|
3300
3342
|
}
|
|
3301
|
-
|
|
3343
|
+
Fo(e, this.options, da(a, !1), !1);
|
|
3302
3344
|
}
|
|
3303
3345
|
}
|
|
3304
|
-
},
|
|
3346
|
+
}, Bi(e, {
|
|
3305
3347
|
pluginName: "scroll",
|
|
3306
3348
|
initializeByDefault: !0
|
|
3307
3349
|
});
|
|
3308
3350
|
}
|
|
3309
|
-
function
|
|
3351
|
+
function No() {
|
|
3310
3352
|
$.forEach(function(e) {
|
|
3311
3353
|
clearInterval(e.pid);
|
|
3312
3354
|
}), $ = [];
|
|
3313
3355
|
}
|
|
3314
|
-
function
|
|
3315
|
-
clearInterval(
|
|
3356
|
+
function Po() {
|
|
3357
|
+
clearInterval(jo);
|
|
3316
3358
|
}
|
|
3317
|
-
var
|
|
3359
|
+
var Fo = ha(function(e, t, n, r) {
|
|
3318
3360
|
if (t.scroll) {
|
|
3319
|
-
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c =
|
|
3320
|
-
|
|
3321
|
-
var d = 0, f =
|
|
3361
|
+
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = ia(), l = !1, u;
|
|
3362
|
+
Eo !== n && (Eo = n, No(), To = t.scroll, u = t.scrollFn, To === !0 && (To = da(n, !0)));
|
|
3363
|
+
var d = 0, f = To;
|
|
3322
3364
|
do {
|
|
3323
|
-
var p = f, m =
|
|
3365
|
+
var p = f, m = B(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 = z(p), E = p.scrollLeft, D = p.scrollTop;
|
|
3324
3366
|
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"));
|
|
3325
|
-
var
|
|
3326
|
-
if (!$[d]) for (var
|
|
3327
|
-
($[d].vx !=
|
|
3328
|
-
r && this.layer === 0 && Q.active._onTouchMove(
|
|
3367
|
+
var O = x && (Math.abs(v - i) <= o && E + y < C) - (Math.abs(_ - i) <= o && !!E), k = S && (Math.abs(g - a) <= o && D + b < w) - (Math.abs(h - a) <= o && !!D);
|
|
3368
|
+
if (!$[d]) for (var ee = 0; ee <= d; ee++) $[ee] || ($[ee] = {});
|
|
3369
|
+
($[d].vx != O || $[d].vy != k || $[d].el !== p) && ($[d].el = p, $[d].vx = O, $[d].vy = k, clearInterval($[d].pid), (O != 0 || k != 0) && (l = !0, $[d].pid = setInterval(function() {
|
|
3370
|
+
r && this.layer === 0 && Q.active._onTouchMove(Ao);
|
|
3329
3371
|
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
3330
|
-
typeof u == "function" && u.call(Q.dragged.parentNode[
|
|
3372
|
+
typeof u == "function" && u.call(Q.dragged.parentNode[V], n, t, e, Ao, $[this.layer].el) !== "continue" || _a($[this.layer].el, n, t);
|
|
3331
3373
|
}.bind({ layer: d }), 24))), d++;
|
|
3332
|
-
} while (t.bubbleScroll && f !== c && (f =
|
|
3333
|
-
|
|
3374
|
+
} while (t.bubbleScroll && f !== c && (f = da(f, !1)));
|
|
3375
|
+
Do = l;
|
|
3334
3376
|
}
|
|
3335
|
-
}, 30),
|
|
3377
|
+
}, 30), Io = function(e) {
|
|
3336
3378
|
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
3337
3379
|
if (t) {
|
|
3338
3380
|
var c = n || i;
|
|
@@ -3344,8 +3386,8 @@ var jo = ua(function(e, t, n, r) {
|
|
|
3344
3386
|
}));
|
|
3345
3387
|
}
|
|
3346
3388
|
};
|
|
3347
|
-
function
|
|
3348
|
-
|
|
3389
|
+
function Lo() {}
|
|
3390
|
+
Lo.prototype = {
|
|
3349
3391
|
startIndex: null,
|
|
3350
3392
|
dragStart: function(e) {
|
|
3351
3393
|
var t = e.oldDraggableIndex;
|
|
@@ -3354,149 +3396,149 @@ No.prototype = {
|
|
|
3354
3396
|
onSpill: function(e) {
|
|
3355
3397
|
var t = e.dragEl, n = e.putSortable;
|
|
3356
3398
|
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
3357
|
-
var r =
|
|
3399
|
+
var r = oa(this.sortable.el, this.startIndex, this.options);
|
|
3358
3400
|
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
3359
3401
|
},
|
|
3360
|
-
drop:
|
|
3361
|
-
},
|
|
3362
|
-
function
|
|
3363
|
-
|
|
3402
|
+
drop: Io
|
|
3403
|
+
}, Bi(Lo, { pluginName: "revertOnSpill" });
|
|
3404
|
+
function Ro() {}
|
|
3405
|
+
Ro.prototype = {
|
|
3364
3406
|
onSpill: function(e) {
|
|
3365
3407
|
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
3366
3408
|
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
3367
3409
|
},
|
|
3368
|
-
drop:
|
|
3369
|
-
},
|
|
3370
|
-
function
|
|
3410
|
+
drop: Io
|
|
3411
|
+
}, Bi(Ro, { pluginName: "removeOnSpill" }), Q.mount(new Mo()), Q.mount(Ro, Lo);
|
|
3412
|
+
function zo(e) {
|
|
3371
3413
|
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
3372
3414
|
}
|
|
3373
|
-
function
|
|
3374
|
-
|
|
3415
|
+
function Bo(e) {
|
|
3416
|
+
re() && r(e);
|
|
3375
3417
|
}
|
|
3376
|
-
function
|
|
3377
|
-
|
|
3418
|
+
function Vo(e) {
|
|
3419
|
+
re() ? a(e) : ie(e);
|
|
3378
3420
|
}
|
|
3379
|
-
var
|
|
3380
|
-
function
|
|
3381
|
-
|
|
3421
|
+
var Ho = null, Uo = null;
|
|
3422
|
+
function Wo(e = null, t = null) {
|
|
3423
|
+
Ho = e, Uo = t;
|
|
3382
3424
|
}
|
|
3383
|
-
function
|
|
3425
|
+
function Go() {
|
|
3384
3426
|
return {
|
|
3385
|
-
data:
|
|
3386
|
-
clonedData:
|
|
3427
|
+
data: Ho,
|
|
3428
|
+
clonedData: Uo
|
|
3387
3429
|
};
|
|
3388
3430
|
}
|
|
3389
|
-
var
|
|
3390
|
-
function
|
|
3391
|
-
let t =
|
|
3392
|
-
Array.isArray(
|
|
3393
|
-
let
|
|
3394
|
-
function
|
|
3395
|
-
let { from: t, oldIndex: r, item:
|
|
3396
|
-
n =
|
|
3397
|
-
let s =
|
|
3398
|
-
|
|
3431
|
+
var Ko = Symbol("cloneElement");
|
|
3432
|
+
function qo(...e) {
|
|
3433
|
+
let t = re()?.proxy, n = null, r = e[0], [, i, a] = e;
|
|
3434
|
+
Array.isArray(k(i)) || (a = i, i = null);
|
|
3435
|
+
let o = null, { immediate: s = !0, clone: l = zo, forceFallback: u, fallbackOnBody: d, customUpdate: f } = k(a) ?? {};
|
|
3436
|
+
function p(e) {
|
|
3437
|
+
let { from: t, oldIndex: r, item: a } = e, o = Array.from(t.childNodes);
|
|
3438
|
+
n = u && !d ? o.slice(0, -1) : o;
|
|
3439
|
+
let s = k(k(i)?.[r]), c = l(s);
|
|
3440
|
+
Wo(s, c), a[Ko] = c;
|
|
3399
3441
|
}
|
|
3400
|
-
function
|
|
3401
|
-
let t = e.item[
|
|
3402
|
-
if (!
|
|
3403
|
-
if (
|
|
3404
|
-
let n = [...
|
|
3405
|
-
|
|
3442
|
+
function m(e) {
|
|
3443
|
+
let t = e.item[Ko];
|
|
3444
|
+
if (!Ti(t)) {
|
|
3445
|
+
if (Oi(e.item), g(i)) {
|
|
3446
|
+
let n = [...k(i)];
|
|
3447
|
+
i.value = wi(n, e.newDraggableIndex, t);
|
|
3406
3448
|
return;
|
|
3407
3449
|
}
|
|
3408
|
-
|
|
3450
|
+
wi(k(i), e.newDraggableIndex, t);
|
|
3409
3451
|
}
|
|
3410
3452
|
}
|
|
3411
|
-
function
|
|
3412
|
-
let { from: t, item: n, oldIndex: r, oldDraggableIndex:
|
|
3413
|
-
if (
|
|
3414
|
-
|
|
3453
|
+
function h(e) {
|
|
3454
|
+
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, pullMode: o, clone: s } = e;
|
|
3455
|
+
if (Di(t, n, r), o === "clone") {
|
|
3456
|
+
Oi(s);
|
|
3415
3457
|
return;
|
|
3416
3458
|
}
|
|
3417
|
-
if (
|
|
3418
|
-
let e = [...
|
|
3419
|
-
|
|
3459
|
+
if (g(i)) {
|
|
3460
|
+
let e = [...k(i)];
|
|
3461
|
+
i.value = Ci(e, a);
|
|
3420
3462
|
return;
|
|
3421
3463
|
}
|
|
3422
|
-
|
|
3464
|
+
Ci(k(i), a);
|
|
3423
3465
|
}
|
|
3424
|
-
function
|
|
3425
|
-
if (
|
|
3426
|
-
|
|
3466
|
+
function _(e) {
|
|
3467
|
+
if (f) {
|
|
3468
|
+
f(e);
|
|
3427
3469
|
return;
|
|
3428
3470
|
}
|
|
3429
|
-
let { from: t, item: n, oldIndex: r, oldDraggableIndex:
|
|
3430
|
-
if (
|
|
3431
|
-
let e = [...
|
|
3432
|
-
|
|
3471
|
+
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, newDraggableIndex: o } = e;
|
|
3472
|
+
if (Oi(n), Di(t, n, r), g(i)) {
|
|
3473
|
+
let e = [...k(i)];
|
|
3474
|
+
i.value = bi(e, a, o);
|
|
3433
3475
|
return;
|
|
3434
3476
|
}
|
|
3435
|
-
|
|
3477
|
+
bi(k(i), a, o);
|
|
3436
3478
|
}
|
|
3437
|
-
function
|
|
3438
|
-
let { newIndex: t, oldIndex:
|
|
3479
|
+
function v(e) {
|
|
3480
|
+
let { newIndex: t, oldIndex: r, from: i, to: a } = e, o = null, s = t === r && i === a;
|
|
3439
3481
|
try {
|
|
3440
|
-
if (
|
|
3482
|
+
if (s) {
|
|
3441
3483
|
let e = null;
|
|
3442
3484
|
n?.some((t, r) => {
|
|
3443
|
-
if (e && n?.length !==
|
|
3444
|
-
let
|
|
3445
|
-
e =
|
|
3485
|
+
if (e && n?.length !== a.childNodes.length) return i.insertBefore(e, t.nextSibling), !0;
|
|
3486
|
+
let o = a.childNodes[r];
|
|
3487
|
+
e = a?.replaceChild(t, o);
|
|
3446
3488
|
});
|
|
3447
3489
|
}
|
|
3448
3490
|
} catch (e) {
|
|
3449
|
-
|
|
3491
|
+
o = e;
|
|
3450
3492
|
} finally {
|
|
3451
3493
|
n = null;
|
|
3452
3494
|
}
|
|
3453
|
-
|
|
3454
|
-
if (
|
|
3495
|
+
ie(() => {
|
|
3496
|
+
if (Wo(), o) throw o;
|
|
3455
3497
|
});
|
|
3456
3498
|
}
|
|
3457
|
-
let
|
|
3458
|
-
onUpdate:
|
|
3459
|
-
onStart:
|
|
3460
|
-
onAdd:
|
|
3461
|
-
onRemove:
|
|
3462
|
-
onEnd:
|
|
3499
|
+
let y = {
|
|
3500
|
+
onUpdate: _,
|
|
3501
|
+
onStart: p,
|
|
3502
|
+
onAdd: m,
|
|
3503
|
+
onRemove: h,
|
|
3504
|
+
onEnd: v
|
|
3463
3505
|
};
|
|
3464
|
-
function
|
|
3465
|
-
let n =
|
|
3466
|
-
return e ||=
|
|
3506
|
+
function b(e) {
|
|
3507
|
+
let n = k(r);
|
|
3508
|
+
return e ||= Ei(n) ? ki(n, t?.$el) : n, e && !Mi(e) && (e = e.$el), e || yi("Root element not found"), e;
|
|
3467
3509
|
}
|
|
3468
|
-
function
|
|
3469
|
-
let e =
|
|
3470
|
-
return
|
|
3471
|
-
|
|
3472
|
-
}),
|
|
3510
|
+
function x() {
|
|
3511
|
+
let e = k(a) ?? {}, { immediate: t, clone: n } = e, r = gi(e, ["immediate", "clone"]);
|
|
3512
|
+
return Ni(r, (e, t) => {
|
|
3513
|
+
Pi(e) && (r[e] = (e, ...n) => (Fi(e, Go()), t(e, ...n)));
|
|
3514
|
+
}), ji(i === null ? {} : y, r);
|
|
3473
3515
|
}
|
|
3474
|
-
let
|
|
3475
|
-
e =
|
|
3516
|
+
let S = (e) => {
|
|
3517
|
+
e = b(e), o && C.destroy(), o = new Q(e, x());
|
|
3476
3518
|
};
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3519
|
+
c(() => a, () => {
|
|
3520
|
+
o && Ni(x(), (e, t) => {
|
|
3521
|
+
o?.option(e, t);
|
|
3480
3522
|
});
|
|
3481
3523
|
}, { deep: !0 });
|
|
3482
|
-
let
|
|
3483
|
-
option: (e, t) =>
|
|
3524
|
+
let C = {
|
|
3525
|
+
option: (e, t) => o?.option(e, t),
|
|
3484
3526
|
destroy: () => {
|
|
3485
|
-
|
|
3527
|
+
o?.destroy(), o = null;
|
|
3486
3528
|
},
|
|
3487
|
-
save: () =>
|
|
3488
|
-
toArray: () =>
|
|
3489
|
-
closest: (...e) =>
|
|
3529
|
+
save: () => o?.save(),
|
|
3530
|
+
toArray: () => o?.toArray(),
|
|
3531
|
+
closest: (...e) => o?.closest(...e)
|
|
3490
3532
|
};
|
|
3491
|
-
return
|
|
3492
|
-
|
|
3493
|
-
}),
|
|
3494
|
-
start:
|
|
3495
|
-
pause: () =>
|
|
3496
|
-
resume: () =>
|
|
3497
|
-
},
|
|
3498
|
-
}
|
|
3499
|
-
var
|
|
3533
|
+
return Vo(() => {
|
|
3534
|
+
s && S();
|
|
3535
|
+
}), Bo(C.destroy), hi({
|
|
3536
|
+
start: S,
|
|
3537
|
+
pause: () => C?.option("disabled", !0),
|
|
3538
|
+
resume: () => C?.option("disabled", !1)
|
|
3539
|
+
}, C);
|
|
3540
|
+
}
|
|
3541
|
+
var Jo = [
|
|
3500
3542
|
"update",
|
|
3501
3543
|
"start",
|
|
3502
3544
|
"add",
|
|
@@ -3509,7 +3551,7 @@ var Wo = [
|
|
|
3509
3551
|
"clone",
|
|
3510
3552
|
"move",
|
|
3511
3553
|
"change"
|
|
3512
|
-
],
|
|
3554
|
+
], Yo = y({
|
|
3513
3555
|
name: "VueDraggable",
|
|
3514
3556
|
model: {
|
|
3515
3557
|
prop: "modelValue",
|
|
@@ -3559,52 +3601,52 @@ var Wo = [
|
|
|
3559
3601
|
"tag",
|
|
3560
3602
|
"target",
|
|
3561
3603
|
"customUpdate",
|
|
3562
|
-
...
|
|
3604
|
+
...Jo.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
|
|
3563
3605
|
],
|
|
3564
|
-
emits: ["update:modelValue", ...
|
|
3565
|
-
setup(
|
|
3566
|
-
let
|
|
3567
|
-
let
|
|
3568
|
-
return e[
|
|
3569
|
-
}, {}), s =
|
|
3570
|
-
let
|
|
3571
|
-
let r =
|
|
3606
|
+
emits: ["update:modelValue", ...Jo],
|
|
3607
|
+
setup(t, { slots: n, emit: r, expose: i, attrs: a }) {
|
|
3608
|
+
let o = Jo.reduce((e, t) => {
|
|
3609
|
+
let n = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
3610
|
+
return e[n] = (...e) => r(t, ...e), e;
|
|
3611
|
+
}, {}), s = j(() => {
|
|
3612
|
+
let n = e(t), { modelValue: r } = n, i = gi(n, ["modelValue"]), s = Object.entries(i).reduce((e, [t, n]) => {
|
|
3613
|
+
let r = k(n);
|
|
3572
3614
|
return r !== void 0 && (e[t] = r), e;
|
|
3573
3615
|
}, {});
|
|
3574
|
-
return
|
|
3575
|
-
}), c =
|
|
3576
|
-
get: () =>
|
|
3577
|
-
set: (e) =>
|
|
3578
|
-
}), l =
|
|
3579
|
-
return
|
|
3580
|
-
}
|
|
3581
|
-
}),
|
|
3616
|
+
return hi(hi({}, o), Si(hi(hi({}, a), s)));
|
|
3617
|
+
}), c = j({
|
|
3618
|
+
get: () => t.modelValue,
|
|
3619
|
+
set: (e) => r("update:modelValue", e)
|
|
3620
|
+
}), l = _(), u = ee(qo(t.target || l, c, s));
|
|
3621
|
+
return i(u), () => ae(t.tag || "div", { ref: l }, (n?.default)?.call(n, u));
|
|
3622
|
+
}
|
|
3623
|
+
}), Xo = {
|
|
3582
3624
|
mounted: "mounted",
|
|
3583
3625
|
unmounted: "unmounted"
|
|
3584
3626
|
};
|
|
3585
|
-
|
|
3627
|
+
Xo.mounted, Xo.unmounted;
|
|
3586
3628
|
//#endregion
|
|
3587
3629
|
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3588
|
-
var
|
|
3630
|
+
var Zo = { class: "tpl:w-full" }, Qo = { class: "tpl:flex tpl:gap-0" }, $o = {
|
|
3589
3631
|
key: 0,
|
|
3590
3632
|
"data-testid": "section-drop-hint",
|
|
3591
3633
|
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)]"
|
|
3592
|
-
},
|
|
3634
|
+
}, es = /* @__PURE__ */ y({
|
|
3593
3635
|
__name: "SectionBlock",
|
|
3594
3636
|
props: {
|
|
3595
3637
|
block: {},
|
|
3596
3638
|
viewport: {}
|
|
3597
3639
|
},
|
|
3598
|
-
setup(
|
|
3599
|
-
let
|
|
3600
|
-
title:
|
|
3601
|
-
paragraph:
|
|
3602
|
-
image:
|
|
3603
|
-
button:
|
|
3604
|
-
divider:
|
|
3605
|
-
custom:
|
|
3606
|
-
},
|
|
3607
|
-
switch (
|
|
3640
|
+
setup(e) {
|
|
3641
|
+
let n = {
|
|
3642
|
+
title: ci,
|
|
3643
|
+
paragraph: Wr,
|
|
3644
|
+
image: jr,
|
|
3645
|
+
button: Sn,
|
|
3646
|
+
divider: fr,
|
|
3647
|
+
custom: ur
|
|
3648
|
+
}, r = e, { t: a } = Tt(), s = et(ht, "SectionBlock"), c = N(bt, null), l = N(_t, null), u = j(() => {
|
|
3649
|
+
switch (r.block.columns) {
|
|
3608
3650
|
case "2": return ["50%", "50%"];
|
|
3609
3651
|
case "3": return [
|
|
3610
3652
|
"33.33%",
|
|
@@ -3615,38 +3657,38 @@ var qo = { class: "tpl:w-full" }, Jo = { class: "tpl:flex tpl:gap-0" }, Yo = {
|
|
|
3615
3657
|
case "2-1": return ["66.67%", "33.33%"];
|
|
3616
3658
|
default: return ["100%"];
|
|
3617
3659
|
}
|
|
3618
|
-
}),
|
|
3619
|
-
let e =
|
|
3660
|
+
}), h = j(() => {
|
|
3661
|
+
let e = u.value.length, t = [...r.block.children];
|
|
3620
3662
|
for (; t.length < e;) t.push([]);
|
|
3621
3663
|
return t.slice(0, e);
|
|
3622
3664
|
});
|
|
3623
|
-
function
|
|
3624
|
-
return
|
|
3665
|
+
function g(e) {
|
|
3666
|
+
return h.value[e] || [];
|
|
3625
3667
|
}
|
|
3626
|
-
function
|
|
3627
|
-
let n = t.map((e) => JSON.parse(JSON.stringify(e))),
|
|
3628
|
-
for (;
|
|
3629
|
-
|
|
3668
|
+
function _(e, t) {
|
|
3669
|
+
let n = t.map((e) => JSON.parse(JSON.stringify(e))), i = [...r.block.children];
|
|
3670
|
+
for (; i.length <= e;) i.push([]);
|
|
3671
|
+
i[e] = n, s.updateBlock(r.block.id, { children: i });
|
|
3630
3672
|
}
|
|
3631
|
-
function
|
|
3632
|
-
return
|
|
3673
|
+
function v(e) {
|
|
3674
|
+
return Gr(e, l, n);
|
|
3633
3675
|
}
|
|
3634
|
-
function
|
|
3676
|
+
function y(e, t) {
|
|
3635
3677
|
e.type === "custom" && s.updateBlock(e.id, {
|
|
3636
3678
|
fieldValues: t.fieldValues,
|
|
3637
3679
|
dataSourceFetched: t.dataSourceFetched
|
|
3638
3680
|
});
|
|
3639
3681
|
}
|
|
3640
|
-
return (
|
|
3641
|
-
key:
|
|
3642
|
-
class:
|
|
3643
|
-
style:
|
|
3644
|
-
}, [
|
|
3645
|
-
"model-value":
|
|
3682
|
+
return (n, r) => (f(), x("div", Zo, [b("div", Qo, [(f(!0), x(A, null, t(h.value, (n, r) => (f(), x("div", {
|
|
3683
|
+
key: r,
|
|
3684
|
+
class: o(["tpl:relative tpl:min-h-[60px] tpl:rounded", g(r).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
3685
|
+
style: i({ width: u.value[r] })
|
|
3686
|
+
}, [w(k(Yo), {
|
|
3687
|
+
"model-value": g(r),
|
|
3646
3688
|
group: {
|
|
3647
3689
|
name: "blocks",
|
|
3648
3690
|
pull: !0,
|
|
3649
|
-
put: (e, t, n) =>
|
|
3691
|
+
put: (e, t, n) => k(li)(n)
|
|
3650
3692
|
},
|
|
3651
3693
|
animation: 150,
|
|
3652
3694
|
"ghost-class": "tpl-ghost",
|
|
@@ -3657,20 +3699,20 @@ var qo = { class: "tpl:w-full" }, Jo = { class: "tpl:flex tpl:gap-0" }, Yo = {
|
|
|
3657
3699
|
"empty-insert-threshold": 20,
|
|
3658
3700
|
"force-fallback": !0,
|
|
3659
3701
|
class: "tpl:min-h-[60px]",
|
|
3660
|
-
"onUpdate:modelValue": (e) =>
|
|
3702
|
+
"onUpdate:modelValue": (e) => _(r, e)
|
|
3661
3703
|
}, {
|
|
3662
|
-
default:
|
|
3663
|
-
block:
|
|
3664
|
-
"is-selected":
|
|
3665
|
-
viewport:
|
|
3666
|
-
"preview-mode":
|
|
3667
|
-
onSelect: (e) =>
|
|
3704
|
+
default: m(() => [(f(!0), x(A, null, t(g(r), (t) => oe((f(), x("div", { key: t.id }, [w(oi, {
|
|
3705
|
+
block: t,
|
|
3706
|
+
"is-selected": k(s).state.selectedBlockId === t.id,
|
|
3707
|
+
viewport: e.viewport,
|
|
3708
|
+
"preview-mode": k(s).state.previewMode,
|
|
3709
|
+
onSelect: (e) => k(s).selectBlock(t.id)
|
|
3668
3710
|
}, {
|
|
3669
|
-
default:
|
|
3670
|
-
block:
|
|
3671
|
-
viewport:
|
|
3672
|
-
onFetchData: (e) =>
|
|
3673
|
-
onUpdate: (e) =>
|
|
3711
|
+
default: m(() => [(f(), D(d(v(t)), {
|
|
3712
|
+
block: t,
|
|
3713
|
+
viewport: e.viewport,
|
|
3714
|
+
onFetchData: (e) => y(t, e),
|
|
3715
|
+
onUpdate: (e) => k(s).updateBlock(t.id, e)
|
|
3674
3716
|
}, null, 40, [
|
|
3675
3717
|
"block",
|
|
3676
3718
|
"viewport",
|
|
@@ -3684,19 +3726,19 @@ var qo = { class: "tpl:w-full" }, Jo = { class: "tpl:flex tpl:gap-0" }, Yo = {
|
|
|
3684
3726
|
"viewport",
|
|
3685
3727
|
"preview-mode",
|
|
3686
3728
|
"onSelect"
|
|
3687
|
-
])])), [[
|
|
3729
|
+
])])), [[se, !k(c)?.isHidden(t.id)]])), 128))]),
|
|
3688
3730
|
_: 2
|
|
3689
3731
|
}, 1032, [
|
|
3690
3732
|
"model-value",
|
|
3691
3733
|
"group",
|
|
3692
3734
|
"onUpdate:modelValue"
|
|
3693
|
-
]),
|
|
3735
|
+
]), g(r).length === 0 ? (f(), x("div", $o, [b("span", null, p(k(a).section.dropHere), 1)])) : M("", !0)], 6))), 128))])]));
|
|
3694
3736
|
}
|
|
3695
|
-
}),
|
|
3737
|
+
}), ts = ke, ns = {
|
|
3696
3738
|
small: 24,
|
|
3697
3739
|
medium: 32,
|
|
3698
3740
|
large: 48
|
|
3699
|
-
},
|
|
3741
|
+
}, rs = [
|
|
3700
3742
|
"facebook",
|
|
3701
3743
|
"twitter",
|
|
3702
3744
|
"instagram",
|
|
@@ -3714,219 +3756,219 @@ var qo = { class: "tpl:w-full" }, Jo = { class: "tpl:flex tpl:gap-0" }, Yo = {
|
|
|
3714
3756
|
"github",
|
|
3715
3757
|
"dribbble",
|
|
3716
3758
|
"behance"
|
|
3717
|
-
],
|
|
3759
|
+
], is = [
|
|
3718
3760
|
"width",
|
|
3719
3761
|
"height",
|
|
3720
3762
|
"fill"
|
|
3721
|
-
],
|
|
3763
|
+
], as = ["d"], os = /* @__PURE__ */ y({
|
|
3722
3764
|
__name: "SocialIconSvg",
|
|
3723
3765
|
props: {
|
|
3724
3766
|
platform: {},
|
|
3725
3767
|
iconStyle: {},
|
|
3726
3768
|
iconSize: {}
|
|
3727
3769
|
},
|
|
3728
|
-
setup(
|
|
3729
|
-
let
|
|
3770
|
+
setup(e) {
|
|
3771
|
+
let t = e, n = j(() => ts[t.platform]), r = j(() => ns[t.iconSize]), a = j(() => {
|
|
3730
3772
|
let e = {
|
|
3731
3773
|
display: "inline-flex",
|
|
3732
3774
|
alignItems: "center",
|
|
3733
3775
|
justifyContent: "center",
|
|
3734
|
-
width: `${
|
|
3735
|
-
height: `${
|
|
3776
|
+
width: `${r.value}px`,
|
|
3777
|
+
height: `${r.value}px`
|
|
3736
3778
|
};
|
|
3737
|
-
switch (
|
|
3779
|
+
switch (t.iconStyle) {
|
|
3738
3780
|
case "solid": return {
|
|
3739
3781
|
...e,
|
|
3740
|
-
backgroundColor:
|
|
3782
|
+
backgroundColor: n.value.color,
|
|
3741
3783
|
borderRadius: "4px"
|
|
3742
3784
|
};
|
|
3743
3785
|
case "outlined": return {
|
|
3744
3786
|
...e,
|
|
3745
3787
|
backgroundColor: "transparent",
|
|
3746
|
-
border: `2px solid ${
|
|
3788
|
+
border: `2px solid ${n.value.color}`,
|
|
3747
3789
|
borderRadius: "4px"
|
|
3748
3790
|
};
|
|
3749
3791
|
case "rounded": return {
|
|
3750
3792
|
...e,
|
|
3751
|
-
backgroundColor:
|
|
3793
|
+
backgroundColor: n.value.color,
|
|
3752
3794
|
borderRadius: "8px"
|
|
3753
3795
|
};
|
|
3754
3796
|
case "square": return {
|
|
3755
3797
|
...e,
|
|
3756
|
-
backgroundColor:
|
|
3798
|
+
backgroundColor: n.value.color,
|
|
3757
3799
|
borderRadius: "0"
|
|
3758
3800
|
};
|
|
3759
3801
|
case "circle": return {
|
|
3760
3802
|
...e,
|
|
3761
|
-
backgroundColor:
|
|
3803
|
+
backgroundColor: n.value.color,
|
|
3762
3804
|
borderRadius: "50%"
|
|
3763
3805
|
};
|
|
3764
3806
|
default: return e;
|
|
3765
3807
|
}
|
|
3766
|
-
}), o =
|
|
3767
|
-
return (
|
|
3808
|
+
}), o = j(() => Math.floor(r.value * .6)), s = j(() => t.iconStyle === "outlined" ? n.value.color : "#ffffff");
|
|
3809
|
+
return (e, t) => (f(), x("span", { style: i(a.value) }, [(f(), x("svg", {
|
|
3768
3810
|
width: o.value,
|
|
3769
3811
|
height: o.value,
|
|
3770
3812
|
viewBox: "0 0 24 24",
|
|
3771
3813
|
fill: s.value,
|
|
3772
3814
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3773
|
-
}, [
|
|
3815
|
+
}, [b("path", { d: n.value.path }, null, 8, as)], 8, is))], 4));
|
|
3774
3816
|
}
|
|
3775
|
-
}),
|
|
3817
|
+
}), ss = { class: "tpl:w-full" }, cs = ["href"], ls = {
|
|
3776
3818
|
key: 1,
|
|
3777
3819
|
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)]"
|
|
3778
|
-
},
|
|
3820
|
+
}, us = /* @__PURE__ */ y({
|
|
3779
3821
|
__name: "SocialIconsBlock",
|
|
3780
3822
|
props: {
|
|
3781
3823
|
block: {},
|
|
3782
3824
|
viewport: {}
|
|
3783
3825
|
},
|
|
3784
|
-
setup(
|
|
3785
|
-
let n =
|
|
3826
|
+
setup(e) {
|
|
3827
|
+
let n = e, { t: r } = Tt(), a = j(() => ({
|
|
3786
3828
|
display: "flex",
|
|
3787
3829
|
flexWrap: "wrap",
|
|
3788
3830
|
gap: `${n.block.spacing}px`,
|
|
3789
3831
|
justifyContent: n.block.align === "left" ? "flex-start" : n.block.align === "right" ? "flex-end" : "center"
|
|
3790
|
-
})),
|
|
3791
|
-
return (n,
|
|
3832
|
+
})), o = j(() => n.block.icons.length > 0);
|
|
3833
|
+
return (n, s) => (f(), x("div", ss, [o.value ? (f(), x("div", {
|
|
3792
3834
|
key: 0,
|
|
3793
|
-
style:
|
|
3794
|
-
}, [(
|
|
3795
|
-
key:
|
|
3796
|
-
href:
|
|
3835
|
+
style: i(a.value)
|
|
3836
|
+
}, [(f(!0), x(A, null, t(e.block.icons, (t) => (f(), x("a", {
|
|
3837
|
+
key: t.id,
|
|
3838
|
+
href: t.url || "#",
|
|
3797
3839
|
class: "tpl:cursor-default",
|
|
3798
|
-
onClick:
|
|
3799
|
-
}, [
|
|
3800
|
-
platform:
|
|
3801
|
-
"icon-style":
|
|
3802
|
-
"icon-size":
|
|
3840
|
+
onClick: s[0] ||= P(() => {}, ["prevent"])
|
|
3841
|
+
}, [w(os, {
|
|
3842
|
+
platform: t.platform,
|
|
3843
|
+
"icon-style": e.block.iconStyle,
|
|
3844
|
+
"icon-size": e.block.iconSize
|
|
3803
3845
|
}, null, 8, [
|
|
3804
3846
|
"platform",
|
|
3805
3847
|
"icon-style",
|
|
3806
3848
|
"icon-size"
|
|
3807
|
-
])], 8,
|
|
3849
|
+
])], 8, cs))), 128))], 4)) : (f(), x("div", ls, [w(k(Nn), { size: 16 }), b("span", null, p(k(r).social.addIcons), 1)]))]));
|
|
3808
3850
|
}
|
|
3809
|
-
}),
|
|
3851
|
+
}), ds = { class: "tpl:w-full" }, fs = {
|
|
3810
3852
|
key: 0,
|
|
3811
3853
|
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3812
3854
|
style: {
|
|
3813
3855
|
"background-color": "var(--tpl-bg-hover)",
|
|
3814
3856
|
color: "var(--tpl-text-dim)"
|
|
3815
3857
|
}
|
|
3816
|
-
},
|
|
3858
|
+
}, ps = /* @__PURE__ */ y({
|
|
3817
3859
|
__name: "SpacerBlock",
|
|
3818
3860
|
props: {
|
|
3819
3861
|
block: {},
|
|
3820
3862
|
viewport: {}
|
|
3821
3863
|
},
|
|
3822
|
-
setup(
|
|
3823
|
-
let
|
|
3824
|
-
height: `${
|
|
3825
|
-
minHeight: `${
|
|
3826
|
-
...
|
|
3864
|
+
setup(e) {
|
|
3865
|
+
let t = e, n = et(ht, "SpacerBlock"), r = j(() => ({
|
|
3866
|
+
height: `${t.block.height}px`,
|
|
3867
|
+
minHeight: `${t.block.height}px`,
|
|
3868
|
+
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3827
3869
|
}));
|
|
3828
|
-
return (
|
|
3829
|
-
style:
|
|
3830
|
-
class:
|
|
3831
|
-
}, [
|
|
3870
|
+
return (t, a) => (f(), x("div", ds, [b("div", {
|
|
3871
|
+
style: i(r.value),
|
|
3872
|
+
class: o(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !k(n).state.previewMode }])
|
|
3873
|
+
}, [k(n).state.previewMode ? M("", !0) : (f(), x("span", fs, p(e.block.height) + "px ", 1))], 6)]));
|
|
3832
3874
|
}
|
|
3833
|
-
}),
|
|
3875
|
+
}), ms = { class: "tpl:w-full" }, hs = { key: 0 }, gs = [
|
|
3834
3876
|
"aria-label",
|
|
3835
3877
|
"data-placeholder",
|
|
3836
3878
|
"onBlur"
|
|
3837
|
-
],
|
|
3879
|
+
], _s = [
|
|
3838
3880
|
"aria-label",
|
|
3839
3881
|
"data-placeholder",
|
|
3840
3882
|
"onBlur"
|
|
3841
|
-
],
|
|
3883
|
+
], vs = {
|
|
3842
3884
|
key: 1,
|
|
3843
3885
|
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)]"
|
|
3844
|
-
},
|
|
3886
|
+
}, ys = /*#__PURE__*/ Mt(/* @__PURE__ */ y({
|
|
3845
3887
|
__name: "TableBlock",
|
|
3846
3888
|
props: {
|
|
3847
3889
|
block: {},
|
|
3848
3890
|
viewport: {}
|
|
3849
3891
|
},
|
|
3850
|
-
setup(
|
|
3851
|
-
let
|
|
3892
|
+
setup(e) {
|
|
3893
|
+
let n = {
|
|
3852
3894
|
mounted(e, t) {
|
|
3853
3895
|
e.textContent = t.value ?? "";
|
|
3854
3896
|
},
|
|
3855
3897
|
updated(e, t) {
|
|
3856
3898
|
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
3857
3899
|
}
|
|
3858
|
-
},
|
|
3900
|
+
}, r = e, { t: a } = Tt(), o = et(ht, "TableBlock"), s = j(() => r.block.rows.length > 0), c = j(() => ({
|
|
3859
3901
|
width: "100%",
|
|
3860
3902
|
borderCollapse: "collapse",
|
|
3861
|
-
fontSize: `${
|
|
3862
|
-
color:
|
|
3863
|
-
textAlign:
|
|
3864
|
-
fontFamily:
|
|
3865
|
-
})),
|
|
3866
|
-
border: `${
|
|
3867
|
-
padding: `${
|
|
3868
|
-
textAlign:
|
|
3869
|
-
})),
|
|
3870
|
-
...
|
|
3903
|
+
fontSize: `${r.block.fontSize}px`,
|
|
3904
|
+
color: r.block.color,
|
|
3905
|
+
textAlign: r.block.textAlign,
|
|
3906
|
+
fontFamily: r.block.fontFamily || "inherit"
|
|
3907
|
+
})), l = j(() => ({
|
|
3908
|
+
border: `${r.block.borderWidth}px solid ${r.block.borderColor}`,
|
|
3909
|
+
padding: `${r.block.cellPadding}px`,
|
|
3910
|
+
textAlign: r.block.textAlign
|
|
3911
|
+
})), u = j(() => ({
|
|
3912
|
+
...l.value,
|
|
3871
3913
|
fontWeight: "bold",
|
|
3872
|
-
backgroundColor:
|
|
3873
|
-
})),
|
|
3874
|
-
function
|
|
3875
|
-
o.selectBlock(
|
|
3914
|
+
backgroundColor: r.block.headerBackgroundColor || "transparent"
|
|
3915
|
+
})), d = j(() => r.block.hasHeaderRow && r.block.rows.length > 0 ? r.block.rows[0] : null), m = j(() => r.block.hasHeaderRow ? r.block.rows.slice(1) : r.block.rows);
|
|
3916
|
+
function h() {
|
|
3917
|
+
o.selectBlock(r.block.id);
|
|
3876
3918
|
}
|
|
3877
|
-
function
|
|
3878
|
-
let
|
|
3919
|
+
function g(e, t, n) {
|
|
3920
|
+
let i = n.target.innerText.trim(), a = r.block.rows.map((n) => n.id === e ? {
|
|
3879
3921
|
...n,
|
|
3880
3922
|
cells: n.cells.map((e) => e.id === t ? {
|
|
3881
3923
|
...e,
|
|
3882
|
-
content:
|
|
3924
|
+
content: i
|
|
3883
3925
|
} : e)
|
|
3884
3926
|
} : n);
|
|
3885
|
-
o.updateBlock(
|
|
3927
|
+
o.updateBlock(r.block.id, { rows: a });
|
|
3886
3928
|
}
|
|
3887
|
-
return (
|
|
3929
|
+
return (e, r) => (f(), x("div", ms, [s.value ? (f(), x("table", {
|
|
3888
3930
|
key: 0,
|
|
3889
|
-
style:
|
|
3931
|
+
style: i(c.value),
|
|
3890
3932
|
class: "tpl-table-editable"
|
|
3891
|
-
}, [
|
|
3892
|
-
key:
|
|
3893
|
-
style:
|
|
3894
|
-
"aria-label":
|
|
3933
|
+
}, [d.value ? (f(), x("thead", hs, [b("tr", null, [(f(!0), x(A, null, t(d.value.cells, (e) => oe((f(), x("th", {
|
|
3934
|
+
key: e.id,
|
|
3935
|
+
style: i(u.value),
|
|
3936
|
+
"aria-label": k(a).table.cellPlaceholder,
|
|
3895
3937
|
contenteditable: "true",
|
|
3896
|
-
"data-placeholder":
|
|
3897
|
-
onBlur: (
|
|
3898
|
-
onKeydown:
|
|
3899
|
-
onClick:
|
|
3900
|
-
}, null, 44,
|
|
3901
|
-
key:
|
|
3902
|
-
style:
|
|
3903
|
-
"aria-label":
|
|
3938
|
+
"data-placeholder": k(a).table.cellPlaceholder,
|
|
3939
|
+
onBlur: (t) => g(d.value.id, e.id, t),
|
|
3940
|
+
onKeydown: r[0] ||= ce(P((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3941
|
+
onClick: P(h, ["stop"])
|
|
3942
|
+
}, null, 44, gs)), [[n, e.content]])), 128))])])) : M("", !0), b("tbody", null, [(f(!0), x(A, null, t(m.value, (e) => (f(), x("tr", { key: e.id }, [(f(!0), x(A, null, t(e.cells, (t) => oe((f(), x("td", {
|
|
3943
|
+
key: t.id,
|
|
3944
|
+
style: i(l.value),
|
|
3945
|
+
"aria-label": k(a).table.cellPlaceholder,
|
|
3904
3946
|
contenteditable: "true",
|
|
3905
|
-
"data-placeholder":
|
|
3906
|
-
onBlur: (
|
|
3907
|
-
onKeydown:
|
|
3908
|
-
onClick:
|
|
3909
|
-
}, null, 44,
|
|
3947
|
+
"data-placeholder": k(a).table.cellPlaceholder,
|
|
3948
|
+
onBlur: (n) => g(e.id, t.id, n),
|
|
3949
|
+
onKeydown: r[1] ||= ce(P((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3950
|
+
onClick: P(h, ["stop"])
|
|
3951
|
+
}, null, 44, _s)), [[n, t.content]])), 128))]))), 128))])], 4)) : (f(), x("div", vs, [w(k(Pn), { size: 16 }), b("span", null, p(k(a).table.empty), 1)]))]));
|
|
3910
3952
|
}
|
|
3911
|
-
}), [["__scopeId", "data-v-f065872a"]]),
|
|
3953
|
+
}), [["__scopeId", "data-v-f065872a"]]), bs = /* @__PURE__ */ y({
|
|
3912
3954
|
__name: "VideoPlayButton",
|
|
3913
3955
|
props: { hoverEffect: {
|
|
3914
3956
|
type: Boolean,
|
|
3915
3957
|
default: !1
|
|
3916
3958
|
} },
|
|
3917
|
-
setup(
|
|
3918
|
-
return (
|
|
3959
|
+
setup(e) {
|
|
3960
|
+
return (t, n) => (f(), x("div", { class: o(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", e.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...n[0] ||= [b("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-white/90 tpl:shadow-lg" }, [b("svg", {
|
|
3919
3961
|
class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
|
|
3920
3962
|
width: "28",
|
|
3921
3963
|
height: "28",
|
|
3922
3964
|
viewBox: "0 0 24 24",
|
|
3923
3965
|
fill: "currentColor"
|
|
3924
|
-
}, [
|
|
3966
|
+
}, [b("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
|
|
3925
3967
|
}
|
|
3926
3968
|
});
|
|
3927
3969
|
//#endregion
|
|
3928
3970
|
//#region src/utils/videoThumbnail.ts
|
|
3929
|
-
function
|
|
3971
|
+
function xs(e) {
|
|
3930
3972
|
if (!e) return {
|
|
3931
3973
|
platform: "unknown",
|
|
3932
3974
|
videoId: null,
|
|
@@ -3958,142 +4000,142 @@ function _s(e) {
|
|
|
3958
4000
|
thumbnailUrl: null
|
|
3959
4001
|
};
|
|
3960
4002
|
}
|
|
3961
|
-
function
|
|
3962
|
-
return t ||
|
|
4003
|
+
function Ss(e, t) {
|
|
4004
|
+
return t || xs(e).thumbnailUrl;
|
|
3963
4005
|
}
|
|
3964
4006
|
//#endregion
|
|
3965
4007
|
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3966
|
-
var
|
|
4008
|
+
var Cs = ["src", "alt"], ws = {
|
|
3967
4009
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
3968
4010
|
style: { opacity: "0.7" }
|
|
3969
|
-
},
|
|
4011
|
+
}, Ts = ["href"], Es = ["src", "alt"], Ds = ["src", "alt"], Os = {
|
|
3970
4012
|
key: 3,
|
|
3971
4013
|
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)]"
|
|
3972
|
-
},
|
|
4014
|
+
}, ks = /* @__PURE__ */ y({
|
|
3973
4015
|
__name: "VideoBlock",
|
|
3974
4016
|
props: {
|
|
3975
4017
|
block: {},
|
|
3976
4018
|
viewport: {}
|
|
3977
4019
|
},
|
|
3978
|
-
setup(
|
|
3979
|
-
let
|
|
3980
|
-
let e =
|
|
4020
|
+
setup(e) {
|
|
4021
|
+
let t = e, { t: n } = Tt(), { syntax: r } = Nt(), a = j(() => Ae(t.block.url, r) || Ae(t.block.thumbnailUrl, r)), o = j(() => a.value ? null : Ss(t.block.url, t.block.thumbnailUrl)), s = j(() => ({ textAlign: t.block.align })), c = j(() => {
|
|
4022
|
+
let e = t.block.align;
|
|
3981
4023
|
return {
|
|
3982
4024
|
maxWidth: "100%",
|
|
3983
|
-
width:
|
|
4025
|
+
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
3984
4026
|
display: "block",
|
|
3985
4027
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
3986
4028
|
marginRight: e === "center" ? "auto" : void 0
|
|
3987
4029
|
};
|
|
3988
|
-
}), l =
|
|
3989
|
-
return (
|
|
4030
|
+
}), l = j(() => Ae(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
4031
|
+
return (t, r) => (f(), x("div", {
|
|
3990
4032
|
class: "tpl:w-full",
|
|
3991
|
-
style:
|
|
3992
|
-
}, [a.value &&
|
|
4033
|
+
style: i(s.value)
|
|
4034
|
+
}, [a.value && e.block.placeholderUrl ? (f(), x("div", {
|
|
3993
4035
|
key: 0,
|
|
3994
4036
|
class: "tpl:relative tpl:inline-block",
|
|
3995
|
-
style:
|
|
3996
|
-
}, [
|
|
4037
|
+
style: i(c.value)
|
|
4038
|
+
}, [b("img", {
|
|
3997
4039
|
class: "tpl:w-full tpl:border-0",
|
|
3998
|
-
src:
|
|
3999
|
-
alt:
|
|
4000
|
-
}, null, 8,
|
|
4040
|
+
src: e.block.placeholderUrl,
|
|
4041
|
+
alt: e.block.alt
|
|
4042
|
+
}, null, 8, Cs), w(bs)], 4)) : a.value ? (f(), x("div", {
|
|
4001
4043
|
key: 1,
|
|
4002
4044
|
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)]",
|
|
4003
|
-
style:
|
|
4004
|
-
}, [
|
|
4045
|
+
style: i([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, c.value])
|
|
4046
|
+
}, [w(k(Fn), {
|
|
4005
4047
|
size: 36,
|
|
4006
4048
|
"stroke-width": 1.5,
|
|
4007
4049
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
4008
4050
|
style: { opacity: "0.5" }
|
|
4009
|
-
}),
|
|
4051
|
+
}), b("span", ws, [w(yn, { text: l.value }, null, 8, ["text"])])], 4)) : o.value ? (f(), x(A, { key: 2 }, [e.block.url ? (f(), x("a", {
|
|
4010
4052
|
key: 0,
|
|
4011
|
-
href:
|
|
4053
|
+
href: e.block.url,
|
|
4012
4054
|
target: "_blank",
|
|
4013
4055
|
rel: "noopener noreferrer",
|
|
4014
4056
|
class: "tpl:group tpl:relative tpl:inline-block",
|
|
4015
|
-
style:
|
|
4016
|
-
onClick:
|
|
4017
|
-
}, [
|
|
4057
|
+
style: i(c.value),
|
|
4058
|
+
onClick: r[0] ||= P(() => {}, ["prevent"])
|
|
4059
|
+
}, [b("img", {
|
|
4018
4060
|
class: "tpl:w-full tpl:border-0",
|
|
4019
4061
|
src: o.value,
|
|
4020
|
-
alt:
|
|
4021
|
-
}, null, 8,
|
|
4062
|
+
alt: e.block.alt
|
|
4063
|
+
}, null, 8, Es), w(bs, { "hover-effect": "" })], 12, Ts)) : (f(), x("div", {
|
|
4022
4064
|
key: 1,
|
|
4023
4065
|
class: "tpl:relative tpl:inline-block",
|
|
4024
|
-
style:
|
|
4025
|
-
}, [
|
|
4066
|
+
style: i(c.value)
|
|
4067
|
+
}, [b("img", {
|
|
4026
4068
|
class: "tpl:w-full tpl:border-0",
|
|
4027
4069
|
src: o.value,
|
|
4028
|
-
alt:
|
|
4029
|
-
}, null, 8,
|
|
4070
|
+
alt: e.block.alt
|
|
4071
|
+
}, null, 8, Ds), w(bs)], 4))], 64)) : (f(), x("div", Os, [w(k(Fn), {
|
|
4030
4072
|
size: 40,
|
|
4031
4073
|
"stroke-width": 1.5,
|
|
4032
4074
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
4033
|
-
}),
|
|
4034
|
-
}
|
|
4035
|
-
}),
|
|
4036
|
-
section:
|
|
4037
|
-
title:
|
|
4038
|
-
paragraph:
|
|
4039
|
-
image:
|
|
4040
|
-
button:
|
|
4041
|
-
divider:
|
|
4042
|
-
video:
|
|
4043
|
-
social:
|
|
4044
|
-
menu:
|
|
4045
|
-
table:
|
|
4046
|
-
spacer:
|
|
4047
|
-
html:
|
|
4048
|
-
countdown:
|
|
4075
|
+
}), b("span", null, p(k(n).video.addVideo), 1)]))], 4));
|
|
4076
|
+
}
|
|
4077
|
+
}), As = {
|
|
4078
|
+
section: es,
|
|
4079
|
+
title: ci,
|
|
4080
|
+
paragraph: Wr,
|
|
4081
|
+
image: jr,
|
|
4082
|
+
button: Sn,
|
|
4083
|
+
divider: fr,
|
|
4084
|
+
video: ks,
|
|
4085
|
+
social: us,
|
|
4086
|
+
menu: Fr,
|
|
4087
|
+
table: ys,
|
|
4088
|
+
spacer: ps,
|
|
4089
|
+
html: _r,
|
|
4090
|
+
countdown: C(() => import("./CountdownBlock-apiYUhkQ.js").then((e) => e.n))
|
|
4049
4091
|
};
|
|
4050
|
-
function
|
|
4051
|
-
let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: o } =
|
|
4092
|
+
function js(e) {
|
|
4093
|
+
let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: o } = Tt(r);
|
|
4052
4094
|
t.setUiTheme(n.uiTheme ?? "auto");
|
|
4053
|
-
let { resolvedTheme:
|
|
4054
|
-
themeOverrides:
|
|
4055
|
-
resolvedTheme:
|
|
4095
|
+
let { resolvedTheme: l } = rn(j(() => t.state.uiTheme)), d = _(n.theme ?? {}), { themeStyles: f } = on({
|
|
4096
|
+
themeOverrides: d,
|
|
4097
|
+
resolvedTheme: l,
|
|
4056
4098
|
extraStyles: e.themeExtraStyles
|
|
4057
|
-
}),
|
|
4099
|
+
}), p = Bt({
|
|
4058
4100
|
content: t.content,
|
|
4059
4101
|
setContent: (e, n) => t.setContent(e, n),
|
|
4060
4102
|
...e.historyOptions
|
|
4061
4103
|
});
|
|
4062
|
-
|
|
4063
|
-
let
|
|
4104
|
+
Kt(t, p);
|
|
4105
|
+
let m = Ht({
|
|
4064
4106
|
addBlock: t.addBlock,
|
|
4065
4107
|
removeBlock: t.removeBlock,
|
|
4066
4108
|
updateBlock: t.updateBlock,
|
|
4067
4109
|
selectBlock: t.selectBlock,
|
|
4068
4110
|
findBlockLocation: t.findBlockLocation,
|
|
4069
4111
|
blockDefaults: n.blockDefaults
|
|
4070
|
-
}),
|
|
4112
|
+
}), h = Wt(t), g = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? Ut({
|
|
4071
4113
|
content: t.content,
|
|
4072
4114
|
isDirty: () => t.state.isDirty,
|
|
4073
4115
|
...e.autoSaveOptions
|
|
4074
|
-
}) : null,
|
|
4075
|
-
g && (
|
|
4116
|
+
}) : null, v = null;
|
|
4117
|
+
g && (v = c(p.isNavigating, (e) => {
|
|
4076
4118
|
e ? g.pause() : g.resume();
|
|
4077
4119
|
}));
|
|
4078
|
-
let
|
|
4120
|
+
let y = nn(t, {
|
|
4079
4121
|
t: a,
|
|
4080
4122
|
format: o
|
|
4081
|
-
}),
|
|
4082
|
-
if (
|
|
4083
|
-
function
|
|
4084
|
-
for (let t of e)
|
|
4123
|
+
}), b = un();
|
|
4124
|
+
if (hn(b, As), n.customBlocks?.length) for (let e of n.customBlocks) b.registerCustom(e, ur);
|
|
4125
|
+
function x(e) {
|
|
4126
|
+
for (let t of e) b.registerCustom(t, ur);
|
|
4085
4127
|
}
|
|
4086
|
-
let S =
|
|
4087
|
-
if (
|
|
4128
|
+
let S = Xt();
|
|
4129
|
+
if (s() && u(S.dispose), e.containerEl) {
|
|
4088
4130
|
let t = e.containerEl;
|
|
4089
|
-
|
|
4131
|
+
Ge(document, "pointerdown", (e) => {
|
|
4090
4132
|
let n = t.value;
|
|
4091
4133
|
n && (e.composedPath?.() ?? []).includes(n) && S.claim();
|
|
4092
4134
|
}, { capture: !0 });
|
|
4093
4135
|
}
|
|
4094
4136
|
function C(r) {
|
|
4095
|
-
S.isActive() &&
|
|
4096
|
-
history:
|
|
4137
|
+
S.isActive() && _n(r, {
|
|
4138
|
+
history: p,
|
|
4097
4139
|
selectBlock: (e) => t.selectBlock(e),
|
|
4098
4140
|
getSelectedBlockId: () => t.state.selectedBlockId,
|
|
4099
4141
|
removeBlock: (e) => t.removeBlock(e),
|
|
@@ -4101,39 +4143,39 @@ function Ds(e) {
|
|
|
4101
4143
|
onBeforeUndo: e.keyboardOptions?.onBeforeUndo
|
|
4102
4144
|
});
|
|
4103
4145
|
}
|
|
4104
|
-
|
|
4105
|
-
let w =
|
|
4106
|
-
E(
|
|
4107
|
-
let T =
|
|
4108
|
-
E(
|
|
4109
|
-
let
|
|
4146
|
+
Ge(document, "keydown", C);
|
|
4147
|
+
let w = _(null);
|
|
4148
|
+
E(ft, e.editorRoot ?? document), E(Je, w), E(Qe, r), E(ht, t), E(ot, p), E(pt, m), E(bt, h), E(dt, i), E(rt, f), E($e, l), E(st, n.blockDefaults), E(_t, b), E(lt, n.customBlocks ?? []), E(mt, n.paletteBlocks), E(ut, dn(t.content, b));
|
|
4149
|
+
let T = pe(n.mergeTags?.syntax);
|
|
4150
|
+
E(it, n.mergeTags?.tags ?? []), E(at, T), E(nt, n.mergeTags?.onRequest ?? null), E(Ye, n.mergeTags?.autocomplete !== !1), E(St, Zt()), E(ct, n.logicTags?.tags ?? []), E(wt, n.logicTags?.pairs ?? []), E(Ze, n.logicTags?.onRequest ?? null), E(Ct, Qt()), E(Xe, n.onRequestMedia ?? null), E(vt, n.displayConditions?.conditions ?? []), E(gt, n.displayConditions?.allowCustom ?? !1), E(yt, e.capabilities ?? {}), E(xt, y);
|
|
4151
|
+
let D = $t(n.lint) ? null : en({
|
|
4110
4152
|
content: t.content,
|
|
4111
4153
|
options: n.lint ?? {},
|
|
4112
4154
|
updateBlock: t.updateBlock,
|
|
4113
4155
|
updateSettings: t.updateSettings,
|
|
4114
4156
|
removeBlock: t.removeBlock
|
|
4115
4157
|
});
|
|
4116
|
-
E(
|
|
4117
|
-
function
|
|
4118
|
-
|
|
4158
|
+
E(tt, D);
|
|
4159
|
+
function O() {
|
|
4160
|
+
v?.(), D?.destroy(), g?.destroy(), p.destroy();
|
|
4119
4161
|
}
|
|
4120
4162
|
return {
|
|
4121
4163
|
t: a,
|
|
4122
4164
|
format: o,
|
|
4123
|
-
history:
|
|
4124
|
-
blockActions:
|
|
4125
|
-
conditionPreview:
|
|
4165
|
+
history: p,
|
|
4166
|
+
blockActions: m,
|
|
4167
|
+
conditionPreview: h,
|
|
4126
4168
|
autoSave: g,
|
|
4127
|
-
resolvedTheme:
|
|
4128
|
-
themeStyles:
|
|
4129
|
-
themeOverrides:
|
|
4130
|
-
registry:
|
|
4131
|
-
keyboardReorder:
|
|
4132
|
-
templateLint:
|
|
4169
|
+
resolvedTheme: l,
|
|
4170
|
+
themeStyles: f,
|
|
4171
|
+
themeOverrides: d,
|
|
4172
|
+
registry: b,
|
|
4173
|
+
keyboardReorder: y,
|
|
4174
|
+
templateLint: D,
|
|
4133
4175
|
popoverRoot: w,
|
|
4134
|
-
registerCustomBlocks:
|
|
4135
|
-
destroy:
|
|
4176
|
+
registerCustomBlocks: x,
|
|
4177
|
+
destroy: O
|
|
4136
4178
|
};
|
|
4137
4179
|
}
|
|
4138
4180
|
//#endregion
|
|
4139
|
-
export {
|
|
4181
|
+
export { jn as A, qn as C, Rn as D, Vn as E, Sn as F, ln as I, tn as L, Dn as M, En as N, Pn as O, Tn as P, Gt as R, Jn as S, Hn as T, _r as _, us as a, tr as b, Yo as c, Kr as d, Gr as f, yr as g, jr as h, ps as i, An as j, Nn as k, ci as l, Fr as m, ks as n, rs as o, Wr as p, ys as r, es as s, js as t, oi as u, fr as v, Un as w, $n as x, ur as y, It as z };
|