@nuxt/devtools 3.0.1 → 3.1.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/chunks/module-main.mjs +73 -57
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +1 -1
- package/dist/client/404.html +1 -1
- package/dist/client/_nuxt/__blank-lxstpk89.js +1 -0
- package/dist/client/_nuxt/{analyze-build-g5gvbr2w.js → analyze-build-kavepk5h.js} +1 -1
- package/dist/client/_nuxt/{assets-hoobpwak.js → assets-lbkq1tqr.js} +3 -3
- package/dist/client/_nuxt/b2u55qmz.js +5 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/06025e11-48ac-46e3-8f59-eb3ab8bfd4b9.json +1 -0
- package/dist/client/_nuxt/{client-miiq4qin.js → client-c6aoxv2l.js} +1 -1
- package/dist/client/_nuxt/{code-diff-ojhnq7lb.js → code-diff-li4lnfub.js} +3 -3
- package/dist/client/_nuxt/{code-snippets-io8vjgte.js → code-snippets-gyl3bqgb.js} +1 -1
- package/dist/client/_nuxt/components-n5suoqli.js +1 -0
- package/dist/client/_nuxt/{composable-item-de2qbj5y.js → composable-item-gqqnydns.js} +1 -1
- package/dist/client/_nuxt/custom-_name_-kmemebv7.js +1 -0
- package/dist/client/_nuxt/{data-schema-button-hqryewml.js → data-schema-button-euw6cc96.js} +1 -1
- package/dist/client/_nuxt/data-schema-drawer-gabow5oi.js +2 -0
- package/dist/client/_nuxt/debug-dfr4605f.js +1 -0
- package/dist/client/_nuxt/default-gnt8qqkx.js +1 -0
- package/dist/client/_nuxt/duration-display-f44008lc.js +1 -0
- package/dist/client/_nuxt/{entry.css-dxneg9ww.css → entry.css-isd0m9wk.css} +1 -1
- package/dist/client/_nuxt/{error-404-iwj5ktdi.js → error-404-k9s93f0g.js} +1 -1
- package/dist/client/_nuxt/error-404.css-fede2tas.css +1 -0
- package/dist/client/_nuxt/{error-500-mqwlgvuu.js → error-500-f6vgodgv.js} +1 -1
- package/dist/client/_nuxt/error-500.css-m89l6mhd.css +1 -0
- package/dist/client/_nuxt/{error-id9ygai8.js → error-n483ebsa.js} +2 -2
- package/dist/client/_nuxt/filepath-item-f2iy8phl.js +1 -0
- package/dist/client/_nuxt/full-dkkamqwi.js +1 -0
- package/dist/client/_nuxt/help-fab-izt1nioe.js +1 -0
- package/dist/client/_nuxt/{hooks-laf22lmj.js → hooks-lehfx0wr.js} +1 -1
- package/dist/client/_nuxt/{imports-f8ct263a.js → imports-hdwwo21k.js} +1 -1
- package/dist/client/_nuxt/{index-c8rdvb0d.js → index-cyu9c9kn.js} +1 -1
- package/dist/client/_nuxt/launch-page-gkflizue.js +1 -0
- package/dist/client/_nuxt/modules-htbuqp0w.js +1 -0
- package/dist/client/_nuxt/nbadge-dv1e6eny.js +1 -0
- package/dist/client/_nuxt/ncheckbox-dg5nbt1d.js +1 -0
- package/dist/client/_nuxt/{ncode-block-pcw3yh3u.js → ncode-block-esxkr86l.js} +2 -2
- package/dist/client/_nuxt/ndrawer-j5h6fmbh.js +1 -0
- package/dist/client/_nuxt/ndropdown-gskb7sy5.js +1 -0
- package/dist/client/_nuxt/nicon-title-n11g9rad.js +1 -0
- package/dist/client/_nuxt/nlink-cmgg7q58.js +1 -0
- package/dist/client/_nuxt/{nmarkdown-n6zsr15e.js → nmarkdown-pb9g5o14.js} +1 -1
- package/dist/client/_nuxt/nnavbar-eqdsa2v0.js +1 -0
- package/dist/client/_nuxt/none-fj7wo34y.js +1 -0
- package/dist/client/_nuxt/nsection-block-owu5vx1c.js +1 -0
- package/dist/client/_nuxt/nselect-h7b4tp2d.js +1 -0
- package/dist/client/_nuxt/nselect-tabs-b4x1017q.js +1 -0
- package/dist/client/_nuxt/nswitch-ikgdy16r.js +1 -0
- package/dist/client/_nuxt/{open-graph-mez5e6fa.js → open-graph-fa6g70np.js} +2 -2
- package/dist/client/_nuxt/{overview-srppqorv.js → overview-c0tmze6n.js} +1 -1
- package/dist/client/_nuxt/{pages-cx6ypazp.js → pages-gv3j1axz.js} +1 -1
- package/dist/client/_nuxt/payload-ht4ljhot.js +1 -0
- package/dist/client/_nuxt/pinia-o8sdd1q0.js +1 -0
- package/dist/client/_nuxt/plugins-j03zk4nt.js +1 -0
- package/dist/client/_nuxt/render-tree-dulpfo6t.js +1 -0
- package/dist/client/_nuxt/{runtime-configs-ikjtidht.js → runtime-configs-ct1bawfd.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-cxlml691.js → server-discovery-oj5uubbh.js} +1 -1
- package/dist/client/_nuxt/server-route-inputs-ewvvpkab.js +1 -0
- package/dist/client/_nuxt/server-routes-d95zd0vp.js +9 -0
- package/dist/client/_nuxt/server-tasks-my595b5f.js +1 -0
- package/dist/client/_nuxt/{settings-jjzeh2ii.js → settings-tj46uptc.js} +1 -1
- package/dist/client/_nuxt/stacktrace-list-hxyb5x3b.js +1 -0
- package/dist/client/_nuxt/{state-components-8k7sf46m.js → state-components-jdafqa4i.js} +1 -1
- package/dist/client/_nuxt/state-editor-baqu4p5i.js +1 -0
- package/dist/client/_nuxt/state-modules-kxdkrymq.js +1 -0
- package/dist/client/_nuxt/{storage-leh9ssqu.js → storage-cx4pelsr.js} +1 -1
- package/dist/client/_nuxt/{terminals-iiytrime.js → terminals-caz1fzd6.js} +1 -1
- package/dist/client/_nuxt/{timeline-e4i6webe.js → timeline-mumljjvf.js} +1 -1
- package/dist/client/_nuxt/{unocss-runtime-f3lhgbmf.js → unocss-runtime-b6rpi9xs.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-ikjc812x.js → json-editor-vue-ho2zu772.js} +101 -136
- package/dist/client/_nuxt/vendor/{quicktype-core-i0qughny.js → quicktype-core-jsgpnknz.js} +47 -99
- package/dist/client/_nuxt/vendor/{shiki-hpfujfi3.js → shiki-g7cm1eew.js} +12 -12
- package/dist/client/_nuxt/vendor/unocss-d7th42z7.js +3 -0
- package/dist/client/_nuxt/vendor/{vis-bs03k74b.js → vis-lxvjz9wh.js} +3 -61
- package/dist/client/_nuxt/{virtual-files-hz1usa1q.js → virtual-files-h4b74qh3.js} +1 -1
- package/dist/client/_nuxt/vue-devtools-eqo8l0nw.js +2 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-b0ym3ct8.js → vue-virtual-scroller.esm-c1c6kquq.js} +2 -2
- package/dist/client/discovery/index.html +80 -80
- package/dist/client/index.html +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/shared/{devtools.Dlu0WIXO.mjs → devtools.DuFZOCNN.mjs} +2 -2
- package/dist/webcomponents/index.mjs +1 -1
- package/package.json +28 -28
- package/dist/client/_nuxt/__blank-dhzpxa9h.js +0 -1
- package/dist/client/_nuxt/builds/meta/ca1a01cd-6ed2-4bbf-8336-117a84e2b101.json +0 -1
- package/dist/client/_nuxt/components-ipir9b5n.js +0 -1
- package/dist/client/_nuxt/custom-_name_-ge4o4zq5.js +0 -1
- package/dist/client/_nuxt/data-schema-drawer-dx9i8gkb.js +0 -2
- package/dist/client/_nuxt/debug-r6n50v7w.js +0 -1
- package/dist/client/_nuxt/default-dqdvxwmy.js +0 -1
- package/dist/client/_nuxt/duration-display-cjpkh71u.js +0 -1
- package/dist/client/_nuxt/error-404.css-da6qbpbu.css +0 -1
- package/dist/client/_nuxt/error-500.css-npck1tpq.css +0 -1
- package/dist/client/_nuxt/fi863awb.js +0 -19
- package/dist/client/_nuxt/filepath-item-owlv864w.js +0 -1
- package/dist/client/_nuxt/full-h5l9uhx2.js +0 -1
- package/dist/client/_nuxt/help-fab-chg6ox1v.js +0 -1
- package/dist/client/_nuxt/launch-page-l87i7ewv.js +0 -1
- package/dist/client/_nuxt/modules-n3nj6dke.js +0 -1
- package/dist/client/_nuxt/nbadge-d24jlq2b.js +0 -1
- package/dist/client/_nuxt/ncheckbox-eijyrwcq.js +0 -1
- package/dist/client/_nuxt/ndrawer-ele5003c.js +0 -1
- package/dist/client/_nuxt/ndropdown-jcnxkt1n.js +0 -1
- package/dist/client/_nuxt/nicon-title-he6hzgyb.js +0 -1
- package/dist/client/_nuxt/nlink-fgjzhevk.js +0 -1
- package/dist/client/_nuxt/nnavbar-b4ap0r8w.js +0 -1
- package/dist/client/_nuxt/none-f818gn7h.js +0 -1
- package/dist/client/_nuxt/nsection-block-je23gs2w.js +0 -1
- package/dist/client/_nuxt/nselect-nvb1idpm.js +0 -1
- package/dist/client/_nuxt/nselect-tabs-fwdas30r.js +0 -1
- package/dist/client/_nuxt/nswitch-ls95gzk4.js +0 -1
- package/dist/client/_nuxt/payload-j2iesofw.js +0 -1
- package/dist/client/_nuxt/pinia-on9aotya.js +0 -1
- package/dist/client/_nuxt/plugins-hfjqtsyk.js +0 -1
- package/dist/client/_nuxt/render-tree-hx67nafn.js +0 -1
- package/dist/client/_nuxt/server-route-inputs-e42a8bs5.js +0 -1
- package/dist/client/_nuxt/server-routes-m3sevzg5.js +0 -9
- package/dist/client/_nuxt/server-tasks-dhxv0bsz.js +0 -1
- package/dist/client/_nuxt/stacktrace-list-gp6s7nwa.js +0 -1
- package/dist/client/_nuxt/state-editor-kisl1jyp.js +0 -1
- package/dist/client/_nuxt/state-modules-lzveckmy.js +0 -1
- package/dist/client/_nuxt/vendor/unocss-le7h2qts.js +0 -3
- package/dist/client/_nuxt/vue-devtools-hb1vi95m.js +0 -2
|
@@ -6,7 +6,7 @@ import { colors } from 'consola/utils';
|
|
|
6
6
|
import { join, dirname as dirname$1, resolve, isAbsolute } from 'pathe';
|
|
7
7
|
import sirv from 'sirv';
|
|
8
8
|
import { searchForWorkspaceRoot } from 'vite';
|
|
9
|
-
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.
|
|
9
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.DuFZOCNN.mjs';
|
|
10
10
|
import path, { dirname, join as join$1, relative, parse } from 'node:path';
|
|
11
11
|
import { hash } from 'ohash';
|
|
12
12
|
import { runtimeDir, clientDir, packageDir, isGlobalInstall } from '../dirs.mjs';
|
|
@@ -33,7 +33,7 @@ import { getDefaultExportOptions, addNuxtModule } from 'magicast/helpers';
|
|
|
33
33
|
import { detectPackageManager } from 'nypm';
|
|
34
34
|
import semver from 'semver';
|
|
35
35
|
|
|
36
|
-
const version$1 = "3.
|
|
36
|
+
const version$1 = "3.1.1";
|
|
37
37
|
|
|
38
38
|
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
39
39
|
function randomStr(size = 16, dict = urlAlphabet) {
|
|
@@ -1300,10 +1300,10 @@ var pp$8 = Parser.prototype;
|
|
|
1300
1300
|
// to its body instead of creating a new node.
|
|
1301
1301
|
|
|
1302
1302
|
pp$8.parseTopLevel = function(node) {
|
|
1303
|
-
var exports = Object.create(null);
|
|
1303
|
+
var exports$1 = Object.create(null);
|
|
1304
1304
|
if (!node.body) { node.body = []; }
|
|
1305
1305
|
while (this.type !== types$1.eof) {
|
|
1306
|
-
var stmt = this.parseStatement(null, true, exports);
|
|
1306
|
+
var stmt = this.parseStatement(null, true, exports$1);
|
|
1307
1307
|
node.body.push(stmt);
|
|
1308
1308
|
}
|
|
1309
1309
|
if (this.inModule)
|
|
@@ -1410,7 +1410,7 @@ pp$8.isUsing = function(isFor) {
|
|
|
1410
1410
|
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
|
|
1411
1411
|
// does not help.
|
|
1412
1412
|
|
|
1413
|
-
pp$8.parseStatement = function(context, topLevel, exports) {
|
|
1413
|
+
pp$8.parseStatement = function(context, topLevel, exports$1) {
|
|
1414
1414
|
var starttype = this.type, node = this.startNode(), kind;
|
|
1415
1415
|
|
|
1416
1416
|
if (this.isLet(context)) {
|
|
@@ -1465,7 +1465,7 @@ pp$8.parseStatement = function(context, topLevel, exports) {
|
|
|
1465
1465
|
if (!this.inModule)
|
|
1466
1466
|
{ this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
|
|
1467
1467
|
}
|
|
1468
|
-
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports)
|
|
1468
|
+
return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1)
|
|
1469
1469
|
|
|
1470
1470
|
// If the statement does not start with a statement keyword or a
|
|
1471
1471
|
// brace, it's an ExpressionStatement or LabeledStatement. We
|
|
@@ -2221,11 +2221,11 @@ function checkKeyName(node, name) {
|
|
|
2221
2221
|
|
|
2222
2222
|
// Parses module export declaration.
|
|
2223
2223
|
|
|
2224
|
-
pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
2224
|
+
pp$8.parseExportAllDeclaration = function(node, exports$1) {
|
|
2225
2225
|
if (this.options.ecmaVersion >= 11) {
|
|
2226
2226
|
if (this.eatContextual("as")) {
|
|
2227
2227
|
node.exported = this.parseModuleExportName();
|
|
2228
|
-
this.checkExport(exports, node.exported, this.lastTokStart);
|
|
2228
|
+
this.checkExport(exports$1, node.exported, this.lastTokStart);
|
|
2229
2229
|
} else {
|
|
2230
2230
|
node.exported = null;
|
|
2231
2231
|
}
|
|
@@ -2239,14 +2239,14 @@ pp$8.parseExportAllDeclaration = function(node, exports) {
|
|
|
2239
2239
|
return this.finishNode(node, "ExportAllDeclaration")
|
|
2240
2240
|
};
|
|
2241
2241
|
|
|
2242
|
-
pp$8.parseExport = function(node, exports) {
|
|
2242
|
+
pp$8.parseExport = function(node, exports$1) {
|
|
2243
2243
|
this.next();
|
|
2244
2244
|
// export * from '...'
|
|
2245
2245
|
if (this.eat(types$1.star)) {
|
|
2246
|
-
return this.parseExportAllDeclaration(node, exports)
|
|
2246
|
+
return this.parseExportAllDeclaration(node, exports$1)
|
|
2247
2247
|
}
|
|
2248
2248
|
if (this.eat(types$1._default)) { // export default ...
|
|
2249
|
-
this.checkExport(exports, "default", this.lastTokStart);
|
|
2249
|
+
this.checkExport(exports$1, "default", this.lastTokStart);
|
|
2250
2250
|
node.declaration = this.parseExportDefaultDeclaration();
|
|
2251
2251
|
return this.finishNode(node, "ExportDefaultDeclaration")
|
|
2252
2252
|
}
|
|
@@ -2254,16 +2254,16 @@ pp$8.parseExport = function(node, exports) {
|
|
|
2254
2254
|
if (this.shouldParseExportStatement()) {
|
|
2255
2255
|
node.declaration = this.parseExportDeclaration(node);
|
|
2256
2256
|
if (node.declaration.type === "VariableDeclaration")
|
|
2257
|
-
{ this.checkVariableExport(exports, node.declaration.declarations); }
|
|
2257
|
+
{ this.checkVariableExport(exports$1, node.declaration.declarations); }
|
|
2258
2258
|
else
|
|
2259
|
-
{ this.checkExport(exports, node.declaration.id, node.declaration.id.start); }
|
|
2259
|
+
{ this.checkExport(exports$1, node.declaration.id, node.declaration.id.start); }
|
|
2260
2260
|
node.specifiers = [];
|
|
2261
2261
|
node.source = null;
|
|
2262
2262
|
if (this.options.ecmaVersion >= 16)
|
|
2263
2263
|
{ node.attributes = []; }
|
|
2264
2264
|
} else { // export { x, y as z } [from '...']
|
|
2265
2265
|
node.declaration = null;
|
|
2266
|
-
node.specifiers = this.parseExportSpecifiers(exports);
|
|
2266
|
+
node.specifiers = this.parseExportSpecifiers(exports$1);
|
|
2267
2267
|
if (this.eatContextual("from")) {
|
|
2268
2268
|
if (this.type !== types$1.string) { this.unexpected(); }
|
|
2269
2269
|
node.source = this.parseExprAtom();
|
|
@@ -2313,47 +2313,47 @@ pp$8.parseExportDefaultDeclaration = function() {
|
|
|
2313
2313
|
}
|
|
2314
2314
|
};
|
|
2315
2315
|
|
|
2316
|
-
pp$8.checkExport = function(exports, name, pos) {
|
|
2317
|
-
if (!exports) { return }
|
|
2316
|
+
pp$8.checkExport = function(exports$1, name, pos) {
|
|
2317
|
+
if (!exports$1) { return }
|
|
2318
2318
|
if (typeof name !== "string")
|
|
2319
2319
|
{ name = name.type === "Identifier" ? name.name : name.value; }
|
|
2320
|
-
if (hasOwn(exports, name))
|
|
2320
|
+
if (hasOwn(exports$1, name))
|
|
2321
2321
|
{ this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
|
|
2322
|
-
exports[name] = true;
|
|
2322
|
+
exports$1[name] = true;
|
|
2323
2323
|
};
|
|
2324
2324
|
|
|
2325
|
-
pp$8.checkPatternExport = function(exports, pat) {
|
|
2325
|
+
pp$8.checkPatternExport = function(exports$1, pat) {
|
|
2326
2326
|
var type = pat.type;
|
|
2327
2327
|
if (type === "Identifier")
|
|
2328
|
-
{ this.checkExport(exports, pat, pat.start); }
|
|
2328
|
+
{ this.checkExport(exports$1, pat, pat.start); }
|
|
2329
2329
|
else if (type === "ObjectPattern")
|
|
2330
2330
|
{ for (var i = 0, list = pat.properties; i < list.length; i += 1)
|
|
2331
2331
|
{
|
|
2332
2332
|
var prop = list[i];
|
|
2333
2333
|
|
|
2334
|
-
this.checkPatternExport(exports, prop);
|
|
2334
|
+
this.checkPatternExport(exports$1, prop);
|
|
2335
2335
|
} }
|
|
2336
2336
|
else if (type === "ArrayPattern")
|
|
2337
2337
|
{ for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
|
|
2338
2338
|
var elt = list$1[i$1];
|
|
2339
2339
|
|
|
2340
|
-
if (elt) { this.checkPatternExport(exports, elt); }
|
|
2340
|
+
if (elt) { this.checkPatternExport(exports$1, elt); }
|
|
2341
2341
|
} }
|
|
2342
2342
|
else if (type === "Property")
|
|
2343
|
-
{ this.checkPatternExport(exports, pat.value); }
|
|
2343
|
+
{ this.checkPatternExport(exports$1, pat.value); }
|
|
2344
2344
|
else if (type === "AssignmentPattern")
|
|
2345
|
-
{ this.checkPatternExport(exports, pat.left); }
|
|
2345
|
+
{ this.checkPatternExport(exports$1, pat.left); }
|
|
2346
2346
|
else if (type === "RestElement")
|
|
2347
|
-
{ this.checkPatternExport(exports, pat.argument); }
|
|
2347
|
+
{ this.checkPatternExport(exports$1, pat.argument); }
|
|
2348
2348
|
};
|
|
2349
2349
|
|
|
2350
|
-
pp$8.checkVariableExport = function(exports, decls) {
|
|
2351
|
-
if (!exports) { return }
|
|
2350
|
+
pp$8.checkVariableExport = function(exports$1, decls) {
|
|
2351
|
+
if (!exports$1) { return }
|
|
2352
2352
|
for (var i = 0, list = decls; i < list.length; i += 1)
|
|
2353
2353
|
{
|
|
2354
2354
|
var decl = list[i];
|
|
2355
2355
|
|
|
2356
|
-
this.checkPatternExport(exports, decl.id);
|
|
2356
|
+
this.checkPatternExport(exports$1, decl.id);
|
|
2357
2357
|
}
|
|
2358
2358
|
};
|
|
2359
2359
|
|
|
@@ -2368,13 +2368,13 @@ pp$8.shouldParseExportStatement = function() {
|
|
|
2368
2368
|
|
|
2369
2369
|
// Parses a comma-separated list of module exports.
|
|
2370
2370
|
|
|
2371
|
-
pp$8.parseExportSpecifier = function(exports) {
|
|
2371
|
+
pp$8.parseExportSpecifier = function(exports$1) {
|
|
2372
2372
|
var node = this.startNode();
|
|
2373
2373
|
node.local = this.parseModuleExportName();
|
|
2374
2374
|
|
|
2375
2375
|
node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
|
|
2376
2376
|
this.checkExport(
|
|
2377
|
-
exports,
|
|
2377
|
+
exports$1,
|
|
2378
2378
|
node.exported,
|
|
2379
2379
|
node.exported.start
|
|
2380
2380
|
);
|
|
@@ -2382,7 +2382,7 @@ pp$8.parseExportSpecifier = function(exports) {
|
|
|
2382
2382
|
return this.finishNode(node, "ExportSpecifier")
|
|
2383
2383
|
};
|
|
2384
2384
|
|
|
2385
|
-
pp$8.parseExportSpecifiers = function(exports) {
|
|
2385
|
+
pp$8.parseExportSpecifiers = function(exports$1) {
|
|
2386
2386
|
var nodes = [], first = true;
|
|
2387
2387
|
// export { x, y as z } [from '...']
|
|
2388
2388
|
this.expect(types$1.braceL);
|
|
@@ -2392,7 +2392,7 @@ pp$8.parseExportSpecifiers = function(exports) {
|
|
|
2392
2392
|
if (this.afterTrailingComma(types$1.braceR)) { break }
|
|
2393
2393
|
} else { first = false; }
|
|
2394
2394
|
|
|
2395
|
-
nodes.push(this.parseExportSpecifier(exports));
|
|
2395
|
+
nodes.push(this.parseExportSpecifier(exports$1));
|
|
2396
2396
|
}
|
|
2397
2397
|
return nodes
|
|
2398
2398
|
};
|
|
@@ -8338,11 +8338,11 @@ function resolvePackageTarget(
|
|
|
8338
8338
|
* @param {URL} base
|
|
8339
8339
|
* @returns {boolean}
|
|
8340
8340
|
*/
|
|
8341
|
-
function isConditionalExportsMainSugar(exports, packageJsonUrl, base) {
|
|
8342
|
-
if (typeof exports === 'string' || Array.isArray(exports)) return true
|
|
8343
|
-
if (typeof exports !== 'object' || exports === null) return false
|
|
8341
|
+
function isConditionalExportsMainSugar(exports$1, packageJsonUrl, base) {
|
|
8342
|
+
if (typeof exports$1 === 'string' || Array.isArray(exports$1)) return true
|
|
8343
|
+
if (typeof exports$1 !== 'object' || exports$1 === null) return false
|
|
8344
8344
|
|
|
8345
|
-
const keys = Object.getOwnPropertyNames(exports);
|
|
8345
|
+
const keys = Object.getOwnPropertyNames(exports$1);
|
|
8346
8346
|
let isConditionalSugar = false;
|
|
8347
8347
|
let i = 0;
|
|
8348
8348
|
let keyIndex = -1;
|
|
@@ -8404,19 +8404,19 @@ function packageExportsResolve(
|
|
|
8404
8404
|
base,
|
|
8405
8405
|
conditions
|
|
8406
8406
|
) {
|
|
8407
|
-
let exports = packageConfig.exports;
|
|
8407
|
+
let exports$1 = packageConfig.exports;
|
|
8408
8408
|
|
|
8409
|
-
if (isConditionalExportsMainSugar(exports, packageJsonUrl, base)) {
|
|
8410
|
-
exports = {'.': exports};
|
|
8409
|
+
if (isConditionalExportsMainSugar(exports$1, packageJsonUrl, base)) {
|
|
8410
|
+
exports$1 = {'.': exports$1};
|
|
8411
8411
|
}
|
|
8412
8412
|
|
|
8413
8413
|
if (
|
|
8414
|
-
own.call(exports, packageSubpath) &&
|
|
8414
|
+
own.call(exports$1, packageSubpath) &&
|
|
8415
8415
|
!packageSubpath.includes('*') &&
|
|
8416
8416
|
!packageSubpath.endsWith('/')
|
|
8417
8417
|
) {
|
|
8418
8418
|
// @ts-expect-error: indexable.
|
|
8419
|
-
const target = exports[packageSubpath];
|
|
8419
|
+
const target = exports$1[packageSubpath];
|
|
8420
8420
|
const resolveResult = resolvePackageTarget(
|
|
8421
8421
|
packageJsonUrl,
|
|
8422
8422
|
target,
|
|
@@ -8437,7 +8437,7 @@ function packageExportsResolve(
|
|
|
8437
8437
|
|
|
8438
8438
|
let bestMatch = '';
|
|
8439
8439
|
let bestMatchSubpath = '';
|
|
8440
|
-
const keys = Object.getOwnPropertyNames(exports);
|
|
8440
|
+
const keys = Object.getOwnPropertyNames(exports$1);
|
|
8441
8441
|
let i = -1;
|
|
8442
8442
|
|
|
8443
8443
|
while (++i < keys.length) {
|
|
@@ -8481,7 +8481,7 @@ function packageExportsResolve(
|
|
|
8481
8481
|
|
|
8482
8482
|
if (bestMatch) {
|
|
8483
8483
|
// @ts-expect-error: indexable.
|
|
8484
|
-
const target = /** @type {unknown} */ (exports[bestMatch]);
|
|
8484
|
+
const target = /** @type {unknown} */ (exports$1[bestMatch]);
|
|
8485
8485
|
const resolveResult = resolvePackageTarget(
|
|
8486
8486
|
packageJsonUrl,
|
|
8487
8487
|
target,
|
|
@@ -9008,7 +9008,7 @@ function findExports(code) {
|
|
|
9008
9008
|
const starExports = matchAll(EXPORT_STAR_RE, code, {
|
|
9009
9009
|
type: "star"
|
|
9010
9010
|
});
|
|
9011
|
-
const exports = normalizeExports([
|
|
9011
|
+
const exports$1 = normalizeExports([
|
|
9012
9012
|
...declaredExports,
|
|
9013
9013
|
...namedExports,
|
|
9014
9014
|
...destructuredExports,
|
|
@@ -9016,7 +9016,7 @@ function findExports(code) {
|
|
|
9016
9016
|
...defaultClassExports,
|
|
9017
9017
|
...starExports
|
|
9018
9018
|
]);
|
|
9019
|
-
if (exports.length === 0) {
|
|
9019
|
+
if (exports$1.length === 0) {
|
|
9020
9020
|
return [];
|
|
9021
9021
|
}
|
|
9022
9022
|
const exportLocations = _tryGetLocations(code, "export");
|
|
@@ -9025,14 +9025,14 @@ function findExports(code) {
|
|
|
9025
9025
|
}
|
|
9026
9026
|
return (
|
|
9027
9027
|
// Filter false positive export matches
|
|
9028
|
-
_filterStatement(exportLocations, exports).filter((exp, index, exports2) => {
|
|
9028
|
+
_filterStatement(exportLocations, exports$1).filter((exp, index, exports2) => {
|
|
9029
9029
|
const nextExport = exports2[index + 1];
|
|
9030
9030
|
return !nextExport || exp.type !== nextExport.type || !exp.name || exp.name !== nextExport.name;
|
|
9031
9031
|
})
|
|
9032
9032
|
);
|
|
9033
9033
|
}
|
|
9034
|
-
function normalizeExports(exports) {
|
|
9035
|
-
for (const exp of exports) {
|
|
9034
|
+
function normalizeExports(exports$1) {
|
|
9035
|
+
for (const exp of exports$1) {
|
|
9036
9036
|
if (!exp.name && exp.names && exp.names.length === 1) {
|
|
9037
9037
|
exp.name = exp.names[0];
|
|
9038
9038
|
}
|
|
@@ -9050,7 +9050,7 @@ function normalizeExports(exports) {
|
|
|
9050
9050
|
);
|
|
9051
9051
|
}
|
|
9052
9052
|
}
|
|
9053
|
-
return exports;
|
|
9053
|
+
return exports$1;
|
|
9054
9054
|
}
|
|
9055
9055
|
function normalizeNamedExports(namedExports) {
|
|
9056
9056
|
for (const namedExport of namedExports) {
|
|
@@ -9061,11 +9061,11 @@ function normalizeNamedExports(namedExports) {
|
|
|
9061
9061
|
async function resolveModuleExportNames(id, options) {
|
|
9062
9062
|
const url = await resolvePath(id, options);
|
|
9063
9063
|
const code = await loadURL(url);
|
|
9064
|
-
const exports = findExports(code);
|
|
9064
|
+
const exports$1 = findExports(code);
|
|
9065
9065
|
const exportNames = new Set(
|
|
9066
|
-
exports.flatMap((exp) => exp.names).filter(Boolean)
|
|
9066
|
+
exports$1.flatMap((exp) => exp.names).filter(Boolean)
|
|
9067
9067
|
);
|
|
9068
|
-
for (const exp of exports) {
|
|
9068
|
+
for (const exp of exports$1) {
|
|
9069
9069
|
if (exp.type !== "star" || !exp.specifier) {
|
|
9070
9070
|
continue;
|
|
9071
9071
|
}
|
|
@@ -10474,6 +10474,9 @@ function isJSONSerializable(value) {
|
|
|
10474
10474
|
if (value.buffer) {
|
|
10475
10475
|
return false;
|
|
10476
10476
|
}
|
|
10477
|
+
if (value instanceof FormData || value instanceof URLSearchParams) {
|
|
10478
|
+
return false;
|
|
10479
|
+
}
|
|
10477
10480
|
return value.constructor && value.constructor.name === "Object" || typeof value.toJSON === "function";
|
|
10478
10481
|
}
|
|
10479
10482
|
const textTypes = /* @__PURE__ */ new Set([
|
|
@@ -10491,6 +10494,9 @@ function detectResponseType(_contentType = "") {
|
|
|
10491
10494
|
if (JSON_RE.test(contentType)) {
|
|
10492
10495
|
return "json";
|
|
10493
10496
|
}
|
|
10497
|
+
if (contentType === "text/event-stream") {
|
|
10498
|
+
return "stream";
|
|
10499
|
+
}
|
|
10494
10500
|
if (textTypes.has(contentType) || contentType.startsWith("text/")) {
|
|
10495
10501
|
return "text";
|
|
10496
10502
|
}
|
|
@@ -10612,6 +10618,12 @@ function createFetch(globalOptions = {}) {
|
|
|
10612
10618
|
}
|
|
10613
10619
|
if (context.options.onRequest) {
|
|
10614
10620
|
await callHooks(context, context.options.onRequest);
|
|
10621
|
+
if (!(context.options.headers instanceof Headers)) {
|
|
10622
|
+
context.options.headers = new Headers(
|
|
10623
|
+
context.options.headers || {}
|
|
10624
|
+
/* compat */
|
|
10625
|
+
);
|
|
10626
|
+
}
|
|
10615
10627
|
}
|
|
10616
10628
|
if (typeof context.request === "string") {
|
|
10617
10629
|
if (context.options.baseURL) {
|
|
@@ -10630,9 +10642,13 @@ function createFetch(globalOptions = {}) {
|
|
|
10630
10642
|
}
|
|
10631
10643
|
if (context.options.body && isPayloadMethod(context.options.method)) {
|
|
10632
10644
|
if (isJSONSerializable(context.options.body)) {
|
|
10633
|
-
|
|
10634
|
-
|
|
10635
|
-
|
|
10645
|
+
const contentType = context.options.headers.get("content-type");
|
|
10646
|
+
if (typeof context.options.body !== "string") {
|
|
10647
|
+
context.options.body = contentType === "application/x-www-form-urlencoded" ? new URLSearchParams(
|
|
10648
|
+
context.options.body
|
|
10649
|
+
).toString() : JSON.stringify(context.options.body);
|
|
10650
|
+
}
|
|
10651
|
+
if (!contentType) {
|
|
10636
10652
|
context.options.headers.set("content-type", "application/json");
|
|
10637
10653
|
}
|
|
10638
10654
|
if (!context.options.headers.has("accept")) {
|
|
@@ -10737,7 +10753,7 @@ function createFetch(globalOptions = {}) {
|
|
|
10737
10753
|
return $fetch;
|
|
10738
10754
|
}
|
|
10739
10755
|
|
|
10740
|
-
const _globalThis = function() {
|
|
10756
|
+
const _globalThis = (function() {
|
|
10741
10757
|
if (typeof globalThis !== "undefined") {
|
|
10742
10758
|
return globalThis;
|
|
10743
10759
|
}
|
|
@@ -10751,7 +10767,7 @@ const _globalThis = function() {
|
|
|
10751
10767
|
return global;
|
|
10752
10768
|
}
|
|
10753
10769
|
throw new Error("unable to locate global object");
|
|
10754
|
-
}();
|
|
10770
|
+
})();
|
|
10755
10771
|
const fetch = _globalThis.fetch ? (...args) => _globalThis.fetch(...args) : () => Promise.reject(new Error("[ofetch] global.fetch is not supported!"));
|
|
10756
10772
|
const Headers = _globalThis.Headers;
|
|
10757
10773
|
const AbortController = _globalThis.AbortController;
|
package/dist/chunks/vscode.mjs
CHANGED
package/dist/client/200.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/b2u55qmz.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-isd0m9wk.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-f8ezrn37.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-c5u30s53.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/b2u55qmz.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-ho2zu772.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-g7cm1eew.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-d7th42z7.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/b2u55qmz.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1764061142449,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"06025e11-48ac-46e3-8f59-eb3ab8bfd4b9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
1
|
+
<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><script type="importmap">{"imports":{"#entry":"/__NUXT_DEVTOOLS_BASE__/_nuxt/b2u55qmz.js"}}</script><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-isd0m9wk.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-f8ezrn37.css" crossorigin><link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-c5u30s53.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/b2u55qmz.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-ho2zu772.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-g7cm1eew.js"><link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-d7th42z7.js"><script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/b2u55qmz.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1764061142451,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"06025e11-48ac-46e3-8f59-eb3ab8bfd4b9",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,J as n,X as t}from"./vendor/json-editor-vue-ho2zu772.js";const c={"h-screen":"","w-screen":"","bg-black":""},r=e({__name:"__blank",setup(o){return(s,_)=>(t(),n("div",c))}});export{r as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b8 as
|
|
1
|
+
import{b8 as X,b9 as j,_ as P,r as S,E as R,b as Y,ba as h,a6 as ee,a7 as ne,Z as te,a1 as le,i as oe,bb as N,a8 as ie,Q as ue,v as re,q as ae,aj as se,M as de}from"#entry";import{_ as me}from"./filepath-item-f2iy8phl.js";import{p as L,q as V,k as F,J as a,X as o,a2 as e,a3 as y,F as f,ag as U,a6 as E,aa as c,a0 as m,u as b,Z as d,ab as x,ac as D,ad as I,W as C}from"./vendor/json-editor-vue-ho2zu772.js";import{_ as ve}from"./ncode-block-esxkr86l.js";import{_ as pe}from"./ncheckbox-dg5nbt1d.js";import{_ as fe}from"./help-fab-izt1nioe.js";import"./vendor/shiki-g7cm1eew.js";import"./vendor/unocss-d7th42z7.js";import"./client-c6aoxv2l.js";const ce={"h-full":"",grid:"~ rows-[max-content_1fr]"},xe={flex:"~ wrap","w-full":""},be=["onClick"],_e={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},ye={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},ge="/__nuxt_devtools__/client",we=L({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(i){const p=i,w=`${X().app.baseURL.replace(ge,"/")}/__nuxt_devtools__/analyze/`.replace(/\/+/g,"/"),z=V(()=>{const l=[{name:"Overview",id:"overview"}];return p.current.features.bundleClient&&l.push({name:"Client Bundle",id:"bundle-client"}),p.current.features.bundleNitro&&l.push({name:"Nitro Bundle",id:"bundle-nitro"}),p.current.features.viteInspect&&l.push({name:"Vite Inspect",id:"vite-inspect"}),l}),u=F(z.value[0]);function $(l){return`${((l.endTime-l.startTime)/1e3).toFixed(1)}s`}function v(l){return l<1024?`${l}B`:l<1024*1024?`${(l/1024).toFixed(1)}KB`:l<1024*1024*1024?`${(l/1024/1024).toFixed(1)}MB`:`${(l/1024/1024/1024).toFixed(1)}GB`}async function T(l){return S.clearAnalyzeBuilds(await R(),[l])}return(l,n)=>{const A=me,k=P;return o(),a("div",ce,[e("div",xe,[(o(!0),a(f,null,U(z.value,(r,t)=>(o(),a("button",{key:t,px4:"",py2:"",border:"r base",hover:"bg-active",class:E(r.id===u.value?.id?"":"border-b"),onClick:B=>u.value=r},[e("div",{class:E(r.id===u.value?.id?"":"op30")},c(r.name),3)],10,be))),128)),n[1]||(n[1]=e("div",{border:"b base","flex-auto":""},null,-1))]),u.value?.id==="overview"?(o(),a("div",_e,[n[15]||(n[15]=e("div",{"flex-auto":""},null,-1)),e("div",ye,[n[10]||(n[10]=e("div",{"i-carbon-commit":"","text-xl":""},null,-1)),e("div",null,[n[2]||(n[2]=e("div",{"text-sm":"",op50:""}," Name ",-1)),e("div",null,c(i.current.name),1)]),n[11]||(n[11]=e("div",{"i-carbon-time":"","text-xl":""},null,-1)),e("div",null,[n[3]||(n[3]=e("div",{"text-sm":"",op50:""}," Build duration ",-1)),e("div",null,c($(i.current)),1)]),i.current.size?.clientBundle?(o(),a(f,{key:0},[n[5]||(n[5]=e("div",{"i-carbon-cics-program":"","text-xl":""},null,-1)),e("div",null,[n[4]||(n[4]=e("div",{"text-sm":"",op50:""}," Client bundle size ",-1)),e("div",null,c(v(i.current.size.clientBundle)),1)])],64)):y("",!0),i.current.size?.nitroBundle?(o(),a(f,{key:1},[n[7]||(n[7]=e("div",{"i-carbon-bare-metal-server":"","text-xl":""},null,-1)),e("div",null,[n[6]||(n[6]=e("div",{"text-sm":"",op50:""}," Nitro bundle size ",-1)),e("div",null,c(v(i.current.size.nitroBundle)),1)])],64)):y("",!0),n[12]||(n[12]=e("div",{"i-carbon-edge-node":"","text-xl":""},null,-1)),e("div",null,[n[8]||(n[8]=e("div",{"text-sm":"",op50:""}," Built ",-1)),e("div",null,c(b(j)(new Date(i.current.endTime))),1)]),n[13]||(n[13]=e("div",{"i-carbon:folder-parent":"","text-xl":""},null,-1)),e("div",null,[n[9]||(n[9]=e("div",{"text-sm":"",op50:""}," Report Path ",-1)),m(A,{filepath:i.current.analyzeDir},null,8,["filepath"])])]),n[16]||(n[16]=e("div",{"flex-auto":""},null,-1)),m(k,{n:"rose",icon:"carbon-delete",onClick:n[0]||(n[0]=r=>T(i.current.name))},{default:d(()=>[...n[14]||(n[14]=[x(" Delete this report ",-1)])]),_:1})])):y("",!0),n._lazyshow1||u.value?.id==="bundle-client"?(n._lazyshow1=!0,o(),a(f,null,[D(e("iframe",{src:`${b(w)}${i.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,u.value?.id==="bundle-client"]])],64)):y("v-show-if",!0),n._lazyshow2||u.value?.id==="bundle-nitro"?(n._lazyshow2=!0,o(),a(f,null,[D(e("iframe",{src:`${b(w)}${i.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,u.value?.id==="bundle-nitro"]])],64)):y("v-show-if",!0),n._lazyshow3||u.value?.id==="vite-inspect"?(n._lazyshow3=!0,o(),a(f,null,[D(e("iframe",{src:`${b(w)}${i.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[I,u.value?.id==="vite-inspect"]])],64)):y("v-show-if",!0)])}}}),ze=Object.assign(we,{__name:"BuildAnalyzeDetails"}),$e={},Be={class:"markdown-body"};function Ce(i,p){return o(),a("div",Be,[...p[0]||(p[0]=[e("template",null,[e("div",{class:"markdown-body"},[e("h1",null,"Build Analyze"),e("p",null,[x("DevTools provides a build analyze tool to help you understand the size of your app in production. Whenever you start a new build, it runs the command "),e("code",{"v-pre":""},"nuxt build --analyze"),x(" and present the output data directly in DevTools for easy browsing and comparing.")])])],-1)])])}const ke=Y($e,[["render",Ce]]),Ne={flex:"~ col"},Te=["onClick"],Ae={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},De={flex:"~ items-center justify-center wrap",p4:""},Ie={flex:"~ col gap-1","w-250":"",p4:""},Se={flex:"~ gap-3",mt2:"","justify-end":""},Oe=L({__name:"analyze-build",setup(i){const p=se(),g=h(),w=ee(),z=ne("analyze-build:slug",""),u=V(()=>g.value?.builds.find(r=>r.slug===z.value)??g.value?.builds[0]),$=F(!1),v=F(""),T=V(()=>g.value?.builds.some(r=>r.name===v.value.trim()));async function l(){v.value=await S.generateAnalyzeBuildName(),await p.start()&&(de("analyze-build:start"),N.value={name:v.value,processId:await S.startAnalyzeBuild(await R(),v.value)},$.value&&k())}const n=te();function A(r){return`${((r.endTime-r.startTime)/1e3).toFixed(1)}s`}function k(){N.value?.processId&&(n.value=N.value.processId,w.push("/modules/terminals"))}return le(()=>[{id:"action:analyze-build: start",title:"Start a new analyze build",icon:"i-carbon-edge-node",action:l}]),(r,t)=>{const B=P,G=ze,O=oe,Z=ie,q=re,M=ae,W=ve,H=pe,J=ue,K=ke,Q=fe;return o(),a(f,null,[m(Z,{"left-size":30},{left:d(()=>[e("div",Ne,[(o(!0),a(f,null,U(b(g)?.builds,s=>(o(),a(f,{key:s.slug},[e("button",{flex:"~ col gap1",p3:"","hover:bg-active":"",class:E(s.slug===u.value?.slug?"text-primary bg-active":""),onClick:_=>z.value=s.slug},[e("code",null,c(s.name),1),e("div",Ae,[t[4]||(t[4]=e("div",{"i-carbon-time":""},null,-1)),e("span",null,c(A(s)),1),t[5]||(t[5]=e("div",{"flex-auto":""},null,-1)),e("span",null,c(b(j)(new Date(s.endTime))),1)])],10,Te),t[6]||(t[6]=e("div",{"x-divider":""},null,-1))],64))),128)),e("div",De,[b(N)?(o(),C(B,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:t[1]||(t[1]=s=>k())},{default:d(()=>[...t[8]||(t[8]=[x(" Building... ",-1)])]),_:1})):(o(),C(B,{key:0,n:"primary",icon:"carbon-edge-node",onClick:t[0]||(t[0]=s=>l())},{default:d(()=>[...t[7]||(t[7]=[x(" Start a new build ",-1)])]),_:1}))])])]),right:d(()=>[u.value?(o(),C(G,{key:0,current:u.value},null,8,["current"])):(o(),C(O,{key:1}))]),_:1}),m(b(p),null,{default:d(({resolve:s})=>[m(J,{"model-value":!0,onClose:_=>s(!1)},{default:d(()=>[e("div",Ie,[t[13]||(t[13]=e("h3",{class:"text-lg font-medium leading-6",mb2:""}," Start analyze build? ",-1)),t[14]||(t[14]=e("p",{op50:""}," Enter the name of the build: ",-1)),m(q,{modelValue:v.value,"onUpdate:modelValue":t[2]||(t[2]=_=>v.value=_),placeholder:"Build name"},null,8,["modelValue"]),T.value?(o(),C(M,{key:0,"n-orange":""},{default:d(()=>[...t[9]||(t[9]=[x(" A build with the same name already exists, continue would overrides the previous build result. ",-1)])]),_:1})):y("",!0),t[15]||(t[15]=e("div",{my3:"","x-divider":""},null,-1)),t[16]||(t[16]=e("p",{op50:""}," The following command will be executed in your terminal: ",-1)),m(W,{code:`npx nuxi analyze --no-serve --name=${v.value}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),m(H,{modelValue:$.value,"onUpdate:modelValue":t[3]||(t[3]=_=>$.value=_),mt2:"",n:"primary"},{default:d(()=>[...t[10]||(t[10]=[x(" Navigate to terminal ",-1)])]),_:1},8,["modelValue"]),e("div",Se,[m(B,{onClick:_=>s(!1)},{default:d(()=>[...t[11]||(t[11]=[x(" Cancel ",-1)])]),_:1},8,["onClick"]),m(B,{n:"solid primary",onClick:_=>s(!0)},{default:d(()=>[...t[12]||(t[12]=[x(" Start ",-1)])]),_:1},8,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),m(Q,null,{default:d(()=>[m(K)]),_:1})],64)}}});export{Oe as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{G as
|
|
1
|
+
import{G as X,H as ee,_ as te,I as ne,v as se,J as z,K as ce,L as pe,M as me,r as J,E as W,N as ve,O as fe,c as le,A as ge,a as xe,w as he,P as _e,Q as be,R as we,S as ye,T as $e,g as ke,U as Ce}from"#entry";import{_ as Pe}from"./ncheckbox-dg5nbt1d.js";import{_ as Ve}from"./ndropdown-gskb7sy5.js";import{_ as Ae}from"./nnavbar-eqdsa2v0.js";import{p as q,k as U,ai as oe,J as i,X as o,a6 as H,u as m,ac as K,a0 as d,a2 as t,ab as A,F as L,ag as Z,W as P,a3 as j,Z as h,q as I,a4 as ae,aa as D,$ as De,j as Fe,at as Ne,a5 as je}from"./vendor/json-editor-vue-ho2zu772.js";import{_ as Ie}from"./nsection-block-owu5vx1c.js";import{_ as Se}from"./filepath-item-f2iy8phl.js";import{_ as Ue}from"./code-snippets-gyl3bqgb.js";import{_ as Te}from"./ndrawer-j5h6fmbh.js";import{D as Oe}from"./constants-b32h69zq.js";import"./vendor/shiki-g7cm1eew.js";import"./vendor/unocss-d7th42z7.js";import"./nicon-title-n11g9rad.js";import"./ncode-block-esxkr86l.js";import"./client-c6aoxv2l.js";const Ee={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},Le={for:"drop-zone-input","text-3xl":"",hover:"text-green cursor-pointer","transition-all":""},Be={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},ze={grid:"~ cols-minmax-8rem gap-8","overflow-auto":"",p6:""},Re={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Me=["src"],Ke={flex:"~ gap1","items-center":""},Ge={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ze=q({__name:"AssetDropZone",props:{modelValue:{type:Boolean,required:!0},folder:{type:String,required:!0}},setup(l){const g=l,f=ee(g,"modelValue"),F=U(),n=U([]);function v(s){F.value=s.target,f.value=!0}function b(s){s.target===F.value&&(f.value=!1)}function T(s){s.preventDefault()}function M(s){s.preventDefault(),_(s.dataTransfer.files)}function _(s){const c=Array.from(s||[]);if(c.length){const x=[],y=n.value.map(u=>u.name);for(const u of c)if(y.includes(u.name)){let V=1;const[$,E]=u.name.split(".");for(;y.includes(`${$} (${V}).${E}`);)V++;const R=`${$}-${V}.${E}`,a=new Blob([u],{type:u.type}),e=new File([a],R,{lastModified:Date.now()});x.push(e),y.push(R)}else u.type===""&&z({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}),x.push(u);n.value=[...n.value,...x]}}async function O(){if(ce.value||pe.value)return;me("assets:upload");const s=[];for(const c of n.value){const x=new FileReader;x.readAsDataURL(c);const u=(await new Promise(V=>{x.onload=()=>V(x.result)})).split(";base64,").pop();s.push({path:c.name,encoding:"base64",content:u})}await J.writeStaticAssets(await W(),[...s],g.folder).then(()=>{p(),z({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(c=>{p(),z({message:`Error uploading files: ${c?.message??"unknown"}`,icon:"i-carbon-warning",classes:"text-red"})}),f.value=!1}function G(s){n.value?.splice(s,1)}function B(s){return URL.createObjectURL(s)}function w(s,c){const[x,y]=s.name.split("."),u=c.replace(/\.\w+$/,""),V=`${u}.${y}`;return u.length===0?(alert("File name must be at least 1 characters long"),x):(Object.defineProperty(s,"name",{value:V,writable:!1}),n.value.splice(n.value.indexOf(s),1,s),s)}function r(){n.value=[]}function p(){f.value=!1,r()}return X("dragenter",v),X("dragleave",b),X("dragover",T),X("drop",M),(s,c)=>{const x=te,y=ne,u=se,V=oe("tooltip");return o(),i("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:H(m(f)?"opacity-100 visible":"opacity-0 invisible")},[K(d(x,{icon:"carbon-close",title:"Close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",border:!1,onClick:p},null,512),[[V,"Close",void 0,{"bottom-end":!0}]]),n.value?.length?(o(),i("div",Be,[c[4]||(c[4]=t("div",{px6:"",py6:""},[t("h1",{"text-2xl":""}," Upload "),t("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1)),t("div",ze,[(o(!0),i(L,null,Z(n.value,($,E)=>(o(),i("div",{key:$.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[t("div",Re,[t("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:B($)},null,8,Me)]),t("div",Ke,[d(u,{n:"xs","h-full":"","flex-auto":"","model-value":$.name,"onUpdate:modelValue":R=>w($,R.target.value)},null,8,["model-value","onUpdate:modelValue"]),d(x,{n:"red",icon:"carbon-trash-can","h-full":"","flex-none":"",title:"Remove file",onClick:R=>G(E)},null,8,["onClick"])])]))),128))]),t("div",Ge,[n.value.length?(o(),P(x,{key:0,n:"red",onClick:r},{default:h(()=>[d(y,{icon:"carbon-clean"}),c[2]||(c[2]=A(" Clear ",-1))]),_:1})):j("",!0),d(x,{disabled:!n.value.length,n:"primary solid",onClick:O},{default:h(()=>[d(y,{icon:"carbon-cloud-upload"}),c[3]||(c[3]=A(" Upload ",-1))]),_:1},8,["disabled"])])])):(o(),i("div",Ee,[t("label",Le,[d(y,{icon:"carbon-cloud-upload","mr-2":""}),c[1]||(c[1]=A(" Drop files here or click to select ",-1))]),t("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:c[0]||(c[0]=$=>_($.target.files))},null,32)]))],2)}}}),qe=Object.assign(Ze,{__name:"AssetDropZone"}),Je=q({__name:"AssetFontPreview",props:{asset:{}},setup(l){const g=l,f=I(()=>`devtools-assets-${ve(g.asset)}`);return fe(I(()=>`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: '${f.value}';
|
|
4
4
|
src: url('${g.asset.publicPath}');
|
|
5
5
|
}
|
|
6
|
-
`)),(F,n)=>(o(),i("div",{"of-hidden":"",style:ae({fontFamily:`'${f.value}'`})}," 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))}}),
|
|
6
|
+
`)),(F,n)=>(o(),i("div",{"of-hidden":"",style:ae({fontFamily:`'${f.value}'`})}," 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))}}),We=Object.assign(Je,{__name:"AssetFontPreview"}),Xe={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},He=["src"],Qe={key:2,"i-carbon-document":"","text-3xl":"",op20:""},Ye={key:3,"w-full":"","self-start":"",p4:""},et=["textContent"],tt={key:4},nt=["src","autoplay","controls"],ot={key:5},lt={key:0,"i-carbon-volume-up":"","text-3xl":"",op20:""},st=["src"],at={key:6,"i-carbon-help":"","text-3xl":"",op20:""},it=q({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(l){return(g,f)=>{const F=We;return o(),i("div",Xe,[l.asset.type==="image"?(o(),i("img",{key:0,src:l.asset.publicPath},null,8,He)):l.asset.type==="font"?(o(),P(F,{key:l.asset.publicPath,asset:l.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):l.asset.type==="text"&&!l.textContent?(o(),i("div",Qe)):l.asset.type==="text"&&l.textContent?(o(),i("div",Ye,[t("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:D(l.textContent)},null,8,et)])):l.asset.type==="video"?(o(),i("div",tt,[t("video",{src:l.asset.publicPath,autoplay:l.detail,controls:l.detail},null,8,nt)])):l.asset.type==="audio"?(o(),i("div",ot,[l.detail?(o(),i("audio",{key:1,src:l.asset.publicPath,controls:""},null,8,st)):(o(),i("div",lt))])):(o(),i("div",at))])}}}),ie=Object.assign(it,{__name:"AssetPreview"}),rt={relative:"",flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},ut={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},dt=q({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(l){const g=l,f=I(()=>g.folder&&g.asset.path.startsWith(g.folder)?g.asset.path.slice(g.folder.length):g.asset.path);return(F,n)=>{const v=ne,b=ie;return o(),i("button",rt,[l.asset.layer?(o(),P(v,{key:0,icon:"i-carbon-layers",absolute:"","right-4":"","top-4":"","bg-primary":""})):j("",!0),d(b,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:l.asset},null,8,["asset"]),t("div",ut,D(f.value),1)])}}}),ct=Object.assign(dt,{__name:"AssetGridItem"}),pt=q({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(l,{emit:g}){const f=l,n=ee(f,"modelValue",g,{passive:!0}),v=I(()=>f.item?.children?.length),b=U(!0),T=I(()=>v.value?"i-carbon-folder":f.item.type==="image"?"i-carbon-image":f.item.type==="video"?"i-carbon-video":f.item.type==="audio"?"i-carbon-volume-up":f.item.type==="font"?"i-carbon-text-small-caps":f.item.type==="text"?"i-carbon-document":f.item.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(M,_)=>{const O=ne,G=re;return o(),i("div",null,[t("button",{flex:"~ gap-2","w-full":"","items-center":"",hover:"bg-active",px4:"",py1:"",style:ae({paddingLeft:`calc(1rem + ${l.index*1.5}em)`}),class:H({"bg-active":!v.value&&m(n)?.filePath===l.item?.filePath}),border:"b base",onClick:_[0]||(_[0]=B=>v.value?b.value=!b.value:n.value=l.item)},[t("div",{class:H(T.value)},null,2),t("span",{class:H({"flex items-center":v.value}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},[A(D(l.item.path)+" ",1),l.item.layer?(o(),P(O,{key:0,icon:"i-carbon-layers","bg-primary":""})):j("",!0)],2),v.value?(o(),P(O,{key:0,icon:"carbon:chevron-right","transform-rotate":b.value?90:0,transition:""},null,8,["transform-rotate"])):j("",!0)],6),b.value?De(M.$slots,"default",{key:0},()=>[(o(!0),i(L,null,Z(l.item?.children,B=>(o(),P(G,{key:B.filepath,modelValue:m(n),"onUpdate:modelValue":_[1]||(_[1]=w=>Fe(n)?n.value=w:null),item:B,index:l.index+1},null,8,["modelValue","item","index"]))),128))]):j("",!0)])}}}),re=Object.assign(pt,{__name:"AssetListItem"}),mt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},vt={flex:"~","items-center":"","justify-center":""},ft={"max-w-full":"","w-full":"","table-fixed":""},gt={flex:"~ gap-1","w-full":"","items-center":""},xt={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},ht={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},_t={capitalize:""},bt={key:0},wt={op70:""},yt={flex:"~ gap2 wrap"},$t={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},kt={flex:"~ gap2 wrap justify-center"},Ct={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Pt={flex:"~ gap2 wrap justify-center"},Vt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},At={flex:"","justify-end":"","gap-4":""},Dt=q({__name:"AssetDetails",props:{modelValue:{}},setup(l,{emit:g}){const n=ee(l,"modelValue",g,{passive:!0}),v=le(async()=>{if(n.value.type==="image")return J.getImageMeta(await W(),n.value.filePath)}),b=U(!1),T=U(),M=U(0),_=le(async()=>{if(n.value.type!=="text")return;M.value;const a=await J.getTextAssetContent(await W(),n.value.filePath);return T.value=a,a});async function O(){if(_.value!==T.value)try{await J.writeStaticAssets(await W(),[{path:n.value.path,content:T.value,override:!0}],""),b.value=!1,M.value++,z({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const G=ge(),B=I(()=>(G.value?._installedModules||[]).some(e=>e.meta?.name==="@nuxt/image"||e.meta?.name==="@nuxt/image-edge"||e.meta?.name==="@nuxt/image-nightly")),w=I(()=>{const a=[];if(n.value.type==="image"){const e=v.value?.width?`
|
|
7
7
|
width="${v.value.width}"
|
|
8
8
|
height="${v.value.height}" `:" ";return a.push({lang:"vue-html",code:`<img${e}
|
|
9
9
|
src="${n.value.publicPath}"
|
|
@@ -13,4 +13,4 @@ import{G as H,H as ee,_ as te,I as ne,v as se,J as z,K as ce,L as pe,M as me,r a
|
|
|
13
13
|
src="${n.value.publicPath}"
|
|
14
14
|
/>`,name:"Nuxt Picture",docs:"https://image.nuxt.com/usage/nuxt-picture"}),a}return a.push({lang:"html",code:`<a download href="${n.value.publicPath}">
|
|
15
15
|
Download ${n.value.path.split("/").slice(-1)[0]}
|
|
16
|
-
</a>`,name:"Download link"}),a}),r=xe(),p=he(),s=_e(()=>n.value.mtime),c=I(()=>{const a=n.value.size;return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1024/1024).toFixed(2)} MB`}),x=I(()=>{if(!v.value?.width||!v.value?.height)return"";const a=(k,S)=>S?a(S,k%S):k,e=a(v.value.width,v.value.height);return e>3?`${v.value.width/e}:${v.value.height/e}`:""}),y=I(()=>["image","text","video","audio","font"].includes(n.value.type)),u=U(!1);async function V(){try{await J.deleteStaticAsset(await X(),n.value.filePath),n.value=void 0,u.value=!1,z({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const $=U(!1),E=U("");async function R(){const a=n.value.filePath.split("/"),e=a.slice(-1)[0]?.split(".").slice(0,-1).join(".");if(!E.value||E.value===e)return z({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const k=a.slice(-1)[0]?.split(".").slice(-1)[0],S=`${a.slice(0,-1).join("/")}/${E.value}.${k}`;await J.renameStaticAsset(await X(),n.value.filePath,S),n.value=void 0,$.value=!1,z({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch(k){console.error(k),z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,e)=>{const k=ie,S=Se,N=te,ue=Ue,W=be,de=se,Y=oe("tooltip");return o(),i(L,null,[t("div",mt,[y.value?(o(),i(L,{key:0},[e[13]||(e[13]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Preview "),t("div",{"x-divider":""})],-1)),t("div",vt,[d(k,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:m(n),"text-content":m(_)},null,8,["asset","text-content"])])],64)):j("",!0),e[25]||(e[25]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Details "),t("div",{"x-divider":""})],-1)),t("table",ft,[t("tbody",null,[t("tr",null,[e[14]||(e[14]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1)),t("td",null,[t("div",gt,[d(S,{filepath:m(n).filePath,"text-left":""},null,8,["filepath"]),K(d(N,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",border:!1,onClick:e[0]||(e[0]=C=>m(p)(m(n).filePath))},null,512),[[Y,"Open in Editor"]])])])]),t("tr",null,[e[15]||(e[15]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1)),t("td",null,[t("div",xt,[t("div",ht,D(m(n).publicPath),1),K(d(N,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:e[1]||(e[1]=C=>m(r)(m(n).publicPath,"assets-public-path"))},null,512),[[Y,"Copy public path"]]),K(d(N,{"flex-none":"",to:m(n).publicPath,icon:"carbon-launch",target:"_blank",border:!1,title:"Open in browser"},null,8,["to"]),[[Y,"Open in browser"]])])])]),t("tr",null,[e[16]||(e[16]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1)),t("td",_t,D(m(n).type),1)]),m(v)?.width?(o(),i(L,{key:0},[t("tr",null,[e[17]||(e[17]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1)),t("td",null,D(m(v).width)+" x "+D(m(v).height),1)]),x.value?(o(),i("tr",bt,[e[18]||(e[18]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1)),t("td",null,D(x.value),1)])):j("",!0)],64)):j("",!0),t("tr",null,[e[19]||(e[19]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1)),t("td",null,D(c.value),1)]),t("tr",null,[e[20]||(e[20]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1)),t("td",null,[A(D(new Date(m(n).mtime).toLocaleString())+" ",1),t("span",wt,"("+D(m(s))+")",1)])])])]),e[26]||(e[26]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Actions "),t("div",{"x-divider":""})],-1)),t("div",yt,[d(N,{to:m(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:h(()=>[...e[21]||(e[21]=[A(" Download ",-1)])]),_:1},8,["to"]),m(n).type==="text"?(o(),P(N,{key:0,icon:"carbon-edit",n:"cyan",onClick:e[2]||(e[2]=C=>b.value=!b.value)},{default:h(()=>[...e[22]||(e[22]=[A(" Edit ",-1)])]),_:1})):j("",!0),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:e[3]||(e[3]=C=>$.value=!$.value)},{default:h(()=>[...e[23]||(e[23]=[A(" Rename ",-1)])]),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:e[4]||(e[4]=C=>u.value=!u.value)},{default:h(()=>[...e[24]||(e[24]=[A(" Delete ",-1)])]),_:1})]),e[27]||(e[27]=t("div",{"flex-auto":""},null,-1)),w.value.length?(o(),P(ue,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":w.value},null,8,["code-snippets"])):j("",!0)]),d(W,{modelValue:u.value,"onUpdate:modelValue":e[6]||(e[6]=C=>u.value=C)},{default:h(()=>[t("div",$t,[e[30]||(e[30]=t("span",null," Are you sure you want to delete this asset? ",-1)),t("div",kt,[d(N,{icon:"carbon-close",onClick:e[5]||(e[5]=C=>u.value=!1)},{default:h(()=>[...e[28]||(e[28]=[A(" Cancel ",-1)])]),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:V},{default:h(()=>[...e[29]||(e[29]=[A(" Delete ",-1)])]),_:1})])])]),_:1},8,["modelValue"]),d(W,{modelValue:$.value,"onUpdate:modelValue":e[9]||(e[9]=C=>$.value=C)},{default:h(()=>[t("div",Ct,[d(de,{modelValue:E.value,"onUpdate:modelValue":e[7]||(e[7]=C=>E.value=C),placeholder:"New name",n:"blue"},null,8,["modelValue"]),t("div",Pt,[d(N,{icon:"carbon-close",onClick:e[8]||(e[8]=C=>$.value=!1)},{default:h(()=>[...e[31]||(e[31]=[A(" Cancel ",-1)])]),_:1}),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:R},{default:h(()=>[...e[32]||(e[32]=[A(" Rename ",-1)])]),_:1})])])]),_:1},8,["modelValue"]),m(n).type==="text"?(o(),P(W,{key:0,modelValue:b.value,"onUpdate:modelValue":e[12]||(e[12]=C=>b.value=C)},{default:h(()=>[t("div",Vt,[K(t("textarea",{"onUpdate:modelValue":e[10]||(e[10]=C=>T.value=C),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:je(O,["enter"])},null,544),[[Ne,T.value]]),t("div",At,[d(N,{icon:"carbon-close",onClick:e[11]||(e[11]=C=>b.value=!1)},{default:h(()=>[...e[33]||(e[33]=[A(" Cancel ",-1)])]),_:1}),d(N,{icon:"carbon:save",n:"primary",onClick:O},{default:h(()=>[...e[34]||(e[34]=[A(" save ",-1)])]),_:1})])])]),_:1},8,["modelValue"])):j("",!0)],64)}}}),Ft=Object.assign(Dt,{__name:"AssetDetails"}),Nt={"h-full":"","of-auto":""},jt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},It={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},St={flex:"~ col","w-30":"","of-auto":""},Ut={"text-xs":"",op75:""},Tt={op50:""},Ot={key:0},Et={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Lt={key:1,p2:"",grid:"~ cols-minmax-8rem"},Bt={key:1},nn=Z({__name:"assets",setup(l){const g=we(),f=U(!1),F=U(""),n=I(()=>new ye(g.value||[],{keys:["path"]})),v=$e(()=>{const w=[];for(const r of g.value||[]){const p=r.path.split(".").pop();p&&!w.find(s=>s.name===p)&&w.push({name:p,value:!0})}return w}),b=I(()=>(F.value?n.value.search(F.value).map(r=>r.item):g.value||[]).filter(r=>{const p=r.path.split(".").pop();return!p||v.some(s=>s.name===p&&s.value)})),T=I(()=>{const w={};for(const r of b.value){const p=`${r.path.split("/").slice(0,-1).join("/")}/`;w[p]||(w[p]=[]),w[p].push(r)}return Object.entries(w).sort(([r],[p])=>r.localeCompare(p))}),M=I(()=>{const w={children:[]},r=(p,s,c)=>{const[x,...y]=s;let u=p.children.find(V=>V.path===x);u||(u={...c,path:x,children:[]},p.children.push(u)),y.length>1?r(u,y,c):y.length===1&&u.children.push({...c,path:y[0]})};return b.value.forEach(p=>{const s=p.path.split("/").filter(c=>c!=="");r(w,s,p)}),w.children}),_=U(),{view:O}=ke("assets");function G(){O.value=O.value==="list"?"grid":"list"}Ce("Escape",()=>{_.value=void 0});const B=U();return(w,r)=>{const p=te,s=Pe,c=Ve,x=Ae,y=Ze,u=ct,V=Ie,$=re,E=Ft,R=Te,a=oe("tooltip");return o(),i("div",Nt,[d(x,{ref_key:"navbar",ref:B,search:F.value,"onUpdate:search":r[1]||(r[1]=e=>F.value=e),pb2:""},{actions:h(()=>[t("div",jt,[K(d(p,{icon:"carbon:cloud-upload",title:"File Upload",border:!1,onClick:r[0]||(r[0]=e=>f.value=!f.value)},null,512),[[a,"File Upload",void 0,{"bottom-end":!0}]]),m(v).length?(o(),P(c,{key:0,direction:"end",n:"sm primary"},{trigger:h(({click:e})=>[K(d(p,{icon:"carbon-filter",border:!1,title:"Filter",p3:"","text-lg":"",onClick:k=>e()},null,8,["onClick"]),[[a,"Filter",void 0,{"bottom-end":!0}]]),t("span",It,D(m(v).length),1)]),default:h(()=>[t("div",St,[(o(!0),i(L,null,q(m(v),e=>(o(),P(s,{key:e.name,modelValue:e.value,"onUpdate:modelValue":k=>e.value=k,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:h(()=>[t("span",Ut,D(e.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):j("",!0),K(d(p,{"text-lg":"",border:!1,icon:m(O)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:G},null,8,["icon"]),[[a,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:h(()=>[t("div",Tt,[F.value?(o(),i("span",Ot,D(b.value.length)+" matched · ",1)):j("",!0),t("span",null,D(m(g)?.length)+" assets in total",1)])]),_:1},8,["search"]),d(y,{modelValue:f.value,"onUpdate:modelValue":r[2]||(r[2]=e=>f.value=e),folder:"/"},null,8,["modelValue"]),m(O)==="grid"?(o(),i(L,{key:0},[T.value.length>1?(o(!0),i(L,{key:0},q(T.value,([e,k])=>(o(),P(V,{key:e,text:e,description:`${k.length} items`,open:k.length<=m(Oe),padding:!1},{default:h(()=>[t("div",Et,[(o(!0),i(L,null,q(k,S=>(o(),P(u,{key:S.path,asset:S,folder:e,onClick:N=>_.value=S},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),i("div",Lt,[(o(!0),i(L,null,q(b.value,e=>(o(),P(u,{key:e.path,asset:e,onClick:k=>_.value=e},null,8,["asset","onClick"]))),128))]))],64)):(o(),i("div",Bt,[(o(!0),i(L,null,q(M.value,(e,k)=>(o(),P($,{key:k,modelValue:_.value,"onUpdate:modelValue":r[3]||(r[3]=S=>_.value=S),item:e},null,8,["modelValue","item"]))),128))])),d(R,{"model-value":!!_.value,"auto-close":"","w-120":"",top:B.value,onClose:r[5]||(r[5]=e=>_.value=void 0)},{default:h(()=>[_.value?(o(),P(E,{key:0,modelValue:_.value,"onUpdate:modelValue":r[4]||(r[4]=e=>_.value=e)},null,8,["modelValue"])):j("",!0)]),_:1},8,["model-value","top"])])}}});export{nn as default};
|
|
16
|
+
</a>`,name:"Download link"}),a}),r=xe(),p=he(),s=_e(()=>n.value.mtime),c=I(()=>{const a=n.value.size;return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1024/1024).toFixed(2)} MB`}),x=I(()=>{if(!v.value?.width||!v.value?.height)return"";const a=(k,S)=>S?a(S,k%S):k,e=a(v.value.width,v.value.height);return e>3?`${v.value.width/e}:${v.value.height/e}`:""}),y=I(()=>["image","text","video","audio","font"].includes(n.value.type)),u=U(!1);async function V(){try{await J.deleteStaticAsset(await W(),n.value.filePath),n.value=void 0,u.value=!1,z({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const $=U(!1),E=U("");async function R(){const a=n.value.filePath.split("/"),e=a.slice(-1)[0]?.split(".").slice(0,-1).join(".");if(!E.value||E.value===e)return z({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const k=a.slice(-1)[0]?.split(".").slice(-1)[0],S=`${a.slice(0,-1).join("/")}/${E.value}.${k}`;await J.renameStaticAsset(await W(),n.value.filePath,S),n.value=void 0,$.value=!1,z({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch(k){console.error(k),z({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,e)=>{const k=ie,S=Se,N=te,ue=Ue,Q=be,de=se,Y=oe("tooltip");return o(),i(L,null,[t("div",mt,[y.value?(o(),i(L,{key:0},[e[13]||(e[13]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Preview "),t("div",{"x-divider":""})],-1)),t("div",vt,[d(k,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:m(n),"text-content":m(_)},null,8,["asset","text-content"])])],64)):j("",!0),e[25]||(e[25]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Details "),t("div",{"x-divider":""})],-1)),t("table",ft,[t("tbody",null,[t("tr",null,[e[14]||(e[14]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1)),t("td",null,[t("div",gt,[d(S,{filepath:m(n).filePath,"text-left":""},null,8,["filepath"]),K(d(N,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",border:!1,onClick:e[0]||(e[0]=C=>m(p)(m(n).filePath))},null,512),[[Y,"Open in Editor"]])])])]),t("tr",null,[e[15]||(e[15]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1)),t("td",null,[t("div",xt,[t("div",ht,D(m(n).publicPath),1),K(d(N,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:e[1]||(e[1]=C=>m(r)(m(n).publicPath,"assets-public-path"))},null,512),[[Y,"Copy public path"]]),K(d(N,{"flex-none":"",to:m(n).publicPath,icon:"carbon-launch",target:"_blank",border:!1,title:"Open in browser"},null,8,["to"]),[[Y,"Open in browser"]])])])]),t("tr",null,[e[16]||(e[16]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1)),t("td",_t,D(m(n).type),1)]),m(v)?.width?(o(),i(L,{key:0},[t("tr",null,[e[17]||(e[17]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1)),t("td",null,D(m(v).width)+" x "+D(m(v).height),1)]),x.value?(o(),i("tr",bt,[e[18]||(e[18]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1)),t("td",null,D(x.value),1)])):j("",!0)],64)):j("",!0),t("tr",null,[e[19]||(e[19]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1)),t("td",null,D(c.value),1)]),t("tr",null,[e[20]||(e[20]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1)),t("td",null,[A(D(new Date(m(n).mtime).toLocaleString())+" ",1),t("span",wt,"("+D(m(s))+")",1)])])])]),e[26]||(e[26]=t("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[t("div",{"x-divider":""}),t("div",{"flex-none":""}," Actions "),t("div",{"x-divider":""})],-1)),t("div",yt,[d(N,{to:m(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:h(()=>[...e[21]||(e[21]=[A(" Download ",-1)])]),_:1},8,["to"]),m(n).type==="text"?(o(),P(N,{key:0,icon:"carbon-edit",n:"cyan",onClick:e[2]||(e[2]=C=>b.value=!b.value)},{default:h(()=>[...e[22]||(e[22]=[A(" Edit ",-1)])]),_:1})):j("",!0),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:e[3]||(e[3]=C=>$.value=!$.value)},{default:h(()=>[...e[23]||(e[23]=[A(" Rename ",-1)])]),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:e[4]||(e[4]=C=>u.value=!u.value)},{default:h(()=>[...e[24]||(e[24]=[A(" Delete ",-1)])]),_:1})]),e[27]||(e[27]=t("div",{"flex-auto":""},null,-1)),w.value.length?(o(),P(ue,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":w.value},null,8,["code-snippets"])):j("",!0)]),d(Q,{modelValue:u.value,"onUpdate:modelValue":e[6]||(e[6]=C=>u.value=C)},{default:h(()=>[t("div",$t,[e[30]||(e[30]=t("span",null," Are you sure you want to delete this asset? ",-1)),t("div",kt,[d(N,{icon:"carbon-close",onClick:e[5]||(e[5]=C=>u.value=!1)},{default:h(()=>[...e[28]||(e[28]=[A(" Cancel ",-1)])]),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:V},{default:h(()=>[...e[29]||(e[29]=[A(" Delete ",-1)])]),_:1})])])]),_:1},8,["modelValue"]),d(Q,{modelValue:$.value,"onUpdate:modelValue":e[9]||(e[9]=C=>$.value=C)},{default:h(()=>[t("div",Ct,[d(de,{modelValue:E.value,"onUpdate:modelValue":e[7]||(e[7]=C=>E.value=C),placeholder:"New name",n:"blue"},null,8,["modelValue"]),t("div",Pt,[d(N,{icon:"carbon-close",onClick:e[8]||(e[8]=C=>$.value=!1)},{default:h(()=>[...e[31]||(e[31]=[A(" Cancel ",-1)])]),_:1}),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:R},{default:h(()=>[...e[32]||(e[32]=[A(" Rename ",-1)])]),_:1})])])]),_:1},8,["modelValue"]),m(n).type==="text"?(o(),P(Q,{key:0,modelValue:b.value,"onUpdate:modelValue":e[12]||(e[12]=C=>b.value=C)},{default:h(()=>[t("div",Vt,[K(t("textarea",{"onUpdate:modelValue":e[10]||(e[10]=C=>T.value=C),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:je(O,["enter"])},null,544),[[Ne,T.value]]),t("div",At,[d(N,{icon:"carbon-close",onClick:e[11]||(e[11]=C=>b.value=!1)},{default:h(()=>[...e[33]||(e[33]=[A(" Cancel ",-1)])]),_:1}),d(N,{icon:"carbon:save",n:"primary",onClick:O},{default:h(()=>[...e[34]||(e[34]=[A(" save ",-1)])]),_:1})])])]),_:1},8,["modelValue"])):j("",!0)],64)}}}),Ft=Object.assign(Dt,{__name:"AssetDetails"}),Nt={"h-full":"","of-auto":""},jt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},It={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},St={flex:"~ col","w-30":"","of-auto":""},Ut={"text-xs":"",op75:""},Tt={op50:""},Ot={key:0},Et={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Lt={key:1,p2:"",grid:"~ cols-minmax-8rem"},Bt={key:1},nn=q({__name:"assets",setup(l){const g=we(),f=U(!1),F=U(""),n=I(()=>new ye(g.value||[],{keys:["path"]})),v=$e(()=>{const w=[];for(const r of g.value||[]){const p=r.path.split(".").pop();p&&!w.find(s=>s.name===p)&&w.push({name:p,value:!0})}return w}),b=I(()=>(F.value?n.value.search(F.value).map(r=>r.item):g.value||[]).filter(r=>{const p=r.path.split(".").pop();return!p||v.some(s=>s.name===p&&s.value)})),T=I(()=>{const w={};for(const r of b.value){const p=`${r.path.split("/").slice(0,-1).join("/")}/`;w[p]||(w[p]=[]),w[p].push(r)}return Object.entries(w).sort(([r],[p])=>r.localeCompare(p))}),M=I(()=>{const w={children:[]},r=(p,s,c)=>{const[x,...y]=s;let u=p.children.find(V=>V.path===x);u||(u={...c,path:x,children:[]},p.children.push(u)),y.length>1?r(u,y,c):y.length===1&&u.children.push({...c,path:y[0]})};return b.value.forEach(p=>{const s=p.path.split("/").filter(c=>c!=="");r(w,s,p)}),w.children}),_=U(),{view:O}=ke("assets");function G(){O.value=O.value==="list"?"grid":"list"}Ce("Escape",()=>{_.value=void 0});const B=U();return(w,r)=>{const p=te,s=Pe,c=Ve,x=Ae,y=qe,u=ct,V=Ie,$=re,E=Ft,R=Te,a=oe("tooltip");return o(),i("div",Nt,[d(x,{ref_key:"navbar",ref:B,search:F.value,"onUpdate:search":r[1]||(r[1]=e=>F.value=e),pb2:""},{actions:h(()=>[t("div",jt,[K(d(p,{icon:"carbon:cloud-upload",title:"File Upload",border:!1,onClick:r[0]||(r[0]=e=>f.value=!f.value)},null,512),[[a,"File Upload",void 0,{"bottom-end":!0}]]),m(v).length?(o(),P(c,{key:0,direction:"end",n:"sm primary"},{trigger:h(({click:e})=>[K(d(p,{icon:"carbon-filter",border:!1,title:"Filter",p3:"","text-lg":"",onClick:k=>e()},null,8,["onClick"]),[[a,"Filter",void 0,{"bottom-end":!0}]]),t("span",It,D(m(v).length),1)]),default:h(()=>[t("div",St,[(o(!0),i(L,null,Z(m(v),e=>(o(),P(s,{key:e.name,modelValue:e.value,"onUpdate:modelValue":k=>e.value=k,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:h(()=>[t("span",Ut,D(e.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):j("",!0),K(d(p,{"text-lg":"",border:!1,icon:m(O)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:G},null,8,["icon"]),[[a,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:h(()=>[t("div",Tt,[F.value?(o(),i("span",Ot,D(b.value.length)+" matched · ",1)):j("",!0),t("span",null,D(m(g)?.length)+" assets in total",1)])]),_:1},8,["search"]),d(y,{modelValue:f.value,"onUpdate:modelValue":r[2]||(r[2]=e=>f.value=e),folder:"/"},null,8,["modelValue"]),m(O)==="grid"?(o(),i(L,{key:0},[T.value.length>1?(o(!0),i(L,{key:0},Z(T.value,([e,k])=>(o(),P(V,{key:e,text:e,description:`${k.length} items`,open:k.length<=m(Oe),padding:!1},{default:h(()=>[t("div",Et,[(o(!0),i(L,null,Z(k,S=>(o(),P(u,{key:S.path,asset:S,folder:e,onClick:N=>_.value=S},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),i("div",Lt,[(o(!0),i(L,null,Z(b.value,e=>(o(),P(u,{key:e.path,asset:e,onClick:k=>_.value=e},null,8,["asset","onClick"]))),128))]))],64)):(o(),i("div",Bt,[(o(!0),i(L,null,Z(M.value,(e,k)=>(o(),P($,{key:k,modelValue:_.value,"onUpdate:modelValue":r[3]||(r[3]=S=>_.value=S),item:e},null,8,["modelValue","item"]))),128))])),d(R,{"model-value":!!_.value,"auto-close":"","w-120":"",top:B.value,onClose:r[5]||(r[5]=e=>_.value=void 0)},{default:h(()=>[_.value?(o(),P(E,{key:0,modelValue:_.value,"onUpdate:modelValue":r[4]||(r[4]=e=>_.value=e)},null,8,["modelValue"])):j("",!0)]),_:1},8,["model-value","top"])])}}});export{nn as default};
|