@templatical/editor 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-ftdKHSR-.js → AiChatSidebar-CkHJ28sf.js} +3 -3
- package/dist/{AiFeatureMenu-aNeCRlil.js → AiFeatureMenu-DWdKguDN.js} +3 -3
- package/dist/{BlockIssueBadge-bTDu6W_2.js → BlockIssueBadge-DcyHTAqw.js} +2 -2
- package/dist/{BlockPreviewCanvas-BsOuOfzB.js → BlockPreviewCanvas-B621ANn9.js} +4 -4
- package/dist/{CloudHeaderExtras-BNpFohqt.js → CloudHeaderExtras-BJ3Cebhv.js} +2 -2
- package/dist/{CloudPanels-xoGWwqSH.js → CloudPanels-BGz9ygo6.js} +6 -6
- package/dist/{CollaboratorBar-mEqXkdEi.js → CollaboratorBar-KphmSQeZ.js} +2 -2
- package/dist/{ColorPicker-FL5Vb9bE.js → ColorPicker-C6EOwtHC.js} +5 -5
- package/dist/{CommentsPanel-slfi74ng.js → CommentsPanel-DmWh8f08.js} +1 -1
- package/dist/{CommentsSidebar-Dea4spMl.js → CommentsSidebar-CL_tffzT.js} +4 -4
- package/dist/{CountdownBlock-DQTwaRxP.js → CountdownBlock-D1fsNsyS.js} +1 -1
- package/dist/{CountdownToolbar-C7xwJoqh.js → CountdownToolbar-B8J4i5Xp.js} +2 -2
- package/dist/{DesignReferenceSidebar-BtBd7bbz.js → DesignReferenceSidebar-BDhEeaAh.js} +4 -4
- package/dist/{IssuesPanel-Ci2H36L2.js → IssuesPanel-CiOjeRFI.js} +4 -4
- package/dist/MergeTagInput-RytOlh1A.js +448 -0
- package/dist/{MergeTagModeToggle-Cdi_DmVw.js → MergeTagModeToggle-Bi-FydXj.js} +2 -2
- package/dist/{ParagraphEditor-DQEOFc0K.js → ParagraphEditor-C87tkmtE.js} +12 -12
- package/dist/{RestoreVersionDialog-CHwngBae.js → RestoreVersionDialog-Db5rZRMA.js} +2 -2
- package/dist/RichTextEditorContent-BmTcV2-a.js +152 -0
- package/dist/{SaveBlockDialog-tZqZzPjW.js → SaveBlockDialog-CDCzx6Bo.js} +15 -15
- package/dist/{SavedBlocksBrowserModal-Bdj3GOD_.js → SavedBlocksBrowserModal-DQR6kJB1.js} +101 -101
- package/dist/{SavedBlocksPanels-2sBxAH9w.js → SavedBlocksPanels-DFzV0CRD.js} +1 -1
- package/dist/{SavedBlocksPickBar-DTjQBR00.js → SavedBlocksPickBar-XyXmnSnO.js} +2 -2
- package/dist/{TemplateScoringPanel-B6nHSrBD.js → TemplateScoringPanel-CpyEKMzC.js} +4 -4
- package/dist/{TestEmailModal-DuHbzO37.js → TestEmailModal-DIfJy9eE.js} +8 -8
- package/dist/{TestEmailPanel-TpwP-eK_.js → TestEmailPanel-C8Wx5yPS.js} +1 -1
- package/dist/{TitleEditor-C0JQJu38.js → TitleEditor-iNFOisr4.js} +11 -11
- package/dist/{TplModal-BMGmhquu.js → TplModal-CowM3o_F.js} +5 -5
- package/dist/{VersionHistoryMenu-D2x6MMYx.js → VersionHistoryMenu-CV90OhXs.js} +2 -2
- package/dist/{VersionHistoryPanels-aGlUVEGF.js → VersionHistoryPanels-BE3pplJG.js} +1 -1
- package/dist/{VersionPreviewBanner-61t3_Z-a.js → VersionPreviewBanner-BwUWBtlH.js} +1 -1
- package/dist/{blockTypeIcons-BsNup009.js → blockTypeIcons-DQsKtHik.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-CqWvtRwB.js → AiChatSidebar-BEnIWn6s.js} +4 -4
- package/dist/cdn/chunks/AiChatSidebar-BEnIWn6s.js.map +1 -0
- package/dist/cdn/chunks/{AiFeatureMenu-DoFrLcXJ.js → AiFeatureMenu-DMl23akc.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-DoFrLcXJ.js.map → AiFeatureMenu-DMl23akc.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-B_mUH69a.js → BlockIssueBadge-CloK4k3M.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-B_mUH69a.js.map → BlockIssueBadge-CloK4k3M.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-CSIxs7hr.js → BlockPreviewCanvas-DSiJFJa0.js} +5 -5
- package/dist/cdn/chunks/{BlockPreviewCanvas-CSIxs7hr.js.map → BlockPreviewCanvas-DSiJFJa0.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-Dgtr7WaE.js → CloudHeaderExtras-b4KpVeUN.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-Dgtr7WaE.js.map → CloudHeaderExtras-b4KpVeUN.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-B91lUmof.js → CloudPanels-DzwOq9lp.js} +7 -7
- package/dist/cdn/chunks/CloudPanels-DzwOq9lp.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-CQwPWoFu.js → CollaboratorBar-WXKvpoGK.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-CQwPWoFu.js.map → CollaboratorBar-WXKvpoGK.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-CdrKX48J.js → ColorPicker-BubTDiS1.js} +6 -6
- package/dist/cdn/chunks/{ColorPicker-CdrKX48J.js.map → ColorPicker-BubTDiS1.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-BJNgTmAA.js → CommentsPanel-DAA2VqX4.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-BJNgTmAA.js.map → CommentsPanel-DAA2VqX4.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-D6VIIPhB.js → CommentsSidebar-Ci0M2ePp.js} +5 -5
- package/dist/cdn/chunks/CommentsSidebar-Ci0M2ePp.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BRwXUvGU.js → CountdownBlock-rK055jpy.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-BRwXUvGU.js.map → CountdownBlock-rK055jpy.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CVaU5WG6.js → CountdownToolbar-CzZq26Vp.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-CVaU5WG6.js.map → CountdownToolbar-CzZq26Vp.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-BvOwE1kg.js → DesignReferenceSidebar-C_ehdX5C.js} +5 -5
- package/dist/cdn/chunks/DesignReferenceSidebar-C_ehdX5C.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-MJZxkScz.js → IssuesPanel-BXAN2_al.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-MJZxkScz.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-bNuN6PTV.js → MergeTagModeToggle-B_mUYJo4.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-bNuN6PTV.js.map → MergeTagModeToggle-B_mUYJo4.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-BU8tlFbL.js → ParagraphEditor-DCDHMcmx.js} +10 -10
- package/dist/cdn/chunks/ParagraphEditor-DCDHMcmx.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-vdRFfyy0.js → RestoreVersionDialog-BkSSwf-Q.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-vdRFfyy0.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-DWaeqcM8.js → SaveBlockDialog-BH774Nt0.js} +14 -14
- package/dist/cdn/chunks/{SaveBlockDialog-DWaeqcM8.js.map → SaveBlockDialog-BH774Nt0.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-qC7UhW74.js → SavedBlocksBrowserModal-CSUqw_dD.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-qC7UhW74.js.map → SavedBlocksBrowserModal-CSUqw_dD.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-BvtjtdsY.js → SavedBlocksPanels-B6ApbCjG.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-BvtjtdsY.js.map → SavedBlocksPanels-B6ApbCjG.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-CxXjF3RN.js → SavedBlocksPickBar-C9MXSRcR.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-CxXjF3RN.js.map → SavedBlocksPickBar-C9MXSRcR.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-CroWaWqy.js → TemplateScoringPanel-QVOxc9TZ.js} +50 -50
- package/dist/cdn/chunks/TemplateScoringPanel-QVOxc9TZ.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-iWxAZRRq.js → TestEmailModal-_CZvaO58.js} +9 -9
- package/dist/cdn/chunks/{TestEmailModal-iWxAZRRq.js.map → TestEmailModal-_CZvaO58.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CGUtEuwp.js → TestEmailPanel-DXLxvyrD.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CGUtEuwp.js.map → TestEmailPanel-DXLxvyrD.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DvXUW2j-.js → TitleEditor-BuCOahW3.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-BuCOahW3.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-X-qNoLGZ.js → TplModal-CqY8R3hn.js} +6 -6
- package/dist/cdn/chunks/TplModal-CqY8R3hn.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryMenu-yKzwxf7n.js → VersionHistoryMenu-DDjIBvad.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryMenu-yKzwxf7n.js.map → VersionHistoryMenu-DDjIBvad.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels--hQaanjH.js → VersionHistoryPanels-BuTw04T5.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels--hQaanjH.js.map → VersionHistoryPanels-BuTw04T5.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-DWU_SqMd.js → VersionPreviewBanner-fGAv20qI.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-DWU_SqMd.js.map → VersionPreviewBanner-fGAv20qI.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-DD6ppb71.js → createCloudRuntime-JFE-sxbT.js} +2 -2
- package/dist/cdn/chunks/{createCloudRuntime-DD6ppb71.js.map → createCloudRuntime-JFE-sxbT.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-BUPHNpKD.js → extensions-7z04EIGg.js} +3 -3
- package/dist/cdn/chunks/{extensions-BUPHNpKD.js.map → extensions-7z04EIGg.js.map} +1 -1
- package/dist/cdn/chunks/keys-DQp8x7Nx.js +12 -0
- package/dist/cdn/chunks/keys-DQp8x7Nx.js.map +1 -0
- package/dist/cdn/chunks/src-CLoCCDfs.js.map +1 -1
- package/dist/cdn/chunks/{src-DtnvR_Hl.js → src-CiAi5oRe.js} +2 -2
- package/dist/cdn/chunks/{src-DtnvR_Hl.js.map → src-CiAi5oRe.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-DbsLlCbZ.js → useCloudI18n-MxgHWrV6.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-DbsLlCbZ.js.map → useCloudI18n-MxgHWrV6.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-ChlgO2GN.js → useEditorCore-ehUSEsbw.js} +548 -511
- package/dist/cdn/chunks/useEditorCore-ehUSEsbw.js.map +1 -0
- package/dist/cdn/chunks/{useEditorRoot-BlF1WPeu.js → useEditorRoot-CteADR3y.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-BlF1WPeu.js.map → useEditorRoot-CteADR3y.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-BdxNNw6j.js → useI18n-Ct1VIFcf.js} +2 -2
- package/dist/cdn/chunks/{useI18n-BdxNNw6j.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-Dw1nTSNx.js → usePopoverPosition-BxVWE5_0.js} +2 -2
- package/dist/cdn/chunks/{usePopoverPosition-Dw1nTSNx.js.map → usePopoverPosition-BxVWE5_0.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-BMis3-PR.js → useScrollToBlock-Cz3fpgTK.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-BMis3-PR.js.map → useScrollToBlock-Cz3fpgTK.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1722 -2071
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{createCloudRuntime-zNcMjRgb.js → createCloudRuntime-DbTFm1ES.js} +1 -1
- package/dist/{extensions-kOYwOh72.js → extensions-Mf8iHey9.js} +2 -2
- package/dist/index.d.ts +41 -0
- package/dist/keys-C3P1yxnr.js +10 -0
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1890 -2240
- package/dist/{useCloudI18n-BlMajbKp.js → useCloudI18n-BKoiYsWZ.js} +1 -1
- package/dist/{useEditorCore-CwQYCSXO.js → useEditorCore-DdkQuTHl.js} +1101 -1064
- package/dist/{useEditorRoot-C92q8uV-.js → useEditorRoot-DkRGTQRs.js} +1 -1
- package/dist/{useI18n-Ce_BRzYv.js → useI18n-CL6RfPzK.js} +1 -1
- package/dist/useMergeTag-gSuYus-M.js +44 -0
- package/dist/{usePopoverPosition-CPk7Twye.js → usePopoverPosition-CWxaIWd3.js} +1 -1
- package/dist/{useScrollToBlock-DvpMfWs2.js → useScrollToBlock-CdI8fGqt.js} +1 -1
- package/package.json +7 -7
- package/dist/RichTextEditorContent-C_9xi7dD.js +0 -153
- package/dist/cdn/chunks/AiChatSidebar-CqWvtRwB.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-B91lUmof.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-D6VIIPhB.js.map +0 -1
- package/dist/cdn/chunks/DesignReferenceSidebar-BvOwE1kg.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-BU8tlFbL.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-C1-5I8Df.js +0 -123
- package/dist/cdn/chunks/RichTextEditorContent-C1-5I8Df.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-CroWaWqy.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-DvXUW2j-.js.map +0 -1
- package/dist/cdn/chunks/TplModal-X-qNoLGZ.js.map +0 -1
- package/dist/cdn/chunks/keys-BOn5i9jV.js +0 -12
- package/dist/cdn/chunks/keys-BOn5i9jV.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-ChlgO2GN.js.map +0 -1
- package/dist/cdn/chunks/useMergeTag-CI2WUNrR.js +0 -46
- package/dist/cdn/chunks/useMergeTag-CI2WUNrR.js.map +0 -1
- package/dist/keys-BOhFlHsv.js +0 -10
- package/dist/scan-line-E7w4yQyv.js +0 -31
- package/dist/useMergeTag-CrXJ49lr.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 an(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 an(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 an(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 an(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 ln(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 ln(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 dn(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 pn(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 mn(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 hn(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 gn(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 _n(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 _n(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 yn(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 yn(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 bn(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 xn(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 xn(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 xn(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 Sn(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 Tn() {
|
|
|
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 Dn(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 Dn(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 Dn(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 On(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 kn(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 An() {
|
|
|
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 jn() {
|
|
|
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 Nn(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 In(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 In(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 Rn = {
|
|
|
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 zn({ 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 Bn() {
|
|
|
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 Bn() {
|
|
|
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 Bn() {
|
|
|
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 Vn(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,33 +1471,65 @@ function Gn(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
|
+
//#region src/utils/templateSettingsFields.ts
|
|
1479
|
+
var Xn = {
|
|
1480
|
+
width: "layout",
|
|
1481
|
+
backgroundColor: "appearance",
|
|
1482
|
+
textColor: "appearance",
|
|
1483
|
+
linkColor: "appearance",
|
|
1484
|
+
linkUnderline: "appearance",
|
|
1485
|
+
fontFamily: "appearance",
|
|
1486
|
+
locale: "language",
|
|
1487
|
+
preheaderText: "preheader"
|
|
1488
|
+
}, Zn = Object.keys(Xn);
|
|
1489
|
+
function Qn(e) {
|
|
1490
|
+
return Object.prototype.hasOwnProperty.call(Xn, e);
|
|
1491
|
+
}
|
|
1492
|
+
function $n(e) {
|
|
1493
|
+
let t = e?.fields;
|
|
1494
|
+
if (t === void 0 || t === !0) return {
|
|
1495
|
+
fields: new Set(Zn),
|
|
1496
|
+
unknown: []
|
|
1497
|
+
};
|
|
1498
|
+
if (t === !1) return {
|
|
1499
|
+
fields: /* @__PURE__ */ new Set(),
|
|
1500
|
+
unknown: []
|
|
1501
|
+
};
|
|
1502
|
+
let n = /* @__PURE__ */ new Set(), r = [];
|
|
1503
|
+
for (let e of t) Qn(e) ? n.add(e) : r.push(String(e));
|
|
1504
|
+
return {
|
|
1505
|
+
fields: n,
|
|
1506
|
+
unknown: r
|
|
1507
|
+
};
|
|
1508
|
+
}
|
|
1509
|
+
//#endregion
|
|
1478
1510
|
//#region src/utils/collectOffPaletteDefaults.ts
|
|
1479
|
-
function
|
|
1511
|
+
function er(e) {
|
|
1480
1512
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1481
1513
|
}
|
|
1482
|
-
function
|
|
1483
|
-
let r = new Set(e.map((e) =>
|
|
1484
|
-
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}`);
|
|
1485
1517
|
}, o = t;
|
|
1486
|
-
for (let [e, t] of Object.entries(
|
|
1518
|
+
for (let [e, t] of Object.entries(Re)) {
|
|
1487
1519
|
let n = o?.[e];
|
|
1488
1520
|
a({
|
|
1489
1521
|
...t,
|
|
1490
|
-
...
|
|
1522
|
+
...er(n) ? n : {}
|
|
1491
1523
|
}, e);
|
|
1492
1524
|
}
|
|
1493
1525
|
return a({
|
|
1494
|
-
...
|
|
1526
|
+
...ne,
|
|
1495
1527
|
...n ?? {}
|
|
1496
1528
|
}, "template"), i;
|
|
1497
1529
|
}
|
|
1498
1530
|
//#endregion
|
|
1499
1531
|
//#region src/utils/localizedBlockDefaults.ts
|
|
1500
|
-
function
|
|
1532
|
+
function nr(e) {
|
|
1501
1533
|
return {
|
|
1502
1534
|
title: { content: `<p>${e.blockDefaults.title}</p>` },
|
|
1503
1535
|
paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
|
|
@@ -1506,7 +1538,7 @@ function Yn(e) {
|
|
|
1506
1538
|
}
|
|
1507
1539
|
//#endregion
|
|
1508
1540
|
//#region src/i18n/index.ts
|
|
1509
|
-
var
|
|
1541
|
+
var rr = /* #__PURE__ */ Object.assign({
|
|
1510
1542
|
"./locales/ca.ts": () => import("./ca-C0hfqt4U.js"),
|
|
1511
1543
|
"./locales/de.ts": () => import("./de-C6J2Iae8.js"),
|
|
1512
1544
|
"./locales/en.ts": () => import("./en-BaUYOQi8.js"),
|
|
@@ -1514,50 +1546,50 @@ var Xn = /* #__PURE__ */ Object.assign({
|
|
|
1514
1546
|
"./locales/fr.ts": () => import("./fr-L8DR73mK.js"),
|
|
1515
1547
|
"./locales/nl.ts": () => import("./nl-GDWeuX18.js"),
|
|
1516
1548
|
"./locales/pt-BR.ts": () => import("./pt-BR-B1AVVhWj.js")
|
|
1517
|
-
}),
|
|
1549
|
+
}), ir = /* #__PURE__ */ Object.assign({
|
|
1518
1550
|
"./locales/cloud/de.ts": () => import("./de-BytZwgn6.js"),
|
|
1519
1551
|
"./locales/cloud/en.ts": () => import("./en-DyOSV0lY.js"),
|
|
1520
1552
|
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-C1WLSGDh.js")
|
|
1521
1553
|
});
|
|
1522
|
-
function
|
|
1554
|
+
function ar(e) {
|
|
1523
1555
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
1524
1556
|
}
|
|
1525
|
-
var
|
|
1526
|
-
function
|
|
1557
|
+
var or = ar(rr), sr = ar(ir);
|
|
1558
|
+
function cr(e) {
|
|
1527
1559
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
1528
1560
|
}
|
|
1529
|
-
function
|
|
1530
|
-
let n =
|
|
1531
|
-
return t.find((e) =>
|
|
1561
|
+
function lr(e, t) {
|
|
1562
|
+
let n = cr(e);
|
|
1563
|
+
return t.find((e) => cr(e) === n);
|
|
1532
1564
|
}
|
|
1533
|
-
function
|
|
1534
|
-
return
|
|
1565
|
+
function ur(e) {
|
|
1566
|
+
return cr(e).split("-")[0];
|
|
1535
1567
|
}
|
|
1536
|
-
function
|
|
1537
|
-
return
|
|
1568
|
+
function dr(e, t) {
|
|
1569
|
+
return lr(e, t) ?? lr(ur(e), t);
|
|
1538
1570
|
}
|
|
1539
|
-
function
|
|
1540
|
-
return
|
|
1571
|
+
function fr(e, t) {
|
|
1572
|
+
return dr(e, t) ?? "en";
|
|
1541
1573
|
}
|
|
1542
|
-
async function
|
|
1543
|
-
let t =
|
|
1574
|
+
async function pr(e) {
|
|
1575
|
+
let t = rr[`./locales/${fr(e, or)}.ts`];
|
|
1544
1576
|
return (await t()).default;
|
|
1545
1577
|
}
|
|
1546
|
-
async function
|
|
1547
|
-
let t =
|
|
1578
|
+
async function mr(e) {
|
|
1579
|
+
let t = ir[`./locales/cloud/${fr(e, sr)}.ts`];
|
|
1548
1580
|
return (await t()).default;
|
|
1549
1581
|
}
|
|
1550
|
-
function
|
|
1551
|
-
return
|
|
1582
|
+
function hr(e) {
|
|
1583
|
+
return dr(e, or) !== void 0;
|
|
1552
1584
|
}
|
|
1553
|
-
function
|
|
1554
|
-
return
|
|
1585
|
+
function gr(e) {
|
|
1586
|
+
return dr(e, sr) !== void 0;
|
|
1555
1587
|
}
|
|
1556
|
-
function
|
|
1557
|
-
return [
|
|
1588
|
+
function _r() {
|
|
1589
|
+
return [...or];
|
|
1558
1590
|
}
|
|
1559
|
-
function
|
|
1560
|
-
return [...
|
|
1591
|
+
function vr() {
|
|
1592
|
+
return [...sr];
|
|
1561
1593
|
}
|
|
1562
1594
|
//#endregion
|
|
1563
1595
|
//#region src/i18n/contentDefaults.ts
|
|
@@ -1618,16 +1650,16 @@ var $ = {
|
|
|
1618
1650
|
seconds: "Segons",
|
|
1619
1651
|
expired: "Aquesta oferta ha caducat"
|
|
1620
1652
|
}
|
|
1621
|
-
},
|
|
1622
|
-
function
|
|
1653
|
+
}, yr = new Map(Object.keys($).map((e) => [e.toLowerCase(), e]));
|
|
1654
|
+
function br(e) {
|
|
1623
1655
|
if (!e) return $.en;
|
|
1624
|
-
let t = e.trim().replace(/_/g, "-").toLowerCase(), n =
|
|
1656
|
+
let t = e.trim().replace(/_/g, "-").toLowerCase(), n = yr.get(t);
|
|
1625
1657
|
if (n) return $[n];
|
|
1626
|
-
let r =
|
|
1658
|
+
let r = yr.get(ur(t));
|
|
1627
1659
|
return r ? $[r] : $.en;
|
|
1628
1660
|
}
|
|
1629
|
-
function
|
|
1630
|
-
let t =
|
|
1661
|
+
function xr(e) {
|
|
1662
|
+
let t = br(e);
|
|
1631
1663
|
return {
|
|
1632
1664
|
video: { alt: t.video },
|
|
1633
1665
|
countdown: {
|
|
@@ -1641,8 +1673,8 @@ function mr(e) {
|
|
|
1641
1673
|
}
|
|
1642
1674
|
//#endregion
|
|
1643
1675
|
//#region src/utils/resolveFieldColors.ts
|
|
1644
|
-
function
|
|
1645
|
-
let n =
|
|
1676
|
+
function Sr(e, t) {
|
|
1677
|
+
let n = Pt({ presets: e.presets }, Mt), r = n.presets.length === 0;
|
|
1646
1678
|
return {
|
|
1647
1679
|
presets: r ? t.presets : n.presets,
|
|
1648
1680
|
allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
|
|
@@ -1654,9 +1686,9 @@ function hr(e, t) {
|
|
|
1654
1686
|
}
|
|
1655
1687
|
//#endregion
|
|
1656
1688
|
//#region src/utils/collectColorFieldIssues.ts
|
|
1657
|
-
function
|
|
1689
|
+
function Cr(e, t) {
|
|
1658
1690
|
let n = [], r = (r, i) => {
|
|
1659
|
-
let a =
|
|
1691
|
+
let a = Sr(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
1660
1692
|
if (a.invalidPresets.length > 0 && n.push({
|
|
1661
1693
|
id: s("invalid-presets"),
|
|
1662
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." : "")
|
|
@@ -1667,8 +1699,8 @@ function gr(e, t) {
|
|
|
1667
1699
|
id: s("allow-custom-ignored"),
|
|
1668
1700
|
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
1669
1701
|
}), !a.allowCustom && a.presets.length > 0) {
|
|
1670
|
-
let e = r.default ?? "", t = new Set(a.presets.map((e) =>
|
|
1671
|
-
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({
|
|
1672
1704
|
id: s("off-palette-default"),
|
|
1673
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.`
|
|
1674
1706
|
});
|
|
@@ -1680,7 +1712,7 @@ function gr(e, t) {
|
|
|
1680
1712
|
}
|
|
1681
1713
|
//#endregion
|
|
1682
1714
|
//#region src/utils/keyboardShortcuts.ts
|
|
1683
|
-
function
|
|
1715
|
+
function wr(e) {
|
|
1684
1716
|
for (let t of e.composedPath()) {
|
|
1685
1717
|
if (!(t instanceof HTMLElement)) continue;
|
|
1686
1718
|
if (t.isContentEditable) return !0;
|
|
@@ -1689,18 +1721,18 @@ function _r(e) {
|
|
|
1689
1721
|
}
|
|
1690
1722
|
return !1;
|
|
1691
1723
|
}
|
|
1692
|
-
function
|
|
1724
|
+
function Tr(e, t) {
|
|
1693
1725
|
let n = e.metaKey || e.ctrlKey;
|
|
1694
1726
|
if (n && e.key.toLowerCase() === "s") {
|
|
1695
1727
|
e.preventDefault(), t.onSave?.();
|
|
1696
1728
|
return;
|
|
1697
1729
|
}
|
|
1698
1730
|
if (n && e.key.toLowerCase() === "z") {
|
|
1699
|
-
if (
|
|
1731
|
+
if (wr(e)) return;
|
|
1700
1732
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
1701
1733
|
return;
|
|
1702
1734
|
}
|
|
1703
|
-
if (t.isPicking?.() && !
|
|
1735
|
+
if (t.isPicking?.() && !wr(e)) {
|
|
1704
1736
|
if (e.key === "Escape") {
|
|
1705
1737
|
e.preventDefault(), t.onCancelPick?.();
|
|
1706
1738
|
return;
|
|
@@ -1718,11 +1750,11 @@ function vr(e, t) {
|
|
|
1718
1750
|
t.selectBlock(null);
|
|
1719
1751
|
return;
|
|
1720
1752
|
}
|
|
1721
|
-
(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()));
|
|
1722
1754
|
}
|
|
1723
1755
|
//#endregion
|
|
1724
1756
|
//#region src/utils/mergeTagLabelSegments.ts
|
|
1725
|
-
function
|
|
1757
|
+
function Er(e, t, n, r = !1) {
|
|
1726
1758
|
if (!e) return [];
|
|
1727
1759
|
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
1728
1760
|
for (; (s = i.exec(e)) !== null;) {
|
|
@@ -1731,18 +1763,18 @@ function yr(e, t, n, r = !1) {
|
|
|
1731
1763
|
value: e.slice(o, s.index)
|
|
1732
1764
|
});
|
|
1733
1765
|
let i = s[0];
|
|
1734
|
-
if (
|
|
1735
|
-
let e = r ?
|
|
1766
|
+
if (xe(i, n)) {
|
|
1767
|
+
let e = r ? Pe(i, t) : void 0;
|
|
1736
1768
|
a.push(e === void 0 ? {
|
|
1737
1769
|
type: "tag",
|
|
1738
|
-
value:
|
|
1770
|
+
value: Ae(i, t)
|
|
1739
1771
|
} : {
|
|
1740
1772
|
type: "text",
|
|
1741
1773
|
value: e
|
|
1742
1774
|
});
|
|
1743
|
-
} else
|
|
1775
|
+
} else be(i, n) ? a.push({
|
|
1744
1776
|
type: "tag",
|
|
1745
|
-
value:
|
|
1777
|
+
value: ve(i, n)
|
|
1746
1778
|
}) : a.push({
|
|
1747
1779
|
type: "text",
|
|
1748
1780
|
value: i
|
|
@@ -1756,20 +1788,20 @@ function yr(e, t, n, r = !1) {
|
|
|
1756
1788
|
}
|
|
1757
1789
|
//#endregion
|
|
1758
1790
|
//#region src/components/MergeTagPreviewText.vue
|
|
1759
|
-
var
|
|
1791
|
+
var Dr = d({
|
|
1760
1792
|
name: "MergeTagPreviewText",
|
|
1761
1793
|
props: { text: {
|
|
1762
1794
|
type: String,
|
|
1763
1795
|
required: !0
|
|
1764
1796
|
} },
|
|
1765
1797
|
setup(e) {
|
|
1766
|
-
let t = n(
|
|
1767
|
-
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", {
|
|
1768
1800
|
key: t,
|
|
1769
1801
|
class: "tpl-merge-tag-label"
|
|
1770
1802
|
}, e.value) : e.value);
|
|
1771
1803
|
}
|
|
1772
|
-
}),
|
|
1804
|
+
}), Or = ["href"], kr = /* @__PURE__ */ d({
|
|
1773
1805
|
__name: "ButtonBlock",
|
|
1774
1806
|
props: {
|
|
1775
1807
|
block: {},
|
|
@@ -1795,13 +1827,13 @@ var br = d({
|
|
|
1795
1827
|
style: k(n.value),
|
|
1796
1828
|
class: "tpl:cursor-default",
|
|
1797
1829
|
onClick: i[0] ||= O(() => {}, ["prevent"])
|
|
1798
|
-
}, [v(
|
|
1830
|
+
}, [v(Dr, { text: e.block.text }, null, 8, ["text"])], 12, Or)], 4));
|
|
1799
1831
|
}
|
|
1800
|
-
}),
|
|
1832
|
+
}), Ar = ["innerHTML"], jr = [
|
|
1801
1833
|
"src",
|
|
1802
1834
|
"width",
|
|
1803
1835
|
"height"
|
|
1804
|
-
],
|
|
1836
|
+
], Mr = /* @__PURE__ */ d({
|
|
1805
1837
|
__name: "CustomBlockIcon",
|
|
1806
1838
|
props: {
|
|
1807
1839
|
icon: {},
|
|
@@ -1817,24 +1849,24 @@ var br = d({
|
|
|
1817
1849
|
height: `${n.value}px`
|
|
1818
1850
|
}),
|
|
1819
1851
|
innerHTML: e.icon
|
|
1820
|
-
}, null, 12,
|
|
1852
|
+
}, null, 12, Ar)) : i.value ? (s(), C("img", {
|
|
1821
1853
|
key: 1,
|
|
1822
1854
|
src: e.icon,
|
|
1823
1855
|
width: n.value,
|
|
1824
1856
|
height: n.value,
|
|
1825
1857
|
class: "tpl:inline-block",
|
|
1826
1858
|
alt: ""
|
|
1827
|
-
}, null, 8,
|
|
1859
|
+
}, null, 8, jr)) : (s(), A(_($t), {
|
|
1828
1860
|
key: 2,
|
|
1829
1861
|
size: n.value,
|
|
1830
1862
|
"stroke-width": 1.5
|
|
1831
1863
|
}, null, 8, ["size"]));
|
|
1832
1864
|
}
|
|
1833
|
-
}),
|
|
1834
|
-
function
|
|
1835
|
-
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;
|
|
1836
1868
|
function s() {
|
|
1837
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
1869
|
+
return e.value ? Array.from(e.value.querySelectorAll(Nr)).filter((e) => e.offsetParent !== null) : [];
|
|
1838
1870
|
}
|
|
1839
1871
|
function c(e) {
|
|
1840
1872
|
if (e.key !== "Tab") return;
|
|
@@ -1849,7 +1881,7 @@ function Dr(e, n) {
|
|
|
1849
1881
|
o = null;
|
|
1850
1882
|
let t = s();
|
|
1851
1883
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
1852
|
-
}), a =
|
|
1884
|
+
}), a = W(e, "keydown", c);
|
|
1853
1885
|
}
|
|
1854
1886
|
function u(e = {}) {
|
|
1855
1887
|
let t = e.restoreFocus !== !1;
|
|
@@ -1864,8 +1896,8 @@ function Dr(e, n) {
|
|
|
1864
1896
|
}
|
|
1865
1897
|
//#endregion
|
|
1866
1898
|
//#region src/composables/useEmoji.ts
|
|
1867
|
-
function
|
|
1868
|
-
let [e, n] =
|
|
1899
|
+
function Fr() {
|
|
1900
|
+
let [e, n] = Ve(!1), r = x([]), i = !1;
|
|
1869
1901
|
h(() => {
|
|
1870
1902
|
i = !0;
|
|
1871
1903
|
}), t(e, async (e) => {
|
|
@@ -1890,7 +1922,7 @@ function Or() {
|
|
|
1890
1922
|
}
|
|
1891
1923
|
//#endregion
|
|
1892
1924
|
//#region src/composables/useFonts.ts
|
|
1893
|
-
var
|
|
1925
|
+
var Ir = [
|
|
1894
1926
|
{
|
|
1895
1927
|
value: "Arial",
|
|
1896
1928
|
label: "Arial"
|
|
@@ -1919,7 +1951,7 @@ var kr = [
|
|
|
1919
1951
|
value: "Courier New",
|
|
1920
1952
|
label: "Courier New"
|
|
1921
1953
|
}
|
|
1922
|
-
],
|
|
1954
|
+
], Lr = {
|
|
1923
1955
|
arial: "Arial, sans-serif",
|
|
1924
1956
|
helvetica: "Helvetica, sans-serif",
|
|
1925
1957
|
georgia: "Georgia, serif",
|
|
@@ -1927,23 +1959,23 @@ var kr = [
|
|
|
1927
1959
|
verdana: "Verdana, sans-serif",
|
|
1928
1960
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1929
1961
|
"courier new": "'Courier New', monospace"
|
|
1930
|
-
},
|
|
1931
|
-
function
|
|
1932
|
-
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];
|
|
1933
1965
|
if (e === !1) return [];
|
|
1934
1966
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1935
1967
|
for (let i of e) {
|
|
1936
|
-
let e = i.toLowerCase(), a =
|
|
1968
|
+
let e = i.toLowerCase(), a = Ir.find((t) => t.value.toLowerCase() === e);
|
|
1937
1969
|
if (!a) {
|
|
1938
|
-
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(", ")}.`));
|
|
1939
1971
|
continue;
|
|
1940
1972
|
}
|
|
1941
1973
|
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1942
1974
|
}
|
|
1943
1975
|
return t;
|
|
1944
1976
|
}
|
|
1945
|
-
function
|
|
1946
|
-
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(() => {
|
|
1947
1979
|
let e = [...r], n = t.value.map((e) => ({
|
|
1948
1980
|
value: e.name,
|
|
1949
1981
|
label: e.name,
|
|
@@ -1954,20 +1986,20 @@ function Nr(e) {
|
|
|
1954
1986
|
function s(e) {
|
|
1955
1987
|
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1956
1988
|
}
|
|
1957
|
-
let c = e?.defaultFont ??
|
|
1958
|
-
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.`);
|
|
1959
1991
|
function u() {
|
|
1960
1992
|
if (e?.defaultFont && s(e.defaultFont)) {
|
|
1961
1993
|
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1962
1994
|
if (t) return t.value;
|
|
1963
1995
|
}
|
|
1964
|
-
return
|
|
1996
|
+
return Rr;
|
|
1965
1997
|
}
|
|
1966
1998
|
let d = S(() => u());
|
|
1967
1999
|
function f(e) {
|
|
1968
2000
|
if (!e) return i.value;
|
|
1969
2001
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1970
|
-
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}`);
|
|
1971
2003
|
}
|
|
1972
2004
|
let p = [], m = !1;
|
|
1973
2005
|
async function g() {
|
|
@@ -1983,7 +2015,7 @@ function Nr(e) {
|
|
|
1983
2015
|
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1984
2016
|
});
|
|
1985
2017
|
} catch (t) {
|
|
1986
|
-
|
|
2018
|
+
Y.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1987
2019
|
}
|
|
1988
2020
|
});
|
|
1989
2021
|
await Promise.allSettled(e), !m && (n.value = !0);
|
|
@@ -2008,8 +2040,8 @@ function Nr(e) {
|
|
|
2008
2040
|
}
|
|
2009
2041
|
//#endregion
|
|
2010
2042
|
//#region src/composables/useLogicTag.ts
|
|
2011
|
-
function
|
|
2012
|
-
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;
|
|
2013
2045
|
async function u() {
|
|
2014
2046
|
if (i) {
|
|
2015
2047
|
o.value = !0;
|
|
@@ -2040,12 +2072,12 @@ function Pr() {
|
|
|
2040
2072
|
}
|
|
2041
2073
|
//#endregion
|
|
2042
2074
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
2043
|
-
function
|
|
2044
|
-
return
|
|
2075
|
+
function Hr(e, t, n) {
|
|
2076
|
+
return be(e, n) ? {
|
|
2045
2077
|
type: "logicMergeTagNode",
|
|
2046
2078
|
attrs: {
|
|
2047
2079
|
value: e,
|
|
2048
|
-
keyword:
|
|
2080
|
+
keyword: ve(e, n)
|
|
2049
2081
|
}
|
|
2050
2082
|
} : {
|
|
2051
2083
|
type: "mergeTagNode",
|
|
@@ -2057,15 +2089,15 @@ function Fr(e, t, n) {
|
|
|
2057
2089
|
}
|
|
2058
2090
|
//#endregion
|
|
2059
2091
|
//#region src/utils/insertLogicTag.ts
|
|
2060
|
-
function
|
|
2092
|
+
function Ur(e) {
|
|
2061
2093
|
return "before" in e && "after" in e;
|
|
2062
2094
|
}
|
|
2063
|
-
function
|
|
2064
|
-
if (!
|
|
2065
|
-
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();
|
|
2066
2098
|
return;
|
|
2067
2099
|
}
|
|
2068
|
-
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;
|
|
2069
2101
|
if (a !== o) {
|
|
2070
2102
|
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
2071
2103
|
return;
|
|
@@ -2074,20 +2106,20 @@ function Lr(e, t, n) {
|
|
|
2074
2106
|
}
|
|
2075
2107
|
//#endregion
|
|
2076
2108
|
//#region src/utils/linkColorExtension.ts
|
|
2077
|
-
function
|
|
2109
|
+
function Gr(e) {
|
|
2078
2110
|
if (!e) return null;
|
|
2079
2111
|
let t = e.trim();
|
|
2080
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;
|
|
2081
2113
|
}
|
|
2082
|
-
function
|
|
2114
|
+
function Kr(e) {
|
|
2083
2115
|
return e.extend({ addAttributes() {
|
|
2084
2116
|
return {
|
|
2085
2117
|
...this.parent?.(),
|
|
2086
2118
|
color: {
|
|
2087
2119
|
default: null,
|
|
2088
|
-
parseHTML: (e) =>
|
|
2120
|
+
parseHTML: (e) => Gr(Nt(e.style.color)),
|
|
2089
2121
|
renderHTML: (e) => {
|
|
2090
|
-
let t =
|
|
2122
|
+
let t = Gr(e.color);
|
|
2091
2123
|
return t ? { style: `color: ${t}` } : {};
|
|
2092
2124
|
}
|
|
2093
2125
|
}
|
|
@@ -2096,24 +2128,24 @@ function zr(e) {
|
|
|
2096
2128
|
}
|
|
2097
2129
|
//#endregion
|
|
2098
2130
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
2099
|
-
function
|
|
2100
|
-
let
|
|
2101
|
-
|
|
2102
|
-
function a() {
|
|
2103
|
-
let i = e.value?.getAttributes("link") ?? {};
|
|
2104
|
-
n.value = i.href || "", r.value = i.color || "", t.value = !0;
|
|
2105
|
-
}
|
|
2131
|
+
function qr(e, t = Me.liquid) {
|
|
2132
|
+
let n = l(!1), r = l(""), i = l(""), a = l(null);
|
|
2133
|
+
Pr(a, n);
|
|
2106
2134
|
function o() {
|
|
2107
|
-
|
|
2108
|
-
|
|
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);
|
|
2109
2141
|
if (t !== null) {
|
|
2110
|
-
let n =
|
|
2111
|
-
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();
|
|
2112
2144
|
}
|
|
2113
2145
|
}
|
|
2114
|
-
|
|
2146
|
+
p();
|
|
2115
2147
|
}
|
|
2116
|
-
let
|
|
2148
|
+
let c = /* @__PURE__ */ new Set([
|
|
2117
2149
|
"http",
|
|
2118
2150
|
"https",
|
|
2119
2151
|
"mailto",
|
|
@@ -2124,38 +2156,41 @@ function Br(e) {
|
|
|
2124
2156
|
"xmpp",
|
|
2125
2157
|
"cid"
|
|
2126
2158
|
]);
|
|
2127
|
-
function
|
|
2159
|
+
function u(e) {
|
|
2160
|
+
return RegExp(`^(?:${t.value.source})`).test(e);
|
|
2161
|
+
}
|
|
2162
|
+
function d(e) {
|
|
2128
2163
|
let t = e.trim();
|
|
2129
2164
|
if (!t) return null;
|
|
2130
2165
|
if (t.startsWith("#")) return t;
|
|
2131
2166
|
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
2132
|
-
return n ?
|
|
2167
|
+
return n ? c.has(n[1].toLowerCase()) ? t : null : u(t) ? t : `https://${t}`;
|
|
2133
2168
|
}
|
|
2134
|
-
function
|
|
2135
|
-
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(),
|
|
2169
|
+
function f() {
|
|
2170
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p();
|
|
2136
2171
|
}
|
|
2137
|
-
function
|
|
2138
|
-
|
|
2172
|
+
function p() {
|
|
2173
|
+
n.value = !1, r.value = "", i.value = "";
|
|
2139
2174
|
}
|
|
2140
|
-
function
|
|
2141
|
-
e.key === "Enter" ? (e.preventDefault(),
|
|
2175
|
+
function m(e) {
|
|
2176
|
+
e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && p();
|
|
2142
2177
|
}
|
|
2143
2178
|
return {
|
|
2144
|
-
showLinkDialog:
|
|
2145
|
-
linkUrl:
|
|
2146
|
-
linkColor:
|
|
2147
|
-
linkDialogRef:
|
|
2148
|
-
openLinkDialog:
|
|
2149
|
-
insertLink:
|
|
2150
|
-
removeLink:
|
|
2151
|
-
closeLinkDialog:
|
|
2152
|
-
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
|
|
2153
2188
|
};
|
|
2154
2189
|
}
|
|
2155
2190
|
//#endregion
|
|
2156
2191
|
//#region src/composables/useRichTextEditor.ts
|
|
2157
|
-
function
|
|
2158
|
-
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;
|
|
2159
2194
|
async function I() {
|
|
2160
2195
|
P.value = null, M.value = !0;
|
|
2161
2196
|
try {
|
|
@@ -2185,7 +2220,7 @@ function Vr(r) {
|
|
|
2185
2220
|
v.value = s, M.value = !1, k();
|
|
2186
2221
|
} catch (e) {
|
|
2187
2222
|
if (F) return;
|
|
2188
|
-
|
|
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;
|
|
2189
2224
|
}
|
|
2190
2225
|
}
|
|
2191
2226
|
function L() {
|
|
@@ -2195,7 +2230,7 @@ function Vr(r) {
|
|
|
2195
2230
|
let R = t(() => r.blockContent(), (e) => {
|
|
2196
2231
|
v.value && v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 });
|
|
2197
2232
|
});
|
|
2198
|
-
function
|
|
2233
|
+
function ee(e) {
|
|
2199
2234
|
if (s.value || p.value) return;
|
|
2200
2235
|
let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement);
|
|
2201
2236
|
if (!n) return;
|
|
@@ -2203,19 +2238,19 @@ function Vr(r) {
|
|
|
2203
2238
|
let i = t.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
2204
2239
|
n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog") || i || r.onDone();
|
|
2205
2240
|
}
|
|
2206
|
-
|
|
2241
|
+
W(document, "mousedown", ee), e(() => {
|
|
2207
2242
|
F = !0, R(), A(), v.value?.destroy();
|
|
2208
2243
|
});
|
|
2209
|
-
async function
|
|
2244
|
+
async function z() {
|
|
2210
2245
|
let e = await c();
|
|
2211
2246
|
F || (e && v.value ? v.value.chain().focus().insertMergeTag({
|
|
2212
2247
|
label: e.label,
|
|
2213
2248
|
value: e.value
|
|
2214
2249
|
}).run() : v.value?.commands.focus());
|
|
2215
2250
|
}
|
|
2216
|
-
async function
|
|
2251
|
+
async function B() {
|
|
2217
2252
|
let e = await m();
|
|
2218
|
-
F || (e && v.value ?
|
|
2253
|
+
F || (e && v.value ? Wr(v.value, e, u) : v.value?.commands.focus());
|
|
2219
2254
|
}
|
|
2220
2255
|
return {
|
|
2221
2256
|
editor: v,
|
|
@@ -2238,15 +2273,15 @@ function Vr(r) {
|
|
|
2238
2273
|
removeLink: E,
|
|
2239
2274
|
closeLinkDialog: D,
|
|
2240
2275
|
handleLinkKeydown: O,
|
|
2241
|
-
handleAddMergeTag:
|
|
2242
|
-
handleAddLogicTag:
|
|
2276
|
+
handleAddMergeTag: z,
|
|
2277
|
+
handleAddLogicTag: B
|
|
2243
2278
|
};
|
|
2244
2279
|
}
|
|
2245
2280
|
//#endregion
|
|
2246
2281
|
//#region src/composables/useSmallScreenNotice.ts
|
|
2247
|
-
var
|
|
2248
|
-
function
|
|
2249
|
-
let t =
|
|
2282
|
+
var Yr = "(max-width: 767px)";
|
|
2283
|
+
function Xr(e) {
|
|
2284
|
+
let t = Ue(Yr);
|
|
2250
2285
|
return {
|
|
2251
2286
|
isSmallScreen: t,
|
|
2252
2287
|
showNotice: S(() => (P(e) ?? !0) && t.value)
|
|
@@ -2254,20 +2289,20 @@ function Ur(e) {
|
|
|
2254
2289
|
}
|
|
2255
2290
|
//#endregion
|
|
2256
2291
|
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2257
|
-
var
|
|
2292
|
+
var Zr = { class: "tpl:w-full" }, Qr = {
|
|
2258
2293
|
key: 0,
|
|
2259
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)]"
|
|
2260
|
-
},
|
|
2295
|
+
}, $r = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ei = {
|
|
2261
2296
|
key: 1,
|
|
2262
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)]"
|
|
2263
|
-
},
|
|
2298
|
+
}, ti = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, ni = {
|
|
2264
2299
|
key: 2,
|
|
2265
2300
|
class: "tpl:relative"
|
|
2266
|
-
},
|
|
2301
|
+
}, ri = ["innerHTML"], ii = {
|
|
2267
2302
|
key: 0,
|
|
2268
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]",
|
|
2269
2304
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
2270
|
-
},
|
|
2305
|
+
}, ai = /* @__PURE__ */ d({
|
|
2271
2306
|
__name: "CustomBlock",
|
|
2272
2307
|
props: {
|
|
2273
2308
|
block: {},
|
|
@@ -2275,7 +2310,7 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2275
2310
|
},
|
|
2276
2311
|
emits: ["fetchData"],
|
|
2277
2312
|
setup(e, { emit: r }) {
|
|
2278
|
-
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({
|
|
2279
2314
|
definition: f,
|
|
2280
2315
|
block: S(() => i.block),
|
|
2281
2316
|
onUpdate: (e, t) => {
|
|
@@ -2284,10 +2319,10 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2284
2319
|
dataSourceFetched: t
|
|
2285
2320
|
});
|
|
2286
2321
|
}
|
|
2287
|
-
}), b = n(
|
|
2322
|
+
}), b = n(G, []), x = n(q, null), T = S(() => {
|
|
2288
2323
|
if (!x?.value) return i.block;
|
|
2289
2324
|
let e = {};
|
|
2290
|
-
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;
|
|
2291
2326
|
return {
|
|
2292
2327
|
...i.block,
|
|
2293
2328
|
fieldValues: e
|
|
@@ -2304,17 +2339,17 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2304
2339
|
}
|
|
2305
2340
|
}
|
|
2306
2341
|
}
|
|
2307
|
-
let k =
|
|
2342
|
+
let k = Be(D, 150);
|
|
2308
2343
|
return E(() => {
|
|
2309
2344
|
D();
|
|
2310
2345
|
}), t(() => i.block.fieldValues, () => {
|
|
2311
2346
|
k();
|
|
2312
2347
|
}, { deep: !0 }), t(() => x?.value, () => {
|
|
2313
2348
|
k();
|
|
2314
|
-
}), (e, t) => (s(), C("div",
|
|
2349
|
+
}), (e, t) => (s(), C("div", Zr, [p.value ? d.value ? (s(), C("div", ei, [v(_(Xt), {
|
|
2315
2350
|
size: 24,
|
|
2316
2351
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
2317
|
-
}), 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, {
|
|
2318
2353
|
key: 1,
|
|
2319
2354
|
class: "tpl:w-48"
|
|
2320
2355
|
})) : (s(), C("button", {
|
|
@@ -2322,16 +2357,16 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2322
2357
|
type: "button",
|
|
2323
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)]",
|
|
2324
2359
|
onClick: t[0] ||= O((...e) => _(h) && _(h)(...e), ["stop"])
|
|
2325
|
-
}, [f.value?.icon ? (s(), A(
|
|
2360
|
+
}, [f.value?.icon ? (s(), A(Mr, {
|
|
2326
2361
|
key: 0,
|
|
2327
2362
|
icon: f.value.icon,
|
|
2328
2363
|
size: 16
|
|
2329
|
-
}, 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), {
|
|
2330
2365
|
size: 24,
|
|
2331
2366
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
2332
|
-
}), M("span",
|
|
2367
|
+
}), M("span", $r, R(_(o).customBlocks.definitionNotFound), 1)]))]));
|
|
2333
2368
|
}
|
|
2334
|
-
}),
|
|
2369
|
+
}), oi = { class: "tpl:w-full" }, si = /* @__PURE__ */ d({
|
|
2335
2370
|
__name: "DividerBlock",
|
|
2336
2371
|
props: {
|
|
2337
2372
|
block: {},
|
|
@@ -2343,28 +2378,28 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2343
2378
|
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
2344
2379
|
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
2345
2380
|
}));
|
|
2346
|
-
return (e, t) => (s(), C("div",
|
|
2381
|
+
return (e, t) => (s(), C("div", oi, [M("hr", {
|
|
2347
2382
|
class: "tpl:m-0 tpl:border-none",
|
|
2348
2383
|
style: k(n.value)
|
|
2349
2384
|
}, null, 4)]));
|
|
2350
2385
|
}
|
|
2351
|
-
}),
|
|
2386
|
+
}), ci = { class: "tpl:w-full" }, li = ["srcdoc", "title"], ui = {
|
|
2352
2387
|
key: 1,
|
|
2353
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)]"
|
|
2354
|
-
},
|
|
2389
|
+
}, di = {
|
|
2355
2390
|
key: 0,
|
|
2356
2391
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
2357
|
-
},
|
|
2392
|
+
}, fi = {
|
|
2358
2393
|
key: 1,
|
|
2359
2394
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
2360
|
-
},
|
|
2395
|
+
}, pi = /* @__PURE__ */ d({
|
|
2361
2396
|
__name: "HtmlBlock",
|
|
2362
2397
|
props: {
|
|
2363
2398
|
block: {},
|
|
2364
2399
|
viewport: {}
|
|
2365
2400
|
},
|
|
2366
2401
|
setup(r) {
|
|
2367
|
-
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;
|
|
2368
2403
|
function y() {
|
|
2369
2404
|
let e = m.value?.contentDocument;
|
|
2370
2405
|
e && (h.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
@@ -2378,7 +2413,7 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2378
2413
|
e || (g?.disconnect(), g = null);
|
|
2379
2414
|
}), e(() => {
|
|
2380
2415
|
g?.disconnect(), g = null;
|
|
2381
|
-
}), (e, t) => (s(), C("div",
|
|
2416
|
+
}), (e, t) => (s(), C("div", ci, [u.value ? (s(), C("iframe", {
|
|
2382
2417
|
key: 0,
|
|
2383
2418
|
ref_key: "iframeRef",
|
|
2384
2419
|
ref: m,
|
|
@@ -2388,18 +2423,18 @@ var Wr = { class: "tpl:w-full" }, Gr = {
|
|
|
2388
2423
|
class: "tpl:block tpl:w-full tpl:border-0",
|
|
2389
2424
|
style: k({ height: `${h.value}px` }),
|
|
2390
2425
|
onLoad: b
|
|
2391
|
-
}, null, 44,
|
|
2426
|
+
}, null, 44, li)) : (s(), C("div", ui, [v(_(Bt), {
|
|
2392
2427
|
size: 24,
|
|
2393
2428
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
2394
|
-
}), 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))]))]));
|
|
2395
2430
|
}
|
|
2396
|
-
}),
|
|
2397
|
-
function
|
|
2398
|
-
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, {
|
|
2399
2434
|
preventDefaultForUnhandled: !0,
|
|
2400
2435
|
onDrop: (e) => {
|
|
2401
2436
|
if (!i()) return;
|
|
2402
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
2437
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(mi));
|
|
2403
2438
|
t.length > 0 && n([t[0]]);
|
|
2404
2439
|
}
|
|
2405
2440
|
});
|
|
@@ -2407,17 +2442,17 @@ function ci(e) {
|
|
|
2407
2442
|
}
|
|
2408
2443
|
//#endregion
|
|
2409
2444
|
//#region src/components/blocks/ImageBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2410
|
-
var
|
|
2445
|
+
var gi = {
|
|
2411
2446
|
key: 0,
|
|
2412
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)]",
|
|
2413
2448
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
2414
|
-
},
|
|
2449
|
+
}, _i = ["href"], vi = ["src", "alt"], yi = ["src", "alt"], bi = {
|
|
2415
2450
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
2416
2451
|
style: { opacity: "0.7" }
|
|
2417
|
-
},
|
|
2452
|
+
}, xi = ["href"], Si = ["src", "alt"], Ci = ["src", "alt"], wi = {
|
|
2418
2453
|
key: 4,
|
|
2419
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)]"
|
|
2420
|
-
},
|
|
2455
|
+
}, Ti = ["aria-label"], Ei = { key: 1 }, Di = /* @__PURE__ */ d({
|
|
2421
2456
|
__name: "ImageBlock",
|
|
2422
2457
|
props: {
|
|
2423
2458
|
block: {},
|
|
@@ -2425,7 +2460,7 @@ var li = {
|
|
|
2425
2460
|
},
|
|
2426
2461
|
emits: ["update"],
|
|
2427
2462
|
setup(e, { emit: t }) {
|
|
2428
|
-
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();
|
|
2429
2464
|
async function f() {
|
|
2430
2465
|
let e = await c?.({ accept: ["images"] });
|
|
2431
2466
|
if (d.alive && e) {
|
|
@@ -2452,7 +2487,7 @@ var li = {
|
|
|
2452
2487
|
}
|
|
2453
2488
|
}
|
|
2454
2489
|
}
|
|
2455
|
-
let { isOver: y } =
|
|
2490
|
+
let { isOver: y } = hi({
|
|
2456
2491
|
target: p,
|
|
2457
2492
|
enabled: h,
|
|
2458
2493
|
onFiles: g
|
|
@@ -2467,21 +2502,21 @@ var li = {
|
|
|
2467
2502
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2468
2503
|
marginRight: e === "center" ? "auto" : void 0
|
|
2469
2504
|
};
|
|
2470
|
-
}), 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);
|
|
2471
2506
|
return (t, n) => (s(), C("div", {
|
|
2472
2507
|
ref_key: "dropZoneRef",
|
|
2473
2508
|
ref: p,
|
|
2474
2509
|
"data-testid": "image-drop-zone",
|
|
2475
2510
|
class: "tpl:relative tpl:w-full",
|
|
2476
2511
|
style: k(b.value)
|
|
2477
|
-
}, [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), {
|
|
2478
2513
|
class: "tpl-spinner",
|
|
2479
2514
|
size: 20,
|
|
2480
2515
|
"stroke-width": 2
|
|
2481
|
-
}),
|
|
2516
|
+
}), B(" " + R(_(a).image.uploading), 1)], 64)) : (s(), C(L, { key: 1 }, [v(_(Jt), {
|
|
2482
2517
|
size: 20,
|
|
2483
2518
|
"stroke-width": 1.5
|
|
2484
|
-
}),
|
|
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", {
|
|
2485
2520
|
key: 0,
|
|
2486
2521
|
href: e.block.linkUrl,
|
|
2487
2522
|
target: "_blank",
|
|
@@ -2493,22 +2528,22 @@ var li = {
|
|
|
2493
2528
|
src: _(D),
|
|
2494
2529
|
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2495
2530
|
style: k(x.value)
|
|
2496
|
-
}, null, 12,
|
|
2531
|
+
}, null, 12, vi)], 8, _i)) : (s(), C("img", {
|
|
2497
2532
|
key: 1,
|
|
2498
2533
|
class: "tpl:border-0",
|
|
2499
2534
|
src: _(D),
|
|
2500
2535
|
alt: e.block.alt,
|
|
2501
2536
|
style: k(x.value)
|
|
2502
|
-
}, null, 12,
|
|
2537
|
+
}, null, 12, yi))], 64)) : e.block.src && T.value ? (s(), C("div", {
|
|
2503
2538
|
key: 2,
|
|
2504
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)]",
|
|
2505
2540
|
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, x.value])
|
|
2506
|
-
}, [v(_(
|
|
2541
|
+
}, [v(_(Wt), {
|
|
2507
2542
|
size: 32,
|
|
2508
2543
|
"stroke-width": 1.5,
|
|
2509
2544
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
2510
2545
|
style: { opacity: "0.5" }
|
|
2511
|
-
}), 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", {
|
|
2512
2547
|
key: 0,
|
|
2513
2548
|
href: e.block.linkUrl,
|
|
2514
2549
|
target: "_blank",
|
|
@@ -2520,33 +2555,33 @@ var li = {
|
|
|
2520
2555
|
src: _(E),
|
|
2521
2556
|
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2522
2557
|
style: k(x.value)
|
|
2523
|
-
}, null, 12,
|
|
2558
|
+
}, null, 12, Si)], 8, xi)) : (s(), C("img", {
|
|
2524
2559
|
key: 1,
|
|
2525
2560
|
class: "tpl:border-0",
|
|
2526
2561
|
src: _(E),
|
|
2527
2562
|
alt: e.block.alt,
|
|
2528
2563
|
style: k(x.value)
|
|
2529
|
-
}, null, 12,
|
|
2564
|
+
}, null, 12, Ci))], 64)) : (s(), C("div", wi, [u.value ? (s(), C("button", {
|
|
2530
2565
|
key: 0,
|
|
2531
2566
|
"aria-label": _(a).image.browseMedia,
|
|
2532
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)]",
|
|
2533
2568
|
onClick: O(f, ["stop"])
|
|
2534
|
-
}, [v(_(
|
|
2569
|
+
}, [v(_(Wt), {
|
|
2535
2570
|
size: 14,
|
|
2536
2571
|
"stroke-width": 1.5
|
|
2537
|
-
}),
|
|
2572
|
+
}), B(" " + R(_(a).image.browseMedia), 1)], 8, Ti)) : (s(), C("span", Ei, R(_(a).image.clickToAdd), 1))]))], 4));
|
|
2538
2573
|
}
|
|
2539
|
-
}),
|
|
2574
|
+
}), Oi = { class: "tpl:w-full" }, ki = ["href"], Ai = {
|
|
2540
2575
|
key: 1,
|
|
2541
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)]"
|
|
2542
|
-
},
|
|
2577
|
+
}, ji = /* @__PURE__ */ d({
|
|
2543
2578
|
__name: "MenuBlock",
|
|
2544
2579
|
props: {
|
|
2545
2580
|
block: {},
|
|
2546
2581
|
viewport: {}
|
|
2547
2582
|
},
|
|
2548
2583
|
setup(e) {
|
|
2549
|
-
let t = e, { t: n } =
|
|
2584
|
+
let t = e, { t: n } = J(), i = S(() => ({
|
|
2550
2585
|
display: "flex",
|
|
2551
2586
|
flexWrap: "wrap",
|
|
2552
2587
|
gap: `0 ${t.block.spacing}px`,
|
|
@@ -2558,7 +2593,7 @@ var li = {
|
|
|
2558
2593
|
function o(e) {
|
|
2559
2594
|
return e || t.block.linkColor || t.block.color;
|
|
2560
2595
|
}
|
|
2561
|
-
return (t, c) => (s(), C("div",
|
|
2596
|
+
return (t, c) => (s(), C("div", Oi, [a.value ? (s(), C("div", {
|
|
2562
2597
|
key: 0,
|
|
2563
2598
|
style: k(i.value)
|
|
2564
2599
|
}, [(s(!0), C(L, null, r(e.block.items, (t, n) => (s(), C(L, { key: t.id }, [M("a", {
|
|
@@ -2570,15 +2605,15 @@ var li = {
|
|
|
2570
2605
|
textDecoration: t.underline ? "underline" : "none"
|
|
2571
2606
|
}),
|
|
2572
2607
|
onClick: c[0] ||= O(() => {}, ["prevent"])
|
|
2573
|
-
}, [v(
|
|
2608
|
+
}, [v(Dr, { text: t.text || "..." }, null, 8, ["text"])], 12, ki), n < e.block.items.length - 1 ? (s(), C("span", {
|
|
2574
2609
|
key: 0,
|
|
2575
2610
|
style: k({
|
|
2576
2611
|
color: e.block.separatorColor,
|
|
2577
2612
|
padding: `0 ${e.block.spacing}px`
|
|
2578
2613
|
})
|
|
2579
|
-
}, 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)]))]));
|
|
2580
2615
|
}
|
|
2581
|
-
}),
|
|
2616
|
+
}), Mi = /* @__PURE__ */ new Set([
|
|
2582
2617
|
"http",
|
|
2583
2618
|
"https",
|
|
2584
2619
|
"mailto",
|
|
@@ -2588,7 +2623,7 @@ var li = {
|
|
|
2588
2623
|
"sms",
|
|
2589
2624
|
"xmpp",
|
|
2590
2625
|
"cid"
|
|
2591
|
-
]),
|
|
2626
|
+
]), Ni = /* @__PURE__ */ new Set([
|
|
2592
2627
|
"SCRIPT",
|
|
2593
2628
|
"STYLE",
|
|
2594
2629
|
"IFRAME",
|
|
@@ -2598,7 +2633,7 @@ var li = {
|
|
|
2598
2633
|
"META",
|
|
2599
2634
|
"BASE",
|
|
2600
2635
|
"FORM"
|
|
2601
|
-
]),
|
|
2636
|
+
]), Pi = /* @__PURE__ */ new Set([
|
|
2602
2637
|
"href",
|
|
2603
2638
|
"xlink:href",
|
|
2604
2639
|
"formaction",
|
|
@@ -2607,16 +2642,16 @@ var li = {
|
|
|
2607
2642
|
"background",
|
|
2608
2643
|
"poster"
|
|
2609
2644
|
]);
|
|
2610
|
-
function
|
|
2645
|
+
function Fi(e, t) {
|
|
2611
2646
|
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2612
2647
|
if (!n || n.startsWith("#")) return !0;
|
|
2613
2648
|
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
2614
2649
|
if (!r) return !0;
|
|
2615
2650
|
let i = r[1].toLowerCase();
|
|
2616
|
-
return
|
|
2651
|
+
return Mi.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
2617
2652
|
}
|
|
2618
|
-
function
|
|
2619
|
-
if (
|
|
2653
|
+
function Ii(e) {
|
|
2654
|
+
if (Ni.has(e.tagName)) {
|
|
2620
2655
|
e.remove();
|
|
2621
2656
|
return;
|
|
2622
2657
|
}
|
|
@@ -2628,29 +2663,29 @@ function ki(e) {
|
|
|
2628
2663
|
e.removeAttribute(n);
|
|
2629
2664
|
continue;
|
|
2630
2665
|
}
|
|
2631
|
-
if (
|
|
2632
|
-
|
|
2666
|
+
if (Pi.has(t)) {
|
|
2667
|
+
Fi(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
2633
2668
|
continue;
|
|
2634
2669
|
}
|
|
2635
2670
|
if (t === "src") {
|
|
2636
|
-
|
|
2671
|
+
Fi(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
2637
2672
|
continue;
|
|
2638
2673
|
}
|
|
2639
2674
|
t === "srcdoc" && e.removeAttribute(n);
|
|
2640
2675
|
}
|
|
2641
2676
|
let n = Array.from(e.children);
|
|
2642
|
-
for (let e of n)
|
|
2677
|
+
for (let e of n) Ii(e);
|
|
2643
2678
|
}
|
|
2644
|
-
function
|
|
2679
|
+
function Li(e) {
|
|
2645
2680
|
if (typeof DOMParser > "u") return e;
|
|
2646
2681
|
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
2647
|
-
for (let e of n)
|
|
2682
|
+
for (let e of n) Ii(e);
|
|
2648
2683
|
return t.innerHTML;
|
|
2649
2684
|
}
|
|
2650
2685
|
//#endregion
|
|
2651
2686
|
//#region src/composables/useEditableTextBlock.ts
|
|
2652
|
-
function
|
|
2653
|
-
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({
|
|
2654
2689
|
top: u.value - 8,
|
|
2655
2690
|
left: d.value
|
|
2656
2691
|
}));
|
|
@@ -2671,14 +2706,14 @@ function ji(e) {
|
|
|
2671
2706
|
}
|
|
2672
2707
|
//#endregion
|
|
2673
2708
|
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2674
|
-
var
|
|
2709
|
+
var zi = ["innerHTML"], Bi = /* @__PURE__ */ d({
|
|
2675
2710
|
__name: "ParagraphBlock",
|
|
2676
2711
|
props: {
|
|
2677
2712
|
block: {},
|
|
2678
2713
|
viewport: {}
|
|
2679
2714
|
},
|
|
2680
2715
|
setup(e) {
|
|
2681
|
-
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);
|
|
2682
2717
|
return (t, u) => (s(), C("div", {
|
|
2683
2718
|
ref_key: "blockRef",
|
|
2684
2719
|
ref: i,
|
|
@@ -2697,54 +2732,54 @@ var Mi = ["innerHTML"], Ni = /* @__PURE__ */ d({
|
|
|
2697
2732
|
key: 1,
|
|
2698
2733
|
class: "tpl-text-content tpl:outline-none",
|
|
2699
2734
|
innerHTML: _(o)
|
|
2700
|
-
}, null, 8,
|
|
2735
|
+
}, null, 8, zi))], 544));
|
|
2701
2736
|
}
|
|
2702
2737
|
});
|
|
2703
2738
|
//#endregion
|
|
2704
2739
|
//#region src/utils/blockComponentResolver.ts
|
|
2705
|
-
function
|
|
2740
|
+
function Vi(e) {
|
|
2706
2741
|
let t = { fontFamily: e.fontFamily };
|
|
2707
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;
|
|
2708
2743
|
}
|
|
2709
|
-
function
|
|
2744
|
+
function Hi(e, t, n) {
|
|
2710
2745
|
if (t) {
|
|
2711
2746
|
let n = t.getComponent(e);
|
|
2712
2747
|
if (n) return n;
|
|
2713
2748
|
}
|
|
2714
2749
|
return n[e.type] ?? null;
|
|
2715
2750
|
}
|
|
2716
|
-
function
|
|
2751
|
+
function Ui(e) {
|
|
2717
2752
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
2718
2753
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
2719
2754
|
backgroundColor: n || "transparent"
|
|
2720
2755
|
};
|
|
2721
|
-
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;
|
|
2722
2757
|
}
|
|
2723
|
-
function
|
|
2758
|
+
function Wi(e) {
|
|
2724
2759
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
2725
2760
|
let t = e.wrapper, n = {};
|
|
2726
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;
|
|
2727
2762
|
}
|
|
2728
2763
|
//#endregion
|
|
2729
2764
|
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
2730
|
-
var
|
|
2765
|
+
var Gi = [
|
|
2731
2766
|
"data-block-id",
|
|
2732
2767
|
"data-block-type",
|
|
2733
2768
|
"data-tpl-picked"
|
|
2734
|
-
],
|
|
2769
|
+
], Ki = ["aria-label"], qi = [
|
|
2735
2770
|
"aria-label",
|
|
2736
2771
|
"aria-pressed",
|
|
2737
2772
|
"title"
|
|
2738
|
-
],
|
|
2773
|
+
], Ji = ["aria-label", "title"], Yi = ["aria-label", "title"], Xi = ["aria-label", "title"], Zi = {
|
|
2739
2774
|
key: 1,
|
|
2740
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"
|
|
2741
|
-
},
|
|
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 = {
|
|
2742
2777
|
key: 2,
|
|
2743
2778
|
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
2744
|
-
},
|
|
2779
|
+
}, ea = ["aria-label", "title"], ta = {
|
|
2745
2780
|
key: 3,
|
|
2746
2781
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
2747
|
-
},
|
|
2782
|
+
}, na = ["aria-label"], ra = /*#__PURE__*/ tn(/* @__PURE__ */ d({
|
|
2748
2783
|
__name: "BlockWrapper",
|
|
2749
2784
|
props: {
|
|
2750
2785
|
block: {},
|
|
@@ -2756,7 +2791,7 @@ var Ri = [
|
|
|
2756
2791
|
},
|
|
2757
2792
|
emits: ["select"],
|
|
2758
2793
|
setup(e, { emit: t }) {
|
|
2759
|
-
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);
|
|
2760
2795
|
async function h() {
|
|
2761
2796
|
await D(), f.value?.focus();
|
|
2762
2797
|
}
|
|
@@ -2782,20 +2817,20 @@ var Ri = [
|
|
|
2782
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 ? {
|
|
2783
2818
|
desktop: c.viewport.desktop,
|
|
2784
2819
|
mobile: c.viewport.mobile
|
|
2785
|
-
}[i.viewport] ?? i.viewport : ""), E = S(() => !!i.block.displayCondition), A = n(
|
|
2786
|
-
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) {
|
|
2787
2822
|
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
|
|
2788
2823
|
}
|
|
2789
|
-
function
|
|
2824
|
+
function re() {
|
|
2790
2825
|
A?.deleteBlock(i.block.id);
|
|
2791
2826
|
}
|
|
2792
|
-
function
|
|
2827
|
+
function ie() {
|
|
2793
2828
|
A?.duplicateBlock(i.block);
|
|
2794
2829
|
}
|
|
2795
|
-
function
|
|
2830
|
+
function ae() {
|
|
2796
2831
|
N.savedBlocks?.startPicking(i.block.id);
|
|
2797
2832
|
}
|
|
2798
|
-
function
|
|
2833
|
+
function oe() {
|
|
2799
2834
|
j?.toggleBlock(i.block.id);
|
|
2800
2835
|
}
|
|
2801
2836
|
return (t, n) => x.value ? w("", !0) : (s(), C("div", {
|
|
@@ -2809,7 +2844,7 @@ var Ri = [
|
|
|
2809
2844
|
"data-block-id": e.block.id,
|
|
2810
2845
|
"data-block-type": e.block.type,
|
|
2811
2846
|
"data-tpl-picked": e.picked || void 0,
|
|
2812
|
-
onClick:
|
|
2847
|
+
onClick: ne
|
|
2813
2848
|
}, [
|
|
2814
2849
|
v(_(r), { "block-id": e.block.id }, null, 8, ["block-id"]),
|
|
2815
2850
|
I.value ? (s(), C("div", {
|
|
@@ -2827,98 +2862,98 @@ var Ri = [
|
|
|
2827
2862
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2828
2863
|
title: _(c).blockActions.drag,
|
|
2829
2864
|
onKeydown: g
|
|
2830
|
-
}, [v(_(
|
|
2865
|
+
}, [v(_(Gt), {
|
|
2831
2866
|
size: 14,
|
|
2832
2867
|
"stroke-width": 1.5
|
|
2833
|
-
})], 40,
|
|
2868
|
+
})], 40, qi),
|
|
2834
2869
|
M("button", {
|
|
2835
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",
|
|
2836
2871
|
"aria-label": _(c).blockActions.duplicate,
|
|
2837
2872
|
title: _(c).blockActions.duplicate,
|
|
2838
|
-
onClick: O(
|
|
2839
|
-
}, [v(_(
|
|
2873
|
+
onClick: O(ie, ["stop"])
|
|
2874
|
+
}, [v(_(Rt), {
|
|
2840
2875
|
size: 14,
|
|
2841
2876
|
"stroke-width": 1.5
|
|
2842
|
-
})], 8,
|
|
2877
|
+
})], 8, Ji),
|
|
2843
2878
|
F.value ? (s(), C("button", {
|
|
2844
2879
|
key: 0,
|
|
2845
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",
|
|
2846
2881
|
"aria-label": _(c).blockActions.saveAsBlock,
|
|
2847
2882
|
title: _(c).blockActions.saveAsBlock,
|
|
2848
|
-
onClick: O(
|
|
2849
|
-
}, [v(_(
|
|
2883
|
+
onClick: O(ae, ["stop"])
|
|
2884
|
+
}, [v(_(Lt), {
|
|
2850
2885
|
size: 14,
|
|
2851
2886
|
"stroke-width": 1.5
|
|
2852
|
-
})], 8,
|
|
2887
|
+
})], 8, Yi)) : w("", !0),
|
|
2853
2888
|
M("button", {
|
|
2854
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",
|
|
2855
2890
|
"aria-label": _(c).blockActions.delete,
|
|
2856
2891
|
title: _(c).blockActions.delete,
|
|
2857
|
-
onClick: O(
|
|
2858
|
-
}, [v(_(
|
|
2892
|
+
onClick: O(re, ["stop"])
|
|
2893
|
+
}, [v(_(Ut), {
|
|
2859
2894
|
size: 14,
|
|
2860
2895
|
"stroke-width": 1.5
|
|
2861
|
-
})], 8,
|
|
2862
|
-
], 8,
|
|
2863
|
-
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), {
|
|
2864
2899
|
size: 12,
|
|
2865
2900
|
"stroke-width": 1.5
|
|
2866
|
-
}),
|
|
2867
|
-
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", {
|
|
2868
2903
|
"data-testid": "condition-toggle",
|
|
2869
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)]",
|
|
2870
2905
|
"aria-label": _(c).blockActions.conditionToggle,
|
|
2871
2906
|
title: e.block.displayCondition?.label,
|
|
2872
|
-
onClick: O(
|
|
2873
|
-
}, [v(_(
|
|
2907
|
+
onClick: O(oe, ["stop"])
|
|
2908
|
+
}, [v(_(Qt), {
|
|
2874
2909
|
size: 12,
|
|
2875
2910
|
"stroke-width": 2
|
|
2876
|
-
})], 8,
|
|
2877
|
-
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", {
|
|
2878
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)]",
|
|
2879
2914
|
"aria-label": _(u)(_(c).blockActions.comments, { count: String(L.value) }),
|
|
2880
2915
|
onClick: n[0] ||= O((t) => _(N).comments?.openForBlock(e.block.id), ["stop"])
|
|
2881
|
-
}, [v(_(
|
|
2916
|
+
}, [v(_(Yt), {
|
|
2882
2917
|
size: 12,
|
|
2883
2918
|
"stroke-width": 2.5
|
|
2884
|
-
}),
|
|
2885
|
-
|
|
2919
|
+
}), B(" " + R(L.value), 1)], 8, na)])) : w("", !0),
|
|
2920
|
+
te.value ? (s(), C("div", {
|
|
2886
2921
|
key: 4,
|
|
2887
2922
|
class: "tpl-section-wrapper",
|
|
2888
|
-
style: k(
|
|
2923
|
+
style: k(te.value)
|
|
2889
2924
|
}, [M("div", {
|
|
2890
2925
|
class: "tpl-block-content",
|
|
2891
|
-
style: k(
|
|
2926
|
+
style: k(ee.value)
|
|
2892
2927
|
}, [a(t.$slots, "default", {}, void 0, !0)], 4)], 4)) : (s(), C("div", {
|
|
2893
2928
|
key: 5,
|
|
2894
2929
|
class: "tpl-block-content",
|
|
2895
|
-
style: k(
|
|
2930
|
+
style: k(ee.value)
|
|
2896
2931
|
}, [a(t.$slots, "default", {}, void 0, !0)], 4))
|
|
2897
|
-
], 10,
|
|
2932
|
+
], 10, Gi));
|
|
2898
2933
|
}
|
|
2899
2934
|
}), [["__scopeId", "data-v-2c239048"]]);
|
|
2900
2935
|
//#endregion
|
|
2901
2936
|
//#region src/utils/unwrapParagraph.ts
|
|
2902
|
-
function
|
|
2937
|
+
function ia(e) {
|
|
2903
2938
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2904
2939
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2905
2940
|
}
|
|
2906
2941
|
//#endregion
|
|
2907
2942
|
//#region src/components/blocks/TitleBlock.vue
|
|
2908
|
-
var
|
|
2943
|
+
var aa = /* @__PURE__ */ d({
|
|
2909
2944
|
__name: "TitleBlock",
|
|
2910
2945
|
props: {
|
|
2911
2946
|
block: {},
|
|
2912
2947
|
viewport: {}
|
|
2913
2948
|
},
|
|
2914
2949
|
setup(e) {
|
|
2915
|
-
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(() => {
|
|
2916
2951
|
let e = {
|
|
2917
|
-
fontSize: `${
|
|
2952
|
+
fontSize: `${ke[t.block.level]}px`,
|
|
2918
2953
|
textAlign: t.block.textAlign
|
|
2919
2954
|
};
|
|
2920
2955
|
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
2921
|
-
}), f = S(() => `h${t.block.level}`), p = S(() =>
|
|
2956
|
+
}), f = S(() => `h${t.block.level}`), p = S(() => ia(o.value));
|
|
2922
2957
|
return (t, o) => (s(), C("div", {
|
|
2923
2958
|
ref_key: "blockRef",
|
|
2924
2959
|
ref: i,
|
|
@@ -2944,16 +2979,16 @@ var Qi = /* @__PURE__ */ d({
|
|
|
2944
2979
|
});
|
|
2945
2980
|
//#endregion
|
|
2946
2981
|
//#region src/utils/sectionColumnDrop.ts
|
|
2947
|
-
function
|
|
2982
|
+
function oa(e) {
|
|
2948
2983
|
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2949
2984
|
}
|
|
2950
2985
|
//#endregion
|
|
2951
2986
|
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2952
|
-
var
|
|
2987
|
+
var sa = { class: "tpl:w-full" }, ca = {
|
|
2953
2988
|
key: 0,
|
|
2954
2989
|
"data-testid": "section-drop-hint",
|
|
2955
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)]"
|
|
2956
|
-
},
|
|
2991
|
+
}, la = /* @__PURE__ */ d({
|
|
2957
2992
|
__name: "SectionBlock",
|
|
2958
2993
|
props: {
|
|
2959
2994
|
block: {},
|
|
@@ -2961,13 +2996,13 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
2961
2996
|
},
|
|
2962
2997
|
setup(e) {
|
|
2963
2998
|
let t = {
|
|
2964
|
-
title:
|
|
2965
|
-
paragraph:
|
|
2966
|
-
image:
|
|
2967
|
-
button:
|
|
2968
|
-
divider:
|
|
2969
|
-
custom:
|
|
2970
|
-
}, 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);
|
|
2971
3006
|
function h(e) {
|
|
2972
3007
|
let t = p.savedBlocks;
|
|
2973
3008
|
if (t?.isPicking.value) {
|
|
@@ -3002,7 +3037,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3002
3037
|
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
3003
3038
|
}
|
|
3004
3039
|
function D(e) {
|
|
3005
|
-
return
|
|
3040
|
+
return Hi(e, d, t);
|
|
3006
3041
|
}
|
|
3007
3042
|
function O(e, t) {
|
|
3008
3043
|
e.type === "custom" && c.updateBlock(e.id, {
|
|
@@ -3010,7 +3045,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3010
3045
|
dataSourceFetched: t.dataSourceFetched
|
|
3011
3046
|
});
|
|
3012
3047
|
}
|
|
3013
|
-
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", {
|
|
3014
3049
|
key: n,
|
|
3015
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)]" : ""]),
|
|
3016
3051
|
style: k({ width: x.value ? "100%" : g.value[n] })
|
|
@@ -3019,7 +3054,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3019
3054
|
group: {
|
|
3020
3055
|
name: "blocks",
|
|
3021
3056
|
pull: !0,
|
|
3022
|
-
put: (e, t, n) => _(
|
|
3057
|
+
put: (e, t, n) => _(oa)(n)
|
|
3023
3058
|
},
|
|
3024
3059
|
animation: 150,
|
|
3025
3060
|
"ghost-class": "tpl-ghost",
|
|
@@ -3032,7 +3067,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3032
3067
|
class: "tpl:min-h-[60px]",
|
|
3033
3068
|
"onUpdate:modelValue": (e) => E(n, e)
|
|
3034
3069
|
}, {
|
|
3035
|
-
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, {
|
|
3036
3071
|
block: t,
|
|
3037
3072
|
"is-selected": _(c).state.selectedBlockId === t.id,
|
|
3038
3073
|
viewport: e.viewport,
|
|
@@ -3064,13 +3099,13 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3064
3099
|
"model-value",
|
|
3065
3100
|
"group",
|
|
3066
3101
|
"onUpdate:modelValue"
|
|
3067
|
-
]), 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)]));
|
|
3068
3103
|
}
|
|
3069
|
-
}),
|
|
3104
|
+
}), ua = Fe, da = {
|
|
3070
3105
|
small: 24,
|
|
3071
3106
|
medium: 32,
|
|
3072
3107
|
large: 48
|
|
3073
|
-
},
|
|
3108
|
+
}, fa = [
|
|
3074
3109
|
"facebook",
|
|
3075
3110
|
"twitter",
|
|
3076
3111
|
"instagram",
|
|
@@ -3088,11 +3123,11 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3088
3123
|
"github",
|
|
3089
3124
|
"dribbble",
|
|
3090
3125
|
"behance"
|
|
3091
|
-
],
|
|
3126
|
+
], pa = [
|
|
3092
3127
|
"width",
|
|
3093
3128
|
"height",
|
|
3094
3129
|
"fill"
|
|
3095
|
-
],
|
|
3130
|
+
], ma = ["d"], ha = /* @__PURE__ */ d({
|
|
3096
3131
|
__name: "SocialIconSvg",
|
|
3097
3132
|
props: {
|
|
3098
3133
|
platform: {},
|
|
@@ -3100,7 +3135,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3100
3135
|
iconSize: {}
|
|
3101
3136
|
},
|
|
3102
3137
|
setup(e) {
|
|
3103
|
-
let t = e, n = S(() =>
|
|
3138
|
+
let t = e, n = S(() => ua[t.platform]), r = S(() => da[t.iconSize]), i = S(() => {
|
|
3104
3139
|
let e = {
|
|
3105
3140
|
display: "inline-flex",
|
|
3106
3141
|
alignItems: "center",
|
|
@@ -3144,25 +3179,25 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3144
3179
|
viewBox: "0 0 24 24",
|
|
3145
3180
|
fill: o.value,
|
|
3146
3181
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3147
|
-
}, [M("path", { d: n.value.path }, null, 8,
|
|
3182
|
+
}, [M("path", { d: n.value.path }, null, 8, ma)], 8, pa))], 4));
|
|
3148
3183
|
}
|
|
3149
|
-
}),
|
|
3184
|
+
}), ga = { class: "tpl:w-full" }, _a = ["href"], va = {
|
|
3150
3185
|
key: 1,
|
|
3151
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)]"
|
|
3152
|
-
},
|
|
3187
|
+
}, ya = /* @__PURE__ */ d({
|
|
3153
3188
|
__name: "SocialIconsBlock",
|
|
3154
3189
|
props: {
|
|
3155
3190
|
block: {},
|
|
3156
3191
|
viewport: {}
|
|
3157
3192
|
},
|
|
3158
3193
|
setup(e) {
|
|
3159
|
-
let t = e, { t: n } =
|
|
3194
|
+
let t = e, { t: n } = J(), i = S(() => ({
|
|
3160
3195
|
display: "flex",
|
|
3161
3196
|
flexWrap: "wrap",
|
|
3162
3197
|
gap: `${t.block.spacing}px`,
|
|
3163
3198
|
justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
|
|
3164
3199
|
})), a = S(() => t.block.icons.length > 0);
|
|
3165
|
-
return (t, o) => (s(), C("div",
|
|
3200
|
+
return (t, o) => (s(), C("div", ga, [a.value ? (s(), C("div", {
|
|
3166
3201
|
key: 0,
|
|
3167
3202
|
style: k(i.value)
|
|
3168
3203
|
}, [(s(!0), C(L, null, r(e.block.icons, (t) => (s(), C("a", {
|
|
@@ -3170,7 +3205,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3170
3205
|
href: t.url || "#",
|
|
3171
3206
|
class: "tpl:cursor-default",
|
|
3172
3207
|
onClick: o[0] ||= O(() => {}, ["prevent"])
|
|
3173
|
-
}, [v(
|
|
3208
|
+
}, [v(ha, {
|
|
3174
3209
|
platform: t.platform,
|
|
3175
3210
|
"icon-style": e.block.iconStyle,
|
|
3176
3211
|
"icon-size": e.block.iconSize
|
|
@@ -3178,44 +3213,44 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3178
3213
|
"platform",
|
|
3179
3214
|
"icon-style",
|
|
3180
3215
|
"icon-size"
|
|
3181
|
-
])], 8,
|
|
3216
|
+
])], 8, _a))), 128))], 4)) : (s(), C("div", va, [v(_(It), { size: 16 }), M("span", null, R(_(n).social.addIcons), 1)]))]));
|
|
3182
3217
|
}
|
|
3183
|
-
}),
|
|
3218
|
+
}), ba = { class: "tpl:w-full" }, xa = {
|
|
3184
3219
|
key: 0,
|
|
3185
3220
|
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3186
3221
|
style: {
|
|
3187
3222
|
"background-color": "var(--tpl-bg-hover)",
|
|
3188
3223
|
color: "var(--tpl-text-dim)"
|
|
3189
3224
|
}
|
|
3190
|
-
},
|
|
3225
|
+
}, Sa = /* @__PURE__ */ d({
|
|
3191
3226
|
__name: "SpacerBlock",
|
|
3192
3227
|
props: {
|
|
3193
3228
|
block: {},
|
|
3194
3229
|
viewport: {}
|
|
3195
3230
|
},
|
|
3196
3231
|
setup(e) {
|
|
3197
|
-
let t = e, n =
|
|
3232
|
+
let t = e, n = $e(K, "SpacerBlock"), r = S(() => ({
|
|
3198
3233
|
height: `${t.block.height}px`,
|
|
3199
3234
|
minHeight: `${t.block.height}px`,
|
|
3200
3235
|
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3201
3236
|
}));
|
|
3202
|
-
return (t, i) => (s(), C("div",
|
|
3237
|
+
return (t, i) => (s(), C("div", ba, [M("div", {
|
|
3203
3238
|
style: k(r.value),
|
|
3204
3239
|
class: b(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !_(n).state.previewMode }])
|
|
3205
|
-
}, [_(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)]));
|
|
3206
3241
|
}
|
|
3207
|
-
}),
|
|
3242
|
+
}), Ca = { class: "tpl:w-full" }, wa = { key: 0 }, Ta = [
|
|
3208
3243
|
"aria-label",
|
|
3209
3244
|
"data-placeholder",
|
|
3210
3245
|
"onBlur"
|
|
3211
|
-
],
|
|
3246
|
+
], Ea = [
|
|
3212
3247
|
"aria-label",
|
|
3213
3248
|
"data-placeholder",
|
|
3214
3249
|
"onBlur"
|
|
3215
|
-
],
|
|
3250
|
+
], Da = {
|
|
3216
3251
|
key: 1,
|
|
3217
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)]"
|
|
3218
|
-
},
|
|
3253
|
+
}, Oa = /*#__PURE__*/ tn(/* @__PURE__ */ d({
|
|
3219
3254
|
__name: "TableBlock",
|
|
3220
3255
|
props: {
|
|
3221
3256
|
block: {},
|
|
@@ -3229,7 +3264,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3229
3264
|
updated(e, t) {
|
|
3230
3265
|
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
3231
3266
|
}
|
|
3232
|
-
}, n = e, { t: i } =
|
|
3267
|
+
}, n = e, { t: i } = J(), a = $e(K, "TableBlock"), o = S(() => n.block.rows.length > 0), c = S(() => {
|
|
3233
3268
|
let e = {
|
|
3234
3269
|
width: "100%",
|
|
3235
3270
|
borderCollapse: "collapse",
|
|
@@ -3260,11 +3295,11 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3260
3295
|
} : n);
|
|
3261
3296
|
a.updateBlock(n.block.id, { rows: o });
|
|
3262
3297
|
}
|
|
3263
|
-
return (e, n) => (s(), C("div",
|
|
3298
|
+
return (e, n) => (s(), C("div", Ca, [o.value ? (s(), C("table", {
|
|
3264
3299
|
key: 0,
|
|
3265
3300
|
style: k(c.value),
|
|
3266
3301
|
class: "tpl-table-editable"
|
|
3267
|
-
}, [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", {
|
|
3268
3303
|
key: e.id,
|
|
3269
3304
|
style: k(u.value),
|
|
3270
3305
|
"aria-label": _(i).table.cellPlaceholder,
|
|
@@ -3273,7 +3308,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3273
3308
|
onBlur: (t) => h(d.value.id, e.id, t),
|
|
3274
3309
|
onKeydown: n[0] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3275
3310
|
onClick: O(m, ["stop"])
|
|
3276
|
-
}, 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", {
|
|
3277
3312
|
key: r.id,
|
|
3278
3313
|
style: k(l.value),
|
|
3279
3314
|
"aria-label": _(i).table.cellPlaceholder,
|
|
@@ -3282,9 +3317,9 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3282
3317
|
onBlur: (t) => h(e.id, r.id, t),
|
|
3283
3318
|
onKeydown: n[1] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3284
3319
|
onClick: O(m, ["stop"])
|
|
3285
|
-
}, 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)]))]));
|
|
3286
3321
|
}
|
|
3287
|
-
}), [["__scopeId", "data-v-963ac422"]]),
|
|
3322
|
+
}), [["__scopeId", "data-v-963ac422"]]), ka = /* @__PURE__ */ d({
|
|
3288
3323
|
__name: "VideoPlayButton",
|
|
3289
3324
|
props: { hoverEffect: {
|
|
3290
3325
|
type: Boolean,
|
|
@@ -3302,7 +3337,7 @@ var ea = { class: "tpl:w-full" }, ta = {
|
|
|
3302
3337
|
});
|
|
3303
3338
|
//#endregion
|
|
3304
3339
|
//#region src/utils/videoThumbnail.ts
|
|
3305
|
-
function
|
|
3340
|
+
function Aa(e) {
|
|
3306
3341
|
if (!e) return {
|
|
3307
3342
|
platform: "unknown",
|
|
3308
3343
|
videoId: null,
|
|
@@ -3334,25 +3369,25 @@ function Ca(e) {
|
|
|
3334
3369
|
thumbnailUrl: null
|
|
3335
3370
|
};
|
|
3336
3371
|
}
|
|
3337
|
-
function
|
|
3338
|
-
return t ||
|
|
3372
|
+
function ja(e, t) {
|
|
3373
|
+
return t || Aa(e).thumbnailUrl;
|
|
3339
3374
|
}
|
|
3340
3375
|
//#endregion
|
|
3341
3376
|
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3342
|
-
var
|
|
3377
|
+
var Ma = ["src", "alt"], Na = {
|
|
3343
3378
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
3344
3379
|
style: { opacity: "0.7" }
|
|
3345
|
-
},
|
|
3380
|
+
}, Pa = ["href"], Fa = ["src", "alt"], Ia = ["src", "alt"], La = {
|
|
3346
3381
|
key: 3,
|
|
3347
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)]"
|
|
3348
|
-
},
|
|
3383
|
+
}, Ra = /* @__PURE__ */ d({
|
|
3349
3384
|
__name: "VideoBlock",
|
|
3350
3385
|
props: {
|
|
3351
3386
|
block: {},
|
|
3352
3387
|
viewport: {}
|
|
3353
3388
|
},
|
|
3354
3389
|
setup(e) {
|
|
3355
|
-
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(() => {
|
|
3356
3391
|
let e = t.block.align;
|
|
3357
3392
|
return {
|
|
3358
3393
|
maxWidth: "100%",
|
|
@@ -3362,7 +3397,7 @@ var Ta = ["src", "alt"], Ea = {
|
|
|
3362
3397
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
3363
3398
|
marginRight: e === "center" ? "auto" : void 0
|
|
3364
3399
|
};
|
|
3365
|
-
}), 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);
|
|
3366
3401
|
return (t, r) => (s(), C("div", {
|
|
3367
3402
|
class: "tpl:w-full",
|
|
3368
3403
|
style: k(l.value)
|
|
@@ -3375,16 +3410,16 @@ var Ta = ["src", "alt"], Ea = {
|
|
|
3375
3410
|
src: _(o),
|
|
3376
3411
|
alt: e.block.alt,
|
|
3377
3412
|
style: k(d.value)
|
|
3378
|
-
}, null, 12,
|
|
3413
|
+
}, null, 12, Ma), v(ka)], 4)) : i.value ? (s(), C("div", {
|
|
3379
3414
|
key: 1,
|
|
3380
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)]",
|
|
3381
3416
|
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
3382
|
-
}, [v(_(
|
|
3417
|
+
}, [v(_(qt), {
|
|
3383
3418
|
size: 36,
|
|
3384
3419
|
"stroke-width": 1.5,
|
|
3385
3420
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
3386
3421
|
style: { opacity: "0.5" }
|
|
3387
|
-
}), 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", {
|
|
3388
3423
|
key: 0,
|
|
3389
3424
|
href: e.block.url,
|
|
3390
3425
|
target: "_blank",
|
|
@@ -3397,7 +3432,7 @@ var Ta = ["src", "alt"], Ea = {
|
|
|
3397
3432
|
src: c.value,
|
|
3398
3433
|
alt: e.block.alt,
|
|
3399
3434
|
style: k(d.value)
|
|
3400
|
-
}, null, 12,
|
|
3435
|
+
}, null, 12, Fa), v(ka, { "hover-effect": "" })], 12, Pa)) : (s(), C("div", {
|
|
3401
3436
|
key: 1,
|
|
3402
3437
|
class: "tpl:relative tpl:inline-block",
|
|
3403
3438
|
style: k(u.value)
|
|
@@ -3406,51 +3441,51 @@ var Ta = ["src", "alt"], Ea = {
|
|
|
3406
3441
|
src: c.value,
|
|
3407
3442
|
alt: e.block.alt,
|
|
3408
3443
|
style: k(d.value)
|
|
3409
|
-
}, null, 12,
|
|
3444
|
+
}, null, 12, Ia), v(ka)], 4))], 64)) : (s(), C("div", La, [v(_(qt), {
|
|
3410
3445
|
size: 40,
|
|
3411
3446
|
"stroke-width": 1.5,
|
|
3412
3447
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
3413
3448
|
}), M("span", null, R(_(n).video.addVideo), 1)]))], 4));
|
|
3414
3449
|
}
|
|
3415
|
-
}),
|
|
3416
|
-
section:
|
|
3417
|
-
title:
|
|
3418
|
-
paragraph:
|
|
3419
|
-
image:
|
|
3420
|
-
button:
|
|
3421
|
-
divider:
|
|
3422
|
-
video:
|
|
3423
|
-
social:
|
|
3424
|
-
menu:
|
|
3425
|
-
table:
|
|
3426
|
-
spacer:
|
|
3427
|
-
html:
|
|
3428
|
-
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"))
|
|
3429
3464
|
};
|
|
3430
|
-
function
|
|
3431
|
-
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 ?? {}));
|
|
3432
3467
|
n.setUiTheme(r.uiTheme ?? "auto");
|
|
3433
|
-
let { resolvedTheme: f } =
|
|
3468
|
+
let { resolvedTheme: f } = Bn(S(() => n.state.uiTheme)), p = l(r.theme ?? {}), { themeStyles: m } = Hn({
|
|
3434
3469
|
themeOverrides: p,
|
|
3435
3470
|
resolvedTheme: f,
|
|
3436
3471
|
extraStyles: () => ({
|
|
3437
3472
|
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
3438
3473
|
...e.themeExtraStyles?.()
|
|
3439
3474
|
})
|
|
3440
|
-
}), g =
|
|
3475
|
+
}), g = fn({
|
|
3441
3476
|
content: n.content,
|
|
3442
3477
|
setContent: (e, t) => n.setContent(e, t),
|
|
3443
3478
|
...e.historyOptions
|
|
3444
3479
|
});
|
|
3445
|
-
|
|
3446
|
-
let _ =
|
|
3480
|
+
yn(n, g);
|
|
3481
|
+
let _ = mn({
|
|
3447
3482
|
addBlock: n.addBlock,
|
|
3448
3483
|
removeBlock: n.removeBlock,
|
|
3449
3484
|
updateBlock: n.updateBlock,
|
|
3450
3485
|
selectBlock: n.selectBlock,
|
|
3451
3486
|
findBlockLocation: n.findBlockLocation,
|
|
3452
3487
|
blockDefaults: () => d.value
|
|
3453
|
-
}), v =
|
|
3488
|
+
}), v = _n(n), y = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? gn({
|
|
3454
3489
|
content: n.content,
|
|
3455
3490
|
isDirty: () => n.state.isDirty,
|
|
3456
3491
|
...e.autoSaveOptions
|
|
@@ -3458,33 +3493,35 @@ function Na(e) {
|
|
|
3458
3493
|
y && (b = t(g.isNavigating, (e) => {
|
|
3459
3494
|
e ? y.pause() : y.resume();
|
|
3460
3495
|
}));
|
|
3461
|
-
let x =
|
|
3496
|
+
let x = zn(n, {
|
|
3462
3497
|
t: s,
|
|
3463
3498
|
format: u
|
|
3464
|
-
}, r.customBlocks ?? []), C =
|
|
3465
|
-
if (C.allowCustomIgnored &&
|
|
3466
|
-
let e =
|
|
3467
|
-
e.length > 0 &&
|
|
3468
|
-
}
|
|
3469
|
-
let w =
|
|
3470
|
-
|
|
3471
|
-
let T =
|
|
3472
|
-
|
|
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);
|
|
3508
|
+
let E = /* @__PURE__ */ new Set();
|
|
3509
|
+
function D(e) {
|
|
3473
3510
|
for (let t of e) {
|
|
3474
|
-
|
|
3475
|
-
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));
|
|
3476
3513
|
}
|
|
3477
3514
|
}
|
|
3478
|
-
r.customBlocks?.length &&
|
|
3479
|
-
let
|
|
3480
|
-
if (o() && h(
|
|
3515
|
+
r.customBlocks?.length && D(r.customBlocks);
|
|
3516
|
+
let O = On();
|
|
3517
|
+
if (o() && h(O.dispose), e.containerEl) {
|
|
3481
3518
|
let t = e.containerEl;
|
|
3482
|
-
|
|
3519
|
+
W(document, "pointerdown", (e) => {
|
|
3483
3520
|
let n = t.value;
|
|
3484
|
-
n && (e.composedPath?.() ?? []).includes(n) &&
|
|
3521
|
+
n && (e.composedPath?.() ?? []).includes(n) && O.claim();
|
|
3485
3522
|
}, { capture: !0 });
|
|
3486
3523
|
}
|
|
3487
|
-
function
|
|
3524
|
+
function k() {
|
|
3488
3525
|
let t = e.capabilities?.templates;
|
|
3489
3526
|
if (t) {
|
|
3490
3527
|
t.save();
|
|
@@ -3492,46 +3529,46 @@ function Na(e) {
|
|
|
3492
3529
|
}
|
|
3493
3530
|
y?.flush();
|
|
3494
3531
|
}
|
|
3495
|
-
function
|
|
3496
|
-
|
|
3532
|
+
function A(t) {
|
|
3533
|
+
O.isActive() && Tr(t, {
|
|
3497
3534
|
history: g,
|
|
3498
3535
|
selectBlock: (e) => n.selectBlock(e),
|
|
3499
3536
|
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
3500
3537
|
removeBlock: (e) => n.removeBlock(e),
|
|
3501
|
-
onSave:
|
|
3538
|
+
onSave: k,
|
|
3502
3539
|
onBeforeUndo: e.keyboardOptions?.onBeforeUndo,
|
|
3503
3540
|
isPicking: () => e.capabilities?.savedBlocks?.isPicking.value === !0,
|
|
3504
3541
|
onConfirmPick: () => e.capabilities?.savedBlocks?.confirmPicking(),
|
|
3505
3542
|
onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
|
|
3506
3543
|
});
|
|
3507
3544
|
}
|
|
3508
|
-
|
|
3509
|
-
let
|
|
3510
|
-
c(
|
|
3511
|
-
let
|
|
3512
|
-
c(
|
|
3513
|
-
let
|
|
3514
|
-
c(
|
|
3515
|
-
let
|
|
3545
|
+
W(document, "keydown", A);
|
|
3546
|
+
let j = l(null);
|
|
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({
|
|
3516
3553
|
resolvePreview: r.resolvePreview,
|
|
3517
3554
|
getContent: () => n.content.value,
|
|
3518
3555
|
isActive: () => n.state.previewMode
|
|
3519
3556
|
});
|
|
3520
|
-
c(
|
|
3521
|
-
let
|
|
3522
|
-
c(
|
|
3523
|
-
let
|
|
3524
|
-
c(
|
|
3525
|
-
let
|
|
3557
|
+
c(tt, P), c(ot, r.resolvePreview);
|
|
3558
|
+
let F = S(() => !(n.state.previewMode && P.isConfigured));
|
|
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({
|
|
3526
3563
|
content: n.content,
|
|
3527
3564
|
options: r.lint ?? {},
|
|
3528
3565
|
updateBlock: n.updateBlock,
|
|
3529
3566
|
updateSettings: n.updateSettings,
|
|
3530
3567
|
removeBlock: n.removeBlock
|
|
3531
3568
|
});
|
|
3532
|
-
c(
|
|
3533
|
-
function
|
|
3534
|
-
b?.(),
|
|
3569
|
+
c(ut, L);
|
|
3570
|
+
function R() {
|
|
3571
|
+
b?.(), L?.destroy(), y?.destroy(), g.destroy();
|
|
3535
3572
|
}
|
|
3536
3573
|
return {
|
|
3537
3574
|
t: s,
|
|
@@ -3543,18 +3580,18 @@ function Na(e) {
|
|
|
3543
3580
|
resolvedTheme: f,
|
|
3544
3581
|
themeStyles: m,
|
|
3545
3582
|
themeOverrides: p,
|
|
3546
|
-
registry:
|
|
3583
|
+
registry: T,
|
|
3547
3584
|
keyboardReorder: x,
|
|
3548
|
-
templateLint:
|
|
3549
|
-
popoverRoot:
|
|
3550
|
-
mergeTagSampleMode:
|
|
3551
|
-
previewResolution:
|
|
3552
|
-
appliesConditionFilter:
|
|
3553
|
-
registerCustomBlocks:
|
|
3554
|
-
destroy:
|
|
3585
|
+
templateLint: L,
|
|
3586
|
+
popoverRoot: j,
|
|
3587
|
+
mergeTagSampleMode: N,
|
|
3588
|
+
previewResolution: P,
|
|
3589
|
+
appliesConditionFilter: F,
|
|
3590
|
+
registerCustomBlocks: D,
|
|
3591
|
+
destroy: R
|
|
3555
3592
|
};
|
|
3556
3593
|
}
|
|
3557
3594
|
//#endregion
|
|
3558
|
-
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 };
|
|
3559
3596
|
|
|
3560
|
-
//# sourceMappingURL=useEditorCore-
|
|
3597
|
+
//# sourceMappingURL=useEditorCore-ehUSEsbw.js.map
|