@nuxt/devtools 2.0.0-beta.3 → 2.0.0-beta.5
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 +77 -21
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +24 -15
- package/dist/client/404.html +24 -15
- package/dist/client/_nuxt/__blank-lg13rweu.js +1 -0
- package/dist/client/_nuxt/analyze-build-gmuknzfw.js +1 -0
- package/dist/client/_nuxt/{assets-lceirxyg.js → assets-dd830wes.js} +3 -3
- package/dist/client/_nuxt/br0ge4ps.js +17 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/783ebd29-35fd-4ab4-977b-48ffdc8d0d2a.json +1 -0
- package/dist/client/_nuxt/{client-bnemmvey.js → client-kpmlv67d.js} +1 -1
- package/dist/client/_nuxt/{code-diff.vue-m59b1ce1.js → code-diff.vue-l20yfb5y.js} +4 -4
- package/dist/client/_nuxt/code-snippets.vue-fyf7hny4.js +1 -0
- package/dist/client/_nuxt/components-kx8xhm4c.js +1 -0
- package/dist/client/_nuxt/composable-item.vue-hl39uozy.js +1 -0
- package/dist/client/_nuxt/custom-_name_-d5qnyb09.js +1 -0
- package/dist/client/_nuxt/data-schema-button.vue-t4x7n86i.js +1 -0
- package/dist/client/_nuxt/data-schema-drawer-n6exgys1.js +2 -0
- package/dist/client/_nuxt/default-g8faw7ar.js +1 -0
- package/dist/client/_nuxt/duration-display.vue-dzttyi5n.js +1 -0
- package/dist/client/_nuxt/{entry.css-egk2z7qr.css → entry.css-gcfkqtar.css} +1 -1
- package/dist/client/_nuxt/error-404-n0mstzuh.js +1 -0
- package/dist/client/_nuxt/error-404.css-fwe7gpvk.css +1 -0
- package/dist/client/_nuxt/{error-500-b6jxhbbr.js → error-500-jm6glw7y.js} +1 -1
- package/dist/client/_nuxt/error-500.css-djemplc9.css +1 -0
- package/dist/client/_nuxt/{error-ir358wkn.js → error-i3oqerah.js} +7 -7
- package/dist/client/_nuxt/filepath-item.vue-k5kbrrxd.js +1 -0
- package/dist/client/_nuxt/full-iaegnm2q.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-yzlm2ptp.js → help-fab.vue-fbsfcevy.js} +1 -1
- package/dist/client/_nuxt/hooks-jwf6n7sm.js +1 -0
- package/dist/client/_nuxt/imports-ofv7nn4p.js +1 -0
- package/dist/client/_nuxt/index-cqfnpc9h.js +2 -0
- package/dist/client/_nuxt/index-g3tpqk1i.js +1 -0
- package/dist/client/_nuxt/launch-page.vue-l6dyjuca.js +1 -0
- package/dist/client/_nuxt/modules-ng7fbrcy.js +1 -0
- package/dist/client/_nuxt/nbadge-ddy5wz2y.js +1 -0
- package/dist/client/_nuxt/ncheckbox.vue-7jfrwa2l.js +1 -0
- package/dist/client/_nuxt/ncode-block.vue-dt6krs6h.js +2 -0
- package/dist/client/_nuxt/{ndrawer.vue-gp265qmz.js → ndrawer.vue-n5czlkzi.js} +1 -1
- package/dist/client/_nuxt/ndropdown.vue-vcbeucyq.js +1 -0
- package/dist/client/_nuxt/nicon-title.vue-hzhi6u0u.js +1 -0
- package/dist/client/_nuxt/nlink.vue-l5doraya.js +1 -0
- package/dist/client/_nuxt/nmarkdown.vue-jpbjhala.js +1 -0
- package/dist/client/_nuxt/nnavbar.vue-np5er7un.js +1 -0
- package/dist/client/_nuxt/none-dzu1bhg8.js +1 -0
- package/dist/client/_nuxt/nsection-block-fzkqbbnr.js +1 -0
- package/dist/client/_nuxt/nselect-tabs.vue-d7rqj9k3.js +1 -0
- package/dist/client/_nuxt/nselect.vue-n3ydby3p.js +1 -0
- package/dist/client/_nuxt/nswitch.vue-iu20lc9i.js +1 -0
- package/dist/client/_nuxt/{open-graph-kgnpjx56.js → open-graph-d7m4frvi.js} +2 -2
- package/dist/client/_nuxt/overview-pfkrhygn.js +1 -0
- package/dist/client/_nuxt/pages-oklawe0o.js +1 -0
- package/dist/client/_nuxt/payload-keznyimi.js +1 -0
- package/dist/client/_nuxt/pinia-fibp8qb0.js +1 -0
- package/dist/client/_nuxt/plugins-ln4pgjet.js +1 -0
- package/dist/client/_nuxt/render-tree-ilxzbv2u.js +1 -0
- package/dist/client/_nuxt/runtime-configs-o7kf9ai7.js +1 -0
- package/dist/client/_nuxt/{server-discovery-lpl7up2g.js → server-discovery-b5752cym.js} +1 -1
- package/dist/client/_nuxt/server-route-inputs.vue-nopzqfij.js +1 -0
- package/dist/client/_nuxt/server-routes-fi0h7729.js +9 -0
- package/dist/client/_nuxt/server-tasks-hme13a9o.js +1 -0
- package/dist/client/_nuxt/settings-k7y98pfh.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-dd1o2nt8.js → stacktrace-list.vue-ihfc6f9a.js} +1 -1
- package/dist/client/_nuxt/{state-components-fznhrvmy.js → state-components-hny3wwud.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-fpm274h0.js +1 -0
- package/dist/client/_nuxt/state-modules-oy2x8z2w.js +1 -0
- package/dist/client/_nuxt/storage-jrv1yxyu.js +1 -0
- package/dist/client/_nuxt/terminals-mmfjxesn.js +1 -0
- package/dist/client/_nuxt/timeline-fswewa43.js +31 -0
- package/dist/client/_nuxt/unocss-runtime-cb61k1ql.js +1 -0
- package/dist/client/_nuxt/vendor/{json-editor-vue-fw81xiot.js → json-editor-vue-kcahofzr.js} +4 -4
- package/dist/client/_nuxt/vendor/quicktype-core-lnbp3n5r.js +1006 -0
- package/dist/client/_nuxt/vendor/{shiki-j4jbxo4i.js → shiki-ja073547.js} +153 -19
- package/dist/client/_nuxt/vendor/unocss-mstcul8h.js +2 -0
- package/dist/client/_nuxt/virtual-files-k9shnk07.js +1 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-luvj44av.js → vue-virtual-scroller.esm-ryb7s73q.js} +2 -2
- package/dist/client/discovery/index.html +1 -1
- package/dist/client/index.html +24 -15
- package/dist/module.json +2 -2
- package/package.json +37 -37
- package/dist/client/_nuxt/__blank-kfhf1maj.js +0 -1
- package/dist/client/_nuxt/analyze-build-i2evx293.js +0 -1
- package/dist/client/_nuxt/builds/meta/6e424b49-a388-4873-af5c-f5bf674ab4fd.json +0 -1
- package/dist/client/_nuxt/code-snippets.vue-mu5jhvae.js +0 -1
- package/dist/client/_nuxt/components-ikkm6wfj.js +0 -1
- package/dist/client/_nuxt/composable-item.vue-ey343bin.js +0 -1
- package/dist/client/_nuxt/custom-_name_-o1a3o1fk.js +0 -1
- package/dist/client/_nuxt/default-er6p2ts4.js +0 -1
- package/dist/client/_nuxt/duration-display.vue-jvaccd8v.js +0 -1
- package/dist/client/_nuxt/error-404-7ihq95lu.js +0 -1
- package/dist/client/_nuxt/error-404.css-lmmxplpx.css +0 -1
- package/dist/client/_nuxt/error-500.css-u0boq89r.css +0 -1
- package/dist/client/_nuxt/filepath-item.vue-dhlc2m5d.js +0 -1
- package/dist/client/_nuxt/full-e9qzc8j7.js +0 -1
- package/dist/client/_nuxt/hooks-lq1fgw8v.js +0 -1
- package/dist/client/_nuxt/imports-dpeohran.js +0 -1
- package/dist/client/_nuxt/index-h6pm4akq.js +0 -2
- package/dist/client/_nuxt/index-hu8k1ikj.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-cqjll0t4.js +0 -1
- package/dist/client/_nuxt/modules-cwxez27z.js +0 -1
- package/dist/client/_nuxt/nbadge-j8xt52su.js +0 -1
- package/dist/client/_nuxt/ncheckbox.vue-ioifqy12.js +0 -1
- package/dist/client/_nuxt/ncode-block.vue-c2t0anp9.js +0 -2
- package/dist/client/_nuxt/ndropdown.vue-ndnxxqz3.js +0 -1
- package/dist/client/_nuxt/nicon-title.vue-hch1agon.js +0 -1
- package/dist/client/_nuxt/nlink.vue-e40v0aor.js +0 -1
- package/dist/client/_nuxt/nmarkdown.vue-lym2fx3e.js +0 -1
- package/dist/client/_nuxt/nnavbar.vue-c0adj8nq.js +0 -1
- package/dist/client/_nuxt/none-kezye0bp.js +0 -1
- package/dist/client/_nuxt/nqd95jrf.js +0 -17
- package/dist/client/_nuxt/nsection-block-f14x58hh.js +0 -1
- package/dist/client/_nuxt/nselect-tabs.vue-na6ry09k.js +0 -1
- package/dist/client/_nuxt/nselect.vue-ee45ax1g.js +0 -1
- package/dist/client/_nuxt/overview-i30f9hlm.js +0 -1
- package/dist/client/_nuxt/pages-knebj0ix.js +0 -1
- package/dist/client/_nuxt/payload-k8wbggdo.js +0 -1
- package/dist/client/_nuxt/pinia-kons3h57.js +0 -1
- package/dist/client/_nuxt/plugins-ii6sh4te.js +0 -1
- package/dist/client/_nuxt/render-tree-i1h2yw86.js +0 -1
- package/dist/client/_nuxt/runtime-configs-enkn9zid.js +0 -1
- package/dist/client/_nuxt/server-route-inputs.vue-bz7xqj56.js +0 -1
- package/dist/client/_nuxt/server-routes-b9ai2wd9.js +0 -9
- package/dist/client/_nuxt/server-tasks-k30bm979.js +0 -1
- package/dist/client/_nuxt/settings-o2tq5e7h.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-kymp37it.js +0 -1
- package/dist/client/_nuxt/state-modules-e55ef8vi.js +0 -1
- package/dist/client/_nuxt/storage-f1itsmu9.js +0 -1
- package/dist/client/_nuxt/terminals-j1dwghns.js +0 -1
- package/dist/client/_nuxt/timeline-mlcexd9r.js +0 -31
- package/dist/client/_nuxt/unocss-runtime-eltx4hvu.js +0 -1
- package/dist/client/_nuxt/vendor/unocss-dypm4cev.js +0 -2
- package/dist/client/_nuxt/virtual-files-g2ocjx4o.js +0 -1
|
@@ -3,7 +3,7 @@ import fs$8 from 'node:fs/promises';
|
|
|
3
3
|
import os$1, { homedir } from 'node:os';
|
|
4
4
|
import { logger, useNuxt, addPlugin, addTemplate, addVitePlugin } from '@nuxt/kit';
|
|
5
5
|
import { colors } from 'consola/utils';
|
|
6
|
-
import { join, dirname as dirname$1, resolve, isAbsolute } from 'pathe';
|
|
6
|
+
import { join, dirname as dirname$1, resolve, isAbsolute as isAbsolute$1 } from 'pathe';
|
|
7
7
|
import sirv from 'sirv';
|
|
8
8
|
import { searchForWorkspaceRoot } from 'vite';
|
|
9
9
|
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools.60b2ba4d.mjs';
|
|
@@ -11,7 +11,7 @@ import path$a, { dirname, join as join$1, relative, parse as parse$4 } from 'nod
|
|
|
11
11
|
import { hash } from 'ohash';
|
|
12
12
|
import { runtimeDir, clientDir, packageDir, isGlobalInstall } from '../dirs.mjs';
|
|
13
13
|
import { createBirpcGroup } from 'birpc';
|
|
14
|
-
import { stringify as stringify$5, parse as parse$5 } from '
|
|
14
|
+
import { stringify as stringify$5, parse as parse$5 } from 'structured-clone-es';
|
|
15
15
|
import { startSubprocess } from '@nuxt/devtools-kit';
|
|
16
16
|
import Git from 'simple-git';
|
|
17
17
|
import { glob } from 'tinyglobby';
|
|
@@ -48,7 +48,7 @@ import __cjs_mod__ from 'module';
|
|
|
48
48
|
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
49
49
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
50
50
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
51
|
-
const version$1 = "2.0.0-beta.
|
|
51
|
+
const version$1 = "2.0.0-beta.5";
|
|
52
52
|
|
|
53
53
|
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
54
54
|
function randomStr(size = 16, dict = urlAlphabet) {
|
|
@@ -8810,7 +8810,7 @@ function _resolve(id, options = {}) {
|
|
|
8810
8810
|
if (id.startsWith("file://")) {
|
|
8811
8811
|
id = fileURLToPath(id);
|
|
8812
8812
|
}
|
|
8813
|
-
if (isAbsolute(id)) {
|
|
8813
|
+
if (isAbsolute$1(id)) {
|
|
8814
8814
|
try {
|
|
8815
8815
|
const stat = statSync$1(id);
|
|
8816
8816
|
if (stat.isFile()) {
|
|
@@ -13359,7 +13359,7 @@ micromatch$1.hasBraces = hasBraces;
|
|
|
13359
13359
|
var micromatch_1 = micromatch$1;
|
|
13360
13360
|
|
|
13361
13361
|
Object.defineProperty(pattern$1, "__esModule", { value: true });
|
|
13362
|
-
pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
|
|
13362
|
+
pattern$1.isAbsolute = pattern$1.partitionAbsoluteAndRelative = pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
|
|
13363
13363
|
const path$5 = require$$0$1;
|
|
13364
13364
|
const globParent = globParent$1;
|
|
13365
13365
|
const micromatch = micromatch_1;
|
|
@@ -13545,6 +13545,24 @@ function removeDuplicateSlashes(pattern) {
|
|
|
13545
13545
|
return pattern.replace(DOUBLE_SLASH_RE, '/');
|
|
13546
13546
|
}
|
|
13547
13547
|
pattern$1.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
13548
|
+
function partitionAbsoluteAndRelative(patterns) {
|
|
13549
|
+
const absolute = [];
|
|
13550
|
+
const relative = [];
|
|
13551
|
+
for (const pattern of patterns) {
|
|
13552
|
+
if (isAbsolute(pattern)) {
|
|
13553
|
+
absolute.push(pattern);
|
|
13554
|
+
}
|
|
13555
|
+
else {
|
|
13556
|
+
relative.push(pattern);
|
|
13557
|
+
}
|
|
13558
|
+
}
|
|
13559
|
+
return [absolute, relative];
|
|
13560
|
+
}
|
|
13561
|
+
pattern$1.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
13562
|
+
function isAbsolute(pattern) {
|
|
13563
|
+
return path$5.isAbsolute(pattern);
|
|
13564
|
+
}
|
|
13565
|
+
pattern$1.isAbsolute = isAbsolute;
|
|
13548
13566
|
|
|
13549
13567
|
var stream$4 = {};
|
|
13550
13568
|
|
|
@@ -15317,11 +15335,19 @@ class EntryFilter {
|
|
|
15317
15335
|
this.index = new Map();
|
|
15318
15336
|
}
|
|
15319
15337
|
getFilter(positive, negative) {
|
|
15320
|
-
const
|
|
15321
|
-
const
|
|
15322
|
-
|
|
15338
|
+
const [absoluteNegative, relativeNegative] = utils$3.pattern.partitionAbsoluteAndRelative(negative);
|
|
15339
|
+
const patterns = {
|
|
15340
|
+
positive: {
|
|
15341
|
+
all: utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions)
|
|
15342
|
+
},
|
|
15343
|
+
negative: {
|
|
15344
|
+
absolute: utils$3.pattern.convertPatternsToRe(absoluteNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true })),
|
|
15345
|
+
relative: utils$3.pattern.convertPatternsToRe(relativeNegative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }))
|
|
15346
|
+
}
|
|
15347
|
+
};
|
|
15348
|
+
return (entry) => this._filter(entry, patterns);
|
|
15323
15349
|
}
|
|
15324
|
-
_filter(entry,
|
|
15350
|
+
_filter(entry, patterns) {
|
|
15325
15351
|
const filepath = utils$3.path.removeLeadingDotSegment(entry.path);
|
|
15326
15352
|
if (this._settings.unique && this._isDuplicateEntry(filepath)) {
|
|
15327
15353
|
return false;
|
|
@@ -15329,11 +15355,7 @@ class EntryFilter {
|
|
|
15329
15355
|
if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
|
|
15330
15356
|
return false;
|
|
15331
15357
|
}
|
|
15332
|
-
|
|
15333
|
-
return false;
|
|
15334
|
-
}
|
|
15335
|
-
const isDirectory = entry.dirent.isDirectory();
|
|
15336
|
-
const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory);
|
|
15358
|
+
const isMatched = this._isMatchToPatternsSet(filepath, patterns, entry.dirent.isDirectory());
|
|
15337
15359
|
if (this._settings.unique && isMatched) {
|
|
15338
15360
|
this._createIndexRecord(filepath);
|
|
15339
15361
|
}
|
|
@@ -15351,14 +15373,32 @@ class EntryFilter {
|
|
|
15351
15373
|
_onlyDirectoryFilter(entry) {
|
|
15352
15374
|
return this._settings.onlyDirectories && !entry.dirent.isDirectory();
|
|
15353
15375
|
}
|
|
15354
|
-
|
|
15355
|
-
|
|
15376
|
+
_isMatchToPatternsSet(filepath, patterns, isDirectory) {
|
|
15377
|
+
const isMatched = this._isMatchToPatterns(filepath, patterns.positive.all, isDirectory);
|
|
15378
|
+
if (!isMatched) {
|
|
15356
15379
|
return false;
|
|
15357
15380
|
}
|
|
15358
|
-
const
|
|
15359
|
-
|
|
15381
|
+
const isMatchedByRelativeNegative = this._isMatchToPatterns(filepath, patterns.negative.relative, isDirectory);
|
|
15382
|
+
if (isMatchedByRelativeNegative) {
|
|
15383
|
+
return false;
|
|
15384
|
+
}
|
|
15385
|
+
const isMatchedByAbsoluteNegative = this._isMatchToAbsoluteNegative(filepath, patterns.negative.absolute, isDirectory);
|
|
15386
|
+
if (isMatchedByAbsoluteNegative) {
|
|
15387
|
+
return false;
|
|
15388
|
+
}
|
|
15389
|
+
return true;
|
|
15390
|
+
}
|
|
15391
|
+
_isMatchToAbsoluteNegative(filepath, patternsRe, isDirectory) {
|
|
15392
|
+
if (patternsRe.length === 0) {
|
|
15393
|
+
return false;
|
|
15394
|
+
}
|
|
15395
|
+
const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, filepath);
|
|
15396
|
+
return this._isMatchToPatterns(fullpath, patternsRe, isDirectory);
|
|
15360
15397
|
}
|
|
15361
15398
|
_isMatchToPatterns(filepath, patternsRe, isDirectory) {
|
|
15399
|
+
if (patternsRe.length === 0) {
|
|
15400
|
+
return false;
|
|
15401
|
+
}
|
|
15362
15402
|
// Trying to match files and directories by patterns.
|
|
15363
15403
|
const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
|
|
15364
15404
|
// A pattern with a trailling slash can be used for directory matching.
|
|
@@ -15777,7 +15817,7 @@ async function extractExports(name, url, cache = true) {
|
|
|
15777
15817
|
const packageJson = await readPackageJSON(packageJsonPath);
|
|
15778
15818
|
const version = packageJson.version;
|
|
15779
15819
|
const cachePath = join(CACHE_PATH, `${name}@${version}`, "exports.json");
|
|
15780
|
-
if (cache && CACHE_WRITEABLE ===
|
|
15820
|
+
if (cache && CACHE_WRITEABLE === undefined) {
|
|
15781
15821
|
try {
|
|
15782
15822
|
CACHE_WRITEABLE = isWritable(CACHE_PATH);
|
|
15783
15823
|
} catch {
|
|
@@ -17505,6 +17545,22 @@ function setupServerDataRPC({
|
|
|
17505
17545
|
let nitro;
|
|
17506
17546
|
let viteServer;
|
|
17507
17547
|
let viteClient;
|
|
17548
|
+
function normalizeViteConfig(config) {
|
|
17549
|
+
return {
|
|
17550
|
+
...config,
|
|
17551
|
+
environments: Object.fromEntries(
|
|
17552
|
+
Object.entries(config.env).map(([key, _]) => {
|
|
17553
|
+
return [key, null];
|
|
17554
|
+
})
|
|
17555
|
+
),
|
|
17556
|
+
plugins: config.plugins.map((i) => {
|
|
17557
|
+
const clone = { ...i };
|
|
17558
|
+
delete clone.api;
|
|
17559
|
+
return clone;
|
|
17560
|
+
}),
|
|
17561
|
+
inlineConfig: null
|
|
17562
|
+
};
|
|
17563
|
+
}
|
|
17508
17564
|
nuxt.hook("nitro:build:before", (_nitro) => {
|
|
17509
17565
|
nitro = _nitro;
|
|
17510
17566
|
});
|
|
@@ -17515,7 +17571,7 @@ function setupServerDataRPC({
|
|
|
17515
17571
|
name: "nuxt:devtools:config-retriever",
|
|
17516
17572
|
enforce: "post",
|
|
17517
17573
|
configResolved(config) {
|
|
17518
|
-
viteServer = config;
|
|
17574
|
+
viteServer = normalizeViteConfig(config);
|
|
17519
17575
|
}
|
|
17520
17576
|
});
|
|
17521
17577
|
} else if (options.isClient) {
|
|
@@ -17524,7 +17580,7 @@ function setupServerDataRPC({
|
|
|
17524
17580
|
name: "nuxt:devtools:config-retriever",
|
|
17525
17581
|
enforce: "post",
|
|
17526
17582
|
configResolved(config) {
|
|
17527
|
-
viteClient = config;
|
|
17583
|
+
viteClient = normalizeViteConfig(config);
|
|
17528
17584
|
}
|
|
17529
17585
|
});
|
|
17530
17586
|
}
|
package/dist/chunks/vscode.mjs
CHANGED
package/dist/client/200.html
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-gcfkqtar.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/br0ge4ps.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-kcahofzr.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mstcul8h.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-ja073547.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="
|
|
15
|
-
<link rel="prefetch" as="
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
17
|
-
<link rel="prefetch" as="
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
19
|
-
<
|
|
20
|
-
<
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-g8faw7ar.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-iaegnm2q.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-dzu1bhg8.js">
|
|
14
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-lvdc77tw.css">
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-n6exgys1.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-n3ydby3p.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-iu20lc9i.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-vcbeucyq.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-dt6krs6h.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-kpmlv67d.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-n5czlkzi.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lnbp3n5r.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-cb61k1ql.js">
|
|
24
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-fwe7gpvk.css">
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-n0mstzuh.js">
|
|
26
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-djemplc9.css">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-jm6glw7y.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/br0ge4ps.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},1738682626670,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"783ebd29-35fd-4ab4-977b-48ffdc8d0d2a",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-gcfkqtar.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/br0ge4ps.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-kcahofzr.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mstcul8h.js">
|
|
9
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-ja073547.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
14
|
-
<link rel="prefetch" as="
|
|
15
|
-
<link rel="prefetch" as="
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
17
|
-
<link rel="prefetch" as="
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
19
|
-
<
|
|
20
|
-
<
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-g8faw7ar.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-iaegnm2q.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-dzu1bhg8.js">
|
|
14
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-lvdc77tw.css">
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-n6exgys1.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-n3ydby3p.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-iu20lc9i.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-vcbeucyq.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-dt6krs6h.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-kpmlv67d.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-n5czlkzi.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lnbp3n5r.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-cb61k1ql.js">
|
|
24
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-fwe7gpvk.css">
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-n0mstzuh.js">
|
|
26
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-djemplc9.css">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-jm6glw7y.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/br0ge4ps.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},1738682626670,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"783ebd29-35fd-4ab4-977b-48ffdc8d0d2a",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,W as n,U as t}from"./vendor/json-editor-vue-kcahofzr.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{k as R,l as J,r as V,m as U,_ as j,n as Q,o as h,p as ee,q as ne,s as te,v as le,w as ie,x as oe,y as k,z as re,A as ue,B as se,h as ae}from"./br0ge4ps.js";import{_ as de}from"./filepath-item.vue-k5kbrrxd.js";import{p as E,q as F,f as S,U as i,W as u,X as e,F as p,ae as G,a0 as P,a8 as v,Z as g,u as b,a3 as d,a2 as a,a9 as f,ab as D,ac as I,P as B}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as me}from"./ncode-block.vue-dt6krs6h.js";import{_ as pe}from"./ncheckbox.vue-7jfrwa2l.js";import{_ as ve}from"./help-fab.vue-fbsfcevy.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-ja073547.js";import"./client-kpmlv67d.js";const fe={"h-full":"",grid:"~ rows-[max-content_1fr]"},ye={flex:"~ wrap","w-full":""},ce=["onClick"],be={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},xe={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},ge=E({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(N){const y=N,$=`${J().app.baseURL}/__nuxt_devtools__/analyze/`.replace(/\/+/g,"/"),c=F(()=>{const l=[{name:"Overview",id:"overview"}];return y.current.features.bundleClient&&l.push({name:"Client Bundle",id:"bundle-client"}),y.current.features.bundleNitro&&l.push({name:"Nitro Bundle",id:"bundle-nitro"}),y.current.features.viteInspect&&l.push({name:"Vite Inspect",id:"vite-inspect"}),l}),o=S(c.value[0]);function z(l){return`${((l.endTime-l.startTime)/1e3).toFixed(1)}s`}function m(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 V.clearAnalyzeBuilds(await U(),[l])}return(l,n)=>{const A=de,C=j;return i(),u("div",fe,[e("div",ye,[(i(!0),u(p,null,G(c.value,(r,t)=>(i(),u("button",{key:t,px4:"",py2:"",border:"r base",hover:"bg-active",class:P(r.id===o.value.id?"":"border-b"),onClick:_=>o.value=r},[e("div",{class:P(r.id===o.value.id?"":"op30")},v(r.name),3)],10,ce))),128)),n[1]||(n[1]=e("div",{border:"b base","flex-auto":""},null,-1))]),o.value.id==="overview"?(i(),u("div",be,[n[15]||(n[15]=e("div",{"flex-auto":""},null,-1)),e("div",xe,[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,v(l.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,v(z(l.current)),1)]),l.current.size?.clientBundle?(i(),u(p,{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,v(m(l.current.size.clientBundle)),1)])],64)):g("",!0),l.current.size.nitroBundle?(i(),u(p,{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,v(m(l.current.size.nitroBundle)),1)])],64)):g("",!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,v(b(R)(new Date(l.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)),d(A,{filepath:l.current.analyzeDir},null,8,["filepath"])])]),n[16]||(n[16]=e("div",{"flex-auto":""},null,-1)),d(C,{n:"rose",icon:"carbon-delete",onClick:n[0]||(n[0]=r=>T(l.current.name))},{default:a(()=>n[14]||(n[14]=[f(" Delete this report ")])),_:1})])):g("",!0),n._lazyshow1||o.value.id==="bundle-client"?(n._lazyshow1=!0,i(),u(p,null,[D(e("iframe",{src:`${b($)}${l.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-client"]])],64)):g("v-show-if",!0),n._lazyshow2||o.value.id==="bundle-nitro"?(n._lazyshow2=!0,i(),u(p,null,[D(e("iframe",{src:`${b($)}${l.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-nitro"]])],64)):g("v-show-if",!0),n._lazyshow3||o.value.id==="vite-inspect"?(n._lazyshow3=!0,i(),u(p,null,[D(e("iframe",{src:`${b($)}${l.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="vite-inspect"]])],64)):g("v-show-if",!0)])}}}),we={class:"markdown-body"},$e={__name:"analyze-build",setup(N,{expose:y}){return y({frontmatter:{}}),($,c)=>(i(),u("div",we,c[0]||(c[0]=[e("h1",null,"Build Analyze",-1),e("p",null,[f("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",null,"nuxt build --analyze"),f(" and present the output data directly in DevTools for easy browsing and comparing.")],-1)])))}},ze={flex:"~ col"},_e=["onClick"],Be={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},Ce={flex:"~ items-center justify-center wrap",p4:""},ke={flex:"~ col gap-1","w-250":"",p4:""},Ne={flex:"~ gap-3",mt2:"","justify-end":""},Ue=E({__name:"analyze-build",setup(N){const y=Q(),w=h(),$=ee(),c=ne("analyze-build:slug",""),o=F(()=>w.value?.builds.find(r=>r.slug===c.value)??w.value?.builds[0]),z=S(!1),m=S(""),T=F(()=>w.value?.builds.some(r=>r.name===m.value.trim()));async function l(){m.value=await V.generateAnalyzeBuildName(),await y.start()&&(oe("analyze-build:start"),k.value={name:m.value,processId:await V.startAnalyzeBuild(await U(),m.value)},z.value&&C())}const n=te();function A(r){return`${((r.endTime-r.startTime)/1e3).toFixed(1)}s`}function C(){k.value?.processId&&(n.value=k.value.processId,$.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 _=j,L=ge,q=ae,O=ie,W=re,Z=ue,H=me,K=pe,M=se,X=$e,Y=ve;return i(),u(p,null,[d(O,{"left-size":30},{left:a(()=>[e("div",ze,[(i(!0),u(p,null,G(b(w)?.builds,s=>(i(),u(p,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:P(s.slug===o.value?.slug?"text-primary bg-active":""),onClick:x=>c.value=s.slug},[e("code",null,v(s.name),1),e("div",Be,[t[4]||(t[4]=e("div",{"i-carbon-time":""},null,-1)),e("span",null,v(A(s)),1),t[5]||(t[5]=e("div",{"flex-auto":""},null,-1)),e("span",null,v(b(R)(new Date(s.endTime))),1)])],10,_e),t[6]||(t[6]=e("div",{"x-divider":""},null,-1))],64))),128)),e("div",Ce,[b(k)?(i(),B(_,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:t[1]||(t[1]=s=>C())},{default:a(()=>t[8]||(t[8]=[f(" Building... ")])),_:1})):(i(),B(_,{key:0,n:"primary",icon:"carbon-edge-node",onClick:t[0]||(t[0]=s=>l())},{default:a(()=>t[7]||(t[7]=[f(" Start a new build ")])),_:1}))])])]),right:a(()=>[o.value?(i(),B(L,{key:0,current:o.value},null,8,["current"])):(i(),B(q,{key:1}))]),_:1}),d(b(y),null,{default:a(({resolve:s})=>[d(M,{"model-value":!0,onClose:x=>s(!1)},{default:a(()=>[e("div",ke,[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)),d(W,{modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=x=>m.value=x),placeholder:"Build name"},null,8,["modelValue"]),T.value?(i(),B(Z,{key:0,"n-orange":""},{default:a(()=>t[9]||(t[9]=[f(" A build with the same name already exists, continue would overrides the previous build result. ")])),_:1})):g("",!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)),d(H,{code:`npx nuxi analyze --no-serve --name=${m.value}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),d(K,{modelValue:z.value,"onUpdate:modelValue":t[3]||(t[3]=x=>z.value=x),mt2:"",n:"primary"},{default:a(()=>t[10]||(t[10]=[f(" Navigate to terminal ")])),_:1},8,["modelValue"]),e("div",Ne,[d(_,{onClick:x=>s(!1)},{default:a(()=>t[11]||(t[11]=[f(" Cancel ")])),_:2},1032,["onClick"]),d(_,{n:"solid primary",onClick:x=>s(!0)},{default:a(()=>t[12]||(t[12]=[f(" Start ")])),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),d(Y,null,{default:a(()=>[d(X)]),_:1})],64)}}});export{Ue as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{C as ee,D as H,E as ce,F as pe,x as me,r as W,m as X,G as M,_ as te,H as ne,z as se,I as ve,J as fe,c as le,K as ge,a as he,L as xe,M as be,B as we,N as _e,O as ye,P as $e,g as ke,Q as Ce}from"./br0ge4ps.js";import{_ as Ve}from"./ncheckbox.vue-7jfrwa2l.js";import{_ as Pe}from"./ndropdown.vue-vcbeucyq.js";import{_ as Ae}from"./nnavbar.vue-np5er7un.js";import{p as Z,f as T,ag as oe,W as i,ab as K,a3 as d,X as t,a9 as D,F as L,ae as G,P as V,a2 as h,Z as U,a0 as J,u as m,U as o,q as I,$ as ae,a8 as F,Y as De,A as Fe,a1 as Ne,an as Ue}from"./vendor/json-editor-vue-kcahofzr.js";import{_ as Ie}from"./nsection-block-fzkqbbnr.js";import{_ as Se}from"./filepath-item.vue-k5kbrrxd.js";import{_ as Te}from"./code-snippets.vue-fyf7hny4.js";import{_ as je}from"./ndrawer.vue-n5czlkzi.js";import{D as Be}from"./constants-b32h69zq.js";import"./vendor/unocss-mstcul8h.js";import"./vendor/shiki-ja073547.js";import"./nicon-title.vue-hzhi6u0u.js";import"./ncode-block.vue-dt6krs6h.js";import"./client-kpmlv67d.js";const Ee={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},ze={for:"drop-zone-input","text-3xl":"",hover:"text-green cursor-pointer","transition-all":""},Le={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},Oe={grid:"~ cols-minmax-8rem gap-8","overflow-auto":"",p6:""},Me={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Re=["src"],Ke={flex:"~ gap1","items-center":""},qe={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ge=Z({__name:"AssetDropZone",props:{modelValue:{type:Boolean,required:!0},folder:{type:String,required:!0}},setup(z){const l=z,f=ee(l,"modelValue"),C=T(),n=T([]);function v(s){C.value=s.target,f.value=!0}function b(s){s.target===C.value&&(f.value=!1)}function j(s){s.preventDefault()}function P(s){s.preventDefault(),x(s.dataTransfer.files)}function x(s){const c=Array.from(s||[]);if(c.length){const g=[],_=n.value.map(u=>u.name);for(const u of c)if(_.includes(u.name)){let A=1;const[y,E]=u.name.split(".");for(;_.includes(`${y} (${A}).${E}`);)A++;const R=`${y}-${A}.${E}`,a=new Blob([u],{type:u.type}),e=new File([a],R,{lastModified:Date.now()});g.push(e),_.push(R)}else u.type===""&&M({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}),g.push(u);n.value=[...n.value,...g]}}async function B(){if(ce.value||pe.value)return;me("assets:upload");const s=[];for(const c of n.value){const g=new FileReader;g.readAsDataURL(c);const u=(await new Promise(A=>{g.onload=()=>A(g.result)})).split(";base64,").pop();s.push({path:c.name,encoding:"base64",content:u})}await W.writeStaticAssets(await X(),[...s],l.folder).then(()=>{p(),M({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(c=>{p(),M({message:`Error uploading files: ${c?.message??"unknown"}`,icon:"i-carbon-warning",classes:"text-red"})}),f.value=!1}function q(s){n.value?.splice(s,1)}function O(s){return URL.createObjectURL(s)}function w(s,c){const[g,_]=s.name.split("."),u=c.replace(/\.\w+$/,""),A=`${u}.${_}`;return u.length===0?(alert("File name must be at least 1 characters long"),g):(Object.defineProperty(s,"name",{value:A,writable:!1}),n.value.splice(n.value.indexOf(s),1,s),s)}function r(){n.value=[]}function p(){f.value=!1,r()}return H("dragenter",v),H("dragleave",b),H("dragover",j),H("drop",P),(s,c)=>{const g=te,_=ne,u=se,A=oe("tooltip");return o(),i("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:J(m(f)?"opacity-100 visible":"opacity-0 invisible")},[K(d(g,{icon:"carbon-close",title:"Close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",border:!1,onClick:p},null,512),[[A,"Close",void 0,{"bottom-end":!0}]]),n.value?.length?(o(),i("div",Le,[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",Oe,[(o(!0),i(L,null,G(n.value,(y,E)=>(o(),i("div",{key:y.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[t("div",Me,[t("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:O(y)},null,8,Re)]),t("div",Ke,[d(u,{n:"xs","h-full":"","flex-auto":"","model-value":y.name,"onUpdate:modelValue":R=>w(y,R.target.value)},null,8,["model-value","onUpdate:modelValue"]),d(g,{n:"red",icon:"carbon-trash-can","h-full":"","flex-none":"",title:"Remove file",onClick:R=>q(E)},null,8,["onClick"])])]))),128))]),t("div",qe,[n.value.length?(o(),V(g,{key:0,n:"red",onClick:r},{default:h(()=>[d(_,{icon:"carbon-clean"}),c[2]||(c[2]=D(" Clear "))]),_:1})):U("",!0),d(g,{disabled:!n.value.length,n:"primary solid",onClick:B},{default:h(()=>[d(_,{icon:"carbon-cloud-upload"}),c[3]||(c[3]=D(" Upload "))]),_:1},8,["disabled"])])])):(o(),i("div",Ee,[t("label",ze,[d(_,{icon:"carbon-cloud-upload","mr-2":""}),c[1]||(c[1]=D(" Drop files here or click to select "))]),t("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:c[0]||(c[0]=y=>x(y.target.files))},null,32)]))],2)}}}),Ze=Z({__name:"AssetFontPreview",props:{asset:{}},setup(z){const l=z,f=I(()=>`devtools-assets-${ve(l.asset)}`);return fe(I(()=>`
|
|
2
2
|
@font-face {
|
|
3
3
|
font-family: '${f.value}';
|
|
4
4
|
src: url('${l.asset.publicPath}');
|
|
5
5
|
}
|
|
6
|
-
`)),(C,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={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},Xe=["src"],He={key:2,"i-carbon-document":"","text-3xl":"",op20:""},Je={key:3,"w-full":"","self-start":"",p4:""},Qe=["textContent"],Ye={key:4},et=["src","autoplay","controls"],tt={key:5},nt={key:0,"i-carbon-volume-up":"","text-3xl":"",op20:""},ot=["src"],lt={key:6,"i-carbon-help":"","text-3xl":"",op20:""},ie=
|
|
6
|
+
`)),(C,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={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},Xe=["src"],He={key:2,"i-carbon-document":"","text-3xl":"",op20:""},Je={key:3,"w-full":"","self-start":"",p4:""},Qe=["textContent"],Ye={key:4},et=["src","autoplay","controls"],tt={key:5},nt={key:0,"i-carbon-volume-up":"","text-3xl":"",op20:""},ot=["src"],lt={key:6,"i-carbon-help":"","text-3xl":"",op20:""},ie=Z({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(z){return(l,f)=>{const C=Ze;return o(),i("div",We,[l.asset.type==="image"?(o(),i("img",{key:0,src:l.asset.publicPath},null,8,Xe)):l.asset.type==="font"?(o(),V(C,{key:l.asset.publicPath,asset:l.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):l.asset.type==="text"&&!l.textContent?(o(),i("div",He)):l.asset.type==="text"&&l.textContent?(o(),i("div",Je,[t("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:F(l.textContent)},null,8,Qe)])):l.asset.type==="video"?(o(),i("div",Ye,[t("video",{src:l.asset.publicPath,autoplay:l.detail,controls:l.detail},null,8,et)])):l.asset.type==="audio"?(o(),i("div",tt,[l.detail?(o(),i("audio",{key:1,src:l.asset.publicPath,controls:""},null,8,ot)):(o(),i("div",nt))])):(o(),i("div",lt))])}}}),st={relative:"",flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},at={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},it=Z({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(z){const l=z,f=I(()=>l.folder&&l.asset.path.startsWith(l.folder)?l.asset.path.slice(l.folder.length):l.asset.path);return(C,n)=>{const v=ne,b=ie;return o(),i("button",st,[C.asset.layer?(o(),V(v,{key:0,icon:"i-carbon-layers",absolute:"","right-4":"","top-4":"","bg-primary":""})):U("",!0),d(b,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:C.asset},null,8,["asset"]),t("div",at,F(f.value),1)])}}}),re=Z({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(z,{emit:l}){const f=z,n=ee(f,"modelValue",l,{passive:!0}),v=I(()=>f.item?.children?.length),b=T(!0),j=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(P,x)=>{const B=ne,q=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 + ${P.index*1.5}em)`}),class:J({"bg-active":!v.value&&m(n)?.filePath===P.item?.filePath}),border:"b base",onClick:x[0]||(x[0]=O=>v.value?b.value=!b.value:n.value=P.item)},[t("div",{class:J(j.value)},null,2),t("span",{class:J({"flex items-center":v.value}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},[D(F(P.item.path)+" ",1),P.item.layer?(o(),V(B,{key:0,icon:"i-carbon-layers","bg-primary":""})):U("",!0)],2),v.value?(o(),V(B,{key:0,icon:"carbon:chevron-right","transform-rotate":b.value?90:0,transition:""},null,8,["transform-rotate"])):U("",!0)],6),b.value?De(P.$slots,"default",{key:0},()=>[(o(!0),i(L,null,G(P.item?.children,O=>(o(),V(q,{key:O.filepath,modelValue:m(n),"onUpdate:modelValue":x[1]||(x[1]=w=>Fe(n)?n.value=w:null),item:O,index:P.index+1},null,8,["modelValue","item","index"]))),128))]):U("",!0)])}}}),rt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},ut={flex:"~","items-center":"","justify-center":""},dt={"max-w-full":"","w-full":"","table-fixed":""},ct={flex:"~ gap-1","w-full":"","items-center":""},pt={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},mt={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},vt={capitalize:""},ft={key:0},gt={op70:""},ht={flex:"~ gap2 wrap"},xt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},bt={flex:"~ gap2 wrap justify-center"},wt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},_t={flex:"~ gap2 wrap justify-center"},yt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},$t={flex:"","justify-end":"","gap-4":""},kt=Z({__name:"AssetDetails",props:{modelValue:{}},setup(z,{emit:l}){const n=ee(z,"modelValue",l,{passive:!0}),v=le(async()=>{if(n.value.type==="image")return W.getImageMeta(await X(),n.value.filePath)}),b=T(!1),j=T(),P=T(0),x=le(async()=>{if(n.value.type!=="text")return;P.value;const a=await W.getTextAssetContent(await X(),n.value.filePath);return j.value=a,a});async function B(){if(x.value!==j.value)try{await W.writeStaticAssets(await X(),[{path:n.value.path,content:j.value,override:!0}],""),b.value=!1,P.value++,M({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const q=ge(),O=I(()=>(q.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{z as ee,A as H,B as ce,C as pe,s as me,r as W,j as X,D as M,f as te,E as
|
|
|
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=he(),p=xe(),s=be(()=>n.value.mtime),c=U(()=>{const a=n.value.size;return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1024/1024).toFixed(2)} MB`}),g=U(()=>{if(!v.value?.width||!v.value?.height)return"";const a=($,I)=>I?a(I,$%I):$,e=a(v.value.width,v.value.height);return e>3?`${v.value.width/e}:${v.value.height/e}`:""}),y=U(()=>["image","text","video","audio","font"].includes(n.value.type)),u=j(!1);async function A(){try{await W.deleteStaticAsset(await X(),n.value.filePath),n.value=void 0,u.value=!1,M({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const _=j(!1),E=j("");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 M({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const $=a.slice(-1)[0].split(".").slice(-1)[0],I=`${a.slice(0,-1).join("/")}/${E.value}.${$}`;await W.renameStaticAsset(await X(),n.value.filePath,I),n.value=void 0,_.value=!1,M({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch($){console.error($),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,e)=>{const $=ie,I=Ie,N=te,ue=je,Q=we,de=se,Y=oe("tooltip");return o(),i(L,null,[t("div",rt,[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",ut,[d($,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:m(n),"text-content":m(x)},null,8,["asset","text-content"])])],64)):S("",!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",dt,[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",ct,[d(I,{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]=k=>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",pt,[t("div",mt,F(m(n).publicPath),1),K(d(N,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:e[1]||(e[1]=k=>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",vt,F(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,F(m(v).width)+" x "+F(m(v).height),1)]),g.value?(o(),i("tr",ft,[e[18]||(e[18]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1)),t("td",null,F(g.value),1)])):S("",!0)],64)):S("",!0),t("tr",null,[e[19]||(e[19]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1)),t("td",null,F(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,[D(F(new Date(m(n).mtime).toLocaleString())+" ",1),t("span",gt,"("+F(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",ht,[d(N,{to:m(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:h(()=>e[21]||(e[21]=[D(" Download ")])),_:1},8,["to"]),m(n).type==="text"?(o(),V(N,{key:0,icon:"carbon-edit",n:"cyan",onClick:e[2]||(e[2]=k=>b.value=!b.value)},{default:h(()=>e[22]||(e[22]=[D(" Edit ")])),_:1})):S("",!0),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:e[3]||(e[3]=k=>_.value=!_.value)},{default:h(()=>e[23]||(e[23]=[D(" Rename ")])),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:e[4]||(e[4]=k=>u.value=!u.value)},{default:h(()=>e[24]||(e[24]=[D(" Delete ")])),_:1})]),e[27]||(e[27]=t("div",{"flex-auto":""},null,-1)),w.value.length?(o(),V(ue,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":w.value},null,8,["code-snippets"])):S("",!0)]),d(Q,{modelValue:u.value,"onUpdate:modelValue":e[6]||(e[6]=k=>u.value=k)},{default:h(()=>[t("div",xt,[e[30]||(e[30]=t("span",null," Are you sure you want to delete this asset? ",-1)),t("div",bt,[d(N,{icon:"carbon-close",onClick:e[5]||(e[5]=k=>u.value=!1)},{default:h(()=>e[28]||(e[28]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:A},{default:h(()=>e[29]||(e[29]=[D(" Delete ")])),_:1})])])]),_:1},8,["modelValue"]),d(Q,{modelValue:_.value,"onUpdate:modelValue":e[9]||(e[9]=k=>_.value=k)},{default:h(()=>[t("div",wt,[d(de,{modelValue:E.value,"onUpdate:modelValue":e[7]||(e[7]=k=>E.value=k),placeholder:"New name",n:"blue"},null,8,["modelValue"]),t("div",yt,[d(N,{icon:"carbon-close",onClick:e[8]||(e[8]=k=>_.value=!1)},{default:h(()=>e[31]||(e[31]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:R},{default:h(()=>e[32]||(e[32]=[D(" Rename ")])),_:1})])])]),_:1},8,["modelValue"]),m(n).type==="text"?(o(),V(Q,{key:0,modelValue:b.value,"onUpdate:modelValue":e[12]||(e[12]=k=>b.value=k)},{default:h(()=>[t("div",_t,[K(t("textarea",{"onUpdate:modelValue":e[10]||(e[10]=k=>T.value=k),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:Ne(B,["enter"])},null,544),[[Se,T.value]]),t("div",$t,[d(N,{icon:"carbon-close",onClick:e[11]||(e[11]=k=>b.value=!1)},{default:h(()=>e[33]||(e[33]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon:save",n:"primary",onClick:B},{default:h(()=>e[34]||(e[34]=[D(" save ")])),_:1})])])]),_:1},8,["modelValue"])):S("",!0)],64)}}}),Ct={"h-full":"","of-auto":""},Vt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},Pt={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},At={flex:"~ col","w-30":"","of-auto":""},Dt={"text-xs":"",op75:""},Ft={op50:""},Nt={key:0},St={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Ut={key:1,p2:"",grid:"~ cols-minmax-8rem"},It={key:1},Ht=q({__name:"assets",setup(z){const l=ye(),f=j(!1),C=j(""),n=U(()=>new _e(l.value||[],{keys:["path"]})),v=$e(()=>{const w=[];for(const r of l.value||[]){const p=r.path.split(".").pop();p&&!w.find(s=>s.name===p)&&w.push({name:p,value:!0})}return w}),b=U(()=>(C.value?n.value.search(C.value).map(r=>r.item):l.value||[]).filter(r=>{const p=r.path.split(".").pop();return!p||v.some(s=>s.name===p&&s.value)})),T=U(()=>{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))}),P=U(()=>{const w={path:"public",children:[]},r=(p,s,c)=>{const[g,...y]=s;let u=p.children.find(A=>A.path===g);u||(u={...c,path:g,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}),x=j(),{view:B}=ke("assets");function G(){B.value=B.value==="list"?"grid":"list"}Ce("Escape",()=>{x.value=void 0});const O=j();return(w,r)=>{const p=te,s=Ve,c=Pe,g=Ae,y=Ze,u=it,A=Ue,_=re,E=kt,R=Te,a=oe("tooltip");return o(),i("div",Ct,[d(g,{ref_key:"navbar",ref:O,search:C.value,"onUpdate:search":r[1]||(r[1]=e=>C.value=e),pb2:""},{actions:h(()=>[t("div",Vt,[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(),V(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:$=>e()},null,8,["onClick"]),[[a,"Filter",void 0,{"bottom-end":!0}]]),t("span",Pt,F(m(v).length),1)]),default:h(()=>[t("div",At,[(o(!0),i(L,null,Z(m(v),e=>(o(),V(s,{key:e.name,modelValue:e.value,"onUpdate:modelValue":$=>e.value=$,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:h(()=>[t("span",Dt,F(e.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):S("",!0),K(d(p,{"text-lg":"",border:!1,icon:m(B)==="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",Ft,[C.value?(o(),i("span",Nt,F(b.value.length)+" matched · ",1)):S("",!0),t("span",null,F(m(l)?.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(B)==="grid"?(o(),i(L,{key:0},[T.value.length>1?(o(!0),i(L,{key:0},Z(T.value,([e,$])=>(o(),V(A,{key:e,text:e,description:`${$.length} items`,open:$.length<=m(Be),padding:!1},{default:h(()=>[t("div",St,[(o(!0),i(L,null,Z($,I=>(o(),V(u,{key:I.path,asset:I,folder:e,onClick:N=>x.value=I},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),i("div",Ut,[(o(!0),i(L,null,Z(b.value,e=>(o(),V(u,{key:e.path,asset:e,onClick:$=>x.value=e},null,8,["asset","onClick"]))),128))]))],64)):(o(),i("div",It,[(o(!0),i(L,null,Z(P.value,(e,$)=>(o(),V(_,{key:$,modelValue:x.value,"onUpdate:modelValue":r[3]||(r[3]=I=>x.value=I),item:e},null,8,["modelValue","item"]))),128))])),d(R,{"model-value":!!x.value,"auto-close":"","w-120":"",top:O.value,onClose:r[5]||(r[5]=e=>x.value=void 0)},{default:h(()=>[x.value?(o(),V(E,{key:0,modelValue:x.value,"onUpdate:modelValue":r[4]||(r[4]=e=>x.value=e)},null,8,["modelValue"])):S("",!0)]),_:1},8,["model-value","top"])])}}});export{Ht as default};
|
|
16
|
+
</a>`,name:"Download link"}),a}),r=he(),p=xe(),s=be(()=>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`}),g=I(()=>{if(!v.value?.width||!v.value?.height)return"";const a=($,S)=>S?a(S,$%S):$,e=a(v.value.width,v.value.height);return e>3?`${v.value.width/e}:${v.value.height/e}`:""}),_=I(()=>["image","text","video","audio","font"].includes(n.value.type)),u=T(!1);async function A(){try{await W.deleteStaticAsset(await X(),n.value.filePath),n.value=void 0,u.value=!1,M({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch(a){console.error(a),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const y=T(!1),E=T("");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 M({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const $=a.slice(-1)[0].split(".").slice(-1)[0],S=`${a.slice(0,-1).join("/")}/${E.value}.${$}`;await W.renameStaticAsset(await X(),n.value.filePath,S),n.value=void 0,y.value=!1,M({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch($){console.error($),M({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,e)=>{const $=ie,S=Se,N=te,ue=Te,Q=we,de=se,Y=oe("tooltip");return o(),i(L,null,[t("div",rt,[_.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",ut,[d($,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:m(n),"text-content":m(x)},null,8,["asset","text-content"])])],64)):U("",!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",dt,[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",ct,[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]=k=>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",pt,[t("div",mt,F(m(n).publicPath),1),K(d(N,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:e[1]||(e[1]=k=>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",vt,F(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,F(m(v).width)+" x "+F(m(v).height),1)]),g.value?(o(),i("tr",ft,[e[18]||(e[18]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1)),t("td",null,F(g.value),1)])):U("",!0)],64)):U("",!0),t("tr",null,[e[19]||(e[19]=t("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1)),t("td",null,F(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,[D(F(new Date(m(n).mtime).toLocaleString())+" ",1),t("span",gt,"("+F(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",ht,[d(N,{to:m(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:h(()=>e[21]||(e[21]=[D(" Download ")])),_:1},8,["to"]),m(n).type==="text"?(o(),V(N,{key:0,icon:"carbon-edit",n:"cyan",onClick:e[2]||(e[2]=k=>b.value=!b.value)},{default:h(()=>e[22]||(e[22]=[D(" Edit ")])),_:1})):U("",!0),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:e[3]||(e[3]=k=>y.value=!y.value)},{default:h(()=>e[23]||(e[23]=[D(" Rename ")])),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:e[4]||(e[4]=k=>u.value=!u.value)},{default:h(()=>e[24]||(e[24]=[D(" Delete ")])),_:1})]),e[27]||(e[27]=t("div",{"flex-auto":""},null,-1)),w.value.length?(o(),V(ue,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":w.value},null,8,["code-snippets"])):U("",!0)]),d(Q,{modelValue:u.value,"onUpdate:modelValue":e[6]||(e[6]=k=>u.value=k)},{default:h(()=>[t("div",xt,[e[30]||(e[30]=t("span",null," Are you sure you want to delete this asset? ",-1)),t("div",bt,[d(N,{icon:"carbon-close",onClick:e[5]||(e[5]=k=>u.value=!1)},{default:h(()=>e[28]||(e[28]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon-delete",n:"red",onClick:A},{default:h(()=>e[29]||(e[29]=[D(" Delete ")])),_:1})])])]),_:1},8,["modelValue"]),d(Q,{modelValue:y.value,"onUpdate:modelValue":e[9]||(e[9]=k=>y.value=k)},{default:h(()=>[t("div",wt,[d(de,{modelValue:E.value,"onUpdate:modelValue":e[7]||(e[7]=k=>E.value=k),placeholder:"New name",n:"blue"},null,8,["modelValue"]),t("div",_t,[d(N,{icon:"carbon-close",onClick:e[8]||(e[8]=k=>y.value=!1)},{default:h(()=>e[31]||(e[31]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:R},{default:h(()=>e[32]||(e[32]=[D(" Rename ")])),_:1})])])]),_:1},8,["modelValue"]),m(n).type==="text"?(o(),V(Q,{key:0,modelValue:b.value,"onUpdate:modelValue":e[12]||(e[12]=k=>b.value=k)},{default:h(()=>[t("div",yt,[K(t("textarea",{"onUpdate:modelValue":e[10]||(e[10]=k=>j.value=k),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:Ne(B,["enter"])},null,544),[[Ue,j.value]]),t("div",$t,[d(N,{icon:"carbon-close",onClick:e[11]||(e[11]=k=>b.value=!1)},{default:h(()=>e[33]||(e[33]=[D(" Cancel ")])),_:1}),d(N,{icon:"carbon:save",n:"primary",onClick:B},{default:h(()=>e[34]||(e[34]=[D(" save ")])),_:1})])])]),_:1},8,["modelValue"])):U("",!0)],64)}}}),Ct={"h-full":"","of-auto":""},Vt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},Pt={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},At={flex:"~ col","w-30":"","of-auto":""},Dt={"text-xs":"",op75:""},Ft={op50:""},Nt={key:0},Ut={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},It={key:1,p2:"",grid:"~ cols-minmax-8rem"},St={key:1},Ht=Z({__name:"assets",setup(z){const l=_e(),f=T(!1),C=T(""),n=I(()=>new ye(l.value||[],{keys:["path"]})),v=$e(()=>{const w=[];for(const r of l.value||[]){const p=r.path.split(".").pop();p&&!w.find(s=>s.name===p)&&w.push({name:p,value:!0})}return w}),b=I(()=>(C.value?n.value.search(C.value).map(r=>r.item):l.value||[]).filter(r=>{const p=r.path.split(".").pop();return!p||v.some(s=>s.name===p&&s.value)})),j=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))}),P=I(()=>{const w={path:"public",children:[]},r=(p,s,c)=>{const[g,..._]=s;let u=p.children.find(A=>A.path===g);u||(u={...c,path:g,children:[]},p.children.push(u)),_.length>1?r(u,_,c):_.length===1&&u.children.push({...c,path:_[0]})};return b.value.forEach(p=>{const s=p.path.split("/").filter(c=>c!=="");r(w,s,p)}),w.children}),x=T(),{view:B}=ke("assets");function q(){B.value=B.value==="list"?"grid":"list"}Ce("Escape",()=>{x.value=void 0});const O=T();return(w,r)=>{const p=te,s=Ve,c=Pe,g=Ae,_=Ge,u=it,A=Ie,y=re,E=kt,R=je,a=oe("tooltip");return o(),i("div",Ct,[d(g,{ref_key:"navbar",ref:O,search:C.value,"onUpdate:search":r[1]||(r[1]=e=>C.value=e),pb2:""},{actions:h(()=>[t("div",Vt,[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(),V(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:$=>e()},null,8,["onClick"]),[[a,"Filter",void 0,{"bottom-end":!0}]]),t("span",Pt,F(m(v).length),1)]),default:h(()=>[t("div",At,[(o(!0),i(L,null,G(m(v),e=>(o(),V(s,{key:e.name,modelValue:e.value,"onUpdate:modelValue":$=>e.value=$,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:h(()=>[t("span",Dt,F(e.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):U("",!0),K(d(p,{"text-lg":"",border:!1,icon:m(B)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:q},null,8,["icon"]),[[a,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:h(()=>[t("div",Ft,[C.value?(o(),i("span",Nt,F(b.value.length)+" matched · ",1)):U("",!0),t("span",null,F(m(l)?.length)+" assets in total",1)])]),_:1},8,["search"]),d(_,{modelValue:f.value,"onUpdate:modelValue":r[2]||(r[2]=e=>f.value=e),folder:"/"},null,8,["modelValue"]),m(B)==="grid"?(o(),i(L,{key:0},[j.value.length>1?(o(!0),i(L,{key:0},G(j.value,([e,$])=>(o(),V(A,{key:e,text:e,description:`${$.length} items`,open:$.length<=m(Be),padding:!1},{default:h(()=>[t("div",Ut,[(o(!0),i(L,null,G($,S=>(o(),V(u,{key:S.path,asset:S,folder:e,onClick:N=>x.value=S},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),i("div",It,[(o(!0),i(L,null,G(b.value,e=>(o(),V(u,{key:e.path,asset:e,onClick:$=>x.value=e},null,8,["asset","onClick"]))),128))]))],64)):(o(),i("div",St,[(o(!0),i(L,null,G(P.value,(e,$)=>(o(),V(y,{key:$,modelValue:x.value,"onUpdate:modelValue":r[3]||(r[3]=S=>x.value=S),item:e},null,8,["modelValue","item"]))),128))])),d(R,{"model-value":!!x.value,"auto-close":"","w-120":"",top:O.value,onClose:r[5]||(r[5]=e=>x.value=void 0)},{default:h(()=>[x.value?(o(),V(E,{key:0,modelValue:x.value,"onUpdate:modelValue":r[4]||(r[4]=e=>x.value=e)},null,8,["modelValue"])):U("",!0)]),_:1},8,["model-value","top"])])}}});export{Ht as default};
|