@nuxt/devtools 2.1.3 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +2 -2
- package/dist/chunks/vue-tracer.mjs +14 -0
- package/dist/client/200.html +14 -14
- package/dist/client/404.html +14 -14
- package/dist/client/_nuxt/__blank-o25h0hkz.js +1 -0
- package/dist/client/_nuxt/{analyze-build-k7usc929.js → analyze-build-h1qtv94t.js} +1 -1
- package/dist/client/_nuxt/assets-oebtr6sn.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/917012c8-846d-4264-bce5-f9be7333c9da.json +1 -0
- package/dist/client/_nuxt/{code-diff.vue-n8bar0i3.js → code-diff.vue-cmobgah0.js} +1 -1
- package/dist/client/_nuxt/{code-snippets.vue-donzovu5.js → code-snippets.vue-kiughdhz.js} +1 -1
- package/dist/client/_nuxt/components-jia8wtb3.js +1 -0
- package/dist/client/_nuxt/{composable-item.vue-ojmi080u.js → composable-item.vue-gfbdvk92.js} +1 -1
- package/dist/client/_nuxt/{custom-_name_-pfktgav8.js → custom-_name_-m80m298x.js} +1 -1
- package/dist/client/_nuxt/{data-schema-button.vue-rqp42n39.js → data-schema-button.vue-j12zu5ly.js} +1 -1
- package/dist/client/_nuxt/{data-schema-drawer-k2wpr3y0.js → data-schema-drawer-c0s8h2rf.js} +1 -1
- package/dist/client/_nuxt/{default-rm5gsi8z.js → default-gc7ie9i4.js} +1 -1
- package/dist/client/_nuxt/{error-404-mi99npap.js → error-404-dlnouvoa.js} +1 -1
- package/dist/client/_nuxt/error-404.css-cyoi3t2n.css +1 -0
- package/dist/client/_nuxt/{error-500-fpz21bp1.js → error-500-nwpcih6s.js} +1 -1
- package/dist/client/_nuxt/error-500.css-c3osv0mr.css +1 -0
- package/dist/client/_nuxt/{error-cbew144m.js → error-n1d3rwvz.js} +1 -1
- package/dist/client/_nuxt/{filepath-item.vue-iltgx83i.js → filepath-item.vue-csqbsvc3.js} +1 -1
- package/dist/client/_nuxt/{full-o1ks5uak.js → full-3l6dimb1.js} +1 -1
- package/dist/client/_nuxt/{help-fab.vue-fz7s38mz.js → help-fab.vue-d99t6zdw.js} +1 -1
- package/dist/client/_nuxt/{hooks-gddqfh4g.js → hooks-jk04ky26.js} +1 -1
- package/dist/client/_nuxt/{imports-m27rstm7.js → imports-dqjyu7ow.js} +1 -1
- package/dist/client/_nuxt/{index-efx0alh8.js → index-izwizeyn.js} +1 -1
- package/dist/client/_nuxt/{launch-page.vue-k3mfatbm.js → launch-page.vue-b5znlr95.js} +1 -1
- package/dist/client/_nuxt/{modules-h7m8imq8.js → modules-ftim9y66.js} +1 -1
- package/dist/client/_nuxt/n2dc525b.js +17 -0
- package/dist/client/_nuxt/{nbadge-j0lg4rvs.js → nbadge-htrvttst.js} +1 -1
- package/dist/client/_nuxt/{ncheckbox.vue-dizdk93x.js → ncheckbox.vue-m6od5ntc.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-iqsqqdsc.js → ndrawer.vue-m60bsg9x.js} +1 -1
- package/dist/client/_nuxt/{ndropdown.vue-i27dwkwo.js → ndropdown.vue-e8of1w4q.js} +1 -1
- package/dist/client/_nuxt/{nlink.vue-mgndip1g.js → nlink.vue-msx1bzvo.js} +1 -1
- package/dist/client/_nuxt/{nnavbar.vue-ip749nge.js → nnavbar.vue-mt44hnfg.js} +1 -1
- package/dist/client/_nuxt/{none-iaayt5li.js → none-fqfjn9dv.js} +1 -1
- package/dist/client/_nuxt/{nsection-block-ez4av87h.js → nsection-block-blzeji2j.js} +1 -1
- package/dist/client/_nuxt/{nselect-tabs.vue-kbdbbl1a.js → nselect-tabs.vue-eewrxxrw.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-h06w7phh.js → nselect.vue-cwn1habi.js} +1 -1
- package/dist/client/_nuxt/{open-graph-c1fets3p.js → open-graph-efd91aeh.js} +1 -1
- package/dist/client/_nuxt/{overview-ytav5zv8.js → overview-b0jfropt.js} +1 -1
- package/dist/client/_nuxt/{pages-hsqav0if.js → pages-owmi8y1w.js} +1 -1
- package/dist/client/_nuxt/{payload-gmcpymvb.js → payload-nzogw6cx.js} +1 -1
- package/dist/client/_nuxt/{pinia-b8qfl5lg.js → pinia-h28kc7st.js} +1 -1
- package/dist/client/_nuxt/{plugins-kikp83ze.js → plugins-cvrrxd2o.js} +1 -1
- package/dist/client/_nuxt/{render-tree-kci73adp.js → render-tree-f4btmb99.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs-c95l3cvn.js → runtime-configs-iwo02vae.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-mqr6vxyg.js → server-discovery-kduvqt6t.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-2gi14bp7.js → server-route-inputs.vue-ouiap82r.js} +1 -1
- package/dist/client/_nuxt/{server-routes-k5dbmj9z.js → server-routes-otulhw4o.js} +1 -1
- package/dist/client/_nuxt/{server-tasks-msqxhezv.js → server-tasks-fb19xaov.js} +1 -1
- package/dist/client/_nuxt/{settings-ev2jeu5l.js → settings-m340011e.js} +1 -1
- package/dist/client/_nuxt/{stacktrace-list.vue-nuejet0w.js → stacktrace-list.vue-jk5kvmxj.js} +1 -1
- package/dist/client/_nuxt/{state-components-o1o8du1g.js → state-components-iu73pb63.js} +1 -1
- package/dist/client/_nuxt/{state-editor.vue-n4ehj4fq.js → state-editor.vue-ccl909mt.js} +1 -1
- package/dist/client/_nuxt/{state-modules-ihh0k0hk.js → state-modules-mc97lhwd.js} +1 -1
- package/dist/client/_nuxt/{storage-hdpr51lz.js → storage-jl97i4lz.js} +1 -1
- package/dist/client/_nuxt/{terminals-hdgtfdx3.js → terminals-hicd7c09.js} +1 -1
- package/dist/client/_nuxt/{timeline-mrc5a9nr.js → timeline-d6b5hxwa.js} +1 -1
- package/dist/client/_nuxt/vendor/{vis-7ar5f2fs.js → vis-fth2qiu5.js} +1 -1
- package/dist/client/_nuxt/{virtual-files-jwisupq9.js → virtual-files-kopy8ufw.js} +1 -1
- package/dist/client/_nuxt/vue-devtools-nhi1fp41.js +2 -0
- package/dist/client/index.html +14 -14
- package/dist/module.d.mts +1 -2
- package/dist/module.d.ts +1 -2
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/view/Main.vue +21 -4
- package/dist/runtime/plugins/view/client.js +34 -39
- package/dist/shared/{devtools.2e078e30.d.mts → devtools.427ec2e8.d.mts} +0 -9
- package/dist/shared/{devtools.2e078e30.d.ts → devtools.427ec2e8.d.ts} +0 -9
- package/dist/types.d.mts +1 -2
- package/dist/types.d.ts +1 -2
- package/package.json +12 -12
- package/dist/chunks/vue-inspector.mjs +0 -15
- package/dist/client/_nuxt/__blank-dudv6g9d.js +0 -1
- package/dist/client/_nuxt/assets-n7z80c9u.js +0 -16
- package/dist/client/_nuxt/builds/meta/b7da869e-e0a9-4d4c-a2f3-5ddb290c30d3.json +0 -1
- package/dist/client/_nuxt/components-hgs0g0ig.js +0 -1
- package/dist/client/_nuxt/dckvv1o7.js +0 -17
- package/dist/client/_nuxt/error-404.css-hufc5r2t.css +0 -1
- package/dist/client/_nuxt/error-500.css-iibxggy2.css +0 -1
- package/dist/client/_nuxt/vue-devtools-h7isihvs.js +0 -2
package/dist/client/index.html
CHANGED
|
@@ -3,27 +3,27 @@
|
|
|
3
3
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-jfo9gib8.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/n2dc525b.js">
|
|
7
7
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-llkaejaf.js">
|
|
8
8
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-mvzv9iuf.js">
|
|
9
9
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-kdj4mcqm.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-
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-gc7ie9i4.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-3l6dimb1.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-fqfjn9dv.js">
|
|
14
14
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-lvdc77tw.css">
|
|
15
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-c0s8h2rf.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-cwn1habi.js">
|
|
17
17
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-jbyu7ls8.js">
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-e8of1w4q.js">
|
|
19
19
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-bir2wz4z.js">
|
|
20
20
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-gsjyqe32.js">
|
|
21
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-m60bsg9x.js">
|
|
22
22
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-o2aektoq.js">
|
|
23
23
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-l2otbg6e.js">
|
|
24
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
25
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
26
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
27
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
28
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
29
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
24
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-cyoi3t2n.css">
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-dlnouvoa.js">
|
|
26
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-c3osv0mr.css">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-nwpcih6s.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/n2dc525b.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},1741166487227,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"917012c8-846d-4264-bce5-f9be7333c9da",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import './shared/devtools.
|
|
2
|
+
import './shared/devtools.427ec2e8.mjs';
|
|
3
3
|
import { ModuleOptions } from '@nuxt/devtools-kit/types';
|
|
4
4
|
export { ModuleOptions } from '@nuxt/devtools-kit/types';
|
|
5
|
-
import 'vite-plugin-vue-inspector';
|
|
6
5
|
|
|
7
6
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
8
7
|
|
package/dist/module.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
-
import './shared/devtools.
|
|
2
|
+
import './shared/devtools.427ec2e8.js';
|
|
3
3
|
import { ModuleOptions } from '@nuxt/devtools-kit/types';
|
|
4
4
|
export { ModuleOptions } from '@nuxt/devtools-kit/types';
|
|
5
|
-
import 'vite-plugin-vue-inspector';
|
|
6
5
|
|
|
7
6
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
8
7
|
|
package/dist/module.json
CHANGED
|
@@ -254,7 +254,7 @@ const iframeStyle = computed(() => {
|
|
|
254
254
|
const style: CSSProperties = {
|
|
255
255
|
position: 'fixed',
|
|
256
256
|
zIndex: -1,
|
|
257
|
-
pointerEvents: isDragging.value || !state.value.open ? 'none' : 'auto',
|
|
257
|
+
pointerEvents: (isDragging.value || !state.value.open || props.client.inspector?.isEnabled.value) ? 'none' : 'auto',
|
|
258
258
|
width: `min(${state.value.width}vw, calc(100vw - ${marginHorizontal}px))`,
|
|
259
259
|
height: `min(${state.value.height}vh, calc(100vh - ${marginVertical}px))`,
|
|
260
260
|
}
|
|
@@ -303,6 +303,10 @@ const iframeStyle = computed(() => {
|
|
|
303
303
|
break
|
|
304
304
|
}
|
|
305
305
|
|
|
306
|
+
if (props.client.inspector?.isEnabled.value) {
|
|
307
|
+
style.opacity = 0
|
|
308
|
+
}
|
|
309
|
+
|
|
306
310
|
return style
|
|
307
311
|
})
|
|
308
312
|
|
|
@@ -324,6 +328,20 @@ const time = computed(() => {
|
|
|
324
328
|
return [type, ...millisecondToHumanreadable(time)]
|
|
325
329
|
})
|
|
326
330
|
|
|
331
|
+
function toggleInspector() {
|
|
332
|
+
const isDevToolsOpen = state.value.open
|
|
333
|
+
if (!isDevToolsOpen)
|
|
334
|
+
props.client.devtools.open()
|
|
335
|
+
|
|
336
|
+
props.client.inspector?.enable()
|
|
337
|
+
|
|
338
|
+
if (!isDevToolsOpen) {
|
|
339
|
+
setTimeout(() => {
|
|
340
|
+
props.client.devtools.close()
|
|
341
|
+
}, 500)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
327
345
|
onMounted(() => {
|
|
328
346
|
bringUp()
|
|
329
347
|
})
|
|
@@ -379,12 +397,12 @@ onMounted(() => {
|
|
|
379
397
|
{{ time[2] }}
|
|
380
398
|
</span>
|
|
381
399
|
</div>
|
|
382
|
-
<template v-if="client.inspector?.
|
|
400
|
+
<template v-if="client.inspector?.isAvailable">
|
|
383
401
|
<div
|
|
384
402
|
style="border-left: 1px solid #8883;width:1px;height:10px;"
|
|
385
403
|
class="nuxt-devtools-panel-content"
|
|
386
404
|
/>
|
|
387
|
-
<button class="nuxt-devtools-icon-button nuxt-devtools-panel-content" title="Toggle Component Inspector" @click
|
|
405
|
+
<button class="nuxt-devtools-icon-button nuxt-devtools-panel-content" title="Toggle Component Inspector" @click.prevent.stop="toggleInspector">
|
|
388
406
|
<svg
|
|
389
407
|
xmlns="http://www.w3.org/2000/svg"
|
|
390
408
|
style="height: 1.2em; width: 1.2em; opacity:0.5;"
|
|
@@ -398,7 +416,6 @@ onMounted(() => {
|
|
|
398
416
|
</div>
|
|
399
417
|
|
|
400
418
|
<div
|
|
401
|
-
v-show="!client.inspector?.isEnabled.value"
|
|
402
419
|
ref="frameBox"
|
|
403
420
|
:style="iframeStyle"
|
|
404
421
|
>
|
|
@@ -2,7 +2,8 @@ import { useAppConfig, useRuntimeConfig } from "#imports";
|
|
|
2
2
|
import { setIframeServerContext } from "@vue/devtools-kit";
|
|
3
3
|
import { createHooks } from "hookable";
|
|
4
4
|
import { debounce } from "perfect-debounce";
|
|
5
|
-
import {
|
|
5
|
+
import { events as inspectorEvents, hasData as inspectorHasData, state as inspectorState } from "vite-plugin-vue-tracer/client/overlay";
|
|
6
|
+
import { computed, createApp, h, markRaw, ref, shallowReactive, shallowRef, toRef, watch } from "vue";
|
|
6
7
|
import { initTimelineMetrics } from "../../function-metrics-helpers.js";
|
|
7
8
|
import Main from "./Main.vue";
|
|
8
9
|
import { popupWindow, state } from "./state.js";
|
|
@@ -14,7 +15,6 @@ export async function setupDevToolsClient({
|
|
|
14
15
|
timeMetric,
|
|
15
16
|
router
|
|
16
17
|
}) {
|
|
17
|
-
const isInspecting = ref(false);
|
|
18
18
|
const colorMode = useClientColorMode();
|
|
19
19
|
const timeline = initTimelineMetrics();
|
|
20
20
|
const client = shallowReactive({
|
|
@@ -138,47 +138,42 @@ export async function setupDevToolsClient({
|
|
|
138
138
|
}, timeout);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
function getInspector() {
|
|
142
|
-
return window.__NUXT_INSPECTOR__ || window.__VUE_INSPECTOR__;
|
|
143
|
-
}
|
|
144
|
-
function enableComponentInspector() {
|
|
145
|
-
getInspector()?.enable();
|
|
146
|
-
isInspecting.value = true;
|
|
147
|
-
}
|
|
148
|
-
function disableComponentInspector() {
|
|
149
|
-
if (!getInspector()?.enabled)
|
|
150
|
-
return;
|
|
151
|
-
getInspector()?.disable();
|
|
152
|
-
client?.hooks.callHook("host:inspector:close");
|
|
153
|
-
isInspecting.value = false;
|
|
154
|
-
}
|
|
155
141
|
function getInspectorInstance() {
|
|
156
|
-
const
|
|
157
|
-
if (
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
142
|
+
const isAvailable = ref(inspectorHasData());
|
|
143
|
+
if (!inspectorEvents.events.disabled?.length) {
|
|
144
|
+
inspectorEvents.on("disabled", () => {
|
|
145
|
+
inspectorState.isVisible = false;
|
|
146
|
+
client?.hooks.callHook("host:inspector:close");
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
if (!inspectorEvents.events.enabled?.length) {
|
|
150
|
+
inspectorEvents.on("enabled", () => {
|
|
151
|
+
inspectorState.isVisible = true;
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (!inspectorEvents.events.click?.length) {
|
|
155
|
+
inspectorEvents.on("click", async (info) => {
|
|
156
|
+
inspectorState.isEnabled = false;
|
|
157
|
+
await client.hooks.callHook("host:inspector:click", info.fullpath);
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
if (!isAvailable.value) {
|
|
161
|
+
inspectorEvents.on("hover", async () => {
|
|
162
|
+
isAvailable.value = inspectorHasData();
|
|
163
|
+
});
|
|
168
164
|
}
|
|
169
165
|
return markRaw({
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
disableComponentInspector();
|
|
178
|
-
else
|
|
179
|
-
enableComponentInspector();
|
|
166
|
+
isAvailable,
|
|
167
|
+
isEnabled: toRef(inspectorState, "isEnabled"),
|
|
168
|
+
enable: () => {
|
|
169
|
+
inspectorState.isEnabled = true;
|
|
170
|
+
},
|
|
171
|
+
disable: () => {
|
|
172
|
+
inspectorState.isEnabled = false;
|
|
180
173
|
},
|
|
181
|
-
|
|
174
|
+
toggle: () => {
|
|
175
|
+
inspectorState.isEnabled = !inspectorState.isEnabled;
|
|
176
|
+
}
|
|
182
177
|
});
|
|
183
178
|
}
|
|
184
179
|
setupRouteTracking(timeline, router);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { VueInspectorClient } from 'vite-plugin-vue-inspector';
|
|
2
1
|
import { NuxtDevtoolsIframeClient, NuxtDevtoolsHostClient, NuxtDevtoolsGlobal, PluginMetric, TimelineMetrics, LoadingTimeMetric } from '@nuxt/devtools-kit/types';
|
|
3
2
|
|
|
4
3
|
declare global {
|
|
@@ -48,14 +47,6 @@ declare global {
|
|
|
48
47
|
* @internal
|
|
49
48
|
*/
|
|
50
49
|
__NUXT_DEVTOOLS_IS_POPUP__?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Vue Inspector client
|
|
53
|
-
*/
|
|
54
|
-
__VUE_INSPECTOR__?: VueInspectorClient;
|
|
55
|
-
/**
|
|
56
|
-
* Vue Inspector client
|
|
57
|
-
*/
|
|
58
|
-
__NUXT_INSPECTOR__?: VueInspectorClient;
|
|
59
50
|
/**
|
|
60
51
|
* Experimental API: Picture-in-Picture mode
|
|
61
52
|
*
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { VueInspectorClient } from 'vite-plugin-vue-inspector';
|
|
2
1
|
import { NuxtDevtoolsIframeClient, NuxtDevtoolsHostClient, NuxtDevtoolsGlobal, PluginMetric, TimelineMetrics, LoadingTimeMetric } from '@nuxt/devtools-kit/types';
|
|
3
2
|
|
|
4
3
|
declare global {
|
|
@@ -48,14 +47,6 @@ declare global {
|
|
|
48
47
|
* @internal
|
|
49
48
|
*/
|
|
50
49
|
__NUXT_DEVTOOLS_IS_POPUP__?: boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Vue Inspector client
|
|
53
|
-
*/
|
|
54
|
-
__VUE_INSPECTOR__?: VueInspectorClient;
|
|
55
|
-
/**
|
|
56
|
-
* Vue Inspector client
|
|
57
|
-
*/
|
|
58
|
-
__NUXT_INSPECTOR__?: VueInspectorClient;
|
|
59
50
|
/**
|
|
60
51
|
* Experimental API: Picture-in-Picture mode
|
|
61
52
|
*
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import './shared/devtools.
|
|
1
|
+
import './shared/devtools.427ec2e8.mjs';
|
|
2
2
|
import { ModuleStaticInfo } from '@nuxt/devtools-kit/types';
|
|
3
3
|
export * from '@nuxt/devtools-kit/types';
|
|
4
|
-
import 'vite-plugin-vue-inspector';
|
|
5
4
|
|
|
6
5
|
interface SocialPreviewResolved {
|
|
7
6
|
url?: string;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import './shared/devtools.
|
|
1
|
+
import './shared/devtools.427ec2e8.js';
|
|
2
2
|
import { ModuleStaticInfo } from '@nuxt/devtools-kit/types';
|
|
3
3
|
export * from '@nuxt/devtools-kit/types';
|
|
4
|
-
import 'vite-plugin-vue-inspector';
|
|
5
4
|
|
|
6
5
|
interface SocialPreviewResolved {
|
|
7
6
|
url?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.1
|
|
4
|
+
"version": "2.2.1",
|
|
5
5
|
"description": "The Nuxt DevTools gives you insights and transparency about your Nuxt App.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://devtools.nuxt.com",
|
|
@@ -46,24 +46,24 @@
|
|
|
46
46
|
"image-meta": "^0.2.1",
|
|
47
47
|
"is-installed-globally": "^1.0.0",
|
|
48
48
|
"launch-editor": "^2.10.0",
|
|
49
|
-
"local-pkg": "^1.1.
|
|
49
|
+
"local-pkg": "^1.1.1",
|
|
50
50
|
"magicast": "^0.3.5",
|
|
51
51
|
"nypm": "^0.6.0",
|
|
52
|
-
"ohash": "^2.0.
|
|
52
|
+
"ohash": "^2.0.11",
|
|
53
53
|
"pathe": "^2.0.3",
|
|
54
54
|
"perfect-debounce": "^1.0.0",
|
|
55
|
-
"pkg-types": "^2.0
|
|
55
|
+
"pkg-types": "^2.1.0",
|
|
56
56
|
"semver": "^7.7.1",
|
|
57
57
|
"simple-git": "^3.27.0",
|
|
58
58
|
"sirv": "^3.0.1",
|
|
59
59
|
"structured-clone-es": "^1.0.0",
|
|
60
60
|
"tinyglobby": "^0.2.12",
|
|
61
61
|
"vite-plugin-inspect": "^11.0.0",
|
|
62
|
-
"vite-plugin-vue-
|
|
62
|
+
"vite-plugin-vue-tracer": "^0.1.0",
|
|
63
63
|
"which": "^5.0.0",
|
|
64
64
|
"ws": "^8.18.1",
|
|
65
|
-
"@nuxt/devtools-kit": "2.1
|
|
66
|
-
"@nuxt/devtools-wizard": "2.1
|
|
65
|
+
"@nuxt/devtools-kit": "2.2.1",
|
|
66
|
+
"@nuxt/devtools-wizard": "2.2.1"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@antfu/utils": "^9.1.0",
|
|
@@ -86,19 +86,19 @@
|
|
|
86
86
|
"@unocss/runtime": "^66.0.0",
|
|
87
87
|
"@vitest/ui": "^3.0.7",
|
|
88
88
|
"@vue/devtools-applet": "^7.7.2",
|
|
89
|
-
"@vueuse/nuxt": "^12.
|
|
89
|
+
"@vueuse/nuxt": "^12.8.0",
|
|
90
90
|
"@xterm/addon-fit": "^0.10.0",
|
|
91
91
|
"@xterm/xterm": "^5.5.0",
|
|
92
|
-
"cronstrue": "^2.
|
|
92
|
+
"cronstrue": "^2.56.0",
|
|
93
93
|
"esno": "^4.8.0",
|
|
94
94
|
"floating-vue": "^5.2.2",
|
|
95
95
|
"fuse.js": "^7.1.0",
|
|
96
|
-
"json-editor-vue": "^0.18.
|
|
96
|
+
"json-editor-vue": "^0.18.1",
|
|
97
97
|
"markdown-it": "^14.1.0",
|
|
98
98
|
"markdown-it-link-attributes": "^4.0.1",
|
|
99
99
|
"my-ua-parser": "^2.0.4",
|
|
100
100
|
"nanoid": "^5.1.2",
|
|
101
|
-
"nitropack": "^2.
|
|
101
|
+
"nitropack": "^2.11.0",
|
|
102
102
|
"nuxt": "^3.15.4",
|
|
103
103
|
"ofetch": "^1.4.1",
|
|
104
104
|
"quicktype-core": "22.0.0",
|
|
@@ -114,7 +114,7 @@
|
|
|
114
114
|
"vis-network": "^9.1.9",
|
|
115
115
|
"vue-tsc": "^2.2.8",
|
|
116
116
|
"vue-virtual-scroller": "^2.0.0-beta.8",
|
|
117
|
-
"@nuxt/devtools": "2.1
|
|
117
|
+
"@nuxt/devtools": "2.2.1"
|
|
118
118
|
},
|
|
119
119
|
"scripts": {
|
|
120
120
|
"build": "pnpm dev:prepare && pnpm build:module && pnpm build:discovery && pnpm build:client",
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { addVitePlugin } from '@nuxt/kit';
|
|
2
|
-
import VueInspector from 'vite-plugin-vue-inspector';
|
|
3
|
-
|
|
4
|
-
function setup({ nuxt, options }) {
|
|
5
|
-
if (!nuxt.options.dev || nuxt.options.test)
|
|
6
|
-
return;
|
|
7
|
-
addVitePlugin(VueInspector({
|
|
8
|
-
toggleComboKey: "",
|
|
9
|
-
...typeof options.componentInspector === "boolean" ? {} : options.componentInspector,
|
|
10
|
-
appendTo: /\/entry\.m?js$/,
|
|
11
|
-
toggleButtonVisibility: "never"
|
|
12
|
-
}));
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export { setup };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,P as n,a1 as t}from"./vendor/json-editor-vue-llkaejaf.js";const a={"h-screen":"","w-screen":"","bg-black":""},r=e({__name:"__blank",setup(c){return(o,s)=>(t(),n("div",a))}});export{r as default};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{C as ne,D as Q,_ as oe,E as se,F as R,G as me,H as fe,B as ve,r as X,m as Z,z as ie,I as he,c as ae,J as ge,a as ye,K as be,L as we,y as _e,M as xe,N as $e,O as ke,g as Ce,P as Ae}from"./dckvv1o7.js";import{_ as Be}from"./ncheckbox.vue-dizdk93x.js";import{_ as Pe}from"./ndropdown.vue-i27dwkwo.js";import{_ as Ve}from"./nnavbar.vue-ip749nge.js";import{p as W,f as E,ag as le,P as f,a1 as r,X as Y,u as b,aa as q,a3 as v,Q as l,a9 as S,F as L,ae as J,S as F,R as U,a2 as A,q as I,V as re,a8 as N,U as De,C as je,an as Fe,W as Se}from"./vendor/json-editor-vue-llkaejaf.js";import{_ as Ne}from"./nsection-block-ez4av87h.js";import{_ as ze}from"./filepath-item.vue-iltgx83i.js";import{_ as Ue}from"./code-snippets.vue-donzovu5.js";import{_ as Ie}from"./ndrawer.vue-iqsqqdsc.js";import{D as Oe}from"./constants-b32h69zq.js";import"./vendor/unocss-mvzv9iuf.js";import"./vendor/shiki-kdj4mcqm.js";import"./nicon-title.vue-dsf9ygne.js";import"./ncode-block.vue-bir2wz4z.js";import"./client-gsjyqe32.js";const Ee={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},Te={for:"drop-zone-input","text-3xl":"",hover:"text-green cursor-pointer","transition-all":""},Me={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},Le={grid:"~ cols-minmax-8rem gap-8","overflow-auto":"",p6:""},Re={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Ke=["src"],qe={flex:"~ gap1","items-center":""},Ge={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Je=W({__name:"AssetDropZone",props:{modelValue:{type:Boolean,required:!0},folder:{type:String,required:!0}},setup(_){const s=_,e=ne(s,"modelValue"),o=E(),n=E([]);function a(u){o.value=u.target,e.value=!0}function i(u){u.target===o.value&&(e.value=!1)}function y(u){u.preventDefault()}function g(u){u.preventDefault(),w(u.dataTransfer.files)}function w(u){const c=Array.from(u||[]);if(c.length){const $=[],x=n.value.map(p=>p.name);for(const p of c)if(x.includes(p.name)){let B=1;const[P,T]=p.name.split(".");for(;x.includes(`${P} (${B}).${T}`);)B++;const K=`${P}-${B}.${T}`,m=new Blob([p],{type:p.type}),t=new File([m],K,{lastModified:Date.now()});$.push(t),x.push(K)}else p.type===""&&R({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}),$.push(p);n.value=[...n.value,...$]}}async function D(){if(me.value||fe.value)return;ve("assets:upload");const u=[];for(const c of n.value){const $=new FileReader;$.readAsDataURL(c);const p=(await new Promise(B=>{$.onload=()=>B($.result)})).split(";base64,").pop();u.push({path:c.name,encoding:"base64",content:p})}await X.writeStaticAssets(await Z(),[...u],s.folder).then(()=>{h(),R({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(c=>{h(),R({message:`Error uploading files: ${c?.message??"unknown"}`,icon:"i-carbon-warning",classes:"text-red"})}),e.value=!1}function M(u){n.value?.splice(u,1)}function k(u){return URL.createObjectURL(u)}function C(u,c){const[$,x]=u.name.split("."),p=c.replace(/\.\w+$/,""),B=`${p}.${x}`;return p.length===0?(alert("File name must be at least 1 characters long"),$):(Object.defineProperty(u,"name",{value:B,writable:!1}),n.value.splice(n.value.indexOf(u),1,u),u)}function d(){n.value=[]}function h(){e.value=!1,d()}return Q("dragenter",a),Q("dragleave",i),Q("dragover",y),Q("drop",g),(u,c)=>{const $=oe,x=se,p=ie,B=le("tooltip");return r(),f("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:Y(b(e)?"opacity-100 visible":"opacity-0 invisible")},[q(v($,{icon:"carbon-close",title:"Close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",border:!1,onClick:h},null,512),[[B,"Close",void 0,{"bottom-end":!0}]]),n.value?.length?(r(),f("div",Me,[c[4]||(c[4]=l("div",{px6:"",py6:""},[l("h1",{"text-2xl":""}," Upload "),l("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1)),l("div",Le,[(r(!0),f(L,null,J(n.value,(P,T)=>(r(),f("div",{key:P.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[l("div",Re,[l("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:k(P)},null,8,Ke)]),l("div",qe,[v(p,{n:"xs","h-full":"","flex-auto":"","model-value":P.name,"onUpdate:modelValue":K=>C(P,K.target.value)},null,8,["model-value","onUpdate:modelValue"]),v($,{n:"red",icon:"carbon-trash-can","h-full":"","flex-none":"",title:"Remove file",onClick:K=>M(T)},null,8,["onClick"])])]))),128))]),l("div",Ge,[n.value.length?(r(),F($,{key:0,n:"red",onClick:d},{default:A(()=>[v(x,{icon:"carbon-clean"}),c[2]||(c[2]=S(" Clear "))]),_:1})):U("",!0),v($,{disabled:!n.value.length,n:"primary solid",onClick:D},{default:A(()=>[v(x,{icon:"carbon-cloud-upload"}),c[3]||(c[3]=S(" Upload "))]),_:1},8,["disabled"])])])):(r(),f("div",Ee,[l("label",Te,[v(x,{icon:"carbon-cloud-upload","mr-2":""}),c[1]||(c[1]=S(" Drop files here or click to select "))]),l("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:c[0]||(c[0]=P=>w(P.target.files))},null,32)]))],2)}}});function We(_){return typeof _=="string"?`'${_}'`:new Xe().serialize(_)}const Xe=function(){class _{#e=new Map;compare(e,o){return typeof e=="number"&&typeof o=="number"?e-o:String.prototype.localeCompare.call(this.serialize(e,!0),this.serialize(o,!0))}serialize(e,o){if(e===null)return"null";switch(typeof e){case"string":return o?e:`'${e}'`;case"bigint":return`${e}n`;case"object":return this.$object(e);case"function":return this.$function(e)}return String(e)}serializeObject(e){const o=Object.prototype.toString.call(e),n=e.constructor?.name,a=n==="Object"||n===void 0?"":n;let i=o.length<10?`unknown:${o}`:o.slice(8,-1);if(i==="Object"&&a in globalThis&&(i=a),i!=="Object"&&i!=="Function"&&i!=="AsyncFunction"){const y=this["$"+i];if(y)return y.call(this,e);if(typeof e?.entries=="function")return this.serializeObjectEntries(i,e.entries());throw new Error(`Cannot serialize ${i}`)}return typeof e.toJSON=="function"?a+this.$object(e.toJSON()):this.serializeObjectEntries(a,Object.entries(e))}serializeObjectEntries(e,o){const n=Array.from(o).sort((i,y)=>this.compare(i[0],y[0]));let a=`${e}{`;for(let i=0;i<n.length;i++){const[y,g]=n[i];a+=`${y}:`,a+=this.serialize(g),i<n.length-1&&(a+=",")}return a+"}"}$object(e){let o=this.#e.get(e);return o===void 0&&(this.#e.set(e,`#${this.#e.size}`),o=this.serializeObject(e),this.#e.set(e,o)),o}$function(e){const o=Function.prototype.toString.call(e);return o.slice(-15)==="[native code] }"?`${e.name||""}()[native]`:`${e.name}(${e.length})${o.replace(/\s*\n\s*/g,"")}`}$Array(e){let o="[";for(let n=0;n<e.length;n++)o+=this.serialize(e[n]),n<e.length-1&&(o+=",");return o+"]"}$Date(e){try{return`Date(${e.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(e){return`ArrayBuffer[${Array.prototype.slice.call(new Uint8Array(e)).join(",")}]`}$Set(e){return`Set${this.$Array(Array.from(e).sort((o,n)=>this.compare(o,n)))}`}$Map(e){return this.serializeObjectEntries("Map",e.entries())}}for(const s of["Error","RegExp","URL"])_.prototype["$"+s]=function(e){return`${s}(${e})`};for(const s of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])_.prototype["$"+s]=function(e){return`${s}[${Array.prototype.slice.call(e).join(",")}]`};for(const s of["BigInt64Array","BigUint64Array"])_.prototype["$"+s]=function(e){return`${s}[${Array.prototype.slice.call(e).map(o=>`${o}n`).join(",")}]`};return _}(),Ze=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],He=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",G=[];class Ye{_data=new H;_hash=new H([...Ze]);_nDataBytes=0;_minBufferSize=0;finalize(s){s&&this._append(s);const e=this._nDataBytes*8,o=this._data.sigBytes*8;return this._data.words[o>>>5]|=128<<24-o%32,this._data.words[(o+64>>>9<<4)+14]=Math.floor(e/4294967296),this._data.words[(o+64>>>9<<4)+15]=e,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(s,e){const o=this._hash.words;let n=o[0],a=o[1],i=o[2],y=o[3],g=o[4],w=o[5],D=o[6],M=o[7];for(let k=0;k<64;k++){if(k<16)G[k]=s[e+k]|0;else{const x=G[k-15],p=(x<<25|x>>>7)^(x<<14|x>>>18)^x>>>3,B=G[k-2],P=(B<<15|B>>>17)^(B<<13|B>>>19)^B>>>10;G[k]=p+G[k-7]+P+G[k-16]}const C=g&w^~g&D,d=n&a^n&i^a&i,h=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),u=(g<<26|g>>>6)^(g<<21|g>>>11)^(g<<7|g>>>25),c=M+u+C+He[k]+G[k],$=h+d;M=D,D=w,w=g,g=y+c|0,y=i,i=a,a=n,n=c+$|0}o[0]=o[0]+n|0,o[1]=o[1]+a|0,o[2]=o[2]+i|0,o[3]=o[3]+y|0,o[4]=o[4]+g|0,o[5]=o[5]+w|0,o[6]=o[6]+D|0,o[7]=o[7]+M|0}_append(s){typeof s=="string"&&(s=H.fromUtf8(s)),this._data.concat(s),this._nDataBytes+=s.sigBytes}_process(s){let e,o=this._data.sigBytes/64;s?o=Math.ceil(o):o=Math.max((o|0)-this._minBufferSize,0);const n=o*16,a=Math.min(n*4,this._data.sigBytes);if(n){for(let i=0;i<n;i+=16)this._doProcessBlock(this._data.words,i);e=this._data.words.splice(0,n),this._data.sigBytes-=a}return new H(e,a)}}class H{words;sigBytes;constructor(s,e){s=this.words=s||[],this.sigBytes=e===void 0?s.length*4:e}static fromUtf8(s){const e=unescape(encodeURIComponent(s)),o=e.length,n=[];for(let a=0;a<o;a++)n[a>>>2]|=(e.charCodeAt(a)&255)<<24-a%4*8;return new H(n,o)}toBase64(){const s=[];for(let e=0;e<this.sigBytes;e+=3){const o=this.words[e>>>2]>>>24-e%4*8&255,n=this.words[e+1>>>2]>>>24-(e+1)%4*8&255,a=this.words[e+2>>>2]>>>24-(e+2)%4*8&255,i=o<<16|n<<8|a;for(let y=0;y<4&&e*8+y*6<this.sigBytes*8;y++)s.push(Qe.charAt(i>>>6*(3-y)&63))}return s.join("")}concat(s){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let e=0;e<s.sigBytes;e++){const o=s.words[e>>>2]>>>24-e%4*8&255;this.words[this.sigBytes+e>>>2]|=o<<24-(this.sigBytes+e)%4*8}else for(let e=0;e<s.sigBytes;e+=4)this.words[this.sigBytes+e>>>2]=s.words[e>>>2];this.sigBytes+=s.sigBytes}}function et(_){return new Ye().finalize(_).toBase64()}function tt(_){return et(We(_))}const nt=W({__name:"AssetFontPreview",props:{asset:{}},setup(_){const s=_,e=I(()=>`devtools-assets-${tt(s.asset)}`);return he(I(()=>`
|
|
2
|
-
@font-face {
|
|
3
|
-
font-family: '${e.value}';
|
|
4
|
-
src: url('${s.asset.publicPath}');
|
|
5
|
-
}
|
|
6
|
-
`)),(o,n)=>(r(),f("div",{"of-hidden":"",style:re({fontFamily:`'${e.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))}}),ot={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},st=["src"],lt={key:2,"i-carbon-document":"","text-3xl":"",op20:""},at={key:3,"w-full":"","self-start":"",p4:""},it=["textContent"],rt={key:4},ut=["src","autoplay","controls"],dt={key:5},ct={key:0,"i-carbon-volume-up":"","text-3xl":"",op20:""},pt=["src"],mt={key:6,"i-carbon-help":"","text-3xl":"",op20:""},ue=W({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(_){return(s,e)=>{const o=nt;return r(),f("div",ot,[s.asset.type==="image"?(r(),f("img",{key:0,src:s.asset.publicPath},null,8,st)):s.asset.type==="font"?(r(),F(o,{key:s.asset.publicPath,asset:s.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):s.asset.type==="text"&&!s.textContent?(r(),f("div",lt)):s.asset.type==="text"&&s.textContent?(r(),f("div",at,[l("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:N(s.textContent)},null,8,it)])):s.asset.type==="video"?(r(),f("div",rt,[l("video",{src:s.asset.publicPath,autoplay:s.detail,controls:s.detail},null,8,ut)])):s.asset.type==="audio"?(r(),f("div",dt,[s.detail?(r(),f("audio",{key:1,src:s.asset.publicPath,controls:""},null,8,pt)):(r(),f("div",ct))])):(r(),f("div",mt))])}}}),ft={relative:"",flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},vt={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},ht=W({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(_){const s=_,e=I(()=>s.folder&&s.asset.path.startsWith(s.folder)?s.asset.path.slice(s.folder.length):s.asset.path);return(o,n)=>{const a=se,i=ue;return r(),f("button",ft,[o.asset.layer?(r(),F(a,{key:0,icon:"i-carbon-layers",absolute:"","right-4":"","top-4":"","bg-primary":""})):U("",!0),v(i,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:o.asset},null,8,["asset"]),l("div",vt,N(e.value),1)])}}}),de=W({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(_,{emit:s}){const e=_,n=ne(e,"modelValue",s,{passive:!0}),a=I(()=>e.item?.children?.length),i=E(!0),y=I(()=>a.value?"i-carbon-folder":e.item.type==="image"?"i-carbon-image":e.item.type==="video"?"i-carbon-video":e.item.type==="audio"?"i-carbon-volume-up":e.item.type==="font"?"i-carbon-text-small-caps":e.item.type==="text"?"i-carbon-document":e.item.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(g,w)=>{const D=se,M=de;return r(),f("div",null,[l("button",{flex:"~ gap-2","w-full":"","items-center":"",hover:"bg-active",px4:"",py1:"",style:re({paddingLeft:`calc(1rem + ${g.index*1.5}em)`}),class:Y({"bg-active":!a.value&&b(n)?.filePath===g.item?.filePath}),border:"b base",onClick:w[0]||(w[0]=k=>a.value?i.value=!i.value:n.value=g.item)},[l("div",{class:Y(y.value)},null,2),l("span",{class:Y({"flex items-center":a.value}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},[S(N(g.item.path)+" ",1),g.item.layer?(r(),F(D,{key:0,icon:"i-carbon-layers","bg-primary":""})):U("",!0)],2),a.value?(r(),F(D,{key:0,icon:"carbon:chevron-right","transform-rotate":i.value?90:0,transition:""},null,8,["transform-rotate"])):U("",!0)],6),i.value?De(g.$slots,"default",{key:0},()=>[(r(!0),f(L,null,J(g.item?.children,k=>(r(),F(M,{key:k.filepath,modelValue:b(n),"onUpdate:modelValue":w[1]||(w[1]=C=>je(n)?n.value=C:null),item:k,index:g.index+1},null,8,["modelValue","item","index"]))),128))]):U("",!0)])}}}),gt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},yt={flex:"~","items-center":"","justify-center":""},bt={"max-w-full":"","w-full":"","table-fixed":""},wt={flex:"~ gap-1","w-full":"","items-center":""},_t={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},xt={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},$t={capitalize:""},kt={key:0},Ct={op70:""},At={flex:"~ gap2 wrap"},Bt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Pt={flex:"~ gap2 wrap justify-center"},Vt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Dt={flex:"~ gap2 wrap justify-center"},jt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},Ft={flex:"","justify-end":"","gap-4":""},St=W({__name:"AssetDetails",props:{modelValue:{}},setup(_,{emit:s}){const n=ne(_,"modelValue",s,{passive:!0}),a=ae(async()=>{if(n.value.type==="image")return X.getImageMeta(await Z(),n.value.filePath)}),i=E(!1),y=E(),g=E(0),w=ae(async()=>{if(n.value.type!=="text")return;g.value;const m=await X.getTextAssetContent(await Z(),n.value.filePath);return y.value=m,m});async function D(){if(w.value!==y.value)try{await X.writeStaticAssets(await Z(),[{path:n.value.path,content:y.value,override:!0}],""),i.value=!1,g.value++,R({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch(m){console.error(m),R({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const M=ge(),k=I(()=>(M.value?._installedModules||[]).some(t=>t.meta?.name==="@nuxt/image"||t.meta?.name==="@nuxt/image-edge"||t.meta?.name==="@nuxt/image-nightly")),C=I(()=>{const m=[];if(n.value.type==="image"){const t=a.value?.width?`
|
|
7
|
-
width="${a.value.width}"
|
|
8
|
-
height="${a.value.height}" `:" ";return m.push({lang:"vue-html",code:`<img${t}
|
|
9
|
-
src="${n.value.publicPath}"
|
|
10
|
-
/>`,name:"Plain Image"}),k.value&&m.push({lang:"vue-html",code:`<NuxtImg${t}
|
|
11
|
-
src="${n.value.publicPath}"
|
|
12
|
-
/>`,name:"Nuxt Img",docs:"https://image.nuxt.com/usage/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${t}
|
|
13
|
-
src="${n.value.publicPath}"
|
|
14
|
-
/>`,name:"Nuxt Picture",docs:"https://image.nuxt.com/usage/nuxt-picture"}),m}return m.push({lang:"html",code:`<a download href="${n.value.publicPath}">
|
|
15
|
-
Download ${n.value.path.split("/").slice(-1)[0]}
|
|
16
|
-
</a>`,name:"Download link"}),m}),d=ye(),h=be(),u=we(()=>n.value.mtime),c=I(()=>{const m=n.value.size;return m<1024?`${m} B`:m<1024*1024?`${(m/1024).toFixed(2)} KB`:`${(m/1024/1024).toFixed(2)} MB`}),$=I(()=>{if(!a.value?.width||!a.value?.height)return"";const m=(V,O)=>O?m(O,V%O):V,t=m(a.value.width,a.value.height);return t>3?`${a.value.width/t}:${a.value.height/t}`:""}),x=I(()=>["image","text","video","audio","font"].includes(n.value.type)),p=E(!1);async function B(){try{await X.deleteStaticAsset(await Z(),n.value.filePath),n.value=void 0,p.value=!1,R({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch(m){console.error(m),R({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const P=E(!1),T=E("");async function K(){const m=n.value.filePath.split("/"),t=m.slice(-1)[0].split(".").slice(0,-1).join(".");if(!T.value||T.value===t)return R({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const V=m.slice(-1)[0].split(".").slice(-1)[0],O=`${m.slice(0,-1).join("/")}/${T.value}.${V}`;await X.renameStaticAsset(await Z(),n.value.filePath,O),n.value=void 0,P.value=!1,R({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch(V){console.error(V),R({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(m,t)=>{const V=ue,O=ze,z=oe,ce=Ue,ee=_e,pe=ie,te=le("tooltip");return r(),f(L,null,[l("div",gt,[x.value?(r(),f(L,{key:0},[t[13]||(t[13]=l("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[l("div",{"x-divider":""}),l("div",{"flex-none":""}," Preview "),l("div",{"x-divider":""})],-1)),l("div",yt,[v(V,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:b(n),"text-content":b(w)},null,8,["asset","text-content"])])],64)):U("",!0),t[25]||(t[25]=l("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[l("div",{"x-divider":""}),l("div",{"flex-none":""}," Details "),l("div",{"x-divider":""})],-1)),l("table",bt,[l("tbody",null,[l("tr",null,[t[14]||(t[14]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1)),l("td",null,[l("div",wt,[v(O,{filepath:b(n).filePath,"text-left":""},null,8,["filepath"]),q(v(z,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",border:!1,onClick:t[0]||(t[0]=j=>b(h)(b(n).filePath))},null,512),[[te,"Open in Editor"]])])])]),l("tr",null,[t[15]||(t[15]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1)),l("td",null,[l("div",_t,[l("div",xt,N(b(n).publicPath),1),q(v(z,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",border:!1,onClick:t[1]||(t[1]=j=>b(d)(b(n).publicPath,"assets-public-path"))},null,512),[[te,"Copy public path"]]),q(v(z,{"flex-none":"",to:b(n).publicPath,icon:"carbon-launch",target:"_blank",border:!1,title:"Open in browser"},null,8,["to"]),[[te,"Open in browser"]])])])]),l("tr",null,[t[16]||(t[16]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1)),l("td",$t,N(b(n).type),1)]),b(a)?.width?(r(),f(L,{key:0},[l("tr",null,[t[17]||(t[17]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1)),l("td",null,N(b(a).width)+" x "+N(b(a).height),1)]),$.value?(r(),f("tr",kt,[t[18]||(t[18]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1)),l("td",null,N($.value),1)])):U("",!0)],64)):U("",!0),l("tr",null,[t[19]||(t[19]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1)),l("td",null,N(c.value),1)]),l("tr",null,[t[20]||(t[20]=l("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1)),l("td",null,[S(N(new Date(b(n).mtime).toLocaleString())+" ",1),l("span",Ct,"("+N(b(u))+")",1)])])])]),t[26]||(t[26]=l("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[l("div",{"x-divider":""}),l("div",{"flex-none":""}," Actions "),l("div",{"x-divider":""})],-1)),l("div",At,[v(z,{to:b(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:A(()=>t[21]||(t[21]=[S(" Download ")])),_:1},8,["to"]),b(n).type==="text"?(r(),F(z,{key:0,icon:"carbon-edit",n:"cyan",onClick:t[2]||(t[2]=j=>i.value=!i.value)},{default:A(()=>t[22]||(t[22]=[S(" Edit ")])),_:1})):U("",!0),v(z,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:t[3]||(t[3]=j=>P.value=!P.value)},{default:A(()=>t[23]||(t[23]=[S(" Rename ")])),_:1}),v(z,{icon:"carbon-delete",n:"red",onClick:t[4]||(t[4]=j=>p.value=!p.value)},{default:A(()=>t[24]||(t[24]=[S(" Delete ")])),_:1})]),t[27]||(t[27]=l("div",{"flex-auto":""},null,-1)),C.value.length?(r(),F(ce,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":C.value},null,8,["code-snippets"])):U("",!0)]),v(ee,{modelValue:p.value,"onUpdate:modelValue":t[6]||(t[6]=j=>p.value=j)},{default:A(()=>[l("div",Bt,[t[30]||(t[30]=l("span",null," Are you sure you want to delete this asset? ",-1)),l("div",Pt,[v(z,{icon:"carbon-close",onClick:t[5]||(t[5]=j=>p.value=!1)},{default:A(()=>t[28]||(t[28]=[S(" Cancel ")])),_:1}),v(z,{icon:"carbon-delete",n:"red",onClick:B},{default:A(()=>t[29]||(t[29]=[S(" Delete ")])),_:1})])])]),_:1},8,["modelValue"]),v(ee,{modelValue:P.value,"onUpdate:modelValue":t[9]||(t[9]=j=>P.value=j)},{default:A(()=>[l("div",Vt,[v(pe,{modelValue:T.value,"onUpdate:modelValue":t[7]||(t[7]=j=>T.value=j),placeholder:"New name",n:"blue"},null,8,["modelValue"]),l("div",Dt,[v(z,{icon:"carbon-close",onClick:t[8]||(t[8]=j=>P.value=!1)},{default:A(()=>t[31]||(t[31]=[S(" Cancel ")])),_:1}),v(z,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:K},{default:A(()=>t[32]||(t[32]=[S(" Rename ")])),_:1})])])]),_:1},8,["modelValue"]),b(n).type==="text"?(r(),F(ee,{key:0,modelValue:i.value,"onUpdate:modelValue":t[12]||(t[12]=j=>i.value=j)},{default:A(()=>[l("div",jt,[q(l("textarea",{"onUpdate:modelValue":t[10]||(t[10]=j=>y.value=j),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:Se(D,["enter"])},null,544),[[Fe,y.value]]),l("div",Ft,[v(z,{icon:"carbon-close",onClick:t[11]||(t[11]=j=>i.value=!1)},{default:A(()=>t[33]||(t[33]=[S(" Cancel ")])),_:1}),v(z,{icon:"carbon:save",n:"primary",onClick:D},{default:A(()=>t[34]||(t[34]=[S(" save ")])),_:1})])])]),_:1},8,["modelValue"])):U("",!0)],64)}}}),Nt={"h-full":"","of-auto":""},zt={"flex-none":"",flex:"~ gap2 items-center","text-lg":""},Ut={flex:"~ items-center justify-center",absolute:"","bottom--1":"","right--1":"","h-4":"","w-4":"","rounded-full":"","bg-primary:30":"","text-8px":""},It={flex:"~ col","w-30":"","of-auto":""},Ot={"text-xs":"",op75:""},Et={op50:""},Tt={key:0},Mt={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Lt={key:1,p2:"",grid:"~ cols-minmax-8rem"},Rt={key:1},ln=W({__name:"assets",setup(_){const s=xe(),e=E(!1),o=E(""),n=I(()=>new $e(s.value||[],{keys:["path"]})),a=ke(()=>{const C=[];for(const d of s.value||[]){const h=d.path.split(".").pop();h&&!C.find(u=>u.name===h)&&C.push({name:h,value:!0})}return C}),i=I(()=>(o.value?n.value.search(o.value).map(d=>d.item):s.value||[]).filter(d=>{const h=d.path.split(".").pop();return!h||a.some(u=>u.name===h&&u.value)})),y=I(()=>{const C={};for(const d of i.value){const h=`${d.path.split("/").slice(0,-1).join("/")}/`;C[h]||(C[h]=[]),C[h].push(d)}return Object.entries(C).sort(([d],[h])=>d.localeCompare(h))}),g=I(()=>{const C={children:[]},d=(h,u,c)=>{const[$,...x]=u;let p=h.children.find(B=>B.path===$);p||(p={...c,path:$,children:[]},h.children.push(p)),x.length>1?d(p,x,c):x.length===1&&p.children.push({...c,path:x[0]})};return i.value.forEach(h=>{const u=h.path.split("/").filter(c=>c!=="");d(C,u,h)}),C.children}),w=E(),{view:D}=Ce("assets");function M(){D.value=D.value==="list"?"grid":"list"}Ae("Escape",()=>{w.value=void 0});const k=E();return(C,d)=>{const h=oe,u=Be,c=Pe,$=Ve,x=Je,p=ht,B=Ne,P=de,T=St,K=Ie,m=le("tooltip");return r(),f("div",Nt,[v($,{ref_key:"navbar",ref:k,search:o.value,"onUpdate:search":d[1]||(d[1]=t=>o.value=t),pb2:""},{actions:A(()=>[l("div",zt,[q(v(h,{icon:"carbon:cloud-upload",title:"File Upload",border:!1,onClick:d[0]||(d[0]=t=>e.value=!e.value)},null,512),[[m,"File Upload",void 0,{"bottom-end":!0}]]),b(a).length?(r(),F(c,{key:0,direction:"end",n:"sm primary"},{trigger:A(({click:t})=>[q(v(h,{icon:"carbon-filter",border:!1,title:"Filter",p3:"","text-lg":"",onClick:V=>t()},null,8,["onClick"]),[[m,"Filter",void 0,{"bottom-end":!0}]]),l("span",Ut,N(b(a).length),1)]),default:A(()=>[l("div",It,[(r(!0),f(L,null,J(b(a),t=>(r(),F(u,{key:t.name,modelValue:t.value,"onUpdate:modelValue":V=>t.value=V,flex:"~ gap-2",rounded:"",px2:"",py2:""},{default:A(()=>[l("span",Ot,N(t.name),1)]),_:2},1032,["modelValue","onUpdate:modelValue"]))),128))])]),_:1})):U("",!0),q(v(h,{"text-lg":"",border:!1,icon:b(D)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:M},null,8,["icon"]),[[m,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:A(()=>[l("div",Et,[o.value?(r(),f("span",Tt,N(i.value.length)+" matched · ",1)):U("",!0),l("span",null,N(b(s)?.length)+" assets in total",1)])]),_:1},8,["search"]),v(x,{modelValue:e.value,"onUpdate:modelValue":d[2]||(d[2]=t=>e.value=t),folder:"/"},null,8,["modelValue"]),b(D)==="grid"?(r(),f(L,{key:0},[y.value.length>1?(r(!0),f(L,{key:0},J(y.value,([t,V])=>(r(),F(B,{key:t,text:t,description:`${V.length} items`,open:V.length<=b(Oe),padding:!1},{default:A(()=>[l("div",Mt,[(r(!0),f(L,null,J(V,O=>(r(),F(p,{key:O.path,asset:O,folder:t,onClick:z=>w.value=O},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(r(),f("div",Lt,[(r(!0),f(L,null,J(i.value,t=>(r(),F(p,{key:t.path,asset:t,onClick:V=>w.value=t},null,8,["asset","onClick"]))),128))]))],64)):(r(),f("div",Rt,[(r(!0),f(L,null,J(g.value,(t,V)=>(r(),F(P,{key:V,modelValue:w.value,"onUpdate:modelValue":d[3]||(d[3]=O=>w.value=O),item:t},null,8,["modelValue","item"]))),128))])),v(K,{"model-value":!!w.value,"auto-close":"","w-120":"",top:k.value,onClose:d[5]||(d[5]=t=>w.value=void 0)},{default:A(()=>[w.value?(r(),F(T,{key:0,modelValue:w.value,"onUpdate:modelValue":d[4]||(d[4]=t=>w.value=t)},null,8,["modelValue"])):U("",!0)]),_:1},8,["model-value","top"])])}}});export{ln as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"b7da869e-e0a9-4d4c-a2f3-5ddb290c30d3","timestamp":1741018020769,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as ie,_ as O,Q as pe,R as re,J as ue,S as de,g as Y,T as me,U as ce,V as fe,N as ve,W as _e,X as he,E as be,f as ge}from"./dckvv1o7.js";import{P as d,a1 as o,Q as n,p as I,q as P,a9 as q,a8 as W,R as w,U as H,a3 as u,S as y,u as $,F as T,ae as M,f as U,m as ye,E as we,j as xe,a2 as f,C as z,Y as ke,X as Ce,a4 as A,ag as $e,aa as J,ad as Ne}from"./vendor/json-editor-vue-llkaejaf.js";import{_ as Ve}from"./help-fab.vue-fz7s38mz.js";import{_ as Pe}from"./ncheckbox.vue-dizdk93x.js";import{_ as K}from"./nnavbar.vue-ip749nge.js";import{p as Z}from"./index-jc4yj4to.js";import{_ as ee}from"./nbadge-j0lg4rvs.js";import{_ as ne}from"./filepath-item.vue-iltgx83i.js";import{_ as Se}from"./ndrawer.vue-iqsqqdsc.js";import{N as De}from"./vendor/vis-7ar5f2fs.js";import{_ as Te}from"./nselect-tabs.vue-kbdbbl1a.js";import{_ as Be}from"./nsection-block-ez4av87h.js";import{_ as Le}from"./nicon-title.vue-dsf9ygne.js";import{D as j}from"./constants-b32h69zq.js";import{u as Me,a as Ue}from"./state-components-o1o8du1g.js";import"./vendor/unocss-mvzv9iuf.js";import"./vendor/shiki-kdj4mcqm.js";const Ie={class:"markdown-body"},Fe={__name:"components",setup(V,{expose:s}){return s({frontmatter:{}}),(i,c)=>(o(),d("div",Ie,c[0]||(c[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)])))}},Ge={"text-sm":"","font-mono":""},oe=I({__name:"ComponentName",props:{component:{}},setup(V){const s=V,v=P(()=>s.component.pascalName||Z(s.component.name||s.component.__name||s.component.kebabName||""));return(i,c)=>(o(),d("code",Ge,[c[0]||(c[0]=n("span",{mr1:"",op20:""},"<",-1)),q(W(v.value),1),c[1]||(c[1]=n("span",{ml1:"",op20:""},"/>",-1))]))}}),Re={flex:"~ col gap1","items-start":"","of-hidden":""},ze={flex:"~ gap2",px3:""},Ee={px3:"",pb2:""},Ae={key:0,border:"t base","max-h-60":"","w-full":"","of-auto":"",px3:"",py3:""},We={"text-sm":""},He={"text-primary":""},Xe={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:""},qe={"text-sm":""},Oe={"text-primary":""},Qe={key:0,flex:"~ col gap-2","items-start":"",pt3:"","text-sm":"",op75:""},te=I({__name:"ComponentDetails",props:{component:{},dependencies:{},dependents:{}},setup(V){const s=V,v=P(()=>s.component.pascalName||Z(s.component.name||s.component.__name||s.component.kebabName||"")),i=P(()=>s.component.filePath||s.component.file||s.component.__file||""),c=ie();return(l,a)=>{const h=oe,r=O,b=ee,x=ne;return o(),d("div",Re,[n("div",ze,[u(h,{component:l.component},null,8,["component"]),u(r,{title:"Copy name","flex-none":"",icon:"carbon-copy",border:!1,onClick:a[0]||(a[0]=m=>$(c)(`<${v.value}></${v.value}>`,"component-name"))}),l.component.global?(o(),y(b,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"runtime"})):w("",!0)]),n("div",Ee,[i.value?(o(),y(x,{key:0,filepath:i.value,"w-full":"","text-sm":"",op40:"","group-hover:op75":""},null,8,["filepath"])):w("",!0)]),l.dependents?(o(),d("div",Ae,[n("div",We,[n("strong",He,W(l.dependents.length),1),a[1]||(a[1]=n("span",{op50:""}," references",-1))]),l.dependents.length?(o(),d("div",Xe,[(o(!0),d(T,null,M(l.dependents,m=>(o(),y(x,{key:m,filepath:m},null,8,["filepath"]))),128))])):w("",!0)])):w("",!0),l.dependencies?(o(),d("div",je,[n("div",qe,[n("strong",Oe,W(l.dependencies.length),1),a[2]||(a[2]=n("span",{op50:""}," dependencies",-1))]),l.dependencies.length?(o(),d("div",Qe,[(o(!0),d(T,null,M(l.dependencies,m=>(o(),y(x,{key:m,filepath:m},null,8,["filepath"]))),128))])):w("",!0)])):w("",!0),H(l.$slots,"default")])}}}),Je={flex:"~ gap-x-3 gap-y-1 wrap","w-full":""},Ye={relative:"","h-full":"","w-full":""},Ke={key:0,py4:"",pt4:"",flex:"~ col"},Ze={border:"t base",p4:""},en=I({__name:"ComponentsGraph",props:{components:{},relationships:{}},setup(V){const s=V,v=U(),i=U(),c=pe(),l=ye(),a=re(),h=ue(),r=de(),{componentsGraphShowNodeModules:b,componentsGraphShowGlobalComponents:x,componentsGraphShowPages:m,componentsGraphShowLayouts:N,componentsGraphShowWorkspace:_}=Y("ui"),k=U(),p=U(""),F=me(p,300),G=P(()=>{const S=s.relationships||[];if(k.value){let e=function(C){!C||t.has(C)||(t.add(C),C.deps.forEach(B=>{e(S.find(L=>L.id===B))}))};const t=new Set;return e(k.value),Array.from(t)}return S}),E=P(()=>{const S=G.value.map(t=>{const C=s.components.find(R=>R.filePath===t.id),B=a.value?.find(R=>R.file===t.id),L=r.value?.find(R=>R.file===t.id),X=t.id.replace(/\?.*$/,"").replace(/#.*$/,""),D=t.id.includes("/node_modules/")?"lib":C?C.global?"global":"user":L?"layout":B?"page":"unknown";if(!b.value&&D==="lib"||!m.value&&D==="page"||!N.value&&D==="layout"||!_.value&&D==="user"&&h.value&&!t.id.startsWith(h.value.rootDir)||!x.value&&D==="global")return null;const g=D==="layout"?"hexagon":D==="page"?"square":"dot",Q=F.value&&!t.id.toLowerCase().includes(F.value.toLowerCase());return{id:t.id,label:X.split("/").splice(-1)[0].replace(/\.\w+$/,""),group:D,shape:g,size:15+Math.min(t.deps.length/2,8),font:{color:Q?"#8885":c.value==="dark"?"white":"black"},color:Q?"#8885":k.value?.id===t.id?"#82c742":void 0,extra:{id:t.id,component:C,page:B,layout:L,relationship:t}}}).filter(t=>!!t),e=G.value.flatMap(t=>t.deps.map(C=>({from:t.id,to:C,arrows:{to:{enabled:!0,scaleFactor:.8}}})));return{nodes:S,edges:e}}),se=P(()=>l.value?.component?s.relationships?.find(e=>e.id===l.value?.component?.filePath)?.deps?.map(e=>s.relationships?.find(t=>t.id===e)?.id).filter(Boolean):[]),le=P(()=>l.value?.component?s.relationships?.filter(e=>e.deps.includes(l.value.component.filePath))?.map(e=>s.relationships?.find(t=>t.id===e.id)?.id).filter(Boolean):[]);we(()=>{const S={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(v.value,E.value,S);e.on("click",t=>{const C=t.nodes?.[0],B=E.value.nodes?.find(L=>L.id===C)?.extra;B&&(l.value=B)}),xe(E,()=>{e.setData(E.value)})});function ae(){k.value=l.value?.relationship,l.value=void 0}return(S,e)=>{const t=Pe,C=K,B=ce,L=te,X=O,D=Se;return o(),d(T,null,[u(C,{ref_key:"navbar",ref:i,search:p.value,"onUpdate:search":e[6]||(e[6]=g=>p.value=g),absolute:"","left-0":"","right-0":"","top-0":""},{actions:f(()=>[n("div",Je,[u(t,{modelValue:$(m),"onUpdate:modelValue":e[0]||(e[0]=g=>z(m)?m.value=g:null),n:"primary sm"},{default:f(()=>e[9]||(e[9]=[n("span",{op75:""},"Show pages",-1)])),_:1},8,["modelValue"]),u(t,{modelValue:$(N),"onUpdate:modelValue":e[1]||(e[1]=g=>z(N)?N.value=g:null),n:"primary sm"},{default:f(()=>e[10]||(e[10]=[n("span",{op75:""},"Show layouts",-1)])),_:1},8,["modelValue"]),u(t,{modelValue:$(_),"onUpdate:modelValue":e[2]||(e[2]=g=>z(_)?_.value=g:null),n:"primary sm"},{default:f(()=>e[11]||(e[11]=[n("span",{op75:""},"Show workspace",-1)])),_:1},8,["modelValue"]),u(t,{modelValue:$(b),"onUpdate:modelValue":e[3]||(e[3]=g=>z(b)?b.value=g:null),n:"primary sm"},{default:f(()=>e[12]||(e[12]=[n("span",{op75:""},"Show node_modules",-1)])),_:1},8,["modelValue"]),u(t,{modelValue:$(x),"onUpdate:modelValue":e[4]||(e[4]=g=>z(x)?x.value=g:null),n:"primary sm"},{default:f(()=>e[13]||(e[13]=[n("span",{op75:""},"Show global components",-1)])),_:1},8,["modelValue"])]),k.value?(o(),d("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]=g=>k.value=void 0)},e[14]||(e[14]=[q(" Clear filter "),n("div",{"i-carbon-close":""},null,-1)]))):w("",!0),e[15]||(e[15]=n("div",{"flex-auto":""},null,-1)),H(S.$slots,"default")]),_:3},8,["search"]),n("div",Ye,[n("div",{ref_key:"container",ref:v,"h-full":"","w-full":""},null,512),u(B,{absolute:"","bottom-3":"","left-3":"","border-0":"",p2:"",px3:"","text-sm":"","n-glass-effect":""},{default:f(()=>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}),u(D,{"model-value":!!(l.value&&l.value.component),top:i.value,border:"t l base","w-80":"",onClose:e[8]||(e[8]=g=>l.value=void 0)},{default:f(()=>[l.value&&l.value.component?(o(),d("div",Ke,[u(L,{component:l.value.component,dependencies:se.value,dependents:le.value},null,8,["component","dependencies","dependents"]),n("div",Ze,[u(X,{n:"primary solid",onClick:e[7]||(e[7]=g=>ae())},{default:f(()=>e[17]||(e[17]=[q(" Filter to this component ")])),_:1})])])):w("",!0)]),_:1},8,["model-value","top"])])],64)}}}),nn={hover:"bg-active",class:"group",flex:"~ gap2","w-full":"","items-center":"",rounded:"",px2:"",py1:""},on={key:0,"ml--1":"","text-primary":""},tn=I({__name:"ComponentItem",props:{component:{},dependencies:{},dependents:{}},setup(V){const s=V,v=P(()=>s.component.filePath||s.component.file||s.component.__file||"");return(i,c)=>{const l=oe,a=te,h=ke("VDropdown"),r=ee,b=ne;return o(),d("div",nn,[u(h,null,{popper:f(()=>[u(a,{component:i.component,dependencies:i.dependencies,dependents:i.dependents,"w-100":"",pt4:""},null,8,["component","dependencies","dependents"])]),default:f(()=>[n("button",{"hover:text-primary":"",class:Ce(i.dependents&&i.dependents.length===0?"op50":"")},[u(l,{component:i.component},null,8,["component"])],2)]),_:1}),i.dependents?.length?(o(),d("sup",on," x"+W(i.dependents?.length),1)):w("",!0),i.component.global?(o(),y(r,{key:1,n:"green",title:"Registered at runtime as a global component",textContent:"runtime"})):w("",!0),H(i.$slots,"default"),v.value?(o(),y(b,{key:2,filepath:v.value,"text-sm":"",op25:"","group-hover:op75":""},null,8,["filepath"])):w("",!0)])}}}),sn={flex:"~ gap-2 items-center"},ln={pl4:""},an=I({__name:"ComponentsList",props:{components:{},relationships:{}},setup(V){const s=V,v=U(""),i=U("all"),c=P(()=>{const h=s.components.map(r=>fe(r,s.relationships));return i.value==="using"?h.filter(r=>r.dependents?.length):i.value==="not-used"?h.filter(r=>!r.dependents?.length):h}),l=P(()=>new ve(c.value,{keys:["component.pascalName","component.filePath","component.kebabName"]})),a=P(()=>{const h=[],r=new Map,b=[],x=[],m={user:0,lib:0,builtin:0,runtime:0};return(v.value?l.value.search(v.value).map(_=>_.item):c.value).forEach(_=>{const k=_.component;if(k.filePath&&_e(k.filePath)){const p=he(k.filePath);if(!p)return;p==="nuxt"?(b.push(_),m.builtin++):(r.has(p)||r.set(p,[]),r.get(p).push(_),m.lib++)}else k.global&&!k.filePath?(x.push(_),m.runtime++):(h.push(_),m.user++)}),{count:m,user:h,builtin:b,lib:r,runtime:x}});return(h,r)=>{const b=be,x=Te,m=K,N=tn,_=Be,k=Le;return o(),d(T,null,[u(m,{search:v.value,"onUpdate:search":r[1]||(r[1]=p=>v.value=p),pb3:""},{actions:f(()=>[H(h.$slots,"default")]),default:f(()=>[n("div",sn,[u(b,{icon:"carbon-filter",op50:""}),u(x,{modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=p=>i.value=p),n:"primary sm",options:[{label:"All",value:"all"},{label:"Using",value:"using"},{label:"Not used",value:"not-used"}]},null,8,["modelValue"])])]),_:3},8,["search"]),a.value.user.length?(o(),y(_,{key:0,icon:"carbon-nominal",text:"User components",open:a.value.user.length<=$(j),description:`Total components: ${a.value.count.user}`},{default:f(()=>[(o(!0),d(T,null,M(a.value.user,p=>(o(),y(N,A({key:p.component.filePath,ref_for:!0},p),null,16))),128))]),_:1},8,["open","description"])):w("",!0),a.value.runtime.length?(o(),y(_,{key:1,icon:"carbon-load-balancer-global",open:a.value.runtime.length<=$(j),text:"Runtime components",description:`Total components: ${a.value.count.runtime}`},{default:f(()=>[(o(!0),d(T,null,M(a.value.runtime,p=>(o(),y(N,A({key:p.component.filePath,ref_for:!0},p),null,16))),128))]),_:1},8,["open","description"])):w("",!0),a.value.builtin.length?(o(),y(_,{key:2,icon:"simple-icons-nuxtdotjs",text:"Built-in components",description:`Total components: ${a.value.count.builtin}`},{default:f(()=>[(o(!0),d(T,null,M(a.value.builtin,p=>(o(),y(N,A({key:p.component.filePath,ref_for:!0},p),null,16))),128))]),_:1},8,["description"])):w("",!0),a.value.lib.size?(o(),y(_,{key:3,open:a.value.count.lib<=$(j),icon:"carbon-3d-mpr-toggle",text:"Components from libraries",description:`${a.value.count.lib} components from ${a.value.lib.size} packages`},{default:f(()=>[(o(!0),d(T,null,M(a.value.lib.entries(),([p,F])=>(o(),d("div",{key:p,"ml-2":""},[u(k,{text:`${p} (${F.length})`,py1:"",op50:""},null,8,["text"]),n("div",ln,[(o(!0),d(T,null,M(F,G=>(o(),y(N,A({key:G.component.filePath,ref_for:!0},G),null,16))),128))])]))),128))]),_:1},8,["open","description"])):w("",!0)],64)}}}),pn={relative:"","h-full":"","of-auto":""},rn={"flex-none":"",flex:"~ gap3"},Vn=I({__name:"components",setup(V){const s=ge(),v=Me(),i=Ue(),{componentsView:c}=Y("ui");function l(){s.value?.inspector?.instance&&s.value.inspector.enable()}function a(){c.value=c.value==="list"?"graph":"list"}return(h,r)=>{const b=O,x=Fe,m=Ve,N=$e("tooltip");return o(),d(T,null,[n("div",pn,[(o(),y(Ne($(c)==="list"?an:en),{components:$(v),relationships:$(i)},{default:f(()=>[n("div",rn,[J(u(b,{"text-lg":"",border:!1,icon:$(c)==="graph"?"i-carbon-list":"i-carbon-network-4",title:"Toggle view",onClick:a},null,8,["icon"]),[[N,"Toggle View",void 0,{"bottom-end":!0}]]),$(s)?.inspector?.instance?J((o(),y(b,{key:0,"text-lg":"",border:!1,icon:"i-tabler-focus-2",title:"Inspect Vue components",onClick:l},null,512)),[[N,"Inspect Vue components",void 0,{"bottom-end":!0}]]):w("",!0)])]),_:1},8,["components","relationships"]))]),u(m,null,{default:f(()=>[u(x)]),_:1})],64)}}});export{Vn as default};
|