@nuxt/devtools-nightly 2.4.0-29091142.bbfd37e → 2.4.1-29150090.ad8f305
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 +16 -54
- package/dist/chunks/vscode.mjs +1 -1
- package/dist/client/200.html +23 -23
- package/dist/client/404.html +23 -23
- package/dist/client/_nuxt/__blank-mumgdw29.js +1 -0
- package/dist/client/_nuxt/analyze-build-f2qpp6jm.js +1 -0
- package/dist/client/_nuxt/assets-hnuh0mae.js +16 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/c48bebdc-b199-49c2-8188-dedb2e144aa9.json +1 -0
- package/dist/client/_nuxt/{client-jvnhv8ra.js → client-jlcyzfwz.js} +1 -1
- package/dist/client/_nuxt/code-diff.vue-b5lbtsap.js +8 -0
- package/dist/client/_nuxt/code-snippets.vue-b6zmibe7.js +1 -0
- package/dist/client/_nuxt/components-boqbn6wn.js +1 -0
- package/dist/client/_nuxt/composable-item.vue-e5jvlwop.js +1 -0
- package/dist/client/_nuxt/{custom-_name_-o7dv9kij.js → custom-_name_-btzoigcx.js} +1 -1
- package/dist/client/_nuxt/data-schema-button.vue-l4lxzyij.js +1 -0
- package/dist/client/_nuxt/{data-schema-drawer-nra0hqyp.js → data-schema-drawer-hd9tzog6.js} +2 -2
- package/dist/client/_nuxt/debug-9fwp3ytg.js +1 -0
- package/dist/client/_nuxt/{default-iucf9a1s.js → default-b7912fqb.js} +1 -1
- package/dist/client/_nuxt/{duration-display.vue-hy8s2ai6.js → duration-display.vue-l7hutejt.js} +1 -1
- package/dist/client/_nuxt/entry.css-gmgc8zz6.css +1 -0
- package/dist/client/_nuxt/{error-404-h1qekzux.js → error-404-j3kvqc8z.js} +1 -1
- package/dist/client/_nuxt/error-404.css-elh6uwdu.css +1 -0
- package/dist/client/_nuxt/{error-500-t2ub6siu.js → error-500-fpytr659.js} +1 -1
- package/dist/client/_nuxt/error-500.css-bxkdntg7.css +1 -0
- package/dist/client/_nuxt/{error-nc04qshe.js → error-h96ha3l5.js} +5 -5
- package/dist/client/_nuxt/{filepath-item.vue-ifezcc65.js → filepath-item.vue-pjacbi6e.js} +1 -1
- package/dist/client/_nuxt/full-ndf2cbnb.js +1 -0
- package/dist/client/_nuxt/{help-fab.vue-l40wc2st.js → help-fab.vue-gg941gpi.js} +1 -1
- package/dist/client/_nuxt/hooks-g9epqvqv.js +1 -0
- package/dist/client/_nuxt/{imports-ks2ns1wf.js → imports-o8fie52q.js} +1 -1
- package/dist/client/_nuxt/index-orgvtm8y.js +1 -0
- package/dist/client/_nuxt/kcxntt4c.js +15 -0
- package/dist/client/_nuxt/launch-page.vue-n602viwk.js +1 -0
- package/dist/client/_nuxt/modules-c754c74x.js +1 -0
- package/dist/client/_nuxt/nbadge-g97w4htj.js +1 -0
- package/dist/client/_nuxt/ncheckbox.vue-e9xa2wmo.js +1 -0
- package/dist/client/_nuxt/{ncode-block.vue-8qivpy1q.js → ncode-block.vue-lge6rogf.js} +1 -1
- package/dist/client/_nuxt/{ndrawer.vue-milk9g16.js → ndrawer.vue-k1x9j44v.js} +1 -1
- package/dist/client/_nuxt/ndropdown.vue-eqr6jtxu.js +1 -0
- package/dist/client/_nuxt/nicon-title.vue-d27ih16g.js +1 -0
- package/dist/client/_nuxt/{nlink.vue-hz7xx99l.js → nlink.vue-gv0kxm0q.js} +1 -1
- package/dist/client/_nuxt/nmarkdown.vue-isat7p33.js +1 -0
- package/dist/client/_nuxt/{nnavbar.vue-fyzefa7j.js → nnavbar.vue-npkjfqtu.js} +1 -1
- package/dist/client/_nuxt/none-no6wpjfq.js +1 -0
- package/dist/client/_nuxt/nsection-block-h8ljvdgq.js +1 -0
- package/dist/client/_nuxt/nselect-tabs.vue-f7fjeew6.js +1 -0
- package/dist/client/_nuxt/{nselect.vue-cspgavw4.js → nselect.vue-eg36z7xq.js} +1 -1
- package/dist/client/_nuxt/{nswitch.vue-n63sh5rf.js → nswitch.vue-f07mzo8x.js} +1 -1
- package/dist/client/_nuxt/open-graph-s33h1caw.js +3 -0
- package/dist/client/_nuxt/overview-etc49gqj.js +1 -0
- package/dist/client/_nuxt/pages-n09nkqmg.js +1 -0
- package/dist/client/_nuxt/payload-c7whkfb0.js +1 -0
- package/dist/client/_nuxt/pinia-birzn67w.js +1 -0
- package/dist/client/_nuxt/plugins-kam33ffh.js +1 -0
- package/dist/client/_nuxt/render-tree-o0447cew.js +1 -0
- package/dist/client/_nuxt/{runtime-configs-ecl9pb0m.js → runtime-configs-f07iylm6.js} +1 -1
- package/dist/client/_nuxt/{server-discovery-c7lnu84n.js → server-discovery-ekped2dy.js} +1 -1
- package/dist/client/_nuxt/{server-route-inputs.vue-byqawym7.js → server-route-inputs.vue-o9uv8sv5.js} +1 -1
- package/dist/client/_nuxt/{server-routes-jvxbktct.js → server-routes-ogw7poz3.js} +2 -2
- package/dist/client/_nuxt/server-tasks-o7f787bg.js +1 -0
- package/dist/client/_nuxt/settings-l57gc40v.js +1 -0
- package/dist/client/_nuxt/{stacktrace-list.vue-dsmfsr8d.js → stacktrace-list.vue-o9lrdclf.js} +1 -1
- package/dist/client/_nuxt/{state-components-dgy5t44w.js → state-components-lhda2i5c.js} +1 -1
- package/dist/client/_nuxt/state-editor.vue-f0gmtda7.js +1 -0
- package/dist/client/_nuxt/state-modules-ddtb2zpx.js +1 -0
- package/dist/client/_nuxt/storage-nfmfy7yx.js +1 -0
- package/dist/client/_nuxt/terminals-nz3pdt0w.js +1 -0
- package/dist/client/_nuxt/{timeline-n7qrr0h5.js → timeline-fntkjvvs.js} +2 -2
- package/dist/client/_nuxt/{unocss-runtime-kct8zzpi.js → unocss-runtime-n76zvjc0.js} +1 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-pb6xqf2y.js +3857 -0
- package/dist/client/_nuxt/vendor/{quicktype-core-d6crrn92.js → quicktype-core-lhaz4hgj.js} +57 -57
- package/dist/client/_nuxt/vendor/shiki-hjqm7vcp.js +152 -0
- package/dist/client/_nuxt/vendor/unocss-k776m6tm.js +2 -0
- package/dist/client/_nuxt/vendor/{vis-fth2qiu5.js → vis-gqe7ml2e.js} +2 -2
- package/dist/client/_nuxt/{virtual-files-ej2c9mxq.js → virtual-files-bx330vdo.js} +1 -1
- package/dist/client/_nuxt/vue-devtools-f2t5s0pw.js +2 -0
- package/dist/client/_nuxt/{vue-virtual-scroller.esm-iodr444e.js → vue-virtual-scroller.esm-nuoya9vo.js} +2 -2
- package/dist/client/index.html +23 -23
- 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-nightly.c069f83f.mjs → devtools-nightly.Dlu0WIXO.mjs} +1 -1
- 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 +46 -38
- package/types.d.ts +1 -1
- package/dist/client/_nuxt/__blank-catci4by.js +0 -1
- package/dist/client/_nuxt/analyze-build-jttd63ji.js +0 -1
- package/dist/client/_nuxt/assets-gglzn90t.js +0 -16
- package/dist/client/_nuxt/builds/meta/4a9bdca8-5c22-4fc7-8398-437f588e3c32.json +0 -1
- package/dist/client/_nuxt/code-diff.vue-k7idjz3p.js +0 -8
- package/dist/client/_nuxt/code-snippets.vue-g128u5r5.js +0 -1
- package/dist/client/_nuxt/components-kigyj3j5.js +0 -1
- package/dist/client/_nuxt/composable-item.vue-h5elegyf.js +0 -1
- package/dist/client/_nuxt/data-schema-button.vue-nju1b5wx.js +0 -1
- package/dist/client/_nuxt/debug-kjznaoju.js +0 -1
- package/dist/client/_nuxt/entry.css-kd26hpr1.css +0 -1
- package/dist/client/_nuxt/error-404.css-itl1ee4a.css +0 -1
- package/dist/client/_nuxt/error-500.css-biq96mi6.css +0 -1
- package/dist/client/_nuxt/full-ezcyueqe.js +0 -1
- package/dist/client/_nuxt/h41qhlrg.js +0 -15
- package/dist/client/_nuxt/hooks-fg8blpj2.js +0 -1
- package/dist/client/_nuxt/index-naevprq0.js +0 -1
- package/dist/client/_nuxt/launch-page.vue-es9mw8wq.js +0 -1
- package/dist/client/_nuxt/modules-n545sb0n.js +0 -1
- package/dist/client/_nuxt/nbadge-mvj0vtjl.js +0 -1
- package/dist/client/_nuxt/ncheckbox.vue-pl5ui7lh.js +0 -1
- package/dist/client/_nuxt/ndropdown.vue-pboodvft.js +0 -1
- package/dist/client/_nuxt/nicon-title.vue-m2ftlsrz.js +0 -1
- package/dist/client/_nuxt/nmarkdown.vue-hrdikzmp.js +0 -1
- package/dist/client/_nuxt/none-f4uo5y2t.js +0 -1
- package/dist/client/_nuxt/nsection-block-bs869psm.js +0 -1
- package/dist/client/_nuxt/nselect-tabs.vue-nnsdw54y.js +0 -1
- package/dist/client/_nuxt/open-graph-l849l3tf.js +0 -3
- package/dist/client/_nuxt/overview-bnjjyc0t.js +0 -1
- package/dist/client/_nuxt/pages-i5hb56o1.js +0 -1
- package/dist/client/_nuxt/payload-bnkrkjeo.js +0 -1
- package/dist/client/_nuxt/pinia-mobxec2a.js +0 -1
- package/dist/client/_nuxt/plugins-l1mazldj.js +0 -1
- package/dist/client/_nuxt/render-tree-h4kavos7.js +0 -1
- package/dist/client/_nuxt/server-tasks-jf5t32u9.js +0 -1
- package/dist/client/_nuxt/settings-hnydc4hu.js +0 -1
- package/dist/client/_nuxt/state-editor.vue-o6mvc5yx.js +0 -1
- package/dist/client/_nuxt/state-modules-mpfbsfka.js +0 -1
- package/dist/client/_nuxt/storage-chuzvi78.js +0 -1
- package/dist/client/_nuxt/terminals-7kdtt06d.js +0 -1
- package/dist/client/_nuxt/vendor/json-editor-vue-exjsfanq.js +0 -3872
- package/dist/client/_nuxt/vendor/shiki-hjrnbayr.js +0 -289
- package/dist/client/_nuxt/vendor/unocss-n30bmhn8.js +0 -2
- package/dist/client/_nuxt/vue-devtools-c54ommx5.js +0 -2
- 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-nightly.427ec2e8.d.ts +0 -57
- package/dist/types.d.ts +0 -41
- /package/dist/shared/{devtools-nightly.427ec2e8.d.mts → devtools-nightly.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 P=function(t,i){return getComputedStyle(t,null).getPropertyValue(i)},Pe=function(t){return P(t,"overflow")+P(t,"overflow-y")+P(t,"overflow-x")},Le=function(t){return Ee.test(Pe(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(Le(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),($(),L(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=>($(),L(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-
|
|
9
|
-
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/vendor/shiki-
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/kcxntt4c.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
|
+
<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-b7912fqb.js">
|
|
12
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/full-ndf2cbnb.js">
|
|
13
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/none-no6wpjfq.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-hd9tzog6.js">
|
|
16
|
+
<link rel="prefetch" as="script" crossorigin href="/__NUXT_DEVTOOLS_BASE__/_nuxt/nselect.vue-eg36z7xq.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-eqr6jtxu.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-k1x9j44v.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-j3kvqc8z.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-fpytr659.js">
|
|
28
|
+
<script type="module" src="/__NUXT_DEVTOOLS_BASE__/_nuxt/kcxntt4c.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},1749005451925,false]</script>
|
|
29
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__NUXT_DEVTOOLS_BASE__/",buildId:"c48bebdc-b199-49c2-8188-dedb2e144aa9",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
|
-
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtModule } from '@nuxt/kit';
|
|
2
2
|
import { isGlobalInstall } from '../dirs.mjs';
|
|
3
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(
|
|
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
5
|
|
|
6
6
|
const WS_EVENT_NAME = "nuxt:devtools:rpc";
|
|
7
7
|
const isSandboxed = p === "stackblitz" || p === "codesandbox";
|
package/dist/types.d.mts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { VueElementConstructor } from 'vue';
|
|
2
|
+
import { ElementTraceInfo } from 'vite-plugin-vue-tracer/client/record';
|
|
3
|
+
|
|
4
|
+
interface NuxtDevToolsInspectorProps {
|
|
5
|
+
matched?: ElementTraceInfo;
|
|
6
|
+
mouse: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare const NuxtDevtoolsFrame: VueElementConstructor<{
|
|
13
|
+
props: NuxtDevToolsInspectorProps;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
declare const NuxtDevtoolsInspectPanel: VueElementConstructor<{
|
|
17
|
+
props: NuxtDevToolsInspectorProps;
|
|
18
|
+
}>;
|
|
19
|
+
|
|
20
|
+
export { type NuxtDevToolsInspectorProps, NuxtDevtoolsFrame, NuxtDevtoolsInspectPanel };
|