@vue/devtools-electron 8.0.2 → 8.0.4

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 (30) hide show
  1. package/client/IconTitle.vue_vue_type_script_setup_true_lang-DP32G0tf.js +25 -0
  2. package/client/{SectionBlock-xKhegVP9.js → SectionBlock-COywJh9H.js} +32 -32
  3. package/client/assets-CtLN4HSW.js +1049 -0
  4. package/client/{components-BrOQ-ofv.js → components-D9hzDL5e.js} +3 -3
  5. package/client/{custom-inspector-tab-view-CkdhUYIP.js → custom-inspector-tab-view-CgbC8V32.js} +3 -3
  6. package/client/{custom-tab-view-B5kvwrLc.js → custom-tab-view-Nv2OEHgp.js} +3 -3
  7. package/client/devtools-panel.css +1 -1
  8. package/client/devtools-panel.js +1 -1
  9. package/client/{graph-CFurbIKf.js → graph-D2U6Ko6A.js} +24173 -23913
  10. package/client/{index-i0Vo12ev.js → index-BLVlznEl.js} +15848 -16028
  11. package/client/{overview-BJSdT74g.js → overview-B1jXzkLb.js} +2 -2
  12. package/client/{pages-IcPQYatG.js → pages-CD3Vo3bP.js} +128 -128
  13. package/client/pinia-iCYu-5A6.js +11 -0
  14. package/client/{router-Dw9ZK4h3.js → router-BZFemq6K.js} +1 -1
  15. package/client/{settings-kuD3Maam.js → settings-Dkkin8YR.js} +11 -11
  16. package/client/{timeline-BeMBNQIL.js → timeline-B5nTW0v0.js} +38 -38
  17. package/dist/cli.cjs +4 -4
  18. package/dist/cli.mjs +4 -4
  19. package/dist/devtools.js +286 -311
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/user-app.cjs +1 -1
  23. package/dist/user-app.iife.js +55 -55
  24. package/dist/user-app.js +1 -1
  25. package/package.json +7 -8
  26. package/client/IconTitle.vue_vue_type_script_setup_true_lang-Dw_OETO7.js +0 -25
  27. package/client/assets-_5Yea5Fb.js +0 -1049
  28. package/client/color-scheme.js +0 -6
  29. package/client/logo.svg +0 -208
  30. package/client/pinia-DKTNMgsj.js +0 -11
