@nuxt/devtools 0.8.0 → 0.8.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.
- package/README.md +1 -1
- package/dist/chunks/module-main.mjs +33 -6025
- package/dist/chunks/vscode.mjs +4 -5
- package/dist/client/200.html +37 -2
- package/dist/client/404.html +37 -2
- package/dist/client/__blank/index.html +37 -2
- package/dist/client/_nuxt/{Badge.73590739.js → Badge.3c6fa035.js} +1 -1
- package/dist/client/_nuxt/{CodeDiff.vue.5bc59452.js → CodeDiff.vue.7a519a6d.js} +2 -2
- package/dist/client/_nuxt/{ComposableItem.vue.b891778e.js → ComposableItem.vue.ffcca591.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaButton.vue.58aa4fbb.js → DataSchemaButton.vue.9ced8093.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaDrawer.b54a9c8c.js → DataSchemaDrawer.6edfca87.js} +100 -100
- package/dist/client/_nuxt/{DrawerRight.vue.462f9048.js → DrawerRight.vue.8980fc15.js} +1 -1
- package/dist/client/_nuxt/{DurationDisplay.vue.281ea057.js → DurationDisplay.vue.dca5d690.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.3d85c8b7.js → FilepathItem.vue.222c7a36.js} +1 -1
- package/dist/client/_nuxt/{HelpFab.vue.7e36821f.js → HelpFab.vue.6da14cd2.js} +1 -1
- package/dist/client/_nuxt/{LaunchPage.vue.fd74a96c.js → LaunchPage.vue.ded97a46.js} +1 -1
- package/dist/client/_nuxt/{NCheckbox.vue.1ddacd54.js → NCheckbox.vue.d47be8e5.js} +1 -1
- package/dist/client/_nuxt/{NCodeBlock.vue.31f18b3e.js → NCodeBlock.vue.cd0d52ca.js} +1 -1
- package/dist/client/_nuxt/{NDropdown.vue.ba86ab23.js → NDropdown.vue.3bf5669f.js} +1 -1
- package/dist/client/_nuxt/{NIconTitle.vue.9acdbad1.js → NIconTitle.vue.590f73cc.js} +1 -1
- package/dist/client/_nuxt/{NLink.vue.a8242afb.js → NLink.vue.2bd59538.js} +1 -1
- package/dist/client/_nuxt/{NMarkdown.vue.12b1eecd.js → NMarkdown.vue.0929ffc5.js} +1 -1
- package/dist/client/_nuxt/{NSectionBlock.00736ab5.js → NSectionBlock.2eb550f4.js} +1 -1
- package/dist/client/_nuxt/{NSelect.vue.d378258a.js → NSelect.vue.120a17c7.js} +1 -1
- package/dist/client/_nuxt/{NSelectTabs.vue.515b8214.js → NSelectTabs.vue.15ded4ea.js} +1 -1
- package/dist/client/_nuxt/{NSwitch.vue.8201d15e.js → NSwitch.vue.00f0a211.js} +1 -1
- package/dist/client/_nuxt/{NTip.vue.8812abb8.js → NTip.vue.b82daf5f.js} +1 -1
- package/dist/client/_nuxt/{Navbar.vue.c509e5d2.js → Navbar.vue.454bbdad.js} +1 -1
- package/dist/client/_nuxt/{StateEditor.vue.2dfb9208.js → StateEditor.vue.fb44992d.js} +1 -1
- package/dist/client/_nuxt/{__blank.6f88f9ac.js → __blank.ed5e6688.js} +1 -1
- package/dist/client/_nuxt/{analyze-build.ad9015ef.js → analyze-build.a348d54f.js} +1 -1
- package/dist/client/_nuxt/assets.9cc20f0c.js +16 -0
- package/dist/client/_nuxt/{client.237dd3ea.js → client.ecec2ff5.js} +1 -1
- package/dist/client/_nuxt/{components.5d298b86.js → components.eb546fab.js} +1 -1
- package/dist/client/_nuxt/css.5abce139.js +501 -0
- package/dist/client/_nuxt/{custom-_name_.6bfb7c0f.js → custom-_name_.405b1822.js} +1 -1
- package/dist/client/_nuxt/{default.f2c7ccc5.js → default.d9ec755b.js} +1 -1
- package/dist/client/_nuxt/diff.22e0b108.js +1 -0
- package/dist/client/_nuxt/entry.102d44fe.js +27 -0
- package/dist/client/_nuxt/entry.a2a7b315.css +1 -0
- package/dist/client/_nuxt/error-404.27f7c5ed.js +1 -0
- package/dist/client/_nuxt/error-404.82ac0ec5.css +1 -0
- package/dist/client/_nuxt/{error-500.7606b55d.js → error-500.6459d9b0.js} +1 -1
- package/dist/client/_nuxt/error-500.ff959f66.css +1 -0
- package/dist/client/_nuxt/{full.69c969de.js → full.ff28afbd.js} +1 -1
- package/dist/client/_nuxt/{hooks.2100ca5d.js → hooks.a92c198c.js} +1 -1
- package/dist/client/_nuxt/html.66e44e78.js +74 -0
- package/dist/client/_nuxt/{imports.cb581504.js → imports.af43913a.js} +1 -1
- package/dist/client/_nuxt/{index.f204f87e.js → index.475555a9.js} +1 -1
- package/dist/client/_nuxt/{index.0d56c910.js → index.9d25c8b5.js} +1 -1
- package/dist/client/_nuxt/javascript.ddb4c460.js +699 -0
- package/dist/client/_nuxt/json-editor-vue.28570b6b.js +130 -0
- package/dist/client/_nuxt/json.709f1c4d.js +25 -0
- package/dist/client/_nuxt/{middleware.688539e5.js → middleware.17de3e64.js} +1 -1
- package/dist/client/_nuxt/{modules.bd62827c.js → modules.d2b55e3a.js} +1 -1
- package/dist/client/_nuxt/{none.1af6e0ee.js → none.60868d86.js} +1 -1
- package/dist/client/_nuxt/onig.0c57a370.js +1 -0
- package/dist/client/_nuxt/{open-graph.11338a0a.js → open-graph.b86b82fa.js} +1 -1
- package/dist/client/_nuxt/{overview.94507b31.js → overview.5b1b22e6.js} +1 -1
- package/dist/client/_nuxt/{pages.e761585a.js → pages.7ce7ead1.js} +1 -1
- package/dist/client/_nuxt/{payload.6d63ca94.js → payload.95a96cbc.js} +1 -1
- package/dist/client/_nuxt/{plugins.37532eb5.js → plugins.19d4d843.js} +1 -1
- package/dist/client/_nuxt/{runtime-configs.5354fdd6.js → runtime-configs.ccb12a0d.js} +1 -1
- package/dist/client/_nuxt/server-routes.7cc44fc0.js +9 -0
- package/dist/client/_nuxt/{settings.5fe86309.js → settings.105e88e7.js} +1 -1
- package/dist/client/_nuxt/shellscript.3d8bff4d.js +4 -0
- package/dist/client/_nuxt/{state-components.7bf3566d.js → state-components.f27756f9.js} +1 -1
- package/dist/client/_nuxt/{state-modules.065d01b4.js → state-modules.4d65021c.js} +1 -1
- package/dist/client/_nuxt/{storage-options.f9b1696b.js → storage-options.f78173e7.js} +1 -1
- package/dist/client/_nuxt/{storage.228d88e2.js → storage.38ee52e0.js} +1 -1
- package/dist/client/_nuxt/{terminals.0377de90.js → terminals.6138e467.js} +1 -1
- package/dist/client/_nuxt/timeline.aeb379fb.js +57 -0
- package/dist/client/_nuxt/typescript.3ef79501.js +666 -0
- package/dist/client/_nuxt/unocss-runtime.50cd6f0c.js +2 -0
- package/dist/client/_nuxt/virtual-files.c0236487.js +1 -0
- package/dist/client/_nuxt/vitesse-dark.ab479e3d.js +1 -0
- package/dist/client/_nuxt/vitesse-light.696edcfd.js +1 -0
- package/dist/client/_nuxt/vue-html.b80b464f.js +1 -0
- package/dist/client/_nuxt/vue.5b4e1de3.js +1844 -0
- package/dist/client/_nuxt/yaml.b29e536f.js +200 -0
- package/dist/client/index.html +37 -2
- package/dist/client/modules/analyze-build/index.html +37 -2
- package/dist/client/modules/assets/index.html +37 -2
- package/dist/client/modules/components/index.html +37 -2
- package/dist/client/modules/hooks/index.html +37 -2
- package/dist/client/modules/imports/index.html +37 -2
- package/dist/client/modules/middleware/index.html +37 -2
- package/dist/client/modules/modules/index.html +37 -2
- package/dist/client/modules/open-graph/index.html +37 -2
- package/dist/client/modules/overview/index.html +37 -2
- package/dist/client/modules/pages/index.html +37 -2
- package/dist/client/modules/payload/index.html +37 -2
- package/dist/client/modules/plugins/index.html +37 -2
- package/dist/client/modules/runtime-configs/index.html +37 -2
- package/dist/client/modules/server-routes/index.html +37 -2
- package/dist/client/modules/storage/index.html +37 -2
- package/dist/client/modules/terminals/index.html +37 -2
- package/dist/client/modules/timeline/index.html +37 -2
- package/dist/client/modules/virtual-files/index.html +37 -2
- package/dist/client/settings/index.html +37 -2
- package/dist/module.json +1 -1
- package/dist/runtime/plugins/view/Main.vue +5 -0
- package/dist/runtime/plugins/view/client.mjs +10 -3
- package/package.json +35 -37
- package/dist/client/_nuxt/assets.d0e2ffb5.js +0 -16
- package/dist/client/_nuxt/entry.582098fc.css +0 -1
- package/dist/client/_nuxt/entry.d12f745d.js +0 -21
- package/dist/client/_nuxt/error-404.91003ceb.css +0 -1
- package/dist/client/_nuxt/error-404.ed94fa51.js +0 -1
- package/dist/client/_nuxt/error-500.7e02f53c.css +0 -1
- package/dist/client/_nuxt/json-editor-vue.ddceb6bb.js +0 -137
- package/dist/client/_nuxt/server-routes.6fd21992.js +0 -9
- package/dist/client/_nuxt/timeline.e89330f3.js +0 -57
- package/dist/client/_nuxt/unocss-runtime.a5ba4c7b.js +0 -2
- package/dist/client/_nuxt/virtual-files.1f7c68a1.js +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuxt/devtools",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.8.
|
|
4
|
+
"version": "0.8.2",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "nuxt/devtools",
|
|
7
7
|
"exports": {
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
"require": "./module.cjs"
|
|
12
12
|
},
|
|
13
13
|
"./types": {
|
|
14
|
-
"types": "./dist/types.d.ts"
|
|
15
|
-
"import": "./dist/types.mjs"
|
|
14
|
+
"types": "./dist/types.d.ts"
|
|
16
15
|
},
|
|
17
16
|
"./*": "./*"
|
|
18
17
|
},
|
|
@@ -30,88 +29,87 @@
|
|
|
30
29
|
"vite": "*"
|
|
31
30
|
},
|
|
32
31
|
"dependencies": {
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
32
|
+
"@antfu/utils": "^0.7.6",
|
|
33
|
+
"@nuxt/kit": "^3.7.0",
|
|
34
|
+
"birpc": "^0.2.13",
|
|
35
35
|
"boxen": "^7.1.1",
|
|
36
36
|
"consola": "^3.2.3",
|
|
37
|
-
"error-stack-parser-es": "^0.1.
|
|
37
|
+
"error-stack-parser-es": "^0.1.1",
|
|
38
38
|
"execa": "^7.2.0",
|
|
39
|
-
"fast-folder-size": "^2.
|
|
39
|
+
"fast-folder-size": "^2.2.0",
|
|
40
40
|
"fast-glob": "^3.3.1",
|
|
41
|
-
"
|
|
41
|
+
"flatted": "^3.2.7",
|
|
42
|
+
"get-port-please": "^3.0.2",
|
|
42
43
|
"global-dirs": "^3.0.1",
|
|
43
|
-
"h3": "^1.
|
|
44
|
+
"h3": "^1.8.1",
|
|
44
45
|
"hookable": "^5.5.3",
|
|
45
46
|
"image-meta": "^0.1.1",
|
|
46
47
|
"is-installed-globally": "^0.4.0",
|
|
47
48
|
"launch-editor": "^2.6.0",
|
|
48
49
|
"local-pkg": "^0.4.3",
|
|
49
50
|
"magicast": "^0.2.10",
|
|
50
|
-
"nypm": "^0.
|
|
51
|
-
"
|
|
51
|
+
"nypm": "^0.3.1",
|
|
52
|
+
"ofetch": "^1.3.3",
|
|
53
|
+
"ohash": "^1.1.3",
|
|
54
|
+
"pacote": "^17.0.3",
|
|
52
55
|
"pathe": "^1.1.1",
|
|
53
56
|
"perfect-debounce": "^1.0.0",
|
|
54
57
|
"picocolors": "^1.0.0",
|
|
55
58
|
"pkg-types": "^1.0.3",
|
|
56
59
|
"rc9": "^2.1.1",
|
|
57
60
|
"semver": "^7.5.4",
|
|
61
|
+
"simple-git": "^3.19.1",
|
|
58
62
|
"sirv": "^2.0.3",
|
|
59
|
-
"unimport": "^3.
|
|
60
|
-
"vite-plugin-inspect": "^0.7.
|
|
63
|
+
"unimport": "^3.2.0",
|
|
64
|
+
"vite-plugin-inspect": "^0.7.38",
|
|
61
65
|
"vite-plugin-vue-inspector": "^3.6.0",
|
|
62
66
|
"wait-on": "^7.0.1",
|
|
63
67
|
"which": "^3.0.1",
|
|
64
68
|
"ws": "^8.13.0",
|
|
65
|
-
"@nuxt/devtools-kit": "0.8.
|
|
66
|
-
"@nuxt/devtools-wizard": "0.8.
|
|
69
|
+
"@nuxt/devtools-kit": "0.8.2",
|
|
70
|
+
"@nuxt/devtools-wizard": "0.8.2"
|
|
67
71
|
},
|
|
68
72
|
"devDependencies": {
|
|
69
|
-
"@antfu/utils": "^0.7.5",
|
|
70
73
|
"@iconify-json/bxl": "^1.1.7",
|
|
71
|
-
"@iconify-json/carbon": "^1.1.
|
|
74
|
+
"@iconify-json/carbon": "^1.1.20",
|
|
72
75
|
"@iconify-json/logos": "^1.1.34",
|
|
73
76
|
"@iconify-json/ri": "^1.1.12",
|
|
74
|
-
"@iconify-json/simple-icons": "^1.1.
|
|
75
|
-
"@iconify-json/tabler": "^1.1.
|
|
77
|
+
"@iconify-json/simple-icons": "^1.1.68",
|
|
78
|
+
"@iconify-json/tabler": "^1.1.89",
|
|
76
79
|
"@nuxt/content": "^2.7.2",
|
|
77
80
|
"@nuxtjs/color-mode": "^3.3.0",
|
|
78
|
-
"@parcel/watcher": "^2.
|
|
81
|
+
"@parcel/watcher": "^2.3.0",
|
|
79
82
|
"@types/markdown-it-link-attributes": "^3.0.1",
|
|
80
83
|
"@types/ua-parser-js": "^0.7.36",
|
|
81
|
-
"@unocss/nuxt": "^0.55.
|
|
82
|
-
"@unocss/preset-icons": "^0.55.
|
|
83
|
-
"@unocss/preset-uno": "^0.55.
|
|
84
|
-
"@unocss/runtime": "^0.55.
|
|
85
|
-
"@vueuse/nuxt": "^10.
|
|
84
|
+
"@unocss/nuxt": "^0.55.3",
|
|
85
|
+
"@unocss/preset-icons": "^0.55.3",
|
|
86
|
+
"@unocss/preset-uno": "^0.55.3",
|
|
87
|
+
"@unocss/runtime": "^0.55.3",
|
|
88
|
+
"@vueuse/nuxt": "^10.4.1",
|
|
86
89
|
"esno": "^0.17.0",
|
|
87
|
-
"flatted": "^3.2.7",
|
|
88
90
|
"floating-vue": "2.0.0-beta.24",
|
|
89
91
|
"fuse.js": "^6.6.2",
|
|
90
92
|
"json-editor-vue": "^0.10.6",
|
|
91
93
|
"markdown-it": "^13.0.1",
|
|
92
94
|
"markdown-it-link-attributes": "^4.0.1",
|
|
93
95
|
"nanoid": "^4.0.2",
|
|
94
|
-
"nuxt": "^3.
|
|
96
|
+
"nuxt": "^3.7.0",
|
|
95
97
|
"nuxt-vitest": "^0.10.2",
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"quicktype-core": "^23.0.64",
|
|
99
|
-
"shiki": "^0.14.3",
|
|
100
|
-
"shiki-es": "^0.14.0",
|
|
101
|
-
"simple-git": "^3.19.1",
|
|
98
|
+
"quicktype-core": "^23.0.71",
|
|
99
|
+
"shikiji": "^0.6.3",
|
|
102
100
|
"splitpanes": "^3.1.5",
|
|
103
101
|
"theme-vitesse": "^0.7.2",
|
|
104
102
|
"ua-parser-js": "^1.0.35",
|
|
105
|
-
"unocss": "^0.55.
|
|
106
|
-
"vanilla-jsoneditor": "^0.
|
|
103
|
+
"unocss": "^0.55.3",
|
|
104
|
+
"vanilla-jsoneditor": "^0.18.2",
|
|
107
105
|
"vis-data": "^7.1.6",
|
|
108
106
|
"vis-network": "^9.1.6",
|
|
109
|
-
"vite-plugin-vue-markdown": "^0.23.
|
|
107
|
+
"vite-plugin-vue-markdown": "^0.23.8",
|
|
110
108
|
"vue-tsc": "^1.8.8",
|
|
111
109
|
"vue-virtual-scroller": "2.0.0-beta.8",
|
|
112
110
|
"xterm": "^5.2.1",
|
|
113
111
|
"xterm-addon-fit": "^0.7.0",
|
|
114
|
-
"@nuxt/devtools": "0.8.
|
|
112
|
+
"@nuxt/devtools": "0.8.2"
|
|
115
113
|
},
|
|
116
114
|
"scripts": {
|
|
117
115
|
"build": "pnpm dev:prepare && pnpm build:module && pnpm build:client && esno scripts/prepare.ts",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{d as X,r as N,W as q,o as s,m as p,i as u,f as t,k as e,v as k,F as L,n as G,h as F,j as x,p as S,E as H,X as U,Y as me,Z as fe,J as Z,K as J,_ as te,a0 as oe,U as se,C as ae,a as A,a1 as ve,a2 as he,a3 as le,t as V,a4 as ie,a5 as _e,l as R,a6 as ge,b as ne,a7 as xe,e as we,a8 as be,a9 as re,H as W,aa as ye,ab as $e,V as ke,ac as Ce,ad as Pe,ae as Ae}from"./entry.d12f745d.js";import{_ as De}from"./Navbar.vue.c509e5d2.js";import{_ as Ve}from"./NSectionBlock.00736ab5.js";import{_ as Ne}from"./FilepathItem.vue.3d85c8b7.js";import{_ as Fe,u as Ie}from"./storage-options.f9b1696b.js";import{_ as Se}from"./DrawerRight.vue.462f9048.js";import{D as Te}from"./constants.4e5eba24.js";import"./NIconTitle.vue.9acdbad1.js";import"./NCodeBlock.vue.31f18b3e.js";import"./client.237dd3ea.js";const je={key:0,"h-full":"","w-full":"",flex:"","items-center":"","justify-center":""},Ee={for:"drop-zone-input","text-3xl":""},Ue={key:1,relative:"","h-full":"","w-full":"",grid:"~ rows-[max-content_1fr_max-content]"},Be=e("div",{px6:"",py6:""},[e("h1",{"text-2xl":""}," Upload "),e("p",{"text-sm":"",op50:""}," Drag and drop files to upload ")],-1),Le={grid:"~ cols-minmax-8rem","overflow-auto":"",p6:""},ze={flex:"","items-center":"","justify-center":"","of-hidden":"",rounded:"","rounded-t-lg":"","bg-active":"","object-cover":"",class:"aspect-1/1",border:"~ base"},Me=["src"],Oe={flex:"~ gap1","items-center":""},Re={flex:"~ gap-2","items-center":"","justify-center":"",p8:""},Ke=X({__name:"DropZone",props:{folder:{type:String,required:!0}},setup(T){const l=T,d=N(!1),n=N(),m=N([]),v=["image","video"];function D(i){n.value=i.target,d.value=!0}function c(i){i.target===n.value&&(d.value=!1)}function C(i){i.preventDefault()}function K(i){i.preventDefault(),B(i.dataTransfer.files)}function B(i){const g=Array.from(i||[]);if(g.length){const _=[],P=m.value.map(f=>f.name);for(const f of g)if(P.includes(f.name)){let r=1;const[y,a]=f.name.split(".");for(;P.includes(`${y} (${r}).${a}`);)r++;const o=`${y}-${r}.${a}`,M=new Blob([f],{type:f.type}),O=new File([M],o,{lastModified:Date.now()});_.push(O),P.push(o)}else f.type===""?U({message:"Folders are not supported yet",icon:"carbon:face-dissatisfied",classes:"text-orange"}):v.some(r=>f.type.includes(r))?_.push(f):U({message:`"${f.type}" file type is not allowed`,icon:"carbon:face-dissatisfied",classes:"text-orange"});m.value=[...m.value,..._]}}async function w(){if(me.value||fe.value)return;const i=[];for(const g of m.value){const _=new FileReader;_.readAsDataURL(g);const f=(await new Promise(r=>{_.onload=()=>r(_.result)})).split(";base64,").pop();i.push({path:g.name,encoding:"base64",content:f})}await Z.writeStaticAssets(await J(),[...i],l.folder).then(()=>{j(),U({message:"Files uploaded successfully!",icon:"i-carbon:checkmark"})}).catch(g=>{console.error(g),j(),U({message:`Error uploading files: ${g}`,icon:"i-carbon-warning",classes:"text-red"})}),d.value=!1}function h(i){m.value?.splice(i,1)}function b(i){return URL.createObjectURL(i)}function z(i,g){const[_,P]=i.name.split("."),f=g.replace(/\.\w+$/,""),r=`${f}.${P}`;return f.length===0?(alert("File name must be at least 1 characters long"),_):(Object.defineProperty(i,"name",{value:r,writable:!1}),m.value.splice(m.value.indexOf(i),1,i),i)}function I(){m.value=[]}function j(){d.value=!1,I()}return q("dragenter",D),q("dragleave",c),q("dragover",C),q("drop",K),(i,g)=>{const _=te,P=oe,f=se,r=ae;return s(),p("div",{fixed:"","bottom-0":"","left-13":"","right-0":"","top-0":"","z-10":"","backdrop-blur-20":"","transition-all":"",class:H(t(d)?"opacity-100 visible":"opacity-0 invisible")},[u(_,{icon:"carbon-close",absolute:"","right-5":"","top-5":"","z-20":"","text-xl":"",onClick:j}),t(m)?.length?(s(),p("div",Ue,[Be,e("div",Le,[(s(!0),p(L,null,G(t(m),(y,a)=>(s(),p("div",{key:y.name,flex:"~ col gap-2",relative:"","h-50":"","w-40":"","items-center":""},[e("div",ze,[e("img",{"h-full":"","w-full":"","rounded-t-lg":"","object-cover":"",src:b(y)},null,8,Me)]),e("div",Oe,[u(f,{n:"xs","flex-auto":"","model-value":y.name,"onUpdate:modelValue":o=>z(y,o.target.value)},null,8,["model-value","onUpdate:modelValue"]),u(_,{icon:"carbon-delete","flex-none":"",title:"Remove file",onClick:o=>h(a)},null,8,["onClick"])])]))),128))]),e("div",Re,[t(m).length?(s(),F(r,{key:0,n:"red",onClick:I},{default:x(()=>[u(P,{icon:"carbon-clean"}),k(" Clear ")]),_:1})):S("",!0),u(r,{disabled:!t(m).length,n:"primary solid",onClick:w},{default:x(()=>[u(P,{icon:"carbon-cloud-upload"}),k(" Upload ")]),_:1},8,["disabled"])])])):(s(),p("div",je,[e("label",Ee,[u(P,{icon:"carbon-cloud-upload","mr-2":""}),k(" Drop files here or click to select ")]),e("input",{id:"drop-zone-input",type:"file",multiple:"",hidden:"",onChange:g[0]||(g[0]=y=>B(y.target.files))},null,32)]))],2)}}}),Xe=X({__name:"AssetFontPreview",props:{asset:{}},setup(T){const l=T,d=A(()=>`devtools-assets-${ve(l.asset)}`);return he(A(()=>`
|
|
2
|
-
@font-face {
|
|
3
|
-
font-family: '${d.value}';
|
|
4
|
-
src: url('${l.asset.publicPath}');
|
|
5
|
-
}
|
|
6
|
-
`)),(n,m)=>(s(),p("div",{"of-hidden":"",style:le({fontFamily:`'${t(d)}'`})}," 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))}}),Ze={flex:"","items-center":"","justify-center":"","of-hidden":"","bg-active":"","object-cover":"",p1:""},Ge=["src"],We={key:2,"i-carbon-document":"","text-3xl":"",op20:""},qe={key:3,"w-full":"","self-start":"",p4:""},He=["textContent"],Je={key:4},Ye=["src","autoplay","controls"],Qe={key:5,"i-carbon-help":"","text-3xl":"",op20:""},ce=X({__name:"AssetPreview",props:{asset:{},textContent:{},detail:{type:Boolean}},setup(T){return(l,d)=>{const n=Xe;return s(),p("div",Ze,[l.asset.type==="image"?(s(),p("img",{key:0,src:l.asset.publicPath},null,8,Ge)):l.asset.type==="font"?(s(),F(n,{key:l.asset.publicPath,asset:l.asset,"self-stretch":"",p2:"","text-2xl":""},null,8,["asset"])):l.asset.type==="text"&&!l.textContent?(s(),p("div",We)):l.asset.type==="text"&&l.textContent?(s(),p("div",qe,[e("pre",{"max-h-10rem":"","of-hidden":"","text-xs":"","font-mono":"",textContent:V(l.textContent)},null,8,He)])):l.asset.type==="video"?(s(),p("div",Je,[e("video",{src:l.asset.publicPath,autoplay:l.detail,controls:l.detail},null,8,Ye)])):(s(),p("div",Qe))])}}}),et={flex:"~ col gap-1",hover:"bg-active","items-center":"","of-hidden":"",rounded:"",p2:""},tt={"w-full":"","of-hidden":"",truncate:"","ws-nowrap":"","text-center":"","text-xs":""},nt=X({__name:"AssetGridItem",props:{asset:{},folder:{}},setup(T){const l=T,d=A(()=>l.folder&&l.asset.path.startsWith(l.folder)?l.asset.path.slice(l.folder.length):l.asset.path);return(n,m)=>{const v=ce;return s(),p("button",et,[u(v,{"h-30":"","w-30":"",rounded:"",border:"~ base",asset:n.asset},null,8,["asset"]),e("div",tt,V(t(d)),1)])}}}),ue=X({__name:"AssetListItem",props:{item:{},index:{default:0},modelValue:{}},setup(T,{emit:l}){const d=T,n=ie(d,"modelValue",l,{passive:!0}),m=A(()=>d.item?.children?.length),v=N(!0),D=A(()=>m.value?"i-carbon-folder":d.item.type==="image"?"i-carbon-image":d.item.type==="video"?"i-carbon-video":d.item.type==="audio"?"i-carbon-volume-up":d.item.type==="font"?"i-carbon-text-small-caps":d.item.type==="text"?"i-carbon-document":d.item.type==="json"?"i-carbon-json":"i-carbon-document-blank");return(c,C)=>{const K=oe,B=ue;return s(),p("div",null,[e("button",{flex:"~ gap-2","w-full":"","items-center":"",hover:"bg-active",px4:"",py1:"",style:le({paddingLeft:`calc(1rem + ${c.index*1.5}em)`}),class:H({"bg-active":!t(m)&&t(n)?.filePath===c.item?.filePath}),border:"b base",onClick:C[0]||(C[0]=w=>t(m)?v.value=!t(v):n.value=c.item)},[e("div",{class:H(t(D))},null,2),e("span",{class:H({"flex items-center":t(m)}),"flex-auto":"","text-start":"","text-sm":"","font-mono":""},V(c.item.path),3),t(m)?(s(),F(K,{key:0,icon:"carbon:chevron-right","transform-rotate":t(v)?90:0,transition:""},null,8,["transform-rotate"])):S("",!0)],6),t(v)?_e(c.$slots,"default",{key:0},()=>[(s(!0),p(L,null,G(c.item?.children,w=>(s(),F(B,{key:w.filepath,modelValue:t(n),"onUpdate:modelValue":C[1]||(C[1]=h=>R(n)?n.value=h:null),item:w,index:c.index+1},null,8,["modelValue","item","index"]))),128))]):S("",!0)])}}}),ot={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},st=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Preview "),e("div",{"x-divider":""})],-1),at={flex:"~","items-center":"","justify-center":""},lt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Details "),e("div",{"x-divider":""})],-1),it={"max-w-full":"","w-full":"","table-fixed":""},rt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Filepath ",-1),ct={flex:"~ gap-1","w-full":"","items-center":""},ut=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Public Path ",-1),dt={flex:"~ gap-1","w-full":"","items-center":"","of-hidden":""},pt={"flex-auto":"","of-hidden":"",truncate:"","ws-pre":"","font-mono":""},mt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Type ",-1),ft={capitalize:""},vt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Image Size ",-1),ht={key:0},_t=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Aspect Ratio ",-1),gt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," File size ",-1),xt=e("td",{"w-30":"","ws-nowrap":"",pr5:"","text-right":"",op50:""}," Last modified ",-1),wt={op70:""},bt=e("div",{flex:"~ gap2","mb--2":"","items-center":"",op50:""},[e("div",{"x-divider":""}),e("div",{"flex-none":""}," Actions "),e("div",{"x-divider":""})],-1),yt={flex:"~ gap2 wrap"},$t=e("div",{"flex-auto":""},null,-1),kt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Ct=e("span",null," Are you sure you want to delete this asset? ",-1),Pt={flex:"~ gap2 wrap justify-center"},At={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p8:""},Dt={flex:"~ gap2 wrap justify-center"},Vt={flex:"~ col gap-4","min-h-full":"","w-full":"","of-hidden":"",p4:""},Nt=["onKeydown"],Ft={flex:"","justify-end":"","gap-4":""},It=X({__name:"AssetDetails",props:{modelValue:{}},setup(T,{emit:l}){const n=ie(T,"modelValue",l,{passive:!0}),m=ge(),v=ne(()=>{if(n.value.type==="image")return Z.getImageMeta(n.value.filePath)}),D=N(!1),c=N(),C=N(0),K=ne(async()=>{if(n.value.type!=="text")return;C.value;const a=await Z.getTextAssetContent(n.value.filePath);return c.value=a,a});async function B(){if(K.value!==c.value)try{await Z.writeStaticAssets(await J(),[{path:n.value.path,content:c.value,override:!0}],""),D.value=!1,C.value++,U({message:"Updated",icon:"i-carbon-checkmark",classes:"text-green"})}catch{U({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const w=xe(),h=A(()=>(w.value?._installedModules||[]).some(o=>o.meta?.name==="@nuxt/image"||o.meta?.name==="@nuxt/image-edge")),b=A(()=>{const a=[];if(n.value.type==="image"){const o=v.value?.width?`
|
|
7
|
-
width="${v.value.width}"
|
|
8
|
-
height="${v.value.height}" `:" ";return a.push({lang:"vue-html",code:`<img${o}
|
|
9
|
-
src="${n.value.publicPath}"
|
|
10
|
-
/>`,name:"Plain Image"}),h.value&&a.push({lang:"vue-html",code:`<NuxtImage${o}
|
|
11
|
-
src="${n.value.publicPath}"
|
|
12
|
-
/>`,name:"Nuxt Image",docs:"https://image.nuxtjs.org/components/nuxt-img"},{lang:"vue-html",code:`<NuxtPicture${o}
|
|
13
|
-
src="${n.value.publicPath}"
|
|
14
|
-
/>`,name:"Nuxt Picture",docs:"https://image.nuxtjs.org/components/nuxt-picture"}),a}return a.push({lang:"html",code:`<a download href="${n.value.publicPath}">
|
|
15
|
-
Download ${n.value.path.split("/").slice(-1)[0]}
|
|
16
|
-
</a>`,name:"Download link"}),a}),z=we(),I=be(()=>n.value.mtime),j=A(()=>{const a=n.value.size;return a<1024?`${a} B`:a<1024*1024?`${(a/1024).toFixed(2)} KB`:`${(a/1024/1024).toFixed(2)} MB`}),i=A(()=>{if(!v.value?.width||!v.value?.height)return"";const a=(M,O)=>O?a(O,M%O):M,o=a(v.value.width,v.value.height);return o>3?`${v.value.width/o}:${v.value.height/o}`:""}),g=A(()=>["image","text","video","font"].includes(n.value.type)),_=N(!1);async function P(){try{await Z.deleteStaticAsset(await J(),n.value.filePath),n.value=void 0,_.value=!1,U({message:"Asset deleted",icon:"i-carbon-checkmark",classes:"text-green"})}catch{U({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}const f=N(!1),r=N("");async function y(){const a=n.value.filePath.split("/"),o=a.slice(-1)[0].split(".").slice(0,-1).join(".");if(!r.value||r.value===o)return U({message:"Please enter a new name",icon:"i-carbon-warning",classes:"text-orange"});try{const M=a.slice(-1)[0].split(".").slice(-1)[0],O=`${a.slice(0,-1).join("/")}/${r.value}.${M}`;await Z.renameStaticAsset(await J(),n.value.filePath,O),n.value=void 0,f.value=!1,U({message:"Asset renamed",icon:"i-carbon-checkmark",classes:"text-green"})}catch{U({message:"Something went wrong!",icon:"i-carbon-warning",classes:"text-red"})}}return(a,o)=>{const M=ce,O=Ne,Y=te,E=ae,de=Fe,Q=ke,pe=se,ee=re("tooltip");return s(),p(L,null,[e("div",ot,[t(g)?(s(),p(L,{key:0},[st,e("div",at,[u(M,{detail:"","max-h-80":"","min-h-20":"","min-w-20":"","w-auto":"",rounded:"",border:"~ base",asset:t(n),"text-content":t(K)},null,8,["asset","text-content"])])],64)):S("",!0),lt,e("table",it,[e("tbody",null,[e("tr",null,[rt,e("td",null,[e("div",ct,[u(O,{filepath:t(n).filePath,"text-left":""},null,8,["filepath"]),W(u(Y,{"flex-none":"",title:"Open in Editor",icon:"carbon-launch",onClick:o[0]||(o[0]=$=>t(m)(t(n).filePath))},null,512),[[ee,"Open in Editor"]])])])]),e("tr",null,[ut,e("td",null,[e("div",dt,[e("div",pt,V(t(n).publicPath),1),W(u(Y,{"flex-none":"",title:"Copy public path",icon:"carbon-copy",onClick:o[1]||(o[1]=$=>t(z)(t(n).publicPath))},null,512),[[ee,"Copy public path"]]),W(u(Y,{"flex-none":"",to:t(n).publicPath,icon:"carbon-launch",target:"_blank",title:"Open in browser"},null,8,["to"]),[[ee,"Open in browser"]])])])]),e("tr",null,[mt,e("td",ft,V(t(n).type),1)]),t(v)?.width?(s(),p(L,{key:0},[e("tr",null,[vt,e("td",null,V(t(v).width)+" x "+V(t(v).height),1)]),t(i)?(s(),p("tr",ht,[_t,e("td",null,V(t(i)),1)])):S("",!0)],64)):S("",!0),e("tr",null,[gt,e("td",null,V(t(j)),1)]),e("tr",null,[xt,e("td",null,[k(V(new Date(t(n).mtime).toLocaleString())+" ",1),e("span",wt,"("+V(t(I))+")",1)])])])]),bt,e("div",yt,[u(E,{to:t(n).publicPath,download:"",target:"_blank",icon:"carbon-download",n:"green"},{default:x(()=>[k(" Download ")]),_:1},8,["to"]),t(n).type==="text"?(s(),F(E,{key:0,icon:"carbon-edit",n:"cyan",onClick:o[2]||(o[2]=$=>D.value=!t(D))},{default:x(()=>[k(" Edit ")]),_:1})):S("",!0),u(E,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:o[3]||(o[3]=$=>f.value=!t(f))},{default:x(()=>[k(" Rename ")]),_:1}),u(E,{icon:"carbon-delete",n:"red",onClick:o[4]||(o[4]=$=>_.value=!t(_))},{default:x(()=>[k(" Delete ")]),_:1}),t(n).type==="image"?(s(),F(E,{key:1,disabled:"",icon:"carbon-image-service"},{default:x(()=>[k(" Optimize image (Coming soon) ")]),_:1})):S("",!0)]),$t,t(b).length?(s(),F(de,{key:1,border:"t base","mx--4":"","mb--4":"","code-snippets":t(b)},null,8,["code-snippets"])):S("",!0)]),u(Q,{modelValue:t(_),"onUpdate:modelValue":o[6]||(o[6]=$=>R(_)?_.value=$:null)},{default:x(()=>[e("div",kt,[Ct,e("div",Pt,[u(E,{icon:"carbon-close",onClick:o[5]||(o[5]=$=>_.value=!1)},{default:x(()=>[k(" Cancel ")]),_:1}),u(E,{icon:"carbon-delete",n:"red",onClick:P},{default:x(()=>[k(" Delete ")]),_:1})])])]),_:1},8,["modelValue"]),u(Q,{modelValue:t(f),"onUpdate:modelValue":o[9]||(o[9]=$=>R(f)?f.value=$:null)},{default:x(()=>[e("div",At,[u(pe,{modelValue:t(r),"onUpdate:modelValue":o[7]||(o[7]=$=>R(r)?r.value=$:null),placeholder:"New name",n:"blue"},null,8,["modelValue"]),e("div",Dt,[u(E,{icon:"carbon-close",onClick:o[8]||(o[8]=$=>f.value=!1)},{default:x(()=>[k(" Cancel ")]),_:1}),u(E,{icon:"carbon-text-annotation-toggle",n:"blue",onClick:y},{default:x(()=>[k(" Rename ")]),_:1})])])]),_:1},8,["modelValue"]),t(n).type==="text"?(s(),F(Q,{key:0,modelValue:t(D),"onUpdate:modelValue":o[12]||(o[12]=$=>R(D)?D.value=$:null)},{default:x(()=>[e("div",Vt,[W(e("textarea",{"onUpdate:modelValue":o[10]||(o[10]=$=>R(c)?c.value=$:null),placeholder:"Item value...",class:"h-lg w-xl of-auto rounded-lg p-4 text-sm font-mono outline-none",onKeydown:ye(B,["enter"])},null,40,Nt),[[$e,t(c)]]),e("div",Ft,[u(E,{icon:"carbon-close",onClick:o[11]||(o[11]=$=>D.value=!1)},{default:x(()=>[k(" Cancel ")]),_:1}),u(E,{icon:"carbon:save",n:"primary",onClick:B},{default:x(()=>[k(" save ")]),_:1})])])]),_:1},8,["modelValue"])):S("",!0)],64)}}}),St={"h-full":"","of-auto":""},Tt={"flex-none":"",flex:"~ gap2 items-center"},jt={op50:""},Et={key:0},Ut={"mt--4":"",px2:"",grid:"~ cols-minmax-8rem"},Bt={key:1,p2:"",grid:"~ cols-minmax-8rem"},Lt={key:1},Ht=X({__name:"assets",setup(T){const l=Ce(),d=N(""),n=A(()=>new Pe(l.value||[],{keys:["path"]})),m=A(()=>d.value?n.value.search(d.value).map(h=>h.item):l.value||[]),v=A(()=>{const w={};for(const h of m.value){const b=`${h.path.split("/").slice(0,-1).join("/")}/`;w[b]||(w[b]=[]),w[b].push(h)}return Object.entries(w).sort(([h],[b])=>h.localeCompare(b))}),D=A(()=>{const w={path:"public",children:[]},h=(b,z,I)=>{const[j,...i]=z;let g=b.children.find(_=>_.path===j);g||(g={...I,path:j,children:[]},b.children.push(g)),i.length>1?h(g,i,I):i.length===1&&g.children.push({...I,path:i[0]})};return m.value.forEach(b=>{const z=b.path.split("/").filter(I=>I!=="");h(w,z,b)}),w.children}),c=N(),{view:C}=Ie("assets");function K(){C.value=C.value==="list"?"grid":"list"}Ae("Escape",()=>{c.value=void 0});const B=N();return(w,h)=>{const b=te,z=De,I=Ke,j=nt,i=Ve,g=ue,_=It,P=Se,f=re("tooltip");return s(),p("div",St,[u(z,{ref_key:"navbar",ref:B,search:t(d),"onUpdate:search":h[0]||(h[0]=r=>R(d)?d.value=r:null),pb2:""},{actions:x(()=>[e("div",Tt,[W(u(b,{"text-lg":"",icon:t(C)==="grid"?"i-carbon-list":"i-carbon-grid",title:"Toggle view",onClick:K},null,8,["icon"]),[[f,"Toggle View",void 0,{"bottom-end":!0}]])])]),default:x(()=>[e("div",jt,[t(d)?(s(),p("span",Et,V(t(m).length)+" matched · ",1)):S("",!0),e("span",null,V(t(l)?.length)+" assets in total",1)])]),_:1},8,["search"]),u(I,{folder:"/"}),t(C)==="grid"?(s(),p(L,{key:0},[t(v).length>1?(s(!0),p(L,{key:0},G(t(v),([r,y])=>(s(),F(i,{key:r,text:r,description:`${y.length} items`,open:y.length<=("DETAILS_MAX_ITEMS"in w?w.DETAILS_MAX_ITEMS:t(Te)),padding:!1},{default:x(()=>[e("div",Ut,[(s(!0),p(L,null,G(y,a=>(s(),F(j,{key:a.path,asset:a,folder:r,onClick:o=>c.value=a},null,8,["asset","folder","onClick"]))),128))])]),_:2},1032,["text","description","open"]))),128)):(s(),p("div",Bt,[(s(!0),p(L,null,G(t(m),r=>(s(),F(j,{key:r.path,asset:r,onClick:y=>c.value=r},null,8,["asset","onClick"]))),128))]))],64)):(s(),p("div",Lt,[(s(!0),p(L,null,G(t(D),(r,y)=>(s(),F(g,{key:y,modelValue:t(c),"onUpdate:modelValue":h[1]||(h[1]=a=>R(c)?c.value=a:null),item:r},null,8,["modelValue","item"]))),128))])),u(P,{"model-value":!!t(c),"auto-close":"","w-120":"",navbar:t(B),onClose:h[3]||(h[3]=r=>c.value=void 0)},{default:x(()=>[t(c)?(s(),F(_,{key:0,modelValue:t(c),"onUpdate:modelValue":h[2]||(h[2]=r=>R(c)?c.value=r:null)},null,8,["modelValue"])):S("",!0)]),_:1},8,["model-value","navbar"])])}}});export{Ht as default};
|