@nuxt/devtools 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/README.md +1 -60
  2. package/cli.mjs +1 -1
  3. package/dist/chunks/module-main.mjs +230 -8365
  4. package/dist/chunks/vscode.mjs +12 -41561
  5. package/dist/client/200.html +2 -2
  6. package/dist/client/404.html +2 -2
  7. package/dist/client/__inspecting/index.html +2 -2
  8. package/dist/client/_nuxt/{Badge.ec308af3.js → Badge.b694092e.js} +1 -1
  9. package/dist/client/_nuxt/DrawerRight.vue.f3060893.js +1 -0
  10. package/dist/client/_nuxt/{DurationDisplay.vue.9b5b62d4.js → DurationDisplay.vue.0d7e7768.js} +1 -1
  11. package/dist/client/_nuxt/{FilepathItem.vue.178a1de3.js → FilepathItem.vue.c7d65dc2.js} +1 -1
  12. package/dist/client/_nuxt/{LaunchPage.vue.a0bbd67e.js → LaunchPage.vue.b1763741.js} +1 -1
  13. package/dist/client/_nuxt/NCheckbox.vue.f03c4497.js +1 -0
  14. package/dist/client/_nuxt/{NCodeBlock.vue.593cb41f.js → NCodeBlock.vue.f41a0d29.js} +1 -1
  15. package/dist/client/_nuxt/{NIconButton.vue.a83f99ea.js → NIconButton.vue.8aefaa88.js} +1 -1
  16. package/dist/client/_nuxt/{NIconTitle.vue.ce90e41b.js → NIconTitle.vue.6c944aa7.js} +1 -1
  17. package/dist/client/_nuxt/{NMarkdown.vue.11f68fad.js → NMarkdown.vue.ae60adfb.js} +1 -1
  18. package/dist/client/_nuxt/NSectionBlock.cef5b3bf.js +1 -0
  19. package/dist/client/_nuxt/{NSelect.vue.e19311d6.js → NSelect.vue.bd089297.js} +1 -1
  20. package/dist/client/_nuxt/{NSwitch.vue.76c93e66.js → NSwitch.vue.ce97ebe7.js} +1 -1
  21. package/dist/client/_nuxt/NTextInput.vue.188f5529.js +1 -0
  22. package/dist/client/_nuxt/{NTip.vue.ac67cde4.js → NTip.vue.2f192405.js} +1 -1
  23. package/dist/client/_nuxt/{NpmVersionCheck.vue.0eab98c7.js → NpmVersionCheck.vue.2469b5b3.js} +1 -1
  24. package/dist/client/_nuxt/{NuxtLogo.38adb408.js → NuxtLogo.7b90e5d5.js} +1 -1
  25. package/dist/client/_nuxt/{PanelLeftRight.vue.90cdedcf.js → PanelLeftRight.vue.73b30819.js} +1 -1
  26. package/dist/client/_nuxt/StateEditor.vue.96fdf802.js +1 -0
  27. package/dist/client/_nuxt/{TabIcon.vue.8236980c.js → TabIcon.vue.ee21be15.js} +1 -1
  28. package/dist/client/_nuxt/{__inspecting.143a746c.js → __inspecting.6125f0dc.js} +1 -1
  29. package/dist/client/_nuxt/assets.3fa6901a.js +16 -0
  30. package/dist/client/_nuxt/assets.a19ea08e.css +1 -0
  31. package/dist/client/_nuxt/{components.1b7f02b2.js → components.5589dfe1.js} +1 -1
  32. package/dist/client/_nuxt/{context.fe69916a.js → context.10127184.js} +1 -1
  33. package/dist/client/_nuxt/custom-_name_.3535f298.js +1 -0
  34. package/dist/client/_nuxt/{default.e6b60844.js → default.20732cb9.js} +1 -1
  35. package/dist/client/_nuxt/editor.58d10855.js +1 -0
  36. package/dist/client/_nuxt/entry.2594199e.css +32 -0
  37. package/dist/client/_nuxt/{entry.216b69f8.js → entry.e1ce6ad4.js} +102 -102
  38. package/dist/client/_nuxt/{error-404.51bdc645.js → error-404.d7646546.js} +1 -1
  39. package/dist/client/_nuxt/{error-500.15ac1dfe.js → error-500.6cac56ab.js} +1 -1
  40. package/dist/client/_nuxt/{error-component.0a7a48e4.js → error-component.a8114c77.js} +2 -2
  41. package/dist/client/_nuxt/{hooks.aa487478.js → hooks.196bb064.js} +1 -1
  42. package/dist/client/_nuxt/{imports.01c0f8be.js → imports.0af9087e.js} +1 -1
  43. package/dist/client/_nuxt/{index.517491fb.js → index.6a39516e.js} +1 -1
  44. package/dist/client/_nuxt/{index.3b3b7aca.js → index.ce8efa93.js} +1 -1
  45. package/dist/client/_nuxt/layouts.f9116de3.js +1 -0
  46. package/dist/client/_nuxt/{middleware.e73473f1.js → middleware.6a82419a.js} +1 -1
  47. package/dist/client/_nuxt/{modules.304ea21e.js → modules.44c94367.js} +1 -1
  48. package/dist/client/_nuxt/{none.3e2499ec.js → none.c8faecb4.js} +1 -1
  49. package/dist/client/_nuxt/{overview.b79bf694.js → overview.8e443c04.js} +1 -1
  50. package/dist/client/_nuxt/{pages.fafa9fe0.js → pages.0df70537.js} +1 -1
  51. package/dist/client/_nuxt/{payload.ee430f3a.js → payload.a31b3317.js} +1 -1
  52. package/dist/client/_nuxt/{plugins.5095ec46.js → plugins.4a0a667e.js} +1 -1
  53. package/dist/client/_nuxt/{runtime-configs.b20fbeb6.js → runtime-configs.2e7a9840.js} +1 -1
  54. package/dist/client/_nuxt/{server-routes.7352d340.js → server-routes.47766769.js} +1 -1
  55. package/dist/client/_nuxt/settings.d06b4aaf.js +1 -0
  56. package/dist/client/_nuxt/{storage.2e73159a.js → storage.eb42392f.js} +1 -1
  57. package/dist/client/_nuxt/terminals.1710aa98.js +1 -0
  58. package/dist/client/_nuxt/unocss-runtime.4fc34dc6.js +2 -0
  59. package/dist/client/_nuxt/virtual-files.1b4b12ba.js +1 -0
  60. package/dist/client/index.html +2 -2
  61. package/dist/client/modules/assets/index.html +2 -2
  62. package/dist/client/modules/components/index.html +2 -2
  63. package/dist/client/modules/hooks/index.html +2 -2
  64. package/dist/client/modules/imports/index.html +2 -2
  65. package/dist/client/modules/layouts/index.html +2 -2
  66. package/dist/client/modules/middleware/index.html +2 -2
  67. package/dist/client/modules/modules/index.html +2 -2
  68. package/dist/client/modules/overview/index.html +2 -2
  69. package/dist/client/modules/pages/index.html +2 -2
  70. package/dist/client/modules/payload/index.html +2 -2
  71. package/dist/client/modules/plugins/index.html +2 -2
  72. package/dist/client/modules/runtime-configs/index.html +2 -2
  73. package/dist/client/modules/server-routes/index.html +2 -2
  74. package/dist/client/modules/storage/index.html +2 -2
  75. package/dist/client/modules/terminals/index.html +2 -2
  76. package/dist/client/modules/virtual-files/index.html +2 -2
  77. package/dist/client/settings/index.html +2 -2
  78. package/dist/module.json +1 -1
  79. package/dist/runtime/plugins/devtools.client.mjs +7 -2
  80. package/package.json +26 -25
  81. package/dist/cli.d.ts +0 -2
  82. package/dist/cli.mjs +0 -406
  83. package/dist/client/_nuxt/DrawerRight.vue.a85afa62.js +0 -1
  84. package/dist/client/_nuxt/NCheckbox.vue.4a02f339.js +0 -1
  85. package/dist/client/_nuxt/NSectionBlock.c955e75e.js +0 -1
  86. package/dist/client/_nuxt/NTextInput.vue.d770ca6c.js +0 -1
  87. package/dist/client/_nuxt/StateEditor.vue.c57dfe46.js +0 -1
  88. package/dist/client/_nuxt/assets.d6a1ab2b.js +0 -16
  89. package/dist/client/_nuxt/custom-_name_.02ebd30e.js +0 -1
  90. package/dist/client/_nuxt/editor.e10c09a2.js +0 -1
  91. package/dist/client/_nuxt/entry.654353dc.css +0 -32
  92. package/dist/client/_nuxt/icons.43eaabec.js +0 -1
  93. package/dist/client/_nuxt/icons.d5925320.js +0 -1
  94. package/dist/client/_nuxt/icons.eca62571.js +0 -1
  95. package/dist/client/_nuxt/layouts.e447e192.js +0 -1
  96. package/dist/client/_nuxt/settings.b6d3cae9.js +0 -1
  97. package/dist/client/_nuxt/terminals.65080a19.js +0 -1
  98. package/dist/client/_nuxt/unocss-runtime.5708ce83.js +0 -2
  99. package/dist/client/_nuxt/virtual-files.9eb05502.js +0 -1
  100. package/dist/shared/devtools.696fb428.mjs +0 -4
