@templatical/editor 0.44.1 → 0.44.3

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.
Files changed (91) hide show
  1. package/README.md +1 -1
  2. package/dist/{AiFeatureMenu-CgfLFHJw.js → AiFeatureMenu-CXqrbDNb.js} +1 -1
  3. package/dist/{BlockPreviewCanvas-2vVu55yN.js → BlockPreviewCanvas-DCeZid0G.js} +2 -2
  4. package/dist/{CloudHeaderExtras-BZ62q1aS.js → CloudHeaderExtras-B38fU84y.js} +1 -1
  5. package/dist/{CloudPanels-sv4aCKKE.js → CloudPanels-B2Mz-TwS.js} +1 -1
  6. package/dist/{CollaboratorBar-CSEFL7uC.js → CollaboratorBar-CL70aVnL.js} +1 -1
  7. package/dist/{ParagraphEditor-C_p6yKLK.js → ParagraphEditor-CHlX3nAk.js} +1 -1
  8. package/dist/{RestoreVersionDialog-CKHeCPG2.js → RestoreVersionDialog-C8Qt-sJV.js} +1 -1
  9. package/dist/{SaveBlockDialog-q3_fjb9t.js → SaveBlockDialog-CsielLi1.js} +5 -5
  10. package/dist/SavedBlocksBrowserModal-RKo9mq3U.js +363 -0
  11. package/dist/{SavedBlocksPanels-DNpnl5cO.js → SavedBlocksPanels-B7IlFCQp.js} +1 -1
  12. package/dist/{SavedBlocksPickBar-Pq2bjpB_.js → SavedBlocksPickBar-BYCwMUR6.js} +1 -1
  13. package/dist/{TestEmailModal-BYCKpH7g.js → TestEmailModal-Btbk0B1s.js} +3 -3
  14. package/dist/{TestEmailPanel-lUXAFsT5.js → TestEmailPanel-kdF_QluO.js} +1 -1
  15. package/dist/{TitleEditor-CWPxXUp2.js → TitleEditor-Cl6AmEy9.js} +1 -1
  16. package/dist/{TplModal-D6lqrKls.js → TplModal-DD1xZyBq.js} +1 -1
  17. package/dist/{VersionHistoryPanels-C3XhpQO_.js → VersionHistoryPanels-Caa2_niu.js} +1 -1
  18. package/dist/{WrapperBlock-ox8TMS_p.js → WrapperBlock-Do8kLejT.js} +1 -1
  19. package/dist/bundle-stats.json +6 -6
  20. package/dist/{ca-DSwai-th.js → ca-DES69VJW.js} +1 -0
  21. package/dist/cdn/chunks/{AiFeatureMenu-vOJtwdmT.js → AiFeatureMenu-B291Us2g.js} +2 -2
  22. package/dist/cdn/chunks/{AiFeatureMenu-vOJtwdmT.js.map → AiFeatureMenu-B291Us2g.js.map} +1 -1
  23. package/dist/cdn/chunks/{BlockPreviewCanvas-CB27Joyn.js → BlockPreviewCanvas-CRJZBmwV.js} +3 -3
  24. package/dist/cdn/chunks/{BlockPreviewCanvas-CB27Joyn.js.map → BlockPreviewCanvas-CRJZBmwV.js.map} +1 -1
  25. package/dist/cdn/chunks/{CloudHeaderExtras-9tKrhPm6.js → CloudHeaderExtras-BvCPpih5.js} +2 -2
  26. package/dist/cdn/chunks/{CloudHeaderExtras-9tKrhPm6.js.map → CloudHeaderExtras-BvCPpih5.js.map} +1 -1
  27. package/dist/cdn/chunks/{CloudPanels-DTQ7zbEN.js → CloudPanels-vlPH6N3s.js} +2 -2
  28. package/dist/cdn/chunks/{CloudPanels-DTQ7zbEN.js.map → CloudPanels-vlPH6N3s.js.map} +1 -1
  29. package/dist/cdn/chunks/{CollaboratorBar-BKTkVMbz.js → CollaboratorBar-Xt3WJ-rn.js} +2 -2
  30. package/dist/cdn/chunks/{CollaboratorBar-BKTkVMbz.js.map → CollaboratorBar-Xt3WJ-rn.js.map} +1 -1
  31. package/dist/cdn/chunks/{ParagraphEditor-BSDGOsja.js → ParagraphEditor-BWfx94pb.js} +2 -2
  32. package/dist/cdn/chunks/{ParagraphEditor-BSDGOsja.js.map → ParagraphEditor-BWfx94pb.js.map} +1 -1
  33. package/dist/cdn/chunks/{RestoreVersionDialog-DLe0Co57.js → RestoreVersionDialog-DWUnyA0B.js} +2 -2
  34. package/dist/cdn/chunks/{RestoreVersionDialog-DLe0Co57.js.map → RestoreVersionDialog-DWUnyA0B.js.map} +1 -1
  35. package/dist/cdn/chunks/{SaveBlockDialog-DQzaED8U.js → SaveBlockDialog-CcfyxDfZ.js} +6 -6
  36. package/dist/cdn/chunks/{SaveBlockDialog-DQzaED8U.js.map → SaveBlockDialog-CcfyxDfZ.js.map} +1 -1
  37. package/dist/cdn/chunks/SavedBlocksBrowserModal-DauQ_V9N.js +360 -0
  38. package/dist/cdn/chunks/SavedBlocksBrowserModal-DauQ_V9N.js.map +1 -0
  39. package/dist/cdn/chunks/{SavedBlocksPanels-lW7PMvJN.js → SavedBlocksPanels-J5v2PsFv.js} +2 -2
  40. package/dist/cdn/chunks/{SavedBlocksPanels-lW7PMvJN.js.map → SavedBlocksPanels-J5v2PsFv.js.map} +1 -1
  41. package/dist/cdn/chunks/{SavedBlocksPickBar-DEL0r3Bv.js → SavedBlocksPickBar-v3AMSqli.js} +2 -2
  42. package/dist/cdn/chunks/{SavedBlocksPickBar-DEL0r3Bv.js.map → SavedBlocksPickBar-v3AMSqli.js.map} +1 -1
  43. package/dist/cdn/chunks/{TestEmailModal-B7Dr2eFa.js → TestEmailModal-CW9EFpFR.js} +4 -4
  44. package/dist/cdn/chunks/{TestEmailModal-B7Dr2eFa.js.map → TestEmailModal-CW9EFpFR.js.map} +1 -1
  45. package/dist/cdn/chunks/{TestEmailPanel-C3PTYDbT.js → TestEmailPanel-D1Hchlr7.js} +2 -2
  46. package/dist/cdn/chunks/{TestEmailPanel-C3PTYDbT.js.map → TestEmailPanel-D1Hchlr7.js.map} +1 -1
  47. package/dist/cdn/chunks/{TitleEditor-gHTla_4I.js → TitleEditor-nDV6P-ag.js} +2 -2
  48. package/dist/cdn/chunks/{TitleEditor-gHTla_4I.js.map → TitleEditor-nDV6P-ag.js.map} +1 -1
  49. package/dist/cdn/chunks/{TplModal-BVUBOEQL.js → TplModal-VuZ9bDw9.js} +2 -2
  50. package/dist/cdn/chunks/{TplModal-BVUBOEQL.js.map → TplModal-VuZ9bDw9.js.map} +1 -1
  51. package/dist/cdn/chunks/{VersionHistoryPanels-Dcdy7ySA.js → VersionHistoryPanels-BChjjMC6.js} +2 -2
  52. package/dist/cdn/chunks/{VersionHistoryPanels-Dcdy7ySA.js.map → VersionHistoryPanels-BChjjMC6.js.map} +1 -1
  53. package/dist/cdn/chunks/{WrapperBlock-23nAzweL.js → WrapperBlock-DDnue8oy.js} +2 -2
  54. package/dist/cdn/chunks/{WrapperBlock-23nAzweL.js.map → WrapperBlock-DDnue8oy.js.map} +1 -1
  55. package/dist/cdn/chunks/{ca-DSwai-th.js → ca-DES69VJW.js} +2 -1
  56. package/dist/cdn/chunks/{ca-DSwai-th.js.map → ca-DES69VJW.js.map} +1 -1
  57. package/dist/cdn/chunks/{de-DOhKuphf.js → de-MlrDhC3Y.js} +2 -1
  58. package/dist/cdn/chunks/{de-DOhKuphf.js.map → de-MlrDhC3Y.js.map} +1 -1
  59. package/dist/cdn/chunks/{en-BE28ZcUF.js → en-6vJh7KCM.js} +2 -1
  60. package/dist/cdn/chunks/{en-BE28ZcUF.js.map → en-6vJh7KCM.js.map} +1 -1
  61. package/dist/cdn/chunks/{es-oQI-dfx2.js → es-ewL03EaP.js} +2 -1
  62. package/dist/cdn/chunks/{es-oQI-dfx2.js.map → es-ewL03EaP.js.map} +1 -1
  63. package/dist/cdn/chunks/{fr-rzLdCMSG.js → fr-D1syuxs1.js} +2 -1
  64. package/dist/cdn/chunks/{fr-rzLdCMSG.js.map → fr-D1syuxs1.js.map} +1 -1
  65. package/dist/{ja-dyFc6Ghz.js → cdn/chunks/ja-Dd_nytwe.js} +3 -0
  66. package/dist/cdn/chunks/{ja-dyFc6Ghz.js.map → ja-Dd_nytwe.js.map} +1 -1
  67. package/dist/cdn/chunks/{nl-BcQhRqKR.js → nl-DD1t_qxS.js} +2 -1
  68. package/dist/cdn/chunks/{nl-BcQhRqKR.js.map → nl-DD1t_qxS.js.map} +1 -1
  69. package/dist/cdn/chunks/{pt-BR-UombhTMO.js → pt-BR-BmtO0R7k.js} +2 -1
  70. package/dist/cdn/chunks/{pt-BR-UombhTMO.js.map → pt-BR-BmtO0R7k.js.map} +1 -1
  71. package/dist/cdn/chunks/{src-D_l1LAxs.js → src-CjjJWoUZ.js} +19 -17
  72. package/dist/cdn/chunks/{src-D_l1LAxs.js.map → src-CjjJWoUZ.js.map} +1 -1
  73. package/dist/cdn/chunks/{useEditorCore-DjD7fJpq.js → useEditorCore-q0G4q-52.js} +11 -11
  74. package/dist/cdn/chunks/{useEditorCore-DjD7fJpq.js.map → useEditorCore-q0G4q-52.js.map} +1 -1
  75. package/dist/cdn/editor.css +1 -1
  76. package/dist/cdn/editor.js +42 -34
  77. package/dist/cdn/editor.js.map +1 -1
  78. package/dist/{de-DOhKuphf.js → de-MlrDhC3Y.js} +1 -0
  79. package/dist/{en-BE28ZcUF.js → en-6vJh7KCM.js} +1 -0
  80. package/dist/{es-oQI-dfx2.js → es-ewL03EaP.js} +1 -0
  81. package/dist/{fr-rzLdCMSG.js → fr-D1syuxs1.js} +1 -0
  82. package/dist/{cdn/chunks/ja-dyFc6Ghz.js → ja-Dd_nytwe.js} +1 -2
  83. package/dist/{nl-BcQhRqKR.js → nl-DD1t_qxS.js} +1 -0
  84. package/dist/{pt-BR-UombhTMO.js → pt-BR-BmtO0R7k.js} +1 -0
  85. package/dist/style.css +1 -1
  86. package/dist/templatical-editor.js +41 -33
  87. package/dist/{useEditorCore-iuKC8yr5.js → useEditorCore-B1CWeFTj.js} +10 -10
  88. package/package.json +7 -7
  89. package/dist/SavedBlocksBrowserModal-DeUo5aFV.js +0 -325
  90. package/dist/cdn/chunks/SavedBlocksBrowserModal-CliZBxHo.js +0 -322
  91. package/dist/cdn/chunks/SavedBlocksBrowserModal-CliZBxHo.js.map +0 -1
