@nuxt/devtools 2.4.1 → 2.5.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/module-main.mjs +12 -52
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +22 -22
- package/dist/client/404.html +22 -22
- package/dist/client/_nuxt/__blank-mumgdw29.js +1 -0
- package/dist/client/_nuxt/analyze-build-lb4a69k4.js +1 -0
- package/dist/client/_nuxt/assets-jc9tzvj2.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/1bba8c88-485d-4954-ab8c-e56e95b99d88.json +1 -0
- package/dist/client/_nuxt/{client-etfulgf7.js → client-jlcyzfwz.js} +1 -1
- package/dist/client/_nuxt/code-diff.vue-c6don53k.js +8 -0
- package/dist/client/_nuxt/{code-snippets.vue-yqoxee04.js → code-snippets.vue-fbdww2bz.js} +1 -1
- package/dist/client/_nuxt/components-k4k1h6le.js +1 -0
- package/dist/client/_nuxt/composable-item.vue-kjbvgud6.js +1 -0
- package/dist/client/_nuxt/{custom-_name_-xxdc4xyk.js → custom-_name_-ihhvc01j.js} +1 -1
- package/dist/client/_nuxt/data-schema-button.vue-drlalata.js +1 -0
- package/dist/client/_nuxt/data-schema-drawer-ij5sf0rl.js +2 -0
- package/dist/client/_nuxt/debug-lohroe37.js +1 -0
- package/dist/client/_nuxt/{default-pd4kv06p.js → default-f68tjzna.js} +1 -1
- package/dist/client/_nuxt/{duration-display.vue-ibudjtt4.js → duration-display.vue-l7hutejt.js} +1 -1
- package/dist/client/_nuxt/{entry.css-nlmjo2pz.css → entry.css-gmgc8zz6.css} +1 -1
- package/dist/client/_nuxt/{error-404-jsmb2ylw.js → error-404-z3t35dwt.js} +1 -1
- package/dist/client/_nuxt/error-404.css-elh6uwdu.css +1 -0
- package/dist/client/_nuxt/{error-500-mbsayqot.js → error-500-k56nq9lo.js} +1 -1
- package/dist/client/_nuxt/error-500.css-bxkdntg7.css +1 -0
- package/dist/client/_nuxt/{error-h1v9m9m6.js → error-eg316ohw.js} +4 -4
- package/dist/client/_nuxt/{filepath-item.vue-br6hjwqx.js → filepath-item.vue-gp9fle8u.js} +1 -1
- package/dist/client/_nuxt/full-ifel6yw8.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-gswykw6o.js → help-fab.vue-f0g3gbyq.js} +1 -1
- package/dist/client/_nuxt/{hooks-gejjjavi.js → hooks-nyntnfws.js} +1 -1
- package/dist/client/_nuxt/{imports-lgt9tkvl.js → imports-ev6yf6rq.js} +1 -1
- package/dist/client/_nuxt/index-cgtwuik1.js +1 -0
- package/dist/client/_nuxt/k3jbhgz8.js +15 -0
- package/dist/client/_nuxt/launch-page.vue-igtsle8u.js +1 -0
- package/dist/client/_nuxt/modules-mhd4fei2.js +1 -0
- package/dist/client/_nuxt/nbadge-k17ouxot.js +1 -0
- package/dist/client/_nuxt/{ncheckbox.vue-jtldzl6k.js → ncheckbox.vue-obepl48o.js} +1 -1
- package/dist/client/_nuxt/ncode-block.vue-lge6rogf.js +2 -0
- package/dist/client/_nuxt/{ndrawer.vue-nkn577bf.js → ndrawer.vue-bvlhfrru.js} +1 -1
- package/dist/client/_nuxt/ndropdown.vue-np55ni86.js +1 -0
- package/dist/client/_nuxt/nicon-title.vue-d27ih16g.js +1 -0
- package/dist/client/_nuxt/{nlink.vue-gepdvjyn.js → nlink.vue-e0431874.js} +1 -1
- package/dist/client/_nuxt/nmarkdown.vue-isat7p33.js +1 -0
- package/dist/client/_nuxt/{nnavbar.vue-exzr4e5w.js → nnavbar.vue-jhylceus.js} +1 -1
- package/dist/client/_nuxt/none-djo8lm18.js +1 -0
- package/dist/client/_nuxt/nsection-block-e106blep.js +1 -0
- package/dist/client/_nuxt/{nselect-tabs.vue-l5x0yirx.js → nselect-tabs.vue-dd0i77k7.js} +1 -1
- package/dist/client/_nuxt/{nselect.vue-jigqjeiw.js → nselect.vue-dbmwjbou.js} +1 -1
- package/dist/client/_nuxt/{nswitch.vue-km9qm824.js → nswitch.vue-f07mzo8x.js} +1 -1
- package/dist/client/_nuxt/open-graph-l04ovzzw.js +3 -0
- package/dist/client/_nuxt/overview-cfkpobw1.js +1 -0
- package/dist/client/_nuxt/pages-ij8tcm9q.js +1 -0
- package/dist/client/_nuxt/payload-jp1vnzdz.js +1 -0
- package/dist/client/_nuxt/pinia-kfhkoott.js +1 -0
- package/dist/client/_nuxt/plugins-bnpq8t1o.js +1 -0
- package/dist/client/_nuxt/render-tree-fdpy9okv.js +1 -0
- package/dist/client/_nuxt/{runtime-configs-lkma1hwx.js → runtime-configs-hguo987n.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-blv2rxq3.js → server-discovery-f0dmvae1.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-cjdtnuu4.js → server-route-inputs.vue-hmskcen8.js} +1 -1
- package/dist/client/_nuxt/{server-routes-ove4utlk.js → server-routes-opx8sfs1.js} +2 -2
- package/dist/client/_nuxt/{server-tasks-i8kjqc0d.js → server-tasks-dexl30xm.js} +1 -1
- package/dist/client/_nuxt/settings-oeg7vwse.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-b70k1t8t.js → stacktrace-list.vue-lbykh9n8.js} +1 -1
- package/dist/client/_nuxt/{state-components-ittrf6yq.js → state-components-f096k414.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-pc9ctaaq.js +1 -0
- package/dist/client/_nuxt/state-modules-d3nbn93r.js +1 -0
- package/dist/client/_nuxt/storage-e20ao8q7.js +1 -0
- package/dist/client/_nuxt/terminals-jcwqz9e4.js +1 -0
- package/dist/client/_nuxt/{timeline-jtxqs7h6.js → timeline-m95we3bl.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-o1gs2hkj.js → unocss-runtime-n76zvjc0.js} +1 -1
- package/dist/client/_nuxt/vendor/{json-editor-vue-g7zhhq6q.js → json-editor-vue-pb6xqf2y.js} +111 -126
- package/dist/client/_nuxt/vendor/{quicktype-core-gg1jfx29.js → quicktype-core-lhaz4hgj.js} +55 -55
- package/dist/client/_nuxt/vendor/unocss-k776m6tm.js +2 -0
- package/dist/client/_nuxt/virtual-files-jlvcu5g2.js +1 -0
- package/dist/client/_nuxt/{vue-devtools-l0o7d54g.js → vue-devtools-fxhixcjy.js} +2 -2
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-b2tvdrfk.js → vue-virtual-scroller.esm-nuoya9vo.js} +2 -2
- package/dist/client/index.html +22 -22
- package/dist/module.d.mts +1 -1
- package/dist/module.json +2 -2
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugins/view/client.d.ts +2 -1
- package/dist/runtime/plugins/view/client.js +57 -28
- package/dist/runtime/plugins/view/state.d.ts +1 -3
- package/dist/runtime/plugins/view/state.js +0 -3
- package/dist/runtime/plugins/view/utils.d.ts +0 -28
- package/dist/runtime/plugins/view/utils.js +1 -125
- package/dist/runtime/shared/hooks.d.ts +1 -0
- package/dist/shared/devtools.Dlu0WIXO.mjs +122 -0
- package/dist/types.d.mts +1 -1
- package/dist/webcomponents/index.d.mts +20 -0
- package/dist/webcomponents/index.mjs +1543 -0
- package/package.json +34 -26
- package/types.d.ts +1 -1
- package/dist/client/_nuxt/__blank-nqwixhj1.js +0 -1
- package/dist/client/_nuxt/analyze-build-o4s5ob2q.js +0 -1
- package/dist/client/_nuxt/assets-huxgsitw.js +0 -16
- package/dist/client/_nuxt/builds/meta/bc495f3e-a5e4-477e-bd8b-c102bb505b43.json +0 -1
- package/dist/client/_nuxt/code-diff.vue-dvzw16bz.js +0 -8
- package/dist/client/_nuxt/components-edsbjzww.js +0 -1
- package/dist/client/_nuxt/composable-item.vue-izr4dc9x.js +0 -1
- package/dist/client/_nuxt/data-schema-button.vue-oxz1jnzv.js +0 -1
- package/dist/client/_nuxt/data-schema-drawer-dv9md89s.js +0 -2
- package/dist/client/_nuxt/debug-iijfcpov.js +0 -1
- package/dist/client/_nuxt/error-404.css-lvo9ozyv.css +0 -1
- package/dist/client/_nuxt/error-500.css-lrbzpi5q.css +0 -1
- package/dist/client/_nuxt/f1cbvne4.js +0 -15
- package/dist/client/_nuxt/full-fcbl8hea.js +0 -1
- package/dist/client/_nuxt/index-mkswwai7.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-jvl04rwq.js +0 -1
- package/dist/client/_nuxt/modules-oiyvev1x.js +0 -1
- package/dist/client/_nuxt/nbadge-lodw2y18.js +0 -1
- package/dist/client/_nuxt/ncode-block.vue-lex5o4lv.js +0 -2
- package/dist/client/_nuxt/ndropdown.vue-ji36i25f.js +0 -1
- package/dist/client/_nuxt/nicon-title.vue-g35plvi8.js +0 -1
- package/dist/client/_nuxt/nmarkdown.vue-gamlcow3.js +0 -1
- package/dist/client/_nuxt/none-nffzj9cd.js +0 -1
- package/dist/client/_nuxt/nsection-block-x8dothd4.js +0 -1
- package/dist/client/_nuxt/open-graph-nz4i7u7j.js +0 -3
- package/dist/client/_nuxt/overview-n2xqscmi.js +0 -1
- package/dist/client/_nuxt/pages-cu5a742d.js +0 -1
- package/dist/client/_nuxt/payload-jugfo4ki.js +0 -1
- package/dist/client/_nuxt/pinia-gsipwrbm.js +0 -1
- package/dist/client/_nuxt/plugins-cchxh0ve.js +0 -1
- package/dist/client/_nuxt/render-tree-gxqpdalx.js +0 -1
- package/dist/client/_nuxt/settings-jkgzzend.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-j3haepux.js +0 -1
- package/dist/client/_nuxt/state-modules-b39szh0f.js +0 -1
- package/dist/client/_nuxt/storage-mf5e8tar.js +0 -1
- package/dist/client/_nuxt/terminals-e8xd9utc.js +0 -1
- package/dist/client/_nuxt/vendor/unocss-hvn0t0zz.js +0 -2
- package/dist/client/_nuxt/virtual-files-xlijdz1c.js +0 -1
- package/dist/dirs.d.ts +0 -7
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -8
- package/dist/runtime/plugins/view/FrameBox.vue +0 -167
- package/dist/runtime/plugins/view/Main.vue +0 -432
- package/dist/shared/devtools.427ec2e8.d.ts +0 -57
- package/dist/shared/devtools.d413ad55.mjs +0 -122
- package/dist/types.d.ts +0 -41
- /package/dist/shared/{devtools.427ec2e8.d.mts → devtools.C1a10l_c.d.mts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{z as
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xe(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function ke(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,a,u=function(n){for(var d=arguments.length,p=new Array(d>1?d-1:0),S=1;S<d;S++)p[S-1]=arguments[S];if(a=p,!(s&&n===r)){var w=i.leading;typeof w=="function"&&(w=w(n,r)),(!s||n!==r)&&w&&e.apply(void 0,[n].concat(X(a))),r=n,clearTimeout(s),s=setTimeout(function(){e.apply(void 0,[n].concat(X(a))),s=0},t)}};return u._clear=function(){clearTimeout(s),s=null},u}function J(e,t){if(e===t)return!0;if(C(e)==="object"){for(var i in e)if(!J(e[i],t[i]))return!1;return!0}return!1}var Me=function(){function e(t,i,s){_e(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,s)}return Ie(e,[{key:"createObserver",value:function(i,s){var r=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=xe(i),this.callback=function(c,n){r.options.callback(c,n),c&&r.options.once&&(r.frozen=!0,r.destroyObserver())},this.callback&&this.options.throttle){var a=this.options.throttleOptions||{},u=a.leading;this.callback=ke(this.callback,this.options.throttle,{leading:function(n){return u==="both"||u==="visible"&&n||u==="hidden"&&!n}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(c){var n=c[0];if(c.length>1){var d=c.find(function(S){return S.isIntersecting});d&&(n=d)}if(r.callback){var p=n.isIntersecting&&n.intersectionRatio>=r.threshold;if(p===r.oldResult)return;r.oldResult=p,r.callback(p,n)}},this.options.intersection),Z(function(){r.observer&&r.observer.observe(r.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 Q(e,t,i){var s=t.value;if(s)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 r=new Me(e,s,i);e._vue_visibilityState=r}}function Ae(e,t,i){var s=t.value,r=t.oldValue;if(!J(s,r)){var a=e._vue_visibilityState;if(!s){ee(e);return}a?a.createObserver(s,i):Q(e,{value:s},i)}}function ee(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Re={beforeMount:Q,updated:Ae,unmounted:ee},Ce={itemsLimit:1e3},Ee=/(auto|scroll)/;function te(e,t){return e.parentNode===null?t:te(e.parentNode,t.concat([e]))}var L=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},Le=function(t){return L(t,"overflow")+L(t,"overflow-y")+L(t,"overflow-x")},Pe=function(t){return Ee.test(Le(t))};function G(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=te(e.parentNode,[]),i=0;i<t.length;i+=1)if(Pe(t[i]))return t[i];return document.scrollingElement||document.documentElement}}function j(e){"@babel/helpers - typeof";return j=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},j(e)}var He={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 Ne(){return this.items.length&&j(this.items[0])!=="object"}var B=!1;if(typeof window<"u"){B=!1;try{var je=Object.defineProperty({},"passive",{get:function(){B=!0}});window.addEventListener("test",null,je)}catch{}}let Be=0;var ie={name:"RecycleScroller",components:{ResizeObserver:E},directives:{ObserveVisibility:Re},props:{...He,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,s=this.minItemSize;let r=1e4,a=0,u;for(let c=0,n=t.length;c<n;c++)u=t[c][i]||s,u<r&&(r=u),a+=u,e[c]={accumulator:a,size:u};return this.$_computedMinItemSize=r,e}return[]},simpleArray:Ne,itemIndexByKey(){const{keyField:e,items:t}=this,i={};for(let s=0,r=t.length;s<r;s++)i[t[s][e]]=s;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,s,r){const a=le({id:Be++,index:t,used:!0,key:s,type:r}),u=ae({item:i,position:0,nr:a});return e.push(u),u},unuseView(e,t=!1){const i=this.$_unusedViews,s=e.nr.type;let r=i.get(s);r||(r=[],i.set(s,r)),r.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,s=this.gridItems||1,r=this.itemSecondarySize||i,a=this.$_computedMinItemSize,u=this.typeField,c=this.simpleArray?null:this.keyField,n=this.items,d=n.length,p=this.sizes,S=this.$_views,w=this.$_unusedViews,V=this.pool,se=this.itemIndexByKey;let y,f,T,g,z;if(!d)y=f=g=z=T=0;else if(this.$_prerender)y=g=0,f=z=Math.min(this.prerender,n.length),T=null;else{const o=this.getScroll();if(t){let m=o.start-this.$_lastUpdateScrollPosition;if(m<0&&(m=-m),i===null&&m<a||m<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=o.start;const v=this.buffer;o.start-=v,o.end+=v;let h=0;if(this.$refs.before&&(h=this.$refs.before.scrollHeight,o.start-=h),this.$refs.after){const m=this.$refs.after.scrollHeight;o.end+=m}if(i===null){let m,O=0,F=d-1,b=~~(d/2),U;do U=b,m=p[b].accumulator,m<o.start?O=b:b<d-1&&p[b+1].accumulator>o.start&&(F=b),b=~~((O+F)/2);while(b!==U);for(b<0&&(b=0),y=b,T=p[d-1].accumulator,f=b;f<d&&p[f].accumulator<o.end;f++);for(f===-1?f=n.length-1:(f++,f>d&&(f=d)),g=y;g<d&&h+p[g].accumulator<o.start;g++);for(z=g;z<d&&h+p[z].accumulator<o.end;z++);}else{y=~~(o.start/i*s);const m=y%s;y-=m,f=Math.ceil(o.end/i*s),g=Math.max(0,Math.floor((o.start-h)/i*s)),z=Math.floor((o.end-h)/i*s),y<0&&(y=0),f>d&&(f=d),g<0&&(g=0),z>d&&(z=d),T=Math.ceil(d/s)*i}}f-y>Ce.itemsLimit&&this.itemsLimitError(),this.totalSize=T;let l;const x=y<=this.$_endIndex&&f>=this.$_startIndex;if(x)for(let o=0,v=V.length;o<v;o++)l=V[o],l.nr.used&&(e&&(l.nr.index=se[l.item[c]]),(l.nr.index==null||l.nr.index<y||l.nr.index>=f)&&this.unuseView(l));const D=x?null:new Map;let I,_,k;for(let o=y;o<f;o++){I=n[o];const v=c?I[c]:I;if(v==null)throw new Error(`Key is ${v} on item (keyField is '${c}')`);if(l=S.get(v),!i&&!p[o].size){l&&this.unuseView(l);continue}_=I[u];let h=w.get(_),m=!1;if(!l)x?h&&h.length?l=h.pop():l=this.addView(V,o,I,v,_):(k=D.get(_)||0,(!h||k>=h.length)&&(l=this.addView(V,o,I,v,_),this.unuseView(l,!0),h=w.get(_)),l=h[k],D.set(_,k+1)),S.delete(l.nr.key),l.nr.used=!0,l.nr.index=o,l.nr.key=v,l.nr.type=_,S.set(v,l),m=!0;else if(!l.nr.used&&(l.nr.used=!0,m=!0,h)){const O=h.indexOf(l);O!==-1&&h.splice(O,1)}l.item=I,m&&(o===n.length-1&&this.$emit("scroll-end"),o===0&&this.$emit("scroll-start")),i===null?(l.position=p[o-1].accumulator,l.offset=0):(l.position=Math.floor(o/s)*i,l.offset=o%s*r)}return this.$_startIndex=y,this.$_endIndex=f,this.emitUpdate&&this.$emit("update",y,f,g,z),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let e=G(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 s;if(this.pageMode){const r=e.getBoundingClientRect(),a=i?r.height:r.width;let u=-(i?r.top:r.left),c=i?window.innerHeight:window.innerWidth;u<0&&(c+=u,u=0),u+c>a&&(c=a-u),s={start:u,end:u+c}}else i?s={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:s={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return s},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,B?{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,s,r;if(this.pageMode){const a=G(this.$el),u=a.tagName==="HTML"?0:a[t.scroll],c=a.getBoundingClientRect(),d=this.$el.getBoundingClientRect()[t.start]-c[t.start];i=a,s=t.scroll,r=e+u+d}else i=this.$el,s=t.scroll,r=e;i[s]=r},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 De={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Fe={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function Ue(e,t,i,s,r,a){const u=ue("ResizeObserver"),c=ce("observe-visibility");return de(($(),M("div",{class:Y(["vue-recycle-scroller",{ready:r.ready,"page-mode":i.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...n)=>a.handleScroll&&a.handleScroll(...n))},[e.$slots.before?($(),M("div",De,[A(e.$slots,"before")],512)):W("v-if",!0),($(),P(q(i.listTag),{ref:"wrapper",style:ve({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:Y(["vue-recycle-scroller__item-wrapper",i.listClass])},{default:K(()=>[($(!0),M(he,null,me(r.pool,n=>($(),P(q(i.itemTag),pe({key:n.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${n.position}px) translate${e.direction==="vertical"?"X":"Y"}(${n.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&&r.hoverKey===n.nr.key}]]},ye(i.skipHover?{}:{mouseenter:()=>{r.hoverKey=n.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:K(()=>[A(e.$slots,"default",{item:n.item,index:n.nr.index,active:n.nr.used})]),_:2},1040,["style","class"]))),128)),A(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?($(),M("div",Fe,[A(e.$slots,"after")],512)):W("v-if",!0),fe(u,{onNotify:a.handleResize},null,8,["onNotify"])],34)),[[c,a.handleVisibilityChange]])}ie.render=Ue;ie.__file="src/components/RecycleScroller.vue";export{ie as s};
|
|
1
|
+
import{z as J,a0 as re,a1 as ne,a2 as oe,V as P,a3 as $,aA as le,s as ae,$ as ue,ai as ce,ac as de,J as M,U as W,a5 as fe,W as A,a4 as K,F as he,ag as me,af as q,a6 as pe,aB as ye,Z as X,X as ve}from"./vendor/json-editor-vue-pb6xqf2y.js";function be(){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 s=e.indexOf("rv:");return parseInt(e.substring(s+3,e.indexOf(".",s)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}let R;function H(){H.init||(H.init=!0,R=be()!==-1)}var E={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){H(),J(()=>{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",R&&this.$el.appendChild(e),e.data="about:blank",R||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&&(!R&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const ge=oe();re("data-v-b329ee4c");const Se={class:"resize-observer",tabindex:"-1"};ne();const ze=ge((e,t,i,s,r,a)=>($(),P("div",Se)));E.render=ze;E.__scopeId="data-v-b329ee4c";E.__file="src/components/ResizeObserver.vue";function C(e){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?C=function(t){return typeof t}:C=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},C(e)}function _e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function we(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function Ie(e,t,i){return t&&we(e.prototype,t),e}function Y(e){return $e(e)||Te(e)||Oe(e)||Ve()}function $e(e){if(Array.isArray(e))return N(e)}function Te(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Oe(e,t){if(e){if(typeof e=="string")return N(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 N(e,t)}}function N(e,t){(t==null||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}function Ve(){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 xe(e){var t;return typeof e=="function"?t={callback:e}:t=e,t}function ke(e,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,r,a,u=function(n){for(var d=arguments.length,p=new Array(d>1?d-1:0),S=1;S<d;S++)p[S-1]=arguments[S];if(a=p,!(s&&n===r)){var w=i.leading;typeof w=="function"&&(w=w(n,r)),(!s||n!==r)&&w&&e.apply(void 0,[n].concat(Y(a))),r=n,clearTimeout(s),s=setTimeout(function(){e.apply(void 0,[n].concat(Y(a))),s=0},t)}};return u._clear=function(){clearTimeout(s),s=null},u}function Z(e,t){if(e===t)return!0;if(C(e)==="object"){for(var i in e)if(!Z(e[i],t[i]))return!1;return!0}return!1}var Me=function(){function e(t,i,s){_e(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,s)}return Ie(e,[{key:"createObserver",value:function(i,s){var r=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=xe(i),this.callback=function(c,n){r.options.callback(c,n),c&&r.options.once&&(r.frozen=!0,r.destroyObserver())},this.callback&&this.options.throttle){var a=this.options.throttleOptions||{},u=a.leading;this.callback=ke(this.callback,this.options.throttle,{leading:function(n){return u==="both"||u==="visible"&&n||u==="hidden"&&!n}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(c){var n=c[0];if(c.length>1){var d=c.find(function(S){return S.isIntersecting});d&&(n=d)}if(r.callback){var p=n.isIntersecting&&n.intersectionRatio>=r.threshold;if(p===r.oldResult)return;r.oldResult=p,r.callback(p,n)}},this.options.intersection),J(function(){r.observer&&r.observer.observe(r.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 Q(e,t,i){var s=t.value;if(s)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 r=new Me(e,s,i);e._vue_visibilityState=r}}function Ae(e,t,i){var s=t.value,r=t.oldValue;if(!Z(s,r)){var a=e._vue_visibilityState;if(!s){ee(e);return}a?a.createObserver(s,i):Q(e,{value:s},i)}}function ee(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var Re={beforeMount:Q,updated:Ae,unmounted:ee},Ce={itemsLimit:1e3},Ee=/(auto|scroll)/;function te(e,t){return e.parentNode===null?t:te(e.parentNode,t.concat([e]))}var L=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},Le=function(t){return L(t,"overflow")+L(t,"overflow-y")+L(t,"overflow-x")},Pe=function(t){return Ee.test(Le(t))};function G(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var t=te(e.parentNode,[]),i=0;i<t.length;i+=1)if(Pe(t[i]))return t[i];return document.scrollingElement||document.documentElement}}function B(e){"@babel/helpers - typeof";return B=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},B(e)}var He={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 Ne(){return this.items.length&&B(this.items[0])!=="object"}var j=!1;if(typeof window<"u"){j=!1;try{var Be=Object.defineProperty({},"passive",{get:function(){j=!0}});window.addEventListener("test",null,Be)}catch{}}let je=0;var ie={name:"RecycleScroller",components:{ResizeObserver:E},directives:{ObserveVisibility:Re},props:{...He,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,s=this.minItemSize;let r=1e4,a=0,u;for(let c=0,n=t.length;c<n;c++)u=t[c][i]||s,u<r&&(r=u),a+=u,e[c]={accumulator:a,size:u};return this.$_computedMinItemSize=r,e}return[]},simpleArray:Ne,itemIndexByKey(){const{keyField:e,items:t}=this,i={};for(let s=0,r=t.length;s<r;s++)i[t[s][e]]=s;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,s,r){const a=le({id:je++,index:t,used:!0,key:s,type:r}),u=ae({item:i,position:0,nr:a});return e.push(u),u},unuseView(e,t=!1){const i=this.$_unusedViews,s=e.nr.type;let r=i.get(s);r||(r=[],i.set(s,r)),r.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,s=this.gridItems||1,r=this.itemSecondarySize||i,a=this.$_computedMinItemSize,u=this.typeField,c=this.simpleArray?null:this.keyField,n=this.items,d=n.length,p=this.sizes,S=this.$_views,w=this.$_unusedViews,V=this.pool,se=this.itemIndexByKey;let y,f,T,g,z;if(!d)y=f=g=z=T=0;else if(this.$_prerender)y=g=0,f=z=Math.min(this.prerender,n.length),T=null;else{const o=this.getScroll();if(t){let m=o.start-this.$_lastUpdateScrollPosition;if(m<0&&(m=-m),i===null&&m<a||m<i)return{continuous:!0}}this.$_lastUpdateScrollPosition=o.start;const v=this.buffer;o.start-=v,o.end+=v;let h=0;if(this.$refs.before&&(h=this.$refs.before.scrollHeight,o.start-=h),this.$refs.after){const m=this.$refs.after.scrollHeight;o.end+=m}if(i===null){let m,O=0,F=d-1,b=~~(d/2),U;do U=b,m=p[b].accumulator,m<o.start?O=b:b<d-1&&p[b+1].accumulator>o.start&&(F=b),b=~~((O+F)/2);while(b!==U);for(b<0&&(b=0),y=b,T=p[d-1].accumulator,f=b;f<d&&p[f].accumulator<o.end;f++);for(f===-1?f=n.length-1:(f++,f>d&&(f=d)),g=y;g<d&&h+p[g].accumulator<o.start;g++);for(z=g;z<d&&h+p[z].accumulator<o.end;z++);}else{y=~~(o.start/i*s);const m=y%s;y-=m,f=Math.ceil(o.end/i*s),g=Math.max(0,Math.floor((o.start-h)/i*s)),z=Math.floor((o.end-h)/i*s),y<0&&(y=0),f>d&&(f=d),g<0&&(g=0),z>d&&(z=d),T=Math.ceil(d/s)*i}}f-y>Ce.itemsLimit&&this.itemsLimitError(),this.totalSize=T;let l;const x=y<=this.$_endIndex&&f>=this.$_startIndex;if(x)for(let o=0,v=V.length;o<v;o++)l=V[o],l.nr.used&&(e&&(l.nr.index=se[l.item[c]]),(l.nr.index==null||l.nr.index<y||l.nr.index>=f)&&this.unuseView(l));const D=x?null:new Map;let I,_,k;for(let o=y;o<f;o++){I=n[o];const v=c?I[c]:I;if(v==null)throw new Error(`Key is ${v} on item (keyField is '${c}')`);if(l=S.get(v),!i&&!p[o].size){l&&this.unuseView(l);continue}_=I[u];let h=w.get(_),m=!1;if(!l)x?h&&h.length?l=h.pop():l=this.addView(V,o,I,v,_):(k=D.get(_)||0,(!h||k>=h.length)&&(l=this.addView(V,o,I,v,_),this.unuseView(l,!0),h=w.get(_)),l=h[k],D.set(_,k+1)),S.delete(l.nr.key),l.nr.used=!0,l.nr.index=o,l.nr.key=v,l.nr.type=_,S.set(v,l),m=!0;else if(!l.nr.used&&(l.nr.used=!0,m=!0,h)){const O=h.indexOf(l);O!==-1&&h.splice(O,1)}l.item=I,m&&(o===n.length-1&&this.$emit("scroll-end"),o===0&&this.$emit("scroll-start")),i===null?(l.position=p[o-1].accumulator,l.offset=0):(l.position=Math.floor(o/s)*i,l.offset=o%s*r)}return this.$_startIndex=y,this.$_endIndex=f,this.emitUpdate&&this.$emit("update",y,f,g,z),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:x}},getListenerTarget(){let e=G(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 s;if(this.pageMode){const r=e.getBoundingClientRect(),a=i?r.height:r.width;let u=-(i?r.top:r.left),c=i?window.innerHeight:window.innerWidth;u<0&&(c+=u,u=0),u+c>a&&(c=a-u),s={start:u,end:u+c}}else i?s={start:e.scrollTop,end:e.scrollTop+e.clientHeight}:s={start:e.scrollLeft,end:e.scrollLeft+e.clientWidth};return s},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,j?{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,s,r;if(this.pageMode){const a=G(this.$el),u=a.tagName==="HTML"?0:a[t.scroll],c=a.getBoundingClientRect(),d=this.$el.getBoundingClientRect()[t.start]-c[t.start];i=a,s=t.scroll,r=e+u+d}else i=this.$el,s=t.scroll,r=e;i[s]=r},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 De={key:0,ref:"before",class:"vue-recycle-scroller__slot"},Fe={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function Ue(e,t,i,s,r,a){const u=ue("ResizeObserver"),c=ce("observe-visibility");return de(($(),M("div",{class:X(["vue-recycle-scroller",{ready:r.ready,"page-mode":i.pageMode,[`direction-${e.direction}`]:!0}]),onScrollPassive:t[0]||(t[0]=(...n)=>a.handleScroll&&a.handleScroll(...n))},[e.$slots.before?($(),M("div",De,[A(e.$slots,"before")],512)):W("v-if",!0),($(),P(q(i.listTag),{ref:"wrapper",style:ve({[e.direction==="vertical"?"minHeight":"minWidth"]:r.totalSize+"px"}),class:X(["vue-recycle-scroller__item-wrapper",i.listClass])},{default:K(()=>[($(!0),M(he,null,me(r.pool,n=>($(),P(q(i.itemTag),pe({key:n.nr.id,style:r.ready?{transform:`translate${e.direction==="vertical"?"Y":"X"}(${n.position}px) translate${e.direction==="vertical"?"X":"Y"}(${n.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&&r.hoverKey===n.nr.key}]]},ye(i.skipHover?{}:{mouseenter:()=>{r.hoverKey=n.nr.key},mouseleave:()=>{r.hoverKey=null}})),{default:K(()=>[A(e.$slots,"default",{item:n.item,index:n.nr.index,active:n.nr.used})]),_:2},1040,["style","class"]))),128)),A(e.$slots,"empty")]),_:3},8,["style","class"])),e.$slots.after?($(),M("div",Fe,[A(e.$slots,"after")],512)):W("v-if",!0),fe(u,{onNotify:a.handleResize},null,8,["onNotify"])],34)),[[c,a.handleVisibilityChange]])}ie.render=Ue;ie.__file="src/components/RecycleScroller.vue";export{ie as s};
|
package/dist/client/index.html
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
<!DOCTYPE html><html><head><meta charset="utf-8">
|
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
-
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-
|
|
3
|
+
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/entry.css-gmgc8zz6.css" crossorigin>
|
|
4
4
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue.css-mqq5uooj.css" crossorigin>
|
|
5
5
|
<link rel="stylesheet" href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss.css-mhvipxpl.css" crossorigin>
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
7
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-
|
|
8
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/k3jbhgz8.js">
|
|
7
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/json-editor-vue-pb6xqf2y.js">
|
|
8
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/unocss-k776m6tm.js">
|
|
9
9
|
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-hjqm7vcp.js">
|
|
10
10
|
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/markdown-it-fvu08dbs.js">
|
|
11
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-
|
|
12
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-
|
|
13
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-
|
|
11
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/default-f68tjzna.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-ifel6yw8.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-djo8lm18.js">
|
|
14
14
|
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.css-lvdc77tw.css">
|
|
15
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-
|
|
16
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-
|
|
17
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-
|
|
18
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-
|
|
19
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-
|
|
20
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-
|
|
21
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-
|
|
22
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-
|
|
23
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-
|
|
24
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-
|
|
25
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-
|
|
26
|
-
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-
|
|
27
|
-
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-
|
|
28
|
-
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/
|
|
29
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"
|
|
15
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/data-schema-drawer-ij5sf0rl.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-dbmwjbou.js">
|
|
17
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nswitch.vue-f07mzo8x.js">
|
|
18
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndropdown.vue-np55ni86.js">
|
|
19
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ncode-block.vue-lge6rogf.js">
|
|
20
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/client-jlcyzfwz.js">
|
|
21
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/ndrawer.vue-bvlhfrru.js">
|
|
22
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/quicktype-core-lhaz4hgj.js">
|
|
23
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/unocss-runtime-n76zvjc0.js">
|
|
24
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404.css-elh6uwdu.css">
|
|
25
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-404-z3t35dwt.js">
|
|
26
|
+
<link rel="prefetch" as="style" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500.css-bxkdntg7.css">
|
|
27
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/error-500-k56nq9lo.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/k3jbhgz8.js" crossorigin></script></head><body><div id="__nuxt"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1749013879166,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"1bba8c88-485d-4954-ab8c-e56e95b99d88",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { NuxtDevtoolsHostClient } from '@nuxt/devtools/types';
|
|
1
2
|
import type { Ref } from 'vue';
|
|
2
3
|
import type { Router } from 'vue-router';
|
|
3
|
-
declare const clientRef: import("vue").ShallowRef<
|
|
4
|
+
declare const clientRef: import("vue").ShallowRef<NuxtDevtoolsHostClient | undefined, NuxtDevtoolsHostClient | undefined>;
|
|
4
5
|
export { clientRef as client };
|
|
5
6
|
export type ColorScheme = 'dark' | 'light';
|
|
6
7
|
export declare function setupDevToolsClient({ nuxt, clientHooks, timeMetric, router, }: {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { useAppConfig, useRuntimeConfig } from "#imports";
|
|
2
|
+
import { NuxtDevtoolsFrame, NuxtDevtoolsInspectPanel } from "@nuxt/devtools/webcomponents";
|
|
2
3
|
import { setIframeServerContext } from "@vue/devtools-kit";
|
|
3
4
|
import { createHooks } from "hookable";
|
|
4
5
|
import { debounce } from "perfect-debounce";
|
|
5
6
|
import { events as inspectorEvents, hasData as inspectorHasData, state as inspectorState } from "vite-plugin-vue-tracer/client/overlay";
|
|
6
|
-
import { computed,
|
|
7
|
+
import { computed, markRaw, reactive, ref, shallowReactive, shallowRef, toRef, watch } from "vue";
|
|
7
8
|
import { initTimelineMetrics } from "../../function-metrics-helpers.js";
|
|
8
|
-
import
|
|
9
|
+
import { settings } from "../../settings.js";
|
|
9
10
|
import { popupWindow, state } from "./state.js";
|
|
10
11
|
const clientRef = shallowRef();
|
|
11
12
|
export { clientRef as client };
|
|
@@ -15,6 +16,8 @@ export async function setupDevToolsClient({
|
|
|
15
16
|
timeMetric,
|
|
16
17
|
router
|
|
17
18
|
}) {
|
|
19
|
+
let iframe;
|
|
20
|
+
let inspector;
|
|
18
21
|
const colorMode = useClientColorMode();
|
|
19
22
|
const timeline = initTimelineMetrics();
|
|
20
23
|
const client = shallowReactive({
|
|
@@ -80,7 +83,6 @@ export async function setupDevToolsClient({
|
|
|
80
83
|
revision: ref(0)
|
|
81
84
|
});
|
|
82
85
|
window.__NUXT_DEVTOOLS_HOST__ = client;
|
|
83
|
-
let iframe;
|
|
84
86
|
function syncClient() {
|
|
85
87
|
if (!client.inspector)
|
|
86
88
|
client.inspector = getInspectorInstance();
|
|
@@ -139,30 +141,57 @@ export async function setupDevToolsClient({
|
|
|
139
141
|
});
|
|
140
142
|
}
|
|
141
143
|
function getInspectorInstance() {
|
|
144
|
+
if (inspector)
|
|
145
|
+
return inspector;
|
|
146
|
+
const props = reactive({
|
|
147
|
+
mouse: { x: 0, y: 0 },
|
|
148
|
+
matched: void 0
|
|
149
|
+
});
|
|
150
|
+
const component = new NuxtDevtoolsInspectPanel(reactive({ props }));
|
|
151
|
+
document.body.appendChild(component);
|
|
152
|
+
Object.assign(component.style, {
|
|
153
|
+
zIndex: 999999,
|
|
154
|
+
position: "fixed"
|
|
155
|
+
});
|
|
156
|
+
component.addEventListener("close", () => {
|
|
157
|
+
props.matched = void 0;
|
|
158
|
+
inspectorState.isEnabled = false;
|
|
159
|
+
});
|
|
160
|
+
component.addEventListener("selectParent", () => {
|
|
161
|
+
const parent = inspectorState.main?.getParent();
|
|
162
|
+
if (parent) {
|
|
163
|
+
inspectorState.main = parent;
|
|
164
|
+
props.matched = parent;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
component.addEventListener("openInEditor", (e) => {
|
|
168
|
+
const url = e?.detail?.[0];
|
|
169
|
+
if (url)
|
|
170
|
+
client.hooks.callHook("host:inspector:click", url);
|
|
171
|
+
});
|
|
172
|
+
inspectorEvents.on("hover", () => {
|
|
173
|
+
inspectorState.isFocused = false;
|
|
174
|
+
});
|
|
175
|
+
inspectorEvents.on("disabled", () => {
|
|
176
|
+
inspectorState.isVisible = false;
|
|
177
|
+
client?.hooks.callHook("host:inspector:close");
|
|
178
|
+
});
|
|
179
|
+
inspectorEvents.on("enabled", () => {
|
|
180
|
+
inspectorState.isVisible = true;
|
|
181
|
+
});
|
|
182
|
+
inspectorEvents.on("click", async (info, e) => {
|
|
183
|
+
inspectorState.isFocused = true;
|
|
184
|
+
inspectorState.isVisible = true;
|
|
185
|
+
props.matched = info;
|
|
186
|
+
props.mouse = { x: e.clientX, y: e.clientY };
|
|
187
|
+
});
|
|
142
188
|
const isAvailable = ref(inspectorHasData());
|
|
143
|
-
if (!inspectorEvents.events.disabled?.length) {
|
|
144
|
-
inspectorEvents.on("disabled", () => {
|
|
145
|
-
inspectorState.isVisible = false;
|
|
146
|
-
client?.hooks.callHook("host:inspector:close");
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
if (!inspectorEvents.events.enabled?.length) {
|
|
150
|
-
inspectorEvents.on("enabled", () => {
|
|
151
|
-
inspectorState.isVisible = true;
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
if (!inspectorEvents.events.click?.length) {
|
|
155
|
-
inspectorEvents.on("click", async (info) => {
|
|
156
|
-
inspectorState.isEnabled = false;
|
|
157
|
-
await client.hooks.callHook("host:inspector:click", info.fullpath);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
189
|
if (!isAvailable.value) {
|
|
161
190
|
inspectorEvents.on("hover", async () => {
|
|
162
191
|
isAvailable.value = inspectorHasData();
|
|
163
192
|
});
|
|
164
193
|
}
|
|
165
|
-
return markRaw({
|
|
194
|
+
return inspector = markRaw({
|
|
166
195
|
isAvailable,
|
|
167
196
|
isEnabled: toRef(inspectorState, "isEnabled"),
|
|
168
197
|
enable: () => {
|
|
@@ -226,13 +255,13 @@ export async function setupDevToolsClient({
|
|
|
226
255
|
if (e.code === "KeyD" && e.altKey && e.shiftKey)
|
|
227
256
|
client.devtools.toggle();
|
|
228
257
|
});
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
});
|
|
235
|
-
|
|
258
|
+
const frame = new NuxtDevtoolsFrame(reactive({
|
|
259
|
+
client,
|
|
260
|
+
settings,
|
|
261
|
+
state,
|
|
262
|
+
popupWindow
|
|
263
|
+
}));
|
|
264
|
+
holder.appendChild(frame);
|
|
236
265
|
}
|
|
237
266
|
export function useClientColorMode() {
|
|
238
267
|
const explicitColor = ref();
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const PANEL_MIN = 20;
|
|
3
|
-
export declare const PANEL_MAX = 100;
|
|
1
|
+
import type { DevToolsFrameState } from '@nuxt/devtools/types';
|
|
4
2
|
export declare const popupWindow: import("vue").ShallowRef<Window | null, Window | null>;
|
|
5
3
|
export declare const state: import("vue").Ref<DevToolsFrameState, DevToolsFrameState>;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { shallowRef } from "vue";
|
|
2
2
|
import { useObjectStorage } from "./utils.js";
|
|
3
|
-
export const PANEL_PADDING = 10;
|
|
4
|
-
export const PANEL_MIN = 20;
|
|
5
|
-
export const PANEL_MAX = 100;
|
|
6
3
|
export const popupWindow = shallowRef(null);
|
|
7
4
|
export const state = useObjectStorage("nuxt-devtools-frame-state", {
|
|
8
5
|
width: 80,
|
|
@@ -1,31 +1,3 @@
|
|
|
1
1
|
import type { Ref } from 'vue';
|
|
2
2
|
export declare function useObjectStorage<T>(key: string, initial: T, listenToStorage?: boolean): Ref<T>;
|
|
3
|
-
export declare function useTransform<F, T>(data: Ref<F>, to: (data: F) => T, from: (data: T) => F): Ref<T>;
|
|
4
3
|
export declare function useEventListener(target: EventTarget, type: string, listener: any, options?: boolean | AddEventListenerOptions): void;
|
|
5
|
-
/**
|
|
6
|
-
* @see https://vueuse.org/useElementBounding
|
|
7
|
-
*/
|
|
8
|
-
export declare function useElementBounding(target: Ref<HTMLElement | null | undefined>): {
|
|
9
|
-
height: Ref<number, number>;
|
|
10
|
-
bottom: Ref<number, number>;
|
|
11
|
-
left: Ref<number, number>;
|
|
12
|
-
right: Ref<number, number>;
|
|
13
|
-
top: Ref<number, number>;
|
|
14
|
-
width: Ref<number, number>;
|
|
15
|
-
x: Ref<number, number>;
|
|
16
|
-
y: Ref<number, number>;
|
|
17
|
-
update: () => void;
|
|
18
|
-
};
|
|
19
|
-
export declare function millisecondToHumanreadable(ms: number): [number, string];
|
|
20
|
-
/**
|
|
21
|
-
* Reactive `env(safe-area-inset-*)`
|
|
22
|
-
*
|
|
23
|
-
* @see https://vueuse.org/useScreenSafeArea
|
|
24
|
-
*/
|
|
25
|
-
export declare function useScreenSafeArea(): {
|
|
26
|
-
top: Ref<number, number>;
|
|
27
|
-
right: Ref<number, number>;
|
|
28
|
-
bottom: Ref<number, number>;
|
|
29
|
-
left: Ref<number, number>;
|
|
30
|
-
update: () => void;
|
|
31
|
-
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getCurrentScope, onScopeDispose, ref, watch } from "vue";
|
|
2
2
|
export function useObjectStorage(key, initial, listenToStorage = true) {
|
|
3
3
|
const raw = localStorage.getItem(key);
|
|
4
4
|
const data = ref(raw ? JSON.parse(raw) : initial);
|
|
@@ -25,132 +25,8 @@ export function useObjectStorage(key, initial, listenToStorage = true) {
|
|
|
25
25
|
}
|
|
26
26
|
return data;
|
|
27
27
|
}
|
|
28
|
-
export function useTransform(data, to, from) {
|
|
29
|
-
return computed({
|
|
30
|
-
get() {
|
|
31
|
-
return to(data.value);
|
|
32
|
-
},
|
|
33
|
-
set(value) {
|
|
34
|
-
data.value = from(value);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
28
|
export function useEventListener(target, type, listener, options) {
|
|
39
29
|
target.addEventListener(type, listener, options);
|
|
40
30
|
if (getCurrentScope())
|
|
41
31
|
onScopeDispose(() => target.removeEventListener(type, listener, options));
|
|
42
32
|
}
|
|
43
|
-
export function useElementBounding(target) {
|
|
44
|
-
const height = ref(0);
|
|
45
|
-
const bottom = ref(0);
|
|
46
|
-
const left = ref(0);
|
|
47
|
-
const right = ref(0);
|
|
48
|
-
const top = ref(0);
|
|
49
|
-
const width = ref(0);
|
|
50
|
-
const x = ref(0);
|
|
51
|
-
const y = ref(0);
|
|
52
|
-
function update() {
|
|
53
|
-
const el = toValue(target);
|
|
54
|
-
if (!el) {
|
|
55
|
-
height.value = 0;
|
|
56
|
-
bottom.value = 0;
|
|
57
|
-
left.value = 0;
|
|
58
|
-
right.value = 0;
|
|
59
|
-
top.value = 0;
|
|
60
|
-
width.value = 0;
|
|
61
|
-
x.value = 0;
|
|
62
|
-
y.value = 0;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const rect = el.getBoundingClientRect();
|
|
66
|
-
height.value = rect.height;
|
|
67
|
-
bottom.value = rect.bottom;
|
|
68
|
-
left.value = rect.left;
|
|
69
|
-
right.value = rect.right;
|
|
70
|
-
top.value = rect.top;
|
|
71
|
-
width.value = rect.width;
|
|
72
|
-
x.value = rect.x;
|
|
73
|
-
y.value = rect.y;
|
|
74
|
-
}
|
|
75
|
-
watch(() => toValue(target), update);
|
|
76
|
-
useEventListener(window, "resize", update);
|
|
77
|
-
if (getCurrentInstance())
|
|
78
|
-
onMounted(() => update());
|
|
79
|
-
let observer;
|
|
80
|
-
const cleanup = () => {
|
|
81
|
-
if (observer) {
|
|
82
|
-
observer.disconnect();
|
|
83
|
-
observer = void 0;
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const stopWatch = watch(
|
|
87
|
-
() => toValue(target),
|
|
88
|
-
(el) => {
|
|
89
|
-
cleanup();
|
|
90
|
-
if (window) {
|
|
91
|
-
observer = new ResizeObserver(update);
|
|
92
|
-
if (el)
|
|
93
|
-
observer.observe(el);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
{ immediate: true, flush: "post", deep: true }
|
|
97
|
-
);
|
|
98
|
-
if (getCurrentScope()) {
|
|
99
|
-
onScopeDispose(() => {
|
|
100
|
-
cleanup();
|
|
101
|
-
stopWatch();
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
return {
|
|
105
|
-
height,
|
|
106
|
-
bottom,
|
|
107
|
-
left,
|
|
108
|
-
right,
|
|
109
|
-
top,
|
|
110
|
-
width,
|
|
111
|
-
x,
|
|
112
|
-
y,
|
|
113
|
-
update
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
export function millisecondToHumanreadable(ms) {
|
|
117
|
-
if (ms < 1e3)
|
|
118
|
-
return [+ms.toFixed(0), "ms"];
|
|
119
|
-
if (ms < 1e3 * 60)
|
|
120
|
-
return [+(ms / 1e3).toFixed(1), "s"];
|
|
121
|
-
if (ms < 1e3 * 60 * 60)
|
|
122
|
-
return [+(ms / 1e3 / 60).toFixed(1), "min"];
|
|
123
|
-
return [+(ms / 1e3 / 60 / 60).toFixed(1), "hour"];
|
|
124
|
-
}
|
|
125
|
-
const topVarName = "--nuxt-devtools-safe-area-top";
|
|
126
|
-
const rightVarName = "--nuxt-devtools-safe-area-right";
|
|
127
|
-
const bottomVarName = "--nuxt-devtools-safe-area-bottom";
|
|
128
|
-
const leftVarName = "--nuxt-devtools-safe-area-left";
|
|
129
|
-
export function useScreenSafeArea() {
|
|
130
|
-
const top = ref(0);
|
|
131
|
-
const right = ref(0);
|
|
132
|
-
const bottom = ref(0);
|
|
133
|
-
const left = ref(0);
|
|
134
|
-
document.documentElement.style.setProperty(topVarName, "env(safe-area-inset-top, 0px)");
|
|
135
|
-
document.documentElement.style.setProperty(rightVarName, "env(safe-area-inset-right, 0px)");
|
|
136
|
-
document.documentElement.style.setProperty(bottomVarName, "env(safe-area-inset-bottom, 0px)");
|
|
137
|
-
document.documentElement.style.setProperty(leftVarName, "env(safe-area-inset-left, 0px)");
|
|
138
|
-
update();
|
|
139
|
-
useEventListener(window, "resize", update);
|
|
140
|
-
function getValue(position) {
|
|
141
|
-
return Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue(position)) || 0;
|
|
142
|
-
}
|
|
143
|
-
function update() {
|
|
144
|
-
top.value = getValue(topVarName);
|
|
145
|
-
right.value = getValue(rightVarName);
|
|
146
|
-
bottom.value = getValue(bottomVarName);
|
|
147
|
-
left.value = getValue(leftVarName);
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
top,
|
|
151
|
-
right,
|
|
152
|
-
bottom,
|
|
153
|
-
left,
|
|
154
|
-
update
|
|
155
|
-
};
|
|
156
|
-
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { defineNuxtModule } from '@nuxt/kit';
|
|
2
|
+
import { isGlobalInstall } from '../dirs.mjs';
|
|
3
|
+
|
|
4
|
+
const r=Object.create(null),i=e=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(e?r:globalThis),o=new Proxy(r,{get(e,s){return i()[s]??r[s]},has(e,s){const E=i();return s in E||s in r},set(e,s,E){const B=i(true);return B[s]=E,true},deleteProperty(e,s){if(!s)return false;const E=i(true);return delete E[s],true},ownKeys(){const e=i(true);return Object.keys(e)}}),t=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",f=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:true}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:true}],["CLOUDFLARE_WORKERS","WORKERS_CI",{ci:true}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:false}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:false}],["VERCEL","VERCEL_ENV",{ci:false}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:false}],["CODESANDBOX","CODESANDBOX_HOST",{ci:false}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:true}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"],["DENO-DEPLOY","DENO_DEPLOYMENT_ID"],["FIREBASE_APP_HOSTING","FIREBASE_APP_HOSTING",{ci:true}]];function b(){if(globalThis.process?.env)for(const e of f){const s=e[1]||e[0];if(globalThis.process?.env[s])return {name:e[0].toLowerCase(),...e[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:false}:{name:"",ci:false}}const l=b(),p=l.name;function n(e){return e?e!=="false":false}const I=globalThis.process?.platform||"",T=n(o.CI)||l.ci!==false,R=n(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);n(o.DEBUG);const a=t==="test"||n(o.TEST);n(o.MINIMAL)||T||a||!R;const A=/^win/i.test(I);!n(o.NO_COLOR)&&(n(o.FORCE_COLOR)||(R||A)&&o.TERM!=="dumb"||T);const C=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(C?.split(".")[0])||null;const W=globalThis.process||Object.create(null),_={versions:{}};new Proxy(W,{get(e,s){if(s==="env")return o;if(s in e)return e[s];if(s in _)return _[s]}});const O=globalThis.process?.release?.name==="node",c=!!globalThis.Bun||!!globalThis.process?.versions?.bun,D=!!globalThis.Deno,L=!!globalThis.fastly,S=!!globalThis.Netlify,u=!!globalThis.EdgeRuntime,N=globalThis.navigator?.userAgent==="Cloudflare-Workers",F=[[S,"netlify"],[u,"edge-light"],[N,"workerd"],[L,"fastly"],[D,"deno"],[c,"bun"],[O,"node"]];function G(){const e=F.find(s=>s[0]);if(e)return {name:e[1]}}const P=G();P?.name||"";
|
|
5
|
+
|
|
6
|
+
const WS_EVENT_NAME = "nuxt:devtools:rpc";
|
|
7
|
+
const isSandboxed = p === "stackblitz" || p === "codesandbox";
|
|
8
|
+
const defaultOptions = {
|
|
9
|
+
enabled: void 0,
|
|
10
|
+
// determine multiple conditions
|
|
11
|
+
componentInspector: true,
|
|
12
|
+
viteInspect: true,
|
|
13
|
+
vscode: {
|
|
14
|
+
enabled: true,
|
|
15
|
+
startOnBoot: false,
|
|
16
|
+
port: 3080,
|
|
17
|
+
reuseExistingServer: true
|
|
18
|
+
},
|
|
19
|
+
disableAuthorization: isSandboxed
|
|
20
|
+
};
|
|
21
|
+
const defaultTabOptions = {
|
|
22
|
+
behavior: {
|
|
23
|
+
telemetry: null,
|
|
24
|
+
openInEditor: void 0
|
|
25
|
+
},
|
|
26
|
+
ui: {
|
|
27
|
+
componentsView: "list",
|
|
28
|
+
componentsGraphShowNodeModules: false,
|
|
29
|
+
componentsGraphShowGlobalComponents: true,
|
|
30
|
+
componentsGraphShowPages: false,
|
|
31
|
+
componentsGraphShowLayouts: false,
|
|
32
|
+
componentsGraphShowWorkspace: true,
|
|
33
|
+
interactionCloseOnOutsideClick: false,
|
|
34
|
+
showExperimentalFeatures: false,
|
|
35
|
+
showHelpButtons: true,
|
|
36
|
+
showPanel: true,
|
|
37
|
+
scale: 1,
|
|
38
|
+
minimizePanelInactive: 5e3,
|
|
39
|
+
hiddenTabs: [],
|
|
40
|
+
pinnedTabs: [],
|
|
41
|
+
hiddenTabCategories: [],
|
|
42
|
+
sidebarExpanded: false,
|
|
43
|
+
sidebarScrollable: false
|
|
44
|
+
},
|
|
45
|
+
serverRoutes: {
|
|
46
|
+
selectedRoute: null,
|
|
47
|
+
view: "tree",
|
|
48
|
+
inputDefaults: {
|
|
49
|
+
query: [],
|
|
50
|
+
body: [],
|
|
51
|
+
headers: []
|
|
52
|
+
},
|
|
53
|
+
sendFrom: "app"
|
|
54
|
+
},
|
|
55
|
+
serverTasks: {
|
|
56
|
+
enabled: false,
|
|
57
|
+
selectedTask: null,
|
|
58
|
+
view: "list",
|
|
59
|
+
inputDefaults: {
|
|
60
|
+
query: [],
|
|
61
|
+
body: [],
|
|
62
|
+
headers: [{ active: true, key: "Content-Type", value: "application/json", type: "string" }]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
assets: {
|
|
66
|
+
view: "grid"
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const defaultAllowedExtensions = [
|
|
70
|
+
"png",
|
|
71
|
+
"jpg",
|
|
72
|
+
"jpeg",
|
|
73
|
+
"gif",
|
|
74
|
+
"svg",
|
|
75
|
+
"webp",
|
|
76
|
+
"ico",
|
|
77
|
+
"mp4",
|
|
78
|
+
"ogg",
|
|
79
|
+
"mp3",
|
|
80
|
+
"wav",
|
|
81
|
+
"mov",
|
|
82
|
+
"mkv",
|
|
83
|
+
"mpg",
|
|
84
|
+
"txt",
|
|
85
|
+
"ttf",
|
|
86
|
+
"woff",
|
|
87
|
+
"woff2",
|
|
88
|
+
"eot",
|
|
89
|
+
"json",
|
|
90
|
+
"js",
|
|
91
|
+
"jsx",
|
|
92
|
+
"ts",
|
|
93
|
+
"tsx",
|
|
94
|
+
"md",
|
|
95
|
+
"mdx",
|
|
96
|
+
"vue",
|
|
97
|
+
"webm"
|
|
98
|
+
];
|
|
99
|
+
|
|
100
|
+
const module = defineNuxtModule({
|
|
101
|
+
meta: {
|
|
102
|
+
name: "@nuxt/devtools",
|
|
103
|
+
configKey: "devtools"
|
|
104
|
+
},
|
|
105
|
+
defaults: defaultOptions,
|
|
106
|
+
setup(options, nuxt) {
|
|
107
|
+
if (process.env.VITEST || process.env.TEST)
|
|
108
|
+
return;
|
|
109
|
+
if (typeof options === "boolean")
|
|
110
|
+
options = { enabled: options };
|
|
111
|
+
if (options.enabled === false)
|
|
112
|
+
return;
|
|
113
|
+
if (isGlobalInstall()) {
|
|
114
|
+
const globalOptions = nuxt.options.devtoolsGlobal || {};
|
|
115
|
+
if (options.enabled !== true && !globalOptions.projects?.includes(nuxt.options.rootDir))
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
return import('../chunks/module-main.mjs').then(function (n) { return n.m; }).then(({ enableModule }) => enableModule(options, nuxt));
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
export { WS_EVENT_NAME as W, defaultTabOptions as a, defaultAllowedExtensions as d, module as m };
|
package/dist/types.d.mts
CHANGED