package/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@nuxt/devtools",
3
3
  "configKey": "devtools",
4
- "version": "0.3.1"
4
+ "version": "0.3.2"
5
5
  }
@@ -1,4 +1,4 @@
1
- import { createApp, markRaw } from "vue";
1
+ import { createApp, h, markRaw } from "vue";
2
2
  import { createHooks } from "hookable";
3
3
  import { setupHooksDebug } from "../shared/hooks.mjs";
4
4
  import Container from "./view/Container.vue";
@@ -37,6 +37,11 @@ export default defineNuxtPlugin((nuxt) => {
37
37
  if (e.code === "KeyD" && e.altKey && e.shiftKey)
38
38
  togglePanel();
39
39
  });
40
- const app = createApp(Container, { client });
40
+ const app = createApp({
41
+ render: () => h(Container, { client }),
42
+ devtools: {
43
+ hide: true
44
+ }
45
+ });
41
46
  app.mount(holder);
42
47
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nuxt/devtools",
3
3
  "type": "module",
4
- "version": "0.3.1",
4
+ "version": "0.3.2",
5
5
  "license": "MIT",
6
6
  "repository": "nuxt/devtools",
7
7
  "exports": {
@@ -30,33 +30,44 @@
30
30
  "vite": "*"
31
31
  },
32
32
  "dependencies": {
33
- "@nuxt/kit": "^3.3.1",
33
+ "@nuxt/kit": "^3.3.2",
34
34
  "birpc": "^0.2.10",
35
35
  "consola": "^2.15.3",
36
36
  "execa": "^7.1.1",
37
37
  "fast-glob": "^3.2.12",
38
- "h3": "^1.6.2",
39
- "hookable": "^5.5.1",
38
+ "get-port-please": "^3.0.1",
39
+ "global-dirs": "^3.0.1",
40
+ "h3": "^1.6.4",
41
+ "hookable": "^5.5.2",
40
42
  "image-meta": "^0.1.1",
41
43
  "is-installed-globally": "^0.4.0",
42
44
  "launch-editor": "^2.6.0",
43
45
  "local-pkg": "^0.4.3",
46
+ "nypm": "^0.1.0",
44
47
  "pacote": "^15.1.1",
45
48
  "pathe": "^1.1.0",
49
+ "picocolors": "^1.0.0",
46
50
  "pkg-types": "^1.0.2",
47
51
  "rc9": "^2.0.1",
48
- "unimport": "^3.0.3",
52
+ "semver": "^7.3.8",
53
+ "sirv": "^2.0.2",
54
+ "tinyws": "^0.1.0",
55
+ "unimport": "^3.0.4",
49
56
  "vite-plugin-inspect": "^0.7.18",
50
57
  "vite-plugin-vue-inspector": "^3.4.0",
51
- "@nuxt/devtools-kit": "0.3.1"
58
+ "wait-on": "^7.0.1",
59
+ "which": "^3.0.0",
60
+ "ws": "^8.13.0",
61
+ "@nuxt/devtools-kit": "0.3.2",
62
+ "@nuxt/devtools-wizard": "0.3.2"
52
63
  },
53
64
  "devDependencies": {
54
65
  "@antfu/utils": "^0.7.2",
55
66
  "@iconify-json/carbon": "^1.1.16",
56
- "@iconify-json/logos": "^1.1.23",
67
+ "@iconify-json/logos": "^1.1.24",
57
68
  "@iconify-json/mdi": "^1.1.50",
58
69
  "@iconify-json/ri": "^1.1.5",
59
- "@iconify-json/tabler": "^1.1.68",
70
+ "@iconify-json/tabler": "^1.1.69",
60
71
  "@nuxtjs/color-mode": "^3.2.0",
61
72
  "@unocss/nuxt": "^0.50.6",
62
73
  "@unocss/preset-icons": "^0.50.6",
@@ -67,36 +78,26 @@
67
78
  "flatted": "^3.2.7",
68
79
  "floating-vue": "2.0.0-beta.20",
69
80
  "fuse.js": "^6.6.2",
70
- "get-port-please": "^3.0.1",
71
- "global-dirs": "^3.0.1",
72
81
  "json-editor-vue": "^0.10.5",
73
82
  "markdown-it": "^13.0.1",
74
- "nanoid": "^4.0.1",
75
- "nuxt": "^3.3.1",
83
+ "nanoid": "^4.0.2",
84
+ "nuxt": "^3.3.2",
76
85
  "nuxt-vitest": "^0.6.9",
77
- "nypm": "^0.1.0",
78
86
  "ofetch": "^1.0.1",
79
87
  "ohash": "^1.0.0",
80
- "picocolors": "^1.0.0",
81
- "semver": "^7.3.8",
82
88
  "shiki": "^0.14.1",
83
89
  "shiki-es": "^0.2.0",
84
- "sirv": "^2.0.2",
85
90
  "splitpanes": "^3.1.5",
86
91
  "theme-vitesse": "^0.6.4",
87
- "tinyws": "^0.1.0",
88
92
  "unocss": "^0.50.6",
89
- "vanilla-jsoneditor": "^0.16.0",
90
- "vis-data": "^7.1.5",
91
- "vis-network": "^9.1.5",
92
- "vue-template-promise": "^0.1.1",
93
+ "vanilla-jsoneditor": "^0.16.1",
94
+ "vis-data": "^7.1.6",
95
+ "vis-network": "^9.1.6",
96
+ "vue-template-promise": "^0.1.3",
93
97
  "vue-tsc": "^1.2.0",
94
- "wait-on": "^7.0.1",
95
- "which": "^3.0.0",
96
- "ws": "^8.13.0",
97
98
  "xterm": "^5.1.0",
98
99
  "xterm-addon-fit": "^0.7.0",
99
- "@nuxt/devtools": "0.3.1"
100
+ "@nuxt/devtools": "0.3.2"
100
101
  },
