@templatical/editor 0.28.1 → 0.29.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-mZyf81xG.js → AiChatSidebar-KeS30iRG.js} +7 -7
- package/dist/{AiFeatureMenu-wpL2vbbd.js → AiFeatureMenu-CCdTgCy7.js} +4 -4
- package/dist/{BlockIssueBadge-CavnyR3o.js → BlockIssueBadge-DQ6jBV1T.js} +2 -2
- package/dist/{BlockPreviewCanvas-C4M7JT4x.js → BlockPreviewCanvas-MgXVXOG_.js} +1 -1
- package/dist/{CloudHeaderExtras-fH0cB-Ru.js → CloudHeaderExtras-L_b51XVJ.js} +2 -2
- package/dist/{CloudPanels-Davlnzfd.js → CloudPanels-XUtScYFl.js} +3 -3
- package/dist/{CollaboratorBar-BvQZriPA.js → CollaboratorBar-Cx5klY7H.js} +2 -2
- package/dist/{ColorPicker-OLSFZBBZ.js → ColorPicker-DjfecH79.js} +1 -1
- package/dist/{CommentsPanel-B4_63eIS.js → CommentsPanel-5QxgkKF-.js} +1 -1
- package/dist/{CommentsSidebar-BkBHMXez.js → CommentsSidebar-CScszOsC.js} +10 -10
- package/dist/{CountdownToolbar-D8FsDIfa.js → CountdownToolbar-CiBrLbq0.js} +1 -1
- package/dist/{DesignReferenceSidebar-Dp44REBY.js → DesignReferenceSidebar-B1__DJJI.js} +5 -5
- package/dist/{IssuesPanel-C1v3dmoB.js → IssuesPanel-CkuV9Fjp.js} +5 -5
- package/dist/{MergeTagModeToggle-CZN0Pr1o.js → MergeTagModeToggle-oX-n91fH.js} +2 -2
- package/dist/{MergeTagSuggestion-a7Tk8tBB.js → MergeTagSuggestion-BUozNVtA.js} +55 -39
- package/dist/{ParagraphEditor-CGxsm0Mx.js → ParagraphEditor-BVlMj-YW.js} +19 -19
- package/dist/{RestoreVersionDialog-BLW8wC1J.js → RestoreVersionDialog-CZRLWoqP.js} +3 -3
- package/dist/{RichTextEditorContent-COBy_Q9j.js → RichTextEditorContent-BN6RBSZG.js} +3 -3
- package/dist/{SaveBlockDialog-KWQaS1_q.js → SaveBlockDialog-KNQVLcUG.js} +6 -6
- package/dist/{SavedBlocksBrowserModal-Cg8yP_EN.js → SavedBlocksBrowserModal-D7qatvfw.js} +7 -7
- package/dist/{SavedBlocksPanels-bept0JjA.js → SavedBlocksPanels-bizAFdNK.js} +1 -1
- package/dist/{SavedBlocksPickBar-Z-YRd488.js → SavedBlocksPickBar-BXUSoa38.js} +2 -2
- package/dist/{TemplateScoringPanel-5zp1qOSl.js → TemplateScoringPanel-Dm83xt9R.js} +10 -10
- package/dist/{TestEmailModal-DtJabfkS.js → TestEmailModal-DAdO9Gmo.js} +6 -6
- package/dist/{TestEmailPanel-CtFxt5q7.js → TestEmailPanel-DORs6xk0.js} +1 -1
- package/dist/{TitleEditor-BfWPus_C.js → TitleEditor-B_aWxZER.js} +8 -8
- package/dist/{TplModal-DBlMd7h9.js → TplModal-7623HR5x.js} +1 -1
- package/dist/{VersionHistoryMenu-Cg4UKxKc.js → VersionHistoryMenu-D7lgozpw.js} +4 -4
- package/dist/{VersionHistoryPanels-BKjbNEOM.js → VersionHistoryPanels-Dor0p1Ur.js} +1 -1
- package/dist/{VersionPreviewBanner-B0thyJ8F.js → VersionPreviewBanner-CQt2il1L.js} +1 -1
- package/dist/{blockTypeIcons-CQMkcHo9.js → blockTypeIcons-Di4AsjQx.js} +2 -2
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-BQATQ3Tr.js → AiChatSidebar-Cwr9eqTh.js} +2 -2
- package/dist/cdn/chunks/{AiChatSidebar-BQATQ3Tr.js.map → AiChatSidebar-Cwr9eqTh.js.map} +1 -1
- package/dist/cdn/chunks/{AiFeatureMenu-cNoZ0xl_.js → AiFeatureMenu-CT2QiHmi.js} +3 -3
- package/dist/cdn/chunks/{AiFeatureMenu-cNoZ0xl_.js.map → AiFeatureMenu-CT2QiHmi.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-CH_3vFw4.js → BlockIssueBadge-CXlXn9Sm.js} +2 -2
- package/dist/cdn/chunks/{BlockIssueBadge-CH_3vFw4.js.map → BlockIssueBadge-CXlXn9Sm.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-BXVC8-Zj.js → BlockPreviewCanvas-BisO3JEy.js} +2 -2
- package/dist/cdn/chunks/{BlockPreviewCanvas-BXVC8-Zj.js.map → BlockPreviewCanvas-BisO3JEy.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-CUAM2ADe.js → CloudHeaderExtras-MRCYqip8.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-CUAM2ADe.js.map → CloudHeaderExtras-MRCYqip8.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-DMnnSIkX.js → CloudPanels-Bb9qSwKJ.js} +4 -4
- package/dist/cdn/chunks/{CloudPanels-DMnnSIkX.js.map → CloudPanels-Bb9qSwKJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C6sorNRi.js → CollaboratorBar-CG13kDHu.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-C6sorNRi.js.map → CollaboratorBar-CG13kDHu.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-q1V7ggWI.js → ColorPicker-UpN24AsB.js} +2 -2
- package/dist/cdn/chunks/{ColorPicker-q1V7ggWI.js.map → ColorPicker-UpN24AsB.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-ExfxJZM3.js → CommentsPanel-CIcIXzOB.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-ExfxJZM3.js.map → CommentsPanel-CIcIXzOB.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-CzALURMJ.js → CommentsSidebar-CB5Z8xNz.js} +2 -2
- package/dist/cdn/chunks/{CommentsSidebar-CzALURMJ.js.map → CommentsSidebar-CB5Z8xNz.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CkbWSrAH.js → CountdownToolbar-B1L0IK1T.js} +2 -2
- package/dist/cdn/chunks/{CountdownToolbar-CkbWSrAH.js.map → CountdownToolbar-B1L0IK1T.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-COh0Rx_A.js → DesignReferenceSidebar-BwsfOFsc.js} +2 -2
- package/dist/cdn/chunks/{DesignReferenceSidebar-COh0Rx_A.js.map → DesignReferenceSidebar-BwsfOFsc.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-C1NG0xRI.js → IssuesPanel-3nTCyKgK.js} +2 -2
- package/dist/cdn/chunks/{IssuesPanel-C1NG0xRI.js.map → IssuesPanel-3nTCyKgK.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-B1yXCp3D.js → MergeTagModeToggle-BUNsRKs6.js} +2 -2
- package/dist/cdn/chunks/{MergeTagModeToggle-B1yXCp3D.js.map → MergeTagModeToggle-BUNsRKs6.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagSuggestion-DqYR3jPA.js → MergeTagSuggestion-Dt6I8bZi.js} +2 -2
- package/dist/cdn/chunks/{MergeTagSuggestion-DqYR3jPA.js.map → MergeTagSuggestion-Dt6I8bZi.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-DPM1hUKo.js → ParagraphEditor-BtzkHfv2.js} +17 -17
- package/dist/cdn/chunks/{ParagraphEditor-DPM1hUKo.js.map → ParagraphEditor-BtzkHfv2.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-Dz0bX5ZZ.js → RestoreVersionDialog-DNoo-EBT.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog-Dz0bX5ZZ.js.map → RestoreVersionDialog-DNoo-EBT.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-nkyIRAyN.js → RichTextEditorContent-BQATmyd9.js} +3 -3
- package/dist/cdn/chunks/{RichTextEditorContent-nkyIRAyN.js.map → RichTextEditorContent-BQATmyd9.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-DYr5yKqy.js → SaveBlockDialog-DB37Vmqt.js} +5 -5
- package/dist/cdn/chunks/{SaveBlockDialog-DYr5yKqy.js.map → SaveBlockDialog-DB37Vmqt.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BUJjcHkw.js → SavedBlocksBrowserModal-CTU2rGWQ.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BUJjcHkw.js.map → SavedBlocksBrowserModal-CTU2rGWQ.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DFgvmsbj.js → SavedBlocksPanels-B9h9wI6d.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-DFgvmsbj.js.map → SavedBlocksPanels-B9h9wI6d.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-Brg8US_n.js → SavedBlocksPickBar-CTY5WZum.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-Brg8US_n.js.map → SavedBlocksPickBar-CTY5WZum.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-DO86BvdQ.js → TemplateScoringPanel-DZ0cpe_D.js} +7 -7
- package/dist/cdn/chunks/{TemplateScoringPanel-DO86BvdQ.js.map → TemplateScoringPanel-DZ0cpe_D.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-DRCcdGvX.js → TestEmailModal-Dqx1RyDE.js} +6 -6
- package/dist/cdn/chunks/{TestEmailModal-DRCcdGvX.js.map → TestEmailModal-Dqx1RyDE.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BZU5HX2c.js → TestEmailPanel-DrcQhnON.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-BZU5HX2c.js.map → TestEmailPanel-DrcQhnON.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CLkXt5RZ.js → TitleEditor-CSeDvWVn.js} +8 -8
- package/dist/cdn/chunks/{TitleEditor-CLkXt5RZ.js.map → TitleEditor-CSeDvWVn.js.map} +1 -1
- package/dist/cdn/chunks/{TplModal-BhfPoZ_W.js → TplModal-BNBLwBxJ.js} +2 -2
- package/dist/cdn/chunks/{TplModal-BhfPoZ_W.js.map → TplModal-BNBLwBxJ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-_DyRYBRP.js → VersionHistoryMenu-cZlb0sMi.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryMenu-_DyRYBRP.js.map → VersionHistoryMenu-cZlb0sMi.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-DGfOOcKV.js → VersionHistoryPanels-DgrjTK3z.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-DGfOOcKV.js.map → VersionHistoryPanels-DgrjTK3z.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-FbBmgknN.js → VersionPreviewBanner-BNq7PRun.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-FbBmgknN.js.map → VersionPreviewBanner-BNq7PRun.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-o4ammRlm.js → blockTypeIcons-BNGmmzB_.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-o4ammRlm.js.map → blockTypeIcons-BNGmmzB_.js.map} +1 -1
- package/dist/cdn/chunks/createCloudRuntime-B_HRgFxU.js +443 -0
- package/dist/cdn/chunks/createCloudRuntime-B_HRgFxU.js.map +1 -0
- package/dist/cdn/chunks/en-BZlZVGwM.js +2 -0
- package/dist/cdn/chunks/{extensions-qSqWdFko.js → extensions-Deqilwp8.js} +3 -3
- package/dist/cdn/chunks/{extensions-qSqWdFko.js.map → extensions-Deqilwp8.js.map} +1 -1
- package/dist/cdn/chunks/{icons-MeYdeH4P.js → icons-C2kP4vOJ.js} +17 -17
- package/dist/cdn/chunks/{icons-MeYdeH4P.js.map → icons-C2kP4vOJ.js.map} +1 -1
- package/dist/cdn/chunks/{src-2QDLdUyx.js → src-CgIXdQlX.js} +3 -3
- package/dist/cdn/chunks/{src-2QDLdUyx.js.map → src-CgIXdQlX.js.map} +1 -1
- package/dist/cdn/chunks/{src-BxHH_6Yr.js → src-CnQgwcsc.js} +2 -2
- package/dist/cdn/chunks/{src-BxHH_6Yr.js.map → src-CnQgwcsc.js.map} +1 -1
- package/dist/cdn/chunks/{tiptap-DgH_wKK_.js → tiptap-DOw5Yb4H.js} +3276 -3229
- package/dist/cdn/chunks/tiptap-DOw5Yb4H.js.map +1 -0
- package/dist/cdn/chunks/{useEditorCore-2ZVOY0Rh.js → useEditorCore-Dq5gdn5i.js} +435 -411
- package/dist/cdn/chunks/useEditorCore-Dq5gdn5i.js.map +1 -0
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1360 -1353
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CLfibuQc.js → check-Cv96tY88.js} +1 -1
- package/dist/{chevron-down-DamTR8ta.js → chevron-down-BwEyjSjd.js} +1 -1
- package/dist/{chevron-up-CrV_Ksg-.js → chevron-up-C6Ye-Nzc.js} +1 -1
- package/dist/{circle-alert-BLy-e34e.js → circle-alert-BLt_gkcU.js} +1 -1
- package/dist/{clock-DQI6aaFT.js → clock-D-2BI0Co.js} +1 -1
- package/dist/createCloudRuntime-CWPQ7puE.js +441 -0
- package/dist/{createLucideIcon-Cbl3Ma_H.js → createLucideIcon-DGRWivCX.js} +2 -2
- package/dist/{dist-CgXIMxZc.js → dist-BG2cHdqw.js} +2 -2
- package/dist/{dist-CclsUQ7r.js → dist-BIFUEhwQ.js} +2 -2
- package/dist/{dist-DUn6jY0n.js → dist-BUh4MT4D.js} +2111 -2086
- package/dist/{dist-7Lr_A7Va.js → dist-BpHkLruF.js} +5 -4
- package/dist/{dist-C145btxT.js → dist-BtPhkQ2u.js} +154 -162
- package/dist/{dist-CQQNoHxz.js → dist-Btz6cFCI.js} +4 -4
- package/dist/dist-CCfNhI54.js +5 -0
- package/dist/{dist-D4Jb08yv.js → dist-CHp21juN.js} +2 -2
- package/dist/dist-CMcNDUcw.js +5 -0
- package/dist/{dist-CLc1cpN2.js → dist-DAR13YWM.js} +6 -5
- package/dist/{dist-Dx-KOuOj.js → dist-DQ_4a0hb.js} +2 -2
- package/dist/{dist-Dz7KUOSg.js → dist-q3Puexqv.js} +2 -2
- package/dist/{extensions-PJK0gLCL.js → extensions-BlYe3NFn.js} +3 -3
- package/dist/{image-up-BVOMy_Fs.js → image-up-KRq0lcdU.js} +1 -1
- package/dist/index.d.ts +146 -117
- package/dist/{info-BKMKasyT.js → info-DbmE2JAo.js} +1 -1
- package/dist/{loader-circle-CSGh8n8A.js → loader-circle-dSap9DfQ.js} +1 -1
- package/dist/{message-circle-C6q2Fm_W.js → message-circle-qSKKLbac.js} +1 -1
- package/dist/{pencil-DaTN0HKw.js → pencil-DMP8vL2F.js} +1 -1
- package/dist/{refresh-cw-Cu4wRQwT.js → refresh-cw-WXtBeMva.js} +1 -1
- package/dist/{scan-line-O_o657Gv.js → scan-line-BTrngVuN.js} +1 -1
- package/dist/{send-GS3soauT.js → send-CLa8Cxmh.js} +1 -1
- package/dist/{shield-check-B2TzT3Wp.js → shield-check-42WZrKQu.js} +1 -1
- package/dist/{sparkles-CNENcXZl.js → sparkles-DcOb0umz.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +723 -716
- package/dist/{text-align-start-D0-k8RUf.js → text-align-start-zoZhXJ2T.js} +1 -1
- package/dist/{trash-2-BE-qGIpG.js → trash-2-Capv4cSE.js} +1 -1
- package/dist/{triangle-alert-DNM2_dyh.js → triangle-alert-CnJUGX-6.js} +1 -1
- package/dist/{upload-Cv2Jx-yM.js → upload-Bc0ZTywl.js} +1 -1
- package/dist/{useEditorCore-DM8vzMZQ.js → useEditorCore-CIjO_NM9.js} +1094 -1072
- package/dist/{useScrollToBlock-C2LYXENK.js → useScrollToBlock-C2-9xCr7.js} +1 -1
- package/dist/{x-DUPrT6Aa.js → x-CvPZ3OAd.js} +1 -1
- package/package.json +22 -22
- package/dist/cdn/chunks/createCloudRuntime-C-u7oIGa.js +0 -344
- package/dist/cdn/chunks/createCloudRuntime-C-u7oIGa.js.map +0 -1
- package/dist/cdn/chunks/en-C6FKrw69.js +0 -2
- package/dist/cdn/chunks/tiptap-DgH_wKK_.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-2ZVOY0Rh.js.map +0 -1
- package/dist/createCloudRuntime-BrgMP9gS.js +0 -342
- package/dist/dist-D-ulkdvF.js +0 -5
- package/dist/dist-Kf9u4ULN.js +0 -5
|
@@ -7,18 +7,30 @@ import "./timeouts-DHPZQ0G3.js";
|
|
|
7
7
|
import { t as Y } from "./useI18n-DYb1SgLB.js";
|
|
8
8
|
import { t as X } from "./logger-ByvdoAwq.js";
|
|
9
9
|
import { a as Tt, i as Et, o as Dt, r as Z, t as Ot } from "./usePopoverPosition-CJZ6EkS4.js";
|
|
10
|
-
import { A as kt, Bt as At, Et as jt, H as Mt, Ot as Nt,
|
|
10
|
+
import { A as kt, Bt as At, Et as jt, H as Mt, Ot as Nt, Tt as Pt, X as Ft, d as It, ft as Lt, ht as Rt, it as zt, o as Bt, s as Vt, tt as Ht, u as Ut, v as Wt, vt as Gt, zt as Kt } from "./icons-C2kP4vOJ.js";
|
|
11
11
|
import { t as qt } from "./LoadingTrack-D_wweXVz.js";
|
|
12
12
|
import { t as Jt } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
13
13
|
import { t as Yt } from "./useEditorRoot-BY-amddA.js";
|
|
14
14
|
import "./useCloudI18n-D4gzxtqF.js";
|
|
15
15
|
import { t as Q } from "./useMergeTag-D-SE_XN8.js";
|
|
16
16
|
import { t as Xt } from "./useAliveFlag-C1pwLtPO.js";
|
|
17
|
-
//#region ../core/src/
|
|
17
|
+
//#region ../core/src/error-reporting.ts
|
|
18
18
|
function Zt(e) {
|
|
19
|
+
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
20
|
+
}
|
|
21
|
+
function Qt(e, t) {
|
|
22
|
+
try {
|
|
23
|
+
t();
|
|
24
|
+
} catch (t) {
|
|
25
|
+
e?.(Zt(t));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region ../core/src/editor.ts
|
|
30
|
+
function $t(e) {
|
|
19
31
|
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
20
32
|
}
|
|
21
|
-
function
|
|
33
|
+
function en(e) {
|
|
22
34
|
let t = m({
|
|
23
35
|
template: null,
|
|
24
36
|
content: e.content ?? fe(e.defaultFontFamily, e.templateDefaults),
|
|
@@ -116,7 +128,7 @@ function Qt(e) {
|
|
|
116
128
|
if (l(n)) return;
|
|
117
129
|
let r = o(t.content.blocks, n);
|
|
118
130
|
if (r && r.type === "section") {
|
|
119
|
-
if (i < 0 || i >=
|
|
131
|
+
if (i < 0 || i >= $t(r.columns)) return;
|
|
120
132
|
r.children[i] = r.children[i] || [];
|
|
121
133
|
let t = r.children[i];
|
|
122
134
|
a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
|
|
@@ -149,7 +161,7 @@ function Qt(e) {
|
|
|
149
161
|
let d;
|
|
150
162
|
if (i) {
|
|
151
163
|
let e = o(t.content.blocks, i);
|
|
152
|
-
if (!e || e.type !== "section" || a < 0 || a >=
|
|
164
|
+
if (!e || e.type !== "section" || a < 0 || a >= $t(e.columns)) return;
|
|
153
165
|
e.children[a] = e.children[a] || [], d = e.children[a];
|
|
154
166
|
} else d = t.content.blocks;
|
|
155
167
|
let [f] = s.blocks.splice(u, 1);
|
|
@@ -162,70 +174,77 @@ function Qt(e) {
|
|
|
162
174
|
throw new W(`[Templatical] Templates: ${e} ${t}`);
|
|
163
175
|
}
|
|
164
176
|
function D(t) {
|
|
177
|
+
Qt(e.onError, t);
|
|
178
|
+
}
|
|
179
|
+
function O(t) {
|
|
165
180
|
let { templates: n } = e;
|
|
166
181
|
return n || E(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
167
182
|
}
|
|
168
|
-
function
|
|
183
|
+
function k(e) {
|
|
169
184
|
t.template && (t.template = {
|
|
170
185
|
...t.template,
|
|
171
186
|
name: e
|
|
172
187
|
}, r());
|
|
173
188
|
}
|
|
174
|
-
async function
|
|
175
|
-
let
|
|
176
|
-
typeof
|
|
189
|
+
async function A(r) {
|
|
190
|
+
let i = O("create()"), { create: a } = i;
|
|
191
|
+
typeof a != "function" && E("create()", "is disabled by the provider — its `create` is `false`.");
|
|
192
|
+
let o;
|
|
193
|
+
t.isLoading = !0;
|
|
177
194
|
try {
|
|
178
195
|
r?.content && (t.content = r.content);
|
|
179
|
-
let e = n
|
|
196
|
+
let e = n;
|
|
197
|
+
o = await a(r?.name === void 0 ? { content: t.content } : {
|
|
180
198
|
name: r.name,
|
|
181
199
|
content: t.content
|
|
182
|
-
});
|
|
183
|
-
return t.template = a, n === e && (t.isDirty = !1), a;
|
|
200
|
+
}), t.template = o, n === e && (t.isDirty = !1);
|
|
184
201
|
} catch (t) {
|
|
185
202
|
throw e.onError?.(t), t;
|
|
186
203
|
} finally {
|
|
187
204
|
t.isLoading = !1;
|
|
188
205
|
}
|
|
206
|
+
return D(() => i.onCreated?.(o)), o;
|
|
189
207
|
}
|
|
190
|
-
async function
|
|
191
|
-
let r =
|
|
208
|
+
async function j(n) {
|
|
209
|
+
let r = O("load()"), i;
|
|
192
210
|
t.isLoading = !0;
|
|
193
211
|
try {
|
|
194
|
-
|
|
195
|
-
return t.template = e, t.content = e.content, t.isDirty = !1, e;
|
|
212
|
+
i = await r.load(n), t.template = i, t.content = i.content, t.isDirty = !1;
|
|
196
213
|
} catch (t) {
|
|
197
214
|
throw e.onError?.(t), t;
|
|
198
215
|
} finally {
|
|
199
216
|
t.isLoading = !1;
|
|
200
217
|
}
|
|
218
|
+
return D(() => r.onLoaded?.(i)), i;
|
|
201
219
|
}
|
|
202
|
-
async function
|
|
203
|
-
let { save:
|
|
204
|
-
typeof
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
let
|
|
208
|
-
name:
|
|
220
|
+
async function M(r = "api") {
|
|
221
|
+
let i = O("save()"), { save: a } = i;
|
|
222
|
+
typeof a != "function" && E("save()", "is disabled by the provider — its `save` is `false`.");
|
|
223
|
+
let o = t.template;
|
|
224
|
+
o || E("save()", "has no template loaded. Call create() or load() first.");
|
|
225
|
+
let s = o.name === void 0 ? { content: t.content } : {
|
|
226
|
+
name: o.name,
|
|
209
227
|
content: t.content
|
|
210
|
-
};
|
|
228
|
+
}, c;
|
|
211
229
|
t.isSaving = !0;
|
|
212
230
|
try {
|
|
213
|
-
let e = n
|
|
214
|
-
if (t.template?.id ===
|
|
231
|
+
let e = n;
|
|
232
|
+
if (c = await a(o.id, s), t.template?.id === o.id) {
|
|
215
233
|
let e = t.template.name;
|
|
216
|
-
t.template = e ===
|
|
217
|
-
...
|
|
234
|
+
t.template = e === o.name ? c : {
|
|
235
|
+
...c,
|
|
218
236
|
name: e
|
|
219
237
|
};
|
|
220
238
|
}
|
|
221
|
-
|
|
239
|
+
n === e && (t.isDirty = !1);
|
|
222
240
|
} catch (t) {
|
|
223
241
|
throw e.onError?.(t), t;
|
|
224
242
|
} finally {
|
|
225
243
|
t.isSaving = !1;
|
|
226
244
|
}
|
|
245
|
+
return D(() => i.onSaved?.(c, { trigger: r })), c;
|
|
227
246
|
}
|
|
228
|
-
function
|
|
247
|
+
function N() {
|
|
229
248
|
return t.template?.id !== void 0;
|
|
230
249
|
}
|
|
231
250
|
return {
|
|
@@ -246,18 +265,18 @@ function Qt(e) {
|
|
|
246
265
|
moveBlock: w,
|
|
247
266
|
markDirty: T,
|
|
248
267
|
findBlockLocation: u,
|
|
249
|
-
setName:
|
|
250
|
-
create:
|
|
251
|
-
load:
|
|
252
|
-
save:
|
|
253
|
-
hasTemplate:
|
|
268
|
+
setName: k,
|
|
269
|
+
create: A,
|
|
270
|
+
load: j,
|
|
271
|
+
save: M,
|
|
272
|
+
hasTemplate: N
|
|
254
273
|
};
|
|
255
274
|
}
|
|
256
275
|
//#endregion
|
|
257
276
|
//#region ../core/src/history.ts
|
|
258
|
-
var
|
|
259
|
-
function
|
|
260
|
-
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i =
|
|
277
|
+
var tn = 50, nn = 300, rn = 1500;
|
|
278
|
+
function an(e) {
|
|
279
|
+
let { content: t, setContent: n, isRemoteOperation: r, maxSize: i = tn } = e, a = l([]), o = l([]), s = l(!1), c = null, u = null, d = p(() => a.value.length > 0), f = p(() => o.value.length > 0);
|
|
261
280
|
function m() {
|
|
262
281
|
return _e(t.value);
|
|
263
282
|
}
|
|
@@ -275,21 +294,21 @@ function nn(e) {
|
|
|
275
294
|
if (u && u.blockId === e) {
|
|
276
295
|
clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
|
|
277
296
|
u = null;
|
|
278
|
-
},
|
|
297
|
+
}, nn);
|
|
279
298
|
return;
|
|
280
299
|
}
|
|
281
300
|
g(), h(m()), o.value = [], u = {
|
|
282
301
|
blockId: e,
|
|
283
302
|
timeoutId: setTimeout(() => {
|
|
284
303
|
u = null;
|
|
285
|
-
},
|
|
304
|
+
}, nn)
|
|
286
305
|
};
|
|
287
306
|
}
|
|
288
307
|
}
|
|
289
308
|
function y() {
|
|
290
309
|
s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
291
310
|
s.value = !1, c = null;
|
|
292
|
-
},
|
|
311
|
+
}, rn);
|
|
293
312
|
}
|
|
294
313
|
function b() {
|
|
295
314
|
if (a.value.length === 0) return;
|
|
@@ -323,7 +342,7 @@ function nn(e) {
|
|
|
323
342
|
}
|
|
324
343
|
//#endregion
|
|
325
344
|
//#region ../core/src/block-actions.ts
|
|
326
|
-
function
|
|
345
|
+
function on(e) {
|
|
327
346
|
e.type === "table" ? e.rows = e.rows.map((e) => ({
|
|
328
347
|
...e,
|
|
329
348
|
id: H(),
|
|
@@ -339,7 +358,7 @@ function rn(e) {
|
|
|
339
358
|
id: H()
|
|
340
359
|
})));
|
|
341
360
|
}
|
|
342
|
-
function
|
|
361
|
+
function sn(e) {
|
|
343
362
|
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
344
363
|
function o(n, r, a) {
|
|
345
364
|
let o = pe(n, e.blockDefaults);
|
|
@@ -347,9 +366,9 @@ function an(e) {
|
|
|
347
366
|
}
|
|
348
367
|
function s(e, n, r) {
|
|
349
368
|
let o = JSON.parse(JSON.stringify(e));
|
|
350
|
-
if (o.id = H(),
|
|
369
|
+
if (o.id = H(), on(o), o.type === "section" && (o.children = o.children.map((e) => e.map((e) => {
|
|
351
370
|
let t = JSON.parse(JSON.stringify(e));
|
|
352
|
-
return t.id = H(),
|
|
371
|
+
return t.id = H(), on(t), t;
|
|
353
372
|
}))), n !== void 0 || r !== void 0) t(o, n, r);
|
|
354
373
|
else {
|
|
355
374
|
let i = a?.(e.id) ?? null;
|
|
@@ -372,9 +391,9 @@ function an(e) {
|
|
|
372
391
|
}
|
|
373
392
|
//#endregion
|
|
374
393
|
//#region ../core/src/auto-save.ts
|
|
375
|
-
var
|
|
376
|
-
function
|
|
377
|
-
let { content: t, isDirty: n, onChange: r, debounce: i =
|
|
394
|
+
var cn = 2e3;
|
|
395
|
+
function ln(e) {
|
|
396
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = cn, enabled: a = !0 } = e, o = null, s = !1;
|
|
378
397
|
function c() {
|
|
379
398
|
return typeof a == "function" ? a() : a;
|
|
380
399
|
}
|
|
@@ -411,7 +430,7 @@ function sn(e) {
|
|
|
411
430
|
}
|
|
412
431
|
//#endregion
|
|
413
432
|
//#region ../core/src/condition-preview.ts
|
|
414
|
-
function
|
|
433
|
+
function un(e) {
|
|
415
434
|
let t = m(/* @__PURE__ */ new Set()), n = p(() => t.size > 0);
|
|
416
435
|
function r(e) {
|
|
417
436
|
return t.has(e);
|
|
@@ -431,7 +450,7 @@ function cn(e) {
|
|
|
431
450
|
}
|
|
432
451
|
//#endregion
|
|
433
452
|
//#region ../core/src/data-source-fetch.ts
|
|
434
|
-
function
|
|
453
|
+
function dn(e) {
|
|
435
454
|
let t = l(!1), n = l(!1), r = p(() => !!e.definition.value?.dataSource), i = p(() => r.value && !e.block.value.dataSourceFetched);
|
|
436
455
|
async function a() {
|
|
437
456
|
let r = e.definition.value;
|
|
@@ -463,7 +482,7 @@ function ln(e) {
|
|
|
463
482
|
}
|
|
464
483
|
//#endregion
|
|
465
484
|
//#region ../core/src/history-interceptor.ts
|
|
466
|
-
function
|
|
485
|
+
function fn(e, t) {
|
|
467
486
|
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
468
487
|
e.addBlock = (r, i, a, o) => {
|
|
469
488
|
i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
|
|
@@ -479,7 +498,7 @@ function un(e, t) {
|
|
|
479
498
|
}
|
|
480
499
|
//#endregion
|
|
481
500
|
//#region ../core/src/saved-blocks.ts
|
|
482
|
-
function
|
|
501
|
+
function pn(e) {
|
|
483
502
|
let { provider: t } = e, n = l([]), r = l(!1), i = S(() => {
|
|
484
503
|
let e = /* @__PURE__ */ new Set();
|
|
485
504
|
for (let t of n.value) {
|
|
@@ -497,7 +516,10 @@ function dn(e) {
|
|
|
497
516
|
function d(e, t) {
|
|
498
517
|
throw new W(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
499
518
|
}
|
|
500
|
-
|
|
519
|
+
function f(t) {
|
|
520
|
+
Qt(e.onError, t);
|
|
521
|
+
}
|
|
522
|
+
async function p(i) {
|
|
501
523
|
r.value = !0;
|
|
502
524
|
try {
|
|
503
525
|
n.value = await t.list(i);
|
|
@@ -507,7 +529,7 @@ function dn(e) {
|
|
|
507
529
|
r.value = !1;
|
|
508
530
|
}
|
|
509
531
|
}
|
|
510
|
-
async function
|
|
532
|
+
async function m(r, i, a) {
|
|
511
533
|
let { create: o } = t;
|
|
512
534
|
typeof o != "function" && d("create", "disabled by the provider");
|
|
513
535
|
try {
|
|
@@ -519,30 +541,30 @@ function dn(e) {
|
|
|
519
541
|
name: r,
|
|
520
542
|
content: i
|
|
521
543
|
});
|
|
522
|
-
return n.value = [e, ...n.value], e;
|
|
544
|
+
return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
|
|
523
545
|
} catch (t) {
|
|
524
546
|
throw e.onError?.(t), t;
|
|
525
547
|
}
|
|
526
548
|
}
|
|
527
|
-
async function
|
|
549
|
+
async function h(r, i) {
|
|
528
550
|
let { update: a } = t;
|
|
529
551
|
typeof a != "function" && d("update", "disabled by the provider");
|
|
530
552
|
let o = n.value.find((e) => e.id === r);
|
|
531
553
|
o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
|
|
532
554
|
try {
|
|
533
555
|
let e = await a(r, i);
|
|
534
|
-
return n.value = n.value.map((t) => t.id === r ? e : t), e;
|
|
556
|
+
return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
|
|
535
557
|
} catch (t) {
|
|
536
558
|
throw e.onError?.(t), t;
|
|
537
559
|
}
|
|
538
560
|
}
|
|
539
|
-
async function
|
|
561
|
+
async function g(r) {
|
|
540
562
|
let { delete: i } = t;
|
|
541
563
|
typeof i != "function" && d("delete", "disabled by the provider");
|
|
542
|
-
let a = n.value.find((e) => e.id === r);
|
|
564
|
+
let a = n.value.find((e) => e.id === r) ?? null;
|
|
543
565
|
a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
|
|
544
566
|
try {
|
|
545
|
-
await i(r), n.value = n.value.filter((e) => e.id !== r);
|
|
567
|
+
await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
|
|
546
568
|
} catch (t) {
|
|
547
569
|
throw e.onError?.(t), t;
|
|
548
570
|
}
|
|
@@ -556,17 +578,17 @@ function dn(e) {
|
|
|
556
578
|
canDelete: s,
|
|
557
579
|
canUpdateBlock: c,
|
|
558
580
|
canDeleteBlock: u,
|
|
559
|
-
load:
|
|
560
|
-
create:
|
|
561
|
-
update:
|
|
562
|
-
remove:
|
|
581
|
+
load: p,
|
|
582
|
+
create: m,
|
|
583
|
+
update: h,
|
|
584
|
+
remove: g
|
|
563
585
|
};
|
|
564
586
|
}
|
|
565
587
|
//#endregion
|
|
566
588
|
//#region ../core/src/saved-blocks-local.ts
|
|
567
|
-
var
|
|
568
|
-
function
|
|
569
|
-
let t = e.key ??
|
|
589
|
+
var mn = "templatical:saved-blocks";
|
|
590
|
+
function hn(e = {}) {
|
|
591
|
+
let t = e.key ?? mn;
|
|
570
592
|
function n() {
|
|
571
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.");
|
|
572
594
|
return localStorage;
|
|
@@ -619,7 +641,7 @@ function pn(e = {}) {
|
|
|
619
641
|
}
|
|
620
642
|
//#endregion
|
|
621
643
|
//#region ../core/src/version-history.ts
|
|
622
|
-
function
|
|
644
|
+
function gn(e) {
|
|
623
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");
|
|
624
646
|
function d(e) {
|
|
625
647
|
let t = n();
|
|
@@ -629,7 +651,10 @@ function mn(e) {
|
|
|
629
651
|
function f(e) {
|
|
630
652
|
throw new W(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
631
653
|
}
|
|
632
|
-
|
|
654
|
+
function p(t) {
|
|
655
|
+
Qt(e.onError, t);
|
|
656
|
+
}
|
|
657
|
+
async function m(n) {
|
|
633
658
|
let o = d("list");
|
|
634
659
|
i.value = !0;
|
|
635
660
|
try {
|
|
@@ -641,11 +666,11 @@ function mn(e) {
|
|
|
641
666
|
i.value = !1;
|
|
642
667
|
}
|
|
643
668
|
}
|
|
644
|
-
function
|
|
669
|
+
function h(e) {
|
|
645
670
|
return e.content ?? s.get(e.id) ?? null;
|
|
646
671
|
}
|
|
647
|
-
async function
|
|
648
|
-
let r =
|
|
672
|
+
async function g(n) {
|
|
673
|
+
let r = h(n);
|
|
649
674
|
if (r) return r;
|
|
650
675
|
let i = d("get");
|
|
651
676
|
try {
|
|
@@ -655,29 +680,30 @@ function mn(e) {
|
|
|
655
680
|
throw e.onError?.(t), t;
|
|
656
681
|
}
|
|
657
682
|
}
|
|
658
|
-
async function
|
|
683
|
+
async function _(n, i) {
|
|
659
684
|
let { create: a } = t;
|
|
660
685
|
typeof a != "function" && f("create");
|
|
661
686
|
let o = d("create");
|
|
662
687
|
try {
|
|
663
688
|
let e = await a(o, n, i);
|
|
664
|
-
return r.value = [e, ...r.value], e;
|
|
689
|
+
return r.value = [e, ...r.value], p(() => t.onCreated?.(e)), e;
|
|
665
690
|
} catch (t) {
|
|
666
691
|
throw e.onError?.(t), t;
|
|
667
692
|
}
|
|
668
693
|
}
|
|
669
|
-
async function
|
|
694
|
+
async function v(n) {
|
|
670
695
|
let { restore: r } = t;
|
|
671
696
|
typeof r != "function" && f("restore");
|
|
672
|
-
let i = d("restore");
|
|
697
|
+
let i = d("restore"), a;
|
|
673
698
|
o.value = !0;
|
|
674
699
|
try {
|
|
675
|
-
|
|
700
|
+
a = await r(i, n);
|
|
676
701
|
} catch (t) {
|
|
677
702
|
throw e.onError?.(t), t;
|
|
678
703
|
} finally {
|
|
679
704
|
o.value = !1;
|
|
680
705
|
}
|
|
706
|
+
return p(() => t.onRestored?.(a)), a;
|
|
681
707
|
}
|
|
682
708
|
return {
|
|
683
709
|
nextCursor: a,
|
|
@@ -686,16 +712,16 @@ function mn(e) {
|
|
|
686
712
|
isRestoring: o,
|
|
687
713
|
canCreate: c,
|
|
688
714
|
canRestore: u,
|
|
689
|
-
load:
|
|
690
|
-
peekContent:
|
|
691
|
-
resolveContent:
|
|
692
|
-
create:
|
|
693
|
-
restore:
|
|
715
|
+
load: m,
|
|
716
|
+
peekContent: h,
|
|
717
|
+
resolveContent: g,
|
|
718
|
+
create: _,
|
|
719
|
+
restore: v
|
|
694
720
|
};
|
|
695
721
|
}
|
|
696
722
|
//#endregion
|
|
697
723
|
//#region ../core/src/comments.ts
|
|
698
|
-
function
|
|
724
|
+
function _n(e) {
|
|
699
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(() => {
|
|
700
726
|
let e = /* @__PURE__ */ new Map();
|
|
701
727
|
for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
@@ -725,15 +751,12 @@ function hn(e) {
|
|
|
725
751
|
let t = r();
|
|
726
752
|
return t !== null && e.author.id === t.id;
|
|
727
753
|
}
|
|
728
|
-
function b(t
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
comment: n
|
|
732
|
-
});
|
|
754
|
+
function b(t) {
|
|
755
|
+
let n = Zt(t);
|
|
756
|
+
throw e.onError?.(n), n;
|
|
733
757
|
}
|
|
734
758
|
function x(t) {
|
|
735
|
-
|
|
736
|
-
throw e.onError?.(n), n;
|
|
759
|
+
Qt(e.onError, t);
|
|
737
760
|
}
|
|
738
761
|
function C(e, t, n) {
|
|
739
762
|
return [
|
|
@@ -742,75 +765,76 @@ function hn(e) {
|
|
|
742
765
|
...e.slice(t + 1)
|
|
743
766
|
];
|
|
744
767
|
}
|
|
745
|
-
function w(e) {
|
|
768
|
+
function w(e, t) {
|
|
769
|
+
return e !== void 0 && JSON.stringify(e) === JSON.stringify(t);
|
|
770
|
+
}
|
|
771
|
+
function T(e) {
|
|
746
772
|
if (e.parentId) {
|
|
747
|
-
|
|
748
|
-
if (
|
|
749
|
-
let
|
|
750
|
-
return {
|
|
751
|
-
...
|
|
752
|
-
replies:
|
|
753
|
-
};
|
|
773
|
+
let t = !1, n = i.value.map((n) => {
|
|
774
|
+
if (n.id !== e.parentId) return n;
|
|
775
|
+
let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
|
|
776
|
+
return i !== -1 && w(r[i], e) ? n : (t = !0, {
|
|
777
|
+
...n,
|
|
778
|
+
replies: i === -1 ? [...r, e] : C(r, i, e)
|
|
779
|
+
});
|
|
754
780
|
});
|
|
755
|
-
return;
|
|
781
|
+
return t && (i.value = n), t;
|
|
756
782
|
}
|
|
757
783
|
let t = i.value.findIndex((t) => t.id === e.id);
|
|
758
|
-
if (t === -1)
|
|
759
|
-
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
i.value = C(i.value, t, {
|
|
784
|
+
if (t === -1) return i.value = [...i.value, e], !0;
|
|
785
|
+
let n = {
|
|
763
786
|
...e,
|
|
764
787
|
replies: e.replies ?? i.value[t].replies
|
|
765
|
-
}
|
|
788
|
+
};
|
|
789
|
+
return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
|
|
766
790
|
}
|
|
767
|
-
function
|
|
791
|
+
function E(e, t) {
|
|
768
792
|
let n = v(e), r = t ?? n?.parentId ?? null;
|
|
769
793
|
return r ? i.value = i.value.map((t) => t.id === r ? {
|
|
770
794
|
...t,
|
|
771
795
|
replies: (t.replies ?? []).filter((t) => t.id !== e)
|
|
772
796
|
} : t) : i.value = i.value.filter((t) => t.id !== e), n;
|
|
773
797
|
}
|
|
774
|
-
async function
|
|
798
|
+
async function D(e) {
|
|
775
799
|
let n = h("list");
|
|
776
800
|
a.value = !0;
|
|
777
801
|
try {
|
|
778
802
|
i.value = await t.list(n, e);
|
|
779
803
|
} catch (e) {
|
|
780
|
-
|
|
804
|
+
b(e);
|
|
781
805
|
} finally {
|
|
782
806
|
a.value = !1;
|
|
783
807
|
}
|
|
784
808
|
}
|
|
785
|
-
async function
|
|
809
|
+
async function O(e) {
|
|
786
810
|
let { create: n } = t;
|
|
787
811
|
typeof n != "function" && _("create");
|
|
788
812
|
let r = h("create");
|
|
789
813
|
g("create"), o.value = !0;
|
|
790
814
|
try {
|
|
791
|
-
let
|
|
792
|
-
return
|
|
815
|
+
let i = await n(r, e);
|
|
816
|
+
return T(i), x(() => t.onCreated?.(i, { origin: "local" })), i;
|
|
793
817
|
} catch (e) {
|
|
794
|
-
|
|
818
|
+
b(e);
|
|
795
819
|
} finally {
|
|
796
820
|
o.value = !1;
|
|
797
821
|
}
|
|
798
822
|
}
|
|
799
|
-
async function
|
|
823
|
+
async function k(e, n) {
|
|
800
824
|
let { update: r } = t;
|
|
801
825
|
typeof r != "function" && _("update");
|
|
802
826
|
let i = h("update");
|
|
803
827
|
g("update"), o.value = !0;
|
|
804
828
|
try {
|
|
805
|
-
let
|
|
806
|
-
return
|
|
829
|
+
let a = await r(i, e, n);
|
|
830
|
+
return T(a), x(() => t.onUpdated?.(a, { origin: "local" })), a;
|
|
807
831
|
} catch (e) {
|
|
808
|
-
|
|
832
|
+
b(e);
|
|
809
833
|
} finally {
|
|
810
834
|
o.value = !1;
|
|
811
835
|
}
|
|
812
836
|
}
|
|
813
|
-
async function
|
|
837
|
+
async function A(e) {
|
|
814
838
|
let { delete: n } = t;
|
|
815
839
|
typeof n != "function" && _("delete");
|
|
816
840
|
let r = h("delete");
|
|
@@ -818,36 +842,36 @@ function hn(e) {
|
|
|
818
842
|
let i = v(e);
|
|
819
843
|
o.value = !0;
|
|
820
844
|
try {
|
|
821
|
-
await n(r, e),
|
|
845
|
+
await n(r, e), E(e), i && x(() => t.onDeleted?.(i, { origin: "local" }));
|
|
822
846
|
} catch (e) {
|
|
823
|
-
|
|
847
|
+
b(e);
|
|
824
848
|
} finally {
|
|
825
849
|
o.value = !1;
|
|
826
850
|
}
|
|
827
851
|
}
|
|
828
|
-
async function
|
|
852
|
+
async function j(e, n) {
|
|
829
853
|
let { setResolved: r } = t;
|
|
830
854
|
typeof r != "function" && _("setResolved");
|
|
831
855
|
let i = h("setResolved");
|
|
832
856
|
g("setResolved"), o.value = !0;
|
|
833
857
|
try {
|
|
834
|
-
let
|
|
835
|
-
return
|
|
858
|
+
let a = await r(i, e, n);
|
|
859
|
+
return T(a), x(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
|
|
836
860
|
} catch (e) {
|
|
837
|
-
|
|
861
|
+
b(e);
|
|
838
862
|
} finally {
|
|
839
863
|
o.value = !1;
|
|
840
864
|
}
|
|
841
865
|
}
|
|
842
|
-
function j(e) {
|
|
843
|
-
w(e), b("created", e);
|
|
844
|
-
}
|
|
845
866
|
function M(e) {
|
|
846
|
-
|
|
867
|
+
T(e) && x(() => t.onCreated?.(e, { origin: "remote" }));
|
|
868
|
+
}
|
|
869
|
+
function N(e) {
|
|
870
|
+
T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
847
871
|
}
|
|
848
|
-
function
|
|
849
|
-
let
|
|
850
|
-
|
|
872
|
+
function P(e, n) {
|
|
873
|
+
let r = E(e, n);
|
|
874
|
+
r && x(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
851
875
|
}
|
|
852
876
|
return {
|
|
853
877
|
comments: i,
|
|
@@ -860,19 +884,19 @@ function hn(e) {
|
|
|
860
884
|
totalCount: f,
|
|
861
885
|
unresolvedCount: p,
|
|
862
886
|
commentCountByBlock: m,
|
|
863
|
-
load:
|
|
864
|
-
create:
|
|
865
|
-
update:
|
|
866
|
-
remove:
|
|
867
|
-
setResolved:
|
|
887
|
+
load: D,
|
|
888
|
+
create: O,
|
|
889
|
+
update: k,
|
|
890
|
+
remove: A,
|
|
891
|
+
setResolved: j,
|
|
868
892
|
find: v,
|
|
869
893
|
isOwn: y,
|
|
870
|
-
applyRemoteCreate:
|
|
871
|
-
applyRemoteUpdate:
|
|
872
|
-
applyRemoteDelete:
|
|
894
|
+
applyRemoteCreate: M,
|
|
895
|
+
applyRemoteUpdate: N,
|
|
896
|
+
applyRemoteDelete: P
|
|
873
897
|
};
|
|
874
898
|
}
|
|
875
|
-
function
|
|
899
|
+
function vn(e) {
|
|
876
900
|
let { comments: n, provider: r, getTemplateId: i } = e, { subscribe: a } = r;
|
|
877
901
|
if (typeof a != "function") return;
|
|
878
902
|
let o = null;
|
|
@@ -895,18 +919,18 @@ function gn(e) {
|
|
|
895
919
|
}
|
|
896
920
|
//#endregion
|
|
897
921
|
//#region src/utils/activeEditorTracker.ts
|
|
898
|
-
var
|
|
899
|
-
function
|
|
900
|
-
let e = ++
|
|
901
|
-
return
|
|
922
|
+
var yn = /* @__PURE__ */ new Set(), $ = 0, bn = 0;
|
|
923
|
+
function xn() {
|
|
924
|
+
let e = ++bn;
|
|
925
|
+
return yn.add(e), $ === 0 && ($ = e), {
|
|
902
926
|
id: e,
|
|
903
|
-
isActive: () =>
|
|
927
|
+
isActive: () => yn.size <= 1 || $ === e,
|
|
904
928
|
claim: () => {
|
|
905
929
|
$ = e;
|
|
906
930
|
},
|
|
907
931
|
dispose: () => {
|
|
908
|
-
if (
|
|
909
|
-
let e = Array.from(
|
|
932
|
+
if (yn.delete(e), $ === e) {
|
|
933
|
+
let e = Array.from(yn);
|
|
910
934
|
$ = e[e.length - 1] ?? 0;
|
|
911
935
|
}
|
|
912
936
|
}
|
|
@@ -914,8 +938,8 @@ function yn() {
|
|
|
914
938
|
}
|
|
915
939
|
//#endregion
|
|
916
940
|
//#region src/composables/usePreviewResolution.ts
|
|
917
|
-
var
|
|
918
|
-
function
|
|
941
|
+
var Sn = 500;
|
|
942
|
+
function Cn(e) {
|
|
919
943
|
let n = typeof e.resolvePreview == "function", r = l(null), i = l(!1), a = l(!1), o = 0, s = null;
|
|
920
944
|
function c() {
|
|
921
945
|
s !== null && (clearTimeout(s), s = null);
|
|
@@ -952,7 +976,7 @@ function xn(e) {
|
|
|
952
976
|
}
|
|
953
977
|
s = setTimeout(() => {
|
|
954
978
|
s = null, u();
|
|
955
|
-
},
|
|
979
|
+
}, Sn);
|
|
956
980
|
}
|
|
957
981
|
}
|
|
958
982
|
return t(() => [e.isActive(), e.getRecipient?.()], ([e]) => {
|
|
@@ -974,7 +998,7 @@ function xn(e) {
|
|
|
974
998
|
}
|
|
975
999
|
//#endregion
|
|
976
1000
|
//#region src/composables/useImageUrlResolver.ts
|
|
977
|
-
function
|
|
1001
|
+
function wn(e) {
|
|
978
1002
|
let t = m(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
979
1003
|
function r(e) {
|
|
980
1004
|
return t.get(e);
|
|
@@ -1007,7 +1031,7 @@ function Sn(e) {
|
|
|
1007
1031
|
lookup: a
|
|
1008
1032
|
};
|
|
1009
1033
|
}
|
|
1010
|
-
function
|
|
1034
|
+
function Tn(e) {
|
|
1011
1035
|
let r = n(ot, null), i = S(e);
|
|
1012
1036
|
if (!r) return i;
|
|
1013
1037
|
let a;
|
|
@@ -1037,7 +1061,7 @@ function Cn(e) {
|
|
|
1037
1061
|
}
|
|
1038
1062
|
//#endregion
|
|
1039
1063
|
//#region src/composables/useMergeTagPicker.ts
|
|
1040
|
-
function
|
|
1064
|
+
function En() {
|
|
1041
1065
|
let e = l(!1), t = l([]), n = null;
|
|
1042
1066
|
function r(r) {
|
|
1043
1067
|
if (n) {
|
|
@@ -1067,7 +1091,7 @@ function wn() {
|
|
|
1067
1091
|
}
|
|
1068
1092
|
//#endregion
|
|
1069
1093
|
//#region src/composables/useLogicTagPicker.ts
|
|
1070
|
-
function
|
|
1094
|
+
function Dn() {
|
|
1071
1095
|
let e = l(!1), t = l([]), n = l([]), r = null;
|
|
1072
1096
|
function i(i, a) {
|
|
1073
1097
|
if (r) {
|
|
@@ -1098,11 +1122,11 @@ function Tn() {
|
|
|
1098
1122
|
}
|
|
1099
1123
|
//#endregion
|
|
1100
1124
|
//#region src/composables/useTemplateLint.ts
|
|
1101
|
-
function
|
|
1125
|
+
function On(e) {
|
|
1102
1126
|
return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 : !1;
|
|
1103
1127
|
}
|
|
1104
|
-
function
|
|
1105
|
-
let n = l([]), r = l(!1), i = l(!1), a = x(null), o =
|
|
1128
|
+
function kn(e) {
|
|
1129
|
+
let n = l([]), r = l(!1), i = l(!1), a = x(null), o = On(e.options), s = null, c = !1;
|
|
1106
1130
|
o || u();
|
|
1107
1131
|
async function u() {
|
|
1108
1132
|
try {
|
|
@@ -1143,17 +1167,17 @@ function Dn(e) {
|
|
|
1143
1167
|
}
|
|
1144
1168
|
//#endregion
|
|
1145
1169
|
//#region src/utils/blockTypeLabels.ts
|
|
1146
|
-
function
|
|
1170
|
+
function An(e, t) {
|
|
1147
1171
|
return t.blocks[e] ?? e;
|
|
1148
1172
|
}
|
|
1149
|
-
function
|
|
1150
|
-
if (e.type !== "custom") return
|
|
1173
|
+
function jn(e, t, n = []) {
|
|
1174
|
+
if (e.type !== "custom") return An(e.type, t);
|
|
1151
1175
|
let { customType: r } = e;
|
|
1152
1176
|
return n.find((e) => e.type === r)?.name ?? r;
|
|
1153
1177
|
}
|
|
1154
1178
|
//#endregion
|
|
1155
1179
|
//#region src/composables/useKeyboardReorder.ts
|
|
1156
|
-
function
|
|
1180
|
+
function Mn(e, t, n = []) {
|
|
1157
1181
|
let r = l(null), i = l(""), a = null;
|
|
1158
1182
|
function o(t) {
|
|
1159
1183
|
let n = e.content.value.blocks, r = n.findIndex((e) => e.id === t);
|
|
@@ -1180,7 +1204,7 @@ function An(e, t, n = []) {
|
|
|
1180
1204
|
let i = o(r);
|
|
1181
1205
|
if (!i) return "";
|
|
1182
1206
|
let a = (i.sectionId ? c(i.sectionId, i.columnIndex ?? 0) : e.content.value.blocks)?.[i.index];
|
|
1183
|
-
return a ?
|
|
1207
|
+
return a ? jn(a, t.t, n) : "";
|
|
1184
1208
|
}
|
|
1185
1209
|
function c(t, n) {
|
|
1186
1210
|
return e.content.value.blocks.find((e) => e.id === t && e.type === "section")?.children[n] ?? null;
|
|
@@ -1249,13 +1273,13 @@ function An(e, t, n = []) {
|
|
|
1249
1273
|
}
|
|
1250
1274
|
//#endregion
|
|
1251
1275
|
//#region src/composables/useUiTheme.ts
|
|
1252
|
-
function
|
|
1276
|
+
function Nn(e) {
|
|
1253
1277
|
let t = Be("(prefers-color-scheme: dark)");
|
|
1254
1278
|
return { resolvedTheme: S(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
|
|
1255
1279
|
}
|
|
1256
1280
|
//#endregion
|
|
1257
1281
|
//#region src/composables/useThemeStyles.ts
|
|
1258
|
-
var
|
|
1282
|
+
var Pn = {
|
|
1259
1283
|
bg: "--tpl-bg",
|
|
1260
1284
|
bgElevated: "--tpl-bg-elevated",
|
|
1261
1285
|
bgHover: "--tpl-bg-hover",
|
|
@@ -1279,10 +1303,10 @@ var Mn = {
|
|
|
1279
1303
|
dangerLight: "--tpl-danger-light",
|
|
1280
1304
|
canvasBg: "--tpl-canvas-bg"
|
|
1281
1305
|
};
|
|
1282
|
-
function
|
|
1306
|
+
function Fn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
1283
1307
|
return { themeStyles: S(() => {
|
|
1284
1308
|
let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
|
|
1285
|
-
if (a) for (let [e, t] of Object.entries(
|
|
1309
|
+
if (a) for (let [e, t] of Object.entries(Pn)) {
|
|
1286
1310
|
let n = a[e];
|
|
1287
1311
|
n && (r[t] = n);
|
|
1288
1312
|
}
|
|
@@ -1291,7 +1315,7 @@ function Nn({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
|
|
|
1291
1315
|
}
|
|
1292
1316
|
//#endregion
|
|
1293
1317
|
//#region src/composables/useBlockRegistry.ts
|
|
1294
|
-
function
|
|
1318
|
+
function In() {
|
|
1295
1319
|
let e = x(/* @__PURE__ */ new Map());
|
|
1296
1320
|
function t(t, n) {
|
|
1297
1321
|
e.value.set(t, n), T(e);
|
|
@@ -1349,9 +1373,9 @@ function Pn() {
|
|
|
1349
1373
|
}
|
|
1350
1374
|
//#endregion
|
|
1351
1375
|
//#region src/composables/useCustomBlockStylesheets.ts
|
|
1352
|
-
function
|
|
1376
|
+
function Ln(e, t) {
|
|
1353
1377
|
return S(() => {
|
|
1354
|
-
let n =
|
|
1378
|
+
let n = Rn(e.value.blocks);
|
|
1355
1379
|
if (n.size === 0) return [];
|
|
1356
1380
|
let r = /* @__PURE__ */ new Set(), i = [];
|
|
1357
1381
|
for (let e of n) {
|
|
@@ -1363,11 +1387,11 @@ function Fn(e, t) {
|
|
|
1363
1387
|
return i;
|
|
1364
1388
|
});
|
|
1365
1389
|
}
|
|
1366
|
-
function
|
|
1390
|
+
function Rn(e) {
|
|
1367
1391
|
let t = /* @__PURE__ */ new Set();
|
|
1368
|
-
return
|
|
1392
|
+
return zn(e, t), t;
|
|
1369
1393
|
}
|
|
1370
|
-
function
|
|
1394
|
+
function zn(e, t) {
|
|
1371
1395
|
for (let n of e) {
|
|
1372
1396
|
if (oe(n)) {
|
|
1373
1397
|
t.add(n.customType);
|
|
@@ -1376,13 +1400,13 @@ function Ln(e, t) {
|
|
|
1376
1400
|
if (n.type === "section") {
|
|
1377
1401
|
let e = n.children;
|
|
1378
1402
|
if (!e) continue;
|
|
1379
|
-
for (let n of e)
|
|
1403
|
+
for (let n of e) zn(n, t);
|
|
1380
1404
|
}
|
|
1381
1405
|
}
|
|
1382
1406
|
}
|
|
1383
1407
|
//#endregion
|
|
1384
1408
|
//#region src/utils/registerBuiltInBlocks.ts
|
|
1385
|
-
var
|
|
1409
|
+
var Bn = [
|
|
1386
1410
|
{
|
|
1387
1411
|
type: "section",
|
|
1388
1412
|
createBlock: Ce
|
|
@@ -1436,8 +1460,8 @@ var Rn = [
|
|
|
1436
1460
|
createBlock: Pe
|
|
1437
1461
|
}
|
|
1438
1462
|
];
|
|
1439
|
-
function
|
|
1440
|
-
for (let n of
|
|
1463
|
+
function Vn(e, t) {
|
|
1464
|
+
for (let n of Bn) {
|
|
1441
1465
|
let r = t[n.type];
|
|
1442
1466
|
r && e.registerBuiltIn(n.type, {
|
|
1443
1467
|
component: r,
|
|
@@ -1447,23 +1471,23 @@ function zn(e, t) {
|
|
|
1447
1471
|
}
|
|
1448
1472
|
//#endregion
|
|
1449
1473
|
//#region src/utils/resolveHtmlBlockPreview.ts
|
|
1450
|
-
function
|
|
1474
|
+
function Hn(e) {
|
|
1451
1475
|
return typeof e == "boolean" ? e : e?.enabled ?? !1;
|
|
1452
1476
|
}
|
|
1453
1477
|
//#endregion
|
|
1454
1478
|
//#region src/utils/collectOffPaletteDefaults.ts
|
|
1455
|
-
function
|
|
1479
|
+
function Un(e) {
|
|
1456
1480
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1457
1481
|
}
|
|
1458
|
-
function
|
|
1482
|
+
function Wn(e, t, n) {
|
|
1459
1483
|
let r = new Set(e.map((e) => Z(e))), i = [], a = (e, t) => {
|
|
1460
|
-
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}`) :
|
|
1484
|
+
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}`) : Un(o) && a(o, `${t}.${n}`);
|
|
1461
1485
|
}, o = t;
|
|
1462
1486
|
for (let [e, t] of Object.entries(Fe)) {
|
|
1463
1487
|
let n = o?.[e];
|
|
1464
1488
|
a({
|
|
1465
1489
|
...t,
|
|
1466
|
-
...
|
|
1490
|
+
...Un(n) ? n : {}
|
|
1467
1491
|
}, e);
|
|
1468
1492
|
}
|
|
1469
1493
|
return a({
|
|
@@ -1473,7 +1497,7 @@ function Hn(e, t, n) {
|
|
|
1473
1497
|
}
|
|
1474
1498
|
//#endregion
|
|
1475
1499
|
//#region src/utils/resolveFieldColors.ts
|
|
1476
|
-
function
|
|
1500
|
+
function Gn(e, t) {
|
|
1477
1501
|
let n = Dt({ presets: e.presets }, Tt), r = n.presets.length === 0;
|
|
1478
1502
|
return {
|
|
1479
1503
|
presets: r ? t.presets : n.presets,
|
|
@@ -1486,9 +1510,9 @@ function Un(e, t) {
|
|
|
1486
1510
|
}
|
|
1487
1511
|
//#endregion
|
|
1488
1512
|
//#region src/utils/collectColorFieldIssues.ts
|
|
1489
|
-
function
|
|
1513
|
+
function Kn(e, t) {
|
|
1490
1514
|
let n = [], r = (r, i) => {
|
|
1491
|
-
let a =
|
|
1515
|
+
let a = Gn(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
|
|
1492
1516
|
if (a.invalidPresets.length > 0 && n.push({
|
|
1493
1517
|
id: s("invalid-presets"),
|
|
1494
1518
|
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." : "")
|
|
@@ -1512,7 +1536,7 @@ function Wn(e, t) {
|
|
|
1512
1536
|
}
|
|
1513
1537
|
//#endregion
|
|
1514
1538
|
//#region src/utils/keyboardShortcuts.ts
|
|
1515
|
-
function
|
|
1539
|
+
function qn(e) {
|
|
1516
1540
|
for (let t of e.composedPath()) {
|
|
1517
1541
|
if (!(t instanceof HTMLElement)) continue;
|
|
1518
1542
|
if (t.isContentEditable) return !0;
|
|
@@ -1521,18 +1545,18 @@ function Gn(e) {
|
|
|
1521
1545
|
}
|
|
1522
1546
|
return !1;
|
|
1523
1547
|
}
|
|
1524
|
-
function
|
|
1548
|
+
function Jn(e, t) {
|
|
1525
1549
|
let n = e.metaKey || e.ctrlKey;
|
|
1526
1550
|
if (n && e.key.toLowerCase() === "s") {
|
|
1527
1551
|
e.preventDefault(), t.onSave?.();
|
|
1528
1552
|
return;
|
|
1529
1553
|
}
|
|
1530
1554
|
if (n && e.key.toLowerCase() === "z") {
|
|
1531
|
-
if (
|
|
1555
|
+
if (qn(e)) return;
|
|
1532
1556
|
e.preventDefault(), e.shiftKey ? t.history.redo() : (t.onBeforeUndo?.(), t.history.undo());
|
|
1533
1557
|
return;
|
|
1534
1558
|
}
|
|
1535
|
-
if (t.isPicking?.() && !
|
|
1559
|
+
if (t.isPicking?.() && !qn(e)) {
|
|
1536
1560
|
if (e.key === "Escape") {
|
|
1537
1561
|
e.preventDefault(), t.onCancelPick?.();
|
|
1538
1562
|
return;
|
|
@@ -1550,11 +1574,11 @@ function Kn(e, t) {
|
|
|
1550
1574
|
t.selectBlock(null);
|
|
1551
1575
|
return;
|
|
1552
1576
|
}
|
|
1553
|
-
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !
|
|
1577
|
+
(e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !qn(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
|
|
1554
1578
|
}
|
|
1555
1579
|
//#endregion
|
|
1556
1580
|
//#region src/utils/mergeTagLabelSegments.ts
|
|
1557
|
-
function
|
|
1581
|
+
function Yn(e, t, n, r = !1) {
|
|
1558
1582
|
if (!e) return [];
|
|
1559
1583
|
let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
|
|
1560
1584
|
for (; (s = i.exec(e)) !== null;) {
|
|
@@ -1588,20 +1612,20 @@ function qn(e, t, n, r = !1) {
|
|
|
1588
1612
|
}
|
|
1589
1613
|
//#endregion
|
|
1590
1614
|
//#region src/components/MergeTagPreviewText.vue
|
|
1591
|
-
var
|
|
1615
|
+
var Xn = d({
|
|
1592
1616
|
name: "MergeTagPreviewText",
|
|
1593
1617
|
props: { text: {
|
|
1594
1618
|
type: String,
|
|
1595
1619
|
required: !0
|
|
1596
1620
|
} },
|
|
1597
1621
|
setup(e) {
|
|
1598
|
-
let t = n(K, []), r = n(ft, Ae.liquid), i = n(q, null), a = S(() =>
|
|
1622
|
+
let t = n(K, []), r = n(ft, Ae.liquid), i = n(q, null), a = S(() => Yn(e.text, t, r, i?.value ?? !1));
|
|
1599
1623
|
return () => a.value.map((e, t) => e.type === "tag" ? z("span", {
|
|
1600
1624
|
key: t,
|
|
1601
1625
|
class: "tpl-merge-tag-label"
|
|
1602
1626
|
}, e.value) : e.value);
|
|
1603
1627
|
}
|
|
1604
|
-
}),
|
|
1628
|
+
}), Zn = ["href"], Qn = /* @__PURE__ */ d({
|
|
1605
1629
|
__name: "ButtonBlock",
|
|
1606
1630
|
props: {
|
|
1607
1631
|
block: {},
|
|
@@ -1627,13 +1651,13 @@ var Jn = d({
|
|
|
1627
1651
|
style: k(n.value),
|
|
1628
1652
|
class: "tpl:cursor-default",
|
|
1629
1653
|
onClick: i[0] ||= O(() => {}, ["prevent"])
|
|
1630
|
-
}, [v(
|
|
1654
|
+
}, [v(Xn, { text: e.block.text }, null, 8, ["text"])], 12, Zn)], 4));
|
|
1631
1655
|
}
|
|
1632
|
-
}),
|
|
1656
|
+
}), $n = ["innerHTML"], er = [
|
|
1633
1657
|
"src",
|
|
1634
1658
|
"width",
|
|
1635
1659
|
"height"
|
|
1636
|
-
],
|
|
1660
|
+
], tr = /* @__PURE__ */ d({
|
|
1637
1661
|
__name: "CustomBlockIcon",
|
|
1638
1662
|
props: {
|
|
1639
1663
|
icon: {},
|
|
@@ -1649,24 +1673,24 @@ var Jn = d({
|
|
|
1649
1673
|
height: `${n.value}px`
|
|
1650
1674
|
}),
|
|
1651
1675
|
innerHTML: e.icon
|
|
1652
|
-
}, null, 12,
|
|
1676
|
+
}, null, 12, $n)) : i.value ? (s(), C("img", {
|
|
1653
1677
|
key: 1,
|
|
1654
1678
|
src: e.icon,
|
|
1655
1679
|
width: n.value,
|
|
1656
1680
|
height: n.value,
|
|
1657
1681
|
class: "tpl:inline-block",
|
|
1658
1682
|
alt: ""
|
|
1659
|
-
}, null, 8,
|
|
1683
|
+
}, null, 8, er)) : (s(), A(_(Kt), {
|
|
1660
1684
|
key: 2,
|
|
1661
1685
|
size: n.value,
|
|
1662
1686
|
"stroke-width": 1.5
|
|
1663
1687
|
}, null, 8, ["size"]));
|
|
1664
1688
|
}
|
|
1665
|
-
}),
|
|
1666
|
-
function
|
|
1689
|
+
}), nr = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
|
|
1690
|
+
function rr(e, n) {
|
|
1667
1691
|
let r = Yt(), i = null, a = null, o = null;
|
|
1668
1692
|
function s() {
|
|
1669
|
-
return e.value ? Array.from(e.value.querySelectorAll(
|
|
1693
|
+
return e.value ? Array.from(e.value.querySelectorAll(nr)).filter((e) => e.offsetParent !== null) : [];
|
|
1670
1694
|
}
|
|
1671
1695
|
function c(e) {
|
|
1672
1696
|
if (e.key !== "Tab") return;
|
|
@@ -1696,7 +1720,7 @@ function tr(e, n) {
|
|
|
1696
1720
|
}
|
|
1697
1721
|
//#endregion
|
|
1698
1722
|
//#region src/composables/useEmoji.ts
|
|
1699
|
-
function
|
|
1723
|
+
function ir() {
|
|
1700
1724
|
let [e, n] = Re(!1), r = x([]), i = !1;
|
|
1701
1725
|
h(() => {
|
|
1702
1726
|
i = !0;
|
|
@@ -1722,7 +1746,7 @@ function nr() {
|
|
|
1722
1746
|
}
|
|
1723
1747
|
//#endregion
|
|
1724
1748
|
//#region src/composables/useFonts.ts
|
|
1725
|
-
var
|
|
1749
|
+
var ar = [
|
|
1726
1750
|
{
|
|
1727
1751
|
value: "Arial",
|
|
1728
1752
|
label: "Arial"
|
|
@@ -1751,7 +1775,7 @@ var rr = [
|
|
|
1751
1775
|
value: "Courier New",
|
|
1752
1776
|
label: "Courier New"
|
|
1753
1777
|
}
|
|
1754
|
-
],
|
|
1778
|
+
], or = {
|
|
1755
1779
|
arial: "Arial, sans-serif",
|
|
1756
1780
|
helvetica: "Helvetica, sans-serif",
|
|
1757
1781
|
georgia: "Georgia, serif",
|
|
@@ -1759,23 +1783,23 @@ var rr = [
|
|
|
1759
1783
|
verdana: "Verdana, sans-serif",
|
|
1760
1784
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
1761
1785
|
"courier new": "'Courier New', monospace"
|
|
1762
|
-
},
|
|
1763
|
-
function
|
|
1764
|
-
if (e === void 0 || e === !0) return [...
|
|
1786
|
+
}, sr = "Arial, sans-serif";
|
|
1787
|
+
function cr(e) {
|
|
1788
|
+
if (e === void 0 || e === !0) return [...ar];
|
|
1765
1789
|
if (e === !1) return [];
|
|
1766
1790
|
let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
|
|
1767
1791
|
for (let i of e) {
|
|
1768
|
-
let e = i.toLowerCase(), a =
|
|
1792
|
+
let e = i.toLowerCase(), a = ar.find((t) => t.value.toLowerCase() === e);
|
|
1769
1793
|
if (!a) {
|
|
1770
|
-
r.has(e) || (r.add(e), X.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${
|
|
1794
|
+
r.has(e) || (r.add(e), X.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${ar.map((e) => e.value).join(", ")}.`));
|
|
1771
1795
|
continue;
|
|
1772
1796
|
}
|
|
1773
1797
|
n.has(a.value) || (n.add(a.value), t.push(a));
|
|
1774
1798
|
}
|
|
1775
1799
|
return t;
|
|
1776
1800
|
}
|
|
1777
|
-
function
|
|
1778
|
-
let t = l(e?.customFonts ?? []), n = l(!1), r =
|
|
1801
|
+
function lr(e) {
|
|
1802
|
+
let t = l(e?.customFonts ?? []), n = l(!1), r = cr(e?.builtIns), i = S(() => e?.defaultFallback ?? sr), a = S(() => {
|
|
1779
1803
|
let e = [...r], n = t.value.map((e) => ({
|
|
1780
1804
|
value: e.name,
|
|
1781
1805
|
label: e.name,
|
|
@@ -1786,20 +1810,20 @@ function sr(e) {
|
|
|
1786
1810
|
function s(e) {
|
|
1787
1811
|
return a.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
|
|
1788
1812
|
}
|
|
1789
|
-
let c = e?.defaultFont ??
|
|
1813
|
+
let c = e?.defaultFont ?? sr.split(",")[0].trim();
|
|
1790
1814
|
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.`);
|
|
1791
1815
|
function u() {
|
|
1792
1816
|
if (e?.defaultFont && s(e.defaultFont)) {
|
|
1793
1817
|
let t = a.value.find((t) => t.label.toLowerCase() === e.defaultFont.toLowerCase() || t.value.toLowerCase().startsWith(e.defaultFont.toLowerCase()));
|
|
1794
1818
|
if (t) return t.value;
|
|
1795
1819
|
}
|
|
1796
|
-
return
|
|
1820
|
+
return sr;
|
|
1797
1821
|
}
|
|
1798
1822
|
let d = S(() => u());
|
|
1799
1823
|
function f(e) {
|
|
1800
1824
|
if (!e) return i.value;
|
|
1801
1825
|
let n = t.value.find((t) => t.name.toLowerCase() === e.toLowerCase());
|
|
1802
|
-
return n ? `'${n.name}', ${n.fallback ?? i.value}` :
|
|
1826
|
+
return n ? `'${n.name}', ${n.fallback ?? i.value}` : or[e.toLowerCase()] || (e.includes(",") ? e : `${e}, ${i.value}`);
|
|
1803
1827
|
}
|
|
1804
1828
|
let p = [], m = !1;
|
|
1805
1829
|
async function g() {
|
|
@@ -1840,7 +1864,7 @@ function sr(e) {
|
|
|
1840
1864
|
}
|
|
1841
1865
|
//#endregion
|
|
1842
1866
|
//#region src/composables/useLogicTag.ts
|
|
1843
|
-
function
|
|
1867
|
+
function ur() {
|
|
1844
1868
|
let e = n(Ge, []), t = n(tt, []), r = n(ft, Ae.liquid), i = n(Ue, null), a = n(xt, null), o = l(!1), s = !!i || e.length > 0 || t.length > 0, c = e.length > 0 || t.length > 0;
|
|
1845
1869
|
async function u() {
|
|
1846
1870
|
if (i) {
|
|
@@ -1872,7 +1896,7 @@ function cr() {
|
|
|
1872
1896
|
}
|
|
1873
1897
|
//#endregion
|
|
1874
1898
|
//#region src/utils/mergeTagNodeSpec.ts
|
|
1875
|
-
function
|
|
1899
|
+
function dr(e, t, n) {
|
|
1876
1900
|
return ve(e, n) ? {
|
|
1877
1901
|
type: "logicMergeTagNode",
|
|
1878
1902
|
attrs: {
|
|
@@ -1889,15 +1913,15 @@ function lr(e, t, n) {
|
|
|
1889
1913
|
}
|
|
1890
1914
|
//#endregion
|
|
1891
1915
|
//#region src/utils/insertLogicTag.ts
|
|
1892
|
-
function
|
|
1916
|
+
function fr(e) {
|
|
1893
1917
|
return "before" in e && "after" in e;
|
|
1894
1918
|
}
|
|
1895
|
-
function
|
|
1896
|
-
if (!
|
|
1897
|
-
e.chain().focus().insertContent(
|
|
1919
|
+
function pr(e, t, n) {
|
|
1920
|
+
if (!fr(t)) {
|
|
1921
|
+
e.chain().focus().insertContent(dr(t.value, t.label, n)).run();
|
|
1898
1922
|
return;
|
|
1899
1923
|
}
|
|
1900
|
-
let r =
|
|
1924
|
+
let r = dr(t.before, t.label, n), i = dr(t.after, t.label, n), { from: a, to: o } = e.state.selection;
|
|
1901
1925
|
if (a !== o) {
|
|
1902
1926
|
e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
|
|
1903
1927
|
return;
|
|
@@ -1906,20 +1930,20 @@ function dr(e, t, n) {
|
|
|
1906
1930
|
}
|
|
1907
1931
|
//#endregion
|
|
1908
1932
|
//#region src/utils/linkColorExtension.ts
|
|
1909
|
-
function
|
|
1933
|
+
function mr(e) {
|
|
1910
1934
|
if (!e) return null;
|
|
1911
1935
|
let t = e.trim();
|
|
1912
1936
|
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;
|
|
1913
1937
|
}
|
|
1914
|
-
function
|
|
1938
|
+
function hr(e) {
|
|
1915
1939
|
return e.extend({ addAttributes() {
|
|
1916
1940
|
return {
|
|
1917
1941
|
...this.parent?.(),
|
|
1918
1942
|
color: {
|
|
1919
1943
|
default: null,
|
|
1920
|
-
parseHTML: (e) =>
|
|
1944
|
+
parseHTML: (e) => mr(Et(e.style.color)),
|
|
1921
1945
|
renderHTML: (e) => {
|
|
1922
|
-
let t =
|
|
1946
|
+
let t = mr(e.color);
|
|
1923
1947
|
return t ? { style: `color: ${t}` } : {};
|
|
1924
1948
|
}
|
|
1925
1949
|
}
|
|
@@ -1928,9 +1952,9 @@ function pr(e) {
|
|
|
1928
1952
|
}
|
|
1929
1953
|
//#endregion
|
|
1930
1954
|
//#region src/composables/useRichTextLinkDialog.ts
|
|
1931
|
-
function
|
|
1955
|
+
function gr(e) {
|
|
1932
1956
|
let t = l(!1), n = l(""), r = l(""), i = l(null);
|
|
1933
|
-
|
|
1957
|
+
rr(i, t);
|
|
1934
1958
|
function a() {
|
|
1935
1959
|
let i = e.value?.getAttributes("link") ?? {};
|
|
1936
1960
|
n.value = i.href || "", r.value = i.color || "", t.value = !0;
|
|
@@ -1939,7 +1963,7 @@ function mr(e) {
|
|
|
1939
1963
|
if (n.value) {
|
|
1940
1964
|
let t = c(n.value);
|
|
1941
1965
|
if (t !== null) {
|
|
1942
|
-
let n =
|
|
1966
|
+
let n = mr(r.value), i = e.value?.chain().focus().extendMarkRange("link").setLink({ href: t }).updateAttributes("link", { color: n });
|
|
1943
1967
|
n && typeof e.value?.commands.unsetColor == "function" && i?.unsetColor(), i?.run();
|
|
1944
1968
|
}
|
|
1945
1969
|
}
|
|
@@ -1986,8 +2010,8 @@ function mr(e) {
|
|
|
1986
2010
|
}
|
|
1987
2011
|
//#endregion
|
|
1988
2012
|
//#region src/composables/useRichTextEditor.ts
|
|
1989
|
-
function
|
|
1990
|
-
let i = n(J, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = Q(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } =
|
|
2013
|
+
function _r(r) {
|
|
2014
|
+
let i = n(J, null), { mergeTags: a, canRequestMergeTag: o, isRequesting: s, requestMergeTag: c, syntax: u, autocomplete: d } = Q(), { canInsertLogicTag: f, isRequesting: p, requestLogicTag: m } = ur(), h = n(nt, null), g = (N(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = Te(u), v = x(null), { showLinkDialog: y, linkUrl: b, linkColor: S, linkDialogRef: C, openLinkDialog: w, insertLink: T, removeLink: E, closeLinkDialog: D, handleLinkKeydown: O } = gr(v), { start: k, stop: A } = Ie(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), j = x(null), M = l(!0), P = l(null), F = !1;
|
|
1991
2015
|
async function I() {
|
|
1992
2016
|
P.value = null, M.value = !0;
|
|
1993
2017
|
try {
|
|
@@ -2047,7 +2071,7 @@ function hr(r) {
|
|
|
2047
2071
|
}
|
|
2048
2072
|
async function V() {
|
|
2049
2073
|
let e = await m();
|
|
2050
|
-
F || (e && v.value ?
|
|
2074
|
+
F || (e && v.value ? pr(v.value, e, u) : v.value?.commands.focus());
|
|
2051
2075
|
}
|
|
2052
2076
|
return {
|
|
2053
2077
|
editor: v,
|
|
@@ -2076,9 +2100,9 @@ function hr(r) {
|
|
|
2076
2100
|
}
|
|
2077
2101
|
//#endregion
|
|
2078
2102
|
//#region src/composables/useSmallScreenNotice.ts
|
|
2079
|
-
var
|
|
2080
|
-
function
|
|
2081
|
-
let t = Be(
|
|
2103
|
+
var vr = "(max-width: 767px)";
|
|
2104
|
+
function yr(e) {
|
|
2105
|
+
let t = Be(vr);
|
|
2082
2106
|
return {
|
|
2083
2107
|
isSmallScreen: t,
|
|
2084
2108
|
showNotice: S(() => (P(e) ?? !0) && t.value)
|
|
@@ -2086,20 +2110,20 @@ function _r(e) {
|
|
|
2086
2110
|
}
|
|
2087
2111
|
//#endregion
|
|
2088
2112
|
//#region src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2089
|
-
var
|
|
2113
|
+
var br = { class: "tpl:w-full" }, xr = {
|
|
2090
2114
|
key: 0,
|
|
2091
2115
|
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)]"
|
|
2092
|
-
},
|
|
2116
|
+
}, Sr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Cr = {
|
|
2093
2117
|
key: 1,
|
|
2094
2118
|
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)]"
|
|
2095
|
-
},
|
|
2119
|
+
}, wr = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Tr = {
|
|
2096
2120
|
key: 2,
|
|
2097
2121
|
class: "tpl:relative"
|
|
2098
|
-
},
|
|
2122
|
+
}, Er = ["innerHTML"], Dr = {
|
|
2099
2123
|
key: 0,
|
|
2100
2124
|
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]",
|
|
2101
2125
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
|
|
2102
|
-
},
|
|
2126
|
+
}, Or = /* @__PURE__ */ d({
|
|
2103
2127
|
__name: "CustomBlock",
|
|
2104
2128
|
props: {
|
|
2105
2129
|
block: {},
|
|
@@ -2107,7 +2131,7 @@ var vr = { class: "tpl:w-full" }, yr = {
|
|
|
2107
2131
|
},
|
|
2108
2132
|
emits: ["fetchData"],
|
|
2109
2133
|
setup(e, { emit: r }) {
|
|
2110
|
-
let i = e, a = r, { t: o } = Y(), c = n(vt, 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 } =
|
|
2134
|
+
let i = e, a = r, { t: o } = Y(), c = n(vt, 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 } = dn({
|
|
2111
2135
|
definition: f,
|
|
2112
2136
|
block: S(() => i.block),
|
|
2113
2137
|
onUpdate: (e, t) => {
|
|
@@ -2143,10 +2167,10 @@ var vr = { class: "tpl:w-full" }, yr = {
|
|
|
2143
2167
|
k();
|
|
2144
2168
|
}, { deep: !0 }), t(() => x?.value, () => {
|
|
2145
2169
|
k();
|
|
2146
|
-
}), (e, t) => (s(), C("div",
|
|
2170
|
+
}), (e, t) => (s(), C("div", br, [p.value ? d.value ? (s(), C("div", Cr, [v(_(Ut), {
|
|
2147
2171
|
size: 24,
|
|
2148
2172
|
class: "tpl:text-[var(--tpl-danger)]"
|
|
2149
|
-
}), M("span",
|
|
2173
|
+
}), M("span", wr, R(_(o).customBlocks.renderError), 1)])) : (s(), C("div", Tr, [M("div", { innerHTML: u.value }, null, 8, Er), _(y) && _(g) ? (s(), C("div", Dr, [_(m) ? (s(), A(qt, {
|
|
2150
2174
|
key: 1,
|
|
2151
2175
|
class: "tpl:w-48"
|
|
2152
2176
|
})) : (s(), C("button", {
|
|
@@ -2154,16 +2178,16 @@ var vr = { class: "tpl:w-full" }, yr = {
|
|
|
2154
2178
|
type: "button",
|
|
2155
2179
|
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)]",
|
|
2156
2180
|
onClick: t[0] ||= O((...e) => _(h) && _(h)(...e), ["stop"])
|
|
2157
|
-
}, [f.value?.icon ? (s(), A(
|
|
2181
|
+
}, [f.value?.icon ? (s(), A(tr, {
|
|
2158
2182
|
key: 0,
|
|
2159
2183
|
icon: f.value.icon,
|
|
2160
2184
|
size: 16
|
|
2161
|
-
}, null, 8, ["icon"])) : w("", !0), V(" " + R(f.value?.dataSource?.label || _(o).customBlocks.dataSource.fetchButton), 1)]))])) : w("", !0)])) : (s(), C("div",
|
|
2185
|
+
}, null, 8, ["icon"])) : w("", !0), V(" " + R(f.value?.dataSource?.label || _(o).customBlocks.dataSource.fetchButton), 1)]))])) : w("", !0)])) : (s(), C("div", xr, [v(_(Mt), {
|
|
2162
2186
|
size: 24,
|
|
2163
2187
|
class: "tpl:text-[var(--tpl-warning)]"
|
|
2164
|
-
}), M("span",
|
|
2188
|
+
}), M("span", Sr, R(_(o).customBlocks.definitionNotFound), 1)]))]));
|
|
2165
2189
|
}
|
|
2166
|
-
}),
|
|
2190
|
+
}), kr = { class: "tpl:w-full" }, Ar = /* @__PURE__ */ d({
|
|
2167
2191
|
__name: "DividerBlock",
|
|
2168
2192
|
props: {
|
|
2169
2193
|
block: {},
|
|
@@ -2175,21 +2199,21 @@ var vr = { class: "tpl:w-full" }, yr = {
|
|
|
2175
2199
|
width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
|
|
2176
2200
|
margin: t.block.width === "full" ? "0" : "0 auto"
|
|
2177
2201
|
}));
|
|
2178
|
-
return (e, t) => (s(), C("div",
|
|
2202
|
+
return (e, t) => (s(), C("div", kr, [M("hr", {
|
|
2179
2203
|
class: "tpl:m-0 tpl:border-none",
|
|
2180
2204
|
style: k(n.value)
|
|
2181
2205
|
}, null, 4)]));
|
|
2182
2206
|
}
|
|
2183
|
-
}),
|
|
2207
|
+
}), jr = { class: "tpl:w-full" }, Mr = ["srcdoc", "title"], Nr = {
|
|
2184
2208
|
key: 1,
|
|
2185
2209
|
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)]"
|
|
2186
|
-
},
|
|
2210
|
+
}, Pr = {
|
|
2187
2211
|
key: 0,
|
|
2188
2212
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
|
|
2189
|
-
},
|
|
2213
|
+
}, Fr = {
|
|
2190
2214
|
key: 1,
|
|
2191
2215
|
class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
|
|
2192
|
-
},
|
|
2216
|
+
}, Ir = /* @__PURE__ */ d({
|
|
2193
2217
|
__name: "HtmlBlock",
|
|
2194
2218
|
props: {
|
|
2195
2219
|
block: {},
|
|
@@ -2210,7 +2234,7 @@ var vr = { class: "tpl:w-full" }, yr = {
|
|
|
2210
2234
|
e || (g?.disconnect(), g = null);
|
|
2211
2235
|
}), e(() => {
|
|
2212
2236
|
g?.disconnect(), g = null;
|
|
2213
|
-
}), (e, t) => (s(), C("div",
|
|
2237
|
+
}), (e, t) => (s(), C("div", jr, [u.value ? (s(), C("iframe", {
|
|
2214
2238
|
key: 0,
|
|
2215
2239
|
ref_key: "iframeRef",
|
|
2216
2240
|
ref: m,
|
|
@@ -2220,18 +2244,18 @@ var vr = { class: "tpl:w-full" }, yr = {
|
|
|
2220
2244
|
class: "tpl:block tpl:w-full tpl:border-0",
|
|
2221
2245
|
style: k({ height: `${h.value}px` }),
|
|
2222
2246
|
onLoad: b
|
|
2223
|
-
}, null, 44,
|
|
2247
|
+
}, null, 44, Mr)) : (s(), C("div", Nr, [v(_(Nt), {
|
|
2224
2248
|
size: 24,
|
|
2225
2249
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
2226
|
-
}), c.value ? (s(), C("span",
|
|
2250
|
+
}), c.value ? (s(), C("span", Pr, R(_(a).html.preview), 1)) : (s(), C("span", Fr, R(_(a).html.empty), 1))]))]));
|
|
2227
2251
|
}
|
|
2228
|
-
}),
|
|
2229
|
-
function
|
|
2252
|
+
}), Lr = "image/";
|
|
2253
|
+
function Rr(e) {
|
|
2230
2254
|
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || P(r), { isOverDropZone: a } = He(t, {
|
|
2231
2255
|
preventDefaultForUnhandled: !0,
|
|
2232
2256
|
onDrop: (e) => {
|
|
2233
2257
|
if (!i()) return;
|
|
2234
|
-
let t = (e ?? []).filter((e) => e.type.startsWith(
|
|
2258
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(Lr));
|
|
2235
2259
|
t.length > 0 && n([t[0]]);
|
|
2236
2260
|
}
|
|
2237
2261
|
});
|
|
@@ -2239,17 +2263,17 @@ function Ir(e) {
|
|
|
2239
2263
|
}
|
|
2240
2264
|
//#endregion
|
|
2241
2265
|
//#region src/components/blocks/ImageBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2242
|
-
var
|
|
2266
|
+
var zr = {
|
|
2243
2267
|
key: 0,
|
|
2244
2268
|
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)]",
|
|
2245
2269
|
style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 85%, transparent)" }
|
|
2246
|
-
},
|
|
2270
|
+
}, Br = ["href"], Vr = ["src", "alt"], Hr = ["src", "alt"], Ur = {
|
|
2247
2271
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
2248
2272
|
style: { opacity: "0.7" }
|
|
2249
|
-
},
|
|
2273
|
+
}, Wr = ["href"], Gr = ["src", "alt"], Kr = ["src", "alt"], qr = {
|
|
2250
2274
|
key: 4,
|
|
2251
2275
|
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)]"
|
|
2252
|
-
},
|
|
2276
|
+
}, Jr = ["aria-label"], Yr = { key: 1 }, Xr = /* @__PURE__ */ d({
|
|
2253
2277
|
__name: "ImageBlock",
|
|
2254
2278
|
props: {
|
|
2255
2279
|
block: {},
|
|
@@ -2284,7 +2308,7 @@ var Lr = {
|
|
|
2284
2308
|
}
|
|
2285
2309
|
}
|
|
2286
2310
|
}
|
|
2287
|
-
let { isOver: y } =
|
|
2311
|
+
let { isOver: y } = Rr({
|
|
2288
2312
|
target: p,
|
|
2289
2313
|
enabled: h,
|
|
2290
2314
|
onFiles: g
|
|
@@ -2298,18 +2322,18 @@ var Lr = {
|
|
|
2298
2322
|
marginLeft: e === "center" || e === "right" ? "auto" : void 0,
|
|
2299
2323
|
marginRight: e === "center" ? "auto" : void 0
|
|
2300
2324
|
};
|
|
2301
|
-
}), T = S(() => U(r.block.src, o)), E =
|
|
2325
|
+
}), T = S(() => U(r.block.src, o)), E = Tn(() => T.value ? void 0 : r.block.src), D = Tn(() => T.value ? r.block.placeholderUrl : void 0);
|
|
2302
2326
|
return (t, n) => (s(), C("div", {
|
|
2303
2327
|
ref_key: "dropZoneRef",
|
|
2304
2328
|
ref: p,
|
|
2305
2329
|
"data-testid": "image-drop-zone",
|
|
2306
2330
|
class: "tpl:relative tpl:w-full",
|
|
2307
2331
|
style: k(b.value)
|
|
2308
|
-
}, [h.value && (_(y) || m.value) ? (s(), C("div",
|
|
2332
|
+
}, [h.value && (_(y) || m.value) ? (s(), C("div", zr, [m.value ? (s(), C(L, { key: 0 }, [v(_(zt), {
|
|
2309
2333
|
class: "tpl-spinner",
|
|
2310
2334
|
size: 20,
|
|
2311
2335
|
"stroke-width": 2
|
|
2312
|
-
}), V(" " + R(_(a).image.uploading), 1)], 64)) : (s(), C(L, { key: 1 }, [v(_(
|
|
2336
|
+
}), V(" " + R(_(a).image.uploading), 1)], 64)) : (s(), C(L, { key: 1 }, [v(_(Vt), {
|
|
2313
2337
|
size: 20,
|
|
2314
2338
|
"stroke-width": 1.5
|
|
2315
2339
|
}), V(" " + 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", {
|
|
@@ -2324,22 +2348,22 @@ var Lr = {
|
|
|
2324
2348
|
src: _(D),
|
|
2325
2349
|
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2326
2350
|
style: k(x.value)
|
|
2327
|
-
}, null, 12,
|
|
2351
|
+
}, null, 12, Vr)], 8, Br)) : (s(), C("img", {
|
|
2328
2352
|
key: 1,
|
|
2329
2353
|
class: "tpl:border-0",
|
|
2330
2354
|
src: _(D),
|
|
2331
2355
|
alt: e.block.alt,
|
|
2332
2356
|
style: k(x.value)
|
|
2333
|
-
}, null, 12,
|
|
2357
|
+
}, null, 12, Hr))], 64)) : e.block.src && T.value ? (s(), C("div", {
|
|
2334
2358
|
key: 2,
|
|
2335
2359
|
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)]",
|
|
2336
2360
|
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, x.value])
|
|
2337
|
-
}, [v(_(
|
|
2361
|
+
}, [v(_(Lt), {
|
|
2338
2362
|
size: 32,
|
|
2339
2363
|
"stroke-width": 1.5,
|
|
2340
2364
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
2341
2365
|
style: { opacity: "0.5" }
|
|
2342
|
-
}), M("span",
|
|
2366
|
+
}), M("span", Ur, [v(Xn, { text: e.block.src }, null, 8, ["text"])])], 4)) : e.block.src ? (s(), C(L, { key: 3 }, [e.block.linkUrl ? (s(), C("a", {
|
|
2343
2367
|
key: 0,
|
|
2344
2368
|
href: e.block.linkUrl,
|
|
2345
2369
|
target: "_blank",
|
|
@@ -2351,26 +2375,26 @@ var Lr = {
|
|
|
2351
2375
|
src: _(E),
|
|
2352
2376
|
alt: e.block.alt || _(a).image.altTextPlaceholder,
|
|
2353
2377
|
style: k(x.value)
|
|
2354
|
-
}, null, 12,
|
|
2378
|
+
}, null, 12, Gr)], 8, Wr)) : (s(), C("img", {
|
|
2355
2379
|
key: 1,
|
|
2356
2380
|
class: "tpl:border-0",
|
|
2357
2381
|
src: _(E),
|
|
2358
2382
|
alt: e.block.alt,
|
|
2359
2383
|
style: k(x.value)
|
|
2360
|
-
}, null, 12,
|
|
2384
|
+
}, null, 12, Kr))], 64)) : (s(), C("div", qr, [u.value ? (s(), C("button", {
|
|
2361
2385
|
key: 0,
|
|
2362
2386
|
"aria-label": _(a).image.browseMedia,
|
|
2363
2387
|
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)]",
|
|
2364
2388
|
onClick: O(f, ["stop"])
|
|
2365
|
-
}, [v(_(
|
|
2389
|
+
}, [v(_(Lt), {
|
|
2366
2390
|
size: 14,
|
|
2367
2391
|
"stroke-width": 1.5
|
|
2368
|
-
}), V(" " + R(_(a).image.browseMedia), 1)], 8,
|
|
2392
|
+
}), V(" " + R(_(a).image.browseMedia), 1)], 8, Jr)) : (s(), C("span", Yr, R(_(a).image.clickToAdd), 1))]))], 4));
|
|
2369
2393
|
}
|
|
2370
|
-
}),
|
|
2394
|
+
}), Zr = { class: "tpl:w-full" }, Qr = ["href"], $r = {
|
|
2371
2395
|
key: 1,
|
|
2372
2396
|
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)]"
|
|
2373
|
-
},
|
|
2397
|
+
}, ei = /* @__PURE__ */ d({
|
|
2374
2398
|
__name: "MenuBlock",
|
|
2375
2399
|
props: {
|
|
2376
2400
|
block: {},
|
|
@@ -2389,7 +2413,7 @@ var Lr = {
|
|
|
2389
2413
|
function o(e) {
|
|
2390
2414
|
return e || t.block.linkColor || t.block.color;
|
|
2391
2415
|
}
|
|
2392
|
-
return (t, c) => (s(), C("div",
|
|
2416
|
+
return (t, c) => (s(), C("div", Zr, [a.value ? (s(), C("div", {
|
|
2393
2417
|
key: 0,
|
|
2394
2418
|
style: k(i.value)
|
|
2395
2419
|
}, [(s(!0), C(L, null, r(e.block.items, (t, n) => (s(), C(L, { key: t.id }, [M("a", {
|
|
@@ -2401,15 +2425,15 @@ var Lr = {
|
|
|
2401
2425
|
textDecoration: t.underline ? "underline" : "none"
|
|
2402
2426
|
}),
|
|
2403
2427
|
onClick: c[0] ||= O(() => {}, ["prevent"])
|
|
2404
|
-
}, [v(
|
|
2428
|
+
}, [v(Xn, { text: t.text || "..." }, null, 8, ["text"])], 12, Qr), n < e.block.items.length - 1 ? (s(), C("span", {
|
|
2405
2429
|
key: 0,
|
|
2406
2430
|
style: k({
|
|
2407
2431
|
color: e.block.separatorColor,
|
|
2408
2432
|
padding: `0 ${e.block.spacing}px`
|
|
2409
2433
|
})
|
|
2410
|
-
}, R(e.block.separator), 5)) : w("", !0)], 64))), 128))], 4)) : (s(), C("div",
|
|
2434
|
+
}, R(e.block.separator), 5)) : w("", !0)], 64))), 128))], 4)) : (s(), C("div", $r, [v(_(Ft), { size: 16 }), M("span", null, R(_(n).menu.addLinks), 1)]))]));
|
|
2411
2435
|
}
|
|
2412
|
-
}),
|
|
2436
|
+
}), ti = /* @__PURE__ */ new Set([
|
|
2413
2437
|
"http",
|
|
2414
2438
|
"https",
|
|
2415
2439
|
"mailto",
|
|
@@ -2419,7 +2443,7 @@ var Lr = {
|
|
|
2419
2443
|
"sms",
|
|
2420
2444
|
"xmpp",
|
|
2421
2445
|
"cid"
|
|
2422
|
-
]),
|
|
2446
|
+
]), ni = /* @__PURE__ */ new Set([
|
|
2423
2447
|
"SCRIPT",
|
|
2424
2448
|
"STYLE",
|
|
2425
2449
|
"IFRAME",
|
|
@@ -2429,7 +2453,7 @@ var Lr = {
|
|
|
2429
2453
|
"META",
|
|
2430
2454
|
"BASE",
|
|
2431
2455
|
"FORM"
|
|
2432
|
-
]),
|
|
2456
|
+
]), ri = /* @__PURE__ */ new Set([
|
|
2433
2457
|
"href",
|
|
2434
2458
|
"xlink:href",
|
|
2435
2459
|
"formaction",
|
|
@@ -2438,16 +2462,16 @@ var Lr = {
|
|
|
2438
2462
|
"background",
|
|
2439
2463
|
"poster"
|
|
2440
2464
|
]);
|
|
2441
|
-
function
|
|
2465
|
+
function ii(e, t) {
|
|
2442
2466
|
let n = e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2443
2467
|
if (!n || n.startsWith("#")) return !0;
|
|
2444
2468
|
let r = /^([a-z][a-z0-9+.-]*):/i.exec(n);
|
|
2445
2469
|
if (!r) return !0;
|
|
2446
2470
|
let i = r[1].toLowerCase();
|
|
2447
|
-
return
|
|
2471
|
+
return ti.has(i) ? !0 : t && i === "data" ? /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i.test(n) : !1;
|
|
2448
2472
|
}
|
|
2449
|
-
function
|
|
2450
|
-
if (
|
|
2473
|
+
function ai(e) {
|
|
2474
|
+
if (ni.has(e.tagName)) {
|
|
2451
2475
|
e.remove();
|
|
2452
2476
|
return;
|
|
2453
2477
|
}
|
|
@@ -2459,29 +2483,29 @@ function ri(e) {
|
|
|
2459
2483
|
e.removeAttribute(n);
|
|
2460
2484
|
continue;
|
|
2461
2485
|
}
|
|
2462
|
-
if (
|
|
2463
|
-
|
|
2486
|
+
if (ri.has(t)) {
|
|
2487
|
+
ii(e.getAttribute(n) ?? "", !1) || e.removeAttribute(n);
|
|
2464
2488
|
continue;
|
|
2465
2489
|
}
|
|
2466
2490
|
if (t === "src") {
|
|
2467
|
-
|
|
2491
|
+
ii(e.getAttribute(n) ?? "", !0) || e.removeAttribute(n);
|
|
2468
2492
|
continue;
|
|
2469
2493
|
}
|
|
2470
2494
|
t === "srcdoc" && e.removeAttribute(n);
|
|
2471
2495
|
}
|
|
2472
2496
|
let n = Array.from(e.children);
|
|
2473
|
-
for (let e of n)
|
|
2497
|
+
for (let e of n) ai(e);
|
|
2474
2498
|
}
|
|
2475
|
-
function
|
|
2499
|
+
function oi(e) {
|
|
2476
2500
|
if (typeof DOMParser > "u") return e;
|
|
2477
2501
|
let t = new DOMParser().parseFromString(`<!doctype html><body>${e}</body>`, "text/html").body, n = Array.from(t.children);
|
|
2478
|
-
for (let e of n)
|
|
2502
|
+
for (let e of n) ai(e);
|
|
2479
2503
|
return t.innerHTML;
|
|
2480
2504
|
}
|
|
2481
2505
|
//#endregion
|
|
2482
2506
|
//#region src/composables/useEditableTextBlock.ts
|
|
2483
|
-
function
|
|
2484
|
-
let t = n(K, []), r = n(q, null), { syntax: i } = Q(), a = S(() => r?.value ? xe(e(), t) : Ee(e(), t)), o = S(() =>
|
|
2507
|
+
function si(e) {
|
|
2508
|
+
let t = n(K, []), r = n(q, null), { syntax: i } = Q(), a = S(() => r?.value ? xe(e(), t) : Ee(e(), t)), o = S(() => oi(ke(a.value, i))), s = l(!1), c = l(null), { top: u, left: d } = Ve(c), { toLocal: f } = Ot(), p = S(() => f({
|
|
2485
2509
|
top: u.value - 8,
|
|
2486
2510
|
left: d.value
|
|
2487
2511
|
}));
|
|
@@ -2502,14 +2526,14 @@ function ai(e) {
|
|
|
2502
2526
|
}
|
|
2503
2527
|
//#endregion
|
|
2504
2528
|
//#region src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2505
|
-
var
|
|
2529
|
+
var ci = ["innerHTML"], li = /* @__PURE__ */ d({
|
|
2506
2530
|
__name: "ParagraphBlock",
|
|
2507
2531
|
props: {
|
|
2508
2532
|
block: {},
|
|
2509
2533
|
viewport: {}
|
|
2510
2534
|
},
|
|
2511
2535
|
setup(e) {
|
|
2512
|
-
let t = e, n = B(() => import("./ParagraphEditor-
|
|
2536
|
+
let t = e, n = B(() => import("./ParagraphEditor-BtzkHfv2.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = si(() => t.block.content);
|
|
2513
2537
|
return (t, u) => (s(), C("div", {
|
|
2514
2538
|
ref_key: "blockRef",
|
|
2515
2539
|
ref: i,
|
|
@@ -2528,54 +2552,54 @@ var oi = ["innerHTML"], si = /* @__PURE__ */ d({
|
|
|
2528
2552
|
key: 1,
|
|
2529
2553
|
class: "tpl-text-content tpl:outline-none [&_a]:tpl:underline [&_li]:tpl:my-1 [&_ol]:tpl:my-2 [&_ol]:tpl:pl-6 [&_p]:tpl:m-0 [&_p]:tpl:mb-2 [&_p:last-child]:tpl:mb-0 [&_s]:tpl:line-through [&_sub]:tpl:align-sub [&_sub]:tpl:text-[0.75em] [&_sup]:tpl:align-super [&_sup]:tpl:text-[0.75em] [&_ul]:tpl:my-2 [&_ul]:tpl:pl-6",
|
|
2530
2554
|
innerHTML: _(o)
|
|
2531
|
-
}, null, 8,
|
|
2555
|
+
}, null, 8, ci))], 544));
|
|
2532
2556
|
}
|
|
2533
2557
|
});
|
|
2534
2558
|
//#endregion
|
|
2535
2559
|
//#region src/utils/blockComponentResolver.ts
|
|
2536
|
-
function
|
|
2560
|
+
function ui(e) {
|
|
2537
2561
|
let t = { fontFamily: e.fontFamily };
|
|
2538
2562
|
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;
|
|
2539
2563
|
}
|
|
2540
|
-
function
|
|
2564
|
+
function di(e, t, n) {
|
|
2541
2565
|
if (t) {
|
|
2542
2566
|
let n = t.getComponent(e);
|
|
2543
2567
|
if (n) return n;
|
|
2544
2568
|
}
|
|
2545
2569
|
return n[e.type] ?? null;
|
|
2546
2570
|
}
|
|
2547
|
-
function
|
|
2571
|
+
function fi(e) {
|
|
2548
2572
|
let { padding: t, backgroundColor: n } = e.styles, r = {
|
|
2549
2573
|
padding: `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`,
|
|
2550
2574
|
backgroundColor: n || "transparent"
|
|
2551
2575
|
};
|
|
2552
2576
|
return e.type === "section" && e.borderRadius && e.borderRadius > 0 && (r.borderRadius = `${e.borderRadius}px`), r;
|
|
2553
2577
|
}
|
|
2554
|
-
function
|
|
2578
|
+
function pi(e) {
|
|
2555
2579
|
if (e.type !== "section" || !e.wrapper) return null;
|
|
2556
2580
|
let t = e.wrapper, n = {};
|
|
2557
2581
|
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;
|
|
2558
2582
|
}
|
|
2559
2583
|
//#endregion
|
|
2560
2584
|
//#region src/components/blocks/BlockWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
2561
|
-
var
|
|
2585
|
+
var mi = [
|
|
2562
2586
|
"data-block-id",
|
|
2563
2587
|
"data-block-type",
|
|
2564
2588
|
"data-tpl-picked"
|
|
2565
|
-
],
|
|
2589
|
+
], hi = ["aria-label"], gi = [
|
|
2566
2590
|
"aria-label",
|
|
2567
2591
|
"aria-pressed",
|
|
2568
2592
|
"title"
|
|
2569
|
-
],
|
|
2593
|
+
], _i = ["aria-label", "title"], vi = ["aria-label", "title"], yi = ["aria-label", "title"], bi = {
|
|
2570
2594
|
key: 1,
|
|
2571
2595
|
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"
|
|
2572
|
-
},
|
|
2596
|
+
}, xi = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, Si = {
|
|
2573
2597
|
key: 2,
|
|
2574
2598
|
class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
|
|
2575
|
-
},
|
|
2599
|
+
}, Ci = ["aria-label", "title"], wi = {
|
|
2576
2600
|
key: 3,
|
|
2577
2601
|
class: "tpl:absolute tpl:-right-1 tpl:-top-1 tpl:z-[5] tpl:translate-x-full"
|
|
2578
|
-
},
|
|
2602
|
+
}, Ti = ["aria-label"], Ei = /*#__PURE__*/ Jt(/* @__PURE__ */ d({
|
|
2579
2603
|
__name: "BlockWrapper",
|
|
2580
2604
|
props: {
|
|
2581
2605
|
block: {},
|
|
@@ -2587,7 +2611,7 @@ var fi = [
|
|
|
2587
2611
|
},
|
|
2588
2612
|
emits: ["select"],
|
|
2589
2613
|
setup(e, { emit: t }) {
|
|
2590
|
-
let r = B(() => import("./BlockIssueBadge-
|
|
2614
|
+
let r = B(() => import("./BlockIssueBadge-CXlXn9Sm.js")), i = e, o = t, { t: c, format: u } = Y(), d = n(St, 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);
|
|
2591
2615
|
async function h() {
|
|
2592
2616
|
await D(), f.value?.focus();
|
|
2593
2617
|
}
|
|
@@ -2614,12 +2638,12 @@ var fi = [
|
|
|
2614
2638
|
desktop: c.viewport.desktop,
|
|
2615
2639
|
mobile: c.viewport.mobile
|
|
2616
2640
|
}[i.viewport] ?? i.viewport : ""), E = S(() => !!i.block.displayCondition), A = n(at, null), j = n(ct, null), N = n(st, {}), 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), z = S(() => {
|
|
2617
|
-
let e =
|
|
2641
|
+
let e = fi(i.block), t = {
|
|
2618
2642
|
padding: e.padding,
|
|
2619
2643
|
backgroundColor: e.backgroundColor
|
|
2620
2644
|
};
|
|
2621
2645
|
return e.borderRadius && (t.borderRadius = e.borderRadius), t;
|
|
2622
|
-
}), ee = S(() =>
|
|
2646
|
+
}), ee = S(() => pi(i.block));
|
|
2623
2647
|
function te(e) {
|
|
2624
2648
|
i.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), o("select"));
|
|
2625
2649
|
}
|
|
@@ -2664,10 +2688,10 @@ var fi = [
|
|
|
2664
2688
|
"aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
|
|
2665
2689
|
title: _(c).blockActions.drag,
|
|
2666
2690
|
onKeydown: g
|
|
2667
|
-
}, [v(_(
|
|
2691
|
+
}, [v(_(Rt), {
|
|
2668
2692
|
size: 14,
|
|
2669
2693
|
"stroke-width": 1.5
|
|
2670
|
-
})], 40,
|
|
2694
|
+
})], 40, gi),
|
|
2671
2695
|
M("button", {
|
|
2672
2696
|
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",
|
|
2673
2697
|
"aria-label": _(c).blockActions.duplicate,
|
|
@@ -2676,7 +2700,7 @@ var fi = [
|
|
|
2676
2700
|
}, [v(_(jt), {
|
|
2677
2701
|
size: 14,
|
|
2678
2702
|
"stroke-width": 1.5
|
|
2679
|
-
})], 8,
|
|
2703
|
+
})], 8, _i),
|
|
2680
2704
|
F.value ? (s(), C("button", {
|
|
2681
2705
|
key: 0,
|
|
2682
2706
|
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",
|
|
@@ -2686,39 +2710,39 @@ var fi = [
|
|
|
2686
2710
|
}, [v(_(At), {
|
|
2687
2711
|
size: 14,
|
|
2688
2712
|
"stroke-width": 1.5
|
|
2689
|
-
})], 8,
|
|
2713
|
+
})], 8, vi)) : w("", !0),
|
|
2690
2714
|
M("button", {
|
|
2691
2715
|
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",
|
|
2692
2716
|
"aria-label": _(c).blockActions.delete,
|
|
2693
2717
|
title: _(c).blockActions.delete,
|
|
2694
2718
|
onClick: O(ne, ["stop"])
|
|
2695
|
-
}, [v(_(
|
|
2719
|
+
}, [v(_(It), {
|
|
2696
2720
|
size: 14,
|
|
2697
2721
|
"stroke-width": 1.5
|
|
2698
|
-
})], 8,
|
|
2699
|
-
], 8,
|
|
2700
|
-
y.value ? (s(), C("div",
|
|
2722
|
+
})], 8, yi)
|
|
2723
|
+
], 8, hi)) : w("", !0),
|
|
2724
|
+
y.value ? (s(), C("div", bi, [M("span", xi, [v(_(Pt), {
|
|
2701
2725
|
size: 12,
|
|
2702
2726
|
"stroke-width": 1.5
|
|
2703
2727
|
}), V(" " + R(_(u)(_(c).blockActions.hiddenOnViewport, { viewport: T.value })), 1)])])) : w("", !0),
|
|
2704
|
-
E.value && !y.value ? (s(), C("div",
|
|
2728
|
+
E.value && !y.value ? (s(), C("div", Si, [M("button", {
|
|
2705
2729
|
"data-testid": "condition-toggle",
|
|
2706
2730
|
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)]",
|
|
2707
2731
|
"aria-label": _(c).blockActions.conditionToggle,
|
|
2708
2732
|
title: e.block.displayCondition?.label,
|
|
2709
2733
|
onClick: O(ae, ["stop"])
|
|
2710
|
-
}, [v(_(
|
|
2734
|
+
}, [v(_(Gt), {
|
|
2711
2735
|
size: 12,
|
|
2712
2736
|
"stroke-width": 2
|
|
2713
|
-
})], 8,
|
|
2714
|
-
L.value > 0 && !y.value ? (s(), C("div",
|
|
2737
|
+
})], 8, Ci)])) : w("", !0),
|
|
2738
|
+
L.value > 0 && !y.value ? (s(), C("div", wi, [M("button", {
|
|
2715
2739
|
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)]",
|
|
2716
2740
|
"aria-label": _(u)(_(c).blockActions.comments, { count: String(L.value) }),
|
|
2717
2741
|
onClick: n[0] ||= O((t) => _(N).comments?.openForBlock(e.block.id), ["stop"])
|
|
2718
|
-
}, [v(_(
|
|
2742
|
+
}, [v(_(Ht), {
|
|
2719
2743
|
size: 12,
|
|
2720
2744
|
"stroke-width": 2.5
|
|
2721
|
-
}), V(" " + R(L.value), 1)], 8,
|
|
2745
|
+
}), V(" " + R(L.value), 1)], 8, Ti)])) : w("", !0),
|
|
2722
2746
|
ee.value ? (s(), C("div", {
|
|
2723
2747
|
key: 4,
|
|
2724
2748
|
class: "tpl-section-wrapper",
|
|
@@ -2731,31 +2755,31 @@ var fi = [
|
|
|
2731
2755
|
class: "tpl-block-content",
|
|
2732
2756
|
style: k(z.value)
|
|
2733
2757
|
}, [a(t.$slots, "default", {}, void 0, !0)], 4))
|
|
2734
|
-
], 10,
|
|
2758
|
+
], 10, mi));
|
|
2735
2759
|
}
|
|
2736
2760
|
}), [["__scopeId", "data-v-096f1d37"]]);
|
|
2737
2761
|
//#endregion
|
|
2738
2762
|
//#region src/utils/unwrapParagraph.ts
|
|
2739
|
-
function
|
|
2763
|
+
function Di(e) {
|
|
2740
2764
|
let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
|
|
2741
2765
|
return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
|
|
2742
2766
|
}
|
|
2743
2767
|
//#endregion
|
|
2744
2768
|
//#region src/components/blocks/TitleBlock.vue
|
|
2745
|
-
var
|
|
2769
|
+
var Oi = /* @__PURE__ */ d({
|
|
2746
2770
|
__name: "TitleBlock",
|
|
2747
2771
|
props: {
|
|
2748
2772
|
block: {},
|
|
2749
2773
|
viewport: {}
|
|
2750
2774
|
},
|
|
2751
2775
|
setup(e) {
|
|
2752
|
-
let t = e, n = B(() => import("./TitleEditor-
|
|
2776
|
+
let t = e, n = B(() => import("./TitleEditor-CSeDvWVn.js")), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: c, handleEditorDone: l } = si(() => t.block.content), d = S(() => {
|
|
2753
2777
|
let e = {
|
|
2754
2778
|
fontSize: `${Me[t.block.level]}px`,
|
|
2755
2779
|
textAlign: t.block.textAlign
|
|
2756
2780
|
};
|
|
2757
2781
|
return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = t.block.fontFamily), e;
|
|
2758
|
-
}), f = S(() => `h${t.block.level}`), p = S(() =>
|
|
2782
|
+
}), f = S(() => `h${t.block.level}`), p = S(() => Di(o.value));
|
|
2759
2783
|
return (t, o) => (s(), C("div", {
|
|
2760
2784
|
ref_key: "blockRef",
|
|
2761
2785
|
ref: i,
|
|
@@ -2781,16 +2805,16 @@ var Ei = /* @__PURE__ */ d({
|
|
|
2781
2805
|
});
|
|
2782
2806
|
//#endregion
|
|
2783
2807
|
//#region src/utils/sectionColumnDrop.ts
|
|
2784
|
-
function
|
|
2808
|
+
function ki(e) {
|
|
2785
2809
|
return e.dataset.blockType !== "section" && e.dataset.paletteType !== "section";
|
|
2786
2810
|
}
|
|
2787
2811
|
//#endregion
|
|
2788
2812
|
//#region src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
|
|
2789
|
-
var
|
|
2813
|
+
var Ai = { class: "tpl:w-full" }, ji = {
|
|
2790
2814
|
key: 0,
|
|
2791
2815
|
"data-testid": "section-drop-hint",
|
|
2792
2816
|
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)]"
|
|
2793
|
-
},
|
|
2817
|
+
}, Mi = /* @__PURE__ */ d({
|
|
2794
2818
|
__name: "SectionBlock",
|
|
2795
2819
|
props: {
|
|
2796
2820
|
block: {},
|
|
@@ -2798,12 +2822,12 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2798
2822
|
},
|
|
2799
2823
|
setup(e) {
|
|
2800
2824
|
let t = {
|
|
2801
|
-
title:
|
|
2802
|
-
paragraph:
|
|
2803
|
-
image:
|
|
2804
|
-
button:
|
|
2805
|
-
divider:
|
|
2806
|
-
custom:
|
|
2825
|
+
title: Oi,
|
|
2826
|
+
paragraph: li,
|
|
2827
|
+
image: Xr,
|
|
2828
|
+
button: Qn,
|
|
2829
|
+
divider: Ar,
|
|
2830
|
+
custom: Or
|
|
2807
2831
|
}, a = e, { t: o } = Y(), c = rt(J, "SectionBlock"), l = n(ct, null), d = n(vt, null), p = n(st, {}), m = n(_t, null);
|
|
2808
2832
|
function h(e) {
|
|
2809
2833
|
let t = p.savedBlocks;
|
|
@@ -2839,7 +2863,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2839
2863
|
r[e] = n, c.updateBlock(a.block.id, { children: r });
|
|
2840
2864
|
}
|
|
2841
2865
|
function D(e) {
|
|
2842
|
-
return
|
|
2866
|
+
return di(e, d, t);
|
|
2843
2867
|
}
|
|
2844
2868
|
function O(e, t) {
|
|
2845
2869
|
e.type === "custom" && c.updateBlock(e.id, {
|
|
@@ -2847,7 +2871,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2847
2871
|
dataSourceFetched: t.dataSourceFetched
|
|
2848
2872
|
});
|
|
2849
2873
|
}
|
|
2850
|
-
return (t, n) => (s(), C("div",
|
|
2874
|
+
return (t, n) => (s(), C("div", Ai, [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", {
|
|
2851
2875
|
key: n,
|
|
2852
2876
|
class: b(["tpl:relative tpl:min-h-[60px] tpl:rounded", T(n).length === 0 ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
|
|
2853
2877
|
style: k({ width: x.value ? "100%" : g.value[n] })
|
|
@@ -2856,7 +2880,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2856
2880
|
group: {
|
|
2857
2881
|
name: "blocks",
|
|
2858
2882
|
pull: !0,
|
|
2859
|
-
put: (e, t, n) => _(
|
|
2883
|
+
put: (e, t, n) => _(ki)(n)
|
|
2860
2884
|
},
|
|
2861
2885
|
animation: 150,
|
|
2862
2886
|
"ghost-class": "tpl-ghost",
|
|
@@ -2869,7 +2893,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2869
2893
|
class: "tpl:min-h-[60px]",
|
|
2870
2894
|
"onUpdate:modelValue": (e) => E(n, e)
|
|
2871
2895
|
}, {
|
|
2872
|
-
default: i(() => [(s(!0), C(L, null, r(T(n), (t) => f((s(), C("div", { key: t.id }, [v(
|
|
2896
|
+
default: i(() => [(s(!0), C(L, null, r(T(n), (t) => f((s(), C("div", { key: t.id }, [v(Ei, {
|
|
2873
2897
|
block: t,
|
|
2874
2898
|
"is-selected": _(c).state.selectedBlockId === t.id,
|
|
2875
2899
|
viewport: e.viewport,
|
|
@@ -2901,13 +2925,13 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2901
2925
|
"model-value",
|
|
2902
2926
|
"group",
|
|
2903
2927
|
"onUpdate:modelValue"
|
|
2904
|
-
]), T(n).length === 0 ? (s(), C("div",
|
|
2928
|
+
]), T(n).length === 0 ? (s(), C("div", ji, [M("span", null, R(_(o).section.dropHere), 1)])) : w("", !0)], 6))), 128))], 2)]));
|
|
2905
2929
|
}
|
|
2906
|
-
}),
|
|
2930
|
+
}), Ni = ye, Pi = {
|
|
2907
2931
|
small: 24,
|
|
2908
2932
|
medium: 32,
|
|
2909
2933
|
large: 48
|
|
2910
|
-
},
|
|
2934
|
+
}, Fi = [
|
|
2911
2935
|
"facebook",
|
|
2912
2936
|
"twitter",
|
|
2913
2937
|
"instagram",
|
|
@@ -2925,11 +2949,11 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2925
2949
|
"github",
|
|
2926
2950
|
"dribbble",
|
|
2927
2951
|
"behance"
|
|
2928
|
-
],
|
|
2952
|
+
], Ii = [
|
|
2929
2953
|
"width",
|
|
2930
2954
|
"height",
|
|
2931
2955
|
"fill"
|
|
2932
|
-
],
|
|
2956
|
+
], Li = ["d"], Ri = /* @__PURE__ */ d({
|
|
2933
2957
|
__name: "SocialIconSvg",
|
|
2934
2958
|
props: {
|
|
2935
2959
|
platform: {},
|
|
@@ -2937,7 +2961,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2937
2961
|
iconSize: {}
|
|
2938
2962
|
},
|
|
2939
2963
|
setup(e) {
|
|
2940
|
-
let t = e, n = S(() =>
|
|
2964
|
+
let t = e, n = S(() => Ni[t.platform]), r = S(() => Pi[t.iconSize]), i = S(() => {
|
|
2941
2965
|
let e = {
|
|
2942
2966
|
display: "inline-flex",
|
|
2943
2967
|
alignItems: "center",
|
|
@@ -2981,12 +3005,12 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2981
3005
|
viewBox: "0 0 24 24",
|
|
2982
3006
|
fill: o.value,
|
|
2983
3007
|
xmlns: "http://www.w3.org/2000/svg"
|
|
2984
|
-
}, [M("path", { d: n.value.path }, null, 8,
|
|
3008
|
+
}, [M("path", { d: n.value.path }, null, 8, Li)], 8, Ii))], 4));
|
|
2985
3009
|
}
|
|
2986
|
-
}),
|
|
3010
|
+
}), zi = { class: "tpl:w-full" }, Bi = ["href"], Vi = {
|
|
2987
3011
|
key: 1,
|
|
2988
3012
|
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)]"
|
|
2989
|
-
},
|
|
3013
|
+
}, Hi = /* @__PURE__ */ d({
|
|
2990
3014
|
__name: "SocialIconsBlock",
|
|
2991
3015
|
props: {
|
|
2992
3016
|
block: {},
|
|
@@ -2999,7 +3023,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
2999
3023
|
gap: `${t.block.spacing}px`,
|
|
3000
3024
|
justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
|
|
3001
3025
|
})), a = S(() => t.block.icons.length > 0);
|
|
3002
|
-
return (t, o) => (s(), C("div",
|
|
3026
|
+
return (t, o) => (s(), C("div", zi, [a.value ? (s(), C("div", {
|
|
3003
3027
|
key: 0,
|
|
3004
3028
|
style: k(i.value)
|
|
3005
3029
|
}, [(s(!0), C(L, null, r(e.block.icons, (t) => (s(), C("a", {
|
|
@@ -3007,7 +3031,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3007
3031
|
href: t.url || "#",
|
|
3008
3032
|
class: "tpl:cursor-default",
|
|
3009
3033
|
onClick: o[0] ||= O(() => {}, ["prevent"])
|
|
3010
|
-
}, [v(
|
|
3034
|
+
}, [v(Ri, {
|
|
3011
3035
|
platform: t.platform,
|
|
3012
3036
|
"icon-style": e.block.iconStyle,
|
|
3013
3037
|
"icon-size": e.block.iconSize
|
|
@@ -3015,16 +3039,16 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3015
3039
|
"platform",
|
|
3016
3040
|
"icon-style",
|
|
3017
3041
|
"icon-size"
|
|
3018
|
-
])], 8,
|
|
3042
|
+
])], 8, Bi))), 128))], 4)) : (s(), C("div", Vi, [v(_(kt), { size: 16 }), M("span", null, R(_(n).social.addIcons), 1)]))]));
|
|
3019
3043
|
}
|
|
3020
|
-
}),
|
|
3044
|
+
}), Ui = { class: "tpl:w-full" }, Wi = {
|
|
3021
3045
|
key: 0,
|
|
3022
3046
|
class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
|
|
3023
3047
|
style: {
|
|
3024
3048
|
"background-color": "var(--tpl-bg-hover)",
|
|
3025
3049
|
color: "var(--tpl-text-dim)"
|
|
3026
3050
|
}
|
|
3027
|
-
},
|
|
3051
|
+
}, Gi = /* @__PURE__ */ d({
|
|
3028
3052
|
__name: "SpacerBlock",
|
|
3029
3053
|
props: {
|
|
3030
3054
|
block: {},
|
|
@@ -3036,23 +3060,23 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3036
3060
|
minHeight: `${t.block.height}px`,
|
|
3037
3061
|
...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
|
|
3038
3062
|
}));
|
|
3039
|
-
return (t, i) => (s(), C("div",
|
|
3063
|
+
return (t, i) => (s(), C("div", Ui, [M("div", {
|
|
3040
3064
|
style: k(r.value),
|
|
3041
3065
|
class: b(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:border-y tpl:border-dashed": !_(n).state.previewMode }])
|
|
3042
|
-
}, [_(n).state.previewMode ? w("", !0) : (s(), C("span",
|
|
3066
|
+
}, [_(n).state.previewMode ? w("", !0) : (s(), C("span", Wi, R(e.block.height) + "px ", 1))], 6)]));
|
|
3043
3067
|
}
|
|
3044
|
-
}),
|
|
3068
|
+
}), Ki = { class: "tpl:w-full" }, qi = { key: 0 }, Ji = [
|
|
3045
3069
|
"aria-label",
|
|
3046
3070
|
"data-placeholder",
|
|
3047
3071
|
"onBlur"
|
|
3048
|
-
],
|
|
3072
|
+
], Yi = [
|
|
3049
3073
|
"aria-label",
|
|
3050
3074
|
"data-placeholder",
|
|
3051
3075
|
"onBlur"
|
|
3052
|
-
],
|
|
3076
|
+
], Xi = {
|
|
3053
3077
|
key: 1,
|
|
3054
3078
|
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)]"
|
|
3055
|
-
},
|
|
3079
|
+
}, Zi = /*#__PURE__*/ Jt(/* @__PURE__ */ d({
|
|
3056
3080
|
__name: "TableBlock",
|
|
3057
3081
|
props: {
|
|
3058
3082
|
block: {},
|
|
@@ -3097,11 +3121,11 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3097
3121
|
} : n);
|
|
3098
3122
|
a.updateBlock(n.block.id, { rows: o });
|
|
3099
3123
|
}
|
|
3100
|
-
return (e, n) => (s(), C("div",
|
|
3124
|
+
return (e, n) => (s(), C("div", Ki, [o.value ? (s(), C("table", {
|
|
3101
3125
|
key: 0,
|
|
3102
3126
|
style: k(c.value),
|
|
3103
3127
|
class: "tpl-table-editable"
|
|
3104
|
-
}, [d.value ? (s(), C("thead",
|
|
3128
|
+
}, [d.value ? (s(), C("thead", qi, [M("tr", null, [(s(!0), C(L, null, r(d.value.cells, (e) => f((s(), C("th", {
|
|
3105
3129
|
key: e.id,
|
|
3106
3130
|
style: k(u.value),
|
|
3107
3131
|
"aria-label": _(i).table.cellPlaceholder,
|
|
@@ -3110,7 +3134,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3110
3134
|
onBlur: (t) => h(d.value.id, e.id, t),
|
|
3111
3135
|
onKeydown: n[0] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3112
3136
|
onClick: O(m, ["stop"])
|
|
3113
|
-
}, null, 44,
|
|
3137
|
+
}, null, 44, Ji)), [[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", {
|
|
3114
3138
|
key: r.id,
|
|
3115
3139
|
style: k(l.value),
|
|
3116
3140
|
"aria-label": _(i).table.cellPlaceholder,
|
|
@@ -3119,9 +3143,9 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3119
3143
|
onBlur: (t) => h(e.id, r.id, t),
|
|
3120
3144
|
onKeydown: n[1] ||= y(O((e) => e.target.blur(), ["prevent"]), ["enter"]),
|
|
3121
3145
|
onClick: O(m, ["stop"])
|
|
3122
|
-
}, null, 44,
|
|
3146
|
+
}, null, 44, Yi)), [[t, r.content]])), 128))]))), 128))])], 4)) : (s(), C("div", Xi, [v(_(Wt), { size: 16 }), M("span", null, R(_(i).table.empty), 1)]))]));
|
|
3123
3147
|
}
|
|
3124
|
-
}), [["__scopeId", "data-v-963ac422"]]),
|
|
3148
|
+
}), [["__scopeId", "data-v-963ac422"]]), Qi = /* @__PURE__ */ d({
|
|
3125
3149
|
__name: "VideoPlayButton",
|
|
3126
3150
|
props: { hoverEffect: {
|
|
3127
3151
|
type: Boolean,
|
|
@@ -3139,7 +3163,7 @@ var Oi = { class: "tpl:w-full" }, ki = {
|
|
|
3139
3163
|
});
|
|
3140
3164
|
//#endregion
|
|
3141
3165
|
//#region src/utils/videoThumbnail.ts
|
|
3142
|
-
function
|
|
3166
|
+
function $i(e) {
|
|
3143
3167
|
if (!e) return {
|
|
3144
3168
|
platform: "unknown",
|
|
3145
3169
|
videoId: null,
|
|
@@ -3171,25 +3195,25 @@ function Zi(e) {
|
|
|
3171
3195
|
thumbnailUrl: null
|
|
3172
3196
|
};
|
|
3173
3197
|
}
|
|
3174
|
-
function
|
|
3175
|
-
return t ||
|
|
3198
|
+
function ea(e, t) {
|
|
3199
|
+
return t || $i(e).thumbnailUrl;
|
|
3176
3200
|
}
|
|
3177
3201
|
//#endregion
|
|
3178
3202
|
//#region src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
|
|
3179
|
-
var
|
|
3203
|
+
var ta = ["src", "alt"], na = {
|
|
3180
3204
|
class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
|
|
3181
3205
|
style: { opacity: "0.7" }
|
|
3182
|
-
},
|
|
3206
|
+
}, ra = ["href"], ia = ["src", "alt"], aa = ["src", "alt"], oa = {
|
|
3183
3207
|
key: 3,
|
|
3184
3208
|
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)]"
|
|
3185
|
-
},
|
|
3209
|
+
}, sa = /* @__PURE__ */ d({
|
|
3186
3210
|
__name: "VideoBlock",
|
|
3187
3211
|
props: {
|
|
3188
3212
|
block: {},
|
|
3189
3213
|
viewport: {}
|
|
3190
3214
|
},
|
|
3191
3215
|
setup(e) {
|
|
3192
|
-
let t = e, { t: n } = Y(), { syntax: r } = Q(), i = S(() => U(t.block.url, r) || U(t.block.thumbnailUrl, r)), a =
|
|
3216
|
+
let t = e, { t: n } = Y(), { syntax: r } = Q(), i = S(() => U(t.block.url, r) || U(t.block.thumbnailUrl, r)), a = Tn(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = Tn(() => i.value ? t.block.placeholderUrl : void 0), c = S(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : ea(t.block.url)), l = S(() => ({ textAlign: t.block.align })), u = S(() => {
|
|
3193
3217
|
let e = t.block.align;
|
|
3194
3218
|
return {
|
|
3195
3219
|
maxWidth: "100%",
|
|
@@ -3212,16 +3236,16 @@ var $i = ["src", "alt"], ea = {
|
|
|
3212
3236
|
src: _(o),
|
|
3213
3237
|
alt: e.block.alt,
|
|
3214
3238
|
style: k(d.value)
|
|
3215
|
-
}, null, 12,
|
|
3239
|
+
}, null, 12, ta), v(Qi)], 4)) : i.value ? (s(), C("div", {
|
|
3216
3240
|
key: 1,
|
|
3217
3241
|
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)]",
|
|
3218
3242
|
style: k([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
|
|
3219
|
-
}, [v(_(
|
|
3243
|
+
}, [v(_(Bt), {
|
|
3220
3244
|
size: 36,
|
|
3221
3245
|
"stroke-width": 1.5,
|
|
3222
3246
|
class: "tpl:text-[var(--tpl-primary)]",
|
|
3223
3247
|
style: { opacity: "0.5" }
|
|
3224
|
-
}), M("span",
|
|
3248
|
+
}), M("span", na, [v(Xn, { text: f.value }, null, 8, ["text"])])], 4)) : c.value ? (s(), C(L, { key: 2 }, [e.block.url ? (s(), C("a", {
|
|
3225
3249
|
key: 0,
|
|
3226
3250
|
href: e.block.url,
|
|
3227
3251
|
target: "_blank",
|
|
@@ -3234,7 +3258,7 @@ var $i = ["src", "alt"], ea = {
|
|
|
3234
3258
|
src: c.value,
|
|
3235
3259
|
alt: e.block.alt,
|
|
3236
3260
|
style: k(d.value)
|
|
3237
|
-
}, null, 12,
|
|
3261
|
+
}, null, 12, ia), v(Qi, { "hover-effect": "" })], 12, ra)) : (s(), C("div", {
|
|
3238
3262
|
key: 1,
|
|
3239
3263
|
class: "tpl:relative tpl:inline-block",
|
|
3240
3264
|
style: k(u.value)
|
|
@@ -3243,51 +3267,51 @@ var $i = ["src", "alt"], ea = {
|
|
|
3243
3267
|
src: c.value,
|
|
3244
3268
|
alt: e.block.alt,
|
|
3245
3269
|
style: k(d.value)
|
|
3246
|
-
}, null, 12,
|
|
3270
|
+
}, null, 12, aa), v(Qi)], 4))], 64)) : (s(), C("div", oa, [v(_(Bt), {
|
|
3247
3271
|
size: 40,
|
|
3248
3272
|
"stroke-width": 1.5,
|
|
3249
3273
|
class: "tpl:text-[var(--tpl-border-light)]"
|
|
3250
3274
|
}), M("span", null, R(_(n).video.addVideo), 1)]))], 4));
|
|
3251
3275
|
}
|
|
3252
|
-
}),
|
|
3253
|
-
section:
|
|
3254
|
-
title:
|
|
3255
|
-
paragraph:
|
|
3256
|
-
image:
|
|
3257
|
-
button:
|
|
3258
|
-
divider:
|
|
3259
|
-
video:
|
|
3260
|
-
social:
|
|
3261
|
-
menu:
|
|
3262
|
-
table:
|
|
3263
|
-
spacer:
|
|
3264
|
-
html:
|
|
3276
|
+
}), ca = {
|
|
3277
|
+
section: Mi,
|
|
3278
|
+
title: Oi,
|
|
3279
|
+
paragraph: li,
|
|
3280
|
+
image: Xr,
|
|
3281
|
+
button: Qn,
|
|
3282
|
+
divider: Ar,
|
|
3283
|
+
video: sa,
|
|
3284
|
+
social: Hi,
|
|
3285
|
+
menu: ei,
|
|
3286
|
+
table: Zi,
|
|
3287
|
+
spacer: Gi,
|
|
3288
|
+
html: Ir,
|
|
3265
3289
|
countdown: B(() => import("./CountdownBlock-_7TUBqJS.js"))
|
|
3266
3290
|
};
|
|
3267
|
-
function
|
|
3291
|
+
function la(e) {
|
|
3268
3292
|
let { editor: n, config: r, translations: i, fontsManager: a } = e, { t: s, format: u } = Y(i);
|
|
3269
3293
|
n.setUiTheme(r.uiTheme ?? "auto");
|
|
3270
|
-
let { resolvedTheme: d } =
|
|
3294
|
+
let { resolvedTheme: d } = Nn(S(() => n.state.uiTheme)), f = l(r.theme ?? {}), { themeStyles: p } = Fn({
|
|
3271
3295
|
themeOverrides: f,
|
|
3272
3296
|
resolvedTheme: d,
|
|
3273
3297
|
extraStyles: () => ({
|
|
3274
3298
|
"--tpl-drop-text": `"${i.canvas.dropHere}"`,
|
|
3275
3299
|
...e.themeExtraStyles?.()
|
|
3276
3300
|
})
|
|
3277
|
-
}), m =
|
|
3301
|
+
}), m = an({
|
|
3278
3302
|
content: n.content,
|
|
3279
3303
|
setContent: (e, t) => n.setContent(e, t),
|
|
3280
3304
|
...e.historyOptions
|
|
3281
3305
|
});
|
|
3282
|
-
|
|
3283
|
-
let g =
|
|
3306
|
+
fn(n, m);
|
|
3307
|
+
let g = sn({
|
|
3284
3308
|
addBlock: n.addBlock,
|
|
3285
3309
|
removeBlock: n.removeBlock,
|
|
3286
3310
|
updateBlock: n.updateBlock,
|
|
3287
3311
|
selectBlock: n.selectBlock,
|
|
3288
3312
|
findBlockLocation: n.findBlockLocation,
|
|
3289
3313
|
blockDefaults: r.blockDefaults
|
|
3290
|
-
}), _ =
|
|
3314
|
+
}), _ = un(n), v = e.autoSaveOptions !== null && e.autoSaveOptions !== void 0 ? ln({
|
|
3291
3315
|
content: n.content,
|
|
3292
3316
|
isDirty: () => n.state.isDirty,
|
|
3293
3317
|
...e.autoSaveOptions
|
|
@@ -3295,25 +3319,25 @@ function sa(e) {
|
|
|
3295
3319
|
v && (y = t(m.isNavigating, (e) => {
|
|
3296
3320
|
e ? v.pause() : v.resume();
|
|
3297
3321
|
}));
|
|
3298
|
-
let b =
|
|
3322
|
+
let b = Mn(n, {
|
|
3299
3323
|
t: s,
|
|
3300
3324
|
format: u
|
|
3301
3325
|
}, r.customBlocks ?? []), x = Dt(r.colors);
|
|
3302
3326
|
if (x.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."), x.invalidPresets.length > 0 && X.warn(`config.colors.presets skipped invalid entries: ${x.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), x.allowCustom === !1) {
|
|
3303
|
-
let e =
|
|
3327
|
+
let e = Wn(x.presets, r.blockDefaults, r.templateDefaults);
|
|
3304
3328
|
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.`);
|
|
3305
3329
|
}
|
|
3306
|
-
let C =
|
|
3307
|
-
|
|
3330
|
+
let C = In();
|
|
3331
|
+
Vn(C, ca);
|
|
3308
3332
|
let w = /* @__PURE__ */ new Set();
|
|
3309
3333
|
function T(e) {
|
|
3310
3334
|
for (let t of e) {
|
|
3311
|
-
C.registerCustom(t,
|
|
3312
|
-
for (let e of
|
|
3335
|
+
C.registerCustom(t, Or);
|
|
3336
|
+
for (let e of Kn(t, x)) w.has(e.id) || (w.add(e.id), X.warn(e.message));
|
|
3313
3337
|
}
|
|
3314
3338
|
}
|
|
3315
3339
|
r.customBlocks?.length && T(r.customBlocks);
|
|
3316
|
-
let E =
|
|
3340
|
+
let E = xn();
|
|
3317
3341
|
if (o() && h(E.dispose), e.containerEl) {
|
|
3318
3342
|
let t = e.containerEl;
|
|
3319
3343
|
G(document, "pointerdown", (e) => {
|
|
@@ -3330,7 +3354,7 @@ function sa(e) {
|
|
|
3330
3354
|
v?.flush();
|
|
3331
3355
|
}
|
|
3332
3356
|
function O(t) {
|
|
3333
|
-
E.isActive() &&
|
|
3357
|
+
E.isActive() && Jn(t, {
|
|
3334
3358
|
history: m,
|
|
3335
3359
|
selectBlock: (e) => n.selectBlock(e),
|
|
3336
3360
|
getSelectedBlockId: () => n.state.selectedBlockId,
|
|
@@ -3344,12 +3368,12 @@ function sa(e) {
|
|
|
3344
3368
|
}
|
|
3345
3369
|
G(document, "keydown", O);
|
|
3346
3370
|
let k = l(null);
|
|
3347
|
-
c(ut, e.editorRoot ?? document), c(et, k), c(nt, i), c(J, n), c(bt, m), c(at, g), c(ct, _), c(it, a), c(We, p), c(Ye, d), c(ht, r.blockDefaults), c(vt, C), c(lt, r.customBlocks ?? []), c(Qe, r.paletteBlocks), c(Ct,
|
|
3371
|
+
c(ut, e.editorRoot ?? document), c(et, k), c(nt, i), c(J, n), c(bt, m), c(at, g), c(ct, _), c(it, a), c(We, p), c(Ye, d), c(ht, r.blockDefaults), c(vt, C), c(lt, r.customBlocks ?? []), c(Qe, r.paletteBlocks), c(Ct, Hn(r.htmlBlockPreview)), c(yt, x), c(gt, Ln(n.content, C));
|
|
3348
3372
|
let A = Se(r.mergeTags?.syntax);
|
|
3349
3373
|
c(K, r.mergeTags?.tags ?? []), c(ft, A), c(Ze, r.mergeTags?.onRequest ?? null), c(qe, r.mergeTags?.autocomplete !== !1);
|
|
3350
3374
|
let j = l(Ne(r.mergeTags?.tags ?? []));
|
|
3351
3375
|
c($e, j);
|
|
3352
|
-
let M =
|
|
3376
|
+
let M = Cn({
|
|
3353
3377
|
resolvePreview: r.resolvePreview,
|
|
3354
3378
|
getContent: () => n.content.value,
|
|
3355
3379
|
isActive: () => n.state.previewMode
|
|
@@ -3357,9 +3381,9 @@ function sa(e) {
|
|
|
3357
3381
|
c(Je, M), c(Xe, r.resolvePreview);
|
|
3358
3382
|
let N = S(() => !(n.state.previewMode && M.isConfigured));
|
|
3359
3383
|
c(_t, N);
|
|
3360
|
-
let P =
|
|
3361
|
-
c(Ke, P), c(Ge, r.logicTags?.tags ?? []), c(tt, r.logicTags?.pairs ?? []), c(Ue, r.logicTags?.onRequest ?? null), c(xt,
|
|
3362
|
-
let F =
|
|
3384
|
+
let P = En();
|
|
3385
|
+
c(Ke, P), c(Ge, r.logicTags?.tags ?? []), c(tt, r.logicTags?.pairs ?? []), c(Ue, r.logicTags?.onRequest ?? null), c(xt, Dn()), c(dt, r.onRequestMedia ?? null), c(ot, r.resolveImageUrl ? wn(r.resolveImageUrl) : null), c(pt, r.displayConditions?.conditions ?? []), c(mt, r.displayConditions?.allowCustom ?? !1), c(st, e.capabilities ?? {}), c(St, b);
|
|
3386
|
+
let F = On(r.lint) ? null : kn({
|
|
3363
3387
|
content: n.content,
|
|
3364
3388
|
options: r.lint ?? {},
|
|
3365
3389
|
updateBlock: n.updateBlock,
|
|
@@ -3392,6 +3416,6 @@ function sa(e) {
|
|
|
3392
3416
|
};
|
|
3393
3417
|
}
|
|
3394
3418
|
//#endregion
|
|
3395
|
-
export {
|
|
3419
|
+
export { jn as A, en as B, ur as C, tr as D, rr as E, gn as F, hn as I, pn as L, Cn as M, vn as N, Qn as O, _n as P, dn as R, hr as S, ir as T, Ir as _, Hi as a, yr as b, Oi as c, ui as d, di as f, Rr as g, Xr as h, Gi as i, An as j, Gn as k, Ei as l, ei as m, sa as n, Fi as o, li as p, Zi as r, Mi as s, la as t, fi as u, Ar as v, lr as w, _r as x, Or as y, cn as z };
|
|
3396
3420
|
|
|
3397
|
-
//# sourceMappingURL=useEditorCore-
|
|
3421
|
+
//# sourceMappingURL=useEditorCore-Dq5gdn5i.js.map
|