vite-plugin-vue-devtools 1.0.0-rc.8 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/README.md +8 -172
  2. package/dist/client/assets/css-a-KJtBLB.js +505 -0
  3. package/dist/client/assets/diff--l9-nN5b.js +1 -0
  4. package/dist/client/assets/html-5-AIf93y.js +74 -0
  5. package/dist/client/assets/index-NNrCE7Vx.css +1 -0
  6. package/dist/client/assets/index-U-H6nGkn.js +1080 -0
  7. package/dist/client/assets/javascript-Of8SnKfU.js +699 -0
  8. package/dist/client/assets/json-t1qiHl76.js +25 -0
  9. package/dist/client/assets/onig-mBJmD8D5.js +1 -0
  10. package/dist/client/assets/shellscript-h1L64xId.js +4 -0
  11. package/dist/client/assets/typescript-b1Nw_bQe.js +666 -0
  12. package/dist/client/assets/unocss-runtime-kftsoZPE.js +2 -0
  13. package/dist/client/assets/vitesse-dark-5VceXvs6.js +1 -0
  14. package/dist/client/assets/vitesse-light-HOMMxGxw.js +1 -0
  15. package/dist/client/assets/vue-apis-Nh9IahXf.js +1 -0
  16. package/dist/client/assets/vue-html-eJ6eRCYJ.js +1 -0
  17. package/dist/client/assets/vue-nOwTje1i.js +2002 -0
  18. package/dist/client/assets/yaml-FtfhlYqU.js +200 -0
  19. package/dist/client/color-scheme.js +6 -0
  20. package/dist/client/css-hXHVOlj5.js +511 -0
  21. package/dist/client/devtools-panel.css +1 -0
  22. package/dist/client/devtools-panel.js +77722 -0
  23. package/dist/client/diff-nydZCsp5.js +7 -0
  24. package/dist/client/html-r4dic7N6.js +84 -0
  25. package/dist/client/index.html +13 -21
  26. package/dist/client/javascript-iu2g-HpL.js +705 -0
  27. package/dist/client/json-6ED1Ntns.js +31 -0
  28. package/dist/client/onig-NuJRzyUz.js +4 -0
  29. package/dist/client/shellscript-lFevXvOp.js +10 -0
  30. package/dist/client/typescript-SzFP_hYV.js +672 -0
  31. package/dist/client/unocss-runtime-c8-Zzj4C.js +1974 -0
  32. package/dist/client/vitesse-dark-Q3b2Vb5y.js +683 -0
  33. package/dist/client/vitesse-light-T_UJmsth.js +681 -0
  34. package/dist/client/vue-apis-j7ljdRbm.js +1127 -0
  35. package/dist/client/vue-html-IdJrwrVJ.js +16 -0
  36. package/dist/client/vue-vFbCUJfs.js +2118 -0
  37. package/dist/client/yaml-n_HyS7lr.js +206 -0
  38. package/dist/vite.cjs +116 -13794
  39. package/dist/vite.d.cts +6 -9
  40. package/dist/vite.d.mts +6 -9
  41. package/dist/vite.d.ts +6 -9
  42. package/dist/vite.mjs +113 -13774
  43. package/package.json +18 -19
  44. package/src/overlay/devtools-overlay.css +1 -0
  45. package/src/overlay/devtools-overlay.js +4 -0
  46. package/src/overlay.js +77 -0
  47. package/README.zh-CN.md +0 -186
  48. package/client.d.ts +0 -63
  49. package/dist/client/assets/DrawerRight.vue_vue_type_script_setup_true_lang-99688d1e.js +0 -81
  50. package/dist/client/assets/IconButton.vue_vue_type_script_setup_true_lang-48a6bea2.js +0 -26
  51. package/dist/client/assets/IconTitle.vue_vue_type_script_setup_true_lang-adb17252.js +0 -30
  52. package/dist/client/assets/IframeView.vue_vue_type_script_setup_true_lang-4ccdbf42.js +0 -96
  53. package/dist/client/assets/PanelGrids-664603ce.js +0 -15
  54. package/dist/client/assets/SectionBlock-0024395a.css +0 -18
  55. package/dist/client/assets/SectionBlock-04b7ab1e.js +0 -109
  56. package/dist/client/assets/StateFields.vue_vue_type_script_setup_true_lang-48cf50ad.js +0 -381
  57. package/dist/client/assets/Switch.vue_vue_type_script_setup_true_lang-d74bf986.js +0 -87
  58. package/dist/client/assets/TextInput.vue_vue_type_script_setup_true_lang-65c09c69.js +0 -38
  59. package/dist/client/assets/__eyedropper-7bbec9b2.js +0 -149
  60. package/dist/client/assets/_commonjsHelpers-7e83dbf2.js +0 -34
  61. package/dist/client/assets/assets-641818bf.js +0 -1597
  62. package/dist/client/assets/component-docs-7bd37475.js +0 -195
  63. package/dist/client/assets/components-b0181ea4.js +0 -790
  64. package/dist/client/assets/data-8729d21a.js +0 -399
  65. package/dist/client/assets/dayjs.min-f03ccd82.js +0 -13
  66. package/dist/client/assets/documentations-7cba8670.js +0 -276
  67. package/dist/client/assets/fuse.esm-c317b696.js +0 -1782
  68. package/dist/client/assets/graph-edf83976.js +0 -52092
  69. package/dist/client/assets/index-77d53487.js +0 -18551
  70. package/dist/client/assets/index-b5475fe0.css +0 -482
  71. package/dist/client/assets/inspect-d17224a9.js +0 -20
  72. package/dist/client/assets/jse-theme-dark-333a4654.js +0 -1565
  73. package/dist/client/assets/jse-theme-dark-351d62d5.css +0 -114
  74. package/dist/client/assets/npm-076ecb7c.js +0 -550
  75. package/dist/client/assets/npm-832f3f2c.css +0 -209
  76. package/dist/client/assets/overview-d99e7f18.js +0 -303
  77. package/dist/client/assets/pages-fca7d8d3.js +0 -561
  78. package/dist/client/assets/pinia-3f5b6c57.js +0 -108
  79. package/dist/client/assets/pinia-7ed2c830.svg +0 -1
  80. package/dist/client/assets/rerender-trace-3afd48a1.css +0 -14
  81. package/dist/client/assets/rerender-trace-5fc6fb22.js +0 -436
  82. package/dist/client/assets/routes-9567a43f.js +0 -132
  83. package/dist/client/assets/settings-5a2e184c.js +0 -9652
  84. package/dist/client/assets/settings-7bce89ae.css +0 -11
  85. package/dist/client/assets/splitpanes.es-26cdc434.js +0 -343
  86. package/dist/client/assets/timeline-20d79e43.js +0 -1480
  87. package/dist/client/assets/timeline-b315b2e0.css +0 -1
  88. package/dist/client/assets/vue-5d4e674c.svg +0 -1
  89. package/dist/client/assets/vueuse-995374f6.svg +0 -1
  90. package/src/app.js +0 -4
  91. package/src/views/ComponentInspector.vue +0 -68
  92. package/src/views/FrameBox.vue +0 -231
  93. package/src/views/Main.vue +0 -435
  94. package/src/views/RerenderIndicator.vue +0 -37
  95. package/src/views/composables.ts +0 -630
  96. package/src/views/utils.ts +0 -241