@@ -1,325 +0,0 @@
1
- import { A as e, At as t, B as n, E as r, F as i, M as a, R as o, S as ee, V as s, Z as c, _ as te, at as l, c as u, d, g as f, jt as p, kt as m, l as h, r as g, s as _, u as v, v as y } from "./vue.runtime.esm-bundler-CyqhBwpY.js";
2
- import { a as b, c as x, i as S, s as C } from "./runtime-dom.esm-bundler-BGbPz4-g.js";
3
- import "./useEditorCore-iuKC8yr5.js";
4
- import { $ as w, U as ne, X as re, g as ie } from "./keys-CDqfZIRt.js";
5
- import { t as ae } from "./useI18n-B_CdcBwG.js";
6
- import { t as T } from "./blockTypeIcons-DEvNVvBj.js";
7
- import { t as E } from "./package-B9OWk-Kp.js";
8
- import { t as oe } from "./pencil-BDnjo24u.js";
9
- import { t as se } from "./search-CxRUiOSF.js";
10
- import { t as ce } from "./trash-BxIzHAri.js";
11
- import { t as le } from "./x-DrZO5tt0.js";
12
- import { v as ue } from "./styleConstants-C_YAPdQS.js";
13
- import { t as de } from "./formatAbsoluteDateTime-DMmop3C-.js";
14
- import { t as fe } from "./formatRelativeTime-CtUU-QZ8.js";
15
- import { t as pe } from "./TplModal-D6lqrKls.js";
16
- //#region src/components/SavedBlocksBrowserModal.vue?vue&type=script&setup=true&lang.ts
17
- var me = {
18
- role: "dialog",
19
- "aria-modal": "true",
20
- "data-testid": "saved-blocks-browser",
21
- "aria-labelledby": "tpl-saved-blocks-browser-title",
22
- class: "tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-[1000px] tpl:max-w-full tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
23
- style: {
24
- "background-color": "var(--tpl-bg-elevated)",
25
- "box-shadow": "var(--tpl-shadow-xl)"
26
- }
27
- }, he = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, ge = {
28
- id: "tpl-saved-blocks-browser-title",
29
- class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
30
- }, _e = ["aria-label"], ve = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, ye = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, be = { class: "tpl:flex tpl:flex-col tpl:gap-2 tpl:px-4 tpl:pt-4 tpl:pb-3" }, xe = { class: "tpl:relative" }, Se = ["placeholder", "disabled"], Ce = ["aria-label"], we = { value: "" }, Te = ["value"], D = { id: "tpl-saved-block-browser-categories" }, O = ["value"], Ee = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, De = ["aria-label"], Oe = {
31
- key: 1,
32
- class: "tpl:flex tpl:flex-col tpl:gap-1"
33
- }, ke = ["onFocusout"], Ae = ["aria-label", "onKeydown"], je = [
34
- "aria-label",
35
- "placeholder",
36
- "onKeydown"
37
- ], Me = ["onClick"], Ne = ["aria-pressed"], Pe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Fe = {
38
- "data-testid": "saved-block-name",
39
- class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]"
40
- }, Ie = { class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]" }, Le = {
41
- key: 0,
42
- class: "tpl:mt-1 tpl:flex tpl:items-center"
43
- }, Re = {
44
- "data-testid": "saved-block-category",
45
- class: "tpl:max-w-full tpl:truncate tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]"
46
- }, ze = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, Be = {
47
- key: 0,
48
- class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
49
- }, Ve = ["title"], He = ["aria-label", "onClick"], Ue = [
50
- "aria-label",
51
- "title",
52
- "onClick"
53
- ], We = [
54
- "aria-label",
55
- "title",
56
- "onClick"
57
- ], Ge = {
58
- key: 2,
59
- class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
60
- }, Ke = {
61
- key: 0,
62
- class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
63
- }, qe = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Je = { class: "tpl:mt-1 tpl:max-w-[220px] tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Ye = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, Xe = {
64
- key: 0,
65
- class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
66
- }, Ze = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Qe = {
67
- key: 1,
68
- class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
69
- }, $e = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, et = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, tt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, nt = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, rt = ["value"], it = { class: "tpl:flex tpl:gap-2" }, at = ["disabled"], k = /* @__PURE__ */ y({
70
- __name: "SavedBlocksBrowserModal",
71
- props: { visible: { type: Boolean } },
72
- emits: ["close", "insert"],
73
- setup(y, { emit: k }) {
74
- let ot = y, A = k, st = te(() => import("./BlockPreviewCanvas-2vVu55yN.js").then((e) => e.n)), { t: j, format: M } = ae(), N = w(ne, "SavedBlocksBrowserModal"), P = w(ie, "SavedBlocksBrowserModal"), ct = ee(re, void 0), F = c(""), I = c(""), L = c(null), R = c(null), z = c(null), B = c(""), V = c(""), H = c(null), U = c("end"), W = _(() => {
75
- let e = F.value.trim().toLowerCase(), t = I.value;
76
- return N.savedBlocks.value.filter((n) => !(e && !n.name.toLowerCase().includes(e) || t && n.category !== t));
77
- }), G = _(() => N.isLoading.value && N.savedBlocks.value.length === 0), lt = _(() => F.value.trim().length > 0 || I.value !== ""), K = _(() => L.value ? N.savedBlocks.value.find((e) => e.id === L.value) ?? null : null), ut = _(() => {
78
- let e = [{
79
- value: "beginning",
80
- label: j.savedBlocks.insertAtBeginning
81
- }], t = P.content.value.blocks;
82
- for (let n = 0; n < t.length; n++) {
83
- let r = t[n], i = r.type, a = j.blocks[i] ?? r.type;
84
- e.push({
85
- value: r.id,
86
- label: M(j.savedBlocks.insertAfterBlock, { block: `${a} ${n + 1}` })
87
- });
88
- }
89
- return e.push({
90
- value: "end",
91
- label: j.savedBlocks.insertAtEnd
92
- }), e;
93
- }), q = _(() => {
94
- if (U.value === "end") return;
95
- if (U.value === "beginning") return 0;
96
- let e = P.content.value.blocks.findIndex((e) => e.id === U.value);
97
- if (e !== -1) return e + 1;
98
- });
99
- o(() => ot.visible, (e) => {
100
- if (e) {
101
- F.value = "", I.value = "", L.value = null, R.value = null, z.value = null;
102
- let e = P.state.selectedBlockId;
103
- if (e) {
104
- let t = P.content.value.blocks.findIndex((t) => t.id === e);
105
- U.value = t === -1 ? "end" : e;
106
- } else U.value = "end";
107
- }
108
- }, { immediate: !0 });
109
- function dt(e) {
110
- let t = [], n = /* @__PURE__ */ new Set();
111
- for (let r of e.content) if (!n.has(r.type) && T[r.type] && (n.add(r.type), t.push({
112
- type: r.type,
113
- icon: T[r.type]
114
- })), t.length >= 5) break;
115
- return t;
116
- }
117
- function J(e) {
118
- let t = new Set(e.content.map((e) => e.type));
119
- return Math.max(0, t.size - 5);
120
- }
121
- function Y(e) {
122
- let t = e.updatedAt ?? e.createdAt;
123
- return t ? fe(t, j.time, M) ?? "" : "";
124
- }
125
- function ft(e) {
126
- let t = e.updatedAt ?? e.createdAt;
127
- return t ? de(t, ct) : "";
128
- }
129
- async function pt(e) {
130
- try {
131
- await N.remove(e), L.value === e && (L.value = null);
132
- } finally {
133
- R.value = null;
134
- }
135
- }
136
- async function mt(e) {
137
- N.canUpdateBlock(e) && (z.value = e.id, B.value = e.name, V.value = e.category ?? "", R.value = null, await r(), H.value?.focus(), H.value?.select());
138
- }
139
- function X() {
140
- z.value = null, B.value = "", V.value = "";
141
- }
142
- async function Z(e) {
143
- if (z.value !== e) return;
144
- let t = B.value.trim(), n = V.value.trim(), r = N.savedBlocks.value.find((t) => t.id === e), i = {};
145
- if (t && t !== r?.name && (i.name = t), n !== (r?.category ?? "") && (i.category = n), Object.keys(i).length === 0) {
146
- X();
147
- return;
148
- }
149
- try {
150
- await N.update(e, i);
151
- } finally {
152
- X();
153
- }
154
- }
155
- function ht(e, t) {
156
- let n = e.currentTarget, r = e.relatedTarget;
157
- r && n.contains(r) || Z(t);
158
- }
159
- function Q() {
160
- K.value && A("insert", K.value, q.value);
161
- }
162
- function $() {
163
- A("close");
164
- }
165
- function gt(e) {
166
- z.value || (e.key === "Escape" && $(), e.key === "Enter" && K.value && (e.preventDefault(), Q()));
167
- }
168
- return (r, o) => (e(), h(pe, {
169
- visible: y.visible,
170
- onClose: $,
171
- onKeydown: gt
172
- }, {
173
- default: n(() => [u("div", me, [
174
- u("div", he, [u("h3", ge, p(l(j).savedBlocks.browse), 1), u("button", {
175
- "aria-label": l(j).savedBlocks.close,
176
- 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)]",
177
- onClick: $
178
- }, [f(l(le), {
179
- size: 16,
180
- "stroke-width": 2
181
- })], 8, _e)]),
182
- u("div", ve, [u("div", ye, [
183
- u("div", be, [u("div", xe, [f(l(se), {
184
- size: 14,
185
- "stroke-width": 2,
186
- 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)]"
187
- }), s(u("input", {
188
- "onUpdate:modelValue": o[0] ||= (e) => F.value = e,
189
- type: "text",
190
- placeholder: l(j).savedBlocks.search,
191
- disabled: G.value,
192
- 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:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:disabled:opacity-50 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
193
- }, null, 8, Se), [[b, F.value]])]), l(N).categories.value.length > 0 ? s((e(), d("select", {
194
- key: 0,
195
- "onUpdate:modelValue": o[1] ||= (e) => I.value = e,
196
- "data-testid": "saved-blocks-category-filter",
197
- "aria-label": l(j).savedBlocks.filterByCategory,
198
- class: "tpl:h-8 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
199
- }, [u("option", we, p(l(j).savedBlocks.allCategories), 1), (e(!0), d(g, null, a(l(N).categories.value, (t) => (e(), d("option", {
200
- key: t,
201
- value: t
202
- }, p(t), 9, Te))), 128))], 8, Ce)), [[S, I.value]]) : v("", !0)]),
203
- u("datalist", D, [(e(!0), d(g, null, a(l(N).categories.value, (t) => (e(), d("option", {
204
- key: t,
205
- value: t
206
- }, null, 8, O))), 128))]),
207
- u("div", Ee, [G.value ? (e(), d("div", {
208
- key: 0,
209
- "data-testid": "saved-blocks-loading",
210
- class: "tpl:flex tpl:flex-col tpl:gap-1",
211
- role: "status",
212
- "aria-busy": "true",
213
- "aria-label": l(j).savedBlocks.loading
214
- }, [(e(), d(g, null, a(3, (e) => u("div", {
215
- key: e,
216
- "aria-hidden": "true",
217
- class: "tpl-saved-block-skeleton tpl:rounded-[var(--tpl-radius-md)] tpl:border tpl:px-3 tpl:py-2 tpl:border-[var(--tpl-border)]"
218
- }, [...o[7] ||= [u("div", { class: "tpl:h-3 tpl:w-1/2 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]" }, null, -1), u("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)) : W.value.length > 0 ? (e(), d("div", Oe, [(e(!0), d(g, null, a(W.value, (n) => (e(), d(g, { key: n.id }, [z.value === n.id ? (e(), d("div", {
219
- key: 0,
220
- 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)]",
221
- style: { "background-color": "var(--tpl-primary-light)" },
222
- onFocusout: (e) => ht(e, n.id)
223
- }, [s(u("input", {
224
- ref_for: !0,
225
- ref: (e) => H.value = e,
226
- "onUpdate:modelValue": o[2] ||= (e) => B.value = e,
227
- type: "text",
228
- "aria-label": l(j).savedBlocks.rename,
229
- class: "tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
230
- onKeydown: [C(x((e) => Z(n.id), ["prevent", "stop"]), ["enter"]), o[3] ||= C(x((e) => X(), ["prevent", "stop"]), ["esc"])]
231
- }, null, 40, Ae), [[b, B.value]]), s(u("input", {
232
- "onUpdate:modelValue": o[4] ||= (e) => V.value = e,
233
- type: "text",
234
- "data-testid": "saved-blocks-edit-category",
235
- "aria-label": l(j).savedBlocks.category,
236
- placeholder: l(j).savedBlocks.categoryPlaceholder,
237
- list: "tpl-saved-block-browser-categories",
238
- class: "tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
239
- onKeydown: [C(x((e) => Z(n.id), ["prevent", "stop"]), ["enter"]), o[5] ||= C(x((e) => X(), ["prevent", "stop"]), ["esc"])]
240
- }, null, 40, je), [[b, V.value]])], 40, ke)) : (e(), d("div", {
241
- key: 1,
242
- "data-testid": "saved-block-card",
243
- class: "tpl:group/card tpl:relative 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]",
244
- style: t({
245
- borderColor: L.value === n.id ? "var(--tpl-primary)" : "var(--tpl-border)",
246
- backgroundColor: L.value === n.id ? "var(--tpl-primary-light)" : "transparent"
247
- }),
248
- onClick: (e) => L.value = n.id
249
- }, [u("button", {
250
- type: "button",
251
- "aria-pressed": L.value === n.id,
252
- class: "tpl-saved-block-select tpl:block tpl:w-full tpl:text-left"
253
- }, [u("span", Pe, [u("span", Fe, p(n.name), 1), u("span", Ie, p(l(M)(l(j).savedBlocks.blockCount, { count: n.content.length })), 1)]), n.category ? (e(), d("span", Le, [u("span", Re, p(n.category), 1)])) : v("", !0)], 8, Ne), u("div", ze, [
254
- (e(!0), d(g, null, a(dt(n), (t) => (e(), h(i(t.icon), {
255
- key: t.type,
256
- size: 14,
257
- "stroke-width": 1.5,
258
- class: "tpl:text-[var(--tpl-text-dim)]"
259
- }))), 128)),
260
- J(n) > 0 ? (e(), d("span", Be, " +" + p(J(n)), 1)) : v("", !0),
261
- Y(n) ? (e(), d("span", {
262
- key: 1,
263
- "data-testid": "saved-block-updated",
264
- class: "tpl:ml-1 tpl:truncate tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]",
265
- title: ft(n)
266
- }, p(Y(n)), 9, Ve)) : v("", !0),
267
- R.value === n.id ? (e(), d("button", {
268
- key: 2,
269
- "aria-label": l(j).savedBlocks.deleteConfirm,
270
- 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)]",
271
- style: { "background-color": "transparent" },
272
- onClick: x((e) => pt(n.id), ["stop"])
273
- }, p(l(j).savedBlocks.deleteConfirm), 9, He)) : (e(), d(g, { key: 3 }, [l(N).canUpdateBlock(n) ? (e(), d("button", {
274
- key: 0,
275
- 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)]",
276
- "aria-label": l(j).savedBlocks.rename,
277
- title: l(j).savedBlocks.rename,
278
- onClick: x((e) => mt(n), ["stop"])
279
- }, [f(l(oe), {
280
- size: 12,
281
- "stroke-width": 1.5
282
- })], 8, Ue)) : v("", !0), l(N).canDeleteBlock(n) ? (e(), d("button", {
283
- key: 1,
284
- class: m(["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": !l(N).canUpdateBlock(n) }]),
285
- "aria-label": l(j).savedBlocks.delete,
286
- title: l(j).savedBlocks.delete,
287
- onClick: x((e) => R.value = n.id, ["stop"])
288
- }, [f(l(ce), {
289
- size: 12,
290
- "stroke-width": 1.5
291
- })], 10, We)) : v("", !0)], 64))
292
- ])], 12, Me))], 64))), 128))])) : (e(), d("div", Ge, [f(l(E), {
293
- size: 32,
294
- "stroke-width": 1,
295
- class: "tpl:text-[var(--tpl-text-dim)]"
296
- }), lt.value ? (e(), d("p", Ke, p(l(j).savedBlocks.noResults), 1)) : (e(), d(g, { key: 1 }, [u("p", qe, p(l(j).savedBlocks.empty), 1), u("p", Je, p(l(j).savedBlocks.emptyHint), 1)], 64))]))])
297
- ]), u("div", Ye, [K.value ? (e(), d("div", Xe, [u("div", Ze, [f(l(st), { blocks: K.value.content }, null, 8, ["blocks"])])])) : (e(), d("div", Qe, [f(l(E), {
298
- size: 32,
299
- "stroke-width": 1,
300
- class: "tpl:text-[var(--tpl-text-dim)]"
301
- }), u("p", $e, p(l(j).savedBlocks.selectToPreview), 1)]))])]),
302
- u("div", et, [u("div", tt, [u("label", nt, p(l(j).savedBlocks.insertPosition), 1), s(u("select", {
303
- "onUpdate:modelValue": o[6] ||= (e) => U.value = e,
304
- class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
305
- }, [(e(!0), d(g, null, a(ut.value, (t) => (e(), d("option", {
306
- key: t.value,
307
- value: t.value
308
- }, p(t.label), 9, rt))), 128))], 512), [[S, U.value]])]), u("div", it, [u("button", {
309
- type: "button",
310
- "data-testid": "saved-blocks-browser-close",
311
- 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)]",
312
- onClick: $
313
- }, p(l(j).savedBlocks.close), 1), u("button", {
314
- type: "button",
315
- class: m(l(ue)),
316
- disabled: !K.value,
317
- onClick: Q
318
- }, p(l(j).savedBlocks.insert), 11, at)])])
319
- ])]),
320
- _: 1
321
- }, 8, ["visible"]));
322
- }
323
- });
324
- //#endregion
325
- export { k as default };
@@ -1,322 +0,0 @@
1
- import { B as e, E as t, F as n, H as r, N as i, Q as a, R as ee, S as o, U as s, a as c, at as l, b as u, c as d, ct as f, f as p, g as m, h, k as te, l as g, lt as ne, m as _, o as v, p as y, u as b, ut as x, x as re } from "./draggable-IB4x6w2O.js";
2
- import "./useEditorCore-DjD7fJpq.js";
3
- import { $ as S, U as ie, X as ae, g as oe } from "./keys-DCWeHkSF.js";
4
- import { t as se } from "./useI18n-CyO_Nmca.js";
5
- import { P as ce, X as C, f as le, n as ue, q as de } from "./icons-BjvraR-Y.js";
6
- import { v as fe } from "./styleConstants-C_YAPdQS.js";
7
- import { t as w } from "./blockTypeIcons-BMZi7sdX.js";
8
- import { t as pe } from "./formatAbsoluteDateTime-DMmop3C-.js";
9
- import { t as me } from "./formatRelativeTime-CtUU-QZ8.js";
10
- import { t as he } from "./TplModal-BVUBOEQL.js";
11
- //#region src/components/SavedBlocksBrowserModal.vue?vue&type=script&setup=true&lang.ts
12
- var ge = {
13
- role: "dialog",
14
- "aria-modal": "true",
15
- "data-testid": "saved-blocks-browser",
16
- "aria-labelledby": "tpl-saved-blocks-browser-title",
17
- class: "tpl-scale-in tpl:flex tpl:max-h-[90%] tpl:w-[1000px] tpl:max-w-full tpl:flex-col tpl:rounded-[var(--tpl-radius-lg)]",
18
- style: {
19
- "background-color": "var(--tpl-bg-elevated)",
20
- "box-shadow": "var(--tpl-shadow-xl)"
21
- }
22
- }, _e = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-b tpl:px-5 tpl:py-4 tpl:border-[var(--tpl-border)]" }, ve = {
23
- id: "tpl-saved-blocks-browser-title",
24
- class: "tpl:text-sm tpl:font-semibold tpl:text-[var(--tpl-text)]"
25
- }, ye = ["aria-label"], be = { class: "tpl:flex tpl:min-h-0 tpl:flex-1 tpl:overflow-hidden" }, xe = { class: "tpl:flex tpl:w-[300px] tpl:shrink-0 tpl:flex-col tpl:overflow-hidden" }, Se = { class: "tpl:flex tpl:flex-col tpl:gap-2 tpl:px-4 tpl:pt-4 tpl:pb-3" }, Ce = { class: "tpl:relative" }, we = ["placeholder", "disabled"], Te = ["aria-label"], T = { value: "" }, E = ["value"], D = { id: "tpl-saved-block-browser-categories" }, O = ["value"], Ee = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:px-4 tpl:pb-4" }, De = ["aria-label"], Oe = {
26
- key: 1,
27
- class: "tpl:flex tpl:flex-col tpl:gap-1"
28
- }, ke = ["onFocusout"], Ae = ["aria-label", "onKeydown"], je = [
29
- "aria-label",
30
- "placeholder",
31
- "onKeydown"
32
- ], Me = ["onClick"], Ne = ["aria-pressed"], Pe = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Fe = {
33
- "data-testid": "saved-block-name",
34
- class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]"
35
- }, Ie = { class: "tpl:shrink-0 tpl:rounded-full tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-muted)]" }, Le = {
36
- key: 0,
37
- class: "tpl:mt-1 tpl:flex tpl:items-center"
38
- }, Re = {
39
- "data-testid": "saved-block-category",
40
- class: "tpl:max-w-full tpl:truncate tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary)]"
41
- }, ze = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, Be = {
42
- key: 0,
43
- class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
44
- }, Ve = ["title"], He = ["aria-label", "onClick"], Ue = [
45
- "aria-label",
46
- "title",
47
- "onClick"
48
- ], We = [
49
- "aria-label",
50
- "title",
51
- "onClick"
52
- ], Ge = {
53
- key: 2,
54
- class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
55
- }, Ke = {
56
- key: 0,
57
- class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
58
- }, qe = { class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Je = { class: "tpl:mt-1 tpl:max-w-[220px] tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, Ye = { class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden tpl:border-l tpl:border-[var(--tpl-border)]" }, Xe = {
59
- key: 0,
60
- class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
61
- }, Ze = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Qe = {
62
- key: 1,
63
- class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
64
- }, $e = { class: "tpl:mt-2 tpl:text-center tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, et = { class: "tpl:flex tpl:items-center tpl:justify-between tpl:border-t tpl:px-5 tpl:py-3 tpl:border-[var(--tpl-border)]" }, tt = { class: "tpl:flex tpl:items-center tpl:gap-2" }, nt = { class: "tpl:shrink-0 tpl:text-xs tpl:text-[var(--tpl-text-dim)]" }, rt = ["value"], it = { class: "tpl:flex tpl:gap-2" }, at = ["disabled"], k = /* @__PURE__ */ o({
65
- __name: "SavedBlocksBrowserModal",
66
- props: { visible: { type: Boolean } },
67
- emits: ["close", "insert"],
68
- setup(o, { emit: k }) {
69
- let ot = o, A = k, st = re(() => import("./BlockPreviewCanvas-CB27Joyn.js").then((e) => e.n)), { t: j, format: M } = se(), N = S(ie, "SavedBlocksBrowserModal"), P = S(oe, "SavedBlocksBrowserModal"), ct = t(ae, void 0), F = a(""), I = a(""), L = a(null), R = a(null), z = a(null), B = a(""), V = a(""), H = a(null), U = a("end"), W = p(() => {
70
- let e = F.value.trim().toLowerCase(), t = I.value;
71
- return N.savedBlocks.value.filter((n) => !(e && !n.name.toLowerCase().includes(e) || t && n.category !== t));
72
- }), G = p(() => N.isLoading.value && N.savedBlocks.value.length === 0), lt = p(() => F.value.trim().length > 0 || I.value !== ""), K = p(() => L.value ? N.savedBlocks.value.find((e) => e.id === L.value) ?? null : null), ut = p(() => {
73
- let e = [{
74
- value: "beginning",
75
- label: j.savedBlocks.insertAtBeginning
76
- }], t = P.content.value.blocks;
77
- for (let n = 0; n < t.length; n++) {
78
- let r = t[n];
79
- e.push({
80
- value: r.id,
81
- label: M(j.savedBlocks.insertAfterBlock, { block: `${j.blocks[r.type] ?? r.type} ${n + 1}` })
82
- });
83
- }
84
- return e.push({
85
- value: "end",
86
- label: j.savedBlocks.insertAtEnd
87
- }), e;
88
- }), q = p(() => {
89
- if (U.value === "end") return;
90
- if (U.value === "beginning") return 0;
91
- let e = P.content.value.blocks.findIndex((e) => e.id === U.value);
92
- if (e !== -1) return e + 1;
93
- });
94
- e(() => ot.visible, (e) => {
95
- if (e) {
96
- F.value = "", I.value = "", L.value = null, R.value = null, z.value = null;
97
- let e = P.state.selectedBlockId;
98
- if (e) {
99
- let t = P.content.value.blocks.findIndex((t) => t.id === e);
100
- U.value = t === -1 ? "end" : e;
101
- } else U.value = "end";
102
- }
103
- }, { immediate: !0 });
104
- function dt(e) {
105
- let t = [], n = /* @__PURE__ */ new Set();
106
- for (let r of e.content) if (!n.has(r.type) && w[r.type] && (n.add(r.type), t.push({
107
- type: r.type,
108
- icon: w[r.type]
109
- })), t.length >= 5) break;
110
- return t;
111
- }
112
- function J(e) {
113
- let t = new Set(e.content.map((e) => e.type));
114
- return Math.max(0, t.size - 5);
115
- }
116
- function Y(e) {
117
- let t = e.updatedAt ?? e.createdAt;
118
- return t ? me(t, j.time, M) ?? "" : "";
119
- }
120
- function ft(e) {
121
- let t = e.updatedAt ?? e.createdAt;
122
- return t ? pe(t, ct) : "";
123
- }
124
- async function pt(e) {
125
- try {
126
- await N.remove(e), L.value === e && (L.value = null);
127
- } finally {
128
- R.value = null;
129
- }
130
- }
131
- async function mt(e) {
132
- N.canUpdateBlock(e) && (z.value = e.id, B.value = e.name, V.value = e.category ?? "", R.value = null, await te(), H.value?.focus(), H.value?.select());
133
- }
134
- function X() {
135
- z.value = null, B.value = "", V.value = "";
136
- }
137
- async function Z(e) {
138
- if (z.value !== e) return;
139
- let t = B.value.trim(), n = V.value.trim(), r = N.savedBlocks.value.find((t) => t.id === e), i = {};
140
- if (t && t !== r?.name && (i.name = t), n !== (r?.category ?? "") && (i.category = n), Object.keys(i).length === 0) {
141
- X();
142
- return;
143
- }
144
- try {
145
- await N.update(e, i);
146
- } finally {
147
- X();
148
- }
149
- }
150
- function ht(e, t) {
151
- let n = e.currentTarget, r = e.relatedTarget;
152
- r && n.contains(r) || Z(t);
153
- }
154
- function Q() {
155
- K.value && A("insert", K.value, q.value);
156
- }
157
- function $() {
158
- A("close");
159
- }
160
- function gt(e) {
161
- z.value || (e.key === "Escape" && $(), e.key === "Enter" && K.value && (e.preventDefault(), Q()));
162
- }
163
- return (e, t) => (i(), _(he, {
164
- visible: o.visible,
165
- onClose: $,
166
- onKeydown: gt
167
- }, {
168
- default: r(() => [y("div", ge, [
169
- y("div", _e, [y("h3", ve, x(l(j).savedBlocks.browse), 1), y("button", {
170
- "aria-label": l(j).savedBlocks.close,
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
- onClick: $
173
- }, [u(l(ue), {
174
- size: 16,
175
- "stroke-width": 2
176
- })], 8, ye)]),
177
- y("div", be, [y("div", xe, [
178
- y("div", Se, [y("div", Ce, [u(l(ce), {
179
- size: 14,
180
- "stroke-width": 2,
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
- }), s(y("input", {
183
- "onUpdate:modelValue": t[0] ||= (e) => F.value = e,
184
- type: "text",
185
- placeholder: l(j).savedBlocks.search,
186
- disabled: G.value,
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:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:disabled:opacity-50 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
188
- }, null, 8, we), [[v, F.value]])]), l(N).categories.value.length > 0 ? s((i(), m("select", {
189
- key: 0,
190
- "onUpdate:modelValue": t[1] ||= (e) => I.value = e,
191
- "data-testid": "saved-blocks-category-filter",
192
- "aria-label": l(j).savedBlocks.filterByCategory,
193
- class: "tpl:h-8 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
194
- }, [y("option", T, x(l(j).savedBlocks.allCategories), 1), (i(!0), m(b, null, n(l(N).categories.value, (e) => (i(), m("option", {
195
- key: e,
196
- value: e
197
- }, x(e), 9, E))), 128))], 8, Te)), [[c, I.value]]) : h("", !0)]),
198
- y("datalist", D, [(i(!0), m(b, null, n(l(N).categories.value, (e) => (i(), m("option", {
199
- key: e,
200
- value: e
201
- }, null, 8, O))), 128))]),
202
- y("div", Ee, [G.value ? (i(), m("div", {
203
- key: 0,
204
- "data-testid": "saved-blocks-loading",
205
- class: "tpl:flex tpl:flex-col tpl:gap-1",
206
- role: "status",
207
- "aria-busy": "true",
208
- "aria-label": l(j).savedBlocks.loading
209
- }, [(i(), m(b, null, n(3, (e) => y("div", {
210
- key: e,
211
- "aria-hidden": "true",
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
- }, [...t[7] ||= [y("div", { class: "tpl:h-3 tpl:w-1/2 tpl:rounded tpl:bg-[var(--tpl-bg-hover)]" }, null, -1), y("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)) : W.value.length > 0 ? (i(), m("div", Oe, [(i(!0), m(b, null, n(W.value, (e) => (i(), m(b, { key: e.id }, [z.value === e.id ? (i(), m("div", {
214
- key: 0,
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
- style: { "background-color": "var(--tpl-primary-light)" },
217
- onFocusout: (t) => ht(t, e.id)
218
- }, [s(y("input", {
219
- ref_for: !0,
220
- ref: (e) => H.value = e,
221
- "onUpdate:modelValue": t[2] ||= (e) => B.value = e,
222
- type: "text",
223
- "aria-label": l(j).savedBlocks.rename,
224
- class: "tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
225
- onKeydown: [d(g((t) => Z(e.id), ["prevent", "stop"]), ["enter"]), t[3] ||= d(g((e) => X(), ["prevent", "stop"]), ["esc"])]
226
- }, null, 40, Ae), [[v, B.value]]), s(y("input", {
227
- "onUpdate:modelValue": t[4] ||= (e) => V.value = e,
228
- type: "text",
229
- "data-testid": "saved-blocks-edit-category",
230
- "aria-label": l(j).savedBlocks.category,
231
- placeholder: l(j).savedBlocks.categoryPlaceholder,
232
- list: "tpl-saved-block-browser-categories",
233
- class: "tpl:h-7 tpl:w-full tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]",
234
- onKeydown: [d(g((t) => Z(e.id), ["prevent", "stop"]), ["enter"]), t[5] ||= d(g((e) => X(), ["prevent", "stop"]), ["esc"])]
235
- }, null, 40, je), [[v, V.value]])], 40, ke)) : (i(), m("div", {
236
- key: 1,
237
- "data-testid": "saved-block-card",
238
- class: "tpl:group/card tpl:relative 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]",
239
- style: ne({
240
- borderColor: L.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
241
- backgroundColor: L.value === e.id ? "var(--tpl-primary-light)" : "transparent"
242
- }),
243
- onClick: (t) => L.value = e.id
244
- }, [y("button", {
245
- type: "button",
246
- "aria-pressed": L.value === e.id,
247
- class: "tpl-saved-block-select tpl:block tpl:w-full tpl:text-left"
248
- }, [y("span", Pe, [y("span", Fe, x(e.name), 1), y("span", Ie, x(l(M)(l(j).savedBlocks.blockCount, { count: e.content.length })), 1)]), e.category ? (i(), m("span", Le, [y("span", Re, x(e.category), 1)])) : h("", !0)], 8, Ne), y("div", ze, [
249
- (i(!0), m(b, null, n(dt(e), (e) => (i(), _(ee(e.icon), {
250
- key: e.type,
251
- size: 14,
252
- "stroke-width": 1.5,
253
- class: "tpl:text-[var(--tpl-text-dim)]"
254
- }))), 128)),
255
- J(e) > 0 ? (i(), m("span", Be, " +" + x(J(e)), 1)) : h("", !0),
256
- Y(e) ? (i(), m("span", {
257
- key: 1,
258
- "data-testid": "saved-block-updated",
259
- class: "tpl:ml-1 tpl:truncate tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]",
260
- title: ft(e)
261
- }, x(Y(e)), 9, Ve)) : h("", !0),
262
- R.value === e.id ? (i(), m("button", {
263
- key: 2,
264
- "aria-label": l(j).savedBlocks.deleteConfirm,
265
- 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)]",
266
- style: { "background-color": "transparent" },
267
- onClick: g((t) => pt(e.id), ["stop"])
268
- }, x(l(j).savedBlocks.deleteConfirm), 9, He)) : (i(), m(b, { key: 3 }, [l(N).canUpdateBlock(e) ? (i(), m("button", {
269
- key: 0,
270
- 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)]",
271
- "aria-label": l(j).savedBlocks.rename,
272
- title: l(j).savedBlocks.rename,
273
- onClick: g((t) => mt(e), ["stop"])
274
- }, [u(l(de), {
275
- size: 12,
276
- "stroke-width": 1.5
277
- })], 8, Ue)) : h("", !0), l(N).canDeleteBlock(e) ? (i(), m("button", {
278
- key: 1,
279
- class: f(["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": !l(N).canUpdateBlock(e) }]),
280
- "aria-label": l(j).savedBlocks.delete,
281
- title: l(j).savedBlocks.delete,
282
- onClick: g((t) => R.value = e.id, ["stop"])
283
- }, [u(l(le), {
284
- size: 12,
285
- "stroke-width": 1.5
286
- })], 10, We)) : h("", !0)], 64))
287
- ])], 12, Me))], 64))), 128))])) : (i(), m("div", Ge, [u(l(C), {
288
- size: 32,
289
- "stroke-width": 1,
290
- class: "tpl:text-[var(--tpl-text-dim)]"
291
- }), lt.value ? (i(), m("p", Ke, x(l(j).savedBlocks.noResults), 1)) : (i(), m(b, { key: 1 }, [y("p", qe, x(l(j).savedBlocks.empty), 1), y("p", Je, x(l(j).savedBlocks.emptyHint), 1)], 64))]))])
292
- ]), y("div", Ye, [K.value ? (i(), m("div", Xe, [y("div", Ze, [u(l(st), { blocks: K.value.content }, null, 8, ["blocks"])])])) : (i(), m("div", Qe, [u(l(C), {
293
- size: 32,
294
- "stroke-width": 1,
295
- class: "tpl:text-[var(--tpl-text-dim)]"
296
- }), y("p", $e, x(l(j).savedBlocks.selectToPreview), 1)]))])]),
297
- y("div", et, [y("div", tt, [y("label", nt, x(l(j).savedBlocks.insertPosition), 1), s(y("select", {
298
- "onUpdate:modelValue": t[6] ||= (e) => U.value = e,
299
- class: "tpl:h-7 tpl:max-w-[220px] tpl:rounded-md tpl:border tpl:px-2 tpl:text-xs tpl:outline-none tpl:focus:border-[var(--tpl-primary)] tpl:focus:shadow-[var(--tpl-ring)] tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg)] tpl:text-[var(--tpl-text)]"
300
- }, [(i(!0), m(b, null, n(ut.value, (e) => (i(), m("option", {
301
- key: e.value,
302
- value: e.value
303
- }, x(e.label), 9, rt))), 128))], 512), [[c, U.value]])]), y("div", it, [y("button", {
304
- type: "button",
305
- "data-testid": "saved-blocks-browser-close",
306
- 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)]",
307
- onClick: $
308
- }, x(l(j).savedBlocks.close), 1), y("button", {
309
- type: "button",
310
- class: f(l(fe)),
311
- disabled: !K.value,
312
- onClick: Q
313
- }, x(l(j).savedBlocks.insert), 11, at)])])
314
- ])]),
315
- _: 1
316
- }, 8, ["visible"]));
317
- }
318
- });
319
- //#endregion
320
- export { k as default };
321
-
322
- //# sourceMappingURL=SavedBlocksBrowserModal-CliZBxHo.js.map