@nuxt/devtools 1.0.0-beta.0 → 1.0.0-beta.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/dist/chunks/module-main.mjs +148 -46
- package/dist/chunks/vscode.mjs +3 -1
- package/dist/client/200.html +24 -24
- package/dist/client/404.html +24 -24
- package/dist/client/__blank/index.html +42 -0
- package/dist/client/_nuxt/{CodeDiff.vue.3beaa134.js → CodeDiff.vue.b74b0167.js} +1 -1
- package/dist/client/_nuxt/{ComposableItem.vue.136c5104.js → ComposableItem.vue.66a98e20.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaButton.vue.125423b7.js → DataSchemaButton.vue.b30dcd6f.js} +1 -1
- package/dist/client/_nuxt/{DataSchemaDrawer.8ac6b677.js → DataSchemaDrawer.d00941d6.js} +1 -1
- package/dist/client/_nuxt/{DurationDisplay.vue.c49b4e64.js → DurationDisplay.vue.5b7cc04d.js} +1 -1
- package/dist/client/_nuxt/{FilepathItem.vue.5af0b5df.js → FilepathItem.vue.6dd69314.js} +1 -1
- package/dist/client/_nuxt/{HelpFab.vue.98c902f4.js → HelpFab.vue.314bc83b.js} +1 -1
- package/dist/client/_nuxt/LaunchPage.vue.017c62ce.js +1 -0
- package/dist/client/_nuxt/{NBadge.98d5d309.js → NBadge.e849763e.js} +1 -1
- package/dist/client/_nuxt/NCheckbox.vue.cf7e1e9d.js +1 -0
- package/dist/client/_nuxt/{NCodeBlock.vue.adf1e9b4.js → NCodeBlock.vue.882d562f.js} +2 -2
- package/dist/client/_nuxt/{NDrawer.vue.8e620517.js → NDrawer.vue.a4010d93.js} +1 -1
- package/dist/client/_nuxt/{NDropdown.vue.b2f7aaef.js → NDropdown.vue.3b1768f5.js} +1 -1
- package/dist/client/_nuxt/{NIconTitle.vue.bf8093eb.js → NIconTitle.vue.71113a3f.js} +1 -1
- package/dist/client/_nuxt/{NLink.vue.0e98999b.js → NLink.vue.a09685db.js} +1 -1
- package/dist/client/_nuxt/{NMarkdown.vue.b0e8b2fc.js → NMarkdown.vue.13c5f0c3.js} +1 -1
- package/dist/client/_nuxt/NNavbar.vue.d9a029e0.js +1 -0
- package/dist/client/_nuxt/{NSectionBlock.4347cc14.js → NSectionBlock.7f41e147.js} +1 -1
- package/dist/client/_nuxt/{NSelect.vue.4c22d30e.js → NSelect.vue.e7f8c81a.js} +1 -1
- package/dist/client/_nuxt/{NSelectTabs.vue.c9be0aa2.js → NSelectTabs.vue.ddc009ff.js} +1 -1
- package/dist/client/_nuxt/{NSwitch.vue.de333089.js → NSwitch.vue.8d3010b0.js} +1 -1
- package/dist/client/_nuxt/{NTip.vue.770a171a.js → NTip.vue.3f5fb5a1.js} +1 -1
- package/dist/client/_nuxt/{StateEditor.vue.332bb451.js → StateEditor.vue.162475d5.js} +1 -1
- package/dist/client/_nuxt/__blank.f49c5a73.js +1 -0
- package/dist/client/_nuxt/analyze-build.988e7c9e.js +1 -0
- package/dist/client/_nuxt/assets.2b649247.js +16 -0
- package/dist/client/_nuxt/{client.3f2665f1.js → client.253674ec.js} +1 -1
- package/dist/client/_nuxt/components.7583b49c.js +98 -0
- package/dist/client/_nuxt/{constants.4e5eba24.js → constants.2cc6e981.js} +1 -1
- package/dist/client/_nuxt/{css.a67813b3.js → css.f61fd02b.js} +3 -3
- package/dist/client/_nuxt/custom-_name_.0e141ac3.js +1 -0
- package/dist/client/_nuxt/{default.3ba7d10b.js → default.a50dad07.js} +1 -1
- package/dist/client/_nuxt/entry.3dd66f35.js +27 -0
- package/dist/client/_nuxt/entry.960c025a.css +1 -0
- package/dist/client/_nuxt/{error-404.9d2aaad9.js → error-404.429edf81.js} +1 -1
- package/dist/client/_nuxt/{error-500.20d1b3ce.js → error-500.9e83b20b.js} +1 -1
- package/dist/client/_nuxt/{full.6d0fd7cf.js → full.c90b8ab9.js} +1 -1
- package/dist/client/_nuxt/{hooks.908144b2.js → hooks.40588927.js} +1 -1
- package/dist/client/_nuxt/{html.af01869e.js → html.14085b69.js} +1 -1
- package/dist/client/_nuxt/imports.7b590e48.js +1 -0
- package/dist/client/_nuxt/index.8013a14e.js +17 -0
- package/dist/client/_nuxt/{index.eb95211d.js → index.90ae56cb.js} +1 -1
- package/dist/client/_nuxt/json-editor-vue.465dc720.js +129 -0
- package/dist/client/_nuxt/{middleware.9e4b2529.js → middleware.72aa446e.js} +1 -1
- package/dist/client/_nuxt/modules.d997669f.js +2 -0
- package/dist/client/_nuxt/{none.27bf71df.js → none.ab2b300f.js} +1 -1
- package/dist/client/_nuxt/open-graph.1cc10683.js +3 -0
- package/dist/client/_nuxt/{overview.4991be1e.js → overview.014aea35.js} +1 -1
- package/dist/client/_nuxt/pages.7f7e1a57.js +1 -0
- package/dist/client/_nuxt/{payload.eaf10e21.js → payload.58a8bb6b.js} +1 -1
- package/dist/client/_nuxt/{plugins.f02b2c56.js → plugins.1f073986.js} +1 -1
- package/dist/client/_nuxt/runtime-configs.6d4dd513.js +1 -0
- package/dist/client/_nuxt/server-routes.b5fc14db.js +9 -0
- package/dist/client/_nuxt/settings.04d1166d.js +1 -0
- package/dist/client/_nuxt/shellscript.e25d1410.js +4 -0
- package/dist/client/_nuxt/{state-components.ca4a58b1.js → state-components.c2be3414.js} +1 -1
- package/dist/client/_nuxt/state-modules.5bf4563c.js +1 -0
- package/dist/client/_nuxt/storage-options.2224e06b.js +1 -0
- package/dist/client/_nuxt/{storage.27117a31.js → storage.8cd70b69.js} +1 -1
- package/dist/client/_nuxt/{terminals.cdead889.js → terminals.ce3bbf0e.js} +2 -2
- package/dist/client/_nuxt/timeline.23647b38.js +29 -0
- package/dist/client/_nuxt/{unocss-runtime.ddd835d7.js → unocss-runtime.41db0d67.js} +2 -2
- package/dist/client/_nuxt/virtual-files.bc5e9072.js +1 -0
- package/dist/client/_nuxt/{vitesse-dark.ab479e3d.js → vitesse-dark.ff0e7dcb.js} +1 -1
- package/dist/client/_nuxt/{vitesse-light.696edcfd.js → vitesse-light.c6996724.js} +1 -1
- package/dist/client/_nuxt/{vue-html.0806679f.js → vue-html.88dda4a8.js} +1 -1
- package/dist/client/_nuxt/{vue.24311fdc.js → vue.7ad3b25a.js} +3 -3
- package/dist/client/index.html +24 -24
- package/dist/client/modules/analyze-build/index.html +24 -24
- package/dist/client/modules/assets/index.html +24 -24
- package/dist/client/modules/components/index.html +24 -24
- package/dist/client/modules/hooks/index.html +24 -24
- package/dist/client/modules/imports/index.html +24 -24
- package/dist/client/modules/middleware/index.html +24 -24
- package/dist/client/modules/modules/index.html +24 -24
- package/dist/client/modules/open-graph/index.html +24 -24
- package/dist/client/modules/overview/index.html +24 -24
- package/dist/client/modules/pages/index.html +24 -24
- package/dist/client/modules/payload/index.html +24 -24
- package/dist/client/modules/plugins/index.html +24 -24
- package/dist/client/modules/runtime-configs/index.html +24 -24
- package/dist/client/modules/server-routes/index.html +24 -24
- package/dist/client/modules/storage/index.html +24 -24
- package/dist/client/modules/terminals/index.html +24 -24
- package/dist/client/modules/timeline/index.html +24 -24
- package/dist/client/modules/virtual-files/index.html +24 -24
- package/dist/client/settings/index.html +24 -24
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/shared/devtools.d18bab28.mjs +84 -0
- package/package.json +32 -29
- package/dist/client/_nuxt/LaunchPage.vue.805f9595.js +0 -1
- package/dist/client/_nuxt/NCheckbox.vue.6fb2ece1.js +0 -1
- package/dist/client/_nuxt/Navbar.vue.371e4d0a.js +0 -1
- package/dist/client/_nuxt/analyze-build.281c50c1.js +0 -1
- package/dist/client/_nuxt/assets.ca8faf7a.js +0 -16
- package/dist/client/_nuxt/components.a8900a78.js +0 -98
- package/dist/client/_nuxt/custom-_name_.c49c72a2.js +0 -1
- package/dist/client/_nuxt/entry.1c0836ed.css +0 -1
- package/dist/client/_nuxt/entry.e01776ec.js +0 -27
- package/dist/client/_nuxt/imports.d7bd415a.js +0 -1
- package/dist/client/_nuxt/index.a0a2f0b3.js +0 -17
- package/dist/client/_nuxt/json-editor-vue.b22bf91c.js +0 -129
- package/dist/client/_nuxt/modules.fd214f26.js +0 -2
- package/dist/client/_nuxt/open-graph.b95ebacd.js +0 -3
- package/dist/client/_nuxt/pages.708b9e25.js +0 -1
- package/dist/client/_nuxt/runtime-configs.63235af8.js +0 -1
- package/dist/client/_nuxt/server-routes.88eebd4c.js +0 -9
- package/dist/client/_nuxt/settings.7dbb31cf.js +0 -1
- package/dist/client/_nuxt/shellscript.9d056341.js +0 -4
- package/dist/client/_nuxt/state-modules.6d6b039c.js +0 -1
- package/dist/client/_nuxt/storage-options.ab028b2a.js +0 -1
- package/dist/client/_nuxt/timeline.ddc61557.js +0 -29
- package/dist/client/_nuxt/virtual-files.9da3562d.js +0 -1
- package/dist/shared/devtools.c28fc9a7.mjs +0 -80
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as e,m as n,o}from"./entry.
|
|
1
|
+
import{d as e,m as n,o}from"./entry.3dd66f35.js";const m=e({__name:"middleware",setup(t){return(a,r)=>(o(),n("div",null," WIP "))}});export{m as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{_ as ze}from"./FilepathItem.vue.6dd69314.js";import{d as H,a as L,a8 as he,o as d,h as C,j as y,k as a,a7 as E,f as m,v as M,t as O,m as b,G as D,p as S,i as v,F as j,n as F,x as te,al as _e,Q as ve,aJ as Me,K as ae,L as ce,U as Ce,aK as ye,aL as ge,_ as ie,y as Te,z as Oe,av as be,aM as Ne,aN as Ve,aO as Pe,am as Ae,ab as Le,I as Be,as as ue,aq as je,aP as Ee,a5 as Re,r as xe,af as De,l as He,W as Ue,a9 as Fe,X as qe,R as Ke,aQ as de}from"./entry.3dd66f35.js";import{_ as We,u as $e,a as Ye}from"./state-modules.5bf4563c.js";import{_ as Ge}from"./NSectionBlock.7f41e147.js";import{_ as Xe}from"./NIconTitle.vue.71113a3f.js";import{_ as Qe}from"./NBadge.e849763e.js";import{_ as Je}from"./NDropdown.vue.3b1768f5.js";import{_ as Ze}from"./NCodeBlock.vue.882d562f.js";import{_ as et}from"./NLink.vue.a09685db.js";import{_ as tt}from"./CodeDiff.vue.b74b0167.js";import{_ as it}from"./NTip.vue.3f5fb5a1.js";import{_ as nt}from"./HelpFab.vue.314bc83b.js";import"./NCheckbox.vue.cf7e1e9d.js";import"./client.253674ec.js";const ot={flex:"~ col gap2","flex-auto":"","of-hidden":"",px1:""},st={"gap-1t":"",flex:"","items-center":"","text-ellipsis":"","ws-nowrap":"","text-lg":""},rt={key:2},lt=a("div",{"flex-auto":""},null,-1),at={key:1,flex:"~ gap-2",title:"Documentation"},ct=a("span",{"i-carbon-link":"","text-lg":"",op50:""},null,-1),ut={key:2,flex:"~ gap-2"},dt=a("span",{"i-carbon-logo-github":"","text-lg":"",op50:""},null,-1),mt={flex:"~ col","items-end":""},ft={key:0,"h-20":"","w-20":"",flex:"","flex-none":"",rounded:"","bg-gray:3":"",p4:""},pt=["src","alt"],ht=a("div",{"i-carbon-cube":"",ma:"","text-4xl":"",op30:""},null,-1),_t={key:1,flex:"~",mt2:"","flex-auto":"","items-end":"","justify-end":""},vt=["src"],yt=a("div",{"flex-auto":""},null,-1),gt={flex:"","justify-end":""},bt="https://api.nuxtjs.org/api/ipx/s_80,f_webp/gh/nuxt/modules/main/icons/",xt="https://api.nuxtjs.org/api/ipx/s_44,f_webp/gh_avatar/",$t="https://github.com/",kt="https://www.npmjs.com/package/",ne=H({__name:"ModuleItemBase",props:{mod:{},info:{},compact:{type:Boolean},maintainers:{type:Boolean,default:!0}},setup(e){const t=e,i=L(()=>({...t.mod?.meta,...t.mod,...t.info})),o=he();return(n,r)=>{const c=te,l=_e;return d(),C(l,{p4:"",flex:"~ gap2"},{default:y(()=>[a("div",ot,[E(n.$slots,"main",{},()=>[a("div",st,[n.mod.isPackageModule?(d(),C(c,{key:0,to:kt+(m(i).npm||m(i).name),target:"_blank",hover:"underline text-primary"},{default:y(()=>[M(O(m(i).name),1)]),_:1},8,["to"])):n.mod.entryPath?(d(),b("button",{key:1,role:"button",hover:"underline text-primary",onClick:r[0]||(r[0]=s=>m(o)(n.mod.entryPath))},O(m(i).name),1)):(d(),b("span",rt,O(m(i).name),1)),E(n.$slots,"badge")]),m(i).description?(d(),b("div",{key:0,class:D(n.compact?"ws-nowrap of-hidden truncate":"line-clamp-2"),"mt--1":"","text-sm":"",op50:""},O(m(i).description),3)):S("",!0),lt,m(i).website?(d(),b("div",at,[ct,v(c,{to:m(i).website,target:"_blank","of-hidden":"",truncate:"","ws-nowrap":"","text-sm":"",op50:"",hover:"op100 underline text-primary"},{default:y(()=>[M(O(m(i).website.replace(/^https?:\/\//,"")),1)]),_:1},8,["to"])])):S("",!0),m(i).github?(d(),b("div",ut,[dt,v(c,{to:m(i).github,target:"_blank","of-hidden":"",truncate:"","ws-nowrap":"","text-sm":"",op50:"",hover:"op100 underline text-primary"},{default:y(()=>[M(O(m(i).github.replace(/^https?:\/\/github.com\//,"")),1)]),_:1},8,["to"])])):S("",!0)]),E(n.$slots,"items")]),a("div",mt,[m(i).icon||n.mod.isPackageModule?(d(),b("div",ft,[m(i).icon?(d(),b("img",{key:0,src:bt+m(i).icon,alt:n.mod.name,ma:""},null,8,pt)):S("",!0),ht])):S("",!0),m(i).maintainers?.length&&n.maintainers?(d(),b("div",_t,[(d(!0),b(j,null,F(m(i).maintainers,s=>(d(),C(c,{key:s.name,target:"_blank",to:$t+s.github,title:s.name},{default:y(()=>[a("img",{src:xt+s.github,"h-6":"","w-6":"","rounded-full":""},null,8,vt)]),_:2},1032,["to","title"]))),128))])):S("",!0),n.$slots.actions?(d(),b(j,{key:2},[yt,a("div",gt,[E(n.$slots,"actions")])],64)):S("",!0)])]),_:3})}}}),wt={key:0,flex:"~ gap-2",title:"Open on filesystem"},It=a("span",{"i-carbon-folder-move-to":"","text-lg":"",op50:""},null,-1),St=a("span",{"i-carbon-circle-dash":"","animate-spin":"","text-lg":"",op50:""},null,-1),zt=a("code",{"text-sm":"",op50:""},"Upgrading...",-1),Mt={key:1,"mx--2":""},Ct=["onClick"],Tt=a("span",{"i-carbon-intent-request-active":"","text-lg":"","text-primary":""},null,-1),Ot=a("code",{"text-xs":""},"Update installed, click to restart",-1),Nt=[Tt,Ot],Vt={key:2,"mx--2":""},Pt=["onClick"],At=a("span",{"i-carbon-intent-request-upgrade":"","text-lg":"",op50:""},null,-1),Lt={op50:""},Bt=a("div",{"i-carbon-arrow-right":"",op50:""},null,-1),jt={"text-green":""},Et={key:3,flex:"~ gap-2","items-center":"",title:"NPM"},Rt=a("span",{"i-carbon-cube":"","text-lg":"",op50:""},null,-1),Dt={"text-sm":"",op50:""},Ht=H({__name:"ModuleItem",props:{mod:{}},setup(e){const t=e,i=L(()=>t.mod.info),o=L(()=>({...t.mod?.meta,...t.mod,...i.value})),n=ve();return(r,c)=>{const l=ze,s=te,u=We,f=ne;return d(),C(f,{mod:r.mod,info:m(i)},{items:y(()=>[r.mod.entryPath?(d(),b("div",wt,[It,v(l,{filepath:r.mod.entryPath,"text-sm":"",op50:"",hover:"text-primary op100"},null,8,["filepath"])])):S("",!0),m(o).npm?(d(),C(u,{key:m(o).npm,"package-name":m(o).npm,options:{dev:!0}},{default:y(({info:h,update:k,state:T,id:w,restart:g})=>[T==="running"?(d(),C(s,{key:0,flex:"~ gap-2","animate-pulse":"","items-center":"",to:w?"/modules/terminals":void 0,onClick:x=>w?n.value=w:void 0},{default:y(()=>[St,zt]),_:2},1032,["to","onClick"])):T==="updated"?(d(),b("div",Mt,[a("button",{flex:"~ gap-2",hover:"bg-primary/20","items-center":"",rounded:"","bg-primary:10":"",px2:"","text-sm":"","text-primary":"",onClick:g},Nt,8,Ct)])):h?.needsUpdate?(d(),b("div",Vt,[a("button",{flex:"~ gap-2",title:"Click to upgrade","items-center":"",rounded:"",px2:"","text-sm":"",hover:"bg-active",onClick:x=>k()},[At,a("code",Lt,"v"+O(h.current),1),Bt,a("code",jt,"v"+O(h.latest),1)],8,Pt)])):h?.latest?(d(),b("div",Et,[Rt,a("code",Dt,"v"+O(h.current),1)])):S("",!0)]),_:1},8,["package-name"])):S("",!0)]),_:1},8,["mod","info"])}}}),Ut=H({__name:"ModuleItemInstall",props:{item:{}},emits:["start"],setup(e,{emit:t}){const i=e,o=$e(),n=L(()=>o.value.find(u=>u.name===i.item.npm)),r=L(()=>n.value&&n.value.isPackageModule),c=L(()=>n.value&&n.value.isPackageModule&&n.value.isUninstallable);async function l(u,f){const h=f==="install"?ae.installNuxtModule:ae.uninstallNuxtModule,k=await h(await ce(),u.npm,!0);Ce(`modules:${f}`,{moduleName:u.npm}),k.commands&&await ye.start(u,k,f)&&(ge.value.push({name:u.npm,info:u,processId:k.processId}),t("start"),await h(await ce(),u.npm,!1))}const s={};return(u,f)=>{const h=Qe,k=ie,T=Je,w=ne;return d(),C(w,{mod:s,role:m(r)?"":"button",info:u.item,mb2:"","h-full":"",class:D(m(r)?"border-dashed op75":"hover:bg-active!"),compact:!0,onClick:f[1]||(f[1]=g=>m(r)?null:l(u.item,"install"))},Me({_:2},[m(r)?{name:"badge",fn:y(()=>[v(h,{n:"green",textContent:"Installed"}),m(c)?(d(),C(T,{key:0,n:"sm green"},{trigger:y(({click:g})=>[v(k,{icon:"carbon-overflow-menu-vertical",border:!1,onClick:x=>g()},null,8,["onClick"])]),default:y(()=>[v(k,{icon:"carbon-trash-can",n:"red",onClick:f[0]||(f[0]=g=>l(u.item,"uninstall"))},{default:y(()=>[M(" Uninstall ")]),_:1})]),_:1})):S("",!0)]),key:"0"}:void 0]),1032,["role","info","class"])}}});function Ft(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var o=e.indexOf("rv:");return parseInt(e.substring(o+3,e.indexOf(".",o)),10)}var n=e.indexOf("Edge/");return n>0?parseInt(e.substring(n+5,e.indexOf(".",n)),10):-1}let W;function Q(){Q.init||(Q.init=!0,W=Ft()!==-1)}var G={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){Q(),be(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const e=document.createElement("object");this._resizeObject=e,e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex",-1),e.onload=this.addResizeHandlers,e.type="text/html",W&&this.$el.appendChild(e),e.data="about:blank",W||this.$el.appendChild(e)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!W&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const qt=Ne();Te("data-v-b329ee4c");const Kt={class:"resize-observer",tabindex:"-1"};Oe();const Wt=qt((e,t,i,o,n,r)=>(d(),C("div",Kt)));G.render=Wt;G.__scopeId="data-v-b329ee4c";G.__file="src/components/ResizeObserver.vue";function Y(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Y=function(t){return typeof t}:Y=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Y(e)}function Yt(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function me(e,t){for(var i=0;i<t.length;i++){var o=t[i];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function Gt(e,t,i){return t&&me(e.prototype,t),i&&me(e,i),e}function fe(e){return Xt(e)||Qt(e)||Jt(e)||Zt()}function Xt(e){if(Array.isArray(e))return J(e)}function Qt(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Jt(e,t){if(e){if(typeof e=="string")return J(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);if(i==="Object"&&e.constructor&&(i=e.constructor.name),i==="Map"||i==="Set")return Array.from(e);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return J(e,t)}}function J(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,o=new Array(t);i<t;i++)o[i]=e[i];return o}function Zt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ei(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function ti(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o,n,r,c=function(s){for(var u=arguments.length,f=new Array(u>1?u-1:0),h=1;h<u;h++)f[h-1]=arguments[h];if(r=f,!(o&&s===n)){var k=i.leading;typeof k=="function"&&(k=k(s,n)),(!o||s!==n)&&k&&e.apply(void 0,[s].concat(fe(r))),n=s,clearTimeout(o),o=setTimeout(function(){e.apply(void 0,[s].concat(fe(r))),o=0},t)}};return c._clear=function(){clearTimeout(o),o=null},c}function ke(e,t){if(e===t)return!0;if(Y(e)==="object"){for(var i in e)if(!ke(e[i],t[i]))return!1;return!0}return!1}var ii=function(){function e(t,i,o){Yt(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,o)}return Gt(e,[{key:"createObserver",value:function(i,o){var n=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=ei(i),this.callback=function(l,s){n.options.callback(l,s),l&&n.options.once&&(n.frozen=!0,n.destroyObserver())},this.callback&&this.options.throttle){var r=this.options.throttleOptions||{},c=r.leading;this.callback=ti(this.callback,this.options.throttle,{leading:function(s){return c==="both"||c==="visible"&&s||c==="hidden"&&!s}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(l){var s=l[0];if(l.length>1){var u=l.find(function(h){return h.isIntersecting});u&&(s=u)}if(n.callback){var f=s.isIntersecting&&s.intersectionRatio>=n.threshold;if(f===n.oldResult)return;n.oldResult=f,n.callback(f,s)}},this.options.intersection),be(function(){n.observer&&n.observer.observe(n.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),e}();function we(e,t,i){var o=t.value;if(o)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var n=new ii(e,o,i);e._vue_visibilityState=n}}function ni(e,t,i){var o=t.value,n=t.oldValue;if(!ke(o,n)){var r=e._vue_visibilityState;if(!o){Ie(e);return}r?r.createObserver(o,i):we(e,{value:o},i)}}function Ie(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var oi={beforeMount:we,updated:ni,unmounted:Ie},si={itemsLimit:1e3},ri=/(auto|scroll)/;function Se(e,t){return e.parentNode===null?t:Se(e.parentNode,t.concat([e]))}var X=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},li=function(t){return X(t,"overflow")+X(t,"overflow-y")+X(t,"overflow-x")},ai=function(t){return ri.test(li(t))};function pe(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=Se(e.parentNode,[]),i=0;i<t.length;i+=1)if(ai(t[i]))return t[i];return document.scrollingElement||document.documentElement}}function Z(e){"@babel/helpers - typeof";return Z=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Z(e)}var ci={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(t){return["vertical","horizontal"].includes(t)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function ui(){return this.items.length&&Z(this.items[0])!=="object"}var ee=!1;if(typeof window<"u"){ee=!1;try{var di=Object.defineProperty({},"passive",{get:function(){ee=!0}});window.addEventListener("test",null,di)}catch{}}let mi=0;var oe={name:"RecycleScroller",components:{ResizeObserver:G},directives:{ObserveVisibility:oi},props:{...ci,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const e={"-1":{accumulator:0}},t=this.items,i=this.sizeField,o=this.minItemSize;let n=1e4,r=0,c;for(let l=0,s=t.length;l<s;l++)c=t[l][i]||o,c<n&&(n=c),r+=c,e[l]={accumulator:r,size:c};return this.$_computedMinItemSize=n,e}return[]},simpleArray:ui,itemIndexByKey(){const{keyField:e,items:t}=this,i={};for(let o=0,n=t.length;o<n;o++)i[t[o][e]]=o;return i}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const e=this.$_lastUpdateScrollPosition;typeof e=="number"&&this.$nextTick(()=>{this.scrollToPosition(e)})},beforeUnmount(){this.removeListeners()},methods:{addView(e,t,i,o,n){const r=Ve({id:mi++,index:t,used:!0,key:o,type:n}),c=Pe({item:i,position:0,nr:r});return e.push(c),c},unuseView(e,t=!1){const i=this.$_unusedViews,o=e.nr.type;let n=i.get(o);n||(n=[],i.set(o,n)),n.push(e),t||(e.nr.used=!1,e.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(e){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const t=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:i}=this.updateVisibleItems(!1,!0);i||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});t(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&t()},this.updateInterval))}},handleVisibilityChange(e,t){this.ready&&(e||t.boundingClientRect.width!==0||t.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(e,t=!1){const i=this.itemSize,o=this.gridItems||1,n=this.itemSecondarySize||i,r=this.$_computedMinItemSize,c=this.typeField,l=this.simpleArray?null:this.keyField,s=this.items,u=s.length,f=this.sizes,h=this.$_views,k=this.$_unusedViews,T=this.pool,w=this.itemIndexByKey;let g,x,$,N,A;if(!u)g=x=N=A=$=0;else if(this.$_prerender)g=N=0,x=A=Math.min(this.prerender,s.length),$=null;else{const p=this.getScroll();if(t){let z=p.start-this.$_lastUpdateScrollPosition;if(z<0&&(z=-z),i===null&&z<r||z<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=p.start;const V=this.buffer;p.start-=V,p.end+=V;let I=0;if(this.$refs.before&&(I=this.$refs.before.scrollHeight,p.start-=I),this.$refs.after){const z=this.$refs.after.scrollHeight;p.end+=z}if(i===null){let z,U=0,re=u-1,P=~~(u/2),le;do le=P,z=f[P].accumulator,z<p.start?U=P:P<u-1&&f[P+1].accumulator>p.start&&(re=P),P=~~((U+re)/2);while(P!==le);for(P<0&&(P=0),g=P,$=f[u-1].accumulator,x=P;x<u&&f[x].accumulator<p.end;x++);for(x===-1?x=s.length-1:(x++,x>u&&(x=u)),N=g;N<u&&I+f[N].accumulator<p.start;N++);for(A=N;A<u&&I+f[A].accumulator<p.end;A++);}else{g=~~(p.start/i*o);const z=g%o;g-=z,x=Math.ceil(p.end/i*o),N=Math.max(0,Math.floor((p.start-I)/i*o)),A=Math.floor((p.end-I)/i*o),g<0&&(g=0),x>u&&(x=u),N<0&&(N=0),A>u&&(A=u),$=Math.ceil(u/o)*i}}x-g>si.itemsLimit&&this.itemsLimitError(),this.totalSize=$;let _;const q=g<=this.$_endIndex&&x>=this.$_startIndex;if(q)for(let p=0,V=T.length;p<V;p++)_=T[p],_.nr.used&&(e&&(_.nr.index=w[_.item[l]]),(_.nr.index==null||_.nr.index<g||_.nr.index>=x)&&this.unuseView(_));const se=q?null:new Map;let R,B,K;for(let p=g;p<x;p++){R=s[p];const V=l?R[l]:R;if(V==null)throw new Error(`Key is ${V} on item (keyField is '${l}')`);if(_=h.get(V),!i&&!f[p].size){_&&this.unuseView(_);continue}B=R[c];let I=k.get(B),z=!1;if(!_)q?I&&I.length?_=I.pop():_=this.addView(T,p,R,V,B):(K=se.get(B)||0,(!I||K>=I.length)&&(_=this.addView(T,p,R,V,B),this.unuseView(_,!0),I=k.get(B)),_=I[K],se.set(B,K+1)),h.delete(_.nr.key),_.nr.used=!0,_.nr.index=p,_.nr.key=V,_.nr.type=B,h.set(V,_),z=!0;else if(!_.nr.used&&(_.nr.used=!0,z=!0,I)){const U=I.indexOf(_);U!==-1&&I.splice(U,1)}_.item=R,z&&(p===s.length-1&&this.$emit("scroll-end"),p===0&&this.$emit("scroll-start")),i===null?(_.position=f[p-1].accumulator,_.offset=0):(_.position=Math.floor(p/o)*i,_.offset=p%o*n)}return this.$_startIndex=g,this.$_endIndex=x,this.emitUpdate&&this.$emit("update",g,x,N,A),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:q}},getListenerTarget(){let e=pe(this.$el);return window.document&&(e===window.document.documentElement||e===window.document.body)&&(e=window),e},getScroll(){const{$el:e,direction:t}=this,i=t==="vertical";let o;if(this.pageMode){const n=e.getBoundingClientRect(),r=i?n.height:n.width;let c=-(i?n.top:n.left),l=i?window.innerHeight:window.innerWidth;c<0&&(l+=c,c=0),c+l>r&&(l=r-c),o={start:c,end:c+l}}else i?o={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:o={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return o},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,ee?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(e){let t;const i=this.gridItems||1;this.itemSize===null?t=e>0?this.sizes[e-1].accumulator:0:t=Math.floor(e/i)*this.itemSize,this.scrollToPosition(t)},scrollToPosition(e){const t=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let i,o,n;if(this.pageMode){const r=pe(this.$el),c=r.tagName==="HTML"?0:r[t.scroll],l=r.getBoundingClientRect(),u=this.$el.getBoundingClientRect()[t.start]-l[t.start];i=r,o=t.scroll,n=e+c+u}else i=this.$el,o=t.scroll,n=e;i[o]=n},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((e,t)=>e.nr.index-t.nr.index)}}};const fi={key:0,ref:"before",class:"vue-recycle-scroller__slot"},pi={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function hi(e,t,i,o,n,r){const c=Ae("ResizeObserver"),l=Le("observe-visibility");return Be((d(),b("div",{class:D(["vue-recycle-scroller",{ready:n.ready,"page-mode":i.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...s)=>r.handleScroll&&r.handleScroll(...s))},[e.$slots.before?(d(),b("div",fi,[E(e.$slots,"before")],512)):S("v-if",!0),(d(),C(ue(i.listTag),{ref:"wrapper",style:Re({[e.direction==="vertical"?"minHeight":"minWidth"]:n.totalSize+"px"}),class:D(["vue-recycle-scroller__item-wrapper",i.listClass])},{default:y(()=>[(d(!0),b(j,null,F(n.pool,s=>(d(),C(ue(i.itemTag),je({key:s.nr.id,style:n.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${s.position}px) translate${e.direction==="vertical"?"X":"Y"}(${s.offset}px)`,width:i.gridItems?`${e.direction==="vertical"&&i.itemSecondarySize||i.itemSize}px`:void 0,height:i.gridItems?`${e.direction==="horizontal"&&i.itemSecondarySize||i.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[i.itemClass,{hover:!i.skipHover&&n.hoverKey===s.nr.key}]]},Ee(i.skipHover?{}:{mouseenter:()=>{n.hoverKey=s.nr.key},mouseleave:()=>{n.hoverKey=null}})),{default:y(()=>[E(e.$slots,"default",{item:s.item,index:s.nr.index,active:s.nr.used})]),_:2},1040,["style","class"]))),128)),E(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?(d(),b("div",pi,[E(e.$slots,"after")],512)):S("v-if",!0),v(c,{onNotify:r.handleResize},null,8,["onNotify"])],34)),[[l,r.handleVisibilityChange]])}oe.render=hi;oe.__file="src/components/RecycleScroller.vue";const _i={"h-full":"",flex:"~ col gap-4"},vi={"flex-auto":"","of-auto":"",flex:"~ col gap-2",pl6:"",pr4:""},yi=H({__name:"ModuleInstallList",emits:["close"],setup(e,{emit:t}){const i=Ye(),o=xe(""),n=L(()=>new De(i.value||[],{keys:["name","description","npm","category"]})),r=L(()=>o.value?n.value.search(o.value).map(c=>c.item):i.value);return(c,l)=>{const s=Xe,u=Ue,f=Ut;return d(),b("div",_i,[v(s,{mx6:"",mt6:"","text-xl":"",op75:"",icon:"i-carbon-intent-request-create",text:"Install Module"}),v(u,{modelValue:m(o),"onUpdate:modelValue":l[0]||(l[0]=h=>He(o)?o.value=h:null),autofocus:!0,placeholder:"Search...",icon:"carbon-search",n:"primary",mx6:"","px-5":"","py-2":""},null,8,["modelValue"]),a("div",vi,[v(m(oe),{class:"scroller",items:m(r),"item-size":160,"key-field":"name"},{default:y(({item:h})=>[v(f,{item:h,onStart:l[1]||(l[1]=k=>t("close"))},null,8,["item"])]),_:1},8,["items"])])])}}}),gi={flex:"~ col gap-2","w-150":"",p4:"",border:"t base"},bi={capitalize:""},xi=a("p",{op50:""}," Following command will be executed in your terminal: ",-1),$i={op50:""},ki=a("p",null,[a("span",{op50:""},"After that, Nuxt will "),a("span",{"text-orange":""},"restart automatically"),M(". ")],-1),wi={flex:"~ gap-3",mt2:"","justify-end":""},Ii=H({__name:"ModuleActionDialog",setup(e){const t=Fe(),i=he(),o={};return(n,r)=>{const c=ne,l=Ze,s=et,u=tt,f=it,h=ie,k=qe;return d(),C(m(ye),null,{default:y(({resolve:T,args:w})=>[v(k,{"model-value":!0,onClose:g=>T(!1)},{default:y(()=>[v(c,{mod:o,info:w[0],border:"none","w-150":"","n-panel-grids":""},null,8,["info"]),a("div",gi,[a("h2",{"text-xl":"",class:D(w[2]==="install"?"text-primary":"text-red")},[a("span",bi,O(w[2]),1),M(),a("code",null,O(w[0].name),1),M("? ")],2),xi,v(l,{code:w[1].commands.join(" "),lang:"bash",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),a("p",$i,[M(" Then your "),v(s,{role:"button",n:"primary",underline:"",onClick:r[0]||(r[0]=g=>m(i)(m(t)?._nuxtConfigFile)),textContent:"Nuxt config"}),M(" will be updated as: ")]),v(u,{from:w[1].configOriginal,to:w[1].configGenerated,"max-h-80":"","of-auto":"",py2:"",border:"~ base rounded",lang:"ts"},null,8,["from","to"]),ki,a("div",wi,[v(f,{n:"sm amber","flex-auto":"",icon:"i-carbon-data-backup"},{default:y(()=>[M(" Please make sure to backup your project first. ")]),_:1}),v(h,{onClick:g=>T(!1)},{default:y(()=>[M(" Cancel ")]),_:2},1032,["onClick"]),v(h,{n:"solid",capitalize:"",class:D(w[2]==="install"?"n-primary":"n-red"),onClick:g=>T(!0)},{default:y(()=>[M(O(w[2]),1)]),_:2},1032,["class","onClick"])])])]),_:2},1032,["onClose"])]),_:1})}}}),Si={class:"markdown-body"},zi=a("h1",null,"Modules",-1),Mi=a("p",null,[M("Nuxt provides a module system to extend the framework core and simplify integrations. You don’t need to develop everything from scratch or maintain boilerplate if there is already a Nuxt module for it. Adding Nuxt modules is possible using "),a("code",null,"nuxt.config"),M(".")],-1),Ci=a("p",null,[M("You can explore the list of modules on "),a("a",{href:"https://nuxt.com/modules",target:"_blank",rel:"noopener"},"nuxt.com/modules"),M(" or install them directly inside the DevTools.")],-1),Ti=a("p",null,[a("a",{href:"https://nuxt.com/docs/guide/concepts/modules",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Oi=[zi,Mi,Ci,Ti],Ni={__name:"modules",setup(e,{expose:t}){return t({frontmatter:{}}),(o,n)=>(d(),b("div",Si,Oi))}},Vi={"h-full":"","w-full":"","of-auto":""},Pi={relative:"","h-20":"","w-20":"",flex:"","flex-none":"",rounded:"","bg-gray:3":"",p3:""},Ai=["src","alt"],Li=a("div",{"i-carbon-cube":"",ma:"","text-4xl":"",op30:""},null,-1),Bi={"text-lg":"","group-hover":"text-primary",transition:"",flex:"~ gap-2 items-center"},ji=a("div",{"i-carbon-circle-dash":"","animate-spin":"","text-xl":"",op75:""},null,-1),Ei={op75:""},Ri=a("div",{"i-carbon-intent-request-create":"","text-4xl":"",op40:"","group-hover":"op75 text-primary",transition:""},null,-1),Di=a("div",{"text-lg":"",op40:"","group-hover":"op75 text-primary",transition:""}," Install New Module ",-1),Hi={key:0,border:"l base",pos:"fixed bottom-0 right-0 top-0","z-200":"","w-150":"","bg-base":""},Ui="https://api.nuxtjs.org/api/ipx/s_80,f_webp/gh/nuxt/modules/main/icons/",sn=H({__name:"modules",setup(e){const t=xe(!1),i=$e(),o=ve(),n=L(()=>i.value.filter(c=>c.isPackageModule)),r=L(()=>i.value.filter(c=>!c.isPackageModule));return Ke(()=>[{id:"action:modules:install",title:"Install a new module",icon:"i-carbon-intent-request-create ",action:()=>{t.value=!0}}]),(c,l)=>{const s=Ht,u=_e,f=te,h=Ge,k=ie,T=yi,w=Ii,g=Ni,x=nt;return d(),b(j,null,[a("div",Vi,[v(h,{icon:"carbon-3d-mpr-toggle",text:"Installed Modules","container-class":"grid grid-cols-minmax-400px gap3 px4",padding:!1,description:`Total modules: ${m(n).length}`},{default:y(()=>[(d(!0),b(j,null,F(m(n),$=>(d(),C(s,{key:$.name,mod:$},null,8,["mod"]))),128)),(d(!0),b(j,null,F("processInstallingModules"in c?c.processInstallingModules:m(ge),$=>(d(),C(f,{key:$.processId,block:"","min-h-30":"",to:"/modules/terminals",onClick:N=>o.value=$.processId},{default:y(()=>[v(u,{border:"1.5 dashed","h-full":"","animate-pulse":"",p4:"",transition:"",hover:"border-primary",flex:"~ col gap-1 items-center justify-center",role:"button",class:"group"},{default:y(()=>[a("div",Pi,[a("img",{src:Ui+$.info.icon,alt:$.info.name,ma:""},null,8,Ai),Li]),a("div",Bi,[ji,a("span",Ei,"Installing "+O($.name)+"...",1)])]),_:2},1024)]),_:2},1032,["onClick"]))),128)),v(u,{border:"1.5 dashed","min-h-30":"",p4:"",transition:"",hover:"border-primary",flex:"~ col gap-2 items-center justify-center",role:"button",class:"group",onClick:l[0]||(l[0]=$=>t.value=!0)},{default:y(()=>[Ri,Di]),_:1})]),_:1},8,["description"]),m(r).length?(d(),C(h,{key:0,icon:"carbon-3d-mpr-toggle",text:"User Modules","container-class":"grid grid-cols-minmax-400px gap3 px4",padding:!1,description:`Total modules: ${m(r).length}`},{default:y(()=>[(d(!0),b(j,null,F(m(r),$=>(d(),b(j,{key:$.meta?.name||$.entryPath},[$.meta?.name||$.entryPath?(d(),C(s,{key:0,mod:$},null,8,["mod"])):S("",!0)],64))),128))]),_:1},8,["description"])):S("",!0),v(de,{name:"fade-in"},{default:y(()=>[m(t)?(d(),b("div",{key:0,class:"fixed bottom-0 left-0 right-0 top-0 z-100","bg-black:20":"","backdrop-blur-2":"",onClick:l[1]||(l[1]=$=>t.value=!1)})):S("",!0)]),_:1}),v(de,{name:"slide-in"},{default:y(()=>[m(t)?(d(),b("div",Hi,[v(k,{icon:"carbon-close",pos:"absolute top-3 right-3 z-10","rounded-full":"","text-xl":"",border:!1,onClick:l[2]||(l[2]=$=>t.value=!1)}),v(T,{onClose:l[3]||(l[3]=$=>t.value=!1)})])):S("",!0)]),_:1}),v(w)]),v(x,null,{default:y(()=>[v(g)]),_:1})],64)}}});export{sn as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{q as r,
|
|
1
|
+
import{q as r,a7 as n}from"./entry.3dd66f35.js";const t={};function o(e,s){return n(e.$slots,"default")}const c=r(t,[["render",o]]);export{c as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{d as M,a as S,aS as oe,e as ne,a8 as U,r as A,f as e,h as I,j as g,p as $,o,k as t,m as n,n as R,G as N,t as h,F as T,i as d,v as k,al as z,_ as J,a5 as B,aT as P,aU as ae,aV as se,b as re,aW as ie,aX as ce,aY as le,aZ as G,av as de,ab as pe,l as me,ac as ue,I as V,W as ge}from"./entry.3dd66f35.js";import{_ as he}from"./NNavbar.vue.d9a029e0.js";import{_ as H}from"./NLink.vue.a09685db.js";import{_ as K}from"./NSectionBlock.7f41e147.js";import{_ as _e}from"./NCodeBlock.vue.882d562f.js";import{_ as fe}from"./HelpFab.vue.314bc83b.js";import"./NIconTitle.vue.71113a3f.js";import"./client.253674ec.js";const W=[{name:"title",suggestion:"required",head:{title:"[title]"},seoMeta:{title:"[title]"},docs:"https://developer.mozilla.org/en-US/docs/Web/HTML/Element/title",description:"A concise and descriptive title for the browser that accurately summarizes the content of the page."},{name:"description",suggestion:"required",head:{meta:[{name:"description",content:"[description]"}]},seoMeta:{description:"[description]"},description:"A one to two sentence summary for search engines that includes relevant keywords to improve visibility in search results."},{name:"icon",suggestion:"recommended",head:{link:[{rel:"icon",type:"image/png",href:"/favicon.png"}]},description:"A small image that appears in the browser tab and bookmark menu to help users easily identify the page."},{name:"lang",suggestion:"recommended",head:{htmlAttrs:{lang:"en"}},description:"The primary language of the page to help search engines and browsers understand the content."},{name:"og:title",suggestion:"recommended",head:{meta:[{property:"og:title",content:"[og:title]"}]},seoMeta:{ogTitle:"[og:title]"},docs:"https://ogp.me/#metadata",description:"A title for the link preview used by social media platforms."},{name:"og:description",suggestion:"recommended",head:{meta:[{property:"og:description",content:"[og:description]"}]},seoMeta:{ogDescription:"[og:description]"},docs:"https://ogp.me/#metadata",description:"A description for the link preview used by social media platforms."},{name:"og:image",suggestion:"recommended",head:{meta:[{property:"og:image",content:"[og:image]"}]},seoMeta:{ogImage:"[og:image]"},docs:"https://ogp.me/#metadata",description:"An image for the link preview used by social media platforms."},{name:"og:url",suggestion:"recommended",head:{meta:[{property:"og:url",content:"[og:url]"}]},seoMeta:{ogUrl:"[og:url]"},docs:"https://ogp.me/#metadata",description:"A canonical URL for the link preview used to specify the preferred URL to display in search engine results and social media previews when multiple URLs may point to the same page."},{name:"twitter:title",suggestion:"recommended",head:{meta:[{name:"twitter:title",content:"[twitter:title]"}]},seoMeta:{twitterTitle:"[twitter:title]"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"A title for the Twitter card used to provide a preview of the content shared on the page."},{name:"twitter:description",suggestion:"recommended",head:{meta:[{name:"twitter:description",content:"[twitter:description]"}]},seoMeta:{twitterDescription:"[twitter:description]"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"A description for the Twitter card used to provide a preview of the content shared on the page."},{name:"twitter:image",suggestion:"recommended",head:{meta:[{name:"twitter:image",content:"[twitter:image]"}]},seoMeta:{twitterImage:"[twitter:image]"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"An image for the Twitter card used to provide a preview of the content shared on the page."},{name:"twitter:card",suggestion:"recommended",head:{meta:[{name:"twitter:card",content:"summary"}]},seoMeta:{twitterCard:"summary"},docs:"https://developer.twitter.com/en/docs/twitter-for-websites/cards/overview/abouts-cards",description:"The type of Twitter card to use, which determines the type of card to display in link previews on Twitter."}],be={flex:"~ wrap","mt--2":"","w-full":"","flex-none":""},ve=["onClick"],we=t("div",{border:"b base","flex-auto":""},null,-1),xe={key:0,"x-divider":""},ye={key:1,"x-divider":""},ke={flex:"~ gap-1 items-center",class:"px2 pt2",lg:"px4 py2"},$e=t("div",{"i-carbon-warning":"","text-orange":""},null,-1),Te={"w-full":"",p2:"",op75:""},Se={key:1,m4:"",flex:"~ col gap-2"},Ce={flex:"~ gap-1 wrap items-center"},Ne={key:1},Me={flex:"~ gap-2",n:"sm primary",absolute:"","right-2":"","top-2":""},Oe=M({__name:"OpenGraphMissingTabs",props:{tags:{},matchedRouteFilepath:{}},setup(v){const i=v,c=S(()=>W.filter(a=>!i.tags?.some(p=>p.name===a.name))),l=S(()=>{let a={};const p={};c.value.forEach(u=>{u.seoMeta?Object.assign(p,u.seoMeta):a=oe(a,u.head)});const b=[];if(Object.keys(p).length){const u=JSON.stringify(p,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'");b.push(`useSeoMeta(${u})`)}if(Object.keys(a).length){const u=JSON.stringify(a,null,2).replace(/"([^"]+)":/g,"$1:").replace(/"/g,"'");b.push(`useHead(${u})`)}return b.join(`
|
|
2
|
+
|
|
3
|
+
`)}),m=ne(),x=U(),y=["Missing Tags","Code Snippet"],_=A(y[0]);return(a,p)=>{const b=H,u=z,C=J,O=_e,L=K;return e(c).length?(o(),I(L,{key:0,text:"Missing Tags",description:`${e(c).length} missing tags`,icon:"carbon:warning-other","header-class":"text-orange op100! [[open]_&]:text-inherit",padding:!1},{default:g(()=>[t("div",be,[(o(),n(T,null,R(y,(s,r)=>t("button",{key:r,px4:"",py2:"",border:"r t base",hover:"bg-active",class:N(s===e(_)?"":"border-b"),onClick:f=>_.value=s},[t("div",{class:N(s===e(_)?"":"op30"),capitalize:""},h(s),3)],10,ve)),64)),we]),e(_)===y[0]?(o(),I(u,{key:0,grid:"~ cols-[1fr] lg:cols-[max-content_1fr]",m4:"","items-center":"","justify-between":"","of-hidden":""},{default:g(()=>[(o(!0),n(T,null,R(e(c),(s,r)=>(o(),n(T,{key:r},[r?(o(),n("div",xe)):$("",!0),r?(o(),n("div",ye)):$("",!0),t("div",ke,[$e,d(b,{"op-50":"",href:s.docs,target:"_blank",n:"orange"},{default:g(()=>[k(h(s.name),1)]),_:2},1032,["href"])]),t("div",Te,h(s.description),1)],64))),128))]),_:1})):(o(),n("div",Se,[t("p",Ce,[d(C,{icon:"carbon-copy",n:"xs","px-2":"",onClick:p[0]||(p[0]=s=>e(m)(e(l)))},{default:g(()=>[k(" Copy ")]),_:1}),k(" the following code snippet and paste it into your "),a.matchedRouteFilepath?(o(),I(C,{key:0,icon:"carbon-launch",n:"xs","px-2":"",onClick:p[1]||(p[1]=s=>e(x)(a.matchedRouteFilepath))},{default:g(()=>[k(" page component ")]),_:1})):(o(),n("span",Ne,"page component")),k(" to full fill the missing tags. ")]),d(u,{relative:"","n-code-block":""},{default:g(()=>[d(O,{code:e(l),lang:"ts",lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code"]),t("div",Me,[d(C,{icon:"carbon-copy",onClick:p[2]||(p[2]=s=>e(m)(e(l)))},{default:g(()=>[k(" Copy ")]),_:1})])]),_:1})]))]),_:1},8,["description"])):$("",!0)}}}),Ae={class:"max-w-[524px] min-w-[524px] cursor-pointer bg-base"},Ie={class:"break-words border border-base px-[12px] py-[10px] antialiased"},Re={class:"overflow-hidden truncate whitespace-nowrap text-[12px] leading-[11px] uppercase op50"},Be={class:"block h-[46px] max-h-[46px] border-separate select-none overflow-hidden break-words text-left",style:{"border-spacing":"0px"}},Le={class:"mt-[3px] truncate pt-[2px] text-[16px] font-semibold leading-[20px]"},Fe={class:"mt-[3px] block h-[18px] max-h-[80px] border-separate select-none overflow-hidden truncate whitespace-nowrap break-words text-left text-[14px] leading-[20px] op50",style:{"-webkit-line-clamp":"1","border-spacing":"0px","-webkit-box-orient":"vertical"}},je=M({__name:"SocialFacebook",props:{card:{}},setup(v){return(i,c)=>(o(),n("div",Ae,[t("div",{class:"h-[274px] border border-b-0 border-base bg-cover bg-center bg-no-repeat",style:B({backgroundImage:`url(${JSON.stringify(i.card.image)})`})},null,4),t("div",Ie,[t("div",Re,h(i.card.url),1),t("div",Be,[t("div",Le,h(i.card.title),1),t("div",Fe,h(i.card.description),1)])])]))}}),De={class:"max-w-[438px] min-w-[438px] of-hidden border border-base rounded-[16px] bg-base -outline-offset-1",style:{"font-family":"TwitterChirp, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif"}},Ve={class:"break-words border-base p-[0.75em] antialiased",flex:"~ col justify-center gap-[2px]"},Ee={class:"overflow-hidden truncate whitespace-nowrap text-[15px] leading-[20px] lowercase op50"},Ge={class:"m-0 truncate text-[15px] font-semibold leading-[20px]"},Ue={class:"line-clamp-2 select-none overflow-hidden break-words text-left text-[15px] leading-[20px] op50"},ze=M({__name:"SocialTwitter",props:{tags:{}},setup(v){const i=v,c=S(()=>P(i.tags,{title:[{tag:"title"}],image:[{tag:"meta",name:"twitter:image"},{tag:"meta",name:"og:image"}],imageAlt:[{tag:"meta",name:"twitter:image:alt"}],description:[{tag:"meta",name:"twitter:description"},{tag:"meta",name:"description"}],favicon:[{tag:"link",name:"icon"}]})),l=S(()=>c.value.image?i.tags.find(m=>m.tag==="meta"&&m.name==="twitter:card")?.value||"summary_large_image":"summary");return(m,x)=>(o(),n("div",De,[t("div",{class:N(["cursor-pointer overflow-hidden leading-[1.3em]",e(l)==="summary_large_image"?"":"flex"]),hover:"bg-[#88888805]"},[e(l)==="summary_large_image"?(o(),n("div",{key:0,class:"h-[220px] border-b border-base bg-cover bg-center bg-no-repeat",style:B({backgroundImage:`url(${JSON.stringify(e(c).image)})`})},null,4)):(o(),n("div",{key:1,class:"h-[129px] w-[129px] flex-none border-r border-base bg-cover bg-center bg-no-repeat",style:B({backgroundImage:`url(${JSON.stringify(e(c).image)})`})},null,4)),t("div",Ve,[t("div",Ee,h(e(c).url),1),t("div",Ge,h(e(c).title),1),t("div",Ue,h(e(c).description),1)])],2)]))}}),Je={class:"max-w-[520px] min-w-[520px] cursor-pointer overflow-hidden border border-base rounded-[2px] shadow-md bg-base"},Pe={class:"break-words p-[10px] antialiased"},He={class:"block h-auto max-h-[50px] border-separate select-none break-words text-left",style:{"border-spacing":"0px"}},Ke={class:"pb-[2px] text-[16px] font-semibold leading-[24px]"},We={class:"overflow-hidden truncate whitespace-nowrap text-xs font-normal uppercase op85"},qe=M({__name:"SocialLinkedin",props:{card:{}},setup(v){return(i,c)=>(o(),n("div",Je,[t("div",{class:"h-[270px] border-b border-base bg-cover bg-center bg-no-repeat",style:B({backgroundImage:`url(${JSON.stringify(i.card.image)})`})},null,4),t("div",Pe,[t("div",He,[t("div",Ke,h(i.card.title),1),t("div",We,h(i.card.url),1)])])]))}}),Ye={flex:"~ col"},Xe={flex:"~ wrap","w-full":"","flex-none":""},Ze=["onClick"],Qe=t("div",{border:"b base","flex-auto":""},null,-1),et={flex:"~ items-center justify-center","flex-auto":"",p4:"","n-panel-grids":""},tt={key:0},ot={key:1},nt={key:2},at=M({__name:"SocialPreviewGroup",props:{tags:{}},setup(v){const i=v,c=["twitter","facebook","linkedin"],l=A(c[0]),m=S(()=>P(i.tags,{title:[{tag:"title"}],image:[{tag:"meta",name:"og:image"}],imageAlt:[{tag:"meta",name:"og:image:alt"}],description:[{tag:"meta",name:"og:description"},{tag:"meta",name:"description"}],favicon:[{tag:"link",name:"icon"}]}));return(x,y)=>{const _=je,a=ze,p=qe;return o(),n("div",Ye,[t("div",Xe,[(o(),n(T,null,R(c,(b,u)=>t("button",{key:u,px4:"",py2:"",border:"r base",hover:"bg-active",class:N(b===e(l)?"":"border-b"),onClick:C=>l.value=b},[t("div",{class:N(b===e(l)?"":"op30"),capitalize:""},h(b),3)],10,Ze)),64)),Qe]),t("div",et,[e(l)==="facebook"?(o(),n("div",tt,[d(_,{card:e(m)},null,8,["card"])])):e(l)==="twitter"?(o(),n("div",ot,[d(a,{tags:x.tags},null,8,["tags"])])):e(l)==="linkedin"?(o(),n("div",nt,[d(p,{card:e(m)},null,8,["card"])])):$("",!0)])])}}}),st={class:"markdown-body"},rt=ae('<h1>Open Graph</h1><p>Nuxt provides several different ways to manage your meta tags using <a href="https://unhead.harlanzw.com/" target="_blank" rel="noopener"><code>unhead</code></a>. Improve your Nuxt app’s SEO with powerful head config, composables and components.</p><p><a href="https://nuxt.com/docs/getting-started/seo-meta" target="_blank" rel="noopener">Learn more on the documentation</a></p><hr><p>You can also find how open graph specs are defined in:</p><ul><li><a href="https://ogp.me/" target="_blank" rel="noopener">The Open Graph protocol</a></li><li><a href="https://developer.twitter.com/en/docs/twitter-for-websites/cards/guides/getting-started" target="_blank" rel="noopener">Twitter Cards</a></li></ul>',6),it=[rt],ct={__name:"open-graph",setup(v,{expose:i}){return i({frontmatter:{}}),(l,m)=>(o(),n("div",st,it))}},lt={flex:"~ col lg:row","h-full":"","w-full":"","of-hidden":""},dt={"flex-auto":"","of-auto":""},pt={"flex-none":"",flex:"~ gap2 items-center"},mt={flex:"~ col"},ut={key:0,"x-divider":""},gt={key:1,"x-divider":""},ht={mr2:"",px4:"",py2:""},$t=M({__name:"open-graph",setup(v){const i=A(0),c=se(),l=re(async()=>(i.value,(await c.value?.resolveTags()).map(r=>{const f=r.props||{};return r.tag==="htmlAttrs"&&f.lang?{tag:"html",name:"lang",value:f.lang}:f.charset?{tag:"meta",name:"charset",value:f.charset}:{tag:r.tag,name:f.property??f.name??f.rel??r.tag,value:f.content??f.href??r.textContent??JSON.stringify(f)}})),[]),m=A(!0);function x(){i.value+=1}const y=ie(),_=ce(),a=A(""),p=le(),b=U();async function u(){a.value!==_.value.path&&y.value.push(a.value||"/")}const C=S(()=>a.value===_.value.path?[]:y.value.resolve(a.value||"/").matched),O=S(()=>{const s=p.value.find(r=>r.path===_.value?.matched?.[0]?.path);return s?.file||s?.meta?.file});function L(s){return W.find(r=>r.name===s.name)?.docs}return G(_).toBeTruthy().then(s=>{a.value=s.path}),G(y).toBeTruthy().then(s=>{s.afterEach(()=>{de(()=>{a.value=_.value.path,setTimeout(x,200),setTimeout(x,800)})})}),(s,r)=>{const f=ge,F=J,q=he,E=H,Y=z,X=K,Z=Oe,Q=at,ee=ct,te=fe,j=pe("tooltip");return o(),n(T,null,[t("div",lt,[t("div",dt,[d(q,null,{search:g(()=>[d(f,{modelValue:e(a),"onUpdate:modelValue":r[0]||(r[0]=w=>me(a)?a.value=w:null),placeholder:"Route",icon:"carbon-direction-right-01 scale-y--100",n:"primary","flex-auto":"","font-mono":"",class:N(["px-5 py-2",e(_)?.path===e(a)?"":e(C).length?"text-green":"text-orange"]),onKeydown:ue(u,["enter"])},null,8,["modelValue","class","onKeydown"])]),actions:g(()=>[t("div",pt,[e(O)?V((o(),I(F,{key:0,"text-lg":"",border:!1,icon:"carbon:launch",title:"Open file in editor",onClick:r[1]||(r[1]=w=>e(b)(e(O)))},null,512)),[[j,"Open file in editor"]]):$("",!0),V(d(F,{"text-lg":"",border:!1,icon:"carbon:reset",title:"Refresh Data",onClick:x},null,512),[[j,"Refresh Data"]]),V(d(F,{"text-lg":"",border:!1,icon:e(m)?"carbon:side-panel-open":"carbon:open-panel-right",title:"Toggle Preview",onClick:r[2]||(r[2]=w=>m.value=!e(m))},null,8,["icon"]),[[j,"Toggle Preview"]])])]),_:1}),t("div",mt,[d(X,{text:"Tags",icon:"carbon:tag-group"},{default:g(()=>[d(Y,{grid:"~ cols-[max-content_1fr]","items-center":"","justify-between":"","of-hidden":""},{default:g(()=>[(o(!0),n(T,null,R(e(l),(w,D)=>(o(),n(T,{key:D},[D?(o(),n("div",ut)):$("",!0),D?(o(),n("div",gt)):$("",!0),t("div",ht,[d(E,{op50:"",href:L(w),target:"_blank",n:"primary"},{default:g(()=>[k(h(w.name),1)]),_:2},1032,["href"])]),d(E,{href:w.value.match(/^https?:\/\//)?w.value:void 0,target:"_blank","w-full":"",p2:"","font-mono":"",n:"primary"},{default:g(()=>[k(h(w.value),1)]),_:2},1032,["href"])],64))),128))]),_:1})]),_:1}),d(Z,{tags:e(l),"matched-route-filepath":e(O)},null,8,["tags","matched-route-filepath"])])]),e(m)&&e(l)?.length?(o(),I(Q,{key:0,tags:e(l),"flex-none":"","border-base":"","lt-lg":"border-t",lg:"h-full w-140 border-l"},null,8,["tags"])):$("",!0)]),d(te,null,{default:g(()=>[d(ee)]),_:1})],64)}}});export{$t as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as j,
|
|
1
|
+
import{d as j,ar as L,a9 as R,aG as A,a_ as M,a$ as O,O as T,a as C,h as m,j as n,A as $,o as s,f as e,m as u,k as t,i as a,t as r,p as d,F as h,b0 as f,b1 as x,b2 as E,v as i,D as P,E as F,x as G,_ as W}from"./entry.3dd66f35.js";import{u as H,_ as K}from"./state-modules.5bf4563c.js";import{_ as U}from"./NTip.vue.3f5fb5a1.js";import{u as q}from"./state-components.c2be3414.js";import"./NBadge.e849763e.js";import"./NCodeBlock.vue.882d562f.js";import"./client.253674ec.js";import"./NCheckbox.vue.cf7e1e9d.js";const J="1.0.0-beta.2",Q={key:0},X={key:1,flex:"~ col gap2",ma:"","h-full":"","max-w-300":"","w-full":"",p5:"",px5:"","md:px20":""},Y=t("div",{"flex-auto":""},null,-1),Z={flex:"~ col","mt-5":"","items-center":"","md:mt-20":""},tt=t("span",{op40:""}," Nuxt DevTools ",-1),et={op40:""},ot={flex:"~ gap2 wrap"},nt={p4:"","theme-card-green":"",flex:"~ col auto"},st=t("div",{"logos-nuxt-icon":"","text-3xl":""},null,-1),it={key:0,p4:"","theme-card-green":"",flex:"~ col auto"},at=t("div",{"logos-vue":"","text-3xl":""},null,-1),lt=t("div",{"carbon-tree-view-alt":"","text-3xl":""},null,-1),ut=t("div",{"i-carbon-assembly-cluster":"","text-3xl":""},null,-1),rt=t("div",{"carbon-function":"","text-3xl":""},null,-1),dt=t("div",{"carbon-3d-mpr-toggle":"","text-3xl":""},null,-1),ct=t("div",{"carbon-plug":"","text-3xl":""},null,-1),pt={key:5,"pointer-events-none":"","min-w-40":"",p4:"","theme-card-lime":"",flex:"~ auto gap-6"},_t=t("div",{"i-carbon-time-plot":"","flex-none":"","text-3xl":""},null,-1),mt={grid:"~ cols-[auto_auto] gap-x-5 items-center"},ht=t("div",{"text-sm":""}," SSR to full load ",-1),ft={"text-right":""},xt=t("div",{"text-sm":""}," Page load ",-1),vt={"text-right":""},gt=t("div",{"text-sm":""}," Navigation ",-1),yt={"text-right":""},bt=t("div",{"text-sm":""}," HMR ",-1),kt={"text-right":""},Ct={flex:"~ col gap2"},wt={flex:"~ gap-6 wrap","mt-5":"","items-center":"","justify-center":""},Bt=t("a",{href:"https://github.com/nuxt/devtools",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-blue",transition:""},[t("div",{"i-carbon-star":""}),i(" Star on GitHub ")],-1),St=t("a",{href:"https://github.com/nuxt/devtools/discussions/29",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-yellow",transition:""},[t("div",{"i-carbon-data-enrichment":""}),i(" Ideas & Suggestions ")],-1),Dt=t("a",{href:"https://github.com/nuxt/devtools/discussions/31",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-lime",transition:""},[t("div",{"i-carbon-plan":""}),i(" Project Roadmap ")],-1),Nt=t("a",{href:"https://github.com/nuxt/devtools/issues",target:"_blank",flex:"~ gap1","items-center":"",op50:"",hover:"op100 text-rose",transition:""},[t("div",{"i-carbon-debug":""}),i(" Bug Reports ")],-1),zt=t("div",{"i-carbon-settings-adjust":""},null,-1),It=t("div",{"flex-auto":""},null,-1),Vt={flex:"col gap-2",mxa:"",hidden:"","w-100":"","text-sm":"",op50:"","md:flex":""},jt={flex:"~ gap-1","items-center":""},Lt=t("span",null,"+",-1),Rt=t("span",null,"+",-1),At=t("div",{"flex-auto":""},null,-1),Mt={flex:"~ gap-1","items-center":""},Ot=t("span",null,"+",-1),Tt=t("span",null,"+",-1),$t=t("span",null,"+",-1),Et=t("span",null,"+",-1),Pt=t("div",{"flex-auto":""},null,-1),Ft=t("div",null,"Toggle DevTools",-1),Zt=j({__name:"overview",setup(Gt){const v=L(),p=R(),w=q(),g=A(),B=H(),S=M(),y=O(),D=T();function N(){P.value=!0,D.push("/")}const b=C(()=>v.value?.nuxt.vueApp.version),l=C(()=>v.value?.metrics.loading());return(o,Wt)=>{const z=F,_=G,k=K,I=U,c=W,V=$;return s(),m(V,{"h-screen":"","w-full":"",flex:""},{default:n(()=>[e(p)?(s(),u("div",X,[Y,t("div",Z,[a(_,{flex:"~","mt--10":"","items-center":"","justify-center":"",to:"https://devtools.nuxt.com/",target:"_blank"},{default:n(()=>[a(z,{"h-10":""})]),_:1}),t("button",{mb6:"",mt3:"","text-center":"","text-sm":"",flex:"~ gap-1 wrap",onClick:N},[tt,t("code",et,"v"+r(e(J)),1),a(k,{"package-name":"@nuxt/devtools",options:{dev:!0},"show-version":!1})])]),t("div",ot,[t("div",nt,[st,a(k,{"package-name":"nuxt",options:{dev:!0}})]),e(b)?(s(),u("div",it,[at,t("code",null,"v"+r(e(b)),1)])):d("",!0),e(p)?(s(),u(h,{key:1},[e(p)&&e(p).pages&&e(v)?(s(),m(_,{key:0,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/pages"},{default:n(()=>[lt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(S).length,"page")),1)]),_:1})):d("",!0),e(p)?(s(),m(_,{key:1,"min-w-40":"",p4:"","theme-card-lime":"",flex:"~ col auto",to:"/modules/components"},{default:n(()=>[ut,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(w).length,"component")),1)]),_:1})):d("",!0),e(p)&&e(g)?(s(),m(_,{key:2,"min-w-40":"",p4:"","theme-card-yellow":"",flex:"~ col auto",to:"/modules/imports"},{default:n(()=>[rt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(g).imports.length,"import")),1)]),_:1})):d("",!0),e(p)?(s(),m(_,{key:3,"min-w-40":"",p4:"","theme-card-purple":"",flex:"~ col auto",to:"/modules/modules"},{default:n(()=>[dt,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(B).length,"module")),1)]),_:1})):d("",!0),e(p)?(s(),m(_,{key:4,"min-w-40":"",p4:"","theme-card-teal":"",flex:"~ col auto",to:"/modules/plugins"},{default:n(()=>[ct,t("div",null,r(("pluralizeByCount"in o?o.pluralizeByCount:e(f))(e(p).plugins.length,"plugin")),1)]),_:1})):d("",!0),e(l)?(s(),u("div",pt,[_t,t("div",mt,[e(l).ssrStart?(s(),u(h,{key:0},[ht,t("div",ft,r(("formatDuration"in o?o.formatDuration:e(x))(e(l).appLoad-e(l).ssrStart)),1)],64)):d("",!0),xt,t("div",vt,r(("formatDuration"in o?o.formatDuration:e(x))(e(l).appLoad-e(l).appInit)),1),gt,t("div",yt,r(("formatDuration"in o?o.formatDuration:e(x))(e(l).pageEnd-e(l).pageStart)),1),e(l).hmrStart?(s(),u(h,{key:1},[bt,t("div",kt,r(("formatDuration"in o?o.formatDuration:e(x))(e(l).hmrEnd-e(l).hmrStart)),1)],64)):d("",!0)])])):d("",!0)],64)):d("",!0)]),t("div",Ct,[("showConnectionWarning"in o?o.showConnectionWarning:e(E))?(s(),m(I,{key:0,n:"yellow5",icon:"carbon-unlink","justify-center":""},{default:n(()=>[i(" Not connected to the client app, showing server-side data only. Use the embedded mode for full features. ")]),_:1})):d("",!0)]),t("div",wt,[Bt,St,Dt,Nt,a(_,{to:"/settings",flex:"~ gap1","inline-block":"","items-center":"",op50:"","hover:op80":""},{default:n(()=>[zt,i(" Settings ")]),_:1})]),It,t("div",Vt,[t("div",jt,[e(y)?(s(),u(h,{key:0},[a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" ⌘ Cmd ")]),_:1}),Lt,a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" K ")]),_:1})],64)):(s(),u(h,{key:1},[a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" Ctrl ")]),_:1}),Rt,a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" K ")]),_:1})],64)),At,i(" Open Command Palette ")]),t("div",Mt,[e(y)?(s(),u(h,{key:0},[a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" ⇧ Shift ")]),_:1}),Ot,a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" ⌥ Option ")]),_:1}),Tt,a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" D ")]),_:1})],64)):(s(),u(h,{key:1},[a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" Shift ")]),_:1}),$t,a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" Alt ")]),_:1}),Et,a(c,{n:"xs",class:"px2"},{default:n(()=>[i(" D ")]),_:1})],64)),Pt,Ft])])])):(s(),u("div",Q," Loading... "))]),_:1})}}});export{Zt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{d as E,r as B,a as x,am as O,f as t,o,m as s,k as e,t as k,h as y,j as b,b8 as G,F as m,n as L,p as N,i as _,v as V,G as M,W as A,_ as H,a8 as X,b9 as j,aW as Y,aX as q,a9 as J,aj as Q,aY as Z,ak as ee,l as te,ac as oe,K as ne,L as ae}from"./entry.3dd66f35.js";import{_ as D}from"./NBadge.e849763e.js";import{_ as F}from"./FilepathItem.vue.6dd69314.js";import{_ as se}from"./NSectionBlock.7f41e147.js";import{_ as re}from"./LaunchPage.vue.017c62ce.js";import{_ as le}from"./HelpFab.vue.314bc83b.js";import"./NIconTitle.vue.71113a3f.js";import"./NMarkdown.vue.13c5f0c3.js";import"./client.253674ec.js";const ie={block:"","cursor-pointer":""},ue={p2:""},ce=["onSubmit"],de=e("div",{px2:"","text-sm":"",op50:""}," Fill params and navigate: ",-1),pe={flex:"~","items-center":"",p2:"","text-sm":"","font-mono":""},_e={key:1},he=E({__name:"RoutePathItem",props:{route:{}},emits:["navigate"],setup(R,{emit:u}){const p=R,h=B([]),f=x(()=>{const c=g(p.route.path);return h.value=Array.from({length:c.length},()=>""),c});function g(c){return c.split(/(:\w+[\?\*]?(?:\(\))?)/).filter(Boolean).map(d=>d[0]===":"?d.replace(/\(\)$/,"?"):d)}const $=x(()=>f.value.map((c,d)=>c[0]===":"?h.value[d]:c).join("").replace(/\/+/g,"/")),r=x(()=>p.route.path.includes(":"));function n(){u("navigate",$.value)}return(c,d)=>{const C=A,a=H,i=O("VDropdown");return t(r)?(o(),y(i,{key:1},{popper:b(({hide:l})=>[e("div",ue,[e("form",{flex:"~ col",onSubmit:G(()=>{n(),l()},["prevent"])},[t(r)?(o(),s(m,{key:0},[de,e("div",pe,[(o(!0),s(m,null,L(t(f),(v,P)=>(o(),s(m,{key:P},[v[0]===":"?(o(),y(C,{key:0,modelValue:t(h)[P],"onUpdate:modelValue":I=>t(h)[P]=I,"w-20":"","n-sm":"",placeholder:v.slice(1)},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(o(),s("span",_e,k(v),1))],64))),128))])],64)):N("",!0),_(a,{block:"",n:"primary"},{default:b(()=>[V(" Navigate ")]),_:1})],40,ce)])]),default:b(()=>[e("code",ie,[(o(!0),s(m,null,L(t(f),(l,v)=>(o(),s("span",{key:v,class:M(l[0]===":"?"text-gray border border-dashed rounded border-gray:50 px1":"")},k(l[0]===":"?l.slice(1):l),3))),128))])]),_:1})):(o(),s("button",{key:0,onClick:n},[e("code",null,k(c.route.path),1)]))}}}),me={"w-full":""},fe=e("thead",{border:"b base"},[e("tr",null,[e("th",{"text-left":""}),e("th",{"text-left":""}," Route Path "),e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Middleware "),e("th",null," Layout ")])],-1),ge={"w-20":"","pr-1":""},ve={flex:"","items-center":"","justify-end":""},ye={"text-sm":""},be={flex:"inline gap3","items-center":""},xe={op0:"","group-hover:op100":"",flex:"~ gap1"},ke=["onClick"],$e=e("div",{"i-carbon-script-reference":""},null,-1),we=[$e],Ne={"w-0":"","ws-nowrap":"","pr-1":"","text-left":"","text-sm":"","font-mono":"",op50:""},Re={"w-0":"","ws-nowrap":"","pr-1":"","text-center":"","text-sm":"","font-mono":"",op50:""},Ce={"w-0":"","ws-nowrap":"","text-center":"","text-sm":"","font-mono":""},Pe={key:0},Ve=["onClick"],Ie=E({__name:"RoutesTable",props:{pages:{},layouts:{},matched:{},matchedPending:{}},emits:["navigate"],setup(R){const u=R,p=X(),h=j(),f=x(()=>[...u.pages].sort((r,n)=>r.path.localeCompare(n.path)));function g(r){const n=u.layouts.find(c=>c.name===r);n&&p(n.file)}function $(r){if(typeof r=="string")return h.value?.middleware.find(n=>n.name===r)?.path}return(r,n)=>{const c=D,d=he,C=F;return o(),s("div",null,[e("table",me,[fe,e("tbody",null,[(o(!0),s(m,null,L(t(f),a=>(o(),s("tr",{key:a.name,class:"group","h-7":"",border:"b dashed transparent hover:base"},[e("td",ge,[e("div",ve,[r.matched.find(i=>i.name===a.name)?(o(),y(c,{key:0,n:"green",title:"active",textContent:"active"})):r.matchedPending.find(i=>i.name===a.name)?(o(),y(c,{key:1,n:"teal",title:"next",textContent:"next"})):N("",!0)])]),e("td",ye,[e("div",be,[_(d,{route:a,class:M(r.matched.find(i=>i.name===a.name)?"text-primary":r.matchedPending.find(i=>i.name===a.name)?"text-teal":""),onNavigate:n[0]||(n[0]=i=>r.$emit("navigate",i))},null,8,["route","class"]),e("div",xe,[a.file||a.meta?.file?(o(),s("button",{key:0,"text-sm":"",op40:"",hover:"op100 text-primary",title:"Open in editor",onClick:i=>t(p)(a.file||a.meta?.file)},we,8,ke)):N("",!0)])])]),e("td",Ne,k(a.name),1),e("td",Re,[_(C,{filepath:$(a.meta.middleware),override:`${a.meta.middleware||"-"}`},null,8,["filepath","override"])]),e("td",Ce,[a.meta.layout===!1?(o(),s("span",Pe,"-")):a.meta.layout?(o(),s("button",{key:1,onClick:i=>g(a.meta.layout)},k(a.meta.layout),9,Ve)):(o(),s("button",{key:2,"text-sm":"",op15:"",onClick:n[1]||(n[1]=i=>g("default"))}," (default) "))])]))),128))])])])}}}),Le={class:"markdown-body"},Te=e("h1",null,"Pages",-1),Be=e("p",null,[V("Nuxt provides a file-based routing to create routes within your web application using Vue Router under the hood. Pages are Vue components and can have any valid extension that Nuxt supports (by default .vue, .js, .jsx, .mjs, .ts or .tsx). Nuxt will automatically create a route for every page in your "),e("code",null,"~/pages/"),V(" directory.")],-1),Ee=e("p",null,[e("a",{href:"https://nuxt.com/docs/getting-started/routing",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Me=e("hr",null,null,-1),Ae=e("h1",null,"Middlewares",-1),je=e("p",null,"Nuxt provides a customizable route middleware framework that can be used throughout the application. This is ideal for extracting code that needs to run before navigating to a particular route.",-1),De=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/directory-structure/middleware",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),Fe=[Te,Be,Ee,Me,Ae,je,De],Se={__name:"pages",setup(R,{expose:u}){return u({frontmatter:{}}),(h,f)=>(o(),s("div",Le,Fe))}},ze={key:0,"h-full":"","of-auto":""},Ke={border:"b base",flex:"~ col gap1",px4:"",py3:"","n-navbar-glass":""},We=e("span",{op50:""},"Navigate from ",-1),Ue={"font-mono":""},Oe=e("span",{op50:""}," to ",-1),Ge={key:1,op50:""},He=e("span",null,[V("Press "),e("b",{"font-bold":""},"Enter"),V(" to navigate")],-1),Xe={key:0,"text-orange":"",op75:""},Ye={key:1,op50:""},qe={"min-h-14":""},Je={key:1,class:"py-4 text-center"},Qe=e("span",{op50:""},"No routes matched",-1),Ze=[Qe],et={"w-full":""},tt=e("thead",{border:"b base","h-7":""},[e("tr",null,[e("th",{"text-left":""}," Name "),e("th",{"text-left":""}," Path ")])],-1),ot={mr1:""},pt=E({__name:"pages",setup(R){const u=Y(),p=q(),h=J(),f=j(),g=Q(),$=Z(),r=x(()=>f.value?.middleware||[]),n=B(""),c=B(0),d=x(()=>(r.value,n.value,g.value,c.value,u.value?.currentRoute.value.path));ee(()=>{p.value&&(n.value=u.value?.currentRoute.value.path),u.value?.beforeEach(l=>{n.value=l.fullPath}),u.value?.afterEach(l=>{n.value=l.fullPath})});async function C(){n.value!==u.value?.currentRoute.value.path&&u.value.push(n.value||"/")}const a=x(()=>u.value.resolve(n.value||"/").matched);function i(l){u.value.push(l),n.value=l}return(l,v)=>{const P=A,I=Ie,T=se,S=D,z=F,K=re,W=Se,U=le;return o(),s(m,null,[t(h)?.pages&&t(u)?(o(),s("div",ze,[e("div",Ke,[e("div",null,[t(d)!==t(n)?(o(),s(m,{key:0},[We,e("span",Ue,k(t(d)),1),Oe],64)):(o(),s("span",Ge,"Current route"))]),_(P,{modelValue:t(n),"onUpdate:modelValue":v[0]||(v[0]=w=>te(n)?n.value=w:null),"font-mono":"",icon:"carbon-direction-right-01 scale-y--100",class:M(t(d)===t(n)?"":t(a).length?"text-green":"text-orange"),onKeydown:oe(C,["enter"])},null,8,["modelValue","class","onKeydown"]),e("div",null,[t(d)!==t(n)?(o(),s(m,{key:0},[He,t(a).length?N("",!0):(o(),s("span",Xe," (no match)"))],64)):(o(),s("span",Ye,"Edit path above to navigate"))])]),_(T,{icon:"carbon-tree-view",text:"Matched Routes",padding:!1},{default:b(()=>[e("div",qe,[t(a).length?(o(),y(I,{key:0,pages:t(a),layouts:t(g)||[],matched:t(p).matched,"matched-pending":t(a),onNavigate:i},null,8,["pages","layouts","matched","matched-pending"])):(o(),s("div",Je,Ze))])]),_:1}),_(T,{icon:"carbon-tree-view-alt",text:"All Routes",description:`${t($).length} routes registered in your application`,padding:"pr5"},{default:b(()=>[_(I,{pages:t($),layouts:t(g)||[],matched:t(p).matched,"matched-pending":t(a),onNavigate:i},null,8,["pages","layouts","matched","matched-pending"])]),_:1},8,["description"]),t(r).length?(o(),y(T,{key:0,icon:"carbon:ibm-watson-studio",text:"Middleware",description:`${t(r).length} middleware registered in your application`,padding:"px13"},{default:b(()=>[e("table",et,[tt,(o(!0),s(m,null,L(t(r),w=>(o(),s("tr",{key:w.path,"h-7":""},[e("td",null,[e("span",ot,k(w.name),1),w.global?(o(),y(S,{key:0,n:"green",title:"Registered at runtime as a global component",textContent:"global"})):N("",!0)]),e("td",null,[_(z,{filepath:w.path},null,8,["filepath"])])]))),128))])]),_:1},8,["description"])):N("",!0)])):(o(),y(K,{key:1,icon:"carbon-tree-view-alt",name:"wizard-pages",title:"Nuxt Routing",description:"Create `./pages/index.vue` to enable routing",actions:[{label:"Learn more",src:"https://nuxt.com/docs/getting-started/routing",attrs:{n:"primary"}},{label:"Enable Routing",async handle(){return("rpc"in l?l.rpc:t(ne)).runWizard(await("ensureDevAuthToken"in l?l.ensureDevAuthToken:t(ae))(),"enablePages")}}]},null,8,["actions"])),_(U,null,{default:b(()=>[_(W)]),_:1})],64)}}});export{pt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as
|
|
1
|
+
import{_ as b}from"./StateEditor.vue.162475d5.js";import{d as v,o as e,m as c,F as k,n as C,h as f,j as o,a7 as N,ba as B,bb as w,k as x,ar as F,a as O,ab as P,f as r,i as a,p as u,v as R,I as V,_ as j}from"./entry.3dd66f35.js";import{_ as E}from"./NSectionBlock.7f41e147.js";import{_ as A}from"./HelpFab.vue.314bc83b.js";import"./DataSchemaButton.vue.b30dcd6f.js";import"./json-editor-vue.465dc720.js";import"./NIconTitle.vue.71113a3f.js";const G={key:0,flex:"~ col gap-1"},H={key:1,mt2:"",px4:"",italic:"",op35:""},K=v({__name:"StateGroup",props:{state:{},prefix:{default:""}},setup(m){return(t,n)=>{const i=b;return e(),c("div",null,[t.state&&Object.keys(t.state).length>0?(e(),c("div",G,[(e(!0),c(k,null,C(t.state,(l,s)=>(e(),f(i,{key:s,state:l,name:s.startsWith(t.prefix)?s.slice(t.prefix.length):s},{actions:o(_=>[N(t.$slots,"actions",B(w(_)))]),_:2},1032,["state","name"]))),128))])):(e(),c("div",H," No data "))])}}}),T={class:"markdown-body"},z=x("h1",null,"State & Async Data",-1),I=x("p",null,"// TODO",-1),L=[z,I],W={__name:"payload",setup(m,{expose:t}){return t({frontmatter:{}}),(i,l)=>(e(),c("div",T,L))}},q={key:0},et=v({__name:"payload",setup(m){const t=F(),n=O(()=>t.value?.nuxt.payload);async function i(l){await t.value?.nuxt.hooks.callHookParallel("app:data:refresh",l)}return(l,s)=>{const _=K,d=E,h=j,$=b,S=W,g=A,D=P("tooltip");return e(),c(k,null,[r(t)?(e(),c("div",q,[a(d,{icon:"carbon-data-set",text:"State",description:"Keyed state from `useState`",padding:!1},{default:o(()=>[a(_,{state:r(n).state,prefix:"$s"},null,8,["state"])]),_:1}),a(d,{icon:"carbon-data-blob",text:"Data",description:"Keyed state from `useAsyncData`",padding:!1},{actions:o(()=>[a(h,{n:"xs primary","self-start":"",icon:"i-carbon-recycle",onClick:s[0]||(s[0]=y=>i())},{default:o(()=>[R(" Re-fetch all data ")]),_:1})]),default:o(()=>[a(_,{state:r(n).data},{actions:o(({isOpen:y,name:p})=>[y&&p?V((e(),f(h,{key:0,title:`Re-fetch '${p}'`,icon:"carbon-recycle",border:!1,onClick:J=>i([p])},null,8,["title","onClick"])),[[D,`Re-fetch '${p}'`,void 0,{bottom:!0}]]):u("",!0)]),_:1},8,["state"])]),_:1}),r(n).functions&&Object.keys(r(n).functions).length?(e(),f(d,{key:0,icon:"carbon-function",text:"Functions",description:"State for functions"},{default:o(()=>[a($,{"ml--6":"",state:r(n).functions},null,8,["state"])]),_:1})):u("",!0)])):u("",!0),a(g,null,{default:o(()=>[a(S)]),_:1})],64)}}});export{et as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as S}from"./FilepathItem.vue.
|
|
1
|
+
import{_ as S}from"./FilepathItem.vue.6dd69314.js";import{_ as D}from"./NBadge.e849763e.js";import{_ as C}from"./DurationDisplay.vue.5b7cc04d.js";import{d as v,a9 as B,a as x,b7 as V,o as n,m,k as t,t as P,i as l,f,h as u,p as d,am as F,a7 as N,a2 as H,q as I,j as g,v as y,b9 as E,ar as W,F as k,n as j,G as L}from"./entry.3dd66f35.js";import{_ as M}from"./NSectionBlock.7f41e147.js";import{_ as q}from"./HelpFab.vue.314bc83b.js";import"./NIconTitle.vue.71113a3f.js";const z={flex:"~ gap2","items-center":""},A={w8:"","text-right":"","text-sm":"",op25:""},G={key:0,"flex-auto":"","text-right":""},R=v({__name:"PluginItem",props:{plugin:{},index:{}},setup(p){const e=p,a=B(),r=x(()=>V(e.plugin.src,a.value?.rootDir||"").path);return(i,c)=>{const _=S,o=D,s=C;return n(),m("div",z,[t("div",A,P(i.index),1),l(_,{filepath:e.plugin.src,subpath:!0},null,8,["filepath"]),t("div",null,[f(r).startsWith("#")?(n(),u(o,{key:0,n:"rose",textContent:"virtual"})):f(r).startsWith(".")?d("",!0):(n(),u(o,{key:1,n:"gray",textContent:"module"})),i.plugin.mode==="server"?(n(),u(o,{key:2,n:"teal",textContent:"server"})):d("",!0),i.plugin.mode==="client"?(n(),u(o,{key:3,n:"orange",textContent:"client"})):d("",!0)]),i.plugin.metric?.duration!=null?(n(),m("div",G,[l(s,{duration:i.plugin.metric?.duration,factor:10},null,8,["duration"])])):d("",!0)])}}}),Y={class:"n-tip n-tip-base",flex:"~ col items-start","mx--4":"",px4:"",py4:""},J={flex:"~ items-center gap-1","font-bold":""},K=v({__name:"HelpTip",props:{title:{},icon:{}},setup(p){return(e,a)=>{const r=H,i=F("ContentSlot");return n(),m("div",Y,[t("div",J,[e.icon?(n(),u(r,{key:0,icon:e.icon,class:"n-tip-icon"},null,8,["icon"])):d("",!0),t("div",null,P(e.title),1)]),t("div",null,[N(e.$slots,"default",{},()=>[l(i,{use:e.$slots.default,unwrap:"p"},null,8,["use"])])])])}}}),O={};function Q(p,e){const a=K;return n(),u(a,{title:"Performance Tip",icon:"carbon-meter",n:"lime6 dark:lime5"},{default:g(()=>[N(p.$slots,"default")]),_:3})}const U=I(O,[["render",Q]]),X={class:"markdown-body"},Z=t("h1",null,"Plugins",-1),tt=t("p",null,[y("Nuxt plugins allow you to extend the functionality of the Nuxt runtime and the Vue instance. You can add plugins to the "),t("code",null,"plugins/"),y(" directory and they will be automatically imported and registered.")],-1),et=t("p",null,[t("a",{href:"https://nuxt.com/docs/guide/directory-structure/plugins",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),nt={__name:"plugins",setup(p,{expose:e}){return e({frontmatter:{}}),(r,i)=>{const c=U;return n(),m("div",X,[Z,tt,l(c,null,{default:g(()=>[y(" Plugins always run before your application's runtime. The loading time of each plugin will directly impact your application's initial loading time. ")]),_:1}),et])}}},ot={pt4:""},st={class:"text-sm",flex:"~ gap-1 items-center justify-start","mt-3":""},it=t("div",{"i-carbon-timer":"","text-lg":"",op75:""},null,-1),at=t("span",{op50:""},"Total execution time:",-1),dt=v({__name:"plugins",setup(p){const e=E(),a=W(),r=x(()=>{const c=e.value?.plugins||[],_=a.value?.metrics.clientPlugins()||[];return c.map(o=>{const s=typeof o=="string"?{src:o}:o;return{...s,metric:_.find(h=>h.src===s.src||h.src.startsWith(s.src))}})}),i=x(()=>{const c=a.value?.metrics.clientPlugins()||[],_=Math.min(...c.map(s=>s.start));return Math.max(...c.map(s=>s.end))-_});return(c,_)=>{const o=R,s=C,h=M,T=nt,w=q;return n(),m(k,null,[l(h,{icon:"carbon-plug",text:"Plugins",description:`Total plugins: ${f(r).length}`},{default:g(()=>[t("div",ot,[(n(!0),m(k,null,j(f(r),($,b)=>(n(),u(o,{key:$.src,plugin:$,index:b+1,"ml--4":"","border-base":"",py2:"",class:L(b?"border-t":"")},null,8,["plugin","index","class"]))),128)),t("div",st,[it,at,l(s,{duration:f(i),factor:10},null,8,["duration"])])])]),_:1},8,["description"]),l(w,null,{default:g(()=>[l(T)]),_:1})],64)}}});export{dt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as v}from"./StateEditor.vue.162475d5.js";import{_ as x}from"./NSectionBlock.7f41e147.js";import{o as r,m as u,k as e,v as m,d as y,ar as b,bc as C,a as d,f as i,i as t,j as a,p as k,F as w}from"./entry.3dd66f35.js";import{_ as N}from"./HelpFab.vue.314bc83b.js";import"./DataSchemaButton.vue.b30dcd6f.js";import"./json-editor-vue.465dc720.js";import"./NIconTitle.vue.71113a3f.js";const R={class:"markdown-body"},T=e("h1",null,"Runtime Configs",-1),B=e("p",null,"Nuxt provides a runtime config API to expose configuration within your application and server routes, with the ability to update it at runtime by setting environment variables.",-1),V=e("p",null,[m("In Nuxt DevTools, the editor allows you to edit the runtime config temporarily to see how the changes affect your application. To update them, you might want to update your "),e("code",null,"nuxt.config.js"),m(" file, or check more details in the documentation.")],-1),$=e("p",null,[e("a",{href:"https://nuxt.com/docs/guide/going-further/runtime-config",target:"_blank",rel:"noopener"},"Learn more in the documentation")],-1),D=[T,B,V,$],F={__name:"runtime-configs",setup(f,{expose:o}){return o({frontmatter:{}}),(p,_)=>(r(),u("div",R,D))}},P={key:0},z=y({__name:"runtime-configs",setup(f){const o=b(),l=C(),p=d(()=>o.value?.nuxt.payload),_=d(()=>{const n={...l.value};return delete n.public,delete n.app,n});return(n,S)=>{const s=v,c=x,g=F,h=N;return r(),u(w,null,[i(o)?(r(),u("div",P,[t(c,{icon:"carbon-settings-services",text:"App Config",padding:!1},{default:a(()=>[t(s,{state:i(o).app.appConfig},null,8,["state"])]),_:1}),t(c,{icon:"carbon-settings",text:"Public Runtime Config",padding:!1},{default:a(()=>[t(s,{state:i(p).config?.public},null,8,["state"])]),_:1}),t(c,{icon:"i-carbon-code-signing-service",text:"Private Runtime Config",open:!1,padding:!1,description:"These values are not exposed to the client. Readonly in the DevTools."},{default:a(()=>[t(s,{state:i(_),readonly:""},null,8,["state"])]),_:1})])):k("",!0),t(h,null,{default:a(()=>[t(g)]),_:1})],64)}}});export{z as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{r as P,bf as Fe,ax as ze,av as He,w as xe,bg as We,bh as Ge,d as ae,bi as we,o as t,m as v,k as d,G as E,h as C,f as e,bj as se,t as j,p as D,v as z,a5 as Je,a7 as ee,F as U,n as A,a2 as ce,a6 as Ke,a as T,i as m,j as k,W as $e,_ as fe,bk as Qe,a9 as Xe,ar as Ye,at as pe,a8 as Ze,aw as et,e as tt,ab as Se,l as X,I as le,aq as ot,U as nt,A as Te,bl as st,bm as lt,af as at,S as rt,bn as it,al as ut}from"./entry.3dd66f35.js";import{_ as dt}from"./NNavbar.vue.d9a029e0.js";import{_ as Ve}from"./NBadge.e849763e.js";import{_ as Re}from"./NSelect.vue.e7f8c81a.js";import{_ as pt}from"./NCheckbox.vue.cf7e1e9d.js";import{u as Ue,_ as ct}from"./storage-options.2224e06b.js";import{_ as ft}from"./DataSchemaButton.vue.b30dcd6f.js";import{_ as mt}from"./NCodeBlock.vue.882d562f.js";import{C as ke,S as Ne}from"./constants.2cc6e981.js";import{U as vt}from"./json-editor-vue.465dc720.js";import{_ as ht}from"./NSectionBlock.7f41e147.js";import{_ as yt}from"./NDrawer.vue.a4010d93.js";import"./client.253674ec.js";import"./NIconTitle.vue.71113a3f.js";const ne=/^[\u0009\u0020-\u007E\u0080-\u00FF]+$/;function _t(r,y){if(typeof r!="string")throw new TypeError("argument str must be a string");const h={},w=(y||{}).decode||kt;let g=0;for(;g<r.length;){const c=r.indexOf("=",g);if(c===-1)break;let s=r.indexOf(";",g);if(s===-1)s=r.length;else if(s<c){g=r.lastIndexOf(";",c-1)+1;continue}const i=r.slice(g,c).trim();if(h[i]===void 0){let a=r.slice(c+1,s).trim();a.codePointAt(0)===34&&(a=a.slice(1,-1)),h[i]=bt(a,w)}g=s+1}return h}function Ce(r,y,h){const o=h||{},w=o.encode||Ct;if(typeof w!="function")throw new TypeError("option encode is invalid");if(!ne.test(r))throw new TypeError("argument name is invalid");const g=w(y);if(g&&!ne.test(g))throw new TypeError("argument val is invalid");let c=r+"="+g;if(o.maxAge!==void 0&&o.maxAge!==null){const s=o.maxAge-0;if(Number.isNaN(s)||!Number.isFinite(s))throw new TypeError("option maxAge is invalid");c+="; Max-Age="+Math.floor(s)}if(o.domain){if(!ne.test(o.domain))throw new TypeError("option domain is invalid");c+="; Domain="+o.domain}if(o.path){if(!ne.test(o.path))throw new TypeError("option path is invalid");c+="; Path="+o.path}if(o.expires){if(!gt(o.expires)||Number.isNaN(o.expires.valueOf()))throw new TypeError("option expires is invalid");c+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(c+="; HttpOnly"),o.secure&&(c+="; Secure"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():o.priority){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"strict":c+="; SameSite=Strict";break;case"none":c+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return c}function gt(r){return Object.prototype.toString.call(r)==="[object Date]"||r instanceof Date}function bt(r,y){try{return y(r)}catch{return r}}function kt(r){return r.includes("%")?decodeURIComponent(r):r}function Ct(r){return encodeURIComponent(r)}const xt={path:"/",watch:!0,decode:r=>We(decodeURIComponent(r)),encode:r=>encodeURIComponent(typeof r=="string"?r:JSON.stringify(r))};function wt(r,y){const h={...xt,...y},o=$t(h)||{},w=P(o[r]??h.default?.());{const g=typeof BroadcastChannel>"u"?null:new BroadcastChannel(`nuxt:cookies:${r}`);Fe()&&ze(()=>{g?.close()});const c=()=>{Tt(r,w.value,h),g?.postMessage(Ge(w.value))};let s=!1;g&&(g.onmessage=i=>{s=!0,w.value=i.data,He(()=>{s=!1})}),h.watch?xe(w,()=>{s||c()},{deep:h.watch!=="shallow"}):c()}return w}function $t(r={}){return _t(document.cookie,r)}function St(r,y,h={}){return y==null?Ce(r,y,{...h,maxAge:-1}):Ce(r,y,h)}function Tt(r,y,h={}){document.cookie=St(r,y,h)}const Vt=d("div",{"x-divider":""},null,-1),Ie=ae({__name:"ServerRouteListItem",props:{item:{},index:{default:0}},setup(r){const y=P(!0),h=we();return(o,w)=>{const g=ce,c=Ve,s=Ie;return t(),v("div",null,[d("button",{flex:"~ gap-2","w-full":"","items-start":"","items-center":"","hover-bg-active":"",px2:"",py1:"",class:E([{"bg-active":e(h)===o.item.filepath}]),style:Je({paddingLeft:`calc(0.5rem + ${o.index*1.5}em)`}),onClick:w[0]||(w[0]=i=>{y.value=!e(y),h.value=o.item.filepath})},[d("div",{class:E({"w-12":!o.item.routes}),"flex-none":"","text-left":""},[o.item.type==="collection"?(t(),C(g,{key:0,icon:"carbon:chevron-right","mb0.5":"","transform-rotate":e(y)?90:0,transition:""},null,8,["transform-rotate"])):(t(),C(c,{key:1,class:E(("getRequestMethodClass"in o?o.getRequestMethodClass:e(se))(o.item.method||"*")),textContent:j((o.item.method||"*").toUpperCase())},null,8,["class","textContent"]))],2),d("span",{class:E({"flex items-center":o.item.routes}),"text-sm":"","font-mono":""},[o.item.type==="collection"?(t(),C(g,{key:0,title:`${o.item.routes?.length} routes`,icon:"carbon:folder",mr1:""},null,8,["title"])):D("",!0),z(" "+j(o.item.route),1)],2)],6),Vt,e(y)?ee(o.$slots,"default",{key:0},()=>[(t(!0),v(U,null,A(o.item.routes,i=>(t(),C(s,{key:i.filepath,item:i,index:o.index+1},null,8,["item","index"]))),128))]):D("",!0)])}}}),Rt={p4:"",flex:"~ col gap-4"},Ut={key:1,ml2:"",flex:""},Nt=["value"],It={key:0,flex:"","gap-4":""},Dt=d("div",{"flex-auto":""},null,-1),De=ae({__name:"ServerRouteInputs",props:{modelValue:{},keys:{default:()=>[]},default:{default:()=>({})},disabled:{type:Boolean,default:!1}},setup(r,{emit:y}){const h=r,o=Ke(h,"modelValue",y,{passive:!0}),w=T(()=>[...h.keys,"key","value","type"]),g=T(()=>{const i={};for(const a of w.value)i[a]=h.default[a]||"";return i}),c=["string","number","boolean","file","date","time","datetime-local"];function s(i,a){const R=a.target;if(R.files&&R.files[0]){const H=R.files[0],F=new FileReader;F.readAsDataURL(H),F.onload=()=>{o.value[i].value=F.result}}}return xe(()=>o,i=>{i.value.forEach(a=>{if(a.type==="number"&&typeof a.value!="number"){const R=Number.parseFloat(a.value);a.value=Number.isNaN(R)?0:R}else a.type==="boolean"&&typeof a.value!="boolean"?a.value=!0:a.type==="file"&&typeof a.value!="object"?a.value="":a.type==="date"&&typeof a.value=="string"&&!a.value.match(/^\d{4}-\d{2}-\d{2}$/)?a.value=new Date().toISOString().slice(0,10):a.type==="time"&&typeof a.value=="string"&&!a.value.match(/^\d{2}:\d{2}$/)?a.value=new Date().toISOString().slice(11,16):a.type==="datetime-local"&&typeof a.value=="string"&&!a.value.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/)?a.value=new Date().toISOString().slice(0,16):a.type==="string"&&(a.value=a.value.toString())})},{deep:!0,immediate:!0,flush:"sync"}),(i,a)=>{const R=$e,H=pt,F=Re,J=ce,b=fe;return t(),v("div",Rt,[(t(!0),v(U,null,A(e(o),(u,S)=>(t(),v("div",{key:S,flex:"~ gap-2","justify-around":""},[ee(i.$slots,"input",{item:u}),(t(!0),v(U,null,A(e(w),$=>(t(),v(U,{key:$},[u.type!==null&&$==="key"?(t(),C(R,{key:0,modelValue:u[$],"onUpdate:modelValue":_=>u[$]=_,placeholder:$,"flex-1":"","font-mono":"",n:"sm primary",disabled:i.disabled,class:E(i.disabled?"op50":"")},null,8,["modelValue","onUpdate:modelValue","placeholder","disabled","class"])):$==="value"?(t(),v(U,{key:1},[u.type==="file"?(t(),C(R,{key:0,type:"file",disabled:i.disabled,class:E(i.disabled?"op75":""),onChange:_=>s(S,_)},null,8,["disabled","class","onChange"])):u.type==="boolean"?(t(),v("div",Ut,[m(H,{modelValue:u.value,"onUpdate:modelValue":_=>u.value=_,placeholder:"Value",n:"green lg",disabled:i.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])])):(t(),C(R,{key:2,modelValue:u.value,"onUpdate:modelValue":_=>u.value=_,type:u.type,placeholder:"Value","flex-1":"","font-mono":"",n:"sm primary",disabled:i.disabled,class:E(i.disabled?"op75":"")},null,8,["modelValue","onUpdate:modelValue","type","disabled","class"]))],64)):$==="type"?(t(),C(F,{key:2,modelValue:u.type,"onUpdate:modelValue":_=>u.type=_,n:"sm green",class:E(i.disabled?"op75":""),disabled:i.disabled},{default:k(()=>[(t(),v(U,null,A(c,_=>d("option",{key:_,value:_},j(_),9,Nt)),64))]),_:2},1032,["modelValue","onUpdate:modelValue","class","disabled"])):D("",!0)],64))),128)),ee(i.$slots,"input-actions",{},()=>[m(b,{n:"red",disabled:i.disabled,class:E(i.disabled?"op0!":""),onClick:$=>e(o).splice(S,1)},{default:k(()=>[m(J,{icon:"carbon:delete"})]),_:2},1032,["disabled","class","onClick"])])]))),128)),i.disabled?D("",!0):(t(),v("div",It,[ee(i.$slots,"actions",{params:e(o)},()=>[m(b,{icon:"carbon-add",n:"sm primary",my1:"","px-3":"",onClick:a[0]||(a[0]=u=>e(o).push({...e(g)}))},{default:k(()=>[z(" Add ")]),_:1}),Dt,e(o).length?(t(),C(b,{key:0,icon:"carbon-trash-can",n:"sm red",my1:"","px-3":"",onClick:a[1]||(a[1]=u=>o.value=[])},{default:k(()=>[z(" Remove All ")]),_:1})):D("",!0)])])),ee(i.$slots,"default")])}}}),jt={"h-full":"","w-full":"",flex:"~ col"},Et={flex:"~ col gap-2","flex-none":"",p4:"","n-navbar-glass":""},Ot={flex:"~ gap2 items-center"},Lt={relative:"","w-full":""},Pt={absolute:"","right-2":"","top-1.5":"",flex:"~ gap-1"},qt={flex:"~ gap2 wrap","w-full":"","items-center":"",px4:"",pb2:"","text-center":"","text-sm":"",border:"b base"},Bt=d("div",{"flex-auto":""},null,-1),At=d("div",{"text-xs":"",op50:""}," Send from ",-1),Mt=d("option",{value:"app"}," App ",-1),Ft=d("option",{value:"devtools"}," DevTools ",-1),zt={key:0,border:"b base","items-center":"",px4:"",py2:"",grid:"~ cols-[max-content_1fr] gap-2"},Ht={"text-right":"","font-mono":""},Wt={key:1,border:"b base",p4:"",flex:"~ col gap-4","font-mono":""},Gt={flex:"~ gap-4"},Jt={flex:"~ gap2","mb--2":"","items-center":"",op50:""},Kt=d("div",{"w-5":"","x-divider":""},null,-1),Qt=d("div",{"flex-none":""}," Default Inputs ",-1),Xt=d("div",{"x-divider":""},null,-1),Yt={key:2},Zt={key:3,border:"b base",relative:"","n-code-block":""},eo={flex:"~ wrap","w-full":""},to=["onClick"],oo=d("div",{border:"b base","flex-auto":""},null,-1),no={border:"b base",flex:"~ gap2","items-center":"",px4:"",py2:""},so=d("div",null,"Response",-1),lo={key:1,"text-xs":"",op50:""},ao=d("div",{"flex-auto":""},null,-1),ro=d("div",{op50:""}," Request finished in ",-1),io={key:0,"flex-auto":"","overflow-auto":""},uo={border:"~ base","h-full":"","w-full":"",rounded:""},po=["data"],co={key:2,"flex-auto":"","overflow-auto":"",p4:""},fo={border:"~ base",rounded:""},mo=["src"],vo={key:1,controls:"",rounded:""},ho=["src"],yo=ae({__name:"ServerRouteDetails",props:{route:{}},emits:["open-default-input"],setup(r,{emit:y}){const h=r,[o,w]=Qe(),g=Xe(),c=Ye(),s=pe({contentType:"text/plain",data:"",statusCode:200,error:void 0,fetchTime:0}),i=T(()=>s.contentType.includes("application/json")?"json":s.contentType.includes("text/html")?"html":s.contentType.includes("text/css")?"css":s.contentType.includes("text/javascript")?"javascript":s.contentType.includes("image")||s.contentType.includes("video")?"media":s.contentType.includes("text/xml")||s.contentType.includes("application/xml")?"xml":s.contentType.includes("application/pdf")?"pdf":"text"),a=T(()=>{if(i.value==="json")return JSON.stringify(s.data,null,2);if(i.value==="media"||i.value==="pdf"){const n=new Blob([s.data],{type:s.contentType});return URL.createObjectURL(n)}return s.data}),R=P(!1),H=P(!1),F=Ze(),J=T(()=>h.route.route?.split(/((?:\*\*)?:[\w_]+)/g)),b=T(()=>J.value?.filter(n=>n.startsWith(":")||n.startsWith("**:"))||[]),u=P(h.route.method||"GET"),S=P({}),$=pe({query:[{key:"",value:"",type:"string"}],body:[{key:"",value:"",type:"string"}],headers:[{key:"Content-Type",value:"application/json",type:"string"}]}),_=P({}),{inputDefaults:V,sendFrom:q}=Ue("serverRoutes"),O=T(()=>c?.value?.app?.$fetch?q.value:"devtools"),B=["GET","POST","PUT","PATCH","DELETE","HEAD"],re=["PATCH","POST","PUT","DELETE"],te=T(()=>re.includes(u.value.toUpperCase())),L=P(b.value.length?"params":"query"),Y=["input","json"],x=P(Y[0]),K=T({get:()=>$[L.value],set:n=>{$[L.value]=n}}),me=T(()=>({...G(V.value.query),...G($.query)})),ve=T(()=>({...G(V.value.headers),...G($.headers)})),ie=T(()=>te.value?x.value==="json"?{...G(V.value.body),..._.value}:{...G(V.value.body),...G($.body)}:void 0),je=T(()=>{let n=window?.location.origin;return n.charAt(n.length-1)==="/"&&(n=n.slice(0,-1)),n}),oe=T(()=>{let n=new URLSearchParams(me.value).toString();n&&(n=`?${n}`);const p=(J.value?.map(N=>(N.startsWith(":")||N.startsWith("**:"))&&S.value[N]||N).join("")||"")+n;let f=g.value?.app.baseURL||"";return(f==="./"||f===".")&&(f=""),f.endsWith("/")&&(f=f.slice(0,-1)),f+p}),he=T(()=>je.value+oe.value);function G(n){const p=Object.fromEntries(n.filter(({key:f,value:N})=>f&&N!==void 0).map(({key:f,value:N})=>[f,N]));return Object.entries(p).length?p:void 0}async function ye(){H.value=!0,R.value=!0;const n=Date.now(),p=O.value==="app"?c.value.app.$fetch:$fetch;nt("server-routes:fetch",{method:u.value,sendFrom:O.value});try{s.data=await p(he.value,{method:u.value.toUpperCase(),headers:ve.value,query:me.value,body:ie.value,onResponse({response:f}){s.contentType=(f.headers.get("content-type")||"").toString().toLowerCase().trim(),s.statusCode=f.status,s.error=void 0},onResponseError(f){s.error=f.response._data,s.data=f.response._data}})}catch{}R.value=!1,s.fetchTime=Date.now()-n}const _e=T(()=>{const n=[],p=[],f=Object.entries(ve.value).filter(([I,M])=>I&&M&&!(I==="Content-Type"&&M==="application/json")).map(([I,M])=>` '${I}': '${M}'`).join(`,
|
|
2
|
+
`);u.value.toUpperCase()!=="GET"&&p.push(`method: '${u.value.toUpperCase()}'`),f&&p.push(`headers: {
|
|
3
|
+
${f}
|
|
4
|
+
}`),ie.value&&p.push(`body: ${JSON.stringify(ie.value,null,2)}`);const N=p.length?`, {
|
|
5
|
+
${p.join(`,
|
|
6
|
+
`).split(`
|
|
7
|
+
`).map(I=>` ${I}`).join(`
|
|
8
|
+
`)}
|
|
9
|
+
}`:"";return n.push({name:"useFetch",lang:"javascript",docs:ke.nuxt.useFetch,code:`const { data, pending, error, refresh } = useFetch('${oe.value}'${N})`}),n.push({name:"$fetch",lang:"javascript",docs:ke.nuxt.$fetch,code:`await $fetch('${oe.value}'${N})`}),n}),Ee=T(()=>{const n=[];return b.value.length&&n.push({name:"Params",slug:"params",length:b.value.length}),n.push({name:"Query",slug:"query",length:$.query.length}),te.value&&n.push({name:"Body",slug:"body",length:$.body.length}),n.push({name:"Headers",slug:"headers",length:$.headers.length}),n.push({name:"Cookies",slug:"cookies"}),n.push({name:"Snippets",slug:"snippet"}),n}),Z=P(Oe());function Oe(){return document.cookie.split("; ").map(n=>{const[p,f]=n.split("=");return{key:p,value:f}})}const W=pe({key:"",value:""});function ue(n,p){if(!n)return;const f=Z.value.find(I=>I.key===n),N=wt(n);f!==void 0?p===void 0&&(Z.value=Z.value.filter(I=>I.key!==n)):(Z.value.push({key:n,value:p}),W.key="",W.value=""),N.value=p}et(()=>{x.value==="json"&&typeof _.value=="string"&&(_.value=JSON.parse(_.value))});const Le=tt();return(n,p)=>{const f=fe,N=Re,I=$e,M=ce,ge=De,Pe=ct,qe=Te,Be=st,de=Ve,Ae=ft,Me=mt,be=Se("tooltip");return t(),v("div",jt,[d("div",Et,[d("div",Ot,[n.route.method?(t(),C(f,{key:0,class:E(["n-badge-base n-sm",("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(e(u))]),"pointer-events-none":"","font-mono":"",tabindex:"-1"},{default:k(()=>[z(j(e(u).toUpperCase()),1)]),_:1},8,["class"])):(t(),C(N,{key:1,modelValue:e(u),"onUpdate:modelValue":p[0]||(p[0]=l=>X(u)?u.value=l:null),class:E(["n-badge-base n-sm",("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(e(u))])},{default:k(()=>[(t(),v(U,null,A(B,l=>d("option",{key:l,class:E(("getRequestMethodClass"in n?n.getRequestMethodClass:e(se))(l))},j(l.toUpperCase()),3)),64))]),_:1},8,["modelValue","class"])),d("div",Lt,[m(I,{"model-value":e(oe),readonly:"","flex-auto":"","font-mono":"",p:"x5 y2",n:"sm"},null,8,["model-value"]),d("div",Pt,[le(m(f,{title:"Copy URL",n:"xs blue",icon:"carbon:copy",border:!1,onClick:p[1]||(p[1]=l=>e(Le)(e(he)))},null,512),[[be,"Copy URL"]]),le(m(f,{title:"Open in Editor",icon:"carbon-launch",n:"xs blue",border:!1,onClick:p[2]||(p[2]=l=>e(F)(n.route.filepath))},null,512),[[be,"Open in Editor"]])])]),m(f,{n:"primary solid",onClick:ye},{default:k(()=>[m(M,{icon:"carbon:send"})]),_:1})])]),d("div",qt,[(t(!0),v(U,null,A(e(Ee),l=>(t(),C(f,{key:l.slug,class:E(e(L)===l.slug?"text-primary n-primary":"border-transparent shadow-none"),onClick:Q=>L.value=l.slug},{default:k(()=>[m(M,{icon:("ServerRouteTabIcons"in n?n.ServerRouteTabIcons:e(Ne))[l.slug]},null,8,["icon"]),z(" "+j(l.name)+" "+j(l?.length?`(${l.length})`:"")+" ",1),d("span",null,j(e(V)[l.slug]?.length?`(${e(V)[l.slug].length})`:""),1)]),_:2},1032,["class","onClick"]))),128)),Bt,At,m(N,{modelValue:e(O),"onUpdate:modelValue":p[3]||(p[3]=l=>X(O)?O.value=l:null),class:"n-xs",disabled:!e(c)?.app?.$fetch},{default:k(()=>[Mt,Ft]),_:1},8,["modelValue","disabled"])]),e(L)==="params"?(t(),v("div",zt,[(t(!0),v(U,null,A(e(b),l=>(t(),v(U,{key:l},[d("div",Ht,j(l),1),m(I,{modelValue:e(S)[l],"onUpdate:modelValue":Q=>e(S)[l]=Q,placeholder:l,"flex-1":""},null,8,["modelValue","onUpdate:modelValue","placeholder"])],64))),128))])):D("",!0),e(L)==="cookies"?(t(),v("div",Wt,[(t(!0),v(U,null,A(e(Z),l=>(t(),v("div",{key:l.key,flex:"~ gap-4 items-center"},[m(I,{placeholder:"Key...","model-value":l.key,disabled:"","op-70":""},null,8,["model-value"]),m(I,{placeholder:"Value...","model-value":l.value,"flex-1":"",n:"primary",onInput:Q=>ue(l.key,Q.target?.value)},null,8,["model-value","onInput"]),m(f,{title:"Delete",n:"red",onClick:Q=>ue(l.key,void 0)},{default:k(()=>[m(M,{icon:"i-carbon-delete"})]),_:2},1032,["onClick"])]))),128)),d("div",Gt,[m(I,{modelValue:e(W).key,"onUpdate:modelValue":p[4]||(p[4]=l=>e(W).key=l),placeholder:"Key",n:"primary","flex-1":""},null,8,["modelValue"]),m(I,{modelValue:e(W).value,"onUpdate:modelValue":p[5]||(p[5]=l=>e(W).value=l),placeholder:"Value",n:"primary","flex-1":""},null,8,["modelValue"]),m(f,{title:"Add",n:"primary",onClick:p[6]||(p[6]=l=>ue(e(W).key,e(W).value))},{default:k(()=>[m(M,{icon:"i-carbon-save"})]),_:1})])])):D("",!0),m(e(o),null,{default:k(()=>[m(ge,{modelValue:e(K),"onUpdate:modelValue":p[9]||(p[9]=l=>X(K)?K.value=l:null),default:{type:"string"},"max-h-xs":"","of-auto":""},{default:k(()=>[e(V)[e(L)]?.length?(t(),v(U,{key:0},[d("div",Jt,[Kt,Qt,m(f,{icon:"i-carbon-edit",border:!1,onClick:p[7]||(p[7]=l=>y("open-default-input"))}),Xt]),m(ge,{modelValue:e(V)[e(L)],"onUpdate:modelValue":p[8]||(p[8]=l=>e(V)[e(L)]=l),disabled:"",p0:""},null,8,["modelValue"])],64)):D("",!0)]),_:1},8,["modelValue"])]),_:1}),e(L)==="snippet"?(t(),v("div",Yt,[e(_e).length?(t(),C(Pe,{key:0,"code-snippets":e(_e)},null,8,["code-snippets"])):D("",!0)])):e(K)?(t(),v("div",Zt,[e(L)==="body"?(t(),v(U,{key:0},[d("div",eo,[(t(),v(U,null,A(Y,l=>d("button",{key:l,px4:"",py2:"",border:"r base",hover:"bg-active",class:E({"border-b":l!==e(x)}),onClick:Q=>x.value=l},[d("div",{class:E({op30:l!==e(x)}),"font-mono":""},j(l),3)],10,to)),64)),oo]),e(x)==="input"?(t(),C(e(w),{key:0})):e(x)==="json"?(t(),C(e(vt),ot({key:1,modelValue:e(_),"onUpdate:modelValue":p[10]||(p[10]=l=>X(_)?_.value=l:null),class:[[n.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue of-auto text-sm outline-none"]},n.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):D("",!0)],64)):(t(),C(e(w),{key:1}))])):D("",!0),e(H)?e(R)?(t(),C(Be,{key:5,"z-10":"","flex-auto":"","backdrop-blur":""},{default:k(()=>[z(" Fetching... ")]),_:1})):(t(),v(U,{key:6},[d("div",no,[so,e(s).error?(t(),C(de,{key:0,n:"red"},{default:k(()=>[z(" Error ")]),_:1})):D("",!0),m(de,{n:e(s).error?"orange":"green",textContent:j(e(s).statusCode)},null,8,["n","textContent"]),e(s).contentType?(t(),v("code",lo,j(e(s).contentType),1)):D("",!0),e(s).contentType==="application/json"?(t(),C(Ae,{key:2,getter:()=>({input:e(a)})},null,8,["getter"])):D("",!0),ao,ro,m(de,{n:"green"},{default:k(()=>[z(j(e(s).fetchTime)+" ms ",1)]),_:1})]),e(i)==="pdf"?(t(),v("div",io,[d("div",uo,[d("object",{data:e(a),type:"application/pdf","flex-auto":"",width:"100%",height:"100%",rounded:""},null,8,po)])])):e(i)!=="media"?(t(),C(Me,{key:1,"flex-auto":"","overflow-auto":"","py-2":"",code:e(a),lang:e(i)},null,8,["code","lang"])):(t(),v("div",co,[d("div",fo,[e(s).contentType.includes("image")?(t(),v("img",{key:0,rounded:"",src:e(a)},null,8,mo)):(t(),v("video",vo,[d("source",{src:e(a),type:"video/mp4"},null,8,ho)]))])]))],64)):(t(),C(qe,{key:4},{default:k(()=>[m(f,{n:"primary",onClick:ye},{default:k(()=>[m(M,{icon:"carbon:send"}),z(" Send request ")]),_:1})]),_:1}))])}}}),_o={flex:"~ gap1","text-sm":""},go={key:0,op50:""},bo={op50:""},ko=d("span",{op75:""},"Select a route to start",-1),Co=d("div",{p4:"",border:"b base"},[d("span",{"text-lg":""},"Default Inputs"),d("br"),d("span",{"text-white":"",op50:""},"Merged as default for every request in DevTools")],-1),Lo=ae({__name:"server-routes",setup(r){const y=P(!1),h=lt(),o=we(),{selectedRoute:w,view:g,inputDefaults:c}=Ue("serverRoutes"),s=T(()=>{!o.value&&w.value&&(o.value=w.value.filepath);const b=h.value?.find(u=>u.filepath===o.value);return o.value!==w.value?.filepath&&b&&(w.value=b),b}),i=P(""),a=T(()=>new at(h.value||[],{keys:["method","route"],shouldSort:!0})),R=T(()=>h.value?i.value?a.value.search(i.value).map(u=>u.item):h.value:[]),H=T(()=>{const b=[],u=(S,$)=>{S.routes=S.routes||[],S.routes.push($)};return R.value.forEach(S=>{const $=S.filepath.split("/"),_=$.slice($.indexOf("server")+1);_.length>0&&_[_.length-1].includes(".")&&_.pop();let V=null;if(_.forEach(q=>{const O=V?V.routes?.find(B=>B.route===q):b.find(B=>B.route===q);if(O)V=O;else{const B={route:q,filepath:q.replace(/\W/g,"-").toLowerCase(),type:"collection",routes:[]};V?u(V,B):b.push(B),V=B}}),S.type==="runtime"){const q=b.find(O=>O.route==="runtime");if(q)u(q,S);else{const O={route:"runtime",filepath:"runtime",type:"collection",routes:[S]};b.push(O)}}else V?u(V,S):b.push(S)}),b});function F(){g.value=g.value==="tree"?"list":"tree"}function J(b){return b.charAt(0).toUpperCase()+b.slice(1)}return(b,u)=>{const S=fe,$=dt,_=Ie,V=yo,q=ut,O=Te,B=rt,re=De,te=ht,L=yt,Y=Se("tooltip");return t(),v(U,null,[m(B,{"storage-key":"tab-server-routes"},{left:k(()=>[m($,{search:e(i),"onUpdate:search":u[1]||(u[1]=x=>X(i)?i.value=x:null),pb2:""},{actions:k(()=>[le(m(S,{"text-lg":"",icon:e(g)==="list"?"i-carbon-list":"i-carbon-tree-view-alt",title:"Toggle view",border:!1,onClick:F},null,8,["icon"]),[[Y,"Toggle View"]]),le(m(S,{"text-lg":"",icon:"i-carbon-cics-sit-overrides",title:"Default Inputs",border:!1,onClick:u[0]||(u[0]=x=>y.value=!e(y))},null,512),[[Y,"Default Inputs"]])]),default:k(()=>[d("div",_o,[e(i)?(t(),v("span",go,j(e(R).length)+" matched · ",1)):D("",!0),d("span",bo,j(e(h)?.length)+" routes in total",1)])]),_:1},8,["search"]),(t(!0),v(U,null,A(e(g)==="tree"?e(H):e(R),x=>(t(),C(_,{key:x.filepath,item:x},null,8,["item"]))),128))]),right:k(()=>[(t(),C(it,{max:10},[e(s)?(t(),C(V,{key:e(s).filepath,route:e(s),onOpenDefaultInput:u[2]||(u[2]=x=>y.value=!0)},null,8,["route"])):D("",!0)],1024)),e(s)?D("",!0):(t(),C(O,{key:0},{default:k(()=>[m(q,{px6:"",py2:""},{default:k(()=>[ko]),_:1})]),_:1}))]),_:1}),m(L,{modelValue:e(y),"onUpdate:modelValue":u[3]||(u[3]=x=>X(y)?y.value=x:null),"auto-close":"","max-w-xl":"","min-w-xl":"",onClose:u[4]||(u[4]=x=>y.value=!1)},{default:k(()=>[d("div",null,[Co,(t(!0),v(U,null,A(Object.keys(e(c)),x=>(t(),C(te,{key:x,text:`${J(x)} ${e(c)[x].length?`(${e(c)[x].length})`:""}`,padding:!1,icon:("ServerRouteTabIcons"in b?b.ServerRouteTabIcons:e(Ne))[x]},{default:k(()=>[m(re,{modelValue:e(c)[x],"onUpdate:modelValue":K=>e(c)[x]=K,py0:"",default:{type:"string"}},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1032,["text","icon"]))),128))])]),_:1},8,["modelValue"])],64)}}});export{Lo as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as J}from"./NIconTitle.vue.71113a3f.js";import{_ as Q}from"./NSwitch.vue.8d3010b0.js";import{d as X,ar as Y,bE as Z,aA as ee,aw as A,m,i as n,k as e,F as v,n as U,f as t,j as a,K as le,_ as oe,al as ne,o as r,h as j,t as y,G as F,p as P,v as N,l as c,C as D,B as te,by as ae,bF as se}from"./entry.3dd66f35.js";import{_ as ie}from"./NSelect.vue.e7f8c81a.js";import{_ as de}from"./NCheckbox.vue.cf7e1e9d.js";const ue={px8:"",py6:""},re={grid:"~ md:cols-2 gap-x-10 gap-y-3","max-w-300":""},ce={flex:"~ col gap-2"},pe=e("h3",{"text-lg":""}," Tabs ",-1),me={flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":""},_e={capitalize:"",op75:""},fe=e("div",{"mx--1":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),ve=e("div",{"flex-auto":""},null,-1),ge={flex:"~ col gap-2"},he=e("h3",{"text-lg":""}," Appearance ",-1),be=e("div",{"i-carbon-sun":"","dark:i-carbon-moon":"","translate-y--1px":""},null,-1),xe=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),ye=e("p",null,"UI Scale",-1),Ve=["value"],ke=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),Ce=e("span",null," Expand Sidebar ",-1),we=e("span",null," Scrollable Sidebar ",-1),Te=e("h3",{mt2:"","text-lg":""}," Features ",-1),Se=e("span",null,"Close DevTools when clicking outside",-1),Ue=e("span",null,"Show help buttons",-1),Ne=e("span",null,"Always show the floating panel",-1),Oe=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),Ie=e("p",null,"Minimize floating panel on inactive",-1),$e=["value"],Be=e("h3",{mt2:"","text-lg":""}," Feedback ",-1),De=e("span",null,"Send anonymous statistics, help us improving DevTools",-1),ze=e("div",{"mx--2":"",my1:"","h-1px":"",border:"b base",op75:""},null,-1),Ee={flex:"~ gap-2"},Ae=e("div",{"i-carbon-data-enrichment":""},null,-1),je=e("div",{"i-carbon-debug":""},null,-1),Fe=e("h3",{mt2:"","text-lg":""}," Debug ",-1),Pe={flex:"~ gap-2"},Le=e("div",{"i-carbon-breaking-change":""},null,-1),qe=X({__name:"settings",setup(Me){const{interactionCloseOnOutsideClick:V,showPanel:O,showHelpButtons:I,scale:$,hiddenTabs:g,pinnedTabs:d,hiddenTabCategories:h,minimizePanelInactive:k,sidebarExpanded:C,sidebarScrollable:B}=te(),b=Y(),L=[["Tiny",12/15],["Small",14/15],["Normal",1],["Large",16/15],["Huge",18/15]],M=[["Always",0],["1s",1e3],["2s",2e3],["5s",5e3],["10s",1e4],["Never",-1]],R=Z(ee());function H(s,o){o?g.value=g.value.filter(u=>u!==s):g.value.push(s)}function G(s,o){o?h.value=h.value.filter(u=>u!==s):h.value.push(s)}function K(s){d.value.includes(s)?d.value=d.value.filter(o=>o!==s):d.value.push(s)}function z(s,o){const u=d.value.indexOf(s);if(u===-1)return;const _=u+o;if(_<0||_>=d.value.length)return;const x=[...d.value];x.splice(u,1),x.splice(_,0,s),d.value=x}async function W(){confirm("Are you sure you to reset all local settings & state? The app will reload.")&&(Object.keys(localStorage).forEach(s=>{s.startsWith("nuxt-devtools-")&&localStorage.removeItem(s)}),await le.clearOptions(),b.value?.app?.reload?.(),window.location.reload())}return A(()=>{b.value&&(b.value.app.frameState.value.closeOnOutsideClick=V.value)}),A(()=>{b.value&&(b.value.app.frameState.value.minimizePanelInactive=k.value)}),(s,o)=>{const u=J,_=Q,x=ae,p=oe,w=ne,q=se,E=ie,f=de;return r(),m("div",ue,[n(u,{class:"mb-5 text-xl op75",icon:"i-carbon-settings-adjust",text:"DevTools Settings"}),e("div",re,[e("div",ce,[pe,(r(!0),m(v,null,U(t(R),([l,T])=>(r(),m(v,{key:l},[T.length?(r(),j(w,{key:0,p3:"",flex:"~ col gap-1",class:F(t(h).includes(l)?"op50 grayscale":"")},{default:a(()=>[n(_,{flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-lime":"","model-value":!t(h).includes(l),"onUpdate:modelValue":i=>G(l,i)},{default:a(()=>[e("div",me,[e("span",_e,y(l),1)])]),_:2},1032,["model-value","onUpdate:modelValue"]),fe,(r(!0),m(v,null,U(T,i=>(r(),j(_,{key:i.name,flex:"~ row-reverse",py1:"",pl2:"",pr1:"","n-primary":"","model-value":!t(g).includes(i.name),"onUpdate:modelValue":S=>H(i.name,S)},{default:a(()=>[e("div",{flex:"~ gap-2","flex-auto":"","items-center":"","justify-start":"","pr-4":"",class:F(t(g).includes(i.name)?"op25":"")},[n(x,{"text-xl":"",icon:i.icon,title:i.title},null,8,["icon","title"]),e("span",null,y(i.title),1),ve,t(d).includes(i.name)?(r(),m(v,{key:0},[n(p,{icon:"i-carbon-caret-up",disabled:t(d).indexOf(i.name)===0,border:!1,onClick:S=>z(i.name,-1)},null,8,["disabled","onClick"]),n(p,{icon:"i-carbon-caret-down",disabled:t(d).indexOf(i.name)===t(d).length-1,border:!1,onClick:S=>z(i.name,1)},null,8,["disabled","onClick"])],64)):P("",!0),n(p,{icon:t(d).includes(i.name)?" i-carbon-pin-filled rotate--45":" i-carbon-pin op50",border:!1,onClick:S=>K(i.name)},null,8,["icon","onClick"])],2)]),_:2},1032,["model-value","onUpdate:modelValue"]))),128))]),_:2},1032,["class"])):P("",!0)],64))),128))]),e("div",ge,[he,n(w,{p4:"",flex:"~ col gap-2"},{default:a(()=>[e("div",null,[n(q,null,{default:a(({toggle:l,isDark:T})=>[n(p,{n:"primary",onClick:l},{default:a(()=>[be,N(" "+y(T.value?"Dark":"Light"),1)]),_:2},1032,["onClick"])]),_:1})]),xe,ye,n(E,{modelValue:t($),"onUpdate:modelValue":o[0]||(o[0]=l=>c($)?$.value=l:null),n:"primary"},{default:a(()=>[(r(),m(v,null,U(L,l=>e("option",{key:l[0],value:l[1]},y(l[0]),9,Ve)),64))]),_:1},8,["modelValue"]),ke,n(f,{modelValue:t(C),"onUpdate:modelValue":o[1]||(o[1]=l=>c(C)?C.value=l:null),"n-primary":""},{default:a(()=>[Ce]),_:1},8,["modelValue"]),n(f,{modelValue:t(B),"onUpdate:modelValue":o[2]||(o[2]=l=>c(B)?B.value=l:null),disabled:t(C),"n-primary":""},{default:a(()=>[we]),_:1},8,["modelValue","disabled"])]),_:1}),Te,n(w,{p4:"",flex:"~ col gap-2"},{default:a(()=>[n(f,{modelValue:t(V),"onUpdate:modelValue":o[3]||(o[3]=l=>c(V)?V.value=l:null),"n-primary":""},{default:a(()=>[Se]),_:1},8,["modelValue"]),n(f,{modelValue:t(I),"onUpdate:modelValue":o[4]||(o[4]=l=>c(I)?I.value=l:null),"n-primary":""},{default:a(()=>[Ue]),_:1},8,["modelValue"]),n(f,{modelValue:t(O),"onUpdate:modelValue":o[5]||(o[5]=l=>c(O)?O.value=l:null),"n-primary":""},{default:a(()=>[Ne]),_:1},8,["modelValue"]),Oe,Ie,n(E,{modelValue:t(k),"onUpdate:modelValue":o[6]||(o[6]=l=>c(k)?k.value=l:null),modelModifiers:{number:!0},"n-primary":""},{default:a(()=>[(r(),m(v,null,U(M,l=>e("option",{key:l[0],value:l[1]},y(l[0]),9,$e)),64))]),_:1},8,["modelValue"])]),_:1}),Be,n(w,{p4:"",flex:"~ col gap-2"},{default:a(()=>[n(f,{modelValue:t(D),"onUpdate:modelValue":o[7]||(o[7]=l=>c(D)?D.value=l:null),"n-primary":""},{default:a(()=>[De]),_:1},8,["modelValue"]),ze,e("div",Ee,[n(p,{n:"blue",to:"https://github.com/nuxt/devtools/discussions/29",target:"_blank"},{default:a(()=>[Ae,N(" Ideas & Suggestions ")]),_:1}),n(p,{n:"orange",to:"https://github.com/nuxt/devtools/issues",target:"_blank"},{default:a(()=>[je,N(" Bug Reports ")]),_:1})])]),_:1}),Fe,e("div",Pe,[n(p,{n:"orange",onClick:W},{default:a(()=>[Le,N(" Reset Local Settings & State ")]),_:1})])])])])}}});export{qe as default};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e=Object.freeze({information_for_contributors:["This file has been converted from https://github.com/jeff-hykin/better-shell-syntax/blob/master/autogenerated/shell.tmLanguage.json","If you want to provide a fix or improvement, please create a pull request against the original repository.","Once accepted there, we are happy to receive an update request."],version:"https://github.com/jeff-hykin/better-shell-syntax/commit/a3de7b32f1537194a83ee848838402fbf4b67424",name:"shellscript",scopeName:"source.shell",patterns:[{include:"#initial_context"}],repository:{alias_statement:{begin:"(alias)[ \\t]*+[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",end:"(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",beginCaptures:{1:{name:"storage.type.alias.shell"},2:{name:"storage.modifier.$2.shell"},3:{name:"variable.other.assignment.shell"},4:{name:"punctuation.definition.array.access.shell"},5:{name:"variable.other.assignment.shell"},6:{name:"punctuation.definition.array.access.shell"},7:{name:"keyword.operator.assignment.shell"},8:{name:"keyword.operator.assignment.compound.shell"},9:{name:"keyword.operator.assignment.compound.shell"}},endCaptures:{1:{name:"punctuation.terminator.statement.semicolon.shell"},2:{name:"punctuation.separator.statement.and.shell"},3:{name:"punctuation.separator.statement.or.shell"},4:{name:"punctuation.separator.statement.background.shell"}},name:"meta.expression.assignment.shell",patterns:[{include:"#normal_statement_context"}]},argument:{begin:"[ \\t]++(?!(?:&|\\||\\(|\\[|#|\\n|$|;))",end:"(?= |\\t|;|\\||&|$|\\n|\\)|\\`)",beginCaptures:{},endCaptures:{},name:"meta.argument.shell",patterns:[{include:"#argument_context"},{include:"#line_continuation"}]},argument_context:{patterns:[{match:`[ \\t]*+([^
|
|
2
|
+
'&;<>\\(\\)\\$\`\\\\"\\|]+(?!>))`,captures:{1:{name:"string.unquoted.argument.shell",patterns:[{match:"\\*",name:"variable.language.special.wildcard.shell"},{include:"#variable"},{include:"#numeric_literal"},{match:"(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)",captures:{1:{name:"constant.language.$1.shell"}}}]}}},{include:"#normal_statement_context"}]},assignment:{patterns:[{begin:"[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))[ \\t]*+(\\()",end:"\\)",beginCaptures:{1:{name:"storage.modifier.$1.shell"},2:{name:"variable.other.assignment.shell"},3:{name:"punctuation.definition.array.access.shell"},4:{name:"variable.other.assignment.shell"},5:{name:"punctuation.definition.array.access.shell"},6:{name:"keyword.operator.assignment.shell"},7:{name:"keyword.operator.assignment.compound.shell"},8:{name:"keyword.operator.assignment.compound.shell"},9:{name:"punctuation.shell"}},endCaptures:{0:{name:"punctuation.shell"}},name:"meta.expression.assignment.shell",patterns:[{include:"#comment"},{include:"#argument_context"}]},{begin:"[ \\t]*+(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))[ \\t]*+)?((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?:(\\[)((?:(?:(?:\\$)?(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)|@)|\\*))(\\]))?(?:(?:(\\=)|(\\+\\=))|(\\-\\=))",end:"(?:(?= |\\t|$)|(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n))",beginCaptures:{1:{name:"storage.modifier.$1.shell"},2:{name:"variable.other.assignment.shell"},3:{name:"punctuation.definition.array.access.shell"},4:{name:"variable.other.assignment.shell"},5:{name:"punctuation.definition.array.access.shell"},6:{name:"keyword.operator.assignment.shell"},7:{name:"keyword.operator.assignment.compound.shell"},8:{name:"keyword.operator.assignment.compound.shell"}},endCaptures:{1:{name:"punctuation.terminator.statement.semicolon.shell"},2:{name:"punctuation.separator.statement.and.shell"},3:{name:"punctuation.separator.statement.or.shell"},4:{name:"punctuation.separator.statement.background.shell"}},name:"meta.expression.assignment.shell",patterns:[{include:"#comment"},{include:"#argument_context"}]}]},basic_command_name:{match:`(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?:((?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$))|((?!"|'|\\\\\\n?$)[^!'" \\t\\n\\r]+?))(?:(?= |\\t)|(?=;|\\||&|\\n|\\)|\\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))`,captures:{1:{name:"storage.modifier.$1.shell"},2:{name:"entity.name.function.call.shell entity.name.command.shell",patterns:[{match:"(?<!\\w)(?:continue|return|break)(?!\\w)",name:"keyword.control.$0.shell"},{match:"(?<!\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",name:"support.function.builtin.shell"},{include:"#variable"}]}},name:"meta.statement.command.name.basic.shell"},block_comment:{begin:"\\s*+(\\/\\*)",end:"\\*\\/",beginCaptures:{1:{name:"punctuation.definition.comment.begin.shell"}},endCaptures:{0:{name:"punctuation.definition.comment.end.shell"}},name:"comment.block.shell"},boolean:{match:"\\b(?:true|false)\\b",name:"constant.language.$0.shell"},"case-clause":{patterns:[{begin:"(?=\\S)",end:";;&?|;&",endCaptures:{0:{name:"punctuation.terminator.case-clause.shell"}},name:"meta.scope.case-clause.shell",patterns:[{begin:"\\(|(?=\\S)",beginCaptures:{0:{name:"punctuation.definition.case-pattern.shell"}},end:"\\)",endCaptures:{0:{name:"punctuation.definition.case-pattern.shell"}},name:"meta.scope.case-pattern.shell",patterns:[{match:"\\|",name:"punctuation.separator.pipe-sign.shell"},{include:"#string"},{include:"#variable"},{include:"#interpolation"},{include:"#pathname"}]},{begin:"(?<=\\))",end:"(?=;;&?|;&)",name:"meta.scope.case-clause-body.shell",patterns:[{include:"#initial_context"}]}]}]},comment:{match:"(?:^|[ \\t]++)(?:((#!).*)|((#).*))",captures:{1:{name:"comment.line.number-sign.shell meta.shebang.shell"},2:{name:"punctuation.definition.comment.shebang.shell"},3:{name:"comment.line.number-sign.shell"},4:{name:"punctuation.definition.comment.shell"}}},comments:{patterns:[{include:"#block_comment"},{include:"#line_comment"}]},"compound-command":{patterns:[{begin:"\\[{1,2}",beginCaptures:{0:{name:"punctuation.definition.logical-expression.shell"}},end:"\\]{1,2}",endCaptures:{0:{name:"punctuation.definition.logical-expression.shell"}},name:"meta.scope.logical-expression.shell",patterns:[{include:"#logical-expression"},{include:"#initial_context"}]},{begin:"\\({2}",beginCaptures:{0:{name:"punctuation.definition.string.begin.shell"}},end:"\\){2}",endCaptures:{0:{name:"punctuation.definition.string.end.shell"}},name:"string.other.math.shell",patterns:[{include:"#math"}]},{begin:"\\(",beginCaptures:{0:{name:"punctuation.definition.subshell.shell"}},end:"\\)",endCaptures:{0:{name:"punctuation.definition.subshell.shell"}},name:"meta.scope.subshell.shell",patterns:[{include:"#initial_context"}]},{begin:"(?<=\\s|^){(?=\\s|$)",beginCaptures:{0:{name:"punctuation.definition.group.shell"}},end:"(?<=^|;)\\s*(})",endCaptures:{1:{name:"punctuation.definition.group.shell"}},name:"meta.scope.group.shell",patterns:[{include:"#initial_context"}]}]},continuation_of_double_quoted_command_name:{begin:'\\G(?<=")',end:'"',beginCaptures:{},endCaptures:{0:{name:"string.quoted.double.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},contentName:"meta.statement.command.name.continuation string.quoted.double entity.name.function.call entity.name.command",patterns:[{match:'\\\\[\\$\\n`"\\\\]',name:"constant.character.escape.shell"},{include:"#variable"},{include:"#interpolation"}]},continuation_of_single_quoted_command_name:{begin:"\\G(?<=')",end:"'",beginCaptures:{},endCaptures:{0:{name:"string.quoted.single.shell punctuation.definition.string.end.shell entity.name.function.call.shell entity.name.command.shell"}},contentName:"meta.statement.command.name.continuation string.quoted.single entity.name.function.call entity.name.command"},custom_command_names:{patterns:[]},custom_commands:{patterns:[]},double_quote_context:{patterns:[{match:'\\\\[\\$`"\\\\\\n]',name:"constant.character.escape.shell"},{include:"#variable"},{include:"#interpolation"}]},double_quote_escape_char:{match:'\\\\[\\$`"\\\\\\n]',name:"constant.character.escape.shell"},function_definition:{begin:"[ \\t]*+(?:(\\bfunction\\b)[ \\t]*+([^ \\t\\n\\r\\(\\)=]+)(?:(\\()[ \\t]*+(\\)))?|([^ \\t\\n\\r\\(\\)=]+)[ \\t]*+(\\()[ \\t]*+(\\)))",end:"(?<=\\}|\\))",beginCaptures:{1:{name:"storage.type.function.shell"},2:{name:"entity.name.function.shell"},3:{name:"punctuation.definition.arguments.shell"},4:{name:"punctuation.definition.arguments.shell"},5:{name:"entity.name.function.shell"},6:{name:"punctuation.definition.arguments.shell"},7:{name:"punctuation.definition.arguments.shell"}},endCaptures:{},name:"meta.function.shell",patterns:[{match:"\\G(?:\\t| |\\n)"},{begin:"\\{",end:"\\}",beginCaptures:{0:{name:"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},endCaptures:{0:{name:"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},name:"meta.function.body.shell",patterns:[{include:"#initial_context"}]},{begin:"\\(",end:"\\)",beginCaptures:{0:{name:"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},endCaptures:{0:{name:"punctuation.definition.group.shell punctuation.section.function.definition.shell"}},name:"meta.function.body.shell",patterns:[{include:"#initial_context"}]}],applyEndPatternLast:1},heredoc:{patterns:[{begin:`((?<!<)<<-)[ \\t]*+("|')[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|"|')(?:\\2)(.*)`,end:"^\\t*(?:\\3)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.operator.heredoc.shell"},2:{},3:{name:"punctuation.definition.string.heredoc.shell"},4:{patterns:[{include:"#normal_statement_context"}]}},endCaptures:{0:{name:"punctuation.definition.string.heredoc.shell"}},contentName:"string.quoted.heredoc.indent",patterns:[]},{begin:`((?<!<)<<(?!<))[ \\t]*+("|')[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|"|')(?:\\2)(.*)`,end:"^(?:\\3)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.operator.heredoc.shell"},2:{},3:{name:"punctuation.definition.string.heredoc.shell"},4:{patterns:[{include:"#normal_statement_context"}]}},endCaptures:{0:{name:"punctuation.definition.string.heredoc.shell"}},contentName:"string.quoted.heredoc.no-indent",patterns:[]},{begin:`((?<!<)<<-)[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|"|')(.*)`,end:"^\\t*(?:\\2)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.operator.heredoc.shell"},2:{name:"punctuation.definition.string.heredoc.shell"},3:{patterns:[{include:"#normal_statement_context"}]}},endCaptures:{0:{name:"punctuation.definition.string.heredoc.shell"}},contentName:"string.unquoted.heredoc.indent",patterns:[{include:"#double_quote_escape_char"},{include:"#variable"},{include:"#interpolation"}]},{begin:`((?<!<)<<(?!<))[ \\t]*+((?<!\\w)[a-zA-Z_0-9-]+(?!\\w))(?=\\s|;|&|<|"|')(.*)`,end:"^(?:\\2)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.operator.heredoc.shell"},2:{name:"punctuation.definition.string.heredoc.shell"},3:{patterns:[{include:"#normal_statement_context"}]}},endCaptures:{0:{name:"punctuation.definition.string.heredoc.shell"}},contentName:"string.unquoted.heredoc.no-indent",patterns:[{include:"#double_quote_escape_char"},{include:"#variable"},{include:"#interpolation"}]}]},herestring:{patterns:[{begin:"(<<<)\\s*(('))",beginCaptures:{1:{name:"keyword.operator.herestring.shell"},2:{name:"string.quoted.single.shell"},3:{name:"punctuation.definition.string.begin.shell"}},end:"(')",endCaptures:{0:{name:"string.quoted.single.shell"},1:{name:"punctuation.definition.string.end.shell"}},name:"meta.herestring.shell",contentName:"string.quoted.single.shell"},{begin:'(<<<)\\s*(("))',beginCaptures:{1:{name:"keyword.operator.herestring.shell"},2:{name:"string.quoted.double.shell"},3:{name:"punctuation.definition.string.begin.shell"}},end:'(")',endCaptures:{0:{name:"string.quoted.double.shell"},1:{name:"punctuation.definition.string.end.shell"}},name:"meta.herestring.shell",contentName:"string.quoted.double.shell",patterns:[{include:"#double_quote_context"}]},{captures:{1:{name:"keyword.operator.herestring.shell"},2:{name:"string.unquoted.herestring.shell",patterns:[{include:"#initial_context"}]}},match:"(<<<)\\s*(([^\\s)\\\\]|\\\\.)+)",name:"meta.herestring.shell"}]},initial_context:{patterns:[{include:"#comment"},{include:"#pipeline"},{include:"#normal_statement_seperator"},{include:"#logical_expression_double"},{include:"#logical_expression_single"},{include:"#misc_ranges"},{include:"#loop"},{include:"#function_definition"},{include:"#variable"},{include:"#interpolation"},{include:"#heredoc"},{include:"#herestring"},{include:"#redirection"},{include:"#pathname"},{include:"#keyword"},{include:"#alias_statement"},{include:"#normal_statement"},{include:"#string"},{include:"#support"}]},inline_comment:{match:"(\\/\\*)((?:[^\\*]|(?:\\*)++[^\\/])*+((?:\\*)++\\/))",captures:{1:{name:"comment.block.shell punctuation.definition.comment.begin.shell"},2:{name:"comment.block.shell"},3:{patterns:[{match:"\\*\\/",name:"comment.block.shell punctuation.definition.comment.end.shell"},{match:"\\*",name:"comment.block.shell"}]}}},interpolation:{patterns:[{begin:"\\$\\({2}",beginCaptures:{0:{name:"punctuation.definition.evaluation.arithmetic.begin.shell"}},end:"\\)\\s*\\)",endCaptures:{0:{name:"punctuation.definition.evaluation.arithmetic.end.shell"}},name:"string.other.math.shell",patterns:[{include:"#math"}]},{begin:"`",beginCaptures:{0:{name:"punctuation.definition.evaluation.backticks.shell"}},end:"`",endCaptures:{0:{name:"punctuation.definition.evaluation.backticks.shell"}},name:"string.interpolated.backtick.shell",patterns:[{match:"\\\\[`\\\\$]",name:"constant.character.escape.shell"},{begin:"(?<=\\W)(?=#)(?!#{)",beginCaptures:{1:{name:"punctuation.whitespace.comment.leading.shell"}},end:"(?!\\G)",patterns:[{begin:"#",beginCaptures:{0:{name:"punctuation.definition.comment.shell"}},end:"(?=`)",name:"comment.line.number-sign.shell"}]},{include:"#initial_context"}]},{begin:"\\$\\(",beginCaptures:{0:{name:"punctuation.definition.evaluation.parens.begin.shell"}},end:"\\)",endCaptures:{0:{name:"punctuation.definition.evaluation.parens.end.shell"}},name:"string.interpolated.dollar.shell",patterns:[{include:"#initial_context"}]}]},keyword:{patterns:[{match:"(?<=^|;|&| |\\t)(?:continue|foreach|return|select|repeat|break|until|while|case|done|elif|else|esac|then|for|end|do|if|fi|in)(?= |\\t|;|&|$)",name:"keyword.control.$0.shell"}]},line_comment:{begin:"\\s*+(\\/\\/)",end:"(?<=\\n)(?<!\\\\\\n)",beginCaptures:{1:{name:"punctuation.definition.comment.shell"}},endCaptures:{},name:"comment.line.double-slash.shell",patterns:[{include:"#line_continuation_character"}]},line_continuation:{match:"\\\\(?=\\n)",name:"constant.character.escape.line-continuation.shell"},"logical-expression":{patterns:[{comment:"do we want a special rule for ( expr )?",match:"=[=~]?|!=?|<|>|&&|\\|\\|",name:"keyword.operator.logical.shell"},{match:"(?<!\\S)-(nt|ot|ef|eq|ne|l[te]|g[te]|[a-hknoprstuwxzOGLSN])\\b",name:"keyword.operator.logical.shell"}]},logical_expression_context:{patterns:[{include:"#regex_comparison"},{include:"#logical-expression"},{include:"#logical_expression_single"},{include:"#logical_expression_double"},{include:"#comment"},{include:"#boolean"},{include:"#redirect_number"},{include:"#numeric_literal"},{include:"#pipeline"},{include:"#normal_statement_seperator"},{include:"#string"},{include:"#variable"},{include:"#interpolation"},{include:"#heredoc"},{include:"#herestring"},{include:"#pathname"},{include:"#keyword"},{include:"#support"}]},logical_expression_double:{begin:"\\[\\[",end:"\\]\\]",beginCaptures:{0:{name:"punctuation.definition.logical-expression.shell"}},endCaptures:{0:{name:"punctuation.definition.logical-expression.shell"}},name:"meta.scope.logical-expression.shell",patterns:[{include:"#logical_expression_context"}]},logical_expression_single:{begin:"\\[",end:"\\]",beginCaptures:{0:{name:"punctuation.definition.logical-expression.shell"}},endCaptures:{0:{name:"punctuation.definition.logical-expression.shell"}},name:"meta.scope.logical-expression.shell",patterns:[{include:"#logical_expression_context"}]},loop:{patterns:[{begin:"(?<=^|;|&|\\s)(for)\\s+(?=\\({2})",beginCaptures:{1:{name:"keyword.control.shell"}},end:"(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",endCaptures:{0:{name:"keyword.control.shell"}},name:"meta.scope.for-loop.shell",patterns:[{include:"#initial_context"}]},{begin:"(?<=^|;|&|\\s)(for)\\s+(.+?)\\s+(in)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.control.shell"},2:{name:"variable.other.loop.shell",patterns:[{include:"#string"}]},3:{name:"keyword.control.shell"}},end:"(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",endCaptures:{0:{name:"keyword.control.shell"}},name:"meta.scope.for-in-loop.shell",patterns:[{include:"#initial_context"}]},{begin:"(?<=^|;|&|\\s)(while|until)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.control.shell"}},end:"(?<=^|;|&|\\s)done(?=\\s|;|&|$|\\))",endCaptures:{0:{name:"keyword.control.shell"}},name:"meta.scope.while-loop.shell",patterns:[{include:"#initial_context"}]},{begin:"(?<=^|;|&|\\s)(select)\\s+((?:[^\\s\\\\]|\\\\.)+)(?=\\s|;|&|$)",beginCaptures:{1:{name:"keyword.control.shell"},2:{name:"variable.other.loop.shell"}},end:"(?<=^|;|&|\\s)(done)(?=\\s|;|&|$|\\))",endCaptures:{1:{name:"keyword.control.shell"}},name:"meta.scope.select-block.shell",patterns:[{include:"#initial_context"}]},{begin:"(?<=^|;|&|\\s)case(?=\\s|;|&|$)",beginCaptures:{0:{name:"keyword.control.shell"}},end:"(?<=^|;|&|\\s)esac(?=\\s|;|&|$)",endCaptures:{0:{name:"keyword.control.shell"}},name:"meta.scope.case-block.shell",patterns:[{begin:"(?<=^|;|&|\\s)in(?=\\s|;|&|$)",beginCaptures:{0:{name:"keyword.control.shell"}},end:"(?<=^|;|&|\\s)(?=esac(\\s|;|&|$))",name:"meta.scope.case-body.shell",patterns:[{include:"#comment"},{include:"#case-clause"}]},{include:"#initial_context"}]},{begin:"(?<=^|;|&|\\s)if(?=\\s|;|&|$)",beginCaptures:{0:{name:"keyword.control.shell"}},end:"(?<=^|;|&|\\s)fi(?=\\s|;|&|$)",endCaptures:{0:{name:"keyword.control.shell"}},name:"meta.scope.if-block.shell",patterns:[{include:"#initial_context"}]}]},math:{patterns:[{include:"#variable"},{match:"\\+{1,2}|-{1,2}|!|~|\\*{1,2}|/|%|<[<=]?|>[>=]?|==|!=|^|\\|{1,2}|&{1,2}|\\?|\\:|,|=|[*/%+\\-&^|]=|<<=|>>=",name:"keyword.operator.arithmetic.shell"},{match:"0[xX][0-9A-Fa-f]+",name:"constant.numeric.hex.shell"},{match:"0\\d+",name:"constant.numeric.octal.shell"},{match:"\\d{1,2}#[0-9a-zA-Z@_]+",name:"constant.numeric.other.shell"},{match:"\\d+",name:"constant.numeric.integer.shell"}]},misc_ranges:{patterns:[{include:"#logical_expression_single"},{include:"#logical_expression_double"},{begin:"\\(\\(",end:"\\)\\)",beginCaptures:{0:{name:"punctuation.section.arithmetic.shell"}},endCaptures:{0:{name:"punctuation.section.arithmetic.shell"}},name:"meta.arithmetic.shell",patterns:[{include:"#math"}]},{begin:"(?<!=)\\(",end:"\\)",beginCaptures:{0:{name:"punctuation.definition.subshell"}},endCaptures:{0:{name:"punctuation.definition.subshell"}},name:"meta.scope.subshell",patterns:[{include:"#initial_context"}]},{begin:"(?<![^ \\t])({)",end:"}",beginCaptures:{1:{name:"punctuation.definition.group.shell"}},endCaptures:{0:{name:"punctuation.definition.group.shell"}},name:"meta.scope.group.shell",patterns:[{include:"#initial_context"}]}]},modifiers:{match:"(?<=^|;|&|[ \\t])(?:readonly|declare|typeset|export|local)(?=[ \\t]|;|&|$)",name:"storage.modifier.$0.shell"},normal_statement:{begin:"(?!^[ \\t]*+$)(?:(?<=^until | until |\\tuntil |^while | while |\\twhile |^elif | elif |\\telif |^else | else |\\telse |^then | then |\\tthen |^do | do |\\tdo |^if | if |\\tif )|(?<=(?:^|;|\\||&|!|\\(|\\{|\\`)))[ \\t]*+(?!nocorrect\\W|nocorrect\\$|function\\W|function\\$|foreach\\W|foreach\\$|repeat\\W|repeat\\$|logout\\W|logout\\$|coproc\\W|coproc\\$|select\\W|select\\$|while\\W|while\\$|pushd\\W|pushd\\$|until\\W|until\\$|case\\W|case\\$|done\\W|done\\$|elif\\W|elif\\$|else\\W|else\\$|esac\\W|esac\\$|popd\\W|popd\\$|then\\W|then\\$|time\\W|time\\$|for\\W|for\\$|end\\W|end\\$|fi\\W|fi\\$|do\\W|do\\$|in\\W|in\\$|if\\W|if\\$)",end:"(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",beginCaptures:{},endCaptures:{},name:"meta.statement.shell",patterns:[{include:"#function_definition"},{include:"#assignment"},{begin:"[ \\t]*+(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?!\\\\\\n?$)",end:"(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\)",beginCaptures:{},endCaptures:{},name:"meta.statement.command.shell",patterns:[{begin:"\\G",end:"(?= |\\t|;|\\||&|$|\\n|\\)|\\`)",beginCaptures:{},endCaptures:{},name:"meta.statement.command.name.shell",patterns:[{include:"#modifiers"},{match:"(?<!\\w)(?:continue|return|break)(?!\\w)",name:"entity.name.function.call.shell entity.name.command.shell keyword.control.$0.shell"},{match:"(?<!\\w)(?:unfunction|continue|autoload|unsetopt|bindkey|builtin|getopts|command|declare|unalias|history|unlimit|typeset|suspend|source|printf|unhash|disown|ulimit|return|which|alias|break|false|print|shift|times|umask|umask|unset|read|type|exec|eval|wait|echo|dirs|jobs|kill|hash|stat|exit|test|trap|true|let|set|pwd|cd|fg|bg|fc|:|\\.)(?!\\/)(?!\\w)",name:"entity.name.function.call.shell entity.name.command.shell support.function.builtin.shell"},{include:"#variable"},{match:`(?<=\\G|'|"|\\}|\\))([^ \\n\\t\\r"'=;&\\|\`\\)\\{]+)`,captures:{1:{name:"entity.name.function.call.shell entity.name.command.shell"}}},{begin:`(?:\\G|(?<! |\\t|;|\\||&|\\n|\\{|#))((?:\\$)?)((?:(")|(')))`,end:"(?<!\\G)(?<=(?:\\2))",beginCaptures:{1:{name:"meta.statement.command.name.quoted.shell punctuation.definition.string.shell entity.name.function.call.shell entity.name.command.shell"},2:{},3:{name:"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},4:{name:"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"}},endCaptures:{},patterns:[{include:"#continuation_of_single_quoted_command_name"},{include:"#continuation_of_double_quoted_command_name"}]},{include:"#line_continuation"}]},{include:"#line_continuation"},{include:"#option"},{include:"#argument"},{include:"#statement_context"},{include:"#string"}]},{include:"#line_continuation"},{include:"#normal_statement_context"}]},normal_statement_context:{patterns:[{include:"#comment"},{include:"#pipeline"},{include:"#normal_statement_seperator"},{include:"#misc_ranges"},{include:"#boolean"},{include:"#redirect_number"},{include:"#numeric_literal"},{include:"#string"},{include:"#variable"},{include:"#interpolation"},{include:"#heredoc"},{include:"#herestring"},{include:"#redirection"},{include:"#pathname"},{include:"#keyword"},{include:"#support"}]},normal_statement_seperator:{match:"(?:(?:(?:(?:(;)|(&&))|(\\|\\|))|(&))|\\n)",captures:{1:{name:"punctuation.terminator.statement.semicolon.shell"},2:{name:"punctuation.separator.statement.and.shell"},3:{name:"punctuation.separator.statement.or.shell"},4:{name:"punctuation.separator.statement.background.shell"}}},numeric_literal:{match:"[ \\t]*+(?<==| |\\t|^|\\{|\\(|\\[)(?:(?:(?:(?:(0[xX][0-9A-Fa-f]+)|(0\\d+))|(\\d{1,2}#[0-9a-zA-Z@_]+))|(-?\\d+\\.\\d+))|(-?\\d+))(?!>)",captures:{1:{name:"constant.numeric.shell constant.numeric.hex.shell"},2:{name:"constant.numeric.shell constant.numeric.octal.shell"},3:{name:"constant.numeric.shell constant.numeric.other.shell"},4:{name:"constant.numeric.shell constant.numeric.integer.shell"},5:{name:"constant.numeric.shell constant.numeric.integer.shell"}}},option:{begin:"[ \\t]++(-)((?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t])))",end:"(?:(?=[ \\t])|(?=;|\\||&|\\n|\\)|\\`|\\{|\\}|[ \\t]*#|\\])(?<!\\\\))",beginCaptures:{1:{name:"string.unquoted.argument.shell constant.other.option.dash.shell"},2:{name:"string.unquoted.argument.shell constant.other.option.shell"}},endCaptures:{},contentName:"string.unquoted.argument constant.other.option",patterns:[{include:"#option_context"}]},option_context:{patterns:[{include:"#misc_ranges"},{include:"#string"},{include:"#variable"},{include:"#interpolation"},{include:"#heredoc"},{include:"#herestring"},{include:"#redirection"},{include:"#pathname"},{include:"#keyword"},{include:"#support"}]},pathname:{patterns:[{match:"(?<=\\s|:|=|^)~",name:"keyword.operator.tilde.shell"},{match:"\\*|\\?",name:"keyword.operator.glob.shell"},{begin:"([?*+@!])(\\()",beginCaptures:{1:{name:"keyword.operator.extglob.shell"},2:{name:"punctuation.definition.extglob.shell"}},end:"\\)",endCaptures:{0:{name:"punctuation.definition.extglob.shell"}},name:"meta.structure.extglob.shell",patterns:[{include:"#initial_context"}]}]},pipeline:{patterns:[{match:"(?<=^|;|&|\\s)(time)(?=\\s|;|&|$)",name:"keyword.other.shell"},{match:"[|!]",name:"keyword.operator.pipe.shell"}]},redirect_number:{match:"(?<=[ \\t])(?:(1)|(2)|(\\d+))(?=>)",captures:{1:{name:"keyword.operator.redirect.stdout.shell"},2:{name:"keyword.operator.redirect.stderr.shell"},3:{name:"keyword.operator.redirect.$3.shell"}}},redirection:{patterns:[{begin:"[><]\\(",beginCaptures:{0:{name:"punctuation.definition.string.begin.shell"}},end:"\\)",endCaptures:{0:{name:"punctuation.definition.string.end.shell"}},name:"string.interpolated.process-substitution.shell",patterns:[{include:"#initial_context"}]},{match:"(?<![<>])(&>|\\d*>&\\d*|\\d*(>>|>|<)|\\d*<&|\\d*<>)(?![<>])",name:"keyword.operator.redirect.shell"}]},regex_comparison:{match:"\\=~",name:"keyword.operator.logical.regex.shell"},regexp:{patterns:[{match:".+"}]},simple_options:{match:"(?:[ \\t]++\\-\\w+)*",captures:{0:{patterns:[{match:"[ \\t]++(\\-)(\\w+)",captures:{1:{name:"string.unquoted.argument.shell constant.other.option.dash.shell"},2:{name:"string.unquoted.argument.shell constant.other.option.shell"}}}]}}},start_of_command:{match:"[ \\t]*+(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?!foreach\\b(?!\\/)|select\\b(?!\\/)|repeat\\b(?!\\/)|until\\b(?!\\/)|while\\b(?!\\/)|case\\b(?!\\/)|done\\b(?!\\/)|elif\\b(?!\\/)|else\\b(?!\\/)|esac\\b(?!\\/)|then\\b(?!\\/)|for\\b(?!\\/)|end\\b(?!\\/)|in\\b(?!\\/)|fi\\b(?!\\/)|do\\b(?!\\/)|if\\b(?!\\/))(?!\\\\\\n?$)"},start_of_double_quoted_command_name:{match:`(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?:[ \\t]*+([^
|
|
3
|
+
'&;<>\\(\\)\\$\`\\\\"\\|]+(?!>)))?(?:(?:\\$")|")`,captures:{1:{name:"entity.name.function.call.shell entity.name.command.shell",patterns:[{match:"\\*",name:"variable.language.special.wildcard.shell"},{include:"#variable"},{include:"#numeric_literal"},{match:"(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)",captures:{1:{name:"constant.language.$1.shell"}}}]}},name:"meta.statement.command.name.quoted.shell string.quoted.double.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},start_of_single_quoted_command_name:{match:`(?!(?:!|&|\\||\\(|\\)|\\{|\\[|<|>|#|\\n|$|;|[ \\t]))(?:[ \\t]*+([^
|
|
4
|
+
'&;<>\\(\\)\\$\`\\\\"\\|]+(?!>)))?(?:(?:\\$')|')`,captures:{1:{name:"entity.name.function.call.shell entity.name.command.shell",patterns:[{match:"\\*",name:"variable.language.special.wildcard.shell"},{include:"#variable"},{include:"#numeric_literal"},{match:"(?<!\\w)(\\b(?:true|false)\\b)(?!\\w)",captures:{1:{name:"constant.language.$1.shell"}}}]}},name:"meta.statement.command.name.quoted.shell string.quoted.single.shell punctuation.definition.string.begin.shell entity.name.function.call.shell entity.name.command.shell"},string:{patterns:[{match:"\\\\.",name:"constant.character.escape.shell"},{begin:"'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin.shell"}},endCaptures:{0:{name:"punctuation.definition.string.end.shell"}},name:"string.quoted.single.shell"},{begin:'\\$?"',end:'"',beginCaptures:{0:{name:"punctuation.definition.string.begin.shell"}},endCaptures:{0:{name:"punctuation.definition.string.end.shell"}},name:"string.quoted.double.shell",patterns:[{match:'\\\\[\\$\\n`"\\\\]',name:"constant.character.escape.shell"},{include:"#variable"},{include:"#interpolation"}]},{begin:"\\$'",end:"'",beginCaptures:{0:{name:"punctuation.definition.string.begin.shell"}},endCaptures:{0:{name:"punctuation.definition.string.end.shell"}},name:"string.quoted.single.dollar.shell",patterns:[{match:"\\\\(?:a|b|e|f|n|r|t|v|\\\\|')",name:"constant.character.escape.ansi-c.shell"},{match:'\\\\[0-9]{3}"',name:"constant.character.escape.octal.shell"},{match:'\\\\x[0-9a-fA-F]{2}"',name:"constant.character.escape.hex.shell"},{match:'\\\\c."',name:"constant.character.escape.control-char.shell"}]}]},support:{patterns:[{match:"(?<=^|;|&|\\s)(?::|\\.)(?=\\s|;|&|$)",name:"support.function.builtin.shell"}]},variable:{patterns:[{match:"(\\$)(\\@(?!\\w))",captures:{1:{name:"punctuation.definition.variable.shell variable.parameter.positional.all.shell"},2:{name:"variable.parameter.positional.all.shell"}}},{match:"(\\$)([0-9](?!\\w))",captures:{1:{name:"punctuation.definition.variable.shell variable.parameter.positional.shell"},2:{name:"variable.parameter.positional.shell"}}},{match:"(\\$)([-*#?$!0_](?!\\w))",captures:{1:{name:"punctuation.definition.variable.shell variable.language.special.shell"},2:{name:"variable.language.special.shell"}}},{begin:"(\\$)(\\{)[ \\t]*+(?=\\d)",end:"\\}",beginCaptures:{1:{name:"punctuation.definition.variable.shell variable.parameter.positional.shell"},2:{name:"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},endCaptures:{0:{name:"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell variable.parameter.positional.shell"}},contentName:"meta.parameter-expansion",patterns:[{match:"!|:[-=?]?|\\*|@|##|#|%%|%|\\/",name:"keyword.operator.expansion.shell"},{match:"(\\[)[^\\]]+(\\])",captures:{1:{name:"punctuation.section.array.shell"},2:{name:"punctuation.section.array.shell"}}},{match:"[0-9]+",name:"variable.parameter.positional.shell"},{match:"(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)",name:"variable.other.normal.shell"},{include:"#variable"},{include:"#string"}]},{begin:"(\\$)(\\{)",end:"\\}",beginCaptures:{1:{name:"punctuation.definition.variable.shell"},2:{name:"punctuation.section.bracket.curly.variable.begin.shell punctuation.definition.variable.shell"}},endCaptures:{0:{name:"punctuation.section.bracket.curly.variable.end.shell punctuation.definition.variable.shell"}},contentName:"meta.parameter-expansion",patterns:[{match:"!|:[-=?]?|\\*|@|##|#|%%|%|\\/",name:"keyword.operator.expansion.shell"},{match:"(\\[)[^\\]]+(\\])",captures:{1:{name:"punctuation.section.array.shell"},2:{name:"punctuation.section.array.shell"}}},{match:"(?<!\\w)[a-zA-Z_0-9-]+(?!\\w)",name:"variable.other.normal.shell"},{include:"#variable"},{include:"#string"}]},{match:"(\\$)(\\w+(?!\\w))",captures:{1:{name:"punctuation.definition.variable.shell variable.other.normal.shell"},2:{name:"variable.other.normal.shell"}}}]}},displayName:"Shell",aliases:["bash","sh","shell","zsh"]});var n=[e];export{n as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{ar as m,b3 as n,a as s,K as o}from"./entry.3dd66f35.js";function r(){const p=m(),t=n("getComponents",()=>o.getComponents()),l=s(()=>Object.entries(p.value?.nuxt?.vueApp._context.components||{}).map(([e])=>({pascalName:e,global:!0})).filter(e=>!/^Lazy[A-Z]/.test(e.pascalName)).filter(e=>!(t.value||[]).find(a=>a.pascalName===e.pascalName)));return s(()=>[...l.value,...t.value||[]].sort((e,a)=>e.pascalName.localeCompare(a.pascalName)))}function u(){return n("getComponentsRelationships",()=>o.getComponentsRelationships())}export{u as a,r as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as F}from"./NBadge.e849763e.js";import{_ as L}from"./NCodeBlock.vue.882d562f.js";import{_ as A}from"./NCheckbox.vue.cf7e1e9d.js";import{_ as E}from"./NTip.vue.3f5fb5a1.js";import{d as G,O,b4 as Q,r as V,b5 as W,M as X,Q as q,o as m,m as g,a7 as z,f as t,t as $,p as w,F as M,i as s,h as H,j as u,k as h,l as B,v as p,_ as J,X as K,b6 as Y,a9 as Z,a as ee,ao as te,ap as ae,b7 as se,b3 as ne}from"./entry.3dd66f35.js";const oe={key:0},le={p4:"",flex:"~ col gap-1"},re={class:"text-lg font-medium leading-6"},ue=h("p",{op50:""}," The following command will be executed in your terminal: ",-1),ie={flex:"~ gap-3",mt2:"","justify-end":""},ve=G({__name:"NpmVersionCheck",props:{packageName:{},options:{},showVersion:{type:Boolean,default:!0}},setup(l){const a=l,e=O(),{info:n,update:i,state:y,processId:k,restart:c}=Q(a.packageName,a.options),f=V(!0),_=V(!0),U=W(),b=X(),R=q();async function C(){const r=await i(async o=>b.start(o));r&&_.value&&U.value.push({id:r,message:`${a.packageName} has been updated. Do you want to restart the Nuxt server now?`}),r&&f.value&&(R.value=r,e.push("/modules/terminals"))}return(r,o)=>{const N=F,S=L,x=A,T=E,P=J,j=K;return m(),g(M,null,[z(r.$slots,"default",{id:t(k),info:t(n),update:C,state:t(y),restart:t(c)},()=>[t(n)&&r.showVersion?(m(),g("code",oe,$(`v${t(n).current}`),1)):w("",!0),t(n)?.latest?(m(),g(M,{key:1},[t(n).needsUpdate?(m(),g("button",{key:0,onClick:o[0]||(o[0]=v=>C())},[s(N,{n:"green",title:"updates available",textContent:"updates available"})])):(m(),H(N,{key:1,n:"gray",title:"latest",textContent:"latest"}))],64)):w("",!0)]),s(t(b),null,{default:u(({resolve:v,args:I})=>[s(j,{"model-value":!0,onClose:d=>v(!1)},{default:u(()=>[h("div",le,[h("h3",re," Update "+$(a.packageName)+"? ",1),ue,s(S,{code:I[0],lang:"bash",my3:"",px4:"",py2:"",border:"~ base rounded",lines:!1},null,8,["code"]),s(x,{modelValue:t(f),"onUpdate:modelValue":o[1]||(o[1]=d=>B(f)?f.value=d:null),n:"primary"},{default:u(()=>[p(" Navigate to terminal ")]),_:1},8,["modelValue"]),s(x,{modelValue:t(_),"onUpdate:modelValue":o[2]||(o[2]=d=>B(_)?_.value=d:null),n:"primary"},{default:u(()=>[p(" Restart Nuxt server after update ")]),_:1},8,["modelValue"]),h("div",ie,[s(T,{n:"sm amber","flex-auto":"",icon:"i-carbon-data-backup"},{default:u(()=>[p(" Please make sure to backup your project first. ")]),_:1}),s(P,{onClick:d=>v(!1)},{default:u(()=>[p(" Cancel ")]),_:2},1032,["onClick"]),s(P,{n:"solid primary",onClick:d=>v(!0)},{default:u(()=>[p(" Update ")]),_:2},1032,["onClick"])])])]),_:2},1032,["onClose"])]),_:1})],64)}}}),D=["pages","meta","components","imports","nuxt-config-schema","@nuxt/devtools","@nuxt/telemetry"];function de(){return ne("getModulesList",async()=>(await $fetch("https://cdn.jsdelivr.net/npm/@nuxt/modules@latest/modules.json")).filter(a=>!D.includes(a.npm)&&a.compatibility.nuxt.includes("^3")))}function ge(){return Y("installed-modules",()=>{const l=Z(),a=de();return ee(()=>(l.value?._installedModules||[]).map(e=>{if(!e.entryPath)return;const n=e.entryPath&&te(e.entryPath),i=e.meta?.name?e.meta?.name:e.entryPath?n?ae(e.entryPath):l.value?.rootDir?se(e.entryPath,l.value?.rootDir).path:void 0:void 0,y=l.value?.modules?.includes(i),k=a.value?.find(c=>c.npm===i)||a.value?.find(c=>c.name===i);return{name:i,isPackageModule:n,isUninstallable:y,info:k,...e}}).filter(e=>e&&(!e.name||!D.includes(e.name))))})}export{ve as _,de as a,ge as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as B}from"./NCodeBlock.vue.882d562f.js";import{d as N,bo as R,e as D,a as V,aw as $,o as a,m as n,k as c,F as f,n as E,G as _,f as s,t as F,i as m,j as b,v,h as L,p as i,_ as T,r as k,K as r,bp as g,bq as h}from"./entry.3dd66f35.js";const W={key:0,relative:"","n-code-block":""},j={flex:"~ wrap","w-full":""},q=["onClick"],z=c("div",{border:"b base","flex-auto":""},null,-1),G={flex:"~ gap-2",px3:"",pb3:"",n:"sm primary"},P=N({__name:"CodeSnippets",props:{codeSnippets:{}},setup(t){const p=t,e=R(p.codeSnippets[0]),w=D(),x=V(()=>e.value?.lang||"text");return $(()=>{p.codeSnippets.includes(e.value)||(e.value=p.codeSnippets[0])}),(l,d)=>{const S=B,u=T;return l.codeSnippets.length?(a(),n("div",W,[c("div",j,[(a(!0),n(f,null,E(l.codeSnippets,(o,O)=>(a(),n("button",{key:O,px4:"",py2:"",border:"r base",hover:"bg-active",class:_(o===s(e)?"":"border-b"),onClick:I=>e.value=o},[c("div",{class:_(o===s(e)?"":"op30"),"font-mono":""},F(o.name),3)],10,q))),128)),z]),s(e)?(a(),n(f,{key:0},[m(S,{code:s(e).code,lang:s(x),lines:!1,"w-full":"","of-auto":"",p3:""},null,8,["code","lang"]),c("div",G,[m(u,{icon:"carbon-copy",onClick:d[0]||(d[0]=o=>s(w)(s(e).code))},{default:b(()=>[v(" Copy ")]),_:1}),s(e)?.docs?(a(),L(u,{key:0,to:s(e).docs,target:"_blank",icon:"carbon-catalog"},{default:b(()=>[v(" Docs ")]),_:1},8,["to"])):i("",!0)])],64)):i("",!0)])):i("",!0)}}}),y=k(await r.getOptions("assets")),K=g(y);h(y,async t=>{r.updateOptions("assets",t)},{deep:!0,flush:"post",debounce:500,maxWait:1e3});const C=k(await r.getOptions("serverRoutes")),A=g(C);h(C,async t=>{r.updateOptions("serverRoutes",t)},{deep:!0,flush:"post",debounce:500,maxWait:1e3});const H={serverRoutes:A,assets:K};function Q(t){return H[t]}export{P as _,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as G,O as ne,r as
|
|
1
|
+
import{d as G,O as ne,r as D,P as T,br as E,ax as ae,w as oe,aw as se,Y as le,a as re,K as f,L as k,f as t,o as l,h as m,j as u,k as r,i as c,l as U,m as i,F as w,n as A,t as b,G as F,ac as L,v as d,p as R,aq as ue,I as ie,b8 as de,ad as ce,bs as pe,bt as z,_ as me,W as _e,a2 as fe,al as ve,A as ye,S as ge,aD as he}from"./entry.3dd66f35.js";import{_ as ke}from"./NSelect.vue.e7f8c81a.js";import{_ as be}from"./NLink.vue.a09685db.js";import{_ as xe}from"./FilepathItem.vue.6dd69314.js";import{U as we}from"./json-editor-vue.465dc720.js";const Ce={class:"h-[48px] flex items-center justify-between gap1 px-3"},Ke={class:"w-full text-sm"},Se=["value"],Ve=["onClick"],$e=r("div",{"x-divider":""},null,-1),Ne={key:0,"h-full":"","of-hidden":"",flex:"~ col"},Ie={border:"b base",class:"h-[49px] flex flex-none items-center justify-between px-4 text-sm"},je={class:"flex items-center gap-4"},De={key:1},Ue=["onKeyup"],Ae=r("br",null,null,-1),Le={key:0,op50:""},Me={key:1},qe=r("code",null,"nitro.storage",-1),Be=r("br",null,null,-1),Pe={"font-bold":""},Te=r("br",null,null,-1),Ee={"text-sm":""},Fe=r("br",null,null,-1),Re=G({__name:"StorageDetails",async setup(O){let p,g;const C=pe(),h=ne(),x=D(""),v=D(""),s=T("storage:current",""),e=D(),y=T("storage:file:state",""),{data:K}=([p,g]=E(()=>z("storageMounts",()=>f.getStorageMounts())),p=await p,g(),p),{data:S,refresh:M}=([p,g]=E(async()=>z("storageKeys",async()=>s.value?await f.getStorageKeys(s.value):[])),p=await p,g(),p),W=C.hook("storage:key:update",async(n,a)=>{if(!(!s.value||n.split(":")[0]!==s.value)&&(await M(),y.value===n)){if(a==="remove")return h.replace({query:{storage:s.value}});await $(y.value)}});ae(W),oe(s,()=>{M(),y.value=""}),se(async()=>{if(!y.value){e.value=null;return}$(y.value)}),le("keydown",n=>{n.key==="s"&&(n.ctrlKey||n.metaKey)&&(N(),n.preventDefault())});function V(n){return n.replace(`${s.value}:`,"")}const Y=re(()=>S.value?S.value.filter(n=>n.includes(x.value)):[]);async function $(n){const a=await f.getStorageItem(await k(),n);e.value={key:n,updatedKey:V(n),editingKey:!1,content:a,updatedContent:a}}async function H(){if(!v.value||!s.value)return;const n=`${s.value}:${v.value}`;S.value?.includes(n)||await f.setStorageItem(await k(),n,""),h.replace({query:{storage:s.value,key:n}}),v.value=""}async function N(){e.value&&(await f.setStorageItem(await k(),e.value.key,e.value.updatedContent),await $(e.value.key))}async function J(){!e.value||!s.value||(await f.removeStorageItem(await k(),e.value.key),e.value=null)}async function Q(){if(!e.value||!s.value)return;const n=`${s.value}:${e.value.updatedKey}`,a=await k();await f.setStorageItem(a,n,e.value.updatedContent),await f.removeStorageItem(a,e.value.key),h.replace({query:{storage:s.value,key:n}})}return(n,a)=>{const I=me,X=ke,j=_e,Z=fe,q=be,B=ve,P=ye,ee=ge,te=xe;return t(s)?(l(),m(ee,{key:0,"storage-key":"tab-storage"},{left:u(()=>[r("div",Ce,[c(I,{icon:"carbon-chevron-left","ml--1":"",border:!1,onClick:a[0]||(a[0]=o=>s.value="")}),r("div",Ke,[c(X,{modelValue:t(s),"onUpdate:modelValue":a[1]||(a[1]=o=>U(s)?s.value=o:null),n:"primary",icon:"carbon-data-base"},{default:u(()=>[(l(!0),i(w,null,A(t(K),(o,_)=>(l(),i("option",{key:_,value:_},b(_),9,Se))),128))]),_:1},8,["modelValue"])])]),c(j,{modelValue:t(x),"onUpdate:modelValue":a[2]||(a[2]=o=>U(x)?x.value=o:null),icon:"carbon-search",placeholder:"Search...",n:"primary sm",border:"y x-none base! rounded-0",class:"w-full py2 ring-0!"},null,8,["modelValue"]),(l(!0),i(w,null,A(t(Y),o=>(l(),i(w,{key:o},[r("button",{block:"","w-full":"",truncate:"",px2:"",py1:"","text-start":"","text-sm":"","font-mono":"",class:F(o===t(e)?.key?"text-primary n-bg-active":"text-secondary hover:n-bg-hover"),onClick:_=>y.value=o},b(V(o)),11,Ve),$e],64))),128)),c(j,{modelValue:t(v),"onUpdate:modelValue":a[3]||(a[3]=o=>U(v)?v.value=o:null),icon:"carbon-add",placeholder:"key",n:"sm",border:"t-none x-none base! rounded-0",class:"w-full py2 font-mono ring-0!",onKeyup:L(H,["enter"])},null,8,["modelValue","onKeyup"])]),right:u(()=>[t(e)?.key?(l(),i("div",Ne,[r("div",Ie,[r("div",je,[t(e).editingKey?(l(),m(j,{key:0,modelValue:t(e).updatedKey,"onUpdate:modelValue":a[4]||(a[4]=o=>t(e).updatedKey=o),onKeyup:L(Q,["enter"])},null,8,["modelValue","onKeyup"])):(l(),i("code",De,[d(b(V(t(e).key))+" ",1),c(Z,{icon:"carbon-edit",class:"cursor-pointer op50 hover:op100",onClick:a[5]||(a[5]=o=>t(e).editingKey=!0)})])),t(e).editingKey?R("",!0):(l(),m(I,{key:2,n:"green xs",disabled:t(e).content===t(e).updatedContent,class:F({"border-green":t(e).content!==t(e).updatedContent}),onClick:N},{default:u(()=>[d(" Save ")]),_:1},8,["disabled","class"]))]),r("div",null,[c(I,{n:"red xs",onClick:J},{default:u(()=>[d(" Delete ")]),_:1})])]),typeof t(e).content=="object"?(l(),m(t(we),ue({key:0,modelValue:t(e).updatedContent,"onUpdate:modelValue":a[6]||(a[6]=o=>t(e).updatedContent=o),class:[[n.$colorMode.value==="dark"?"jse-theme-dark":"light"],"json-editor-vue h-full of-auto text-sm outline-none"]},n.$attrs,{mode:"text","navigation-bar":!1,indentation:2,"tab-size":2}),null,16,["modelValue","class"])):ie((l(),i("textarea",{key:1,"onUpdate:modelValue":a[7]||(a[7]=o=>t(e).updatedContent=o),placeholder:"Item value...",class:"h-full of-auto p-4 text-sm font-mono outline-none",onKeyup:L(de(N,["ctrl"]),["enter"])},null,40,Ue)),[[ce,t(e).updatedContent]])])):(l(),m(P,{key:1},{default:u(()=>[c(B,{px6:"",py4:""},{default:u(()=>[d(" Select one key to start."),Ae,d("Learn more about "),c(q,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:u(()=>[d(" Nitro storage ")]),_:1})]),_:1})]),_:1}))]),_:1})):(l(),m(P,{key:1},{default:u(()=>[Object.keys(t(K)).length?(l(),i("p",Le," Select one storage to start: ")):(l(),i("p",Me,[d(" No custom storage defined in "),qe,d("."),Be,d(" Learn more about "),c(q,{href:"https://nitro.unjs.io/guide/storage",n:"orange",target:"_blank"},{default:u(()=>[d(" Nitro storage ")]),_:1})])),(l(!0),i(w,null,A(t(K),(o,_)=>(l(),m(B,{key:_,"min-w-80":"","cursor-pointer":"","p-4":"","text-left":"",hover:"border-green",onClick:ze=>s.value=_},{default:u(()=>[r("span",Pe,b(_),1),Te,r("span",Ee,b(o.driver)+" driver",1),Fe,o.base?(l(),m(te,{key:0,"text-xs":"",filepath:o.base},null,8,["filepath"])):R("",!0)]),_:2},1032,["onClick"]))),128))]),_:1}))}}}),Je=G({__name:"storage",setup(O){return(p,g)=>{const C=Re,h=he;return l(),m(h,null,{default:u(()=>[c(C)]),_:1})}}});export{Je as default};
|