@@ -1,1597 +0,0 @@
1
- import { _ as __unplugin_components_0 } from './PanelGrids-664603ce.js';
2
- import { v as defineComponent, a1 as computed, o as openBlock, e as createElementBlock, y as toDisplayString, z as unref, q as normalizeClass, cK as useStyleTag, l as normalizeStyle, c as createBlock, x as createBaseVNode, bL as useVModel, cJ as useNotification, cL as computedAsync, cH as useCopy, cM as useTimeAgo, a$ as ref, F as Fragment, u as createVNode, g as createCommentVNode, a9 as createTextVNode, h as withCtx, aC as isRef, ci as rpc, c6 as useDevToolsClient, bM as _sfc_main$9, bN as _sfc_main$a, r as resolveComponent, f as renderSlot, i as renderList, bJ as _sfc_main$c, cN as onKeyDown, cn as hookApi, c7 as rootPath, _ as __unplugin_components_7, cO as useDebounceFn } from './index-77d53487.js';
3
- import { _ as _sfc_main$d } from './DrawerRight.vue_vue_type_script_setup_true_lang-99688d1e.js';
4
- import { _ as _sfc_main$b } from './TextInput.vue_vue_type_script_setup_true_lang-65c09c69.js';
5
- import { _ as _sfc_main$8 } from './IconButton.vue_vue_type_script_setup_true_lang-48a6bea2.js';
6
- import { _ as __unplugin_components_3 } from './SectionBlock-04b7ab1e.js';
7
- import { F as Fuse } from './fuse.esm-c317b696.js';
8
- import './IconTitle.vue_vue_type_script_setup_true_lang-adb17252.js';
9
-
10
- const _hoisted_1$6 = ["title"];
11
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
12
- __name: "FilepathItem",
13
- props: {
14
- filepath: {},
15
- lineBreak: { type: Boolean },
16
- subpath: { type: Boolean }
17
- },
18
- setup(__props) {
19
- const props = __props;
20
- const parsed = computed(
21
- () => ({ path: props.filepath })
22
- );
23
- return (_ctx, _cache) => {
24
- return openBlock(), createElementBlock("button", {
25
- "font-mono": "",
26
- "hover:underline": "",
27
- class: normalizeClass(_ctx.lineBreak ? "" : "ws-nowrap of-hidden truncate"),
28
- title: _ctx.filepath
29
- }, toDisplayString(unref(parsed).path), 11, _hoisted_1$6);
30
- };
31
- }
32
- });
33
-
34
- /* Injected with object hook! */
35
-
36
- const defaults = Object.freeze({
37
- ignoreUnknown: false,
38
- respectType: false,
39
- respectFunctionNames: false,
40
- respectFunctionProperties: false,
41
- unorderedObjects: true,
42
- unorderedArrays: false,
43
- unorderedSets: false,
44
- excludeKeys: void 0,
45
- excludeValues: void 0,
46
- replacer: void 0
47
- });
48
- function objectHash(object, options) {
49
- if (options) {
50
- options = { ...defaults, ...options };
51
- } else {
52
- options = defaults;
53
- }
54
- const hasher = createHasher(options);
55
- hasher.dispatch(object);
56
- return hasher.toString();
57
- }
58
- const defaultPrototypesKeys = Object.freeze([
59
- "prototype",
60
- "__proto__",
61
- "constructor"
62
- ]);
63
- function createHasher(options) {
64
- let buff = "";
65
- let context = /* @__PURE__ */ new Map();
66
- const write = (str) => {
67
- buff += str;
68
- };
69
- return {
70
- toString() {
71
- return buff;
72
- },
73
- getContext() {
74
- return context;
75
- },
76
- dispatch(value) {
77
- if (options.replacer) {
78
- value = options.replacer(value);
79
- }
80
- const type = value === null ? "null" : typeof value;
81
- return this[type](value);
82
- },
83
- object(object) {
84
- if (object && typeof object.toJSON === "function") {
85
- return this.object(object.toJSON());
86
- }
87
- const objString = Object.prototype.toString.call(object);
88
- let objType = "";
89
- const objectLength = objString.length;
90
- if (objectLength < 10) {
91
- objType = "unknown:[" + objString + "]";
92
- } else {
93
- objType = objString.slice(8, objectLength - 1);
94
- }
95
- objType = objType.toLowerCase();
96
- let objectNumber = null;
97
- if ((objectNumber = context.get(object)) === void 0) {
98
- context.set(object, context.size);
99
- } else {
100
- return this.dispatch("[CIRCULAR:" + objectNumber + "]");
101
- }
102
- if (typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(object)) {
103
- write("buffer:");
104
- return write(object.toString("utf8"));
105
- }
106
- if (objType !== "object" && objType !== "function" && objType !== "asyncfunction") {
107
- if (this[objType]) {
108
- this[objType](object);
109
- } else if (!options.ignoreUnknown) {
110
- this.unkown(object, objType);
111
- }
112
- } else {
113
- let keys = Object.keys(object);
114
- if (options.unorderedObjects) {
115
- keys = keys.sort();
116
- }
117
- let extraKeys = [];
118
- if (options.respectType !== false && !isNativeFunction(object)) {
119
- extraKeys = defaultPrototypesKeys;
120
- }
121
- if (options.excludeKeys) {
122
- keys = keys.filter((key) => {
123
- return !options.excludeKeys(key);
124
- });
125
- extraKeys = extraKeys.filter((key) => {
126
- return !options.excludeKeys(key);
127
- });
128
- }
129
- write("object:" + (keys.length + extraKeys.length) + ":");
130
- const dispatchForKey = (key) => {
131
- this.dispatch(key);
132
- write(":");
133
- if (!options.excludeValues) {
134
- this.dispatch(object[key]);
135
- }
136
- write(",");
137
- };
138
- for (const key of keys) {
139
- dispatchForKey(key);
140
- }
141
- for (const key of extraKeys) {
142
- dispatchForKey(key);
143
- }
144
- }
145
- },
146
- array(arr, unordered) {
147
- unordered = unordered === void 0 ? options.unorderedArrays !== false : unordered;
148
- write("array:" + arr.length + ":");
149
- if (!unordered || arr.length <= 1) {
150
- for (const entry of arr) {
151
- this.dispatch(entry);
152
- }
153
- return;
154
- }
155
- const contextAdditions = /* @__PURE__ */ new Map();
156
- const entries = arr.map((entry) => {
157
- const hasher = createHasher(options);
158
- hasher.dispatch(entry);
159
- for (const [key, value] of hasher.getContext()) {
160
- contextAdditions.set(key, value);
161
- }
162
- return hasher.toString();
163
- });
164
- context = contextAdditions;
165
- entries.sort();
166
- return this.array(entries, false);
167
- },
168
- date(date) {
169
- return write("date:" + date.toJSON());
170
- },
171
- symbol(sym) {
172
- return write("symbol:" + sym.toString());
173
- },
174
- unkown(value, type) {
175
- write(type);
176
- if (!value) {
177
- return;
178
- }
179
- write(":");
180
- if (value && typeof value.entries === "function") {
181
- return this.array(
182
- Array.from(value.entries()),
183
- true
184
- /* ordered */
185
- );
186
- }
187
- },
188
- error(err) {
189
- return write("error:" + err.toString());
190
- },
191
- boolean(bool) {
192
- return write("bool:" + bool);
193
- },
194
- string(string) {
195
- write("string:" + string.length + ":");
196
- write(string);
197
- },
198
- function(fn) {
199
- write("fn:");
200
- if (isNativeFunction(fn)) {
201
- this.dispatch("[native]");
202
- } else {
203
- this.dispatch(fn.toString());
204
- }
205
- if (options.respectFunctionNames !== false) {
206
- this.dispatch("function-name:" + String(fn.name));
207
- }
208
- if (options.respectFunctionProperties) {
209
- this.object(fn);
210
- }
211
- },
212
- number(number) {
213
- return write("number:" + number);
214
- },
215
- xml(xml) {
216
- return write("xml:" + xml.toString());
217
- },
218
- null() {
219
- return write("Null");
220
- },
221
- undefined() {
222
- return write("Undefined");
223
- },
224
- regexp(regex) {
225
- return write("regex:" + regex.toString());
226
- },
227
- uint8array(arr) {
228
- write("uint8array:");
229
- return this.dispatch(Array.prototype.slice.call(arr));
230
- },
231
- uint8clampedarray(arr) {
232
- write("uint8clampedarray:");
233
- return this.dispatch(Array.prototype.slice.call(arr));
234
- },
235
- int8array(arr) {
236
- write("int8array:");
237
- return this.dispatch(Array.prototype.slice.call(arr));
238
- },
239
- uint16array(arr) {
240
- write("uint16array:");
241
- return this.dispatch(Array.prototype.slice.call(arr));
242
- },
243
- int16array(arr) {
244
- write("int16array:");
245
- return this.dispatch(Array.prototype.slice.call(arr));
246
- },
247
- uint32array(arr) {
248
- write("uint32array:");
249
- return this.dispatch(Array.prototype.slice.call(arr));
250
- },
251
- int32array(arr) {
252
- write("int32array:");
253
- return this.dispatch(Array.prototype.slice.call(arr));
254
- },
255
- float32array(arr) {
256
- write("float32array:");
257
- return this.dispatch(Array.prototype.slice.call(arr));
258
- },
259
- float64array(arr) {
260
- write("float64array:");
261
- return this.dispatch(Array.prototype.slice.call(arr));
262
- },
263
- arraybuffer(arr) {
264
- write("arraybuffer:");
265
- return this.dispatch(new Uint8Array(arr));
266
- },
267
- url(url) {
268
- return write("url:" + url.toString());
269
- },
270
- map(map) {
271
- write("map:");
272
- const arr = [...map];
273
- return this.array(arr, options.unorderedSets !== false);
274
- },
275
- set(set) {
276
- write("set:");
277
- const arr = [...set];
278
- return this.array(arr, options.unorderedSets !== false);
279
- },
280
- file(file) {
281
- write("file:");
282
- return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
283
- },
284
- blob() {
285
- if (options.ignoreUnknown) {
286
- return write("[blob]");
287
- }
288
- throw new Error(
289
- 'Hashing Blob objects is currently not supported\nUse "options.replacer" or "options.ignoreUnknown"\n'
290
- );
291
- },
292
- domwindow() {
293
- return write("domwindow");
294
- },
295
- bigint(number) {
296
- return write("bigint:" + number.toString());
297
- },
298
- /* Node.js standard native objects */
299
- process() {
300
- return write("process");
301
- },
302
- timer() {
303
- return write("timer");
304
- },
305
- pipe() {
306
- return write("pipe");
307
- },
308
- tcp() {
309
- return write("tcp");
310
- },
311
- udp() {
312
- return write("udp");
313
- },
314
- tty() {
315
- return write("tty");
316
- },
317
- statwatcher() {
318
- return write("statwatcher");
319
- },
320
- securecontext() {
321
- return write("securecontext");
322
- },
323
- connection() {
324
- return write("connection");
325
- },
326
- zlib() {
327
- return write("zlib");
328
- },
329
- context() {
330
- return write("context");
331
- },
332
- nodescript() {
333
- return write("nodescript");
334
- },
335
- httpparser() {
336
- return write("httpparser");
337
- },
338
- dataview() {
339
- return write("dataview");
340
- },
341
- signal() {
342
- return write("signal");
343
- },
344
- fsevent() {
345
- return write("fsevent");
346
- },
347
- tlswrap() {
348
- return write("tlswrap");
349
- }
350
- };
351
- }
352
- const nativeFunc = "[native code] }";
353
- const nativeFuncLength = nativeFunc.length;
354
- function isNativeFunction(f) {
355
- if (typeof f !== "function") {
356
- return false;
357
- }
358
- return Function.prototype.toString.call(f).slice(-nativeFuncLength) === nativeFunc;
359
- }
360
-
361
- class WordArray {
362
- constructor(words, sigBytes) {
363
- words = this.words = words || [];
364
- this.sigBytes = sigBytes === void 0 ? words.length * 4 : sigBytes;
365
- }
366
- toString(encoder) {
367
- return (encoder || Hex).stringify(this);
368
- }
369
- concat(wordArray) {
370
- this.clamp();
371
- if (this.sigBytes % 4) {
372
- for (let i = 0; i < wordArray.sigBytes; i++) {
373
- const thatByte = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
374
- this.words[this.sigBytes + i >>> 2] |= thatByte << 24 - (this.sigBytes + i) % 4 * 8;
375
- }
376
- } else {
377
- for (let j = 0; j < wordArray.sigBytes; j += 4) {
378
- this.words[this.sigBytes + j >>> 2] = wordArray.words[j >>> 2];
379
- }
380
- }
381
- this.sigBytes += wordArray.sigBytes;
382
- return this;
383
- }
384
- clamp() {
385
- this.words[this.sigBytes >>> 2] &= 4294967295 << 32 - this.sigBytes % 4 * 8;
386
- this.words.length = Math.ceil(this.sigBytes / 4);
387
- }
388
- clone() {
389
- return new WordArray([...this.words]);
390
- }
391
- }
392
- const Hex = {
393
- stringify(wordArray) {
394
- const hexChars = [];
395
- for (let i = 0; i < wordArray.sigBytes; i++) {
396
- const bite = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
397
- hexChars.push((bite >>> 4).toString(16), (bite & 15).toString(16));
398
- }
399
- return hexChars.join("");
400
- }
401
- };
402
- const Base64 = {
403
- stringify(wordArray) {
404
- const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
405
- const base64Chars = [];
406
- for (let i = 0; i < wordArray.sigBytes; i += 3) {
407
- const byte1 = wordArray.words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
408
- const byte2 = wordArray.words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
409
- const byte3 = wordArray.words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
410
- const triplet = byte1 << 16 | byte2 << 8 | byte3;
411
- for (let j = 0; j < 4 && i * 8 + j * 6 < wordArray.sigBytes * 8; j++) {
412
- base64Chars.push(keyStr.charAt(triplet >>> 6 * (3 - j) & 63));
413
- }
414
- }
415
- return base64Chars.join("");
416
- }
417
- };
418
- const Latin1 = {
419
- parse(latin1Str) {
420
- const latin1StrLength = latin1Str.length;
421
- const words = [];
422
- for (let i = 0; i < latin1StrLength; i++) {
423
- words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
424
- }
425
- return new WordArray(words, latin1StrLength);
426
- }
427
- };
428
- const Utf8 = {
429
- parse(utf8Str) {
430
- return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
431
- }
432
- };
433
- class BufferedBlockAlgorithm {
434
- constructor() {
435
- this._data = new WordArray();
436
- this._nDataBytes = 0;
437
- this._minBufferSize = 0;
438
- this.blockSize = 512 / 32;
439
- }
440
- reset() {
441
- this._data = new WordArray();
442
- this._nDataBytes = 0;
443
- }
444
- _append(data) {
445
- if (typeof data === "string") {
446
- data = Utf8.parse(data);
447
- }
448
- this._data.concat(data);
449
- this._nDataBytes += data.sigBytes;
450
- }
451
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
452
- _doProcessBlock(_dataWords, _offset) {
453
- }
454
- _process(doFlush) {
455
- let processedWords;
456
- let nBlocksReady = this._data.sigBytes / (this.blockSize * 4);
457
- if (doFlush) {
458
- nBlocksReady = Math.ceil(nBlocksReady);
459
- } else {
460
- nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
461
- }
462
- const nWordsReady = nBlocksReady * this.blockSize;
463
- const nBytesReady = Math.min(nWordsReady * 4, this._data.sigBytes);
464
- if (nWordsReady) {
465
- for (let offset = 0; offset < nWordsReady; offset += this.blockSize) {
466
- this._doProcessBlock(this._data.words, offset);
467
- }
468
- processedWords = this._data.words.splice(0, nWordsReady);
469
- this._data.sigBytes -= nBytesReady;
470
- }
471
- return new WordArray(processedWords, nBytesReady);
472
- }
473
- }
474
- class Hasher extends BufferedBlockAlgorithm {
475
- update(messageUpdate) {
476
- this._append(messageUpdate);
477
- this._process();
478
- return this;
479
- }
480
- finalize(messageUpdate) {
481
- if (messageUpdate) {
482
- this._append(messageUpdate);
483
- }
484
- }
485
- }
486
-
487
- const H = [
488
- 1779033703,
489
- -1150833019,
490
- 1013904242,
491
- -1521486534,
492
- 1359893119,
493
- -1694144372,
494
- 528734635,
495
- 1541459225
496
- ];
497
- const K = [
498
- 1116352408,
499
- 1899447441,
500
- -1245643825,
501
- -373957723,
502
- 961987163,
503
- 1508970993,
504
- -1841331548,
505
- -1424204075,
506
- -670586216,
507
- 310598401,
508
- 607225278,
509
- 1426881987,
510
- 1925078388,
511
- -2132889090,
512
- -1680079193,
513
- -1046744716,
514
- -459576895,
515
- -272742522,
516
- 264347078,
517
- 604807628,
518
- 770255983,
519
- 1249150122,
520
- 1555081692,
521
- 1996064986,
522
- -1740746414,
523
- -1473132947,
524
- -1341970488,
525
- -1084653625,
526
- -958395405,
527
- -710438585,
528
- 113926993,
529
- 338241895,
530
- 666307205,
531
- 773529912,
532
- 1294757372,
533
- 1396182291,
534
- 1695183700,
535
- 1986661051,
536
- -2117940946,
537
- -1838011259,
538
- -1564481375,
539
- -1474664885,
540
- -1035236496,
541
- -949202525,
542
- -778901479,
543
- -694614492,
544
- -200395387,
545
- 275423344,
546
- 430227734,
547
- 506948616,
548
- 659060556,
549
- 883997877,
550
- 958139571,
551
- 1322822218,
552
- 1537002063,
553
- 1747873779,
554
- 1955562222,
555
- 2024104815,
556
- -2067236844,
557
- -1933114872,
558
- -1866530822,
559
- -1538233109,
560
- -1090935817,
561
- -965641998
562
- ];
563
- const W = [];
564
- class SHA256 extends Hasher {
565
- constructor() {
566
- super(...arguments);
567
- this._hash = new WordArray([...H]);
568
- }
569
- reset() {
570
- super.reset();
571
- this._hash = new WordArray([...H]);
572
- }
573
- _doProcessBlock(M, offset) {
574
- const H2 = this._hash.words;
575
- let a = H2[0];
576
- let b = H2[1];
577
- let c = H2[2];
578
- let d = H2[3];
579
- let e = H2[4];
580
- let f = H2[5];
581
- let g = H2[6];
582
- let h = H2[7];
583
- for (let i = 0; i < 64; i++) {
584
- if (i < 16) {
585
- W[i] = M[offset + i] | 0;
586
- } else {
587
- const gamma0x = W[i - 15];
588
- const gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
589
- const gamma1x = W[i - 2];
590
- const gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
591
- W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
592
- }
593
- const ch = e & f ^ ~e & g;
594
- const maj = a & b ^ a & c ^ b & c;
595
- const sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
596
- const sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
597
- const t1 = h + sigma1 + ch + K[i] + W[i];
598
- const t2 = sigma0 + maj;
599
- h = g;
600
- g = f;
601
- f = e;
602
- e = d + t1 | 0;
603
- d = c;
604
- c = b;
605
- b = a;
606
- a = t1 + t2 | 0;
607
- }
608
- H2[0] = H2[0] + a | 0;
609
- H2[1] = H2[1] + b | 0;
610
- H2[2] = H2[2] + c | 0;
611
- H2[3] = H2[3] + d | 0;
612
- H2[4] = H2[4] + e | 0;
613
- H2[5] = H2[5] + f | 0;
614
- H2[6] = H2[6] + g | 0;
615
- H2[7] = H2[7] + h | 0;
616
- }
617
- finalize(messageUpdate) {
618
- super.finalize(messageUpdate);
619
- const nBitsTotal = this._nDataBytes * 8;
620
- const nBitsLeft = this._data.sigBytes * 8;
621
- this._data.words[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
622
- this._data.words[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(
623
- nBitsTotal / 4294967296
624
- );
625
- this._data.words[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
626
- this._data.sigBytes = this._data.words.length * 4;
627
- this._process();
628
- return this._hash;
629
- }
630
- }
631
- function sha256base64(message) {
632
- return new SHA256().finalize(message).toString(Base64);
633
- }
634
-
635
- function hash(object, options = {}) {
636
- const hashed = typeof object === "string" ? object : objectHash(object, options);
637
- return sha256base64(hashed).slice(0, 10);
638
- }
639
-
640
- /* Injected with object hook! */
641
-
642
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
643
- __name: "AssetFontPreview",
644
- props: {
645
- asset: {}
646
- },
647
- setup(__props) {
648
- const props = __props;
649
- const id = computed(() => `devtools-assets-${hash(props.asset)}`);
650
- useStyleTag(computed(() => `
651
- @font-face {
652
- font-family: '${id.value}';
653
- src: url('${props.asset.publicPath}');
654
- }
655
- `));
656
- return (_ctx, _cache) => {
657
- return openBlock(), createElementBlock("div", {
658
- "of-hidden": "",
659
- style: normalizeStyle({ fontFamily: `'${unref(id)}'` })
660
- }, " 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);
661
- };
662
- }
663
- });
664
-
665
- /* Injected with object hook! */
666
-
667
- const _hoisted_1$5 = {
668
- flex: "",
669
- "items-center": "",
670
- "justify-center": "",
671
- "of-hidden": "",
672
- "bg-active": "",
673
- "object-cover": "",
674
- p1: ""
675
- };
676
- const _hoisted_2$3 = ["src"];
677
- const _hoisted_3$2 = {
678
- key: 2,
679
- "i-carbon-document": "",
680
- "text-3xl": "",
681
- op20: ""
682
- };
683
- const _hoisted_4$2 = {
684
- key: 3,
685
- "w-full": "",
686
- "self-start": "",
687
- p4: ""
688
- };
689
- const _hoisted_5$2 = ["textContent"];
690
- const _hoisted_6$2 = { key: 4 };
691
- const _hoisted_7$2 = ["src", "autoplay", "controls"];
692
- const _hoisted_8$2 = { key: 5 };
693
- const _hoisted_9$1 = ["src", "autoplay", "controls"];
694
- const _hoisted_10$1 = {
695
- key: 1,
696
- "i-carbon:volume-up": "",
697
- "text-3xl": "",
698
- op20: ""
699
- };
700
- const _hoisted_11$1 = {
701
- key: 6,
702
- "i-carbon-help": "",
703
- "text-3xl": "",
704
- op20: ""
705
- };
706
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
707
- __name: "AssetPreview",
708
- props: {
709
- asset: {},
710
- textContent: {},
711
- detail: { type: Boolean }
712
- },
713
- setup(__props) {
714
- return (_ctx, _cache) => {
715
- const _component_AssetFontPreview = _sfc_main$6;
716
- return openBlock(), createElementBlock("div", _hoisted_1$5, [
717
- _ctx.asset.type === "image" ? (openBlock(), createElementBlock("img", {
718
- key: 0,
719
- src: _ctx.asset.publicPath
720
- }, null, 8, _hoisted_2$3)) : _ctx.asset.type === "font" ? (openBlock(), createBlock(_component_AssetFontPreview, {
721
- key: _ctx.asset.publicPath,
722
- asset: _ctx.asset,
723
- "self-stretch": "",
724
- p2: "",
725
- "text-2xl": ""
726
- }, null, 8, ["asset"])) : _ctx.asset.type === "text" && !_ctx.textContent ? (openBlock(), createElementBlock("div", _hoisted_3$2)) : _ctx.asset.type === "text" && _ctx.textContent ? (openBlock(), createElementBlock("div", _hoisted_4$2, [
727
- createBaseVNode("pre", {
728
- "max-h-10rem": "",
729
- "of-hidden": "",
730
- "text-xs": "",
731
- "font-mono": "",
732
- textContent: toDisplayString(_ctx.textContent)
733
- }, null, 8, _hoisted_5$2)
734
- ])) : _ctx.asset.type === "video" ? (openBlock(), createElementBlock("div", _hoisted_6$2, [
735
- createBaseVNode("video", {
736
- src: _ctx.asset.publicPath,
737
- autoplay: _ctx.detail,
738
- controls: _ctx.detail
739
- }, null, 8, _hoisted_7$2)
740
- ])) : _ctx.asset.type === "audio" ? (openBlock(), createElementBlock("div", _hoisted_8$2, [
741
- _ctx.detail ? (openBlock(), createElementBlock("audio", {
742
- key: 0,
743
- src: _ctx.asset.publicPath,
744
- autoplay: _ctx.detail,
745
- controls: _ctx.detail
746
- }, null, 8, _hoisted_9$1)) : (openBlock(), createElementBlock("div", _hoisted_10$1))
747
- ])) : (openBlock(), createElementBlock("div", _hoisted_11$1))
748
- ]);
749
- };
750
- }
751
- });
752
-
753
- /* Injected with object hook! */
754
-
755
- const _hoisted_1$4 = {
756
- flex: "~ col gap-4",
757
- "min-h-full": "",
758
- "w-full": "",
759
- "of-hidden": "",
760
- p4: ""
761
- };
762
- const _hoisted_2$2 = /* @__PURE__ */ createBaseVNode("div", {
763
- flex: "~ gap2",
764
- "mb--2": "",
765
- "items-center": "",
766
- op50: ""
767
- }, [
768
- /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" }),
769
- /* @__PURE__ */ createBaseVNode("div", { "flex-none": "" }, " Preview "),
770
- /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" })
771
- ], -1);
772
- const _hoisted_3$1 = {
773
- flex: "~",
774
- "items-center": "",
775
- "justify-center": ""
776
- };
777
- const _hoisted_4$1 = /* @__PURE__ */ createBaseVNode("div", {
778
- flex: "~ gap2",
779
- "mb--2": "",
780
- "items-center": "",
781
- op50: ""
782
- }, [
783
- /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" }),
784
- /* @__PURE__ */ createBaseVNode("div", { "flex-none": "" }, " Details "),
785
- /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" })
786
- ], -1);
787
- const _hoisted_5$1 = {
788
- "max-w-full": "",
789
- "w-full": "",
790
- "table-fixed": ""
791
- };
792
- const _hoisted_6$1 = /* @__PURE__ */ createBaseVNode("td", {
793
- "w-30": "",
794
- "ws-nowrap": "",
795
- pr5: "",
796
- "text-right": "",
797
- op50: ""
798
- }, " Filepath ", -1);
799
- const _hoisted_7$1 = {
800
- flex: "~ gap-1",
801
- "w-full": "",
802
- "items-center": ""
803
- };
804
- const _hoisted_8$1 = /* @__PURE__ */ createBaseVNode("td", {
805
- "w-30": "",
806
- "ws-nowrap": "",
807
- pr5: "",
808
- "text-right": "",
809
- op50: ""
810
- }, " Public Path ", -1);
811
- const _hoisted_9 = {
812
- flex: "~ gap-1",
813
- "w-full": "",
814
- "items-center": "",
815
- "of-hidden": ""
816
- };
817
- const _hoisted_10 = {
818
- "flex-auto": "",
819
- "of-hidden": "",
820
- truncate: "",
821
- "ws-pre": "",
822
- "font-mono": ""
823
- };
824
- const _hoisted_11 = /* @__PURE__ */ createBaseVNode("td", {
825
- "w-30": "",
826
- "ws-nowrap": "",
827
- pr5: "",
828
- "text-right": "",
829
- op50: ""
830
- }, " Type ", -1);
831
- const _hoisted_12 = { capitalize: "" };
832
- const _hoisted_13 = /* @__PURE__ */ createBaseVNode("td", {
833
- "w-30": "",
834
- "ws-nowrap": "",
835
- pr5: "",
836
- "text-right": "",
837
- op50: ""
838
- }, " Image Size ", -1);
839
- const _hoisted_14 = { key: 0 };
840
- const _hoisted_15 = /* @__PURE__ */ createBaseVNode("td", {
841
- "w-30": "",
842
- "ws-nowrap": "",
843
- pr5: "",
844
- "text-right": "",
845
- op50: ""
846
- }, " Aspect Ratio ", -1);
847
- const _hoisted_16 = /* @__PURE__ */ createBaseVNode("td", {
848
- "w-30": "",
849
- "ws-nowrap": "",
850
- pr5: "",
851
- "text-right": "",
852
- op50: ""
853
- }, " File size ", -1);
854
- const _hoisted_17 = /* @__PURE__ */ createBaseVNode("td", {
855
- "w-30": "",
856
- "ws-nowrap": "",
857
- pr5: "",
858
- "text-right": "",
859
- op50: ""
860
- }, " Last modified ", -1);
861
- const _hoisted_18 = { op70: "" };
862
- const _hoisted_19 = /* @__PURE__ */ createBaseVNode("div", {
863
- flex: "~ gap2",
864
- "mb--2": "",
865
- "items-center": "",
866
- op50: ""
867
- }, [
868
- /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" }),
869
- /* @__PURE__ */ createBaseVNode("div", { "flex-none": "" }, " Actions "),
870
- /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" })
871
- ], -1);
872
- const _hoisted_20 = { flex: "~ gap2 wrap" };
873
- const _hoisted_21 = /* @__PURE__ */ createBaseVNode("div", { "flex-auto": "" }, null, -1);
874
- const _hoisted_22 = {
875
- flex: "~ col gap-4",
876
- "min-h-full": "",
877
- "w-full": "",
878
- "of-hidden": "",
879
- p8: ""
880
- };
881
- const _hoisted_23 = /* @__PURE__ */ createBaseVNode("span", null, " Are you sure you want to delete this asset? ", -1);
882
- const _hoisted_24 = { flex: "~ gap2 wrap justify-center" };
883
- const _hoisted_25 = {
884
- flex: "~ col gap-4",
885
- "min-h-full": "",
886
- "w-full": "",
887
- "of-hidden": "",
888
- p8: ""
889
- };
890
- const _hoisted_26 = { flex: "~ gap2 wrap justify-center" };
891
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
892
- __name: "AssetDetails",
893
- props: {
894
- modelValue: {}
895
- },
896
- setup(__props, { emit }) {
897
- const props = __props;
898
- const asset = useVModel(props, "modelValue", emit, { passive: true });
899
- const showNotification = useNotification();
900
- const origin = window.parent.location.origin;
901
- const imageMeta = computedAsync(() => {
902
- if (asset.value.type !== "image")
903
- return void 0;
904
- return rpc.getImageMeta(asset.value.filePath);
905
- });
906
- const textContent = computedAsync(() => {
907
- if (asset.value.type !== "text")
908
- return void 0;
909
- return rpc.getTextAssetContent(asset.value.filePath);
910
- });
911
- const copy = useCopy();
912
- const timeAgo = useTimeAgo(() => asset.value.mtime);
913
- const fileSize = computed(() => {
914
- const size = asset.value.size;
915
- if (size < 1024)
916
- return `${size} B`;
917
- if (size < 1024 * 1024)
918
- return `${(size / 1024).toFixed(2)} KB`;
919
- return `${(size / 1024 / 1024).toFixed(2)} MB`;
920
- });
921
- const aspectRatio = computed(() => {
922
- if (!imageMeta.value?.width || !imageMeta.value?.height)
923
- return "";
924
- const gcd = (a, b) => {
925
- if (!b)
926
- return a;
927
- return gcd(b, a % b);
928
- };
929
- const ratio = gcd(imageMeta.value.width, imageMeta.value.height);
930
- if (ratio > 3)
931
- return `${imageMeta.value.width / ratio}:${imageMeta.value.height / ratio}`;
932
- return "";
933
- });
934
- const supportsPreview = computed(() => {
935
- return [
936
- "image",
937
- "text",
938
- "video",
939
- "audio",
940
- "font"
941
- ].includes(asset.value.type);
942
- });
943
- const deleteDialog = ref(false);
944
- async function deleteAsset() {
945
- try {
946
- await rpc.deleteStaticAsset(asset.value.filePath);
947
- asset.value = void 0;
948
- deleteDialog.value = false;
949
- showNotification({
950
- text: "Asset deleted",
951
- icon: "carbon-checkmark",
952
- type: "primary"
953
- });
954
- } catch (error) {
955
- deleteDialog.value = false;
956
- showNotification({
957
- text: "Something went wrong!",
958
- icon: "carbon-warning",
959
- type: "error"
960
- });
961
- }
962
- }
963
- const renameDialog = ref(false);
964
- const newName = ref("");
965
- async function renameAsset() {
966
- const parts = asset.value.filePath.split("/");
967
- const oldName = parts.slice(-1)[0].split(".").slice(0, -1).join(".");
968
- if (!newName.value || newName.value === oldName) {
969
- return showNotification({
970
- text: "Please enter a new name",
971
- icon: "carbon-warning",
972
- type: "error"
973
- });
974
- }
975
- try {
976
- const extension = parts.slice(-1)[0].split(".").slice(-1)[0];
977
- const fullPath = `${parts.slice(0, -1).join("/")}/${newName.value}.${extension}`;
978
- await rpc.renameStaticAsset(asset.value.filePath, fullPath);
979
- asset.value = void 0;
980
- renameDialog.value = false;
981
- showNotification({
982
- text: "Asset renamed",
983
- icon: "carbon-checkmark",
984
- type: "primary"
985
- });
986
- } catch (error) {
987
- showNotification({
988
- text: "Something went wrong!",
989
- icon: "carbon-warning",
990
- type: "error"
991
- });
992
- }
993
- }
994
- const client = useDevToolsClient();
995
- return (_ctx, _cache) => {
996
- const _component_AssetPreview = _sfc_main$5;
997
- const _component_FilepathItem = _sfc_main$7;
998
- const _component_VDIconButton = _sfc_main$8;
999
- const _component_VDButton = _sfc_main$9;
1000
- const _component_VDDialog = _sfc_main$a;
1001
- const _component_VDTextInput = _sfc_main$b;
1002
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
1003
- unref(supportsPreview) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1004
- _hoisted_2$2,
1005
- createBaseVNode("div", _hoisted_3$1, [
1006
- createVNode(_component_AssetPreview, {
1007
- border: "~ base",
1008
- detail: "",
1009
- "max-h-80": "",
1010
- "min-h-20": "",
1011
- "min-w-20": "",
1012
- "w-auto": "",
1013
- rounded: "",
1014
- asset: unref(asset),
1015
- "text-content": unref(textContent)
1016
- }, null, 8, ["asset", "text-content"])
1017
- ])
1018
- ], 64)) : createCommentVNode("", true),
1019
- _hoisted_4$1,
1020
- createBaseVNode("table", _hoisted_5$1, [
1021
- createBaseVNode("tbody", null, [
1022
- createBaseVNode("tr", null, [
1023
- _hoisted_6$1,
1024
- createBaseVNode("td", null, [
1025
- createBaseVNode("div", _hoisted_7$1, [
1026
- createVNode(_component_FilepathItem, {
1027
- filepath: unref(asset).filePath,
1028
- "text-left": ""
1029
- }, null, 8, ["filepath"]),
1030
- createVNode(_component_VDIconButton, {
1031
- "flex-none": "",
1032
- title: "Open in Editor",
1033
- icon: "carbon-launch",
1034
- onClick: _cache[0] || (_cache[0] = ($event) => unref(client).openInEditor(unref(asset).filePath))
1035
- })
1036
- ])
1037
- ])
1038
- ]),
1039
- createBaseVNode("tr", null, [
1040
- _hoisted_8$1,
1041
- createBaseVNode("td", null, [
1042
- createBaseVNode("div", _hoisted_9, [
1043
- createBaseVNode("div", _hoisted_10, toDisplayString(unref(asset).publicPath), 1),
1044
- createVNode(_component_VDIconButton, {
1045
- "flex-none": "",
1046
- title: "Copy public path",
1047
- icon: "carbon-copy",
1048
- onClick: _cache[1] || (_cache[1] = ($event) => unref(copy)(unref(asset).publicPath))
1049
- }),
1050
- createVNode(_component_VDIconButton, {
1051
- "flex-none": "",
1052
- to: `${unref(origin)}${unref(asset).publicPath}`,
1053
- icon: "carbon-launch",
1054
- target: "_blank",
1055
- title: "Open in browser"
1056
- }, null, 8, ["to"])
1057
- ])
1058
- ])
1059
- ]),
1060
- createBaseVNode("tr", null, [
1061
- _hoisted_11,
1062
- createBaseVNode("td", _hoisted_12, toDisplayString(unref(asset).type), 1)
1063
- ]),
1064
- unref(imageMeta)?.width ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1065
- createBaseVNode("tr", null, [
1066
- _hoisted_13,
1067
- createBaseVNode("td", null, toDisplayString(unref(imageMeta).width) + " x " + toDisplayString(unref(imageMeta).height), 1)
1068
- ]),
1069
- unref(aspectRatio) ? (openBlock(), createElementBlock("tr", _hoisted_14, [
1070
- _hoisted_15,
1071
- createBaseVNode("td", null, toDisplayString(unref(aspectRatio)), 1)
1072
- ])) : createCommentVNode("", true)
1073
- ], 64)) : createCommentVNode("", true),
1074
- createBaseVNode("tr", null, [
1075
- _hoisted_16,
1076
- createBaseVNode("td", null, toDisplayString(unref(fileSize)), 1)
1077
- ]),
1078
- createBaseVNode("tr", null, [
1079
- _hoisted_17,
1080
- createBaseVNode("td", null, [
1081
- createTextVNode(toDisplayString(new Date(unref(asset).mtime).toLocaleString()) + " ", 1),
1082
- createBaseVNode("span", _hoisted_18, "(" + toDisplayString(unref(timeAgo)) + ")", 1)
1083
- ])
1084
- ])
1085
- ])
1086
- ]),
1087
- _hoisted_19,
1088
- createBaseVNode("div", _hoisted_20, [
1089
- createVNode(_component_VDButton, {
1090
- to: `${unref(origin)}${unref(asset).publicPath}`,
1091
- download: "",
1092
- target: "_blank",
1093
- icon: "carbon-download",
1094
- n: "green"
1095
- }, {
1096
- default: withCtx(() => [
1097
- createTextVNode(" Download ")
1098
- ]),
1099
- _: 1
1100
- }, 8, ["to"]),
1101
- createVNode(_component_VDButton, {
1102
- icon: "carbon-text-annotation-toggle",
1103
- n: "blue",
1104
- onClick: _cache[2] || (_cache[2] = ($event) => renameDialog.value = !unref(renameDialog))
1105
- }, {
1106
- default: withCtx(() => [
1107
- createTextVNode(" Rename ")
1108
- ]),
1109
- _: 1
1110
- }),
1111
- createVNode(_component_VDButton, {
1112
- icon: "carbon-delete",
1113
- n: "red",
1114
- onClick: _cache[3] || (_cache[3] = ($event) => deleteDialog.value = !unref(deleteDialog))
1115
- }, {
1116
- default: withCtx(() => [
1117
- createTextVNode(" Delete ")
1118
- ]),
1119
- _: 1
1120
- })
1121
- ]),
1122
- _hoisted_21,
1123
- createVNode(_component_VDDialog, {
1124
- modelValue: unref(deleteDialog),
1125
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(deleteDialog) ? deleteDialog.value = $event : null),
1126
- onClose: _cache[6] || (_cache[6] = ($event) => deleteDialog.value = false)
1127
- }, {
1128
- default: withCtx(() => [
1129
- createBaseVNode("div", _hoisted_22, [
1130
- _hoisted_23,
1131
- createBaseVNode("div", _hoisted_24, [
1132
- createVNode(_component_VDButton, {
1133
- icon: "carbon-close",
1134
- onClick: _cache[4] || (_cache[4] = ($event) => deleteDialog.value = false)
1135
- }, {
1136
- default: withCtx(() => [
1137
- createTextVNode(" Cancel ")
1138
- ]),
1139
- _: 1
1140
- }),
1141
- createVNode(_component_VDButton, {
1142
- icon: "carbon-delete",
1143
- n: "red",
1144
- onClick: deleteAsset
1145
- }, {
1146
- default: withCtx(() => [
1147
- createTextVNode(" Delete ")
1148
- ]),
1149
- _: 1
1150
- })
1151
- ])
1152
- ])
1153
- ]),
1154
- _: 1
1155
- }, 8, ["modelValue"]),
1156
- createVNode(_component_VDDialog, {
1157
- modelValue: unref(renameDialog),
1158
- "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => isRef(renameDialog) ? renameDialog.value = $event : null),
1159
- onClose: _cache[10] || (_cache[10] = ($event) => deleteDialog.value = false)
1160
- }, {
1161
- default: withCtx(() => [
1162
- createBaseVNode("div", _hoisted_25, [
1163
- createVNode(_component_VDTextInput, {
1164
- modelValue: unref(newName),
1165
- "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => isRef(newName) ? newName.value = $event : null),
1166
- placeholder: "New name",
1167
- n: "blue"
1168
- }, null, 8, ["modelValue"]),
1169
- createBaseVNode("div", _hoisted_26, [
1170
- createVNode(_component_VDButton, {
1171
- icon: "carbon-close",
1172
- onClick: _cache[8] || (_cache[8] = ($event) => renameDialog.value = false)
1173
- }, {
1174
- default: withCtx(() => [
1175
- createTextVNode(" Cancel ")
1176
- ]),
1177
- _: 1
1178
- }),
1179
- createVNode(_component_VDButton, {
1180
- icon: "carbon-text-annotation-toggle",
1181
- n: "blue",
1182
- onClick: renameAsset
1183
- }, {
1184
- default: withCtx(() => [
1185
- createTextVNode(" Rename ")
1186
- ]),
1187
- _: 1
1188
- })
1189
- ])
1190
- ])
1191
- ]),
1192
- _: 1
1193
- }, 8, ["modelValue"])
1194
- ]);
1195
- };
1196
- }
1197
- });
1198
-
1199
- /* Injected with object hook! */
1200
-
1201
- const _hoisted_1$3 = /* @__PURE__ */ createBaseVNode("div", { "x-divider": "" }, null, -1);
1202
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
1203
- __name: "AssetListItem",
1204
- props: {
1205
- item: {},
1206
- index: { default: 0 },
1207
- modelValue: {}
1208
- },
1209
- setup(__props, { emit }) {
1210
- const props = __props;
1211
- const model = useVModel(props, "modelValue", emit, { passive: true });
1212
- const isCollection = computed(() => props.item?.children?.length);
1213
- const open = ref(true);
1214
- const icon = computed(() => {
1215
- if (isCollection.value)
1216
- return "i-carbon-folder";
1217
- const assets = {
1218
- image: "i-carbon-image",
1219
- video: "i-carbon-video",
1220
- audio: "i-carbon-volume-up",
1221
- font: "i-carbon-text-small-caps",
1222
- text: "i-carbon-document",
1223
- json: "i-carbon-json"
1224
- };
1225
- return assets[props.item.type] ?? "i-carbon-document-blank";
1226
- });
1227
- return (_ctx, _cache) => {
1228
- const _component_VDIcon = _sfc_main$c;
1229
- const _component_AssetListItem = resolveComponent("AssetListItem", true);
1230
- return openBlock(), createElementBlock("div", null, [
1231
- createBaseVNode("button", {
1232
- flex: "~ gap-2",
1233
- "w-full": "",
1234
- "items-center": "",
1235
- hover: "bg-active",
1236
- px4: "",
1237
- py1: "",
1238
- style: normalizeStyle({ paddingLeft: `calc(1rem + ${_ctx.index * 1.5}em)` }),
1239
- class: normalizeClass({ "bg-active": !unref(isCollection) && unref(model)?.filePath === _ctx.item?.filePath }),
1240
- onClick: _cache[0] || (_cache[0] = ($event) => unref(isCollection) ? open.value = !unref(open) : model.value = _ctx.item)
1241
- }, [
1242
- createBaseVNode("div", {
1243
- class: normalizeClass(unref(icon))
1244
- }, null, 2),
1245
- createBaseVNode("span", {
1246
- class: normalizeClass({ "flex items-center": unref(isCollection) }),
1247
- "flex-auto": "",
1248
- "text-start": "",
1249
- "text-sm": "",
1250
- "font-mono": ""
1251
- }, toDisplayString(_ctx.item.path), 3),
1252
- unref(isCollection) ? (openBlock(), createBlock(_component_VDIcon, {
1253
- key: 0,
1254
- icon: "carbon:chevron-right",
1255
- "transform-rotate": unref(open) ? 90 : 0,
1256
- transition: ""
1257
- }, null, 8, ["transform-rotate"])) : createCommentVNode("", true)
1258
- ], 6),
1259
- _hoisted_1$3,
1260
- unref(open) ? renderSlot(_ctx.$slots, "default", { key: 0 }, () => [
1261
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.item?.children, (subItem) => {
1262
- return openBlock(), createBlock(_component_AssetListItem, {
1263
- key: subItem.filepath,
1264
- modelValue: unref(model),
1265
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(model) ? model.value = $event : null),
1266
- item: subItem,
1267
- index: _ctx.index + 1
1268
- }, null, 8, ["modelValue", "item", "index"]);
1269
- }), 128))
1270
- ]) : createCommentVNode("", true)
1271
- ]);
1272
- };
1273
- }
1274
- });
1275
-
1276
- /* Injected with object hook! */
1277
-
1278
- const _hoisted_1$2 = {
1279
- flex: "~ col gap-1",
1280
- hover: "bg-active",
1281
- "items-center": "",
1282
- "of-hidden": "",
1283
- rounded: "",
1284
- p2: ""
1285
- };
1286
- const _hoisted_2$1 = {
1287
- "w-full": "",
1288
- "of-hidden": "",
1289
- truncate: "",
1290
- "ws-nowrap": "",
1291
- "text-center": "",
1292
- "text-xs": ""
1293
- };
1294
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
1295
- __name: "AssetGridItem",
1296
- props: {
1297
- asset: {},
1298
- folder: {}
1299
- },
1300
- setup(__props) {
1301
- const props = __props;
1302
- const path = computed(() => {
1303
- if (props.folder && props.asset.path.startsWith(props.folder))
1304
- return props.asset.path.slice(props.folder.length);
1305
- return props.asset.path;
1306
- });
1307
- return (_ctx, _cache) => {
1308
- const _component_AssetPreview = _sfc_main$5;
1309
- return openBlock(), createElementBlock("button", _hoisted_1$2, [
1310
- createVNode(_component_AssetPreview, {
1311
- "h-30": "",
1312
- "w-30": "",
1313
- rounded: "",
1314
- border: "~ base",
1315
- asset: _ctx.asset
1316
- }, null, 8, ["asset"]),
1317
- createBaseVNode("div", _hoisted_2$1, toDisplayString(unref(path)), 1)
1318
- ]);
1319
- };
1320
- }
1321
- });
1322
-
1323
- /* Injected with object hook! */
1324
-
1325
- const _hoisted_1$1 = { flex: "~ gap4" };
1326
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
1327
- __name: "Navbar",
1328
- props: {
1329
- search: {
1330
- type: String,
1331
- default: void 0
1332
- },
1333
- noPadding: {
1334
- type: Boolean,
1335
- default: false
1336
- }
1337
- },
1338
- emits: ["update:search"],
1339
- setup(__props, { emit }) {
1340
- function update(event) {
1341
- emit("update:search", event.target.value);
1342
- }
1343
- return (_ctx, _cache) => {
1344
- const _component_VDTextInput = _sfc_main$b;
1345
- return openBlock(), createElementBlock("div", {
1346
- flex: "~ col gap2",
1347
- border: "b base",
1348
- "flex-1": "",
1349
- "navbar-glass": "",
1350
- class: normalizeClass([{ p4: !__props.noPadding }])
1351
- }, [
1352
- createBaseVNode("div", _hoisted_1$1, [
1353
- renderSlot(_ctx.$slots, "search", {}, () => [
1354
- createVNode(_component_VDTextInput, {
1355
- placeholder: "Search...",
1356
- icon: "carbon-search",
1357
- n: "primary",
1358
- "flex-auto": "",
1359
- class: normalizeClass({ "px-5 py-2": !__props.noPadding }),
1360
- value: __props.search,
1361
- onInput: update
1362
- }, null, 8, ["class", "value"])
1363
- ]),
1364
- renderSlot(_ctx.$slots, "actions")
1365
- ]),
1366
- renderSlot(_ctx.$slots, "default")
1367
- ], 2);
1368
- };
1369
- }
1370
- });
1371
-
1372
- /* Injected with object hook! */
1373
-
1374
- const _hoisted_1 = {
1375
- key: 0,
1376
- "h-full": "",
1377
- "of-auto": "",
1378
- "n-panel-grids": ""
1379
- };
1380
- const _hoisted_2 = {
1381
- "flex-none": "",
1382
- flex: "~ gap4"
1383
- };
1384
- const _hoisted_3 = { op50: "" };
1385
- const _hoisted_4 = { key: 0 };
1386
- const _hoisted_5 = {
1387
- "mt--4": "",
1388
- px2: "",
1389
- grid: "~ cols-minmax-8rem"
1390
- };
1391
- const _hoisted_6 = {
1392
- key: 1,
1393
- p2: "",
1394
- grid: "~ cols-minmax-8rem"
1395
- };
1396
- const _hoisted_7 = { key: 1 };
1397
- const _hoisted_8 = /* @__PURE__ */ createBaseVNode("h1", {
1398
- "text-sm": "",
1399
- italic: "",
1400
- op50: ""
1401
- }, " No Assets ", -1);
1402
- const _sfc_main = /* @__PURE__ */ defineComponent({
1403
- __name: "assets",
1404
- setup(__props) {
1405
- function useAssets() {
1406
- const assets2 = ref([]);
1407
- getAssets();
1408
- const debounceAssets = useDebounceFn(() => {
1409
- getAssets();
1410
- }, 100);
1411
- async function getAssets() {
1412
- assets2.value = await rpc.staticAssets();
1413
- }
1414
- hookApi.hook.on("__vue-devtools:file-watch", ({ event, path }) => {
1415
- if (path.startsWith(rootPath) && ["add", "unlink"].includes(event))
1416
- debounceAssets();
1417
- });
1418
- return { assets: assets2 };
1419
- }
1420
- const { assets } = useAssets();
1421
- const search = ref("");
1422
- const fuse = computed(() => new Fuse(assets.value || [], {
1423
- keys: [
1424
- "path"
1425
- ]
1426
- }));
1427
- const filtered = computed(() => {
1428
- const result = search.value ? fuse.value.search(search.value).map((i) => i.item) : assets.value || [];
1429
- return result;
1430
- });
1431
- const byFolders = computed(() => {
1432
- const result = {};
1433
- for (const asset of filtered.value) {
1434
- const folder = `${asset.path.split("/").slice(0, -1).join("/")}/`;
1435
- if (!result[folder])
1436
- result[folder] = [];
1437
- result[folder].push(asset);
1438
- }
1439
- return Object.entries(result).sort(([a], [b]) => a.localeCompare(b));
1440
- });
1441
- const byTree = computed(() => {
1442
- const root = { path: "public", children: [] };
1443
- const addToTree = (node, pathParts, file) => {
1444
- const [currentPart, ...remainingParts] = pathParts;
1445
- let child = node.children.find((child2) => child2.path === currentPart);
1446
- if (!child) {
1447
- child = { ...file, path: currentPart, children: [] };
1448
- node.children.push(child);
1449
- }
1450
- if (remainingParts.length > 1)
1451
- addToTree(child, remainingParts, file);
1452
- else if (remainingParts.length === 1)
1453
- child.children.push({ ...file, path: remainingParts[0] });
1454
- };
1455
- filtered.value.forEach((file) => {
1456
- const pathParts = file.path.split("/").filter((part) => part !== "");
1457
- addToTree(root, pathParts, file);
1458
- });
1459
- return root.children;
1460
- });
1461
- const selected = ref();
1462
- const view = ref("grid");
1463
- function toggleView() {
1464
- view.value = view.value === "list" ? "grid" : "list";
1465
- }
1466
- onKeyDown("Escape", () => {
1467
- selected.value = void 0;
1468
- });
1469
- const navbar = ref();
1470
- return (_ctx, _cache) => {
1471
- const _component_VDIcon = _sfc_main$c;
1472
- const _component_Navbar = _sfc_main$1;
1473
- const _component_AssetGridItem = _sfc_main$2;
1474
- const _component_VDSectionBlock = __unplugin_components_3;
1475
- const _component_AssetListItem = _sfc_main$3;
1476
- const _component_AssetDetails = _sfc_main$4;
1477
- const _component_DrawerRight = _sfc_main$d;
1478
- const _component_VDCard = __unplugin_components_7;
1479
- const _component_VDPanelGrids = __unplugin_components_0;
1480
- return unref(assets)?.length ? (openBlock(), createElementBlock("div", _hoisted_1, [
1481
- createVNode(_component_Navbar, {
1482
- ref_key: "navbar",
1483
- ref: navbar,
1484
- search: unref(search),
1485
- "onUpdate:search": _cache[0] || (_cache[0] = ($event) => isRef(search) ? search.value = $event : null),
1486
- pb2: ""
1487
- }, {
1488
- actions: withCtx(() => [
1489
- createBaseVNode("div", _hoisted_2, [
1490
- createBaseVNode("button", {
1491
- title: "Toggle view",
1492
- onClick: toggleView
1493
- }, [
1494
- unref(view) === "grid" ? (openBlock(), createBlock(_component_VDIcon, {
1495
- key: 0,
1496
- icon: "i-carbon-list"
1497
- })) : (openBlock(), createBlock(_component_VDIcon, {
1498
- key: 1,
1499
- icon: "i-carbon-grid"
1500
- }))
1501
- ])
1502
- ])
1503
- ]),
1504
- default: withCtx(() => [
1505
- createBaseVNode("div", _hoisted_3, [
1506
- unref(search) ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(filtered).length) + " matched · ", 1)) : createCommentVNode("", true),
1507
- createBaseVNode("span", null, toDisplayString(unref(assets)?.length) + " assets in total", 1)
1508
- ])
1509
- ]),
1510
- _: 1
1511
- }, 8, ["search"]),
1512
- unref(view) === "grid" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
1513
- unref(byFolders).length > 1 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(byFolders), ([folder, items]) => {
1514
- return openBlock(), createBlock(_component_VDSectionBlock, {
1515
- key: folder,
1516
- text: folder,
1517
- description: `${items.length} items`,
1518
- open: items.length <= 20,
1519
- padding: false
1520
- }, {
1521
- default: withCtx(() => [
1522
- createBaseVNode("div", _hoisted_5, [
1523
- (openBlock(true), createElementBlock(Fragment, null, renderList(items, (a) => {
1524
- return openBlock(), createBlock(_component_AssetGridItem, {
1525
- key: a.path,
1526
- asset: a,
1527
- folder,
1528
- onClick: ($event) => selected.value = a
1529
- }, null, 8, ["asset", "folder", "onClick"]);
1530
- }), 128))
1531
- ])
1532
- ]),
1533
- _: 2
1534
- }, 1032, ["text", "description", "open"]);
1535
- }), 128)) : (openBlock(), createElementBlock("div", _hoisted_6, [
1536
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filtered), (a) => {
1537
- return openBlock(), createBlock(_component_AssetGridItem, {
1538
- key: a.path,
1539
- asset: a,
1540
- onClick: ($event) => selected.value = a
1541
- }, null, 8, ["asset", "onClick"]);
1542
- }), 128))
1543
- ]))
1544
- ], 64)) : (openBlock(), createElementBlock("div", _hoisted_7, [
1545
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(byTree), (item, key) => {
1546
- return openBlock(), createBlock(_component_AssetListItem, {
1547
- key,
1548
- modelValue: unref(selected),
1549
- "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(selected) ? selected.value = $event : null),
1550
- item
1551
- }, null, 8, ["modelValue", "item"]);
1552
- }), 128))
1553
- ])),
1554
- createVNode(_component_DrawerRight, {
1555
- "model-value": !!unref(selected),
1556
- "auto-close": "",
1557
- "w-120": "",
1558
- navbar: unref(navbar),
1559
- onClose: _cache[3] || (_cache[3] = ($event) => selected.value = void 0)
1560
- }, {
1561
- default: withCtx(() => [
1562
- unref(selected) ? (openBlock(), createBlock(_component_AssetDetails, {
1563
- key: 0,
1564
- modelValue: unref(selected),
1565
- "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isRef(selected) ? selected.value = $event : null)
1566
- }, null, 8, ["modelValue"])) : createCommentVNode("", true)
1567
- ]),
1568
- _: 1
1569
- }, 8, ["model-value", "navbar"])
1570
- ])) : (openBlock(), createBlock(_component_VDPanelGrids, {
1571
- key: 1,
1572
- px5: ""
1573
- }, {
1574
- default: withCtx(() => [
1575
- createVNode(_component_VDCard, {
1576
- flex: "~ col gap2",
1577
- "min-w-30": "",
1578
- "items-center": "",
1579
- p3: ""
1580
- }, {
1581
- default: withCtx(() => [
1582
- _hoisted_8
1583
- ]),
1584
- _: 1
1585
- })
1586
- ]),
1587
- _: 1
1588
- }));
1589
- };
1590
- }
1591
- });
1592
-
1593
- /* Injected with object hook! */
1594
-
1595
- /* Injected with object hook! */
1596
-
1597
- export { _sfc_main as default };