@templatical/editor 0.33.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiChatSidebar-J7WsHRDS.js → AiChatSidebar-CkHJ28sf.js} +3 -3
- package/dist/{AiFeatureMenu-C9mxL_7U.js → AiFeatureMenu-DWdKguDN.js} +3 -3
- package/dist/{BlockIssueBadge-BI6v_eol.js → BlockIssueBadge-DcyHTAqw.js} +2 -2
- package/dist/{BlockPreviewCanvas-mZIr9mY2.js → BlockPreviewCanvas-B621ANn9.js} +4 -4
- package/dist/{CloudHeaderExtras-CLtTtK12.js → CloudHeaderExtras-BJ3Cebhv.js} +2 -2
- package/dist/{CloudPanels-BbLAX1jH.js → CloudPanels-BGz9ygo6.js} +6 -6
- package/dist/{CollaboratorBar-OBbLOhLK.js → CollaboratorBar-KphmSQeZ.js} +2 -2
- package/dist/{ColorPicker-Cs7iK01u.js → ColorPicker-C6EOwtHC.js} +5 -5
- package/dist/{CommentsPanel-G_uNzi1a.js → CommentsPanel-DmWh8f08.js} +1 -1
- package/dist/{CommentsSidebar-DlFlpfkU.js → CommentsSidebar-CL_tffzT.js} +4 -4
- package/dist/{CountdownBlock-Bdt8qZi1.js → CountdownBlock-D1fsNsyS.js} +1 -1
- package/dist/{CountdownToolbar-BWLYViOm.js → CountdownToolbar-B8J4i5Xp.js} +2 -2
- package/dist/{DesignReferenceSidebar-CK_xTLh2.js → DesignReferenceSidebar-BDhEeaAh.js} +4 -4
- package/dist/{IssuesPanel-DIbJ_jaa.js → IssuesPanel-CiOjeRFI.js} +4 -4
- package/dist/MergeTagInput-RytOlh1A.js +448 -0
- package/dist/{MergeTagModeToggle-DeI65T5k.js → MergeTagModeToggle-Bi-FydXj.js} +2 -2
- package/dist/{ParagraphEditor-Dr-u72hu.js → ParagraphEditor-C87tkmtE.js} +12 -12
- package/dist/{RestoreVersionDialog-6sBYYt9f.js → RestoreVersionDialog-Db5rZRMA.js} +2 -2
- package/dist/RichTextEditorContent-BmTcV2-a.js +152 -0
- package/dist/{SaveBlockDialog-DABN4-Jf.js → SaveBlockDialog-CDCzx6Bo.js} +16 -16
- package/dist/{SavedBlocksBrowserModal-BoylzTEq.js → SavedBlocksBrowserModal-DQR6kJB1.js} +101 -101
- package/dist/{SavedBlocksPanels-2np4Yu1H.js → SavedBlocksPanels-DFzV0CRD.js} +1 -1
- package/dist/{SavedBlocksPickBar-BM7aTSK2.js → SavedBlocksPickBar-XyXmnSnO.js} +2 -2
- package/dist/{TemplateScoringPanel-CzWoSM1V.js → TemplateScoringPanel-CpyEKMzC.js} +4 -4
- package/dist/{TestEmailModal-Cb0n7Dhj.js → TestEmailModal-DIfJy9eE.js} +8 -8
- package/dist/{TestEmailPanel-52HjvuU7.js → TestEmailPanel-C8Wx5yPS.js} +1 -1
- package/dist/{TitleEditor-_taBpBfB.js → TitleEditor-iNFOisr4.js} +11 -11
- package/dist/{TplModal-CEYnwBBk.js → TplModal-CowM3o_F.js} +5 -5
- package/dist/{VersionHistoryMenu-CsGlLSO8.js → VersionHistoryMenu-CV90OhXs.js} +2 -2
- package/dist/{VersionHistoryPanels-DPmYk00L.js → VersionHistoryPanels-BE3pplJG.js} +1 -1
- package/dist/{VersionPreviewBanner-VGJbEoXj.js → VersionPreviewBanner-BwUWBtlH.js} +1 -1
- package/dist/{blockTypeIcons-IhdBwbxp.js → blockTypeIcons-DQsKtHik.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{AiChatSidebar-6S5LPyRW.js → AiChatSidebar-BEnIWn6s.js} +4 -4
- package/dist/cdn/chunks/AiChatSidebar-BEnIWn6s.js.map +1 -0
- package/dist/cdn/chunks/{AiFeatureMenu-BHCtjIfV.js → AiFeatureMenu-DMl23akc.js} +4 -4
- package/dist/cdn/chunks/{AiFeatureMenu-BHCtjIfV.js.map → AiFeatureMenu-DMl23akc.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-2-os120N.js → BlockIssueBadge-CloK4k3M.js} +3 -3
- package/dist/cdn/chunks/{BlockIssueBadge-2-os120N.js.map → BlockIssueBadge-CloK4k3M.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-CYNs-Yn-.js → BlockPreviewCanvas-DSiJFJa0.js} +5 -5
- package/dist/cdn/chunks/{BlockPreviewCanvas-CYNs-Yn-.js.map → BlockPreviewCanvas-DSiJFJa0.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-DrbFk6Fy.js → CloudHeaderExtras-b4KpVeUN.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-DrbFk6Fy.js.map → CloudHeaderExtras-b4KpVeUN.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CpzYrAPQ.js → CloudPanels-DzwOq9lp.js} +7 -7
- package/dist/cdn/chunks/CloudPanels-DzwOq9lp.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-VMTCYn_z.js → CollaboratorBar-WXKvpoGK.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-VMTCYn_z.js.map → CollaboratorBar-WXKvpoGK.js.map} +1 -1
- package/dist/cdn/chunks/{ColorPicker-B0l_UF8G.js → ColorPicker-BubTDiS1.js} +6 -6
- package/dist/cdn/chunks/{ColorPicker-B0l_UF8G.js.map → ColorPicker-BubTDiS1.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-CXMMdLrO.js → CommentsPanel-DAA2VqX4.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-CXMMdLrO.js.map → CommentsPanel-DAA2VqX4.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-CGkhAJUW.js → CommentsSidebar-Ci0M2ePp.js} +5 -5
- package/dist/cdn/chunks/CommentsSidebar-Ci0M2ePp.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-CPe1ulzk.js → CountdownBlock-rK055jpy.js} +2 -2
- package/dist/cdn/chunks/{CountdownBlock-CPe1ulzk.js.map → CountdownBlock-rK055jpy.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-D5xyNd5V.js → CountdownToolbar-CzZq26Vp.js} +3 -3
- package/dist/cdn/chunks/{CountdownToolbar-D5xyNd5V.js.map → CountdownToolbar-CzZq26Vp.js.map} +1 -1
- package/dist/cdn/chunks/{DesignReferenceSidebar-D1NH1WRv.js → DesignReferenceSidebar-C_ehdX5C.js} +5 -5
- package/dist/cdn/chunks/DesignReferenceSidebar-C_ehdX5C.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-07SBSZVN.js → IssuesPanel-BXAN2_al.js} +5 -5
- package/dist/cdn/chunks/{IssuesPanel-07SBSZVN.js.map → IssuesPanel-BXAN2_al.js.map} +1 -1
- package/dist/cdn/chunks/MergeTagInput-1vcI9uQH.js +419 -0
- package/dist/cdn/chunks/MergeTagInput-1vcI9uQH.js.map +1 -0
- package/dist/cdn/chunks/{MergeTagModeToggle-Bg8eO5nc.js → MergeTagModeToggle-B_mUYJo4.js} +3 -3
- package/dist/cdn/chunks/{MergeTagModeToggle-Bg8eO5nc.js.map → MergeTagModeToggle-B_mUYJo4.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-x2LTi6DN.js → ParagraphEditor-DCDHMcmx.js} +10 -10
- package/dist/cdn/chunks/ParagraphEditor-DCDHMcmx.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog--SjTV0_4.js → RestoreVersionDialog-BkSSwf-Q.js} +3 -3
- package/dist/cdn/chunks/{RestoreVersionDialog--SjTV0_4.js.map → RestoreVersionDialog-BkSSwf-Q.js.map} +1 -1
- package/dist/cdn/chunks/RichTextEditorContent-S4KogjIj.js +122 -0
- package/dist/cdn/chunks/RichTextEditorContent-S4KogjIj.js.map +1 -0
- package/dist/cdn/chunks/{SaveBlockDialog-CS1lqdsQ.js → SaveBlockDialog-BH774Nt0.js} +14 -14
- package/dist/cdn/chunks/{SaveBlockDialog-CS1lqdsQ.js.map → SaveBlockDialog-BH774Nt0.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D6nDZ4rq.js → SavedBlocksBrowserModal-CSUqw_dD.js} +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D6nDZ4rq.js.map → SavedBlocksBrowserModal-CSUqw_dD.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-DdkwvYRR.js → SavedBlocksPanels-B6ApbCjG.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-DdkwvYRR.js.map → SavedBlocksPanels-B6ApbCjG.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-BLQr_6WM.js → SavedBlocksPickBar-C9MXSRcR.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPickBar-BLQr_6WM.js.map → SavedBlocksPickBar-C9MXSRcR.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateScoringPanel-CDC-JC6C.js → TemplateScoringPanel-QVOxc9TZ.js} +50 -50
- package/dist/cdn/chunks/TemplateScoringPanel-QVOxc9TZ.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailModal-B2LcU11Y.js → TestEmailModal-_CZvaO58.js} +9 -9
- package/dist/cdn/chunks/{TestEmailModal-B2LcU11Y.js.map → TestEmailModal-_CZvaO58.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-ByqDSx8B.js → TestEmailPanel-DXLxvyrD.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-ByqDSx8B.js.map → TestEmailPanel-DXLxvyrD.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-DCoulgN8.js → TitleEditor-BuCOahW3.js} +9 -9
- package/dist/cdn/chunks/TitleEditor-BuCOahW3.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CxQDl-tN.js → TplModal-CqY8R3hn.js} +6 -6
- package/dist/cdn/chunks/TplModal-CqY8R3hn.js.map +1 -0
- package/dist/cdn/chunks/{VersionHistoryMenu-BOy8aMB6.js → VersionHistoryMenu-DDjIBvad.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryMenu-BOy8aMB6.js.map → VersionHistoryMenu-DDjIBvad.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BPLhzW9c.js → VersionHistoryPanels-BuTw04T5.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BPLhzW9c.js.map → VersionHistoryPanels-BuTw04T5.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-CYC9qP2i.js → VersionPreviewBanner-fGAv20qI.js} +2 -2
- package/dist/cdn/chunks/{VersionPreviewBanner-CYC9qP2i.js.map → VersionPreviewBanner-fGAv20qI.js.map} +1 -1
- package/dist/cdn/chunks/{createCloudRuntime-CbSqoOba.js → createCloudRuntime-JFE-sxbT.js} +2 -2
- package/dist/cdn/chunks/{createCloudRuntime-CbSqoOba.js.map → createCloudRuntime-JFE-sxbT.js.map} +1 -1
- package/dist/cdn/chunks/{extensions-CeP0iOPC.js → extensions-7z04EIGg.js} +3 -3
- package/dist/cdn/chunks/{extensions-CeP0iOPC.js.map → extensions-7z04EIGg.js.map} +1 -1
- package/dist/cdn/chunks/{keys-O8clwJ41.js → keys-DQp8x7Nx.js} +4 -4
- package/dist/cdn/chunks/{keys-O8clwJ41.js.map → keys-DQp8x7Nx.js.map} +1 -1
- package/dist/cdn/chunks/{src-C1lP5sIe.js → src-CiAi5oRe.js} +2 -2
- package/dist/cdn/chunks/{src-C1lP5sIe.js.map → src-CiAi5oRe.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-ZBEJvkf4.js → useCloudI18n-MxgHWrV6.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-ZBEJvkf4.js.map → useCloudI18n-MxgHWrV6.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorCore-CZxGbZmY.js → useEditorCore-ehUSEsbw.js} +503 -500
- package/dist/cdn/chunks/useEditorCore-ehUSEsbw.js.map +1 -0
- package/dist/cdn/chunks/{useEditorRoot-DVV-EsNI.js → useEditorRoot-CteADR3y.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-DVV-EsNI.js.map → useEditorRoot-CteADR3y.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-DCbvHv6W.js → useI18n-Ct1VIFcf.js} +2 -2
- package/dist/cdn/chunks/{useI18n-DCbvHv6W.js.map → useI18n-Ct1VIFcf.js.map} +1 -1
- package/dist/cdn/chunks/useMergeTag-TLhF2fGK.js +46 -0
- package/dist/cdn/chunks/useMergeTag-TLhF2fGK.js.map +1 -0
- package/dist/cdn/chunks/{usePopoverPosition-Ozg5iU3y.js → usePopoverPosition-BxVWE5_0.js} +2 -2
- package/dist/cdn/chunks/{usePopoverPosition-Ozg5iU3y.js.map → usePopoverPosition-BxVWE5_0.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CrUCYsIc.js → useScrollToBlock-Cz3fpgTK.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-CrUCYsIc.js.map → useScrollToBlock-Cz3fpgTK.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +1672 -2075
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{createCloudRuntime-j6a9Z-vL.js → createCloudRuntime-DbTFm1ES.js} +1 -1
- package/dist/{extensions-5xeZR9U9.js → extensions-Mf8iHey9.js} +2 -2
- package/dist/{keys-BJJ4hJ4z.js → keys-C3P1yxnr.js} +3 -3
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +1835 -2239
- package/dist/{useCloudI18n-DaKcDMDz.js → useCloudI18n-BKoiYsWZ.js} +1 -1
- package/dist/{useEditorCore-BWrxHVKW.js → useEditorCore-DdkQuTHl.js} +1068 -1065
- package/dist/{useEditorRoot-E-oxHaEI.js → useEditorRoot-DkRGTQRs.js} +1 -1
- package/dist/{useI18n-DUVIAju4.js → useI18n-CL6RfPzK.js} +1 -1
- package/dist/useMergeTag-gSuYus-M.js +44 -0
- package/dist/{usePopoverPosition-APlWgXoQ.js → usePopoverPosition-CWxaIWd3.js} +1 -1
- package/dist/{useScrollToBlock--AzCOzlg.js → useScrollToBlock-CdI8fGqt.js} +1 -1
- package/package.json +7 -7
- package/dist/RichTextEditorContent-DKLVe6Io.js +0 -153
- package/dist/cdn/chunks/AiChatSidebar-6S5LPyRW.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-CpzYrAPQ.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-CGkhAJUW.js.map +0 -1
- package/dist/cdn/chunks/DesignReferenceSidebar-D1NH1WRv.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-x2LTi6DN.js.map +0 -1
- package/dist/cdn/chunks/RichTextEditorContent-CzdMJ1c9.js +0 -123
- package/dist/cdn/chunks/RichTextEditorContent-CzdMJ1c9.js.map +0 -1
- package/dist/cdn/chunks/TemplateScoringPanel-CDC-JC6C.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-DCoulgN8.js.map +0 -1
- package/dist/cdn/chunks/TplModal-CxQDl-tN.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-CZxGbZmY.js.map +0 -1
- package/dist/cdn/chunks/useMergeTag-CbuagYNK.js +0 -46
- package/dist/cdn/chunks/useMergeTag-CbuagYNK.js.map +0 -1
- package/dist/scan-line-E7w4yQyv.js +0 -31
- package/dist/useMergeTag-CuZZeiSE.js +0 -44
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { F as e, Ot as t, P as n, S as r, c as i, d as a, g as o, h as s, i as c, k as l, kt as u, l as d, rt as f, s as p, u as m, v as h, w as g } from "./vue.runtime.esm-bundler-D9JUcKrV.js";
|
|
2
|
+
import { c as _ } from "./runtime-dom.esm-bundler-BuG03jBM.js";
|
|
3
|
+
import { K as v, U as y, h as b } from "./keys-C3P1yxnr.js";
|
|
4
|
+
import { t as x } from "./useI18n-CL6RfPzK.js";
|
|
5
|
+
import { n as S } from "./usePopoverPosition-CWxaIWd3.js";
|
|
6
|
+
import { t as C } from "./createLucideIcon-Bvw1Zx56.js";
|
|
7
|
+
import { t as w } from "./MergeTagInput-RytOlh1A.js";
|
|
8
|
+
import { t as T } from "./x-DJOd1hS4.js";
|
|
9
|
+
import { t as E } from "./ColorPicker-C6EOwtHC.js";
|
|
10
|
+
var D = C("bold", [["path", {
|
|
11
|
+
d: "M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",
|
|
12
|
+
key: "mg9rjx"
|
|
13
|
+
}]]), O = C("italic", [
|
|
14
|
+
["line", {
|
|
15
|
+
x1: "19",
|
|
16
|
+
x2: "10",
|
|
17
|
+
y1: "4",
|
|
18
|
+
y2: "4",
|
|
19
|
+
key: "15jd3p"
|
|
20
|
+
}],
|
|
21
|
+
["line", {
|
|
22
|
+
x1: "14",
|
|
23
|
+
x2: "5",
|
|
24
|
+
y1: "20",
|
|
25
|
+
y2: "20",
|
|
26
|
+
key: "bu0au3"
|
|
27
|
+
}],
|
|
28
|
+
["line", {
|
|
29
|
+
x1: "15",
|
|
30
|
+
x2: "9",
|
|
31
|
+
y1: "4",
|
|
32
|
+
y2: "20",
|
|
33
|
+
key: "uljnxc"
|
|
34
|
+
}]
|
|
35
|
+
]), k = C("link", [["path", {
|
|
36
|
+
d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",
|
|
37
|
+
key: "1cjeqo"
|
|
38
|
+
}], ["path", {
|
|
39
|
+
d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",
|
|
40
|
+
key: "19qd67"
|
|
41
|
+
}]]), A = ["data-tpl-theme"], j = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:border-[var(--tpl-border)] tpl:px-5 tpl:py-4" }, M = {
|
|
42
|
+
id: "tpl-link-dialog-title",
|
|
43
|
+
class: "tpl:m-0 tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
|
|
44
|
+
}, N = ["aria-label"], P = { class: "tpl:p-5" }, F = { class: "tpl:mb-4 tpl:last:mb-0" }, I = { class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, L = { class: "tpl:mb-4 tpl:last:mb-0" }, R = { class: "tpl:mb-1.5 tpl:block tpl:text-xs tpl:font-medium tpl:tracking-wide tpl:text-[var(--tpl-text-muted)] tpl:uppercase" }, z = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-elevated)] tpl:px-5 tpl:py-4" }, B = { class: "tpl:ml-auto tpl:flex tpl:gap-2" }, V = /* @__PURE__ */ h({
|
|
45
|
+
__name: "RichTextLinkDialog",
|
|
46
|
+
props: /*@__PURE__*/ g({
|
|
47
|
+
visible: { type: Boolean },
|
|
48
|
+
isEditingLink: { type: Boolean }
|
|
49
|
+
}, {
|
|
50
|
+
linkUrl: { required: !0 },
|
|
51
|
+
linkUrlModifiers: {},
|
|
52
|
+
linkColor: { default: "" },
|
|
53
|
+
linkColorModifiers: {},
|
|
54
|
+
dialogRef: { required: !0 },
|
|
55
|
+
dialogRefModifiers: {}
|
|
56
|
+
}),
|
|
57
|
+
emits: /*@__PURE__*/ g([
|
|
58
|
+
"close",
|
|
59
|
+
"insert",
|
|
60
|
+
"remove",
|
|
61
|
+
"keydown"
|
|
62
|
+
], [
|
|
63
|
+
"update:linkUrl",
|
|
64
|
+
"update:linkColor",
|
|
65
|
+
"update:dialogRef"
|
|
66
|
+
]),
|
|
67
|
+
setup(n, { emit: s }) {
|
|
68
|
+
let h = e(n, "linkUrl"), g = e(n, "linkColor"), C = e(n, "dialogRef"), D = s, O = r(y, null), k = r(v, null), V = S(), H = r(b, null), U = p(() => H?.content.value.settings.linkColor || "#2c85de"), { t: W } = x();
|
|
69
|
+
return (e, r) => f(V) ? (l(), d(c, {
|
|
70
|
+
key: 0,
|
|
71
|
+
to: f(V)
|
|
72
|
+
}, [n.visible ? (l(), a("div", {
|
|
73
|
+
key: 0,
|
|
74
|
+
"data-tpl-theme": f(k),
|
|
75
|
+
class: "tpl tpl-link-dialog tpl:fixed tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center",
|
|
76
|
+
style: t(f(O)),
|
|
77
|
+
onClick: r[7] ||= _((e) => D("close"), ["self"])
|
|
78
|
+
}, [i("div", {
|
|
79
|
+
ref: (e) => C.value = e,
|
|
80
|
+
role: "dialog",
|
|
81
|
+
"aria-modal": "true",
|
|
82
|
+
"aria-labelledby": "tpl-link-dialog-title",
|
|
83
|
+
"data-testid": "link-dialog",
|
|
84
|
+
class: "tpl:w-[400px] tpl:overflow-hidden tpl:rounded-lg tpl:border tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:shadow-[var(--tpl-shadow-lg)]"
|
|
85
|
+
}, [
|
|
86
|
+
i("div", j, [i("h4", M, u(n.isEditingLink ? f(W).linkDialog.editLink : f(W).linkDialog.insertLink), 1), i("button", {
|
|
87
|
+
type: "button",
|
|
88
|
+
"aria-label": f(W).linkDialog.cancel,
|
|
89
|
+
class: "tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded tpl:border-none tpl:bg-transparent tpl:p-0 tpl:text-[var(--tpl-text-muted)] tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
90
|
+
onClick: r[0] ||= (e) => D("close")
|
|
91
|
+
}, [o(f(T), {
|
|
92
|
+
size: 16,
|
|
93
|
+
"stroke-width": 2
|
|
94
|
+
})], 8, N)]),
|
|
95
|
+
i("div", P, [i("div", F, [i("label", I, u(f(W).linkDialog.urlLabel), 1), o(w, {
|
|
96
|
+
"model-value": h.value,
|
|
97
|
+
type: "url",
|
|
98
|
+
"data-testid": "link-dialog-url",
|
|
99
|
+
placeholder: f(W).linkDialog.urlPlaceholder,
|
|
100
|
+
"onUpdate:modelValue": r[1] ||= (e) => h.value = e,
|
|
101
|
+
onKeydown: r[2] ||= (e) => D("keydown", e)
|
|
102
|
+
}, null, 8, ["model-value", "placeholder"])]), i("div", L, [i("label", R, u(f(W).linkDialog.colorLabel), 1), o(E, {
|
|
103
|
+
"model-value": g.value,
|
|
104
|
+
"seed-color": U.value,
|
|
105
|
+
"onUpdate:modelValue": r[3] ||= (e) => g.value = e
|
|
106
|
+
}, null, 8, ["model-value", "seed-color"])])]),
|
|
107
|
+
i("div", z, [n.isEditingLink ? (l(), a("button", {
|
|
108
|
+
key: 0,
|
|
109
|
+
type: "button",
|
|
110
|
+
class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-danger)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-danger)] tpl:transition-all tpl:hover:bg-[var(--tpl-danger-light)]",
|
|
111
|
+
onClick: r[4] ||= (e) => D("remove")
|
|
112
|
+
}, u(f(W).linkDialog.removeLink), 1)) : m("", !0), i("div", B, [i("button", {
|
|
113
|
+
type: "button",
|
|
114
|
+
class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border tpl:border-[var(--tpl-border)] tpl:bg-transparent tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:text-[var(--tpl-text-muted)] tpl:transition-all tpl:hover:bg-[var(--tpl-bg-hover)] tpl:hover:text-[var(--tpl-text)]",
|
|
115
|
+
onClick: r[5] ||= (e) => D("close")
|
|
116
|
+
}, u(f(W).linkDialog.cancel), 1), i("button", {
|
|
117
|
+
type: "button",
|
|
118
|
+
class: "tpl:inline-flex tpl:cursor-pointer tpl:items-center tpl:rounded-md tpl:border-none tpl:bg-[var(--tpl-primary)] tpl:px-4 tpl:py-2 tpl:text-[13px] tpl:font-medium tpl:transition-all tpl:hover:bg-[var(--tpl-primary-hover)] tpl:text-[var(--tpl-on-primary)]",
|
|
119
|
+
"data-testid": "link-dialog-submit",
|
|
120
|
+
onClick: r[6] ||= (e) => D("insert")
|
|
121
|
+
}, u(n.isEditingLink ? f(W).linkDialog.updateLink : f(W).linkDialog.insertLink), 1)])])
|
|
122
|
+
], 512)], 12, A)) : m("", !0)], 8, ["to"])) : m("", !0);
|
|
123
|
+
}
|
|
124
|
+
}), H = {
|
|
125
|
+
key: 0,
|
|
126
|
+
class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:p-2"
|
|
127
|
+
}, U = { class: "tpl:animate-pulse tpl:text-[var(--tpl-text-dim)]" }, W = {
|
|
128
|
+
key: 1,
|
|
129
|
+
class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:p-2 tpl:text-center tpl:text-xs tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-text-muted)]"
|
|
130
|
+
}, G = /* @__PURE__ */ h({
|
|
131
|
+
__name: "RichTextEditorContent",
|
|
132
|
+
props: {
|
|
133
|
+
editor: {},
|
|
134
|
+
editorContent: {},
|
|
135
|
+
isLoading: { type: Boolean },
|
|
136
|
+
initError: {}
|
|
137
|
+
},
|
|
138
|
+
emits: ["retry"],
|
|
139
|
+
setup(e, { emit: t }) {
|
|
140
|
+
let r = t, { t: o } = x();
|
|
141
|
+
return (t, c) => e.isLoading ? (l(), a("div", H, [i("div", U, u(f(o).errors.editorLoading), 1)])) : e.initError ? (l(), a("div", W, [s(u(f(o).errors.editorLoadFailed) + " ", 1), i("button", {
|
|
142
|
+
class: "tpl:ml-1 tpl:cursor-pointer tpl:border-none tpl:bg-transparent tpl:p-0 tpl:underline tpl:text-[var(--tpl-primary)]",
|
|
143
|
+
onClick: c[0] ||= (e) => r("retry")
|
|
144
|
+
}, u(f(o).errors.retry), 1)])) : e.editorContent && e.editor ? (l(), d(n(e.editorContent), {
|
|
145
|
+
key: 2,
|
|
146
|
+
editor: e.editor,
|
|
147
|
+
class: "tpl-text-editable tpl:min-h-[1.5em] tpl:rounded tpl:border tpl:border-dashed tpl:border-[var(--tpl-primary)] tpl:p-2"
|
|
148
|
+
}, null, 8, ["editor"])) : m("", !0);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
//#endregion
|
|
152
|
+
export { D as a, O as i, V as n, k as r, G as t };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { B as e, D as t, Dt as n, E as r, L as i, Ot as a, P as o, S as s, X as c, c as l, d as u, g as d, h as f, j as p, k as m, kt as h, l as g, r as _, rt as v, s as y, u as b, v as x, z as S } from "./vue.runtime.esm-bundler-D9JUcKrV.js";
|
|
2
2
|
import { a as C, c as w, s as T } from "./runtime-dom.esm-bundler-BuG03jBM.js";
|
|
3
|
-
import { N as E, Y as
|
|
4
|
-
import {
|
|
5
|
-
import { t as M } from "./useI18n-
|
|
3
|
+
import { N as E, Y as D, c as O } from "./useEditorCore-DdkQuTHl.js";
|
|
4
|
+
import { J as k, f as ee, h as A, z as j } from "./keys-C3P1yxnr.js";
|
|
5
|
+
import { t as M } from "./useI18n-CL6RfPzK.js";
|
|
6
6
|
import { t as te } from "./chevron-down-a-fb_Ijn.js";
|
|
7
7
|
import { t as N } from "./chevron-up-x4l0et_Y.js";
|
|
8
8
|
import { t as P } from "./loader-circle-t-SVgmJ3.js";
|
|
9
9
|
import { v as F } from "./styleConstants-C_YAPdQS.js";
|
|
10
10
|
import { n as I } from "./emailFrameWidth-BmFCN2dp.js";
|
|
11
|
-
import { t as L } from "./TplModal-
|
|
12
|
-
import { t as R } from "./BlockPreviewCanvas-
|
|
11
|
+
import { t as L } from "./TplModal-CowM3o_F.js";
|
|
12
|
+
import { t as R } from "./BlockPreviewCanvas-B621ANn9.js";
|
|
13
13
|
//#region src/components/SavedBlockPreviewRow.vue?vue&type=script&setup=true&lang.ts
|
|
14
14
|
var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relative tpl:min-w-0 tpl:flex-1" }, H = {
|
|
15
15
|
key: 0,
|
|
@@ -26,21 +26,21 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
|
|
|
26
26
|
},
|
|
27
27
|
emits: ["move"],
|
|
28
28
|
setup(e, { emit: n }) {
|
|
29
|
-
let i = e, p = n, { t: _, format: x } = M(), S = s(
|
|
29
|
+
let i = e, p = n, { t: _, format: x } = M(), S = s(ee, []), C = s(A, null), O = y(() => I(C?.content.value.settings)), k = c(null), j = c(null), P = c(1), F = c(null), L = c(!1), G = null, K = y(() => F.value !== null && F.value > W), q = y(() => F.value === null ? null : L.value || !K.value ? F.value : W);
|
|
30
30
|
function J() {
|
|
31
|
-
let e =
|
|
31
|
+
let e = k.value, t = j.value;
|
|
32
32
|
if (!e || !t) return;
|
|
33
33
|
let n = e.clientWidth;
|
|
34
34
|
if (n <= 0) return;
|
|
35
|
-
let r = Math.min(1, n /
|
|
35
|
+
let r = Math.min(1, n / O.value);
|
|
36
36
|
P.value = r, F.value = t.offsetHeight * r;
|
|
37
37
|
}
|
|
38
38
|
t(() => {
|
|
39
|
-
J(), !(typeof ResizeObserver > "u") && (G = new ResizeObserver(() => J()),
|
|
39
|
+
J(), !(typeof ResizeObserver > "u") && (G = new ResizeObserver(() => J()), k.value && G.observe(k.value), j.value && G.observe(j.value));
|
|
40
40
|
}), r(() => {
|
|
41
41
|
G?.disconnect(), G = null;
|
|
42
42
|
});
|
|
43
|
-
let Y = y(() =>
|
|
43
|
+
let Y = y(() => D(i.block, _, S)), X = y(() => x(_.savedBlocks.reorderHandle, {
|
|
44
44
|
block: Y.value,
|
|
45
45
|
position: i.position,
|
|
46
46
|
total: i.total
|
|
@@ -63,14 +63,14 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
|
|
|
63
63
|
})], 40, B), l("div", V, [
|
|
64
64
|
l("div", {
|
|
65
65
|
ref_key: "frameEl",
|
|
66
|
-
ref:
|
|
66
|
+
ref: k,
|
|
67
67
|
class: "tpl:overflow-hidden",
|
|
68
68
|
style: a({ height: q.value === null ? void 0 : `${q.value}px` })
|
|
69
69
|
}, [l("div", {
|
|
70
70
|
ref_key: "contentEl",
|
|
71
|
-
ref:
|
|
71
|
+
ref: j,
|
|
72
72
|
style: a({
|
|
73
|
-
width: `${
|
|
73
|
+
width: `${O.value}px`,
|
|
74
74
|
transform: `scale(${P.value})`,
|
|
75
75
|
transformOrigin: "top left"
|
|
76
76
|
})
|
|
@@ -122,7 +122,7 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
|
|
|
122
122
|
},
|
|
123
123
|
emits: ["close", "saved"],
|
|
124
124
|
setup(t, { emit: r }) {
|
|
125
|
-
let a = t, o = r, { t: x, format: w } = M(), T =
|
|
125
|
+
let a = t, o = r, { t: x, format: w } = M(), T = k(A, "SaveBlockDialog"), E = k(j, "SaveBlockDialog"), te = s(ee, []), N = c(""), I = c(""), R = c(!1), z = c(null), B = c(""), V = c([]), H = y(() => {
|
|
126
126
|
let e = new Map(T.content.value.blocks.map((e) => [e.id, e]));
|
|
127
127
|
return V.value.map((t) => e.get(t)).filter((e) => e !== void 0);
|
|
128
128
|
}), U = y({
|
|
@@ -143,7 +143,7 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
|
|
|
143
143
|
}) : "";
|
|
144
144
|
}
|
|
145
145
|
function Q(e) {
|
|
146
|
-
return
|
|
146
|
+
return D(e, x, te);
|
|
147
147
|
}
|
|
148
148
|
let ge = y(() => H.value.map(Q).join(", "));
|
|
149
149
|
i(() => a.visible, (e) => {
|
|
@@ -214,7 +214,7 @@ var z = ["data-block-id"], B = ["aria-label", "title"], V = { class: "tpl:relati
|
|
|
214
214
|
]),
|
|
215
215
|
l("p", oe, [f(h(v(w)(v(x).savedBlocks.savingCount, { count: H.value.length })) + " ", 1), l("span", se, h(ge.value), 1)]),
|
|
216
216
|
H.value.length > 1 ? (m(), u("p", ce, h(v(x).savedBlocks.reorderHint), 1)) : b("", !0),
|
|
217
|
-
d(v(
|
|
217
|
+
d(v(O), {
|
|
218
218
|
modelValue: U.value,
|
|
219
219
|
"onUpdate:modelValue": i[2] ||= (e) => U.value = e,
|
|
220
220
|
"data-testid": "saved-blocks-reorder-list",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { B as e, Dt as t, L as n, Ot as r, P as i, S as a, T as ee, X as o, _ as te, c as s, d as c, g as l, j as u, k as d, kt as f, l as p, r as m, rt as h, s as g, u as _, v, z as ne } from "./vue.runtime.esm-bundler-D9JUcKrV.js";
|
|
2
2
|
import { a as y, c as b, i as x, s as S } from "./runtime-dom.esm-bundler-BuG03jBM.js";
|
|
3
|
-
import "./useEditorCore-
|
|
4
|
-
import {
|
|
5
|
-
import { t as oe } from "./useI18n-
|
|
6
|
-
import { n as se, r as w, t as T } from "./blockTypeIcons-
|
|
3
|
+
import "./useEditorCore-DdkQuTHl.js";
|
|
4
|
+
import { G as re, J as C, h as ie, z as ae } from "./keys-C3P1yxnr.js";
|
|
5
|
+
import { t as oe } from "./useI18n-CL6RfPzK.js";
|
|
6
|
+
import { n as se, r as w, t as T } from "./blockTypeIcons-DQsKtHik.js";
|
|
7
7
|
import { t as ce } from "./pencil-2qhC-Y4q.js";
|
|
8
8
|
import { t as le } from "./trash-rYMzzHZd.js";
|
|
9
9
|
import { t as ue } from "./x-DJOd1hS4.js";
|
|
10
10
|
import { v as de } from "./styleConstants-C_YAPdQS.js";
|
|
11
11
|
import { t as fe } from "./formatAbsoluteDateTime-DMmop3C-.js";
|
|
12
12
|
import { t as pe } from "./formatRelativeTime-CtUU-QZ8.js";
|
|
13
|
-
import { t as me } from "./TplModal-
|
|
13
|
+
import { t as me } from "./TplModal-CowM3o_F.js";
|
|
14
14
|
//#region src/components/SavedBlocksBrowserModal.vue?vue&type=script&setup=true&lang.ts
|
|
15
15
|
var he = {
|
|
16
16
|
role: "dialog",
|
|
@@ -55,53 +55,53 @@ var he = {
|
|
|
55
55
|
}, Ge = {
|
|
56
56
|
key: 0,
|
|
57
57
|
class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
58
|
-
},
|
|
58
|
+
}, k = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Ke = { class: "tpl:mt-1 tpl:max-w-[220px] tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, qe = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, Je = {
|
|
59
59
|
key: 0,
|
|
60
60
|
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
|
|
61
|
-
},
|
|
61
|
+
}, Ye = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Xe = {
|
|
62
62
|
key: 1,
|
|
63
63
|
class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
|
|
64
|
-
},
|
|
64
|
+
}, Ze = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Qe = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, $e = { class: "tpl:flex tpl:items-center tpl:gap-2" }, et = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, tt = ["value"], nt = { class: "tpl:flex tpl:gap-2" }, rt = ["disabled"], A = /* @__PURE__ */ v({
|
|
65
65
|
__name: "SavedBlocksBrowserModal",
|
|
66
66
|
props: { visible: { type: Boolean } },
|
|
67
67
|
emits: ["close", "insert"],
|
|
68
|
-
setup(v, { emit:
|
|
69
|
-
let
|
|
70
|
-
let e =
|
|
71
|
-
return
|
|
72
|
-
}),
|
|
68
|
+
setup(v, { emit: A }) {
|
|
69
|
+
let it = v, j = A, at = te(() => import("./BlockPreviewCanvas-B621ANn9.js").then((e) => e.n)), { t: M, format: N } = oe(), P = C(ae, "SavedBlocksBrowserModal"), F = C(ie, "SavedBlocksBrowserModal"), ot = a(re, void 0), I = o(""), L = o(""), R = o(null), z = o(null), B = o(null), V = o(""), H = o(""), U = o(null), W = o("end"), G = g(() => {
|
|
70
|
+
let e = I.value.trim().toLowerCase(), t = L.value;
|
|
71
|
+
return P.savedBlocks.value.filter((n) => !(e && !n.name.toLowerCase().includes(e) || t && n.category !== t));
|
|
72
|
+
}), K = g(() => P.isLoading.value && P.savedBlocks.value.length === 0), st = g(() => I.value.trim().length > 0 || L.value !== ""), q = g(() => R.value ? P.savedBlocks.value.find((e) => e.id === R.value) ?? null : null), ct = g(() => {
|
|
73
73
|
let e = [{
|
|
74
74
|
value: "beginning",
|
|
75
|
-
label:
|
|
76
|
-
}], t =
|
|
75
|
+
label: M.savedBlocks.insertAtBeginning
|
|
76
|
+
}], t = F.content.value.blocks;
|
|
77
77
|
for (let n = 0; n < t.length; n++) {
|
|
78
|
-
let r = t[n], i = r.type, a =
|
|
78
|
+
let r = t[n], i = r.type, a = M.blocks[i] ?? r.type;
|
|
79
79
|
e.push({
|
|
80
80
|
value: r.id,
|
|
81
|
-
label: M
|
|
81
|
+
label: N(M.savedBlocks.insertAfterBlock, { block: `${a} ${n + 1}` })
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
84
|
return e.push({
|
|
85
85
|
value: "end",
|
|
86
|
-
label:
|
|
86
|
+
label: M.savedBlocks.insertAtEnd
|
|
87
87
|
}), e;
|
|
88
|
-
}),
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
91
|
-
let e =
|
|
88
|
+
}), lt = g(() => {
|
|
89
|
+
if (W.value === "end") return;
|
|
90
|
+
if (W.value === "beginning") return 0;
|
|
91
|
+
let e = F.content.value.blocks.findIndex((e) => e.id === W.value);
|
|
92
92
|
if (e !== -1) return e + 1;
|
|
93
93
|
});
|
|
94
|
-
n(() =>
|
|
94
|
+
n(() => it.visible, (e) => {
|
|
95
95
|
if (e) {
|
|
96
|
-
|
|
97
|
-
let e =
|
|
96
|
+
I.value = "", L.value = "", R.value = null, z.value = null, B.value = null;
|
|
97
|
+
let e = F.state.selectedBlockId;
|
|
98
98
|
if (e) {
|
|
99
|
-
let t =
|
|
100
|
-
|
|
101
|
-
} else
|
|
99
|
+
let t = F.content.value.blocks.findIndex((t) => t.id === e);
|
|
100
|
+
W.value = t === -1 ? "end" : e;
|
|
101
|
+
} else W.value = "end";
|
|
102
102
|
}
|
|
103
103
|
}, { immediate: !0 });
|
|
104
|
-
function
|
|
104
|
+
function ut(e) {
|
|
105
105
|
let t = [], n = /* @__PURE__ */ new Set();
|
|
106
106
|
for (let r of e.content) if (!n.has(r.type) && T[r.type] && (n.add(r.type), t.push({
|
|
107
107
|
type: r.type,
|
|
@@ -109,40 +109,40 @@ var he = {
|
|
|
109
109
|
})), t.length >= 5) break;
|
|
110
110
|
return t;
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function J(e) {
|
|
113
113
|
let t = new Set(e.content.map((e) => e.type));
|
|
114
114
|
return Math.max(0, t.size - 5);
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function Y(e) {
|
|
117
117
|
let t = e.updatedAt ?? e.createdAt;
|
|
118
|
-
return t ? pe(t,
|
|
118
|
+
return t ? pe(t, M.time, N) ?? "" : "";
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function dt(e) {
|
|
121
121
|
let t = e.updatedAt ?? e.createdAt;
|
|
122
|
-
return t ? fe(t,
|
|
122
|
+
return t ? fe(t, ot) : "";
|
|
123
123
|
}
|
|
124
|
-
async function
|
|
124
|
+
async function ft(e) {
|
|
125
125
|
try {
|
|
126
|
-
await
|
|
126
|
+
await P.remove(e), R.value === e && (R.value = null);
|
|
127
127
|
} finally {
|
|
128
|
-
|
|
128
|
+
z.value = null;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
|
-
async function
|
|
132
|
-
|
|
131
|
+
async function pt(e) {
|
|
132
|
+
P.canUpdateBlock(e) && (B.value = e.id, V.value = e.name, H.value = e.category ?? "", z.value = null, await ee(), U.value?.focus(), U.value?.select());
|
|
133
133
|
}
|
|
134
134
|
function X() {
|
|
135
|
-
|
|
135
|
+
B.value = null, V.value = "", H.value = "";
|
|
136
136
|
}
|
|
137
137
|
async function Z(e) {
|
|
138
|
-
if (
|
|
139
|
-
let t =
|
|
138
|
+
if (B.value !== e) return;
|
|
139
|
+
let t = V.value.trim(), n = H.value.trim(), r = P.savedBlocks.value.find((t) => t.id === e), i = {};
|
|
140
140
|
if (t && t !== r?.name && (i.name = t), n !== (r?.category ?? "") && (i.category = n), Object.keys(i).length === 0) {
|
|
141
141
|
X();
|
|
142
142
|
return;
|
|
143
143
|
}
|
|
144
144
|
try {
|
|
145
|
-
await
|
|
145
|
+
await P.update(e, i);
|
|
146
146
|
} finally {
|
|
147
147
|
X();
|
|
148
148
|
}
|
|
@@ -152,13 +152,13 @@ var he = {
|
|
|
152
152
|
r && n.contains(r) || Z(t);
|
|
153
153
|
}
|
|
154
154
|
function Q() {
|
|
155
|
-
|
|
155
|
+
q.value && j("insert", q.value, lt.value);
|
|
156
156
|
}
|
|
157
157
|
function $() {
|
|
158
|
-
|
|
158
|
+
j("close");
|
|
159
159
|
}
|
|
160
160
|
function ht(e) {
|
|
161
|
-
|
|
161
|
+
B.value || (e.key === "Escape" && $(), e.key === "Enter" && q.value && (e.preventDefault(), Q()));
|
|
162
162
|
}
|
|
163
163
|
return (n, a) => (d(), p(me, {
|
|
164
164
|
visible: v.visible,
|
|
@@ -166,8 +166,8 @@ var he = {
|
|
|
166
166
|
onKeydown: ht
|
|
167
167
|
}, {
|
|
168
168
|
default: ne(() => [s("div", he, [
|
|
169
|
-
s("div", ge, [s("h3", _e, f(h(
|
|
170
|
-
"aria-label": h(
|
|
169
|
+
s("div", ge, [s("h3", _e, f(h(M).savedBlocks.browse), 1), s("button", {
|
|
170
|
+
"aria-label": h(M).savedBlocks.close,
|
|
171
171
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-1 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]",
|
|
172
172
|
onClick: $
|
|
173
173
|
}, [l(h(ue), {
|
|
@@ -180,107 +180,107 @@ var he = {
|
|
|
180
180
|
"stroke-width": 2,
|
|
181
181
|
class: "tpl:pointer-events-none tpl:absolute tpl:left-3 tpl:top-1/2 tpl:-translate-y-1/2 tpl:text-[var(--tpl-text-dim)]"
|
|
182
182
|
}), e(s("input", {
|
|
183
|
-
"onUpdate:modelValue": a[0] ||= (e) =>
|
|
183
|
+
"onUpdate:modelValue": a[0] ||= (e) => I.value = e,
|
|
184
184
|
type: "text",
|
|
185
|
-
placeholder: h(
|
|
186
|
-
disabled:
|
|
185
|
+
placeholder: h(M).savedBlocks.search,
|
|
186
|
+
disabled: K.value,
|
|
187
187
|
class: "tpl:h-9 tpl:w-full tpl:rounded-md tpl:border tpl:pl-9 tpl:pr-3 tpl:text-sm tpl:outline-none tpl:disabled:opacity-50 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
188
|
-
}, null, 8, Ce), [[y,
|
|
188
|
+
}, null, 8, Ce), [[y, I.value]])]), h(P).categories.value.length > 0 ? e((d(), c("select", {
|
|
189
189
|
key: 0,
|
|
190
|
-
"onUpdate:modelValue": a[1] ||= (e) =>
|
|
190
|
+
"onUpdate:modelValue": a[1] ||= (e) => L.value = e,
|
|
191
191
|
"data-testid": "saved-blocks-category-filter",
|
|
192
|
-
"aria-label": h(
|
|
192
|
+
"aria-label": h(M).savedBlocks.filterByCategory,
|
|
193
193
|
class: "tpl:h-8 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
194
|
-
}, [s("option", Te, f(h(
|
|
194
|
+
}, [s("option", Te, f(h(M).savedBlocks.allCategories), 1), (d(!0), c(m, null, u(h(P).categories.value, (e) => (d(), c("option", {
|
|
195
195
|
key: e,
|
|
196
196
|
value: e
|
|
197
|
-
}, f(e), 9, E))), 128))], 8, we)), [[x,
|
|
198
|
-
s("datalist", D, [(d(!0), c(m, null, u(h(
|
|
197
|
+
}, f(e), 9, E))), 128))], 8, we)), [[x, L.value]]) : _("", !0)]),
|
|
198
|
+
s("datalist", D, [(d(!0), c(m, null, u(h(P).categories.value, (e) => (d(), c("option", {
|
|
199
199
|
key: e,
|
|
200
200
|
value: e
|
|
201
201
|
}, null, 8, O))), 128))]),
|
|
202
|
-
s("div", Ee, [
|
|
202
|
+
s("div", Ee, [K.value ? (d(), c("div", {
|
|
203
203
|
key: 0,
|
|
204
204
|
"data-testid": "saved-blocks-loading",
|
|
205
205
|
class: "tpl:flex tpl:flex-col tpl:gap-1",
|
|
206
206
|
role: "status",
|
|
207
207
|
"aria-busy": "true",
|
|
208
|
-
"aria-label": h(
|
|
208
|
+
"aria-label": h(M).savedBlocks.loading
|
|
209
209
|
}, [(d(), c(m, null, u(3, (e) => s("div", {
|
|
210
210
|
key: e,
|
|
211
211
|
"aria-hidden": "true",
|
|
212
212
|
class: "tpl-saved-block-skeleton tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)]"
|
|
213
|
-
}, [...a[7] ||= [s("div", { class: "tpl:h-3 tpl:w-1/2 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]" }, null, -1), s("div", { class: "tpl:mt-2 tpl:h-2.5 tpl:w-1/4 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]" }, null, -1)]])), 64))], 8, De)) :
|
|
213
|
+
}, [...a[7] ||= [s("div", { class: "tpl:h-3 tpl:w-1/2 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]" }, null, -1), s("div", { class: "tpl:mt-2 tpl:h-2.5 tpl:w-1/4 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]" }, null, -1)]])), 64))], 8, De)) : G.value.length > 0 ? (d(), c("div", Oe, [(d(!0), c(m, null, u(G.value, (n) => (d(), c(m, { key: n.id }, [B.value === n.id ? (d(), c("div", {
|
|
214
214
|
key: 0,
|
|
215
215
|
class: "tpl:flex tpl:w-full tpl:flex-col tpl:gap-1 tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-primary)]",
|
|
216
216
|
style: { "background-color": "var(--tpl-primary-light)" },
|
|
217
217
|
onFocusout: (e) => mt(e, n.id)
|
|
218
218
|
}, [e(s("input", {
|
|
219
219
|
ref_for: !0,
|
|
220
|
-
ref: (e) =>
|
|
221
|
-
"onUpdate:modelValue": a[2] ||= (e) =>
|
|
220
|
+
ref: (e) => U.value = e,
|
|
221
|
+
"onUpdate:modelValue": a[2] ||= (e) => V.value = e,
|
|
222
222
|
type: "text",
|
|
223
|
-
"aria-label": h(
|
|
223
|
+
"aria-label": h(M).savedBlocks.rename,
|
|
224
224
|
class: "tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
225
225
|
onKeydown: [S(b((e) => Z(n.id), ["prevent", "stop"]), ["enter"]), a[3] ||= S(b((e) => X(), ["prevent", "stop"]), ["esc"])]
|
|
226
|
-
}, null, 40, Ae), [[y,
|
|
227
|
-
"onUpdate:modelValue": a[4] ||= (e) =>
|
|
226
|
+
}, null, 40, Ae), [[y, V.value]]), e(s("input", {
|
|
227
|
+
"onUpdate:modelValue": a[4] ||= (e) => H.value = e,
|
|
228
228
|
type: "text",
|
|
229
229
|
"data-testid": "saved-blocks-edit-category",
|
|
230
|
-
"aria-label": h(
|
|
231
|
-
placeholder: h(
|
|
230
|
+
"aria-label": h(M).savedBlocks.category,
|
|
231
|
+
placeholder: h(M).savedBlocks.categoryPlaceholder,
|
|
232
232
|
list: "tpl-saved-block-browser-categories",
|
|
233
233
|
class: "tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
|
|
234
234
|
onKeydown: [S(b((e) => Z(n.id), ["prevent", "stop"]), ["enter"]), a[5] ||= S(b((e) => X(), ["prevent", "stop"]), ["esc"])]
|
|
235
|
-
}, null, 40, je), [[y,
|
|
235
|
+
}, null, 40, je), [[y, H.value]])], 40, ke)) : (d(), c("button", {
|
|
236
236
|
key: 1,
|
|
237
237
|
type: "button",
|
|
238
238
|
"data-testid": "saved-block-card",
|
|
239
|
-
"aria-pressed":
|
|
239
|
+
"aria-pressed": R.value === n.id,
|
|
240
240
|
class: "tpl:group/card tpl:w-full tpl:cursor-pointer tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:bg-transparent tpl:px-3 tpl:py-2 tpl:text-left tpl:transition-all tpl:duration-[120ms]",
|
|
241
241
|
style: r({
|
|
242
|
-
borderColor:
|
|
243
|
-
backgroundColor:
|
|
242
|
+
borderColor: R.value === n.id ? "var(--tpl-primary)" : "var(--tpl-border)",
|
|
243
|
+
backgroundColor: R.value === n.id ? "var(--tpl-primary-light)" : "transparent"
|
|
244
244
|
}),
|
|
245
|
-
onClick: (e) =>
|
|
245
|
+
onClick: (e) => R.value = n.id
|
|
246
246
|
}, [
|
|
247
|
-
s("div", Ne, [s("span", Pe, f(n.name), 1), s("span", Fe, f(h(
|
|
247
|
+
s("div", Ne, [s("span", Pe, f(n.name), 1), s("span", Fe, f(h(N)(h(M).savedBlocks.blockCount, { count: n.content.length })), 1)]),
|
|
248
248
|
n.category ? (d(), c("div", Ie, [s("span", Le, f(n.category), 1)])) : _("", !0),
|
|
249
249
|
s("div", Re, [
|
|
250
|
-
(d(!0), c(m, null, u(
|
|
250
|
+
(d(!0), c(m, null, u(ut(n), (e) => (d(), p(i(e.icon), {
|
|
251
251
|
key: e.type,
|
|
252
252
|
size: 14,
|
|
253
253
|
"stroke-width": 1.5,
|
|
254
254
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
255
255
|
}))), 128)),
|
|
256
|
-
|
|
257
|
-
|
|
256
|
+
J(n) > 0 ? (d(), c("span", ze, " +" + f(J(n)), 1)) : _("", !0),
|
|
257
|
+
Y(n) ? (d(), c("span", {
|
|
258
258
|
key: 1,
|
|
259
259
|
"data-testid": "saved-block-updated",
|
|
260
260
|
class: "tpl:ml-1 tpl:truncate tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]",
|
|
261
|
-
title:
|
|
262
|
-
}, f(
|
|
263
|
-
|
|
261
|
+
title: dt(n)
|
|
262
|
+
}, f(Y(n)), 9, Be)) : _("", !0),
|
|
263
|
+
z.value === n.id ? (d(), c("button", {
|
|
264
264
|
key: 2,
|
|
265
|
-
"aria-label": h(
|
|
265
|
+
"aria-label": h(M).savedBlocks.deleteConfirm,
|
|
266
266
|
class: "tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:transition-colors tpl:border-[var(--tpl-danger)] tpl:text-[var(--tpl-danger)]",
|
|
267
267
|
style: { "background-color": "transparent" },
|
|
268
|
-
onClick: b((e) =>
|
|
269
|
-
}, f(h(
|
|
268
|
+
onClick: b((e) => ft(n.id), ["stop"])
|
|
269
|
+
}, f(h(M).savedBlocks.deleteConfirm), 9, Ve)) : (d(), c(m, { key: 3 }, [h(P).canUpdateBlock(n) ? (d(), c("button", {
|
|
270
270
|
key: 0,
|
|
271
271
|
class: "tpl-saved-block-rename-btn tpl:ml-auto tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]",
|
|
272
|
-
"aria-label": h(
|
|
273
|
-
title: h(
|
|
274
|
-
onClick: b((e) =>
|
|
272
|
+
"aria-label": h(M).savedBlocks.rename,
|
|
273
|
+
title: h(M).savedBlocks.rename,
|
|
274
|
+
onClick: b((e) => pt(n), ["stop"])
|
|
275
275
|
}, [l(h(ce), {
|
|
276
276
|
size: 12,
|
|
277
277
|
"stroke-width": 1.5
|
|
278
|
-
})], 8, He)) : _("", !0), h(
|
|
278
|
+
})], 8, He)) : _("", !0), h(P).canDeleteBlock(n) ? (d(), c("button", {
|
|
279
279
|
key: 1,
|
|
280
|
-
class: t(["tpl-saved-block-delete-btn tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]", { "tpl:ml-auto": !h(
|
|
281
|
-
"aria-label": h(
|
|
282
|
-
title: h(
|
|
283
|
-
onClick: b((e) =>
|
|
280
|
+
class: t(["tpl-saved-block-delete-btn tpl:cursor-pointer tpl:rounded-md tpl:border-none tpl:bg-transparent tpl:p-0.5 tpl:transition-colors tpl:text-[var(--tpl-text-dim)]", { "tpl:ml-auto": !h(P).canUpdateBlock(n) }]),
|
|
281
|
+
"aria-label": h(M).savedBlocks.delete,
|
|
282
|
+
title: h(M).savedBlocks.delete,
|
|
283
|
+
onClick: b((e) => z.value = n.id, ["stop"])
|
|
284
284
|
}, [l(h(le), {
|
|
285
285
|
size: 12,
|
|
286
286
|
"stroke-width": 1.5
|
|
@@ -290,33 +290,33 @@ var he = {
|
|
|
290
290
|
size: 32,
|
|
291
291
|
"stroke-width": 1,
|
|
292
292
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
293
|
-
}),
|
|
294
|
-
]), s("div",
|
|
293
|
+
}), st.value ? (d(), c("p", Ge, f(h(M).savedBlocks.noResults), 1)) : (d(), c(m, { key: 1 }, [s("p", k, f(h(M).savedBlocks.empty), 1), s("p", Ke, f(h(M).savedBlocks.emptyHint), 1)], 64))]))])
|
|
294
|
+
]), s("div", qe, [q.value ? (d(), c("div", Je, [s("div", Ye, [l(h(at), { blocks: q.value.content }, null, 8, ["blocks"])])])) : (d(), c("div", Xe, [l(h(w), {
|
|
295
295
|
size: 32,
|
|
296
296
|
"stroke-width": 1,
|
|
297
297
|
class: "tpl:text-[var(--tpl-text-dim)]"
|
|
298
|
-
}), s("p",
|
|
299
|
-
s("div",
|
|
300
|
-
"onUpdate:modelValue": a[6] ||= (e) =>
|
|
298
|
+
}), s("p", Ze, f(h(M).savedBlocks.selectToPreview), 1)]))])]),
|
|
299
|
+
s("div", Qe, [s("div", $e, [s("label", et, f(h(M).savedBlocks.insertPosition), 1), e(s("select", {
|
|
300
|
+
"onUpdate:modelValue": a[6] ||= (e) => W.value = e,
|
|
301
301
|
class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
|
|
302
|
-
}, [(d(!0), c(m, null, u(
|
|
302
|
+
}, [(d(!0), c(m, null, u(ct.value, (e) => (d(), c("option", {
|
|
303
303
|
key: e.value,
|
|
304
304
|
value: e.value
|
|
305
|
-
}, f(e.label), 9,
|
|
305
|
+
}, f(e.label), 9, tt))), 128))], 512), [[x, W.value]])]), s("div", nt, [s("button", {
|
|
306
306
|
type: "button",
|
|
307
307
|
"data-testid": "saved-blocks-browser-close",
|
|
308
308
|
class: "tpl:cursor-pointer tpl:rounded-md tpl:border tpl:px-3 tpl:py-1.5 tpl:text-sm tpl:font-medium tpl:shadow-[var(--tpl-shadow-sm)] tpl:transition-all tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text)] tpl:bg-[var(--tpl-bg)]",
|
|
309
309
|
onClick: $
|
|
310
|
-
}, f(h(
|
|
310
|
+
}, f(h(M).savedBlocks.close), 1), s("button", {
|
|
311
311
|
type: "button",
|
|
312
312
|
class: t(h(de)),
|
|
313
|
-
disabled: !
|
|
313
|
+
disabled: !q.value,
|
|
314
314
|
onClick: Q
|
|
315
|
-
}, f(h(
|
|
315
|
+
}, f(h(M).savedBlocks.insert), 11, rt)])])
|
|
316
316
|
])]),
|
|
317
317
|
_: 1
|
|
318
318
|
}, 8, ["visible"]));
|
|
319
319
|
}
|
|
320
320
|
});
|
|
321
321
|
//#endregion
|
|
322
|
-
export {
|
|
322
|
+
export { A as default };
|
|
@@ -5,7 +5,7 @@ var c = /* @__PURE__ */ s({
|
|
|
5
5
|
__name: "SavedBlocksPanels",
|
|
6
6
|
props: { feature: {} },
|
|
7
7
|
setup(s) {
|
|
8
|
-
let c = s, l = e(() => import("./SavedBlocksPickBar-
|
|
8
|
+
let c = s, l = e(() => import("./SavedBlocksPickBar-XyXmnSnO.js")), u = e(() => import("./SaveBlockDialog-CDCzx6Bo.js")), d = e(() => import("./SavedBlocksBrowserModal-DQR6kJB1.js"));
|
|
9
9
|
function f(e, t) {
|
|
10
10
|
c.feature.insert(e, t);
|
|
11
11
|
}
|