@templatical/editor 0.45.0 → 0.46.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-BlFWWhBv.js → AiChatSidebar-DGcH4Lyo.js} +1 -1
- package/dist/{AiFeatureMenu-CvWygUmC.js → AiFeatureMenu-B4q-0g1S.js} +1 -1
- package/dist/{BlockPreviewCanvas-DwxJOTzH.js → BlockPreviewCanvas-DIZ0KgUD.js} +3 -3
- package/dist/{CloudHeaderExtras-BzM1QU1r.js → CloudHeaderExtras-ehMYJP68.js} +1 -1
- package/dist/{CloudPanels-d36YXXyn.js → CloudPanels-BwOaAlKz.js} +2 -2
- package/dist/{CollaboratorBar-rwXe_Qd2.js → CollaboratorBar-qOZFRNPx.js} +1 -1
- package/dist/{CountdownToolbar-lbjCc8ik.js → CountdownToolbar-BeF21SeB.js} +4 -4
- package/dist/{DesignReferenceSidebar-zlJQsP0X.js → DesignReferenceSidebar-zH93uB15.js} +1 -1
- package/dist/{IssuesPanel-CHx3m8SP.js → IssuesPanel-Dltw9haP.js} +1 -1
- package/dist/{LogicTagInsertButton-BvftbkL4.js → LogicTagInsertButton-CHa-UD76.js} +12 -12
- package/dist/{MergeTagInput-CR1kcj8X.js → MergeTagInput-B3ntd4dN.js} +1 -1
- package/dist/{MergeTagModeToggle-DssKrVYb.js → MergeTagModeToggle-C_06ZL0Q.js} +1 -1
- package/dist/{ParagraphEditor-DFizsZRc.js → ParagraphEditor-CxuW3TV0.js} +6 -6
- package/dist/{RestoreVersionDialog-Cp3q2mU4.js → RestoreVersionDialog-B1n37M1Z.js} +1 -1
- package/dist/{RichTextEditorContent-Cj3oaPMk.js → RichTextEditorContent-CP_uULWB.js} +2 -2
- package/dist/{SaveBlockDialog-BR8vW_XF.js → SaveBlockDialog-BSKX_7_v.js} +5 -5
- package/dist/{SavedBlocksBrowserModal-DmwbmKxI.js → SavedBlocksBrowserModal-CHKrH1gO.js} +4 -4
- package/dist/{SavedBlocksPanels-D4XKrs-a.js → SavedBlocksPanels-B-xDqBcz.js} +1 -1
- package/dist/{SavedBlocksPickBar-gfc-o5sR.js → SavedBlocksPickBar-D2J-g82g.js} +1 -1
- package/dist/{TemplateSettings-D7aNrd0d.js → TemplateSettings-D07K_Y4m.js} +4 -4
- package/dist/{TestEmailModal-DUmtcSm-.js → TestEmailModal-BNPw_lID.js} +5 -5
- package/dist/{TestEmailPanel-s9gISTI8.js → TestEmailPanel-8klWo8hE.js} +1 -1
- package/dist/{TitleEditor-C-uHqtml.js → TitleEditor-CmC9OuhA.js} +4 -4
- package/dist/{ToggleSwitch-CTwwCIVA.js → ToggleSwitch-COeyWGfT.js} +1 -1
- package/dist/{Toolbar-CLpA36RO.js → Toolbar-CqhRb6EM.js} +36 -36
- package/dist/{TplModal-D6XtxusQ.js → TplModal-BGFawHY9.js} +1 -1
- package/dist/{VersionHistoryPanels-Dvowtt7V.js → VersionHistoryPanels-DdbGjEOR.js} +1 -1
- package/dist/{WrapperBlock-CzJa2Mxw.js → WrapperBlock-CTkmA887.js} +1 -1
- package/dist/{blockTypeIcons-D3aj5u_5.js → blockTypeIcons-CVKo6V_v.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-SRGBP-SL.js → AiChatSidebar-kCK4NZM9.js} +2 -2
- package/dist/cdn/chunks/{AiChatSidebar-SRGBP-SL.js.map → AiChatSidebar-kCK4NZM9.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-oZhlgsGh.js → AiFeatureMenu-K1dLeDft.js} +2 -2
- package/dist/cdn/chunks/{AiFeatureMenu-oZhlgsGh.js.map → AiFeatureMenu-K1dLeDft.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-hKxE6f-k.js → BlockPreviewCanvas-Djz9YAFx.js} +4 -4
- package/dist/cdn/chunks/{BlockPreviewCanvas-hKxE6f-k.js.map → BlockPreviewCanvas-Djz9YAFx.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-t-_ZlHwn.js → CloudHeaderExtras-5ONQ1RCa.js} +2 -2
- package/dist/cdn/chunks/{CloudHeaderExtras-t-_ZlHwn.js.map → CloudHeaderExtras-5ONQ1RCa.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-DR2eEcpX.js → CloudPanels-_irSdWbi.js} +3 -3
- package/dist/cdn/chunks/{CloudPanels-DR2eEcpX.js.map → CloudPanels-_irSdWbi.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-w8_2WPE0.js → CollaboratorBar-CZufI1On.js} +2 -2
- package/dist/cdn/chunks/{CollaboratorBar-w8_2WPE0.js.map → CollaboratorBar-CZufI1On.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CvNuDR5Z.js → CountdownToolbar-BaXCefQM.js} +5 -5
- package/dist/cdn/chunks/{CountdownToolbar-CvNuDR5Z.js.map → CountdownToolbar-BaXCefQM.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-CJg_5GXU.js → DesignReferenceSidebar-GjkpHylX.js} +2 -2
- package/dist/cdn/chunks/{DesignReferenceSidebar-CJg_5GXU.js.map → DesignReferenceSidebar-GjkpHylX.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-DXqlRk19.js → IssuesPanel-C1Lv2y_O.js} +2 -2
- package/dist/cdn/chunks/{IssuesPanel-DXqlRk19.js.map → IssuesPanel-C1Lv2y_O.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-DnHghQHb.js → LogicTagInsertButton-BYjdrDnQ.js} +4 -4
- package/dist/cdn/chunks/{LogicTagInsertButton-DnHghQHb.js.map → LogicTagInsertButton-BYjdrDnQ.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-heTX9P_k.js → MergeTagInput-Cx67J_vg.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-heTX9P_k.js.map → MergeTagInput-Cx67J_vg.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-C9EfuZIP.js → MergeTagModeToggle-DZ4EuXVp.js} +2 -2
- package/dist/cdn/chunks/{MergeTagModeToggle-C9EfuZIP.js.map → MergeTagModeToggle-DZ4EuXVp.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-B5DN4Sy4.js → ParagraphEditor-DndEFXmR.js} +7 -7
- package/dist/cdn/chunks/{ParagraphEditor-B5DN4Sy4.js.map → ParagraphEditor-DndEFXmR.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-DBgJ-Nui.js → RestoreVersionDialog-CFYs13a4.js} +2 -2
- package/dist/cdn/chunks/{RestoreVersionDialog-DBgJ-Nui.js.map → RestoreVersionDialog-CFYs13a4.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-LOas4rfU.js → RichTextEditorContent-DKkDQ0dc.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-LOas4rfU.js.map → RichTextEditorContent-DKkDQ0dc.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-Dx-QVQCX.js → SaveBlockDialog-BOA2RaC_.js} +6 -6
- package/dist/cdn/chunks/{SaveBlockDialog-Dx-QVQCX.js.map → SaveBlockDialog-BOA2RaC_.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-C2RQ-JCc.js → SavedBlocksBrowserModal-DQDVek3K.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-C2RQ-JCc.js.map → SavedBlocksBrowserModal-DQDVek3K.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-BmRbvqqL.js → SavedBlocksPanels-Lu3tJ3QA.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-BmRbvqqL.js.map → SavedBlocksPanels-Lu3tJ3QA.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BzwKojoJ.js → SavedBlocksPickBar-D7MtqG6r.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPickBar-BzwKojoJ.js.map → SavedBlocksPickBar-D7MtqG6r.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-G-yV7C1C.js → TemplateSettings-rZiHmq24.js} +5 -5
- package/dist/cdn/chunks/{TemplateSettings-G-yV7C1C.js.map → TemplateSettings-rZiHmq24.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-lOeztfTN.js → TestEmailModal-DWEyHXH2.js} +6 -6
- package/dist/cdn/chunks/{TestEmailModal-lOeztfTN.js.map → TestEmailModal-DWEyHXH2.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CZswVkk_.js → TestEmailPanel-XXMD-Lnr.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CZswVkk_.js.map → TestEmailPanel-XXMD-Lnr.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CnTT2Y3H.js → TitleEditor-D1F0YoE-.js} +4 -4
- package/dist/cdn/chunks/{TitleEditor-CnTT2Y3H.js.map → TitleEditor-D1F0YoE-.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-CLHteVMO.js → ToggleSwitch-B5U9cqhi.js} +2 -2
- package/dist/cdn/chunks/{ToggleSwitch-CLHteVMO.js.map → ToggleSwitch-B5U9cqhi.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-K4tIkpG1.js → Toolbar-C_5HfUQq.js} +55 -55
- package/dist/cdn/chunks/{Toolbar-K4tIkpG1.js.map → Toolbar-C_5HfUQq.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-OOT36AjS.js → TplModal-CYBbPCHL.js} +2 -2
- package/dist/cdn/chunks/{TplModal-OOT36AjS.js.map → TplModal-CYBbPCHL.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BrpYRSfW.js → VersionHistoryPanels-Dq12VsTX.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BrpYRSfW.js.map → VersionHistoryPanels-Dq12VsTX.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-DdrnwH80.js → WrapperBlock-CJ0CLqi2.js} +2 -2
- package/dist/cdn/chunks/{WrapperBlock-DdrnwH80.js.map → WrapperBlock-CJ0CLqi2.js.map} +1 -1
- package/dist/cdn/chunks/{cloud-bhW8qTnh.js → cloud-h1vaHp2p.js} +2 -2
- package/dist/cdn/chunks/{cloud-bhW8qTnh.js.map → cloud-h1vaHp2p.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-CeRJkLR2.js → createCloudRuntime-bJN9EM1H.js} +3 -3
- package/dist/cdn/chunks/{createCloudRuntime-CeRJkLR2.js.map → createCloudRuntime-bJN9EM1H.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-xjRsIjMP.js → extensions-CrmXF4MW.js} +6 -6
- package/dist/cdn/chunks/extensions-CrmXF4MW.js.map +1 -0
- package/dist/{preRenderCustomBlocks-DAS48ZCp.js → cdn/chunks/preRenderCustomBlocks-CyGB3lZr.js} +5 -3
- package/dist/cdn/chunks/{preRenderCustomBlocks-CFwa7nP9.js.map → preRenderCustomBlocks-CyGB3lZr.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-CsYnPPll.js → socialIcons-ClJVDZwt.js} +82 -101
- package/dist/cdn/chunks/socialIcons-ClJVDZwt.js.map +1 -0
- package/dist/cdn/chunks/{src-HA9F2kvk.js → src-B0pZeTYO.js} +200 -183
- package/dist/cdn/chunks/src-B0pZeTYO.js.map +1 -0
- package/dist/cdn/chunks/{src-CkXmV2I2.js → src-BMw3u-iV.js} +213 -215
- package/dist/cdn/chunks/src-BMw3u-iV.js.map +1 -0
- package/dist/cdn/chunks/{src-BcqNlDMe.js → src-Bh0MoJ67.js} +280 -187
- package/dist/cdn/chunks/src-Bh0MoJ67.js.map +1 -0
- package/dist/cdn/chunks/{useEditorCore-BF1ZhcGu.js → useEditorCore-DuC7kVti.js} +323 -319
- package/dist/cdn/chunks/useEditorCore-DuC7kVti.js.map +1 -0
- package/dist/cdn/chunks/{useLogicTag-91bO_SOi.js → useLogicTag-B3uV3XHG.js} +2 -2
- package/dist/cdn/chunks/{useLogicTag-91bO_SOi.js.map → useLogicTag-B3uV3XHG.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-hwifK582.js → useMergeTag-DJLM-7WQ.js} +2 -2
- package/dist/cdn/chunks/{useMergeTag-hwifK582.js.map → useMergeTag-DJLM-7WQ.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-BDNJ25X1.js → useScrollToBlock-CpmB5KxW.js} +2 -3
- package/dist/cdn/chunks/useScrollToBlock-CpmB5KxW.js.map +1 -0
- package/dist/cdn/chunks/withCurrentFont-isIyuezD.js +21 -0
- package/dist/cdn/chunks/withCurrentFont-isIyuezD.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +435 -417
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{cloud-CVfwPu19.js → cloud-DPGjMGfv.js} +1 -1
- package/dist/{createCloudRuntime-GRv_TDb2.js → createCloudRuntime-D0RRgWab.js} +2 -2
- package/dist/{dist-CSaWqmWM.js → dist-BI_LeQGl.js} +271 -200
- package/dist/{extensions-B65sfZRk.js → extensions-CYigjb1g.js} +13 -13
- package/dist/index.d.ts +34 -12
- package/dist/{cdn/chunks/preRenderCustomBlocks-CFwa7nP9.js → preRenderCustomBlocks-DokBGA_M.js} +3 -5
- package/dist/{socialIcons-CvAixjj8.js → socialIcons-Ct_IoqPQ.js} +107 -126
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +456 -438
- package/dist/{useEditorCore-DQSeKPE9.js → useEditorCore-BJAQMvNW.js} +482 -478
- package/dist/{useLogicTag-BH87j1vZ.js → useLogicTag-B5gjcMzn.js} +1 -1
- package/dist/{useMergeTag-DfPKX2Tk.js → useMergeTag-BwsBIDzR.js} +3 -3
- package/dist/{useScrollToBlock-Dr7Sb6Tr.js → useScrollToBlock-JRxhT1u_.js} +1 -2
- package/dist/withCurrentFont-C9vqrduu.js +19 -0
- package/package.json +8 -8
- package/dist/cdn/chunks/extensions-xjRsIjMP.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-CsYnPPll.js.map +0 -1
- package/dist/cdn/chunks/src-BcqNlDMe.js.map +0 -1
- package/dist/cdn/chunks/src-CkXmV2I2.js.map +0 -1
- package/dist/cdn/chunks/src-HA9F2kvk.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-BF1ZhcGu.js.map +0 -1
- package/dist/cdn/chunks/useScrollToBlock-BDNJ25X1.js.map +0 -1
- package/dist/cdn/chunks/withCurrentFont-DeCbPVaE.js +0 -32
- package/dist/cdn/chunks/withCurrentFont-DeCbPVaE.js.map +0 -1
- package/dist/withCurrentFont-DeCbPVaE.js +0 -30
|
@@ -1,35 +1,35 @@
|
|
|
1
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, X as p, Y as m, at as h, b as g, c as _, ct as v, et as y, f as b, g as x, h as S, it as C, j as w, k as T, l as E, lt as D, m as O, p as k, q as A, rt as j, s as M, t as N, u as P, ut as F, w as I, x as L, y as R } from "./draggable-BUTN5vZC.js";
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { a as
|
|
6
|
-
import { $ as
|
|
2
|
+
import { $ as z, B, Ct as V, Dt as H, Et as ee, F as te, G as ne, H as re, I as ie, K as ae, L as oe, M as se, N as ce, P as le, Q as ue, R as de, T as fe, Tt as pe, U as me, W as he, X as ge, Y as _e, _ as ve, a as ye, bt as be, d as xe, et as Se, f as Ce, g as we, h as Te, ht as Ee, i as U, l as De, m as Oe, n as ke, nt as Ae, o as je, p as Me, r as Ne, s as Pe, u as Fe, v as Ie, vt as Le, wt as Re, yt as ze, z as Be } from "./src-Bh0MoJ67.js";
|
|
3
|
+
import { a as Ve, b as He, g as Ue, h as We, i as Ge, m as Ke, n as qe, o as Je, t as Ye, v as Xe, y as Ze } from "./socialIcons-ClJVDZwt.js";
|
|
4
|
+
import { _ as Qe, h as $e, v as et, y as tt } from "./dist-B7W-Lb65.js";
|
|
5
|
+
import { a as W, c as nt, i as rt } from "./dist-C5nRd_ua.js";
|
|
6
|
+
import { $ as it, A as at, B as ot, C as st, D as ct, E as lt, F as G, G as ut, H as dt, I as ft, J as pt, K as mt, L as ht, M as gt, N as _t, O as K, P as vt, Q as q, R as yt, S as bt, T as xt, V as St, X as Ct, Y as wt, Z as Tt, _ as Et, a as Dt, b as Ot, c as kt, d as At, f as jt, g as J, h as Mt, j as Nt, k as Pt, l as Ft, m as It, n as Lt, o as Rt, p as zt, q as Bt, r as Vt, s as Ht, v as Ut, w as Wt, x as Gt, y as Kt, z as qt } from "./keys-BKu-LOk5.js";
|
|
7
7
|
import "./timeouts-DHPZQ0G3.js";
|
|
8
|
-
import { t as
|
|
9
|
-
import { t as
|
|
10
|
-
import { i as
|
|
11
|
-
import { r as
|
|
12
|
-
import { Bt as
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as
|
|
8
|
+
import { t as Y } from "./useI18n-DO4NTunW.js";
|
|
9
|
+
import { t as X } from "./logger-ByvdoAwq.js";
|
|
10
|
+
import { i as Jt, r as Z, s as Yt, t as Xt } from "./usePopoverPosition-CtVNwoHj.js";
|
|
11
|
+
import { r as Zt, t as Qt } from "./templateSettingsFields-YCFVBVYh.js";
|
|
12
|
+
import { Bt as $t, Dt as en, Tt as tn, U as nn, Vt as rn, Z as an, at as on, d as sn, f as cn, gt as ln, j as un, kt as dn, nt as fn, o as pn, pt as mn, s as hn, y as gn, yt as _n } from "./icons-Dr9erFGs.js";
|
|
13
|
+
import { t as vn } from "./LoadingTrack-Cg1HRIND.js";
|
|
14
|
+
import { t as yn } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
15
|
+
import { t as bn } from "./useEditorRoot-DDPIcEOO.js";
|
|
16
16
|
import "./useCloudI18n-Cgk0ts_F.js";
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
17
|
+
import { t as xn } from "./useMergeTag-DJLM-7WQ.js";
|
|
18
|
+
import { t as Sn } from "./useLogicTag-B3uV3XHG.js";
|
|
19
|
+
import { t as Cn } from "./useAliveFlag-DzyXG-8A.js";
|
|
20
20
|
//#region src/utils/activeEditorTracker.ts
|
|
21
|
-
var
|
|
22
|
-
function
|
|
23
|
-
let e = ++
|
|
24
|
-
return
|
|
21
|
+
var wn = /* @__PURE__ */ new Set(), Q = 0, Tn = 0;
|
|
22
|
+
function En() {
|
|
23
|
+
let e = ++Tn;
|
|
24
|
+
return wn.add(e), Q === 0 && (Q = e), {
|
|
25
25
|
id: e,
|
|
26
|
-
isActive: () =>
|
|
26
|
+
isActive: () => wn.size <= 1 || Q === e,
|
|
27
27
|
claim: () => {
|
|
28
28
|
Q = e;
|
|
29
29
|
},
|
|
30
30
|
dispose: () => {
|
|
31
|
-
if (
|
|
32
|
-
let e = Array.from(
|
|
31
|
+
if (wn.delete(e), Q === e) {
|
|
32
|
+
let e = Array.from(wn);
|
|
33
33
|
Q = e[e.length - 1] ?? 0;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -37,8 +37,8 @@ function Tn() {
|
|
|
37
37
|
}
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/composables/usePreviewResolution.ts
|
|
40
|
-
var
|
|
41
|
-
function
|
|
40
|
+
var Dn = 500;
|
|
41
|
+
function On(e) {
|
|
42
42
|
let n = typeof e.resolvePreview == "function", r = l(null), i = l(!1), a = l(!1), o = 0, s = null;
|
|
43
43
|
function c() {
|
|
44
44
|
s !== null && (clearTimeout(s), s = null);
|
|
@@ -49,13 +49,13 @@ function Dn(e) {
|
|
|
49
49
|
let n = ++o;
|
|
50
50
|
i.value = !0;
|
|
51
51
|
let s = {
|
|
52
|
-
content:
|
|
52
|
+
content: _e(e.getContent()),
|
|
53
53
|
...e.getRecipient?.() === void 0 ? {} : { recipient: e.getRecipient() }
|
|
54
54
|
};
|
|
55
55
|
try {
|
|
56
56
|
let e = await t(s);
|
|
57
57
|
if (n !== o) return;
|
|
58
|
-
if (!
|
|
58
|
+
if (!ke(e)) {
|
|
59
59
|
a.value = !0;
|
|
60
60
|
return;
|
|
61
61
|
}
|
|
@@ -70,7 +70,7 @@ function Dn(e) {
|
|
|
70
70
|
function d() {
|
|
71
71
|
n && (c(), r.value === null ? u() : s = setTimeout(() => {
|
|
72
72
|
s = null, u();
|
|
73
|
-
},
|
|
73
|
+
}, Dn));
|
|
74
74
|
}
|
|
75
75
|
return t(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
|
|
76
76
|
e ? d() : (c(), o++, i.value = !1, r.value = null, a.value = !1);
|
|
@@ -87,7 +87,7 @@ function Dn(e) {
|
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region src/composables/useImageUrlResolver.ts
|
|
90
|
-
function
|
|
90
|
+
function kn(e) {
|
|
91
91
|
let t = p(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
92
92
|
function r(e) {
|
|
93
93
|
return t.get(e);
|
|
@@ -116,8 +116,8 @@ function On(e) {
|
|
|
116
116
|
lookup: a
|
|
117
117
|
};
|
|
118
118
|
}
|
|
119
|
-
function
|
|
120
|
-
let r = n(
|
|
119
|
+
function An(e) {
|
|
120
|
+
let r = n(Gt, null), i = b(e);
|
|
121
121
|
if (!r) return i;
|
|
122
122
|
let a;
|
|
123
123
|
function s() {
|
|
@@ -140,7 +140,7 @@ function kn(e) {
|
|
|
140
140
|
}
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region src/composables/useMergeTagPicker.ts
|
|
143
|
-
function
|
|
143
|
+
function jn() {
|
|
144
144
|
let e = l(!1), t = l([]), n = l(null), r = null;
|
|
145
145
|
function i(i, a) {
|
|
146
146
|
if (r) {
|
|
@@ -171,7 +171,7 @@ function An() {
|
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region src/composables/useLogicTagPicker.ts
|
|
174
|
-
function
|
|
174
|
+
function Mn() {
|
|
175
175
|
let e = l(!1), t = l([]), n = l([]), r = null;
|
|
176
176
|
function i(i, a) {
|
|
177
177
|
if (r) {
|
|
@@ -202,17 +202,17 @@ function jn() {
|
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
204
|
//#region src/composables/useTemplateLint.ts
|
|
205
|
-
function
|
|
205
|
+
function Nn(e) {
|
|
206
206
|
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
let n = l([]), r = l(!1), i = l(!1), a = y(null), o =
|
|
208
|
+
function Pn(e) {
|
|
209
|
+
let n = l([]), r = l(!1), i = l(!1), a = y(null), o = Nn(e.options), s = null, c = !1;
|
|
210
210
|
o || u();
|
|
211
211
|
async function u() {
|
|
212
212
|
try {
|
|
213
|
-
let t = await import("./src-
|
|
213
|
+
let t = await import("./src-B0pZeTYO.js");
|
|
214
214
|
if (c) return;
|
|
215
|
-
a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s =
|
|
215
|
+
a.value = { lintTemplate: t.lintTemplate }, r.value = !0, d(), s = tt(e.content, d, {
|
|
216
216
|
debounce: e.debounce ?? 500,
|
|
217
217
|
deep: !0
|
|
218
218
|
});
|
|
@@ -247,7 +247,7 @@ function Nn(e) {
|
|
|
247
247
|
}
|
|
248
248
|
//#endregion
|
|
249
249
|
//#region src/composables/useKeyboardReorder.ts
|
|
250
|
-
function
|
|
250
|
+
function Fn(e, t, n = []) {
|
|
251
251
|
let r = l(null), i = l(""), a = null;
|
|
252
252
|
function o(t) {
|
|
253
253
|
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
@@ -274,7 +274,7 @@ function Pn(e, t, n = []) {
|
|
|
274
274
|
let i = o(r);
|
|
275
275
|
if (!i) return "";
|
|
276
276
|
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
277
|
-
return a ?
|
|
277
|
+
return a ? Je(a, t.t, n) : "";
|
|
278
278
|
}
|
|
279
279
|
function c(t, n) {
|
|
280
280
|
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
@@ -343,13 +343,13 @@ function Pn(e, t, n = []) {
|
|
|
343
343
|
}
|
|
344
344
|
//#endregion
|
|
345
345
|
//#region src/composables/useUiTheme.ts
|
|
346
|
-
function
|
|
347
|
-
let t =
|
|
346
|
+
function In(e) {
|
|
347
|
+
let t = nt("(prefers-color-scheme: dark)");
|
|
348
348
|
return { resolvedTheme: b(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
349
349
|
}
|
|
350
350
|
//#endregion
|
|
351
351
|
//#region src/composables/useThemeStyles.ts
|
|
352
|
-
var
|
|
352
|
+
var Ln = {
|
|
353
353
|
bg: "--tpl-bg",
|
|
354
354
|
bgElevated: "--tpl-bg-elevated",
|
|
355
355
|
bgHover: "--tpl-bg-hover",
|
|
@@ -373,10 +373,10 @@ var In = {
|
|
|
373
373
|
dangerLight: "--tpl-danger-light",
|
|
374
374
|
canvasBg: "--tpl-canvas-bg"
|
|
375
375
|
};
|
|
376
|
-
function
|
|
376
|
+
function Rn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
377
377
|
return { themeStyles: b(() => {
|
|
378
378
|
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
379
|
-
if (a) for (let [e, t] of Object.entries(
|
|
379
|
+
if (a) for (let [e, t] of Object.entries(Ln)) {
|
|
380
380
|
let n = a[e];
|
|
381
381
|
n && (r[t] = n);
|
|
382
382
|
}
|
|
@@ -385,7 +385,7 @@ function Ln({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
|
385
385
|
}
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/composables/useBlockRegistry.ts
|
|
388
|
-
function
|
|
388
|
+
function zn() {
|
|
389
389
|
let e = y(/* @__PURE__ */ new Map());
|
|
390
390
|
function t(t, n) {
|
|
391
391
|
e.value.set(t, n), C(e);
|
|
@@ -394,7 +394,7 @@ function Rn() {
|
|
|
394
394
|
let r = `custom:${t.type}`;
|
|
395
395
|
e.value.set(r, {
|
|
396
396
|
component: n,
|
|
397
|
-
createBlock: () =>
|
|
397
|
+
createBlock: () => le(t),
|
|
398
398
|
definition: t
|
|
399
399
|
}), C(e);
|
|
400
400
|
}
|
|
@@ -425,7 +425,7 @@ function Rn() {
|
|
|
425
425
|
strictFilters: !1
|
|
426
426
|
}).parseAndRender(t.template, e.fieldValues);
|
|
427
427
|
} catch (t) {
|
|
428
|
-
return
|
|
428
|
+
return X.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
431
|
function c(t) {
|
|
@@ -443,9 +443,9 @@ function Rn() {
|
|
|
443
443
|
}
|
|
444
444
|
//#endregion
|
|
445
445
|
//#region src/composables/useCustomBlockStylesheets.ts
|
|
446
|
-
function
|
|
446
|
+
function Bn(e, t) {
|
|
447
447
|
return b(() => {
|
|
448
|
-
let n =
|
|
448
|
+
let n = Vn(e.value.blocks);
|
|
449
449
|
if (n.size === 0) return [];
|
|
450
450
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
451
451
|
for (let e of n) {
|
|
@@ -457,76 +457,76 @@ function zn(e, t) {
|
|
|
457
457
|
return i;
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
|
-
function
|
|
460
|
+
function Vn(e) {
|
|
461
461
|
let t = /* @__PURE__ */ new Set();
|
|
462
|
-
return
|
|
462
|
+
return Hn(e, t), t;
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
for (let n of e) if (
|
|
464
|
+
function Hn(e, t) {
|
|
465
|
+
for (let n of e) if (Ae(n)) t.add(n.customType);
|
|
466
466
|
else if (n.type === "section") {
|
|
467
467
|
let e = n.children;
|
|
468
468
|
if (!e) continue;
|
|
469
|
-
for (let n of e)
|
|
470
|
-
} else
|
|
469
|
+
for (let n of e) Hn(n, t);
|
|
470
|
+
} else Ee(n) && Hn(n.children, t);
|
|
471
471
|
}
|
|
472
472
|
//#endregion
|
|
473
473
|
//#region src/utils/registerBuiltInBlocks.ts
|
|
474
|
-
var
|
|
474
|
+
var Un = [
|
|
475
475
|
{
|
|
476
476
|
type: "section",
|
|
477
|
-
createBlock:
|
|
477
|
+
createBlock: B
|
|
478
478
|
},
|
|
479
479
|
{
|
|
480
480
|
type: "title",
|
|
481
|
-
createBlock:
|
|
481
|
+
createBlock: ne
|
|
482
482
|
},
|
|
483
483
|
{
|
|
484
484
|
type: "paragraph",
|
|
485
|
-
createBlock:
|
|
485
|
+
createBlock: Be
|
|
486
486
|
},
|
|
487
487
|
{
|
|
488
488
|
type: "image",
|
|
489
|
-
createBlock:
|
|
489
|
+
createBlock: oe
|
|
490
490
|
},
|
|
491
491
|
{
|
|
492
492
|
type: "button",
|
|
493
|
-
createBlock:
|
|
493
|
+
createBlock: se
|
|
494
494
|
},
|
|
495
495
|
{
|
|
496
496
|
type: "divider",
|
|
497
|
-
createBlock:
|
|
497
|
+
createBlock: te
|
|
498
498
|
},
|
|
499
499
|
{
|
|
500
500
|
type: "video",
|
|
501
|
-
createBlock:
|
|
501
|
+
createBlock: ae
|
|
502
502
|
},
|
|
503
503
|
{
|
|
504
504
|
type: "social",
|
|
505
|
-
createBlock:
|
|
505
|
+
createBlock: re
|
|
506
506
|
},
|
|
507
507
|
{
|
|
508
508
|
type: "menu",
|
|
509
|
-
createBlock:
|
|
509
|
+
createBlock: de
|
|
510
510
|
},
|
|
511
511
|
{
|
|
512
512
|
type: "table",
|
|
513
|
-
createBlock:
|
|
513
|
+
createBlock: he
|
|
514
514
|
},
|
|
515
515
|
{
|
|
516
516
|
type: "spacer",
|
|
517
|
-
createBlock:
|
|
517
|
+
createBlock: me
|
|
518
518
|
},
|
|
519
519
|
{
|
|
520
520
|
type: "html",
|
|
521
|
-
createBlock:
|
|
521
|
+
createBlock: ie
|
|
522
522
|
},
|
|
523
523
|
{
|
|
524
524
|
type: "countdown",
|
|
525
|
-
createBlock:
|
|
525
|
+
createBlock: ce
|
|
526
526
|
}
|
|
527
527
|
];
|
|
528
|
-
function
|
|
529
|
-
for (let n of
|
|
528
|
+
function Wn(e, t) {
|
|
529
|
+
for (let n of Un) {
|
|
530
530
|
let r = t[n.type];
|
|
531
531
|
r && e.registerBuiltIn(n.type, {
|
|
532
532
|
component: r,
|
|
@@ -536,33 +536,33 @@ function Un(e, t) {
|
|
|
536
536
|
}
|
|
537
537
|
//#endregion
|
|
538
538
|
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
539
|
-
function
|
|
539
|
+
function Gn(e) {
|
|
540
540
|
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
541
541
|
}
|
|
542
542
|
//#endregion
|
|
543
543
|
//#region src/utils/collectOffPaletteDefaults.ts
|
|
544
|
-
function
|
|
544
|
+
function Kn(e) {
|
|
545
545
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
let r = new Set(e.map((e) =>
|
|
549
|
-
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(
|
|
547
|
+
function qn(e, t, n) {
|
|
548
|
+
let r = new Set(e.map((e) => Z(e))), i = [], a = (e, t) => {
|
|
549
|
+
for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(Z(o)) && i.push(`${t}.${n}: ${o}`) : Kn(o) && a(o, `${t}.${n}`);
|
|
550
550
|
}, o = t;
|
|
551
|
-
for (let [e, t] of Object.entries(
|
|
551
|
+
for (let [e, t] of Object.entries(ue)) {
|
|
552
552
|
let n = o?.[e];
|
|
553
553
|
a({
|
|
554
554
|
...t,
|
|
555
|
-
...
|
|
555
|
+
...Kn(n) ? n : {}
|
|
556
556
|
}, e);
|
|
557
557
|
}
|
|
558
558
|
return a({
|
|
559
|
-
...
|
|
559
|
+
...z,
|
|
560
560
|
...n ?? {}
|
|
561
561
|
}, "template"), i;
|
|
562
562
|
}
|
|
563
563
|
//#endregion
|
|
564
564
|
//#region src/utils/localizedBlockDefaults.ts
|
|
565
|
-
function
|
|
565
|
+
function Jn(e) {
|
|
566
566
|
return {
|
|
567
567
|
title: { content: `<p>${e.blockDefaults.title}</p>` },
|
|
568
568
|
paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
|
|
@@ -571,7 +571,7 @@ function qn(e) {
|
|
|
571
571
|
}
|
|
572
572
|
//#endregion
|
|
573
573
|
//#region src/i18n/index.ts
|
|
574
|
-
var
|
|
574
|
+
var Yn = /* #__PURE__ */ Object.assign({
|
|
575
575
|
"./locales/ca.ts": () => import("./ca-C__Dzq--.js"),
|
|
576
576
|
"./locales/de.ts": () => import("./de-CGjbQ2mt.js"),
|
|
577
577
|
"./locales/en.ts": () => import("./en-BTiiAC-B.js"),
|
|
@@ -580,51 +580,51 @@ var Jn = /* #__PURE__ */ Object.assign({
|
|
|
580
580
|
"./locales/ja.ts": () => import("./ja-BhdkqENz.js"),
|
|
581
581
|
"./locales/nl.ts": () => import("./nl-CE3YItYg.js"),
|
|
582
582
|
"./locales/pt-BR.ts": () => import("./pt-BR-CUIT4rq4.js")
|
|
583
|
-
}),
|
|
583
|
+
}), Xn = /* #__PURE__ */ Object.assign({
|
|
584
584
|
"./locales/cloud/de.ts": () => import("./de-mMY5yQJu.js"),
|
|
585
585
|
"./locales/cloud/en.ts": () => import("./en-ChVeGQBY.js"),
|
|
586
586
|
"./locales/cloud/pt-BR.ts": () => import("./pt-BR-CoCwRUi0.js")
|
|
587
587
|
});
|
|
588
|
-
function
|
|
588
|
+
function Zn(e) {
|
|
589
589
|
return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
|
|
590
590
|
}
|
|
591
|
-
var
|
|
592
|
-
function
|
|
591
|
+
var Qn = Zn(Yn), $n = Zn(Xn);
|
|
592
|
+
function er(e) {
|
|
593
593
|
return e.trim().replace(/_/g, "-").toLowerCase();
|
|
594
594
|
}
|
|
595
|
-
function
|
|
596
|
-
let n =
|
|
597
|
-
return t.find((e) =>
|
|
595
|
+
function tr(e, t) {
|
|
596
|
+
let n = er(e);
|
|
597
|
+
return t.find((e) => er(e) === n);
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
return
|
|
601
|
-
}
|
|
602
|
-
function nr(e, t) {
|
|
603
|
-
return er(e, t) ?? er(tr(e), t);
|
|
599
|
+
function nr(e) {
|
|
600
|
+
return er(e).split("-")[0];
|
|
604
601
|
}
|
|
605
602
|
function rr(e, t) {
|
|
606
|
-
return
|
|
603
|
+
return tr(e, t) ?? tr(nr(e), t);
|
|
607
604
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
return (await t()).default;
|
|
605
|
+
function ir(e, t) {
|
|
606
|
+
return rr(e, t) ?? "en";
|
|
611
607
|
}
|
|
612
608
|
async function ar(e) {
|
|
613
|
-
let t = Yn[`./locales
|
|
609
|
+
let t = Yn[`./locales/${ir(e, Qn)}.ts`];
|
|
614
610
|
return (await t()).default;
|
|
615
611
|
}
|
|
616
|
-
function or(e) {
|
|
617
|
-
|
|
612
|
+
async function or(e) {
|
|
613
|
+
let t = Xn[`./locales/cloud/${ir(e, $n)}.ts`];
|
|
614
|
+
return (await t()).default;
|
|
618
615
|
}
|
|
619
616
|
function sr(e) {
|
|
620
|
-
return
|
|
617
|
+
return rr(e, Qn) !== void 0;
|
|
621
618
|
}
|
|
622
|
-
function cr() {
|
|
623
|
-
return
|
|
619
|
+
function cr(e) {
|
|
620
|
+
return rr(e, $n) !== void 0;
|
|
624
621
|
}
|
|
625
622
|
function lr() {
|
|
626
623
|
return [...Qn];
|
|
627
624
|
}
|
|
625
|
+
function ur() {
|
|
626
|
+
return [...$n];
|
|
627
|
+
}
|
|
628
628
|
//#endregion
|
|
629
629
|
//#region src/i18n/contentDefaults.ts
|
|
630
630
|
var $ = {
|
|
@@ -692,16 +692,16 @@ var $ = {
|
|
|
692
692
|
seconds: "秒",
|
|
693
693
|
expired: "このオファーは終了しました"
|
|
694
694
|
}
|
|
695
|
-
},
|
|
696
|
-
function
|
|
695
|
+
}, dr = new Map(Object.keys($).map((e) => [e.toLowerCase(), e]));
|
|
696
|
+
function fr(e) {
|
|
697
697
|
if (!e) return $.en;
|
|
698
|
-
let t = e.trim().replace(/_/g, "-").toLowerCase(), n =
|
|
698
|
+
let t = e.trim().replace(/_/g, "-").toLowerCase(), n = dr.get(t);
|
|
699
699
|
if (n) return $[n];
|
|
700
|
-
let r =
|
|
700
|
+
let r = dr.get(nr(t));
|
|
701
701
|
return r ? $[r] : $.en;
|
|
702
702
|
}
|
|
703
|
-
function
|
|
704
|
-
let t =
|
|
703
|
+
function pr(e) {
|
|
704
|
+
let t = fr(e);
|
|
705
705
|
return {
|
|
706
706
|
video: { alt: t.video },
|
|
707
707
|
countdown: {
|
|
@@ -715,9 +715,9 @@ function fr(e) {
|
|
|
715
715
|
}
|
|
716
716
|
//#endregion
|
|
717
717
|
//#region src/utils/collectColorFieldIssues.ts
|
|
718
|
-
function
|
|
718
|
+
function mr(e, t) {
|
|
719
719
|
let n = [], r = (r, i) => {
|
|
720
|
-
let a =
|
|
720
|
+
let a = Ve(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
721
721
|
if (a.invalidPresets.length > 0 && n.push({
|
|
722
722
|
id: s("invalid-presets"),
|
|
723
723
|
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." : "")
|
|
@@ -728,8 +728,8 @@ function pr(e, t) {
|
|
|
728
728
|
id: s("allow-custom-ignored"),
|
|
729
729
|
message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
|
|
730
730
|
}), !a.allowCustom && a.presets.length > 0) {
|
|
731
|
-
let e = r.default ?? "", t = new Set(a.presets.map((e) =>
|
|
732
|
-
e !== "" && !t.has(
|
|
731
|
+
let e = r.default ?? "", t = new Set(a.presets.map((e) => Z(e)));
|
|
732
|
+
e !== "" && !t.has(Z(e)) && n.push({
|
|
733
733
|
id: s("off-palette-default"),
|
|
734
734
|
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.`
|
|
735
735
|
});
|
|
@@ -741,7 +741,7 @@ function pr(e, t) {
|
|
|
741
741
|
}
|
|
742
742
|
//#endregion
|
|
743
743
|
//#region src/utils/keyboardShortcuts.ts
|
|
744
|
-
function
|
|
744
|
+
function hr(e) {
|
|
745
745
|
for (let t of e.composedPath()) {
|
|
746
746
|
if (!(t instanceof HTMLElement)) continue;
|
|
747
747
|
if (t.isContentEditable) return !0;
|
|
@@ -750,14 +750,14 @@ function mr(e) {
|
|
|
750
750
|
}
|
|
751
751
|
return !1;
|
|
752
752
|
}
|
|
753
|
-
function
|
|
753
|
+
function gr(e, t) {
|
|
754
754
|
let n = e.metaKey || e.ctrlKey;
|
|
755
755
|
if (n && e.key.toLowerCase() === "s") e.preventDefault(), t.onSave?.();
|
|
756
756
|
else if (n && e.key.toLowerCase() === "z") {
|
|
757
|
-
if (
|
|
757
|
+
if (hr(e)) return;
|
|
758
758
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
759
759
|
} else {
|
|
760
|
-
if (t.isPicking?.() && !
|
|
760
|
+
if (t.isPicking?.() && !hr(e)) {
|
|
761
761
|
if (e.key === "Escape") {
|
|
762
762
|
e.preventDefault(), t.onCancelPick?.();
|
|
763
763
|
return;
|
|
@@ -771,47 +771,47 @@ function hr(e, t) {
|
|
|
771
771
|
return;
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !
|
|
774
|
+
e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !hr(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
775
775
|
}
|
|
776
776
|
}
|
|
777
777
|
//#endregion
|
|
778
778
|
//#region src/utils/blockComponentResolver.ts
|
|
779
|
-
function
|
|
779
|
+
function _r(e) {
|
|
780
780
|
let t = { fontFamily: e.fontFamily };
|
|
781
781
|
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;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
783
|
+
function vr(e, t, n) {
|
|
784
784
|
if (t) {
|
|
785
785
|
let n = t.getComponent(e);
|
|
786
786
|
if (n) return n;
|
|
787
787
|
}
|
|
788
788
|
return n[e.type] ?? null;
|
|
789
789
|
}
|
|
790
|
-
function
|
|
790
|
+
function yr(e) {
|
|
791
791
|
if (e.type === "wrapper") return {};
|
|
792
792
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
793
793
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
794
794
|
backgroundColor: n || "transparent"
|
|
795
795
|
};
|
|
796
|
-
if ((e.type === "paragraph" || e.type === "title") && (r["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ??
|
|
797
|
-
let t =
|
|
798
|
-
t !== null && (r.borderRadius = t), Object.assign(r,
|
|
796
|
+
if ((e.type === "paragraph" || e.type === "title") && (r["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? Re.paragraphGap : Re.paragraphGap}px`), e.type === "section") {
|
|
797
|
+
let t = H(e.borderRadius);
|
|
798
|
+
t !== null && (r.borderRadius = t), Object.assign(r, br(e.border));
|
|
799
799
|
}
|
|
800
800
|
return r;
|
|
801
801
|
}
|
|
802
|
-
function
|
|
802
|
+
function br(e) {
|
|
803
803
|
let t = {};
|
|
804
|
-
for (let [n, r] of Object.entries(
|
|
804
|
+
for (let [n, r] of Object.entries(ee(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
|
|
805
805
|
return t;
|
|
806
806
|
}
|
|
807
|
-
function
|
|
807
|
+
function xr(e) {
|
|
808
808
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
809
809
|
let t = e.wrapper, n = {};
|
|
810
810
|
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`);
|
|
811
|
-
let r =
|
|
811
|
+
let r = H(t.borderRadius);
|
|
812
812
|
return r !== null && (n.borderRadius = r), n;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
814
|
+
function Sr(e) {
|
|
815
815
|
if (e.type !== "wrapper") return null;
|
|
816
816
|
let t = {};
|
|
817
817
|
if (e.styles.backgroundColor && (t.backgroundColor = e.styles.backgroundColor), e.styles.padding) {
|
|
@@ -822,7 +822,7 @@ function xr(e) {
|
|
|
822
822
|
}
|
|
823
823
|
//#endregion
|
|
824
824
|
//#region src/utils/mergeTagLabelSegments.ts
|
|
825
|
-
function
|
|
825
|
+
function Cr(e, t, n, r = !1) {
|
|
826
826
|
if (!e) return [];
|
|
827
827
|
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
828
828
|
for (; (s = i.exec(e)) !== null;) {
|
|
@@ -831,18 +831,18 @@ function Sr(e, t, n, r = !1) {
|
|
|
831
831
|
value: e.slice(o, s.index)
|
|
832
832
|
});
|
|
833
833
|
let i = s[0];
|
|
834
|
-
if (
|
|
835
|
-
let e = r ?
|
|
834
|
+
if (Ce(i, n)) {
|
|
835
|
+
let e = r ? Pe(i, t) : void 0;
|
|
836
836
|
a.push(e === void 0 ? {
|
|
837
837
|
type: "tag",
|
|
838
|
-
value:
|
|
838
|
+
value: je(i, t)
|
|
839
839
|
} : {
|
|
840
840
|
type: "text",
|
|
841
841
|
value: e
|
|
842
842
|
});
|
|
843
|
-
} else
|
|
843
|
+
} else xe(i, n) ? a.push({
|
|
844
844
|
type: "tag",
|
|
845
|
-
value:
|
|
845
|
+
value: ye(i, n)
|
|
846
846
|
}) : a.push({
|
|
847
847
|
type: "text",
|
|
848
848
|
value: i
|
|
@@ -856,20 +856,20 @@ function Sr(e, t, n, r = !1) {
|
|
|
856
856
|
}
|
|
857
857
|
//#endregion
|
|
858
858
|
//#region src/components/MergeTagPreviewText.vue
|
|
859
|
-
var
|
|
859
|
+
var wr = d({
|
|
860
860
|
name: "MergeTagPreviewText",
|
|
861
861
|
props: { text: {
|
|
862
862
|
type: String,
|
|
863
863
|
required: !0
|
|
864
864
|
} },
|
|
865
865
|
setup(e) {
|
|
866
|
-
let t = n(
|
|
866
|
+
let t = n(K, G), r = n(vt, Ne.liquid), i = n(q, null), a = b(() => Cr(e.text, t.value, r, i?.value ?? !1));
|
|
867
867
|
return () => a.value.map((e, t) => e.type === "tag" ? I("span", {
|
|
868
868
|
key: t,
|
|
869
869
|
class: "tpl-merge-tag-label"
|
|
870
870
|
}, e.value) : e.value);
|
|
871
871
|
}
|
|
872
|
-
}),
|
|
872
|
+
}), Tr = ["href"], Er = /* @__PURE__ */ d({
|
|
873
873
|
__name: "ButtonBlock",
|
|
874
874
|
props: {
|
|
875
875
|
block: {},
|
|
@@ -885,23 +885,23 @@ var Cr = d({
|
|
|
885
885
|
fontSize: `${t.block.fontSize}px`,
|
|
886
886
|
fontWeight: "bold",
|
|
887
887
|
textDecoration: "none",
|
|
888
|
-
borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` :
|
|
888
|
+
borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` : H(t.block.borderRadius) ?? "0px",
|
|
889
889
|
textAlign: "center"
|
|
890
890
|
};
|
|
891
|
-
return Object.assign(e,
|
|
891
|
+
return Object.assign(e, br(t.block.border)), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
|
|
892
892
|
}), r = b(() => ({ textAlign: t.block.align ?? "center" }));
|
|
893
893
|
return (t, i) => (s(), x("div", { style: D(r.value) }, [k("a", {
|
|
894
894
|
href: e.block.url || "#",
|
|
895
895
|
style: D(n.value),
|
|
896
896
|
class: "tpl:cursor-default",
|
|
897
897
|
onClick: i[0] ||= E(() => {}, ["prevent"])
|
|
898
|
-
}, [g(
|
|
898
|
+
}, [g(wr, { text: e.block.text }, null, 8, ["text"])], 12, Tr)], 4));
|
|
899
899
|
}
|
|
900
|
-
}),
|
|
900
|
+
}), Dr = ["innerHTML"], Or = [
|
|
901
901
|
"src",
|
|
902
902
|
"width",
|
|
903
903
|
"height"
|
|
904
|
-
],
|
|
904
|
+
], kr = /* @__PURE__ */ d({
|
|
905
905
|
__name: "CustomBlockIcon",
|
|
906
906
|
props: {
|
|
907
907
|
icon: {},
|
|
@@ -917,24 +917,24 @@ var Cr = d({
|
|
|
917
917
|
height: `${n.value}px`
|
|
918
918
|
}),
|
|
919
919
|
innerHTML: e.icon
|
|
920
|
-
}, null, 12,
|
|
920
|
+
}, null, 12, Dr)) : i.value ? (s(), x("img", {
|
|
921
921
|
key: 1,
|
|
922
922
|
src: e.icon,
|
|
923
923
|
width: n.value,
|
|
924
924
|
height: n.value,
|
|
925
925
|
class: "tpl:inline-block",
|
|
926
926
|
alt: ""
|
|
927
|
-
}, null, 8,
|
|
927
|
+
}, null, 8, Or)) : (s(), O(h($t), {
|
|
928
928
|
key: 2,
|
|
929
929
|
size: n.value,
|
|
930
930
|
"stroke-width": 1.5
|
|
931
931
|
}, null, 8, ["size"]));
|
|
932
932
|
}
|
|
933
|
-
}),
|
|
934
|
-
function
|
|
935
|
-
let r =
|
|
933
|
+
}), Ar = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
934
|
+
function jr(e, n) {
|
|
935
|
+
let r = bn(), i = null, a = null, o = null;
|
|
936
936
|
function s() {
|
|
937
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
937
|
+
return e.value ? Array.from(e.value.querySelectorAll(Ar)).filter((e) => e.offsetParent !== null) : [];
|
|
938
938
|
}
|
|
939
939
|
function c(e) {
|
|
940
940
|
if (e.key !== "Tab") return;
|
|
@@ -949,7 +949,7 @@ function Ar(e, n) {
|
|
|
949
949
|
o = null;
|
|
950
950
|
let t = s();
|
|
951
951
|
t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
|
|
952
|
-
}), a =
|
|
952
|
+
}), a = W(e, "keydown", c);
|
|
953
953
|
}
|
|
954
954
|
function u(e = {}) {
|
|
955
955
|
let t = e.restoreFocus !== !1;
|
|
@@ -964,8 +964,8 @@ function Ar(e, n) {
|
|
|
964
964
|
}
|
|
965
965
|
//#endregion
|
|
966
966
|
//#region src/composables/useEmoji.ts
|
|
967
|
-
function
|
|
968
|
-
let [e, n] =
|
|
967
|
+
function Mr() {
|
|
968
|
+
let [e, n] = et(!1), r = y([]), i = !1;
|
|
969
969
|
m(() => {
|
|
970
970
|
i = !0;
|
|
971
971
|
}), t(e, async (e) => {
|
|
@@ -990,7 +990,7 @@ function jr() {
|
|
|
990
990
|
}
|
|
991
991
|
//#endregion
|
|
992
992
|
//#region src/composables/useFonts.ts
|
|
993
|
-
var
|
|
993
|
+
var Nr = [
|
|
994
994
|
{
|
|
995
995
|
value: "Arial",
|
|
996
996
|
label: "Arial"
|
|
@@ -1019,22 +1019,14 @@ var Mr = [
|
|
|
1019
1019
|
value: "Courier New",
|
|
1020
1020
|
label: "Courier New"
|
|
1021
1021
|
}
|
|
1022
|
-
],
|
|
1023
|
-
arial: "Arial, sans-serif",
|
|
1024
|
-
helvetica: "Helvetica, sans-serif",
|
|
1025
|
-
georgia: "Georgia, serif",
|
|
1026
|
-
"times new roman": "'Times New Roman', serif",
|
|
1027
|
-
verdana: "Verdana, sans-serif",
|
|
1028
|
-
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1029
|
-
"courier new": "'Courier New', monospace"
|
|
1030
|
-
}, Pr = "Arial, sans-serif";
|
|
1022
|
+
], Pr = "Arial, sans-serif";
|
|
1031
1023
|
function Fr(e) {
|
|
1032
|
-
if (e === void 0 || e === !0) return [...
|
|
1024
|
+
if (e === void 0 || e === !0) return [...Nr];
|
|
1033
1025
|
if (e === !1) return [];
|
|
1034
1026
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1035
1027
|
for (let i of e) {
|
|
1036
|
-
let e = i.toLowerCase(), a =
|
|
1037
|
-
a ? n.has(a.value) || (n.add(a.value), t.push(a)) : r.has(e) || (r.add(e),
|
|
1028
|
+
let e = i.toLowerCase(), a = Nr.find((t) => t.value.toLowerCase() === e);
|
|
1029
|
+
a ? n.has(a.value) || (n.add(a.value), t.push(a)) : r.has(e) || (r.add(e), X.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${Nr.map((e) => e.value).join(", ")}.`));
|
|
1038
1030
|
}
|
|
1039
1031
|
return t;
|
|
1040
1032
|
}
|
|
@@ -1051,7 +1043,7 @@ function Ir(e) {
|
|
|
1051
1043
|
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1052
1044
|
}
|
|
1053
1045
|
let c = e?.defaultFont ?? Pr.split(",")[0].trim();
|
|
1054
|
-
s(c) ||
|
|
1046
|
+
s(c) || X.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.`);
|
|
1055
1047
|
function u() {
|
|
1056
1048
|
if (e?.defaultFont && s(e.defaultFont)) {
|
|
1057
1049
|
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
@@ -1063,7 +1055,7 @@ function Ir(e) {
|
|
|
1063
1055
|
function f(e) {
|
|
1064
1056
|
if (!e) return i.value;
|
|
1065
1057
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1066
|
-
return n ? `'${n.name}', ${n.fallback ?? i.value}` :
|
|
1058
|
+
return n ? `'${n.name}', ${n.fallback ?? i.value}` : Ie[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1067
1059
|
}
|
|
1068
1060
|
let p = [], h = !1;
|
|
1069
1061
|
async function g() {
|
|
@@ -1079,7 +1071,7 @@ function Ir(e) {
|
|
|
1079
1071
|
t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
|
|
1080
1072
|
});
|
|
1081
1073
|
} catch (t) {
|
|
1082
|
-
|
|
1074
|
+
X.warn(`Failed to load custom font "${e.name}":`, t);
|
|
1083
1075
|
}
|
|
1084
1076
|
});
|
|
1085
1077
|
await Promise.allSettled(e), !h && (n.value = !0);
|
|
@@ -1105,11 +1097,11 @@ function Ir(e) {
|
|
|
1105
1097
|
//#endregion
|
|
1106
1098
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
1107
1099
|
function Lr(e, t, n) {
|
|
1108
|
-
return
|
|
1100
|
+
return xe(e, n) ? {
|
|
1109
1101
|
type: "logicMergeTagNode",
|
|
1110
1102
|
attrs: {
|
|
1111
1103
|
value: e,
|
|
1112
|
-
keyword:
|
|
1104
|
+
keyword: ye(e, n)
|
|
1113
1105
|
}
|
|
1114
1106
|
} : {
|
|
1115
1107
|
type: "mergeTagNode",
|
|
@@ -1145,7 +1137,7 @@ function Vr(e) {
|
|
|
1145
1137
|
...this.parent?.(),
|
|
1146
1138
|
color: {
|
|
1147
1139
|
default: null,
|
|
1148
|
-
parseHTML: (e) => Br(
|
|
1140
|
+
parseHTML: (e) => Br(Jt(e.style.color)),
|
|
1149
1141
|
renderHTML: (e) => {
|
|
1150
1142
|
let t = Br(e.color);
|
|
1151
1143
|
return t ? { style: `color: ${t}` } : {};
|
|
@@ -1156,22 +1148,22 @@ function Vr(e) {
|
|
|
1156
1148
|
}
|
|
1157
1149
|
//#endregion
|
|
1158
1150
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
1159
|
-
function Hr(e, t =
|
|
1151
|
+
function Hr(e, t = Ne.liquid) {
|
|
1160
1152
|
let n = l(!1), r = l(""), i = l(""), a = l(null);
|
|
1161
|
-
|
|
1153
|
+
jr(a, n);
|
|
1162
1154
|
function o() {
|
|
1163
1155
|
let t = e.value?.getAttributes("link") ?? {};
|
|
1164
1156
|
r.value = t.href || "", i.value = t.color || "", n.value = !0;
|
|
1165
1157
|
}
|
|
1166
1158
|
function s() {
|
|
1167
1159
|
if (r.value) {
|
|
1168
|
-
let t =
|
|
1160
|
+
let t = f(r.value);
|
|
1169
1161
|
if (t !== null) {
|
|
1170
1162
|
let n = Br(i.value), r = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
1171
1163
|
n && typeof e.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
|
|
1172
1164
|
}
|
|
1173
1165
|
}
|
|
1174
|
-
|
|
1166
|
+
m();
|
|
1175
1167
|
}
|
|
1176
1168
|
let c = /* @__PURE__ */ new Set([
|
|
1177
1169
|
"http",
|
|
@@ -1183,25 +1175,27 @@ function Hr(e, t = je.liquid) {
|
|
|
1183
1175
|
"sms",
|
|
1184
1176
|
"xmpp",
|
|
1185
1177
|
"cid"
|
|
1186
|
-
])
|
|
1187
|
-
function
|
|
1178
|
+
]), u = /^(?:\/|\.{1,2}\/|\?)/;
|
|
1179
|
+
function d(e) {
|
|
1188
1180
|
return RegExp(`^(?:${t.value.source})`).test(e);
|
|
1189
1181
|
}
|
|
1190
|
-
function
|
|
1182
|
+
function f(e) {
|
|
1191
1183
|
let t = e.trim();
|
|
1192
1184
|
if (!t) return null;
|
|
1193
1185
|
if (t.startsWith("#")) return t;
|
|
1186
|
+
if (t.startsWith("//")) return `https:${t}`;
|
|
1187
|
+
if (u.test(t)) return t;
|
|
1194
1188
|
let n = /^([a-z][a-z0-9+.-]*):/i.exec(t);
|
|
1195
|
-
return n ? c.has(n[1].toLowerCase()) ? t : null :
|
|
1196
|
-
}
|
|
1197
|
-
function f() {
|
|
1198
|
-
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p();
|
|
1189
|
+
return n ? c.has(n[1].toLowerCase()) ? t : null : d(t) ? t : `https://${t}`;
|
|
1199
1190
|
}
|
|
1200
1191
|
function p() {
|
|
1192
|
+
e.value?.chain().focus().extendMarkRange("link").unsetLink().run(), m();
|
|
1193
|
+
}
|
|
1194
|
+
function m() {
|
|
1201
1195
|
n.value = !1, r.value = "", i.value = "";
|
|
1202
1196
|
}
|
|
1203
|
-
function
|
|
1204
|
-
e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" &&
|
|
1197
|
+
function h(e) {
|
|
1198
|
+
e.key === "Enter" ? (e.preventDefault(), s()) : e.key === "Escape" && m();
|
|
1205
1199
|
}
|
|
1206
1200
|
return {
|
|
1207
1201
|
showLinkDialog: n,
|
|
@@ -1210,21 +1204,21 @@ function Hr(e, t = je.liquid) {
|
|
|
1210
1204
|
linkDialogRef: a,
|
|
1211
1205
|
openLinkDialog: o,
|
|
1212
1206
|
insertLink: s,
|
|
1213
|
-
removeLink:
|
|
1214
|
-
closeLinkDialog:
|
|
1215
|
-
handleLinkKeydown:
|
|
1207
|
+
removeLink: p,
|
|
1208
|
+
closeLinkDialog: m,
|
|
1209
|
+
handleLinkKeydown: h
|
|
1216
1210
|
};
|
|
1217
1211
|
}
|
|
1218
1212
|
//#endregion
|
|
1219
1213
|
//#region src/composables/useRichTextEditor.ts
|
|
1220
1214
|
function Ur(r) {
|
|
1221
|
-
let i = n(
|
|
1215
|
+
let i = n(J, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = xn(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } = Sn(), h = n(wt, null), g = (A(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = De(u), v = y(null), b = () => ge(i?.content?.value?.settings ?? { locale: "en" });
|
|
1222
1216
|
t(b, (e) => {
|
|
1223
1217
|
let t = v.value?.view.dom;
|
|
1224
1218
|
t && t.setAttribute("dir", e);
|
|
1225
1219
|
});
|
|
1226
|
-
let { showLinkDialog: x, linkUrl: S, linkColor: C, linkDialogRef: w, openLinkDialog: T, insertLink: E, removeLink: D, closeLinkDialog: O, handleLinkKeydown: k } = Hr(v, u), { start: j, stop: M } =
|
|
1227
|
-
async function
|
|
1220
|
+
let { showLinkDialog: x, linkUrl: S, linkColor: C, linkDialogRef: w, openLinkDialog: T, insertLink: E, removeLink: D, closeLinkDialog: O, handleLinkKeydown: k } = Hr(v, u), { start: j, stop: M } = Qe(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), N = y(null), P = l(!0), F = l(null), I = !1, L = null;
|
|
1221
|
+
async function R() {
|
|
1228
1222
|
F.value = null, P.value = !0;
|
|
1229
1223
|
try {
|
|
1230
1224
|
let { TiptapEditor: e, EC: t, extensions: n } = await r.loadExtensions({
|
|
@@ -1244,7 +1238,7 @@ function Ur(r) {
|
|
|
1244
1238
|
editable: !0,
|
|
1245
1239
|
editorProps: { attributes: { dir: b() } },
|
|
1246
1240
|
onUpdate: ({ editor: e }) => {
|
|
1247
|
-
I || i && i.updateBlock(r.blockId(), { content:
|
|
1241
|
+
I || i && (L = e.getHTML(), i.updateBlock(r.blockId(), { content: L }));
|
|
1248
1242
|
}
|
|
1249
1243
|
});
|
|
1250
1244
|
if (I) {
|
|
@@ -1254,17 +1248,17 @@ function Ur(r) {
|
|
|
1254
1248
|
v.value = s, P.value = !1, j();
|
|
1255
1249
|
} catch (e) {
|
|
1256
1250
|
if (I) return;
|
|
1257
|
-
|
|
1251
|
+
X.error(`[${r.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), F.value = e instanceof Error ? e.message : "Failed to load editor", P.value = !1;
|
|
1258
1252
|
}
|
|
1259
1253
|
}
|
|
1260
|
-
function
|
|
1261
|
-
v.value?.destroy(), v.value = null,
|
|
1254
|
+
function z() {
|
|
1255
|
+
v.value?.destroy(), v.value = null, R();
|
|
1262
1256
|
}
|
|
1263
|
-
|
|
1264
|
-
let
|
|
1265
|
-
v.value && v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 });
|
|
1257
|
+
R();
|
|
1258
|
+
let B = t(() => r.blockContent(), (e) => {
|
|
1259
|
+
v.value && e !== L && (L = e, v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 }));
|
|
1266
1260
|
});
|
|
1267
|
-
function
|
|
1261
|
+
function V(e) {
|
|
1268
1262
|
if (s.value || p.value) return;
|
|
1269
1263
|
let t = e.composedPath(), n = t.find((e) => e instanceof HTMLElement);
|
|
1270
1264
|
if (!n) return;
|
|
@@ -1272,10 +1266,10 @@ function Ur(r) {
|
|
|
1272
1266
|
let i = t.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
|
|
1273
1267
|
n.closest(".tpl-text-editor-wrapper") || n.closest(".tpl-text-toolbar") || n.closest(".tpl-link-dialog") || i || r.onDone();
|
|
1274
1268
|
}
|
|
1275
|
-
|
|
1276
|
-
I = !0,
|
|
1269
|
+
W(document, "mousedown", V), e(() => {
|
|
1270
|
+
I = !0, B(), M(), v.value?.destroy();
|
|
1277
1271
|
});
|
|
1278
|
-
async function
|
|
1272
|
+
async function H() {
|
|
1279
1273
|
let e = await c();
|
|
1280
1274
|
I || (e && v.value ? v.value.chain().focus().insertMergeTag({
|
|
1281
1275
|
label: e.label,
|
|
@@ -1291,7 +1285,7 @@ function Ur(r) {
|
|
|
1291
1285
|
EditorContent: N,
|
|
1292
1286
|
isLoading: P,
|
|
1293
1287
|
initError: F,
|
|
1294
|
-
retry:
|
|
1288
|
+
retry: z,
|
|
1295
1289
|
showLinkDialog: x,
|
|
1296
1290
|
linkUrl: S,
|
|
1297
1291
|
linkColor: C,
|
|
@@ -1307,7 +1301,7 @@ function Ur(r) {
|
|
|
1307
1301
|
removeLink: D,
|
|
1308
1302
|
closeLinkDialog: O,
|
|
1309
1303
|
handleLinkKeydown: k,
|
|
1310
|
-
handleAddMergeTag:
|
|
1304
|
+
handleAddMergeTag: H,
|
|
1311
1305
|
handleAddLogicTag: ee
|
|
1312
1306
|
};
|
|
1313
1307
|
}
|
|
@@ -1315,7 +1309,7 @@ function Ur(r) {
|
|
|
1315
1309
|
//#region src/composables/useSmallScreenNotice.ts
|
|
1316
1310
|
var Wr = "(max-width: 767px)";
|
|
1317
1311
|
function Gr(e) {
|
|
1318
|
-
let t =
|
|
1312
|
+
let t = nt(Wr);
|
|
1319
1313
|
return {
|
|
1320
1314
|
isSmallScreen: t,
|
|
1321
1315
|
showNotice: b(() => (j(e) ?? !0) && t.value)
|
|
@@ -1344,7 +1338,7 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1344
1338
|
},
|
|
1345
1339
|
emits: ["fetchData"],
|
|
1346
1340
|
setup(e, { emit: r }) {
|
|
1347
|
-
let i = e, a = r, { t: o } =
|
|
1341
|
+
let i = e, a = r, { t: o } = Y(), c = n(Ht, null), u = l(""), d = l(!1), f = b(() => c?.getDefinition(i.block.customType)), p = b(() => !!f.value), m = b(() => i.block), { isFetching: _, fetch: v, needsFetch: y, hasDataSource: C } = We({
|
|
1348
1342
|
definition: f,
|
|
1349
1343
|
block: m,
|
|
1350
1344
|
onUpdate: (e, t) => {
|
|
@@ -1353,10 +1347,10 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1353
1347
|
dataSourceFetched: t
|
|
1354
1348
|
});
|
|
1355
1349
|
}
|
|
1356
|
-
}), T = n(
|
|
1350
|
+
}), T = n(K, G), D = n(q, null), A = b(() => {
|
|
1357
1351
|
if (!D?.value) return i.block;
|
|
1358
1352
|
let e = {};
|
|
1359
|
-
for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ?
|
|
1353
|
+
for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? ve(n, T.value) : n;
|
|
1360
1354
|
return {
|
|
1361
1355
|
...i.block,
|
|
1362
1356
|
fieldValues: e
|
|
@@ -1373,17 +1367,17 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1373
1367
|
}
|
|
1374
1368
|
}
|
|
1375
1369
|
}
|
|
1376
|
-
let M =
|
|
1370
|
+
let M = $e(j, 150);
|
|
1377
1371
|
return w(() => {
|
|
1378
1372
|
j();
|
|
1379
1373
|
}), t(() => i.block.fieldValues, () => {
|
|
1380
1374
|
M();
|
|
1381
1375
|
}, { deep: !0 }), t(() => D?.value, () => {
|
|
1382
1376
|
M();
|
|
1383
|
-
}), (e, t) => (s(), x("div", Kr, [p.value ? d.value ? (s(), x("div", Yr, [g(h(
|
|
1377
|
+
}), (e, t) => (s(), x("div", Kr, [p.value ? d.value ? (s(), x("div", Yr, [g(h(sn), {
|
|
1384
1378
|
size: 24,
|
|
1385
1379
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
1386
|
-
}), k("span", Xr, F(h(o).customBlocks.renderError), 1)])) : (s(), x("div", Zr, [k("div", { innerHTML: u.value }, null, 8, Qr), h(C) && h(y) ? (s(), x("div", $r, [h(_) ? (s(), O(
|
|
1380
|
+
}), k("span", Xr, F(h(o).customBlocks.renderError), 1)])) : (s(), x("div", Zr, [k("div", { innerHTML: u.value }, null, 8, Qr), h(C) && h(y) ? (s(), x("div", $r, [h(_) ? (s(), O(vn, {
|
|
1387
1381
|
key: 1,
|
|
1388
1382
|
class: "tpl:w-48"
|
|
1389
1383
|
})) : (s(), x("button", {
|
|
@@ -1391,11 +1385,11 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1391
1385
|
type: "button",
|
|
1392
1386
|
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)]",
|
|
1393
1387
|
onClick: t[0] ||= E((...e) => h(v) && h(v)(...e), ["stop"])
|
|
1394
|
-
}, [f.value?.icon ? (s(), O(
|
|
1388
|
+
}, [f.value?.icon ? (s(), O(kr, {
|
|
1395
1389
|
key: 0,
|
|
1396
1390
|
icon: f.value.icon,
|
|
1397
1391
|
size: 16
|
|
1398
|
-
}, null, 8, ["icon"])) : S("", !0), R(" " + F(f.value?.dataSource?.label || h(o).customBlocks.dataSource.fetchButton), 1)]))])) : S("", !0)])) : (s(), x("div", qr, [g(h(
|
|
1392
|
+
}, null, 8, ["icon"])) : S("", !0), R(" " + F(f.value?.dataSource?.label || h(o).customBlocks.dataSource.fetchButton), 1)]))])) : S("", !0)])) : (s(), x("div", qr, [g(h(nn), {
|
|
1399
1393
|
size: 24,
|
|
1400
1394
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
1401
1395
|
}), k("span", Jr, F(h(o).customBlocks.definitionNotFound), 1)]))]));
|
|
@@ -1433,7 +1427,7 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1433
1427
|
viewport: {}
|
|
1434
1428
|
},
|
|
1435
1429
|
setup(r) {
|
|
1436
|
-
let i = r, { t: a } =
|
|
1430
|
+
let i = r, { t: a } = Y(), o = n(Ot, !1), c = b(() => i.block.content.trim().length > 0), u = b(() => o && c.value), d = n(K, G), f = n(q, null), p = b(() => f?.value ? ve(i.block.content, d.value) : i.block.content), m = l(null), _ = l(60), v = null;
|
|
1437
1431
|
function y() {
|
|
1438
1432
|
let e = m.value?.contentDocument;
|
|
1439
1433
|
e && (_.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
|
|
@@ -1457,7 +1451,7 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1457
1451
|
class: "tpl:block tpl:w-full tpl:border-0",
|
|
1458
1452
|
style: D({ height: `${_.value}px` }),
|
|
1459
1453
|
onLoad: S
|
|
1460
|
-
}, null, 44, ii)) : (s(), x("div", ai, [g(h(
|
|
1454
|
+
}, null, 44, ii)) : (s(), x("div", ai, [g(h(dn), {
|
|
1461
1455
|
size: 24,
|
|
1462
1456
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
1463
1457
|
}), c.value ? (s(), x("span", oi, F(h(a).html.preview), 1)) : (s(), x("span", si, F(h(a).html.empty), 1))]))]));
|
|
@@ -1480,7 +1474,7 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1480
1474
|
},
|
|
1481
1475
|
emits: ["update"],
|
|
1482
1476
|
setup(e, { emit: t }) {
|
|
1483
|
-
let r = e, i = t, { t: a } =
|
|
1477
|
+
let r = e, i = t, { t: a } = Y(), { syntax: o } = xn(), c = n(ht, null), u = n(kt, null), d = b(() => !!c), f = Cn();
|
|
1484
1478
|
async function p() {
|
|
1485
1479
|
let e = await c?.({ accept: ["images"] });
|
|
1486
1480
|
if (f.alive && e) {
|
|
@@ -1507,12 +1501,12 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1507
1501
|
}
|
|
1508
1502
|
}
|
|
1509
1503
|
}
|
|
1510
|
-
let { isOver: C } =
|
|
1504
|
+
let { isOver: C } = Ge({
|
|
1511
1505
|
target: m,
|
|
1512
1506
|
enabled: v,
|
|
1513
1507
|
onFiles: y
|
|
1514
1508
|
}), w = b(() => ({ textAlign: r.block.align })), T = b(() => {
|
|
1515
|
-
let e = r.block.border, t = ["left", "right"].map((t) =>
|
|
1509
|
+
let e = r.block.border, t = ["left", "right"].map((t) => pe(e?.[t]) === null ? 0 : e[t].width).reduce((e, t) => e + t, 0);
|
|
1516
1510
|
return t > 0 ? `calc(100% - ${t}px)` : "100%";
|
|
1517
1511
|
}), O = b(() => {
|
|
1518
1512
|
let e = r.block.align;
|
|
@@ -1520,13 +1514,13 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1520
1514
|
maxWidth: "100%",
|
|
1521
1515
|
width: r.block.width === "full" ? T.value : `${r.block.width}px`,
|
|
1522
1516
|
height: r.block.height ? `${r.block.height}px` : void 0,
|
|
1523
|
-
borderRadius:
|
|
1524
|
-
...
|
|
1517
|
+
borderRadius: H(r.block.borderRadius) ?? void 0,
|
|
1518
|
+
...br(r.block.border),
|
|
1525
1519
|
display: "block",
|
|
1526
1520
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
1527
1521
|
marginRight: e === "center" ? "auto" : void 0
|
|
1528
1522
|
};
|
|
1529
|
-
}), A = b(() =>
|
|
1523
|
+
}), A = b(() => U(r.block.src, o)), j = An(() => A.value ? void 0 : r.block.src), M = An(() => A.value ? r.block.placeholderUrl : void 0);
|
|
1530
1524
|
return (t, n) => (s(), x("div", {
|
|
1531
1525
|
ref_key: "dropZoneRef",
|
|
1532
1526
|
ref: m,
|
|
@@ -1534,11 +1528,11 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1534
1528
|
"data-drop-enabled": v.value,
|
|
1535
1529
|
class: "tpl:relative tpl:w-full",
|
|
1536
1530
|
style: D(w.value)
|
|
1537
|
-
}, [v.value && (h(C) || _.value) ? (s(), x("div", ui, [_.value ? (s(), x(P, { key: 0 }, [g(h(
|
|
1531
|
+
}, [v.value && (h(C) || _.value) ? (s(), x("div", ui, [_.value ? (s(), x(P, { key: 0 }, [g(h(on), {
|
|
1538
1532
|
class: "tpl-spinner",
|
|
1539
1533
|
size: 20,
|
|
1540
1534
|
"stroke-width": 2
|
|
1541
|
-
}), R(" " + F(h(a).image.uploading), 1)], 64)) : (s(), x(P, { key: 1 }, [g(h(
|
|
1535
|
+
}), R(" " + F(h(a).image.uploading), 1)], 64)) : (s(), x(P, { key: 1 }, [g(h(hn), {
|
|
1542
1536
|
size: 20,
|
|
1543
1537
|
"stroke-width": 1.5
|
|
1544
1538
|
}), R(" " + F(h(a).image.dropToUpload), 1)], 64))])) : S("", !0), e.block.src && A.value && e.block.placeholderUrl ? (s(), x(P, { key: 1 }, [e.block.linkUrl ? (s(), x("a", {
|
|
@@ -1563,12 +1557,12 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1563
1557
|
key: 2,
|
|
1564
1558
|
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)]",
|
|
1565
1559
|
style: D([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, O.value])
|
|
1566
|
-
}, [g(h(
|
|
1560
|
+
}, [g(h(mn), {
|
|
1567
1561
|
size: 32,
|
|
1568
1562
|
"stroke-width": 1.5,
|
|
1569
1563
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
1570
1564
|
style: { opacity: "0.5" }
|
|
1571
|
-
}), k("span", mi, [g(
|
|
1565
|
+
}), k("span", mi, [g(wr, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (s(), x(P, { key: 3 }, [e.block.linkUrl ? (s(), x("a", {
|
|
1572
1566
|
key: 0,
|
|
1573
1567
|
href: e.block.linkUrl,
|
|
1574
1568
|
target: "_blank",
|
|
@@ -1591,7 +1585,7 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1591
1585
|
"aria-label": h(a).image.browseMedia,
|
|
1592
1586
|
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)]",
|
|
1593
1587
|
onClick: E(p, ["stop"])
|
|
1594
|
-
}, [g(h(
|
|
1588
|
+
}, [g(h(mn), {
|
|
1595
1589
|
size: 14,
|
|
1596
1590
|
"stroke-width": 1.5
|
|
1597
1591
|
}), R(" " + F(h(a).image.browseMedia), 1)], 8, yi)) : (s(), x("span", bi, F(h(a).image.clickToAdd), 1))]))], 12, li));
|
|
@@ -1606,7 +1600,7 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1606
1600
|
viewport: {}
|
|
1607
1601
|
},
|
|
1608
1602
|
setup(e) {
|
|
1609
|
-
let t = e, { t: n } =
|
|
1603
|
+
let t = e, { t: n } = Y(), i = b(() => ({
|
|
1610
1604
|
display: "flex",
|
|
1611
1605
|
flexWrap: "wrap",
|
|
1612
1606
|
gap: `0 ${t.block.spacing}px`,
|
|
@@ -1630,13 +1624,13 @@ var Kr = { class: "tpl:w-full" }, qr = {
|
|
|
1630
1624
|
textDecoration: t.underline ? "underline" : "none"
|
|
1631
1625
|
}),
|
|
1632
1626
|
onClick: c[0] ||= E(() => {}, ["prevent"])
|
|
1633
|
-
}, [g(
|
|
1627
|
+
}, [g(wr, { text: t.text || "..." }, null, 8, ["text"])], 12, Ci), n < e.block.items.length - 1 ? (s(), x("span", {
|
|
1634
1628
|
key: 0,
|
|
1635
1629
|
style: D({
|
|
1636
1630
|
color: e.block.separatorColor,
|
|
1637
1631
|
padding: `0 ${e.block.spacing}px`
|
|
1638
1632
|
})
|
|
1639
|
-
}, F(e.block.separator), 5)) : S("", !0)], 64))), 128))], 4)) : (s(), x("div", wi, [g(h(
|
|
1633
|
+
}, F(e.block.separator), 5)) : S("", !0)], 64))), 128))], 4)) : (s(), x("div", wi, [g(h(an), { size: 16 }), k("span", null, F(h(n).menu.addLinks), 1)]))]));
|
|
1640
1634
|
}
|
|
1641
1635
|
}), Ei = /* @__PURE__ */ new Set([
|
|
1642
1636
|
"http",
|
|
@@ -1698,7 +1692,7 @@ function ji(e) {
|
|
|
1698
1692
|
//#endregion
|
|
1699
1693
|
//#region src/composables/useEditableTextBlock.ts
|
|
1700
1694
|
function Mi(e) {
|
|
1701
|
-
let t = n(
|
|
1695
|
+
let t = n(K, G), r = n(q, null), { syntax: i } = xn(), a = b(() => r?.value ? we(e(), t.value) : Oe(e(), t.value)), o = b(() => ji(Me(a.value, i))), s = l(!1), c = l(null), { top: u, left: d } = rt(c), { toLocal: f } = Xt(), p = b(() => f({
|
|
1702
1696
|
top: u.value - 8,
|
|
1703
1697
|
left: d.value
|
|
1704
1698
|
}));
|
|
@@ -1726,7 +1720,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1726
1720
|
viewport: {}
|
|
1727
1721
|
},
|
|
1728
1722
|
setup(e) {
|
|
1729
|
-
let t = e, n = L(() => import("./ParagraphEditor-
|
|
1723
|
+
let t = e, n = L(() => import("./ParagraphEditor-DndEFXmR.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = Mi(() => t.block.content);
|
|
1730
1724
|
return (t, u) => (s(), x("div", {
|
|
1731
1725
|
ref_key: "blockRef",
|
|
1732
1726
|
ref: i,
|
|
@@ -1764,7 +1758,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1764
1758
|
}, Wi = ["aria-label", "title"], Gi = {
|
|
1765
1759
|
key: 3,
|
|
1766
1760
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
1767
|
-
}, Ki = ["aria-label"], qi = /*#__PURE__*/
|
|
1761
|
+
}, Ki = ["aria-label"], qi = /*#__PURE__*/ yn(/* @__PURE__ */ d({
|
|
1768
1762
|
__name: "BlockWrapper",
|
|
1769
1763
|
props: {
|
|
1770
1764
|
block: {},
|
|
@@ -1776,7 +1770,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1776
1770
|
},
|
|
1777
1771
|
emits: ["select"],
|
|
1778
1772
|
setup(e, { emit: t }) {
|
|
1779
|
-
let r = L(() => import("./BlockIssueBadge-05Q3L4RV.js")), i = e, o = t, { t: c, format: u } =
|
|
1773
|
+
let r = L(() => import("./BlockIssueBadge-05Q3L4RV.js")), i = e, o = t, { t: c, format: u } = Y(), d = n(bt, null), f = l(null), p = b(() => d?.liftedBlockId.value === i.block.id), m = b(() => p.value ? u(c.blockActions.dragLifted, { block: i.block.type }) : c.blockActions.drag);
|
|
1780
1774
|
async function _() {
|
|
1781
1775
|
await T(), f.value?.focus();
|
|
1782
1776
|
}
|
|
@@ -1786,7 +1780,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1786
1780
|
let C = b(() => !i.viewport || !i.block.visibility ? !1 : i.block.visibility[i.viewport] === !1), w = b(() => i.previewMode === !0 && C.value), O = b(() => i.viewport ? {
|
|
1787
1781
|
desktop: c.viewport.desktop,
|
|
1788
1782
|
mobile: c.viewport.mobile
|
|
1789
|
-
}[i.viewport] ?? i.viewport : ""), A = b(() => !!i.block.displayCondition), j = n(
|
|
1783
|
+
}[i.viewport] ?? i.viewport : ""), A = b(() => !!i.block.displayCondition), j = n(Dt, null), M = n(jt, null), N = n(Ft, {}), P = b(() => N.savedBlocks?.isPicking.value === !0), I = b(() => !i.nested && N.savedBlocks?.isAvailable.value === !0 && N.savedBlocks?.canCreate.value === !0), z = b(() => i.isSelected && !P.value), B = b(() => N.comments?.getBlockCount(i.block.id) ?? 0), V = b(() => yr(i.block)), H = b(() => xr(i.block));
|
|
1790
1784
|
function ee(e) {
|
|
1791
1785
|
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
|
|
1792
1786
|
}
|
|
@@ -1831,7 +1825,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1831
1825
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
1832
1826
|
title: h(c).blockActions.drag,
|
|
1833
1827
|
onKeydown: y
|
|
1834
|
-
}, [g(h(
|
|
1828
|
+
}, [g(h(ln), {
|
|
1835
1829
|
size: 14,
|
|
1836
1830
|
"stroke-width": 1.5
|
|
1837
1831
|
})], 40, Li),
|
|
@@ -1840,7 +1834,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1840
1834
|
"aria-label": h(c).blockActions.duplicate,
|
|
1841
1835
|
title: h(c).blockActions.duplicate,
|
|
1842
1836
|
onClick: E(ne, ["stop"])
|
|
1843
|
-
}, [g(h(
|
|
1837
|
+
}, [g(h(en), {
|
|
1844
1838
|
size: 14,
|
|
1845
1839
|
"stroke-width": 1.5
|
|
1846
1840
|
})], 8, Ri),
|
|
@@ -1850,7 +1844,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1850
1844
|
"aria-label": h(c).blockActions.saveAsBlock,
|
|
1851
1845
|
title: h(c).blockActions.saveAsBlock,
|
|
1852
1846
|
onClick: E(re, ["stop"])
|
|
1853
|
-
}, [g(h(
|
|
1847
|
+
}, [g(h(rn), {
|
|
1854
1848
|
size: 14,
|
|
1855
1849
|
"stroke-width": 1.5
|
|
1856
1850
|
})], 8, zi)) : S("", !0),
|
|
@@ -1859,12 +1853,12 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1859
1853
|
"aria-label": h(c).blockActions.delete,
|
|
1860
1854
|
title: h(c).blockActions.delete,
|
|
1861
1855
|
onClick: E(te, ["stop"])
|
|
1862
|
-
}, [g(h(
|
|
1856
|
+
}, [g(h(cn), {
|
|
1863
1857
|
size: 14,
|
|
1864
1858
|
"stroke-width": 1.5
|
|
1865
1859
|
})], 8, Bi)
|
|
1866
1860
|
], 8, Ii)) : S("", !0),
|
|
1867
|
-
C.value ? (s(), x("div", Vi, [k("span", Hi, [g(h(
|
|
1861
|
+
C.value ? (s(), x("div", Vi, [k("span", Hi, [g(h(tn), {
|
|
1868
1862
|
size: 12,
|
|
1869
1863
|
"stroke-width": 1.5
|
|
1870
1864
|
}), R(" " + F(h(u)(h(c).blockActions.hiddenOnViewport, { viewport: O.value })), 1)])])) : S("", !0),
|
|
@@ -1874,7 +1868,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1874
1868
|
"aria-label": h(c).blockActions.conditionToggle,
|
|
1875
1869
|
title: e.block.displayCondition?.label,
|
|
1876
1870
|
onClick: E(ie, ["stop"])
|
|
1877
|
-
}, [g(h(
|
|
1871
|
+
}, [g(h(_n), {
|
|
1878
1872
|
size: 12,
|
|
1879
1873
|
"stroke-width": 2
|
|
1880
1874
|
})], 8, Wi)])) : S("", !0),
|
|
@@ -1882,7 +1876,7 @@ var Ni = ["innerHTML"], Pi = /* @__PURE__ */ d({
|
|
|
1882
1876
|
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)]",
|
|
1883
1877
|
"aria-label": h(u)(h(c).blockActions.comments, { count: String(B.value) }),
|
|
1884
1878
|
onClick: n[0] ||= E((t) => h(N).comments?.openForBlock(e.block.id), ["stop"])
|
|
1885
|
-
}, [g(h(
|
|
1879
|
+
}, [g(h(fn), {
|
|
1886
1880
|
size: 12,
|
|
1887
1881
|
"stroke-width": 2.5
|
|
1888
1882
|
}), R(" " + F(B.value), 1)], 8, Ki)])) : S("", !0),
|
|
@@ -1916,9 +1910,9 @@ var Yi = /* @__PURE__ */ d({
|
|
|
1916
1910
|
viewport: {}
|
|
1917
1911
|
},
|
|
1918
1912
|
setup(e) {
|
|
1919
|
-
let t = e, n = L(() => import("./TitleEditor-
|
|
1913
|
+
let t = e, n = L(() => import("./TitleEditor-D1F0YoE-.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = Mi(() => t.block.content), d = b(() => {
|
|
1920
1914
|
let e = {
|
|
1921
|
-
fontSize: `${
|
|
1915
|
+
fontSize: `${V[t.block.level]}px`,
|
|
1922
1916
|
textAlign: t.block.textAlign
|
|
1923
1917
|
};
|
|
1924
1918
|
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
@@ -1968,10 +1962,10 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
1968
1962
|
title: Yi,
|
|
1969
1963
|
paragraph: Pi,
|
|
1970
1964
|
image: xi,
|
|
1971
|
-
button:
|
|
1965
|
+
button: Er,
|
|
1972
1966
|
divider: ni,
|
|
1973
1967
|
custom: ei
|
|
1974
|
-
}, a = e, { t: o } =
|
|
1968
|
+
}, a = e, { t: o } = Y(), c = it(J, "SectionBlock"), d = n(jt, null), p = n(Ht, null), m = n(Ft, {}), _ = n(Vt, null);
|
|
1975
1969
|
function y(e) {
|
|
1976
1970
|
let t = m.savedBlocks;
|
|
1977
1971
|
t?.isPicking.value ? t.togglePick(a.block.id) : c.selectBlock(e);
|
|
@@ -2004,17 +1998,23 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2004
1998
|
}
|
|
2005
1999
|
let I = l(null);
|
|
2006
2000
|
function L(e) {
|
|
2007
|
-
return j(e) ? !0 : I.value === e && E(e).filter((e) => A(e.id)).length <= 1;
|
|
2001
|
+
return c.state.previewMode ? !1 : j(e) ? !0 : I.value === e && E(e).filter((e) => A(e.id)).length <= 1;
|
|
2002
|
+
}
|
|
2003
|
+
function R(e) {
|
|
2004
|
+
return E(e).length === 0 && !c.state.previewMode;
|
|
2008
2005
|
}
|
|
2009
|
-
function
|
|
2006
|
+
function z(e) {
|
|
2007
|
+
return E(e).length === 0 && c.state.previewMode;
|
|
2008
|
+
}
|
|
2009
|
+
function B(e, t) {
|
|
2010
2010
|
let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...a.block.children];
|
|
2011
2011
|
for (; r.length <= e;) r.push([]);
|
|
2012
2012
|
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
2013
2013
|
}
|
|
2014
|
-
function
|
|
2015
|
-
return
|
|
2014
|
+
function V(e) {
|
|
2015
|
+
return vr(e, p, t);
|
|
2016
2016
|
}
|
|
2017
|
-
function
|
|
2017
|
+
function H(e, t) {
|
|
2018
2018
|
e.type === "custom" && c.updateBlock(e.id, {
|
|
2019
2019
|
fieldValues: t.fieldValues,
|
|
2020
2020
|
dataSourceFetched: t.dataSourceFetched
|
|
@@ -2022,7 +2022,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2022
2022
|
}
|
|
2023
2023
|
return (t, n) => (s(), x("div", Zi, [k("div", { class: v(["tpl:flex tpl:gap-0", { "tpl:flex-col": T.value }]) }, [(s(!0), x(P, null, r(w.value, (t, a) => (s(), x("div", {
|
|
2024
2024
|
key: a,
|
|
2025
|
-
class: v(["tpl:relative tpl:flex tpl:flex-col tpl:rounded",
|
|
2025
|
+
class: v(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", R(a) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
2026
2026
|
style: D({ width: T.value ? "100%" : C.value[a] })
|
|
2027
2027
|
}, [g(h(N), {
|
|
2028
2028
|
"model-value": E(a),
|
|
@@ -2039,10 +2039,13 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2039
2039
|
"inverted-swap-threshold": .65,
|
|
2040
2040
|
"empty-insert-threshold": 20,
|
|
2041
2041
|
"force-fallback": !0,
|
|
2042
|
-
class: v(["tpl:grow", {
|
|
2042
|
+
class: v(["tpl:grow", {
|
|
2043
|
+
"tpl:min-h-[60px]": L(a),
|
|
2044
|
+
"tpl:min-h-[34px]": z(a)
|
|
2045
|
+
}]),
|
|
2043
2046
|
onStart: (e) => I.value = a,
|
|
2044
2047
|
onEnd: n[0] ||= (e) => I.value = null,
|
|
2045
|
-
"onUpdate:modelValue": (e) =>
|
|
2048
|
+
"onUpdate:modelValue": (e) => B(a, e)
|
|
2046
2049
|
}, {
|
|
2047
2050
|
default: i(() => [(s(!0), x(P, null, r(E(a), (t) => f((s(), x("div", { key: t.id }, [g(qi, {
|
|
2048
2051
|
block: t,
|
|
@@ -2052,10 +2055,10 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2052
2055
|
nested: "",
|
|
2053
2056
|
onSelect: (e) => y(t.id)
|
|
2054
2057
|
}, {
|
|
2055
|
-
default: i(() => [(s(), O(u(
|
|
2058
|
+
default: i(() => [(s(), O(u(V(t)), {
|
|
2056
2059
|
block: t,
|
|
2057
2060
|
viewport: e.viewport,
|
|
2058
|
-
onFetchData: (e) =>
|
|
2061
|
+
onFetchData: (e) => H(t, e),
|
|
2059
2062
|
onUpdate: (e) => h(c).updateBlock(t.id, e)
|
|
2060
2063
|
}, null, 40, [
|
|
2061
2064
|
"block",
|
|
@@ -2078,7 +2081,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2078
2081
|
"class",
|
|
2079
2082
|
"onStart",
|
|
2080
2083
|
"onUpdate:modelValue"
|
|
2081
|
-
]),
|
|
2084
|
+
]), R(a) ? (s(), x("div", Qi, [k("span", null, F(h(o).section.dropHere), 1)])) : S("", !0)], 6))), 128))], 2)]));
|
|
2082
2085
|
}
|
|
2083
2086
|
}), ea = ["width", "height"], ta = [
|
|
2084
2087
|
"d",
|
|
@@ -2094,7 +2097,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2094
2097
|
iconSize: {}
|
|
2095
2098
|
},
|
|
2096
2099
|
setup(e) {
|
|
2097
|
-
let t = e, n = b(() =>
|
|
2100
|
+
let t = e, n = b(() => qe[t.platform]), r = b(() => Ye[t.iconSize]), i = b(() => Le(t.platform, t.iconTone)), a = b(() => be(t.iconStyle, t.iconTone)), o = b(() => {
|
|
2098
2101
|
let e = {
|
|
2099
2102
|
display: "inline-flex",
|
|
2100
2103
|
alignItems: "center",
|
|
@@ -2132,7 +2135,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2132
2135
|
};
|
|
2133
2136
|
default: return e;
|
|
2134
2137
|
}
|
|
2135
|
-
}), c = b(() =>
|
|
2138
|
+
}), c = b(() => ze(t.iconStyle)), l = b(() => Math.floor(r.value * c.value));
|
|
2136
2139
|
function u(e) {
|
|
2137
2140
|
let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
|
|
2138
2141
|
return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
|
|
@@ -2168,7 +2171,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2168
2171
|
viewport: {}
|
|
2169
2172
|
},
|
|
2170
2173
|
setup(e) {
|
|
2171
|
-
let t = e, { t: n } =
|
|
2174
|
+
let t = e, { t: n } = Y(), i = b(() => ({
|
|
2172
2175
|
display: "flex",
|
|
2173
2176
|
flexWrap: "wrap",
|
|
2174
2177
|
gap: `${t.block.spacing}px`,
|
|
@@ -2192,7 +2195,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2192
2195
|
"icon-style",
|
|
2193
2196
|
"icon-tone",
|
|
2194
2197
|
"icon-size"
|
|
2195
|
-
])], 8, aa))), 128))], 4)) : (s(), x("div", oa, [g(h(
|
|
2198
|
+
])], 8, aa))), 128))], 4)) : (s(), x("div", oa, [g(h(un), { size: 16 }), k("span", null, F(h(n).social.addIcons), 1)]))]));
|
|
2196
2199
|
}
|
|
2197
2200
|
}), ca = { class: "tpl:w-full" }, la = {
|
|
2198
2201
|
key: 0,
|
|
@@ -2208,7 +2211,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2208
2211
|
viewport: {}
|
|
2209
2212
|
},
|
|
2210
2213
|
setup(e) {
|
|
2211
|
-
let t = e, n =
|
|
2214
|
+
let t = e, n = it(J, "SpacerBlock"), r = b(() => ({
|
|
2212
2215
|
height: `${t.block.height}px`,
|
|
2213
2216
|
minHeight: `${t.block.height}px`,
|
|
2214
2217
|
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
@@ -2229,7 +2232,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2229
2232
|
], ha = {
|
|
2230
2233
|
key: 1,
|
|
2231
2234
|
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)]"
|
|
2232
|
-
}, ga = /*#__PURE__*/
|
|
2235
|
+
}, ga = /*#__PURE__*/ yn(/* @__PURE__ */ d({
|
|
2233
2236
|
__name: "TableBlock",
|
|
2234
2237
|
props: {
|
|
2235
2238
|
block: {},
|
|
@@ -2243,7 +2246,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2243
2246
|
updated(e, t) {
|
|
2244
2247
|
t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
|
|
2245
2248
|
}
|
|
2246
|
-
}, n = e, { t: i } =
|
|
2249
|
+
}, n = e, { t: i } = Y(), a = it(J, "TableBlock"), o = b(() => n.block.rows.length > 0), c = b(() => {
|
|
2247
2250
|
let e = {
|
|
2248
2251
|
width: "100%",
|
|
2249
2252
|
borderCollapse: "collapse",
|
|
@@ -2296,7 +2299,7 @@ var Zi = { class: "tpl:w-full" }, Qi = {
|
|
|
2296
2299
|
onBlur: (t) => v(e.id, r.id, t),
|
|
2297
2300
|
onKeydown: n[1] ||= _(E((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
2298
2301
|
onClick: E(m, ["stop"])
|
|
2299
|
-
}, null, 44, ma)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), x("div", ha, [g(h(
|
|
2302
|
+
}, null, 44, ma)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), x("div", ha, [g(h(gn), { size: 16 }), k("span", null, F(h(i).table.empty), 1)]))]));
|
|
2300
2303
|
}
|
|
2301
2304
|
}), [["__scopeId", "data-v-963ac422"]]), _a = /* @__PURE__ */ d({
|
|
2302
2305
|
__name: "VideoPlayButton",
|
|
@@ -2366,7 +2369,7 @@ var ba = ["src", "alt"], xa = {
|
|
|
2366
2369
|
viewport: {}
|
|
2367
2370
|
},
|
|
2368
2371
|
setup(e) {
|
|
2369
|
-
let t = e, { t: n } =
|
|
2372
|
+
let t = e, { t: n } = Y(), { syntax: r } = xn(), i = b(() => U(t.block.url, r) || U(t.block.thumbnailUrl, r)), a = An(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = An(() => i.value ? t.block.placeholderUrl : void 0), c = b(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : ya(t.block.url)), l = b(() => ({ textAlign: t.block.align })), u = b(() => {
|
|
2370
2373
|
let e = t.block.align;
|
|
2371
2374
|
return {
|
|
2372
2375
|
maxWidth: "100%",
|
|
@@ -2376,7 +2379,7 @@ var ba = ["src", "alt"], xa = {
|
|
|
2376
2379
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2377
2380
|
marginRight: e === "center" ? "auto" : void 0
|
|
2378
2381
|
};
|
|
2379
|
-
}), d = b(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = b(() =>
|
|
2382
|
+
}), d = b(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), f = b(() => U(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
|
|
2380
2383
|
return (t, r) => (s(), x("div", {
|
|
2381
2384
|
class: "tpl:w-full",
|
|
2382
2385
|
style: D(l.value)
|
|
@@ -2393,12 +2396,12 @@ var ba = ["src", "alt"], xa = {
|
|
|
2393
2396
|
key: 1,
|
|
2394
2397
|
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)]",
|
|
2395
2398
|
style: D([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
2396
|
-
}, [g(h(
|
|
2399
|
+
}, [g(h(pn), {
|
|
2397
2400
|
size: 36,
|
|
2398
2401
|
"stroke-width": 1.5,
|
|
2399
2402
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
2400
2403
|
style: { opacity: "0.5" }
|
|
2401
|
-
}), k("span", xa, [g(
|
|
2404
|
+
}), k("span", xa, [g(wr, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (s(), x(P, { key: 2 }, [e.block.url ? (s(), x("a", {
|
|
2402
2405
|
key: 0,
|
|
2403
2406
|
href: e.block.url,
|
|
2404
2407
|
target: "_blank",
|
|
@@ -2420,7 +2423,7 @@ var ba = ["src", "alt"], xa = {
|
|
|
2420
2423
|
src: c.value,
|
|
2421
2424
|
alt: e.block.alt,
|
|
2422
2425
|
style: D(d.value)
|
|
2423
|
-
}, null, 12, wa), g(_a)], 4))], 64)) : (s(), x("div", Ta, [g(h(
|
|
2426
|
+
}, null, 12, wa), g(_a)], 4))], 64)) : (s(), x("div", Ta, [g(h(pn), {
|
|
2424
2427
|
size: 40,
|
|
2425
2428
|
"stroke-width": 1.5,
|
|
2426
2429
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
@@ -2431,7 +2434,7 @@ var ba = ["src", "alt"], xa = {
|
|
|
2431
2434
|
title: Yi,
|
|
2432
2435
|
paragraph: Pi,
|
|
2433
2436
|
image: xi,
|
|
2434
|
-
button:
|
|
2437
|
+
button: Er,
|
|
2435
2438
|
divider: ni,
|
|
2436
2439
|
video: Ea,
|
|
2437
2440
|
social: sa,
|
|
@@ -2442,32 +2445,32 @@ var ba = ["src", "alt"], xa = {
|
|
|
2442
2445
|
countdown: L(() => import("./CountdownBlock-lHU3Lu7Q.js"))
|
|
2443
2446
|
};
|
|
2444
2447
|
function Oa(e) {
|
|
2445
|
-
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } =
|
|
2448
|
+
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } = Y(i), d = b(() => Se(Se(Se(Jn(i), pr(n.content.value.settings?.locale)), ge(n.content.value.settings) === "rtl" ? {
|
|
2446
2449
|
title: { textAlign: "right" },
|
|
2447
2450
|
table: { textAlign: "right" }
|
|
2448
2451
|
} : {}), r.blockDefaults ?? {}));
|
|
2449
2452
|
n.setUiTheme(r.uiTheme ?? "auto");
|
|
2450
|
-
let { resolvedTheme: f } =
|
|
2453
|
+
let { resolvedTheme: f } = In(b(() => n.state.uiTheme)), p = l(r.theme ?? {}), { themeStyles: h } = Rn({
|
|
2451
2454
|
themeOverrides: p,
|
|
2452
2455
|
resolvedTheme: f,
|
|
2453
2456
|
extraStyles: () => ({
|
|
2454
2457
|
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
2455
2458
|
...e.themeExtraStyles?.()
|
|
2456
2459
|
})
|
|
2457
|
-
}), g =
|
|
2460
|
+
}), g = He({
|
|
2458
2461
|
content: n.content,
|
|
2459
2462
|
setContent: (e, t) => n.setContent(e, t),
|
|
2460
2463
|
...e.historyOptions
|
|
2461
2464
|
});
|
|
2462
|
-
|
|
2463
|
-
let _ =
|
|
2465
|
+
Ke(n, g);
|
|
2466
|
+
let _ = Ze({
|
|
2464
2467
|
addBlock: n.addBlock,
|
|
2465
2468
|
removeBlock: n.removeBlock,
|
|
2466
2469
|
updateBlock: n.updateBlock,
|
|
2467
2470
|
selectBlock: n.selectBlock,
|
|
2468
2471
|
findBlockLocation: n.findBlockLocation,
|
|
2469
2472
|
blockDefaults: () => d.value
|
|
2470
|
-
}), v =
|
|
2473
|
+
}), v = Ue(n), x = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? Xe({
|
|
2471
2474
|
content: n.content,
|
|
2472
2475
|
isDirty: () => n.state.isDirty,
|
|
2473
2476
|
...e.autoSaveOptions
|
|
@@ -2475,30 +2478,30 @@ function Oa(e) {
|
|
|
2475
2478
|
x && (S = t(g.isNavigating, (e) => {
|
|
2476
2479
|
e ? x.pause() : x.resume();
|
|
2477
2480
|
}));
|
|
2478
|
-
let C =
|
|
2481
|
+
let C = Fn(n, {
|
|
2479
2482
|
t: s,
|
|
2480
2483
|
format: u
|
|
2481
|
-
}, r.customBlocks ?? []), w =
|
|
2482
|
-
if (w.allowCustomIgnored &&
|
|
2483
|
-
let e =
|
|
2484
|
-
e.length > 0 &&
|
|
2485
|
-
}
|
|
2486
|
-
let T =
|
|
2487
|
-
for (let e of T.unknown)
|
|
2488
|
-
let E =
|
|
2489
|
-
|
|
2484
|
+
}, r.customBlocks ?? []), w = Yt(r.colors);
|
|
2485
|
+
if (w.allowCustomIgnored && X.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), w.invalidPresets.length > 0 && X.warn(`config.colors.presets skipped invalid entries: ${w.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), w.allowCustom === !1) {
|
|
2486
|
+
let e = qn(w.presets, r.blockDefaults, r.templateDefaults);
|
|
2487
|
+
e.length > 0 && X.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.`);
|
|
2488
|
+
}
|
|
2489
|
+
let T = Zt(r.templateSettings);
|
|
2490
|
+
for (let e of T.unknown) X.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${Qt.join(", ")}) — skipping it.`);
|
|
2491
|
+
let E = zn();
|
|
2492
|
+
Wn(E, Da);
|
|
2490
2493
|
let D = /* @__PURE__ */ new Set();
|
|
2491
2494
|
function O(e) {
|
|
2492
2495
|
for (let t of e) {
|
|
2493
2496
|
E.registerCustom(t, ei);
|
|
2494
|
-
for (let e of
|
|
2497
|
+
for (let e of mr(t, w)) D.has(e.id) || (D.add(e.id), X.warn(e.message));
|
|
2495
2498
|
}
|
|
2496
2499
|
}
|
|
2497
2500
|
r.customBlocks?.length && O(r.customBlocks);
|
|
2498
|
-
let k =
|
|
2501
|
+
let k = En();
|
|
2499
2502
|
if (o() && m(k.dispose), e.containerEl) {
|
|
2500
2503
|
let t = e.containerEl;
|
|
2501
|
-
|
|
2504
|
+
W(document, "pointerdown", (e) => {
|
|
2502
2505
|
let n = t.value;
|
|
2503
2506
|
n && (e.composedPath?.() ?? []).includes(n) && k.claim();
|
|
2504
2507
|
}, { capture: !0 });
|
|
@@ -2508,7 +2511,7 @@ function Oa(e) {
|
|
|
2508
2511
|
t ? t.save() : x?.flush();
|
|
2509
2512
|
}
|
|
2510
2513
|
function j(t) {
|
|
2511
|
-
k.isActive() &&
|
|
2514
|
+
k.isActive() && gr(t, {
|
|
2512
2515
|
history: g,
|
|
2513
2516
|
selectBlock: (e) => n.selectBlock(e),
|
|
2514
2517
|
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
@@ -2520,43 +2523,44 @@ function Oa(e) {
|
|
|
2520
2523
|
onCancelPick: () => e.capabilities?.savedBlocks?.cancelPicking()
|
|
2521
2524
|
});
|
|
2522
2525
|
}
|
|
2523
|
-
|
|
2524
|
-
let M = l(null);
|
|
2525
|
-
c(
|
|
2526
|
-
let
|
|
2527
|
-
function
|
|
2528
|
-
Array.isArray(e) ?
|
|
2529
|
-
}
|
|
2530
|
-
c(
|
|
2531
|
-
let
|
|
2532
|
-
c(
|
|
2533
|
-
let
|
|
2526
|
+
W(document, "keydown", j);
|
|
2527
|
+
let M = l(null), N = e.editorRoot ?? document;
|
|
2528
|
+
c(Et, N), c(ot, M), c(wt, i), c(J, n), c(Kt, g), c(Dt, _), c(jt, v), c(Ut, a), c(pt, h), c(Tt, f), c(Rt, d), c(Ct, r.locale), c(Ht, E), c(zt, r.customBlocks ?? []), c(qt, r.paletteBlocks), c(Ot, Gn(r.htmlBlockPreview)), c(st, r.layout), c(ut, r.sectionWrapper), c(At, w), c(Bt, T.fields), c(It, Bn(n.content, E));
|
|
2529
|
+
let P = Te(r.mergeTags?.syntax), F = y(r.mergeTags?.tags ?? []);
|
|
2530
|
+
function I(e) {
|
|
2531
|
+
Array.isArray(e) ? F.value = e : X.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
|
|
2532
|
+
}
|
|
2533
|
+
c(K, F), c(vt, P), c(yt, r.mergeTags?.onRequest ?? null), c(Pt, r.mergeTags?.autocomplete !== !1), c(_t, r.mergeTags?.showRawValue !== !1);
|
|
2534
|
+
let L = l(Fe(r.mergeTags?.tags ?? []));
|
|
2535
|
+
c(gt, L);
|
|
2536
|
+
let R = On({
|
|
2534
2537
|
resolvePreview: r.resolvePreview,
|
|
2535
2538
|
getContent: () => {
|
|
2536
2539
|
let e = n.content.value;
|
|
2537
|
-
return r.layout && n.state.previewMode ?
|
|
2540
|
+
return r.layout && n.state.previewMode ? fe(r.layout, e) : e;
|
|
2538
2541
|
},
|
|
2539
2542
|
isActive: () => n.state.previewMode
|
|
2540
2543
|
});
|
|
2541
|
-
c(
|
|
2542
|
-
let
|
|
2543
|
-
c(
|
|
2544
|
-
let
|
|
2545
|
-
c(
|
|
2546
|
-
let
|
|
2544
|
+
c(St, R), c(dt, r.resolvePreview);
|
|
2545
|
+
let z = b(() => !(n.state.previewMode && R.isConfigured));
|
|
2546
|
+
c(Vt, z);
|
|
2547
|
+
let B = jn();
|
|
2548
|
+
c(at, B), c(Nt, l(!1)), c(ct, l(!1)), c(xt, r.logicTags?.tags ?? []), c(Wt, r.logicTags?.pairs ?? []), c(ft, r.logicTags?.onRequest ?? null), c(lt, Mn()), c(ht, r.onRequestMedia ?? null), c(kt, r.canDropMedia ?? null), c(Gt, r.resolveImageUrl ? kn(r.resolveImageUrl) : null), c(Mt, r.displayConditions?.conditions ?? []), c(Lt, r.displayConditions?.allowCustom ?? !1), c(Ft, e.capabilities ?? {}), c(bt, C);
|
|
2549
|
+
let V = Nn(r.lint) ? null : Pn({
|
|
2547
2550
|
content: n.content,
|
|
2548
2551
|
options: r.lint ?? {},
|
|
2549
2552
|
updateBlock: n.updateBlock,
|
|
2550
2553
|
updateSettings: n.updateSettings,
|
|
2551
2554
|
removeBlock: n.removeBlock
|
|
2552
2555
|
});
|
|
2553
|
-
c(
|
|
2554
|
-
function
|
|
2555
|
-
S?.(),
|
|
2556
|
+
c(mt, V);
|
|
2557
|
+
function H() {
|
|
2558
|
+
S?.(), V?.destroy(), x?.destroy(), g.destroy();
|
|
2556
2559
|
}
|
|
2557
2560
|
return {
|
|
2558
2561
|
t: s,
|
|
2559
2562
|
format: u,
|
|
2563
|
+
editorRoot: N,
|
|
2560
2564
|
history: g,
|
|
2561
2565
|
blockActions: _,
|
|
2562
2566
|
conditionPreview: v,
|
|
@@ -2566,17 +2570,17 @@ function Oa(e) {
|
|
|
2566
2570
|
themeOverrides: p,
|
|
2567
2571
|
registry: E,
|
|
2568
2572
|
keyboardReorder: C,
|
|
2569
|
-
templateLint:
|
|
2573
|
+
templateLint: V,
|
|
2570
2574
|
popoverRoot: M,
|
|
2571
|
-
mergeTagSampleMode:
|
|
2572
|
-
previewResolution:
|
|
2573
|
-
appliesConditionFilter:
|
|
2575
|
+
mergeTagSampleMode: L,
|
|
2576
|
+
previewResolution: R,
|
|
2577
|
+
appliesConditionFilter: z,
|
|
2574
2578
|
registerCustomBlocks: O,
|
|
2575
|
-
setMergeTags:
|
|
2576
|
-
destroy:
|
|
2579
|
+
setMergeTags: I,
|
|
2580
|
+
destroy: H
|
|
2577
2581
|
};
|
|
2578
2582
|
}
|
|
2579
2583
|
//#endregion
|
|
2580
|
-
export {
|
|
2584
|
+
export { cr as A, yr as C, nr as D, vr as E, or as M, ar as N, ur as O, On as P, Er as S, Sr as T, Vr as _, sa as a, jr as b, qi as c, xi as d, ci as f, Ur as g, Gr as h, ua as i, sr as j, lr as k, Pi as l, ei as m, Ea as n, $i as o, ni as p, ga as r, Yi as s, Oa as t, Ti as u, Ir as v, _r as w, kr as x, Mr as y };
|
|
2581
2585
|
|
|
2582
|
-
//# sourceMappingURL=useEditorCore-
|
|
2586
|
+
//# sourceMappingURL=useEditorCore-DuC7kVti.js.map
|