@templatical/editor 0.18.0 → 0.20.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-BWIzNePR.js → AiChatSidebar-ChrE6pUq.js} +10 -10
- package/dist/{AiFeatureMenu-IoLW8c6m.js → AiFeatureMenu-DkQ9HhQ6.js} +7 -7
- package/dist/{BlockIssueBadge-FbyZBJlf.js → BlockIssueBadge-B4QjePax.js} +4 -4
- package/dist/{CloudEditor-txLsdvcR.js → CloudEditor-CfX-aMiV.js} +24 -22
- package/dist/{CollaboratorBar-CpLOFt43.js → CollaboratorBar-DTibhQ1j.js} +3 -3
- package/dist/ColorPicker-4vDYhdGe.js +552 -0
- package/dist/{CommentsSidebar-C8xFu9qy.js → CommentsSidebar-D-o5Stlg.js} +12 -12
- package/dist/{CountdownBlock-CaU40Htk.js → CountdownBlock-Bn5w7C-p.js} +1 -1
- package/dist/{CountdownToolbar-CBbGAxmF.js → CountdownToolbar-D7yQqnA2.js} +3 -3
- package/dist/{DesignReferenceSidebar-BWZgqmT-.js → DesignReferenceSidebar-DnO6ZdwS.js} +10 -10
- package/dist/{IssuesPanel-CBzfmzRM.js → IssuesPanel-X_vkNGrs.js} +7 -7
- package/dist/{ModuleBrowserModal-C9qHpjaS.js → ModuleBrowserModal-AJt--JPh.js} +9 -9
- package/dist/{ModulePreviewCanvas-xEMWMJwf.js → ModulePreviewCanvas-BKYOcVCh.js} +2 -2
- package/dist/{NumberWithSuffix-BreqtON_.js → NumberWithSuffix-Bf3rNxza.js} +1 -1
- package/dist/{ParagraphEditor-iRJI_YbA.js → ParagraphEditor-C5ixOIYb.js} +46 -46
- package/dist/{RichTextEditorContent-DkXai9qP.js → RichTextEditorContent-DwhDnMsG.js} +7 -7
- package/dist/{SaveModuleDialog-DqDmk0rO.js → SaveModuleDialog-B4QX9eiv.js} +7 -7
- package/dist/{SnapshotHistory-BVe5aCHi.js → SnapshotHistory-DaVueFv6.js} +8 -8
- package/dist/{TemplateScoringPanel-CRqt9-T5.js → TemplateScoringPanel-B0UHoTLx.js} +77 -77
- package/dist/{TestEmailModal-jpy4hnYZ.js → TestEmailModal-BkauxF7j.js} +4 -4
- package/dist/{TitleEditor-Bf6Jv2qI.js → TitleEditor-n6WDVDjW.js} +9 -9
- package/dist/{TplModal-DAtccv6o.js → TplModal-BDDyvT-C.js} +3 -3
- package/dist/{blockTypeIcons-CnlwyvkL.js → blockTypeIcons-4D0aFXNg.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +2 -1
- package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js → AiFeatureMenu-CIBHAGSz.js} +5 -5
- package/dist/cdn/chunks/{AiFeatureMenu-B4oJlFQI.js.map → AiFeatureMenu-CIBHAGSz.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js → BlockIssueBadge-CxMiLo3p.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-C7Ts7bT7.js.map → BlockIssueBadge-CxMiLo3p.js.map} +1 -1
- package/dist/cdn/chunks/{CloudEditor-BRO-2CcF.js → CloudEditor-CEa3Xgqh.js} +133 -131
- package/dist/cdn/chunks/CloudEditor-CEa3Xgqh.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js → CollaboratorBar-Bk1gD02G.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-BsWOjOCS.js.map → CollaboratorBar-Bk1gD02G.js.map} +1 -1
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js +550 -0
- package/dist/cdn/chunks/ColorPicker-ll8pynws.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js → CountdownBlock-eGUE7hhw.js} +4 -4
- package/dist/cdn/chunks/{CountdownBlock-BUGxk8GI.js.map → CountdownBlock-eGUE7hhw.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js → CountdownToolbar-C1bkSjUR.js} +4 -4
- package/dist/cdn/chunks/{CountdownToolbar-C8tWWfGw.js.map → CountdownToolbar-C1bkSjUR.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js → IssuesPanel-Csasylf_.js} +7 -7
- package/dist/cdn/chunks/{IssuesPanel-C5izyrbm.js.map → IssuesPanel-Csasylf_.js.map} +1 -1
- package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js → ModuleBrowserModal-DznWWtBI.js} +8 -8
- package/dist/cdn/chunks/{ModuleBrowserModal-DySKXKFF.js.map → ModuleBrowserModal-DznWWtBI.js.map} +1 -1
- package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js → ModulePreviewCanvas-D-h7fr87.js} +8 -8
- package/dist/cdn/chunks/{ModulePreviewCanvas-qqEvLBp2.js.map → ModulePreviewCanvas-D-h7fr87.js.map} +1 -1
- package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js → NumberWithSuffix-Dt-0odUN.js} +2 -2
- package/dist/cdn/chunks/{NumberWithSuffix-DttdbXsh.js.map → NumberWithSuffix-Dt-0odUN.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js → ParagraphEditor-v0_XEL-v.js} +110 -110
- package/dist/cdn/chunks/{ParagraphEditor-CQJ23PXU.js.map → ParagraphEditor-v0_XEL-v.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js → RichTextEditorContent-NQExNsaV.js} +5 -5
- package/dist/cdn/chunks/{RichTextEditorContent-C4vxiXng.js.map → RichTextEditorContent-NQExNsaV.js.map} +1 -1
- package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js → SaveModuleDialog-BpFhTi-k.js} +5 -5
- package/dist/cdn/chunks/{SaveModuleDialog-D5eddgzd.js.map → SaveModuleDialog-BpFhTi-k.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js → TitleEditor-CS-_MzYs.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-5TkwDrPL.js.map → TitleEditor-CS-_MzYs.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js → blockTypeIcons-B0Hjh42a.js} +7 -7
- package/dist/cdn/chunks/{blockTypeIcons-CbmN4aSw.js.map → blockTypeIcons-B0Hjh42a.js.map} +1 -1
- package/dist/cdn/chunks/{ca-CSl--oWR.js → ca-DbWoy4rG.js} +3 -2
- package/dist/cdn/chunks/{ca-CSl--oWR.js.map → ca-DbWoy4rG.js.map} +1 -1
- package/dist/{de-ZaffrKDP.js → cdn/chunks/de-CgGOnerg.js} +4 -1
- package/dist/cdn/chunks/{de-ZaffrKDP.js.map → de-CgGOnerg.js.map} +1 -1
- package/dist/cdn/chunks/{en-CHuXeJDt.js → en-DrUV9xth.js} +3 -2
- package/dist/cdn/chunks/{en-CHuXeJDt.js.map → en-DrUV9xth.js.map} +1 -1
- package/dist/{es-CaC8VQjO.js → cdn/chunks/es-DwbKjU7q.js} +4 -1
- package/dist/cdn/chunks/{es-CaC8VQjO.js.map → es-DwbKjU7q.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-B3M4IqhZ.js → extensions-Di3hdIRT.js} +25 -25
- package/dist/cdn/chunks/{extensions-B3M4IqhZ.js.map → extensions-Di3hdIRT.js.map} +1 -1
- package/dist/cdn/chunks/{features-HBwOEo4D.js → features-CLIZ7Q-Y.js} +1129 -1002
- package/dist/cdn/chunks/features-CLIZ7Q-Y.js.map +1 -0
- package/dist/cdn/chunks/{icons-D4vTsN4p.js → icons-GX40Qm2W.js} +2 -2
- package/dist/cdn/chunks/{icons-D4vTsN4p.js.map → icons-GX40Qm2W.js.map} +1 -1
- package/dist/cdn/chunks/{media-library-CfExuiSG.js → media-library-yYAkAagU.js} +537 -537
- package/dist/cdn/chunks/{media-library-CfExuiSG.js.map → media-library-yYAkAagU.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +3 -2
- package/dist/cdn/chunks/{pt-BR-C74zfEWH.js.map → pt-BR-Bcc5Tjed.js.map} +1 -1
- package/dist/cdn/chunks/{pusher-CIwiKF8H.js → pusher-R0v5p99W.js} +27 -22
- package/dist/cdn/chunks/pusher-R0v5p99W.js.map +1 -0
- package/dist/cdn/chunks/quality-DffYv9j5.js +2180 -0
- package/dist/cdn/chunks/{quality-nh1R42eb.js.map → quality-DffYv9j5.js.map} +1 -1
- package/dist/cdn/chunks/{renderer-BLvlUayY.js → renderer-DpBGiXOg.js} +16 -16
- package/dist/cdn/chunks/{renderer-BLvlUayY.js.map → renderer-DpBGiXOg.js.map} +1 -1
- package/dist/cdn/chunks/{src-Cks4RrLL.js → src-9K6uFiuK.js} +6 -6
- package/dist/cdn/chunks/{src-Cks4RrLL.js.map → src-9K6uFiuK.js.map} +1 -1
- package/dist/cdn/chunks/{styles-CPCN13az.js → styles-DHSmjlpX.js} +820 -816
- package/dist/cdn/chunks/styles-DHSmjlpX.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +54 -52
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-Cg6Mc2pP.js → check-Bl4J_tYV.js} +1 -1
- package/dist/{chevron-down-dClfxKrJ.js → chevron-down-COEcl2iP.js} +1 -1
- package/dist/{circle-alert-Bhzm-fNA.js → circle-alert-CvHi5etc.js} +1 -1
- package/dist/{clock-m7TwQw4b.js → clock-CZZw62e8.js} +1 -1
- package/dist/{cloud-BogxOeZu.js → cloud-B-RebwxI.js} +5 -5
- package/dist/{createLucideIcon-FSF4peHQ.js → createLucideIcon-_peTZQtY.js} +2 -2
- package/dist/{cdn/chunks/de-ZaffrKDP.js → de-CgGOnerg.js} +2 -3
- package/dist/{dist-DoRIUsfz.js → dist-BJbqgyPn.js} +108 -94
- package/dist/{en-CHuXeJDt.js → en-DrUV9xth.js} +2 -1
- package/dist/{cdn/chunks/es-CaC8VQjO.js → es-DwbKjU7q.js} +2 -3
- package/dist/{extensions-gpFdCinj.js → extensions-BCA9pyer.js} +11 -11
- package/dist/{image-up-CDEgJqwA.js → image-up-D26rNdfX.js} +1 -1
- package/dist/index.d.ts +31 -0
- package/dist/{info-BNP8yGsK.js → info-CE3JSTqk.js} +1 -1
- package/dist/keys-DFaIbGR8.js +10 -0
- package/dist/{list-checks-jepi4iYr.js → list-checks-BQsLrtBB.js} +1 -1
- package/dist/{loader-circle-BT38qSm3.js → loader-circle-s9Rh5lLd.js} +1 -1
- package/dist/{message-circle-BAHcL9S-.js → message-circle-CI62d690.js} +1 -1
- package/dist/{pt-BR-C74zfEWH.js → pt-BR-Bcc5Tjed.js} +2 -1
- package/dist/{refresh-cw-as5Bmg4X.js → refresh-cw-DlYfl65Y.js} +1 -1
- package/dist/{scan-line-IAMjPtRw.js → scan-line-CHadrYVb.js} +1 -1
- package/dist/{send-DvMay6bt.js → send-CbP40otC.js} +1 -1
- package/dist/{shield-check-YYDhGroE.js → shield-check-Bnj9aRoJ.js} +1 -1
- package/dist/{sparkles-CCwQMMMZ.js → sparkles-CncWT57a.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{styles-CJ6WmkYL.js → styles-DkF_-uX8.js} +677 -673
- package/dist/templatical-editor.js +14 -12
- package/dist/{text-align-start-BwsA6QzC.js → text-align-start-B458vzYw.js} +1 -1
- package/dist/{trash-2-CRBDolnR.js → trash-2-DO0yjSU1.js} +1 -1
- package/dist/{triangle-alert-B2g0ALvq.js → triangle-alert-C18_ima6.js} +1 -1
- package/dist/{upload-y4gxiFp5.js → upload-DsCd2zTR.js} +1 -1
- package/dist/{useCloudI18n-DIn74fK2.js → useCloudI18n-PCDOC2kz.js} +1 -1
- package/dist/{useEditorCore-LJJNXXqC.js → useEditorCore-kKUemYY6.js} +1047 -961
- package/dist/{useI18n-OaMLWqhY.js → useI18n-BNMzZTM5.js} +1 -1
- package/dist/{useMergeTag-CZMgwVvr.js → useMergeTag-DfEY0eK5.js} +5 -5
- package/dist/{usePopoverPosition-QDY09q9H.js → usePopoverPosition-F9STHRIr.js} +33 -6
- package/dist/{x-Ctg_250T.js → x-BCFQuE_q.js} +1 -1
- package/package.json +10 -10
- package/dist/ColorPicker-BXCcUYsZ.js +0 -473
- package/dist/cdn/chunks/CloudEditor-BRO-2CcF.js.map +0 -1
- package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js +0 -471
- package/dist/cdn/chunks/ColorPicker-DEtVX4gN.js.map +0 -1
- package/dist/cdn/chunks/features-HBwOEo4D.js.map +0 -1
- package/dist/cdn/chunks/pusher-CIwiKF8H.js.map +0 -1
- package/dist/cdn/chunks/quality-nh1R42eb.js +0 -2180
- package/dist/cdn/chunks/styles-CPCN13az.js.map +0 -1
- package/dist/keys-DAxnnmXs.js +0 -10
|
@@ -1,28 +1,28 @@
|
|
|
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
|
|
2
|
-
import { c as
|
|
3
|
-
import { t as
|
|
4
|
-
import { A as
|
|
5
|
-
import { f as
|
|
6
|
-
import { a as
|
|
7
|
-
import { A 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 { t as
|
|
15
|
-
import { t as
|
|
16
|
-
import "./useCloudI18n-
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
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 A, r as j, rt as ee, s as M, tt as te, u as N, v as ne, w as re, x as P, y as ie, z as ae } from "./vue.runtime.esm-bundler-B0xoGkDv.js";
|
|
2
|
+
import { c as F, o as oe, s as se } from "./runtime-dom.esm-bundler-GdMI8WqG.js";
|
|
3
|
+
import { t as ce } from "./upload-DsCd2zTR.js";
|
|
4
|
+
import { A as le, C as ue, D as de, E as fe, F as pe, I as me, M as he, N as ge, P as _e, S as ve, T as ye, _ as be, a as xe, b as Se, c as Ce, d as we, f as Te, g as Ee, h as De, i as Oe, j as ke, k as Ae, l as je, m as Me, n as Ne, p as Pe, r as Fe, t as Ie, u as Le, v as Re, w as ze, x as Be, y as Ve } from "./dist-BJbqgyPn.js";
|
|
5
|
+
import { f as He, g as Ue, h as We, m as Ge } from "./dist-DYv_Pttj.js";
|
|
6
|
+
import { a as Ke, c as qe, d as Je, i as Ye, l as Xe, o as Ze, r as Qe, t as $e, u as et } from "./usePopoverPosition-F9STHRIr.js";
|
|
7
|
+
import { A as tt, B as nt, C as rt, D as it, E as at, I as ot, L as st, M as ct, N as lt, O as ut, R as dt, S as ft, T as pt, _ as mt, a as ht, b as gt, d as _t, f as vt, g as yt, h as bt, i as xt, j as St, k as Ct, l as wt, m as Tt, n as Et, o as Dt, p as Ot, s as kt, v as At, w as jt, x as Mt, y as Nt, z as Pt } from "./keys-DFaIbGR8.js";
|
|
8
|
+
import { t as Ft } from "./useI18n-BNMzZTM5.js";
|
|
9
|
+
import { t as I } from "./createLucideIcon-_peTZQtY.js";
|
|
10
|
+
import { t as It } from "./loader-circle-s9Rh5lLd.js";
|
|
11
|
+
import { t as Lt } from "./message-circle-CI62d690.js";
|
|
12
|
+
import { t as Rt } from "./trash-2-DO0yjSU1.js";
|
|
13
|
+
import { t as zt } from "./triangle-alert-C18_ima6.js";
|
|
14
|
+
import { t as Bt } from "./LoadingTrack-KIcREPlS.js";
|
|
15
|
+
import { t as Vt } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
16
|
+
import "./useCloudI18n-PCDOC2kz.js";
|
|
17
|
+
import { t as Ht } from "./useMergeTag-DfEY0eK5.js";
|
|
18
|
+
import { t as Ut } from "./useAliveFlag-C43EhZFY.js";
|
|
19
19
|
//#region ../core/dist/index.js
|
|
20
|
-
function
|
|
20
|
+
function Wt(e) {
|
|
21
21
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
24
|
-
let t =
|
|
25
|
-
content: e.content ??
|
|
23
|
+
function Gt(e) {
|
|
24
|
+
let t = A({
|
|
25
|
+
content: e.content ?? Pe(e.defaultFontFamily, e.templateDefaults),
|
|
26
26
|
selectedBlockId: null,
|
|
27
27
|
viewport: "desktop",
|
|
28
28
|
darkMode: !1,
|
|
@@ -111,7 +111,7 @@ function Bt(e) {
|
|
|
111
111
|
if (c(n)) return;
|
|
112
112
|
let o = a(t.content.blocks, n);
|
|
113
113
|
if (o && o.type === "section") {
|
|
114
|
-
if (r < 0 || r >=
|
|
114
|
+
if (r < 0 || r >= Wt(o.columns)) return;
|
|
115
115
|
o.children[r] = o.children[r] || [];
|
|
116
116
|
let t = o.children[r];
|
|
117
117
|
i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
|
|
@@ -144,7 +144,7 @@ function Bt(e) {
|
|
|
144
144
|
let u;
|
|
145
145
|
if (r) {
|
|
146
146
|
let e = a(t.content.blocks, r);
|
|
147
|
-
if (!e || e.type !== "section" || i < 0 || i >=
|
|
147
|
+
if (!e || e.type !== "section" || i < 0 || i >= Wt(e.columns)) return;
|
|
148
148
|
e.children[i] = e.children[i] || [], u = e.children[i];
|
|
149
149
|
} else u = t.content.blocks;
|
|
150
150
|
let [d] = o.blocks.splice(l, 1);
|
|
@@ -173,11 +173,11 @@ function Bt(e) {
|
|
|
173
173
|
findBlockLocation: u
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
var
|
|
177
|
-
function
|
|
178
|
-
let { content: t, setContent: r, isRemoteOperation: i, maxSize: a =
|
|
176
|
+
var Kt = 50, qt = 300, Jt = 1500;
|
|
177
|
+
function Yt(e) {
|
|
178
|
+
let { content: t, setContent: r, isRemoteOperation: i, maxSize: a = Kt } = e, o = _([]), s = _([]), c = _(!1), l = null, u = null, d = n(() => o.value.length > 0), f = n(() => s.value.length > 0);
|
|
179
179
|
function p() {
|
|
180
|
-
return
|
|
180
|
+
return me(t.value);
|
|
181
181
|
}
|
|
182
182
|
function m(e) {
|
|
183
183
|
o.value.push(e), o.value.length > a && o.value.splice(0, o.value.length - a);
|
|
@@ -193,21 +193,21 @@ function Wt(e) {
|
|
|
193
193
|
if (u && u.blockId === e) {
|
|
194
194
|
clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
|
|
195
195
|
u = null;
|
|
196
|
-
},
|
|
196
|
+
}, qt);
|
|
197
197
|
return;
|
|
198
198
|
}
|
|
199
199
|
h(), m(p()), s.value = [], u = {
|
|
200
200
|
blockId: e,
|
|
201
201
|
timeoutId: setTimeout(() => {
|
|
202
202
|
u = null;
|
|
203
|
-
},
|
|
203
|
+
}, qt)
|
|
204
204
|
};
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
207
|
function y() {
|
|
208
208
|
c.value = !0, l && clearTimeout(l), l = setTimeout(() => {
|
|
209
209
|
c.value = !1, l = null;
|
|
210
|
-
},
|
|
210
|
+
}, Jt);
|
|
211
211
|
}
|
|
212
212
|
function b() {
|
|
213
213
|
if (o.value.length === 0) return;
|
|
@@ -239,33 +239,33 @@ function Wt(e) {
|
|
|
239
239
|
destroy: C
|
|
240
240
|
};
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function Xt(e) {
|
|
243
243
|
e.type === "table" ? e.rows = e.rows.map((e) => ({
|
|
244
244
|
...e,
|
|
245
|
-
id:
|
|
245
|
+
id: ye(),
|
|
246
246
|
cells: e.cells.map((e) => ({
|
|
247
247
|
...e,
|
|
248
|
-
id:
|
|
248
|
+
id: ye()
|
|
249
249
|
}))
|
|
250
250
|
})) : e.type === "social" ? e.icons = e.icons.map((e) => ({
|
|
251
251
|
...e,
|
|
252
|
-
id:
|
|
252
|
+
id: ye()
|
|
253
253
|
})) : e.type === "menu" && (e.items = e.items.map((e) => ({
|
|
254
254
|
...e,
|
|
255
|
-
id:
|
|
255
|
+
id: ye()
|
|
256
256
|
})));
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function Zt(e) {
|
|
259
259
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
260
260
|
function o(n, r, a) {
|
|
261
|
-
let o =
|
|
261
|
+
let o = je(n, e.blockDefaults);
|
|
262
262
|
return t(o, r, a), i(o.id), o;
|
|
263
263
|
}
|
|
264
264
|
function s(e, n, r) {
|
|
265
265
|
let o = JSON.parse(JSON.stringify(e));
|
|
266
|
-
if (o.id =
|
|
266
|
+
if (o.id = ye(), Xt(o), o.type === "section" && (o.children = o.children.map((e) => e.map((e) => {
|
|
267
267
|
let t = JSON.parse(JSON.stringify(e));
|
|
268
|
-
return t.id =
|
|
268
|
+
return t.id = ye(), Xt(t), t;
|
|
269
269
|
}))), n !== void 0 || r !== void 0) t(o, n, r);
|
|
270
270
|
else {
|
|
271
271
|
let i = a?.(e.id) ?? null;
|
|
@@ -286,7 +286,7 @@ function Kt(e) {
|
|
|
286
286
|
updateBlockProperty: l
|
|
287
287
|
};
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Qt(e) {
|
|
290
290
|
let { content: t, isDirty: n, onChange: r, debounce: i = 1e3, enabled: a = !0 } = e, o = null, s = !1;
|
|
291
291
|
function c() {
|
|
292
292
|
return typeof a == "function" ? a() : a;
|
|
@@ -308,7 +308,7 @@ function qt(e) {
|
|
|
308
308
|
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
309
309
|
}, i));
|
|
310
310
|
}
|
|
311
|
-
let m =
|
|
311
|
+
let m = ee(t, () => {
|
|
312
312
|
c() && !s && n() && p();
|
|
313
313
|
}, { deep: !0 });
|
|
314
314
|
function h() {
|
|
@@ -322,8 +322,8 @@ function qt(e) {
|
|
|
322
322
|
destroy: h
|
|
323
323
|
};
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
let t =
|
|
325
|
+
function $t(e) {
|
|
326
|
+
let t = A(/* @__PURE__ */ new Set()), r = n(() => t.size > 0);
|
|
327
327
|
function i(e) {
|
|
328
328
|
return t.has(e);
|
|
329
329
|
}
|
|
@@ -340,7 +340,7 @@ function Jt(e) {
|
|
|
340
340
|
hasHiddenBlocks: r
|
|
341
341
|
};
|
|
342
342
|
}
|
|
343
|
-
function
|
|
343
|
+
function en(e) {
|
|
344
344
|
let t = _(!1), r = _(!1), i = n(() => !!e.definition.value?.dataSource), a = n(() => i.value && !e.block.value.dataSourceFetched);
|
|
345
345
|
async function o() {
|
|
346
346
|
let n = e.definition.value;
|
|
@@ -370,7 +370,7 @@ function Yt(e) {
|
|
|
370
370
|
needsFetch: a
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function tn(e, t) {
|
|
374
374
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
375
375
|
e.addBlock = (r, i, a, o) => {
|
|
376
376
|
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
@@ -386,27 +386,27 @@ function Xt(e, t) {
|
|
|
386
386
|
}
|
|
387
387
|
//#endregion
|
|
388
388
|
//#region src/utils/activeEditorTracker.ts
|
|
389
|
-
var
|
|
390
|
-
function
|
|
391
|
-
let e =
|
|
392
|
-
return
|
|
389
|
+
var nn = /* @__PURE__ */ new Set(), rn = 0, an = 0;
|
|
390
|
+
function on() {
|
|
391
|
+
let e = ++an;
|
|
392
|
+
return nn.add(e), rn === 0 && (rn = e), {
|
|
393
393
|
id: e,
|
|
394
|
-
isActive: () =>
|
|
394
|
+
isActive: () => nn.size <= 1 || rn === e,
|
|
395
395
|
claim: () => {
|
|
396
|
-
|
|
396
|
+
rn = e;
|
|
397
397
|
},
|
|
398
398
|
dispose: () => {
|
|
399
|
-
if (
|
|
400
|
-
let e = Array.from(
|
|
401
|
-
|
|
399
|
+
if (nn.delete(e), rn === e) {
|
|
400
|
+
let e = Array.from(nn);
|
|
401
|
+
rn = e[e.length - 1] ?? 0;
|
|
402
402
|
}
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
//#endregion
|
|
407
407
|
//#region src/composables/useImageUrlResolver.ts
|
|
408
|
-
function
|
|
409
|
-
let t =
|
|
408
|
+
function sn(e) {
|
|
409
|
+
let t = A(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
410
410
|
function r(e) {
|
|
411
411
|
return t.get(e);
|
|
412
412
|
}
|
|
@@ -438,8 +438,8 @@ function tn(e) {
|
|
|
438
438
|
lookup: a
|
|
439
439
|
};
|
|
440
440
|
}
|
|
441
|
-
function
|
|
442
|
-
let t =
|
|
441
|
+
function cn(e) {
|
|
442
|
+
let t = P(gt, null), n = M(e);
|
|
443
443
|
if (!t) return n;
|
|
444
444
|
let r;
|
|
445
445
|
function i() {
|
|
@@ -459,7 +459,7 @@ function nn(e) {
|
|
|
459
459
|
r = void 0, t.lookup(e);
|
|
460
460
|
}, 300);
|
|
461
461
|
}
|
|
462
|
-
}, { immediate: !0 }),
|
|
462
|
+
}, { immediate: !0 }), M(() => {
|
|
463
463
|
let e = n.value;
|
|
464
464
|
if (!e) return e;
|
|
465
465
|
let r = t.get(e);
|
|
@@ -468,7 +468,7 @@ function nn(e) {
|
|
|
468
468
|
}
|
|
469
469
|
//#endregion
|
|
470
470
|
//#region src/composables/useMergeTagPicker.ts
|
|
471
|
-
function
|
|
471
|
+
function ln() {
|
|
472
472
|
let e = _(!1), t = _([]), n = null;
|
|
473
473
|
function r(r) {
|
|
474
474
|
if (n) {
|
|
@@ -498,7 +498,7 @@ function rn() {
|
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region src/composables/useLogicTagPicker.ts
|
|
501
|
-
function
|
|
501
|
+
function un() {
|
|
502
502
|
let e = _(!1), t = _([]), n = _([]), r = null;
|
|
503
503
|
function i(i, a) {
|
|
504
504
|
if (r) {
|
|
@@ -529,17 +529,17 @@ function an() {
|
|
|
529
529
|
}
|
|
530
530
|
//#endregion
|
|
531
531
|
//#region src/composables/useTemplateLint.ts
|
|
532
|
-
function
|
|
532
|
+
function dn(e) {
|
|
533
533
|
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
534
534
|
}
|
|
535
|
-
function
|
|
536
|
-
let t = _([]), n = _(!1), r = _(!1), i = v(null), a =
|
|
535
|
+
function fn(e) {
|
|
536
|
+
let t = _([]), n = _(!1), r = _(!1), i = v(null), a = dn(e.options), o = null, s = !1;
|
|
537
537
|
a || l();
|
|
538
538
|
async function l() {
|
|
539
539
|
try {
|
|
540
540
|
let t = await import("@templatical/quality");
|
|
541
541
|
if (s) return;
|
|
542
|
-
i.value = { lintTemplate: t.lintTemplate }, n.value = !0, u(), o =
|
|
542
|
+
i.value = { lintTemplate: t.lintTemplate }, n.value = !0, u(), o = Ue(e.content, u, {
|
|
543
543
|
debounce: e.debounce ?? 500,
|
|
544
544
|
deep: !0
|
|
545
545
|
});
|
|
@@ -574,12 +574,12 @@ function sn(e) {
|
|
|
574
574
|
}
|
|
575
575
|
//#endregion
|
|
576
576
|
//#region src/utils/blockTypeLabels.ts
|
|
577
|
-
function
|
|
577
|
+
function pn(e, t) {
|
|
578
578
|
return t.blocks[e] ?? e;
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/composables/useKeyboardReorder.ts
|
|
582
|
-
function
|
|
582
|
+
function mn(e, t) {
|
|
583
583
|
let n = _(null), r = _(""), i = null;
|
|
584
584
|
function a(t) {
|
|
585
585
|
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
@@ -606,7 +606,7 @@ function ln(e, t) {
|
|
|
606
606
|
let r = a(n);
|
|
607
607
|
if (!r) return "";
|
|
608
608
|
let i = (r.sectionId ? s(r.sectionId, r.columnIndex ?? 0) : e.content.value.blocks)?.[r.index];
|
|
609
|
-
return i ?
|
|
609
|
+
return i ? pn(i.type, t.t) : "";
|
|
610
610
|
}
|
|
611
611
|
function s(t, n) {
|
|
612
612
|
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
@@ -675,13 +675,13 @@ function ln(e, t) {
|
|
|
675
675
|
}
|
|
676
676
|
//#endregion
|
|
677
677
|
//#region src/composables/useUiTheme.ts
|
|
678
|
-
function
|
|
679
|
-
let t =
|
|
680
|
-
return { resolvedTheme:
|
|
678
|
+
function hn(e) {
|
|
679
|
+
let t = Je("(prefers-color-scheme: dark)");
|
|
680
|
+
return { resolvedTheme: M(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
681
681
|
}
|
|
682
682
|
//#endregion
|
|
683
683
|
//#region src/composables/useThemeStyles.ts
|
|
684
|
-
var
|
|
684
|
+
var gn = {
|
|
685
685
|
bg: "--tpl-bg",
|
|
686
686
|
bgElevated: "--tpl-bg-elevated",
|
|
687
687
|
bgHover: "--tpl-bg-hover",
|
|
@@ -705,10 +705,10 @@ var dn = {
|
|
|
705
705
|
dangerLight: "--tpl-danger-light",
|
|
706
706
|
canvasBg: "--tpl-canvas-bg"
|
|
707
707
|
};
|
|
708
|
-
function
|
|
709
|
-
return { themeStyles:
|
|
708
|
+
function _n({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
709
|
+
return { themeStyles: M(() => {
|
|
710
710
|
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
711
|
-
if (a) for (let [e, t] of Object.entries(
|
|
711
|
+
if (a) for (let [e, t] of Object.entries(gn)) {
|
|
712
712
|
let n = a[e];
|
|
713
713
|
n && (r[t] = n);
|
|
714
714
|
}
|
|
@@ -717,38 +717,38 @@ function fn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
|
717
717
|
}
|
|
718
718
|
//#endregion
|
|
719
719
|
//#region src/utils/logger.ts
|
|
720
|
-
var
|
|
721
|
-
function
|
|
720
|
+
var vn = "[Templatical]";
|
|
721
|
+
function yn() {
|
|
722
722
|
return typeof process < "u" && process.env.NODE_ENV === "production";
|
|
723
723
|
}
|
|
724
|
-
var
|
|
724
|
+
var bn = {
|
|
725
725
|
warn(...e) {
|
|
726
|
-
console.warn(
|
|
726
|
+
console.warn(vn, ...e);
|
|
727
727
|
},
|
|
728
728
|
error(...e) {
|
|
729
|
-
console.error(
|
|
729
|
+
console.error(vn, ...e);
|
|
730
730
|
},
|
|
731
731
|
debug(...e) {
|
|
732
|
-
|
|
732
|
+
yn() || console.debug(vn, ...e);
|
|
733
733
|
},
|
|
734
734
|
info(...e) {
|
|
735
|
-
|
|
735
|
+
yn() || console.info(vn, ...e);
|
|
736
736
|
}
|
|
737
737
|
};
|
|
738
738
|
//#endregion
|
|
739
739
|
//#region src/composables/useBlockRegistry.ts
|
|
740
|
-
function
|
|
740
|
+
function xn() {
|
|
741
741
|
let e = v(/* @__PURE__ */ new Map());
|
|
742
742
|
function t(t, n) {
|
|
743
|
-
e.value.set(t, n),
|
|
743
|
+
e.value.set(t, n), te(e);
|
|
744
744
|
}
|
|
745
745
|
function n(t, n) {
|
|
746
746
|
let r = `custom:${t.type}`, i = {
|
|
747
747
|
component: n,
|
|
748
|
-
createBlock: () =>
|
|
748
|
+
createBlock: () => Te(t),
|
|
749
749
|
definition: t
|
|
750
750
|
};
|
|
751
|
-
e.value.set(r, i),
|
|
751
|
+
e.value.set(r, i), te(e);
|
|
752
752
|
}
|
|
753
753
|
function r(t) {
|
|
754
754
|
if (t.type === "custom") {
|
|
@@ -777,7 +777,7 @@ function gn() {
|
|
|
777
777
|
strictFilters: !1
|
|
778
778
|
}).parseAndRender(t.template, e.fieldValues);
|
|
779
779
|
} catch (t) {
|
|
780
|
-
return
|
|
780
|
+
return bn.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
781
781
|
}
|
|
782
782
|
}
|
|
783
783
|
function c(t) {
|
|
@@ -795,9 +795,9 @@ function gn() {
|
|
|
795
795
|
}
|
|
796
796
|
//#endregion
|
|
797
797
|
//#region src/composables/useCustomBlockStylesheets.ts
|
|
798
|
-
function
|
|
799
|
-
return
|
|
800
|
-
let n =
|
|
798
|
+
function Sn(e, t) {
|
|
799
|
+
return M(() => {
|
|
800
|
+
let n = Cn(e.value.blocks);
|
|
801
801
|
if (n.size === 0) return [];
|
|
802
802
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
803
803
|
for (let e of n) {
|
|
@@ -809,65 +809,65 @@ function _n(e, t) {
|
|
|
809
809
|
return i;
|
|
810
810
|
});
|
|
811
811
|
}
|
|
812
|
-
function
|
|
812
|
+
function Cn(e) {
|
|
813
813
|
let t = /* @__PURE__ */ new Set();
|
|
814
|
-
return
|
|
814
|
+
return wn(e, t), t;
|
|
815
815
|
}
|
|
816
|
-
function
|
|
816
|
+
function wn(e, t) {
|
|
817
817
|
for (let n of e) {
|
|
818
|
-
if (
|
|
818
|
+
if (le(n)) {
|
|
819
819
|
t.add(n.customType);
|
|
820
820
|
continue;
|
|
821
821
|
}
|
|
822
822
|
if (n.type === "section") {
|
|
823
823
|
let e = n.children;
|
|
824
824
|
if (!e) continue;
|
|
825
|
-
for (let n of e)
|
|
825
|
+
for (let n of e) wn(n, t);
|
|
826
826
|
}
|
|
827
827
|
}
|
|
828
828
|
}
|
|
829
829
|
//#endregion
|
|
830
830
|
//#region src/utils/registerBuiltInBlocks.ts
|
|
831
|
-
var
|
|
831
|
+
var Tn = [
|
|
832
832
|
{
|
|
833
833
|
type: "section",
|
|
834
|
-
createBlock:
|
|
834
|
+
createBlock: Ve
|
|
835
835
|
},
|
|
836
836
|
{
|
|
837
837
|
type: "title",
|
|
838
|
-
createBlock:
|
|
838
|
+
createBlock: ue
|
|
839
839
|
},
|
|
840
840
|
{
|
|
841
841
|
type: "paragraph",
|
|
842
|
-
createBlock:
|
|
842
|
+
createBlock: Re
|
|
843
843
|
},
|
|
844
844
|
{
|
|
845
845
|
type: "image",
|
|
846
|
-
createBlock:
|
|
846
|
+
createBlock: Ee
|
|
847
847
|
},
|
|
848
848
|
{
|
|
849
849
|
type: "button",
|
|
850
|
-
createBlock:
|
|
850
|
+
createBlock: Le
|
|
851
851
|
},
|
|
852
852
|
{
|
|
853
853
|
type: "divider",
|
|
854
|
-
createBlock:
|
|
854
|
+
createBlock: Me
|
|
855
855
|
},
|
|
856
856
|
{
|
|
857
857
|
type: "video",
|
|
858
|
-
createBlock:
|
|
858
|
+
createBlock: ze
|
|
859
859
|
},
|
|
860
860
|
{
|
|
861
861
|
type: "social",
|
|
862
|
-
createBlock:
|
|
862
|
+
createBlock: Se
|
|
863
863
|
},
|
|
864
864
|
{
|
|
865
865
|
type: "menu",
|
|
866
|
-
createBlock:
|
|
866
|
+
createBlock: be
|
|
867
867
|
},
|
|
868
868
|
{
|
|
869
869
|
type: "table",
|
|
870
|
-
createBlock:
|
|
870
|
+
createBlock: ve
|
|
871
871
|
},
|
|
872
872
|
{
|
|
873
873
|
type: "spacer",
|
|
@@ -875,15 +875,15 @@ var bn = [
|
|
|
875
875
|
},
|
|
876
876
|
{
|
|
877
877
|
type: "html",
|
|
878
|
-
createBlock:
|
|
878
|
+
createBlock: De
|
|
879
879
|
},
|
|
880
880
|
{
|
|
881
881
|
type: "countdown",
|
|
882
|
-
createBlock:
|
|
882
|
+
createBlock: we
|
|
883
883
|
}
|
|
884
884
|
];
|
|
885
|
-
function
|
|
886
|
-
for (let n of
|
|
885
|
+
function En(e, t) {
|
|
886
|
+
for (let n of Tn) {
|
|
887
887
|
let r = t[n.type];
|
|
888
888
|
r && e.registerBuiltIn(n.type, {
|
|
889
889
|
component: r,
|
|
@@ -893,12 +893,72 @@ function xn(e, t) {
|
|
|
893
893
|
}
|
|
894
894
|
//#endregion
|
|
895
895
|
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
896
|
-
function
|
|
896
|
+
function Dn(e) {
|
|
897
897
|
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
898
898
|
}
|
|
899
899
|
//#endregion
|
|
900
|
+
//#region src/utils/collectOffPaletteDefaults.ts
|
|
901
|
+
function On(e) {
|
|
902
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
903
|
+
}
|
|
904
|
+
function kn(e, t, n) {
|
|
905
|
+
let r = new Set(e.map((e) => Qe(e))), i = [], a = (e, t) => {
|
|
906
|
+
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(Qe(o)) && i.push(`${t}.${n}: ${o}`) : On(o) && a(o, `${t}.${n}`);
|
|
907
|
+
}, o = t;
|
|
908
|
+
for (let [e, t] of Object.entries(Ie)) {
|
|
909
|
+
let n = o?.[e];
|
|
910
|
+
a({
|
|
911
|
+
...t,
|
|
912
|
+
...On(n) ? n : {}
|
|
913
|
+
}, e);
|
|
914
|
+
}
|
|
915
|
+
return a({
|
|
916
|
+
...Ne,
|
|
917
|
+
...n ?? {}
|
|
918
|
+
}, "template"), i;
|
|
919
|
+
}
|
|
920
|
+
//#endregion
|
|
921
|
+
//#region src/utils/resolveFieldColors.ts
|
|
922
|
+
function An(e, t) {
|
|
923
|
+
let n = Ze({ presets: e.presets }, Ke), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
|
|
924
|
+
return {
|
|
925
|
+
presets: r ? t.presets : n.presets,
|
|
926
|
+
allowCustom: t.allowCustom !== !1 && i,
|
|
927
|
+
invalidPresets: n.invalidPresets,
|
|
928
|
+
emptyPresets: e.presets !== void 0 && e.presets.length === 0,
|
|
929
|
+
presetsInherited: r,
|
|
930
|
+
allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
|
|
931
|
+
};
|
|
932
|
+
}
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region src/utils/collectColorFieldIssues.ts
|
|
935
|
+
function jn(e, t) {
|
|
936
|
+
let n = [], r = (r, i) => {
|
|
937
|
+
let a = An(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
938
|
+
if (a.invalidPresets.length > 0 && n.push({
|
|
939
|
+
id: s("invalid-presets"),
|
|
940
|
+
message: `${o}: presets skipped invalid entries: ${a.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).` + (a.presetsInherited ? " No valid entries are left, so the field inherits colors.presets." : "")
|
|
941
|
+
}), a.emptyPresets && n.push({
|
|
942
|
+
id: s("empty-presets"),
|
|
943
|
+
message: `${o}: presets is empty — a field palette can only narrow the editor's, so an empty list is ignored and the field inherits colors.presets.`
|
|
944
|
+
}), a.allowCustomIgnored && n.push({
|
|
945
|
+
id: s("allow-custom-ignored"),
|
|
946
|
+
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
947
|
+
}), !a.allowCustom && a.presets.length > 0) {
|
|
948
|
+
let e = r.default ?? "", t = new Set(a.presets.map((e) => Qe(e)));
|
|
949
|
+
e !== "" && !t.has(Qe(e)) && n.push({
|
|
950
|
+
id: s("off-palette-default"),
|
|
951
|
+
message: `${o} locks custom colours, but its default ${e} falls outside the field's presets: ${a.presets.join(", ")}. New blocks start on a colour the picker can't reselect — set the default from the same palette.`
|
|
952
|
+
});
|
|
953
|
+
}
|
|
954
|
+
};
|
|
955
|
+
for (let t of e.fields) if (t.type === "color") r(t, t.key);
|
|
956
|
+
else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
|
|
957
|
+
return n;
|
|
958
|
+
}
|
|
959
|
+
//#endregion
|
|
900
960
|
//#region src/utils/keyboardShortcuts.ts
|
|
901
|
-
function
|
|
961
|
+
function Mn(e) {
|
|
902
962
|
for (let t of e.composedPath()) {
|
|
903
963
|
if (!(t instanceof HTMLElement)) continue;
|
|
904
964
|
if (t.isContentEditable) return !0;
|
|
@@ -907,14 +967,14 @@ function Cn(e) {
|
|
|
907
967
|
}
|
|
908
968
|
return !1;
|
|
909
969
|
}
|
|
910
|
-
function
|
|
970
|
+
function Nn(e, t) {
|
|
911
971
|
let n = e.metaKey || e.ctrlKey;
|
|
912
972
|
if (n && e.key.toLowerCase() === "s") {
|
|
913
973
|
e.preventDefault(), t.onSave?.();
|
|
914
974
|
return;
|
|
915
975
|
}
|
|
916
976
|
if (n && e.key.toLowerCase() === "z") {
|
|
917
|
-
if (
|
|
977
|
+
if (Mn(e)) return;
|
|
918
978
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
919
979
|
return;
|
|
920
980
|
}
|
|
@@ -922,11 +982,11 @@ function wn(e, t) {
|
|
|
922
982
|
t.selectBlock(null);
|
|
923
983
|
return;
|
|
924
984
|
}
|
|
925
|
-
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !
|
|
985
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !Mn(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
926
986
|
}
|
|
927
987
|
//#endregion
|
|
928
988
|
//#region src/utils/mergeTagLabelSegments.ts
|
|
929
|
-
function
|
|
989
|
+
function Pn(e, t, n) {
|
|
930
990
|
if (!e) return [];
|
|
931
991
|
let r = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), i = [], a = 0, o;
|
|
932
992
|
for (; (o = r.exec(e)) !== null;) {
|
|
@@ -935,12 +995,12 @@ function Tn(e, t, n) {
|
|
|
935
995
|
value: e.slice(a, o.index)
|
|
936
996
|
});
|
|
937
997
|
let r = o[0];
|
|
938
|
-
|
|
998
|
+
he(r, n) ? i.push({
|
|
939
999
|
type: "tag",
|
|
940
|
-
value:
|
|
941
|
-
}) :
|
|
1000
|
+
value: de(r, t)
|
|
1001
|
+
}) : ke(r, n) ? i.push({
|
|
942
1002
|
type: "tag",
|
|
943
|
-
value:
|
|
1003
|
+
value: fe(r, n)
|
|
944
1004
|
}) : i.push({
|
|
945
1005
|
type: "text",
|
|
946
1006
|
value: r
|
|
@@ -953,27 +1013,27 @@ function Tn(e, t, n) {
|
|
|
953
1013
|
}
|
|
954
1014
|
//#endregion
|
|
955
1015
|
//#region src/components/MergeTagPreviewText.vue
|
|
956
|
-
var
|
|
1016
|
+
var Fn = y({
|
|
957
1017
|
name: "MergeTagPreviewText",
|
|
958
1018
|
props: { text: {
|
|
959
1019
|
type: String,
|
|
960
1020
|
required: !0
|
|
961
1021
|
} },
|
|
962
1022
|
setup(e) {
|
|
963
|
-
let t =
|
|
964
|
-
return () => r.value.map((e, t) => e.type === "tag" ?
|
|
1023
|
+
let t = P(pt, []), n = P(ut, xe.liquid), r = M(() => Pn(e.text, t, n));
|
|
1024
|
+
return () => r.value.map((e, t) => e.type === "tag" ? ie("span", {
|
|
965
1025
|
key: t,
|
|
966
1026
|
class: "tpl-merge-tag-label"
|
|
967
1027
|
}, e.value) : e.value);
|
|
968
1028
|
}
|
|
969
|
-
}),
|
|
1029
|
+
}), In = { class: "tpl:text-center" }, Ln = ["href"], Rn = /* @__PURE__ */ y({
|
|
970
1030
|
__name: "ButtonBlock",
|
|
971
1031
|
props: {
|
|
972
1032
|
block: {},
|
|
973
1033
|
viewport: {}
|
|
974
1034
|
},
|
|
975
1035
|
setup(e) {
|
|
976
|
-
let t = e, n =
|
|
1036
|
+
let t = e, n = M(() => {
|
|
977
1037
|
let e = {
|
|
978
1038
|
display: "inline-block",
|
|
979
1039
|
padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
|
|
@@ -987,17 +1047,17 @@ var En = y({
|
|
|
987
1047
|
};
|
|
988
1048
|
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;
|
|
989
1049
|
});
|
|
990
|
-
return (t, r) => (f(), x("div",
|
|
1050
|
+
return (t, r) => (f(), x("div", In, [b("a", {
|
|
991
1051
|
href: e.block.url || "#",
|
|
992
1052
|
style: i(n.value),
|
|
993
1053
|
class: "tpl:cursor-default",
|
|
994
|
-
onClick: r[0] ||=
|
|
995
|
-
}, [w(
|
|
1054
|
+
onClick: r[0] ||= F(() => {}, ["prevent"])
|
|
1055
|
+
}, [w(Fn, { text: e.block.text }, null, 8, ["text"])], 12, Ln)]));
|
|
996
1056
|
}
|
|
997
|
-
}),
|
|
1057
|
+
}), zn = I("bookmark", [["path", {
|
|
998
1058
|
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",
|
|
999
1059
|
key: "oz39mx"
|
|
1000
|
-
}]]),
|
|
1060
|
+
}]]), Bn = I("box", [
|
|
1001
1061
|
["path", {
|
|
1002
1062
|
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",
|
|
1003
1063
|
key: "hh9hay"
|
|
@@ -1010,13 +1070,13 @@ var En = y({
|
|
|
1010
1070
|
d: "M12 22V12",
|
|
1011
1071
|
key: "d0xqtd"
|
|
1012
1072
|
}]
|
|
1013
|
-
]),
|
|
1073
|
+
]), Vn = I("code", [["path", {
|
|
1014
1074
|
d: "m16 18 6-6-6-6",
|
|
1015
1075
|
key: "eg8j8"
|
|
1016
1076
|
}], ["path", {
|
|
1017
1077
|
d: "m8 6-6 6 6 6",
|
|
1018
1078
|
key: "ppft3o"
|
|
1019
|
-
}]]),
|
|
1079
|
+
}]]), Hn = I("copy", [["rect", {
|
|
1020
1080
|
width: "14",
|
|
1021
1081
|
height: "14",
|
|
1022
1082
|
x: "8",
|
|
@@ -1027,7 +1087,7 @@ var En = y({
|
|
|
1027
1087
|
}], ["path", {
|
|
1028
1088
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",
|
|
1029
1089
|
key: "zix9uf"
|
|
1030
|
-
}]]),
|
|
1090
|
+
}]]), Un = I("eye-off", [
|
|
1031
1091
|
["path", {
|
|
1032
1092
|
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",
|
|
1033
1093
|
key: "ct8e1f"
|
|
@@ -1044,10 +1104,10 @@ var En = y({
|
|
|
1044
1104
|
d: "m2 2 20 20",
|
|
1045
1105
|
key: "1ooewy"
|
|
1046
1106
|
}]
|
|
1047
|
-
]),
|
|
1107
|
+
]), Wn = I("funnel", [["path", {
|
|
1048
1108
|
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",
|
|
1049
1109
|
key: "sc7q7i"
|
|
1050
|
-
}]]),
|
|
1110
|
+
}]]), Gn = I("grip-vertical", [
|
|
1051
1111
|
["circle", {
|
|
1052
1112
|
cx: "9",
|
|
1053
1113
|
cy: "12",
|
|
@@ -1084,7 +1144,7 @@ var En = y({
|
|
|
1084
1144
|
r: "1",
|
|
1085
1145
|
key: "f4zoj3"
|
|
1086
1146
|
}]
|
|
1087
|
-
]),
|
|
1147
|
+
]), Kn = I("image", [
|
|
1088
1148
|
["rect", {
|
|
1089
1149
|
width: "18",
|
|
1090
1150
|
height: "18",
|
|
@@ -1104,13 +1164,13 @@ var En = y({
|
|
|
1104
1164
|
d: "m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
1105
1165
|
key: "1xmnt7"
|
|
1106
1166
|
}]
|
|
1107
|
-
]),
|
|
1167
|
+
]), qn = I("navigation", [["polygon", {
|
|
1108
1168
|
points: "3 11 22 2 13 21 11 13 3 11",
|
|
1109
1169
|
key: "1ltx0t"
|
|
1110
|
-
}]]),
|
|
1170
|
+
}]]), Jn = I("puzzle", [["path", {
|
|
1111
1171
|
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",
|
|
1112
1172
|
key: "w46dr5"
|
|
1113
|
-
}]]),
|
|
1173
|
+
}]]), Yn = I("share-2", [
|
|
1114
1174
|
["circle", {
|
|
1115
1175
|
cx: "18",
|
|
1116
1176
|
cy: "5",
|
|
@@ -1143,7 +1203,7 @@ var En = y({
|
|
|
1143
1203
|
y2: "10.49",
|
|
1144
1204
|
key: "1n3mei"
|
|
1145
1205
|
}]
|
|
1146
|
-
]),
|
|
1206
|
+
]), Xn = I("table", [
|
|
1147
1207
|
["path", {
|
|
1148
1208
|
d: "M12 3v18",
|
|
1149
1209
|
key: "108xh3"
|
|
@@ -1164,7 +1224,7 @@ var En = y({
|
|
|
1164
1224
|
d: "M3 15h18",
|
|
1165
1225
|
key: "5xshup"
|
|
1166
1226
|
}]
|
|
1167
|
-
]),
|
|
1227
|
+
]), Zn = I("video", [["path", {
|
|
1168
1228
|
d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
|
|
1169
1229
|
key: "ftymec"
|
|
1170
1230
|
}], ["rect", {
|
|
@@ -1174,18 +1234,18 @@ var En = y({
|
|
|
1174
1234
|
height: "12",
|
|
1175
1235
|
rx: "2",
|
|
1176
1236
|
key: "158x01"
|
|
1177
|
-
}]]),
|
|
1237
|
+
}]]), Qn = ["innerHTML"], $n = [
|
|
1178
1238
|
"src",
|
|
1179
1239
|
"width",
|
|
1180
1240
|
"height"
|
|
1181
|
-
],
|
|
1241
|
+
], er = /* @__PURE__ */ y({
|
|
1182
1242
|
__name: "CustomBlockIcon",
|
|
1183
1243
|
props: {
|
|
1184
1244
|
icon: {},
|
|
1185
1245
|
size: {}
|
|
1186
1246
|
},
|
|
1187
1247
|
setup(e) {
|
|
1188
|
-
let t = e, n =
|
|
1248
|
+
let t = e, n = M(() => t.size ?? 20), r = M(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), a = M(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/")));
|
|
1189
1249
|
return (t, o) => r.value ? (f(), x("span", {
|
|
1190
1250
|
key: 0,
|
|
1191
1251
|
class: "tpl:inline-flex tpl:items-center tpl:justify-center",
|
|
@@ -1194,14 +1254,14 @@ var En = y({
|
|
|
1194
1254
|
height: `${n.value}px`
|
|
1195
1255
|
}),
|
|
1196
1256
|
innerHTML: e.icon
|
|
1197
|
-
}, null, 12,
|
|
1257
|
+
}, null, 12, Qn)) : a.value ? (f(), x("img", {
|
|
1198
1258
|
key: 1,
|
|
1199
1259
|
src: e.icon,
|
|
1200
1260
|
width: n.value,
|
|
1201
1261
|
height: n.value,
|
|
1202
1262
|
class: "tpl:inline-block",
|
|
1203
1263
|
alt: ""
|
|
1204
|
-
}, null, 8,
|
|
1264
|
+
}, null, 8, $n)) : (f(), D(k(Bn), {
|
|
1205
1265
|
key: 2,
|
|
1206
1266
|
size: n.value,
|
|
1207
1267
|
"stroke-width": 1.5
|
|
@@ -1210,16 +1270,16 @@ var En = y({
|
|
|
1210
1270
|
});
|
|
1211
1271
|
//#endregion
|
|
1212
1272
|
//#region src/composables/useEditorRoot.ts
|
|
1213
|
-
function
|
|
1214
|
-
return
|
|
1273
|
+
function tr() {
|
|
1274
|
+
return P(yt, document) ?? document;
|
|
1215
1275
|
}
|
|
1216
1276
|
//#endregion
|
|
1217
1277
|
//#region src/composables/useFocusTrap.ts
|
|
1218
|
-
var
|
|
1219
|
-
function
|
|
1220
|
-
let n =
|
|
1278
|
+
var nr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
1279
|
+
function rr(e, t) {
|
|
1280
|
+
let n = tr(), r = null, i = null, a = null;
|
|
1221
1281
|
function o() {
|
|
1222
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
1282
|
+
return e.value ? Array.from(e.value.querySelectorAll(nr)).filter((e) => e.offsetParent !== null) : [];
|
|
1223
1283
|
}
|
|
1224
1284
|
function s(e) {
|
|
1225
1285
|
if (e.key !== "Tab") return;
|
|
@@ -1234,7 +1294,7 @@ function Jn(e, t) {
|
|
|
1234
1294
|
a = null;
|
|
1235
1295
|
let t = o();
|
|
1236
1296
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
1237
|
-
}), i =
|
|
1297
|
+
}), i = et(e, "keydown", s);
|
|
1238
1298
|
}
|
|
1239
1299
|
function d(e = {}) {
|
|
1240
1300
|
let t = e.restoreFocus !== !1;
|
|
@@ -1249,8 +1309,8 @@ function Jn(e, t) {
|
|
|
1249
1309
|
}
|
|
1250
1310
|
//#endregion
|
|
1251
1311
|
//#region src/composables/useEmoji.ts
|
|
1252
|
-
function
|
|
1253
|
-
let [e, t] =
|
|
1312
|
+
function ir() {
|
|
1313
|
+
let [e, t] = We(!1), n = v([]), r = !1;
|
|
1254
1314
|
u(() => {
|
|
1255
1315
|
r = !0;
|
|
1256
1316
|
}), c(e, async (e) => {
|
|
@@ -1275,7 +1335,7 @@ function Yn() {
|
|
|
1275
1335
|
}
|
|
1276
1336
|
//#endregion
|
|
1277
1337
|
//#region src/composables/useDragDrop.ts
|
|
1278
|
-
function
|
|
1338
|
+
function ar(e) {
|
|
1279
1339
|
let { onBlockMove: t, onBlockAdd: n } = e, r = _(!1), i = _(null), a = _(null);
|
|
1280
1340
|
function o(e) {
|
|
1281
1341
|
r.value = !0, i.value = e;
|
|
@@ -1325,7 +1385,7 @@ function Xn(e) {
|
|
|
1325
1385
|
}
|
|
1326
1386
|
//#endregion
|
|
1327
1387
|
//#region src/composables/useFonts.ts
|
|
1328
|
-
var
|
|
1388
|
+
var or = [
|
|
1329
1389
|
{
|
|
1330
1390
|
value: "Arial",
|
|
1331
1391
|
label: "Arial"
|
|
@@ -1354,7 +1414,7 @@ var Zn = [
|
|
|
1354
1414
|
value: "Courier New",
|
|
1355
1415
|
label: "Courier New"
|
|
1356
1416
|
}
|
|
1357
|
-
],
|
|
1417
|
+
], sr = {
|
|
1358
1418
|
arial: "Arial, sans-serif",
|
|
1359
1419
|
helvetica: "Helvetica, sans-serif",
|
|
1360
1420
|
georgia: "Georgia, serif",
|
|
@@ -1362,91 +1422,107 @@ var Zn = [
|
|
|
1362
1422
|
verdana: "Verdana, sans-serif",
|
|
1363
1423
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1364
1424
|
"courier new": "'Courier New', monospace"
|
|
1365
|
-
},
|
|
1366
|
-
function
|
|
1367
|
-
|
|
1368
|
-
|
|
1425
|
+
}, cr = "Arial, sans-serif";
|
|
1426
|
+
function lr(e) {
|
|
1427
|
+
if (e === void 0 || e === !0) return [...or];
|
|
1428
|
+
if (e === !1) return [];
|
|
1429
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1430
|
+
for (let i of e) {
|
|
1431
|
+
let e = i.toLowerCase(), a = or.find((t) => t.value.toLowerCase() === e);
|
|
1432
|
+
if (!a) {
|
|
1433
|
+
r.has(e) || (r.add(e), bn.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${or.map((e) => e.value).join(", ")}.`));
|
|
1434
|
+
continue;
|
|
1435
|
+
}
|
|
1436
|
+
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1437
|
+
}
|
|
1438
|
+
return t;
|
|
1439
|
+
}
|
|
1440
|
+
function ur(e) {
|
|
1441
|
+
let t = _(e?.customFonts ?? []), n = _(!0), r = _(!1), i = lr(e?.builtIns), a = M(() => e?.defaultFallback ?? cr);
|
|
1442
|
+
function o(e) {
|
|
1369
1443
|
n.value = e;
|
|
1370
1444
|
}
|
|
1371
|
-
let
|
|
1372
|
-
let e = [...
|
|
1445
|
+
let c = M(() => {
|
|
1446
|
+
let e = [...i];
|
|
1373
1447
|
if (!n.value) return e.sort((e, t) => e.label.localeCompare(t.label));
|
|
1374
1448
|
let r = t.value.map((e) => ({
|
|
1375
1449
|
value: e.name,
|
|
1376
1450
|
label: e.name,
|
|
1377
1451
|
isCustom: !0
|
|
1378
|
-
})),
|
|
1379
|
-
return
|
|
1452
|
+
})), a = [...e, ...r];
|
|
1453
|
+
return a.sort((e, t) => e.label.localeCompare(t.label)), a;
|
|
1380
1454
|
});
|
|
1381
|
-
function c(e) {
|
|
1382
|
-
return o.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1383
|
-
}
|
|
1384
1455
|
function l(e) {
|
|
1385
|
-
return
|
|
1456
|
+
return c.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1386
1457
|
}
|
|
1387
|
-
|
|
1458
|
+
let d = e?.defaultFont ?? cr.split(",")[0].trim();
|
|
1459
|
+
l(d) || bn.warn(`config.fonts: new templates seed "${d}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
|
|
1460
|
+
function f(e) {
|
|
1461
|
+
return or.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1462
|
+
}
|
|
1463
|
+
function p() {
|
|
1388
1464
|
if (e?.defaultFont) {
|
|
1389
|
-
if (!n.value && !
|
|
1390
|
-
if (
|
|
1391
|
-
let t =
|
|
1465
|
+
if (!n.value && !f(e.defaultFont)) return cr;
|
|
1466
|
+
if (l(e.defaultFont)) {
|
|
1467
|
+
let t = c.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1392
1468
|
if (t) return t.value;
|
|
1393
1469
|
}
|
|
1394
1470
|
}
|
|
1395
|
-
return
|
|
1471
|
+
return cr;
|
|
1396
1472
|
}
|
|
1397
|
-
let
|
|
1398
|
-
function
|
|
1399
|
-
if (!e) return
|
|
1473
|
+
let m = M(() => p());
|
|
1474
|
+
function h(e) {
|
|
1475
|
+
if (!e) return a.value;
|
|
1400
1476
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1401
1477
|
if (n) {
|
|
1402
|
-
let e = n.fallback ??
|
|
1478
|
+
let e = n.fallback ?? a.value;
|
|
1403
1479
|
return `'${n.name}', ${e}`;
|
|
1404
1480
|
}
|
|
1405
|
-
return
|
|
1481
|
+
return sr[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${a.value}`);
|
|
1406
1482
|
}
|
|
1407
|
-
let
|
|
1408
|
-
async function
|
|
1483
|
+
let g = [], v = !1;
|
|
1484
|
+
async function y() {
|
|
1409
1485
|
if (t.value.length === 0) {
|
|
1410
|
-
|
|
1486
|
+
v || (r.value = !0);
|
|
1411
1487
|
return;
|
|
1412
1488
|
}
|
|
1413
1489
|
let e = t.value.map(async (e) => {
|
|
1414
1490
|
try {
|
|
1415
1491
|
if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
|
|
1416
1492
|
let t = document.createElement("link");
|
|
1417
|
-
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name),
|
|
1493
|
+
t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), g.push(t), await new Promise((n, r) => {
|
|
1418
1494
|
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1419
1495
|
});
|
|
1420
1496
|
} catch (t) {
|
|
1421
|
-
|
|
1497
|
+
bn.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1422
1498
|
}
|
|
1423
1499
|
});
|
|
1424
|
-
await Promise.allSettled(e), !
|
|
1500
|
+
await Promise.allSettled(e), !v && (r.value = !0);
|
|
1425
1501
|
}
|
|
1426
|
-
function
|
|
1427
|
-
for (let e of
|
|
1428
|
-
|
|
1502
|
+
function b() {
|
|
1503
|
+
for (let e of g) e.remove();
|
|
1504
|
+
g.length = 0;
|
|
1429
1505
|
}
|
|
1430
1506
|
return s() && u(() => {
|
|
1431
|
-
|
|
1507
|
+
v = !0, b();
|
|
1432
1508
|
}), {
|
|
1433
|
-
fonts:
|
|
1434
|
-
defaultFont:
|
|
1435
|
-
defaultFallback:
|
|
1509
|
+
fonts: c,
|
|
1510
|
+
defaultFont: m,
|
|
1511
|
+
defaultFallback: a,
|
|
1436
1512
|
customFonts: t,
|
|
1437
1513
|
customFontsEnabled: n,
|
|
1438
1514
|
isLoaded: r,
|
|
1439
|
-
setCustomFontsEnabled:
|
|
1440
|
-
loadCustomFonts:
|
|
1441
|
-
cleanupFontLinks:
|
|
1442
|
-
getFontWithFallback:
|
|
1443
|
-
getDefaultFont:
|
|
1515
|
+
setCustomFontsEnabled: o,
|
|
1516
|
+
loadCustomFonts: y,
|
|
1517
|
+
cleanupFontLinks: b,
|
|
1518
|
+
getFontWithFallback: h,
|
|
1519
|
+
getDefaultFont: p
|
|
1444
1520
|
};
|
|
1445
1521
|
}
|
|
1446
1522
|
//#endregion
|
|
1447
1523
|
//#region src/composables/useLogicTag.ts
|
|
1448
|
-
function
|
|
1449
|
-
let e =
|
|
1524
|
+
function dr() {
|
|
1525
|
+
let e = P(rt, []), t = P(ft, []), n = P(ut, xe.liquid), r = P(Ct, null), i = P(jt, null), a = _(!1), o = !!r || e.length > 0 || t.length > 0, s = e.length > 0 || t.length > 0;
|
|
1450
1526
|
async function c() {
|
|
1451
1527
|
if (r) {
|
|
1452
1528
|
a.value = !0;
|
|
@@ -1477,12 +1553,12 @@ function tr() {
|
|
|
1477
1553
|
}
|
|
1478
1554
|
//#endregion
|
|
1479
1555
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
1480
|
-
function
|
|
1481
|
-
return
|
|
1556
|
+
function fr(e, t, n) {
|
|
1557
|
+
return ke(e, n) ? {
|
|
1482
1558
|
type: "logicMergeTagNode",
|
|
1483
1559
|
attrs: {
|
|
1484
1560
|
value: e,
|
|
1485
|
-
keyword:
|
|
1561
|
+
keyword: fe(e, n)
|
|
1486
1562
|
}
|
|
1487
1563
|
} : {
|
|
1488
1564
|
type: "mergeTagNode",
|
|
@@ -1494,15 +1570,15 @@ function nr(e, t, n) {
|
|
|
1494
1570
|
}
|
|
1495
1571
|
//#endregion
|
|
1496
1572
|
//#region src/utils/insertLogicTag.ts
|
|
1497
|
-
function
|
|
1573
|
+
function pr(e) {
|
|
1498
1574
|
return "before" in e && "after" in e;
|
|
1499
1575
|
}
|
|
1500
|
-
function
|
|
1501
|
-
if (!
|
|
1502
|
-
e.chain().focus().insertContent(
|
|
1576
|
+
function mr(e, t, n) {
|
|
1577
|
+
if (!pr(t)) {
|
|
1578
|
+
e.chain().focus().insertContent(fr(t.value, t.label, n)).run();
|
|
1503
1579
|
return;
|
|
1504
1580
|
}
|
|
1505
|
-
let r =
|
|
1581
|
+
let r = fr(t.before, t.label, n), i = fr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
1506
1582
|
if (a !== o) {
|
|
1507
1583
|
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
1508
1584
|
return;
|
|
@@ -1511,20 +1587,20 @@ function ir(e, t, n) {
|
|
|
1511
1587
|
}
|
|
1512
1588
|
//#endregion
|
|
1513
1589
|
//#region src/utils/linkColorExtension.ts
|
|
1514
|
-
function
|
|
1590
|
+
function hr(e) {
|
|
1515
1591
|
if (!e) return null;
|
|
1516
1592
|
let t = e.trim();
|
|
1517
1593
|
return /^#[0-9a-f]{3,8}$/i.test(t) || /^(rgb|rgba|hsl|hsla)\(\s*[0-9.,%/\s]+\)$/i.test(t) || /^[a-z]+$/i.test(t) ? t : null;
|
|
1518
1594
|
}
|
|
1519
|
-
function
|
|
1595
|
+
function gr(e) {
|
|
1520
1596
|
return e.extend({ addAttributes() {
|
|
1521
1597
|
return {
|
|
1522
1598
|
...this.parent?.(),
|
|
1523
1599
|
color: {
|
|
1524
1600
|
default: null,
|
|
1525
|
-
parseHTML: (e) =>
|
|
1601
|
+
parseHTML: (e) => hr(Ye(e.style.color)),
|
|
1526
1602
|
renderHTML: (e) => {
|
|
1527
|
-
let t =
|
|
1603
|
+
let t = hr(e.color);
|
|
1528
1604
|
return t ? { style: `color: ${t}` } : {};
|
|
1529
1605
|
}
|
|
1530
1606
|
}
|
|
@@ -1533,9 +1609,9 @@ function or(e) {
|
|
|
1533
1609
|
}
|
|
1534
1610
|
//#endregion
|
|
1535
1611
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
1536
|
-
function
|
|
1612
|
+
function _r(e) {
|
|
1537
1613
|
let t = _(!1), n = _(""), r = _(""), i = _(null);
|
|
1538
|
-
|
|
1614
|
+
rr(i, t);
|
|
1539
1615
|
function a() {
|
|
1540
1616
|
let i = e.value?.getAttributes("link") ?? {};
|
|
1541
1617
|
n.value = i.href || "", r.value = i.color || "", t.value = !0;
|
|
@@ -1544,7 +1620,7 @@ function sr(e) {
|
|
|
1544
1620
|
if (n.value) {
|
|
1545
1621
|
let t = c(n.value);
|
|
1546
1622
|
if (t !== null) {
|
|
1547
|
-
let n =
|
|
1623
|
+
let n = hr(r.value), i = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
1548
1624
|
n && typeof e.value?.commands.unsetColor == "function" && i?.unsetColor(), i?.run();
|
|
1549
1625
|
}
|
|
1550
1626
|
}
|
|
@@ -1591,10 +1667,10 @@ function sr(e) {
|
|
|
1591
1667
|
}
|
|
1592
1668
|
//#endregion
|
|
1593
1669
|
//#region src/composables/useRichTextEditor.ts
|
|
1594
|
-
function
|
|
1595
|
-
let t =
|
|
1596
|
-
async function
|
|
1597
|
-
|
|
1670
|
+
function vr(e) {
|
|
1671
|
+
let t = P(bt, null), { mergeTags: n, canRequestMergeTag: r, isRequesting: i, requestMergeTag: a, syntax: o, autocomplete: s } = Ht(), { canInsertLogicTag: l, isRequesting: u, requestLogicTag: d } = dr(), f = P(dt, null), p = (g(f) ? f.value : f)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", m = Ae(o), y = v(null), { showLinkDialog: b, linkUrl: x, linkColor: S, linkDialogRef: C, openLinkDialog: w, insertLink: T, removeLink: E, closeLinkDialog: D, handleLinkKeydown: O } = _r(y), { start: k, stop: A } = Ge(() => y.value?.commands.focus("end"), 0, { immediate: !1 }), j = v(null), ee = _(!0), M = _(null), te = !1;
|
|
1672
|
+
async function N() {
|
|
1673
|
+
M.value = null, ee.value = !0;
|
|
1598
1674
|
try {
|
|
1599
1675
|
let { TiptapEditor: r, EC: i, extensions: a } = await e.loadExtensions({
|
|
1600
1676
|
mergeTags: n,
|
|
@@ -1603,8 +1679,8 @@ function cr(e) {
|
|
|
1603
1679
|
autocompleteEnabled: s,
|
|
1604
1680
|
suggestionEmptyText: p
|
|
1605
1681
|
});
|
|
1606
|
-
if (
|
|
1607
|
-
|
|
1682
|
+
if (te) return;
|
|
1683
|
+
j.value = i;
|
|
1608
1684
|
let c = /* @__PURE__ */ new Map();
|
|
1609
1685
|
a.forEach((e, t) => c.set(e.name, t));
|
|
1610
1686
|
let l = new r({
|
|
@@ -1612,27 +1688,27 @@ function cr(e) {
|
|
|
1612
1688
|
content: e.blockContent(),
|
|
1613
1689
|
editable: !0,
|
|
1614
1690
|
onUpdate: ({ editor: n }) => {
|
|
1615
|
-
|
|
1691
|
+
te || t && t.updateBlock(e.blockId(), { content: n.getHTML() });
|
|
1616
1692
|
}
|
|
1617
1693
|
});
|
|
1618
|
-
if (
|
|
1694
|
+
if (te) {
|
|
1619
1695
|
l.destroy();
|
|
1620
1696
|
return;
|
|
1621
1697
|
}
|
|
1622
|
-
y.value = l,
|
|
1698
|
+
y.value = l, ee.value = !1, k();
|
|
1623
1699
|
} catch (t) {
|
|
1624
|
-
if (
|
|
1625
|
-
|
|
1700
|
+
if (te) return;
|
|
1701
|
+
bn.error(`[${e.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, t), M.value = t instanceof Error ? t.message : "Failed to load editor", ee.value = !1;
|
|
1626
1702
|
}
|
|
1627
1703
|
}
|
|
1628
|
-
function
|
|
1629
|
-
y.value?.destroy(), y.value = null,
|
|
1704
|
+
function ne() {
|
|
1705
|
+
y.value?.destroy(), y.value = null, N();
|
|
1630
1706
|
}
|
|
1631
|
-
|
|
1632
|
-
let
|
|
1707
|
+
N();
|
|
1708
|
+
let re = c(() => e.blockContent(), (e) => {
|
|
1633
1709
|
y.value && y.value.getHTML() !== e && y.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1634
1710
|
});
|
|
1635
|
-
function
|
|
1711
|
+
function ie(t) {
|
|
1636
1712
|
if (i.value || u.value) return;
|
|
1637
1713
|
let n = t.composedPath(), r = n.find((e) => e instanceof HTMLElement);
|
|
1638
1714
|
if (!r) return;
|
|
@@ -1640,26 +1716,26 @@ function cr(e) {
|
|
|
1640
1716
|
let a = n.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
1641
1717
|
r.closest(".tpl-text-editor-wrapper") || r.closest(".tpl-text-toolbar") || r.closest(".tpl-link-dialog") || a || e.onDone();
|
|
1642
1718
|
}
|
|
1643
|
-
|
|
1644
|
-
|
|
1719
|
+
et(document, "mousedown", ie), h(() => {
|
|
1720
|
+
te = !0, re(), A(), y.value?.destroy();
|
|
1645
1721
|
});
|
|
1646
|
-
async function
|
|
1722
|
+
async function ae() {
|
|
1647
1723
|
let e = await a();
|
|
1648
|
-
|
|
1724
|
+
te || (e && y.value ? y.value.chain().focus().insertMergeTag({
|
|
1649
1725
|
label: e.label,
|
|
1650
1726
|
value: e.value
|
|
1651
1727
|
}).run() : y.value?.commands.focus());
|
|
1652
1728
|
}
|
|
1653
|
-
async function
|
|
1729
|
+
async function F() {
|
|
1654
1730
|
let e = await d();
|
|
1655
|
-
|
|
1731
|
+
te || (e && y.value ? mr(y.value, e, o) : y.value?.commands.focus());
|
|
1656
1732
|
}
|
|
1657
1733
|
return {
|
|
1658
1734
|
editor: y,
|
|
1659
|
-
EditorContent:
|
|
1660
|
-
isLoading:
|
|
1661
|
-
initError:
|
|
1662
|
-
retry:
|
|
1735
|
+
EditorContent: j,
|
|
1736
|
+
isLoading: ee,
|
|
1737
|
+
initError: M,
|
|
1738
|
+
retry: ne,
|
|
1663
1739
|
showLinkDialog: b,
|
|
1664
1740
|
linkUrl: x,
|
|
1665
1741
|
linkColor: S,
|
|
@@ -1675,36 +1751,36 @@ function cr(e) {
|
|
|
1675
1751
|
removeLink: E,
|
|
1676
1752
|
closeLinkDialog: D,
|
|
1677
1753
|
handleLinkKeydown: O,
|
|
1678
|
-
handleAddMergeTag:
|
|
1679
|
-
handleAddLogicTag:
|
|
1754
|
+
handleAddMergeTag: ae,
|
|
1755
|
+
handleAddLogicTag: F
|
|
1680
1756
|
};
|
|
1681
1757
|
}
|
|
1682
1758
|
//#endregion
|
|
1683
1759
|
//#region src/composables/useSmallScreenNotice.ts
|
|
1684
|
-
var
|
|
1685
|
-
function
|
|
1686
|
-
let t =
|
|
1760
|
+
var yr = "(max-width: 767px)";
|
|
1761
|
+
function br(e) {
|
|
1762
|
+
let t = Je(yr);
|
|
1687
1763
|
return {
|
|
1688
1764
|
isSmallScreen: t,
|
|
1689
|
-
showNotice:
|
|
1765
|
+
showNotice: M(() => (S(e) ?? !0) && t.value)
|
|
1690
1766
|
};
|
|
1691
1767
|
}
|
|
1692
1768
|
//#endregion
|
|
1693
1769
|
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1694
|
-
var
|
|
1770
|
+
var xr = { class: "tpl:w-full" }, Sr = {
|
|
1695
1771
|
key: 0,
|
|
1696
1772
|
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)]"
|
|
1697
|
-
},
|
|
1773
|
+
}, Cr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, wr = {
|
|
1698
1774
|
key: 1,
|
|
1699
1775
|
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)]"
|
|
1700
|
-
},
|
|
1776
|
+
}, Tr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Er = {
|
|
1701
1777
|
key: 2,
|
|
1702
1778
|
class: "tpl:relative"
|
|
1703
|
-
},
|
|
1779
|
+
}, Dr = ["innerHTML"], Or = {
|
|
1704
1780
|
key: 0,
|
|
1705
1781
|
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]",
|
|
1706
1782
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
1707
|
-
},
|
|
1783
|
+
}, kr = /* @__PURE__ */ y({
|
|
1708
1784
|
__name: "CustomBlock",
|
|
1709
1785
|
props: {
|
|
1710
1786
|
block: {},
|
|
@@ -1712,9 +1788,9 @@ var dr = { class: "tpl:w-full" }, fr = {
|
|
|
1712
1788
|
},
|
|
1713
1789
|
emits: ["fetchData"],
|
|
1714
1790
|
setup(e, { emit: t }) {
|
|
1715
|
-
let n = e, r = t, { t: i } =
|
|
1791
|
+
let n = e, r = t, { t: i } = Ft(), o = P(Dt, null), s = _(""), l = _(!1), u = M(() => o?.getDefinition(n.block.customType)), d = M(() => !!u.value), { isFetching: m, fetch: h, needsFetch: g, hasDataSource: v } = en({
|
|
1716
1792
|
definition: u,
|
|
1717
|
-
block:
|
|
1793
|
+
block: M(() => n.block),
|
|
1718
1794
|
onUpdate: (e, t) => {
|
|
1719
1795
|
r("fetchData", {
|
|
1720
1796
|
fieldValues: e,
|
|
@@ -1733,65 +1809,65 @@ var dr = { class: "tpl:w-full" }, fr = {
|
|
|
1733
1809
|
}
|
|
1734
1810
|
}
|
|
1735
1811
|
}
|
|
1736
|
-
let S =
|
|
1812
|
+
let S = He(y, 150);
|
|
1737
1813
|
return a(() => {
|
|
1738
1814
|
y();
|
|
1739
1815
|
}), c(() => n.block.fieldValues, () => {
|
|
1740
1816
|
S();
|
|
1741
|
-
}, { deep: !0 }), (e, t) => (f(), x("div",
|
|
1817
|
+
}, { deep: !0 }), (e, t) => (f(), x("div", xr, [d.value ? l.value ? (f(), x("div", wr, [w(k(zt), {
|
|
1742
1818
|
size: 24,
|
|
1743
1819
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
1744
|
-
}), b("span",
|
|
1820
|
+
}), b("span", Tr, p(k(i).customBlocks.renderError), 1)])) : (f(), x("div", Er, [b("div", { innerHTML: s.value }, null, 8, Dr), k(v) && k(g) ? (f(), x("div", Or, [k(m) ? (f(), D(Bt, {
|
|
1745
1821
|
key: 1,
|
|
1746
1822
|
class: "tpl:w-48"
|
|
1747
1823
|
})) : (f(), x("button", {
|
|
1748
1824
|
key: 0,
|
|
1749
1825
|
type: "button",
|
|
1750
1826
|
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)]",
|
|
1751
|
-
onClick: t[0] ||=
|
|
1752
|
-
}, [u.value?.icon ? (f(), D(
|
|
1827
|
+
onClick: t[0] ||= F((...e) => k(h) && k(h)(...e), ["stop"])
|
|
1828
|
+
}, [u.value?.icon ? (f(), D(er, {
|
|
1753
1829
|
key: 0,
|
|
1754
1830
|
icon: u.value.icon,
|
|
1755
1831
|
size: 16
|
|
1756
|
-
}, null, 8, ["icon"])) :
|
|
1832
|
+
}, null, 8, ["icon"])) : N("", !0), O(" " + p(u.value?.dataSource?.label || k(i).customBlocks.dataSource.fetchButton), 1)]))])) : N("", !0)])) : (f(), x("div", Sr, [w(k(Jn), {
|
|
1757
1833
|
size: 24,
|
|
1758
1834
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
1759
|
-
}), b("span",
|
|
1835
|
+
}), b("span", Cr, p(k(i).customBlocks.definitionNotFound), 1)]))]));
|
|
1760
1836
|
}
|
|
1761
|
-
}),
|
|
1837
|
+
}), Ar = { class: "tpl:w-full" }, jr = /* @__PURE__ */ y({
|
|
1762
1838
|
__name: "DividerBlock",
|
|
1763
1839
|
props: {
|
|
1764
1840
|
block: {},
|
|
1765
1841
|
viewport: {}
|
|
1766
1842
|
},
|
|
1767
1843
|
setup(e) {
|
|
1768
|
-
let t = e, n =
|
|
1844
|
+
let t = e, n = M(() => ({
|
|
1769
1845
|
borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
|
|
1770
1846
|
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
1771
1847
|
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
1772
1848
|
}));
|
|
1773
|
-
return (e, t) => (f(), x("div",
|
|
1849
|
+
return (e, t) => (f(), x("div", Ar, [b("hr", {
|
|
1774
1850
|
class: "tpl:m-0 tpl:border-none",
|
|
1775
1851
|
style: i(n.value)
|
|
1776
1852
|
}, null, 4)]));
|
|
1777
1853
|
}
|
|
1778
|
-
}),
|
|
1854
|
+
}), Mr = { class: "tpl:w-full" }, Nr = ["srcdoc", "title"], Pr = {
|
|
1779
1855
|
key: 1,
|
|
1780
1856
|
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)]"
|
|
1781
|
-
},
|
|
1857
|
+
}, Fr = {
|
|
1782
1858
|
key: 0,
|
|
1783
1859
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
1784
|
-
},
|
|
1860
|
+
}, Ir = {
|
|
1785
1861
|
key: 1,
|
|
1786
1862
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
1787
|
-
},
|
|
1863
|
+
}, Lr = /* @__PURE__ */ y({
|
|
1788
1864
|
__name: "HtmlBlock",
|
|
1789
1865
|
props: {
|
|
1790
1866
|
block: {},
|
|
1791
1867
|
viewport: {}
|
|
1792
1868
|
},
|
|
1793
1869
|
setup(e) {
|
|
1794
|
-
let t = e, { t: n } =
|
|
1870
|
+
let t = e, { t: n } = Ft(), r = P(Nt, !1), a = M(() => t.block.content.trim().length > 0), o = M(() => r && a.value), s = _(null), l = _(60), u = null;
|
|
1795
1871
|
function d() {
|
|
1796
1872
|
let e = s.value?.contentDocument;
|
|
1797
1873
|
e && (l.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
@@ -1805,7 +1881,7 @@ var dr = { class: "tpl:w-full" }, fr = {
|
|
|
1805
1881
|
e || (u?.disconnect(), u = null);
|
|
1806
1882
|
}), h(() => {
|
|
1807
1883
|
u?.disconnect(), u = null;
|
|
1808
|
-
}), (t, r) => (f(), x("div",
|
|
1884
|
+
}), (t, r) => (f(), x("div", Mr, [o.value ? (f(), x("iframe", {
|
|
1809
1885
|
key: 0,
|
|
1810
1886
|
ref_key: "iframeRef",
|
|
1811
1887
|
ref: s,
|
|
@@ -1815,36 +1891,36 @@ var dr = { class: "tpl:w-full" }, fr = {
|
|
|
1815
1891
|
class: "tpl:block tpl:w-full tpl:border-0",
|
|
1816
1892
|
style: i({ height: `${l.value}px` }),
|
|
1817
1893
|
onLoad: m
|
|
1818
|
-
}, null, 44,
|
|
1894
|
+
}, null, 44, Nr)) : (f(), x("div", Pr, [w(k(Vn), {
|
|
1819
1895
|
size: 24,
|
|
1820
1896
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1821
|
-
}), a.value ? (f(), x("span",
|
|
1897
|
+
}), a.value ? (f(), x("span", Fr, p(k(n).html.preview), 1)) : (f(), x("span", Ir, p(k(n).html.empty), 1))]))]));
|
|
1822
1898
|
}
|
|
1823
|
-
}),
|
|
1824
|
-
function
|
|
1825
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || S(r), { isOverDropZone: a } =
|
|
1899
|
+
}), Rr = "image/";
|
|
1900
|
+
function zr(e) {
|
|
1901
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || S(r), { isOverDropZone: a } = qe(t, {
|
|
1826
1902
|
preventDefaultForUnhandled: !0,
|
|
1827
1903
|
onDrop: (e) => {
|
|
1828
1904
|
if (!i()) return;
|
|
1829
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
1905
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(Rr));
|
|
1830
1906
|
t.length > 0 && n([t[0]]);
|
|
1831
1907
|
}
|
|
1832
1908
|
});
|
|
1833
|
-
return { isOver:
|
|
1909
|
+
return { isOver: M(() => i() && a.value) };
|
|
1834
1910
|
}
|
|
1835
1911
|
//#endregion
|
|
1836
1912
|
//#region src/components/blocks/ImageBlock.vue?vue&type=script&setup=true&lang.ts
|
|
1837
|
-
var
|
|
1913
|
+
var Br = {
|
|
1838
1914
|
key: 0,
|
|
1839
1915
|
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)]",
|
|
1840
1916
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
1841
|
-
},
|
|
1917
|
+
}, Vr = ["href"], Hr = ["src", "alt"], Ur = ["src", "alt"], Wr = {
|
|
1842
1918
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
1843
1919
|
style: { opacity: "0.7" }
|
|
1844
|
-
},
|
|
1920
|
+
}, Gr = ["href"], Kr = ["src", "alt"], qr = ["src", "alt"], Jr = {
|
|
1845
1921
|
key: 4,
|
|
1846
1922
|
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)]"
|
|
1847
|
-
},
|
|
1923
|
+
}, Yr = ["aria-label"], Xr = { key: 1 }, Zr = /* @__PURE__ */ y({
|
|
1848
1924
|
__name: "ImageBlock",
|
|
1849
1925
|
props: {
|
|
1850
1926
|
block: {},
|
|
@@ -1852,7 +1928,7 @@ var Ar = {
|
|
|
1852
1928
|
},
|
|
1853
1929
|
emits: ["update"],
|
|
1854
1930
|
setup(e, { emit: t }) {
|
|
1855
|
-
let n = e, r = t, { t: a } =
|
|
1931
|
+
let n = e, r = t, { t: a } = Ft(), { syntax: o } = Ht(), s = P(tt, null), c = M(() => !!s), l = Ut();
|
|
1856
1932
|
async function u() {
|
|
1857
1933
|
let e = await s?.({ accept: ["images"] });
|
|
1858
1934
|
if (l.alive && e) {
|
|
@@ -1860,7 +1936,7 @@ var Ar = {
|
|
|
1860
1936
|
e.alt && (t.alt = e.alt), r("update", t);
|
|
1861
1937
|
}
|
|
1862
1938
|
}
|
|
1863
|
-
let d = _(), m = _(!1), h =
|
|
1939
|
+
let d = _(), m = _(!1), h = M(() => c.value && !m.value && !C.value);
|
|
1864
1940
|
async function g(e) {
|
|
1865
1941
|
if (s) {
|
|
1866
1942
|
m.value = !0;
|
|
@@ -1879,11 +1955,11 @@ var Ar = {
|
|
|
1879
1955
|
}
|
|
1880
1956
|
}
|
|
1881
1957
|
}
|
|
1882
|
-
let { isOver: v } =
|
|
1958
|
+
let { isOver: v } = zr({
|
|
1883
1959
|
target: d,
|
|
1884
1960
|
enabled: h,
|
|
1885
1961
|
onFiles: g
|
|
1886
|
-
}), y =
|
|
1962
|
+
}), y = M(() => ({ textAlign: n.block.align })), S = M(() => {
|
|
1887
1963
|
let e = n.block.align;
|
|
1888
1964
|
return {
|
|
1889
1965
|
maxWidth: "100%",
|
|
@@ -1892,86 +1968,86 @@ var Ar = {
|
|
|
1892
1968
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
1893
1969
|
marginRight: e === "center" ? "auto" : void 0
|
|
1894
1970
|
};
|
|
1895
|
-
}), C =
|
|
1971
|
+
}), C = M(() => Ce(n.block.src, o)), T = cn(() => C.value ? void 0 : n.block.src), E = cn(() => C.value ? n.block.placeholderUrl : void 0);
|
|
1896
1972
|
return (t, n) => (f(), x("div", {
|
|
1897
1973
|
ref_key: "dropZoneRef",
|
|
1898
1974
|
ref: d,
|
|
1899
1975
|
"data-testid": "image-drop-zone",
|
|
1900
1976
|
class: "tpl:relative tpl:w-full",
|
|
1901
1977
|
style: i(y.value)
|
|
1902
|
-
}, [h.value && (k(v) || m.value) ? (f(), x("div",
|
|
1978
|
+
}, [h.value && (k(v) || m.value) ? (f(), x("div", Br, [m.value ? (f(), x(j, { key: 0 }, [w(k(It), {
|
|
1903
1979
|
class: "tpl-spinner",
|
|
1904
1980
|
size: 20,
|
|
1905
1981
|
"stroke-width": 2
|
|
1906
|
-
}), O(" " + p(k(a).image.uploading), 1)], 64)) : (f(), x(
|
|
1982
|
+
}), O(" " + p(k(a).image.uploading), 1)], 64)) : (f(), x(j, { key: 1 }, [w(k(ce), {
|
|
1907
1983
|
size: 20,
|
|
1908
1984
|
"stroke-width": 1.5
|
|
1909
|
-
}), O(" " + p(k(a).image.dropToUpload), 1)], 64))])) :
|
|
1985
|
+
}), O(" " + p(k(a).image.dropToUpload), 1)], 64))])) : N("", !0), e.block.src && C.value && e.block.placeholderUrl ? (f(), x(j, { key: 1 }, [e.block.linkUrl ? (f(), x("a", {
|
|
1910
1986
|
key: 0,
|
|
1911
1987
|
href: e.block.linkUrl,
|
|
1912
1988
|
target: "_blank",
|
|
1913
1989
|
rel: "noopener noreferrer",
|
|
1914
|
-
onClick: n[0] ||=
|
|
1990
|
+
onClick: n[0] ||= F(() => {}, ["prevent"])
|
|
1915
1991
|
}, [b("img", {
|
|
1916
1992
|
class: "tpl:border-0",
|
|
1917
1993
|
loading: "lazy",
|
|
1918
1994
|
src: k(E),
|
|
1919
1995
|
alt: e.block.alt || k(a).image.altTextPlaceholder,
|
|
1920
1996
|
style: i(S.value)
|
|
1921
|
-
}, null, 12,
|
|
1997
|
+
}, null, 12, Hr)], 8, Vr)) : (f(), x("img", {
|
|
1922
1998
|
key: 1,
|
|
1923
1999
|
class: "tpl:border-0",
|
|
1924
2000
|
src: k(E),
|
|
1925
2001
|
alt: e.block.alt,
|
|
1926
2002
|
style: i(S.value)
|
|
1927
|
-
}, null, 12,
|
|
2003
|
+
}, null, 12, Ur))], 64)) : e.block.src && C.value ? (f(), x("div", {
|
|
1928
2004
|
key: 2,
|
|
1929
2005
|
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)]",
|
|
1930
2006
|
style: i([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, S.value])
|
|
1931
|
-
}, [w(k(
|
|
2007
|
+
}, [w(k(Kn), {
|
|
1932
2008
|
size: 32,
|
|
1933
2009
|
"stroke-width": 1.5,
|
|
1934
2010
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
1935
2011
|
style: { opacity: "0.5" }
|
|
1936
|
-
}), b("span",
|
|
2012
|
+
}), b("span", Wr, [w(Fn, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (f(), x(j, { key: 3 }, [e.block.linkUrl ? (f(), x("a", {
|
|
1937
2013
|
key: 0,
|
|
1938
2014
|
href: e.block.linkUrl,
|
|
1939
2015
|
target: "_blank",
|
|
1940
2016
|
rel: "noopener noreferrer",
|
|
1941
|
-
onClick: n[1] ||=
|
|
2017
|
+
onClick: n[1] ||= F(() => {}, ["prevent"])
|
|
1942
2018
|
}, [b("img", {
|
|
1943
2019
|
class: "tpl:border-0",
|
|
1944
2020
|
loading: "lazy",
|
|
1945
2021
|
src: k(T),
|
|
1946
2022
|
alt: e.block.alt || k(a).image.altTextPlaceholder,
|
|
1947
2023
|
style: i(S.value)
|
|
1948
|
-
}, null, 12,
|
|
2024
|
+
}, null, 12, Kr)], 8, Gr)) : (f(), x("img", {
|
|
1949
2025
|
key: 1,
|
|
1950
2026
|
class: "tpl:border-0",
|
|
1951
2027
|
src: k(T),
|
|
1952
2028
|
alt: e.block.alt,
|
|
1953
2029
|
style: i(S.value)
|
|
1954
|
-
}, null, 12,
|
|
2030
|
+
}, null, 12, qr))], 64)) : (f(), x("div", Jr, [c.value ? (f(), x("button", {
|
|
1955
2031
|
key: 0,
|
|
1956
2032
|
"aria-label": k(a).image.browseMedia,
|
|
1957
2033
|
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)]",
|
|
1958
|
-
onClick:
|
|
1959
|
-
}, [w(k(
|
|
2034
|
+
onClick: F(u, ["stop"])
|
|
2035
|
+
}, [w(k(Kn), {
|
|
1960
2036
|
size: 14,
|
|
1961
2037
|
"stroke-width": 1.5
|
|
1962
|
-
}), O(" " + p(k(a).image.browseMedia), 1)], 8,
|
|
2038
|
+
}), O(" " + p(k(a).image.browseMedia), 1)], 8, Yr)) : (f(), x("span", Xr, p(k(a).image.clickToAdd), 1))]))], 4));
|
|
1963
2039
|
}
|
|
1964
|
-
}),
|
|
2040
|
+
}), Qr = { class: "tpl:w-full" }, $r = ["href"], ei = {
|
|
1965
2041
|
key: 1,
|
|
1966
2042
|
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)]"
|
|
1967
|
-
},
|
|
2043
|
+
}, ti = /* @__PURE__ */ y({
|
|
1968
2044
|
__name: "MenuBlock",
|
|
1969
2045
|
props: {
|
|
1970
2046
|
block: {},
|
|
1971
2047
|
viewport: {}
|
|
1972
2048
|
},
|
|
1973
2049
|
setup(e) {
|
|
1974
|
-
let n = e, { t: r } =
|
|
2050
|
+
let n = e, { t: r } = Ft(), a = M(() => ({
|
|
1975
2051
|
display: "flex",
|
|
1976
2052
|
flexWrap: "wrap",
|
|
1977
2053
|
gap: `0 ${n.block.spacing}px`,
|
|
@@ -1979,14 +2055,14 @@ var Ar = {
|
|
|
1979
2055
|
fontSize: `${n.block.fontSize}px`,
|
|
1980
2056
|
fontFamily: n.block.fontFamily || "inherit",
|
|
1981
2057
|
alignItems: "center"
|
|
1982
|
-
})), o =
|
|
2058
|
+
})), o = M(() => n.block.items.length > 0);
|
|
1983
2059
|
function s(e) {
|
|
1984
2060
|
return e || n.block.linkColor || n.block.color;
|
|
1985
2061
|
}
|
|
1986
|
-
return (n, c) => (f(), x("div",
|
|
2062
|
+
return (n, c) => (f(), x("div", Qr, [o.value ? (f(), x("div", {
|
|
1987
2063
|
key: 0,
|
|
1988
2064
|
style: i(a.value)
|
|
1989
|
-
}, [(f(!0), x(
|
|
2065
|
+
}, [(f(!0), x(j, null, t(e.block.items, (t, n) => (f(), x(j, { key: t.id }, [b("a", {
|
|
1990
2066
|
href: t.url || "#",
|
|
1991
2067
|
class: "tpl:cursor-default tpl:no-underline",
|
|
1992
2068
|
style: i({
|
|
@@ -1994,16 +2070,16 @@ var Ar = {
|
|
|
1994
2070
|
fontWeight: t.bold ? "bold" : "normal",
|
|
1995
2071
|
textDecoration: t.underline ? "underline" : "none"
|
|
1996
2072
|
}),
|
|
1997
|
-
onClick: c[0] ||=
|
|
1998
|
-
}, [w(
|
|
2073
|
+
onClick: c[0] ||= F(() => {}, ["prevent"])
|
|
2074
|
+
}, [w(Fn, { text: t.text || "..." }, null, 8, ["text"])], 12, $r), n < e.block.items.length - 1 ? (f(), x("span", {
|
|
1999
2075
|
key: 0,
|
|
2000
2076
|
style: i({
|
|
2001
2077
|
color: e.block.separatorColor,
|
|
2002
2078
|
padding: `0 ${e.block.spacing}px`
|
|
2003
2079
|
})
|
|
2004
|
-
}, p(e.block.separator), 5)) :
|
|
2080
|
+
}, p(e.block.separator), 5)) : N("", !0)], 64))), 128))], 4)) : (f(), x("div", ei, [w(k(qn), { size: 16 }), b("span", null, p(k(r).menu.addLinks), 1)]))]));
|
|
2005
2081
|
}
|
|
2006
|
-
}),
|
|
2082
|
+
}), ni = /* @__PURE__ */ new Set([
|
|
2007
2083
|
"http",
|
|
2008
2084
|
"https",
|
|
2009
2085
|
"mailto",
|
|
@@ -2013,7 +2089,7 @@ var Ar = {
|
|
|
2013
2089
|
"sms",
|
|
2014
2090
|
"xmpp",
|
|
2015
2091
|
"cid"
|
|
2016
|
-
]),
|
|
2092
|
+
]), ri = /* @__PURE__ */ new Set([
|
|
2017
2093
|
"SCRIPT",
|
|
2018
2094
|
"STYLE",
|
|
2019
2095
|
"IFRAME",
|
|
@@ -2023,7 +2099,7 @@ var Ar = {
|
|
|
2023
2099
|
"META",
|
|
2024
2100
|
"BASE",
|
|
2025
2101
|
"FORM"
|
|
2026
|
-
]),
|
|
2102
|
+
]), ii = /* @__PURE__ */ new Set([
|
|
2027
2103
|
"href",
|
|
2028
2104
|
"xlink:href",
|
|
2029
2105
|
"formaction",
|
|
@@ -2032,16 +2108,16 @@ var Ar = {
|
|
|
2032
2108
|
"background",
|
|
2033
2109
|
"poster"
|
|
2034
2110
|
]);
|
|
2035
|
-
function
|
|
2111
|
+
function ai(e, t) {
|
|
2036
2112
|
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2037
2113
|
if (!n || n.startsWith("#")) return !0;
|
|
2038
2114
|
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
2039
2115
|
if (!r) return !0;
|
|
2040
2116
|
let i = r[1].toLowerCase();
|
|
2041
|
-
return
|
|
2117
|
+
return ni.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
2042
2118
|
}
|
|
2043
|
-
function
|
|
2044
|
-
if (
|
|
2119
|
+
function oi(e) {
|
|
2120
|
+
if (ri.has(e.tagName)) {
|
|
2045
2121
|
e.remove();
|
|
2046
2122
|
return;
|
|
2047
2123
|
}
|
|
@@ -2053,29 +2129,29 @@ function Xr(e) {
|
|
|
2053
2129
|
e.removeAttribute(n);
|
|
2054
2130
|
continue;
|
|
2055
2131
|
}
|
|
2056
|
-
if (
|
|
2057
|
-
|
|
2132
|
+
if (ii.has(t)) {
|
|
2133
|
+
ai(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
2058
2134
|
continue;
|
|
2059
2135
|
}
|
|
2060
2136
|
if (t === "src") {
|
|
2061
|
-
|
|
2137
|
+
ai(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
2062
2138
|
continue;
|
|
2063
2139
|
}
|
|
2064
2140
|
t === "srcdoc" && e.removeAttribute(n);
|
|
2065
2141
|
}
|
|
2066
2142
|
let n = Array.from(e.children);
|
|
2067
|
-
for (let e of n)
|
|
2143
|
+
for (let e of n) oi(e);
|
|
2068
2144
|
}
|
|
2069
|
-
function
|
|
2145
|
+
function si(e) {
|
|
2070
2146
|
if (typeof DOMParser > "u") return e;
|
|
2071
2147
|
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
2072
|
-
for (let e of n)
|
|
2148
|
+
for (let e of n) oi(e);
|
|
2073
2149
|
return t.innerHTML;
|
|
2074
2150
|
}
|
|
2075
2151
|
//#endregion
|
|
2076
2152
|
//#region src/composables/useEditableTextBlock.ts
|
|
2077
|
-
function
|
|
2078
|
-
let t =
|
|
2153
|
+
function ci(e) {
|
|
2154
|
+
let t = P(pt, []), { syntax: n } = Ht(), r = M(() => si(ge(_e(e(), t), n))), i = _(!1), a = _(null), { top: o, left: s } = Xe(a), { toLocal: c } = $e(), l = M(() => c({
|
|
2079
2155
|
top: o.value - 8,
|
|
2080
2156
|
left: s.value
|
|
2081
2157
|
}));
|
|
@@ -2096,14 +2172,14 @@ function Qr(e) {
|
|
|
2096
2172
|
}
|
|
2097
2173
|
//#endregion
|
|
2098
2174
|
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2099
|
-
var
|
|
2175
|
+
var li = ["innerHTML"], ui = /* @__PURE__ */ y({
|
|
2100
2176
|
__name: "ParagraphBlock",
|
|
2101
2177
|
props: {
|
|
2102
2178
|
block: {},
|
|
2103
2179
|
viewport: {}
|
|
2104
2180
|
},
|
|
2105
2181
|
setup(e) {
|
|
2106
|
-
let t = e, n = C(() => import("./ParagraphEditor-
|
|
2182
|
+
let t = e, n = C(() => import("./ParagraphEditor-C5ixOIYb.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: s, handleEditorDone: c } = ci(() => t.block.content);
|
|
2107
2183
|
return (t, l) => (f(), x("div", {
|
|
2108
2184
|
ref_key: "blockRef",
|
|
2109
2185
|
ref: i,
|
|
@@ -2122,46 +2198,46 @@ var $r = ["innerHTML"], ei = /* @__PURE__ */ y({
|
|
|
2122
2198
|
key: 1,
|
|
2123
2199
|
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",
|
|
2124
2200
|
innerHTML: k(o)
|
|
2125
|
-
}, null, 8,
|
|
2201
|
+
}, null, 8, li))], 544));
|
|
2126
2202
|
}
|
|
2127
2203
|
});
|
|
2128
2204
|
//#endregion
|
|
2129
2205
|
//#region src/utils/blockComponentResolver.ts
|
|
2130
|
-
function
|
|
2206
|
+
function di(e, t, n) {
|
|
2131
2207
|
if (t) {
|
|
2132
2208
|
let n = t.getComponent(e);
|
|
2133
2209
|
if (n) return n;
|
|
2134
2210
|
}
|
|
2135
2211
|
return n[e.type] ?? null;
|
|
2136
2212
|
}
|
|
2137
|
-
function
|
|
2213
|
+
function fi(e) {
|
|
2138
2214
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
2139
2215
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
2140
2216
|
backgroundColor: n || "transparent"
|
|
2141
2217
|
};
|
|
2142
2218
|
return e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
2143
2219
|
}
|
|
2144
|
-
function
|
|
2220
|
+
function pi(e) {
|
|
2145
2221
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
2146
2222
|
let t = e.wrapper, n = {};
|
|
2147
2223
|
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;
|
|
2148
2224
|
}
|
|
2149
2225
|
//#endregion
|
|
2150
2226
|
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
2151
|
-
var
|
|
2227
|
+
var mi = ["data-block-id", "data-block-type"], hi = ["aria-label"], gi = [
|
|
2152
2228
|
"aria-label",
|
|
2153
2229
|
"aria-pressed",
|
|
2154
2230
|
"title"
|
|
2155
|
-
],
|
|
2231
|
+
], _i = ["aria-label", "title"], vi = ["aria-label", "title"], yi = ["aria-label", "title"], bi = {
|
|
2156
2232
|
key: 1,
|
|
2157
2233
|
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"
|
|
2158
|
-
},
|
|
2234
|
+
}, xi = { 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)]" }, Si = {
|
|
2159
2235
|
key: 2,
|
|
2160
2236
|
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
2161
|
-
},
|
|
2237
|
+
}, Ci = ["aria-label", "title"], wi = {
|
|
2162
2238
|
key: 3,
|
|
2163
2239
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
2164
|
-
},
|
|
2240
|
+
}, Ti = ["aria-label"], Ei = /*#__PURE__*/ Vt(/* @__PURE__ */ y({
|
|
2165
2241
|
__name: "BlockWrapper",
|
|
2166
2242
|
props: {
|
|
2167
2243
|
block: {},
|
|
@@ -2171,9 +2247,9 @@ var ii = ["data-block-id", "data-block-type"], ai = ["aria-label"], oi = [
|
|
|
2171
2247
|
},
|
|
2172
2248
|
emits: ["select"],
|
|
2173
2249
|
setup(e, { emit: t }) {
|
|
2174
|
-
let n = C(() => import("./BlockIssueBadge-
|
|
2250
|
+
let n = C(() => import("./BlockIssueBadge-B4QjePax.js")), r = e, a = t, { t: s, format: c } = Ft(), l = P(Mt, null), u = _(null), d = M(() => l?.liftedBlockId.value === r.block.id), m = M(() => d.value ? c(s.blockActions.dragLifted, { block: r.block.type }) : s.blockActions.drag);
|
|
2175
2251
|
async function h() {
|
|
2176
|
-
await
|
|
2252
|
+
await re(), u.value?.focus();
|
|
2177
2253
|
}
|
|
2178
2254
|
function g(e) {
|
|
2179
2255
|
if (l) {
|
|
@@ -2194,32 +2270,32 @@ var ii = ["data-block-id", "data-block-type"], ai = ["aria-label"], oi = [
|
|
|
2194
2270
|
}
|
|
2195
2271
|
}
|
|
2196
2272
|
}
|
|
2197
|
-
let v =
|
|
2273
|
+
let v = M(() => !r.viewport || !r.block.visibility ? !1 : r.block.visibility[r.viewport] === !1), y = M(() => r.previewMode === !0 && v.value), S = M(() => r.viewport ? {
|
|
2198
2274
|
desktop: s.viewport.desktop,
|
|
2199
2275
|
mobile: s.viewport.mobile
|
|
2200
|
-
}[r.viewport] ?? r.viewport : ""), E =
|
|
2201
|
-
let e =
|
|
2276
|
+
}[r.viewport] ?? r.viewport : ""), E = M(() => !!r.block.displayCondition), D = P(xt, null), A = P(_t, null), j = P(kt, {}), ee = M(() => !!j.savedModules), te = M(() => j.comments?.getBlockCount(r.block.id) ?? 0), ne = M(() => {
|
|
2277
|
+
let e = fi(r.block), t = {
|
|
2202
2278
|
padding: e.padding,
|
|
2203
2279
|
backgroundColor: e.backgroundColor
|
|
2204
2280
|
};
|
|
2205
2281
|
return e.borderRadius && (t.borderRadius = e.borderRadius), t;
|
|
2206
|
-
}),
|
|
2207
|
-
function
|
|
2282
|
+
}), ie = M(() => pi(r.block));
|
|
2283
|
+
function ae(e) {
|
|
2208
2284
|
r.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), a("select"));
|
|
2209
2285
|
}
|
|
2210
|
-
function
|
|
2286
|
+
function oe() {
|
|
2211
2287
|
D?.deleteBlock(r.block.id);
|
|
2212
2288
|
}
|
|
2213
|
-
function
|
|
2289
|
+
function se() {
|
|
2214
2290
|
D?.duplicateBlock(r.block);
|
|
2215
2291
|
}
|
|
2216
|
-
function
|
|
2217
|
-
|
|
2292
|
+
function ce() {
|
|
2293
|
+
j.savedModules?.openSaveDialog(r.block.id);
|
|
2218
2294
|
}
|
|
2219
|
-
function
|
|
2220
|
-
|
|
2295
|
+
function le() {
|
|
2296
|
+
A?.toggleBlock(r.block.id);
|
|
2221
2297
|
}
|
|
2222
|
-
return (t, r) => y.value ?
|
|
2298
|
+
return (t, r) => y.value ? N("", !0) : (f(), x("div", {
|
|
2223
2299
|
key: 0,
|
|
2224
2300
|
class: o(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow tpl:duration-150", {
|
|
2225
2301
|
"tpl-block--selected": e.isSelected,
|
|
@@ -2228,7 +2304,7 @@ var ii = ["data-block-id", "data-block-type"], ai = ["aria-label"], oi = [
|
|
|
2228
2304
|
}]),
|
|
2229
2305
|
"data-block-id": e.block.id,
|
|
2230
2306
|
"data-block-type": e.block.type,
|
|
2231
|
-
onClick:
|
|
2307
|
+
onClick: ae
|
|
2232
2308
|
}, [
|
|
2233
2309
|
w(k(n), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
2234
2310
|
e.isSelected ? (f(), x("div", {
|
|
@@ -2246,97 +2322,97 @@ var ii = ["data-block-id", "data-block-type"], ai = ["aria-label"], oi = [
|
|
|
2246
2322
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2247
2323
|
title: k(s).blockActions.drag,
|
|
2248
2324
|
onKeydown: g
|
|
2249
|
-
}, [w(k(
|
|
2325
|
+
}, [w(k(Gn), {
|
|
2250
2326
|
size: 14,
|
|
2251
2327
|
"stroke-width": 1.5
|
|
2252
|
-
})], 40,
|
|
2328
|
+
})], 40, gi),
|
|
2253
2329
|
b("button", {
|
|
2254
2330
|
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",
|
|
2255
2331
|
"aria-label": k(s).blockActions.duplicate,
|
|
2256
2332
|
title: k(s).blockActions.duplicate,
|
|
2257
|
-
onClick:
|
|
2258
|
-
}, [w(k(
|
|
2333
|
+
onClick: F(se, ["stop"])
|
|
2334
|
+
}, [w(k(Hn), {
|
|
2259
2335
|
size: 14,
|
|
2260
2336
|
"stroke-width": 1.5
|
|
2261
|
-
})], 8,
|
|
2262
|
-
|
|
2337
|
+
})], 8, _i),
|
|
2338
|
+
ee.value ? (f(), x("button", {
|
|
2263
2339
|
key: 0,
|
|
2264
2340
|
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",
|
|
2265
2341
|
"aria-label": k(s).blockActions.saveAsModule,
|
|
2266
2342
|
title: k(s).blockActions.saveAsModule,
|
|
2267
|
-
onClick:
|
|
2268
|
-
}, [w(k(
|
|
2343
|
+
onClick: F(ce, ["stop"])
|
|
2344
|
+
}, [w(k(zn), {
|
|
2269
2345
|
size: 14,
|
|
2270
2346
|
"stroke-width": 1.5
|
|
2271
|
-
})], 8,
|
|
2347
|
+
})], 8, vi)) : N("", !0),
|
|
2272
2348
|
b("button", {
|
|
2273
2349
|
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",
|
|
2274
2350
|
"aria-label": k(s).blockActions.delete,
|
|
2275
2351
|
title: k(s).blockActions.delete,
|
|
2276
|
-
onClick:
|
|
2277
|
-
}, [w(k(
|
|
2352
|
+
onClick: F(oe, ["stop"])
|
|
2353
|
+
}, [w(k(Rt), {
|
|
2278
2354
|
size: 14,
|
|
2279
2355
|
"stroke-width": 1.5
|
|
2280
|
-
})], 8,
|
|
2281
|
-
], 8,
|
|
2282
|
-
v.value ? (f(), x("div",
|
|
2356
|
+
})], 8, yi)
|
|
2357
|
+
], 8, hi)) : N("", !0),
|
|
2358
|
+
v.value ? (f(), x("div", bi, [b("span", xi, [w(k(Un), {
|
|
2283
2359
|
size: 12,
|
|
2284
2360
|
"stroke-width": 1.5
|
|
2285
|
-
}), O(" " + p(k(c)(k(s).blockActions.hiddenOnViewport, { viewport: S.value })), 1)])])) :
|
|
2286
|
-
E.value && !v.value ? (f(), x("div",
|
|
2361
|
+
}), O(" " + p(k(c)(k(s).blockActions.hiddenOnViewport, { viewport: S.value })), 1)])])) : N("", !0),
|
|
2362
|
+
E.value && !v.value ? (f(), x("div", Si, [b("button", {
|
|
2287
2363
|
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)]",
|
|
2288
2364
|
"aria-label": k(s).blockActions.conditionToggle,
|
|
2289
2365
|
title: e.block.displayCondition?.label,
|
|
2290
|
-
onClick:
|
|
2291
|
-
}, [w(k(
|
|
2366
|
+
onClick: F(le, ["stop"])
|
|
2367
|
+
}, [w(k(Wn), {
|
|
2292
2368
|
size: 12,
|
|
2293
2369
|
"stroke-width": 2
|
|
2294
|
-
})], 8,
|
|
2295
|
-
|
|
2370
|
+
})], 8, Ci)])) : N("", !0),
|
|
2371
|
+
te.value > 0 && !v.value ? (f(), x("div", wi, [b("button", {
|
|
2296
2372
|
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)]",
|
|
2297
|
-
"aria-label": k(c)(k(s).blockActions.comments, { count: String(
|
|
2298
|
-
onClick: r[0] ||=
|
|
2299
|
-
}, [w(k(
|
|
2373
|
+
"aria-label": k(c)(k(s).blockActions.comments, { count: String(te.value) }),
|
|
2374
|
+
onClick: r[0] ||= F((t) => k(j).comments?.openForBlock(e.block.id), ["stop"])
|
|
2375
|
+
}, [w(k(Lt), {
|
|
2300
2376
|
size: 12,
|
|
2301
2377
|
"stroke-width": 2.5
|
|
2302
|
-
}), O(" " + p(
|
|
2303
|
-
|
|
2378
|
+
}), O(" " + p(te.value), 1)], 8, Ti)])) : N("", !0),
|
|
2379
|
+
ie.value ? (f(), x("div", {
|
|
2304
2380
|
key: 4,
|
|
2305
2381
|
class: "tpl-section-wrapper",
|
|
2306
|
-
style: i(
|
|
2382
|
+
style: i(ie.value)
|
|
2307
2383
|
}, [b("div", {
|
|
2308
2384
|
class: "tpl-block-content",
|
|
2309
|
-
style: i(
|
|
2385
|
+
style: i(ne.value)
|
|
2310
2386
|
}, [T(t.$slots, "default", {}, void 0, !0)], 4)], 4)) : (f(), x("div", {
|
|
2311
2387
|
key: 5,
|
|
2312
2388
|
class: "tpl-block-content",
|
|
2313
|
-
style: i(
|
|
2389
|
+
style: i(ne.value)
|
|
2314
2390
|
}, [T(t.$slots, "default", {}, void 0, !0)], 4))
|
|
2315
|
-
], 10,
|
|
2391
|
+
], 10, mi));
|
|
2316
2392
|
}
|
|
2317
2393
|
}), [["__scopeId", "data-v-7d9e7893"]]);
|
|
2318
2394
|
//#endregion
|
|
2319
2395
|
//#region src/utils/unwrapParagraph.ts
|
|
2320
|
-
function
|
|
2396
|
+
function Di(e) {
|
|
2321
2397
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2322
2398
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2323
2399
|
}
|
|
2324
2400
|
//#endregion
|
|
2325
2401
|
//#region src/components/blocks/TitleBlock.vue
|
|
2326
|
-
var
|
|
2402
|
+
var Oi = /* @__PURE__ */ y({
|
|
2327
2403
|
__name: "TitleBlock",
|
|
2328
2404
|
props: {
|
|
2329
2405
|
block: {},
|
|
2330
2406
|
viewport: {}
|
|
2331
2407
|
},
|
|
2332
2408
|
setup(e) {
|
|
2333
|
-
let t = e, n = C(() => import("./TitleEditor-
|
|
2409
|
+
let t = e, n = C(() => import("./TitleEditor-n6WDVDjW.js")), { isEditing: r, blockRef: a, toolbarPosition: o, resolvedContent: s, handleDoubleClick: c, handleEditorDone: l } = ci(() => t.block.content), u = M(() => {
|
|
2334
2410
|
let e = {
|
|
2335
2411
|
fontSize: `${Fe[t.block.level]}px`,
|
|
2336
2412
|
textAlign: t.block.textAlign
|
|
2337
2413
|
};
|
|
2338
2414
|
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
2339
|
-
}), p =
|
|
2415
|
+
}), p = M(() => `h${t.block.level}`), m = M(() => Di(s.value));
|
|
2340
2416
|
return (t, s) => (f(), x("div", {
|
|
2341
2417
|
ref_key: "blockRef",
|
|
2342
2418
|
ref: a,
|
|
@@ -2362,88 +2438,88 @@ var vi = /* @__PURE__ */ y({
|
|
|
2362
2438
|
});
|
|
2363
2439
|
//#endregion
|
|
2364
2440
|
//#region src/utils/sectionColumnDrop.ts
|
|
2365
|
-
function
|
|
2441
|
+
function ki(e) {
|
|
2366
2442
|
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2367
2443
|
}
|
|
2368
2444
|
//#endregion
|
|
2369
2445
|
//#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
|
|
2370
|
-
var
|
|
2446
|
+
var Ai = Object.defineProperty, ji = Object.getOwnPropertySymbols, Mi = Object.prototype.hasOwnProperty, Ni = Object.prototype.propertyIsEnumerable, Pi = (e, t, n) => t in e ? Ai(e, t, {
|
|
2371
2447
|
enumerable: !0,
|
|
2372
2448
|
configurable: !0,
|
|
2373
2449
|
writable: !0,
|
|
2374
2450
|
value: n
|
|
2375
|
-
}) : e[t] = n,
|
|
2376
|
-
for (var n in t ||= {})
|
|
2377
|
-
if (
|
|
2451
|
+
}) : e[t] = n, Fi = (e, t) => {
|
|
2452
|
+
for (var n in t ||= {}) Mi.call(t, n) && Pi(e, n, t[n]);
|
|
2453
|
+
if (ji) for (var n of ji(t)) Ni.call(t, n) && Pi(e, n, t[n]);
|
|
2378
2454
|
return e;
|
|
2379
|
-
},
|
|
2455
|
+
}, Ii = (e, t) => {
|
|
2380
2456
|
var n = {};
|
|
2381
|
-
for (var r in e)
|
|
2382
|
-
if (e != null &&
|
|
2457
|
+
for (var r in e) Mi.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
2458
|
+
if (e != null && ji) for (var r of ji(e)) t.indexOf(r) < 0 && Ni.call(e, r) && (n[r] = e[r]);
|
|
2383
2459
|
return n;
|
|
2384
|
-
},
|
|
2385
|
-
function
|
|
2386
|
-
console.warn(
|
|
2460
|
+
}, Li = "[vue-draggable-plus]: ";
|
|
2461
|
+
function Ri(e) {
|
|
2462
|
+
console.warn(Li + e);
|
|
2387
2463
|
}
|
|
2388
|
-
function
|
|
2389
|
-
console.error(
|
|
2464
|
+
function zi(e) {
|
|
2465
|
+
console.error(Li + e);
|
|
2390
2466
|
}
|
|
2391
|
-
function
|
|
2467
|
+
function Bi(e, t, n) {
|
|
2392
2468
|
return n >= 0 && n < e.length && e.splice(n, 0, e.splice(t, 1)[0]), e;
|
|
2393
2469
|
}
|
|
2394
|
-
function
|
|
2470
|
+
function Vi(e) {
|
|
2395
2471
|
return e.replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
|
|
2396
2472
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[
|
|
2473
|
+
function Hi(e) {
|
|
2474
|
+
return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[Vi(n)] = e[n]), t), {});
|
|
2399
2475
|
}
|
|
2400
|
-
function
|
|
2476
|
+
function Ui(e, t) {
|
|
2401
2477
|
return Array.isArray(e) && e.splice(t, 1), e;
|
|
2402
2478
|
}
|
|
2403
|
-
function
|
|
2479
|
+
function Wi(e, t, n) {
|
|
2404
2480
|
return Array.isArray(e) && e.splice(t, 0, n), e;
|
|
2405
2481
|
}
|
|
2406
|
-
function
|
|
2482
|
+
function Gi(e) {
|
|
2407
2483
|
return e === void 0;
|
|
2408
2484
|
}
|
|
2409
|
-
function
|
|
2485
|
+
function Ki(e) {
|
|
2410
2486
|
return typeof e == "string";
|
|
2411
2487
|
}
|
|
2412
|
-
function
|
|
2488
|
+
function qi(e, t, n) {
|
|
2413
2489
|
let r = e.children[n];
|
|
2414
2490
|
e.insertBefore(t, r);
|
|
2415
2491
|
}
|
|
2416
|
-
function
|
|
2492
|
+
function Ji(e) {
|
|
2417
2493
|
e.parentNode && e.parentNode.removeChild(e);
|
|
2418
2494
|
}
|
|
2419
|
-
function
|
|
2495
|
+
function Yi(e, t = document) {
|
|
2420
2496
|
let n = null;
|
|
2421
|
-
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n ||
|
|
2497
|
+
return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n || Ri(`Element not found: ${e}`), n;
|
|
2422
2498
|
}
|
|
2423
|
-
function
|
|
2499
|
+
function Xi(e, t, n = null) {
|
|
2424
2500
|
return function(...r) {
|
|
2425
2501
|
return e.apply(n, r), t.apply(n, r);
|
|
2426
2502
|
};
|
|
2427
2503
|
}
|
|
2428
|
-
function
|
|
2429
|
-
let n =
|
|
2504
|
+
function Zi(e, t) {
|
|
2505
|
+
let n = Fi({}, e);
|
|
2430
2506
|
return Object.keys(t).forEach((r) => {
|
|
2431
|
-
n[r] ? n[r] =
|
|
2507
|
+
n[r] ? n[r] = Xi(e[r], t[r]) : n[r] = t[r];
|
|
2432
2508
|
}), n;
|
|
2433
2509
|
}
|
|
2434
|
-
function
|
|
2510
|
+
function Qi(e) {
|
|
2435
2511
|
return e instanceof HTMLElement;
|
|
2436
2512
|
}
|
|
2437
|
-
function
|
|
2513
|
+
function $i(e, t) {
|
|
2438
2514
|
Object.keys(e).forEach((n) => {
|
|
2439
2515
|
t(n, e[n]);
|
|
2440
2516
|
});
|
|
2441
2517
|
}
|
|
2442
|
-
function
|
|
2518
|
+
function ea(e) {
|
|
2443
2519
|
return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
|
|
2444
2520
|
}
|
|
2445
|
-
var
|
|
2446
|
-
function
|
|
2521
|
+
var ta = Object.assign;
|
|
2522
|
+
function na(e, t) {
|
|
2447
2523
|
var n = Object.keys(e);
|
|
2448
2524
|
if (Object.getOwnPropertySymbols) {
|
|
2449
2525
|
var r = Object.getOwnPropertySymbols(e);
|
|
@@ -2453,26 +2529,26 @@ function Ki(e, t) {
|
|
|
2453
2529
|
}
|
|
2454
2530
|
return n;
|
|
2455
2531
|
}
|
|
2456
|
-
function
|
|
2532
|
+
function ra(e) {
|
|
2457
2533
|
for (var t = 1; t < arguments.length; t++) {
|
|
2458
2534
|
var n = arguments[t] == null ? {} : arguments[t];
|
|
2459
|
-
t % 2 ?
|
|
2460
|
-
|
|
2461
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) :
|
|
2535
|
+
t % 2 ? na(Object(n), !0).forEach(function(t) {
|
|
2536
|
+
aa(e, t, n[t]);
|
|
2537
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : na(Object(n)).forEach(function(t) {
|
|
2462
2538
|
Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
|
|
2463
2539
|
});
|
|
2464
2540
|
}
|
|
2465
2541
|
return e;
|
|
2466
2542
|
}
|
|
2467
|
-
function
|
|
2543
|
+
function ia(e) {
|
|
2468
2544
|
"@babel/helpers - typeof";
|
|
2469
|
-
return
|
|
2545
|
+
return ia = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
|
|
2470
2546
|
return typeof e;
|
|
2471
2547
|
} : function(e) {
|
|
2472
2548
|
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
|
|
2473
|
-
},
|
|
2549
|
+
}, ia(e);
|
|
2474
2550
|
}
|
|
2475
|
-
function
|
|
2551
|
+
function aa(e, t, n) {
|
|
2476
2552
|
return t in e ? Object.defineProperty(e, t, {
|
|
2477
2553
|
value: n,
|
|
2478
2554
|
enumerable: !0,
|
|
@@ -2480,45 +2556,45 @@ function Yi(e, t, n) {
|
|
|
2480
2556
|
writable: !0
|
|
2481
2557
|
}) : e[t] = n, e;
|
|
2482
2558
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return
|
|
2559
|
+
function oa() {
|
|
2560
|
+
return oa = Object.assign || function(e) {
|
|
2485
2561
|
for (var t = 1; t < arguments.length; t++) {
|
|
2486
2562
|
var n = arguments[t];
|
|
2487
2563
|
for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
|
|
2488
2564
|
}
|
|
2489
2565
|
return e;
|
|
2490
|
-
},
|
|
2566
|
+
}, oa.apply(this, arguments);
|
|
2491
2567
|
}
|
|
2492
|
-
function
|
|
2568
|
+
function sa(e, t) {
|
|
2493
2569
|
if (e == null) return {};
|
|
2494
2570
|
var n = {}, r = Object.keys(e), i, a;
|
|
2495
2571
|
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
|
|
2496
2572
|
return n;
|
|
2497
2573
|
}
|
|
2498
|
-
function
|
|
2574
|
+
function ca(e, t) {
|
|
2499
2575
|
if (e == null) return {};
|
|
2500
|
-
var n =
|
|
2576
|
+
var n = sa(e, t), r, i;
|
|
2501
2577
|
if (Object.getOwnPropertySymbols) {
|
|
2502
2578
|
var a = Object.getOwnPropertySymbols(e);
|
|
2503
2579
|
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
|
|
2504
2580
|
}
|
|
2505
2581
|
return n;
|
|
2506
2582
|
}
|
|
2507
|
-
var
|
|
2508
|
-
function
|
|
2583
|
+
var la = "1.15.2";
|
|
2584
|
+
function ua(e) {
|
|
2509
2585
|
if (typeof window < "u" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(e);
|
|
2510
2586
|
}
|
|
2511
|
-
var
|
|
2587
|
+
var da = ua(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), fa = ua(/Edge/i), pa = ua(/firefox/i), ma = ua(/safari/i) && !ua(/chrome/i) && !ua(/android/i), ha = ua(/iP(ad|od|hone)/i), ga = ua(/chrome/i) && ua(/android/i), _a = {
|
|
2512
2588
|
capture: !1,
|
|
2513
2589
|
passive: !1
|
|
2514
2590
|
};
|
|
2515
|
-
function I(e, t, n) {
|
|
2516
|
-
e.addEventListener(t, n, !ta && sa);
|
|
2517
|
-
}
|
|
2518
2591
|
function L(e, t, n) {
|
|
2519
|
-
e.
|
|
2592
|
+
e.addEventListener(t, n, !da && _a);
|
|
2520
2593
|
}
|
|
2521
|
-
function
|
|
2594
|
+
function R(e, t, n) {
|
|
2595
|
+
e.removeEventListener(t, n, !da && _a);
|
|
2596
|
+
}
|
|
2597
|
+
function va(e, t) {
|
|
2522
2598
|
if (t) {
|
|
2523
2599
|
if (t[0] === ">" && (t = t.substring(1)), e) try {
|
|
2524
2600
|
if (e.matches) return e.matches(t);
|
|
@@ -2530,41 +2606,41 @@ function ca(e, t) {
|
|
|
2530
2606
|
return !1;
|
|
2531
2607
|
}
|
|
2532
2608
|
}
|
|
2533
|
-
function
|
|
2609
|
+
function ya(e) {
|
|
2534
2610
|
return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
|
|
2535
2611
|
}
|
|
2536
|
-
function
|
|
2612
|
+
function ba(e, t, n, r) {
|
|
2537
2613
|
if (e) {
|
|
2538
2614
|
n ||= document;
|
|
2539
2615
|
do {
|
|
2540
|
-
if (t != null && (t[0] === ">" ? e.parentNode === n &&
|
|
2616
|
+
if (t != null && (t[0] === ">" ? e.parentNode === n && va(e, t) : va(e, t)) || r && e === n) return e;
|
|
2541
2617
|
if (e === n) break;
|
|
2542
|
-
} while (e =
|
|
2618
|
+
} while (e = ya(e));
|
|
2543
2619
|
}
|
|
2544
2620
|
return null;
|
|
2545
2621
|
}
|
|
2546
|
-
var
|
|
2547
|
-
function R(e, t, n) {
|
|
2548
|
-
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(da, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(da, " "));
|
|
2549
|
-
}
|
|
2622
|
+
var xa = /\s+/g;
|
|
2550
2623
|
function z(e, t, n) {
|
|
2624
|
+
e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(xa, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(xa, " "));
|
|
2625
|
+
}
|
|
2626
|
+
function B(e, t, n) {
|
|
2551
2627
|
var r = e && e.style;
|
|
2552
2628
|
if (r) {
|
|
2553
2629
|
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];
|
|
2554
2630
|
!(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
|
|
2555
2631
|
}
|
|
2556
2632
|
}
|
|
2557
|
-
function
|
|
2633
|
+
function Sa(e, t) {
|
|
2558
2634
|
var n = "";
|
|
2559
2635
|
if (typeof e == "string") n = e;
|
|
2560
2636
|
else do {
|
|
2561
|
-
var r =
|
|
2637
|
+
var r = B(e, "transform");
|
|
2562
2638
|
r && r !== "none" && (n = r + " " + n);
|
|
2563
2639
|
} while (!t && (e = e.parentNode));
|
|
2564
2640
|
var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
|
|
2565
2641
|
return i && new i(n);
|
|
2566
2642
|
}
|
|
2567
|
-
function
|
|
2643
|
+
function Ca(e, t, n) {
|
|
2568
2644
|
if (e) {
|
|
2569
2645
|
var r = e.getElementsByTagName(t), i = 0, a = r.length;
|
|
2570
2646
|
if (n) for (; i < a; i++) n(r[i], i);
|
|
@@ -2572,21 +2648,21 @@ function pa(e, t, n) {
|
|
|
2572
2648
|
}
|
|
2573
2649
|
return [];
|
|
2574
2650
|
}
|
|
2575
|
-
function
|
|
2651
|
+
function wa() {
|
|
2576
2652
|
return document.scrollingElement || document.documentElement;
|
|
2577
2653
|
}
|
|
2578
|
-
function
|
|
2654
|
+
function V(e, t, n, r, i) {
|
|
2579
2655
|
if (!(!e.getBoundingClientRect && e !== window)) {
|
|
2580
2656
|
var a, o, s, c, l, u, d;
|
|
2581
|
-
if (e !== window && e.parentNode && e !==
|
|
2582
|
-
if (i && i.getBoundingClientRect && (
|
|
2657
|
+
if (e !== window && e.parentNode && e !== wa() ? (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, !da)) do
|
|
2658
|
+
if (i && i.getBoundingClientRect && (B(i, "transform") !== "none" || n && B(i, "position") !== "static")) {
|
|
2583
2659
|
var f = i.getBoundingClientRect();
|
|
2584
|
-
o -= f.top + parseInt(
|
|
2660
|
+
o -= f.top + parseInt(B(i, "border-top-width")), s -= f.left + parseInt(B(i, "border-left-width")), c = o + a.height, l = s + a.width;
|
|
2585
2661
|
break;
|
|
2586
2662
|
}
|
|
2587
2663
|
while (i = i.parentNode);
|
|
2588
2664
|
if (r && e !== window) {
|
|
2589
|
-
var p =
|
|
2665
|
+
var p = Sa(i || e), m = p && p.a, h = p && p.d;
|
|
2590
2666
|
p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
|
|
2591
2667
|
}
|
|
2592
2668
|
return {
|
|
@@ -2599,18 +2675,18 @@ function B(e, t, n, r, i) {
|
|
|
2599
2675
|
};
|
|
2600
2676
|
}
|
|
2601
2677
|
}
|
|
2602
|
-
function
|
|
2603
|
-
for (var r =
|
|
2604
|
-
var a =
|
|
2678
|
+
function Ta(e, t, n) {
|
|
2679
|
+
for (var r = ja(e, !0), i = V(e)[t]; r;) {
|
|
2680
|
+
var a = V(r)[n], o = void 0;
|
|
2605
2681
|
if (o = i >= a, !o) return r;
|
|
2606
|
-
if (r ===
|
|
2607
|
-
r =
|
|
2682
|
+
if (r === wa()) break;
|
|
2683
|
+
r = ja(r, !1);
|
|
2608
2684
|
}
|
|
2609
2685
|
return !1;
|
|
2610
2686
|
}
|
|
2611
|
-
function
|
|
2687
|
+
function Ea(e, t, n, r) {
|
|
2612
2688
|
for (var i = 0, a = 0, o = e.children; a < o.length;) {
|
|
2613
|
-
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) &&
|
|
2689
|
+
if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && ba(o[a], n.draggable, e, !1)) {
|
|
2614
2690
|
if (i === t) return o[a];
|
|
2615
2691
|
i++;
|
|
2616
2692
|
}
|
|
@@ -2618,96 +2694,96 @@ function ga(e, t, n, r) {
|
|
|
2618
2694
|
}
|
|
2619
2695
|
return null;
|
|
2620
2696
|
}
|
|
2621
|
-
function
|
|
2622
|
-
for (var n = e.lastElementChild; n && (n === Q.ghost ||
|
|
2697
|
+
function Da(e, t) {
|
|
2698
|
+
for (var n = e.lastElementChild; n && (n === Q.ghost || B(n, "display") === "none" || t && !va(n, t));) n = n.previousElementSibling;
|
|
2623
2699
|
return n || null;
|
|
2624
2700
|
}
|
|
2625
|
-
function
|
|
2701
|
+
function Oa(e, t) {
|
|
2626
2702
|
var n = 0;
|
|
2627
2703
|
if (!e || !e.parentNode) return -1;
|
|
2628
|
-
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t ||
|
|
2704
|
+
for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || va(e, t)) && n++;
|
|
2629
2705
|
return n;
|
|
2630
2706
|
}
|
|
2631
|
-
function
|
|
2632
|
-
var t = 0, n = 0, r =
|
|
2707
|
+
function ka(e) {
|
|
2708
|
+
var t = 0, n = 0, r = wa();
|
|
2633
2709
|
if (e) do {
|
|
2634
|
-
var i =
|
|
2710
|
+
var i = Sa(e), a = i.a, o = i.d;
|
|
2635
2711
|
t += e.scrollLeft * a, n += e.scrollTop * o;
|
|
2636
2712
|
} while (e !== r && (e = e.parentNode));
|
|
2637
2713
|
return [t, n];
|
|
2638
2714
|
}
|
|
2639
|
-
function
|
|
2715
|
+
function Aa(e, t) {
|
|
2640
2716
|
for (var n in e) if (e.hasOwnProperty(n)) {
|
|
2641
2717
|
for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
|
|
2642
2718
|
}
|
|
2643
2719
|
return -1;
|
|
2644
2720
|
}
|
|
2645
|
-
function
|
|
2646
|
-
if (!e || !e.getBoundingClientRect) return
|
|
2721
|
+
function ja(e, t) {
|
|
2722
|
+
if (!e || !e.getBoundingClientRect) return wa();
|
|
2647
2723
|
var n = e, r = !1;
|
|
2648
2724
|
do
|
|
2649
2725
|
if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
|
|
2650
|
-
var i =
|
|
2726
|
+
var i = B(n);
|
|
2651
2727
|
if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
|
|
2652
|
-
if (!n.getBoundingClientRect || n === document.body) return
|
|
2728
|
+
if (!n.getBoundingClientRect || n === document.body) return wa();
|
|
2653
2729
|
if (r || t) return n;
|
|
2654
2730
|
r = !0;
|
|
2655
2731
|
}
|
|
2656
2732
|
}
|
|
2657
2733
|
while (n = n.parentNode);
|
|
2658
|
-
return
|
|
2734
|
+
return wa();
|
|
2659
2735
|
}
|
|
2660
|
-
function
|
|
2736
|
+
function Ma(e, t) {
|
|
2661
2737
|
if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
|
|
2662
2738
|
return e;
|
|
2663
2739
|
}
|
|
2664
|
-
function
|
|
2740
|
+
function Na(e, t) {
|
|
2665
2741
|
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);
|
|
2666
2742
|
}
|
|
2667
|
-
var
|
|
2668
|
-
function
|
|
2743
|
+
var Pa;
|
|
2744
|
+
function Fa(e, t) {
|
|
2669
2745
|
return function() {
|
|
2670
|
-
if (!
|
|
2746
|
+
if (!Pa) {
|
|
2671
2747
|
var n = arguments, r = this;
|
|
2672
|
-
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n),
|
|
2673
|
-
|
|
2748
|
+
n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), Pa = setTimeout(function() {
|
|
2749
|
+
Pa = void 0;
|
|
2674
2750
|
}, t);
|
|
2675
2751
|
}
|
|
2676
2752
|
};
|
|
2677
2753
|
}
|
|
2678
|
-
function
|
|
2679
|
-
clearTimeout(
|
|
2754
|
+
function Ia() {
|
|
2755
|
+
clearTimeout(Pa), Pa = void 0;
|
|
2680
2756
|
}
|
|
2681
|
-
function
|
|
2757
|
+
function La(e, t, n) {
|
|
2682
2758
|
e.scrollLeft += t, e.scrollTop += n;
|
|
2683
2759
|
}
|
|
2684
|
-
function
|
|
2760
|
+
function Ra(e) {
|
|
2685
2761
|
var t = window.Polymer, n = window.jQuery || window.Zepto;
|
|
2686
2762
|
return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
|
|
2687
2763
|
}
|
|
2688
|
-
function
|
|
2764
|
+
function za(e, t, n) {
|
|
2689
2765
|
var r = {};
|
|
2690
2766
|
return Array.from(e.children).forEach(function(i) {
|
|
2691
|
-
if (!(!
|
|
2692
|
-
var a =
|
|
2767
|
+
if (!(!ba(i, t.draggable, e, !1) || i.animated || i === n)) {
|
|
2768
|
+
var a = V(i);
|
|
2693
2769
|
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);
|
|
2694
2770
|
}
|
|
2695
2771
|
}), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
|
|
2696
2772
|
}
|
|
2697
|
-
var
|
|
2698
|
-
function
|
|
2773
|
+
var H = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
|
|
2774
|
+
function Ba() {
|
|
2699
2775
|
var e = [], t;
|
|
2700
2776
|
return {
|
|
2701
2777
|
captureAnimationState: function() {
|
|
2702
2778
|
e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
|
|
2703
|
-
if (!(
|
|
2779
|
+
if (!(B(t, "display") === "none" || t === Q.ghost)) {
|
|
2704
2780
|
e.push({
|
|
2705
2781
|
target: t,
|
|
2706
|
-
rect:
|
|
2782
|
+
rect: V(t)
|
|
2707
2783
|
});
|
|
2708
|
-
var n =
|
|
2784
|
+
var n = ra({}, e[e.length - 1].rect);
|
|
2709
2785
|
if (t.thisAnimationDuration) {
|
|
2710
|
-
var r =
|
|
2786
|
+
var r = Sa(t, !0);
|
|
2711
2787
|
r && (n.top -= r.f, n.left -= r.e);
|
|
2712
2788
|
}
|
|
2713
2789
|
t.fromRect = n;
|
|
@@ -2718,7 +2794,7 @@ function Aa() {
|
|
|
2718
2794
|
e.push(t);
|
|
2719
2795
|
},
|
|
2720
2796
|
removeAnimationState: function(t) {
|
|
2721
|
-
e.splice(
|
|
2797
|
+
e.splice(Aa(e, { target: t }), 1);
|
|
2722
2798
|
},
|
|
2723
2799
|
animateAll: function(n) {
|
|
2724
2800
|
var r = this;
|
|
@@ -2728,8 +2804,8 @@ function Aa() {
|
|
|
2728
2804
|
}
|
|
2729
2805
|
var i = !1, a = 0;
|
|
2730
2806
|
e.forEach(function(e) {
|
|
2731
|
-
var t = 0, n = e.target, o = n.fromRect, s =
|
|
2732
|
-
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration &&
|
|
2807
|
+
var t = 0, n = e.target, o = n.fromRect, s = V(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Sa(n, !0);
|
|
2808
|
+
d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Na(c, s) && !Na(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = Ha(u, c, l, r.options)), Na(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() {
|
|
2733
2809
|
n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
|
|
2734
2810
|
}, t), n.thisAnimationDuration = t);
|
|
2735
2811
|
}), clearTimeout(t), i ? t = setTimeout(function() {
|
|
@@ -2738,27 +2814,27 @@ function Aa() {
|
|
|
2738
2814
|
},
|
|
2739
2815
|
animate: function(e, t, n, r) {
|
|
2740
2816
|
if (r) {
|
|
2741
|
-
|
|
2742
|
-
var i =
|
|
2743
|
-
e.animatingX = !!s, e.animatingY = !!c,
|
|
2744
|
-
|
|
2817
|
+
B(e, "transition", ""), B(e, "transform", "");
|
|
2818
|
+
var i = Sa(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
|
|
2819
|
+
e.animatingX = !!s, e.animatingY = !!c, B(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = Va(e), B(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), B(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
|
|
2820
|
+
B(e, "transition", ""), B(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
|
|
2745
2821
|
}, r);
|
|
2746
2822
|
}
|
|
2747
2823
|
}
|
|
2748
2824
|
};
|
|
2749
2825
|
}
|
|
2750
|
-
function
|
|
2826
|
+
function Va(e) {
|
|
2751
2827
|
return e.offsetWidth;
|
|
2752
2828
|
}
|
|
2753
|
-
function
|
|
2829
|
+
function Ha(e, t, n, r) {
|
|
2754
2830
|
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;
|
|
2755
2831
|
}
|
|
2756
|
-
var
|
|
2832
|
+
var Ua = [], Wa = { initializeByDefault: !0 }, Ga = {
|
|
2757
2833
|
mount: function(e) {
|
|
2758
|
-
for (var t in
|
|
2759
|
-
|
|
2834
|
+
for (var t in Wa) Wa.hasOwnProperty(t) && !(t in e) && (e[t] = Wa[t]);
|
|
2835
|
+
Ua.forEach(function(t) {
|
|
2760
2836
|
if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
|
|
2761
|
-
}),
|
|
2837
|
+
}), Ua.push(e);
|
|
2762
2838
|
},
|
|
2763
2839
|
pluginEvent: function(e, t, n) {
|
|
2764
2840
|
var r = this;
|
|
@@ -2766,16 +2842,16 @@ var Na = [], Pa = { initializeByDefault: !0 }, Fa = {
|
|
|
2766
2842
|
r.eventCanceled = !0;
|
|
2767
2843
|
};
|
|
2768
2844
|
var i = e + "Global";
|
|
2769
|
-
|
|
2770
|
-
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](
|
|
2845
|
+
Ua.forEach(function(r) {
|
|
2846
|
+
t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](ra({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](ra({ sortable: t }, n)));
|
|
2771
2847
|
});
|
|
2772
2848
|
},
|
|
2773
2849
|
initializePlugins: function(e, t, n, r) {
|
|
2774
|
-
for (var i in
|
|
2850
|
+
for (var i in Ua.forEach(function(r) {
|
|
2775
2851
|
var i = r.pluginName;
|
|
2776
2852
|
if (!(!e.options[i] && !r.initializeByDefault)) {
|
|
2777
2853
|
var a = new r(e, t, e.options);
|
|
2778
|
-
a.sortable = e, a.options = e.options, e[i] = a,
|
|
2854
|
+
a.sortable = e, a.options = e.options, e[i] = a, oa(n, a.defaults);
|
|
2779
2855
|
}
|
|
2780
2856
|
}), e.options) if (e.options.hasOwnProperty(i)) {
|
|
2781
2857
|
var a = this.modifyOption(e, i, e.options[i]);
|
|
@@ -2784,59 +2860,59 @@ var Na = [], Pa = { initializeByDefault: !0 }, Fa = {
|
|
|
2784
2860
|
},
|
|
2785
2861
|
getEventProperties: function(e, t) {
|
|
2786
2862
|
var n = {};
|
|
2787
|
-
return
|
|
2788
|
-
typeof r.eventProperties == "function" &&
|
|
2863
|
+
return Ua.forEach(function(r) {
|
|
2864
|
+
typeof r.eventProperties == "function" && oa(n, r.eventProperties.call(t[r.pluginName], e));
|
|
2789
2865
|
}), n;
|
|
2790
2866
|
},
|
|
2791
2867
|
modifyOption: function(e, t, n) {
|
|
2792
2868
|
var r;
|
|
2793
|
-
return
|
|
2869
|
+
return Ua.forEach(function(i) {
|
|
2794
2870
|
e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
|
|
2795
2871
|
}), r;
|
|
2796
2872
|
}
|
|
2797
2873
|
};
|
|
2798
|
-
function
|
|
2874
|
+
function Ka(e) {
|
|
2799
2875
|
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;
|
|
2800
|
-
if (t ||= n && n[
|
|
2876
|
+
if (t ||= n && n[H], t) {
|
|
2801
2877
|
var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
|
|
2802
|
-
window.CustomEvent && !
|
|
2878
|
+
window.CustomEvent && !da && !fa ? h = new CustomEvent(r, {
|
|
2803
2879
|
bubbles: !0,
|
|
2804
2880
|
cancelable: !0
|
|
2805
2881
|
}) : (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;
|
|
2806
|
-
var v =
|
|
2882
|
+
var v = ra(ra({}, m), Ga.getEventProperties(r, t));
|
|
2807
2883
|
for (var y in v) h[y] = v[y];
|
|
2808
2884
|
n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
|
|
2809
2885
|
}
|
|
2810
2886
|
}
|
|
2811
|
-
var
|
|
2812
|
-
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i =
|
|
2813
|
-
|
|
2814
|
-
dragEl:
|
|
2815
|
-
parentEl:
|
|
2816
|
-
ghostEl:
|
|
2817
|
-
rootEl:
|
|
2818
|
-
nextEl:
|
|
2819
|
-
lastDownEl:
|
|
2820
|
-
cloneEl:
|
|
2821
|
-
cloneHidden:
|
|
2822
|
-
dragStarted:
|
|
2887
|
+
var qa = ["evt"], U = function(e, t) {
|
|
2888
|
+
var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = ca(n, qa);
|
|
2889
|
+
Ga.pluginEvent.bind(Q)(e, t, ra({
|
|
2890
|
+
dragEl: G,
|
|
2891
|
+
parentEl: K,
|
|
2892
|
+
ghostEl: q,
|
|
2893
|
+
rootEl: J,
|
|
2894
|
+
nextEl: Ja,
|
|
2895
|
+
lastDownEl: Ya,
|
|
2896
|
+
cloneEl: Y,
|
|
2897
|
+
cloneHidden: Xa,
|
|
2898
|
+
dragStarted: fo,
|
|
2823
2899
|
putSortable: X,
|
|
2824
2900
|
activeSortable: Q.active,
|
|
2825
2901
|
originalEvent: r,
|
|
2826
|
-
oldIndex:
|
|
2827
|
-
oldDraggableIndex:
|
|
2828
|
-
newIndex:
|
|
2829
|
-
newDraggableIndex:
|
|
2830
|
-
hideGhostForTarget:
|
|
2831
|
-
unhideGhostForTarget:
|
|
2902
|
+
oldIndex: Za,
|
|
2903
|
+
oldDraggableIndex: $a,
|
|
2904
|
+
newIndex: Qa,
|
|
2905
|
+
newDraggableIndex: eo,
|
|
2906
|
+
hideGhostForTarget: Ao,
|
|
2907
|
+
unhideGhostForTarget: jo,
|
|
2832
2908
|
cloneNowHidden: function() {
|
|
2833
|
-
|
|
2909
|
+
Xa = !0;
|
|
2834
2910
|
},
|
|
2835
2911
|
cloneNowShown: function() {
|
|
2836
|
-
|
|
2912
|
+
Xa = !1;
|
|
2837
2913
|
},
|
|
2838
2914
|
dispatchSortableEvent: function(e) {
|
|
2839
|
-
|
|
2915
|
+
W({
|
|
2840
2916
|
sortable: t,
|
|
2841
2917
|
name: e,
|
|
2842
2918
|
originalEvent: r
|
|
@@ -2844,46 +2920,46 @@ var La = ["evt"], H = function(e, t) {
|
|
|
2844
2920
|
}
|
|
2845
2921
|
}, i));
|
|
2846
2922
|
};
|
|
2847
|
-
function
|
|
2848
|
-
|
|
2923
|
+
function W(e) {
|
|
2924
|
+
Ka(ra({
|
|
2849
2925
|
putSortable: X,
|
|
2850
|
-
cloneEl:
|
|
2851
|
-
targetEl:
|
|
2852
|
-
rootEl:
|
|
2853
|
-
oldIndex:
|
|
2854
|
-
oldDraggableIndex:
|
|
2855
|
-
newIndex:
|
|
2856
|
-
newDraggableIndex:
|
|
2926
|
+
cloneEl: Y,
|
|
2927
|
+
targetEl: G,
|
|
2928
|
+
rootEl: J,
|
|
2929
|
+
oldIndex: Za,
|
|
2930
|
+
oldDraggableIndex: $a,
|
|
2931
|
+
newIndex: Qa,
|
|
2932
|
+
newDraggableIndex: eo
|
|
2857
2933
|
}, e));
|
|
2858
2934
|
}
|
|
2859
|
-
var
|
|
2860
|
-
if (
|
|
2861
|
-
if (
|
|
2935
|
+
var G, K, q, J, Ja, Ya, Y, Xa, Za, Qa, $a, eo, to, X, no = !1, ro = !1, io = [], ao, oo, so, co, lo, uo, fo, po, mo, ho = !1, go = !1, _o, Z, vo = [], yo = !1, bo = [], xo = typeof document < "u", So = ha, Co = fa || da ? "cssFloat" : "float", wo = xo && !ga && !ha && "draggable" in document.createElement("div"), To = function() {
|
|
2936
|
+
if (xo) {
|
|
2937
|
+
if (da) return !1;
|
|
2862
2938
|
var e = document.createElement("x");
|
|
2863
2939
|
return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
|
|
2864
2940
|
}
|
|
2865
|
-
}(),
|
|
2866
|
-
var n =
|
|
2941
|
+
}(), Eo = function(e, t) {
|
|
2942
|
+
var n = B(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = Ea(e, 0, t), a = Ea(e, 1, t), o = i && B(i), s = a && B(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + V(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + V(a).width;
|
|
2867
2943
|
if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
|
|
2868
2944
|
if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
|
|
2869
2945
|
if (i && o.float && o.float !== "none") {
|
|
2870
2946
|
var u = o.float === "left" ? "left" : "right";
|
|
2871
2947
|
return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
|
|
2872
2948
|
}
|
|
2873
|
-
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[
|
|
2874
|
-
},
|
|
2949
|
+
return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[Co] === "none" || a && n[Co] === "none" && c + l > r) ? "vertical" : "horizontal";
|
|
2950
|
+
}, Do = function(e, t, n) {
|
|
2875
2951
|
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;
|
|
2876
2952
|
return r === o || i === s || r + a / 2 === o + c / 2;
|
|
2877
|
-
},
|
|
2953
|
+
}, Oo = function(e, t) {
|
|
2878
2954
|
var n;
|
|
2879
|
-
return
|
|
2880
|
-
var i = r[
|
|
2881
|
-
if (!(!i ||
|
|
2882
|
-
var a =
|
|
2955
|
+
return io.some(function(r) {
|
|
2956
|
+
var i = r[H].options.emptyInsertThreshold;
|
|
2957
|
+
if (!(!i || Da(r))) {
|
|
2958
|
+
var a = V(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
|
|
2883
2959
|
if (o && s) return n = r;
|
|
2884
2960
|
}
|
|
2885
2961
|
}), n;
|
|
2886
|
-
},
|
|
2962
|
+
}, ko = function(e) {
|
|
2887
2963
|
function t(e, n) {
|
|
2888
2964
|
return function(r, i, a, o) {
|
|
2889
2965
|
var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
|
|
@@ -2896,31 +2972,31 @@ var W, G, K, q, Ra, za, J, Ba, Va, Y, Ha, Ua, Wa, X, Ga = !1, Ka = !1, qa = [],
|
|
|
2896
2972
|
};
|
|
2897
2973
|
}
|
|
2898
2974
|
var n = {}, r = e.group;
|
|
2899
|
-
(!r ||
|
|
2900
|
-
},
|
|
2901
|
-
!
|
|
2902
|
-
},
|
|
2903
|
-
!
|
|
2975
|
+
(!r || ia(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;
|
|
2976
|
+
}, Ao = function() {
|
|
2977
|
+
!To && q && B(q, "display", "none");
|
|
2978
|
+
}, jo = function() {
|
|
2979
|
+
!To && q && B(q, "display", "");
|
|
2904
2980
|
};
|
|
2905
|
-
|
|
2906
|
-
if (
|
|
2981
|
+
xo && !ga && document.addEventListener("click", function(e) {
|
|
2982
|
+
if (ro) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), ro = !1, !1;
|
|
2907
2983
|
}, !0);
|
|
2908
|
-
var
|
|
2909
|
-
if (
|
|
2984
|
+
var Mo = function(e) {
|
|
2985
|
+
if (G) {
|
|
2910
2986
|
e = e.touches ? e.touches[0] : e;
|
|
2911
|
-
var t =
|
|
2987
|
+
var t = Oo(e.clientX, e.clientY);
|
|
2912
2988
|
if (t) {
|
|
2913
2989
|
var n = {};
|
|
2914
2990
|
for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
|
|
2915
|
-
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[
|
|
2991
|
+
n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[H]._onDragOver(n);
|
|
2916
2992
|
}
|
|
2917
2993
|
}
|
|
2918
|
-
},
|
|
2919
|
-
|
|
2994
|
+
}, No = function(e) {
|
|
2995
|
+
G && G.parentNode[H]._isOutsideThisEl(e.target);
|
|
2920
2996
|
};
|
|
2921
2997
|
function Q(e, t) {
|
|
2922
2998
|
if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
|
|
2923
|
-
this.el = e, this.options = t =
|
|
2999
|
+
this.el = e, this.options = t = oa({}, t), e[H] = this;
|
|
2924
3000
|
var n = {
|
|
2925
3001
|
group: null,
|
|
2926
3002
|
sort: !0,
|
|
@@ -2933,7 +3009,7 @@ function Q(e, t) {
|
|
|
2933
3009
|
invertedSwapThreshold: null,
|
|
2934
3010
|
removeCloneOnHide: !0,
|
|
2935
3011
|
direction: function() {
|
|
2936
|
-
return
|
|
3012
|
+
return Eo(e, this.options);
|
|
2937
3013
|
},
|
|
2938
3014
|
ghostClass: "sortable-ghost",
|
|
2939
3015
|
chosenClass: "sortable-chosen",
|
|
@@ -2960,80 +3036,80 @@ function Q(e, t) {
|
|
|
2960
3036
|
x: 0,
|
|
2961
3037
|
y: 0
|
|
2962
3038
|
},
|
|
2963
|
-
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !
|
|
3039
|
+
supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !ma,
|
|
2964
3040
|
emptyInsertThreshold: 5
|
|
2965
3041
|
};
|
|
2966
|
-
for (var r in
|
|
2967
|
-
for (var i in
|
|
2968
|
-
this.nativeDraggable = !t.forceFallback &&
|
|
3042
|
+
for (var r in Ga.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
|
|
3043
|
+
for (var i in ko(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
|
|
3044
|
+
this.nativeDraggable = !t.forceFallback && wo, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? L(e, "pointerdown", this._onTapStart) : (L(e, "mousedown", this._onTapStart), L(e, "touchstart", this._onTapStart)), this.nativeDraggable && (L(e, "dragover", this), L(e, "dragenter", this)), io.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), oa(this, Ba());
|
|
2969
3045
|
}
|
|
2970
3046
|
Q.prototype = {
|
|
2971
3047
|
constructor: Q,
|
|
2972
3048
|
_isOutsideThisEl: function(e) {
|
|
2973
|
-
!this.el.contains(e) && e !== this.el && (
|
|
3049
|
+
!this.el.contains(e) && e !== this.el && (po = null);
|
|
2974
3050
|
},
|
|
2975
3051
|
_getDirection: function(e, t) {
|
|
2976
|
-
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t,
|
|
3052
|
+
return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, G) : this.options.direction;
|
|
2977
3053
|
},
|
|
2978
3054
|
_onTapStart: function(e) {
|
|
2979
3055
|
if (e.cancelable) {
|
|
2980
3056
|
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;
|
|
2981
|
-
if (
|
|
2982
|
-
if (
|
|
3057
|
+
if (Uo(n), !G && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && ma && s && s.tagName.toUpperCase() === "SELECT") && (s = ba(s, r.draggable, n, !1), !(s && s.animated) && Ya !== s)) {
|
|
3058
|
+
if (Za = Oa(s), $a = Oa(s, r.draggable), typeof l == "function") {
|
|
2983
3059
|
if (l.call(this, e, s, this)) {
|
|
2984
|
-
|
|
3060
|
+
W({
|
|
2985
3061
|
sortable: t,
|
|
2986
3062
|
rootEl: c,
|
|
2987
3063
|
name: "filter",
|
|
2988
3064
|
targetEl: s,
|
|
2989
3065
|
toEl: n,
|
|
2990
3066
|
fromEl: n
|
|
2991
|
-
}),
|
|
3067
|
+
}), U("filter", t, { evt: e }), i && e.cancelable && e.preventDefault();
|
|
2992
3068
|
return;
|
|
2993
3069
|
}
|
|
2994
3070
|
} else if (l && (l = l.split(",").some(function(r) {
|
|
2995
|
-
if (r =
|
|
3071
|
+
if (r = ba(c, r.trim(), n, !1), r) return W({
|
|
2996
3072
|
sortable: t,
|
|
2997
3073
|
rootEl: r,
|
|
2998
3074
|
name: "filter",
|
|
2999
3075
|
targetEl: s,
|
|
3000
3076
|
fromEl: n,
|
|
3001
3077
|
toEl: n
|
|
3002
|
-
}),
|
|
3078
|
+
}), U("filter", t, { evt: e }), !0;
|
|
3003
3079
|
}), l)) {
|
|
3004
3080
|
i && e.cancelable && e.preventDefault();
|
|
3005
3081
|
return;
|
|
3006
3082
|
}
|
|
3007
|
-
r.handle && !
|
|
3083
|
+
r.handle && !ba(c, r.handle, n, !1) || this._prepareDragStart(e, o, s);
|
|
3008
3084
|
}
|
|
3009
3085
|
}
|
|
3010
3086
|
},
|
|
3011
3087
|
_prepareDragStart: function(e, t, n) {
|
|
3012
3088
|
var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
|
|
3013
|
-
if (n && !
|
|
3014
|
-
var c =
|
|
3015
|
-
if (
|
|
3016
|
-
target:
|
|
3089
|
+
if (n && !G && n.parentNode === i) {
|
|
3090
|
+
var c = V(n);
|
|
3091
|
+
if (J = i, G = n, K = G.parentNode, Ja = G.nextSibling, Ya = n, to = a.group, Q.dragged = G, ao = {
|
|
3092
|
+
target: G,
|
|
3017
3093
|
clientX: (t || e).clientX,
|
|
3018
3094
|
clientY: (t || e).clientY
|
|
3019
|
-
},
|
|
3020
|
-
if (
|
|
3095
|
+
}, lo = ao.clientX - c.left, uo = ao.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, G.style["will-change"] = "all", s = function() {
|
|
3096
|
+
if (U("delayEnded", r, { evt: e }), Q.eventCanceled) {
|
|
3021
3097
|
r._onDrop();
|
|
3022
3098
|
return;
|
|
3023
3099
|
}
|
|
3024
|
-
r._disableDelayedDragEvents(), !
|
|
3100
|
+
r._disableDelayedDragEvents(), !pa && r.nativeDraggable && (G.draggable = !0), r._triggerDragStart(e, t), W({
|
|
3025
3101
|
sortable: r,
|
|
3026
3102
|
name: "choose",
|
|
3027
3103
|
originalEvent: e
|
|
3028
|
-
}),
|
|
3104
|
+
}), z(G, a.chosenClass, !0);
|
|
3029
3105
|
}, a.ignore.split(",").forEach(function(e) {
|
|
3030
|
-
|
|
3031
|
-
}),
|
|
3106
|
+
Ca(G, e.trim(), Io);
|
|
3107
|
+
}), L(o, "dragover", Mo), L(o, "mousemove", Mo), L(o, "touchmove", Mo), L(o, "mouseup", r._onDrop), L(o, "touchend", r._onDrop), L(o, "touchcancel", r._onDrop), pa && this.nativeDraggable && (this.options.touchStartThreshold = 4, G.draggable = !0), U("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(fa || da))) {
|
|
3032
3108
|
if (Q.eventCanceled) {
|
|
3033
3109
|
this._onDrop();
|
|
3034
3110
|
return;
|
|
3035
3111
|
}
|
|
3036
|
-
|
|
3112
|
+
L(o, "mouseup", r._disableDelayedDrag), L(o, "touchend", r._disableDelayedDrag), L(o, "touchcancel", r._disableDelayedDrag), L(o, "mousemove", r._delayedDragTouchMoveHandler), L(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && L(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
|
|
3037
3113
|
} else s();
|
|
3038
3114
|
}
|
|
3039
3115
|
},
|
|
@@ -3042,25 +3118,25 @@ Q.prototype = {
|
|
|
3042
3118
|
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();
|
|
3043
3119
|
},
|
|
3044
3120
|
_disableDelayedDrag: function() {
|
|
3045
|
-
|
|
3121
|
+
G && Io(G), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
|
|
3046
3122
|
},
|
|
3047
3123
|
_disableDelayedDragEvents: function() {
|
|
3048
3124
|
var e = this.el.ownerDocument;
|
|
3049
|
-
|
|
3125
|
+
R(e, "mouseup", this._disableDelayedDrag), R(e, "touchend", this._disableDelayedDrag), R(e, "touchcancel", this._disableDelayedDrag), R(e, "mousemove", this._delayedDragTouchMoveHandler), R(e, "touchmove", this._delayedDragTouchMoveHandler), R(e, "pointermove", this._delayedDragTouchMoveHandler);
|
|
3050
3126
|
},
|
|
3051
3127
|
_triggerDragStart: function(e, t) {
|
|
3052
|
-
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ?
|
|
3128
|
+
t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? L(document, "pointermove", this._onTouchMove) : t ? L(document, "touchmove", this._onTouchMove) : L(document, "mousemove", this._onTouchMove) : (L(G, "dragend", this), L(J, "dragstart", this._onDragStart));
|
|
3053
3129
|
try {
|
|
3054
|
-
document.selection ?
|
|
3130
|
+
document.selection ? Wo(function() {
|
|
3055
3131
|
document.selection.empty();
|
|
3056
3132
|
}) : window.getSelection().removeAllRanges();
|
|
3057
3133
|
} catch {}
|
|
3058
3134
|
},
|
|
3059
3135
|
_dragStarted: function(e, t) {
|
|
3060
|
-
if (
|
|
3061
|
-
|
|
3136
|
+
if (no = !1, J && G) {
|
|
3137
|
+
U("dragStarted", this, { evt: t }), this.nativeDraggable && L(document, "dragover", No);
|
|
3062
3138
|
var n = this.options;
|
|
3063
|
-
!e &&
|
|
3139
|
+
!e && z(G, n.dragClass, !1), z(G, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), W({
|
|
3064
3140
|
sortable: this,
|
|
3065
3141
|
name: "start",
|
|
3066
3142
|
originalEvent: t
|
|
@@ -3068,33 +3144,33 @@ Q.prototype = {
|
|
|
3068
3144
|
} else this._nulling();
|
|
3069
3145
|
},
|
|
3070
3146
|
_emulateDragOver: function() {
|
|
3071
|
-
if (
|
|
3072
|
-
this._lastX =
|
|
3073
|
-
for (var e = document.elementFromPoint(
|
|
3074
|
-
if (
|
|
3075
|
-
if (t[
|
|
3147
|
+
if (oo) {
|
|
3148
|
+
this._lastX = oo.clientX, this._lastY = oo.clientY, Ao();
|
|
3149
|
+
for (var e = document.elementFromPoint(oo.clientX, oo.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(oo.clientX, oo.clientY), e !== t);) t = e;
|
|
3150
|
+
if (G.parentNode[H]._isOutsideThisEl(e), t) do {
|
|
3151
|
+
if (t[H]) {
|
|
3076
3152
|
var n = void 0;
|
|
3077
|
-
if (n = t[
|
|
3078
|
-
clientX:
|
|
3079
|
-
clientY:
|
|
3153
|
+
if (n = t[H]._onDragOver({
|
|
3154
|
+
clientX: oo.clientX,
|
|
3155
|
+
clientY: oo.clientY,
|
|
3080
3156
|
target: e,
|
|
3081
3157
|
rootEl: t
|
|
3082
3158
|
}), n && !this.options.dragoverBubble) break;
|
|
3083
3159
|
}
|
|
3084
3160
|
e = t;
|
|
3085
3161
|
} while (t = t.parentNode);
|
|
3086
|
-
|
|
3162
|
+
jo();
|
|
3087
3163
|
}
|
|
3088
3164
|
},
|
|
3089
3165
|
_onTouchMove: function(e) {
|
|
3090
|
-
if (
|
|
3091
|
-
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a =
|
|
3092
|
-
if (!Q.active && !
|
|
3166
|
+
if (ao) {
|
|
3167
|
+
var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = q && Sa(q, !0), o = q && a && a.a, s = q && a && a.d, c = So && Z && ka(Z), l = (i.clientX - ao.clientX + r.x) / (o || 1) + (c ? c[0] - vo[0] : 0) / (o || 1), u = (i.clientY - ao.clientY + r.y) / (s || 1) + (c ? c[1] - vo[1] : 0) / (s || 1);
|
|
3168
|
+
if (!Q.active && !no) {
|
|
3093
3169
|
if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
|
|
3094
3170
|
this._onDragStart(e, !0);
|
|
3095
3171
|
}
|
|
3096
|
-
if (
|
|
3097
|
-
a ? (a.e += l - (
|
|
3172
|
+
if (q) {
|
|
3173
|
+
a ? (a.e += l - (so || 0), a.f += u - (co || 0)) : a = {
|
|
3098
3174
|
a: 1,
|
|
3099
3175
|
b: 0,
|
|
3100
3176
|
c: 0,
|
|
@@ -3103,39 +3179,39 @@ Q.prototype = {
|
|
|
3103
3179
|
f: u
|
|
3104
3180
|
};
|
|
3105
3181
|
var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
|
|
3106
|
-
|
|
3182
|
+
B(q, "webkitTransform", d), B(q, "mozTransform", d), B(q, "msTransform", d), B(q, "transform", d), so = l, co = u, oo = i;
|
|
3107
3183
|
}
|
|
3108
3184
|
e.cancelable && e.preventDefault();
|
|
3109
3185
|
}
|
|
3110
3186
|
},
|
|
3111
3187
|
_appendGhost: function() {
|
|
3112
|
-
if (!
|
|
3113
|
-
var e = this.options.fallbackOnBody ? document.body :
|
|
3114
|
-
if (
|
|
3115
|
-
for (Z = e;
|
|
3116
|
-
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z =
|
|
3188
|
+
if (!q) {
|
|
3189
|
+
var e = this.options.fallbackOnBody ? document.body : J, t = V(G, !0, So, !0, e), n = this.options;
|
|
3190
|
+
if (So) {
|
|
3191
|
+
for (Z = e; B(Z, "position") === "static" && B(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
|
|
3192
|
+
Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = wa()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = wa(), vo = ka(Z);
|
|
3117
3193
|
}
|
|
3118
|
-
|
|
3194
|
+
q = G.cloneNode(!0), z(q, n.ghostClass, !1), z(q, n.fallbackClass, !0), z(q, n.dragClass, !0), B(q, "transition", ""), B(q, "transform", ""), B(q, "box-sizing", "border-box"), B(q, "margin", 0), B(q, "top", t.top), B(q, "left", t.left), B(q, "width", t.width), B(q, "height", t.height), B(q, "opacity", "0.8"), B(q, "position", So ? "absolute" : "fixed"), B(q, "zIndex", "100000"), B(q, "pointerEvents", "none"), Q.ghost = q, e.appendChild(q), B(q, "transform-origin", lo / parseInt(q.style.width) * 100 + "% " + uo / parseInt(q.style.height) * 100 + "%");
|
|
3119
3195
|
}
|
|
3120
3196
|
},
|
|
3121
3197
|
_onDragStart: function(e, t) {
|
|
3122
3198
|
var n = this, r = e.dataTransfer, i = n.options;
|
|
3123
|
-
if (
|
|
3199
|
+
if (U("dragStart", this, { evt: e }), Q.eventCanceled) {
|
|
3124
3200
|
this._onDrop();
|
|
3125
3201
|
return;
|
|
3126
3202
|
}
|
|
3127
|
-
|
|
3128
|
-
|
|
3203
|
+
U("setupClone", this), Q.eventCanceled || (Y = Ra(G), Y.removeAttribute("id"), Y.draggable = !1, Y.style["will-change"] = "", this._hideClone(), z(Y, this.options.chosenClass, !1), Q.clone = Y), n.cloneId = Wo(function() {
|
|
3204
|
+
U("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || J.insertBefore(Y, G), n._hideClone(), W({
|
|
3129
3205
|
sortable: n,
|
|
3130
3206
|
name: "clone"
|
|
3131
3207
|
}));
|
|
3132
|
-
}), !t &&
|
|
3208
|
+
}), !t && z(G, i.dragClass, !0), t ? (ro = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (R(document, "mouseup", n._onDrop), R(document, "touchend", n._onDrop), R(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, G)), L(document, "drop", n), B(G, "transform", "translateZ(0)")), no = !0, n._dragStartId = Wo(n._dragStarted.bind(n, t, e)), L(document, "selectstart", n), fo = !0, ma && B(document.body, "user-select", "none");
|
|
3133
3209
|
},
|
|
3134
3210
|
_onDragOver: function(e) {
|
|
3135
|
-
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l =
|
|
3136
|
-
if (
|
|
3211
|
+
var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = to === s, u = o.sort, d = X || c, f, p = this, m = !1;
|
|
3212
|
+
if (yo) return;
|
|
3137
3213
|
function h(o, s) {
|
|
3138
|
-
|
|
3214
|
+
U(o, p, ra({
|
|
3139
3215
|
evt: e,
|
|
3140
3216
|
isOwner: l,
|
|
3141
3217
|
axis: f ? "vertical" : "horizontal",
|
|
@@ -3147,7 +3223,7 @@ Q.prototype = {
|
|
|
3147
3223
|
target: n,
|
|
3148
3224
|
completed: _,
|
|
3149
3225
|
onMove: function(n, i) {
|
|
3150
|
-
return
|
|
3226
|
+
return Fo(J, t, G, r, n, V(n), e, i);
|
|
3151
3227
|
},
|
|
3152
3228
|
changed: v
|
|
3153
3229
|
}, s));
|
|
@@ -3156,119 +3232,119 @@ Q.prototype = {
|
|
|
3156
3232
|
h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
|
|
3157
3233
|
}
|
|
3158
3234
|
function _(r) {
|
|
3159
|
-
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (
|
|
3235
|
+
return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (z(G, X ? X.options.ghostClass : c.options.ghostClass, !1), z(G, o.ghostClass, !0)), X !== p && p !== Q.active ? X = p : p === Q.active && X && (X = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
|
|
3160
3236
|
h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
|
|
3161
|
-
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n ===
|
|
3237
|
+
}), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === G && !G.animated || n === t && !n.animated) && (po = null), !o.dragoverBubble && !e.rootEl && n !== document && (G.parentNode[H]._isOutsideThisEl(e.target), !r && Mo(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
|
|
3162
3238
|
}
|
|
3163
3239
|
function v() {
|
|
3164
|
-
|
|
3240
|
+
Qa = Oa(G), eo = Oa(G, o.draggable), W({
|
|
3165
3241
|
sortable: p,
|
|
3166
3242
|
name: "change",
|
|
3167
3243
|
toEl: t,
|
|
3168
|
-
newIndex:
|
|
3169
|
-
newDraggableIndex:
|
|
3244
|
+
newIndex: Qa,
|
|
3245
|
+
newDraggableIndex: eo,
|
|
3170
3246
|
originalEvent: e
|
|
3171
3247
|
});
|
|
3172
3248
|
}
|
|
3173
|
-
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n =
|
|
3174
|
-
if (
|
|
3175
|
-
if (
|
|
3176
|
-
if (f = this._getDirection(e, n) === "vertical", r =
|
|
3177
|
-
if (a) return
|
|
3178
|
-
var y =
|
|
3179
|
-
if (!y ||
|
|
3180
|
-
if (y ===
|
|
3181
|
-
if (y && t === e.target && (n = y), n && (i =
|
|
3182
|
-
} else if (y &&
|
|
3183
|
-
var b =
|
|
3184
|
-
if (b ===
|
|
3185
|
-
if (n = b, i =
|
|
3249
|
+
if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = ba(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
|
|
3250
|
+
if (G.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
|
|
3251
|
+
if (ro = !1, c && !o.disabled && (l ? u || (a = K !== J) : X === this || (this.lastPutMode = to.checkPull(this, c, G, e)) && s.checkPut(this, c, G, e))) {
|
|
3252
|
+
if (f = this._getDirection(e, n) === "vertical", r = V(G), h("dragOverValid"), Q.eventCanceled) return m;
|
|
3253
|
+
if (a) return K = J, g(), this._hideClone(), h("revert"), Q.eventCanceled || (Ja ? J.insertBefore(G, Ja) : J.appendChild(G)), _(!0);
|
|
3254
|
+
var y = Da(t, o.draggable);
|
|
3255
|
+
if (!y || zo(e, f, this) && !y.animated) {
|
|
3256
|
+
if (y === G) return _(!1);
|
|
3257
|
+
if (y && t === e.target && (n = y), n && (i = V(n)), Fo(J, t, G, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(G, y.nextSibling) : t.appendChild(G), K = t, v(), _(!0);
|
|
3258
|
+
} else if (y && Ro(e, f, this)) {
|
|
3259
|
+
var b = Ea(t, 0, o, !0);
|
|
3260
|
+
if (b === G) return _(!1);
|
|
3261
|
+
if (n = b, i = V(n), Fo(J, t, G, r, n, i, e, !1) !== !1) return g(), t.insertBefore(G, b), K = t, v(), _(!0);
|
|
3186
3262
|
} else if (n.parentNode === t) {
|
|
3187
|
-
i =
|
|
3188
|
-
var x = 0, S, C =
|
|
3189
|
-
|
|
3263
|
+
i = V(n);
|
|
3264
|
+
var x = 0, S, C = G.parentNode !== t, w = !Do(G.animated && G.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = Ta(n, "top", "top") || Ta(G, "top", "top"), D = E ? E.scrollTop : void 0;
|
|
3265
|
+
po !== n && (S = i[T], ho = !1, go = !w && o.invertSwap || C), x = Bo(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, go, po === n);
|
|
3190
3266
|
var O;
|
|
3191
3267
|
if (x !== 0) {
|
|
3192
|
-
var k =
|
|
3268
|
+
var k = Oa(G);
|
|
3193
3269
|
do
|
|
3194
|
-
k -= x, O =
|
|
3195
|
-
while (O && (
|
|
3270
|
+
k -= x, O = K.children[k];
|
|
3271
|
+
while (O && (B(O, "display") === "none" || O === q));
|
|
3196
3272
|
}
|
|
3197
3273
|
if (x === 0 || O === n) return _(!1);
|
|
3198
|
-
|
|
3199
|
-
var
|
|
3200
|
-
|
|
3201
|
-
var
|
|
3202
|
-
if (
|
|
3274
|
+
po = n, mo = x;
|
|
3275
|
+
var A = n.nextElementSibling, j = !1;
|
|
3276
|
+
j = x === 1;
|
|
3277
|
+
var ee = Fo(J, t, G, r, n, i, e, j);
|
|
3278
|
+
if (ee !== !1) return (ee === 1 || ee === -1) && (j = ee === 1), yo = !0, setTimeout(Lo, 30), g(), j && !A ? t.appendChild(G) : n.parentNode.insertBefore(G, j ? A : n), E && La(E, 0, D - E.scrollTop), K = G.parentNode, S !== void 0 && !go && (_o = Math.abs(S - V(n)[T])), v(), _(!0);
|
|
3203
3279
|
}
|
|
3204
|
-
if (t.contains(
|
|
3280
|
+
if (t.contains(G)) return _(!1);
|
|
3205
3281
|
}
|
|
3206
3282
|
return !1;
|
|
3207
3283
|
},
|
|
3208
3284
|
_ignoreWhileAnimating: null,
|
|
3209
3285
|
_offMoveEvents: function() {
|
|
3210
|
-
|
|
3286
|
+
R(document, "mousemove", this._onTouchMove), R(document, "touchmove", this._onTouchMove), R(document, "pointermove", this._onTouchMove), R(document, "dragover", Mo), R(document, "mousemove", Mo), R(document, "touchmove", Mo);
|
|
3211
3287
|
},
|
|
3212
3288
|
_offUpEvents: function() {
|
|
3213
3289
|
var e = this.el.ownerDocument;
|
|
3214
|
-
|
|
3290
|
+
R(e, "mouseup", this._onDrop), R(e, "touchend", this._onDrop), R(e, "pointerup", this._onDrop), R(e, "touchcancel", this._onDrop), R(document, "selectstart", this);
|
|
3215
3291
|
},
|
|
3216
3292
|
_onDrop: function(e) {
|
|
3217
3293
|
var t = this.el, n = this.options;
|
|
3218
|
-
if (
|
|
3294
|
+
if (Qa = Oa(G), eo = Oa(G, n.draggable), U("drop", this, { evt: e }), K = G && G.parentNode, Qa = Oa(G), eo = Oa(G, n.draggable), Q.eventCanceled) {
|
|
3219
3295
|
this._nulling();
|
|
3220
3296
|
return;
|
|
3221
3297
|
}
|
|
3222
|
-
|
|
3298
|
+
no = !1, go = !1, ho = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Go(this.cloneId), Go(this._dragStartId), this.nativeDraggable && (R(document, "drop", this), R(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), ma && B(document.body, "user-select", ""), B(G, "transform", ""), e && (fo && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), q && q.parentNode && q.parentNode.removeChild(q), (J === K || X && X.lastPutMode !== "clone") && Y && Y.parentNode && Y.parentNode.removeChild(Y), G && (this.nativeDraggable && R(G, "dragend", this), Io(G), G.style["will-change"] = "", fo && !no && z(G, X ? X.options.ghostClass : this.options.ghostClass, !1), z(G, this.options.chosenClass, !1), W({
|
|
3223
3299
|
sortable: this,
|
|
3224
3300
|
name: "unchoose",
|
|
3225
|
-
toEl:
|
|
3301
|
+
toEl: K,
|
|
3226
3302
|
newIndex: null,
|
|
3227
3303
|
newDraggableIndex: null,
|
|
3228
3304
|
originalEvent: e
|
|
3229
|
-
}),
|
|
3305
|
+
}), J === K ? Qa !== Za && Qa >= 0 && (W({
|
|
3230
3306
|
sortable: this,
|
|
3231
3307
|
name: "update",
|
|
3232
|
-
toEl:
|
|
3308
|
+
toEl: K,
|
|
3233
3309
|
originalEvent: e
|
|
3234
|
-
}),
|
|
3310
|
+
}), W({
|
|
3235
3311
|
sortable: this,
|
|
3236
3312
|
name: "sort",
|
|
3237
|
-
toEl:
|
|
3313
|
+
toEl: K,
|
|
3238
3314
|
originalEvent: e
|
|
3239
|
-
})) : (
|
|
3240
|
-
rootEl:
|
|
3315
|
+
})) : (Qa >= 0 && (W({
|
|
3316
|
+
rootEl: K,
|
|
3241
3317
|
name: "add",
|
|
3242
|
-
toEl:
|
|
3243
|
-
fromEl:
|
|
3318
|
+
toEl: K,
|
|
3319
|
+
fromEl: J,
|
|
3244
3320
|
originalEvent: e
|
|
3245
|
-
}),
|
|
3321
|
+
}), W({
|
|
3246
3322
|
sortable: this,
|
|
3247
3323
|
name: "remove",
|
|
3248
|
-
toEl:
|
|
3324
|
+
toEl: K,
|
|
3249
3325
|
originalEvent: e
|
|
3250
|
-
}),
|
|
3251
|
-
rootEl:
|
|
3326
|
+
}), W({
|
|
3327
|
+
rootEl: K,
|
|
3252
3328
|
name: "sort",
|
|
3253
|
-
toEl:
|
|
3254
|
-
fromEl:
|
|
3329
|
+
toEl: K,
|
|
3330
|
+
fromEl: J,
|
|
3255
3331
|
originalEvent: e
|
|
3256
|
-
}),
|
|
3332
|
+
}), W({
|
|
3257
3333
|
sortable: this,
|
|
3258
3334
|
name: "sort",
|
|
3259
|
-
toEl:
|
|
3335
|
+
toEl: K,
|
|
3260
3336
|
originalEvent: e
|
|
3261
|
-
})), X && X.save()), Q.active && ((
|
|
3337
|
+
})), X && X.save()), Q.active && ((Qa == null || Qa === -1) && (Qa = Za, eo = $a), W({
|
|
3262
3338
|
sortable: this,
|
|
3263
3339
|
name: "end",
|
|
3264
|
-
toEl:
|
|
3340
|
+
toEl: K,
|
|
3265
3341
|
originalEvent: e
|
|
3266
3342
|
}), this.save()))), this._nulling();
|
|
3267
3343
|
},
|
|
3268
3344
|
_nulling: function() {
|
|
3269
|
-
|
|
3345
|
+
U("nulling", this), J = G = K = q = Ja = Y = Ya = Xa = ao = oo = fo = Qa = eo = Za = $a = po = mo = X = to = Q.dragged = Q.ghost = Q.clone = Q.active = null, bo.forEach(function(e) {
|
|
3270
3346
|
e.checked = !0;
|
|
3271
|
-
}),
|
|
3347
|
+
}), bo.length = so = co = 0;
|
|
3272
3348
|
},
|
|
3273
3349
|
handleEvent: function(e) {
|
|
3274
3350
|
switch (e.type) {
|
|
@@ -3278,7 +3354,7 @@ Q.prototype = {
|
|
|
3278
3354
|
break;
|
|
3279
3355
|
case "dragenter":
|
|
3280
3356
|
case "dragover":
|
|
3281
|
-
|
|
3357
|
+
G && (this._onDragOver(e), Po(e));
|
|
3282
3358
|
break;
|
|
3283
3359
|
case "selectstart":
|
|
3284
3360
|
e.preventDefault();
|
|
@@ -3286,14 +3362,14 @@ Q.prototype = {
|
|
|
3286
3362
|
}
|
|
3287
3363
|
},
|
|
3288
3364
|
toArray: function() {
|
|
3289
|
-
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r],
|
|
3365
|
+
for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], ba(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || Ho(t));
|
|
3290
3366
|
return e;
|
|
3291
3367
|
},
|
|
3292
3368
|
sort: function(e, t) {
|
|
3293
3369
|
var n = {}, r = this.el;
|
|
3294
3370
|
this.toArray().forEach(function(e, t) {
|
|
3295
3371
|
var i = r.children[t];
|
|
3296
|
-
|
|
3372
|
+
ba(i, this.options.draggable, r, !1) && (n[e] = i);
|
|
3297
3373
|
}, this), t && this.captureAnimationState(), e.forEach(function(e) {
|
|
3298
3374
|
n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
|
|
3299
3375
|
}), t && this.animateAll();
|
|
@@ -3303,25 +3379,25 @@ Q.prototype = {
|
|
|
3303
3379
|
e && e.set && e.set(this);
|
|
3304
3380
|
},
|
|
3305
3381
|
closest: function(e, t) {
|
|
3306
|
-
return
|
|
3382
|
+
return ba(e, t || this.options.draggable, this.el, !1);
|
|
3307
3383
|
},
|
|
3308
3384
|
option: function(e, t) {
|
|
3309
3385
|
var n = this.options;
|
|
3310
3386
|
if (t === void 0) return n[e];
|
|
3311
|
-
var r =
|
|
3312
|
-
r === void 0 ? n[e] = t : n[e] = r, e === "group" &&
|
|
3387
|
+
var r = Ga.modifyOption(this, e, t);
|
|
3388
|
+
r === void 0 ? n[e] = t : n[e] = r, e === "group" && ko(n);
|
|
3313
3389
|
},
|
|
3314
3390
|
destroy: function() {
|
|
3315
|
-
|
|
3391
|
+
U("destroy", this);
|
|
3316
3392
|
var e = this.el;
|
|
3317
|
-
e[
|
|
3393
|
+
e[H] = null, R(e, "mousedown", this._onTapStart), R(e, "touchstart", this._onTapStart), R(e, "pointerdown", this._onTapStart), this.nativeDraggable && (R(e, "dragover", this), R(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
|
|
3318
3394
|
e.removeAttribute("draggable");
|
|
3319
|
-
}), this._onDrop(), this._disableDelayedDragEvents(),
|
|
3395
|
+
}), this._onDrop(), this._disableDelayedDragEvents(), io.splice(io.indexOf(this.el), 1), this.el = e = null;
|
|
3320
3396
|
},
|
|
3321
3397
|
_hideClone: function() {
|
|
3322
|
-
if (!
|
|
3323
|
-
if (
|
|
3324
|
-
|
|
3398
|
+
if (!Xa) {
|
|
3399
|
+
if (U("hideClone", this), Q.eventCanceled) return;
|
|
3400
|
+
B(Y, "display", "none"), this.options.removeCloneOnHide && Y.parentNode && Y.parentNode.removeChild(Y), Xa = !0;
|
|
3325
3401
|
}
|
|
3326
3402
|
},
|
|
3327
3403
|
_showClone: function(e) {
|
|
@@ -3329,99 +3405,99 @@ Q.prototype = {
|
|
|
3329
3405
|
this._hideClone();
|
|
3330
3406
|
return;
|
|
3331
3407
|
}
|
|
3332
|
-
if (
|
|
3333
|
-
if (
|
|
3334
|
-
|
|
3408
|
+
if (Xa) {
|
|
3409
|
+
if (U("showClone", this), Q.eventCanceled) return;
|
|
3410
|
+
G.parentNode == J && !this.options.group.revertClone ? J.insertBefore(Y, G) : Ja ? J.insertBefore(Y, Ja) : J.appendChild(Y), this.options.group.revertClone && this.animate(G, Y), B(Y, "display", ""), Xa = !1;
|
|
3335
3411
|
}
|
|
3336
3412
|
}
|
|
3337
3413
|
};
|
|
3338
|
-
function
|
|
3414
|
+
function Po(e) {
|
|
3339
3415
|
e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
|
|
3340
3416
|
}
|
|
3341
|
-
function
|
|
3342
|
-
var c, l = e[
|
|
3343
|
-
return window.CustomEvent && !
|
|
3417
|
+
function Fo(e, t, n, r, i, a, o, s) {
|
|
3418
|
+
var c, l = e[H], u = l.options.onMove, d;
|
|
3419
|
+
return window.CustomEvent && !da && !fa ? c = new CustomEvent("move", {
|
|
3344
3420
|
bubbles: !0,
|
|
3345
3421
|
cancelable: !0
|
|
3346
|
-
}) : (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 ||
|
|
3422
|
+
}) : (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 || V(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
|
|
3347
3423
|
}
|
|
3348
|
-
function
|
|
3424
|
+
function Io(e) {
|
|
3349
3425
|
e.draggable = !1;
|
|
3350
3426
|
}
|
|
3351
|
-
function
|
|
3352
|
-
|
|
3427
|
+
function Lo() {
|
|
3428
|
+
yo = !1;
|
|
3353
3429
|
}
|
|
3354
|
-
function
|
|
3355
|
-
var r =
|
|
3430
|
+
function Ro(e, t, n) {
|
|
3431
|
+
var r = V(Ea(n.el, 0, n.options, !0)), i = za(n.el, n.options, q), a = 10;
|
|
3356
3432
|
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;
|
|
3357
3433
|
}
|
|
3358
|
-
function
|
|
3359
|
-
var r =
|
|
3434
|
+
function zo(e, t, n) {
|
|
3435
|
+
var r = V(Da(n.el, n.options.draggable)), i = za(n.el, n.options, q), a = 10;
|
|
3360
3436
|
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;
|
|
3361
3437
|
}
|
|
3362
|
-
function
|
|
3438
|
+
function Bo(e, t, n, r, i, a, o, s) {
|
|
3363
3439
|
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;
|
|
3364
3440
|
if (!o) {
|
|
3365
|
-
if (s &&
|
|
3366
|
-
if (!
|
|
3367
|
-
else if (
|
|
3368
|
-
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return
|
|
3441
|
+
if (s && _o < l * i) {
|
|
3442
|
+
if (!ho && (mo === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (ho = !0), ho) f = !0;
|
|
3443
|
+
else if (mo === 1 ? c < u + _o : c > d - _o) return -mo;
|
|
3444
|
+
} else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return Vo(t);
|
|
3369
3445
|
}
|
|
3370
3446
|
return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
|
|
3371
3447
|
}
|
|
3372
|
-
function
|
|
3373
|
-
return
|
|
3448
|
+
function Vo(e) {
|
|
3449
|
+
return Oa(G) < Oa(e) ? 1 : -1;
|
|
3374
3450
|
}
|
|
3375
|
-
function
|
|
3451
|
+
function Ho(e) {
|
|
3376
3452
|
for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
|
|
3377
3453
|
return r.toString(36);
|
|
3378
3454
|
}
|
|
3379
|
-
function
|
|
3380
|
-
|
|
3455
|
+
function Uo(e) {
|
|
3456
|
+
bo.length = 0;
|
|
3381
3457
|
for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
|
|
3382
3458
|
var r = t[n];
|
|
3383
|
-
r.checked &&
|
|
3459
|
+
r.checked && bo.push(r);
|
|
3384
3460
|
}
|
|
3385
3461
|
}
|
|
3386
|
-
function
|
|
3462
|
+
function Wo(e) {
|
|
3387
3463
|
return setTimeout(e, 0);
|
|
3388
3464
|
}
|
|
3389
|
-
function
|
|
3465
|
+
function Go(e) {
|
|
3390
3466
|
return clearTimeout(e);
|
|
3391
3467
|
}
|
|
3392
|
-
|
|
3393
|
-
(Q.active ||
|
|
3468
|
+
xo && L(document, "touchmove", function(e) {
|
|
3469
|
+
(Q.active || no) && e.cancelable && e.preventDefault();
|
|
3394
3470
|
}), Q.utils = {
|
|
3395
|
-
on:
|
|
3396
|
-
off:
|
|
3397
|
-
css:
|
|
3398
|
-
find:
|
|
3471
|
+
on: L,
|
|
3472
|
+
off: R,
|
|
3473
|
+
css: B,
|
|
3474
|
+
find: Ca,
|
|
3399
3475
|
is: function(e, t) {
|
|
3400
|
-
return !!
|
|
3476
|
+
return !!ba(e, t, e, !1);
|
|
3401
3477
|
},
|
|
3402
|
-
extend:
|
|
3403
|
-
throttle:
|
|
3404
|
-
closest:
|
|
3405
|
-
toggleClass:
|
|
3406
|
-
clone:
|
|
3407
|
-
index:
|
|
3408
|
-
nextTick:
|
|
3409
|
-
cancelNextTick:
|
|
3410
|
-
detectDirection:
|
|
3411
|
-
getChild:
|
|
3478
|
+
extend: Ma,
|
|
3479
|
+
throttle: Fa,
|
|
3480
|
+
closest: ba,
|
|
3481
|
+
toggleClass: z,
|
|
3482
|
+
clone: Ra,
|
|
3483
|
+
index: Oa,
|
|
3484
|
+
nextTick: Wo,
|
|
3485
|
+
cancelNextTick: Go,
|
|
3486
|
+
detectDirection: Eo,
|
|
3487
|
+
getChild: Ea
|
|
3412
3488
|
}, Q.get = function(e) {
|
|
3413
|
-
return e[
|
|
3489
|
+
return e[H];
|
|
3414
3490
|
}, Q.mount = function() {
|
|
3415
3491
|
var e = [...arguments];
|
|
3416
3492
|
e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
|
|
3417
3493
|
if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
|
|
3418
|
-
e.utils && (Q.utils =
|
|
3494
|
+
e.utils && (Q.utils = ra(ra({}, Q.utils), e.utils)), Ga.mount(e);
|
|
3419
3495
|
});
|
|
3420
3496
|
}, Q.create = function(e, t) {
|
|
3421
3497
|
return new Q(e, t);
|
|
3422
|
-
}, Q.version =
|
|
3423
|
-
var $ = [],
|
|
3424
|
-
function
|
|
3498
|
+
}, Q.version = la;
|
|
3499
|
+
var $ = [], Ko, qo, Jo = !1, Yo, Xo, Zo, Qo;
|
|
3500
|
+
function $o() {
|
|
3425
3501
|
function e() {
|
|
3426
3502
|
for (var e in this.defaults = {
|
|
3427
3503
|
scroll: !0,
|
|
@@ -3434,70 +3510,70 @@ function Ho() {
|
|
|
3434
3510
|
return e.prototype = {
|
|
3435
3511
|
dragStarted: function(e) {
|
|
3436
3512
|
var t = e.originalEvent;
|
|
3437
|
-
this.sortable.nativeDraggable ?
|
|
3513
|
+
this.sortable.nativeDraggable ? L(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? L(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? L(document, "touchmove", this._handleFallbackAutoScroll) : L(document, "mousemove", this._handleFallbackAutoScroll);
|
|
3438
3514
|
},
|
|
3439
3515
|
dragOverCompleted: function(e) {
|
|
3440
3516
|
var t = e.originalEvent;
|
|
3441
3517
|
!this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
|
|
3442
3518
|
},
|
|
3443
3519
|
drop: function() {
|
|
3444
|
-
this.sortable.nativeDraggable ?
|
|
3520
|
+
this.sortable.nativeDraggable ? R(document, "dragover", this._handleAutoScroll) : (R(document, "pointermove", this._handleFallbackAutoScroll), R(document, "touchmove", this._handleFallbackAutoScroll), R(document, "mousemove", this._handleFallbackAutoScroll)), ts(), es(), Ia();
|
|
3445
3521
|
},
|
|
3446
3522
|
nulling: function() {
|
|
3447
|
-
|
|
3523
|
+
Zo = qo = Ko = Jo = Qo = Yo = Xo = null, $.length = 0;
|
|
3448
3524
|
},
|
|
3449
3525
|
_handleFallbackAutoScroll: function(e) {
|
|
3450
3526
|
this._handleAutoScroll(e, !0);
|
|
3451
3527
|
},
|
|
3452
3528
|
_handleAutoScroll: function(e, t) {
|
|
3453
3529
|
var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
|
|
3454
|
-
if (
|
|
3455
|
-
|
|
3456
|
-
var o =
|
|
3457
|
-
|
|
3458
|
-
var a =
|
|
3459
|
-
a !== o && (o = a,
|
|
3460
|
-
}, 10),
|
|
3530
|
+
if (Zo = e, t || this.options.forceAutoScrollFallback || fa || da || ma) {
|
|
3531
|
+
ns(e, this.options, a, t);
|
|
3532
|
+
var o = ja(a, !0);
|
|
3533
|
+
Jo && (!Qo || r !== Yo || i !== Xo) && (Qo && ts(), Qo = setInterval(function() {
|
|
3534
|
+
var a = ja(document.elementFromPoint(r, i), !0);
|
|
3535
|
+
a !== o && (o = a, es()), ns(e, n.options, a, t);
|
|
3536
|
+
}, 10), Yo = r, Xo = i);
|
|
3461
3537
|
} else {
|
|
3462
|
-
if (!this.options.bubbleScroll ||
|
|
3463
|
-
|
|
3538
|
+
if (!this.options.bubbleScroll || ja(a, !0) === wa()) {
|
|
3539
|
+
es();
|
|
3464
3540
|
return;
|
|
3465
3541
|
}
|
|
3466
|
-
|
|
3542
|
+
ns(e, this.options, ja(a, !1), !1);
|
|
3467
3543
|
}
|
|
3468
3544
|
}
|
|
3469
|
-
},
|
|
3545
|
+
}, oa(e, {
|
|
3470
3546
|
pluginName: "scroll",
|
|
3471
3547
|
initializeByDefault: !0
|
|
3472
3548
|
});
|
|
3473
3549
|
}
|
|
3474
|
-
function
|
|
3550
|
+
function es() {
|
|
3475
3551
|
$.forEach(function(e) {
|
|
3476
3552
|
clearInterval(e.pid);
|
|
3477
3553
|
}), $ = [];
|
|
3478
3554
|
}
|
|
3479
|
-
function
|
|
3480
|
-
clearInterval(
|
|
3555
|
+
function ts() {
|
|
3556
|
+
clearInterval(Qo);
|
|
3481
3557
|
}
|
|
3482
|
-
var
|
|
3558
|
+
var ns = Fa(function(e, t, n, r) {
|
|
3483
3559
|
if (t.scroll) {
|
|
3484
|
-
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c =
|
|
3485
|
-
|
|
3486
|
-
var d = 0, f =
|
|
3560
|
+
var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = wa(), l = !1, u;
|
|
3561
|
+
qo !== n && (qo = n, es(), Ko = t.scroll, u = t.scrollFn, Ko === !0 && (Ko = ja(n, !0)));
|
|
3562
|
+
var d = 0, f = Ko;
|
|
3487
3563
|
do {
|
|
3488
|
-
var p = f, m =
|
|
3564
|
+
var p = f, m = V(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 = B(p), E = p.scrollLeft, D = p.scrollTop;
|
|
3489
3565
|
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"));
|
|
3490
3566
|
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);
|
|
3491
|
-
if (!$[d]) for (var
|
|
3567
|
+
if (!$[d]) for (var A = 0; A <= d; A++) $[A] || ($[A] = {});
|
|
3492
3568
|
($[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() {
|
|
3493
|
-
r && this.layer === 0 && Q.active._onTouchMove(
|
|
3569
|
+
r && this.layer === 0 && Q.active._onTouchMove(Zo);
|
|
3494
3570
|
var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
|
|
3495
|
-
typeof u == "function" && u.call(Q.dragged.parentNode[
|
|
3571
|
+
typeof u == "function" && u.call(Q.dragged.parentNode[H], n, t, e, Zo, $[this.layer].el) !== "continue" || La($[this.layer].el, n, t);
|
|
3496
3572
|
}.bind({ layer: d }), 24))), d++;
|
|
3497
|
-
} while (t.bubbleScroll && f !== c && (f =
|
|
3498
|
-
|
|
3573
|
+
} while (t.bubbleScroll && f !== c && (f = ja(f, !1)));
|
|
3574
|
+
Jo = l;
|
|
3499
3575
|
}
|
|
3500
|
-
}, 30),
|
|
3576
|
+
}, 30), rs = function(e) {
|
|
3501
3577
|
var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
|
|
3502
3578
|
if (t) {
|
|
3503
3579
|
var c = n || i;
|
|
@@ -3509,8 +3585,8 @@ var Go = Ta(function(e, t, n, r) {
|
|
|
3509
3585
|
}));
|
|
3510
3586
|
}
|
|
3511
3587
|
};
|
|
3512
|
-
function
|
|
3513
|
-
|
|
3588
|
+
function is() {}
|
|
3589
|
+
is.prototype = {
|
|
3514
3590
|
startIndex: null,
|
|
3515
3591
|
dragStart: function(e) {
|
|
3516
3592
|
var t = e.oldDraggableIndex;
|
|
@@ -3519,72 +3595,72 @@ qo.prototype = {
|
|
|
3519
3595
|
onSpill: function(e) {
|
|
3520
3596
|
var t = e.dragEl, n = e.putSortable;
|
|
3521
3597
|
this.sortable.captureAnimationState(), n && n.captureAnimationState();
|
|
3522
|
-
var r =
|
|
3598
|
+
var r = Ea(this.sortable.el, this.startIndex, this.options);
|
|
3523
3599
|
r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
|
|
3524
3600
|
},
|
|
3525
|
-
drop:
|
|
3526
|
-
},
|
|
3527
|
-
function
|
|
3528
|
-
|
|
3601
|
+
drop: rs
|
|
3602
|
+
}, oa(is, { pluginName: "revertOnSpill" });
|
|
3603
|
+
function as() {}
|
|
3604
|
+
as.prototype = {
|
|
3529
3605
|
onSpill: function(e) {
|
|
3530
3606
|
var t = e.dragEl, n = e.putSortable || this.sortable;
|
|
3531
3607
|
n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
|
|
3532
3608
|
},
|
|
3533
|
-
drop:
|
|
3534
|
-
},
|
|
3535
|
-
function
|
|
3609
|
+
drop: rs
|
|
3610
|
+
}, oa(as, { pluginName: "removeOnSpill" }), Q.mount(new $o()), Q.mount(as, is);
|
|
3611
|
+
function os(e) {
|
|
3536
3612
|
return e == null ? e : JSON.parse(JSON.stringify(e));
|
|
3537
3613
|
}
|
|
3538
|
-
function
|
|
3539
|
-
|
|
3614
|
+
function ss(e) {
|
|
3615
|
+
ne() && r(e);
|
|
3540
3616
|
}
|
|
3541
|
-
function
|
|
3542
|
-
|
|
3617
|
+
function cs(e) {
|
|
3618
|
+
ne() ? a(e) : re(e);
|
|
3543
3619
|
}
|
|
3544
|
-
var
|
|
3545
|
-
function
|
|
3546
|
-
|
|
3620
|
+
var ls = null, us = null;
|
|
3621
|
+
function ds(e = null, t = null) {
|
|
3622
|
+
ls = e, us = t;
|
|
3547
3623
|
}
|
|
3548
|
-
function
|
|
3624
|
+
function fs() {
|
|
3549
3625
|
return {
|
|
3550
|
-
data:
|
|
3551
|
-
clonedData:
|
|
3626
|
+
data: ls,
|
|
3627
|
+
clonedData: us
|
|
3552
3628
|
};
|
|
3553
3629
|
}
|
|
3554
|
-
var
|
|
3555
|
-
function
|
|
3556
|
-
let t =
|
|
3630
|
+
var ps = Symbol("cloneElement");
|
|
3631
|
+
function ms(...e) {
|
|
3632
|
+
let t = ne()?.proxy, n = null, r = e[0], [, i, a] = e;
|
|
3557
3633
|
Array.isArray(k(i)) || (a = i, i = null);
|
|
3558
|
-
let o = null, { immediate: s = !0, clone: l =
|
|
3634
|
+
let o = null, { immediate: s = !0, clone: l = os, forceFallback: u, fallbackOnBody: d, customUpdate: f } = k(a) ?? {};
|
|
3559
3635
|
function p(e) {
|
|
3560
3636
|
let { from: t, oldIndex: r, item: a } = e, o = Array.from(t.childNodes);
|
|
3561
3637
|
n = u && !d ? o.slice(0, -1) : o;
|
|
3562
3638
|
let s = k(k(i)?.[r]), c = l(s);
|
|
3563
|
-
|
|
3639
|
+
ds(s, c), a[ps] = c;
|
|
3564
3640
|
}
|
|
3565
3641
|
function m(e) {
|
|
3566
|
-
let t = e.item[
|
|
3567
|
-
if (!
|
|
3568
|
-
if (
|
|
3642
|
+
let t = e.item[ps];
|
|
3643
|
+
if (!Gi(t)) {
|
|
3644
|
+
if (Ji(e.item), g(i)) {
|
|
3569
3645
|
let n = [...k(i)];
|
|
3570
|
-
i.value =
|
|
3646
|
+
i.value = Wi(n, e.newDraggableIndex, t);
|
|
3571
3647
|
return;
|
|
3572
3648
|
}
|
|
3573
|
-
|
|
3649
|
+
Wi(k(i), e.newDraggableIndex, t);
|
|
3574
3650
|
}
|
|
3575
3651
|
}
|
|
3576
3652
|
function h(e) {
|
|
3577
3653
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, pullMode: o, clone: s } = e;
|
|
3578
|
-
if (
|
|
3579
|
-
|
|
3654
|
+
if (qi(t, n, r), o === "clone") {
|
|
3655
|
+
Ji(s);
|
|
3580
3656
|
return;
|
|
3581
3657
|
}
|
|
3582
3658
|
if (g(i)) {
|
|
3583
3659
|
let e = [...k(i)];
|
|
3584
|
-
i.value =
|
|
3660
|
+
i.value = Ui(e, a);
|
|
3585
3661
|
return;
|
|
3586
3662
|
}
|
|
3587
|
-
|
|
3663
|
+
Ui(k(i), a);
|
|
3588
3664
|
}
|
|
3589
3665
|
function _(e) {
|
|
3590
3666
|
if (f) {
|
|
@@ -3592,12 +3668,12 @@ function rs(...e) {
|
|
|
3592
3668
|
return;
|
|
3593
3669
|
}
|
|
3594
3670
|
let { from: t, item: n, oldIndex: r, oldDraggableIndex: a, newDraggableIndex: o } = e;
|
|
3595
|
-
if (
|
|
3671
|
+
if (Ji(n), qi(t, n, r), g(i)) {
|
|
3596
3672
|
let e = [...k(i)];
|
|
3597
|
-
i.value =
|
|
3673
|
+
i.value = Bi(e, a, o);
|
|
3598
3674
|
return;
|
|
3599
3675
|
}
|
|
3600
|
-
|
|
3676
|
+
Bi(k(i), a, o);
|
|
3601
3677
|
}
|
|
3602
3678
|
function v(e) {
|
|
3603
3679
|
let { newIndex: t, oldIndex: r, from: i, to: a } = e, o = null, s = t === r && i === a;
|
|
@@ -3615,8 +3691,8 @@ function rs(...e) {
|
|
|
3615
3691
|
} finally {
|
|
3616
3692
|
n = null;
|
|
3617
3693
|
}
|
|
3618
|
-
|
|
3619
|
-
if (
|
|
3694
|
+
re(() => {
|
|
3695
|
+
if (ds(), o) throw o;
|
|
3620
3696
|
});
|
|
3621
3697
|
}
|
|
3622
3698
|
let y = {
|
|
@@ -3628,19 +3704,19 @@ function rs(...e) {
|
|
|
3628
3704
|
};
|
|
3629
3705
|
function b(e) {
|
|
3630
3706
|
let n = k(r);
|
|
3631
|
-
return e ||=
|
|
3707
|
+
return e ||= Ki(n) ? Yi(n, t?.$el) : n, e && !Qi(e) && (e = e.$el), e || zi("Root element not found"), e;
|
|
3632
3708
|
}
|
|
3633
3709
|
function x() {
|
|
3634
|
-
let e = k(a) ?? {}, { immediate: t, clone: n } = e, r =
|
|
3635
|
-
return
|
|
3636
|
-
|
|
3637
|
-
}),
|
|
3710
|
+
let e = k(a) ?? {}, { immediate: t, clone: n } = e, r = Ii(e, ["immediate", "clone"]);
|
|
3711
|
+
return $i(r, (e, t) => {
|
|
3712
|
+
ea(e) && (r[e] = (e, ...n) => (ta(e, fs()), t(e, ...n)));
|
|
3713
|
+
}), Zi(i === null ? {} : y, r);
|
|
3638
3714
|
}
|
|
3639
3715
|
let S = (e) => {
|
|
3640
3716
|
e = b(e), o && C.destroy(), o = new Q(e, x());
|
|
3641
3717
|
};
|
|
3642
3718
|
c(() => a, () => {
|
|
3643
|
-
o &&
|
|
3719
|
+
o && $i(x(), (e, t) => {
|
|
3644
3720
|
o?.option(e, t);
|
|
3645
3721
|
});
|
|
3646
3722
|
}, { deep: !0 });
|
|
@@ -3653,15 +3729,15 @@ function rs(...e) {
|
|
|
3653
3729
|
toArray: () => o?.toArray(),
|
|
3654
3730
|
closest: (...e) => o?.closest(...e)
|
|
3655
3731
|
};
|
|
3656
|
-
return
|
|
3732
|
+
return cs(() => {
|
|
3657
3733
|
s && S();
|
|
3658
|
-
}),
|
|
3734
|
+
}), ss(C.destroy), Fi({
|
|
3659
3735
|
start: S,
|
|
3660
3736
|
pause: () => C?.option("disabled", !0),
|
|
3661
3737
|
resume: () => C?.option("disabled", !1)
|
|
3662
3738
|
}, C);
|
|
3663
3739
|
}
|
|
3664
|
-
var
|
|
3740
|
+
var hs = [
|
|
3665
3741
|
"update",
|
|
3666
3742
|
"start",
|
|
3667
3743
|
"add",
|
|
@@ -3674,7 +3750,7 @@ var is = [
|
|
|
3674
3750
|
"clone",
|
|
3675
3751
|
"move",
|
|
3676
3752
|
"change"
|
|
3677
|
-
],
|
|
3753
|
+
], gs = y({
|
|
3678
3754
|
name: "VueDraggable",
|
|
3679
3755
|
model: {
|
|
3680
3756
|
prop: "modelValue",
|
|
@@ -3724,37 +3800,37 @@ var is = [
|
|
|
3724
3800
|
"tag",
|
|
3725
3801
|
"target",
|
|
3726
3802
|
"customUpdate",
|
|
3727
|
-
...
|
|
3803
|
+
...hs.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
|
|
3728
3804
|
],
|
|
3729
|
-
emits: ["update:modelValue", ...
|
|
3805
|
+
emits: ["update:modelValue", ...hs],
|
|
3730
3806
|
setup(t, { slots: n, emit: r, expose: i, attrs: a }) {
|
|
3731
|
-
let o =
|
|
3807
|
+
let o = hs.reduce((e, t) => {
|
|
3732
3808
|
let n = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
|
|
3733
3809
|
return e[n] = (...e) => r(t, ...e), e;
|
|
3734
|
-
}, {}), s =
|
|
3735
|
-
let n = e(t), { modelValue: r } = n, i =
|
|
3810
|
+
}, {}), s = M(() => {
|
|
3811
|
+
let n = e(t), { modelValue: r } = n, i = Ii(n, ["modelValue"]), s = Object.entries(i).reduce((e, [t, n]) => {
|
|
3736
3812
|
let r = k(n);
|
|
3737
3813
|
return r !== void 0 && (e[t] = r), e;
|
|
3738
3814
|
}, {});
|
|
3739
|
-
return
|
|
3740
|
-
}), c =
|
|
3815
|
+
return Fi(Fi({}, o), Hi(Fi(Fi({}, a), s)));
|
|
3816
|
+
}), c = M({
|
|
3741
3817
|
get: () => t.modelValue,
|
|
3742
3818
|
set: (e) => r("update:modelValue", e)
|
|
3743
|
-
}), l = _(), u =
|
|
3744
|
-
return i(u), () =>
|
|
3819
|
+
}), l = _(), u = A(ms(t.target || l, c, s));
|
|
3820
|
+
return i(u), () => ie(t.tag || "div", { ref: l }, (n?.default)?.call(n, u));
|
|
3745
3821
|
}
|
|
3746
|
-
}),
|
|
3822
|
+
}), _s = {
|
|
3747
3823
|
mounted: "mounted",
|
|
3748
3824
|
unmounted: "unmounted"
|
|
3749
3825
|
};
|
|
3750
|
-
|
|
3826
|
+
_s.mounted, _s.unmounted;
|
|
3751
3827
|
//#endregion
|
|
3752
3828
|
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3753
|
-
var
|
|
3829
|
+
var vs = { class: "tpl:w-full" }, ys = {
|
|
3754
3830
|
key: 0,
|
|
3755
3831
|
"data-testid": "section-drop-hint",
|
|
3756
3832
|
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)]"
|
|
3757
|
-
},
|
|
3833
|
+
}, bs = /* @__PURE__ */ y({
|
|
3758
3834
|
__name: "SectionBlock",
|
|
3759
3835
|
props: {
|
|
3760
3836
|
block: {},
|
|
@@ -3762,13 +3838,13 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3762
3838
|
},
|
|
3763
3839
|
setup(e) {
|
|
3764
3840
|
let n = {
|
|
3765
|
-
title:
|
|
3766
|
-
paragraph:
|
|
3767
|
-
image:
|
|
3768
|
-
button:
|
|
3769
|
-
divider:
|
|
3770
|
-
custom:
|
|
3771
|
-
}, r = e, { t: a } =
|
|
3841
|
+
title: Oi,
|
|
3842
|
+
paragraph: ui,
|
|
3843
|
+
image: Zr,
|
|
3844
|
+
button: Rn,
|
|
3845
|
+
divider: jr,
|
|
3846
|
+
custom: kr
|
|
3847
|
+
}, r = e, { t: a } = Ft(), s = nt(bt, "SectionBlock"), c = P(_t, null), l = P(Dt, null), u = M(() => {
|
|
3772
3848
|
switch (r.block.columns) {
|
|
3773
3849
|
case "2": return ["50%", "50%"];
|
|
3774
3850
|
case "3": return [
|
|
@@ -3780,11 +3856,11 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3780
3856
|
case "2-1": return ["66.67%", "33.33%"];
|
|
3781
3857
|
default: return ["100%"];
|
|
3782
3858
|
}
|
|
3783
|
-
}), h =
|
|
3859
|
+
}), h = M(() => {
|
|
3784
3860
|
let e = u.value.length, t = [...r.block.children];
|
|
3785
3861
|
for (; t.length < e;) t.push([]);
|
|
3786
3862
|
return t.slice(0, e);
|
|
3787
|
-
}), g =
|
|
3863
|
+
}), g = M(() => r.viewport === "mobile" && r.block.stackOnMobile !== !1);
|
|
3788
3864
|
function _(e) {
|
|
3789
3865
|
return h.value[e] || [];
|
|
3790
3866
|
}
|
|
@@ -3794,7 +3870,7 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3794
3870
|
i[e] = n, s.updateBlock(r.block.id, { children: i });
|
|
3795
3871
|
}
|
|
3796
3872
|
function y(e) {
|
|
3797
|
-
return
|
|
3873
|
+
return di(e, l, n);
|
|
3798
3874
|
}
|
|
3799
3875
|
function S(e, t) {
|
|
3800
3876
|
e.type === "custom" && s.updateBlock(e.id, {
|
|
@@ -3802,16 +3878,16 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3802
3878
|
dataSourceFetched: t.dataSourceFetched
|
|
3803
3879
|
});
|
|
3804
3880
|
}
|
|
3805
|
-
return (n, r) => (f(), x("div",
|
|
3881
|
+
return (n, r) => (f(), x("div", vs, [b("div", { class: o(["tpl:flex tpl:gap-0", { "tpl:flex-col": g.value }]) }, [(f(!0), x(j, null, t(h.value, (n, r) => (f(), x("div", {
|
|
3806
3882
|
key: r,
|
|
3807
3883
|
class: o(["tpl:relative tpl:min-h-[60px] tpl:rounded", _(r).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
3808
3884
|
style: i({ width: g.value ? "100%" : u.value[r] })
|
|
3809
|
-
}, [w(k(
|
|
3885
|
+
}, [w(k(gs), {
|
|
3810
3886
|
"model-value": _(r),
|
|
3811
3887
|
group: {
|
|
3812
3888
|
name: "blocks",
|
|
3813
3889
|
pull: !0,
|
|
3814
|
-
put: (e, t, n) => k(
|
|
3890
|
+
put: (e, t, n) => k(ki)(n)
|
|
3815
3891
|
},
|
|
3816
3892
|
animation: 150,
|
|
3817
3893
|
"ghost-class": "tpl-ghost",
|
|
@@ -3824,7 +3900,7 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3824
3900
|
class: "tpl:min-h-[60px]",
|
|
3825
3901
|
"onUpdate:modelValue": (e) => v(r, e)
|
|
3826
3902
|
}, {
|
|
3827
|
-
default: m(() => [(f(!0), x(
|
|
3903
|
+
default: m(() => [(f(!0), x(j, null, t(_(r), (t) => ae((f(), x("div", { key: t.id }, [w(Ei, {
|
|
3828
3904
|
block: t,
|
|
3829
3905
|
"is-selected": k(s).state.selectedBlockId === t.id,
|
|
3830
3906
|
viewport: e.viewport,
|
|
@@ -3849,19 +3925,19 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3849
3925
|
"viewport",
|
|
3850
3926
|
"preview-mode",
|
|
3851
3927
|
"onSelect"
|
|
3852
|
-
])])), [[
|
|
3928
|
+
])])), [[oe, !k(c)?.isHidden(t.id)]])), 128))]),
|
|
3853
3929
|
_: 2
|
|
3854
3930
|
}, 1032, [
|
|
3855
3931
|
"model-value",
|
|
3856
3932
|
"group",
|
|
3857
3933
|
"onUpdate:modelValue"
|
|
3858
|
-
]), _(r).length === 0 ? (f(), x("div",
|
|
3934
|
+
]), _(r).length === 0 ? (f(), x("div", ys, [b("span", null, p(k(a).section.dropHere), 1)])) : N("", !0)], 6))), 128))], 2)]));
|
|
3859
3935
|
}
|
|
3860
|
-
}),
|
|
3936
|
+
}), xs = Oe, Ss = {
|
|
3861
3937
|
small: 24,
|
|
3862
3938
|
medium: 32,
|
|
3863
3939
|
large: 48
|
|
3864
|
-
},
|
|
3940
|
+
}, Cs = [
|
|
3865
3941
|
"facebook",
|
|
3866
3942
|
"twitter",
|
|
3867
3943
|
"instagram",
|
|
@@ -3879,11 +3955,11 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3879
3955
|
"github",
|
|
3880
3956
|
"dribbble",
|
|
3881
3957
|
"behance"
|
|
3882
|
-
],
|
|
3958
|
+
], ws = [
|
|
3883
3959
|
"width",
|
|
3884
3960
|
"height",
|
|
3885
3961
|
"fill"
|
|
3886
|
-
],
|
|
3962
|
+
], Ts = ["d"], Es = /* @__PURE__ */ y({
|
|
3887
3963
|
__name: "SocialIconSvg",
|
|
3888
3964
|
props: {
|
|
3889
3965
|
platform: {},
|
|
@@ -3891,7 +3967,7 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3891
3967
|
iconSize: {}
|
|
3892
3968
|
},
|
|
3893
3969
|
setup(e) {
|
|
3894
|
-
let t = e, n =
|
|
3970
|
+
let t = e, n = M(() => xs[t.platform]), r = M(() => Ss[t.iconSize]), a = M(() => {
|
|
3895
3971
|
let e = {
|
|
3896
3972
|
display: "inline-flex",
|
|
3897
3973
|
alignItems: "center",
|
|
@@ -3928,40 +4004,40 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3928
4004
|
};
|
|
3929
4005
|
default: return e;
|
|
3930
4006
|
}
|
|
3931
|
-
}), o =
|
|
4007
|
+
}), o = M(() => Math.floor(r.value * .6)), s = M(() => t.iconStyle === "outlined" ? n.value.color : "#ffffff");
|
|
3932
4008
|
return (e, t) => (f(), x("span", { style: i(a.value) }, [(f(), x("svg", {
|
|
3933
4009
|
width: o.value,
|
|
3934
4010
|
height: o.value,
|
|
3935
4011
|
viewBox: "0 0 24 24",
|
|
3936
4012
|
fill: s.value,
|
|
3937
4013
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3938
|
-
}, [b("path", { d: n.value.path }, null, 8,
|
|
4014
|
+
}, [b("path", { d: n.value.path }, null, 8, Ts)], 8, ws))], 4));
|
|
3939
4015
|
}
|
|
3940
|
-
}),
|
|
4016
|
+
}), Ds = { class: "tpl:w-full" }, Os = ["href"], ks = {
|
|
3941
4017
|
key: 1,
|
|
3942
4018
|
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)]"
|
|
3943
|
-
},
|
|
4019
|
+
}, As = /* @__PURE__ */ y({
|
|
3944
4020
|
__name: "SocialIconsBlock",
|
|
3945
4021
|
props: {
|
|
3946
4022
|
block: {},
|
|
3947
4023
|
viewport: {}
|
|
3948
4024
|
},
|
|
3949
4025
|
setup(e) {
|
|
3950
|
-
let n = e, { t: r } =
|
|
4026
|
+
let n = e, { t: r } = Ft(), a = M(() => ({
|
|
3951
4027
|
display: "flex",
|
|
3952
4028
|
flexWrap: "wrap",
|
|
3953
4029
|
gap: `${n.block.spacing}px`,
|
|
3954
4030
|
justifyContent: n.block.align === "left" ? "flex-start" : n.block.align === "right" ? "flex-end" : "center"
|
|
3955
|
-
})), o =
|
|
3956
|
-
return (n, s) => (f(), x("div",
|
|
4031
|
+
})), o = M(() => n.block.icons.length > 0);
|
|
4032
|
+
return (n, s) => (f(), x("div", Ds, [o.value ? (f(), x("div", {
|
|
3957
4033
|
key: 0,
|
|
3958
4034
|
style: i(a.value)
|
|
3959
|
-
}, [(f(!0), x(
|
|
4035
|
+
}, [(f(!0), x(j, null, t(e.block.icons, (t) => (f(), x("a", {
|
|
3960
4036
|
key: t.id,
|
|
3961
4037
|
href: t.url || "#",
|
|
3962
4038
|
class: "tpl:cursor-default",
|
|
3963
|
-
onClick: s[0] ||=
|
|
3964
|
-
}, [w(
|
|
4039
|
+
onClick: s[0] ||= F(() => {}, ["prevent"])
|
|
4040
|
+
}, [w(Es, {
|
|
3965
4041
|
platform: t.platform,
|
|
3966
4042
|
"icon-style": e.block.iconStyle,
|
|
3967
4043
|
"icon-size": e.block.iconSize
|
|
@@ -3969,44 +4045,44 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
3969
4045
|
"platform",
|
|
3970
4046
|
"icon-style",
|
|
3971
4047
|
"icon-size"
|
|
3972
|
-
])], 8,
|
|
4048
|
+
])], 8, Os))), 128))], 4)) : (f(), x("div", ks, [w(k(Yn), { size: 16 }), b("span", null, p(k(r).social.addIcons), 1)]))]));
|
|
3973
4049
|
}
|
|
3974
|
-
}),
|
|
4050
|
+
}), js = { class: "tpl:w-full" }, Ms = {
|
|
3975
4051
|
key: 0,
|
|
3976
4052
|
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3977
4053
|
style: {
|
|
3978
4054
|
"background-color": "var(--tpl-bg-hover)",
|
|
3979
4055
|
color: "var(--tpl-text-dim)"
|
|
3980
4056
|
}
|
|
3981
|
-
},
|
|
4057
|
+
}, Ns = /* @__PURE__ */ y({
|
|
3982
4058
|
__name: "SpacerBlock",
|
|
3983
4059
|
props: {
|
|
3984
4060
|
block: {},
|
|
3985
4061
|
viewport: {}
|
|
3986
4062
|
},
|
|
3987
4063
|
setup(e) {
|
|
3988
|
-
let t = e, n =
|
|
4064
|
+
let t = e, n = nt(bt, "SpacerBlock"), r = M(() => ({
|
|
3989
4065
|
height: `${t.block.height}px`,
|
|
3990
4066
|
minHeight: `${t.block.height}px`,
|
|
3991
4067
|
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3992
4068
|
}));
|
|
3993
|
-
return (t, a) => (f(), x("div",
|
|
4069
|
+
return (t, a) => (f(), x("div", js, [b("div", {
|
|
3994
4070
|
style: i(r.value),
|
|
3995
4071
|
class: o(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !k(n).state.previewMode }])
|
|
3996
|
-
}, [k(n).state.previewMode ?
|
|
4072
|
+
}, [k(n).state.previewMode ? N("", !0) : (f(), x("span", Ms, p(e.block.height) + "px ", 1))], 6)]));
|
|
3997
4073
|
}
|
|
3998
|
-
}),
|
|
4074
|
+
}), Ps = { class: "tpl:w-full" }, Fs = { key: 0 }, Is = [
|
|
3999
4075
|
"aria-label",
|
|
4000
4076
|
"data-placeholder",
|
|
4001
4077
|
"onBlur"
|
|
4002
|
-
],
|
|
4078
|
+
], Ls = [
|
|
4003
4079
|
"aria-label",
|
|
4004
4080
|
"data-placeholder",
|
|
4005
4081
|
"onBlur"
|
|
4006
|
-
],
|
|
4082
|
+
], Rs = {
|
|
4007
4083
|
key: 1,
|
|
4008
4084
|
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)]"
|
|
4009
|
-
},
|
|
4085
|
+
}, zs = /*#__PURE__*/ Vt(/* @__PURE__ */ y({
|
|
4010
4086
|
__name: "TableBlock",
|
|
4011
4087
|
props: {
|
|
4012
4088
|
block: {},
|
|
@@ -4020,7 +4096,7 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
4020
4096
|
updated(e, t) {
|
|
4021
4097
|
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
4022
4098
|
}
|
|
4023
|
-
}, r = e, { t: a } =
|
|
4099
|
+
}, r = e, { t: a } = Ft(), o = nt(bt, "TableBlock"), s = M(() => r.block.rows.length > 0), c = M(() => {
|
|
4024
4100
|
let e = {
|
|
4025
4101
|
width: "100%",
|
|
4026
4102
|
borderCollapse: "collapse",
|
|
@@ -4029,15 +4105,15 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
4029
4105
|
fontFamily: r.block.fontFamily || "inherit"
|
|
4030
4106
|
};
|
|
4031
4107
|
return r.block.color && (e.color = r.block.color), e;
|
|
4032
|
-
}), l =
|
|
4108
|
+
}), l = M(() => ({
|
|
4033
4109
|
border: `${r.block.borderWidth}px solid ${r.block.borderColor}`,
|
|
4034
4110
|
padding: `${r.block.cellPadding}px`,
|
|
4035
4111
|
textAlign: r.block.textAlign
|
|
4036
|
-
})), u =
|
|
4112
|
+
})), u = M(() => ({
|
|
4037
4113
|
...l.value,
|
|
4038
4114
|
fontWeight: "bold",
|
|
4039
4115
|
backgroundColor: r.block.headerBackgroundColor || "transparent"
|
|
4040
|
-
})), d =
|
|
4116
|
+
})), d = M(() => r.block.hasHeaderRow && r.block.rows.length > 0 ? r.block.rows[0] : null), m = M(() => r.block.hasHeaderRow ? r.block.rows.slice(1) : r.block.rows);
|
|
4041
4117
|
function h() {
|
|
4042
4118
|
o.selectBlock(r.block.id);
|
|
4043
4119
|
}
|
|
@@ -4051,31 +4127,31 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
4051
4127
|
} : n);
|
|
4052
4128
|
o.updateBlock(r.block.id, { rows: a });
|
|
4053
4129
|
}
|
|
4054
|
-
return (e, r) => (f(), x("div",
|
|
4130
|
+
return (e, r) => (f(), x("div", Ps, [s.value ? (f(), x("table", {
|
|
4055
4131
|
key: 0,
|
|
4056
4132
|
style: i(c.value),
|
|
4057
4133
|
class: "tpl-table-editable"
|
|
4058
|
-
}, [d.value ? (f(), x("thead",
|
|
4134
|
+
}, [d.value ? (f(), x("thead", Fs, [b("tr", null, [(f(!0), x(j, null, t(d.value.cells, (e) => ae((f(), x("th", {
|
|
4059
4135
|
key: e.id,
|
|
4060
4136
|
style: i(u.value),
|
|
4061
4137
|
"aria-label": k(a).table.cellPlaceholder,
|
|
4062
4138
|
contenteditable: "true",
|
|
4063
4139
|
"data-placeholder": k(a).table.cellPlaceholder,
|
|
4064
4140
|
onBlur: (t) => g(d.value.id, e.id, t),
|
|
4065
|
-
onKeydown: r[0] ||=
|
|
4066
|
-
onClick:
|
|
4067
|
-
}, null, 44,
|
|
4141
|
+
onKeydown: r[0] ||= se(F((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
4142
|
+
onClick: F(h, ["stop"])
|
|
4143
|
+
}, null, 44, Is)), [[n, e.content]])), 128))])])) : N("", !0), b("tbody", null, [(f(!0), x(j, null, t(m.value, (e) => (f(), x("tr", { key: e.id }, [(f(!0), x(j, null, t(e.cells, (t) => ae((f(), x("td", {
|
|
4068
4144
|
key: t.id,
|
|
4069
4145
|
style: i(l.value),
|
|
4070
4146
|
"aria-label": k(a).table.cellPlaceholder,
|
|
4071
4147
|
contenteditable: "true",
|
|
4072
4148
|
"data-placeholder": k(a).table.cellPlaceholder,
|
|
4073
4149
|
onBlur: (n) => g(e.id, t.id, n),
|
|
4074
|
-
onKeydown: r[1] ||=
|
|
4075
|
-
onClick:
|
|
4076
|
-
}, null, 44,
|
|
4150
|
+
onKeydown: r[1] ||= se(F((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
4151
|
+
onClick: F(h, ["stop"])
|
|
4152
|
+
}, null, 44, Ls)), [[n, t.content]])), 128))]))), 128))])], 4)) : (f(), x("div", Rs, [w(k(Xn), { size: 16 }), b("span", null, p(k(a).table.empty), 1)]))]));
|
|
4077
4153
|
}
|
|
4078
|
-
}), [["__scopeId", "data-v-963ac422"]]),
|
|
4154
|
+
}), [["__scopeId", "data-v-963ac422"]]), Bs = /* @__PURE__ */ y({
|
|
4079
4155
|
__name: "VideoPlayButton",
|
|
4080
4156
|
props: { hoverEffect: {
|
|
4081
4157
|
type: Boolean,
|
|
@@ -4093,7 +4169,7 @@ var ss = { class: "tpl:w-full" }, cs = {
|
|
|
4093
4169
|
});
|
|
4094
4170
|
//#endregion
|
|
4095
4171
|
//#region src/utils/videoThumbnail.ts
|
|
4096
|
-
function
|
|
4172
|
+
function Vs(e) {
|
|
4097
4173
|
if (!e) return {
|
|
4098
4174
|
platform: "unknown",
|
|
4099
4175
|
videoId: null,
|
|
@@ -4125,25 +4201,25 @@ function As(e) {
|
|
|
4125
4201
|
thumbnailUrl: null
|
|
4126
4202
|
};
|
|
4127
4203
|
}
|
|
4128
|
-
function
|
|
4129
|
-
return t ||
|
|
4204
|
+
function Hs(e, t) {
|
|
4205
|
+
return t || Vs(e).thumbnailUrl;
|
|
4130
4206
|
}
|
|
4131
4207
|
//#endregion
|
|
4132
4208
|
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
4133
|
-
var
|
|
4209
|
+
var Us = ["src", "alt"], Ws = {
|
|
4134
4210
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
4135
4211
|
style: { opacity: "0.7" }
|
|
4136
|
-
},
|
|
4212
|
+
}, Gs = ["href"], Ks = ["src", "alt"], qs = ["src", "alt"], Js = {
|
|
4137
4213
|
key: 3,
|
|
4138
4214
|
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)]"
|
|
4139
|
-
},
|
|
4215
|
+
}, Ys = /* @__PURE__ */ y({
|
|
4140
4216
|
__name: "VideoBlock",
|
|
4141
4217
|
props: {
|
|
4142
4218
|
block: {},
|
|
4143
4219
|
viewport: {}
|
|
4144
4220
|
},
|
|
4145
4221
|
setup(e) {
|
|
4146
|
-
let t = e, { t: n } =
|
|
4222
|
+
let t = e, { t: n } = Ft(), { syntax: r } = Ht(), a = M(() => Ce(t.block.url, r) || Ce(t.block.thumbnailUrl, r)), o = cn(() => a.value ? void 0 : t.block.thumbnailUrl || void 0), s = cn(() => a.value ? t.block.placeholderUrl : void 0), c = M(() => a.value ? null : t.block.thumbnailUrl ? o.value ?? null : Hs(t.block.url)), l = M(() => ({ textAlign: t.block.align })), u = M(() => {
|
|
4147
4223
|
let e = t.block.align;
|
|
4148
4224
|
return {
|
|
4149
4225
|
maxWidth: "100%",
|
|
@@ -4152,7 +4228,7 @@ var Ms = ["src", "alt"], Ns = {
|
|
|
4152
4228
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
4153
4229
|
marginRight: e === "center" ? "auto" : void 0
|
|
4154
4230
|
};
|
|
4155
|
-
}), d =
|
|
4231
|
+
}), d = M(() => Ce(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
4156
4232
|
return (t, r) => (f(), x("div", {
|
|
4157
4233
|
class: "tpl:w-full",
|
|
4158
4234
|
style: i(l.value)
|
|
@@ -4164,28 +4240,28 @@ var Ms = ["src", "alt"], Ns = {
|
|
|
4164
4240
|
class: "tpl:w-full tpl:border-0",
|
|
4165
4241
|
src: k(s),
|
|
4166
4242
|
alt: e.block.alt
|
|
4167
|
-
}, null, 8,
|
|
4243
|
+
}, null, 8, Us), w(Bs)], 4)) : a.value ? (f(), x("div", {
|
|
4168
4244
|
key: 1,
|
|
4169
4245
|
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)]",
|
|
4170
4246
|
style: i([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
4171
|
-
}, [w(k(
|
|
4247
|
+
}, [w(k(Zn), {
|
|
4172
4248
|
size: 36,
|
|
4173
4249
|
"stroke-width": 1.5,
|
|
4174
4250
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
4175
4251
|
style: { opacity: "0.5" }
|
|
4176
|
-
}), b("span",
|
|
4252
|
+
}), b("span", Ws, [w(Fn, { text: d.value }, null, 8, ["text"])])], 4)) : c.value ? (f(), x(j, { key: 2 }, [e.block.url ? (f(), x("a", {
|
|
4177
4253
|
key: 0,
|
|
4178
4254
|
href: e.block.url,
|
|
4179
4255
|
target: "_blank",
|
|
4180
4256
|
rel: "noopener noreferrer",
|
|
4181
4257
|
class: "tpl:group tpl:relative tpl:inline-block",
|
|
4182
4258
|
style: i(u.value),
|
|
4183
|
-
onClick: r[0] ||=
|
|
4259
|
+
onClick: r[0] ||= F(() => {}, ["prevent"])
|
|
4184
4260
|
}, [b("img", {
|
|
4185
4261
|
class: "tpl:w-full tpl:border-0",
|
|
4186
4262
|
src: c.value,
|
|
4187
4263
|
alt: e.block.alt
|
|
4188
|
-
}, null, 8,
|
|
4264
|
+
}, null, 8, Ks), w(Bs, { "hover-effect": "" })], 12, Gs)) : (f(), x("div", {
|
|
4189
4265
|
key: 1,
|
|
4190
4266
|
class: "tpl:relative tpl:inline-block",
|
|
4191
4267
|
style: i(u.value)
|
|
@@ -4193,48 +4269,48 @@ var Ms = ["src", "alt"], Ns = {
|
|
|
4193
4269
|
class: "tpl:w-full tpl:border-0",
|
|
4194
4270
|
src: c.value,
|
|
4195
4271
|
alt: e.block.alt
|
|
4196
|
-
}, null, 8,
|
|
4272
|
+
}, null, 8, qs), w(Bs)], 4))], 64)) : (f(), x("div", Js, [w(k(Zn), {
|
|
4197
4273
|
size: 40,
|
|
4198
4274
|
"stroke-width": 1.5,
|
|
4199
4275
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
4200
4276
|
}), b("span", null, p(k(n).video.addVideo), 1)]))], 4));
|
|
4201
4277
|
}
|
|
4202
|
-
}),
|
|
4203
|
-
section:
|
|
4204
|
-
title:
|
|
4205
|
-
paragraph:
|
|
4206
|
-
image:
|
|
4207
|
-
button:
|
|
4208
|
-
divider:
|
|
4209
|
-
video:
|
|
4210
|
-
social:
|
|
4211
|
-
menu:
|
|
4212
|
-
table:
|
|
4213
|
-
spacer:
|
|
4214
|
-
html:
|
|
4215
|
-
countdown: C(() => import("./CountdownBlock-
|
|
4278
|
+
}), Xs = {
|
|
4279
|
+
section: bs,
|
|
4280
|
+
title: Oi,
|
|
4281
|
+
paragraph: ui,
|
|
4282
|
+
image: Zr,
|
|
4283
|
+
button: Rn,
|
|
4284
|
+
divider: jr,
|
|
4285
|
+
video: Ys,
|
|
4286
|
+
social: As,
|
|
4287
|
+
menu: ti,
|
|
4288
|
+
table: zs,
|
|
4289
|
+
spacer: Ns,
|
|
4290
|
+
html: Lr,
|
|
4291
|
+
countdown: C(() => import("./CountdownBlock-Bn5w7C-p.js").then((e) => e.n))
|
|
4216
4292
|
};
|
|
4217
|
-
function
|
|
4218
|
-
let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: o } =
|
|
4293
|
+
function Zs(e) {
|
|
4294
|
+
let { editor: t, config: n, translations: r, fontsManager: i } = e, { t: a, format: o } = Ft(r);
|
|
4219
4295
|
t.setUiTheme(n.uiTheme ?? "auto");
|
|
4220
|
-
let { resolvedTheme: l } =
|
|
4296
|
+
let { resolvedTheme: l } = hn(M(() => t.state.uiTheme)), d = _(n.theme ?? {}), { themeStyles: f } = _n({
|
|
4221
4297
|
themeOverrides: d,
|
|
4222
4298
|
resolvedTheme: l,
|
|
4223
4299
|
extraStyles: e.themeExtraStyles
|
|
4224
|
-
}), p =
|
|
4300
|
+
}), p = Yt({
|
|
4225
4301
|
content: t.content,
|
|
4226
4302
|
setContent: (e, n) => t.setContent(e, n),
|
|
4227
4303
|
...e.historyOptions
|
|
4228
4304
|
});
|
|
4229
|
-
|
|
4230
|
-
let m =
|
|
4305
|
+
tn(t, p);
|
|
4306
|
+
let m = Zt({
|
|
4231
4307
|
addBlock: t.addBlock,
|
|
4232
4308
|
removeBlock: t.removeBlock,
|
|
4233
4309
|
updateBlock: t.updateBlock,
|
|
4234
4310
|
selectBlock: t.selectBlock,
|
|
4235
4311
|
findBlockLocation: t.findBlockLocation,
|
|
4236
4312
|
blockDefaults: n.blockDefaults
|
|
4237
|
-
}), h =
|
|
4313
|
+
}), h = $t(t), g = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? Qt({
|
|
4238
4314
|
content: t.content,
|
|
4239
4315
|
isDirty: () => t.state.isDirty,
|
|
4240
4316
|
...e.autoSaveOptions
|
|
@@ -4242,24 +4318,34 @@ function Bs(e) {
|
|
|
4242
4318
|
g && (v = c(p.isNavigating, (e) => {
|
|
4243
4319
|
e ? g.pause() : g.resume();
|
|
4244
4320
|
}));
|
|
4245
|
-
let y =
|
|
4321
|
+
let y = mn(t, {
|
|
4246
4322
|
t: a,
|
|
4247
4323
|
format: o
|
|
4248
|
-
}), b =
|
|
4249
|
-
if (
|
|
4250
|
-
|
|
4251
|
-
|
|
4324
|
+
}), b = Ze(n.colors);
|
|
4325
|
+
if (b.allowCustomIgnored && bn.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), b.invalidPresets.length > 0 && bn.warn(`config.colors.presets skipped invalid entries: ${b.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), b.allowCustom === !1) {
|
|
4326
|
+
let e = kn(b.presets, n.blockDefaults, n.templateDefaults);
|
|
4327
|
+
e.length > 0 && bn.warn(`config.colors locks custom colours, but these block/template default colours fall outside colors.presets: ${e.join(", ")}. New blocks start on a colour the palette can't reselect — set blockDefaults / templateDefaults from the same palette.`);
|
|
4328
|
+
}
|
|
4329
|
+
let x = xn();
|
|
4330
|
+
En(x, Xs);
|
|
4331
|
+
let S = /* @__PURE__ */ new Set();
|
|
4332
|
+
function C(e) {
|
|
4333
|
+
for (let t of e) {
|
|
4334
|
+
x.registerCustom(t, kr);
|
|
4335
|
+
for (let e of jn(t, b)) S.has(e.id) || (S.add(e.id), bn.warn(e.message));
|
|
4336
|
+
}
|
|
4252
4337
|
}
|
|
4253
|
-
|
|
4254
|
-
|
|
4338
|
+
n.customBlocks?.length && C(n.customBlocks);
|
|
4339
|
+
let w = on();
|
|
4340
|
+
if (s() && u(w.dispose), e.containerEl) {
|
|
4255
4341
|
let t = e.containerEl;
|
|
4256
|
-
|
|
4342
|
+
et(document, "pointerdown", (e) => {
|
|
4257
4343
|
let n = t.value;
|
|
4258
|
-
n && (e.composedPath?.() ?? []).includes(n) &&
|
|
4344
|
+
n && (e.composedPath?.() ?? []).includes(n) && w.claim();
|
|
4259
4345
|
}, { capture: !0 });
|
|
4260
4346
|
}
|
|
4261
|
-
function
|
|
4262
|
-
|
|
4347
|
+
function T(r) {
|
|
4348
|
+
w.isActive() && Nn(r, {
|
|
4263
4349
|
history: p,
|
|
4264
4350
|
selectBlock: (e) => t.selectBlock(e),
|
|
4265
4351
|
getSelectedBlockId: () => t.state.selectedBlockId,
|
|
@@ -4268,21 +4354,21 @@ function Bs(e) {
|
|
|
4268
4354
|
onBeforeUndo: e.keyboardOptions?.onBeforeUndo
|
|
4269
4355
|
});
|
|
4270
4356
|
}
|
|
4271
|
-
|
|
4272
|
-
let
|
|
4273
|
-
E(
|
|
4274
|
-
let
|
|
4275
|
-
E(
|
|
4276
|
-
let
|
|
4357
|
+
et(document, "keydown", T);
|
|
4358
|
+
let D = _(null);
|
|
4359
|
+
E(yt, e.editorRoot ?? document), E(lt, D), E(dt, r), E(bt, t), E(At, p), E(xt, m), E(_t, h), E(mt, i), E(st, f), E(Pt, l), E(ht, n.blockDefaults), E(Dt, x), E(vt, n.customBlocks ?? []), E(ct, n.paletteBlocks), E(Nt, Dn(n.htmlBlockPreview)), E(wt, b), E(Ot, Sn(t.content, x));
|
|
4360
|
+
let O = pe(n.mergeTags?.syntax);
|
|
4361
|
+
E(pt, n.mergeTags?.tags ?? []), E(ut, O), E(St, n.mergeTags?.onRequest ?? null), E(at, n.mergeTags?.autocomplete !== !1), E(it, ln()), E(rt, n.logicTags?.tags ?? []), E(ft, n.logicTags?.pairs ?? []), E(Ct, n.logicTags?.onRequest ?? null), E(jt, un()), E(tt, n.onRequestMedia ?? null), E(gt, n.resolveImageUrl ? sn(n.resolveImageUrl) : null), E(Tt, n.displayConditions?.conditions ?? []), E(Et, n.displayConditions?.allowCustom ?? !1), E(kt, e.capabilities ?? {}), E(Mt, y);
|
|
4362
|
+
let k = dn(n.lint) ? null : fn({
|
|
4277
4363
|
content: t.content,
|
|
4278
4364
|
options: n.lint ?? {},
|
|
4279
4365
|
updateBlock: t.updateBlock,
|
|
4280
4366
|
updateSettings: t.updateSettings,
|
|
4281
4367
|
removeBlock: t.removeBlock
|
|
4282
4368
|
});
|
|
4283
|
-
E(
|
|
4284
|
-
function
|
|
4285
|
-
v?.(),
|
|
4369
|
+
E(ot, k);
|
|
4370
|
+
function A() {
|
|
4371
|
+
v?.(), k?.destroy(), g?.destroy(), p.destroy();
|
|
4286
4372
|
}
|
|
4287
4373
|
return {
|
|
4288
4374
|
t: a,
|
|
@@ -4294,13 +4380,13 @@ function Bs(e) {
|
|
|
4294
4380
|
resolvedTheme: l,
|
|
4295
4381
|
themeStyles: f,
|
|
4296
4382
|
themeOverrides: d,
|
|
4297
|
-
registry:
|
|
4383
|
+
registry: x,
|
|
4298
4384
|
keyboardReorder: y,
|
|
4299
|
-
templateLint:
|
|
4300
|
-
popoverRoot:
|
|
4301
|
-
registerCustomBlocks:
|
|
4302
|
-
destroy:
|
|
4385
|
+
templateLint: k,
|
|
4386
|
+
popoverRoot: D,
|
|
4387
|
+
registerCustomBlocks: C,
|
|
4388
|
+
destroy: A
|
|
4303
4389
|
};
|
|
4304
4390
|
}
|
|
4305
4391
|
//#endregion
|
|
4306
|
-
export {
|
|
4392
|
+
export { Yn as A, en as B, dr as C, rr as D, ir as E, Vn as F, Rn as I, An as L, Kn as M, Un as N, er as O, Hn as P, bn as R, gr as S, ar as T, Gt as V, Lr as _, As as a, br as b, gs as c, fi as d, di as f, zr as g, Zr as h, Ns as i, qn as j, Xn as k, Oi as l, ti as m, Ys as n, Cs as o, ui as p, zs as r, bs as s, Zs as t, Ei as u, jr as v, ur as w, vr as x, kr as y, pn as z };
|