@nuxt/devtools-nightly 2.0.0-beta.0-28940205.5b566fb → 2.0.0-beta.1-28945928.8db1f2a
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 +54 -51
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +12 -12
- package/dist/client/404.html +12 -12
- package/dist/client/_nuxt/{analyze-build-kcwmvlyl.js → analyze-build-dhl902y9.js} +1 -1
- package/dist/client/_nuxt/{assets-ivvrbi3q.js → assets-tdu15xdh.js} +3 -3
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d3cc6080-b1af-4518-8c18-051df89d9c28.json +1 -0
- package/dist/client/_nuxt/{code-diff.vue-bhijg81q.js → code-diff.vue-i6ai5lst.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-i4e657wf.js → code-snippets.vue-hvapgodh.js} +1 -1
- package/dist/client/_nuxt/{components-krpx1826.js → components-flcxjbpi.js} +1 -1
- package/dist/client/_nuxt/{composable-item.vue-kwpzi9u7.js → composable-item.vue-nf0lmc00.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-cepykbos.js → custom-_name_-gctvnum9.js} +1 -1
- package/dist/client/_nuxt/{default-mk5axw1k.js → default-etxkwzb2.js} +1 -1
- package/dist/client/_nuxt/{error-404-lp8coab3.js → error-404-n2bv7ov9.js} +1 -1
- package/dist/client/_nuxt/error-404.css-gakauvtn.css +1 -0
- package/dist/client/_nuxt/{error-500-d4b6gi3u.js → error-500-luh9fo24.js} +1 -1
- package/dist/client/_nuxt/error-500.css-nt5emrt3.css +1 -0
- package/dist/client/_nuxt/error-fut0s14b.js +9 -0
- package/dist/client/_nuxt/filepath-item.vue-ldc0cd59.js +1 -0
- package/dist/client/_nuxt/{full-j8mngb76.js → full-l6aaq3cv.js} +1 -1
- package/dist/client/_nuxt/{help-fab.vue-gtlaa6k2.js → help-fab.vue-hhv95xvg.js} +1 -1
- package/dist/client/_nuxt/{hooks-htmew7il.js → hooks-nnc2743y.js} +1 -1
- package/dist/client/_nuxt/imports-fknrz1re.js +1 -0
- package/dist/client/_nuxt/index-bbxva40i.js +1 -0
- package/dist/client/_nuxt/index-lty6c7e5.js +2 -0
- package/dist/client/_nuxt/launch-page.vue-n4iqorpj.js +1 -0
- package/dist/client/_nuxt/{modules-hdu1ikfi.js → modules-j9u2l2km.js} +1 -1
- package/dist/client/_nuxt/{nbadge-fktngirm.js → nbadge-ixgsh96g.js} +1 -1
- package/dist/client/_nuxt/{ncheckbox.vue-fs1yhvat.js → ncheckbox.vue-ktnsaj70.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-cjxfdzsk.js → ndrawer.vue-oeawm3h0.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-fe8ybtb0.js → ndropdown.vue-c5jsbp5v.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-jafnipxp.js → nlink.vue-k9k5hsy4.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-d5x8tq5w.js → nnavbar.vue-f0vufq5s.js} +1 -1
- package/dist/client/_nuxt/{none-i3w61o4x.js → none-liasomf8.js} +1 -1
- package/dist/client/_nuxt/{nsection-block-ivkmhmn9.js → nsection-block-lalufadl.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-sw71szzx.js → nselect-tabs.vue-kz2aw76p.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-mkp3umn0.js → nselect.vue-mgxbszb3.js} +1 -1
- package/dist/client/_nuxt/{open-graph-i5rptgvl.js → open-graph-i9tuqyq7.js} +2 -2
- package/dist/client/_nuxt/oqehn934.js +17 -0
- package/dist/client/_nuxt/{overview-jzek603r.js → overview-bn3nhi98.js} +1 -1
- package/dist/client/_nuxt/{pages-mhjzw1eo.js → pages-o7b83d0d.js} +1 -1
- package/dist/client/_nuxt/{payload-kjhui3c5.js → payload-hlgnscsj.js} +1 -1
- package/dist/client/_nuxt/{pinia-jy0feqo2.js → pinia-ds7jhuvv.js} +1 -1
- package/dist/client/_nuxt/plugins-n4on0a1j.js +1 -0
- package/dist/client/_nuxt/{render-tree-malxu5t7.js → render-tree-o6m99mru.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-c8u0cuv7.js → runtime-configs-k5mmw4ae.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-dfs3eezs.js → server-route-inputs.vue-c9toxo7z.js} +1 -1
- package/dist/client/_nuxt/{server-routes-ea89bftg.js → server-routes-oywm7hej.js} +2 -2
- package/dist/client/_nuxt/{server-tasks-guw0x7eh.js → server-tasks-y2pcd9w0.js} +1 -1
- package/dist/client/_nuxt/settings-l6ourgt3.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-cfyme80n.js → stacktrace-list.vue-i6sjgftd.js} +1 -1
- package/dist/client/_nuxt/{state-components-f29eyhzi.js → state-components-h4h7ppgm.js} +1 -1
- package/dist/client/_nuxt/{state-editor.vue-nd6tb0dn.js → state-editor.vue-f0he07j5.js} +1 -1
- package/dist/client/_nuxt/state-modules-mgqjnewh.js +1 -0
- package/dist/client/_nuxt/storage-ihktoh6o.js +1 -0
- package/dist/client/_nuxt/{terminals-igsxvm6w.js → terminals-mm1zdy29.js} +1 -1
- package/dist/client/_nuxt/{timeline-lm6kcwsd.js → timeline-n6lmb3xx.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-jzfgcoxk.js → unocss-runtime-lxpmsgjb.js} +1 -1
- package/dist/client/_nuxt/vendor/{unocss-3uirpnla.js → unocss-fae7bffg.js} +1 -1
- package/dist/client/_nuxt/{virtual-files-jzsbborg.js → virtual-files-mvim6jfj.js} +1 -1
- package/dist/client/index.html +12 -12
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/Main.vue +2 -9
- package/dist/shared/{devtools-nightly.5ac54dae.mjs → devtools-nightly.60b2ba4d.mjs} +3 -2
- package/package.json +19 -19
- package/dist/client/_nuxt/b6bfxrb8.js +0 -17
- package/dist/client/_nuxt/builds/meta/b8bbfd27-5704-4be8-a606-01af93c734ef.json +0 -1
- package/dist/client/_nuxt/error-404.css-b3x40x40.css +0 -1
- package/dist/client/_nuxt/error-500.css-hilpkhd4.css +0 -1
- package/dist/client/_nuxt/error-ojb7cn7v.js +0 -9
- package/dist/client/_nuxt/filepath-item.vue-b829sn9l.js +0 -1
- package/dist/client/_nuxt/imports-18kqq3am.js +0 -1
- package/dist/client/_nuxt/index-dl6nn7ct.js +0 -2
- package/dist/client/_nuxt/index-e7wrzeix.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-iyi310zf.js +0 -1
- package/dist/client/_nuxt/plugins-d2vnj57a.js +0 -1
- package/dist/client/_nuxt/settings-nr7x6wel.js +0 -1
- package/dist/client/_nuxt/state-modules-gh2s62ky.js +0 -1
- package/dist/client/_nuxt/storage-d1qa6fff.js +0 -1
|
@@ -6,7 +6,7 @@ import { colors } from 'consola/utils';
|
|
|
6
6
|
import { join, dirname as dirname$1, resolve } 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-nightly.
|
|
9
|
+
import { d as defaultAllowedExtensions, a as defaultTabOptions, W as WS_EVENT_NAME } from '../shared/devtools-nightly.60b2ba4d.mjs';
|
|
10
10
|
import { dirname, join as join$1, relative, parse } from 'node:path';
|
|
11
11
|
import { randomStr } from '@antfu/utils';
|
|
12
12
|
import { hash } from 'ohash';
|
|
@@ -31,7 +31,7 @@ import { getPackageInfo } from 'local-pkg';
|
|
|
31
31
|
import 'pkg-types';
|
|
32
32
|
import semver from 'semver';
|
|
33
33
|
|
|
34
|
-
const version = "2.0.0-beta.
|
|
34
|
+
const version = "2.0.0-beta.1-28945928.8db1f2a";
|
|
35
35
|
|
|
36
36
|
function getHomeDir() {
|
|
37
37
|
return process.env.XDG_CONFIG_HOME || homedir();
|
|
@@ -384,6 +384,54 @@ function setupCustomTabRPC({ nuxt, options, refresh }) {
|
|
|
384
384
|
};
|
|
385
385
|
}
|
|
386
386
|
|
|
387
|
+
let options;
|
|
388
|
+
function getOptions() {
|
|
389
|
+
return options;
|
|
390
|
+
}
|
|
391
|
+
function setupOptionsRPC({ nuxt }) {
|
|
392
|
+
async function getOptions2(tab) {
|
|
393
|
+
if (!options || options[tab]) {
|
|
394
|
+
options = defaultTabOptions;
|
|
395
|
+
await read(tab);
|
|
396
|
+
}
|
|
397
|
+
return options[tab];
|
|
398
|
+
}
|
|
399
|
+
async function read(tab) {
|
|
400
|
+
options[tab] = await readLocalOptions(defaultTabOptions[tab], {
|
|
401
|
+
root: nuxt.options.rootDir,
|
|
402
|
+
key: tab !== "ui" && tab
|
|
403
|
+
});
|
|
404
|
+
return options;
|
|
405
|
+
}
|
|
406
|
+
getOptions2("ui");
|
|
407
|
+
async function clearOptions() {
|
|
408
|
+
options = void 0;
|
|
409
|
+
await clearLocalOptions({
|
|
410
|
+
root: nuxt.options.rootDir
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
return {
|
|
414
|
+
async updateOptions(tab, _settings) {
|
|
415
|
+
const settings = await getOptions2(tab);
|
|
416
|
+
Object.assign(settings, _settings);
|
|
417
|
+
await writeLocalOptions(
|
|
418
|
+
{ ...settings },
|
|
419
|
+
{
|
|
420
|
+
root: nuxt.options.rootDir,
|
|
421
|
+
key: tab !== "ui" && tab
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
nuxt.callHook("builder:generateApp", {
|
|
425
|
+
filter(template) {
|
|
426
|
+
return template.filename.includes("devtools/settings.js");
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
},
|
|
430
|
+
getOptions: getOptions2,
|
|
431
|
+
clearOptions
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
|
|
387
435
|
function setupGeneralRPC({
|
|
388
436
|
nuxt,
|
|
389
437
|
options,
|
|
@@ -530,7 +578,10 @@ function setupGeneralRPC({
|
|
|
530
578
|
if (result)
|
|
531
579
|
return true;
|
|
532
580
|
}
|
|
533
|
-
|
|
581
|
+
let editor = getOptions()?.behavior.openInEditor ?? void 0;
|
|
582
|
+
if (editor === "auto")
|
|
583
|
+
editor = void 0;
|
|
584
|
+
await import('launch-editor').then((r) => (r.default || r)(path + suffix, editor));
|
|
534
585
|
return true;
|
|
535
586
|
} catch (e) {
|
|
536
587
|
console.error(e);
|
|
@@ -1346,54 +1397,6 @@ function setupNpmRPC({ nuxt, ensureDevAuthToken }) {
|
|
|
1346
1397
|
};
|
|
1347
1398
|
}
|
|
1348
1399
|
|
|
1349
|
-
let options;
|
|
1350
|
-
function getOptions() {
|
|
1351
|
-
return options;
|
|
1352
|
-
}
|
|
1353
|
-
function setupOptionsRPC({ nuxt }) {
|
|
1354
|
-
async function getOptions2(tab) {
|
|
1355
|
-
if (!options || options[tab]) {
|
|
1356
|
-
options = defaultTabOptions;
|
|
1357
|
-
await read(tab);
|
|
1358
|
-
}
|
|
1359
|
-
return options[tab];
|
|
1360
|
-
}
|
|
1361
|
-
async function read(tab) {
|
|
1362
|
-
options[tab] = await readLocalOptions(defaultTabOptions[tab], {
|
|
1363
|
-
root: nuxt.options.rootDir,
|
|
1364
|
-
key: tab !== "ui" && tab
|
|
1365
|
-
});
|
|
1366
|
-
return options;
|
|
1367
|
-
}
|
|
1368
|
-
getOptions2("ui");
|
|
1369
|
-
async function clearOptions() {
|
|
1370
|
-
options = void 0;
|
|
1371
|
-
await clearLocalOptions({
|
|
1372
|
-
root: nuxt.options.rootDir
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
return {
|
|
1376
|
-
async updateOptions(tab, _settings) {
|
|
1377
|
-
const settings = await getOptions2(tab);
|
|
1378
|
-
Object.assign(settings, _settings);
|
|
1379
|
-
await writeLocalOptions(
|
|
1380
|
-
{ ...settings },
|
|
1381
|
-
{
|
|
1382
|
-
root: nuxt.options.rootDir,
|
|
1383
|
-
key: tab !== "ui" && tab
|
|
1384
|
-
}
|
|
1385
|
-
);
|
|
1386
|
-
nuxt.callHook("builder:generateApp", {
|
|
1387
|
-
filter(template) {
|
|
1388
|
-
return template.filename.includes("devtools/settings.js");
|
|
1389
|
-
}
|
|
1390
|
-
});
|
|
1391
|
-
},
|
|
1392
|
-
getOptions: getOptions2,
|
|
1393
|
-
clearOptions
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
1400
|
function setupServerRoutesRPC({ nuxt, refresh }) {
|
|
1398
1401
|
let nitro;
|
|
1399
1402
|
let cache = null;
|
package/dist/chunks/vscode.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import 'consola/utils';
|
|
|
12
12
|
import 'pathe';
|
|
13
13
|
import 'sirv';
|
|
14
14
|
import 'vite';
|
|
15
|
-
import '../shared/devtools-nightly.
|
|
15
|
+
import '../shared/devtools-nightly.60b2ba4d.mjs';
|
|
16
16
|
import '../dirs.mjs';
|
|
17
17
|
import 'node:url';
|
|
18
18
|
import 'is-installed-globally';
|
package/dist/client/200.html
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-nqz5coc9.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/
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/oqehn934.js">
|
|
7
7
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-gi2fewby.js">
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-fae7bffg.js">
|
|
9
9
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-bnvxb5wv.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="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
15
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
17
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
19
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
20
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-etxkwzb2.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-l6aaq3cv.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-liasomf8.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-lxpmsgjb.js">
|
|
15
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-gakauvtn.css">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-n2bv7ov9.js">
|
|
17
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-nt5emrt3.css">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-luh9fo24.js">
|
|
19
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/oqehn934.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},1736755758552,false]</script>
|
|
20
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"d3cc6080-b1af-4518-8c18-051df89d9c28",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/client/404.html
CHANGED
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-nqz5coc9.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/
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/oqehn934.js">
|
|
7
7
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-gi2fewby.js">
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-fae7bffg.js">
|
|
9
9
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-bnvxb5wv.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="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
15
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
17
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
19
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
20
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-etxkwzb2.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-l6aaq3cv.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-liasomf8.js">
|
|
14
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-lxpmsgjb.js">
|
|
15
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-gakauvtn.css">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-n2bv7ov9.js">
|
|
17
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-nt5emrt3.css">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-luh9fo24.js">
|
|
19
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/oqehn934.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},1736755758552,false]</script>
|
|
20
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"d3cc6080-b1af-4518-8c18-051df89d9c28",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{g as P,h as J,r as S,j as R,f as U,k as X,l as h,m as ee,n as ne,o as te,p as le,q as ie,s as oe,v as C,w as re,x as ue,y as se,d as ae}from"./oqehn934.js";import{_ as de}from"./filepath-item.vue-ldc0cd59.js";import{k as E,l as V,b as F,Q as i,S as u,U as e,F as p,ab as G,Y as j,a5 as v,W as x,u as c,a0 as d,$ as a,a6 as f,a8 as A,a9 as I,M as k}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as me}from"./ncode-block.vue-gy1ero5j.js";import{_ as pe}from"./ncheckbox.vue-ktnsaj70.js";import{_ as ve}from"./help-fab.vue-hhv95xvg.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./client-c9f80qsp.js";const fe={"h-full":"",grid:"~ rows-[max-content_1fr]"},ye={flex:"~ wrap","w-full":""},be=["onClick"],ce={key:0,flex:"~ col gap-4 items-center justify-center",p4:""},ge={grid:"~ cols-[30px_1fr] gap-x-2 gap-y-3 items-center justify-center","w-100":""},xe=E({__name:"BuildAnalyzeDetails",props:{current:{},prev:{}},setup(N){const y=N,$=`${J().app.baseURL}/__nuxt_devtools__/analyze/`.replace(/\/+/g,"/"),b=V(()=>{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=F(b.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 S.clearAnalyzeBuilds(await R(),[l])}return(l,n)=>{const D=de,B=U;return i(),u("div",fe,[e("div",ye,[(i(!0),u(p,null,G(b.value,(r,t)=>(i(),u("button",{key:t,px4:"",py2:"",border:"r base",hover:"bg-active",class:j(r.id===o.value.id?"":"border-b"),onClick:_=>o.value=r},[e("div",{class:j(r.id===o.value.id?"":"op30")},v(r.name),3)],10,be))),128)),n[1]||(n[1]=e("div",{border:"b base","flex-auto":""},null,-1))]),o.value.id==="overview"?(i(),u("div",ce,[n[15]||(n[15]=e("div",{"flex-auto":""},null,-1)),e("div",ge,[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)):x("",!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)):x("",!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(c(P)(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(D,{filepath:l.current.analyzeDir},null,8,["filepath"])])]),n[16]||(n[16]=e("div",{"flex-auto":""},null,-1)),d(B,{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})])):x("",!0),n._lazyshow1||o.value.id==="bundle-client"?(n._lazyshow1=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/client.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-client"]])],64)):x("v-show-if",!0),n._lazyshow2||o.value.id==="bundle-nitro"?(n._lazyshow2=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/nitro.html`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="bundle-nitro"]])],64)):x("v-show-if",!0),n._lazyshow3||o.value.id==="vite-inspect"?(n._lazyshow3=!0,i(),u(p,null,[A(e("iframe",{src:`${c($)}${l.current.slug}/.vite-inspect/`,"h-full":"","w-full":""},null,8,["src"]),[[I,o.value.id==="vite-inspect"]])],64)):x("v-show-if",!0)])}}}),we={class:"markdown-body"},$e={__name:"analyze-build",setup(N,{expose:y}){return y({frontmatter:{}}),($,b)=>(i(),u("div",we,b[0]||(b[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"],ke={flex:"~ gap-1 items-center wrap","w-full":"","text-sm":"",op60:""},Be={flex:"~ items-center justify-center wrap",p4:""},Ce={flex:"~ col gap-1","w-250":"",p4:""},Ne={flex:"~ gap-3",mt2:"","justify-end":""},Re=E({__name:"analyze-build",setup(N){const y=X(),w=h(),$=ee(),b=ne("analyze-build:slug",""),o=V(()=>w.value?.builds.find(r=>r.slug===b.value)??w.value?.builds[0]),z=F(!1),m=F(""),T=V(()=>w.value?.builds.some(r=>r.name===m.value.trim()));async function l(){m.value=await S.generateAnalyzeBuildName(),await y.start()&&(oe("analyze-build:start"),C.value={name:m.value,processId:await S.startAnalyzeBuild(await R(),m.value)},z.value&&B())}const n=te();function D(r){return`${((r.endTime-r.startTime)/1e3).toFixed(1)}s`}function B(){C.value?.processId&&(n.value=C.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 _=U,L=xe,M=ae,O=ie,W=re,Y=ue,q=me,H=pe,K=se,Q=$e,Z=ve;return i(),u(p,null,[d(O,{"left-size":30},{left:a(()=>[e("div",ze,[(i(!0),u(p,null,G(c(w)?.builds,s=>(i(),u(p,{key:s.slug},[e("button",{flex:"~ col gap1","hover:bg-active":"",p3:"",class:j(s.slug===o.value?.slug?"text-primary bg-active":""),onClick:g=>b.value=s.slug},[e("code",null,v(s.name),1),e("div",ke,[t[4]||(t[4]=e("div",{"i-carbon-time":""},null,-1)),e("span",null,v(D(s)),1),t[5]||(t[5]=e("div",{"flex-auto":""},null,-1)),e("span",null,v(c(P)(new Date(s.endTime))),1)])],10,_e),t[6]||(t[6]=e("div",{"x-divider":""},null,-1))],64))),128)),e("div",Be,[c(C)?(i(),k(_,{key:1,n:"primary",icon:"carbon-circle-dash animate-spin",onClick:t[1]||(t[1]=s=>B())},{default:a(()=>t[8]||(t[8]=[f(" Building... ")])),_:1})):(i(),k(_,{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(),k(L,{key:0,current:o.value},null,8,["current"])):(i(),k(M,{key:1}))]),_:1}),d(c(y),null,{default:a(({resolve:s})=>[d(K,{"model-value":!0,onClose:g=>s(!1)},{default:a(()=>[e("div",Ce,[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]=g=>m.value=g),placeholder:"Build name"},null,8,["modelValue"]),T.value?(i(),k(Y,{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})):x("",!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(q,{code:`npx nuxi analyze --no-serve --name=${m.value}`,lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),d(H,{modelValue:z.value,"onUpdate:modelValue":t[3]||(t[3]=g=>z.value=g),mt2:"",n:"primary"},{default:a(()=>t[10]||(t[10]=[f(" Navigate to terminal ")])),_:1},8,["modelValue"]),e("div",Ne,[d(_,{onClick:g=>s(!1)},{default:a(()=>t[11]||(t[11]=[f(" Cancel ")])),_:2},1032,["onClick"]),d(_,{n:"solid primary",onClick:g=>s(!0)},{default:a(()=>t[12]||(t[12]=[f(" Start ")])),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1}),d(Z,null,{default:a(()=>[d(Q)]),_:1})],64)}}});export{Re as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{
|
|
1
|
+
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 ne,w as se,F as ve,G as fe,H as le,I as ge,J as he,K as xe,L as be,y as we,M as ye,N as _e,O as $e,c as ke,P as Ce}from"./oqehn934.js";import{_ as Ve}from"./ncheckbox.vue-ktnsaj70.js";import{_ as Pe}from"./ndropdown.vue-c5jsbp5v.js";import{_ as Ae}from"./nnavbar.vue-f0vufq5s.js";import{k as q,b as j,ae as oe,S as i,a8 as K,a0 as d,U as t,a6 as D,F as L,ab as Z,M as V,$ as h,W as S,Y as J,u as m,Q as o,l as U,X as ae,a5 as F,V as De,y as Fe,Z as Ne,al as Se}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as Ue}from"./nsection-block-lalufadl.js";import{_ as Ie}from"./filepath-item.vue-ldc0cd59.js";import{_ as je}from"./code-snippets.vue-hvapgodh.js";import{_ as Te}from"./ndrawer.vue-oeawm3h0.js";import{D as Be}from"./constants-b32h69zq.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";import"./nicon-title.vue-ouqsubn7.js";import"./ncode-block.vue-gy1ero5j.js";import"./client-c9f80qsp.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":""},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(z){const l=z,f=ee(l,"modelValue"),C=j(),n=j([]);function v(s){C.value=s.target,f.value=!0}function b(s){s.target===C.value&&(f.value=!1)}function T(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=[],y=n.value.map(u=>u.name);for(const u of c)if(y.includes(u.name)){let A=1;const[_,E]=u.name.split(".");for(;y.includes(`${_} (${A}).${E}`);)A++;const R=`${_}-${A}.${E}`,a=new Blob([u],{type:u.type}),e=new File([a],R,{lastModified:Date.now()});g.push(e),y.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 G(s){n.value?.splice(s,1)}function O(s){return URL.createObjectURL(s)}function w(s,c){const[g,y]=s.name.split("."),u=c.replace(/\.\w+$/,""),A=`${u}.${y}`;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",T),H("drop",P),(s,c)=>{const g=te,y=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,Z(n.value,(_,E)=>(o(),i("div",{key:_.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(_)},null,8,Re)]),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(g,{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(),V(g,{key:0,n:"red",onClick:r},{default:h(()=>[d(y,{icon:"carbon-clean"}),c[2]||(c[2]=D(" Clear "))]),_:1})):S("",!0),d(g,{disabled:!n.value.length,n:"primary solid",onClick:B},{default:h(()=>[d(y,{icon:"carbon-cloud-upload"}),c[3]||(c[3]=D(" Upload "))]),_:1},8,["disabled"])])])):(o(),i("div",Ee,[t("label",ze,[d(y,{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]=_=>x(_.target.files))},null,32)]))],2)}}}),qe=q({__name:"AssetFontPreview",props:{asset:{}},setup(z){const l=z,f=U(()=>`devtools-assets-${ve(l.asset)}`);return fe(U(()=>`
|
|
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=q({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(z){return(l,f)=>{const C=qe;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=q({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(z){const l=z,f=U(()=>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":""})):S("",!0),d(b,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:C.asset},null,8,["asset"]),t("div",at,F(f.value),1)])}}}),re=q({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(z,{emit:l}){const f=z,n=ee(f,"modelValue",l,{passive:!0}),v=U(()=>f.item?.children?.length),b=j(!0),T=U(()=>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,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 + ${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(T.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":""})):S("",!0)],2),v.value?(o(),V(B,{key:0,icon:"carbon:chevron-right","transform-rotate":b.value?90:0,transition:""},null,8,["transform-rotate"])):S("",!0)],6),b.value?De(P.$slots,"default",{key:0},()=>[(o(!0),i(L,null,Z(P.item?.children,O=>(o(),V(G,{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))]):S("",!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:""},yt={flex:"~ gap2 wrap justify-center"},_t={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},$t={flex:"","justify-end":"","gap-4":""},kt=q({__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=j(!1),T=j(),P=j(0),x=le(async()=>{if(n.value.type!=="text")return;P.value;const a=await W.getTextAssetContent(await X(),n.value.filePath);return T.value=a,a});async function B(){if(x.value!==T.value)try{await W.writeStaticAssets(await X(),[{path:n.value.path,content:T.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 G=ge(),O=U(()=>(G.value?._installedModules||[]).some(e=>e.meta?.name==="@nuxt/image"||e.meta?.name==="@nuxt/image-edge"||e.meta?.name==="@nuxt/image-nightly")),w=U(()=>{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{y as ee,z as H,A as ce,B as pe,q as me,r as W,h as X,C as M,e as te,D 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=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 _=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],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=Te,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=>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),[[Se,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"])):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=Z({__name:"assets",setup(z){const l=ye(),f=T(!1),C=T(""),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)})),j=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=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,y=Ge,u=it,A=Ue,_=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})):S("",!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)):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},[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",St,[(o(!0),i(L,null,G($,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,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",It,[(o(!0),i(L,null,G(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=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};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"id":"
|
|
1
|
+
{"id":"d3cc6080-b1af-4518-8c18-051df89d9c28","timestamp":1736755720080}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"id":"d3cc6080-b1af-4518-8c18-051df89d9c28","timestamp":1736755720080,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as H}from"./ncode-block.vue-gy1ero5j.js";import{
|
|
1
|
+
import{_ as H}from"./ncode-block.vue-gy1ero5j.js";import{bb as P}from"./oqehn934.js";import{k as U,l as X,b as Y,x as j,Q as W,M as S}from"./vendor/json-editor-vue-gi2fewby.js";function g(){}g.prototype={diff:function(e,r){var t,u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=u.callback;typeof u=="function"&&(o=u,u={});var i=this;function f(v){return v=i.postProcess(v,u),o?(setTimeout(function(){o(v)},0),!0):v}e=this.castInput(e,u),r=this.castInput(r,u),e=this.removeEmpty(this.tokenize(e,u)),r=this.removeEmpty(this.tokenize(r,u));var l=r.length,s=e.length,a=1,c=l+s;u.maxEditLength!=null&&(c=Math.min(c,u.maxEditLength));var p=(t=u.timeout)!==null&&t!==void 0?t:1/0,d=Date.now()+p,m=[{oldPos:-1,lastComponent:void 0}],h=this.extractCommon(m[0],r,e,0,u);if(m[0].oldPos+1>=s&&h+1>=l)return f(F(i,m[0].lastComponent,r,e,i.useLongestToken));var y=-1/0,T=1/0;function x(){for(var v=Math.max(y,-a);v<=Math.min(T,a);v+=2){var C=void 0,w=m[v-1],E=m[v+1];w&&(m[v-1]=void 0);var _=!1;if(E){var M=E.oldPos-v;_=E&&0<=M&&M<l}var B=w&&w.oldPos+1<s;if(!_&&!B){m[v]=void 0;continue}if(!B||_&&w.oldPos<E.oldPos?C=i.addToPath(E,!0,!1,0,u):C=i.addToPath(w,!1,!0,1,u),h=i.extractCommon(C,r,e,v,u),C.oldPos+1>=s&&h+1>=l)return f(F(i,C.lastComponent,r,e,i.useLongestToken));m[v]=C,C.oldPos+1>=s&&(T=Math.min(T,v-1)),h+1>=l&&(y=Math.max(y,v+1))}a++}if(o)(function v(){setTimeout(function(){if(a>c||Date.now()>d)return o();x()||v()},0)})();else for(;a<=c&&Date.now()<=d;){var z=x();if(z)return z}},addToPath:function(e,r,t,u,o){var i=e.lastComponent;return i&&!o.oneChangePerToken&&i.added===r&&i.removed===t?{oldPos:e.oldPos+u,lastComponent:{count:i.count+1,added:r,removed:t,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+u,lastComponent:{count:1,added:r,removed:t,previousComponent:i}}},extractCommon:function(e,r,t,u,o){for(var i=r.length,f=t.length,l=e.oldPos,s=l-u,a=0;s+1<i&&l+1<f&&this.equals(t[l+1],r[s+1],o);)s++,l++,a++,o.oneChangePerToken&&(e.lastComponent={count:1,previousComponent:e.lastComponent,added:!1,removed:!1});return a&&!o.oneChangePerToken&&(e.lastComponent={count:a,previousComponent:e.lastComponent,added:!1,removed:!1}),e.oldPos=l,s},equals:function(e,r,t){return t.comparator?t.comparator(e,r):e===r||t.ignoreCase&&e.toLowerCase()===r.toLowerCase()},removeEmpty:function(e){for(var r=[],t=0;t<e.length;t++)e[t]&&r.push(e[t]);return r},castInput:function(e){return e},tokenize:function(e){return Array.from(e)},join:function(e){return e.join("")},postProcess:function(e){return e}};function F(n,e,r,t,u){for(var o=[],i;e;)o.push(e),i=e.previousComponent,delete e.previousComponent,e=i;o.reverse();for(var f=0,l=o.length,s=0,a=0;f<l;f++){var c=o[f];if(c.removed)c.value=n.join(t.slice(a,a+c.count)),a+=c.count;else{if(!c.added&&u){var p=r.slice(s,s+c.count);p=p.map(function(d,m){var h=t[a+m];return h.length>d.length?h:d}),c.value=n.join(p)}else c.value=n.join(r.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}return o}function V(n,e){var r;for(r=0;r<n.length&&r<e.length;r++)if(n[r]!=e[r])return n.slice(0,r);return n.slice(0,r)}function Q(n,e){var r;if(!n||!e||n[n.length-1]!=e[e.length-1])return"";for(r=0;r<n.length&&r<e.length;r++)if(n[n.length-(r+1)]!=e[e.length-(r+1)])return n.slice(-r);return n.slice(-r)}function q(n,e,r){if(n.slice(0,e.length)!=e)throw Error("string ".concat(JSON.stringify(n)," doesn't start with prefix ").concat(JSON.stringify(e),"; this is a bug"));return r+n.slice(e.length)}function N(n,e,r){if(!e)return n+r;if(n.slice(-e.length)!=e)throw Error("string ".concat(JSON.stringify(n)," doesn't end with suffix ").concat(JSON.stringify(e),"; this is a bug"));return n.slice(0,-e.length)+r}function L(n,e){return q(n,e,"")}function I(n,e){return N(n,e,"")}function Z(n,e){return e.slice(0,b(n,e))}function b(n,e){var r=0;n.length>e.length&&(r=n.length-e.length);var t=e.length;n.length<e.length&&(t=n.length);var u=Array(t),o=0;u[0]=0;for(var i=1;i<t;i++){for(e[i]==e[o]?u[i]=u[o]:u[i]=o;o>0&&e[i]!=e[o];)o=u[o];e[i]==e[o]&&o++}o=0;for(var f=r;f<n.length;f++){for(;o>0&&n[f]!=e[o];)o=u[o];n[f]==e[o]&&o++}return o}var O="a-zA-Z0-9_\\u{C0}-\\u{FF}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}",K=new RegExp("[".concat(O,"]+|\\s+|[^").concat(O,"]"),"ug"),k=new g;k.equals=function(n,e,r){return r.ignoreCase&&(n=n.toLowerCase(),e=e.toLowerCase()),n.trim()===e.trim()};k.tokenize=function(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r;if(e.intlSegmenter){if(e.intlSegmenter.resolvedOptions().granularity!="word")throw new Error('The segmenter passed must have a granularity of "word"');r=Array.from(e.intlSegmenter.segment(n),function(o){return o.segment})}else r=n.match(K)||[];var t=[],u=null;return r.forEach(function(o){/\s/.test(o)?u==null?t.push(o):t.push(t.pop()+o):/\s/.test(u)?t[t.length-1]==u?t.push(t.pop()+o):t.push(u+o):t.push(o),u=o}),t};k.join=function(n){return n.map(function(e,r){return r==0?e:e.replace(/^\s+/,"")}).join("")};k.postProcess=function(n,e){if(!n||e.oneChangePerToken)return n;var r=null,t=null,u=null;return n.forEach(function(o){o.added?t=o:o.removed?u=o:((t||u)&&G(r,u,t,o),r=o,t=null,u=null)}),(t||u)&&G(r,u,t,null),n};function G(n,e,r,t){if(e&&r){var u=e.value.match(/^\s*/)[0],o=e.value.match(/\s*$/)[0],i=r.value.match(/^\s*/)[0],f=r.value.match(/\s*$/)[0];if(n){var l=V(u,i);n.value=N(n.value,i,l),e.value=L(e.value,l),r.value=L(r.value,l)}if(t){var s=Q(o,f);t.value=q(t.value,f,s),e.value=I(e.value,s),r.value=I(r.value,s)}}else if(r)n&&(r.value=r.value.replace(/^\s*/,"")),t&&(t.value=t.value.replace(/^\s*/,""));else if(n&&t){var a=t.value.match(/^\s*/)[0],c=e.value.match(/^\s*/)[0],p=e.value.match(/\s*$/)[0],d=V(a,c);e.value=L(e.value,d);var m=Q(L(a,d),p);e.value=I(e.value,m),t.value=q(t.value,a,m),n.value=N(n.value,a,a.slice(0,a.length-m.length))}else if(t){var h=t.value.match(/^\s*/)[0],y=e.value.match(/\s*$/)[0],T=Z(y,h);e.value=I(e.value,T)}else if(n){var x=n.value.match(/\s*$/)[0],z=e.value.match(/^\s*/)[0],v=Z(x,z);e.value=L(e.value,v)}}var ee=new g;ee.tokenize=function(n){var e=new RegExp("(\\r?\\n)|[".concat(O,"]+|[^\\S\\n\\r]+|[^").concat(O,"]"),"ug");return n.match(e)||[]};var $=new g;$.tokenize=function(n,e){e.stripTrailingCr&&(n=n.replace(/\r\n/g,`
|
|
2
2
|
`));var r=[],t=n.split(/(\n|\r\n)/);t[t.length-1]||t.pop();for(var u=0;u<t.length;u++){var o=t[u];u%2&&!e.newlineIsToken?r[r.length-1]+=o:r.push(o)}return r};$.equals=function(n,e,r){return r.ignoreWhitespace?((!r.newlineIsToken||!n.includes(`
|
|
3
3
|
`))&&(n=n.trim()),(!r.newlineIsToken||!e.includes(`
|
|
4
4
|
`))&&(e=e.trim())):r.ignoreNewlineAtEof&&!r.newlineIsToken&&(n.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as g}from"./ncode-block.vue-gy1ero5j.js";import{
|
|
1
|
+
import{_ as g}from"./ncode-block.vue-gy1ero5j.js";import{J as C,f as S}from"./oqehn934.js";import{k as w,j as x,l as B,w as N,Q as a,S as n,U as s,F as d,ab as $,Y as i,a5 as V,a0 as u,$ as v,a6 as m,u as T,M as h,W as r}from"./vendor/json-editor-vue-gi2fewby.js";const D={key:0,relative:"","n-code-block":""},E={flex:"~ wrap","w-full":""},F=["onClick"],L={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},Q=w({__name:"CodeSnippets",props:{codeSnippets:{},eventType:{}},setup(f){const l=f,e=x(l.codeSnippets[0]),_=C(),b=B(()=>e.value?.lang||"text");return N(()=>{l.codeSnippets.includes(e.value)||(e.value=l.codeSnippets[0])}),(p,o)=>{const k=g,c=S;return p.codeSnippets.length?(a(),n("div",D,[s("div",E,[(a(!0),n(d,null,$(p.codeSnippets,(t,y)=>(a(),n("button",{key:y,px4:"",py2:"",border:"r base",hover:"bg-active",class:i(t===e.value?"":"border-b"),onClick:j=>e.value=t},[s("div",{class:i(t===e.value?"":"op30"),"font-mono":""},V(t.name),3)],10,F))),128)),o[1]||(o[1]=s("div",{border:"b base","flex-auto":""},null,-1))]),e.value?(a(),n(d,{key:0},[u(k,{code:e.value.code,lang:b.value,lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),s("div",L,[u(c,{icon:"carbon-copy",onClick:o[0]||(o[0]=t=>T(_)(e.value.code,p.eventType||`code-snippet-${e.value.name}`))},{default:v(()=>o[2]||(o[2]=[m(" Copy ")])),_:1}),e.value?.docs?(a(),h(c,{key:0,to:e.value.docs,target:"_blank",icon:"carbon-catalog"},{default:v(()=>o[3]||(o[3]=[m(" Docs ")])),_:1},8,["to"])):r("",!0)])],64)):r("",!0)])):r("",!0)}}});export{Q as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{I as ie,e as X,P as pe,Q as re,H as ue,R as de,b as J,S as me,T as ce,U as fe,M as ve,V as _e,W as he,D as be,X as ge}from"./b6bfxrb8.js";import{Q as t,S as _,U as n,k as R,l as S,a6 as Q,a5 as W,a0 as v,u as N,M as x,W as k,F as M,ab as B,V as H,b as L,j as ye,x as we,c as xe,$ as b,y as A,R as ke,Y as Ce,a1 as z,ae as $e,a7 as Ne,a8 as Y}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as Ve}from"./help-fab.vue-gtlaa6k2.js";import{_ as Se}from"./ncheckbox.vue-fs1yhvat.js";import{_ as K}from"./nnavbar.vue-d5x8tq5w.js";import{_ as Z}from"./nbadge-fktngirm.js";import{_ as ee}from"./filepath-item.vue-b829sn9l.js";import{_ as Pe}from"./ndrawer.vue-cjxfdzsk.js";import{N as De}from"./vendor/vis-dlwijd5n.js";import{_ as Me}from"./nselect-tabs.vue-sw71szzx.js";import{_ as Te}from"./nsection-block-ivkmhmn9.js";import{_ as Ue}from"./nicon-title.vue-ouqsubn7.js";import{D as O}from"./constants-b32h69zq.js";import{u as Be,a as Le}from"./state-components-f29eyhzi.js";import"./vendor/unocss-3uirpnla.js";import"./vendor/shiki-bnvxb5wv.js";const Re={class:"markdown-body"},Ie={__name:"components",setup(r,{expose:s}){return s({frontmatter:{}}),(a,i)=>(t(),_("div",Re,i[0]||(i[0]=[n("h1",null,"Components",-1),n("p",null,"Vue Components allow us to split the UI into independent and reusable pieces, and think about each piece in isolation. This is very similar to how we nest native HTML elements, but Vue implements its own component model that allow us to encapsulate custom content and logic in each component.",-1),n("p",null,"Components placed in the components/ directory are automatically registered by Nuxt. They can be used in your templates without importing them.",-1),n("p",null,[n("a",{href:"https://nuxt.com/docs/guide/directory-structure/components",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1)])))}},Fe=/\d/,Ge=["-","_","/","."];function Ae(r=""){if(!Fe.test(r))return r!==r.toLowerCase()}function Ee(r,s){const m=Ge,a=[];if(!r||typeof r!="string")return a;let i="",o,p;for(const c of r){const u=m.includes(c);if(u===!0){a.push(i),i="",o=void 0;continue}const f=Ae(c);if(p===!1){if(o===!1&&f===!0){a.push(i),i=c,o=f;continue}if(o===!0&&f===!1&&i.length>1){const g=i.at(-1);a.push(i.slice(0,Math.max(0,i.length-1))),i=g+c,o=f;continue}}i+=c,o=f,p=u}return a.push(i),a}function ze(r){return r?r[0].toUpperCase()+r.slice(1):""}function ne(r,s){return r?(Array.isArray(r)?r:Ee(r)).map(m=>ze(m)).join(""):""}const We={"text-sm":"","font-mono":""},oe=R({__name:"ComponentName",props:{component:{}},setup(r){const s=r,m=S(()=>s.component.pascalName||ne(s.component.name||s.component.__name||s.component.kebabName||""));return(a,i)=>(t(),_("code",We,[i[0]||(i[0]=n("span",{mr1:"",op20:""},"<",-1)),Q(W(m.value),1),i[1]||(i[1]=n("span",{ml1:"",op20:""},"/>",-1))]))}}),He={flex:"~ col gap1","items-start":"","of-hidden":""},je={flex:"~ gap2",px3:""},Oe={px3:"",pb2:""},Qe={key:0,border:"t base","max-h-60":"","w-full":"","of-auto":"",px3:"",py3:""},Xe={"text-sm":""},qe={"text-primary":""},Ye={key:0,flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},Je={key:1,border:"t base","max-h-60":"","w-full":"","of-auto":"",px3:"",py3:""},Ke={"text-sm":""},Ze={"text-primary":""},en={key:0,flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},te=R({__name:"ComponentDetails",props:{component:{},dependencies:{},dependents:{}},setup(r){const s=r,m=S(()=>s.component.pascalName||ne(s.component.name||s.component.__name||s.component.kebabName||"")),a=S(()=>s.component.filePath||s.component.file||s.component.__file||""),i=ie();return(o,p)=>{const c=oe,u=X,f=Z,g=ee;return t(),_("div",He,[n("div",je,[v(c,{component:o.component},null,8,["component"]),v(u,{title:"Copy name","flex-none":"",icon:"carbon-copy",border:!1,onClick:p[0]||(p[0]=h=>N(i)(`<${m.value}></${m.value}>`,"component-name"))}),o.component.global?(t(),x(f,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"runtime"})):k("",!0)]),n("div",Oe,[a.value?(t(),x(g,{key:0,filepath:a.value,"w-full":"","text-sm":"",op40:"","group-hover:op75":""},null,8,["filepath"])):k("",!0)]),o.dependents?(t(),_("div",Qe,[n("div",Xe,[n("strong",qe,W(o.dependents.length),1),p[1]||(p[1]=n("span",{op50:""}," references",-1))]),o.dependents.length?(t(),_("div",Ye,[(t(!0),_(M,null,B(o.dependents,h=>(t(),x(g,{key:h,filepath:h},null,8,["filepath"]))),128))])):k("",!0)])):k("",!0),o.dependencies?(t(),_("div",Je,[n("div",Ke,[n("strong",Ze,W(o.dependencies.length),1),p[2]||(p[2]=n("span",{op50:""}," dependencies",-1))]),o.dependencies.length?(t(),_("div",en,[(t(!0),_(M,null,B(o.dependencies,h=>(t(),x(g,{key:h,filepath:h},null,8,["filepath"]))),128))])):k("",!0)])):k("",!0),H(o.$slots,"default")])}}}),nn={flex:"~ gap-x-3 gap-y-1 wrap","w-full":""},on={relative:"","h-full":"","w-full":""},tn={key:0,py4:"",pt4:"",flex:"~ col"},sn={border:"t base",p4:""},ln=R({__name:"ComponentsGraph",props:{components:{},relationships:{}},setup(r){const s=r,m=L(),a=L(),i=pe(),o=ye(),p=re(),c=ue(),u=de(),{componentsGraphShowNodeModules:f,componentsGraphShowGlobalComponents:g,componentsGraphShowPages:h,componentsGraphShowLayouts:V,componentsGraphShowWorkspace:y}=J("ui"),C=L(),d=L(""),I=me(d,300),F=S(()=>{const P=s.relationships||[];if(C.value){let e=function($){!$||l.has($)||(l.add($),$.deps.forEach(T=>{e(P.find(U=>U.id===T))}))};const l=new Set;return e(C.value),Array.from(l)}return P}),E=S(()=>{const P=F.value.map(l=>{const $=s.components.find(G=>G.filePath===l.id),T=p.value?.find(G=>G.file===l.id),U=u.value?.find(G=>G.file===l.id),j=l.id.replace(/\?.*$/,"").replace(/#.*$/,""),D=l.id.includes("/node_modules/")?"lib":$?$.global?"global":"user":U?"layout":T?"page":"unknown";if(!f.value&&D==="lib"||!h.value&&D==="page"||!V.value&&D==="layout"||!y.value&&D==="user"&&c.value&&!l.id.startsWith(c.value.rootDir)||!g.value&&D==="global")return null;const w=D==="layout"?"hexagon":D==="page"?"square":"dot",q=I.value&&!l.id.toLowerCase().includes(I.value.toLowerCase());return{id:l.id,label:j.split("/").splice(-1)[0].replace(/\.\w+$/,""),group:D,shape:w,size:15+Math.min(l.deps.length/2,8),font:{color:q?"#8885":i.value==="dark"?"white":"black"},color:q?"#8885":C.value?.id===l.id?"#82c742":void 0,extra:{id:l.id,component:$,page:T,layout:U,relationship:l}}}).filter(l=>!!l),e=F.value.flatMap(l=>l.deps.map($=>({from:l.id,to:$,arrows:{to:{enabled:!0,scaleFactor:.8}}})));return{nodes:P,edges:e}}),se=S(()=>o.value?.component?s.relationships?.find(e=>e.id===o.value?.component?.filePath)?.deps?.map(e=>s.relationships?.find(l=>l.id===e)?.id).filter(Boolean):[]),le=S(()=>o.value?.component?s.relationships?.filter(e=>e.deps.includes(o.value.component.filePath))?.map(e=>s.relationships?.find(l=>l.id===e.id)?.id).filter(Boolean):[]);we(()=>{const P={nodes:{shape:"dot",size:16},physics:{repulsion:{centralGravity:.7,springLength:100,springConstant:.01},maxVelocity:146,solver:"forceAtlas2Based",timestep:.35,stabilization:{enabled:!0,iterations:200}},groups:{user:{color:"#42b883"},unknown:{color:"#b86542"},lib:{color:"#b4b842"},page:{color:"#42b2b8"},layout:{color:"#4256b8"}}},e=new De(m.value,E.value,P);e.on("click",l=>{const $=l.nodes?.[0],T=E.value.nodes?.find(U=>U.id===$)?.extra;T&&(o.value=T)}),xe(E,()=>{e.setData(E.value)})});function ae(){C.value=o.value?.relationship,o.value=void 0}return(P,e)=>{const l=Se,$=K,T=ce,U=te,j=X,D=Pe;return t(),_(M,null,[v($,{ref_key:"navbar",ref:a,search:d.value,"onUpdate:search":e[6]||(e[6]=w=>d.value=w),absolute:"","left-0":"","right-0":"","top-0":""},{actions:b(()=>[n("div",nn,[v(l,{modelValue:N(h),"onUpdate:modelValue":e[0]||(e[0]=w=>A(h)?h.value=w:null),n:"primary sm"},{default:b(()=>e[9]||(e[9]=[n("span",{op75:""},"Show pages",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(V),"onUpdate:modelValue":e[1]||(e[1]=w=>A(V)?V.value=w:null),n:"primary sm"},{default:b(()=>e[10]||(e[10]=[n("span",{op75:""},"Show layouts",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(y),"onUpdate:modelValue":e[2]||(e[2]=w=>A(y)?y.value=w:null),n:"primary sm"},{default:b(()=>e[11]||(e[11]=[n("span",{op75:""},"Show workspace",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(f),"onUpdate:modelValue":e[3]||(e[3]=w=>A(f)?f.value=w:null),n:"primary sm"},{default:b(()=>e[12]||(e[12]=[n("span",{op75:""},"Show node_modules",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(g),"onUpdate:modelValue":e[4]||(e[4]=w=>A(g)?g.value=w:null),n:"primary sm"},{default:b(()=>e[13]||(e[13]=[n("span",{op75:""},"Show global components",-1)])),_:1},8,["modelValue"])]),C.value?(t(),_("button",{key:0,flex:"~ gap-1","flex-none":"","items-center":"","rounded-full":"","bg-gray:20":"",py1:"",pl3:"",pr2:"","text-xs":"",op50:"","hover:op100":"",onClick:e[5]||(e[5]=w=>C.value=void 0)},e[14]||(e[14]=[Q(" Clear filter "),n("div",{"i-carbon-close":""},null,-1)]))):k("",!0),e[15]||(e[15]=n("div",{"flex-auto":""},null,-1)),H(P.$slots,"default")]),_:3},8,["search"]),n("div",on,[n("div",{ref_key:"container",ref:m,"h-full":"","w-full":""},null,512),v(T,{absolute:"","bottom-3":"","left-3":"","border-0":"",p2:"",px3:"","text-sm":"","n-glass-effect":""},{default:b(()=>e[16]||(e[16]=[n("div",{grid:"~ cols-[20px_1fr] items-center gap-y-1"},[n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-42b883":""}),n("div",{op50:""}," Component "),n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-97c2fc":""}),n("div",{op50:""}," Global Component "),n("div",{"h-3":"","w-3":"","bg-hex-42b2b8":""}),n("div",{op50:""}," Page "),n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 726 628","ml--1px":"","h-3":""},[n("path",{fill:"#4256b8","stroke-width":"4",d:"M723 314 543 625.8H183L3 314 183 2.2h360L723 314z"})]),n("div",{op50:""}," Layout "),n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b4b842":""}),n("div",{op50:""}," Library Component "),n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b86542":""}),n("div",{op50:""}," Unknown ")],-1)])),_:1}),v(D,{"model-value":!!(o.value&&o.value.component),top:a.value,border:"t l base","w-80":"",onClose:e[8]||(e[8]=w=>o.value=void 0)},{default:b(()=>[o.value&&o.value.component?(t(),_("div",tn,[v(U,{component:o.value.component,dependencies:se.value,dependents:le.value},null,8,["component","dependencies","dependents"]),n("div",sn,[v(j,{n:"primary solid",onClick:e[7]||(e[7]=w=>ae())},{default:b(()=>e[17]||(e[17]=[Q(" Filter to this component ")])),_:1})])])):k("",!0)]),_:1},8,["model-value","top"])])],64)}}}),an={hover:"bg-active",class:"group",flex:"~ gap2","w-full":"","items-center":"",rounded:"",px2:"",py1:""},pn={key:0,"ml--1":"","text-primary":""},rn=R({__name:"ComponentItem",props:{component:{},dependencies:{},dependents:{}},setup(r){const s=r,m=S(()=>s.component.filePath||s.component.file||s.component.__file||"");return(a,i)=>{const o=oe,p=te,c=ke("VDropdown"),u=Z,f=ee;return t(),_("div",an,[v(c,null,{popper:b(()=>[v(p,{component:a.component,dependencies:a.dependencies,dependents:a.dependents,"w-100":"",pt4:""},null,8,["component","dependencies","dependents"])]),default:b(()=>[n("button",{"hover:text-primary":"",class:Ce(a.dependents&&a.dependents.length===0?"op50":"")},[v(o,{component:a.component},null,8,["component"])],2)]),_:1}),a.dependents?.length?(t(),_("sup",pn," x"+W(a.dependents?.length),1)):k("",!0),a.component.global?(t(),x(u,{key:1,n:"green",title:"Registered at runtime as a global component",textContent:"runtime"})):k("",!0),H(a.$slots,"default"),m.value?(t(),x(f,{key:2,filepath:m.value,"text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):k("",!0)])}}}),un={flex:"~ gap-2 items-center"},dn={pl4:""},mn=R({__name:"ComponentsList",props:{components:{},relationships:{}},setup(r){const s=r,m=L(""),a=L("all"),i=S(()=>{const c=s.components.map(u=>fe(u,s.relationships));return a.value==="using"?c.filter(u=>u.dependents?.length):a.value==="not-used"?c.filter(u=>!u.dependents?.length):c}),o=S(()=>new ve(i.value,{keys:["component.pascalName","component.filePath","component.kebabName"]})),p=S(()=>{const c=[],u=new Map,f=[],g=[],h={user:0,lib:0,builtin:0,runtime:0};return(m.value?o.value.search(m.value).map(y=>y.item):i.value).forEach(y=>{const C=y.component;if(C.filePath&&_e(C.filePath)){const d=he(C.filePath);if(!d)return;d==="nuxt"?(f.push(y),h.builtin++):(u.has(d)||u.set(d,[]),u.get(d).push(y),h.lib++)}else C.global&&!C.filePath?(g.push(y),h.runtime++):(c.push(y),h.user++)}),{count:h,user:c,builtin:f,lib:u,runtime:g}});return(c,u)=>{const f=be,g=Me,h=K,V=rn,y=Te,C=Ue;return t(),_(M,null,[v(h,{search:m.value,"onUpdate:search":u[1]||(u[1]=d=>m.value=d),pb3:""},{actions:b(()=>[H(c.$slots,"default")]),default:b(()=>[n("div",un,[v(f,{icon:"carbon-filter",op50:""}),v(g,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),n:"primary sm",options:[{label:"All",value:"all"},{label:"Using",value:"using"},{label:"Not used",value:"not-used"}]},null,8,["modelValue"])])]),_:3},8,["search"]),p.value.user.length?(t(),x(y,{key:0,icon:"carbon-nominal",text:"User components",open:p.value.user.length<=N(O),description:`Total components: ${p.value.count.user}`},{default:b(()=>[(t(!0),_(M,null,B(p.value.user,d=>(t(),x(V,z({key:d.component.filePath,ref_for:!0},d),null,16))),128))]),_:1},8,["open","description"])):k("",!0),p.value.runtime.length?(t(),x(y,{key:1,icon:"carbon-load-balancer-global",open:p.value.runtime.length<=N(O),text:"Runtime components",description:`Total components: ${p.value.count.runtime}`},{default:b(()=>[(t(!0),_(M,null,B(p.value.runtime,d=>(t(),x(V,z({key:d.component.filePath,ref_for:!0},d),null,16))),128))]),_:1},8,["open","description"])):k("",!0),p.value.builtin.length?(t(),x(y,{key:2,icon:"simple-icons-nuxtdotjs",text:"Built-in components",description:`Total components: ${p.value.count.builtin}`},{default:b(()=>[(t(!0),_(M,null,B(p.value.builtin,d=>(t(),x(V,z({key:d.component.filePath,ref_for:!0},d),null,16))),128))]),_:1},8,["description"])):k("",!0),p.value.lib.size?(t(),x(y,{key:3,open:p.value.count.lib<=N(O),icon:"carbon-3d-mpr-toggle",text:"Components from libraries",description:`${p.value.count.lib} components from ${p.value.lib.size} packages`},{default:b(()=>[(t(!0),_(M,null,B(p.value.lib.entries(),([d,I])=>(t(),_("div",{key:d,"ml-2":""},[v(C,{text:`${d} (${I.length})`,py1:"",op50:""},null,8,["text"]),n("div",dn,[(t(!0),_(M,null,B(I,F=>(t(),x(V,z({key:F.component.filePath,ref_for:!0},F),null,16))),128))])]))),128))]),_:1},8,["open","description"])):k("",!0)],64)}}}),cn={relative:"","h-full":"","of-auto":""},fn={"flex-none":"",flex:"~ gap3"},Mn=R({__name:"components",setup(r){const s=ge(),m=Be(),a=Le(),{componentsView:i}=J("ui");function o(){s.value?.inspector?.instance&&s.value.inspector.enable()}function p(){i.value=i.value==="list"?"graph":"list"}return(c,u)=>{const f=X,g=Ie,h=Ve,V=$e("tooltip");return t(),_(M,null,[n("div",cn,[(t(),x(Ne(N(i)==="list"?mn:ln),{components:N(m),relationships:N(a)},{default:b(()=>[n("div",fn,[Y(v(f,{"text-lg":"",border:!1,icon:N(i)==="graph"?"i-carbon-list":"i-carbon-network-4",title:"Toggle view",onClick:p},null,8,["icon"]),[[V,"Toggle View",void 0,{"bottom-end":!0}]]),N(s)?.inspector?.instance?Y((t(),x(f,{key:0,"text-lg":"",border:!1,icon:"i-tabler-focus-2",title:"Inspect Vue components",onClick:o},null,512)),[[V,"Inspect Vue components",void 0,{"bottom-end":!0}]]):k("",!0)])]),_:1},8,["components","relationships"]))]),v(h,null,{default:b(()=>[v(g)]),_:1})],64)}}});export{Mn as default};
|
|
1
|
+
import{J as ie,f as X,Q as pe,R as re,I as ue,S as de,c as Y,T as ce,U as me,V as fe,N as ve,W as _e,X as he,E as be,b as ge}from"./oqehn934.js";import{Q as t,S as _,U as n,k as R,l as S,a6 as Q,a5 as W,a0 as v,u as N,M as x,W as k,F as T,ab as B,V as H,b as L,j as ye,x as we,c as xe,$ as b,y as E,R as ke,Y as Ce,a1 as z,ae as $e,a7 as Ne,a8 as J}from"./vendor/json-editor-vue-gi2fewby.js";import{_ as Ve}from"./help-fab.vue-hhv95xvg.js";import{_ as Se}from"./ncheckbox.vue-ktnsaj70.js";import{_ as K}from"./nnavbar.vue-f0vufq5s.js";import{_ as Z}from"./nbadge-ixgsh96g.js";import{_ as ee}from"./filepath-item.vue-ldc0cd59.js";import{_ as Pe}from"./ndrawer.vue-oeawm3h0.js";import{N as De}from"./vendor/vis-dlwijd5n.js";import{_ as Te}from"./nselect-tabs.vue-kz2aw76p.js";import{_ as Ue}from"./nsection-block-lalufadl.js";import{_ as Me}from"./nicon-title.vue-ouqsubn7.js";import{D as O}from"./constants-b32h69zq.js";import{u as Be,a as Le}from"./state-components-h4h7ppgm.js";import"./vendor/unocss-fae7bffg.js";import"./vendor/shiki-bnvxb5wv.js";const Re={class:"markdown-body"},Ie={__name:"components",setup(r,{expose:s}){return s({frontmatter:{}}),(a,i)=>(t(),_("div",Re,i[0]||(i[0]=[n("h1",null,"Components",-1),n("p",null,"Vue Components allow us to split the UI into independent and reusable pieces, and think about each piece in isolation. This is very similar to how we nest native HTML elements, but Vue implements its own component model that allow us to encapsulate custom content and logic in each component.",-1),n("p",null,"Components placed in the components/ directory are automatically registered by Nuxt. They can be used in your templates without importing them.",-1),n("p",null,[n("a",{href:"https://nuxt.com/docs/guide/directory-structure/components",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1)])))}},Fe=/\d/,Ge=["-","_","/","."];function Ee(r=""){if(!Fe.test(r))return r!==r.toLowerCase()}function Ae(r,s){const c=Ge,a=[];if(!r||typeof r!="string")return a;let i="",o,p;for(const m of r){const u=c.includes(m);if(u===!0){a.push(i),i="",o=void 0;continue}const f=Ee(m);if(p===!1){if(o===!1&&f===!0){a.push(i),i=m,o=f;continue}if(o===!0&&f===!1&&i.length>1){const g=i.at(-1);a.push(i.slice(0,Math.max(0,i.length-1))),i=g+m,o=f;continue}}i+=m,o=f,p=u}return a.push(i),a}function ze(r){return r?r[0].toUpperCase()+r.slice(1):""}function ne(r,s){return r?(Array.isArray(r)?r:Ae(r)).map(c=>ze(c)).join(""):""}const We={"text-sm":"","font-mono":""},oe=R({__name:"ComponentName",props:{component:{}},setup(r){const s=r,c=S(()=>s.component.pascalName||ne(s.component.name||s.component.__name||s.component.kebabName||""));return(a,i)=>(t(),_("code",We,[i[0]||(i[0]=n("span",{mr1:"",op20:""},"<",-1)),Q(W(c.value),1),i[1]||(i[1]=n("span",{ml1:"",op20:""},"/>",-1))]))}}),He={flex:"~ col gap1","items-start":"","of-hidden":""},je={flex:"~ gap2",px3:""},Oe={px3:"",pb2:""},Qe={key:0,border:"t base","max-h-60":"","w-full":"","of-auto":"",px3:"",py3:""},Xe={"text-sm":""},qe={"text-primary":""},Je={key:0,flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},Ye={key:1,border:"t base","max-h-60":"","w-full":"","of-auto":"",px3:"",py3:""},Ke={"text-sm":""},Ze={"text-primary":""},en={key:0,flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},te=R({__name:"ComponentDetails",props:{component:{},dependencies:{},dependents:{}},setup(r){const s=r,c=S(()=>s.component.pascalName||ne(s.component.name||s.component.__name||s.component.kebabName||"")),a=S(()=>s.component.filePath||s.component.file||s.component.__file||""),i=ie();return(o,p)=>{const m=oe,u=X,f=Z,g=ee;return t(),_("div",He,[n("div",je,[v(m,{component:o.component},null,8,["component"]),v(u,{title:"Copy name","flex-none":"",icon:"carbon-copy",border:!1,onClick:p[0]||(p[0]=h=>N(i)(`<${c.value}></${c.value}>`,"component-name"))}),o.component.global?(t(),x(f,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"runtime"})):k("",!0)]),n("div",Oe,[a.value?(t(),x(g,{key:0,filepath:a.value,"w-full":"","text-sm":"",op40:"","group-hover:op75":""},null,8,["filepath"])):k("",!0)]),o.dependents?(t(),_("div",Qe,[n("div",Xe,[n("strong",qe,W(o.dependents.length),1),p[1]||(p[1]=n("span",{op50:""}," references",-1))]),o.dependents.length?(t(),_("div",Je,[(t(!0),_(T,null,B(o.dependents,h=>(t(),x(g,{key:h,filepath:h},null,8,["filepath"]))),128))])):k("",!0)])):k("",!0),o.dependencies?(t(),_("div",Ye,[n("div",Ke,[n("strong",Ze,W(o.dependencies.length),1),p[2]||(p[2]=n("span",{op50:""}," dependencies",-1))]),o.dependencies.length?(t(),_("div",en,[(t(!0),_(T,null,B(o.dependencies,h=>(t(),x(g,{key:h,filepath:h},null,8,["filepath"]))),128))])):k("",!0)])):k("",!0),H(o.$slots,"default")])}}}),nn={flex:"~ gap-x-3 gap-y-1 wrap","w-full":""},on={relative:"","h-full":"","w-full":""},tn={key:0,py4:"",pt4:"",flex:"~ col"},sn={border:"t base",p4:""},ln=R({__name:"ComponentsGraph",props:{components:{},relationships:{}},setup(r){const s=r,c=L(),a=L(),i=pe(),o=ye(),p=re(),m=ue(),u=de(),{componentsGraphShowNodeModules:f,componentsGraphShowGlobalComponents:g,componentsGraphShowPages:h,componentsGraphShowLayouts:V,componentsGraphShowWorkspace:y}=Y("ui"),C=L(),d=L(""),I=ce(d,300),F=S(()=>{const P=s.relationships||[];if(C.value){let e=function($){!$||l.has($)||(l.add($),$.deps.forEach(U=>{e(P.find(M=>M.id===U))}))};const l=new Set;return e(C.value),Array.from(l)}return P}),A=S(()=>{const P=F.value.map(l=>{const $=s.components.find(G=>G.filePath===l.id),U=p.value?.find(G=>G.file===l.id),M=u.value?.find(G=>G.file===l.id),j=l.id.replace(/\?.*$/,"").replace(/#.*$/,""),D=l.id.includes("/node_modules/")?"lib":$?$.global?"global":"user":M?"layout":U?"page":"unknown";if(!f.value&&D==="lib"||!h.value&&D==="page"||!V.value&&D==="layout"||!y.value&&D==="user"&&m.value&&!l.id.startsWith(m.value.rootDir)||!g.value&&D==="global")return null;const w=D==="layout"?"hexagon":D==="page"?"square":"dot",q=I.value&&!l.id.toLowerCase().includes(I.value.toLowerCase());return{id:l.id,label:j.split("/").splice(-1)[0].replace(/\.\w+$/,""),group:D,shape:w,size:15+Math.min(l.deps.length/2,8),font:{color:q?"#8885":i.value==="dark"?"white":"black"},color:q?"#8885":C.value?.id===l.id?"#82c742":void 0,extra:{id:l.id,component:$,page:U,layout:M,relationship:l}}}).filter(l=>!!l),e=F.value.flatMap(l=>l.deps.map($=>({from:l.id,to:$,arrows:{to:{enabled:!0,scaleFactor:.8}}})));return{nodes:P,edges:e}}),se=S(()=>o.value?.component?s.relationships?.find(e=>e.id===o.value?.component?.filePath)?.deps?.map(e=>s.relationships?.find(l=>l.id===e)?.id).filter(Boolean):[]),le=S(()=>o.value?.component?s.relationships?.filter(e=>e.deps.includes(o.value.component.filePath))?.map(e=>s.relationships?.find(l=>l.id===e.id)?.id).filter(Boolean):[]);we(()=>{const P={nodes:{shape:"dot",size:16},physics:{repulsion:{centralGravity:.7,springLength:100,springConstant:.01},maxVelocity:146,solver:"forceAtlas2Based",timestep:.35,stabilization:{enabled:!0,iterations:200}},groups:{user:{color:"#42b883"},unknown:{color:"#b86542"},lib:{color:"#b4b842"},page:{color:"#42b2b8"},layout:{color:"#4256b8"}}},e=new De(c.value,A.value,P);e.on("click",l=>{const $=l.nodes?.[0],U=A.value.nodes?.find(M=>M.id===$)?.extra;U&&(o.value=U)}),xe(A,()=>{e.setData(A.value)})});function ae(){C.value=o.value?.relationship,o.value=void 0}return(P,e)=>{const l=Se,$=K,U=me,M=te,j=X,D=Pe;return t(),_(T,null,[v($,{ref_key:"navbar",ref:a,search:d.value,"onUpdate:search":e[6]||(e[6]=w=>d.value=w),absolute:"","left-0":"","right-0":"","top-0":""},{actions:b(()=>[n("div",nn,[v(l,{modelValue:N(h),"onUpdate:modelValue":e[0]||(e[0]=w=>E(h)?h.value=w:null),n:"primary sm"},{default:b(()=>e[9]||(e[9]=[n("span",{op75:""},"Show pages",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(V),"onUpdate:modelValue":e[1]||(e[1]=w=>E(V)?V.value=w:null),n:"primary sm"},{default:b(()=>e[10]||(e[10]=[n("span",{op75:""},"Show layouts",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(y),"onUpdate:modelValue":e[2]||(e[2]=w=>E(y)?y.value=w:null),n:"primary sm"},{default:b(()=>e[11]||(e[11]=[n("span",{op75:""},"Show workspace",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(f),"onUpdate:modelValue":e[3]||(e[3]=w=>E(f)?f.value=w:null),n:"primary sm"},{default:b(()=>e[12]||(e[12]=[n("span",{op75:""},"Show node_modules",-1)])),_:1},8,["modelValue"]),v(l,{modelValue:N(g),"onUpdate:modelValue":e[4]||(e[4]=w=>E(g)?g.value=w:null),n:"primary sm"},{default:b(()=>e[13]||(e[13]=[n("span",{op75:""},"Show global components",-1)])),_:1},8,["modelValue"])]),C.value?(t(),_("button",{key:0,flex:"~ gap-1","flex-none":"","items-center":"","rounded-full":"","bg-gray:20":"",py1:"",pl3:"",pr2:"","text-xs":"",op50:"","hover:op100":"",onClick:e[5]||(e[5]=w=>C.value=void 0)},e[14]||(e[14]=[Q(" Clear filter "),n("div",{"i-carbon-close":""},null,-1)]))):k("",!0),e[15]||(e[15]=n("div",{"flex-auto":""},null,-1)),H(P.$slots,"default")]),_:3},8,["search"]),n("div",on,[n("div",{ref_key:"container",ref:c,"h-full":"","w-full":""},null,512),v(U,{absolute:"","bottom-3":"","left-3":"","border-0":"",p2:"",px3:"","text-sm":"","n-glass-effect":""},{default:b(()=>e[16]||(e[16]=[n("div",{grid:"~ cols-[20px_1fr] items-center gap-y-1"},[n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-42b883":""}),n("div",{op50:""}," Component "),n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-97c2fc":""}),n("div",{op50:""}," Global Component "),n("div",{"h-3":"","w-3":"","bg-hex-42b2b8":""}),n("div",{op50:""}," Page "),n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 726 628","ml--1px":"","h-3":""},[n("path",{fill:"#4256b8","stroke-width":"4",d:"M723 314 543 625.8H183L3 314 183 2.2h360L723 314z"})]),n("div",{op50:""}," Layout "),n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b4b842":""}),n("div",{op50:""}," Library Component "),n("div",{"h-3":"","w-3":"","rounded-full":"","bg-hex-b86542":""}),n("div",{op50:""}," Unknown ")],-1)])),_:1}),v(D,{"model-value":!!(o.value&&o.value.component),top:a.value,border:"t l base","w-80":"",onClose:e[8]||(e[8]=w=>o.value=void 0)},{default:b(()=>[o.value&&o.value.component?(t(),_("div",tn,[v(M,{component:o.value.component,dependencies:se.value,dependents:le.value},null,8,["component","dependencies","dependents"]),n("div",sn,[v(j,{n:"primary solid",onClick:e[7]||(e[7]=w=>ae())},{default:b(()=>e[17]||(e[17]=[Q(" Filter to this component ")])),_:1})])])):k("",!0)]),_:1},8,["model-value","top"])])],64)}}}),an={hover:"bg-active",class:"group",flex:"~ gap2","w-full":"","items-center":"",rounded:"",px2:"",py1:""},pn={key:0,"ml--1":"","text-primary":""},rn=R({__name:"ComponentItem",props:{component:{},dependencies:{},dependents:{}},setup(r){const s=r,c=S(()=>s.component.filePath||s.component.file||s.component.__file||"");return(a,i)=>{const o=oe,p=te,m=ke("VDropdown"),u=Z,f=ee;return t(),_("div",an,[v(m,null,{popper:b(()=>[v(p,{component:a.component,dependencies:a.dependencies,dependents:a.dependents,"w-100":"",pt4:""},null,8,["component","dependencies","dependents"])]),default:b(()=>[n("button",{"hover:text-primary":"",class:Ce(a.dependents&&a.dependents.length===0?"op50":"")},[v(o,{component:a.component},null,8,["component"])],2)]),_:1}),a.dependents?.length?(t(),_("sup",pn," x"+W(a.dependents?.length),1)):k("",!0),a.component.global?(t(),x(u,{key:1,n:"green",title:"Registered at runtime as a global component",textContent:"runtime"})):k("",!0),H(a.$slots,"default"),c.value?(t(),x(f,{key:2,filepath:c.value,"text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):k("",!0)])}}}),un={flex:"~ gap-2 items-center"},dn={pl4:""},cn=R({__name:"ComponentsList",props:{components:{},relationships:{}},setup(r){const s=r,c=L(""),a=L("all"),i=S(()=>{const m=s.components.map(u=>fe(u,s.relationships));return a.value==="using"?m.filter(u=>u.dependents?.length):a.value==="not-used"?m.filter(u=>!u.dependents?.length):m}),o=S(()=>new ve(i.value,{keys:["component.pascalName","component.filePath","component.kebabName"]})),p=S(()=>{const m=[],u=new Map,f=[],g=[],h={user:0,lib:0,builtin:0,runtime:0};return(c.value?o.value.search(c.value).map(y=>y.item):i.value).forEach(y=>{const C=y.component;if(C.filePath&&_e(C.filePath)){const d=he(C.filePath);if(!d)return;d==="nuxt"?(f.push(y),h.builtin++):(u.has(d)||u.set(d,[]),u.get(d).push(y),h.lib++)}else C.global&&!C.filePath?(g.push(y),h.runtime++):(m.push(y),h.user++)}),{count:h,user:m,builtin:f,lib:u,runtime:g}});return(m,u)=>{const f=be,g=Te,h=K,V=rn,y=Ue,C=Me;return t(),_(T,null,[v(h,{search:c.value,"onUpdate:search":u[1]||(u[1]=d=>c.value=d),pb3:""},{actions:b(()=>[H(m.$slots,"default")]),default:b(()=>[n("div",un,[v(f,{icon:"carbon-filter",op50:""}),v(g,{modelValue:a.value,"onUpdate:modelValue":u[0]||(u[0]=d=>a.value=d),n:"primary sm",options:[{label:"All",value:"all"},{label:"Using",value:"using"},{label:"Not used",value:"not-used"}]},null,8,["modelValue"])])]),_:3},8,["search"]),p.value.user.length?(t(),x(y,{key:0,icon:"carbon-nominal",text:"User components",open:p.value.user.length<=N(O),description:`Total components: ${p.value.count.user}`},{default:b(()=>[(t(!0),_(T,null,B(p.value.user,d=>(t(),x(V,z({key:d.component.filePath,ref_for:!0},d),null,16))),128))]),_:1},8,["open","description"])):k("",!0),p.value.runtime.length?(t(),x(y,{key:1,icon:"carbon-load-balancer-global",open:p.value.runtime.length<=N(O),text:"Runtime components",description:`Total components: ${p.value.count.runtime}`},{default:b(()=>[(t(!0),_(T,null,B(p.value.runtime,d=>(t(),x(V,z({key:d.component.filePath,ref_for:!0},d),null,16))),128))]),_:1},8,["open","description"])):k("",!0),p.value.builtin.length?(t(),x(y,{key:2,icon:"simple-icons-nuxtdotjs",text:"Built-in components",description:`Total components: ${p.value.count.builtin}`},{default:b(()=>[(t(!0),_(T,null,B(p.value.builtin,d=>(t(),x(V,z({key:d.component.filePath,ref_for:!0},d),null,16))),128))]),_:1},8,["description"])):k("",!0),p.value.lib.size?(t(),x(y,{key:3,open:p.value.count.lib<=N(O),icon:"carbon-3d-mpr-toggle",text:"Components from libraries",description:`${p.value.count.lib} components from ${p.value.lib.size} packages`},{default:b(()=>[(t(!0),_(T,null,B(p.value.lib.entries(),([d,I])=>(t(),_("div",{key:d,"ml-2":""},[v(C,{text:`${d} (${I.length})`,py1:"",op50:""},null,8,["text"]),n("div",dn,[(t(!0),_(T,null,B(I,F=>(t(),x(V,z({key:F.component.filePath,ref_for:!0},F),null,16))),128))])]))),128))]),_:1},8,["open","description"])):k("",!0)],64)}}}),mn={relative:"","h-full":"","of-auto":""},fn={"flex-none":"",flex:"~ gap3"},Tn=R({__name:"components",setup(r){const s=ge(),c=Be(),a=Le(),{componentsView:i}=Y("ui");function o(){s.value?.inspector?.instance&&s.value.inspector.enable()}function p(){i.value=i.value==="list"?"graph":"list"}return(m,u)=>{const f=X,g=Ie,h=Ve,V=$e("tooltip");return t(),_(T,null,[n("div",mn,[(t(),x(Ne(N(i)==="list"?cn:ln),{components:N(c),relationships:N(a)},{default:b(()=>[n("div",fn,[J(v(f,{"text-lg":"",border:!1,icon:N(i)==="graph"?"i-carbon-list":"i-carbon-network-4",title:"Toggle view",onClick:p},null,8,["icon"]),[[V,"Toggle View",void 0,{"bottom-end":!0}]]),N(s)?.inspector?.instance?J((t(),x(f,{key:0,"text-lg":"",border:!1,icon:"i-tabler-focus-2",title:"Inspect Vue components",onClick:o},null,512)),[[V,"Inspect Vue components",void 0,{"bottom-end":!0}]]):k("",!0)])]),_:1},8,["components","relationships"]))]),v(h,null,{default:b(()=>[v(g)]),_:1})],64)}}});export{Tn as default};
|