101
102
  "scripts": {
102
103
  "build": "pnpm dev:prepare && pnpm build:module && pnpm build:client && esno scripts/prepare.ts",
package/dist/cli.d.ts DELETED
@@ -1,2 +0,0 @@
1
-
2
- export { }
package/dist/cli.mjs DELETED
@@ -1,406 +0,0 @@
1
- import fs from 'node:fs';
2
- import consola from 'consola';
3
- import { execa } from 'execa';
4
- import { readUser, writeUser } from 'rc9';
5
- import require$$1 from 'path';
6
- import require$$1$1 from 'os';
7
- import require$$0__default from 'fs';
8
- import { resolve } from 'pathe';
9
- import { n as name } from './shared/devtools.696fb428.mjs';
10
-
11
- var globalDirs = {};
12
-
13
- const { hasOwnProperty } = Object.prototype;
14
-
15
- const eol = typeof process !== 'undefined' &&
16
- process.platform === 'win32' ? '\r\n' : '\n';
17
-
18
- const encode = (obj, opt) => {
19
- const children = [];
20
- let out = '';
21
-
22
- if (typeof opt === 'string') {
23
- opt = {
24
- section: opt,
25
- whitespace: false,
26
- };
27
- } else {
28
- opt = opt || Object.create(null);
29
- opt.whitespace = opt.whitespace === true;
30
- }
31
-
32
- const separator = opt.whitespace ? ' = ' : '=';
33
-
34
- for (const k of Object.keys(obj)) {
35
- const val = obj[k];
36
- if (val && Array.isArray(val)) {
37
- for (const item of val)
38
- out += safe(k + '[]') + separator + safe(item) + '\n';
39
- } else if (val && typeof val === 'object')
40
- children.push(k);
41
- else
42
- out += safe(k) + separator + safe(val) + eol;
43
- }
44
-
45
- if (opt.section && out.length)
46
- out = '[' + safe(opt.section) + ']' + eol + out;
47
-
48
- for (const k of children) {
49
- const nk = dotSplit(k).join('\\.');
50
- const section = (opt.section ? opt.section + '.' : '') + nk;
51
- const { whitespace } = opt;
52
- const child = encode(obj[k], {
53
- section,
54
- whitespace,
55
- });
56
- if (out.length && child.length)
57
- out += eol;
58
-
59
- out += child;
60
- }
61
-
62
- return out
63
- };
64
-
65
- const dotSplit = str =>
66
- str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
67
- .replace(/\\\./g, '\u0001')
68
- .split(/\./)
69
- .map(part =>
70
- part.replace(/\1/g, '\\.')
71
- .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001'));
72
-
73
- const decode = str => {
74
- const out = Object.create(null);
75
- let p = out;
76
- let section = null;
77
- // section |key = value
78
- const re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i;
79
- const lines = str.split(/[\r\n]+/g);
80
-
81
- for (const line of lines) {
82
- if (!line || line.match(/^\s*[;#]/))
83
- continue
84
- const match = line.match(re);
85
- if (!match)
86
- continue
87
- if (match[1] !== undefined) {
88
- section = unsafe(match[1]);
89
- if (section === '__proto__') {
90
- // not allowed
91
- // keep parsing the section, but don't attach it.
92
- p = Object.create(null);
93
- continue
94
- }
95
- p = out[section] = out[section] || Object.create(null);
96
- continue
97
- }
98
- const keyRaw = unsafe(match[2]);
99
- const isArray = keyRaw.length > 2 && keyRaw.slice(-2) === '[]';
100
- const key = isArray ? keyRaw.slice(0, -2) : keyRaw;
101
- if (key === '__proto__')
102
- continue
103
- const valueRaw = match[3] ? unsafe(match[4]) : true;
104
- const value = valueRaw === 'true' ||
105
- valueRaw === 'false' ||
106
- valueRaw === 'null' ? JSON.parse(valueRaw)
107
- : valueRaw;
108
-
109
- // Convert keys with '[]' suffix to an array
110
- if (isArray) {
111
- if (!hasOwnProperty.call(p, key))
112
- p[key] = [];
113
- else if (!Array.isArray(p[key]))
114
- p[key] = [p[key]];
115
- }
116
-
117
- // safeguard against resetting a previously defined
118
- // array by accidentally forgetting the brackets
119
- if (Array.isArray(p[key]))
120
- p[key].push(value);
121
- else
122
- p[key] = value;
123
- }
124
-
125
- // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
126
- // use a filter to return the keys that have to be deleted.
127
- const remove = [];
128
- for (const k of Object.keys(out)) {
129
- if (!hasOwnProperty.call(out, k) ||
130
- typeof out[k] !== 'object' ||
131
- Array.isArray(out[k]))
132
- continue
133
-
134
- // see if the parent section is also an object.
135
- // if so, add it to that, and mark this one for deletion
136
- const parts = dotSplit(k);
137
- let p = out;
138
- const l = parts.pop();
139
- const nl = l.replace(/\\\./g, '.');
140
- for (const part of parts) {
141
- if (part === '__proto__')
142
- continue
143
- if (!hasOwnProperty.call(p, part) || typeof p[part] !== 'object')
144
- p[part] = Object.create(null);
145
- p = p[part];
146
- }
147
- if (p === out && nl === l)
148
- continue
149
-
150
- p[nl] = out[k];
151
- remove.push(k);
152
- }
153
- for (const del of remove)
154
- delete out[del];
155
-
156
- return out
157
- };
158
-
159
- const isQuoted = val =>
160
- (val.charAt(0) === '"' && val.slice(-1) === '"') ||
161
- (val.charAt(0) === "'" && val.slice(-1) === "'");
162
-
163
- const safe = val =>
164
- (typeof val !== 'string' ||
165
- val.match(/[=\r\n]/) ||
166
- val.match(/^\[/) ||
167
- (val.length > 1 &&
168
- isQuoted(val)) ||
169
- val !== val.trim())
170
- ? JSON.stringify(val)
171
- : val.replace(/;/g, '\\;').replace(/#/g, '\\#');
172
-
173
- const unsafe = (val, doUnesc) => {
174
- val = (val || '').trim();
175
- if (isQuoted(val)) {
176
- // remove the single quotes before calling JSON.parse
177
- if (val.charAt(0) === "'")
178
- val = val.substr(1, val.length - 2);
179
-
180
- try {
181
- val = JSON.parse(val);
182
- } catch (_) {}
183
- } else {
184
- // walk the val to find the first not-escaped ; character
185
- let esc = false;
186
- let unesc = '';
187
- for (let i = 0, l = val.length; i < l; i++) {
188
- const c = val.charAt(i);
189
- if (esc) {
190
- if ('\\;#'.indexOf(c) !== -1)
191
- unesc += c;
192
- else
193
- unesc += '\\' + c;
194
-
195
- esc = false;
196
- } else if (';#'.indexOf(c) !== -1)
197
- break
198
- else if (c === '\\')
199
- esc = true;
200
- else
201
- unesc += c;
202
- }
203
- if (esc)
204
- unesc += '\\';
205
-
206
- return unesc.trim()
207
- }
208
- return val
209
- };
210
-
211
- var ini = {
212
- parse: decode,
213
- decode,
214
- stringify: encode,
215
- encode,
216
- safe,
217
- unsafe,
218
- };
219
-
220
- (function (exports) {
221
- const path = require$$1;
222
- const os = require$$1$1;
223
- const fs = require$$0__default;
224
- const ini$1 = ini;
225
-
226
- const isWindows = process.platform === 'win32';
227
-
228
- const readRc = filePath => {
229
- try {
230
- return ini$1.parse(fs.readFileSync(filePath, 'utf8')).prefix;
231
- } catch {}
232
- };
233
-
234
- const getEnvNpmPrefix = () => {
235
- // TODO: Remove the `.reduce` call.
236
- // eslint-disable-next-line unicorn/no-array-reduce
237
- return Object.keys(process.env).reduce((prefix, name) => {
238
- return /^npm_config_prefix$/i.test(name) ? process.env[name] : prefix;
239
- }, undefined);
240
- };
241
-
242
- const getGlobalNpmrc = () => {
243
- if (isWindows && process.env.APPDATA) {
244
- // Hardcoded contents of `c:\Program Files\nodejs\node_modules\npm\npmrc`
245
- return path.join(process.env.APPDATA, '/npm/etc/npmrc');
246
- }
247
-
248
- // Homebrew special case: `$(brew --prefix)/lib/node_modules/npm/npmrc`
249
- if (process.execPath.includes('/Cellar/node')) {
250
- const homebrewPrefix = process.execPath.slice(0, process.execPath.indexOf('/Cellar/node'));
251
- return path.join(homebrewPrefix, '/lib/node_modules/npm/npmrc');
252
- }
253
-
254
- if (process.execPath.endsWith('/bin/node')) {
255
- const installDir = path.dirname(path.dirname(process.execPath));
256
- return path.join(installDir, '/etc/npmrc');
257
- }
258
- };
259
-
260
- const getDefaultNpmPrefix = () => {
261
- if (isWindows) {
262
- const {APPDATA} = process.env;
263
- // `c:\node\node.exe` → `prefix=c:\node\`
264
- return APPDATA ? path.join(APPDATA, 'npm') : path.dirname(process.execPath);
265
- }
266
-
267
- // `/usr/local/bin/node` → `prefix=/usr/local`
268
- return path.dirname(path.dirname(process.execPath));
269
- };
270
-
271
- const getNpmPrefix = () => {
272
- const envPrefix = getEnvNpmPrefix();
273
- if (envPrefix) {
274
- return envPrefix;
275
- }
276
-
277
- const homePrefix = readRc(path.join(os.homedir(), '.npmrc'));
278
- if (homePrefix) {
279
- return homePrefix;
280
- }
281
-
282
- if (process.env.PREFIX) {
283
- return process.env.PREFIX;
284
- }
285
-
286
- const globalPrefix = readRc(getGlobalNpmrc());
287
- if (globalPrefix) {
288
- return globalPrefix;
289
- }
290
-
291
- return getDefaultNpmPrefix();
292
- };
293
-
294
- const npmPrefix = path.resolve(getNpmPrefix());
295
-
296
- const getYarnWindowsDirectory = () => {
297
- if (isWindows && process.env.LOCALAPPDATA) {
298
- const dir = path.join(process.env.LOCALAPPDATA, 'Yarn');
299
- if (fs.existsSync(dir)) {
300
- return dir;
301
- }
302
- }
303
-
304
- return false;
305
- };
306
-
307
- const getYarnPrefix = () => {
308
- if (process.env.PREFIX) {
309
- return process.env.PREFIX;
310
- }
311
-
312
- const windowsPrefix = getYarnWindowsDirectory();
313
- if (windowsPrefix) {
314
- return windowsPrefix;
315
- }
316
-
317
- const configPrefix = path.join(os.homedir(), '.config/yarn');
318
- if (fs.existsSync(configPrefix)) {
319
- return configPrefix;
320
- }
321
-
322
- const homePrefix = path.join(os.homedir(), '.yarn-config');
323
- if (fs.existsSync(homePrefix)) {
324
- return homePrefix;
325
- }
326
-
327
- // Yarn supports the npm conventions but the inverse is not true
328
- return npmPrefix;
329
- };
330
-
331
- exports.npm = {};
332
- exports.npm.prefix = npmPrefix;
333
- exports.npm.packages = path.join(npmPrefix, isWindows ? 'node_modules' : 'lib/node_modules');
334
- exports.npm.binaries = isWindows ? npmPrefix : path.join(npmPrefix, 'bin');
335
-
336
- const yarnPrefix = path.resolve(getYarnPrefix());
337
- exports.yarn = {};
338
- exports.yarn.prefix = yarnPrefix;
339
- exports.yarn.packages = path.join(yarnPrefix, getYarnWindowsDirectory() ? 'Data/global/node_modules' : 'global/node_modules');
340
- exports.yarn.binaries = path.join(exports.yarn.packages, '.bin');
341
- } (globalDirs));
342
-
343
- const RC_PATH = ".nuxtrc";
344
- function enable(rc, path) {
345
- const modulePath = resolve(globalDirs.npm.packages, name);
346
- const targetPath = resolve(modulePath, "module.cjs").replace(/\\/g, "/");
347
- if (!fs.existsSync(targetPath))
348
- throw new Error("Failed to locate the global Nuxt Devtools module. You may try it again");
349
- removeModule(rc);
350
- if (!rc.modules?.includes(targetPath))
351
- rc.modules = [...rc.modules || [], targetPath];
352
- if (!rc.devtoolsGlobal)
353
- rc.devtoolsGlobal = {};
354
- if (!rc.devtoolsGlobal.projects)
355
- rc.devtoolsGlobal.projects = [];
356
- if (!rc.devtoolsGlobal.projects.includes(path))
357
- rc.devtoolsGlobal.projects.push(path);
358
- }
359
- function disable(rc, path) {
360
- if (rc.devtoolsGlobal?.projects?.includes(path)) {
361
- rc.devtoolsGlobal.projects = rc.devtoolsGlobal.projects.filter((p) => p !== path);
362
- return true;
363
- }
364
- if (!rc.devtoolsGlobal.projects?.length)
365
- removeModule(rc);
366
- return false;
367
- }
368
- const pathRegex = /[\\\/]@nuxt[\\\/]devtools[\\\/]/;
369
- function removeModule(rc) {
370
- if (Array.isArray(rc.modules))
371
- rc.modules = rc.modules.filter((p) => !p.match(pathRegex));
372
- return true;
373
- }
374
- async function run() {
375
- const args = process.argv.slice(2);
376
- const command = args[0];
377
- const cwd = process.cwd();
378
- const rc = readUser(RC_PATH);
379
- if (command === "enable") {
380
- consola.info("Installed Nuxt Devtools...");
381
- await execa("npm", ["install", "-g", `${name}@latest`], { stdio: "inherit" });
382
- enable(rc, cwd);
383
- consola.info("Nuxt Devtools enabled! Restart your Nuxt app to start using it.");
384
- } else if (command === "disable") {
385
- const isRemove = args.includes("--remove");
386
- if (disable(rc, cwd))
387
- consola.success("Nuxt Devtools disabled for this project.");
388
- else if (!isRemove)
389
- consola.warn("Nuxt Devtools is not enabled for this project.");
390
- if (isRemove) {
391
- removeModule(rc);
392
- consola.success("Nuxt Devtools is removed globally");
393
- }
394
- } else if (!command) {
395
- console.log(`npx ${name} enable|disable`);
396
- process.exit(1);
397
- } else {
398
- consola.log(`Unknown command "${command}"`);
399
- process.exit(1);
400
- }
401
- writeUser(rc, RC_PATH);
402
- }
403
- run().catch((err) => {
404
- consola.error(err);
405
- process.exit(1);
406
- });
@@ -1 +0,0 @@
1
- import{_ as i}from"./NIconButton.vue.a83f99ea.js";import{a as u,E as m,Y as f,Z as d,o as l,c as p,w as _,a0 as b,f as v,i as h,h as x,J as y,a1 as g,u as k,y as B}from"./entry.216b69f8.js";const C={"w-full":"","of-auto":"","h-full":"",relative:""},V={inheritAttrs:!1},N=u({...V,__name:"DrawerRight",props:{modelValue:{type:Boolean},navbar:null,autoClose:{type:Boolean}},emits:["close"],setup(o,{emit:r}){const e=o,a=m(),{height:n}=f(()=>e.navbar,void 0,{box:"border-box"});return d(a,()=>{e.modelValue&&e.autoClose&&r("close")},{ignore:["a","button","summary"]}),(t,s)=>{const c=i;return l(),p(b,{"enter-active-class":"duration-200 ease-in","enter-from-class":"transform translate-x-1/1","enter-to-class":"opacity-100","leave-active-class":"duration-200 ease-out","leave-from-class":"opacity-100","leave-to-class":"transform translate-x-1/1"},{default:_(()=>[o.modelValue?(l(),v("div",g({key:0,ref_key:"el",ref:a,border:"l base",flex:"~ col gap-1","text-sm":"",absolute:"","of-auto":"","right-0":"","bottom-0":"","glass-effect":"","z-10":"","z-20":"",style:{top:`${k(n)}px`}},t.$attrs),[h(c,{absolute:"","z-20":"","text-xl":"","right-2":"","top-2":"",icon:"carbon-close",onClick:s[0]||(s[0]=$=>t.$emit("close"))}),x("div",C,[y(t.$slots,"default")])],16)):B("",!0)]),_:3})}}});export{N as _};
@@ -1 +0,0 @@
1
- import{a as i,ay as r,o as b,f as p,aD as u,aM as h,u as a,h as n,H as k,av as f,i as m,J as v,x,I as _}from"./entry.216b69f8.js";const y=["checked","disabled"],V=["disabled"],B={class:"n-transition n-checkbox-box n-checked:n-checkbox-box-checked peer-active:n-active-base peer-focus-visible:n-focus-base"},M=i({__name:"NCheckbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},setup(o,{emit:l}){const e=r(o,"modelValue",l,{passive:!0});return(t,s)=>{const d=_;return b(),p("label",{class:"items-center select-none n-disabled:n-disabled n-checkbox hover:n-checkbox-hover",checked:a(e)||null,disabled:o.disabled||null},[u(n("input",{"onUpdate:modelValue":s[0]||(s[0]=c=>k(e)?e.value=c:null),type:"checkbox",class:"absolute op0 peer",disabled:o.disabled,onKeypress:s[1]||(s[1]=f(c=>e.value=!a(e),["enter"]))},null,40,V),[[h,a(e)]]),n("span",B,[m(d,{class:"n-transition op0 n-checkbox-icon transform scale-0 n-checked:op100 n-checked:scale-100"})]),n("span",{class:x([a(e)?"":"op50","n-transition"])},[v(t.$slots,"default")],2)],8,y)}}});export{M as _};
@@ -1 +0,0 @@
1
- import{a as f,o as a,f as l,h as o,x as n,i as m,w as v,J as s,F as x,l as c,t as i,y as d,c as h,aB as b,aC as g,I as y,aj as B}from"./entry.216b69f8.js";import{_ as $}from"./NIconTitle.vue.ce90e41b.js";const r=e=>(b("data-v-dcb9bb68"),e=e(),g(),e),C=["open"],I={key:0,class:"op50 text-sm"},N=r(()=>o("div",{class:"flex-auto"},null,-1)),S=r(()=>o("div",{class:"x-divider"},null,-1)),k=f({__name:"NSectionBlock",props:{icon:null,text:null,description:null,containerClass:{default:""},collapse:{type:Boolean,default:!0},open:{type:Boolean,default:!0},padding:{type:[Boolean,String],default:!0}},setup(e){return(t,_)=>{const u=y,p=$;return a(),l(x,null,[o("details",{open:e.open},[o("summary",{class:n(["select-none cursor-pointer p4 hover:bg-active",e.collapse?"":"pointer-events-none"])},[m(p,{icon:e.icon,text:e.text,class:"text-xl op75"},{default:v(()=>[o("div",null,[s(t.$slots,"text",{},()=>[c(i(e.text),1)],!0),e.description||t.$slots.description?(a(),l("div",I,[s(t.$slots,"description",{},()=>[c(i(e.description),1)],!0)])):d("",!0)]),N,s(t.$slots,"actions",{},void 0,!0),e.collapse?(a(),h(u,{key:0,icon:"carbon-chevron-down",class:"op50 cursor-pointer text-base transition duration-500 place-self-start chevron"})):d("",!0)]),_:3},8,["icon","text"])],2),o("div",{class:n(["flex flex-col flex-gap2 pt2 pb6",typeof e.padding=="string"?e.padding:e.padding?"px8":""])},[s(t.$slots,"details",{},void 0,!0),o("div",{class:n([e.containerClass,"mt1"])},[s(t.$slots,"default",{},void 0,!0)],2),s(t.$slots,"footer",{},void 0,!0)],2)],8,C),S],64)}}}),F=B(k,[["__scopeId","data-v-dcb9bb68"]]);export{F as _};
@@ -1 +0,0 @@
1
- import{a as d,ay as i,o as a,f as u,J as r,aD as p,aL as f,u as m,h as b,H as x,c as y,y as h,I as V}from"./entry.216b69f8.js";const v={class:"n-bg-base rounded py-1 border n-border-base flex items-center flex n-text-input focus-within:n-focus-base focus-within:border-context px-2"},B=["type","disabled","placeholder"],N=d({__name:"NTextInput",props:{modelValue:{default:""},placeholder:null,icon:null,disabled:{type:Boolean,default:!1},type:{default:"text"}},setup(e,{emit:n}){const t=i(e,"modelValue",n,{passive:!0});return(l,o)=>{const s=V;return a(),u("div",v,[r(l.$slots,"icon",{},()=>[e.icon?(a(),y(s,{key:0,icon:e.icon,class:"op50 mr-0.4em text-1.1em"},null,8,["icon"])):h("",!0)]),p(b("input",{"onUpdate:modelValue":o[0]||(o[0]=c=>x(t)?t.value=c:null),class:"flex-auto n-bg-base w-full !outline-none",type:e.type,disabled:e.disabled,placeholder:e.placeholder},null,8,B),[[f,m(t)]])])}}});export{N as _};
@@ -1 +0,0 @@
1
- import{_ as h}from"./NIconButton.vue.a83f99ea.js";import{a as N,ay as S,L as x,E as B,az as O,o as i,f as c,h as u,x as d,u as s,t as V,y as m,J as C,n as w,g as J,c as v,F as j,a1 as z,H as P,aA as $,a4 as A}from"./entry.216b69f8.js";const E=["open"],M={flex:"~ gap2","select-none":"","items-center":"",px4:""},R={key:1,p5:"","bg-active":"",italic:""},F=u("span",{op50:""},"No data",-1),D=[F],L=N({__name:"StateEditor",props:{name:null,open:{type:Boolean},state:null,readonly:{type:Boolean}},emits:["update:open"],setup(t,{emit:k}){const r=t,n=S(r,"open",k,{passive:!0}),g=x(),l=B();l.value=JSON.parse(JSON.stringify(r.state));const y=O(l,e=>{p(e,r.state)},{deep:!0});function p(e,o){for(const a in e)e[a]===null?o[a]=null:Array.isArray(e[a])?o[a]=e[a].slice():typeof e[a]=="object"?p(e[a],o[a]):o[a]=e[a]}async function b(){y.pause(),l.value=JSON.parse(JSON.stringify(r.state)),await A(),y.resume()}return(e,o)=>{const a=h;return i(),c("div",{class:"state-editor-details",open:t.name?s(n):!0},[u("div",M,[t.name?(i(),c("button",{key:0,flex:"~","items-center":"","cursor-pointer":"",class:d(s(n)?"":"op50"),onClick:o[0]||(o[0]=f=>n.value=!s(n))},[u("div",{transition:"","i-carbon-chevron-right":"",class:d(s(n)?"rotate-90 op0":"")},null,2),u("code",{py1:"","font-mono":"",px3:"",class:d(s(n)?"bg-[#8881] rounded-t":"rounded hover:bg-active")},V(t.name),3)],2)):m("",!0),C(e.$slots,"actions",w(J({isOpen:s(n),name:t.name,state:t.state}))),s(n)?(i(),v(a,{key:1,title:"Refresh View",icon:"carbon-renew",onClick:b})):m("",!0)]),s(n)||!t.name?(i(),c(j,{key:0},[t.state&&Object.keys(t.state).length>0?(i(),v(s($),z({key:0,modelValue:s(l),"onUpdate:modelValue":o[1]||(o[1]=f=>P(l)?l.value=f:null)},e.$attrs,{class:["json-editor-vue",[s(g).value==="dark"?"jse-theme-dark":"",(t.name,"")]],"main-menu-bar":!1,"navigation-bar":!1,"status-bar":!1,"read-only":t.readonly,indentation:2,"tab-size":2}),null,16,["modelValue","class","read-only"])):(i(),c("div",R,D))],64)):m("",!0)],8,E)}}});export{L as _};
@@ -1,16 +0,0 @@
1
- import{_ as G}from"./NTextInput.vue.d770ca6c.js";import{a as P,m as h,p as K,o,f as l,q,u as n,c as m,h as e,t as u,s as H,r as U,F as $,v as B,x as V,w as A,l as F,y as _,k as R,z as T,A as W,B as J,i as w,C as L,D as Q,E as z,G as X,H as Y,I as Z}from"./entry.216b69f8.js";import{h as ee}from"./index.c769634a.js";import{_ as te}from"./NSectionBlock.c955e75e.js";import{_ as ne}from"./FilepathItem.vue.178a1de3.js";import{_ as se}from"./NIconButton.vue.a83f99ea.js";import{_ as oe}from"./NCodeBlock.vue.593cb41f.js";import{u as M,o as ae}from"./editor.e10c09a2.js";import{_ as ie}from"./DrawerRight.vue.a85afa62.js";import{F as le}from"./fuse.esm.88e2763d.js";import"./NIconTitle.vue.ce90e41b.js";import"./context.fe69916a.js";const re=P({__name:"AssetFontPreview",props:{asset:null},setup(a){const s=a,t=h(()=>`devtools-assets-${ee(s.asset)}`);return K(h(()=>`
2
- @font-face {
3
- font-family: '${t.value}';
4
- src: url('${s.asset.publicPath}');
5
- }
6
- `)),(f,v)=>(o(),l("div",{"of-hidden":"",style:q({fontFamily:`'${n(t)}'`})}," 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))}}),ce={"items-center":"","of-hidden":"","justify-center":"",flex:"",p1:"","bg-active":"","object-cover":""},de=["src"],ue={key:2,op20:"","text-3xl":"","i-carbon-document":""},pe={key:3,"w-full":"",p4:"","self-start":""},me=["textContent"],he={key:4,op20:"","text-3xl":"","i-carbon-help":""},O=P({__name:"AssetPreview",props:{asset:null,textContent:null},setup(a){return(s,t)=>{const f=re;return o(),l("div",ce,[a.asset.type==="image"?(o(),l("img",{key:0,src:a.asset.publicPath},null,8,de)):a.asset.type==="font"?(o(),m(f,{key:a.asset.publicPath,asset:a.asset,p2:"","self-stretch":"","text-2xl":""},null,8,["asset"])):a.asset.type==="text"&&!a.textContent?(o(),l("div",ue)):a.asset.type==="text"&&a.textContent?(o(),l("div",pe,[e("pre",{"of-hidden":"","font-mono":"","text-xs":"","max-h-10rem":"",textContent:u(a.textContent)},null,8,me)])):(o(),l("div",he))])}}}),_e={key:0,"n-code-block":"",relative:""},fe={flex:"~ wrap","w-full":""},ve=["onClick"],xe=e("div",{"flex-auto":""},null,-1),ge=e("div",{"x-divider":""},null,-1),be=P({__name:"CodeSnippets",props:{codeSnippets:null},setup(a){const s=a,t=H(s.codeSnippets[0]),f=M();return U(()=>{s.codeSnippets.includes(t.value)||(t.value=s.codeSnippets[0])}),(v,g)=>{const d=R,y=oe;return a.codeSnippets.length?(o(),l("div",_e,[e("div",fe,[(o(!0),l($,null,B(a.codeSnippets,(b,S)=>(o(),l("button",{key:S,p2:"",border:"r base",hover:"bg-active",class:V(b===n(t)?"bg-active":""),onClick:x=>t.value=b},[e("div",{class:V(b===n(t)?"":"op50")},u(b.name),3)],10,ve))),128)),xe,n(t)?.docs?(o(),m(d,{key:0,to:n(t).docs,target:"_blank",icon:"carbon-help",n:"sm primary",border:"none",my1:"","px-2":""},{default:A(()=>[F(" Docs ")]),_:1},8,["to"])):_("",!0),n(t)?(o(),m(d,{key:1,icon:"carbon-copy",n:"sm primary",border:"none","px-2":"",my1:"",mr1:"",onClick:g[0]||(g[0]=b=>n(f)(n(t).code))},{default:A(()=>[F(" Copy ")]),_:1})):_("",!0)]),ge,n(t)?(o(),m(y,{key:0,code:n(t).code,lang:n(t).lang,lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"])):_("",!0)])):_("",!0)}}}),we={flex:"~ col gap-4","w-full":"","of-hidden":"","min-h-full":"",p4:""},ye=e("div",{flex:"~ gap2",op50:"","items-center":"","mb--2":""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Preview "),e("div",{"x-divider":""})],-1),$e={flex:"~","items-center":"","justify-center":""},ke=e("div",{op50:"","mb--2":"",flex:"~ gap2","items-center":""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Details "),e("div",{"x-divider":""})],-1),Ce={"w-full":"","max-w-full":"","table-fixed":""},Pe=e("td",{op50:"","text-right":"",pr5:"","ws-nowrap":"","w-30":""}," Filepath ",-1),Se={flex:"~ gap-1","items-center":""},Ae=e("div",{"flex-auto":""},null,-1),Ie=e("td",{"text-right":"",op50:"",pr5:"","w-30":"","ws-nowrap":""}," Public Path ",-1),Ne={flex:"~ gap-1","items-center":""},Be={"font-mono":""},Fe=e("div",{"flex-auto":""},null,-1),De=e("td",{"text-right":"",op50:"",pr5:"","w-30":"","ws-nowrap":""}," Type ",-1),ze={capitalize:""},je=e("td",{"text-right":"",op50:"",pr5:"","w-30":"","ws-nowrap":""}," Image Size ",-1),Ee={key:0},Ve=e("td",{"text-right":"",op50:"",pr5:"","w-30":"","ws-nowrap":""}," Aspect Ratio ",-1),Te=e("td",{"text-right":"",op50:"",pr5:"","w-30":"","ws-nowrap":""}," File size ",-1),Le=e("td",{"text-right":"",op50:"",pr5:"","w-30":"","ws-nowrap":""}," Last modified ",-1),Re={op70:""},Me=e("div",{op50:"","mb--2":"",flex:"~ gap2","items-center":""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Actions "),e("div",{"x-divider":""})],-1),Oe={flex:"~ gap2 wrap"},Ge=e("div",{"flex-auto":""},null,-1),Ke=P({__name:"AssetDetails",props:{asset:null},setup(a){const s=a,t=T(()=>{if(s.asset.type==="image")return L.getImageMeta(s.asset.filePath)}),f=T(()=>{if(s.asset.type==="text")return L.getTextAssetContent(s.asset.filePath)}),v=W(),g=h(()=>(v.value?._installedModules||[]).some(r=>r.meta?.name==="@nuxt/image"||r.meta?.name==="@nuxt/image-edge")),d=h(()=>{const i=[];if(s.asset.type==="image"){const r=t.value?.width?`
7
- width="${t.value.width}"
8
- height="${t.value.height}" `:" ";return i.push({lang:"vue-html",code:`<img${r}
9
- src="${s.asset.publicPath}"
10
- />`,name:"Plain Image"}),g.value&&i.push({lang:"vue-html",code:`<NuxtImage${r}
11
- src="${s.asset.publicPath}"
12
- />`,name:"Nuxt Image",docs:"https://image.nuxtjs.org/components/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${r}
13
- src="${s.asset.publicPath}"
14
- />`,name:"Nuxt Picture",docs:"https://image.nuxtjs.org/components/nuxt-picture"}),i}return i.push({lang:"html",code:`<a download href="${s.asset.publicPath}">
15
- Download ${s.asset.path.split("/").slice(-1)[0]}
16
- </a>`,name:"Download link"}),i}),y=M(),b=J(()=>s.asset.mtime),S=h(()=>{const i=s.asset.size;return i<1024?`${i} B`:i<1024*1024?`${(i/1024).toFixed(2)} KB`:`${(i/1024/1024).toFixed(2)} MB`}),x=h(()=>{if(!t.value?.width||!t.value?.height)return"";const i=(k,C)=>C?i(C,k%C):k,r=i(t.value.width,t.value.height);return r>3?`${t.value.width/r}:${t.value.height/r}`:""}),p=h(()=>["image","text","video","font"].includes(s.asset.type));return(i,r)=>{const k=O,C=ne,I=se,D=R,j=be;return o(),l("div",we,[n(p)?(o(),l($,{key:0},[ye,e("div",$e,[w(k,{rounded:"","max-h-80":"","w-auto":"","min-h-20":"","min-w-20":"",border:"~ base",asset:a.asset,"text-content":n(f)},null,8,["asset","text-content"])])],64)):_("",!0),ke,e("table",Ce,[e("tbody",null,[e("tr",null,[Pe,e("td",null,[e("div",Se,[w(C,{filepath:a.asset.filePath,"w-full":"","line-break":"","ws-normal":"","text-left":""},null,8,["filepath"]),Ae,w(I,{title:"Open in Editor",icon:"carbon-launch",onClick:r[0]||(r[0]=c=>("openInEditor"in i?i.openInEditor:n(ae))(a.asset.filePath))})])])]),e("tr",null,[Ie,e("td",null,[e("div",Ne,[e("div",Be,u(a.asset.publicPath),1),Fe,w(I,{to:a.asset.publicPath,icon:"carbon-launch",target:"_blank",title:"Open in browser"},null,8,["to"]),w(I,{title:"Copy public path",icon:"carbon-copy",onClick:r[1]||(r[1]=c=>n(y)(a.asset.publicPath))})])])]),e("tr",null,[De,e("td",ze,u(a.asset.type),1)]),n(t)?.width?(o(),l($,{key:0},[e("tr",null,[je,e("td",null,u(n(t).width)+" x "+u(n(t).height),1)]),n(x)?(o(),l("tr",Ee,[Ve,e("td",null,u(n(x)),1)])):_("",!0)],64)):_("",!0),e("tr",null,[Te,e("td",null,u(n(S)),1)]),e("tr",null,[Le,e("td",null,[F(u(new Date(a.asset.mtime).toLocaleString())+" ",1),e("span",Re,"("+u(n(b))+")",1)])])])]),Me,e("div",Oe,[w(D,{to:a.asset.publicPath,download:"",target:"_blank",icon:"carbon-download"},{default:A(()=>[F(" Download ")]),_:1},8,["to"]),a.asset.type==="image"?(o(),m(D,{key:0,disabled:"",icon:"carbon-image-service"},{default:A(()=>[F(" Optimize image (Coming soon) ")]),_:1})):_("",!0)]),Ge,n(d).length?(o(),m(j,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":n(d)},null,8,["code-snippets"])):_("",!0)])}}}),qe={flex:"~ col gap-1",hover:"bg-active",rounded:"","of-hidden":"","items-center":"",p2:""},He={"of-hidden":"","w-full":"","ws-nowrap":"","text-center":"",truncate:"","text-xs":""},Ue=P({__name:"AssetGridItem",props:{asset:null,folder:null},setup(a){const s=a,t=h(()=>s.folder&&s.asset.path.startsWith(s.folder)?s.asset.path.slice(s.folder.length):s.asset.path);return(f,v)=>{const g=O;return o(),l("button",qe,[w(g,{rounded:"","w-30":"","h-30":"",border:"~ base",asset:a.asset},null,8,["asset"]),e("div",He,u(n(t)),1)])}}}),We={flex:"~ gap-1","w-full":"","items-center":"",hover:"bg-active",rounded:"",px4:"",py2:""},Je={"text-center":"","ws-nowrap":"","of-hidden":"",truncate:""},Qe=P({__name:"AssetListItem",props:{asset:null},setup(a){const s=a,t=h(()=>s.asset.type==="image"?"i-carbon-image":s.asset.type==="video"?"i-carbon-video":s.asset.type==="audio"?"i-carbon-volume-up":s.asset.type==="font"?"i-carbon-text-small-caps":s.asset.type==="text"?"i-carbon-document":s.asset.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(f,v)=>(o(),l("button",We,[e("div",{class:V(n(t))},null,2),e("div",Je,u(a.asset.path),1)]))}}),Xe={"h-full":"","of-auto":""},Ye={flex:"~ gap4"},Ze={"flex-none":"",flex:"~ gap4"},et={op50:""},tt={key:0},nt={px2:"","mt--4":"",grid:"~ cols-minmax-8rem"},st={key:1,p2:"",grid:"~ cols-minmax-8rem"},ot={key:1},xt=P({__name:"assets",setup(a){const s=Q(),t=z(""),f=h(()=>new le(s.value||[],{keys:["path"]})),v=h(()=>t.value?f.value.search(t.value).map(p=>p.item):s.value||[]),g=h(()=>{const x={};for(const p of v.value){const i=`${p.path.split("/").slice(0,-1).join("/")}/`;x[i]||(x[i]=[]),x[i].push(p)}return Object.entries(x).sort(([p],[i])=>p.localeCompare(i))}),d=z(),y=z("grid");function b(){y.value=y.value==="list"?"grid":"list"}X("Escape",()=>{d.value=void 0});const S=z();return(x,p)=>{const i=G,r=Z,k=Ue,C=te,I=Qe,D=Ke,j=ie;return o(),l("div",Xe,[e("div",{ref_key:"navbar",ref:S,flex:"~ col gap-2",border:"b base",p4:"","navbar-glass":"","flex-1":"",pb2:""},[e("div",Ye,[w(i,{modelValue:n(t),"onUpdate:modelValue":p[0]||(p[0]=c=>Y(t)?t.value=c:null),placeholder:"Search...",icon:"carbon-search","flex-auto":"",p:"x5 y2",n:"primary"},null,8,["modelValue"]),e("div",Ze,[e("button",{title:"Toggle view",onClick:b},[n(y)==="grid"?(o(),m(r,{key:0,icon:"i-carbon-list"})):(o(),m(r,{key:1,icon:"i-carbon-grid"}))])])]),e("div",et,[n(t)?(o(),l("span",tt,u(n(v).length)+" matched · ",1)):_("",!0),e("span",null,u(n(s)?.length)+" assets in total",1)])],512),n(y)==="grid"?(o(),l($,{key:0},[n(g).length>1?(o(!0),l($,{key:0},B(n(g),([c,N])=>(o(),m(C,{key:c,text:c,description:`${N.length} items`,open:N.length<30,padding:!1},{default:A(()=>[e("div",nt,[(o(!0),l($,null,B(N,E=>(o(),m(k,{key:E.path,asset:E,folder:c,onClick:at=>d.value=E},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(o(),l("div",st,[(o(!0),l($,null,B(n(v),c=>(o(),m(k,{key:c.path,asset:c,onClick:N=>d.value=c},null,8,["asset","onClick"]))),128))]))],64)):(o(),l("div",ot,[(o(!0),l($,null,B(n(v),c=>(o(),m(I,{key:c.path,asset:c,onClick:N=>d.value=c},null,8,["asset","onClick"]))),128))])),w(j,{"model-value":!!n(d),"w-120":"","auto-close":"",navbar:n(S),onClose:p[1]||(p[1]=c=>d.value=void 0)},{default:A(()=>[n(d)?(o(),m(D,{key:0,asset:n(d)},null,8,["asset"])):_("",!0)]),_:1},8,["model-value","navbar"])])}}});export{xt as default};
@@ -1 +0,0 @@
1
- import{a as k,L as g,E as b,m as y,a2 as x,a3 as C,P as E,a4 as T,r as m,a5 as j,a6 as M,o as i,f as _,a7 as $,a8 as B,u as n,c as f,X as L,C as I,t as W}from"./entry.216b69f8.js";import{_ as D}from"./LaunchPage.vue.a0bbd67e.js";import"./TabIcon.vue.8236980c.js";import"./NMarkdown.vue.11f68fad.js";const d=new Map,O=k({__name:"IframeView",props:{tab:null},setup(h){const c=h,l=g(),u=b(),t=y(()=>c.tab.name),e=b(),o=x(C(u));E(()=>{const a=c.tab.view,p=a.persistent!==!1;if(d.get(t.value)&&p)e.value=d.get(t.value),e.value.style.visibility="visible";else{e.value=document.createElement("iframe"),p&&d.set(t.value,e.value),e.value.src=a.src;try{e.value.style.opacity="0.01",e.value.onload=()=>{r(),s(),e.value.style.opacity="1"}}catch{e.value.style.opacity="1"}document.body.appendChild(e.value),T(w)}setTimeout(s,100)}),m(w),m(s),m(r),j(()=>{e.value&&(e.value.style.visibility="hidden")});function s(){if(!(!e.value||!e.value.contentWindow))try{const a=e.value.contentWindow.document.querySelector("html");a?.classList.toggle("dark",l.value==="dark"),a?.classList.toggle("light",l.value==="dark")}catch{}}const v=M();function r(){if(!(!e.value||!e.value.contentWindow))try{e.value.contentWindow.__NUXT_DEVTOOLS__=v.value}catch{}}function w(){e.value&&Object.assign(e.value.style,{position:"fixed",left:`${o.left}px`,top:`${o.top}px`,width:`${o.width}px`,height:`${o.height}px`,outline:"none"})}return(a,p)=>(i(),_("div",{ref_key:"anchor",ref:u,"w-full":"","h-full":""},null,512))}}),P={key:0,flex:"~ col","h-full":"","items-center":"","justify-center":""},S={key:4,flex:"~ col","h-full":"","items-center":"","justify-center":""},N=k({__name:"custom-[name]",setup(h){const c=$(),l=y(()=>c.params.name),u=B(),t=y(()=>u.all.value.find(e=>e.name===l.value));return(e,o)=>{const s=O,v=D;return n(t)?n(t).view.type==="iframe"?(i(),f(s,{key:1,tab:n(t)},null,8,["tab"])):n(t).view.type==="vnode"?(i(),f(L(n(t).view.vnode),{key:2})):n(t).view.type==="launch"?(i(),f(v,{key:3,icon:n(t).view.icon||n(t).icon,title:n(t).view.title||n(t).title,description:n(t).view.description,actions:n(t).view.actions,onAction:o[0]||(o[0]=r=>("rpc"in e?e.rpc:n(I)).customTabAction(n(t).name,r))},null,8,["icon","title","description","actions"])):(i(),_("div",S," Unknown tab type "+W(n(t).view),1)):(i(),_("div",P," Tab not found "))}}});export{N as default};
@@ -1 +0,0 @@
1
- import{C as t,ax as n}from"./entry.216b69f8.js";import{u as r}from"./context.fe69916a.js";async function s(o){await t.openInEditor(o)}function e(){const o=n(),i=r();return a=>{o.copy(a),i("Copied to clipboard","carbon-checkmark")}}export{s as o,e as u};