@@ -1,1049 +0,0 @@
1
- import { d as T, aq as re, ay as Z, i as _, a7 as le, c as p, a as P, o as a, b as r, F as z, s as F, n as M, u as s, t as x, q as C, a6 as ae, e as S, w as A, H as X, r as L, M as Q, T as E, ak as W, az as ue, av as se, Y as de, aA as Y, aa as ce, p as D, S as ne, f as ee, U as q, a5 as oe, aB as pe, ax as H, y as J, aj as te, a8 as he, aC as fe, aD as me, aw as ve, a0 as ye, at as ge, I as be, J as we, V as _e } from "./index-i0Vo12ev.js";
2
- import { _ as $e } from "./SectionBlock-xKhegVP9.js";
3
- import { _ as xe } from "./IconTitle.vue_vue_type_script_setup_true_lang-Dw_OETO7.js";
4
- const ke = {
5
- key: 0,
6
- relative: "",
7
- "code-block": ""
8
- }, Be = {
9
- flex: "~ wrap",
10
- "w-full": ""
11
- }, Ce = ["onClick"], Ae = {
12
- flex: "~ gap-2",
13
- px3: "",
14
- pb3: ""
15
- }, Pe = /* @__PURE__ */ T({
16
- __name: "CodeSnippets",
17
- props: {
18
- codeSnippets: {},
19
- eventType: {}
20
- },
21
- setup(f) {
22
- const n = f, e = re(n.codeSnippets[0]), { copy: t } = Z(), i = _(() => e.value?.lang || "text");
23
- return le(() => {
24
- n.codeSnippets.includes(e.value) || (e.value = n.codeSnippets[0]);
25
- }), (o, l) => o.codeSnippets.length ? (a(), p("div", ke, [
26
- r("div", Be, [
27
- (a(!0), p(z, null, F(o.codeSnippets, (d, m) => (a(), p("button", {
28
- key: m,
29
- px4: "",
30
- py2: "",
31
- border: "r base",
32
- hover: "bg-active",
33
- class: M(d === s(e) ? "" : "border-b"),
34
- onClick: (v) => e.value = d
35
- }, [
36
- r("div", {
37
- class: M(d === s(e) ? "" : "op30"),
38
- "font-mono": ""
39
- }, x(d.name), 3)
40
- ], 10, Ce))), 128)),
41
- l[1] || (l[1] = r("div", {
42
- border: "b base",
43
- "flex-auto": ""
44
- }, null, -1))
45
- ]),
46
- s(e) ? (a(), p(z, { key: 0 }, [
47
- C(s(ae), {
48
- code: s(e).code,
49
- lang: s(i),
50
- lines: !1,
51
- "w-full": "",
52
- "of-auto": "",
53
- p3: ""
54
- }, null, 8, ["code", "lang"]),
55
- r("div", Ae, [
56
- C(s(Q), {
57
- onClick: l[0] || (l[0] = (d) => s(t)(s(e).code, { silent: !1, type: o.eventType || `code-snippet-${s(e).name}` }))
58
- }, {
59
- icon: A(() => [
60
- L(o.$slots, "i-carbon-copy")
61
- ]),
62
- default: A(() => [
63
- l[2] || (l[2] = X(" Copy ", -1))
64
- ]),
65
- _: 3
66
- }),
67
- s(e)?.docs ? (a(), S(s(Q), {
68
- key: 0,
69
- to: s(e).docs,
70
- target: "_blank"
71
- }, {
72
- icon: A(() => [
73
- L(o.$slots, "i-carbon-catalog")
74
- ]),
75
- default: A(() => [
76
- l[3] || (l[3] = X(" Docs ", -1))
77
- ]),
78
- _: 3
79
- }, 8, ["to"])) : P("", !0)
80
- ])
81
- ], 64)) : P("", !0)
82
- ])) : P("", !0);
83
- }
84
- }), Se = ["title"], ze = /* @__PURE__ */ T({
85
- __name: "FilepathItem",
86
- props: {
87
- filepath: {},
88
- lineBreak: { type: Boolean },
89
- subpath: { type: Boolean }
90
- },
91
- setup(f) {
92
- const n = f, e = _(
93
- () => ({ path: n.filepath })
94
- ), { copy: t } = Z();
95
- return (i, o) => E((a(), p("button", {
96
- "font-mono": "",
97
- "hover:underline": "",
98
- class: M(i.lineBreak ? "" : "ws-nowrap of-hidden truncate"),
99
- title: i.filepath,
100
- onClick: o[0] || (o[0] = (l) => s(t)(i.filepath))
101
- }, [
102
- X(x(s(e).path), 1)
103
- ], 10, Se)), [
104
- [s(W), "Copy file path"]
105
- ]);
106
- }
107
- });
108
- function je(f) {
109
- return typeof f == "string" ? `'${f}'` : new Ve().serialize(f);
110
- }
111
- const Ve = /* @__PURE__ */ (function() {
112
- class f {
113
- #e = /* @__PURE__ */ new Map();
114
- compare(e, t) {
115
- const i = typeof e, o = typeof t;
116
- return i === "string" && o === "string" ? e.localeCompare(t) : i === "number" && o === "number" ? e - t : String.prototype.localeCompare.call(this.serialize(e, !0), this.serialize(t, !0));
117
- }
118
- serialize(e, t) {
119
- if (e === null) return "null";
120
- switch (typeof e) {
121
- case "string":
122
- return t ? e : `'${e}'`;
123
- case "bigint":
124
- return `${e}n`;
125
- case "object":
126
- return this.$object(e);
127
- case "function":
128
- return this.$function(e);
129
- }
130
- return String(e);
131
- }
132
- serializeObject(e) {
133
- const t = Object.prototype.toString.call(e);
134
- if (t !== "[object Object]") return this.serializeBuiltInType(t.length < 10 ? `unknown:${t}` : t.slice(8, -1), e);
135
- const i = e.constructor, o = i === Object || i === void 0 ? "" : i.name;
136
- if (o !== "" && globalThis[o] === i) return this.serializeBuiltInType(o, e);
137
- if (typeof e.toJSON == "function") {
138
- const l = e.toJSON();
139
- return o + (l !== null && typeof l == "object" ? this.$object(l) : `(${this.serialize(l)})`);
140
- }
141
- return this.serializeObjectEntries(o, Object.entries(e));
142
- }
143
- serializeBuiltInType(e, t) {
144
- const i = this["$" + e];
145
- if (i) return i.call(this, t);
146
- if (typeof t?.entries == "function") return this.serializeObjectEntries(e, t.entries());
147
- throw new Error(`Cannot serialize ${e}`);
148
- }
149
- serializeObjectEntries(e, t) {
150
- const i = Array.from(t).sort((l, d) => this.compare(l[0], d[0]));
151
- let o = `${e}{`;
152
- for (let l = 0; l < i.length; l++) {
153
- const [d, m] = i[l];
154
- o += `${this.serialize(d, !0)}:${this.serialize(m)}`, l < i.length - 1 && (o += ",");
155
- }
156
- return o + "}";
157
- }
158
- $object(e) {
159
- let t = this.#e.get(e);
160
- return t === void 0 && (this.#e.set(e, `#${this.#e.size}`), t = this.serializeObject(e), this.#e.set(e, t)), t;
161
- }
162
- $function(e) {
163
- const t = Function.prototype.toString.call(e);
164
- return t.slice(-15) === "[native code] }" ? `${e.name || ""}()[native]` : `${e.name}(${e.length})${t.replace(/\s*\n\s*/g, "")}`;
165
- }
166
- $Array(e) {
167
- let t = "[";
168
- for (let i = 0; i < e.length; i++) t += this.serialize(e[i]), i < e.length - 1 && (t += ",");
169
- return t + "]";
170
- }
171
- $Date(e) {
172
- try {
173
- return `Date(${e.toISOString()})`;
174
- } catch {
175
- return "Date(null)";
176
- }
177
- }
178
- $ArrayBuffer(e) {
179
- return `ArrayBuffer[${new Uint8Array(e).join(",")}]`;
180
- }
181
- $Set(e) {
182
- return `Set${this.$Array(Array.from(e).sort((t, i) => this.compare(t, i)))}`;
183
- }
184
- $Map(e) {
185
- return this.serializeObjectEntries("Map", e.entries());
186
- }
187
- }
188
- for (const n of ["Error", "RegExp", "URL"]) f.prototype["$" + n] = function(e) {
189
- return `${n}(${e})`;
190
- };
191
- for (const n of ["Int8Array", "Uint8Array", "Uint8ClampedArray", "Int16Array", "Uint16Array", "Int32Array", "Uint32Array", "Float32Array", "Float64Array"]) f.prototype["$" + n] = function(e) {
192
- return `${n}[${e.join(",")}]`;
193
- };
194
- for (const n of ["BigInt64Array", "BigUint64Array"]) f.prototype["$" + n] = function(e) {
195
- return `${n}[${e.join("n,")}${e.length > 0 ? "n" : ""}]`;
196
- };
197
- return f;
198
- })(), Ie = [1779033703, -1150833019, 1013904242, -1521486534, 1359893119, -1694144372, 528734635, 1541459225], De = [1116352408, 1899447441, -1245643825, -373957723, 961987163, 1508970993, -1841331548, -1424204075, -670586216, 310598401, 607225278, 1426881987, 1925078388, -2132889090, -1680079193, -1046744716, -459576895, -272742522, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, -1740746414, -1473132947, -1341970488, -1084653625, -958395405, -710438585, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, -2117940946, -1838011259, -1564481375, -1474664885, -1035236496, -949202525, -778901479, -694614492, -200395387, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, -2067236844, -1933114872, -1866530822, -1538233109, -1090935817, -965641998], Te = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", O = [];
199
- class Ue {
200
- _data = new G();
201
- _hash = new G([...Ie]);
202
- _nDataBytes = 0;
203
- _minBufferSize = 0;
204
- finalize(n) {
205
- n && this._append(n);
206
- const e = this._nDataBytes * 8, t = this._data.sigBytes * 8;
207
- return this._data.words[t >>> 5] |= 128 << 24 - t % 32, this._data.words[(t + 64 >>> 9 << 4) + 14] = Math.floor(e / 4294967296), this._data.words[(t + 64 >>> 9 << 4) + 15] = e, this._data.sigBytes = this._data.words.length * 4, this._process(), this._hash;
208
- }
209
- _doProcessBlock(n, e) {
210
- const t = this._hash.words;
211
- let i = t[0], o = t[1], l = t[2], d = t[3], m = t[4], v = t[5], j = t[6], V = t[7];
212
- for (let w = 0; w < 64; w++) {
213
- if (w < 16) O[w] = n[e + w] | 0;
214
- else {
215
- const c = O[w - 15], u = (c << 25 | c >>> 7) ^ (c << 14 | c >>> 18) ^ c >>> 3, $ = O[w - 2], k = ($ << 15 | $ >>> 17) ^ ($ << 13 | $ >>> 19) ^ $ >>> 10;
216
- O[w] = u + O[w - 7] + k + O[w - 16];
217
- }
218
- const U = m & v ^ ~m & j, K = i & o ^ i & l ^ o & l, g = (i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22), h = (m << 26 | m >>> 6) ^ (m << 21 | m >>> 11) ^ (m << 7 | m >>> 25), y = V + h + U + De[w] + O[w], I = g + K;
219
- V = j, j = v, v = m, m = d + y | 0, d = l, l = o, o = i, i = y + I | 0;
220
- }
221
- t[0] = t[0] + i | 0, t[1] = t[1] + o | 0, t[2] = t[2] + l | 0, t[3] = t[3] + d | 0, t[4] = t[4] + m | 0, t[5] = t[5] + v | 0, t[6] = t[6] + j | 0, t[7] = t[7] + V | 0;
222
- }
223
- _append(n) {
224
- typeof n == "string" && (n = G.fromUtf8(n)), this._data.concat(n), this._nDataBytes += n.sigBytes;
225
- }
226
- _process(n) {
227
- let e, t = this._data.sigBytes / 64;
228
- n ? t = Math.ceil(t) : t = Math.max((t | 0) - this._minBufferSize, 0);
229
- const i = t * 16, o = Math.min(i * 4, this._data.sigBytes);
230
- if (i) {
231
- for (let l = 0; l < i; l += 16) this._doProcessBlock(this._data.words, l);
232
- e = this._data.words.splice(0, i), this._data.sigBytes -= o;
233
- }
234
- return new G(e, o);
235
- }
236
- }
237
- class G {
238
- words;
239
- sigBytes;
240
- constructor(n, e) {
241
- n = this.words = n || [], this.sigBytes = e === void 0 ? n.length * 4 : e;
242
- }
243
- static fromUtf8(n) {
244
- const e = unescape(encodeURIComponent(n)), t = e.length, i = [];
245
- for (let o = 0; o < t; o++) i[o >>> 2] |= (e.charCodeAt(o) & 255) << 24 - o % 4 * 8;
246
- return new G(i, t);
247
- }
248
- toBase64() {
249
- const n = [];
250
- for (let e = 0; e < this.sigBytes; e += 3) {
251
- const t = this.words[e >>> 2] >>> 24 - e % 4 * 8 & 255, i = this.words[e + 1 >>> 2] >>> 24 - (e + 1) % 4 * 8 & 255, o = this.words[e + 2 >>> 2] >>> 24 - (e + 2) % 4 * 8 & 255, l = t << 16 | i << 8 | o;
252
- for (let d = 0; d < 4 && e * 8 + d * 6 < this.sigBytes * 8; d++) n.push(Te.charAt(l >>> 6 * (3 - d) & 63));
253
- }
254
- return n.join("");
255
- }
256
- concat(n) {
257
- if (this.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8, this.words.length = Math.ceil(this.sigBytes / 4), this.sigBytes % 4) for (let e = 0; e < n.sigBytes; e++) {
258
- const t = n.words[e >>> 2] >>> 24 - e % 4 * 8 & 255;
259
- this.words[this.sigBytes + e >>> 2] |= t << 24 - (this.sigBytes + e) % 4 * 8;
260
- }
261
- else for (let e = 0; e < n.sigBytes; e += 4) this.words[this.sigBytes + e >>> 2] = n.words[e >>> 2];
262
- this.sigBytes += n.sigBytes;
263
- }
264
- }
265
- function Oe(f) {
266
- return new Ue().finalize(f).toBase64();
267
- }
268
- function Fe(f) {
269
- return Oe(je(f));
270
- }
271
- const Ee = /* @__PURE__ */ T({
272
- __name: "AssetFontPreview",
273
- props: {
274
- asset: {}
275
- },
276
- setup(f) {
277
- const n = f, e = _(() => `devtools-assets-${Fe(n.asset)}`);
278
- return ue(_(() => `
279
- @font-face {
280
- font-family: '${e.value}';
281
- src: url('${n.asset.publicPath}');
282
- }
283
- `)), (t, i) => (a(), p("div", {
284
- "of-hidden": "",
285
- style: se({ fontFamily: `'${s(e)}'` })
286
- }, " Aa Bb Cc Dd Ee Ff Gg Hh Ii Jj Kk Ll Mm Nn Oo Pp Qq Rr Ss Tt Uu Vv Ww Xx Yy Zz ", 4));
287
- }
288
- }), Me = {
289
- flex: "",
290
- "items-center": "",
291
- "justify-center": "",
292
- "of-hidden": "",
293
- "bg-active": "",
294
- "object-cover": "",
295
- p1: ""
296
- }, Le = ["src"], Re = {
297
- key: 2,
298
- "i-carbon-document": "",
299
- "text-3xl": "",
300
- op20: ""
301
- }, Ne = {
302
- key: 3,
303
- "w-full": "",
304
- "self-start": "",
305
- p4: ""
306
- }, qe = ["textContent"], Je = { key: 4 }, Ge = ["src", "autoplay", "controls"], Xe = { key: 5 }, He = {
307
- key: 0,
308
- "i-carbon-volume-up": "",
309
- "text-3xl": "",
310
- op20: ""
311
- }, Ke = ["src"], We = {
312
- key: 6,
313
- "i-vscode-icons-file-type-wasm": "",
314
- "text-3xl": ""
315
- }, Ye = {
316
- key: 7,
317
- "i-carbon-help": "",
318
- "text-3xl": "",
319
- op20: ""
320
- }, ie = /* @__PURE__ */ T({
321
- __name: "AssetPreview",
322
- props: {
323
- asset: {},
324
- textContent: {},
325
- detail: { type: Boolean }
326
- },
327
- setup(f) {
328
- return (n, e) => {
329
- const t = Ee;
330
- return a(), p("div", Me, [
331
- n.asset.type === "image" ? (a(), p("img", {
332
- key: 0,
333
- src: n.asset.publicPath
334
- }, null, 8, Le)) : n.asset.type === "font" ? (a(), S(t, {
335
- key: n.asset.publicPath,
336
- asset: n.asset,
337
- "self-stretch": "",
338
- p2: "",
339
- "text-2xl": ""
340
- }, null, 8, ["asset"])) : n.asset.type === "text" && !n.textContent ? (a(), p("div", Re)) : n.asset.type === "text" && n.textContent ? (a(), p("div", Ne, [
341
- r("pre", {
342
- "max-h-10rem": "",
343
- "of-hidden": "",
344
- "text-xs": "",
345
- "font-mono": "",
346
- textContent: x(n.textContent)
347
- }, null, 8, qe)
348
- ])) : n.asset.type === "video" ? (a(), p("div", Je, [
349
- r("video", {
350
- src: n.asset.publicPath,
351
- autoplay: n.detail,
352
- controls: n.detail
353
- }, null, 8, Ge)
354
- ])) : n.asset.type === "audio" ? (a(), p("div", Xe, [
355
- n.detail ? (a(), p("audio", {
356
- key: 1,
357
- src: n.asset.publicPath,
358
- controls: ""
359
- }, null, 8, Ke)) : (a(), p("div", He))
360
- ])) : n.asset.type === "wasm" ? (a(), p("div", We)) : (a(), p("div", Ye))
361
- ]);
362
- };
363
- }
364
- }), Qe = {
365
- flex: "~ col gap-4",
366
- "min-h-full": "",
367
- "w-full": "",
368
- "of-hidden": "",
369
- p4: ""
370
- }, Ze = {
371
- flex: "~",
372
- "items-center": "",
373
- "justify-center": ""
374
- }, et = {
375
- "max-w-full": "",
376
- "w-full": "",
377
- "table-fixed": ""
378
- }, tt = {
379
- flex: "~ gap-1",
380
- "w-full": "",
381
- "items-center": ""
382
- }, st = {
383
- flex: "~ gap-1",
384
- "w-full": "",
385
- "items-center": "",
386
- "of-hidden": ""
387
- }, nt = {
388
- "flex-auto": "",
389
- "of-hidden": "",
390
- truncate: "",
391
- "ws-pre": "",
392
- "font-mono": ""
393
- }, ot = { capitalize: "" }, it = { key: 0 }, rt = { op70: "" }, lt = { flex: "~ gap2 wrap" }, at = /* @__PURE__ */ T({
394
- __name: "AssetDetails",
395
- props: {
396
- modelValue: {}
397
- },
398
- setup(f, { emit: n }) {
399
- const e = f, t = n, i = de(), o = ne(e, "modelValue", t, { passive: !0 }), l = _(() => i.vitePluginDetected.value), d = Y(() => H.value.getAssetImporters(o.value.publicPath).then((c) => c), []), m = _(() => ce.value), v = Y(() => {
400
- if (o.value.type === "image")
401
- return H.value.getImageMeta(o.value.filePath).then((c) => c);
402
- }), j = D(), V = D(0), w = Y(async () => {
403
- if (o.value.type !== "text")
404
- return;
405
- V.value;
406
- const c = await H.value.getTextAssetContent(o.value.filePath).then((u) => u);
407
- return j.value = c, c;
408
- }), U = _(() => {
409
- const c = [];
410
- if (o.value.type === "image") {
411
- const u = v.value?.width ? `
412
- width="${v.value.width}"
413
- height="${v.value.height}" ` : " ";
414
- return c.push(
415
- { lang: "vue-html", code: `<img${u}
416
- src="${o.value.publicPath}"
417
- />`, name: "Plain Image" }
418
- ), c;
419
- }
420
- return c.push({
421
- lang: "html",
422
- code: `<a download href="${o.value.publicPath}">
423
- Download ${o.value.path.split("/").slice(-1)[0]}
424
- </a>`,
425
- name: "Download link"
426
- }), c;
427
- }), { copy: K } = Z(), g = pe(() => o.value.mtime), h = _(() => {
428
- const c = o.value.size;
429
- return c < 1024 ? `${c} B` : c < 1024 * 1024 ? `${(c / 1024).toFixed(2)} KB` : `${(c / 1024 / 1024).toFixed(2)} MB`;
430
- }), y = _(() => {
431
- if (!v.value?.width || !v.value?.height)
432
- return "";
433
- const c = ($, k) => k ? c(k, $ % k) : $, u = c(v.value.width, v.value.height);
434
- return u > 3 ? `${v.value.width / u}:${v.value.height / u}` : "";
435
- }), I = _(() => [
436
- "image",
437
- "text",
438
- "video",
439
- "audio",
440
- "font"
441
- ].includes(o.value.type));
442
- return (c, u) => {
443
- const $ = ie, k = ze, R = oe("RouterLink"), b = Pe;
444
- return a(), p("div", Qe, [
445
- s(I) ? (a(), p(z, { key: 0 }, [
446
- u[2] || (u[2] = r("div", {
447
- flex: "~ gap2",
448
- "mb--2": "",
449
- "items-center": "",
450
- op50: ""
451
- }, [
452
- r("div", { "x-divider": "" }),
453
- r("div", { "flex-none": "" }, " Preview "),
454
- r("div", { "x-divider": "" })
455
- ], -1)),
456
- r("div", Ze, [
457
- C($, {
458
- detail: "",
459
- "max-h-80": "",
460
- "min-h-20": "",
461
- "min-w-20": "",
462
- "w-auto": "",
463
- rounded: "",
464
- border: "~ base",
465
- asset: s(o),
466
- "text-content": s(w)
467
- }, null, 8, ["asset", "text-content"])
468
- ])
469
- ], 64)) : P("", !0),
470
- u[12] || (u[12] = r("div", {
471
- flex: "~ gap2",
472
- "mb--2": "",
473
- "items-center": "",
474
- op50: ""
475
- }, [
476
- r("div", { "x-divider": "" }),
477
- r("div", { "flex-none": "" }, " Details "),
478
- r("div", { "x-divider": "" })
479
- ], -1)),
480
- r("table", et, [
481
- r("tbody", null, [
482
- r("tr", null, [
483
- u[3] || (u[3] = r("td", {
484
- "w-30": "",
485
- "ws-nowrap": "",
486
- pr5: "",
487
- "text-right": "",
488
- op50: ""
489
- }, " Filepath ", -1)),
490
- r("td", null, [
491
- r("div", tt, [
492
- C(k, {
493
- filepath: s(o).filePath,
494
- "text-left": ""
495
- }, null, 8, ["filepath"]),
496
- s(l) && s(m) ? E((a(), S(s(q), {
497
- key: 0,
498
- title: "Open in Editor",
499
- icon: "i-carbon-launch",
500
- action: "",
501
- "flex-none": "",
502
- border: !1,
503
- onClick: u[0] || (u[0] = (B) => s(ee)(s(o).filePath))
504
- }, null, 512)), [
505
- [s(W), "Open in Editor"]
506
- ]) : P("", !0)
507
- ])
508
- ])
509
- ]),
510
- r("tr", null, [
511
- u[4] || (u[4] = r("td", {
512
- "w-30": "",
513
- "ws-nowrap": "",
514
- pr5: "",
515
- "text-right": "",
516
- op50: ""
517
- }, " Public Path ", -1)),
518
- r("td", null, [
519
- r("div", st, [
520
- r("div", nt, x(s(o).publicPath), 1),
521
- E(C(s(q), {
522
- title: "Copy public path",
523
- icon: "i-carbon-copy",
524
- action: "",
525
- mr1: "",
526
- "mt--2px": "",
527
- "flex-none": "",
528
- border: !1,
529
- onClick: u[1] || (u[1] = (B) => s(K)(s(o).publicPath, { type: "assets-public-path" }))
530
- }, null, 512), [
531
- [s(W), "Copy public path"]
532
- ]),
533
- C(R, {
534
- to: s(o).publicPath,
535
- target: "_blank"
536
- }, {
537
- default: A(() => [
538
- E(C(s(q), {
539
- icon: "i-carbon-launch",
540
- action: "",
541
- "flex-none": "",
542
- border: !1,
543
- title: "Open in Browser"
544
- }, null, 512), [
545
- [s(W), "Open in Browser"]
546
- ])
547
- ]),
548
- _: 1
549
- }, 8, ["to"])
550
- ])
551
- ])
552
- ]),
553
- r("tr", null, [
554
- u[5] || (u[5] = r("td", {
555
- "w-30": "",
556
- "ws-nowrap": "",
557
- pr5: "",
558
- "text-right": "",
559
- op50: ""
560
- }, " Type ", -1)),
561
- r("td", ot, x(s(o).type), 1)
562
- ]),
563
- s(v)?.width ? (a(), p(z, { key: 0 }, [
564
- r("tr", null, [
565
- u[6] || (u[6] = r("td", {
566
- "w-30": "",
567
- "ws-nowrap": "",
568
- pr5: "",
569
- "text-right": "",
570
- op50: ""
571
- }, " Image Size ", -1)),
572
- r("td", null, x(s(v).width) + " x " + x(s(v).height), 1)
573
- ]),
574
- s(y) ? (a(), p("tr", it, [
575
- u[7] || (u[7] = r("td", {
576
- "w-30": "",
577
- "ws-nowrap": "",
578
- pr5: "",
579
- "text-right": "",
580
- op50: ""
581
- }, " Aspect Ratio ", -1)),
582
- r("td", null, x(s(y)), 1)
583
- ])) : P("", !0)
584
- ], 64)) : P("", !0),
585
- r("tr", null, [
586
- u[8] || (u[8] = r("td", {
587
- "w-30": "",
588
- "ws-nowrap": "",
589
- pr5: "",
590
- "text-right": "",
591
- op50: ""
592
- }, " File size ", -1)),
593
- r("td", null, x(s(h)), 1)
594
- ]),
595
- r("tr", null, [
596
- u[9] || (u[9] = r("td", {
597
- "w-30": "",
598
- "ws-nowrap": "",
599
- pr5: "",
600
- "text-right": "",
601
- op50: ""
602
- }, " Last modified ", -1)),
603
- r("td", null, [
604
- X(x(new Date(s(o).mtime).toLocaleString()) + " ", 1),
605
- r("span", rt, "(" + x(s(g)) + ")", 1)
606
- ])
607
- ]),
608
- r("tr", null, [
609
- u[10] || (u[10] = r("td", {
610
- "w-30": "",
611
- "ws-nowrap": "",
612
- pr5: "",
613
- "text-right": "",
614
- "align-top": "",
615
- op50: ""
616
- }, " Importers ", -1)),
617
- r("td", null, [
618
- s(d).length > 0 ? (a(!0), p(z, { key: 0 }, F(s(d), (B) => (a(), p("div", {
619
- key: B.url,
620
- flex: "~ gap-1",
621
- "w-full": "",
622
- "items-center": ""
623
- }, [
624
- C(k, {
625
- filepath: B.id || B.url,
626
- "text-left": ""
627
- }, null, 8, ["filepath"]),
628
- s(i).vitePluginDetected.value && s(m) && B.id ? E((a(), S(s(q), {
629
- key: 0,
630
- title: "Open in Editor",
631
- icon: "i-carbon-launch",
632
- action: "",
633
- "flex-none": "",
634
- border: !1,
635
- onClick: (N) => s(ee)(B.id)
636
- }, null, 8, ["onClick"])), [
637
- [s(W), "Open in Editor"]
638
- ]) : P("", !0)
639
- ]))), 128)) : (a(), p(z, { key: 1 }, [
640
- X(" None ")
641
- ], 64))
642
- ])
643
- ])
644
- ])
645
- ]),
646
- u[13] || (u[13] = r("div", {
647
- flex: "~ gap2",
648
- "mb--2": "",
649
- "items-center": "",
650
- op50: ""
651
- }, [
652
- r("div", { "x-divider": "" }),
653
- r("div", { "flex-none": "" }, " Actions "),
654
- r("div", { "x-divider": "" })
655
- ], -1)),
656
- r("div", lt, [
657
- C(s(Q), {
658
- to: s(o).publicPath,
659
- download: "",
660
- target: "_blank"
661
- }, {
662
- icon: A(() => [
663
- L(c.$slots, "i-carbon-download")
664
- ]),
665
- default: A(() => [
666
- u[11] || (u[11] = X(" Download ", -1))
667
- ]),
668
- _: 3
669
- }, 8, ["to"])
670
- ]),
671
- u[14] || (u[14] = r("div", { "flex-auto": "" }, null, -1)),
672
- s(U).length ? (a(), S(b, {
673
- key: 1,
674
- border: "t base",
675
- "mx--4": "",
676
- "mb--4": "",
677
- "code-snippets": s(U)
678
- }, null, 8, ["code-snippets"])) : P("", !0)
679
- ]);
680
- };
681
- }
682
- }), ut = /* @__PURE__ */ T({
683
- __name: "AssetListItem",
684
- props: {
685
- item: {},
686
- index: { default: 0 },
687
- modelValue: {}
688
- },
689
- setup(f, { emit: n }) {
690
- const e = f, i = ne(e, "modelValue", n, { passive: !0 }), o = _(() => e.item?.children?.length), l = D(!0), d = _(() => o.value ? "i-carbon-folder" : e.item.type === "image" ? "i-carbon-image" : e.item.type === "video" ? "i-carbon-video" : e.item.type === "audio" ? "i-carbon-volume-up" : e.item.type === "font" ? "i-carbon-text-small-caps" : e.item.type === "text" ? "i-carbon-document" : e.item.type === "json" ? "i-carbon-json" : e.item.type === "wasm" ? "i-vscode-icons-file-type-wasm" : "i-carbon-document-blank");
691
- return (m, v) => {
692
- const j = oe("AssetListItem", !0);
693
- return a(), p("div", null, [
694
- r("button", {
695
- flex: "~ gap-2",
696
- "w-full": "",
697
- "items-center": "",
698
- hover: "bg-active",
699
- px4: "",
700
- py1: "",
701
- style: se({ paddingLeft: `calc(1rem + ${m.index * 1.5}em)` }),
702
- class: M({ "bg-active": !s(o) && s(i)?.filePath === m.item?.filePath }),
703
- border: "b base",
704
- onClick: v[0] || (v[0] = (V) => s(o) ? l.value = !s(l) : i.value = m.item)
705
- }, [
706
- r("div", {
707
- class: M(s(d))
708
- }, null, 2),
709
- r("span", {
710
- class: M({ "flex items-center": s(o) }),
711
- "flex-auto": "",
712
- "text-start": "",
713
- "text-sm": "",
714
- "font-mono": ""
715
- }, x(m.item.path), 3),
716
- s(o) ? (a(), S(s(q), {
717
- key: 0,
718
- icon: "carbon:chevron-right",
719
- "transform-rotate": s(l) ? 90 : 0,
720
- transition: ""
721
- }, null, 8, ["transform-rotate"])) : P("", !0)
722
- ], 6),
723
- s(l) ? L(m.$slots, "default", { key: 0 }, () => [
724
- (a(!0), p(z, null, F(m.item?.children, (V) => (a(), S(j, {
725
- key: V.filepath,
726
- modelValue: s(i),
727
- "onUpdate:modelValue": v[1] || (v[1] = (w) => J(i) ? i.value = w : null),
728
- item: V,
729
- index: m.index + 1
730
- }, null, 8, ["modelValue", "item", "index"]))), 128))
731
- ]) : P("", !0)
732
- ]);
733
- };
734
- }
735
- }), dt = {
736
- flex: "~ col gap-1",
737
- hover: "bg-active",
738
- "items-center": "",
739
- "of-hidden": "",
740
- rounded: "",
741
- p2: ""
742
- }, ct = {
743
- "w-full": "",
744
- "of-hidden": "",
745
- truncate: "",
746
- "ws-nowrap": "",
747
- "text-center": "",
748
- "text-xs": ""
749
- }, pt = /* @__PURE__ */ T({
750
- __name: "AssetGridItem",
751
- props: {
752
- asset: {},
753
- folder: {}
754
- },
755
- setup(f) {
756
- const n = f, e = _(() => n.folder && n.asset.path.startsWith(n.folder) ? n.asset.path.slice(n.folder.length) : n.asset.path);
757
- return (t, i) => {
758
- const o = ie;
759
- return a(), p("button", dt, [
760
- C(o, {
761
- "h-30": "",
762
- "w-30": "",
763
- rounded: "",
764
- border: "~ base",
765
- asset: t.asset
766
- }, null, 8, ["asset"]),
767
- r("div", ct, x(s(e)), 1)
768
- ]);
769
- };
770
- }
771
- }), ht = {
772
- flex: "~ col gap2",
773
- border: "b base",
774
- "navbar-glass": "",
775
- "flex-1": "",
776
- p4: ""
777
- }, ft = {
778
- flex: "~ gap4",
779
- "items-center": ""
780
- }, mt = /* @__PURE__ */ T({
781
- __name: "Navbar",
782
- props: {
783
- search: {},
784
- noPadding: { type: Boolean }
785
- },
786
- emits: ["update:search"],
787
- setup(f, { emit: n }) {
788
- const e = f, t = n, i = D(e.search);
789
- return te(() => e.search, (o) => {
790
- i.value = o;
791
- }), te(i, () => {
792
- t("update:search", i.value);
793
- }), (o, l) => (a(), p("div", ht, [
794
- r("div", ft, [
795
- L(o.$slots, "search", {}, () => [
796
- o.search !== void 0 ? (a(), S(s(he), {
797
- key: 0,
798
- modelValue: s(i),
799
- "onUpdate:modelValue": l[0] || (l[0] = (d) => J(i) ? i.value = d : null),
800
- placeholder: "Search...",
801
- "left-icon": "i-carbon-search",
802
- class: M(["flex-auto", { "px-5 py-2": !o.noPadding }])
803
- }, null, 8, ["modelValue", "class"])) : P("", !0)
804
- ]),
805
- L(o.$slots, "actions")
806
- ]),
807
- L(o.$slots, "default")
808
- ]));
809
- }
810
- }), vt = {
811
- block: "",
812
- "h-full": "",
813
- "of-hidden": "",
814
- class: "drawer-container relative"
815
- }, yt = {
816
- "h-full": "",
817
- "w-full": "",
818
- "of-auto": ""
819
- }, gt = {
820
- "flex-none": "",
821
- flex: "~ gap2 items-center",
822
- "text-lg": ""
823
- }, bt = {
824
- flex: "~ items-center justify-center",
825
- absolute: "",
826
- "bottom-0": "",
827
- "right-2px": "",
828
- "h-4": "",
829
- "w-4": "",
830
- "rounded-full": "",
831
- "bg-primary-800": "",
832
- "text-8px": "",
833
- "text-white": ""
834
- }, wt = {
835
- "w-full": "",
836
- flex: "~ gap-2 items-center",
837
- rounded: "",
838
- px2: "",
839
- py2: ""
840
- }, _t = {
841
- "text-xs": "",
842
- op75: ""
843
- }, $t = { op50: "" }, xt = { key: 0 }, kt = {
844
- "mt--4": "",
845
- px2: "",
846
- grid: "~ cols-minmax-8rem"
847
- }, Bt = {
848
- key: 1,
849
- p2: "",
850
- grid: "~ cols-minmax-8rem"
851
- }, Ct = { key: 1 }, At = 50, Vt = /* @__PURE__ */ T({
852
- __name: "assets",
853
- setup(f) {
854
- const n = D(""), e = D(), t = D("grid"), i = D([]), o = _(() => {
855
- const g = [];
856
- for (const h of i.value || []) {
857
- const y = h.path.split(".").pop();
858
- y && !g.find((I) => I.value === y) && g.push({ label: y, value: y });
859
- }
860
- return g;
861
- }), l = D([]);
862
- fe(() => o.value, (g) => {
863
- l.value = g.map((h) => h.value);
864
- });
865
- const d = D(), m = _(() => new me(i.value || [], {
866
- keys: [
867
- "path"
868
- ]
869
- })), v = _(() => (n.value ? m.value.search(n.value).map((h) => h.item) : i.value || []).filter((h) => {
870
- const y = h.path.split(".").pop();
871
- return !y || l.value.includes(y);
872
- })), j = _(() => {
873
- const g = {};
874
- for (const h of v.value) {
875
- const y = `${h.relativePath.split("/").slice(0, -1).join("/")}/`;
876
- g[y] || (g[y] = []), g[y].push(h);
877
- }
878
- return Object.entries(g).sort(([h], [y]) => h.localeCompare(y));
879
- }), V = _(() => {
880
- const g = { children: [] }, h = (y, I, c) => {
881
- const [u, ...$] = I;
882
- let k = y.children.find((R) => R.path === u);
883
- k || (k = { ...c, path: u, children: [] }, y.children.push(k)), $.length > 1 ? h(k, $, c) : $.length === 1 && k.children.push({ ...c, path: $[0] });
884
- };
885
- return v.value.forEach((y) => {
886
- const I = y.relativePath.split("/").filter((c) => c !== "");
887
- h(g, I, y);
888
- }), g.children;
889
- });
890
- function w() {
891
- H.value.getStaticAssets().then((g) => {
892
- i.value = g;
893
- });
894
- }
895
- function U() {
896
- w();
897
- }
898
- ve(() => {
899
- w(), H.functions.on("assetsUpdated", U);
900
- });
901
- function K() {
902
- t.value = t.value === "list" ? "grid" : "list";
903
- }
904
- return ye(() => {
905
- H.functions.off("assetsUpdated", U);
906
- }), (g, h) => {
907
- const y = xe, I = mt, c = pt, u = $e, $ = ut, k = at, R = _e("tooltip");
908
- return a(), p("div", vt, [
909
- r("div", yt, [
910
- C(I, {
911
- ref_key: "navbar",
912
- ref: e,
913
- search: s(n),
914
- "onUpdate:search": h[1] || (h[1] = (b) => J(n) ? n.value = b : null),
915
- pb2: "",
916
- "no-padding": !0
917
- }, {
918
- actions: A(() => [
919
- r("div", gt, [
920
- C(s(be), {
921
- modelValue: s(l),
922
- "onUpdate:modelValue": h[0] || (h[0] = (b) => J(l) ? l.value = b : null),
923
- multiple: !0,
924
- options: s(o)
925
- }, {
926
- button: A(() => [
927
- E((a(), S(y, {
928
- icon: "i-carbon-filter hover:op50",
929
- border: !1,
930
- title: "Filter",
931
- relative: "",
932
- "cursor-pointer": "",
933
- p2: "",
934
- "text-lg": "",
935
- onClick: () => {
936
- }
937
- }, {
938
- default: A(() => [
939
- r("span", bt, x(s(l).length), 1)
940
- ]),
941
- _: 1
942
- })), [
943
- [
944
- R,
945
- "Filter",
946
- void 0,
947
- { "bottom-end": !0 }
948
- ]
949
- ])
950
- ]),
951
- item: A(({
952
- item: b,
953
- active: B
954
- }) => [
955
- r("div", wt, [
956
- C(s(we), { "model-value": B }, null, 8, ["model-value"]),
957
- r("span", _t, x(b.label), 1)
958
- ])
959
- ]),
960
- _: 1
961
- }, 8, ["modelValue", "options"]),
962
- E(C(s(q), {
963
- border: !1,
964
- icon: s(t) === "grid" ? "i-carbon-list" : "i-carbon-grid",
965
- title: "Toggle view",
966
- action: "",
967
- "cursor-pointer": "",
968
- "text-lg": "",
969
- onClick: K
970
- }, null, 8, ["icon"]), [
971
- [
972
- R,
973
- "Toggle View",
974
- void 0,
975
- { "bottom-end": !0 }
976
- ]
977
- ])
978
- ])
979
- ]),
980
- default: A(() => [
981
- r("div", $t, [
982
- s(n) ? (a(), p("span", xt, x(s(v).length) + " matched · ", 1)) : P("", !0),
983
- r("span", null, x(s(i)?.length) + " assets in total", 1)
984
- ])
985
- ]),
986
- _: 1
987
- }, 8, ["search"]),
988
- s(t) === "grid" ? (a(), p(z, { key: 0 }, [
989
- s(j).length > 1 ? (a(!0), p(z, { key: 0 }, F(s(j), ([b, B]) => (a(), S(u, {
990
- key: b,
991
- text: b,
992
- description: `${B.length} items`,
993
- open: B.length <= At,
994
- padding: !1
995
- }, {
996
- default: A(() => [
997
- r("div", kt, [
998
- (a(!0), p(z, null, F(B, (N) => (a(), S(c, {
999
- key: N.path,
1000
- asset: N,
1001
- folder: b,
1002
- onClick: (Pt) => d.value = N
1003
- }, null, 8, ["asset", "folder", "onClick"]))), 128))
1004
- ])
1005
- ]),
1006
- _: 2
1007
- }, 1032, ["text", "description", "open"]))), 128)) : (a(), p("div", Bt, [
1008
- (a(!0), p(z, null, F(s(v), (b) => (a(), S(c, {
1009
- key: b.path,
1010
- asset: b,
1011
- onClick: (B) => d.value = b
1012
- }, null, 8, ["asset", "onClick"]))), 128))
1013
- ]))
1014
- ], 64)) : (a(), p("div", Ct, [
1015
- (a(!0), p(z, null, F(s(V), (b, B) => (a(), S($, {
1016
- key: B,
1017
- modelValue: s(d),
1018
- "onUpdate:modelValue": h[2] || (h[2] = (N) => J(d) ? d.value = N : null),
1019
- item: b
1020
- }, null, 8, ["modelValue", "item"]))), 128))
1021
- ]))
1022
- ]),
1023
- C(s(ge), {
1024
- "model-value": !!s(d),
1025
- top: s(e),
1026
- permanent: "",
1027
- "mount-to": ".drawer-container",
1028
- position: "absolute",
1029
- "content-class": "w120 text-sm",
1030
- "onUpdate:modelValue": h[4] || (h[4] = (b) => {
1031
- b || (d.value = void 0);
1032
- })
1033
- }, {
1034
- default: A(() => [
1035
- s(d) ? (a(), S(k, {
1036
- key: 0,
1037
- modelValue: s(d),
1038
- "onUpdate:modelValue": h[3] || (h[3] = (b) => J(d) ? d.value = b : null)
1039
- }, null, 8, ["modelValue"])) : P("", !0)
1040
- ]),
1041
- _: 1
1042
- }, 8, ["model-value", "top"])
1043
- ]);
1044
- };
1045
- }
1046
- });
1047
- export {
1048
- Vt as default
1049
- };