@templatical/editor 0.33.0 → 0.34.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-J7WsHRDS.js → AiChatSidebar-CkHJ28sf.js} +3 -3
- package/dist/{AiFeatureMenu-C9mxL_7U.js → AiFeatureMenu-DWdKguDN.js} +3 -3
- package/dist/{BlockIssueBadge-BI6v_eol.js → BlockIssueBadge-DcyHTAqw.js} +2 -2
- package/dist/{BlockPreviewCanvas-mZIr9mY2.js → BlockPreviewCanvas-B621ANn9.js} +4 -4
- package/dist/{CloudHeaderExtras-CLtTtK12.js → CloudHeaderExtras-BJ3Cebhv.js} +2 -2
- package/dist/{CloudPanels-BbLAX1jH.js → CloudPanels-BGz9ygo6.js} +6 -6
- package/dist/{CollaboratorBar-OBbLOhLK.js → CollaboratorBar-KphmSQeZ.js} +2 -2
- package/dist/{ColorPicker-Cs7iK01u.js → ColorPicker-C6EOwtHC.js} +5 -5
- package/dist/{CommentsPanel-G_uNzi1a.js → CommentsPanel-DmWh8f08.js} +1 -1
- package/dist/{CommentsSidebar-DlFlpfkU.js → CommentsSidebar-CL_tffzT.js} +4 -4
- package/dist/{CountdownBlock-Bdt8qZi1.js → CountdownBlock-D1fsNsyS.js} +1 -1
- package/dist/{CountdownToolbar-BWLYViOm.js → CountdownToolbar-B8J4i5Xp.js} +2 -2
- package/dist/{DesignReferenceSidebar-CK_xTLh2.js → DesignReferenceSidebar-BDhEeaAh.js} +4 -4
- package/dist/{IssuesPanel-DIbJ_jaa.js → IssuesPanel-CiOjeRFI.js} +4 -4
- package/dist/MergeTagInput-RytOlh1A.js +448 -0
- package/dist/{MergeTagModeToggle-DeI65T5k.js → MergeTagModeToggle-Bi-FydXj.js} +2 -2
- package/dist/{ParagraphEditor-Dr-u72hu.js → ParagraphEditor-C87tkmtE.js} +12 -12
- package/dist/{RestoreVersionDialog-6sBYYt9f.js → RestoreVersionDialog-Db5rZRMA.js} +2 -2
- package/dist/RichTextEditorContent-BmTcV2-a.js +152 -0
- package/dist/{SaveBlockDialog-DABN4-Jf.js → SaveBlockDialog-CDCzx6Bo.js} +16 -16
- package/dist/{SavedBlocksBrowserModal-BoylzTEq.js → SavedBlocksBrowserModal-DQR6kJB1.js} +101 -101
- package/dist/{SavedBlocksPanels-2np4Yu1H.js → SavedBlocksPanels-DFzV0CRD.js} +1 -1
- package/dist/{SavedBlocksPickBar-BM7aTSK2.js → SavedBlocksPickBar-XyXmnSnO.js} +2 -2
- package/dist/{TemplateScoringPanel-CzWoSM1V.js → TemplateScoringPanel-CpyEKMzC.js} +4 -4
- package/dist/{TestEmailModal-Cb0n7Dhj.js → TestEmailModal-DIfJy9eE.js} +8 -8
- package/dist/{TestEmailPanel-52HjvuU7.js → TestEmailPanel-C8Wx5yPS.js} +1 -1
- package/dist/{TitleEditor-_taBpBfB.js → TitleEditor-iNFOisr4.js} +11 -11
- package/dist/{TplModal-CEYnwBBk.js → TplModal-CowM3o_F.js} +5 -5
- package/dist/{VersionHistoryMenu-CsGlLSO8.js → VersionHistoryMenu-CV90OhXs.js} +2 -2
- package/dist/{VersionHistoryPanels-DPmYk00L.js → VersionHistoryPanels-BE3pplJG.js} +1 -1
- package/dist/{VersionPreviewBanner-VGJbEoXj.js → VersionPreviewBanner-BwUWBtlH.js} +1 -1
- package/dist/{blockTypeIcons-IhdBwbxp.js → blockTypeIcons-DQsKtHik.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-6S5LPyRW.js → AiChatSidebar-BEnIWn6s.js} +4 -4
- package/dist/cdn/chunks/AiChatSidebar-BEnIWn6s.js.map +1 -0
- package/dist/cdn/chunks/{AiFeatureMenu-BHCtjIfV.js → AiFeatureMenu-DMl23akc.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-BHCtjIfV.js.map → AiFeatureMenu-DMl23akc.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-2-os120N.js → BlockIssueBadge-CloK4k3M.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-2-os120N.js.map → BlockIssueBadge-CloK4k3M.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-CYNs-Yn-.js → BlockPreviewCanvas-DSiJFJa0.js} +5 -5
- package/dist/cdn/chunks/{BlockPreviewCanvas-CYNs-Yn-.js.map → BlockPreviewCanvas-DSiJFJa0.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-DrbFk6Fy.js → CloudHeaderExtras-b4KpVeUN.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-DrbFk6Fy.js.map → CloudHeaderExtras-b4KpVeUN.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CpzYrAPQ.js → CloudPanels-DzwOq9lp.js} +7 -7
- package/dist/cdn/chunks/CloudPanels-DzwOq9lp.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-VMTCYn_z.js → CollaboratorBar-WXKvpoGK.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-VMTCYn_z.js.map → CollaboratorBar-WXKvpoGK.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-B0l_UF8G.js → ColorPicker-BubTDiS1.js} +6 -6
- package/dist/cdn/chunks/{ColorPicker-B0l_UF8G.js.map → ColorPicker-BubTDiS1.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CXMMdLrO.js → CommentsPanel-DAA2VqX4.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-CXMMdLrO.js.map → CommentsPanel-DAA2VqX4.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-CGkhAJUW.js → CommentsSidebar-Ci0M2ePp.js} +5 -5
- package/dist/cdn/chunks/CommentsSidebar-Ci0M2ePp.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-CPe1ulzk.js → CountdownBlock-rK055jpy.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CPe1ulzk.js.map → CountdownBlock-rK055jpy.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-D5xyNd5V.js → CountdownToolbar-CzZq26Vp.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-D5xyNd5V.js.map → CountdownToolbar-CzZq26Vp.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-D1NH1WRv.js → DesignReferenceSidebar-C_ehdX5C.js} +5 -5
- package/dist/cdn/chunks/DesignReferenceSidebar-C_ehdX5C.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-07SBSZVN.js → IssuesPanel-BXAN2_al.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-07SBSZVN.js.map → IssuesPanel-BXAN2_al.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagInput-1vcI9uQH.js +419 -0
- package/dist/cdn/chunks/MergeTagInput-1vcI9uQH.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagModeToggle-Bg8eO5nc.js → MergeTagModeToggle-B_mUYJo4.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-Bg8eO5nc.js.map → MergeTagModeToggle-B_mUYJo4.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-x2LTi6DN.js → ParagraphEditor-DCDHMcmx.js} +10 -10
- package/dist/cdn/chunks/ParagraphEditor-DCDHMcmx.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog--SjTV0_4.js → RestoreVersionDialog-BkSSwf-Q.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog--SjTV0_4.js.map → RestoreVersionDialog-BkSSwf-Q.js.map} +1 -1
- package/dist/cdn/chunks/RichTextEditorContent-S4KogjIj.js +122 -0
- package/dist/cdn/chunks/RichTextEditorContent-S4KogjIj.js.map +1 -0
- package/dist/cdn/chunks/{SaveBlockDialog-CS1lqdsQ.js → SaveBlockDialog-BH774Nt0.js} +14 -14
- package/dist/cdn/chunks/{SaveBlockDialog-CS1lqdsQ.js.map → SaveBlockDialog-BH774Nt0.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D6nDZ4rq.js → SavedBlocksBrowserModal-CSUqw_dD.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D6nDZ4rq.js.map → SavedBlocksBrowserModal-CSUqw_dD.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DdkwvYRR.js → SavedBlocksPanels-B6ApbCjG.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-DdkwvYRR.js.map → SavedBlocksPanels-B6ApbCjG.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BLQr_6WM.js → SavedBlocksPickBar-C9MXSRcR.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-BLQr_6WM.js.map → SavedBlocksPickBar-C9MXSRcR.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-CDC-JC6C.js → TemplateScoringPanel-QVOxc9TZ.js} +50 -50
- package/dist/cdn/chunks/TemplateScoringPanel-QVOxc9TZ.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-B2LcU11Y.js → TestEmailModal-_CZvaO58.js} +9 -9
- package/dist/cdn/chunks/{TestEmailModal-B2LcU11Y.js.map → TestEmailModal-_CZvaO58.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-ByqDSx8B.js → TestEmailPanel-DXLxvyrD.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-ByqDSx8B.js.map → TestEmailPanel-DXLxvyrD.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DCoulgN8.js → TitleEditor-BuCOahW3.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-BuCOahW3.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CxQDl-tN.js → TplModal-CqY8R3hn.js} +6 -6
- package/dist/cdn/chunks/TplModal-CqY8R3hn.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryMenu-BOy8aMB6.js → VersionHistoryMenu-DDjIBvad.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryMenu-BOy8aMB6.js.map → VersionHistoryMenu-DDjIBvad.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BPLhzW9c.js → VersionHistoryPanels-BuTw04T5.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BPLhzW9c.js.map → VersionHistoryPanels-BuTw04T5.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-CYC9qP2i.js → VersionPreviewBanner-fGAv20qI.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-CYC9qP2i.js.map → VersionPreviewBanner-fGAv20qI.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-CbSqoOba.js → createCloudRuntime-JFE-sxbT.js} +2 -2
- package/dist/cdn/chunks/{createCloudRuntime-CbSqoOba.js.map → createCloudRuntime-JFE-sxbT.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CeP0iOPC.js → extensions-7z04EIGg.js} +3 -3
- package/dist/cdn/chunks/{extensions-CeP0iOPC.js.map → extensions-7z04EIGg.js.map} +1 -1
- package/dist/cdn/chunks/{keys-O8clwJ41.js → keys-DQp8x7Nx.js} +4 -4
- package/dist/cdn/chunks/{keys-O8clwJ41.js.map → keys-DQp8x7Nx.js.map} +1 -1
- package/dist/cdn/chunks/{src-C1lP5sIe.js → src-B7p3PQqm.js} +2 -2
- package/dist/cdn/chunks/{src-C1lP5sIe.js.map → src-B7p3PQqm.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-ZBEJvkf4.js → useCloudI18n-MxgHWrV6.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-ZBEJvkf4.js.map → useCloudI18n-MxgHWrV6.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-CZxGbZmY.js → useEditorCore-ehUSEsbw.js} +503 -500
- package/dist/cdn/chunks/useEditorCore-ehUSEsbw.js.map +1 -0
- package/dist/cdn/chunks/{useEditorRoot-DVV-EsNI.js → useEditorRoot-CteADR3y.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-DVV-EsNI.js.map → useEditorRoot-CteADR3y.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-DCbvHv6W.js → useI18n-Ct1VIFcf.js} +2 -2
- package/dist/cdn/chunks/{useI18n-DCbvHv6W.js.map → useI18n-Ct1VIFcf.js.map} +1 -1
- package/dist/cdn/chunks/useMergeTag-TLhF2fGK.js +46 -0
- package/dist/cdn/chunks/useMergeTag-TLhF2fGK.js.map +1 -0
- package/dist/cdn/chunks/{usePopoverPosition-Ozg5iU3y.js → usePopoverPosition-BxVWE5_0.js} +2 -2
- package/dist/cdn/chunks/{usePopoverPosition-Ozg5iU3y.js.map → usePopoverPosition-BxVWE5_0.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CrUCYsIc.js → useScrollToBlock-Cz3fpgTK.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-CrUCYsIc.js.map → useScrollToBlock-Cz3fpgTK.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1672 -2075
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{createCloudRuntime-j6a9Z-vL.js → createCloudRuntime-DbTFm1ES.js} +1 -1
- package/dist/{extensions-5xeZR9U9.js → extensions-Mf8iHey9.js} +2 -2
- package/dist/{keys-BJJ4hJ4z.js → keys-C3P1yxnr.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1835 -2239
- package/dist/{useCloudI18n-DaKcDMDz.js → useCloudI18n-BKoiYsWZ.js} +1 -1
- package/dist/{useEditorCore-BWrxHVKW.js → useEditorCore-DdkQuTHl.js} +1068 -1065
- package/dist/{useEditorRoot-E-oxHaEI.js → useEditorRoot-DkRGTQRs.js} +1 -1
- package/dist/{useI18n-DUVIAju4.js → useI18n-CL6RfPzK.js} +1 -1
- package/dist/useMergeTag-gSuYus-M.js +44 -0
- package/dist/{usePopoverPosition-APlWgXoQ.js → usePopoverPosition-CWxaIWd3.js} +1 -1
- package/dist/{useScrollToBlock--AzCOzlg.js → useScrollToBlock-CdI8fGqt.js} +1 -1
- package/package.json +7 -7
- package/dist/RichTextEditorContent-DKLVe6Io.js +0 -153
- package/dist/cdn/chunks/AiChatSidebar-6S5LPyRW.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-CpzYrAPQ.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-CGkhAJUW.js.map +0 -1
- package/dist/cdn/chunks/DesignReferenceSidebar-D1NH1WRv.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-x2LTi6DN.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-CzdMJ1c9.js +0 -123
- package/dist/cdn/chunks/RichTextEditorContent-CzdMJ1c9.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-CDC-JC6C.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-DCoulgN8.js.map +0 -1
- package/dist/cdn/chunks/TplModal-CxQDl-tN.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-CZxGbZmY.js.map +0 -1
- package/dist/cdn/chunks/useMergeTag-CbuagYNK.js +0 -46
- package/dist/cdn/chunks/useMergeTag-CbuagYNK.js.map +0 -1
- package/dist/scan-line-E7w4yQyv.js +0 -31
- package/dist/useMergeTag-CuZZeiSE.js +0 -44
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { A as e, B as t, E as n, F as r, H as i, I as a, K as o, N as s, P as c, Q as l, R as u, S as d, U as f, W as p, X as m, Y as h, Z as g, at as _, b as v, c as y, ct as b, et as x, f as S, g as C, h as w, it as T, j as E, k as D, l as O, lt as k, m as A, ot as j, p as M, q as N, rt as P, s as F, t as I, u as L, ut as R, w as
|
|
2
|
-
import { A as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { a as
|
|
5
|
-
import { A as
|
|
1
|
+
import { A as e, B as t, E as n, F as r, H as i, I as a, K as o, N as s, P as c, Q as l, R as u, S as d, U as f, W as p, X as m, Y as h, Z as g, at as _, b as v, c as y, ct as b, et as x, f as S, g as C, h as w, it as T, j as E, k as D, l as O, lt as k, m as A, ot as j, p as M, q as N, rt as P, s as F, t as I, u as L, ut as R, w as ee, x as z, y as B } from "./draggable-kbOhCgnk.js";
|
|
2
|
+
import { A as te, B as ne, C as re, D as ie, E as ae, F as oe, I as se, L as V, M as ce, N as le, O as ue, P as de, R as fe, S as pe, T as me, U as he, V as ge, _ as _e, a as ve, b as ye, d as be, f as xe, g as Se, h as Ce, i as H, j as we, k as Te, l as Ee, m as De, n as Oe, nt as ke, o as Ae, p as je, r as Me, rt as Ne, s as Pe, t as U, tt as Fe, u as Ie, w as Le, z as Re } from "./src-CLoCCDfs.js";
|
|
3
|
+
import { _ as ze, h as Be, v as Ve, y as He } from "./dist-BW6Y49zE.js";
|
|
4
|
+
import { a as W, c as Ue, i as We, r as Ge } from "./dist-CAFTQ6Y2.js";
|
|
5
|
+
import { A as Ke, C as qe, D as Je, E as G, F as Ye, G as Xe, H as Ze, I as Qe, J as $e, K as et, L as tt, M as nt, N as rt, O as it, P as at, R as ot, S as st, T as ct, U as lt, V as ut, W as dt, _ as ft, a as pt, b as mt, c as ht, d as gt, f as _t, g as vt, h as K, j as yt, k as bt, m as xt, n as St, o as Ct, p as wt, q, r as Tt, s as Et, u as Dt, v as Ot, w as kt, x as At, y as jt } from "./keys-DQp8x7Nx.js";
|
|
6
6
|
import "./timeouts-DHPZQ0G3.js";
|
|
7
|
-
import { t as
|
|
8
|
-
import { t as
|
|
9
|
-
import { a as
|
|
10
|
-
import { A as
|
|
11
|
-
import { t as
|
|
12
|
-
import { t as
|
|
13
|
-
import { t as
|
|
14
|
-
import "./useCloudI18n-
|
|
15
|
-
import { t as
|
|
16
|
-
import { t as
|
|
7
|
+
import { t as J } from "./useI18n-Ct1VIFcf.js";
|
|
8
|
+
import { t as Y } from "./logger-ByvdoAwq.js";
|
|
9
|
+
import { a as Mt, i as Nt, o as Pt, r as X, t as Ft } from "./usePopoverPosition-BxVWE5_0.js";
|
|
10
|
+
import { A as It, Bt as Lt, Et as Rt, H as zt, Ot as Bt, Tt as Vt, X as Ht, d as Ut, ft as Wt, ht as Gt, it as Kt, o as qt, s as Jt, tt as Yt, u as Xt, v as Zt, vt as Qt, zt as $t } from "./icons-SP5Itd-A.js";
|
|
11
|
+
import { t as en } from "./LoadingTrack-Cm3TDKb3.js";
|
|
12
|
+
import { t as tn } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
13
|
+
import { t as nn } from "./useEditorRoot-CteADR3y.js";
|
|
14
|
+
import "./useCloudI18n-MxgHWrV6.js";
|
|
15
|
+
import { t as Z } from "./useMergeTag-TLhF2fGK.js";
|
|
16
|
+
import { t as rn } from "./useAliveFlag-CT9gjvO_.js";
|
|
17
17
|
//#region ../core/src/error-reporting.ts
|
|
18
|
-
function
|
|
18
|
+
function an(e) {
|
|
19
19
|
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function on(e, t) {
|
|
22
22
|
try {
|
|
23
23
|
t();
|
|
24
24
|
} catch (t) {
|
|
25
|
-
e?.(
|
|
25
|
+
e?.(an(t));
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region ../core/src/editor.ts
|
|
30
|
-
function
|
|
30
|
+
function sn(e) {
|
|
31
31
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function cn(e) {
|
|
34
34
|
let t = m({
|
|
35
35
|
template: null,
|
|
36
|
-
content: e.content ??
|
|
36
|
+
content: e.content ?? fe(e.defaultFontFamily, e.templateDefaults),
|
|
37
37
|
selectedBlockId: null,
|
|
38
38
|
viewport: "desktop",
|
|
39
39
|
darkMode: !1,
|
|
@@ -128,7 +128,7 @@ function on(e) {
|
|
|
128
128
|
if (l(n)) return;
|
|
129
129
|
let r = o(t.content.blocks, n);
|
|
130
130
|
if (r && r.type === "section") {
|
|
131
|
-
if (i < 0 || i >=
|
|
131
|
+
if (i < 0 || i >= sn(r.columns)) return;
|
|
132
132
|
r.children[i] = r.children[i] || [];
|
|
133
133
|
let t = r.children[i];
|
|
134
134
|
a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
|
|
@@ -161,7 +161,7 @@ function on(e) {
|
|
|
161
161
|
let d;
|
|
162
162
|
if (i) {
|
|
163
163
|
let e = o(t.content.blocks, i);
|
|
164
|
-
if (!e || e.type !== "section" || a < 0 || a >=
|
|
164
|
+
if (!e || e.type !== "section" || a < 0 || a >= sn(e.columns)) return;
|
|
165
165
|
e.children[a] = e.children[a] || [], d = e.children[a];
|
|
166
166
|
} else d = t.content.blocks;
|
|
167
167
|
let [f] = s.blocks.splice(u, 1);
|
|
@@ -171,10 +171,10 @@ function on(e) {
|
|
|
171
171
|
r();
|
|
172
172
|
}
|
|
173
173
|
function E(e, t) {
|
|
174
|
-
throw new
|
|
174
|
+
throw new U(`[Templatical] Templates: ${e} ${t}`);
|
|
175
175
|
}
|
|
176
176
|
function D(t) {
|
|
177
|
-
|
|
177
|
+
on(e.onError, t);
|
|
178
178
|
}
|
|
179
179
|
function O(t) {
|
|
180
180
|
let { templates: n } = e;
|
|
@@ -274,11 +274,11 @@ function on(e) {
|
|
|
274
274
|
}
|
|
275
275
|
//#endregion
|
|
276
276
|
//#region ../core/src/history.ts
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i =
|
|
277
|
+
var ln = 50, un = 300, dn = 1500;
|
|
278
|
+
function fn(e) {
|
|
279
|
+
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i = ln } = e, a = l([]), o = l([]), s = l(!1), c = null, u = null, d = p(() => a.value.length > 0), f = p(() => o.value.length > 0);
|
|
280
280
|
function m() {
|
|
281
|
-
return
|
|
281
|
+
return ye(t.value);
|
|
282
282
|
}
|
|
283
283
|
function h(e) {
|
|
284
284
|
a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
|
|
@@ -294,21 +294,21 @@ function un(e) {
|
|
|
294
294
|
if (u && u.blockId === e) {
|
|
295
295
|
clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
|
|
296
296
|
u = null;
|
|
297
|
-
},
|
|
297
|
+
}, un);
|
|
298
298
|
return;
|
|
299
299
|
}
|
|
300
300
|
g(), h(m()), o.value = [], u = {
|
|
301
301
|
blockId: e,
|
|
302
302
|
timeoutId: setTimeout(() => {
|
|
303
303
|
u = null;
|
|
304
|
-
},
|
|
304
|
+
}, un)
|
|
305
305
|
};
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
function y() {
|
|
309
309
|
s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
310
310
|
s.value = !1, c = null;
|
|
311
|
-
},
|
|
311
|
+
}, dn);
|
|
312
312
|
}
|
|
313
313
|
function b() {
|
|
314
314
|
if (a.value.length === 0) return;
|
|
@@ -342,33 +342,33 @@ function un(e) {
|
|
|
342
342
|
}
|
|
343
343
|
//#endregion
|
|
344
344
|
//#region ../core/src/block-actions.ts
|
|
345
|
-
function
|
|
345
|
+
function pn(e) {
|
|
346
346
|
e.type === "table" ? e.rows = e.rows.map((e) => ({
|
|
347
347
|
...e,
|
|
348
|
-
id:
|
|
348
|
+
id: V(),
|
|
349
349
|
cells: e.cells.map((e) => ({
|
|
350
350
|
...e,
|
|
351
|
-
id:
|
|
351
|
+
id: V()
|
|
352
352
|
}))
|
|
353
353
|
})) : e.type === "social" ? e.icons = e.icons.map((e) => ({
|
|
354
354
|
...e,
|
|
355
|
-
id:
|
|
355
|
+
id: V()
|
|
356
356
|
})) : e.type === "menu" && (e.items = e.items.map((e) => ({
|
|
357
357
|
...e,
|
|
358
|
-
id:
|
|
358
|
+
id: V()
|
|
359
359
|
})));
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function mn(e) {
|
|
362
362
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
363
363
|
function o(n, r, a) {
|
|
364
|
-
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s =
|
|
364
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = pe(n, o);
|
|
365
365
|
return t(s, r, a), i(s.id), s;
|
|
366
366
|
}
|
|
367
367
|
function s(e, n, r) {
|
|
368
368
|
let o = JSON.parse(JSON.stringify(e));
|
|
369
|
-
if (o.id =
|
|
369
|
+
if (o.id = V(), pn(o), o.type === "section" && (o.children = o.children.map((e) => e.map((e) => {
|
|
370
370
|
let t = JSON.parse(JSON.stringify(e));
|
|
371
|
-
return t.id =
|
|
371
|
+
return t.id = V(), pn(t), t;
|
|
372
372
|
}))), n !== void 0 || r !== void 0) t(o, n, r);
|
|
373
373
|
else {
|
|
374
374
|
let i = a?.(e.id) ?? null;
|
|
@@ -391,9 +391,9 @@ function fn(e) {
|
|
|
391
391
|
}
|
|
392
392
|
//#endregion
|
|
393
393
|
//#region ../core/src/auto-save.ts
|
|
394
|
-
var
|
|
395
|
-
function
|
|
396
|
-
let { content: t, isDirty: n, onChange: r, debounce: i =
|
|
394
|
+
var hn = 2e3;
|
|
395
|
+
function gn(e) {
|
|
396
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = hn, enabled: a = !0 } = e, o = null, s = !1;
|
|
397
397
|
function c() {
|
|
398
398
|
return typeof a == "function" ? a() : a;
|
|
399
399
|
}
|
|
@@ -430,7 +430,7 @@ function mn(e) {
|
|
|
430
430
|
}
|
|
431
431
|
//#endregion
|
|
432
432
|
//#region ../core/src/condition-preview.ts
|
|
433
|
-
function
|
|
433
|
+
function _n(e) {
|
|
434
434
|
let t = m(/* @__PURE__ */ new Set()), n = p(() => t.size > 0);
|
|
435
435
|
function r(e) {
|
|
436
436
|
return t.has(e);
|
|
@@ -450,7 +450,7 @@ function hn(e) {
|
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
452
|
//#region ../core/src/data-source-fetch.ts
|
|
453
|
-
function
|
|
453
|
+
function vn(e) {
|
|
454
454
|
let t = l(!1), n = l(!1), r = p(() => !!e.definition.value?.dataSource), i = p(() => r.value && !e.block.value.dataSourceFetched);
|
|
455
455
|
async function a() {
|
|
456
456
|
let r = e.definition.value;
|
|
@@ -482,7 +482,7 @@ function gn(e) {
|
|
|
482
482
|
}
|
|
483
483
|
//#endregion
|
|
484
484
|
//#region ../core/src/history-interceptor.ts
|
|
485
|
-
function
|
|
485
|
+
function yn(e, t) {
|
|
486
486
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
487
487
|
e.addBlock = (r, i, a, o) => {
|
|
488
488
|
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
@@ -498,7 +498,7 @@ function _n(e, t) {
|
|
|
498
498
|
}
|
|
499
499
|
//#endregion
|
|
500
500
|
//#region ../core/src/saved-blocks.ts
|
|
501
|
-
function
|
|
501
|
+
function bn(e) {
|
|
502
502
|
let { provider: t } = e, n = l([]), r = l(!1), i = S(() => {
|
|
503
503
|
let e = /* @__PURE__ */ new Set();
|
|
504
504
|
for (let t of n.value) {
|
|
@@ -514,10 +514,10 @@ function vn(e) {
|
|
|
514
514
|
return s.value && e.canDelete !== !1;
|
|
515
515
|
}
|
|
516
516
|
function d(e, t) {
|
|
517
|
-
throw new
|
|
517
|
+
throw new U(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
518
518
|
}
|
|
519
519
|
function f(t) {
|
|
520
|
-
|
|
520
|
+
on(e.onError, t);
|
|
521
521
|
}
|
|
522
522
|
async function p(i) {
|
|
523
523
|
r.value = !0;
|
|
@@ -586,9 +586,9 @@ function vn(e) {
|
|
|
586
586
|
}
|
|
587
587
|
//#endregion
|
|
588
588
|
//#region ../core/src/saved-blocks-local.ts
|
|
589
|
-
var
|
|
590
|
-
function
|
|
591
|
-
let t = e.key ??
|
|
589
|
+
var xn = "templatical:saved-blocks";
|
|
590
|
+
function Sn(e = {}) {
|
|
591
|
+
let t = e.key ?? xn;
|
|
592
592
|
function n() {
|
|
593
593
|
if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
|
|
594
594
|
return localStorage;
|
|
@@ -613,7 +613,7 @@ function bn(e = {}) {
|
|
|
613
613
|
},
|
|
614
614
|
async create(e) {
|
|
615
615
|
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
616
|
-
id:
|
|
616
|
+
id: V(),
|
|
617
617
|
name: e.name,
|
|
618
618
|
content: e.content,
|
|
619
619
|
...e.category ? { category: e.category } : {},
|
|
@@ -641,18 +641,18 @@ function bn(e = {}) {
|
|
|
641
641
|
}
|
|
642
642
|
//#endregion
|
|
643
643
|
//#region ../core/src/version-history.ts
|
|
644
|
-
function
|
|
644
|
+
function Cn(e) {
|
|
645
645
|
let { provider: t, getTemplateId: n } = e, r = l([]), i = l(!1), a = l(void 0), o = l(!1), s = /* @__PURE__ */ new Map(), c = S(() => typeof t.create == "function"), u = S(() => typeof t.restore == "function");
|
|
646
646
|
function d(e) {
|
|
647
647
|
let t = n();
|
|
648
|
-
if (!t) throw new
|
|
648
|
+
if (!t) throw new U(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
649
649
|
return t;
|
|
650
650
|
}
|
|
651
651
|
function f(e) {
|
|
652
|
-
throw new
|
|
652
|
+
throw new U(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
653
653
|
}
|
|
654
654
|
function p(t) {
|
|
655
|
-
|
|
655
|
+
on(e.onError, t);
|
|
656
656
|
}
|
|
657
657
|
async function m(n) {
|
|
658
658
|
let o = d("list");
|
|
@@ -721,7 +721,7 @@ function xn(e) {
|
|
|
721
721
|
}
|
|
722
722
|
//#endregion
|
|
723
723
|
//#region ../core/src/comments.ts
|
|
724
|
-
function
|
|
724
|
+
function wn(e) {
|
|
725
725
|
let { provider: t, getTemplateId: n, getUser: r } = e, i = l([]), a = l(!1), o = l(!1), s = S(() => typeof t.create == "function"), c = S(() => typeof t.update == "function"), u = S(() => typeof t.delete == "function"), d = S(() => typeof t.setResolved == "function"), f = S(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = S(() => i.value.filter((e) => !e.resolvedAt).length), m = S(() => {
|
|
726
726
|
let e = /* @__PURE__ */ new Map();
|
|
727
727
|
for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
@@ -729,16 +729,16 @@ function Sn(e) {
|
|
|
729
729
|
});
|
|
730
730
|
function h(e) {
|
|
731
731
|
let t = n();
|
|
732
|
-
if (!t) throw new
|
|
732
|
+
if (!t) throw new U(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
733
733
|
return t;
|
|
734
734
|
}
|
|
735
735
|
function g(e) {
|
|
736
736
|
let t = r();
|
|
737
|
-
if (!t) throw new
|
|
737
|
+
if (!t) throw new U(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
738
738
|
return t;
|
|
739
739
|
}
|
|
740
740
|
function _(e) {
|
|
741
|
-
throw new
|
|
741
|
+
throw new U(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
742
742
|
}
|
|
743
743
|
function v(e) {
|
|
744
744
|
for (let t of i.value) {
|
|
@@ -752,11 +752,11 @@ function Sn(e) {
|
|
|
752
752
|
return t !== null && e.author.id === t.id;
|
|
753
753
|
}
|
|
754
754
|
function b(t) {
|
|
755
|
-
let n =
|
|
755
|
+
let n = an(t);
|
|
756
756
|
throw e.onError?.(n), n;
|
|
757
757
|
}
|
|
758
758
|
function x(t) {
|
|
759
|
-
|
|
759
|
+
on(e.onError, t);
|
|
760
760
|
}
|
|
761
761
|
function C(e, t, n) {
|
|
762
762
|
return [
|
|
@@ -896,7 +896,7 @@ function Sn(e) {
|
|
|
896
896
|
applyRemoteDelete: P
|
|
897
897
|
};
|
|
898
898
|
}
|
|
899
|
-
function
|
|
899
|
+
function Tn(e) {
|
|
900
900
|
let { comments: n, provider: r, getTemplateId: i } = e, { subscribe: a } = r;
|
|
901
901
|
if (typeof a != "function") return;
|
|
902
902
|
let o = null;
|
|
@@ -919,18 +919,18 @@ function Cn(e) {
|
|
|
919
919
|
}
|
|
920
920
|
//#endregion
|
|
921
921
|
//#region src/utils/activeEditorTracker.ts
|
|
922
|
-
var
|
|
923
|
-
function
|
|
924
|
-
let e = ++
|
|
925
|
-
return
|
|
922
|
+
var En = /* @__PURE__ */ new Set(), Q = 0, Dn = 0;
|
|
923
|
+
function On() {
|
|
924
|
+
let e = ++Dn;
|
|
925
|
+
return En.add(e), Q === 0 && (Q = e), {
|
|
926
926
|
id: e,
|
|
927
|
-
isActive: () =>
|
|
927
|
+
isActive: () => En.size <= 1 || Q === e,
|
|
928
928
|
claim: () => {
|
|
929
929
|
Q = e;
|
|
930
930
|
},
|
|
931
931
|
dispose: () => {
|
|
932
|
-
if (
|
|
933
|
-
let e = Array.from(
|
|
932
|
+
if (En.delete(e), Q === e) {
|
|
933
|
+
let e = Array.from(En);
|
|
934
934
|
Q = e[e.length - 1] ?? 0;
|
|
935
935
|
}
|
|
936
936
|
}
|
|
@@ -938,8 +938,8 @@ function En() {
|
|
|
938
938
|
}
|
|
939
939
|
//#endregion
|
|
940
940
|
//#region src/composables/usePreviewResolution.ts
|
|
941
|
-
var
|
|
942
|
-
function
|
|
941
|
+
var kn = 500;
|
|
942
|
+
function An(e) {
|
|
943
943
|
let n = typeof e.resolvePreview == "function", r = l(null), i = l(!1), a = l(!1), o = 0, s = null;
|
|
944
944
|
function c() {
|
|
945
945
|
s !== null && (clearTimeout(s), s = null);
|
|
@@ -950,13 +950,13 @@ function On(e) {
|
|
|
950
950
|
let n = ++o;
|
|
951
951
|
i.value = !0;
|
|
952
952
|
let s = {
|
|
953
|
-
content:
|
|
953
|
+
content: ye(e.getContent()),
|
|
954
954
|
...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
|
|
955
955
|
};
|
|
956
956
|
try {
|
|
957
957
|
let e = await t(s);
|
|
958
958
|
if (n !== o) return;
|
|
959
|
-
if (!
|
|
959
|
+
if (!Oe(e)) {
|
|
960
960
|
a.value = !0;
|
|
961
961
|
return;
|
|
962
962
|
}
|
|
@@ -976,7 +976,7 @@ function On(e) {
|
|
|
976
976
|
}
|
|
977
977
|
s = setTimeout(() => {
|
|
978
978
|
s = null, u();
|
|
979
|
-
},
|
|
979
|
+
}, kn);
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
982
|
return t(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
|
|
@@ -998,7 +998,7 @@ function On(e) {
|
|
|
998
998
|
}
|
|
999
999
|
//#endregion
|
|
1000
1000
|
//#region src/composables/useImageUrlResolver.ts
|
|
1001
|
-
function
|
|
1001
|
+
function jn(e) {
|
|
1002
1002
|
let t = m(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
1003
1003
|
function r(e) {
|
|
1004
1004
|
return t.get(e);
|
|
@@ -1031,8 +1031,8 @@ function kn(e) {
|
|
|
1031
1031
|
lookup: a
|
|
1032
1032
|
};
|
|
1033
1033
|
}
|
|
1034
|
-
function
|
|
1035
|
-
let r = n(
|
|
1034
|
+
function Mn(e) {
|
|
1035
|
+
let r = n(mt, null), i = S(e);
|
|
1036
1036
|
if (!r) return i;
|
|
1037
1037
|
let a;
|
|
1038
1038
|
function s() {
|
|
@@ -1061,7 +1061,7 @@ function An(e) {
|
|
|
1061
1061
|
}
|
|
1062
1062
|
//#endregion
|
|
1063
1063
|
//#region src/composables/useMergeTagPicker.ts
|
|
1064
|
-
function
|
|
1064
|
+
function Nn() {
|
|
1065
1065
|
let e = l(!1), t = l([]), n = null;
|
|
1066
1066
|
function r(r) {
|
|
1067
1067
|
if (n) {
|
|
@@ -1091,7 +1091,7 @@ function jn() {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
//#endregion
|
|
1093
1093
|
//#region src/composables/useLogicTagPicker.ts
|
|
1094
|
-
function
|
|
1094
|
+
function Pn() {
|
|
1095
1095
|
let e = l(!1), t = l([]), n = l([]), r = null;
|
|
1096
1096
|
function i(i, a) {
|
|
1097
1097
|
if (r) {
|
|
@@ -1122,17 +1122,17 @@ function Mn() {
|
|
|
1122
1122
|
}
|
|
1123
1123
|
//#endregion
|
|
1124
1124
|
//#region src/composables/useTemplateLint.ts
|
|
1125
|
-
function
|
|
1125
|
+
function Fn(e) {
|
|
1126
1126
|
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1129
|
-
let n = l([]), r = l(!1), i = l(!1), a = x(null), o =
|
|
1128
|
+
function In(e) {
|
|
1129
|
+
let n = l([]), r = l(!1), i = l(!1), a = x(null), o = Fn(e.options), s = null, c = !1;
|
|
1130
1130
|
o || u();
|
|
1131
1131
|
async function u() {
|
|
1132
1132
|
try {
|
|
1133
1133
|
let t = await import("./src-BM3f9I7t.js");
|
|
1134
1134
|
if (c) return;
|
|
1135
|
-
a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s =
|
|
1135
|
+
a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s = He(e.content, d, {
|
|
1136
1136
|
debounce: e.debounce ?? 500,
|
|
1137
1137
|
deep: !0
|
|
1138
1138
|
});
|
|
@@ -1167,17 +1167,17 @@ function Pn(e) {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
//#endregion
|
|
1169
1169
|
//#region src/utils/blockTypeLabels.ts
|
|
1170
|
-
function
|
|
1170
|
+
function Ln(e, t) {
|
|
1171
1171
|
return t.blocks[e] ?? e;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1174
|
-
if (e.type !== "custom") return
|
|
1173
|
+
function Rn(e, t, n = []) {
|
|
1174
|
+
if (e.type !== "custom") return Ln(e.type, t);
|
|
1175
1175
|
let { customType: r } = e;
|
|
1176
1176
|
return n.find((e) => e.type === r)?.name ?? r;
|
|
1177
1177
|
}
|
|
1178
1178
|
//#endregion
|
|
1179
1179
|
//#region src/composables/useKeyboardReorder.ts
|
|
1180
|
-
function
|
|
1180
|
+
function zn(e, t, n = []) {
|
|
1181
1181
|
let r = l(null), i = l(""), a = null;
|
|
1182
1182
|
function o(t) {
|
|
1183
1183
|
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
@@ -1204,7 +1204,7 @@ function Ln(e, t, n = []) {
|
|
|
1204
1204
|
let i = o(r);
|
|
1205
1205
|
if (!i) return "";
|
|
1206
1206
|
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
1207
|
-
return a ?
|
|
1207
|
+
return a ? Rn(a, t.t, n) : "";
|
|
1208
1208
|
}
|
|
1209
1209
|
function c(t, n) {
|
|
1210
1210
|
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
@@ -1273,13 +1273,13 @@ function Ln(e, t, n = []) {
|
|
|
1273
1273
|
}
|
|
1274
1274
|
//#endregion
|
|
1275
1275
|
//#region src/composables/useUiTheme.ts
|
|
1276
|
-
function
|
|
1277
|
-
let t =
|
|
1276
|
+
function Bn(e) {
|
|
1277
|
+
let t = Ue("(prefers-color-scheme: dark)");
|
|
1278
1278
|
return { resolvedTheme: S(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
1279
1279
|
}
|
|
1280
1280
|
//#endregion
|
|
1281
1281
|
//#region src/composables/useThemeStyles.ts
|
|
1282
|
-
var
|
|
1282
|
+
var Vn = {
|
|
1283
1283
|
bg: "--tpl-bg",
|
|
1284
1284
|
bgElevated: "--tpl-bg-elevated",
|
|
1285
1285
|
bgHover: "--tpl-bg-hover",
|
|
@@ -1303,10 +1303,10 @@ var zn = {
|
|
|
1303
1303
|
dangerLight: "--tpl-danger-light",
|
|
1304
1304
|
canvasBg: "--tpl-canvas-bg"
|
|
1305
1305
|
};
|
|
1306
|
-
function
|
|
1306
|
+
function Hn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
1307
1307
|
return { themeStyles: S(() => {
|
|
1308
1308
|
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
1309
|
-
if (a) for (let [e, t] of Object.entries(
|
|
1309
|
+
if (a) for (let [e, t] of Object.entries(Vn)) {
|
|
1310
1310
|
let n = a[e];
|
|
1311
1311
|
n && (r[t] = n);
|
|
1312
1312
|
}
|
|
@@ -1315,7 +1315,7 @@ function Bn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
|
1315
1315
|
}
|
|
1316
1316
|
//#endregion
|
|
1317
1317
|
//#region src/composables/useBlockRegistry.ts
|
|
1318
|
-
function
|
|
1318
|
+
function Un() {
|
|
1319
1319
|
let e = x(/* @__PURE__ */ new Map());
|
|
1320
1320
|
function t(t, n) {
|
|
1321
1321
|
e.value.set(t, n), T(e);
|
|
@@ -1324,7 +1324,7 @@ function Vn() {
|
|
|
1324
1324
|
let r = `custom:${t.type}`;
|
|
1325
1325
|
e.value.set(r, {
|
|
1326
1326
|
component: n,
|
|
1327
|
-
createBlock: () =>
|
|
1327
|
+
createBlock: () => me(t),
|
|
1328
1328
|
definition: t
|
|
1329
1329
|
}), T(e);
|
|
1330
1330
|
}
|
|
@@ -1355,7 +1355,7 @@ function Vn() {
|
|
|
1355
1355
|
strictFilters: !1
|
|
1356
1356
|
}).parseAndRender(t.template, e.fieldValues);
|
|
1357
1357
|
} catch (t) {
|
|
1358
|
-
return
|
|
1358
|
+
return Y.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
1361
|
function c(t) {
|
|
@@ -1373,9 +1373,9 @@ function Vn() {
|
|
|
1373
1373
|
}
|
|
1374
1374
|
//#endregion
|
|
1375
1375
|
//#region src/composables/useCustomBlockStylesheets.ts
|
|
1376
|
-
function
|
|
1376
|
+
function Wn(e, t) {
|
|
1377
1377
|
return S(() => {
|
|
1378
|
-
let n =
|
|
1378
|
+
let n = Gn(e.value.blocks);
|
|
1379
1379
|
if (n.size === 0) return [];
|
|
1380
1380
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
1381
1381
|
for (let e of n) {
|
|
@@ -1387,81 +1387,81 @@ function Hn(e, t) {
|
|
|
1387
1387
|
return i;
|
|
1388
1388
|
});
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Gn(e) {
|
|
1391
1391
|
let t = /* @__PURE__ */ new Set();
|
|
1392
|
-
return
|
|
1392
|
+
return Kn(e, t), t;
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1394
|
+
function Kn(e, t) {
|
|
1395
1395
|
for (let n of e) {
|
|
1396
|
-
if (
|
|
1396
|
+
if (he(n)) {
|
|
1397
1397
|
t.add(n.customType);
|
|
1398
1398
|
continue;
|
|
1399
1399
|
}
|
|
1400
1400
|
if (n.type === "section") {
|
|
1401
1401
|
let e = n.children;
|
|
1402
1402
|
if (!e) continue;
|
|
1403
|
-
for (let n of e)
|
|
1403
|
+
for (let n of e) Kn(n, t);
|
|
1404
1404
|
}
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
1407
1407
|
//#endregion
|
|
1408
1408
|
//#region src/utils/registerBuiltInBlocks.ts
|
|
1409
|
-
var
|
|
1409
|
+
var qn = [
|
|
1410
1410
|
{
|
|
1411
1411
|
type: "section",
|
|
1412
|
-
createBlock:
|
|
1412
|
+
createBlock: we
|
|
1413
1413
|
},
|
|
1414
1414
|
{
|
|
1415
1415
|
type: "title",
|
|
1416
|
-
createBlock:
|
|
1416
|
+
createBlock: oe
|
|
1417
1417
|
},
|
|
1418
1418
|
{
|
|
1419
1419
|
type: "paragraph",
|
|
1420
|
-
createBlock:
|
|
1420
|
+
createBlock: te
|
|
1421
1421
|
},
|
|
1422
1422
|
{
|
|
1423
1423
|
type: "image",
|
|
1424
|
-
createBlock:
|
|
1424
|
+
createBlock: ue
|
|
1425
1425
|
},
|
|
1426
1426
|
{
|
|
1427
1427
|
type: "button",
|
|
1428
|
-
createBlock:
|
|
1428
|
+
createBlock: re
|
|
1429
1429
|
},
|
|
1430
1430
|
{
|
|
1431
1431
|
type: "divider",
|
|
1432
|
-
createBlock:
|
|
1432
|
+
createBlock: ae
|
|
1433
1433
|
},
|
|
1434
1434
|
{
|
|
1435
1435
|
type: "video",
|
|
1436
|
-
createBlock:
|
|
1436
|
+
createBlock: se
|
|
1437
1437
|
},
|
|
1438
1438
|
{
|
|
1439
1439
|
type: "social",
|
|
1440
|
-
createBlock:
|
|
1440
|
+
createBlock: ce
|
|
1441
1441
|
},
|
|
1442
1442
|
{
|
|
1443
1443
|
type: "menu",
|
|
1444
|
-
createBlock:
|
|
1444
|
+
createBlock: Te
|
|
1445
1445
|
},
|
|
1446
1446
|
{
|
|
1447
1447
|
type: "table",
|
|
1448
|
-
createBlock:
|
|
1448
|
+
createBlock: de
|
|
1449
1449
|
},
|
|
1450
1450
|
{
|
|
1451
1451
|
type: "spacer",
|
|
1452
|
-
createBlock:
|
|
1452
|
+
createBlock: le
|
|
1453
1453
|
},
|
|
1454
1454
|
{
|
|
1455
1455
|
type: "html",
|
|
1456
|
-
createBlock:
|
|
1456
|
+
createBlock: ie
|
|
1457
1457
|
},
|
|
1458
1458
|
{
|
|
1459
1459
|
type: "countdown",
|
|
1460
|
-
createBlock:
|
|
1460
|
+
createBlock: Le
|
|
1461
1461
|
}
|
|
1462
1462
|
];
|
|
1463
|
-
function
|
|
1464
|
-
for (let n of
|
|
1463
|
+
function Jn(e, t) {
|
|
1464
|
+
for (let n of qn) {
|
|
1465
1465
|
let r = t[n.type];
|
|
1466
1466
|
r && e.registerBuiltIn(n.type, {
|
|
1467
1467
|
component: r,
|
|
@@ -1471,12 +1471,12 @@ function Kn(e, t) {
|
|
|
1471
1471
|
}
|
|
1472
1472
|
//#endregion
|
|
1473
1473
|
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
1474
|
-
function
|
|
1474
|
+
function Yn(e) {
|
|
1475
1475
|
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
1476
1476
|
}
|
|
1477
1477
|
//#endregion
|
|
1478
1478
|
//#region src/utils/templateSettingsFields.ts
|
|
1479
|
-
var
|
|
1479
|
+
var Xn = {
|
|
1480
1480
|
width: "layout",
|
|
1481
1481
|
backgroundColor: "appearance",
|
|
1482
1482
|
textColor: "appearance",
|
|
@@ -1485,14 +1485,14 @@ var Jn = {
|
|
|
1485
1485
|
fontFamily: "appearance",
|
|
1486
1486
|
locale: "language",
|
|
1487
1487
|
preheaderText: "preheader"
|
|
1488
|
-
},
|
|
1489
|
-
function
|
|
1490
|
-
return Object.prototype.hasOwnProperty.call(
|
|
1488
|
+
}, Zn = Object.keys(Xn);
|
|
1489
|
+
function Qn(e) {
|
|
1490
|
+
return Object.prototype.hasOwnProperty.call(Xn, e);
|
|
1491
1491
|
}
|
|
1492
|
-
function
|
|
1492
|
+
function $n(e) {
|
|
1493
1493
|
let t = e?.fields;
|
|
1494
1494
|
if (t === void 0 || t === !0) return {
|
|
1495
|
-
fields: new Set(
|
|
1495
|
+
fields: new Set(Zn),
|
|
1496
1496
|
unknown: []
|
|
1497
1497
|
};
|
|
1498
1498
|
if (t === !1) return {
|
|
@@ -1500,7 +1500,7 @@ function Zn(e) {
|
|
|
1500
1500
|
unknown: []
|
|
1501
1501
|
};
|
|
1502
1502
|
let n = /* @__PURE__ */ new Set(), r = [];
|
|
1503
|
-
for (let e of t)
|
|
1503
|
+
for (let e of t) Qn(e) ? n.add(e) : r.push(String(e));
|
|
1504
1504
|
return {
|
|
1505
1505
|
fields: n,
|
|
1506
1506
|
unknown: r
|
|
@@ -1508,28 +1508,28 @@ function Zn(e) {
|
|
|
1508
1508
|
}
|
|
1509
1509
|
//#endregion
|
|
1510
1510
|
//#region src/utils/collectOffPaletteDefaults.ts
|
|
1511
|
-
function
|
|
1511
|
+
function er(e) {
|
|
1512
1512
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1513
1513
|
}
|
|
1514
|
-
function
|
|
1515
|
-
let r = new Set(e.map((e) =>
|
|
1516
|
-
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(
|
|
1514
|
+
function tr(e, t, n) {
|
|
1515
|
+
let r = new Set(e.map((e) => X(e))), i = [], a = (e, t) => {
|
|
1516
|
+
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(X(o)) && i.push(`${t}.${n}: ${o}`) : er(o) && a(o, `${t}.${n}`);
|
|
1517
1517
|
}, o = t;
|
|
1518
|
-
for (let [e, t] of Object.entries(
|
|
1518
|
+
for (let [e, t] of Object.entries(Re)) {
|
|
1519
1519
|
let n = o?.[e];
|
|
1520
1520
|
a({
|
|
1521
1521
|
...t,
|
|
1522
|
-
...
|
|
1522
|
+
...er(n) ? n : {}
|
|
1523
1523
|
}, e);
|
|
1524
1524
|
}
|
|
1525
1525
|
return a({
|
|
1526
|
-
...
|
|
1526
|
+
...ne,
|
|
1527
1527
|
...n ?? {}
|
|
1528
1528
|
}, "template"), i;
|
|
1529
1529
|
}
|
|
1530
1530
|
//#endregion
|
|
1531
1531
|
//#region src/utils/localizedBlockDefaults.ts
|
|
1532
|
-
function
|
|
1532
|
+
function nr(e) {
|
|
1533
1533
|
return {
|
|
1534
1534
|
title: { content: `<p>${e.blockDefaults.title}</p>` },
|
|
1535
1535
|
paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
|
|
@@ -1538,7 +1538,7 @@ function er(e) {
|
|
|
1538
1538
|
}
|
|
1539
1539
|
//#endregion
|
|
1540
1540
|
//#region src/i18n/index.ts
|
|
1541
|
-
var
|
|
1541
|
+
var rr = /* #__PURE__ */ Object.assign({
|
|
1542
1542
|
"./locales/ca.ts": () => import("./ca-C0hfqt4U.js"),
|
|
1543
1543
|
"./locales/de.ts": () => import("./de-C6J2Iae8.js"),
|
|
1544
1544
|
"./locales/en.ts": () => import("./en-BaUYOQi8.js"),
|
|
@@ -1546,50 +1546,50 @@ var tr = /* #__PURE__ */ Object.assign({
|
|
|
1546
1546
|
"./locales/fr.ts": () => import("./fr-L8DR73mK.js"),
|
|
1547
1547
|
"./locales/nl.ts": () => import("./nl-GDWeuX18.js"),
|
|
1548
1548
|
"./locales/pt-BR.ts": () => import("./pt-BR-B1AVVhWj.js")
|
|
1549
|
-
}),
|
|
1549
|
+
}), ir = /* #__PURE__ */ Object.assign({
|
|
1550
1550
|
"./locales/cloud/de.ts": () => import("./de-BytZwgn6.js"),
|
|
1551
1551
|
"./locales/cloud/en.ts": () => import("./en-DyOSV0lY.js"),
|
|
1552
1552
|
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-C1WLSGDh.js")
|
|
1553
1553
|
});
|
|
1554
|
-
function
|
|
1554
|
+
function ar(e) {
|
|
1555
1555
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
1556
1556
|
}
|
|
1557
|
-
var
|
|
1558
|
-
function
|
|
1557
|
+
var or = ar(rr), sr = ar(ir);
|
|
1558
|
+
function cr(e) {
|
|
1559
1559
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1562
|
-
let n =
|
|
1563
|
-
return t.find((e) =>
|
|
1561
|
+
function lr(e, t) {
|
|
1562
|
+
let n = cr(e);
|
|
1563
|
+
return t.find((e) => cr(e) === n);
|
|
1564
1564
|
}
|
|
1565
|
-
function
|
|
1566
|
-
return
|
|
1565
|
+
function ur(e) {
|
|
1566
|
+
return cr(e).split("-")[0];
|
|
1567
1567
|
}
|
|
1568
|
-
function
|
|
1569
|
-
return
|
|
1568
|
+
function dr(e, t) {
|
|
1569
|
+
return lr(e, t) ?? lr(ur(e), t);
|
|
1570
1570
|
}
|
|
1571
|
-
function
|
|
1572
|
-
return
|
|
1571
|
+
function fr(e, t) {
|
|
1572
|
+
return dr(e, t) ?? "en";
|
|
1573
1573
|
}
|
|
1574
|
-
async function
|
|
1575
|
-
let t =
|
|
1574
|
+
async function pr(e) {
|
|
1575
|
+
let t = rr[`./locales/${fr(e, or)}.ts`];
|
|
1576
1576
|
return (await t()).default;
|
|
1577
1577
|
}
|
|
1578
|
-
async function
|
|
1579
|
-
let t =
|
|
1578
|
+
async function mr(e) {
|
|
1579
|
+
let t = ir[`./locales/cloud/${fr(e, sr)}.ts`];
|
|
1580
1580
|
return (await t()).default;
|
|
1581
1581
|
}
|
|
1582
|
-
function
|
|
1583
|
-
return
|
|
1582
|
+
function hr(e) {
|
|
1583
|
+
return dr(e, or) !== void 0;
|
|
1584
1584
|
}
|
|
1585
|
-
function
|
|
1586
|
-
return
|
|
1585
|
+
function gr(e) {
|
|
1586
|
+
return dr(e, sr) !== void 0;
|
|
1587
1587
|
}
|
|
1588
|
-
function
|
|
1589
|
-
return [...
|
|
1588
|
+
function _r() {
|
|
1589
|
+
return [...or];
|
|
1590
1590
|
}
|
|
1591
|
-
function
|
|
1592
|
-
return [...
|
|
1591
|
+
function vr() {
|
|
1592
|
+
return [...sr];
|
|
1593
1593
|
}
|
|
1594
1594
|
//#endregion
|
|
1595
1595
|
//#region src/i18n/contentDefaults.ts
|
|
@@ -1650,16 +1650,16 @@ var $ = {
|
|
|
1650
1650
|
seconds: "Segons",
|
|
1651
1651
|
expired: "Aquesta oferta ha caducat"
|
|
1652
1652
|
}
|
|
1653
|
-
},
|
|
1654
|
-
function
|
|
1653
|
+
}, yr = new Map(Object.keys($).map((e) => [e.toLowerCase(), e]));
|
|
1654
|
+
function br(e) {
|
|
1655
1655
|
if (!e) return $.en;
|
|
1656
|
-
let t = e.trim().replace(/_/g, "-").toLowerCase(), n =
|
|
1656
|
+
let t = e.trim().replace(/_/g, "-").toLowerCase(), n = yr.get(t);
|
|
1657
1657
|
if (n) return $[n];
|
|
1658
|
-
let r =
|
|
1658
|
+
let r = yr.get(ur(t));
|
|
1659
1659
|
return r ? $[r] : $.en;
|
|
1660
1660
|
}
|
|
1661
|
-
function
|
|
1662
|
-
let t =
|
|
1661
|
+
function xr(e) {
|
|
1662
|
+
let t = br(e);
|
|
1663
1663
|
return {
|
|
1664
1664
|
video: { alt: t.video },
|
|
1665
1665
|
countdown: {
|
|
@@ -1673,8 +1673,8 @@ function yr(e) {
|
|
|
1673
1673
|
}
|
|
1674
1674
|
//#endregion
|
|
1675
1675
|
//#region src/utils/resolveFieldColors.ts
|
|
1676
|
-
function
|
|
1677
|
-
let n =
|
|
1676
|
+
function Sr(e, t) {
|
|
1677
|
+
let n = Pt({ presets: e.presets }, Mt), r = n.presets.length === 0;
|
|
1678
1678
|
return {
|
|
1679
1679
|
presets: r ? t.presets : n.presets,
|
|
1680
1680
|
allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
|
|
@@ -1686,9 +1686,9 @@ function br(e, t) {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
//#endregion
|
|
1688
1688
|
//#region src/utils/collectColorFieldIssues.ts
|
|
1689
|
-
function
|
|
1689
|
+
function Cr(e, t) {
|
|
1690
1690
|
let n = [], r = (r, i) => {
|
|
1691
|
-
let a =
|
|
1691
|
+
let a = Sr(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
1692
1692
|
if (a.invalidPresets.length > 0 && n.push({
|
|
1693
1693
|
id: s("invalid-presets"),
|
|
1694
1694
|
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." : "")
|
|
@@ -1699,8 +1699,8 @@ function xr(e, t) {
|
|
|
1699
1699
|
id: s("allow-custom-ignored"),
|
|
1700
1700
|
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
1701
1701
|
}), !a.allowCustom && a.presets.length > 0) {
|
|
1702
|
-
let e = r.default ?? "", t = new Set(a.presets.map((e) =>
|
|
1703
|
-
e !== "" && !t.has(
|
|
1702
|
+
let e = r.default ?? "", t = new Set(a.presets.map((e) => X(e)));
|
|
1703
|
+
e !== "" && !t.has(X(e)) && n.push({
|
|
1704
1704
|
id: s("off-palette-default"),
|
|
1705
1705
|
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.`
|
|
1706
1706
|
});
|
|
@@ -1712,7 +1712,7 @@ function xr(e, t) {
|
|
|
1712
1712
|
}
|
|
1713
1713
|
//#endregion
|
|
1714
1714
|
//#region src/utils/keyboardShortcuts.ts
|
|
1715
|
-
function
|
|
1715
|
+
function wr(e) {
|
|
1716
1716
|
for (let t of e.composedPath()) {
|
|
1717
1717
|
if (!(t instanceof HTMLElement)) continue;
|
|
1718
1718
|
if (t.isContentEditable) return !0;
|
|
@@ -1721,18 +1721,18 @@ function Sr(e) {
|
|
|
1721
1721
|
}
|
|
1722
1722
|
return !1;
|
|
1723
1723
|
}
|
|
1724
|
-
function
|
|
1724
|
+
function Tr(e, t) {
|
|
1725
1725
|
let n = e.metaKey || e.ctrlKey;
|
|
1726
1726
|
if (n && e.key.toLowerCase() === "s") {
|
|
1727
1727
|
e.preventDefault(), t.onSave?.();
|
|
1728
1728
|
return;
|
|
1729
1729
|
}
|
|
1730
1730
|
if (n && e.key.toLowerCase() === "z") {
|
|
1731
|
-
if (
|
|
1731
|
+
if (wr(e)) return;
|
|
1732
1732
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
1733
1733
|
return;
|
|
1734
1734
|
}
|
|
1735
|
-
if (t.isPicking?.() && !
|
|
1735
|
+
if (t.isPicking?.() && !wr(e)) {
|
|
1736
1736
|
if (e.key === "Escape") {
|
|
1737
1737
|
e.preventDefault(), t.onCancelPick?.();
|
|
1738
1738
|
return;
|
|
@@ -1750,11 +1750,11 @@ function Cr(e, t) {
|
|
|
1750
1750
|
t.selectBlock(null);
|
|
1751
1751
|
return;
|
|
1752
1752
|
}
|
|
1753
|
-
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !
|
|
1753
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !wr(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
1754
1754
|
}
|
|
1755
1755
|
//#endregion
|
|
1756
1756
|
//#region src/utils/mergeTagLabelSegments.ts
|
|
1757
|
-
function
|
|
1757
|
+
function Er(e, t, n, r = !1) {
|
|
1758
1758
|
if (!e) return [];
|
|
1759
1759
|
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
1760
1760
|
for (; (s = i.exec(e)) !== null;) {
|
|
@@ -1763,18 +1763,18 @@ function wr(e, t, n, r = !1) {
|
|
|
1763
1763
|
value: e.slice(o, s.index)
|
|
1764
1764
|
});
|
|
1765
1765
|
let i = s[0];
|
|
1766
|
-
if (
|
|
1767
|
-
let e = r ?
|
|
1766
|
+
if (xe(i, n)) {
|
|
1767
|
+
let e = r ? Pe(i, t) : void 0;
|
|
1768
1768
|
a.push(e === void 0 ? {
|
|
1769
1769
|
type: "tag",
|
|
1770
|
-
value:
|
|
1770
|
+
value: Ae(i, t)
|
|
1771
1771
|
} : {
|
|
1772
1772
|
type: "text",
|
|
1773
1773
|
value: e
|
|
1774
1774
|
});
|
|
1775
|
-
} else
|
|
1775
|
+
} else be(i, n) ? a.push({
|
|
1776
1776
|
type: "tag",
|
|
1777
|
-
value:
|
|
1777
|
+
value: ve(i, n)
|
|
1778
1778
|
}) : a.push({
|
|
1779
1779
|
type: "text",
|
|
1780
1780
|
value: i
|
|
@@ -1788,20 +1788,20 @@ function wr(e, t, n, r = !1) {
|
|
|
1788
1788
|
}
|
|
1789
1789
|
//#endregion
|
|
1790
1790
|
//#region src/components/MergeTagPreviewText.vue
|
|
1791
|
-
var
|
|
1791
|
+
var Dr = d({
|
|
1792
1792
|
name: "MergeTagPreviewText",
|
|
1793
1793
|
props: { text: {
|
|
1794
1794
|
type: String,
|
|
1795
1795
|
required: !0
|
|
1796
1796
|
} },
|
|
1797
1797
|
setup(e) {
|
|
1798
|
-
let t = n(
|
|
1799
|
-
return () => a.value.map((e, t) => e.type === "tag" ?
|
|
1798
|
+
let t = n(G, []), r = n(yt, Me.liquid), i = n(q, null), a = S(() => Er(e.text, t, r, i?.value ?? !1));
|
|
1799
|
+
return () => a.value.map((e, t) => e.type === "tag" ? ee("span", {
|
|
1800
1800
|
key: t,
|
|
1801
1801
|
class: "tpl-merge-tag-label"
|
|
1802
1802
|
}, e.value) : e.value);
|
|
1803
1803
|
}
|
|
1804
|
-
}),
|
|
1804
|
+
}), Or = ["href"], kr = /* @__PURE__ */ d({
|
|
1805
1805
|
__name: "ButtonBlock",
|
|
1806
1806
|
props: {
|
|
1807
1807
|
block: {},
|
|
@@ -1827,13 +1827,13 @@ var Tr = d({
|
|
|
1827
1827
|
style: k(n.value),
|
|
1828
1828
|
class: "tpl:cursor-default",
|
|
1829
1829
|
onClick: i[0] ||= O(() => {}, ["prevent"])
|
|
1830
|
-
}, [v(
|
|
1830
|
+
}, [v(Dr, { text: e.block.text }, null, 8, ["text"])], 12, Or)], 4));
|
|
1831
1831
|
}
|
|
1832
|
-
}),
|
|
1832
|
+
}), Ar = ["innerHTML"], jr = [
|
|
1833
1833
|
"src",
|
|
1834
1834
|
"width",
|
|
1835
1835
|
"height"
|
|
1836
|
-
],
|
|
1836
|
+
], Mr = /* @__PURE__ */ d({
|
|
1837
1837
|
__name: "CustomBlockIcon",
|
|
1838
1838
|
props: {
|
|
1839
1839
|
icon: {},
|
|
@@ -1849,24 +1849,24 @@ var Tr = d({
|
|
|
1849
1849
|
height: `${n.value}px`
|
|
1850
1850
|
}),
|
|
1851
1851
|
innerHTML: e.icon
|
|
1852
|
-
}, null, 12,
|
|
1852
|
+
}, null, 12, Ar)) : i.value ? (s(), C("img", {
|
|
1853
1853
|
key: 1,
|
|
1854
1854
|
src: e.icon,
|
|
1855
1855
|
width: n.value,
|
|
1856
1856
|
height: n.value,
|
|
1857
1857
|
class: "tpl:inline-block",
|
|
1858
1858
|
alt: ""
|
|
1859
|
-
}, null, 8,
|
|
1859
|
+
}, null, 8, jr)) : (s(), A(_($t), {
|
|
1860
1860
|
key: 2,
|
|
1861
1861
|
size: n.value,
|
|
1862
1862
|
"stroke-width": 1.5
|
|
1863
1863
|
}, null, 8, ["size"]));
|
|
1864
1864
|
}
|
|
1865
|
-
}),
|
|
1866
|
-
function
|
|
1867
|
-
let r =
|
|
1865
|
+
}), Nr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
1866
|
+
function Pr(e, n) {
|
|
1867
|
+
let r = nn(), i = null, a = null, o = null;
|
|
1868
1868
|
function s() {
|
|
1869
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
1869
|
+
return e.value ? Array.from(e.value.querySelectorAll(Nr)).filter((e) => e.offsetParent !== null) : [];
|
|
1870
1870
|
}
|
|
1871
1871
|
function c(e) {
|
|
1872
1872
|
if (e.key !== "Tab") return;
|
|
@@ -1881,7 +1881,7 @@ function Mr(e, n) {
|
|
|
1881
1881
|
o = null;
|
|
1882
1882
|
let t = s();
|
|
1883
1883
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
1884
|
-
}), a =
|
|
1884
|
+
}), a = W(e, "keydown", c);
|
|
1885
1885
|
}
|
|
1886
1886
|
function u(e = {}) {
|
|
1887
1887
|
let t = e.restoreFocus !== !1;
|
|
@@ -1896,8 +1896,8 @@ function Mr(e, n) {
|
|
|
1896
1896
|
}
|
|
1897
1897
|
//#endregion
|
|
1898
1898
|
//#region src/composables/useEmoji.ts
|
|
1899
|
-
function
|
|
1900
|
-
let [e, n] =
|
|
1899
|
+
function Fr() {
|
|
1900
|
+
let [e, n] = Ve(!1), r = x([]), i = !1;
|
|
1901
1901
|
h(() => {
|
|
1902
1902
|
i = !0;
|
|
1903
1903
|
}), t(e, async (e) => {
|
|
@@ -1922,7 +1922,7 @@ function Nr() {
|
|
|
1922
1922
|
}
|
|
1923
1923
|
//#endregion
|
|
1924
1924
|
//#region src/composables/useFonts.ts
|
|
1925
|
-
var
|
|
1925
|
+
var Ir = [
|
|
1926
1926
|
{
|
|
1927
1927
|
value: "Arial",
|
|
1928
1928
|
label: "Arial"
|
|
@@ -1951,7 +1951,7 @@ var Pr = [
|
|
|
1951
1951
|
value: "Courier New",
|
|
1952
1952
|
label: "Courier New"
|
|
1953
1953
|
}
|
|
1954
|
-
],
|
|
1954
|
+
], Lr = {
|
|
1955
1955
|
arial: "Arial, sans-serif",
|
|
1956
1956
|
helvetica: "Helvetica, sans-serif",
|
|
1957
1957
|
georgia: "Georgia, serif",
|
|
@@ -1959,23 +1959,23 @@ var Pr = [
|
|
|
1959
1959
|
verdana: "Verdana, sans-serif",
|
|
1960
1960
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1961
1961
|
"courier new": "'Courier New', monospace"
|
|
1962
|
-
},
|
|
1963
|
-
function
|
|
1964
|
-
if (e === void 0 || e === !0) return [...
|
|
1962
|
+
}, Rr = "Arial, sans-serif";
|
|
1963
|
+
function zr(e) {
|
|
1964
|
+
if (e === void 0 || e === !0) return [...Ir];
|
|
1965
1965
|
if (e === !1) return [];
|
|
1966
1966
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1967
1967
|
for (let i of e) {
|
|
1968
|
-
let e = i.toLowerCase(), a =
|
|
1968
|
+
let e = i.toLowerCase(), a = Ir.find((t) => t.value.toLowerCase() === e);
|
|
1969
1969
|
if (!a) {
|
|
1970
|
-
r.has(e) || (r.add(e),
|
|
1970
|
+
r.has(e) || (r.add(e), Y.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${Ir.map((e) => e.value).join(", ")}.`));
|
|
1971
1971
|
continue;
|
|
1972
1972
|
}
|
|
1973
1973
|
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1974
1974
|
}
|
|
1975
1975
|
return t;
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1978
|
-
let t = l(e?.customFonts ?? []), n = l(!1), r =
|
|
1977
|
+
function Br(e) {
|
|
1978
|
+
let t = l(e?.customFonts ?? []), n = l(!1), r = zr(e?.builtIns), i = S(() => e?.defaultFallback ?? Rr), a = S(() => {
|
|
1979
1979
|
let e = [...r], n = t.value.map((e) => ({
|
|
1980
1980
|
value: e.name,
|
|
1981
1981
|
label: e.name,
|
|
@@ -1986,20 +1986,20 @@ function Rr(e) {
|
|
|
1986
1986
|
function s(e) {
|
|
1987
1987
|
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1988
1988
|
}
|
|
1989
|
-
let c = e?.defaultFont ??
|
|
1990
|
-
s(c) ||
|
|
1989
|
+
let c = e?.defaultFont ?? Rr.split(",")[0].trim();
|
|
1990
|
+
s(c) || Y.warn(`config.fonts: new templates seed "${c}", 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.`);
|
|
1991
1991
|
function u() {
|
|
1992
1992
|
if (e?.defaultFont && s(e.defaultFont)) {
|
|
1993
1993
|
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1994
1994
|
if (t) return t.value;
|
|
1995
1995
|
}
|
|
1996
|
-
return
|
|
1996
|
+
return Rr;
|
|
1997
1997
|
}
|
|
1998
1998
|
let d = S(() => u());
|
|
1999
1999
|
function f(e) {
|
|
2000
2000
|
if (!e) return i.value;
|
|
2001
2001
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
2002
|
-
return n ? `'${n.name}', ${n.fallback ?? i.value}` :
|
|
2002
|
+
return n ? `'${n.name}', ${n.fallback ?? i.value}` : Lr[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
2003
2003
|
}
|
|
2004
2004
|
let p = [], m = !1;
|
|
2005
2005
|
async function g() {
|
|
@@ -2015,7 +2015,7 @@ function Rr(e) {
|
|
|
2015
2015
|
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
2016
2016
|
});
|
|
2017
2017
|
} catch (t) {
|
|
2018
|
-
|
|
2018
|
+
Y.warn(`Failed to load custom font "${e.name}":`, t);
|
|
2019
2019
|
}
|
|
2020
2020
|
});
|
|
2021
2021
|
await Promise.allSettled(e), !m && (n.value = !0);
|
|
@@ -2040,8 +2040,8 @@ function Rr(e) {
|
|
|
2040
2040
|
}
|
|
2041
2041
|
//#endregion
|
|
2042
2042
|
//#region src/composables/useLogicTag.ts
|
|
2043
|
-
function
|
|
2044
|
-
let e = n(qe, []), t = n(
|
|
2043
|
+
function Vr() {
|
|
2044
|
+
let e = n(qe, []), t = n(st, []), r = n(yt, Me.liquid), i = n(nt, null), a = n(kt, null), o = n(ct, null) ?? l(!1), s = !!i || e.length > 0 || t.length > 0, c = e.length > 0 || t.length > 0;
|
|
2045
2045
|
async function u() {
|
|
2046
2046
|
if (i) {
|
|
2047
2047
|
o.value = !0;
|
|
@@ -2072,12 +2072,12 @@ function zr() {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
//#endregion
|
|
2074
2074
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
2075
|
-
function
|
|
2076
|
-
return
|
|
2075
|
+
function Hr(e, t, n) {
|
|
2076
|
+
return be(e, n) ? {
|
|
2077
2077
|
type: "logicMergeTagNode",
|
|
2078
2078
|
attrs: {
|
|
2079
2079
|
value: e,
|
|
2080
|
-
keyword:
|
|
2080
|
+
keyword: ve(e, n)
|
|
2081
2081
|
}
|
|
2082
2082
|
} : {
|
|
2083
2083
|
type: "mergeTagNode",
|
|
@@ -2089,15 +2089,15 @@ function Br(e, t, n) {
|
|
|
2089
2089
|
}
|
|
2090
2090
|
//#endregion
|
|
2091
2091
|
//#region src/utils/insertLogicTag.ts
|
|
2092
|
-
function
|
|
2092
|
+
function Ur(e) {
|
|
2093
2093
|
return "before" in e && "after" in e;
|
|
2094
2094
|
}
|
|
2095
|
-
function
|
|
2096
|
-
if (!
|
|
2097
|
-
e.chain().focus().insertContent(
|
|
2095
|
+
function Wr(e, t, n) {
|
|
2096
|
+
if (!Ur(t)) {
|
|
2097
|
+
e.chain().focus().insertContent(Hr(t.value, t.label, n)).run();
|
|
2098
2098
|
return;
|
|
2099
2099
|
}
|
|
2100
|
-
let r =
|
|
2100
|
+
let r = Hr(t.before, t.label, n), i = Hr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
2101
2101
|
if (a !== o) {
|
|
2102
2102
|
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
2103
2103
|
return;
|
|
@@ -2106,20 +2106,20 @@ function Hr(e, t, n) {
|
|
|
2106
2106
|
}
|
|
2107
2107
|
//#endregion
|
|
2108
2108
|
//#region src/utils/linkColorExtension.ts
|
|
2109
|
-
function
|
|
2109
|
+
function Gr(e) {
|
|
2110
2110
|
if (!e) return null;
|
|
2111
2111
|
let t = e.trim();
|
|
2112
2112
|
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;
|
|
2113
2113
|
}
|
|
2114
|
-
function
|
|
2114
|
+
function Kr(e) {
|
|
2115
2115
|
return e.extend({ addAttributes() {
|
|
2116
2116
|
return {
|
|
2117
2117
|
...this.parent?.(),
|
|
2118
2118
|
color: {
|
|
2119
2119
|
default: null,
|
|
2120
|
-
parseHTML: (e) =>
|
|
2120
|
+
parseHTML: (e) => Gr(Nt(e.style.color)),
|
|
2121
2121
|
renderHTML: (e) => {
|
|
2122
|
-
let t =
|
|
2122
|
+
let t = Gr(e.color);
|
|
2123
2123
|
return t ? { style: `color: ${t}` } : {};
|
|
2124
2124
|
}
|
|
2125
2125
|
}
|
|
@@ -2128,24 +2128,24 @@ function Wr(e) {
|
|
|
2128
2128
|
}
|
|
2129
2129
|
//#endregion
|
|
2130
2130
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
2131
|
-
function
|
|
2132
|
-
let
|
|
2133
|
-
|
|
2134
|
-
function a() {
|
|
2135
|
-
let i = e.value?.getAttributes("link") ?? {};
|
|
2136
|
-
n.value = i.href || "", r.value = i.color || "", t.value = !0;
|
|
2137
|
-
}
|
|
2131
|
+
function qr(e, t = Me.liquid) {
|
|
2132
|
+
let n = l(!1), r = l(""), i = l(""), a = l(null);
|
|
2133
|
+
Pr(a, n);
|
|
2138
2134
|
function o() {
|
|
2139
|
-
|
|
2140
|
-
|
|
2135
|
+
let t = e.value?.getAttributes("link") ?? {};
|
|
2136
|
+
r.value = t.href || "", i.value = t.color || "", n.value = !0;
|
|
2137
|
+
}
|
|
2138
|
+
function s() {
|
|
2139
|
+
if (r.value) {
|
|
2140
|
+
let t = d(r.value);
|
|
2141
2141
|
if (t !== null) {
|
|
2142
|
-
let n =
|
|
2143
|
-
n && typeof e.value?.commands.unsetColor == "function" &&
|
|
2142
|
+
let n = Gr(i.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
2143
|
+
n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
|
|
2144
2144
|
}
|
|
2145
2145
|
}
|
|
2146
|
-
|
|
2146
|
+
p();
|
|
2147
2147
|
}
|
|
2148
|
-
let
|
|
2148
|
+
let c = /* @__PURE__ */ new Set([
|
|
2149
2149
|
"http",
|
|
2150
2150
|
"https",
|
|
2151
2151
|
"mailto",
|
|
@@ -2156,38 +2156,41 @@ function Gr(e) {
|
|
|
2156
2156
|
"xmpp",
|
|
2157
2157
|
"cid"
|
|
2158
2158
|
]);
|
|
2159
|
-
function
|
|
2159
|
+
function u(e) {
|
|
2160
|
+
return RegExp(`^(?:${t.value.source})`).test(e);
|
|
2161
|
+
}
|
|
2162
|
+
function d(e) {
|
|
2160
2163
|
let t = e.trim();
|
|
2161
2164
|
if (!t) return null;
|
|
2162
2165
|
if (t.startsWith("#")) return t;
|
|
2163
2166
|
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
2164
|
-
return n ?
|
|
2167
|
+
return n ? c.has(n[1].toLowerCase()) ? t : null : u(t) ? t : `https://${t}`;
|
|
2165
2168
|
}
|
|
2166
|
-
function
|
|
2167
|
-
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(),
|
|
2169
|
+
function f() {
|
|
2170
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p();
|
|
2168
2171
|
}
|
|
2169
|
-
function
|
|
2170
|
-
|
|
2172
|
+
function p() {
|
|
2173
|
+
n.value = !1, r.value = "", i.value = "";
|
|
2171
2174
|
}
|
|
2172
|
-
function
|
|
2173
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
2175
|
+
function m(e) {
|
|
2176
|
+
e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && p();
|
|
2174
2177
|
}
|
|
2175
2178
|
return {
|
|
2176
|
-
showLinkDialog:
|
|
2177
|
-
linkUrl:
|
|
2178
|
-
linkColor:
|
|
2179
|
-
linkDialogRef:
|
|
2180
|
-
openLinkDialog:
|
|
2181
|
-
insertLink:
|
|
2182
|
-
removeLink:
|
|
2183
|
-
closeLinkDialog:
|
|
2184
|
-
handleLinkKeydown:
|
|
2179
|
+
showLinkDialog: n,
|
|
2180
|
+
linkUrl: r,
|
|
2181
|
+
linkColor: i,
|
|
2182
|
+
linkDialogRef: a,
|
|
2183
|
+
openLinkDialog: o,
|
|
2184
|
+
insertLink: s,
|
|
2185
|
+
removeLink: f,
|
|
2186
|
+
closeLinkDialog: p,
|
|
2187
|
+
handleLinkKeydown: m
|
|
2185
2188
|
};
|
|
2186
2189
|
}
|
|
2187
2190
|
//#endregion
|
|
2188
2191
|
//#region src/composables/useRichTextEditor.ts
|
|
2189
|
-
function
|
|
2190
|
-
let i = n(
|
|
2192
|
+
function Jr(r) {
|
|
2193
|
+
let i = n(K, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = Z(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } = Vr(), h = n(dt, null), g = (N(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = Ee(u), v = x(null), { showLinkDialog: y, linkUrl: b, linkColor: S, linkDialogRef: C, openLinkDialog: w, insertLink: T, removeLink: E, closeLinkDialog: D, handleLinkKeydown: O } = qr(v, u), { start: k, stop: A } = ze(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), j = x(null), M = l(!0), P = l(null), F = !1;
|
|
2191
2194
|
async function I() {
|
|
2192
2195
|
P.value = null, M.value = !0;
|
|
2193
2196
|
try {
|
|
@@ -2217,7 +2220,7 @@ function Kr(r) {
|
|
|
2217
2220
|
v.value = s, M.value = !1, k();
|
|
2218
2221
|
} catch (e) {
|
|
2219
2222
|
if (F) return;
|
|
2220
|
-
|
|
2223
|
+
Y.error(`[${r.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), P.value = e instanceof Error ? e.message : "Failed to load editor", M.value = !1;
|
|
2221
2224
|
}
|
|
2222
2225
|
}
|
|
2223
2226
|
function L() {
|
|
@@ -2227,7 +2230,7 @@ function Kr(r) {
|
|
|
2227
2230
|
let R = t(() => r.blockContent(), (e) => {
|
|
2228
2231
|
v.value && v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 });
|
|
2229
2232
|
});
|
|
2230
|
-
function
|
|
2233
|
+
function ee(e) {
|
|
2231
2234
|
if (s.value || p.value) return;
|
|
2232
2235
|
let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement);
|
|
2233
2236
|
if (!n) return;
|
|
@@ -2235,19 +2238,19 @@ function Kr(r) {
|
|
|
2235
2238
|
let i = t.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
2236
2239
|
n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog") || i || r.onDone();
|
|
2237
2240
|
}
|
|
2238
|
-
|
|
2241
|
+
W(document, "mousedown", ee), e(() => {
|
|
2239
2242
|
F = !0, R(), A(), v.value?.destroy();
|
|
2240
2243
|
});
|
|
2241
|
-
async function
|
|
2244
|
+
async function z() {
|
|
2242
2245
|
let e = await c();
|
|
2243
2246
|
F || (e && v.value ? v.value.chain().focus().insertMergeTag({
|
|
2244
2247
|
label: e.label,
|
|
2245
2248
|
value: e.value
|
|
2246
2249
|
}).run() : v.value?.commands.focus());
|
|
2247
2250
|
}
|
|
2248
|
-
async function
|
|
2251
|
+
async function B() {
|
|
2249
2252
|
let e = await m();
|
|
2250
|
-
F || (e && v.value ?
|
|
2253
|
+
F || (e && v.value ? Wr(v.value, e, u) : v.value?.commands.focus());
|
|
2251
2254
|
}
|
|
2252
2255
|
return {
|
|
2253
2256
|
editor: v,
|
|
@@ -2270,15 +2273,15 @@ function Kr(r) {
|
|
|
2270
2273
|
removeLink: E,
|
|
2271
2274
|
closeLinkDialog: D,
|
|
2272
2275
|
handleLinkKeydown: O,
|
|
2273
|
-
handleAddMergeTag:
|
|
2274
|
-
handleAddLogicTag:
|
|
2276
|
+
handleAddMergeTag: z,
|
|
2277
|
+
handleAddLogicTag: B
|
|
2275
2278
|
};
|
|
2276
2279
|
}
|
|
2277
2280
|
//#endregion
|
|
2278
2281
|
//#region src/composables/useSmallScreenNotice.ts
|
|
2279
|
-
var
|
|
2280
|
-
function
|
|
2281
|
-
let t =
|
|
2282
|
+
var Yr = "(max-width: 767px)";
|
|
2283
|
+
function Xr(e) {
|
|
2284
|
+
let t = Ue(Yr);
|
|
2282
2285
|
return {
|
|
2283
2286
|
isSmallScreen: t,
|
|
2284
2287
|
showNotice: S(() => (P(e) ?? !0) && t.value)
|
|
@@ -2286,20 +2289,20 @@ function Jr(e) {
|
|
|
2286
2289
|
}
|
|
2287
2290
|
//#endregion
|
|
2288
2291
|
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2289
|
-
var
|
|
2292
|
+
var Zr = { class: "tpl:w-full" }, Qr = {
|
|
2290
2293
|
key: 0,
|
|
2291
2294
|
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)]"
|
|
2292
|
-
},
|
|
2295
|
+
}, $r = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ei = {
|
|
2293
2296
|
key: 1,
|
|
2294
2297
|
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)]"
|
|
2295
|
-
},
|
|
2298
|
+
}, ti = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ni = {
|
|
2296
2299
|
key: 2,
|
|
2297
2300
|
class: "tpl:relative"
|
|
2298
|
-
},
|
|
2301
|
+
}, ri = ["innerHTML"], ii = {
|
|
2299
2302
|
key: 0,
|
|
2300
2303
|
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]",
|
|
2301
2304
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
2302
|
-
},
|
|
2305
|
+
}, ai = /* @__PURE__ */ d({
|
|
2303
2306
|
__name: "CustomBlock",
|
|
2304
2307
|
props: {
|
|
2305
2308
|
block: {},
|
|
@@ -2307,7 +2310,7 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2307
2310
|
},
|
|
2308
2311
|
emits: ["fetchData"],
|
|
2309
2312
|
setup(e, { emit: r }) {
|
|
2310
|
-
let i = e, a = r, { t: o } =
|
|
2313
|
+
let i = e, a = r, { t: o } = J(), c = n(Et, null), u = l(""), d = l(!1), f = S(() => c?.getDefinition(i.block.customType)), p = S(() => !!f.value), { isFetching: m, fetch: h, needsFetch: g, hasDataSource: y } = vn({
|
|
2311
2314
|
definition: f,
|
|
2312
2315
|
block: S(() => i.block),
|
|
2313
2316
|
onUpdate: (e, t) => {
|
|
@@ -2316,10 +2319,10 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2316
2319
|
dataSourceFetched: t
|
|
2317
2320
|
});
|
|
2318
2321
|
}
|
|
2319
|
-
}), b = n(
|
|
2322
|
+
}), b = n(G, []), x = n(q, null), T = S(() => {
|
|
2320
2323
|
if (!x?.value) return i.block;
|
|
2321
2324
|
let e = {};
|
|
2322
|
-
for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ?
|
|
2325
|
+
for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? _e(n, b) : n;
|
|
2323
2326
|
return {
|
|
2324
2327
|
...i.block,
|
|
2325
2328
|
fieldValues: e
|
|
@@ -2336,17 +2339,17 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2336
2339
|
}
|
|
2337
2340
|
}
|
|
2338
2341
|
}
|
|
2339
|
-
let k =
|
|
2342
|
+
let k = Be(D, 150);
|
|
2340
2343
|
return E(() => {
|
|
2341
2344
|
D();
|
|
2342
2345
|
}), t(() => i.block.fieldValues, () => {
|
|
2343
2346
|
k();
|
|
2344
2347
|
}, { deep: !0 }), t(() => x?.value, () => {
|
|
2345
2348
|
k();
|
|
2346
|
-
}), (e, t) => (s(), C("div",
|
|
2349
|
+
}), (e, t) => (s(), C("div", Zr, [p.value ? d.value ? (s(), C("div", ei, [v(_(Xt), {
|
|
2347
2350
|
size: 24,
|
|
2348
2351
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
2349
|
-
}), M("span",
|
|
2352
|
+
}), M("span", ti, R(_(o).customBlocks.renderError), 1)])) : (s(), C("div", ni, [M("div", { innerHTML: u.value }, null, 8, ri), _(y) && _(g) ? (s(), C("div", ii, [_(m) ? (s(), A(en, {
|
|
2350
2353
|
key: 1,
|
|
2351
2354
|
class: "tpl:w-48"
|
|
2352
2355
|
})) : (s(), C("button", {
|
|
@@ -2354,16 +2357,16 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2354
2357
|
type: "button",
|
|
2355
2358
|
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-[var(--tpl-shadow)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:shadow-[var(--tpl-shadow-md)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
|
|
2356
2359
|
onClick: t[0] ||= O((...e) => _(h) && _(h)(...e), ["stop"])
|
|
2357
|
-
}, [f.value?.icon ? (s(), A(
|
|
2360
|
+
}, [f.value?.icon ? (s(), A(Mr, {
|
|
2358
2361
|
key: 0,
|
|
2359
2362
|
icon: f.value.icon,
|
|
2360
2363
|
size: 16
|
|
2361
|
-
}, null, 8, ["icon"])) : w("", !0),
|
|
2364
|
+
}, null, 8, ["icon"])) : w("", !0), B(" " + R(f.value?.dataSource?.label || _(o).customBlocks.dataSource.fetchButton), 1)]))])) : w("", !0)])) : (s(), C("div", Qr, [v(_(zt), {
|
|
2362
2365
|
size: 24,
|
|
2363
2366
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
2364
|
-
}), M("span",
|
|
2367
|
+
}), M("span", $r, R(_(o).customBlocks.definitionNotFound), 1)]))]));
|
|
2365
2368
|
}
|
|
2366
|
-
}),
|
|
2369
|
+
}), oi = { class: "tpl:w-full" }, si = /* @__PURE__ */ d({
|
|
2367
2370
|
__name: "DividerBlock",
|
|
2368
2371
|
props: {
|
|
2369
2372
|
block: {},
|
|
@@ -2375,28 +2378,28 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2375
2378
|
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
2376
2379
|
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
2377
2380
|
}));
|
|
2378
|
-
return (e, t) => (s(), C("div",
|
|
2381
|
+
return (e, t) => (s(), C("div", oi, [M("hr", {
|
|
2379
2382
|
class: "tpl:m-0 tpl:border-none",
|
|
2380
2383
|
style: k(n.value)
|
|
2381
2384
|
}, null, 4)]));
|
|
2382
2385
|
}
|
|
2383
|
-
}),
|
|
2386
|
+
}), ci = { class: "tpl:w-full" }, li = ["srcdoc", "title"], ui = {
|
|
2384
2387
|
key: 1,
|
|
2385
2388
|
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)]"
|
|
2386
|
-
},
|
|
2389
|
+
}, di = {
|
|
2387
2390
|
key: 0,
|
|
2388
2391
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
2389
|
-
},
|
|
2392
|
+
}, fi = {
|
|
2390
2393
|
key: 1,
|
|
2391
2394
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
2392
|
-
},
|
|
2395
|
+
}, pi = /* @__PURE__ */ d({
|
|
2393
2396
|
__name: "HtmlBlock",
|
|
2394
2397
|
props: {
|
|
2395
2398
|
block: {},
|
|
2396
2399
|
viewport: {}
|
|
2397
2400
|
},
|
|
2398
2401
|
setup(r) {
|
|
2399
|
-
let i = r, { t: a } =
|
|
2402
|
+
let i = r, { t: a } = J(), o = n(jt, !1), c = S(() => i.block.content.trim().length > 0), u = S(() => o && c.value), d = n(G, []), f = n(q, null), p = S(() => f?.value ? _e(i.block.content, d) : i.block.content), m = l(null), h = l(60), g = null;
|
|
2400
2403
|
function y() {
|
|
2401
2404
|
let e = m.value?.contentDocument;
|
|
2402
2405
|
e && (h.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
@@ -2410,7 +2413,7 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2410
2413
|
e || (g?.disconnect(), g = null);
|
|
2411
2414
|
}), e(() => {
|
|
2412
2415
|
g?.disconnect(), g = null;
|
|
2413
|
-
}), (e, t) => (s(), C("div",
|
|
2416
|
+
}), (e, t) => (s(), C("div", ci, [u.value ? (s(), C("iframe", {
|
|
2414
2417
|
key: 0,
|
|
2415
2418
|
ref_key: "iframeRef",
|
|
2416
2419
|
ref: m,
|
|
@@ -2420,18 +2423,18 @@ var Yr = { class: "tpl:w-full" }, Xr = {
|
|
|
2420
2423
|
class: "tpl:block tpl:w-full tpl:border-0",
|
|
2421
2424
|
style: k({ height: `${h.value}px` }),
|
|
2422
2425
|
onLoad: b
|
|
2423
|
-
}, null, 44,
|
|
2426
|
+
}, null, 44, li)) : (s(), C("div", ui, [v(_(Bt), {
|
|
2424
2427
|
size: 24,
|
|
2425
2428
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
2426
|
-
}), c.value ? (s(), C("span",
|
|
2429
|
+
}), c.value ? (s(), C("span", di, R(_(a).html.preview), 1)) : (s(), C("span", fi, R(_(a).html.empty), 1))]))]));
|
|
2427
2430
|
}
|
|
2428
|
-
}),
|
|
2429
|
-
function
|
|
2430
|
-
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || P(r), { isOverDropZone: a } =
|
|
2431
|
+
}), mi = "image/";
|
|
2432
|
+
function hi(e) {
|
|
2433
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || P(r), { isOverDropZone: a } = Ge(t, {
|
|
2431
2434
|
preventDefaultForUnhandled: !0,
|
|
2432
2435
|
onDrop: (e) => {
|
|
2433
2436
|
if (!i()) return;
|
|
2434
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
2437
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(mi));
|
|
2435
2438
|
t.length > 0 && n([t[0]]);
|
|
2436
2439
|
}
|
|
2437
2440
|
});
|
|
@@ -2439,17 +2442,17 @@ function pi(e) {
|
|
|
2439
2442
|
}
|
|
2440
2443
|
//#endregion
|
|
2441
2444
|
//#region src/components/blocks/ImageBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2442
|
-
var
|
|
2445
|
+
var gi = {
|
|
2443
2446
|
key: 0,
|
|
2444
2447
|
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)]",
|
|
2445
2448
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
2446
|
-
},
|
|
2449
|
+
}, _i = ["href"], vi = ["src", "alt"], yi = ["src", "alt"], bi = {
|
|
2447
2450
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
2448
2451
|
style: { opacity: "0.7" }
|
|
2449
|
-
},
|
|
2452
|
+
}, xi = ["href"], Si = ["src", "alt"], Ci = ["src", "alt"], wi = {
|
|
2450
2453
|
key: 4,
|
|
2451
2454
|
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)]"
|
|
2452
|
-
},
|
|
2455
|
+
}, Ti = ["aria-label"], Ei = { key: 1 }, Di = /* @__PURE__ */ d({
|
|
2453
2456
|
__name: "ImageBlock",
|
|
2454
2457
|
props: {
|
|
2455
2458
|
block: {},
|
|
@@ -2457,7 +2460,7 @@ var mi = {
|
|
|
2457
2460
|
},
|
|
2458
2461
|
emits: ["update"],
|
|
2459
2462
|
setup(e, { emit: t }) {
|
|
2460
|
-
let r = e, i = t, { t: a } =
|
|
2463
|
+
let r = e, i = t, { t: a } = J(), { syntax: o } = Z(), c = n(rt, null), u = S(() => !!c), d = rn();
|
|
2461
2464
|
async function f() {
|
|
2462
2465
|
let e = await c?.({ accept: ["images"] });
|
|
2463
2466
|
if (d.alive && e) {
|
|
@@ -2484,7 +2487,7 @@ var mi = {
|
|
|
2484
2487
|
}
|
|
2485
2488
|
}
|
|
2486
2489
|
}
|
|
2487
|
-
let { isOver: y } =
|
|
2490
|
+
let { isOver: y } = hi({
|
|
2488
2491
|
target: p,
|
|
2489
2492
|
enabled: h,
|
|
2490
2493
|
onFiles: g
|
|
@@ -2499,21 +2502,21 @@ var mi = {
|
|
|
2499
2502
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2500
2503
|
marginRight: e === "center" ? "auto" : void 0
|
|
2501
2504
|
};
|
|
2502
|
-
}), T = S(() =>
|
|
2505
|
+
}), T = S(() => H(r.block.src, o)), E = Mn(() => T.value ? void 0 : r.block.src), D = Mn(() => T.value ? r.block.placeholderUrl : void 0);
|
|
2503
2506
|
return (t, n) => (s(), C("div", {
|
|
2504
2507
|
ref_key: "dropZoneRef",
|
|
2505
2508
|
ref: p,
|
|
2506
2509
|
"data-testid": "image-drop-zone",
|
|
2507
2510
|
class: "tpl:relative tpl:w-full",
|
|
2508
2511
|
style: k(b.value)
|
|
2509
|
-
}, [h.value && (_(y) || m.value) ? (s(), C("div",
|
|
2512
|
+
}, [h.value && (_(y) || m.value) ? (s(), C("div", gi, [m.value ? (s(), C(L, { key: 0 }, [v(_(Kt), {
|
|
2510
2513
|
class: "tpl-spinner",
|
|
2511
2514
|
size: 20,
|
|
2512
2515
|
"stroke-width": 2
|
|
2513
|
-
}),
|
|
2516
|
+
}), B(" " + R(_(a).image.uploading), 1)], 64)) : (s(), C(L, { key: 1 }, [v(_(Jt), {
|
|
2514
2517
|
size: 20,
|
|
2515
2518
|
"stroke-width": 1.5
|
|
2516
|
-
}),
|
|
2519
|
+
}), B(" " + R(_(a).image.dropToUpload), 1)], 64))])) : w("", !0), e.block.src && T.value && e.block.placeholderUrl ? (s(), C(L, { key: 1 }, [e.block.linkUrl ? (s(), C("a", {
|
|
2517
2520
|
key: 0,
|
|
2518
2521
|
href: e.block.linkUrl,
|
|
2519
2522
|
target: "_blank",
|
|
@@ -2525,22 +2528,22 @@ var mi = {
|
|
|
2525
2528
|
src: _(D),
|
|
2526
2529
|
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2527
2530
|
style: k(x.value)
|
|
2528
|
-
}, null, 12,
|
|
2531
|
+
}, null, 12, vi)], 8, _i)) : (s(), C("img", {
|
|
2529
2532
|
key: 1,
|
|
2530
2533
|
class: "tpl:border-0",
|
|
2531
2534
|
src: _(D),
|
|
2532
2535
|
alt: e.block.alt,
|
|
2533
2536
|
style: k(x.value)
|
|
2534
|
-
}, null, 12,
|
|
2537
|
+
}, null, 12, yi))], 64)) : e.block.src && T.value ? (s(), C("div", {
|
|
2535
2538
|
key: 2,
|
|
2536
2539
|
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)]",
|
|
2537
2540
|
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, x.value])
|
|
2538
|
-
}, [v(_(
|
|
2541
|
+
}, [v(_(Wt), {
|
|
2539
2542
|
size: 32,
|
|
2540
2543
|
"stroke-width": 1.5,
|
|
2541
2544
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
2542
2545
|
style: { opacity: "0.5" }
|
|
2543
|
-
}), M("span",
|
|
2546
|
+
}), M("span", bi, [v(Dr, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (s(), C(L, { key: 3 }, [e.block.linkUrl ? (s(), C("a", {
|
|
2544
2547
|
key: 0,
|
|
2545
2548
|
href: e.block.linkUrl,
|
|
2546
2549
|
target: "_blank",
|
|
@@ -2552,33 +2555,33 @@ var mi = {
|
|
|
2552
2555
|
src: _(E),
|
|
2553
2556
|
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2554
2557
|
style: k(x.value)
|
|
2555
|
-
}, null, 12,
|
|
2558
|
+
}, null, 12, Si)], 8, xi)) : (s(), C("img", {
|
|
2556
2559
|
key: 1,
|
|
2557
2560
|
class: "tpl:border-0",
|
|
2558
2561
|
src: _(E),
|
|
2559
2562
|
alt: e.block.alt,
|
|
2560
2563
|
style: k(x.value)
|
|
2561
|
-
}, null, 12,
|
|
2564
|
+
}, null, 12, Ci))], 64)) : (s(), C("div", wi, [u.value ? (s(), C("button", {
|
|
2562
2565
|
key: 0,
|
|
2563
2566
|
"aria-label": _(a).image.browseMedia,
|
|
2564
2567
|
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:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
|
|
2565
2568
|
onClick: O(f, ["stop"])
|
|
2566
|
-
}, [v(_(
|
|
2569
|
+
}, [v(_(Wt), {
|
|
2567
2570
|
size: 14,
|
|
2568
2571
|
"stroke-width": 1.5
|
|
2569
|
-
}),
|
|
2572
|
+
}), B(" " + R(_(a).image.browseMedia), 1)], 8, Ti)) : (s(), C("span", Ei, R(_(a).image.clickToAdd), 1))]))], 4));
|
|
2570
2573
|
}
|
|
2571
|
-
}),
|
|
2574
|
+
}), Oi = { class: "tpl:w-full" }, ki = ["href"], Ai = {
|
|
2572
2575
|
key: 1,
|
|
2573
2576
|
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)]"
|
|
2574
|
-
},
|
|
2577
|
+
}, ji = /* @__PURE__ */ d({
|
|
2575
2578
|
__name: "MenuBlock",
|
|
2576
2579
|
props: {
|
|
2577
2580
|
block: {},
|
|
2578
2581
|
viewport: {}
|
|
2579
2582
|
},
|
|
2580
2583
|
setup(e) {
|
|
2581
|
-
let t = e, { t: n } =
|
|
2584
|
+
let t = e, { t: n } = J(), i = S(() => ({
|
|
2582
2585
|
display: "flex",
|
|
2583
2586
|
flexWrap: "wrap",
|
|
2584
2587
|
gap: `0 ${t.block.spacing}px`,
|
|
@@ -2590,7 +2593,7 @@ var mi = {
|
|
|
2590
2593
|
function o(e) {
|
|
2591
2594
|
return e || t.block.linkColor || t.block.color;
|
|
2592
2595
|
}
|
|
2593
|
-
return (t, c) => (s(), C("div",
|
|
2596
|
+
return (t, c) => (s(), C("div", Oi, [a.value ? (s(), C("div", {
|
|
2594
2597
|
key: 0,
|
|
2595
2598
|
style: k(i.value)
|
|
2596
2599
|
}, [(s(!0), C(L, null, r(e.block.items, (t, n) => (s(), C(L, { key: t.id }, [M("a", {
|
|
@@ -2602,15 +2605,15 @@ var mi = {
|
|
|
2602
2605
|
textDecoration: t.underline ? "underline" : "none"
|
|
2603
2606
|
}),
|
|
2604
2607
|
onClick: c[0] ||= O(() => {}, ["prevent"])
|
|
2605
|
-
}, [v(
|
|
2608
|
+
}, [v(Dr, { text: t.text || "..." }, null, 8, ["text"])], 12, ki), n < e.block.items.length - 1 ? (s(), C("span", {
|
|
2606
2609
|
key: 0,
|
|
2607
2610
|
style: k({
|
|
2608
2611
|
color: e.block.separatorColor,
|
|
2609
2612
|
padding: `0 ${e.block.spacing}px`
|
|
2610
2613
|
})
|
|
2611
|
-
}, R(e.block.separator), 5)) : w("", !0)], 64))), 128))], 4)) : (s(), C("div",
|
|
2614
|
+
}, R(e.block.separator), 5)) : w("", !0)], 64))), 128))], 4)) : (s(), C("div", Ai, [v(_(Ht), { size: 16 }), M("span", null, R(_(n).menu.addLinks), 1)]))]));
|
|
2612
2615
|
}
|
|
2613
|
-
}),
|
|
2616
|
+
}), Mi = /* @__PURE__ */ new Set([
|
|
2614
2617
|
"http",
|
|
2615
2618
|
"https",
|
|
2616
2619
|
"mailto",
|
|
@@ -2620,7 +2623,7 @@ var mi = {
|
|
|
2620
2623
|
"sms",
|
|
2621
2624
|
"xmpp",
|
|
2622
2625
|
"cid"
|
|
2623
|
-
]),
|
|
2626
|
+
]), Ni = /* @__PURE__ */ new Set([
|
|
2624
2627
|
"SCRIPT",
|
|
2625
2628
|
"STYLE",
|
|
2626
2629
|
"IFRAME",
|
|
@@ -2630,7 +2633,7 @@ var mi = {
|
|
|
2630
2633
|
"META",
|
|
2631
2634
|
"BASE",
|
|
2632
2635
|
"FORM"
|
|
2633
|
-
]),
|
|
2636
|
+
]), Pi = /* @__PURE__ */ new Set([
|
|
2634
2637
|
"href",
|
|
2635
2638
|
"xlink:href",
|
|
2636
2639
|
"formaction",
|
|
@@ -2639,16 +2642,16 @@ var mi = {
|
|
|
2639
2642
|
"background",
|
|
2640
2643
|
"poster"
|
|
2641
2644
|
]);
|
|
2642
|
-
function
|
|
2645
|
+
function Fi(e, t) {
|
|
2643
2646
|
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2644
2647
|
if (!n || n.startsWith("#")) return !0;
|
|
2645
2648
|
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
2646
2649
|
if (!r) return !0;
|
|
2647
2650
|
let i = r[1].toLowerCase();
|
|
2648
|
-
return
|
|
2651
|
+
return Mi.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
2649
2652
|
}
|
|
2650
|
-
function
|
|
2651
|
-
if (
|
|
2653
|
+
function Ii(e) {
|
|
2654
|
+
if (Ni.has(e.tagName)) {
|
|
2652
2655
|
e.remove();
|
|
2653
2656
|
return;
|
|
2654
2657
|
}
|
|
@@ -2660,29 +2663,29 @@ function Pi(e) {
|
|
|
2660
2663
|
e.removeAttribute(n);
|
|
2661
2664
|
continue;
|
|
2662
2665
|
}
|
|
2663
|
-
if (
|
|
2664
|
-
|
|
2666
|
+
if (Pi.has(t)) {
|
|
2667
|
+
Fi(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
2665
2668
|
continue;
|
|
2666
2669
|
}
|
|
2667
2670
|
if (t === "src") {
|
|
2668
|
-
|
|
2671
|
+
Fi(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
2669
2672
|
continue;
|
|
2670
2673
|
}
|
|
2671
2674
|
t === "srcdoc" && e.removeAttribute(n);
|
|
2672
2675
|
}
|
|
2673
2676
|
let n = Array.from(e.children);
|
|
2674
|
-
for (let e of n)
|
|
2677
|
+
for (let e of n) Ii(e);
|
|
2675
2678
|
}
|
|
2676
|
-
function
|
|
2679
|
+
function Li(e) {
|
|
2677
2680
|
if (typeof DOMParser > "u") return e;
|
|
2678
2681
|
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
2679
|
-
for (let e of n)
|
|
2682
|
+
for (let e of n) Ii(e);
|
|
2680
2683
|
return t.innerHTML;
|
|
2681
2684
|
}
|
|
2682
2685
|
//#endregion
|
|
2683
2686
|
//#region src/composables/useEditableTextBlock.ts
|
|
2684
|
-
function
|
|
2685
|
-
let t = n(
|
|
2687
|
+
function Ri(e) {
|
|
2688
|
+
let t = n(G, []), r = n(q, null), { syntax: i } = Z(), a = S(() => r?.value ? Se(e(), t) : De(e(), t)), o = S(() => Li(je(a.value, i))), s = l(!1), c = l(null), { top: u, left: d } = We(c), { toLocal: f } = Ft(), p = S(() => f({
|
|
2686
2689
|
top: u.value - 8,
|
|
2687
2690
|
left: d.value
|
|
2688
2691
|
}));
|
|
@@ -2703,14 +2706,14 @@ function Ii(e) {
|
|
|
2703
2706
|
}
|
|
2704
2707
|
//#endregion
|
|
2705
2708
|
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2706
|
-
var
|
|
2709
|
+
var zi = ["innerHTML"], Bi = /* @__PURE__ */ d({
|
|
2707
2710
|
__name: "ParagraphBlock",
|
|
2708
2711
|
props: {
|
|
2709
2712
|
block: {},
|
|
2710
2713
|
viewport: {}
|
|
2711
2714
|
},
|
|
2712
2715
|
setup(e) {
|
|
2713
|
-
let t = e, n =
|
|
2716
|
+
let t = e, n = z(() => import("./ParagraphEditor-DCDHMcmx.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = Ri(() => t.block.content);
|
|
2714
2717
|
return (t, u) => (s(), C("div", {
|
|
2715
2718
|
ref_key: "blockRef",
|
|
2716
2719
|
ref: i,
|
|
@@ -2729,54 +2732,54 @@ var Li = ["innerHTML"], Ri = /* @__PURE__ */ d({
|
|
|
2729
2732
|
key: 1,
|
|
2730
2733
|
class: "tpl-text-content tpl:outline-none",
|
|
2731
2734
|
innerHTML: _(o)
|
|
2732
|
-
}, null, 8,
|
|
2735
|
+
}, null, 8, zi))], 544));
|
|
2733
2736
|
}
|
|
2734
2737
|
});
|
|
2735
2738
|
//#endregion
|
|
2736
2739
|
//#region src/utils/blockComponentResolver.ts
|
|
2737
|
-
function
|
|
2740
|
+
function Vi(e) {
|
|
2738
2741
|
let t = { fontFamily: e.fontFamily };
|
|
2739
2742
|
return e.textColor && (t.color = e.textColor), e.linkColor && (t["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (t["--tpl-doc-link-underline"] = "underline"), t;
|
|
2740
2743
|
}
|
|
2741
|
-
function
|
|
2744
|
+
function Hi(e, t, n) {
|
|
2742
2745
|
if (t) {
|
|
2743
2746
|
let n = t.getComponent(e);
|
|
2744
2747
|
if (n) return n;
|
|
2745
2748
|
}
|
|
2746
2749
|
return n[e.type] ?? null;
|
|
2747
2750
|
}
|
|
2748
|
-
function
|
|
2751
|
+
function Ui(e) {
|
|
2749
2752
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
2750
2753
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
2751
2754
|
backgroundColor: n || "transparent"
|
|
2752
2755
|
};
|
|
2753
|
-
return (e.type === "paragraph" || e.type === "title") && (r["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ??
|
|
2756
|
+
return (e.type === "paragraph" || e.type === "title") && (r["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? Ne.paragraphGap : Ne.paragraphGap}px`), e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
2754
2757
|
}
|
|
2755
|
-
function
|
|
2758
|
+
function Wi(e) {
|
|
2756
2759
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
2757
2760
|
let t = e.wrapper, n = {};
|
|
2758
2761
|
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;
|
|
2759
2762
|
}
|
|
2760
2763
|
//#endregion
|
|
2761
2764
|
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
2762
|
-
var
|
|
2765
|
+
var Gi = [
|
|
2763
2766
|
"data-block-id",
|
|
2764
2767
|
"data-block-type",
|
|
2765
2768
|
"data-tpl-picked"
|
|
2766
|
-
],
|
|
2769
|
+
], Ki = ["aria-label"], qi = [
|
|
2767
2770
|
"aria-label",
|
|
2768
2771
|
"aria-pressed",
|
|
2769
2772
|
"title"
|
|
2770
|
-
],
|
|
2773
|
+
], Ji = ["aria-label", "title"], Yi = ["aria-label", "title"], Xi = ["aria-label", "title"], Zi = {
|
|
2771
2774
|
key: 1,
|
|
2772
2775
|
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"
|
|
2773
|
-
},
|
|
2776
|
+
}, Qi = { 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-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, $i = {
|
|
2774
2777
|
key: 2,
|
|
2775
2778
|
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
2776
|
-
},
|
|
2779
|
+
}, ea = ["aria-label", "title"], ta = {
|
|
2777
2780
|
key: 3,
|
|
2778
2781
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
2779
|
-
},
|
|
2782
|
+
}, na = ["aria-label"], ra = /*#__PURE__*/ tn(/* @__PURE__ */ d({
|
|
2780
2783
|
__name: "BlockWrapper",
|
|
2781
2784
|
props: {
|
|
2782
2785
|
block: {},
|
|
@@ -2788,7 +2791,7 @@ var Ui = [
|
|
|
2788
2791
|
},
|
|
2789
2792
|
emits: ["select"],
|
|
2790
2793
|
setup(e, { emit: t }) {
|
|
2791
|
-
let r =
|
|
2794
|
+
let r = z(() => import("./BlockIssueBadge-CloK4k3M.js")), i = e, o = t, { t: c, format: u } = J(), d = n(At, null), f = l(null), p = S(() => d?.liftedBlockId.value === i.block.id), m = S(() => p.value ? u(c.blockActions.dragLifted, { block: i.block.type }) : c.blockActions.drag);
|
|
2792
2795
|
async function h() {
|
|
2793
2796
|
await D(), f.value?.focus();
|
|
2794
2797
|
}
|
|
@@ -2814,20 +2817,20 @@ var Ui = [
|
|
|
2814
2817
|
let y = S(() => !i.viewport || !i.block.visibility ? !1 : i.block.visibility[i.viewport] === !1), x = S(() => i.previewMode === !0 && y.value), T = S(() => i.viewport ? {
|
|
2815
2818
|
desktop: c.viewport.desktop,
|
|
2816
2819
|
mobile: c.viewport.mobile
|
|
2817
|
-
}[i.viewport] ?? i.viewport : ""), E = S(() => !!i.block.displayCondition), A = n(
|
|
2818
|
-
function
|
|
2820
|
+
}[i.viewport] ?? i.viewport : ""), E = S(() => !!i.block.displayCondition), A = n(pt, null), j = n(gt, null), N = n(ht, {}), P = S(() => N.savedBlocks?.isPicking.value === !0), F = S(() => !i.nested && N.savedBlocks?.isAvailable.value === !0 && N.savedBlocks?.canCreate.value === !0), I = S(() => i.isSelected && !P.value), L = S(() => N.comments?.getBlockCount(i.block.id) ?? 0), ee = S(() => Ui(i.block)), te = S(() => Wi(i.block));
|
|
2821
|
+
function ne(e) {
|
|
2819
2822
|
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
|
|
2820
2823
|
}
|
|
2821
|
-
function
|
|
2824
|
+
function re() {
|
|
2822
2825
|
A?.deleteBlock(i.block.id);
|
|
2823
2826
|
}
|
|
2824
|
-
function
|
|
2827
|
+
function ie() {
|
|
2825
2828
|
A?.duplicateBlock(i.block);
|
|
2826
2829
|
}
|
|
2827
|
-
function
|
|
2830
|
+
function ae() {
|
|
2828
2831
|
N.savedBlocks?.startPicking(i.block.id);
|
|
2829
2832
|
}
|
|
2830
|
-
function
|
|
2833
|
+
function oe() {
|
|
2831
2834
|
j?.toggleBlock(i.block.id);
|
|
2832
2835
|
}
|
|
2833
2836
|
return (t, n) => x.value ? w("", !0) : (s(), C("div", {
|
|
@@ -2841,7 +2844,7 @@ var Ui = [
|
|
|
2841
2844
|
"data-block-id": e.block.id,
|
|
2842
2845
|
"data-block-type": e.block.type,
|
|
2843
2846
|
"data-tpl-picked": e.picked || void 0,
|
|
2844
|
-
onClick:
|
|
2847
|
+
onClick: ne
|
|
2845
2848
|
}, [
|
|
2846
2849
|
v(_(r), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
2847
2850
|
I.value ? (s(), C("div", {
|
|
@@ -2859,98 +2862,98 @@ var Ui = [
|
|
|
2859
2862
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2860
2863
|
title: _(c).blockActions.drag,
|
|
2861
2864
|
onKeydown: g
|
|
2862
|
-
}, [v(_(
|
|
2865
|
+
}, [v(_(Gt), {
|
|
2863
2866
|
size: 14,
|
|
2864
2867
|
"stroke-width": 1.5
|
|
2865
|
-
})], 40,
|
|
2868
|
+
})], 40, qi),
|
|
2866
2869
|
M("button", {
|
|
2867
2870
|
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",
|
|
2868
2871
|
"aria-label": _(c).blockActions.duplicate,
|
|
2869
2872
|
title: _(c).blockActions.duplicate,
|
|
2870
|
-
onClick: O(
|
|
2871
|
-
}, [v(_(
|
|
2873
|
+
onClick: O(ie, ["stop"])
|
|
2874
|
+
}, [v(_(Rt), {
|
|
2872
2875
|
size: 14,
|
|
2873
2876
|
"stroke-width": 1.5
|
|
2874
|
-
})], 8,
|
|
2877
|
+
})], 8, Ji),
|
|
2875
2878
|
F.value ? (s(), C("button", {
|
|
2876
2879
|
key: 0,
|
|
2877
2880
|
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",
|
|
2878
2881
|
"aria-label": _(c).blockActions.saveAsBlock,
|
|
2879
2882
|
title: _(c).blockActions.saveAsBlock,
|
|
2880
|
-
onClick: O(
|
|
2881
|
-
}, [v(_(
|
|
2883
|
+
onClick: O(ae, ["stop"])
|
|
2884
|
+
}, [v(_(Lt), {
|
|
2882
2885
|
size: 14,
|
|
2883
2886
|
"stroke-width": 1.5
|
|
2884
|
-
})], 8,
|
|
2887
|
+
})], 8, Yi)) : w("", !0),
|
|
2885
2888
|
M("button", {
|
|
2886
2889
|
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",
|
|
2887
2890
|
"aria-label": _(c).blockActions.delete,
|
|
2888
2891
|
title: _(c).blockActions.delete,
|
|
2889
|
-
onClick: O(
|
|
2890
|
-
}, [v(_(
|
|
2892
|
+
onClick: O(re, ["stop"])
|
|
2893
|
+
}, [v(_(Ut), {
|
|
2891
2894
|
size: 14,
|
|
2892
2895
|
"stroke-width": 1.5
|
|
2893
|
-
})], 8,
|
|
2894
|
-
], 8,
|
|
2895
|
-
y.value ? (s(), C("div",
|
|
2896
|
+
})], 8, Xi)
|
|
2897
|
+
], 8, Ki)) : w("", !0),
|
|
2898
|
+
y.value ? (s(), C("div", Zi, [M("span", Qi, [v(_(Vt), {
|
|
2896
2899
|
size: 12,
|
|
2897
2900
|
"stroke-width": 1.5
|
|
2898
|
-
}),
|
|
2899
|
-
E.value && !y.value ? (s(), C("div",
|
|
2901
|
+
}), B(" " + R(_(u)(_(c).blockActions.hiddenOnViewport, { viewport: T.value })), 1)])])) : w("", !0),
|
|
2902
|
+
E.value && !y.value ? (s(), C("div", $i, [M("button", {
|
|
2900
2903
|
"data-testid": "condition-toggle",
|
|
2901
2904
|
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:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
|
|
2902
2905
|
"aria-label": _(c).blockActions.conditionToggle,
|
|
2903
2906
|
title: e.block.displayCondition?.label,
|
|
2904
|
-
onClick: O(
|
|
2905
|
-
}, [v(_(
|
|
2907
|
+
onClick: O(oe, ["stop"])
|
|
2908
|
+
}, [v(_(Qt), {
|
|
2906
2909
|
size: 12,
|
|
2907
2910
|
"stroke-width": 2
|
|
2908
|
-
})], 8,
|
|
2909
|
-
L.value > 0 && !y.value ? (s(), C("div",
|
|
2911
|
+
})], 8, ea)])) : w("", !0),
|
|
2912
|
+
L.value > 0 && !y.value ? (s(), C("div", ta, [M("button", {
|
|
2910
2913
|
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:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]",
|
|
2911
2914
|
"aria-label": _(u)(_(c).blockActions.comments, { count: String(L.value) }),
|
|
2912
2915
|
onClick: n[0] ||= O((t) => _(N).comments?.openForBlock(e.block.id), ["stop"])
|
|
2913
|
-
}, [v(_(
|
|
2916
|
+
}, [v(_(Yt), {
|
|
2914
2917
|
size: 12,
|
|
2915
2918
|
"stroke-width": 2.5
|
|
2916
|
-
}),
|
|
2917
|
-
|
|
2919
|
+
}), B(" " + R(L.value), 1)], 8, na)])) : w("", !0),
|
|
2920
|
+
te.value ? (s(), C("div", {
|
|
2918
2921
|
key: 4,
|
|
2919
2922
|
class: "tpl-section-wrapper",
|
|
2920
|
-
style: k(
|
|
2923
|
+
style: k(te.value)
|
|
2921
2924
|
}, [M("div", {
|
|
2922
2925
|
class: "tpl-block-content",
|
|
2923
|
-
style: k(
|
|
2926
|
+
style: k(ee.value)
|
|
2924
2927
|
}, [a(t.$slots, "default", {}, void 0, !0)], 4)], 4)) : (s(), C("div", {
|
|
2925
2928
|
key: 5,
|
|
2926
2929
|
class: "tpl-block-content",
|
|
2927
|
-
style: k(
|
|
2930
|
+
style: k(ee.value)
|
|
2928
2931
|
}, [a(t.$slots, "default", {}, void 0, !0)], 4))
|
|
2929
|
-
], 10,
|
|
2932
|
+
], 10, Gi));
|
|
2930
2933
|
}
|
|
2931
2934
|
}), [["__scopeId", "data-v-2c239048"]]);
|
|
2932
2935
|
//#endregion
|
|
2933
2936
|
//#region src/utils/unwrapParagraph.ts
|
|
2934
|
-
function
|
|
2937
|
+
function ia(e) {
|
|
2935
2938
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2936
2939
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2937
2940
|
}
|
|
2938
2941
|
//#endregion
|
|
2939
2942
|
//#region src/components/blocks/TitleBlock.vue
|
|
2940
|
-
var
|
|
2943
|
+
var aa = /* @__PURE__ */ d({
|
|
2941
2944
|
__name: "TitleBlock",
|
|
2942
2945
|
props: {
|
|
2943
2946
|
block: {},
|
|
2944
2947
|
viewport: {}
|
|
2945
2948
|
},
|
|
2946
2949
|
setup(e) {
|
|
2947
|
-
let t = e, n =
|
|
2950
|
+
let t = e, n = z(() => import("./TitleEditor-BuCOahW3.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = Ri(() => t.block.content), d = S(() => {
|
|
2948
2951
|
let e = {
|
|
2949
|
-
fontSize: `${
|
|
2952
|
+
fontSize: `${ke[t.block.level]}px`,
|
|
2950
2953
|
textAlign: t.block.textAlign
|
|
2951
2954
|
};
|
|
2952
2955
|
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
2953
|
-
}), f = S(() => `h${t.block.level}`), p = S(() =>
|
|
2956
|
+
}), f = S(() => `h${t.block.level}`), p = S(() => ia(o.value));
|
|
2954
2957
|
return (t, o) => (s(), C("div", {
|
|
2955
2958
|
ref_key: "blockRef",
|
|
2956
2959
|
ref: i,
|
|
@@ -2976,16 +2979,16 @@ var ra = /* @__PURE__ */ d({
|
|
|
2976
2979
|
});
|
|
2977
2980
|
//#endregion
|
|
2978
2981
|
//#region src/utils/sectionColumnDrop.ts
|
|
2979
|
-
function
|
|
2982
|
+
function oa(e) {
|
|
2980
2983
|
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2981
2984
|
}
|
|
2982
2985
|
//#endregion
|
|
2983
2986
|
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2984
|
-
var
|
|
2987
|
+
var sa = { class: "tpl:w-full" }, ca = {
|
|
2985
2988
|
key: 0,
|
|
2986
2989
|
"data-testid": "section-drop-hint",
|
|
2987
2990
|
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-chrome-text-dim)]"
|
|
2988
|
-
},
|
|
2991
|
+
}, la = /* @__PURE__ */ d({
|
|
2989
2992
|
__name: "SectionBlock",
|
|
2990
2993
|
props: {
|
|
2991
2994
|
block: {},
|
|
@@ -2993,13 +2996,13 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
2993
2996
|
},
|
|
2994
2997
|
setup(e) {
|
|
2995
2998
|
let t = {
|
|
2996
|
-
title:
|
|
2997
|
-
paragraph:
|
|
2998
|
-
image:
|
|
2999
|
-
button:
|
|
3000
|
-
divider:
|
|
3001
|
-
custom:
|
|
3002
|
-
}, a = e, { t: o } =
|
|
2999
|
+
title: aa,
|
|
3000
|
+
paragraph: Bi,
|
|
3001
|
+
image: Di,
|
|
3002
|
+
button: kr,
|
|
3003
|
+
divider: si,
|
|
3004
|
+
custom: ai
|
|
3005
|
+
}, a = e, { t: o } = J(), c = $e(K, "SectionBlock"), l = n(gt, null), d = n(Et, null), p = n(ht, {}), m = n(Tt, null);
|
|
3003
3006
|
function h(e) {
|
|
3004
3007
|
let t = p.savedBlocks;
|
|
3005
3008
|
if (t?.isPicking.value) {
|
|
@@ -3034,7 +3037,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3034
3037
|
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
3035
3038
|
}
|
|
3036
3039
|
function D(e) {
|
|
3037
|
-
return
|
|
3040
|
+
return Hi(e, d, t);
|
|
3038
3041
|
}
|
|
3039
3042
|
function O(e, t) {
|
|
3040
3043
|
e.type === "custom" && c.updateBlock(e.id, {
|
|
@@ -3042,7 +3045,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3042
3045
|
dataSourceFetched: t.dataSourceFetched
|
|
3043
3046
|
});
|
|
3044
3047
|
}
|
|
3045
|
-
return (t, n) => (s(), C("div",
|
|
3048
|
+
return (t, n) => (s(), C("div", sa, [M("div", { class: b(["tpl:flex tpl:gap-0", { "tpl:flex-col": x.value }]) }, [(s(!0), C(L, null, r(y.value, (t, n) => (s(), C("div", {
|
|
3046
3049
|
key: n,
|
|
3047
3050
|
class: b(["tpl:relative tpl:min-h-[60px] tpl:rounded", T(n).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
3048
3051
|
style: k({ width: x.value ? "100%" : g.value[n] })
|
|
@@ -3051,7 +3054,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3051
3054
|
group: {
|
|
3052
3055
|
name: "blocks",
|
|
3053
3056
|
pull: !0,
|
|
3054
|
-
put: (e, t, n) => _(
|
|
3057
|
+
put: (e, t, n) => _(oa)(n)
|
|
3055
3058
|
},
|
|
3056
3059
|
animation: 150,
|
|
3057
3060
|
"ghost-class": "tpl-ghost",
|
|
@@ -3064,7 +3067,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3064
3067
|
class: "tpl:min-h-[60px]",
|
|
3065
3068
|
"onUpdate:modelValue": (e) => E(n, e)
|
|
3066
3069
|
}, {
|
|
3067
|
-
default: i(() => [(s(!0), C(L, null, r(T(n), (t) => f((s(), C("div", { key: t.id }, [v(
|
|
3070
|
+
default: i(() => [(s(!0), C(L, null, r(T(n), (t) => f((s(), C("div", { key: t.id }, [v(ra, {
|
|
3068
3071
|
block: t,
|
|
3069
3072
|
"is-selected": _(c).state.selectedBlockId === t.id,
|
|
3070
3073
|
viewport: e.viewport,
|
|
@@ -3096,13 +3099,13 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3096
3099
|
"model-value",
|
|
3097
3100
|
"group",
|
|
3098
3101
|
"onUpdate:modelValue"
|
|
3099
|
-
]), T(n).length === 0 ? (s(), C("div",
|
|
3102
|
+
]), T(n).length === 0 ? (s(), C("div", ca, [M("span", null, R(_(o).section.dropHere), 1)])) : w("", !0)], 6))), 128))], 2)]));
|
|
3100
3103
|
}
|
|
3101
|
-
}),
|
|
3104
|
+
}), ua = Fe, da = {
|
|
3102
3105
|
small: 24,
|
|
3103
3106
|
medium: 32,
|
|
3104
3107
|
large: 48
|
|
3105
|
-
},
|
|
3108
|
+
}, fa = [
|
|
3106
3109
|
"facebook",
|
|
3107
3110
|
"twitter",
|
|
3108
3111
|
"instagram",
|
|
@@ -3120,11 +3123,11 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3120
3123
|
"github",
|
|
3121
3124
|
"dribbble",
|
|
3122
3125
|
"behance"
|
|
3123
|
-
],
|
|
3126
|
+
], pa = [
|
|
3124
3127
|
"width",
|
|
3125
3128
|
"height",
|
|
3126
3129
|
"fill"
|
|
3127
|
-
],
|
|
3130
|
+
], ma = ["d"], ha = /* @__PURE__ */ d({
|
|
3128
3131
|
__name: "SocialIconSvg",
|
|
3129
3132
|
props: {
|
|
3130
3133
|
platform: {},
|
|
@@ -3132,7 +3135,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3132
3135
|
iconSize: {}
|
|
3133
3136
|
},
|
|
3134
3137
|
setup(e) {
|
|
3135
|
-
let t = e, n = S(() =>
|
|
3138
|
+
let t = e, n = S(() => ua[t.platform]), r = S(() => da[t.iconSize]), i = S(() => {
|
|
3136
3139
|
let e = {
|
|
3137
3140
|
display: "inline-flex",
|
|
3138
3141
|
alignItems: "center",
|
|
@@ -3176,25 +3179,25 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3176
3179
|
viewBox: "0 0 24 24",
|
|
3177
3180
|
fill: o.value,
|
|
3178
3181
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3179
|
-
}, [M("path", { d: n.value.path }, null, 8,
|
|
3182
|
+
}, [M("path", { d: n.value.path }, null, 8, ma)], 8, pa))], 4));
|
|
3180
3183
|
}
|
|
3181
|
-
}),
|
|
3184
|
+
}), ga = { class: "tpl:w-full" }, _a = ["href"], va = {
|
|
3182
3185
|
key: 1,
|
|
3183
3186
|
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)]"
|
|
3184
|
-
},
|
|
3187
|
+
}, ya = /* @__PURE__ */ d({
|
|
3185
3188
|
__name: "SocialIconsBlock",
|
|
3186
3189
|
props: {
|
|
3187
3190
|
block: {},
|
|
3188
3191
|
viewport: {}
|
|
3189
3192
|
},
|
|
3190
3193
|
setup(e) {
|
|
3191
|
-
let t = e, { t: n } =
|
|
3194
|
+
let t = e, { t: n } = J(), i = S(() => ({
|
|
3192
3195
|
display: "flex",
|
|
3193
3196
|
flexWrap: "wrap",
|
|
3194
3197
|
gap: `${t.block.spacing}px`,
|
|
3195
3198
|
justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
|
|
3196
3199
|
})), a = S(() => t.block.icons.length > 0);
|
|
3197
|
-
return (t, o) => (s(), C("div",
|
|
3200
|
+
return (t, o) => (s(), C("div", ga, [a.value ? (s(), C("div", {
|
|
3198
3201
|
key: 0,
|
|
3199
3202
|
style: k(i.value)
|
|
3200
3203
|
}, [(s(!0), C(L, null, r(e.block.icons, (t) => (s(), C("a", {
|
|
@@ -3202,7 +3205,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3202
3205
|
href: t.url || "#",
|
|
3203
3206
|
class: "tpl:cursor-default",
|
|
3204
3207
|
onClick: o[0] ||= O(() => {}, ["prevent"])
|
|
3205
|
-
}, [v(
|
|
3208
|
+
}, [v(ha, {
|
|
3206
3209
|
platform: t.platform,
|
|
3207
3210
|
"icon-style": e.block.iconStyle,
|
|
3208
3211
|
"icon-size": e.block.iconSize
|
|
@@ -3210,44 +3213,44 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3210
3213
|
"platform",
|
|
3211
3214
|
"icon-style",
|
|
3212
3215
|
"icon-size"
|
|
3213
|
-
])], 8,
|
|
3216
|
+
])], 8, _a))), 128))], 4)) : (s(), C("div", va, [v(_(It), { size: 16 }), M("span", null, R(_(n).social.addIcons), 1)]))]));
|
|
3214
3217
|
}
|
|
3215
|
-
}),
|
|
3218
|
+
}), ba = { class: "tpl:w-full" }, xa = {
|
|
3216
3219
|
key: 0,
|
|
3217
3220
|
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3218
3221
|
style: {
|
|
3219
3222
|
"background-color": "var(--tpl-bg-hover)",
|
|
3220
3223
|
color: "var(--tpl-text-dim)"
|
|
3221
3224
|
}
|
|
3222
|
-
},
|
|
3225
|
+
}, Sa = /* @__PURE__ */ d({
|
|
3223
3226
|
__name: "SpacerBlock",
|
|
3224
3227
|
props: {
|
|
3225
3228
|
block: {},
|
|
3226
3229
|
viewport: {}
|
|
3227
3230
|
},
|
|
3228
3231
|
setup(e) {
|
|
3229
|
-
let t = e, n = $e(
|
|
3232
|
+
let t = e, n = $e(K, "SpacerBlock"), r = S(() => ({
|
|
3230
3233
|
height: `${t.block.height}px`,
|
|
3231
3234
|
minHeight: `${t.block.height}px`,
|
|
3232
3235
|
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3233
3236
|
}));
|
|
3234
|
-
return (t, i) => (s(), C("div",
|
|
3237
|
+
return (t, i) => (s(), C("div", ba, [M("div", {
|
|
3235
3238
|
style: k(r.value),
|
|
3236
3239
|
class: b(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !_(n).state.previewMode }])
|
|
3237
|
-
}, [_(n).state.previewMode ? w("", !0) : (s(), C("span",
|
|
3240
|
+
}, [_(n).state.previewMode ? w("", !0) : (s(), C("span", xa, R(e.block.height) + "px ", 1))], 6)]));
|
|
3238
3241
|
}
|
|
3239
|
-
}),
|
|
3242
|
+
}), Ca = { class: "tpl:w-full" }, wa = { key: 0 }, Ta = [
|
|
3240
3243
|
"aria-label",
|
|
3241
3244
|
"data-placeholder",
|
|
3242
3245
|
"onBlur"
|
|
3243
|
-
],
|
|
3246
|
+
], Ea = [
|
|
3244
3247
|
"aria-label",
|
|
3245
3248
|
"data-placeholder",
|
|
3246
3249
|
"onBlur"
|
|
3247
|
-
],
|
|
3250
|
+
], Da = {
|
|
3248
3251
|
key: 1,
|
|
3249
3252
|
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)]"
|
|
3250
|
-
},
|
|
3253
|
+
}, Oa = /*#__PURE__*/ tn(/* @__PURE__ */ d({
|
|
3251
3254
|
__name: "TableBlock",
|
|
3252
3255
|
props: {
|
|
3253
3256
|
block: {},
|
|
@@ -3261,7 +3264,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3261
3264
|
updated(e, t) {
|
|
3262
3265
|
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
3263
3266
|
}
|
|
3264
|
-
}, n = e, { t: i } =
|
|
3267
|
+
}, n = e, { t: i } = J(), a = $e(K, "TableBlock"), o = S(() => n.block.rows.length > 0), c = S(() => {
|
|
3265
3268
|
let e = {
|
|
3266
3269
|
width: "100%",
|
|
3267
3270
|
borderCollapse: "collapse",
|
|
@@ -3292,11 +3295,11 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3292
3295
|
} : n);
|
|
3293
3296
|
a.updateBlock(n.block.id, { rows: o });
|
|
3294
3297
|
}
|
|
3295
|
-
return (e, n) => (s(), C("div",
|
|
3298
|
+
return (e, n) => (s(), C("div", Ca, [o.value ? (s(), C("table", {
|
|
3296
3299
|
key: 0,
|
|
3297
3300
|
style: k(c.value),
|
|
3298
3301
|
class: "tpl-table-editable"
|
|
3299
|
-
}, [d.value ? (s(), C("thead",
|
|
3302
|
+
}, [d.value ? (s(), C("thead", wa, [M("tr", null, [(s(!0), C(L, null, r(d.value.cells, (e) => f((s(), C("th", {
|
|
3300
3303
|
key: e.id,
|
|
3301
3304
|
style: k(u.value),
|
|
3302
3305
|
"aria-label": _(i).table.cellPlaceholder,
|
|
@@ -3305,7 +3308,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3305
3308
|
onBlur: (t) => h(d.value.id, e.id, t),
|
|
3306
3309
|
onKeydown: n[0] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3307
3310
|
onClick: O(m, ["stop"])
|
|
3308
|
-
}, null, 44,
|
|
3311
|
+
}, null, 44, Ta)), [[t, e.content]])), 128))])])) : w("", !0), M("tbody", null, [(s(!0), C(L, null, r(p.value, (e) => (s(), C("tr", { key: e.id }, [(s(!0), C(L, null, r(e.cells, (r) => f((s(), C("td", {
|
|
3309
3312
|
key: r.id,
|
|
3310
3313
|
style: k(l.value),
|
|
3311
3314
|
"aria-label": _(i).table.cellPlaceholder,
|
|
@@ -3314,9 +3317,9 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3314
3317
|
onBlur: (t) => h(e.id, r.id, t),
|
|
3315
3318
|
onKeydown: n[1] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3316
3319
|
onClick: O(m, ["stop"])
|
|
3317
|
-
}, null, 44,
|
|
3320
|
+
}, null, 44, Ea)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), C("div", Da, [v(_(Zt), { size: 16 }), M("span", null, R(_(i).table.empty), 1)]))]));
|
|
3318
3321
|
}
|
|
3319
|
-
}), [["__scopeId", "data-v-963ac422"]]),
|
|
3322
|
+
}), [["__scopeId", "data-v-963ac422"]]), ka = /* @__PURE__ */ d({
|
|
3320
3323
|
__name: "VideoPlayButton",
|
|
3321
3324
|
props: { hoverEffect: {
|
|
3322
3325
|
type: Boolean,
|
|
@@ -3334,7 +3337,7 @@ var aa = { class: "tpl:w-full" }, oa = {
|
|
|
3334
3337
|
});
|
|
3335
3338
|
//#endregion
|
|
3336
3339
|
//#region src/utils/videoThumbnail.ts
|
|
3337
|
-
function
|
|
3340
|
+
function Aa(e) {
|
|
3338
3341
|
if (!e) return {
|
|
3339
3342
|
platform: "unknown",
|
|
3340
3343
|
videoId: null,
|
|
@@ -3366,25 +3369,25 @@ function Oa(e) {
|
|
|
3366
3369
|
thumbnailUrl: null
|
|
3367
3370
|
};
|
|
3368
3371
|
}
|
|
3369
|
-
function
|
|
3370
|
-
return t ||
|
|
3372
|
+
function ja(e, t) {
|
|
3373
|
+
return t || Aa(e).thumbnailUrl;
|
|
3371
3374
|
}
|
|
3372
3375
|
//#endregion
|
|
3373
3376
|
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3374
|
-
var
|
|
3377
|
+
var Ma = ["src", "alt"], Na = {
|
|
3375
3378
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
3376
3379
|
style: { opacity: "0.7" }
|
|
3377
|
-
},
|
|
3380
|
+
}, Pa = ["href"], Fa = ["src", "alt"], Ia = ["src", "alt"], La = {
|
|
3378
3381
|
key: 3,
|
|
3379
3382
|
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)]"
|
|
3380
|
-
},
|
|
3383
|
+
}, Ra = /* @__PURE__ */ d({
|
|
3381
3384
|
__name: "VideoBlock",
|
|
3382
3385
|
props: {
|
|
3383
3386
|
block: {},
|
|
3384
3387
|
viewport: {}
|
|
3385
3388
|
},
|
|
3386
3389
|
setup(e) {
|
|
3387
|
-
let t = e, { t: n } =
|
|
3390
|
+
let t = e, { t: n } = J(), { syntax: r } = Z(), i = S(() => H(t.block.url, r) || H(t.block.thumbnailUrl, r)), a = Mn(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = Mn(() => i.value ? t.block.placeholderUrl : void 0), c = S(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : ja(t.block.url)), l = S(() => ({ textAlign: t.block.align })), u = S(() => {
|
|
3388
3391
|
let e = t.block.align;
|
|
3389
3392
|
return {
|
|
3390
3393
|
maxWidth: "100%",
|
|
@@ -3394,7 +3397,7 @@ var Aa = ["src", "alt"], ja = {
|
|
|
3394
3397
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
3395
3398
|
marginRight: e === "center" ? "auto" : void 0
|
|
3396
3399
|
};
|
|
3397
|
-
}), d = S(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = S(() =>
|
|
3400
|
+
}), d = S(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = S(() => H(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
3398
3401
|
return (t, r) => (s(), C("div", {
|
|
3399
3402
|
class: "tpl:w-full",
|
|
3400
3403
|
style: k(l.value)
|
|
@@ -3407,16 +3410,16 @@ var Aa = ["src", "alt"], ja = {
|
|
|
3407
3410
|
src: _(o),
|
|
3408
3411
|
alt: e.block.alt,
|
|
3409
3412
|
style: k(d.value)
|
|
3410
|
-
}, null, 12,
|
|
3413
|
+
}, null, 12, Ma), v(ka)], 4)) : i.value ? (s(), C("div", {
|
|
3411
3414
|
key: 1,
|
|
3412
3415
|
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)]",
|
|
3413
3416
|
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
3414
|
-
}, [v(_(
|
|
3417
|
+
}, [v(_(qt), {
|
|
3415
3418
|
size: 36,
|
|
3416
3419
|
"stroke-width": 1.5,
|
|
3417
3420
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
3418
3421
|
style: { opacity: "0.5" }
|
|
3419
|
-
}), M("span",
|
|
3422
|
+
}), M("span", Na, [v(Dr, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (s(), C(L, { key: 2 }, [e.block.url ? (s(), C("a", {
|
|
3420
3423
|
key: 0,
|
|
3421
3424
|
href: e.block.url,
|
|
3422
3425
|
target: "_blank",
|
|
@@ -3429,7 +3432,7 @@ var Aa = ["src", "alt"], ja = {
|
|
|
3429
3432
|
src: c.value,
|
|
3430
3433
|
alt: e.block.alt,
|
|
3431
3434
|
style: k(d.value)
|
|
3432
|
-
}, null, 12,
|
|
3435
|
+
}, null, 12, Fa), v(ka, { "hover-effect": "" })], 12, Pa)) : (s(), C("div", {
|
|
3433
3436
|
key: 1,
|
|
3434
3437
|
class: "tpl:relative tpl:inline-block",
|
|
3435
3438
|
style: k(u.value)
|
|
@@ -3438,51 +3441,51 @@ var Aa = ["src", "alt"], ja = {
|
|
|
3438
3441
|
src: c.value,
|
|
3439
3442
|
alt: e.block.alt,
|
|
3440
3443
|
style: k(d.value)
|
|
3441
|
-
}, null, 12,
|
|
3444
|
+
}, null, 12, Ia), v(ka)], 4))], 64)) : (s(), C("div", La, [v(_(qt), {
|
|
3442
3445
|
size: 40,
|
|
3443
3446
|
"stroke-width": 1.5,
|
|
3444
3447
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
3445
3448
|
}), M("span", null, R(_(n).video.addVideo), 1)]))], 4));
|
|
3446
3449
|
}
|
|
3447
|
-
}),
|
|
3448
|
-
section:
|
|
3449
|
-
title:
|
|
3450
|
-
paragraph:
|
|
3451
|
-
image:
|
|
3452
|
-
button:
|
|
3453
|
-
divider:
|
|
3454
|
-
video:
|
|
3455
|
-
social:
|
|
3456
|
-
menu:
|
|
3457
|
-
table:
|
|
3458
|
-
spacer:
|
|
3459
|
-
html:
|
|
3460
|
-
countdown:
|
|
3450
|
+
}), za = {
|
|
3451
|
+
section: la,
|
|
3452
|
+
title: aa,
|
|
3453
|
+
paragraph: Bi,
|
|
3454
|
+
image: Di,
|
|
3455
|
+
button: kr,
|
|
3456
|
+
divider: si,
|
|
3457
|
+
video: Ra,
|
|
3458
|
+
social: ya,
|
|
3459
|
+
menu: ji,
|
|
3460
|
+
table: Oa,
|
|
3461
|
+
spacer: Sa,
|
|
3462
|
+
html: pi,
|
|
3463
|
+
countdown: z(() => import("./CountdownBlock-rK055jpy.js"))
|
|
3461
3464
|
};
|
|
3462
|
-
function
|
|
3463
|
-
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } =
|
|
3465
|
+
function Ba(e) {
|
|
3466
|
+
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } = J(i), d = S(() => ge(ge(nr(i), xr(n.content.value.settings?.locale)), r.blockDefaults ?? {}));
|
|
3464
3467
|
n.setUiTheme(r.uiTheme ?? "auto");
|
|
3465
|
-
let { resolvedTheme: f } =
|
|
3468
|
+
let { resolvedTheme: f } = Bn(S(() => n.state.uiTheme)), p = l(r.theme ?? {}), { themeStyles: m } = Hn({
|
|
3466
3469
|
themeOverrides: p,
|
|
3467
3470
|
resolvedTheme: f,
|
|
3468
3471
|
extraStyles: () => ({
|
|
3469
3472
|
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
3470
3473
|
...e.themeExtraStyles?.()
|
|
3471
3474
|
})
|
|
3472
|
-
}), g =
|
|
3475
|
+
}), g = fn({
|
|
3473
3476
|
content: n.content,
|
|
3474
3477
|
setContent: (e, t) => n.setContent(e, t),
|
|
3475
3478
|
...e.historyOptions
|
|
3476
3479
|
});
|
|
3477
|
-
|
|
3478
|
-
let _ =
|
|
3480
|
+
yn(n, g);
|
|
3481
|
+
let _ = mn({
|
|
3479
3482
|
addBlock: n.addBlock,
|
|
3480
3483
|
removeBlock: n.removeBlock,
|
|
3481
3484
|
updateBlock: n.updateBlock,
|
|
3482
3485
|
selectBlock: n.selectBlock,
|
|
3483
3486
|
findBlockLocation: n.findBlockLocation,
|
|
3484
3487
|
blockDefaults: () => d.value
|
|
3485
|
-
}), v =
|
|
3488
|
+
}), v = _n(n), y = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? gn({
|
|
3486
3489
|
content: n.content,
|
|
3487
3490
|
isDirty: () => n.state.isDirty,
|
|
3488
3491
|
...e.autoSaveOptions
|
|
@@ -3490,30 +3493,30 @@ function Ra(e) {
|
|
|
3490
3493
|
y && (b = t(g.isNavigating, (e) => {
|
|
3491
3494
|
e ? y.pause() : y.resume();
|
|
3492
3495
|
}));
|
|
3493
|
-
let x =
|
|
3496
|
+
let x = zn(n, {
|
|
3494
3497
|
t: s,
|
|
3495
3498
|
format: u
|
|
3496
|
-
}, r.customBlocks ?? []), C =
|
|
3497
|
-
if (C.allowCustomIgnored &&
|
|
3498
|
-
let e =
|
|
3499
|
-
e.length > 0 &&
|
|
3500
|
-
}
|
|
3501
|
-
let w =
|
|
3502
|
-
for (let e of w.unknown)
|
|
3503
|
-
let T =
|
|
3504
|
-
|
|
3499
|
+
}, r.customBlocks ?? []), C = Pt(r.colors);
|
|
3500
|
+
if (C.allowCustomIgnored && Y.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), C.invalidPresets.length > 0 && Y.warn(`config.colors.presets skipped invalid entries: ${C.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), C.allowCustom === !1) {
|
|
3501
|
+
let e = tr(C.presets, r.blockDefaults, r.templateDefaults);
|
|
3502
|
+
e.length > 0 && Y.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.`);
|
|
3503
|
+
}
|
|
3504
|
+
let w = $n(r.templateSettings);
|
|
3505
|
+
for (let e of w.unknown) Y.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${Zn.join(", ")}) — skipping it.`);
|
|
3506
|
+
let T = Un();
|
|
3507
|
+
Jn(T, za);
|
|
3505
3508
|
let E = /* @__PURE__ */ new Set();
|
|
3506
3509
|
function D(e) {
|
|
3507
3510
|
for (let t of e) {
|
|
3508
|
-
T.registerCustom(t,
|
|
3509
|
-
for (let e of
|
|
3511
|
+
T.registerCustom(t, ai);
|
|
3512
|
+
for (let e of Cr(t, C)) E.has(e.id) || (E.add(e.id), Y.warn(e.message));
|
|
3510
3513
|
}
|
|
3511
3514
|
}
|
|
3512
3515
|
r.customBlocks?.length && D(r.customBlocks);
|
|
3513
|
-
let O =
|
|
3516
|
+
let O = On();
|
|
3514
3517
|
if (o() && h(O.dispose), e.containerEl) {
|
|
3515
3518
|
let t = e.containerEl;
|
|
3516
|
-
|
|
3519
|
+
W(document, "pointerdown", (e) => {
|
|
3517
3520
|
let n = t.value;
|
|
3518
3521
|
n && (e.composedPath?.() ?? []).includes(n) && O.claim();
|
|
3519
3522
|
}, { capture: !0 });
|
|
@@ -3527,7 +3530,7 @@ function Ra(e) {
|
|
|
3527
3530
|
y?.flush();
|
|
3528
3531
|
}
|
|
3529
3532
|
function A(t) {
|
|
3530
|
-
O.isActive() &&
|
|
3533
|
+
O.isActive() && Tr(t, {
|
|
3531
3534
|
history: g,
|
|
3532
3535
|
selectBlock: (e) => n.selectBlock(e),
|
|
3533
3536
|
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
@@ -3539,31 +3542,31 @@ function Ra(e) {
|
|
|
3539
3542
|
onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
|
|
3540
3543
|
});
|
|
3541
3544
|
}
|
|
3542
|
-
|
|
3545
|
+
W(document, "keydown", A);
|
|
3543
3546
|
let j = l(null);
|
|
3544
|
-
c(
|
|
3545
|
-
let M =
|
|
3546
|
-
c(
|
|
3547
|
-
let N = l(
|
|
3548
|
-
c(
|
|
3549
|
-
let P =
|
|
3547
|
+
c(vt, e.editorRoot ?? document), c(Qe, j), c(dt, i), c(K, n), c(Ot, g), c(pt, _), c(gt, v), c(ft, a), c(lt, m), c(et, f), c(Ct, d), c(Xe, r.locale), c(Et, T), c(_t, r.customBlocks ?? []), c(Ye, r.paletteBlocks), c(jt, Yn(r.htmlBlockPreview)), c(Dt, C), c(Ze, w.fields), c(wt, Wn(n.content, T));
|
|
3548
|
+
let M = Ce(r.mergeTags?.syntax);
|
|
3549
|
+
c(G, r.mergeTags?.tags ?? []), c(yt, M), c(at, r.mergeTags?.onRequest ?? null), c(Je, r.mergeTags?.autocomplete !== !1);
|
|
3550
|
+
let N = l(Ie(r.mergeTags?.tags ?? []));
|
|
3551
|
+
c(Ke, N);
|
|
3552
|
+
let P = An({
|
|
3550
3553
|
resolvePreview: r.resolvePreview,
|
|
3551
3554
|
getContent: () => n.content.value,
|
|
3552
3555
|
isActive: () => n.state.previewMode
|
|
3553
3556
|
});
|
|
3554
|
-
c(
|
|
3557
|
+
c(tt, P), c(ot, r.resolvePreview);
|
|
3555
3558
|
let F = S(() => !(n.state.previewMode && P.isConfigured));
|
|
3556
|
-
c(
|
|
3557
|
-
let I =
|
|
3558
|
-
c(
|
|
3559
|
-
let L =
|
|
3559
|
+
c(Tt, F);
|
|
3560
|
+
let I = Nn();
|
|
3561
|
+
c(it, I), c(bt, l(!1)), c(ct, l(!1)), c(qe, r.logicTags?.tags ?? []), c(st, r.logicTags?.pairs ?? []), c(nt, r.logicTags?.onRequest ?? null), c(kt, Pn()), c(rt, r.onRequestMedia ?? null), c(mt, r.resolveImageUrl ? jn(r.resolveImageUrl) : null), c(xt, r.displayConditions?.conditions ?? []), c(St, r.displayConditions?.allowCustom ?? !1), c(ht, e.capabilities ?? {}), c(At, x);
|
|
3562
|
+
let L = Fn(r.lint) ? null : In({
|
|
3560
3563
|
content: n.content,
|
|
3561
3564
|
options: r.lint ?? {},
|
|
3562
3565
|
updateBlock: n.updateBlock,
|
|
3563
3566
|
updateSettings: n.updateSettings,
|
|
3564
3567
|
removeBlock: n.removeBlock
|
|
3565
3568
|
});
|
|
3566
|
-
c(
|
|
3569
|
+
c(ut, L);
|
|
3567
3570
|
function R() {
|
|
3568
3571
|
b?.(), L?.destroy(), y?.destroy(), g.destroy();
|
|
3569
3572
|
}
|
|
@@ -3589,6 +3592,6 @@ function Ra(e) {
|
|
|
3589
3592
|
};
|
|
3590
3593
|
}
|
|
3591
3594
|
//#endregion
|
|
3592
|
-
export {
|
|
3595
|
+
export { ur as A, Ln as B, Vr as C, Mr as D, Pr as E, mr as F, Sn as G, Tn as H, pr as I, hn as J, bn as K, Zn as L, _r as M, gr as N, kr as O, hr as P, Xn as R, Kr as S, Fr as T, wn as U, An as V, Cn as W, cn as Y, pi as _, ya as a, Xr as b, aa as c, Vi as d, Hi as f, hi as g, Di as h, Sa as i, vr as j, Sr as k, ra as l, ji as m, Ra as n, fa as o, Bi as p, vn as q, Oa as r, la as s, Ba as t, Ui as u, si as v, Br as w, Jr as x, ai as y, Rn as z };
|
|
3593
3596
|
|
|
3594
|
-
//# sourceMappingURL=useEditorCore-
|
|
3597
|
+
//# sourceMappingURL=useEditorCore-ehUSEsbw.js.map
|