@templatical/editor 0.44.0 → 0.44.1

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.
@@ -29,76 +29,79 @@ var ge = {
29
29
  "aria-label",
30
30
  "placeholder",
31
31
  "onKeydown"
32
- ], Me = ["aria-pressed", "onClick"], Ne = { class: "tpl:flex tpl:items-center tpl:gap-2" }, Pe = { class: "tpl:flex-1 tpl:truncate tpl:text-xs tpl:font-semibold tpl:text-[var(--tpl-text)]" }, Fe = { 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)]" }, Ie = {
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 = {
33
36
  key: 0,
34
37
  class: "tpl:mt-1 tpl:flex tpl:items-center"
35
- }, Le = {
38
+ }, Re = {
36
39
  "data-testid": "saved-block-category",
37
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)]"
38
- }, Re = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, ze = {
41
+ }, ze = { class: "tpl:mt-1 tpl:flex tpl:items-center tpl:gap-1" }, Be = {
39
42
  key: 0,
40
43
  class: "tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]"
41
- }, Be = ["title"], Ve = ["aria-label", "onClick"], He = [
44
+ }, Ve = ["title"], He = ["aria-label", "onClick"], Ue = [
42
45
  "aria-label",
43
46
  "title",
44
47
  "onClick"
45
- ], Ue = [
48
+ ], We = [
46
49
  "aria-label",
47
50
  "title",
48
51
  "onClick"
49
- ], We = {
52
+ ], Ge = {
50
53
  key: 2,
51
54
  class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
52
- }, k = {
55
+ }, Ke = {
53
56
  key: 0,
54
57
  class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
55
- }, Ge = { 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 = {
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 = {
56
59
  key: 0,
57
60
  class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:overflow-hidden"
58
- }, Ye = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Xe = {
61
+ }, Ze = { class: "tpl:flex-1 tpl:overflow-y-auto tpl:p-4" }, Qe = {
59
62
  key: 1,
60
63
  class: "tpl:flex tpl:flex-1 tpl:flex-col tpl:items-center tpl:justify-center tpl:px-4"
61
- }, 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__ */ o({
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({
62
65
  __name: "SavedBlocksBrowserModal",
63
66
  props: { visible: { type: Boolean } },
64
67
  emits: ["close", "insert"],
65
- setup(o, { emit: A }) {
66
- let it = o, j = A, at = re(() => import("./BlockPreviewCanvas-CB27Joyn.js").then((e) => e.n)), { t: M, format: N } = se(), P = S(ie, "SavedBlocksBrowserModal"), F = S(oe, "SavedBlocksBrowserModal"), ot = t(ae, void 0), I = a(""), L = a(""), R = a(null), z = a(null), B = a(null), V = a(""), H = a(""), U = a(null), W = a("end"), G = p(() => {
67
- let e = I.value.trim().toLowerCase(), t = L.value;
68
- return P.savedBlocks.value.filter((n) => !(e && !n.name.toLowerCase().includes(e) || t && n.category !== t));
69
- }), K = p(() => P.isLoading.value && P.savedBlocks.value.length === 0), st = p(() => I.value.trim().length > 0 || L.value !== ""), q = p(() => R.value ? P.savedBlocks.value.find((e) => e.id === R.value) ?? null : null), ct = p(() => {
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(() => {
70
73
  let e = [{
71
74
  value: "beginning",
72
- label: M.savedBlocks.insertAtBeginning
73
- }], t = F.content.value.blocks;
75
+ label: j.savedBlocks.insertAtBeginning
76
+ }], t = P.content.value.blocks;
74
77
  for (let n = 0; n < t.length; n++) {
75
78
  let r = t[n];
76
79
  e.push({
77
80
  value: r.id,
78
- label: N(M.savedBlocks.insertAfterBlock, { block: `${M.blocks[r.type] ?? r.type} ${n + 1}` })
81
+ label: M(j.savedBlocks.insertAfterBlock, { block: `${j.blocks[r.type] ?? r.type} ${n + 1}` })
79
82
  });
80
83
  }
81
84
  return e.push({
82
85
  value: "end",
83
- label: M.savedBlocks.insertAtEnd
86
+ label: j.savedBlocks.insertAtEnd
84
87
  }), e;
85
- }), lt = p(() => {
86
- if (W.value === "end") return;
87
- if (W.value === "beginning") return 0;
88
- let e = F.content.value.blocks.findIndex((e) => e.id === W.value);
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);
89
92
  if (e !== -1) return e + 1;
90
93
  });
91
- e(() => it.visible, (e) => {
94
+ e(() => ot.visible, (e) => {
92
95
  if (e) {
93
- I.value = "", L.value = "", R.value = null, z.value = null, B.value = null;
94
- let e = F.state.selectedBlockId;
96
+ F.value = "", I.value = "", L.value = null, R.value = null, z.value = null;
97
+ let e = P.state.selectedBlockId;
95
98
  if (e) {
96
- let t = F.content.value.blocks.findIndex((t) => t.id === e);
97
- W.value = t === -1 ? "end" : e;
98
- } else W.value = "end";
99
+ let t = P.content.value.blocks.findIndex((t) => t.id === e);
100
+ U.value = t === -1 ? "end" : e;
101
+ } else U.value = "end";
99
102
  }
100
103
  }, { immediate: !0 });
101
- function ut(e) {
104
+ function dt(e) {
102
105
  let t = [], n = /* @__PURE__ */ new Set();
103
106
  for (let r of e.content) if (!n.has(r.type) && w[r.type] && (n.add(r.type), t.push({
104
107
  type: r.type,
@@ -112,59 +115,59 @@ var ge = {
112
115
  }
113
116
  function Y(e) {
114
117
  let t = e.updatedAt ?? e.createdAt;
115
- return t ? me(t, M.time, N) ?? "" : "";
118
+ return t ? me(t, j.time, M) ?? "" : "";
116
119
  }
117
- function dt(e) {
120
+ function ft(e) {
118
121
  let t = e.updatedAt ?? e.createdAt;
119
- return t ? pe(t, ot) : "";
122
+ return t ? pe(t, ct) : "";
120
123
  }
121
- async function ft(e) {
124
+ async function pt(e) {
122
125
  try {
123
- await P.remove(e), R.value === e && (R.value = null);
126
+ await N.remove(e), L.value === e && (L.value = null);
124
127
  } finally {
125
- z.value = null;
128
+ R.value = null;
126
129
  }
127
130
  }
128
- async function pt(e) {
129
- P.canUpdateBlock(e) && (B.value = e.id, V.value = e.name, H.value = e.category ?? "", z.value = null, await te(), U.value?.focus(), U.value?.select());
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());
130
133
  }
131
134
  function X() {
132
- B.value = null, V.value = "", H.value = "";
135
+ z.value = null, B.value = "", V.value = "";
133
136
  }
134
137
  async function Z(e) {
135
- if (B.value !== e) return;
136
- let t = V.value.trim(), n = H.value.trim(), r = P.savedBlocks.value.find((t) => t.id === e), i = {};
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 = {};
137
140
  if (t && t !== r?.name && (i.name = t), n !== (r?.category ?? "") && (i.category = n), Object.keys(i).length === 0) {
138
141
  X();
139
142
  return;
140
143
  }
141
144
  try {
142
- await P.update(e, i);
145
+ await N.update(e, i);
143
146
  } finally {
144
147
  X();
145
148
  }
146
149
  }
147
- function mt(e, t) {
150
+ function ht(e, t) {
148
151
  let n = e.currentTarget, r = e.relatedTarget;
149
152
  r && n.contains(r) || Z(t);
150
153
  }
151
154
  function Q() {
152
- q.value && j("insert", q.value, lt.value);
155
+ K.value && A("insert", K.value, q.value);
153
156
  }
154
157
  function $() {
155
- j("close");
158
+ A("close");
156
159
  }
157
- function ht(e) {
158
- B.value || (e.key === "Escape" && $(), e.key === "Enter" && q.value && (e.preventDefault(), Q()));
160
+ function gt(e) {
161
+ z.value || (e.key === "Escape" && $(), e.key === "Enter" && K.value && (e.preventDefault(), Q()));
159
162
  }
160
163
  return (e, t) => (i(), _(he, {
161
164
  visible: o.visible,
162
165
  onClose: $,
163
- onKeydown: ht
166
+ onKeydown: gt
164
167
  }, {
165
168
  default: r(() => [y("div", ge, [
166
- y("div", _e, [y("h3", ve, x(l(M).savedBlocks.browse), 1), y("button", {
167
- "aria-label": l(M).savedBlocks.close,
169
+ y("div", _e, [y("h3", ve, x(l(j).savedBlocks.browse), 1), y("button", {
170
+ "aria-label": l(j).savedBlocks.close,
168
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)]",
169
172
  onClick: $
170
173
  }, [u(l(ue), {
@@ -177,145 +180,143 @@ var ge = {
177
180
  "stroke-width": 2,
178
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)]"
179
182
  }), s(y("input", {
180
- "onUpdate:modelValue": t[0] ||= (e) => I.value = e,
183
+ "onUpdate:modelValue": t[0] ||= (e) => F.value = e,
181
184
  type: "text",
182
- placeholder: l(M).savedBlocks.search,
183
- disabled: K.value,
185
+ placeholder: l(j).savedBlocks.search,
186
+ disabled: G.value,
184
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)]"
185
- }, null, 8, we), [[v, I.value]])]), l(P).categories.value.length > 0 ? s((i(), m("select", {
188
+ }, null, 8, we), [[v, F.value]])]), l(N).categories.value.length > 0 ? s((i(), m("select", {
186
189
  key: 0,
187
- "onUpdate:modelValue": t[1] ||= (e) => L.value = e,
190
+ "onUpdate:modelValue": t[1] ||= (e) => I.value = e,
188
191
  "data-testid": "saved-blocks-category-filter",
189
- "aria-label": l(M).savedBlocks.filterByCategory,
192
+ "aria-label": l(j).savedBlocks.filterByCategory,
190
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)]"
191
- }, [y("option", T, x(l(M).savedBlocks.allCategories), 1), (i(!0), m(b, null, n(l(P).categories.value, (e) => (i(), m("option", {
194
+ }, [y("option", T, x(l(j).savedBlocks.allCategories), 1), (i(!0), m(b, null, n(l(N).categories.value, (e) => (i(), m("option", {
192
195
  key: e,
193
196
  value: e
194
- }, x(e), 9, E))), 128))], 8, Te)), [[c, L.value]]) : h("", !0)]),
195
- y("datalist", D, [(i(!0), m(b, null, n(l(P).categories.value, (e) => (i(), m("option", {
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", {
196
199
  key: e,
197
200
  value: e
198
201
  }, null, 8, O))), 128))]),
199
- y("div", Ee, [K.value ? (i(), m("div", {
202
+ y("div", Ee, [G.value ? (i(), m("div", {
200
203
  key: 0,
201
204
  "data-testid": "saved-blocks-loading",
202
205
  class: "tpl:flex tpl:flex-col tpl:gap-1",
203
206
  role: "status",
204
207
  "aria-busy": "true",
205
- "aria-label": l(M).savedBlocks.loading
208
+ "aria-label": l(j).savedBlocks.loading
206
209
  }, [(i(), m(b, null, n(3, (e) => y("div", {
207
210
  key: e,
208
211
  "aria-hidden": "true",
209
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)]"
210
- }, [...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)) : G.value.length > 0 ? (i(), m("div", Oe, [(i(!0), m(b, null, n(G.value, (e) => (i(), m(b, { key: e.id }, [B.value === e.id ? (i(), m("div", {
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", {
211
214
  key: 0,
212
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)]",
213
216
  style: { "background-color": "var(--tpl-primary-light)" },
214
- onFocusout: (t) => mt(t, e.id)
217
+ onFocusout: (t) => ht(t, e.id)
215
218
  }, [s(y("input", {
216
219
  ref_for: !0,
217
- ref: (e) => U.value = e,
218
- "onUpdate:modelValue": t[2] ||= (e) => V.value = e,
220
+ ref: (e) => H.value = e,
221
+ "onUpdate:modelValue": t[2] ||= (e) => B.value = e,
219
222
  type: "text",
220
- "aria-label": l(M).savedBlocks.rename,
223
+ "aria-label": l(j).savedBlocks.rename,
221
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)]",
222
225
  onKeydown: [d(g((t) => Z(e.id), ["prevent", "stop"]), ["enter"]), t[3] ||= d(g((e) => X(), ["prevent", "stop"]), ["esc"])]
223
- }, null, 40, Ae), [[v, V.value]]), s(y("input", {
224
- "onUpdate:modelValue": t[4] ||= (e) => H.value = e,
226
+ }, null, 40, Ae), [[v, B.value]]), s(y("input", {
227
+ "onUpdate:modelValue": t[4] ||= (e) => V.value = e,
225
228
  type: "text",
226
229
  "data-testid": "saved-blocks-edit-category",
227
- "aria-label": l(M).savedBlocks.category,
228
- placeholder: l(M).savedBlocks.categoryPlaceholder,
230
+ "aria-label": l(j).savedBlocks.category,
231
+ placeholder: l(j).savedBlocks.categoryPlaceholder,
229
232
  list: "tpl-saved-block-browser-categories",
230
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)]",
231
234
  onKeydown: [d(g((t) => Z(e.id), ["prevent", "stop"]), ["enter"]), t[5] ||= d(g((e) => X(), ["prevent", "stop"]), ["esc"])]
232
- }, null, 40, je), [[v, H.value]])], 40, ke)) : (i(), m("button", {
235
+ }, null, 40, je), [[v, V.value]])], 40, ke)) : (i(), m("div", {
233
236
  key: 1,
234
- type: "button",
235
237
  "data-testid": "saved-block-card",
236
- "aria-pressed": R.value === e.id,
237
- 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]",
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]",
238
239
  style: ne({
239
- borderColor: R.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
240
- backgroundColor: R.value === e.id ? "var(--tpl-primary-light)" : "transparent"
240
+ borderColor: L.value === e.id ? "var(--tpl-primary)" : "var(--tpl-border)",
241
+ backgroundColor: L.value === e.id ? "var(--tpl-primary-light)" : "transparent"
241
242
  }),
242
- onClick: (t) => R.value = e.id
243
- }, [
244
- y("div", Ne, [y("span", Pe, x(e.name), 1), y("span", Fe, x(l(N)(l(M).savedBlocks.blockCount, { count: e.content.length })), 1)]),
245
- e.category ? (i(), m("div", Ie, [y("span", Le, x(e.category), 1)])) : h("", !0),
246
- y("div", Re, [
247
- (i(!0), m(b, null, n(ut(e), (e) => (i(), _(ee(e.icon), {
248
- key: e.type,
249
- size: 14,
250
- "stroke-width": 1.5,
251
- class: "tpl:text-[var(--tpl-text-dim)]"
252
- }))), 128)),
253
- J(e) > 0 ? (i(), m("span", ze, " +" + x(J(e)), 1)) : h("", !0),
254
- Y(e) ? (i(), m("span", {
255
- key: 1,
256
- "data-testid": "saved-block-updated",
257
- class: "tpl:ml-1 tpl:truncate tpl:text-[10px] tpl:text-[var(--tpl-text-dim)]",
258
- title: dt(e)
259
- }, x(Y(e)), 9, Be)) : h("", !0),
260
- z.value === e.id ? (i(), m("button", {
261
- key: 2,
262
- "aria-label": l(M).savedBlocks.deleteConfirm,
263
- 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)]",
264
- style: { "background-color": "transparent" },
265
- onClick: g((t) => ft(e.id), ["stop"])
266
- }, x(l(M).savedBlocks.deleteConfirm), 9, Ve)) : (i(), m(b, { key: 3 }, [l(P).canUpdateBlock(e) ? (i(), m("button", {
267
- key: 0,
268
- 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)]",
269
- "aria-label": l(M).savedBlocks.rename,
270
- title: l(M).savedBlocks.rename,
271
- onClick: g((t) => pt(e), ["stop"])
272
- }, [u(l(de), {
273
- size: 12,
274
- "stroke-width": 1.5
275
- })], 8, He)) : h("", !0), l(P).canDeleteBlock(e) ? (i(), m("button", {
276
- key: 1,
277
- 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(P).canUpdateBlock(e) }]),
278
- "aria-label": l(M).savedBlocks.delete,
279
- title: l(M).savedBlocks.delete,
280
- onClick: g((t) => z.value = e.id, ["stop"])
281
- }, [u(l(le), {
282
- size: 12,
283
- "stroke-width": 1.5
284
- })], 10, Ue)) : h("", !0)], 64))
285
- ])
286
- ], 12, Me))], 64))), 128))])) : (i(), m("div", We, [u(l(C), {
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), {
287
288
  size: 32,
288
289
  "stroke-width": 1,
289
290
  class: "tpl:text-[var(--tpl-text-dim)]"
290
- }), st.value ? (i(), m("p", k, x(l(M).savedBlocks.noResults), 1)) : (i(), m(b, { key: 1 }, [y("p", Ge, x(l(M).savedBlocks.empty), 1), y("p", Ke, x(l(M).savedBlocks.emptyHint), 1)], 64))]))])
291
- ]), y("div", qe, [q.value ? (i(), m("div", Je, [y("div", Ye, [u(l(at), { blocks: q.value.content }, null, 8, ["blocks"])])])) : (i(), m("div", Xe, [u(l(C), {
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), {
292
293
  size: 32,
293
294
  "stroke-width": 1,
294
295
  class: "tpl:text-[var(--tpl-text-dim)]"
295
- }), y("p", Ze, x(l(M).savedBlocks.selectToPreview), 1)]))])]),
296
- y("div", Qe, [y("div", $e, [y("label", et, x(l(M).savedBlocks.insertPosition), 1), s(y("select", {
297
- "onUpdate:modelValue": t[6] ||= (e) => W.value = e,
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,
298
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)]"
299
- }, [(i(!0), m(b, null, n(ct.value, (e) => (i(), m("option", {
300
+ }, [(i(!0), m(b, null, n(ut.value, (e) => (i(), m("option", {
300
301
  key: e.value,
301
302
  value: e.value
302
- }, x(e.label), 9, tt))), 128))], 512), [[c, W.value]])]), y("div", nt, [y("button", {
303
+ }, x(e.label), 9, rt))), 128))], 512), [[c, U.value]])]), y("div", it, [y("button", {
303
304
  type: "button",
304
305
  "data-testid": "saved-blocks-browser-close",
305
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)]",
306
307
  onClick: $
307
- }, x(l(M).savedBlocks.close), 1), y("button", {
308
+ }, x(l(j).savedBlocks.close), 1), y("button", {
308
309
  type: "button",
309
310
  class: f(l(fe)),
310
- disabled: !q.value,
311
+ disabled: !K.value,
311
312
  onClick: Q
312
- }, x(l(M).savedBlocks.insert), 11, rt)])])
313
+ }, x(l(j).savedBlocks.insert), 11, at)])])
313
314
  ])]),
314
315
  _: 1
315
316
  }, 8, ["visible"]));
316
317
  }
317
318
  });
318
319
  //#endregion
319
- export { A as default };
320
+ export { k as default };
320
321
 
321
- //# sourceMappingURL=SavedBlocksBrowserModal-D3JF-Gx-.js.map
322
+ //# sourceMappingURL=SavedBlocksBrowserModal-CliZBxHo.js.map