@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.
- package/dist/{SavedBlocksBrowserModal-C4J-_cW8.js → SavedBlocksBrowserModal-DeUo5aFV.js} +79 -78
- package/dist/{SavedBlocksPanels-DBoqC6df.js → SavedBlocksPanels-DNpnl5cO.js} +1 -1
- package/dist/bundle-stats.json +6 -6
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D3JF-Gx-.js → SavedBlocksBrowserModal-CliZBxHo.js} +134 -133
- package/dist/cdn/chunks/SavedBlocksBrowserModal-CliZBxHo.js.map +1 -0
- package/dist/cdn/chunks/{SavedBlocksPanels-Cxbgby24.js → SavedBlocksPanels-lW7PMvJN.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-Cxbgby24.js.map → SavedBlocksPanels-lW7PMvJN.js.map} +1 -1
- package/dist/cdn/chunks/{src-BmKDV_BK.js → src-D_l1LAxs.js} +2 -2
- package/dist/cdn/chunks/{src-BmKDV_BK.js.map → src-D_l1LAxs.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +99 -74
- package/dist/cdn/editor.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +275 -250
- package/package.json +9 -9
- package/dist/cdn/chunks/SavedBlocksBrowserModal-D3JF-Gx-.js.map +0 -1
package/dist/cdn/chunks/{SavedBlocksBrowserModal-D3JF-Gx-.js → SavedBlocksBrowserModal-CliZBxHo.js}
RENAMED
|
@@ -29,76 +29,79 @@ var ge = {
|
|
|
29
29
|
"aria-label",
|
|
30
30
|
"placeholder",
|
|
31
31
|
"onKeydown"
|
|
32
|
-
], Me = ["
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
44
|
+
}, Ve = ["title"], He = ["aria-label", "onClick"], Ue = [
|
|
42
45
|
"aria-label",
|
|
43
46
|
"title",
|
|
44
47
|
"onClick"
|
|
45
|
-
],
|
|
48
|
+
], We = [
|
|
46
49
|
"aria-label",
|
|
47
50
|
"title",
|
|
48
51
|
"onClick"
|
|
49
|
-
],
|
|
52
|
+
], Ge = {
|
|
50
53
|
key: 2,
|
|
51
54
|
class: "tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:py-12"
|
|
52
|
-
},
|
|
55
|
+
}, Ke = {
|
|
53
56
|
key: 0,
|
|
54
57
|
class: "tpl:mt-2 tpl:text-xs tpl:text-[var(--tpl-text-dim)]"
|
|
55
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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:
|
|
66
|
-
let
|
|
67
|
-
let e =
|
|
68
|
-
return
|
|
69
|
-
}),
|
|
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:
|
|
73
|
-
}], t =
|
|
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:
|
|
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:
|
|
86
|
+
label: j.savedBlocks.insertAtEnd
|
|
84
87
|
}), e;
|
|
85
|
-
}),
|
|
86
|
-
if (
|
|
87
|
-
if (
|
|
88
|
-
let 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);
|
|
89
92
|
if (e !== -1) return e + 1;
|
|
90
93
|
});
|
|
91
|
-
e(() =>
|
|
94
|
+
e(() => ot.visible, (e) => {
|
|
92
95
|
if (e) {
|
|
93
|
-
|
|
94
|
-
let e =
|
|
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 =
|
|
97
|
-
|
|
98
|
-
} else
|
|
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
|
|
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,
|
|
118
|
+
return t ? me(t, j.time, M) ?? "" : "";
|
|
116
119
|
}
|
|
117
|
-
function
|
|
120
|
+
function ft(e) {
|
|
118
121
|
let t = e.updatedAt ?? e.createdAt;
|
|
119
|
-
return t ? pe(t,
|
|
122
|
+
return t ? pe(t, ct) : "";
|
|
120
123
|
}
|
|
121
|
-
async function
|
|
124
|
+
async function pt(e) {
|
|
122
125
|
try {
|
|
123
|
-
await
|
|
126
|
+
await N.remove(e), L.value === e && (L.value = null);
|
|
124
127
|
} finally {
|
|
125
|
-
|
|
128
|
+
R.value = null;
|
|
126
129
|
}
|
|
127
130
|
}
|
|
128
|
-
async function
|
|
129
|
-
|
|
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
|
-
|
|
135
|
+
z.value = null, B.value = "", V.value = "";
|
|
133
136
|
}
|
|
134
137
|
async function Z(e) {
|
|
135
|
-
if (
|
|
136
|
-
let t =
|
|
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
|
|
145
|
+
await N.update(e, i);
|
|
143
146
|
} finally {
|
|
144
147
|
X();
|
|
145
148
|
}
|
|
146
149
|
}
|
|
147
|
-
function
|
|
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
|
-
|
|
155
|
+
K.value && A("insert", K.value, q.value);
|
|
153
156
|
}
|
|
154
157
|
function $() {
|
|
155
|
-
|
|
158
|
+
A("close");
|
|
156
159
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
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:
|
|
166
|
+
onKeydown: gt
|
|
164
167
|
}, {
|
|
165
168
|
default: r(() => [y("div", ge, [
|
|
166
|
-
y("div", _e, [y("h3", ve, x(l(
|
|
167
|
-
"aria-label": l(
|
|
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) =>
|
|
183
|
+
"onUpdate:modelValue": t[0] ||= (e) => F.value = e,
|
|
181
184
|
type: "text",
|
|
182
|
-
placeholder: l(
|
|
183
|
-
disabled:
|
|
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,
|
|
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) =>
|
|
190
|
+
"onUpdate:modelValue": t[1] ||= (e) => I.value = e,
|
|
188
191
|
"data-testid": "saved-blocks-category-filter",
|
|
189
|
-
"aria-label": l(
|
|
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(
|
|
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,
|
|
195
|
-
y("datalist", D, [(i(!0), m(b, null, n(l(
|
|
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, [
|
|
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(
|
|
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)) :
|
|
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) =>
|
|
217
|
+
onFocusout: (t) => ht(t, e.id)
|
|
215
218
|
}, [s(y("input", {
|
|
216
219
|
ref_for: !0,
|
|
217
|
-
ref: (e) =>
|
|
218
|
-
"onUpdate:modelValue": t[2] ||= (e) =>
|
|
220
|
+
ref: (e) => H.value = e,
|
|
221
|
+
"onUpdate:modelValue": t[2] ||= (e) => B.value = e,
|
|
219
222
|
type: "text",
|
|
220
|
-
"aria-label": l(
|
|
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,
|
|
224
|
-
"onUpdate:modelValue": t[4] ||= (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(
|
|
228
|
-
placeholder: l(
|
|
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,
|
|
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
|
-
"
|
|
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:
|
|
240
|
-
backgroundColor:
|
|
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) =>
|
|
243
|
-
}, [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
])
|
|
286
|
-
], 12, Me))], 64))), 128))])) : (i(), m("div",
|
|
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
|
-
}),
|
|
291
|
-
]), y("div",
|
|
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",
|
|
296
|
-
y("div",
|
|
297
|
-
"onUpdate:modelValue": t[6] ||= (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(
|
|
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,
|
|
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(
|
|
308
|
+
}, x(l(j).savedBlocks.close), 1), y("button", {
|
|
308
309
|
type: "button",
|
|
309
310
|
class: f(l(fe)),
|
|
310
|
-
disabled: !
|
|
311
|
+
disabled: !K.value,
|
|
311
312
|
onClick: Q
|
|
312
|
-
}, x(l(
|
|
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 {
|
|
320
|
+
export { k as default };
|
|
320
321
|
|
|
321
|
-
//# sourceMappingURL=SavedBlocksBrowserModal-
|
|
322
|
+
//# sourceMappingURL=SavedBlocksBrowserModal-CliZBxHo.js.map
|