@aevantec/litevue 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/dist/litevue-devtools.iife.js +1 -1
- package/dist/litevue-devtools.mjs +14 -2
- package/dist/litevue-devtools.umd.js +1 -1
- package/dist/litevue-plugins.iife.js +1 -1
- package/dist/litevue-plugins.mjs +178 -1
- package/dist/litevue-plugins.umd.js +1 -1
- package/dist/litevue.iife.js +2 -2
- package/dist/litevue.mjs +81 -1
- package/dist/litevue.umd.js +2 -2
- package/dist/types/context.d.mts +7 -0
- package/dist/types/context.d.ts +7 -0
- package/dist/types/index.d.mts +2 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/plugins/index.d.mts +2 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/morph.d.mts +34 -0
- package/dist/types/plugins/morph.d.ts +34 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,14 +6,15 @@ Published on npm as **[`@aevantec/litevue`](https://www.npmjs.com/package/@aevan
|
|
|
6
6
|
unscoped name is blocked by an unrelated `lite-vue` package. The IIFE/UMD global
|
|
7
7
|
stays `LiteVue`.
|
|
8
8
|
|
|
9
|
-
- **~
|
|
9
|
+
- **~9kb** gzipped core, driven by the real `@vue/reactivity`
|
|
10
10
|
- Vue-compatible syntax: `{{ }}`, `v-if`/`v-for` (keyed), `v-model`, `v-show`, …
|
|
11
11
|
- **Built-in devtools** — in-page inspector panel + browser extension, one line to disable in production
|
|
12
12
|
- **Transitions** that work with `v-show` *and* `v-if` (deferred unmount)
|
|
13
|
-
- **Plugin system** with first-party plugins: intersect, persist, focus (+trap), collapse, transition, mask
|
|
13
|
+
- **Plugin system** with first-party plugins: intersect, persist, focus (+trap), collapse, transition, mask, morph
|
|
14
14
|
- **Global store** (`store()` / `$store`) and magic properties (`$dispatch`, `$watch`, `$id`, `$root`, …)
|
|
15
|
+
- **Cached derived state** with `computed()`, alongside `reactive()` and `watchEffect()`
|
|
15
16
|
- Extra event modifiers: `.outside`, `.window`, `.debounce`, `.throttle`, animation-event filters
|
|
16
|
-
- Safe with dynamic content: injected markup stays inert until explicitly mounted
|
|
17
|
+
- Safe with dynamic content: injected markup stays inert until explicitly mounted, and `morph` updates a server-rendered region in place without losing scope state, focus or scroll
|
|
17
18
|
|
|
18
19
|
## Quick start
|
|
19
20
|
|
|
@@ -47,7 +48,7 @@ Full documentation lives in the **[docs site](https://litevue.dev/)** (source in
|
|
|
47
48
|
- [Essentials](https://litevue.dev/essentials/) — state, templating, components, lifecycle, dynamic content
|
|
48
49
|
- [Directives](https://litevue.dev/directives/) — a page per directive, with live demos
|
|
49
50
|
- [Magics](https://litevue.dev/magics/) — `$el`, `$store`, `$dispatch`, `$watch`, `$id`, …
|
|
50
|
-
- [Globals](https://litevue.dev/globals/) — `createApp()`, `store()`, the devtools API
|
|
51
|
+
- [Globals](https://litevue.dev/globals/) — `createApp()`, `store()`, `computed()`, `watchEffect()`, the devtools API
|
|
51
52
|
- [Plugins](https://litevue.dev/plugins/) — the plugin system and all first-party plugins
|
|
52
53
|
- [Devtools](https://litevue.dev/devtools/) — inspector panel, browser extension, production kill-switch
|
|
53
54
|
- [Migrating from petite-vue](https://litevue.dev/migration/from-petite-vue) · [Coming from Alpine](https://litevue.dev/migration/from-alpine)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var LiteVueDevtoolsPanel=function(e){"use strict";let n,t,o,r,i,l,d,a,s,p,c,h=null,u=null,v=!1,x="",g="Elements";const m=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",y="litevue-devtools-theme",f="litevue-devtools-ui",b=()=>{try{return JSON.parse(localStorage.getItem(f)||"{}")}catch{return{}}},w=e=>{try{localStorage.setItem(f,JSON.stringify({...b(),...e}))}catch{}},k={dark:m('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:m('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:m('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},C={dark:"light",light:"system",system:"dark"};let E="dark";try{const e=localStorage.getItem(y);"light"!==e&&"system"!==e||(E=e)}catch{}const L=matchMedia("(prefers-color-scheme: light)"),O=()=>{const e="light"===E||"system"===E&&L.matches;t.host.classList.toggle("light",e),a.innerHTML=k[E],a.title="theme: "+E},S=new Set,N=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},$=e=>{const n=N("span","label");return n.appendChild(N("span","punct","<")),n.appendChild(N("span","name",D(e))),n.appendChild(N("span","punct",">")),n},T=e=>{let t=0,o=e.parentElement;for(;o;)n.scopes.has(o)&&t++,o=o.parentElement;return t},_=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},z=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},I=()=>{s.style.display="none"},j=e=>{e!==h&&S.clear(),u=null,h=e,g="Elements",window.$scope=e?n.scopes.get(e):void 0,V(),H()},M=e=>{e!==u&&S.clear(),h=null,u=e,g="Stores",window.$scope=n.stores.get(e),V(),H()},P=e=>{g=e,V()},D=e=>n.names.get(e)||e.id||e.tagName.toLowerCase(),V=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===g?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===g?"tab active":"tab"})(),i.textContent="","Elements"===g){const e=[...n.scopes.keys()].filter(e=>D(e).toLowerCase().includes(x)).sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);if(!e.length)return void i.appendChild(N("div","empty",x?"no matching scopes":"no scopes mounted"));for(const t of e){const e=N("div",t===h?"row sel":"row");e.style.paddingLeft=8+12*T(t)+"px",e.appendChild($(t));const o=n.exps.get(t);o&&e.appendChild(N("span","exp"," "+o)),e.onclick=()=>j(t),e.onmouseenter=()=>z(t),e.onmouseleave=I,i.appendChild(e)}return}const e=[...n.stores?n.stores.keys():[]].filter(e=>e.toLowerCase().includes(x));if(e.length)for(const n of e){const e=N("div",n===u?"row sel":"row"),t=N("span","label");t.appendChild(N("span","punct","$store.")),t.appendChild(N("span","name",n)),e.appendChild(t),e.onclick=()=>M(n),i.appendChild(e)}else i.appendChild(N("div","empty",x?"no matching stores":"no stores registered"))},H=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=u?n.stores.get(u):h?n.scopes.get(h):void 0;if(!e)return void l.appendChild(N("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>W(n,e,n,0,"prop",[])),r.length&&(l.appendChild(N("div","divider","inherited")),r.forEach(n=>W(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(N("div","empty","empty scope")),l.appendChild(R(e))},R=e=>{const n=N("div","prop adder");n.appendChild(N("span","spacer"));const t=N("input","val key-in");t.placeholder="key";const o=N("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),X(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},W=(e,n,t,o,r,i)=>{const d=n[e],a=N("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&S.has(t);if(a.appendChild(N("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(N("span","key",e)),a.appendChild(N("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${_(e)}`:_(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?S.delete(t):S.add(t),H()}),A(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=N("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)W(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(N("span","spacer")),a.appendChild(N("span","key",e));const s=Object.getOwnPropertyDescriptor(n,e);if("function"==typeof d)a.appendChild(N("span","preview","\u0192"));else if(s&&s.get&&!s.set)a.appendChild(N("span","preview",_(d)));else if("boolean"==typeof d){a.appendChild(N("span","bool",String(d)));const t=N("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),X()},a.appendChild(t)}else{const t=N("input","val");t.value=_(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=_(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,X()):t.value=_(d)},a.appendChild(t)}A(a,n,e,o,r),l.appendChild(a)},A=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=N("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],X()},e.appendChild(d)},B=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),J();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&j(r)},F=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?z(o):I()}},J=()=>{v=!1,d.classList.remove("active"),I(),document.removeEventListener("click",B,!0),document.removeEventListener("mousemove",F,!0)};let U=!1;const X=()=>{U||(U=!0,setTimeout(()=>{U=!1,"none"!==o.style.display&&(V(),H())}))},Y=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const u=document.createElement("style");u.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 200px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(u),s=N("div","highlight"),t.appendChild(s),r=N("div","pill","\u26a1 LiteVue"),r.onclick=()=>{r.style.display="none",o.style.display="flex",w({open:!0}),X()},t.appendChild(r),o=N("div","panel"),o.style.display="none";const g=N("div","header");g.appendChild(N("span","title","\u26a1 LiteVue")),g.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=Math.max(0,t-(e.clientX-i))+"px",o.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),w({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),a=N("button","btn"),a.onclick=()=>{E=C[E];try{localStorage.setItem(y,E)}catch{}O()},g.appendChild(a),L.addEventListener("change",()=>{"system"===E&&O()}),O(),d=N("button","btn"),d.title="pick an element on the page",d.innerHTML=m('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>v?J():(v=!0,d.classList.add("active"),document.addEventListener("click",B,!0),void document.addEventListener("mousemove",F,!0)),g.appendChild(d);const f=N("button","btn","\u2715");f.onclick=()=>{v&&J(),o.style.display="none",r.style.display="",w({open:!1})},g.appendChild(f),o.appendChild(g);const k=N("div","body"),S=N("div","side"),$=N("div","tabs");p=N("div","tab active"),p.onclick=()=>P("Elements"),c=N("div","tab"),c.onclick=()=>P("Stores"),$.appendChild(p),$.appendChild(c),S.appendChild($);const T=N("input","filter");T.placeholder="Filter by name",T.oninput=()=>{x=T.value.trim().toLowerCase(),V()},T.onkeydown=e=>{"Escape"===e.key&&(T.value="",x="",V())},S.appendChild(T),i=N("div","tree"),S.appendChild(i),l=N("div","state"),k.appendChild(S),k.appendChild(l),o.appendChild(k),t.appendChild(o);const _=b();if(null!=_.right&&(o.style.right=_.right+"px"),null!=_.bottom&&(o.style.bottom=_.bottom+"px"),_.w&&(o.style.width=_.w+"px"),_.h&&(o.style.height=_.h+"px"),_.open&&(r.style.display="none",o.style.display="flex",X()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==o.style.display&&o.offsetWidth&&w({w:o.offsetWidth,h:o.offsetHeight})},300)}).observe(o)}document.body.appendChild(e),n.on("scope:mount",X),n.on("scope:unmount",e=>{e===h&&(h=null),X()}),n.stores&&n.on("store:register",X),n.on("flush",X)},q=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?Y():addEventListener("DOMContentLoaded",Y)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return q(),e.init=q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
|
1
|
+
var LiteVueDevtoolsPanel=function(e){"use strict";let n,t,o,r,i,l,d,a,s,p,c,h=null,u=null,v=!1,g="",x="Elements";const f=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",y="litevue-devtools-theme",m="litevue-devtools-ui",b=()=>{try{return JSON.parse(localStorage.getItem(m)||"{}")}catch{return{}}},w=e=>{try{localStorage.setItem(m,JSON.stringify({...b(),...e}))}catch{}},k={dark:f('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:f('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:f('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},C={dark:"light",light:"system",system:"dark"};let E="dark";try{const e=localStorage.getItem(y);"light"!==e&&"system"!==e||(E=e)}catch{}const L=matchMedia("(prefers-color-scheme: light)"),O=()=>{const e="light"===E||"system"===E&&L.matches;t.host.classList.toggle("light",e),a.innerHTML=k[E],a.title="theme: "+E},S=new Set,_=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},N=e=>{const n=_("span","label");return n.appendChild(_("span","punct","<")),n.appendChild(_("span","name",D(e))),n.appendChild(_("span","punct",">")),n},$=e=>{let t=0,o=e.parentElement;for(;o;)n.scopes.has(o)&&t++,o=o.parentElement;return t},j=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},T=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},z=()=>{s.style.display="none"},I=e=>{e!==h&&S.clear(),u=null,h=e,x="Elements",window.$scope=e?n.scopes.get(e):void 0,V(),R()},P=e=>{e!==u&&S.clear(),h=null,u=e,x="Stores",window.$scope=n.stores.get(e),V(),R()},M=e=>{x=e,V()},D=e=>n.names.get(e)||e.id||e.tagName.toLowerCase(),V=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===x?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===x?"tab active":"tab"})(),i.textContent="","Elements"===x){const e=[...n.scopes.keys()].filter(e=>D(e).toLowerCase().includes(g)).sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);if(!e.length)return void i.appendChild(_("div","empty",g?"no matching scopes":"no scopes mounted"));for(const t of e){const e=_("div",t===h?"row sel":"row");e.style.paddingLeft=8+12*$(t)+"px",e.appendChild(N(t));const o=n.exps.get(t);o&&e.appendChild(_("span","exp"," "+o)),e.onclick=()=>I(t),e.onmouseenter=()=>T(t),e.onmouseleave=z,i.appendChild(e)}return}const e=[...n.stores?n.stores.keys():[]].filter(e=>e.toLowerCase().includes(g));if(e.length)for(const n of e){const e=_("div",n===u?"row sel":"row"),t=_("span","label");t.appendChild(_("span","punct","$store.")),t.appendChild(_("span","name",n)),e.appendChild(t),e.onclick=()=>P(n),i.appendChild(e)}else i.appendChild(_("div","empty",g?"no matching stores":"no stores registered"))},R=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=u?n.stores.get(u):h?n.scopes.get(h):void 0;if(!e)return void l.appendChild(_("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>W(n,e,n,0,"prop",[])),r.length&&(l.appendChild(_("div","divider","inherited")),r.forEach(n=>W(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(_("div","empty","empty scope")),l.appendChild(H(e))},H=e=>{const n=_("div","prop adder");n.appendChild(_("span","spacer"));const t=_("input","val key-in");t.placeholder="key";const o=_("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),X(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},W=(e,n,t,o,r,i)=>{const d=n[e],a=_("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&S.has(t);if(a.appendChild(_("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(_("span","key",e)),a.appendChild(_("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${j(e)}`:j(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?S.delete(t):S.add(t),R()}),A(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=_("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)W(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(_("span","spacer")),a.appendChild(_("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(_("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(_("span","preview",j(d)));else if("boolean"==typeof d){a.appendChild(_("span","bool",String(d)));const t=_("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),X()},a.appendChild(t)}else{const t=_("input","val");t.value=j(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=j(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,X()):t.value=j(d)},a.appendChild(t)}A(a,n,e,o,r),l.appendChild(a)},A=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=_("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],X()},e.appendChild(d)},B=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),J();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&I(r)},F=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?T(o):z()}},J=()=>{v=!1,d.classList.remove("active"),z(),document.removeEventListener("click",B,!0),document.removeEventListener("mousemove",F,!0)};let U=!1;const X=()=>{U||(U=!0,setTimeout(()=>{U=!1,"none"!==o.style.display&&(V(),R())}))},Y=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const u=document.createElement("style");u.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 200px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(u),s=_("div","highlight"),t.appendChild(s),r=_("div","pill","\u26a1 LiteVue"),r.onclick=()=>{r.style.display="none",o.style.display="flex",w({open:!0}),X()},t.appendChild(r),o=_("div","panel"),o.style.display="none";const x=_("div","header");x.appendChild(_("span","title","\u26a1 LiteVue")),x.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=Math.max(0,t-(e.clientX-i))+"px",o.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),w({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),a=_("button","btn"),a.onclick=()=>{E=C[E];try{localStorage.setItem(y,E)}catch{}O()},x.appendChild(a),L.addEventListener("change",()=>{"system"===E&&O()}),O(),d=_("button","btn"),d.title="pick an element on the page",d.innerHTML=f('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>v?J():(v=!0,d.classList.add("active"),document.addEventListener("click",B,!0),void document.addEventListener("mousemove",F,!0)),x.appendChild(d);const m=_("button","btn","\u2715");m.onclick=()=>{v&&J(),o.style.display="none",r.style.display="",w({open:!1})},x.appendChild(m),o.appendChild(x);const k=_("div","body"),S=_("div","side"),N=_("div","tabs");p=_("div","tab active"),p.onclick=()=>M("Elements"),c=_("div","tab"),c.onclick=()=>M("Stores"),N.appendChild(p),N.appendChild(c),S.appendChild(N);const $=_("input","filter");$.placeholder="Filter by name",$.oninput=()=>{g=$.value.trim().toLowerCase(),V()},$.onkeydown=e=>{"Escape"===e.key&&($.value="",g="",V())},S.appendChild($),i=_("div","tree"),S.appendChild(i),l=_("div","state"),k.appendChild(S),k.appendChild(l),o.appendChild(k),t.appendChild(o);const j=b();if(null!=j.right&&(o.style.right=j.right+"px"),null!=j.bottom&&(o.style.bottom=j.bottom+"px"),j.w&&(o.style.width=j.w+"px"),j.h&&(o.style.height=j.h+"px"),j.open&&(r.style.display="none",o.style.display="flex",X()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==o.style.display&&o.offsetWidth&&w({w:o.offsetWidth,h:o.offsetHeight})},300)}).observe(o)}document.body.appendChild(e),n.on("scope:mount",X),n.on("scope:unmount",e=>{e===h&&(h=null),X()}),n.stores&&n.on("store:register",X),n.on("flush",X)},q=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?Y():addEventListener("DOMContentLoaded",Y)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};return q(),e.init=q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
|
@@ -397,6 +397,18 @@ const coerce = (raw, old) => {
|
|
|
397
397
|
}
|
|
398
398
|
return raw;
|
|
399
399
|
};
|
|
400
|
+
const descriptorOf = (o, key) => {
|
|
401
|
+
for (let t = o; t && t !== Object.prototype; t = Object.getPrototypeOf(t)) {
|
|
402
|
+
const d = Object.getOwnPropertyDescriptor(t, key);
|
|
403
|
+
if (d) return d;
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
const isReadOnly = (desc) => {
|
|
407
|
+
if (!desc) return false;
|
|
408
|
+
if (desc.get && !desc.set) return true;
|
|
409
|
+
const raw = desc.value;
|
|
410
|
+
return !!raw && raw.__v_isRef === true && raw.__v_isReadonly === true;
|
|
411
|
+
};
|
|
400
412
|
const collectProps = (scope) => {
|
|
401
413
|
const isData = (o, k) => k[0] !== "$" && typeof o[k] !== "function";
|
|
402
414
|
const own = Object.keys(scope).filter((k) => isData(scope, k));
|
|
@@ -591,10 +603,10 @@ const addNode = (key, container, path, depth, cls, ancestors) => {
|
|
|
591
603
|
}
|
|
592
604
|
row.appendChild(h("span", "spacer"));
|
|
593
605
|
row.appendChild(h("span", "key", key));
|
|
594
|
-
const desc =
|
|
606
|
+
const desc = descriptorOf(container, key);
|
|
595
607
|
if (typeof v === "function") {
|
|
596
608
|
row.appendChild(h("span", "preview", "ƒ"));
|
|
597
|
-
} else if (desc
|
|
609
|
+
} else if (isReadOnly(desc)) {
|
|
598
610
|
row.appendChild(h("span", "preview", fmt(v)));
|
|
599
611
|
} else if (typeof v === "boolean") {
|
|
600
612
|
row.appendChild(h("span", "bool", String(v)));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){"use strict";let n,t,o,r,i,l,d,a,s,p,c,h=null,u=null,v=!1,x="",g="Elements";const f=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",y="litevue-devtools-theme",m="litevue-devtools-ui",b=()=>{try{return JSON.parse(localStorage.getItem(m)||"{}")}catch{return{}}},w=e=>{try{localStorage.setItem(m,JSON.stringify({...b(),...e}))}catch{}},k={dark:f('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:f('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:f('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},C={dark:"light",light:"system",system:"dark"};let E="dark";try{const e=localStorage.getItem(y);"light"!==e&&"system"!==e||(E=e)}catch{}const L=matchMedia("(prefers-color-scheme: light)"),O=()=>{const e="light"===E||"system"===E&&L.matches;t.host.classList.toggle("light",e),a.innerHTML=k[E],a.title="theme: "+E},S=new Set,N=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},T=e=>{const n=N("span","label");return n.appendChild(N("span","punct","<")),n.appendChild(N("span","name",D(e))),n.appendChild(N("span","punct",">")),n},$=e=>{let t=0,o=e.parentElement;for(;o;)n.scopes.has(o)&&t++,o=o.parentElement;return t},_=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},j=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},z=()=>{s.style.display="none"},I=e=>{e!==h&&S.clear(),u=null,h=e,g="Elements",window.$scope=e?n.scopes.get(e):void 0,V(),H()},M=e=>{e!==u&&S.clear(),h=null,u=e,g="Stores",window.$scope=n.stores.get(e),V(),H()},P=e=>{g=e,V()},D=e=>n.names.get(e)||e.id||e.tagName.toLowerCase(),V=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===g?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===g?"tab active":"tab"})(),i.textContent="","Elements"===g){const e=[...n.scopes.keys()].filter(e=>D(e).toLowerCase().includes(x)).sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);if(!e.length)return void i.appendChild(N("div","empty",x?"no matching scopes":"no scopes mounted"));for(const t of e){const e=N("div",t===h?"row sel":"row");e.style.paddingLeft=8+12*$(t)+"px",e.appendChild(T(t));const o=n.exps.get(t);o&&e.appendChild(N("span","exp"," "+o)),e.onclick=()=>I(t),e.onmouseenter=()=>j(t),e.onmouseleave=z,i.appendChild(e)}return}const e=[...n.stores?n.stores.keys():[]].filter(e=>e.toLowerCase().includes(x));if(e.length)for(const n of e){const e=N("div",n===u?"row sel":"row"),t=N("span","label");t.appendChild(N("span","punct","$store.")),t.appendChild(N("span","name",n)),e.appendChild(t),e.onclick=()=>M(n),i.appendChild(e)}else i.appendChild(N("div","empty",x?"no matching stores":"no stores registered"))},H=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=u?n.stores.get(u):h?n.scopes.get(h):void 0;if(!e)return void l.appendChild(N("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>W(n,e,n,0,"prop",[])),r.length&&(l.appendChild(N("div","divider","inherited")),r.forEach(n=>W(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(N("div","empty","empty scope")),l.appendChild(R(e))},R=e=>{const n=N("div","prop adder");n.appendChild(N("span","spacer"));const t=N("input","val key-in");t.placeholder="key";const o=N("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),X(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},W=(e,n,t,o,r,i)=>{const d=n[e],a=N("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&S.has(t);if(a.appendChild(N("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(N("span","key",e)),a.appendChild(N("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${_(e)}`:_(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?S.delete(t):S.add(t),H()}),A(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=N("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)W(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(N("span","spacer")),a.appendChild(N("span","key",e));const s=Object.getOwnPropertyDescriptor(n,e);if("function"==typeof d)a.appendChild(N("span","preview","\u0192"));else if(s&&s.get&&!s.set)a.appendChild(N("span","preview",_(d)));else if("boolean"==typeof d){a.appendChild(N("span","bool",String(d)));const t=N("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),X()},a.appendChild(t)}else{const t=N("input","val");t.value=_(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=_(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,X()):t.value=_(d)},a.appendChild(t)}A(a,n,e,o,r),l.appendChild(a)},A=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=N("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],X()},e.appendChild(d)},B=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),J();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&I(r)},F=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?j(o):z()}},J=()=>{v=!1,d.classList.remove("active"),z(),document.removeEventListener("click",B,!0),document.removeEventListener("mousemove",F,!0)};let U=!1;const X=()=>{U||(U=!0,setTimeout(()=>{U=!1,"none"!==o.style.display&&(V(),H())}))},Y=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const u=document.createElement("style");u.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 200px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(u),s=N("div","highlight"),t.appendChild(s),r=N("div","pill","\u26a1 LiteVue"),r.onclick=()=>{r.style.display="none",o.style.display="flex",w({open:!0}),X()},t.appendChild(r),o=N("div","panel"),o.style.display="none";const g=N("div","header");g.appendChild(N("span","title","\u26a1 LiteVue")),g.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=Math.max(0,t-(e.clientX-i))+"px",o.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),w({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),a=N("button","btn"),a.onclick=()=>{E=C[E];try{localStorage.setItem(y,E)}catch{}O()},g.appendChild(a),L.addEventListener("change",()=>{"system"===E&&O()}),O(),d=N("button","btn"),d.title="pick an element on the page",d.innerHTML=f('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>v?J():(v=!0,d.classList.add("active"),document.addEventListener("click",B,!0),void document.addEventListener("mousemove",F,!0)),g.appendChild(d);const m=N("button","btn","\u2715");m.onclick=()=>{v&&J(),o.style.display="none",r.style.display="",w({open:!1})},g.appendChild(m),o.appendChild(g);const k=N("div","body"),S=N("div","side"),T=N("div","tabs");p=N("div","tab active"),p.onclick=()=>P("Elements"),c=N("div","tab"),c.onclick=()=>P("Stores"),T.appendChild(p),T.appendChild(c),S.appendChild(T);const $=N("input","filter");$.placeholder="Filter by name",$.oninput=()=>{x=$.value.trim().toLowerCase(),V()},$.onkeydown=e=>{"Escape"===e.key&&($.value="",x="",V())},S.appendChild($),i=N("div","tree"),S.appendChild(i),l=N("div","state"),k.appendChild(S),k.appendChild(l),o.appendChild(k),t.appendChild(o);const _=b();if(null!=_.right&&(o.style.right=_.right+"px"),null!=_.bottom&&(o.style.bottom=_.bottom+"px"),_.w&&(o.style.width=_.w+"px"),_.h&&(o.style.height=_.h+"px"),_.open&&(r.style.display="none",o.style.display="flex",X()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==o.style.display&&o.offsetWidth&&w({w:o.offsetWidth,h:o.offsetHeight})},300)}).observe(o)}document.body.appendChild(e),n.on("scope:mount",X),n.on("scope:unmount",e=>{e===h&&(h=null),X()}),n.stores&&n.on("store:register",X),n.on("flush",X)},q=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?Y():addEventListener("DOMContentLoaded",Y)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};q(),e.init=q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVueDevtoolsPanel={})}(this,function(e){"use strict";let n,t,o,r,i,l,d,a,s,p,c,h=null,u=null,v=!1,f="",x="Elements";const g=e=>'<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'+e+"</svg>",y="litevue-devtools-theme",b="litevue-devtools-ui",m=()=>{try{return JSON.parse(localStorage.getItem(b)||"{}")}catch{return{}}},w=e=>{try{localStorage.setItem(b,JSON.stringify({...m(),...e}))}catch{}},k={dark:g('<path d="M21 12.8A9 9 0 1 1 11.2 3 7 7 0 0 0 21 12.8z"/>'),light:g('<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.2" y1="4.2" x2="5.6" y2="5.6"/><line x1="18.4" y1="18.4" x2="19.8" y2="19.8"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.2" y1="19.8" x2="5.6" y2="18.4"/><line x1="18.4" y1="5.6" x2="19.8" y2="4.2"/>'),system:g('<rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>')},C={dark:"light",light:"system",system:"dark"};let E="dark";try{const e=localStorage.getItem(y);"light"!==e&&"system"!==e||(E=e)}catch{}const L=matchMedia("(prefers-color-scheme: light)"),O=()=>{const e="light"===E||"system"===E&&L.matches;t.host.classList.toggle("light",e),a.innerHTML=k[E],a.title="theme: "+E},S=new Set,_=(e,n,t)=>{const o=document.createElement(e);return o.className=n,null!=t&&(o.textContent=t),o},N=e=>{const n=_("span","label");return n.appendChild(_("span","punct","<")),n.appendChild(_("span","name",D(e))),n.appendChild(_("span","punct",">")),n},T=e=>{let t=0,o=e.parentElement;for(;o;)n.scopes.has(o)&&t++,o=o.parentElement;return t},j=e=>{let n;try{n=void 0===e?"undefined":JSON.stringify(e)??String(e)}catch(t){n=String(e)}return n.length>60?n.slice(0,60)+"\u2026":n},$=e=>{const n=e.getBoundingClientRect();s.style.cssText=`display:block;left:${n.left}px;top:${n.top}px;width:${n.width}px;height:${n.height}px`},z=()=>{s.style.display="none"},I=e=>{e!==h&&S.clear(),u=null,h=e,x="Elements",window.$scope=e?n.scopes.get(e):void 0,V(),R()},P=e=>{e!==u&&S.clear(),h=null,u=e,x="Stores",window.$scope=n.stores.get(e),V(),R()},M=e=>{x=e,V()},D=e=>n.names.get(e)||e.id||e.tagName.toLowerCase(),V=()=>{if((()=>{const e=n.stores?n.stores.size:0;p.textContent=`Elements (${n.scopes.size})`,p.className="Elements"===x?"tab active":"tab",c.textContent=`Stores (${e})`,c.className="Stores"===x?"tab active":"tab"})(),i.textContent="","Elements"===x){const e=[...n.scopes.keys()].filter(e=>D(e).toLowerCase().includes(f)).sort((e,n)=>e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1);if(!e.length)return void i.appendChild(_("div","empty",f?"no matching scopes":"no scopes mounted"));for(const t of e){const e=_("div",t===h?"row sel":"row");e.style.paddingLeft=8+12*T(t)+"px",e.appendChild(N(t));const o=n.exps.get(t);o&&e.appendChild(_("span","exp"," "+o)),e.onclick=()=>I(t),e.onmouseenter=()=>$(t),e.onmouseleave=z,i.appendChild(e)}return}const e=[...n.stores?n.stores.keys():[]].filter(e=>e.toLowerCase().includes(f));if(e.length)for(const n of e){const e=_("div",n===u?"row sel":"row"),t=_("span","label");t.appendChild(_("span","punct","$store.")),t.appendChild(_("span","name",n)),e.appendChild(t),e.onclick=()=>P(n),i.appendChild(e)}else i.appendChild(_("div","empty",f?"no matching stores":"no stores registered"))},R=()=>{if(l.contains(t.activeElement))return;l.textContent="";const e=u?n.stores.get(u):h?n.scopes.get(h):void 0;if(!e)return void l.appendChild(_("div","empty","Select a scope"));const{own:o,inherited:r}=(e=>{const n=(e,n)=>"$"!==n[0]&&"function"!=typeof e[n],t=Object.keys(e).filter(t=>n(e,t)),o=new Set(t),r=[];let i=Object.getPrototypeOf(e);for(;i&&i!==Object.prototype;){for(const e of Object.keys(i))!o.has(e)&&n(i,e)&&(o.add(e),r.push(e));i=Object.getPrototypeOf(i)}return{own:t,inherited:r}})(e);o.forEach(n=>W(n,e,n,0,"prop",[])),r.length&&(l.appendChild(_("div","divider","inherited")),r.forEach(n=>W(n,e,n,0,"prop inherited",[]))),o.length||r.length||l.appendChild(_("div","empty","empty scope")),l.appendChild(H(e))},H=e=>{const n=_("div","prop adder");n.appendChild(_("span","spacer"));const t=_("input","val key-in");t.placeholder="key";const o=_("input","val");o.placeholder="value";return t.onkeydown=o.onkeydown=n=>{"Enter"===n.key&&(()=>{const n=t.value.trim();if(!n)return;const r=o.value;let i=r;"true"===r?i=!0:"false"===r?i=!1:""===r||isNaN(+r)||(i=+r),e[n]=i,t.blur(),o.blur(),X(),setTimeout(()=>{const e=l.querySelector(".adder .key-in");e&&e.focus()})})()},n.appendChild(t),n.appendChild(o),n},W=(e,n,t,o,r,i)=>{const d=n[e],a=_("div",r);if(a.style.paddingLeft=8+14*o+"px",null!==d&&"object"==typeof d){const s=i.indexOf(d)>-1,p=!s&&S.has(t);if(a.appendChild(_("span",p?"arrow open":"arrow","\u25b6")),a.appendChild(_("span","key",e)),a.appendChild(_("span","preview",s?"(circular)":(e=>Array.isArray(e)?`(${e.length}) ${j(e)}`:j(e))(d))),s||(a.classList.add("toggle"),a.onclick=()=>{p?S.delete(t):S.add(t),R()}),A(a,n,e,o,r),l.appendChild(a),p){const e=Object.keys(d);if(!e.length){const e=_("div","muted","(empty)");e.style.paddingLeft=22+14*(o+1)+"px",l.appendChild(e)}for(const n of e)W(n,d,t+"."+n,o+1,r,i.concat([d]))}return}a.appendChild(_("span","spacer")),a.appendChild(_("span","key",e));const s=((e,n)=>{for(let t=e;t&&t!==Object.prototype;t=Object.getPrototypeOf(t)){const e=Object.getOwnPropertyDescriptor(t,n);if(e)return e}})(n,e);if("function"==typeof d)a.appendChild(_("span","preview","\u0192"));else if((e=>{if(!e)return!1;if(e.get&&!e.set)return!0;const n=e.value;return!!n&&!0===n.__v_isRef&&!0===n.__v_isReadonly})(s))a.appendChild(_("span","preview",j(d)));else if("boolean"==typeof d){a.appendChild(_("span","bool",String(d)));const t=_("input","check");t.type="checkbox",t.checked=d,t.onchange=()=>{n[e]=t.checked,t.blur(),X()},a.appendChild(t)}else{const t=_("input","val");t.value=j(d),t.onfocus=()=>{t.value="string"==typeof d?d:String(d)},t.onkeydown=e=>{"Enter"===e.key&&t.blur(),"Escape"===e.key&&(t.value=j(d),t.blur())},t.onblur=()=>{const o=((e,n)=>{if("number"==typeof n){const n=parseFloat(e);return isNaN(n)?e:n}return e})(t.value,d);o!==d?(n[e]=o,X()):t.value=j(d)},a.appendChild(t)}A(a,n,e,o,r),l.appendChild(a)},A=(e,n,o,r,i)=>{if(0!==r||"prop"!==i)return;const l=Object.getOwnPropertyDescriptor(n,o);if(l&&l.get)return;const d=_("button","del","\u2715");d.title=`delete "${o}"`,d.onclick=e=>{e.stopPropagation();const r=t.activeElement;r&&r.blur&&r.blur(),delete n[o],X()},e.appendChild(d)},B=e=>{const o=e.target;if(o===t.host)return;e.preventDefault(),e.stopPropagation(),J();let r=o;for(;r&&!n.scopes.has(r);)r=r.parentElement;r&&I(r)},F=e=>{let o=e.target;if(o!==t.host){for(;o&&!n.scopes.has(o);)o=o.parentElement;o?$(o):z()}},J=()=>{v=!1,d.classList.remove("active"),z(),document.removeEventListener("click",B,!0),document.removeEventListener("mousemove",F,!0)};let U=!1;const X=()=>{U||(U=!0,setTimeout(()=>{U=!1,"none"!==o.style.display&&(V(),R())}))},Y=()=>{const e=document.createElement("div");t=e.attachShadow({mode:"open"});const u=document.createElement("style");u.textContent="\n:host {\n all: initial;\n --bg: #1e1e1e;\n --bg2: #252526;\n --hover: #2a2d2e;\n --border: #3c3c3c;\n --fg: #d4d4d4;\n --muted: #808080;\n --accent: #42b883;\n --sel: #094771;\n --key: #9cdcfe;\n --val: #ce9178;\n --exp: #6a9955;\n}\n:host(.light) {\n --bg: #ffffff;\n --bg2: #f3f3f3;\n --hover: #ececec;\n --border: #d0d0d0;\n --fg: #383a42;\n --muted: #8e8e90;\n --sel: #d2e5f5;\n --key: #0451a5;\n --val: #a31515;\n --exp: #22863a;\n}\n* {\n box-sizing: border-box;\n}\n.pill, .panel {\n position: fixed;\n right: 12px;\n bottom: 12px;\n z-index: 2147483646;\n font: 11px/1.5 ui-monospace, Menlo, Consolas, monospace;\n color: var(--fg);\n}\n.pill {\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 999px;\n padding: 4px 10px;\n cursor: pointer;\n user-select: none;\n}\n.pill:hover {\n border-color: var(--accent);\n}\n.panel {\n display: flex;\n flex-direction: column;\n width: 640px;\n max-width: calc(100vw - 24px);\n height: 440px;\n max-height: calc(100vh - 24px);\n min-width: 320px;\n min-height: 200px;\n background: var(--bg);\n border: 1px solid var(--border);\n border-radius: 6px;\n overflow: hidden;\n resize: both;\n box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);\n}\n.header {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 8px;\n background: var(--bg2);\n border-bottom: 1px solid var(--border);\n user-select: none;\n cursor: move;\n}\n.title {\n color: var(--accent);\n font-weight: bold;\n margin-right: auto;\n}\n.btn {\n display: flex;\n align-items: center;\n background: none;\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 3px 7px;\n cursor: pointer;\n}\n.btn svg {\n display: block;\n}\n.btn:hover {\n border-color: var(--accent);\n}\n.btn.active {\n background: var(--accent);\n border-color: var(--accent);\n color: var(--bg);\n}\n.body {\n display: flex;\n flex: 1;\n min-height: 0;\n}\n.side {\n display: flex;\n flex-direction: column;\n width: 40%;\n min-width: 0;\n border-right: 1px solid var(--border);\n}\n.tabs {\n display: flex;\n border-bottom: 1px solid var(--border);\n user-select: none;\n}\n.tab {\n flex: 1;\n padding: 4px 0;\n text-align: center;\n color: var(--muted);\n border-bottom: 2px solid transparent;\n cursor: pointer;\n}\n.tab:hover {\n color: var(--fg);\n}\n.tab.active {\n color: var(--fg);\n border-bottom-color: var(--accent);\n}\n.filter {\n margin: 6px 6px 2px;\n background: var(--bg2);\n border: 1px solid var(--border);\n border-radius: 3px;\n color: var(--fg);\n font: inherit;\n padding: 2px 6px;\n outline: none;\n}\n.filter:focus {\n border-color: var(--accent);\n}\n.filter::placeholder {\n color: var(--muted);\n}\n.tree {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.state {\n flex: 1;\n overflow: auto;\n padding: 4px 0;\n}\n.row {\n padding: 2px 8px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n cursor: pointer;\n}\n.row:hover {\n background: var(--hover);\n}\n.row.sel {\n background: var(--sel);\n}\n.row .name {\n color: var(--key);\n}\n.row .punct {\n color: var(--muted);\n}\n.row .exp {\n color: var(--exp);\n}\n.prop {\n display: flex;\n gap: 6px;\n padding: 2px 8px;\n align-items: center;\n}\n.prop .key {\n color: var(--key);\n flex-shrink: 0;\n}\n.arrow {\n width: 12px;\n flex-shrink: 0;\n color: var(--muted);\n font-size: 9px;\n transition: transform 0.1s;\n}\n.arrow.open {\n transform: rotate(90deg);\n}\n.spacer {\n width: 12px;\n flex-shrink: 0;\n}\n.prop.toggle {\n cursor: pointer;\n user-select: none;\n}\n.prop.toggle:hover {\n background: var(--hover);\n}\n.preview {\n flex: 1;\n min-width: 0;\n color: var(--muted);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.muted {\n color: var(--muted);\n padding: 2px 8px;\n}\n.check {\n margin: 0;\n flex-shrink: 0;\n accent-color: var(--accent);\n cursor: pointer;\n}\n.del {\n visibility: hidden;\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n color: var(--muted);\n font: inherit;\n cursor: pointer;\n}\n.prop:hover .del {\n visibility: visible;\n}\n.del:hover {\n color: #e5534b;\n}\n.adder .key-in {\n flex: 0 0 30%;\n color: var(--key);\n}\n.adder input::placeholder {\n color: var(--muted);\n}\n.adder input {\n border-color: var(--border);\n}\n.bool {\n color: var(--val);\n}\n.prop.inherited .key {\n color: var(--muted);\n}\n.prop .val {\n flex: 1;\n min-width: 0;\n background: none;\n border: 1px solid transparent;\n border-radius: 3px;\n color: var(--val);\n font: inherit;\n padding: 0 3px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\ninput.val:hover, input.val:focus {\n border-color: var(--border);\n outline: none;\n background: var(--bg2);\n}\n.divider {\n padding: 4px 8px 1px;\n color: var(--muted);\n font-size: 10px;\n text-transform: uppercase;\n user-select: none;\n}\n.empty {\n padding: 8px;\n color: var(--muted);\n}\n.highlight {\n position: fixed;\n z-index: 2147483645;\n background: rgba(66, 184, 131, 0.25);\n border: 1px solid var(--accent);\n pointer-events: none;\n display: none;\n}\n",t.appendChild(u),s=_("div","highlight"),t.appendChild(s),r=_("div","pill","\u26a1 LiteVue"),r.onclick=()=>{r.style.display="none",o.style.display="flex",w({open:!0}),X()},t.appendChild(r),o=_("div","panel"),o.style.display="none";const x=_("div","header");x.appendChild(_("span","title","\u26a1 LiteVue")),x.addEventListener("mousedown",e=>{if(e.target.closest(".btn"))return;e.preventDefault();const n=o.getBoundingClientRect(),t=window.innerWidth-n.right,r=window.innerHeight-n.bottom,i=e.clientX,l=e.clientY,d=e=>{o.style.right=Math.max(0,t-(e.clientX-i))+"px",o.style.bottom=Math.max(0,r-(e.clientY-l))+"px"},a=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",a),w({right:parseInt(o.style.right)||12,bottom:parseInt(o.style.bottom)||12})};document.addEventListener("mousemove",d),document.addEventListener("mouseup",a)}),a=_("button","btn"),a.onclick=()=>{E=C[E];try{localStorage.setItem(y,E)}catch{}O()},x.appendChild(a),L.addEventListener("change",()=>{"system"===E&&O()}),O(),d=_("button","btn"),d.title="pick an element on the page",d.innerHTML=g('<circle cx="12" cy="12" r="7"/><line x1="12" y1="1" x2="12" y2="6"/><line x1="12" y1="18" x2="12" y2="23"/><line x1="1" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="23" y2="12"/>'),d.onclick=()=>v?J():(v=!0,d.classList.add("active"),document.addEventListener("click",B,!0),void document.addEventListener("mousemove",F,!0)),x.appendChild(d);const b=_("button","btn","\u2715");b.onclick=()=>{v&&J(),o.style.display="none",r.style.display="",w({open:!1})},x.appendChild(b),o.appendChild(x);const k=_("div","body"),S=_("div","side"),N=_("div","tabs");p=_("div","tab active"),p.onclick=()=>M("Elements"),c=_("div","tab"),c.onclick=()=>M("Stores"),N.appendChild(p),N.appendChild(c),S.appendChild(N);const T=_("input","filter");T.placeholder="Filter by name",T.oninput=()=>{f=T.value.trim().toLowerCase(),V()},T.onkeydown=e=>{"Escape"===e.key&&(T.value="",f="",V())},S.appendChild(T),i=_("div","tree"),S.appendChild(i),l=_("div","state"),k.appendChild(S),k.appendChild(l),o.appendChild(k),t.appendChild(o);const j=m();if(null!=j.right&&(o.style.right=j.right+"px"),null!=j.bottom&&(o.style.bottom=j.bottom+"px"),j.w&&(o.style.width=j.w+"px"),j.h&&(o.style.height=j.h+"px"),j.open&&(r.style.display="none",o.style.display="flex",X()),"undefined"!=typeof ResizeObserver){let e;new ResizeObserver(()=>{clearTimeout(e),e=setTimeout(()=>{"none"!==o.style.display&&o.offsetWidth&&w({w:o.offsetWidth,h:o.offsetHeight})},300)}).observe(o)}document.body.appendChild(e),n.on("scope:mount",X),n.on("scope:unmount",e=>{e===h&&(h=null),X()}),n.stores&&n.on("store:register",X),n.on("flush",X)},q=()=>{const e=window.__LITE_VUE__;e?(n=e,document.body?Y():addEventListener("DOMContentLoaded",Y)):console.warn("[LiteVue devtools] window.__LITE_VUE__ not found \u2014 load LiteVue before the devtools panel script.")};q(),e.init=q,Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var LiteVuePlugins=function(e,t){"use strict";const
|
|
1
|
+
var LiteVuePlugins=function(e,t){"use strict";const n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),s=(e,t)=>{const n=e.split(","),s=t.split(",");let o=0;for(let i=0;i<n.length;i++)o=Math.max(o,r(n[i])+r(s[i%s.length]));return o},o="litevue:",i=Object.create(null);let l="local";const c=e=>{const t=e??l;return"string"!=typeof t?t:i[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},a=(e,t,n,r,s)=>{if(!r)return s(()=>{});const o=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of o)t in n&&(e[t]=n[t])}catch{}return s(()=>{const n={};for(const t of o)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},u=/^(?:v-|:|@)/,f=/^(?::|v-bind:)/,d=["id","data-key","data-id"],v=e=>{for(const t of d){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},h=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},m=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),p=(e,t)=>{const n=(e=>{const t=new Set;for(const{name:n}of e.attributes)f.test(n)?t.add(n.replace(f,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:s}of[...t.attributes])u.test(r)||n.has(r)||e.getAttribute(r)!==s&&e.setAttribute(r,s);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},g=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return y(e,t,n);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const s=e,o=t;if(s.tagName!==o.tagName)return y(e,t,n);r.skip?.(s,o)||s.hasAttribute("data-morph-skip")||(p(s,o),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||m(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(m(t))return!0;return!1})(o)||x(s,o,s.__ctx||n,r))},y=(e,t,n)=>{const r=t.cloneNode(!0);e.parentNode.replaceChild(r,e),b(r,n)},b=(e,t)=>{const n=t||h(e.parentNode);n?.walk?.(e,n)},x=(e,t,n,r)=>{const s=r.key||v,o=new Map;for(let u=e.firstChild;u;u=u.nextSibling)if(1===u.nodeType){const e=s(u);if(null==e)continue;o.set(e,u)}const i=e=>e&&1===e.nodeType?s(e):null;let l=e.firstChild,c=t.firstChild;const a=t=>{const r=t.cloneNode(!0);e.insertBefore(r,l),b(r,n)};for(;c;){const t=c.nextSibling,s=i(c);if(null!=s){const t=o.get(s);t?(t===l?l=l.nextSibling:e.insertBefore(t,l),o.delete(s),g(t,c,n,r)):a(c)}else if(l&&null==i(l)){const e=l.nextSibling;g(l,c,n,r),l=e}else a(c);c=t}for(;l;){const t=l.nextSibling;e.removeChild(l),l=t}},S=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const s=n.content;r=1===s.childElementCount?s.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(s),t})()}else r=t;if(r){const t=A();g(e,r,h(e),n),t()}return e},A=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}};return e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const s=e;let o=250;for(const c in r||{}){const e=/^duration-(\d+)$/.exec(c);e&&(o=+e[1])}s.style.overflow="hidden";let i=!0,l=0;n(()=>{const e=!!t(),n=++l;if(i)return i=!1,e||(s.style.height="0px"),void setTimeout(()=>{s.style.transition=`height ${o}ms ease`});e?(s.style.height=s.scrollHeight+"px",setTimeout(()=>{n===l&&(s.style.height="")},o)):(s.style.height=s.scrollHeight+"px",s.offsetHeight,s.style.height="0px")})})},e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{n(()=>{const n=!!t();Promise.resolve().then(()=>{n&&(e.focus(),r?.select&&e.select&&e.select())})})}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,s=null;const o=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),i=t=>{if("Tab"!==t.key)return;const n=o();if(!n.length)return void t.preventDefault();const r=n[0],s=n[n.length-1],i=document.activeElement;e.contains(i)?t.shiftKey&&i===r?(t.preventDefault(),s.focus()):t.shiftKey||i!==s||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},l=()=>{r=!1,document.removeEventListener("keydown",i,!0),s&&s.focus&&s.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,s=document.activeElement,document.addEventListener("keydown",i,!0),Promise.resolve().then(()=>{r&&(o()[0]||e).focus()})):!n&&r&&l()}),()=>{r&&l()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const s of e){(n?.leave?!s.isIntersecting:s.isIntersecting)&&(t(),n?.once&&r.disconnect())}},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,s=()=>{const e=((e,t)=>{let r="",s="",o=0;for(let i=0;i<t.length;i++){const l=n[t[i]];if(l){for(;o<e.length&&!l.test(e[o]);)o++;if(o>=e.length)break;r+=s+e[o++],s=""}else s+=t[i],e[o]===t[i]&&o++}return r})(r.value,t);e!==r.value&&(r.value=e)};return e.addEventListener("input",s),s(),()=>e.removeEventListener("input",s)})},e.morph=S,e.morphPlugin=e=>{e.scope.$morph=S},e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:s,effect:i})=>{const l=o+(n||t.id);let u;for(const o in s||{})if(c(o)){u=o;break}const f=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;a(e.scope,l,f,c(u),i)})},e.persistStore=(e,n={})=>{const r=t.store(e);if(!r)return()=>{};const s=c(n.storage);return a(r,o+(n.key??e),n.keys,s,t.watchEffect)},e.registerStorage=(e,t)=>{i[e]=t},e.setDefaultStorage=e=>{l=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:o,exp:i})=>{const l=e,c=r||"v",a=e=>`${c}-${e}`;let u=0,f=!0;const d=()=>{l.classList.remove(a("enter-from"),a("enter-active"),a("enter-to"),a("leave-from"),a("leave-active"),a("leave-to"))},v=(e,t)=>{const n=++u;d(),l.classList.add(a(e+"-from"),a(e+"-active")),l.offsetWidth,l.classList.remove(a(e+"-from")),l.classList.add(a(e+"-to")),setTimeout(()=>{n===u&&(d(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(s(t.transitionDuration,t.transitionDelay),s(t.animationDuration,t.animationDelay))})(l))};if(!i)return Promise.resolve().then(()=>v("enter")),l.__leave=()=>new Promise(e=>v("leave",e)),()=>{delete l.__leave};n(()=>{const e=!!t();if(f)return f=!1,l.style.display=e?"":"none",void(e&&o?.appear&&v("enter"));e?(l.style.display="",v("enter")):v("leave",()=>{l.style.display="none"})})})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({},LiteVue);
|
package/dist/litevue-plugins.mjs
CHANGED
|
@@ -155,6 +155,10 @@ const persistable = (target, keys) => (keys ?? Object.keys(target)).filter((k) =
|
|
|
155
155
|
if (k[0] === "$") return false;
|
|
156
156
|
const desc = Object.getOwnPropertyDescriptor(target, k);
|
|
157
157
|
if (desc && desc.get && !desc.set) return false;
|
|
158
|
+
const raw = desc && desc.value;
|
|
159
|
+
if (raw && raw.__v_isRef === true && raw.__v_isReadonly === true) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
158
162
|
return typeof target[k] !== "function";
|
|
159
163
|
});
|
|
160
164
|
const sync = (target, key, keys, storage, run) => {
|
|
@@ -313,4 +317,177 @@ const collapse = (app) => {
|
|
|
313
317
|
});
|
|
314
318
|
};
|
|
315
319
|
|
|
316
|
-
|
|
320
|
+
const dirRE = /^(?:v-|:|@)/;
|
|
321
|
+
const bindRE = /^(?::|v-bind:)/;
|
|
322
|
+
const KEY_ATTRS = ["id", "data-key", "data-id"];
|
|
323
|
+
const defaultKey = (el) => {
|
|
324
|
+
for (const attr of KEY_ATTRS) {
|
|
325
|
+
const value = el.getAttribute(attr);
|
|
326
|
+
if (value != null) return attr + "=" + value;
|
|
327
|
+
}
|
|
328
|
+
return null;
|
|
329
|
+
};
|
|
330
|
+
const nearestCtx = (node) => {
|
|
331
|
+
for (let el = node; el; el = el.parentElement) {
|
|
332
|
+
if (el.__ctx) return el.__ctx;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
const boundAttrs = (to) => {
|
|
336
|
+
const owned = /* @__PURE__ */ new Set();
|
|
337
|
+
for (const { name } of to.attributes) {
|
|
338
|
+
if (bindRE.test(name)) {
|
|
339
|
+
owned.add(name.replace(bindRE, "").split(".")[0]);
|
|
340
|
+
} else if (name === "v-model") {
|
|
341
|
+
owned.add("value");
|
|
342
|
+
owned.add("checked");
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return owned;
|
|
346
|
+
};
|
|
347
|
+
const isBlockRoot = (el) => el.hasAttribute("v-for") || el.hasAttribute("v-if") || el.hasAttribute("v-else") || el.hasAttribute("v-else-if");
|
|
348
|
+
const ownsChildren = (to) => {
|
|
349
|
+
if (to.hasAttribute("v-text") || to.hasAttribute("v-html") || to.hasAttribute("v-pre") || to.hasAttribute("v-once") || isBlockRoot(to)) {
|
|
350
|
+
return true;
|
|
351
|
+
}
|
|
352
|
+
for (let c = to.firstElementChild; c; c = c.nextElementSibling) {
|
|
353
|
+
if (isBlockRoot(c)) return true;
|
|
354
|
+
}
|
|
355
|
+
return false;
|
|
356
|
+
};
|
|
357
|
+
const patchAttrs = (from, to) => {
|
|
358
|
+
const owned = boundAttrs(to);
|
|
359
|
+
for (const { name, value } of [...to.attributes]) {
|
|
360
|
+
if (dirRE.test(name) || owned.has(name)) continue;
|
|
361
|
+
if (from.getAttribute(name) !== value) from.setAttribute(name, value);
|
|
362
|
+
}
|
|
363
|
+
for (const { name } of [...from.attributes]) {
|
|
364
|
+
if (owned.has(name) || to.hasAttribute(name)) continue;
|
|
365
|
+
from.removeAttribute(name);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
const isInterpolation = (data, ctx) => data.includes(ctx ? ctx.delimiters[0] : "{{");
|
|
369
|
+
const patchNode = (from, to, ctx, opts) => {
|
|
370
|
+
if (from.nodeType !== to.nodeType) return replaceNode(from, to, ctx);
|
|
371
|
+
if (from.nodeType === 3 || from.nodeType === 8) {
|
|
372
|
+
const data = to.data;
|
|
373
|
+
if (isInterpolation(data, ctx)) return;
|
|
374
|
+
if (from.data !== data) from.data = data;
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
if (from.nodeType !== 1) return;
|
|
378
|
+
const a = from;
|
|
379
|
+
const b = to;
|
|
380
|
+
if (a.tagName !== b.tagName) return replaceNode(from, to, ctx);
|
|
381
|
+
if (opts.skip?.(a, b) || a.hasAttribute("data-morph-skip")) return;
|
|
382
|
+
patchAttrs(a, b);
|
|
383
|
+
if (!ownsChildren(b)) {
|
|
384
|
+
patchChildren(a, b, a.__ctx || ctx, opts);
|
|
385
|
+
}
|
|
386
|
+
};
|
|
387
|
+
const replaceNode = (from, to, ctx) => {
|
|
388
|
+
const fresh = to.cloneNode(true);
|
|
389
|
+
from.parentNode.replaceChild(fresh, from);
|
|
390
|
+
mountNew(fresh, ctx);
|
|
391
|
+
};
|
|
392
|
+
const mountNew = (node, ctx) => {
|
|
393
|
+
const target = ctx || nearestCtx(node.parentNode);
|
|
394
|
+
target?.walk?.(node, target);
|
|
395
|
+
};
|
|
396
|
+
const patchChildren = (from, to, ctx, opts) => {
|
|
397
|
+
const key = opts.key || defaultKey;
|
|
398
|
+
const keyed = /* @__PURE__ */ new Map();
|
|
399
|
+
for (let n = from.firstChild; n; n = n.nextSibling) {
|
|
400
|
+
if (n.nodeType === 1) {
|
|
401
|
+
const k = key(n);
|
|
402
|
+
if (k == null) continue;
|
|
403
|
+
keyed.set(k, n);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
const keyOf = (n) => n && n.nodeType === 1 ? key(n) : null;
|
|
407
|
+
let oldChild = from.firstChild;
|
|
408
|
+
let newChild = to.firstChild;
|
|
409
|
+
const insert = (node) => {
|
|
410
|
+
const fresh = node.cloneNode(true);
|
|
411
|
+
from.insertBefore(fresh, oldChild);
|
|
412
|
+
mountNew(fresh, ctx);
|
|
413
|
+
};
|
|
414
|
+
while (newChild) {
|
|
415
|
+
const nextNew = newChild.nextSibling;
|
|
416
|
+
const wantKey = keyOf(newChild);
|
|
417
|
+
if (wantKey != null) {
|
|
418
|
+
const match = keyed.get(wantKey);
|
|
419
|
+
if (match) {
|
|
420
|
+
if (match === oldChild) {
|
|
421
|
+
oldChild = oldChild.nextSibling;
|
|
422
|
+
} else {
|
|
423
|
+
from.insertBefore(match, oldChild);
|
|
424
|
+
}
|
|
425
|
+
keyed.delete(wantKey);
|
|
426
|
+
patchNode(match, newChild, ctx, opts);
|
|
427
|
+
} else {
|
|
428
|
+
insert(newChild);
|
|
429
|
+
}
|
|
430
|
+
} else if (oldChild && keyOf(oldChild) == null) {
|
|
431
|
+
const nextOld = oldChild.nextSibling;
|
|
432
|
+
patchNode(oldChild, newChild, ctx, opts);
|
|
433
|
+
oldChild = nextOld;
|
|
434
|
+
} else {
|
|
435
|
+
insert(newChild);
|
|
436
|
+
}
|
|
437
|
+
newChild = nextNew;
|
|
438
|
+
}
|
|
439
|
+
while (oldChild) {
|
|
440
|
+
const next = oldChild.nextSibling;
|
|
441
|
+
from.removeChild(oldChild);
|
|
442
|
+
oldChild = next;
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
const morph = (from, to, opts = {}) => {
|
|
446
|
+
let target;
|
|
447
|
+
if (typeof to === "string") {
|
|
448
|
+
const holder = document.createElement("template");
|
|
449
|
+
holder.innerHTML = to.trim();
|
|
450
|
+
const content = holder.content;
|
|
451
|
+
target = content.childElementCount === 1 ? content.firstElementChild : (() => {
|
|
452
|
+
const wrapper = from.cloneNode(false);
|
|
453
|
+
wrapper.appendChild(content);
|
|
454
|
+
return wrapper;
|
|
455
|
+
})();
|
|
456
|
+
} else {
|
|
457
|
+
target = to;
|
|
458
|
+
}
|
|
459
|
+
if (target) {
|
|
460
|
+
const restore = captureFocus();
|
|
461
|
+
patchNode(from, target, nearestCtx(from), opts);
|
|
462
|
+
restore();
|
|
463
|
+
}
|
|
464
|
+
return from;
|
|
465
|
+
};
|
|
466
|
+
const captureFocus = () => {
|
|
467
|
+
const active = document.activeElement;
|
|
468
|
+
if (!active || active === document.body) return () => {
|
|
469
|
+
};
|
|
470
|
+
const field = active;
|
|
471
|
+
let start = null;
|
|
472
|
+
let end = null;
|
|
473
|
+
try {
|
|
474
|
+
start = field.selectionStart;
|
|
475
|
+
end = field.selectionEnd;
|
|
476
|
+
} catch {
|
|
477
|
+
}
|
|
478
|
+
return () => {
|
|
479
|
+
if (active === document.activeElement || !active.isConnected) return;
|
|
480
|
+
active.focus();
|
|
481
|
+
if (start !== null) {
|
|
482
|
+
try {
|
|
483
|
+
field.setSelectionRange(start, end);
|
|
484
|
+
} catch {
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
};
|
|
488
|
+
};
|
|
489
|
+
const morphPlugin = (app) => {
|
|
490
|
+
app.scope.$morph = morph;
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
export { collapse, focus, intersect, mask, morph, morphPlugin, persist, persistStore, registerStorage, setDefaultStorage, transition };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@aevantec/litevue")):"function"==typeof define&&define.amd?define(["exports","@aevantec/litevue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVuePlugins={},e.LiteVue)}(this,function(e,t){"use strict";const n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@aevantec/litevue")):"function"==typeof define&&define.amd?define(["exports","@aevantec/litevue"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVuePlugins={},e.LiteVue)}(this,function(e,t){"use strict";const n={9:/\d/,a:/[a-zA-Z]/,"*":/[a-zA-Z0-9]/},r=e=>(parseFloat(e)||0)*(e.includes("ms")?1:1e3),o=(e,t)=>{const n=e.split(","),o=t.split(",");let i=0;for(let s=0;s<n.length;s++)i=Math.max(i,r(n[s])+r(o[s%o.length]));return i},i="litevue:",s=Object.create(null);let l="local";const c=e=>{const t=e??l;return"string"!=typeof t?t:s[t]??(e=>{try{if("local"===e||"localStorage"===e)return localStorage;if("session"===e||"sessionStorage"===e)return sessionStorage}catch{}})(t)},a=(e,t,n,r,o)=>{if(!r)return o(()=>{});const i=((e,t)=>(t??Object.keys(e)).filter(t=>{if("$"===t[0])return!1;const n=Object.getOwnPropertyDescriptor(e,t);if(n&&n.get&&!n.set)return!1;const r=n&&n.value;return(!r||!0!==r.__v_isRef||!0!==r.__v_isReadonly)&&"function"!=typeof e[t]}))(e,n);try{const n=JSON.parse(r.getItem(t)||"null");if(n)for(const t of i)t in n&&(e[t]=n[t])}catch{}return o(()=>{const n={};for(const t of i)n[t]=e[t];try{r.setItem(t,JSON.stringify(n))}catch{}})},f=/^(?:v-|:|@)/,u=/^(?::|v-bind:)/,d=["id","data-key","data-id"],v=e=>{for(const t of d){const n=e.getAttribute(t);if(null!=n)return t+"="+n}return null},h=e=>{for(let t=e;t;t=t.parentElement)if(t.__ctx)return t.__ctx},p=e=>e.hasAttribute("v-for")||e.hasAttribute("v-if")||e.hasAttribute("v-else")||e.hasAttribute("v-else-if"),m=(e,t)=>{const n=(e=>{const t=new Set;for(const{name:n}of e.attributes)u.test(n)?t.add(n.replace(u,"").split(".")[0]):"v-model"===n&&(t.add("value"),t.add("checked"));return t})(t);for(const{name:r,value:o}of[...t.attributes])f.test(r)||n.has(r)||e.getAttribute(r)!==o&&e.setAttribute(r,o);for(const{name:r}of[...e.attributes])n.has(r)||t.hasAttribute(r)||e.removeAttribute(r)},g=(e,t,n,r)=>{if(e.nodeType!==t.nodeType)return y(e,t,n);if(3===e.nodeType||8===e.nodeType){const r=t.data;if(((e,t)=>e.includes(t?t.delimiters[0]:"{{"))(r,n))return;return void(e.data!==r&&(e.data=r))}if(1!==e.nodeType)return;const o=e,i=t;if(o.tagName!==i.tagName)return y(e,t,n);r.skip?.(o,i)||o.hasAttribute("data-morph-skip")||(m(o,i),(e=>{if(e.hasAttribute("v-text")||e.hasAttribute("v-html")||e.hasAttribute("v-pre")||e.hasAttribute("v-once")||p(e))return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(p(t))return!0;return!1})(i)||x(o,i,o.__ctx||n,r))},y=(e,t,n)=>{const r=t.cloneNode(!0);e.parentNode.replaceChild(r,e),b(r,n)},b=(e,t)=>{const n=t||h(e.parentNode);n?.walk?.(e,n)},x=(e,t,n,r)=>{const o=r.key||v,i=new Map;for(let f=e.firstChild;f;f=f.nextSibling)if(1===f.nodeType){const e=o(f);if(null==e)continue;i.set(e,f)}const s=e=>e&&1===e.nodeType?o(e):null;let l=e.firstChild,c=t.firstChild;const a=t=>{const r=t.cloneNode(!0);e.insertBefore(r,l),b(r,n)};for(;c;){const t=c.nextSibling,o=s(c);if(null!=o){const t=i.get(o);t?(t===l?l=l.nextSibling:e.insertBefore(t,l),i.delete(o),g(t,c,n,r)):a(c)}else if(l&&null==s(l)){const e=l.nextSibling;g(l,c,n,r),l=e}else a(c);c=t}for(;l;){const t=l.nextSibling;e.removeChild(l),l=t}},S=(e,t,n={})=>{let r;if("string"==typeof t){const n=document.createElement("template");n.innerHTML=t.trim();const o=n.content;r=1===o.childElementCount?o.firstElementChild:(()=>{const t=e.cloneNode(!1);return t.appendChild(o),t})()}else r=t;if(r){const t=A();g(e,r,h(e),n),t()}return e},A=()=>{const e=document.activeElement;if(!e||e===document.body)return()=>{};const t=e;let n=null,r=null;try{n=t.selectionStart,r=t.selectionEnd}catch{}return()=>{if(e!==document.activeElement&&e.isConnected&&(e.focus(),null!==n))try{t.setSelectionRange(n,r)}catch{}}};e.collapse=e=>{e.directive("collapse",({el:e,get:t,effect:n,modifiers:r})=>{const o=e;let i=250;for(const c in r||{}){const e=/^duration-(\d+)$/.exec(c);e&&(i=+e[1])}o.style.overflow="hidden";let s=!0,l=0;n(()=>{const e=!!t(),n=++l;if(s)return s=!1,e||(o.style.height="0px"),void setTimeout(()=>{o.style.transition=`height ${i}ms ease`});e?(o.style.height=o.scrollHeight+"px",setTimeout(()=>{n===l&&(o.style.height="")},i)):(o.style.height=o.scrollHeight+"px",o.offsetHeight,o.style.height="0px")})})},e.focus=e=>{e.directive("focus",({el:e,get:t,effect:n,modifiers:r})=>{n(()=>{const n=!!t();Promise.resolve().then(()=>{n&&(e.focus(),r?.select&&e.select&&e.select())})})}),e.directive("trap",({el:e,get:t,effect:n})=>{let r=!1,o=null;const i=()=>[...e.querySelectorAll('a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')].filter(e=>!e.hasAttribute("disabled")),s=t=>{if("Tab"!==t.key)return;const n=i();if(!n.length)return void t.preventDefault();const r=n[0],o=n[n.length-1],s=document.activeElement;e.contains(s)?t.shiftKey&&s===r?(t.preventDefault(),o.focus()):t.shiftKey||s!==o||(t.preventDefault(),r.focus()):(t.preventDefault(),r.focus())},l=()=>{r=!1,document.removeEventListener("keydown",s,!0),o&&o.focus&&o.focus()};return n(()=>{const n=!!t();n&&!r?(r=!0,o=document.activeElement,document.addEventListener("keydown",s,!0),Promise.resolve().then(()=>{r&&(i()[0]||e).focus()})):!n&&r&&l()}),()=>{r&&l()}})},e.intersect=e=>{e.directive("intersect",({el:e,get:t,modifiers:n})=>{const r=new IntersectionObserver(e=>{for(const o of e){(n?.leave?!o.isIntersecting:o.isIntersecting)&&(t(),n?.once&&r.disconnect())}},{threshold:n?.full?1:0});return r.observe(e),()=>r.disconnect()})},e.mask=e=>{e.directive("mask",({el:e,exp:t})=>{const r=e,o=()=>{const e=((e,t)=>{let r="",o="",i=0;for(let s=0;s<t.length;s++){const l=n[t[s]];if(l){for(;i<e.length&&!l.test(e[i]);)i++;if(i>=e.length)break;r+=o+e[i++],o=""}else o+=t[s],e[i]===t[s]&&i++}return r})(r.value,t);e!==r.value&&(r.value=e)};return e.addEventListener("input",o),o(),()=>e.removeEventListener("input",o)})},e.morph=S,e.morphPlugin=e=>{e.scope.$morph=S},e.persist=e=>{e.directive("persist",({ctx:e,el:t,exp:n,arg:r,modifiers:o,effect:s})=>{const l=i+(n||t.id);let f;for(const i in o||{})if(c(i)){f=i;break}const u=r?r.split(",").map(e=>e.trim()).filter(Boolean):void 0;a(e.scope,l,u,c(f),s)})},e.persistStore=(e,n={})=>{const r=t.store(e);if(!r)return()=>{};const o=c(n.storage);return a(r,i+(n.key??e),n.keys,o,t.watchEffect)},e.registerStorage=(e,t)=>{s[e]=t},e.setDefaultStorage=e=>{l=e},e.transition=e=>{e.directive("transition",({el:e,get:t,effect:n,arg:r,modifiers:i,exp:s})=>{const l=e,c=r||"v",a=e=>`${c}-${e}`;let f=0,u=!0;const d=()=>{l.classList.remove(a("enter-from"),a("enter-active"),a("enter-to"),a("leave-from"),a("leave-active"),a("leave-to"))},v=(e,t)=>{const n=++f;d(),l.classList.add(a(e+"-from"),a(e+"-active")),l.offsetWidth,l.classList.remove(a(e+"-from")),l.classList.add(a(e+"-to")),setTimeout(()=>{n===f&&(d(),t&&t())},(e=>{const t=getComputedStyle(e);return Math.max(o(t.transitionDuration,t.transitionDelay),o(t.animationDuration,t.animationDelay))})(l))};if(!s)return Promise.resolve().then(()=>v("enter")),l.__leave=()=>new Promise(e=>v("leave",e)),()=>{delete l.__leave};n(()=>{const e=!!t();if(u)return u=!1,l.style.display=e?"":"none",void(e&&i?.appear&&v("enter"));e?(l.style.display="",v("enter")):v("leave",()=>{l.style.display="none"})})})},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/dist/litevue.iife.js
CHANGED
|
@@ -4,9 +4,9 @@ var LiteVue=function(e){"use strict";
|
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
5
|
* @license MIT
|
|
6
6
|
**/
|
|
7
|
-
/*! #__NO_SIDE_EFFECTS__ */function t(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const n=()=>{},s=Object.assign,r=Object.prototype.hasOwnProperty,i=(e,t)=>r.call(e,t),o=Array.isArray,c=e=>"[object Map]"===d(e),l=e=>"[object Date]"===d(e),u=e=>"string"==typeof e,a=e=>"symbol"==typeof e,f=e=>null!==e&&"object"==typeof e,p=Object.prototype.toString,d=e=>p.call(e),h=e=>u(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,m=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},g=/-(\w)/g,v=m(e=>e.replace(g,(e,t)=>t?t.toUpperCase():"")),_=/\B([A-Z])/g,y=m(e=>e.replace(_,"-$1").toLowerCase()),b=e=>{const t=u(e)?Number(e):NaN;return isNaN(t)?e:t};function
|
|
7
|
+
/*! #__NO_SIDE_EFFECTS__ */function t(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const n=()=>{},s=Object.assign,r=Object.prototype.hasOwnProperty,i=(e,t)=>r.call(e,t),o=Array.isArray,c=e=>"[object Map]"===d(e),l=e=>"[object Date]"===d(e),u=e=>"string"==typeof e,a=e=>"symbol"==typeof e,f=e=>null!==e&&"object"==typeof e,p=Object.prototype.toString,d=e=>p.call(e),h=e=>u(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,m=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},g=/-(\w)/g,v=m(e=>e.replace(g,(e,t)=>t?t.toUpperCase():"")),_=/\B([A-Z])/g,y=m(e=>e.replace(_,"-$1").toLowerCase()),b=(e,t)=>!Object.is(e,t),w=e=>{const t=u(e)?Number(e):NaN;return isNaN(t)?e:t};function x(e){if(o(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=u(s)?E(s):x(s);if(r)for(const e in r)t[e]=r[e]}return t}if(u(e)||f(e))return e}const S=/;(?![^(]*\))/g,$=/:([^]+)/,k=/\/\*[^]*?\*\//g;function E(e){const t={};return e.replace(k,"").split(S).forEach(e=>{if(e){const n=e.split($);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function O(e){let t="";if(u(e))t=e;else if(o(e))for(let n=0;n<e.length;n++){const s=O(e[n]);s&&(t+=s+" ")}else if(f(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function L(e,t){if(e===t)return!0;let n=l(e),s=l(t);if(n||s)return!(!n||!s)&&e.getTime()===t.getTime();if(n=a(e),s=a(t),n||s)return e===t;if(n=o(e),s=o(t),n||s)return!(!n||!s)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=L(e[s],t[s]);return n}(e,t);if(n=f(e),s=f(t),n||s){if(!n||!s)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const s=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(s&&!r||!s&&r||!L(e[n],t[n]))return!1}}return String(e)===String(t)}function j(e,t){return e.findIndex(e=>L(e,t))}
|
|
8
8
|
/**
|
|
9
9
|
* @vue/reactivity v3.4.38
|
|
10
10
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
11
11
|
* @license MIT
|
|
12
|
-
**/let j;function N(e,t=void 0){t&&t.active&&t.effects.push(e)}class T{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,N(this,s)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,z();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(A(t.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),K()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=V,t=j;try{return V=!0,j=this,this._runnings++,P(this),this.fn()}finally{R(this),this._runnings--,j=t,V=e}}stop(){this.active&&(P(this),R(this),this.onStop&&this.onStop(),this.active=!1)}}function A(e){return e.value}function P(e){e._trackId++,e._depsLength=0}function R(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)M(e.deps[t],e);e.deps.length=e._depsLength}}function M(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}function C(e,t){e.effect instanceof T&&(e=e.effect.fn);const r=new T(e,n,()=>{r.dirty&&r.run()});t&&(s(r,t),t.scope&&N(r,t.scope)),t&&t.lazy||r.run();const i=r.run.bind(r);return i.effect=r,i}function I(e){e.effect.stop()}let V=!0,B=0;const W=[];function z(){W.push(V),V=!1}function K(){const e=W.pop();V=void 0===e||e}function D(){B++}function F(){for(B--;!B&&U.length;)U.shift()()}const U=[];function q(e,t,n){D();for(const s of e.keys()){let n;s._dirtyLevel<t&&(null!=n?n:n=e.get(s)===s._trackId)&&(s._shouldSchedule||(s._shouldSchedule=0===s._dirtyLevel),s._dirtyLevel=t),s._shouldSchedule&&(null!=n?n:n=e.get(s)===s._trackId)&&(s.trigger(),s._runnings&&!s.allowRecurse||2===s._dirtyLevel||(s._shouldSchedule=!1,s.scheduler&&U.push(s.scheduler)))}F()}const H=new WeakMap,J=Symbol(""),Z=Symbol("");function G(e,t,n){if(V&&j){let t=H.get(e);t||H.set(e,t=new Map);let s=t.get(n);s||t.set(n,s=((e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n})(()=>t.delete(n))),function(e,t){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&M(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}(j,s)}}function Q(e,t,n,s,r,i){const l=H.get(e);if(!l)return;let u=[];if("clear"===t)u=[...l.values()];else if("length"===n&&o(e)){const e=Number(s);l.forEach((t,n)=>{("length"===n||!a(n)&&n>=e)&&u.push(t)})}else switch(void 0!==n&&u.push(l.get(n)),t){case"add":o(e)?h(n)&&u.push(l.get("length")):(u.push(l.get(J)),c(e)&&u.push(l.get(Z)));break;case"delete":o(e)||(u.push(l.get(J)),c(e)&&u.push(l.get(Z)));break;case"set":c(e)&&u.push(l.get(J))}D();for(const o of u)o&&q(o,4);F()}const X=t("__proto__,__v_isRef,__isVue"),Y=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(a)),ee=te();function te(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){const n=ge(this);for(let t=0,r=this.length;t<r;t++)G(n,0,t+"");const s=n[t](...e);return-1===s||!1===s?n[t](...e.map(ge)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...e){z(),D();const n=ge(this)[t].apply(this,e);return F(),K(),n}}),e}function ne(e){a(e)||(e=String(e));const t=ge(this);return G(t,0,e),t.hasOwnProperty(e)}class se{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?fe:ae:r?ue:le).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const c=o(e);if(!s){if(c&&i(ee,t))return Reflect.get(ee,t,n);if("hasOwnProperty"===t)return ne}const l=Reflect.get(e,t,n);return(a(t)?Y.has(t):X(t))?l:(s||G(e,0,t),r?l:ve(l)?c&&h(t)?l:l.value:f(l)?s?function(e){return he(e,!0,ce,null,ae)}(l):de(l):l)}}class re extends se{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=me(r);if(function(e){return!(!e||!e.__v_isShallow)}(n)||me(n)||(r=ge(r),n=ge(n)),!o(e)&&ve(r)&&!ve(n))return!t&&(r.value=n,!0)}const c=o(e)&&h(t)?Number(t)<e.length:i(e,t),l=Reflect.set(e,t,n,s);return e===ge(s)&&(c?((e,t)=>!Object.is(e,t))(n,r)&&Q(e,"set",t,n):Q(e,"add",t,n)),l}deleteProperty(e,t){const n=i(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&n&&Q(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return a(t)&&Y.has(t)||G(e,0,t),n}ownKeys(e){return G(e,0,o(e)?"length":J),Reflect.ownKeys(e)}}class ie extends se{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const oe=new re,ce=new ie,le=new WeakMap,ue=new WeakMap,ae=new WeakMap,fe=new WeakMap;function pe(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>d(e).slice(8,-1))(e))}function de(e){return me(e)?e:he(e,!1,oe,null,le)}function he(e,t,n,s,r){if(!f(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=pe(e);if(0===o)return e;const c=new Proxy(e,2===o?s:n);return r.set(e,c),c}function me(e){return!(!e||!e.__v_isReadonly)}function ge(e){const t=e&&e.__v_raw;return t?ge(t):e}function ve(e){return!(!e||!0!==e.__v_isRef)}let _e=0;const ye=()=>{const e=Object.create(null);return(t="id")=>e[t]||(e[t]=`${t}-${++_e}`)},be=e=>(t,n)=>{const s="function"==typeof t?t:()=>t.split(".").reduce((e,t)=>null==e?e:e[t],e.scope);let r,i=!1;e.effect(()=>{const e=s();i&&e!==r&&(z(),n(e,r),K()),i=!0,r=e})},we=new Map,xe=new Map,Se=new Map,$e=new Map;let ke=!1;const Ee=()=>ke||"undefined"!=typeof window&&!1===window.__LITE_VUE_DEVTOOLS__,Oe={"scope:mount":new Set,"scope:unmount":new Set,"store:register":new Set,flush:new Set},Le=(e,...t)=>{Oe[e].forEach(e=>e(...t))},je=()=>{},Ne=(e,t,n,s)=>Ee()?je:(we.set(e,t),n&&xe.set(e,n),s&&Se.set(e,s),Le("scope:mount",e,t),()=>{we.delete(e)&&(xe.delete(e),Se.delete(e),Le("scope:unmount",e))}),Te={scopes:we,exps:xe,names:Se,stores:$e,getScopeByName(e){for(const[t,n]of Se)if(n===e)return we.get(t)},getScope(e){let t=1===e.nodeType?e:e.parentElement;for(;t;){const e=we.get(t);if(e)return e;t=t.parentElement}},on:(e,t)=>(Oe[e].add(t),()=>Oe[e].delete(t)),off(e,t){Oe[e].delete(t)}};"undefined"==typeof window||Ee()||(window.__LITE_VUE__=Te);let Ae=!1;const Pe=[],Re=Promise.resolve(),Me=e=>Re.then(e),Ce=e=>{Pe.includes(e)||Pe.push(e),Ae||(Ae=!0,Me(Ie))},Ie=()=>{for(const e of Pe)e();Pe.length=0,Ae=!1,Oe.flush.size&&Le("flush")},Ve=/^(spellcheck|draggable|form|list|type)$/,Be=({el:e,get:t,effect:n,arg:s,modifiers:r})=>{let i;"class"===s&&(e._class=e.className),n(()=>{let n=t();if(s)r?.camel&&(s=v(s)),We(e,s,n,i);else{for(const t in n)We(e,t,n[t],i&&i[t]);for(const t in i)n&&t in n||We(e,t,null)}i=n})},We=(e,t,n,s)=>{if("class"===t)e.setAttribute("class",E(e._class?[e._class,n]:n)||"");else if("style"===t){n=w(n);const{style:t}=e;if(n)if(u(n))n!==s&&(t.cssText=n);else{for(const e in n)Ke(t,e,n[e]);if(s&&!u(s))for(const e in s)null==n[e]&&Ke(t,e,"")}else e.removeAttribute("style")}else e instanceof SVGElement||!(t in e)||Ve.test(t)?"true-value"===t?e._trueValue=n:"false-value"===t?e._falseValue=n:null!=n?e.setAttribute(t,n):e.removeAttribute(t):(e[t]=n,"value"===t&&(e._value=n))},ze=/\s*!important$/,Ke=(e,t,n)=>{o(n)?n.forEach(n=>Ke(e,t,n)):t.startsWith("--")?e.setProperty(t,n):ze.test(n)?e.setProperty(y(t),n.replace(ze,""),"important"):e[t]=n},De=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Fe=["ctrl","shift","alt","meta"],Ue={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Fe.some(n=>e[`${n}Key`]&&!t[n])},qe=/^(stop|prevent|self|ctrl|shift|alt|meta|left|middle|right|exact|once|capture|passive|window|document|outside|debounce(-\d+)?|throttle(-\d+)?|prop-.+|name-.+)$/,He=({el:e,get:t,exp:n,arg:s,modifiers:r})=>{if(!s)return;let i=De.test(n)?t(`(e => ${n}(e))`):t(`($event => { ${n} })`);if("mounted"===s||"vue:mounted"===s)return void Me(i);if("unmounted"===s||"vue:unmounted"===s)return()=>i();if(r){"click"===s&&(r.right&&(s="contextmenu"),r.middle&&(s="mouseup"));let t=i;for(const e in r){let n=/^debounce(?:-(\d+))?$/.exec(e);if(n){const e=t,s=n[1]?+n[1]:250;let r;t=t=>{clearTimeout(r),r=setTimeout(e,s,t)};continue}if(n=/^throttle(?:-(\d+))?$/.exec(e),n){const e=t,s=n[1]?+n[1]:250;let r=0;t=t=>{const n=Date.now();n-r>=s&&(r=n,e(t))}}}const n=Object.keys(r).filter(e=>!qe.test(e));i=s=>{if(!(r.outside&&e.contains(s.target)||"key"in s&&n.length&&!(y(s.key)in r))){for(const e in r){const t=Ue[e];if(t&&t(s,r))return;if(e.startsWith("prop-")&&"propertyName"in s&&s.propertyName!==e.slice(5))return;if(e.startsWith("name-")&&"animationName"in s&&s.animationName!==e.slice(5))return}return t(s)}}}const o=r?.window?window:r?.document||r?.outside?document:e,c=s;return o.addEventListener(c,i,r),o!==e?()=>o.removeEventListener(c,i,r):void 0},Je=({el:e,get:t,effect:n})=>{n(()=>{e.textContent=Ze(t())})},Ze=e=>null==e?"":f(e)?JSON.stringify(e,null,2):String(e),Ge=(e,t)=>{const n=e.getAttribute(t);return null!=n&&e.removeAttribute(t),n},Qe=(e,t,n,s)=>{e.addEventListener(t,n,s)},Xe=e=>"_value"in e?e._value:e.value,Ye=(e,t)=>{const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t},et=e=>{e.target.composing=!0},tt=e=>{const t=e.target;t.composing&&(t.composing=!1,nt(t,"input"))},nt=(e,t)=>{const n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)},st=Object.create(null),rt=(e,t,n)=>it(e,`return(${t})`,n),it=(e,t,n)=>{const s=st[t]||(st[t]=ot(t));try{return s(e,n,n&&(e=>(t,n)=>e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0})))(n))}catch(r){console.error(r)}},ot=e=>{try{return new Function("$data","$el","$dispatch",`with($data){${e}}`)}catch(t){return console.error(`${t.message} in expression: ${e}`),()=>{}}},ct={bind:Be,on:He,show:({el:e,get:t,effect:n})=>{const s=e.style.display;n(()=>{e.style.display=t()?s:"none"})},text:Je,html:({el:e,get:t,effect:n})=>{n(()=>{e.innerHTML=t()})},model:({el:e,exp:t,get:n,effect:s,modifiers:r})=>{const i=e.type,c=n(`(val) => { ${t} = val }`),{trim:l,number:u="number"===i,lazy:a,fill:f}=r||{};if("SELECT"===e.tagName){const t=e;Qe(e,"change",()=>{const e=Array.prototype.filter.call(t.options,e=>e.selected).map(e=>u?b(Xe(e)):Xe(e));c(t.multiple?e:e[0])}),s(()=>{const e=n(),s=t.multiple;for(let n=0,r=t.options.length;n<r;n++){const r=t.options[n],i=Xe(r);if(s)o(e)?r.selected=L(e,i)>-1:r.selected=e.has(i);else if(O(Xe(r),e))return void(t.selectedIndex!==n&&(t.selectedIndex=n))}s||-1===t.selectedIndex||(t.selectedIndex=-1)})}else if("checkbox"===i){let t;Qe(e,"change",()=>{const t=n(),s=e.checked;if(o(t)){const n=Xe(e),r=L(t,n),i=-1!==r;if(s&&!i)c(t.concat(n));else if(!s&&i){const e=[...t];e.splice(r,1),c(e)}}else c(Ye(e,s))}),s(()=>{const s=n();o(s)?e.checked=L(s,Xe(e))>-1:s!==t&&(e.checked=O(s,Ye(e,!0))),t=s})}else if("radio"===i){let t;Qe(e,"change",()=>{c(Xe(e))}),s(()=>{const s=n();s!==t&&(e.checked=O(s,Xe(e)))})}else{const t=e=>l?e.trim():u?b(e):e;let i=c;for(const e in r||{}){const t=/^debounce(?:-(\d+))?$/.exec(e);if(t){const e=t[1]?+t[1]:250;let n;i=t=>{clearTimeout(n),n=setTimeout(c,e,t)}}}if(Qe(e,"compositionstart",et),Qe(e,"compositionend",tt),Qe(e,a?"change":"input",()=>{e.composing||i(t(e.value))}),l&&Qe(e,"change",()=>{e.value=e.value.trim()}),f){const s=n();null!=s&&""!==s||!e.value||c(t(e.value))}s(()=>{if(e.composing)return;const s=e.value,r=n();document.activeElement===e&&t(s)===r||s!==r&&(e.value=r)})}},effect:({el:e,ctx:t,exp:n,effect:s})=>{Me(()=>s(()=>it(t.scope,n,e)))}},lt=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ut=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,at=/^\(|\)$/g,ft=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,pt=(e,t,n)=>{const s=t.match(lt);if(!s)return;const r=e.nextSibling,i=e.parentElement,c=new Text("");i.insertBefore(c,e),i.removeChild(e);const l=s[2].trim();let u,a,p,d,h=s[1].trim().replace(at,"").trim(),m=!1,g="key",v=e.getAttribute(g)||e.getAttribute(g=":key")||e.getAttribute(g="v-bind:key");v&&(e.removeAttribute(g),"key"===g&&(v=JSON.stringify(v))),(d=h.match(ut))&&(h=h.replace(ut,"").trim(),a=d[1].trim(),d[2]&&(p=d[2].trim())),(d=h.match(ft))&&(u=d[1].split(",").map(e=>e.trim()),m="["===h[0]);let _,y,b,w=!1;const x=(e,t,s,r)=>{const i={};u?u.forEach((e,n)=>i[e]=t[m?n:e]):i[h]=t,r?(a&&(i[a]=r),p&&(i[p]=s)):a&&(i[a]=s);const o=St(n,i),c=v?rt(o.scope,v):s;return e.set(c,s),o.key=c,o},S=(t,n)=>{const s=new kt(e,t);return s.key=t.key,s.insert(i,n),s};return n.effect(()=>{const e=rt(n.scope,l),t=b;if([y,b]=(e=>{const t=new Map,n=[];if(o(e))for(let s=0;s<e.length;s++)n.push(x(t,e[s],s));else if("number"==typeof e)for(let s=0;s<e;s++)n.push(x(t,s+1,s));else if(f(e)){let s=0;for(const r in e)n.push(x(t,e[r],s++,r))}return[n,t]})(e),w){for(let t=0;t<_.length;t++)b.has(_[t].key)||_[t].remove();const e=[];let n,s,r=y.length;for(;r--;){const o=y[r],l=t.get(o.key);let u;null==l?u=S(o,n?n.el:c):(u=_[l],Object.assign(u.ctx.scope,o.scope),l!==r&&(_[l+1]===n&&s!==n||(s=u,u.insert(i,n?n.el:c)))),e.unshift(n=u)}_=e}else _=y.map(e=>S(e,c)),w=!0}),r},dt=({el:e,ctx:{scope:{$refs:t}},get:n,effect:s})=>{let r;return s(()=>{const s=n();t[s]=e,r&&s!==r&&delete t[r],r=s}),()=>{r&&delete t[r]}},ht=/^(?:v-|:|@)/,mt=/\.([\w-]+)/g;let gt=!1;const vt=(e,t)=>{const n=e.nodeType;if(1===n){const n=e;if(n.hasAttribute("v-pre"))return;let s;if(Ge(n,"v-cloak"),s=Ge(n,"v-if"))return((e,t,n)=>{const s=e.parentElement,r=new Comment("v-if");s.insertBefore(r,e);const i=[{exp:t,el:e}];let o,c;for(;(o=e.nextElementSibling)&&(c=null,""===Ge(o,"v-else")||(c=Ge(o,"v-else-if")));)s.removeChild(o),i.push({exp:c,el:o});const l=e.nextSibling;let u;s.removeChild(e);let a=-1;const f=()=>{u&&(u.el.parentNode===s&&s.insertBefore(r,u.el),u.remove(),u=void 0)};return n.effect(()=>{for(let e=0;e<i.length;e++){const{exp:t,el:o}=i[e];if(!t||rt(n.scope,t))return void(e!==a&&(f(),u=new kt(o,n),u.insert(s,r),u.el.parentNode===s&&s.removeChild(r),a=e))}a=-1,f()}),l})(n,s,t);if(s=Ge(n,"v-for"))return pt(n,s,t);const r=Ge(n,"v-name");let i;if(s=Ge(n,"v-teleport")){const e=document.querySelector(s);e&&(i=n.nextSibling,n.__teleported=!0,e.appendChild(n),t.cleanups.push(()=>n.remove()))}if((s=Ge(n,"v-scope"))||""===s){const e=s?rt(t.scope,s):{};(t=St(t,e)).cleanups.push(Ne(n,t.scope,s||void 0,r||void 0)),e.$template&&wt(n,e.$template)}const o=null!=Ge(n,"v-once");o&&(gt=!0),(s=Ge(n,"ref"))&&bt(n,dt,`"${s}"`,t),_t(n,t);const c=[];for(const{name:e,value:l}of[...n.attributes])ht.test(e)&&"v-cloak"!==e&&("v-model"===e?c.unshift([e,l]):"@"===e[0]||/^v-on\b/.test(e)?c.push([e,l]):yt(n,e,l,t));for(const[e,l]of c)yt(n,e,l,t);return o&&(gt=!1),i}if(3===n){const n=e.data;if(n.includes(t.delimiters[0])){let s,r=[],i=0;for(;s=t.delimitersRE.exec(n);){const e=n.slice(i,s.index);e&&r.push(JSON.stringify(e)),r.push(`$s(${s[1]})`),i=s.index+s[0].length}i<n.length&&r.push(JSON.stringify(n.slice(i))),bt(e,Je,r.join("+"),t)}}else 11===n&&_t(e,t)},_t=(e,t)=>{let n=e.firstChild;for(;n;)n=vt(n,t)||n.nextSibling},yt=(e,t,n,s)=>{let r,i,o;if(":"===(t=t.replace(mt,(e,t)=>((o||(o={}))[t]=!0,"")))[0])r=Be,i=t.slice(1);else if("@"===t[0])r=He,i=t.slice(1);else{const e=t.indexOf(":"),n=e>0?t.slice(2,e):t.slice(2);r=ct[n]||s.dirs[n],i=e>0?t.slice(e+1):void 0}r&&(r===Be&&"ref"===i&&(r=dt),bt(e,r,n,s,i,o),e.removeAttribute(t))},bt=(e,t,n,s,r,i)=>{const o=t({el:e,get:(t=n)=>rt(s.scope,t,e),effect:s.effect,ctx:s,exp:n,arg:r,modifiers:i});o&&s.cleanups.push(o)},wt=(e,t)=>{if("#"===t[0]){const n=document.querySelector(t);return void e.appendChild(n.content.cloneNode(!0))}e.innerHTML=t},xt=e=>{const t={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...e,scope:e?e.scope:de({}),dirs:e?e.dirs:{},effects:[],blocks:[],cleanups:[],effect:e=>{if(gt)return Ce(e),e;const n=C(e,{scheduler:()=>Ce(n)});return t.effects.push(n),n}};return t},St=(e,t={})=>{const n=e.scope,s=Object.create(n);Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)),s.$refs=Object.create(n.$refs);const r=de(new Proxy(s,{set:(e,t,s,o)=>o!==r||i(e,t)?Reflect.set(e,t,s,o):Reflect.set(n,t,s)})),o={...e,scope:r};return s.$watch=be(o),s.$id=ye(),$t(r),o},$t=e=>{for(const t of Object.keys(e))"function"==typeof e[t]&&(e[t]=e[t].bind(e))};class kt{template;ctx;key;parentCtx;isFragment;start;end;get el(){return this.start||this.template}constructor(e,t,n=!1){this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=xt(t)),vt(this.template,this.ctx)}insert(e,t=null){if(this.isFragment)if(this.start){let n,s=this.start;for(;s&&(n=s.nextSibling,e.insertBefore(s,t),s!==this.end);)s=n}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else this.template.__teleported||e.insertBefore(this.template,t)}remove(){this.parentCtx&&((e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)})(this.parentCtx.blocks,this);const e=()=>{if(this.start){const e=this.start.parentNode;let t,n=this.start;for(;n&&(t=n.nextSibling,e.removeChild(n),n!==this.end);)n=t}else this.template.parentNode.removeChild(this.template);this.teardown()},t=this.isFragment?void 0:this.template.__leave;t?t().then(e):e()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(I),this.ctx.cleanups.forEach(e=>e())}}const Et=de(Object.create(null)),Ot=e=>e.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),Lt=e=>{const t=xt();if("function"==typeof e&&(e=e()),e&&(t.scope=de(e),$t(t.scope),e.$delimiters)){const[n,s]=t.delimiters=e.$delimiters;t.delimitersRE=new RegExp(Ot(n)+"([^]+?)"+Ot(s),"g")}t.scope.$s=Ze,t.scope.$nextTick=Me,t.scope.$refs=Object.create(null),t.scope.$store=Et,t.scope.$watch=be(t),t.scope.$id=ye(),Object.defineProperty(t.scope,"$root",{value:t.scope,enumerable:!1});let n=[];const s=new Set,r={get scope(){return t.scope},directive(e,n){return n?(t.dirs[e]=n,this):t.dirs[e]},use:(e,t)=>(s.has(e)||(s.add(e),("function"==typeof e?e:e.install)(r,t)),r),mount(e){if("string"==typeof e&&!(e=document.querySelector(e)))return;let s;s=(e=e||document.documentElement).hasAttribute("v-scope")?[e]:[...e.querySelectorAll("[v-scope]")].filter(e=>!e.matches("[v-scope] [v-scope]")),s.length||(s=[e]);for(const r of s){const e=r.getAttribute("v-name"),s=new kt(r,t,!0);Te.scopes.has(r)||t.cleanups.push(Ne(r,t.scope,void 0,e||void 0)),n.push(s)}return this},unmount(){n.forEach(e=>e.teardown()),n=[]}};return r},jt=document.currentScript;return jt&&jt.hasAttribute("init")&&Lt().mount(),e.createApp=Lt,e.devtools=Te,e.disableDevtools=()=>{ke=!0,we.clear(),xe.clear(),Se.clear(),$e.clear();for(const e in Oe)Oe[e].clear();"undefined"!=typeof window&&window.__LITE_VUE__===Te&&delete window.__LITE_VUE__},e.nextTick=Me,e.reactive=de,e.store=(e,t)=>(void 0!==t&&(Et[e]=t,"function"==typeof Et[e].init&&Et[e].init(),((e,t)=>{Ee()||($e.set(e,t),Le("store:register",e,t))})(e,Et[e])),Et[e]),e.watchEffect=e=>{let t;return t=C(e,{scheduler:()=>Ce(t)}),()=>I(t)},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
|
12
|
+
**/let N;function T(e,t=void 0){t&&t.active&&t.effects.push(e)}class A{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,T(this,s)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,K();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(R(t.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),D()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=B,t=N;try{return B=!0,N=this,this._runnings++,P(this),this.fn()}finally{M(this),this._runnings--,N=t,B=e}}stop(){this.active&&(P(this),M(this),this.onStop&&this.onStop(),this.active=!1)}}function R(e){return e.value}function P(e){e._trackId++,e._depsLength=0}function M(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)C(e.deps[t],e);e.deps.length=e._depsLength}}function C(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}function I(e,t){e.effect instanceof A&&(e=e.effect.fn);const r=new A(e,n,()=>{r.dirty&&r.run()});t&&(s(r,t),t.scope&&T(r,t.scope)),t&&t.lazy||r.run();const i=r.run.bind(r);return i.effect=r,i}function V(e){e.effect.stop()}let B=!0,W=0;const z=[];function K(){z.push(B),B=!1}function D(){const e=z.pop();B=void 0===e||e}function F(){W++}function U(){for(W--;!W&&H.length;)H.shift()()}function q(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&C(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const H=[];function J(e,t,n){F();for(const s of e.keys()){let n;s._dirtyLevel<t&&(null!=n?n:n=e.get(s)===s._trackId)&&(s._shouldSchedule||(s._shouldSchedule=0===s._dirtyLevel),s._dirtyLevel=t),s._shouldSchedule&&(null!=n?n:n=e.get(s)===s._trackId)&&(s.trigger(),s._runnings&&!s.allowRecurse||2===s._dirtyLevel||(s._shouldSchedule=!1,s.scheduler&&H.push(s.scheduler)))}U()}const Z=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},G=new WeakMap,Q=Symbol(""),X=Symbol("");function Y(e,t,n){if(B&&N){let t=G.get(e);t||G.set(e,t=new Map);let s=t.get(n);s||t.set(n,s=Z(()=>t.delete(n))),q(N,s)}}function ee(e,t,n,s,r,i){const l=G.get(e);if(!l)return;let u=[];if("clear"===t)u=[...l.values()];else if("length"===n&&o(e)){const e=Number(s);l.forEach((t,n)=>{("length"===n||!a(n)&&n>=e)&&u.push(t)})}else switch(void 0!==n&&u.push(l.get(n)),t){case"add":o(e)?h(n)&&u.push(l.get("length")):(u.push(l.get(Q)),c(e)&&u.push(l.get(X)));break;case"delete":o(e)||(u.push(l.get(Q)),c(e)&&u.push(l.get(X)));break;case"set":c(e)&&u.push(l.get(Q))}F();for(const o of u)o&&J(o,4);U()}const te=t("__proto__,__v_isRef,__isVue"),ne=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(a)),se=re();function re(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){const n=ye(this);for(let t=0,r=this.length;t<r;t++)Y(n,0,t+"");const s=n[t](...e);return-1===s||!1===s?n[t](...e.map(ye)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...e){K(),F();const n=ye(this)[t].apply(this,e);return U(),D(),n}}),e}function ie(e){a(e)||(e=String(e));const t=ye(this);return Y(t,0,e),t.hasOwnProperty(e)}class oe{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?he:de:r?pe:fe).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const c=o(e);if(!s){if(c&&i(se,t))return Reflect.get(se,t,n);if("hasOwnProperty"===t)return ie}const l=Reflect.get(e,t,n);return(a(t)?ne.has(t):te(t))?l:(s||Y(e,0,t),r?l:xe(l)?c&&h(t)?l:l.value:f(l)?s?function(e){return ve(e,!0,ae,null,de)}(l):ge(l):l)}}class ce extends oe{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=_e(r);if(function(e){return!(!e||!e.__v_isShallow)}(n)||_e(n)||(r=ye(r),n=ye(n)),!o(e)&&xe(r)&&!xe(n))return!t&&(r.value=n,!0)}const c=o(e)&&h(t)?Number(t)<e.length:i(e,t),l=Reflect.set(e,t,n,s);return e===ye(s)&&(c?b(n,r)&&ee(e,"set",t,n):ee(e,"add",t,n)),l}deleteProperty(e,t){const n=i(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&n&&ee(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return a(t)&&ne.has(t)||Y(e,0,t),n}ownKeys(e){return Y(e,0,o(e)?"length":Q),Reflect.ownKeys(e)}}class le extends oe{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const ue=new ce,ae=new le,fe=new WeakMap,pe=new WeakMap,de=new WeakMap,he=new WeakMap;function me(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>d(e).slice(8,-1))(e))}function ge(e){return _e(e)?e:ve(e,!1,ue,null,fe)}function ve(e,t,n,s,r){if(!f(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=me(e);if(0===o)return e;const c=new Proxy(e,2===o?s:n);return r.set(e,c),c}function _e(e){return!(!e||!e.__v_isReadonly)}function ye(e){const t=e&&e.__v_raw;return t?ye(t):e}class be{constructor(e,t,n,s){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new A(()=>e(this._value),()=>we(this,2===this.effect._dirtyLevel?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=n}get value(){const e=ye(this);var t,n;return e._cacheable&&!e.effect.dirty||!b(e._value,e._value=e.effect.run())||we(e,4),t=e,B&&N&&(t=ye(t),q(N,null!=(n=t.dep)?n:t.dep=Z(()=>t.dep=void 0,t instanceof be?t:void 0))),e.effect._dirtyLevel>=2&&we(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function we(e,t=4,n,s){const r=(e=ye(e)).dep;r&&J(r,t)}function xe(e){return!(!e||!0!==e.__v_isRef)}let Se=0;const $e=()=>{const e=Object.create(null);return(t="id")=>e[t]||(e[t]=`${t}-${++Se}`)},ke=e=>(t,n)=>{const s="function"==typeof t?t:()=>t.split(".").reduce((e,t)=>null==e?e:e[t],e.scope);let r,i=!1;e.effect(()=>{const e=s();i&&e!==r&&(K(),n(e,r),D()),i=!0,r=e})},Ee=new Map,Oe=new Map,Le=new Map,je=new Map;let Ne=!1;const Te=()=>Ne||"undefined"!=typeof window&&!1===window.__LITE_VUE_DEVTOOLS__,Ae={"scope:mount":new Set,"scope:unmount":new Set,"store:register":new Set,flush:new Set},Re=(e,...t)=>{Ae[e].forEach(e=>e(...t))},Pe=()=>{},Me=(e,t,n,s)=>Te()?Pe:(Ee.set(e,t),n&&Oe.set(e,n),s&&Le.set(e,s),Re("scope:mount",e,t),()=>{Ee.delete(e)&&(Oe.delete(e),Le.delete(e),Re("scope:unmount",e))}),Ce={scopes:Ee,exps:Oe,names:Le,stores:je,getScopeByName(e){for(const[t,n]of Le)if(n===e)return Ee.get(t)},getScope(e){let t=1===e.nodeType?e:e.parentElement;for(;t;){const e=Ee.get(t);if(e)return e;t=t.parentElement}},on:(e,t)=>(Ae[e].add(t),()=>Ae[e].delete(t)),off(e,t){Ae[e].delete(t)}};"undefined"==typeof window||Te()||(window.__LITE_VUE__=Ce);let Ie=!1;const Ve=[],Be=Promise.resolve(),We=e=>Be.then(e),ze=e=>{Ve.includes(e)||Ve.push(e),Ie||(Ie=!0,We(Ke))},Ke=()=>{for(const e of Ve)e();Ve.length=0,Ie=!1,Ae.flush.size&&Re("flush")},De=/^(spellcheck|draggable|form|list|type)$/,Fe=({el:e,get:t,effect:n,arg:s,modifiers:r})=>{let i;"class"===s&&(e._class=e.className),n(()=>{let n=t();if(s)r?.camel&&(s=v(s)),Ue(e,s,n,i);else{for(const t in n)Ue(e,t,n[t],i&&i[t]);for(const t in i)n&&t in n||Ue(e,t,null)}i=n})},Ue=(e,t,n,s)=>{if("class"===t)e.setAttribute("class",O(e._class?[e._class,n]:n)||"");else if("style"===t){n=x(n);const{style:t}=e;if(n)if(u(n))n!==s&&(t.cssText=n);else{for(const e in n)He(t,e,n[e]);if(s&&!u(s))for(const e in s)null==n[e]&&He(t,e,"")}else e.removeAttribute("style")}else e instanceof SVGElement||!(t in e)||De.test(t)?"true-value"===t?e._trueValue=n:"false-value"===t?e._falseValue=n:null!=n?e.setAttribute(t,n):e.removeAttribute(t):(e[t]=n,"value"===t&&(e._value=n))},qe=/\s*!important$/,He=(e,t,n)=>{o(n)?n.forEach(n=>He(e,t,n)):t.startsWith("--")?e.setProperty(t,n):qe.test(n)?e.setProperty(y(t),n.replace(qe,""),"important"):e[t]=n},Je=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ze=["ctrl","shift","alt","meta"],Ge={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Ze.some(n=>e[`${n}Key`]&&!t[n])},Qe=/^(stop|prevent|self|ctrl|shift|alt|meta|left|middle|right|exact|once|capture|passive|window|document|outside|debounce(-\d+)?|throttle(-\d+)?|prop-.+|name-.+)$/,Xe=({el:e,get:t,exp:n,arg:s,modifiers:r})=>{if(!s)return;let i=Je.test(n)?t(`(e => ${n}(e))`):t(`($event => { ${n} })`);if("mounted"===s||"vue:mounted"===s)return void We(i);if("unmounted"===s||"vue:unmounted"===s)return()=>i();if(r){"click"===s&&(r.right&&(s="contextmenu"),r.middle&&(s="mouseup"));let t=i;for(const e in r){let n=/^debounce(?:-(\d+))?$/.exec(e);if(n){const e=t,s=n[1]?+n[1]:250;let r;t=t=>{clearTimeout(r),r=setTimeout(e,s,t)};continue}if(n=/^throttle(?:-(\d+))?$/.exec(e),n){const e=t,s=n[1]?+n[1]:250;let r=0;t=t=>{const n=Date.now();n-r>=s&&(r=n,e(t))}}}const n=Object.keys(r).filter(e=>!Qe.test(e));i=s=>{if(!(r.outside&&e.contains(s.target)||"key"in s&&n.length&&!(y(s.key)in r))){for(const e in r){const t=Ge[e];if(t&&t(s,r))return;if(e.startsWith("prop-")&&"propertyName"in s&&s.propertyName!==e.slice(5))return;if(e.startsWith("name-")&&"animationName"in s&&s.animationName!==e.slice(5))return}return t(s)}}}const o=r?.window?window:r?.document||r?.outside?document:e,c=s;return o.addEventListener(c,i,r),o!==e?()=>o.removeEventListener(c,i,r):void 0},Ye=({el:e,get:t,effect:n})=>{n(()=>{e.textContent=et(t())})},et=e=>null==e?"":f(e)?JSON.stringify(e,null,2):String(e),tt=(e,t)=>{const n=e.getAttribute(t);return null!=n&&e.removeAttribute(t),n},nt=(e,t,n,s)=>{e.addEventListener(t,n,s)},st=e=>"_value"in e?e._value:e.value,rt=(e,t)=>{const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t},it=e=>{e.target.composing=!0},ot=e=>{const t=e.target;t.composing&&(t.composing=!1,ct(t,"input"))},ct=(e,t)=>{const n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)},lt=Object.create(null),ut=(e,t,n)=>at(e,`return(${t})`,n),at=(e,t,n)=>{const s=lt[t]||(lt[t]=ft(t));try{return s(e,n,n&&(e=>(t,n)=>e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0})))(n))}catch(r){console.error(r)}},ft=e=>{try{return new Function("$data","$el","$dispatch",`with($data){${e}}`)}catch(t){return console.error(`${t.message} in expression: ${e}`),()=>{}}},pt={bind:Fe,on:Xe,show:({el:e,get:t,effect:n})=>{const s=e.style.display;n(()=>{e.style.display=t()?s:"none"})},text:Ye,html:({el:e,get:t,effect:n})=>{n(()=>{e.innerHTML=t()})},model:({el:e,exp:t,get:n,effect:s,modifiers:r})=>{const i=e.type,c=n(`(val) => { ${t} = val }`),{trim:l,number:u="number"===i,lazy:a,fill:f}=r||{};if("SELECT"===e.tagName){const t=e;nt(e,"change",()=>{const e=Array.prototype.filter.call(t.options,e=>e.selected).map(e=>u?w(st(e)):st(e));c(t.multiple?e:e[0])}),s(()=>{const e=n(),s=t.multiple;for(let n=0,r=t.options.length;n<r;n++){const r=t.options[n],i=st(r);if(s)o(e)?r.selected=j(e,i)>-1:r.selected=e.has(i);else if(L(st(r),e))return void(t.selectedIndex!==n&&(t.selectedIndex=n))}s||-1===t.selectedIndex||(t.selectedIndex=-1)})}else if("checkbox"===i){let t;nt(e,"change",()=>{const t=n(),s=e.checked;if(o(t)){const n=st(e),r=j(t,n),i=-1!==r;if(s&&!i)c(t.concat(n));else if(!s&&i){const e=[...t];e.splice(r,1),c(e)}}else c(rt(e,s))}),s(()=>{const s=n();o(s)?e.checked=j(s,st(e))>-1:s!==t&&(e.checked=L(s,rt(e,!0))),t=s})}else if("radio"===i){let t;nt(e,"change",()=>{c(st(e))}),s(()=>{const s=n();s!==t&&(e.checked=L(s,st(e)))})}else{const t=e=>l?e.trim():u?w(e):e;let i=c;for(const e in r||{}){const t=/^debounce(?:-(\d+))?$/.exec(e);if(t){const e=t[1]?+t[1]:250;let n;i=t=>{clearTimeout(n),n=setTimeout(c,e,t)}}}if(nt(e,"compositionstart",it),nt(e,"compositionend",ot),nt(e,a?"change":"input",()=>{e.composing||i(t(e.value))}),l&&nt(e,"change",()=>{e.value=e.value.trim()}),f){const s=n();null!=s&&""!==s||!e.value||c(t(e.value))}s(()=>{if(e.composing)return;const s=e.value,r=n();document.activeElement===e&&t(s)===r||s!==r&&(e.value=r)})}},effect:({el:e,ctx:t,exp:n,effect:s})=>{We(()=>s(()=>at(t.scope,n,e)))}},dt=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ht=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,mt=/^\(|\)$/g,gt=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,vt=(e,t,n)=>{const s=t.match(dt);if(!s)return;const r=e.nextSibling,i=e.parentElement,c=new Text("");i.insertBefore(c,e),i.removeChild(e);const l=s[2].trim();let u,a,p,d,h=s[1].trim().replace(mt,"").trim(),m=!1,g="key",v=e.getAttribute(g)||e.getAttribute(g=":key")||e.getAttribute(g="v-bind:key");v&&(e.removeAttribute(g),"key"===g&&(v=JSON.stringify(v))),(d=h.match(ht))&&(h=h.replace(ht,"").trim(),a=d[1].trim(),d[2]&&(p=d[2].trim())),(d=h.match(gt))&&(u=d[1].split(",").map(e=>e.trim()),m="["===h[0]);let _,y,b,w=!1;const x=(e,t,s,r)=>{const i={};u?u.forEach((e,n)=>i[e]=t[m?n:e]):i[h]=t,r?(a&&(i[a]=r),p&&(i[p]=s)):a&&(i[a]=s);const o=Lt(n,i),c=v?ut(o.scope,v):s;return e.set(c,s),o.key=c,o},S=(t,n)=>{const s=new Nt(e,t);return s.key=t.key,s.insert(i,n),s};return n.effect(()=>{const e=ut(n.scope,l),t=b;if([y,b]=(e=>{const t=new Map,n=[];if(o(e))for(let s=0;s<e.length;s++)n.push(x(t,e[s],s));else if("number"==typeof e)for(let s=0;s<e;s++)n.push(x(t,s+1,s));else if(f(e)){let s=0;for(const r in e)n.push(x(t,e[r],s++,r))}return[n,t]})(e),w){for(let t=0;t<_.length;t++)b.has(_[t].key)||_[t].remove();const e=[];let n,s,r=y.length;for(;r--;){const o=y[r],l=t.get(o.key);let u;null==l?u=S(o,n?n.el:c):(u=_[l],Object.assign(u.ctx.scope,o.scope),l!==r&&(_[l+1]===n&&s!==n||(s=u,u.insert(i,n?n.el:c)))),e.unshift(n=u)}_=e}else _=y.map(e=>S(e,c)),w=!0}),r},_t=({el:e,ctx:{scope:{$refs:t}},get:n,effect:s})=>{let r;return s(()=>{const s=n();t[s]=e,r&&s!==r&&delete t[r],r=s}),()=>{r&&delete t[r]}},yt=/^(?:v-|:|@)/,bt=/\.([\w-]+)/g;let wt=!1;const xt=(e,t)=>{const n=e.nodeType;if(1===n){const n=e;if(n.hasAttribute("v-pre"))return;let s;if(tt(n,"v-cloak"),s=tt(n,"v-if"))return((e,t,n)=>{const s=e.parentElement,r=new Comment("v-if");s.insertBefore(r,e);const i=[{exp:t,el:e}];let o,c;for(;(o=e.nextElementSibling)&&(c=null,""===tt(o,"v-else")||(c=tt(o,"v-else-if")));)s.removeChild(o),i.push({exp:c,el:o});const l=e.nextSibling;let u;s.removeChild(e);let a=-1;const f=()=>{u&&(u.el.parentNode===s&&s.insertBefore(r,u.el),u.remove(),u=void 0)};return n.effect(()=>{for(let e=0;e<i.length;e++){const{exp:t,el:o}=i[e];if(!t||ut(n.scope,t))return void(e!==a&&(f(),u=new Nt(o,n),u.insert(s,r),u.el.parentNode===s&&s.removeChild(r),a=e))}a=-1,f()}),l})(n,s,t);if(s=tt(n,"v-for"))return vt(n,s,t);const r=tt(n,"v-name");let i;if(s=tt(n,"v-teleport")){const e=document.querySelector(s);e&&(i=n.nextSibling,n.__teleported=!0,e.appendChild(n),t.cleanups.push(()=>n.remove()))}if((s=tt(n,"v-scope"))||""===s){const e=s?ut(t.scope,s):{};t=Lt(t,e),n.__ctx=t,t.cleanups.push(Me(n,t.scope,s||void 0,r||void 0)),e.$template&&Et(n,e.$template)}const o=null!=tt(n,"v-once");o&&(wt=!0),(s=tt(n,"ref"))&&kt(n,_t,`"${s}"`,t),St(n,t);const c=[];for(const{name:e,value:l}of[...n.attributes])yt.test(e)&&"v-cloak"!==e&&("v-model"===e?c.unshift([e,l]):"@"===e[0]||/^v-on\b/.test(e)?c.push([e,l]):$t(n,e,l,t));for(const[e,l]of c)$t(n,e,l,t);return o&&(wt=!1),i}if(3===n){const n=e.data;if(n.includes(t.delimiters[0])){let s,r=[],i=0;for(;s=t.delimitersRE.exec(n);){const e=n.slice(i,s.index);e&&r.push(JSON.stringify(e)),r.push(`$s(${s[1]})`),i=s.index+s[0].length}i<n.length&&r.push(JSON.stringify(n.slice(i))),kt(e,Ye,r.join("+"),t)}}else 11===n&&St(e,t)},St=(e,t)=>{let n=e.firstChild;for(;n;)n=xt(n,t)||n.nextSibling},$t=(e,t,n,s)=>{let r,i,o;if(":"===(t=t.replace(bt,(e,t)=>((o||(o={}))[t]=!0,"")))[0])r=Fe,i=t.slice(1);else if("@"===t[0])r=Xe,i=t.slice(1);else{const e=t.indexOf(":"),n=e>0?t.slice(2,e):t.slice(2);r=pt[n]||s.dirs[n],i=e>0?t.slice(e+1):void 0}r&&(r===Fe&&"ref"===i&&(r=_t),kt(e,r,n,s,i,o),e.removeAttribute(t))},kt=(e,t,n,s,r,i)=>{const o=t({el:e,get:(t=n)=>ut(s.scope,t,e),effect:s.effect,ctx:s,exp:n,arg:r,modifiers:i});o&&s.cleanups.push(o)},Et=(e,t)=>{if("#"===t[0]){const n=document.querySelector(t);return void e.appendChild(n.content.cloneNode(!0))}e.innerHTML=t},Ot=e=>{const t={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...e,scope:e?e.scope:ge({}),dirs:e?e.dirs:{},effects:[],blocks:[],cleanups:[],effect:e=>{if(wt)return ze(e),e;const n=I(e,{scheduler:()=>ze(n)});return t.effects.push(n),n}};return t},Lt=(e,t={})=>{const n=e.scope,s=Object.create(n);Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)),s.$refs=Object.create(n.$refs);const r=ge(new Proxy(s,{set:(e,t,s,o)=>o!==r||i(e,t)?Reflect.set(e,t,s,o):Reflect.set(n,t,s)})),o={...e,scope:r};return s.$watch=ke(o),s.$id=$e(),jt(r),o},jt=e=>{for(const t of Object.keys(e))"function"==typeof e[t]&&(e[t]=e[t].bind(e))};class Nt{template;ctx;key;parentCtx;isFragment;start;end;get el(){return this.start||this.template}constructor(e,t,n=!1){this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=Ot(t)),xt(this.template,this.ctx)}insert(e,t=null){if(this.isFragment)if(this.start){let n,s=this.start;for(;s&&(n=s.nextSibling,e.insertBefore(s,t),s!==this.end);)s=n}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else this.template.__teleported||e.insertBefore(this.template,t)}remove(){this.parentCtx&&((e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)})(this.parentCtx.blocks,this);const e=()=>{if(this.start){const e=this.start.parentNode;let t,n=this.start;for(;n&&(t=n.nextSibling,e.removeChild(n),n!==this.end);)n=t}else this.template.parentNode.removeChild(this.template);this.teardown()},t=this.isFragment?void 0:this.template.__leave;t?t().then(e):e()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(V),this.ctx.cleanups.forEach(e=>e())}}const Tt=ge(Object.create(null)),At=e=>e.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),Rt=e=>{const t=Ot();if("function"==typeof e&&(e=e()),e&&(t.scope=ge(e),jt(t.scope),e.$delimiters)){const[n,s]=t.delimiters=e.$delimiters;t.delimitersRE=new RegExp(At(n)+"([^]+?)"+At(s),"g")}t.scope.$s=et,t.scope.$nextTick=We,t.scope.$refs=Object.create(null),t.scope.$store=Tt,t.scope.$watch=ke(t),t.scope.$id=$e(),Object.defineProperty(t.scope,"$root",{value:t.scope,enumerable:!1});let n=[];const s=new Set,r={get scope(){return t.scope},directive(e,n){return n?(t.dirs[e]=n,this):t.dirs[e]},use:(e,t)=>(s.has(e)||(s.add(e),("function"==typeof e?e:e.install)(r,t)),r),mount(e){if("string"==typeof e&&!(e=document.querySelector(e)))return;let s;s=(e=e||document.documentElement).hasAttribute("v-scope")?[e]:[...e.querySelectorAll("[v-scope]")].filter(e=>!e.matches("[v-scope] [v-scope]")),s.length||(s=[e]),t.walk??=xt;for(const r of s){const e=r.getAttribute("v-name");r.__ctx??=t;const s=new Nt(r,t,!0);Ce.scopes.has(r)||t.cleanups.push(Me(r,t.scope,void 0,e||void 0)),n.push(s)}return this},unmount(){n.forEach(e=>e.teardown()),n=[]}};return r},Pt=document.currentScript;return Pt&&Pt.hasAttribute("init")&&Rt().mount(),e.computed=function(e,t,s=!1){let r,i;const o="function"==typeof e;return o?(r=e,i=n):(r=e.get,i=e.set),new be(r,i,o||!i,s)},e.createApp=Rt,e.devtools=Ce,e.disableDevtools=()=>{Ne=!0,Ee.clear(),Oe.clear(),Le.clear(),je.clear();for(const e in Ae)Ae[e].clear();"undefined"!=typeof window&&window.__LITE_VUE__===Ce&&delete window.__LITE_VUE__},e.nextTick=We,e.reactive=ge,e.store=(e,t)=>(void 0!==t&&(Tt[e]=t,"function"==typeof Tt[e].init&&Tt[e].init(),((e,t)=>{Te()||(je.set(e,t),Re("store:register",e,t))})(e,Tt[e])),Tt[e]),e.watchEffect=e=>{let t;return t=I(e,{scheduler:()=>ze(t)}),()=>V(t)},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),e}({});
|
package/dist/litevue.mjs
CHANGED
|
@@ -23,6 +23,7 @@ const hasOwn = (val, key) => hasOwnProperty$1.call(val, key);
|
|
|
23
23
|
const isArray = Array.isArray;
|
|
24
24
|
const isMap = (val) => toTypeString(val) === "[object Map]";
|
|
25
25
|
const isDate = (val) => toTypeString(val) === "[object Date]";
|
|
26
|
+
const isFunction = (val) => typeof val === "function";
|
|
26
27
|
const isString = (val) => typeof val === "string";
|
|
27
28
|
const isSymbol = (val) => typeof val === "symbol";
|
|
28
29
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
@@ -643,6 +644,82 @@ function toRaw(observed) {
|
|
|
643
644
|
const raw = observed && observed["__v_raw"];
|
|
644
645
|
return raw ? toRaw(raw) : observed;
|
|
645
646
|
}
|
|
647
|
+
class ComputedRefImpl {
|
|
648
|
+
constructor(getter, _setter, isReadonly2, isSSR) {
|
|
649
|
+
this.getter = getter;
|
|
650
|
+
this._setter = _setter;
|
|
651
|
+
this.dep = void 0;
|
|
652
|
+
this.__v_isRef = true;
|
|
653
|
+
this["__v_isReadonly"] = false;
|
|
654
|
+
this.effect = new ReactiveEffect(
|
|
655
|
+
() => getter(this._value),
|
|
656
|
+
() => triggerRefValue(
|
|
657
|
+
this,
|
|
658
|
+
this.effect._dirtyLevel === 2 ? 2 : 3
|
|
659
|
+
)
|
|
660
|
+
);
|
|
661
|
+
this.effect.computed = this;
|
|
662
|
+
this.effect.active = this._cacheable = !isSSR;
|
|
663
|
+
this["__v_isReadonly"] = isReadonly2;
|
|
664
|
+
}
|
|
665
|
+
get value() {
|
|
666
|
+
const self = toRaw(this);
|
|
667
|
+
if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
|
|
668
|
+
triggerRefValue(self, 4);
|
|
669
|
+
}
|
|
670
|
+
trackRefValue(self);
|
|
671
|
+
if (self.effect._dirtyLevel >= 2) {
|
|
672
|
+
triggerRefValue(self, 2);
|
|
673
|
+
}
|
|
674
|
+
return self._value;
|
|
675
|
+
}
|
|
676
|
+
set value(newValue) {
|
|
677
|
+
this._setter(newValue);
|
|
678
|
+
}
|
|
679
|
+
// #region polyfill _dirty for backward compatibility third party code for Vue <= 3.3.x
|
|
680
|
+
get _dirty() {
|
|
681
|
+
return this.effect.dirty;
|
|
682
|
+
}
|
|
683
|
+
set _dirty(v) {
|
|
684
|
+
this.effect.dirty = v;
|
|
685
|
+
}
|
|
686
|
+
// #endregion
|
|
687
|
+
}
|
|
688
|
+
function computed(getterOrOptions, debugOptions, isSSR = false) {
|
|
689
|
+
let getter;
|
|
690
|
+
let setter;
|
|
691
|
+
const onlyGetter = isFunction(getterOrOptions);
|
|
692
|
+
if (onlyGetter) {
|
|
693
|
+
getter = getterOrOptions;
|
|
694
|
+
setter = NOOP;
|
|
695
|
+
} else {
|
|
696
|
+
getter = getterOrOptions.get;
|
|
697
|
+
setter = getterOrOptions.set;
|
|
698
|
+
}
|
|
699
|
+
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
|
|
700
|
+
return cRef;
|
|
701
|
+
}
|
|
702
|
+
function trackRefValue(ref2) {
|
|
703
|
+
var _a;
|
|
704
|
+
if (shouldTrack && activeEffect) {
|
|
705
|
+
ref2 = toRaw(ref2);
|
|
706
|
+
trackEffect(
|
|
707
|
+
activeEffect,
|
|
708
|
+
(_a = ref2.dep) != null ? _a : ref2.dep = createDep(
|
|
709
|
+
() => ref2.dep = void 0,
|
|
710
|
+
ref2 instanceof ComputedRefImpl ? ref2 : void 0
|
|
711
|
+
));
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function triggerRefValue(ref2, dirtyLevel = 4, newVal, oldVal) {
|
|
715
|
+
ref2 = toRaw(ref2);
|
|
716
|
+
const dep = ref2.dep;
|
|
717
|
+
if (dep) {
|
|
718
|
+
triggerEffects(
|
|
719
|
+
dep,
|
|
720
|
+
dirtyLevel);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
646
723
|
function isRef(r) {
|
|
647
724
|
return !!(r && r.__v_isRef === true);
|
|
648
725
|
}
|
|
@@ -1412,6 +1489,7 @@ const walk = (node, ctx) => {
|
|
|
1412
1489
|
if ((exp = checkAttr(el, "v-scope")) || exp === "") {
|
|
1413
1490
|
const scope = exp ? evaluate(ctx.scope, exp) : {};
|
|
1414
1491
|
ctx = createScopedContext(ctx, scope);
|
|
1492
|
+
el.__ctx = ctx;
|
|
1415
1493
|
ctx.cleanups.push(
|
|
1416
1494
|
registerScope(el, ctx.scope, exp || void 0, name || void 0)
|
|
1417
1495
|
);
|
|
@@ -1747,8 +1825,10 @@ const createApp = (initialData) => {
|
|
|
1747
1825
|
if (!roots.length) {
|
|
1748
1826
|
roots = [el];
|
|
1749
1827
|
}
|
|
1828
|
+
ctx.walk ??= walk;
|
|
1750
1829
|
for (const el2 of roots) {
|
|
1751
1830
|
const name = el2.getAttribute("v-name");
|
|
1831
|
+
el2.__ctx ??= ctx;
|
|
1752
1832
|
const block = new Block(el2, ctx, true);
|
|
1753
1833
|
if (!devtools.scopes.has(el2)) {
|
|
1754
1834
|
ctx.cleanups.push(
|
|
@@ -1778,4 +1858,4 @@ if (s && s.hasAttribute("init")) {
|
|
|
1778
1858
|
createApp().mount();
|
|
1779
1859
|
}
|
|
1780
1860
|
|
|
1781
|
-
export { createApp, devtools, disableDevtools, nextTick, reactive, store, watchEffect };
|
|
1861
|
+
export { computed, createApp, devtools, disableDevtools, nextTick, reactive, store, watchEffect };
|
package/dist/litevue.umd.js
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
5
|
* @license MIT
|
|
6
6
|
**/
|
|
7
|
-
/*! #__NO_SIDE_EFFECTS__ */function t(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const n=()=>{},s=Object.assign,r=Object.prototype.hasOwnProperty,i=(e,t)=>r.call(e,t),o=Array.isArray,c=e=>"[object Map]"===d(e),l=e=>"[object Date]"===d(e),u=e=>"string"==typeof e,f=e=>"symbol"==typeof e,a=e=>null!==e&&"object"==typeof e,p=Object.prototype.toString,d=e=>p.call(e),h=e=>u(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,m=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},g=/-(\w)/g,
|
|
7
|
+
/*! #__NO_SIDE_EFFECTS__ */function t(e,t){const n=new Set(e.split(","));return e=>n.has(e)}const n=()=>{},s=Object.assign,r=Object.prototype.hasOwnProperty,i=(e,t)=>r.call(e,t),o=Array.isArray,c=e=>"[object Map]"===d(e),l=e=>"[object Date]"===d(e),u=e=>"string"==typeof e,f=e=>"symbol"==typeof e,a=e=>null!==e&&"object"==typeof e,p=Object.prototype.toString,d=e=>p.call(e),h=e=>u(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,m=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},g=/-(\w)/g,_=m(e=>e.replace(g,(e,t)=>t?t.toUpperCase():"")),v=/\B([A-Z])/g,y=m(e=>e.replace(v,"-$1").toLowerCase()),b=(e,t)=>!Object.is(e,t),w=e=>{const t=u(e)?Number(e):NaN;return isNaN(t)?e:t};function x(e){if(o(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=u(s)?E(s):x(s);if(r)for(const e in r)t[e]=r[e]}return t}if(u(e)||a(e))return e}const S=/;(?![^(]*\))/g,$=/:([^]+)/,k=/\/\*[^]*?\*\//g;function E(e){const t={};return e.replace(k,"").split(S).forEach(e=>{if(e){const n=e.split($);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function O(e){let t="";if(u(e))t=e;else if(o(e))for(let n=0;n<e.length;n++){const s=O(e[n]);s&&(t+=s+" ")}else if(a(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function L(e,t){if(e===t)return!0;let n=l(e),s=l(t);if(n||s)return!(!n||!s)&&e.getTime()===t.getTime();if(n=f(e),s=f(t),n||s)return e===t;if(n=o(e),s=o(t),n||s)return!(!n||!s)&&function(e,t){if(e.length!==t.length)return!1;let n=!0;for(let s=0;n&&s<e.length;s++)n=L(e[s],t[s]);return n}(e,t);if(n=a(e),s=a(t),n||s){if(!n||!s)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e){const s=e.hasOwnProperty(n),r=t.hasOwnProperty(n);if(s&&!r||!s&&r||!L(e[n],t[n]))return!1}}return String(e)===String(t)}function j(e,t){return e.findIndex(e=>L(e,t))}
|
|
8
8
|
/**
|
|
9
9
|
* @vue/reactivity v3.4.38
|
|
10
10
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
11
11
|
* @license MIT
|
|
12
|
-
**/let j;function T(e,t=void 0){t&&t.active&&t.effects.push(e)}class N{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,T(this,s)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,z();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(A(t.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),K()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=V,t=j;try{return V=!0,j=this,this._runnings++,P(this),this.fn()}finally{R(this),this._runnings--,j=t,V=e}}stop(){this.active&&(P(this),R(this),this.onStop&&this.onStop(),this.active=!1)}}function A(e){return e.value}function P(e){e._trackId++,e._depsLength=0}function R(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)M(e.deps[t],e);e.deps.length=e._depsLength}}function M(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}function C(e,t){e.effect instanceof N&&(e=e.effect.fn);const r=new N(e,n,()=>{r.dirty&&r.run()});t&&(s(r,t),t.scope&&T(r,t.scope)),t&&t.lazy||r.run();const i=r.run.bind(r);return i.effect=r,i}function I(e){e.effect.stop()}let V=!0,B=0;const W=[];function z(){W.push(V),V=!1}function K(){const e=W.pop();V=void 0===e||e}function D(){B++}function F(){for(B--;!B&&U.length;)U.shift()()}const U=[];function q(e,t,n){D();for(const s of e.keys()){let n;s._dirtyLevel<t&&(null!=n?n:n=e.get(s)===s._trackId)&&(s._shouldSchedule||(s._shouldSchedule=0===s._dirtyLevel),s._dirtyLevel=t),s._shouldSchedule&&(null!=n?n:n=e.get(s)===s._trackId)&&(s.trigger(),s._runnings&&!s.allowRecurse||2===s._dirtyLevel||(s._shouldSchedule=!1,s.scheduler&&U.push(s.scheduler)))}F()}const H=new WeakMap,J=Symbol(""),Z=Symbol("");function G(e,t,n){if(V&&j){let t=H.get(e);t||H.set(e,t=new Map);let s=t.get(n);s||t.set(n,s=((e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n})(()=>t.delete(n))),function(e,t){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&M(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}(j,s)}}function Q(e,t,n,s,r,i){const l=H.get(e);if(!l)return;let u=[];if("clear"===t)u=[...l.values()];else if("length"===n&&o(e)){const e=Number(s);l.forEach((t,n)=>{("length"===n||!f(n)&&n>=e)&&u.push(t)})}else switch(void 0!==n&&u.push(l.get(n)),t){case"add":o(e)?h(n)&&u.push(l.get("length")):(u.push(l.get(J)),c(e)&&u.push(l.get(Z)));break;case"delete":o(e)||(u.push(l.get(J)),c(e)&&u.push(l.get(Z)));break;case"set":c(e)&&u.push(l.get(J))}D();for(const o of u)o&&q(o,4);F()}const X=t("__proto__,__v_isRef,__isVue"),Y=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(f)),ee=te();function te(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){const n=ge(this);for(let t=0,r=this.length;t<r;t++)G(n,0,t+"");const s=n[t](...e);return-1===s||!1===s?n[t](...e.map(ge)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...e){z(),D();const n=ge(this)[t].apply(this,e);return F(),K(),n}}),e}function ne(e){f(e)||(e=String(e));const t=ge(this);return G(t,0,e),t.hasOwnProperty(e)}class se{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?ae:fe:r?ue:le).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const c=o(e);if(!s){if(c&&i(ee,t))return Reflect.get(ee,t,n);if("hasOwnProperty"===t)return ne}const l=Reflect.get(e,t,n);return(f(t)?Y.has(t):X(t))?l:(s||G(e,0,t),r?l:ve(l)?c&&h(t)?l:l.value:a(l)?s?function(e){return he(e,!0,ce,null,fe)}(l):de(l):l)}}class re extends se{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=me(r);if(function(e){return!(!e||!e.__v_isShallow)}(n)||me(n)||(r=ge(r),n=ge(n)),!o(e)&&ve(r)&&!ve(n))return!t&&(r.value=n,!0)}const c=o(e)&&h(t)?Number(t)<e.length:i(e,t),l=Reflect.set(e,t,n,s);return e===ge(s)&&(c?((e,t)=>!Object.is(e,t))(n,r)&&Q(e,"set",t,n):Q(e,"add",t,n)),l}deleteProperty(e,t){const n=i(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&n&&Q(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return f(t)&&Y.has(t)||G(e,0,t),n}ownKeys(e){return G(e,0,o(e)?"length":J),Reflect.ownKeys(e)}}class ie extends se{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const oe=new re,ce=new ie,le=new WeakMap,ue=new WeakMap,fe=new WeakMap,ae=new WeakMap;function pe(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>d(e).slice(8,-1))(e))}function de(e){return me(e)?e:he(e,!1,oe,null,le)}function he(e,t,n,s,r){if(!a(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=pe(e);if(0===o)return e;const c=new Proxy(e,2===o?s:n);return r.set(e,c),c}function me(e){return!(!e||!e.__v_isReadonly)}function ge(e){const t=e&&e.__v_raw;return t?ge(t):e}function ve(e){return!(!e||!0!==e.__v_isRef)}let _e=0;const ye=()=>{const e=Object.create(null);return(t="id")=>e[t]||(e[t]=`${t}-${++_e}`)},be=e=>(t,n)=>{const s="function"==typeof t?t:()=>t.split(".").reduce((e,t)=>null==e?e:e[t],e.scope);let r,i=!1;e.effect(()=>{const e=s();i&&e!==r&&(z(),n(e,r),K()),i=!0,r=e})},we=new Map,xe=new Map,Se=new Map,$e=new Map;let ke=!1;const Ee=()=>ke||"undefined"!=typeof window&&!1===window.__LITE_VUE_DEVTOOLS__,Oe={"scope:mount":new Set,"scope:unmount":new Set,"store:register":new Set,flush:new Set},Le=(e,...t)=>{Oe[e].forEach(e=>e(...t))},je=()=>{},Te=(e,t,n,s)=>Ee()?je:(we.set(e,t),n&&xe.set(e,n),s&&Se.set(e,s),Le("scope:mount",e,t),()=>{we.delete(e)&&(xe.delete(e),Se.delete(e),Le("scope:unmount",e))}),Ne={scopes:we,exps:xe,names:Se,stores:$e,getScopeByName(e){for(const[t,n]of Se)if(n===e)return we.get(t)},getScope(e){let t=1===e.nodeType?e:e.parentElement;for(;t;){const e=we.get(t);if(e)return e;t=t.parentElement}},on:(e,t)=>(Oe[e].add(t),()=>Oe[e].delete(t)),off(e,t){Oe[e].delete(t)}};"undefined"==typeof window||Ee()||(window.__LITE_VUE__=Ne);let Ae=!1;const Pe=[],Re=Promise.resolve(),Me=e=>Re.then(e),Ce=e=>{Pe.includes(e)||Pe.push(e),Ae||(Ae=!0,Me(Ie))},Ie=()=>{for(const e of Pe)e();Pe.length=0,Ae=!1,Oe.flush.size&&Le("flush")},Ve=/^(spellcheck|draggable|form|list|type)$/,Be=({el:e,get:t,effect:n,arg:s,modifiers:r})=>{let i;"class"===s&&(e._class=e.className),n(()=>{let n=t();if(s)r?.camel&&(s=v(s)),We(e,s,n,i);else{for(const t in n)We(e,t,n[t],i&&i[t]);for(const t in i)n&&t in n||We(e,t,null)}i=n})},We=(e,t,n,s)=>{if("class"===t)e.setAttribute("class",E(e._class?[e._class,n]:n)||"");else if("style"===t){n=w(n);const{style:t}=e;if(n)if(u(n))n!==s&&(t.cssText=n);else{for(const e in n)Ke(t,e,n[e]);if(s&&!u(s))for(const e in s)null==n[e]&&Ke(t,e,"")}else e.removeAttribute("style")}else e instanceof SVGElement||!(t in e)||Ve.test(t)?"true-value"===t?e._trueValue=n:"false-value"===t?e._falseValue=n:null!=n?e.setAttribute(t,n):e.removeAttribute(t):(e[t]=n,"value"===t&&(e._value=n))},ze=/\s*!important$/,Ke=(e,t,n)=>{o(n)?n.forEach(n=>Ke(e,t,n)):t.startsWith("--")?e.setProperty(t,n):ze.test(n)?e.setProperty(y(t),n.replace(ze,""),"important"):e[t]=n},De=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Fe=["ctrl","shift","alt","meta"],Ue={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Fe.some(n=>e[`${n}Key`]&&!t[n])},qe=/^(stop|prevent|self|ctrl|shift|alt|meta|left|middle|right|exact|once|capture|passive|window|document|outside|debounce(-\d+)?|throttle(-\d+)?|prop-.+|name-.+)$/,He=({el:e,get:t,exp:n,arg:s,modifiers:r})=>{if(!s)return;let i=De.test(n)?t(`(e => ${n}(e))`):t(`($event => { ${n} })`);if("mounted"===s||"vue:mounted"===s)return void Me(i);if("unmounted"===s||"vue:unmounted"===s)return()=>i();if(r){"click"===s&&(r.right&&(s="contextmenu"),r.middle&&(s="mouseup"));let t=i;for(const e in r){let n=/^debounce(?:-(\d+))?$/.exec(e);if(n){const e=t,s=n[1]?+n[1]:250;let r;t=t=>{clearTimeout(r),r=setTimeout(e,s,t)};continue}if(n=/^throttle(?:-(\d+))?$/.exec(e),n){const e=t,s=n[1]?+n[1]:250;let r=0;t=t=>{const n=Date.now();n-r>=s&&(r=n,e(t))}}}const n=Object.keys(r).filter(e=>!qe.test(e));i=s=>{if(!(r.outside&&e.contains(s.target)||"key"in s&&n.length&&!(y(s.key)in r))){for(const e in r){const t=Ue[e];if(t&&t(s,r))return;if(e.startsWith("prop-")&&"propertyName"in s&&s.propertyName!==e.slice(5))return;if(e.startsWith("name-")&&"animationName"in s&&s.animationName!==e.slice(5))return}return t(s)}}}const o=r?.window?window:r?.document||r?.outside?document:e,c=s;return o.addEventListener(c,i,r),o!==e?()=>o.removeEventListener(c,i,r):void 0},Je=({el:e,get:t,effect:n})=>{n(()=>{e.textContent=Ze(t())})},Ze=e=>null==e?"":a(e)?JSON.stringify(e,null,2):String(e),Ge=(e,t)=>{const n=e.getAttribute(t);return null!=n&&e.removeAttribute(t),n},Qe=(e,t,n,s)=>{e.addEventListener(t,n,s)},Xe=e=>"_value"in e?e._value:e.value,Ye=(e,t)=>{const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t},et=e=>{e.target.composing=!0},tt=e=>{const t=e.target;t.composing&&(t.composing=!1,nt(t,"input"))},nt=(e,t)=>{const n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)},st=Object.create(null),rt=(e,t,n)=>it(e,`return(${t})`,n),it=(e,t,n)=>{const s=st[t]||(st[t]=ot(t));try{return s(e,n,n&&(e=>(t,n)=>e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0})))(n))}catch(r){console.error(r)}},ot=e=>{try{return new Function("$data","$el","$dispatch",`with($data){${e}}`)}catch(t){return console.error(`${t.message} in expression: ${e}`),()=>{}}},ct={bind:Be,on:He,show:({el:e,get:t,effect:n})=>{const s=e.style.display;n(()=>{e.style.display=t()?s:"none"})},text:Je,html:({el:e,get:t,effect:n})=>{n(()=>{e.innerHTML=t()})},model:({el:e,exp:t,get:n,effect:s,modifiers:r})=>{const i=e.type,c=n(`(val) => { ${t} = val }`),{trim:l,number:u="number"===i,lazy:f,fill:a}=r||{};if("SELECT"===e.tagName){const t=e;Qe(e,"change",()=>{const e=Array.prototype.filter.call(t.options,e=>e.selected).map(e=>u?b(Xe(e)):Xe(e));c(t.multiple?e:e[0])}),s(()=>{const e=n(),s=t.multiple;for(let n=0,r=t.options.length;n<r;n++){const r=t.options[n],i=Xe(r);if(s)o(e)?r.selected=L(e,i)>-1:r.selected=e.has(i);else if(O(Xe(r),e))return void(t.selectedIndex!==n&&(t.selectedIndex=n))}s||-1===t.selectedIndex||(t.selectedIndex=-1)})}else if("checkbox"===i){let t;Qe(e,"change",()=>{const t=n(),s=e.checked;if(o(t)){const n=Xe(e),r=L(t,n),i=-1!==r;if(s&&!i)c(t.concat(n));else if(!s&&i){const e=[...t];e.splice(r,1),c(e)}}else c(Ye(e,s))}),s(()=>{const s=n();o(s)?e.checked=L(s,Xe(e))>-1:s!==t&&(e.checked=O(s,Ye(e,!0))),t=s})}else if("radio"===i){let t;Qe(e,"change",()=>{c(Xe(e))}),s(()=>{const s=n();s!==t&&(e.checked=O(s,Xe(e)))})}else{const t=e=>l?e.trim():u?b(e):e;let i=c;for(const e in r||{}){const t=/^debounce(?:-(\d+))?$/.exec(e);if(t){const e=t[1]?+t[1]:250;let n;i=t=>{clearTimeout(n),n=setTimeout(c,e,t)}}}if(Qe(e,"compositionstart",et),Qe(e,"compositionend",tt),Qe(e,f?"change":"input",()=>{e.composing||i(t(e.value))}),l&&Qe(e,"change",()=>{e.value=e.value.trim()}),a){const s=n();null!=s&&""!==s||!e.value||c(t(e.value))}s(()=>{if(e.composing)return;const s=e.value,r=n();document.activeElement===e&&t(s)===r||s!==r&&(e.value=r)})}},effect:({el:e,ctx:t,exp:n,effect:s})=>{Me(()=>s(()=>it(t.scope,n,e)))}},lt=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ut=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,ft=/^\(|\)$/g,at=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,pt=(e,t,n)=>{const s=t.match(lt);if(!s)return;const r=e.nextSibling,i=e.parentElement,c=new Text("");i.insertBefore(c,e),i.removeChild(e);const l=s[2].trim();let u,f,p,d,h=s[1].trim().replace(ft,"").trim(),m=!1,g="key",v=e.getAttribute(g)||e.getAttribute(g=":key")||e.getAttribute(g="v-bind:key");v&&(e.removeAttribute(g),"key"===g&&(v=JSON.stringify(v))),(d=h.match(ut))&&(h=h.replace(ut,"").trim(),f=d[1].trim(),d[2]&&(p=d[2].trim())),(d=h.match(at))&&(u=d[1].split(",").map(e=>e.trim()),m="["===h[0]);let _,y,b,w=!1;const x=(e,t,s,r)=>{const i={};u?u.forEach((e,n)=>i[e]=t[m?n:e]):i[h]=t,r?(f&&(i[f]=r),p&&(i[p]=s)):f&&(i[f]=s);const o=St(n,i),c=v?rt(o.scope,v):s;return e.set(c,s),o.key=c,o},S=(t,n)=>{const s=new kt(e,t);return s.key=t.key,s.insert(i,n),s};return n.effect(()=>{const e=rt(n.scope,l),t=b;if([y,b]=(e=>{const t=new Map,n=[];if(o(e))for(let s=0;s<e.length;s++)n.push(x(t,e[s],s));else if("number"==typeof e)for(let s=0;s<e;s++)n.push(x(t,s+1,s));else if(a(e)){let s=0;for(const r in e)n.push(x(t,e[r],s++,r))}return[n,t]})(e),w){for(let t=0;t<_.length;t++)b.has(_[t].key)||_[t].remove();const e=[];let n,s,r=y.length;for(;r--;){const o=y[r],l=t.get(o.key);let u;null==l?u=S(o,n?n.el:c):(u=_[l],Object.assign(u.ctx.scope,o.scope),l!==r&&(_[l+1]===n&&s!==n||(s=u,u.insert(i,n?n.el:c)))),e.unshift(n=u)}_=e}else _=y.map(e=>S(e,c)),w=!0}),r},dt=({el:e,ctx:{scope:{$refs:t}},get:n,effect:s})=>{let r;return s(()=>{const s=n();t[s]=e,r&&s!==r&&delete t[r],r=s}),()=>{r&&delete t[r]}},ht=/^(?:v-|:|@)/,mt=/\.([\w-]+)/g;let gt=!1;const vt=(e,t)=>{const n=e.nodeType;if(1===n){const n=e;if(n.hasAttribute("v-pre"))return;let s;if(Ge(n,"v-cloak"),s=Ge(n,"v-if"))return((e,t,n)=>{const s=e.parentElement,r=new Comment("v-if");s.insertBefore(r,e);const i=[{exp:t,el:e}];let o,c;for(;(o=e.nextElementSibling)&&(c=null,""===Ge(o,"v-else")||(c=Ge(o,"v-else-if")));)s.removeChild(o),i.push({exp:c,el:o});const l=e.nextSibling;let u;s.removeChild(e);let f=-1;const a=()=>{u&&(u.el.parentNode===s&&s.insertBefore(r,u.el),u.remove(),u=void 0)};return n.effect(()=>{for(let e=0;e<i.length;e++){const{exp:t,el:o}=i[e];if(!t||rt(n.scope,t))return void(e!==f&&(a(),u=new kt(o,n),u.insert(s,r),u.el.parentNode===s&&s.removeChild(r),f=e))}f=-1,a()}),l})(n,s,t);if(s=Ge(n,"v-for"))return pt(n,s,t);const r=Ge(n,"v-name");let i;if(s=Ge(n,"v-teleport")){const e=document.querySelector(s);e&&(i=n.nextSibling,n.__teleported=!0,e.appendChild(n),t.cleanups.push(()=>n.remove()))}if((s=Ge(n,"v-scope"))||""===s){const e=s?rt(t.scope,s):{};(t=St(t,e)).cleanups.push(Te(n,t.scope,s||void 0,r||void 0)),e.$template&&wt(n,e.$template)}const o=null!=Ge(n,"v-once");o&&(gt=!0),(s=Ge(n,"ref"))&&bt(n,dt,`"${s}"`,t),_t(n,t);const c=[];for(const{name:e,value:l}of[...n.attributes])ht.test(e)&&"v-cloak"!==e&&("v-model"===e?c.unshift([e,l]):"@"===e[0]||/^v-on\b/.test(e)?c.push([e,l]):yt(n,e,l,t));for(const[e,l]of c)yt(n,e,l,t);return o&&(gt=!1),i}if(3===n){const n=e.data;if(n.includes(t.delimiters[0])){let s,r=[],i=0;for(;s=t.delimitersRE.exec(n);){const e=n.slice(i,s.index);e&&r.push(JSON.stringify(e)),r.push(`$s(${s[1]})`),i=s.index+s[0].length}i<n.length&&r.push(JSON.stringify(n.slice(i))),bt(e,Je,r.join("+"),t)}}else 11===n&&_t(e,t)},_t=(e,t)=>{let n=e.firstChild;for(;n;)n=vt(n,t)||n.nextSibling},yt=(e,t,n,s)=>{let r,i,o;if(":"===(t=t.replace(mt,(e,t)=>((o||(o={}))[t]=!0,"")))[0])r=Be,i=t.slice(1);else if("@"===t[0])r=He,i=t.slice(1);else{const e=t.indexOf(":"),n=e>0?t.slice(2,e):t.slice(2);r=ct[n]||s.dirs[n],i=e>0?t.slice(e+1):void 0}r&&(r===Be&&"ref"===i&&(r=dt),bt(e,r,n,s,i,o),e.removeAttribute(t))},bt=(e,t,n,s,r,i)=>{const o=t({el:e,get:(t=n)=>rt(s.scope,t,e),effect:s.effect,ctx:s,exp:n,arg:r,modifiers:i});o&&s.cleanups.push(o)},wt=(e,t)=>{if("#"===t[0]){const n=document.querySelector(t);return void e.appendChild(n.content.cloneNode(!0))}e.innerHTML=t},xt=e=>{const t={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...e,scope:e?e.scope:de({}),dirs:e?e.dirs:{},effects:[],blocks:[],cleanups:[],effect:e=>{if(gt)return Ce(e),e;const n=C(e,{scheduler:()=>Ce(n)});return t.effects.push(n),n}};return t},St=(e,t={})=>{const n=e.scope,s=Object.create(n);Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)),s.$refs=Object.create(n.$refs);const r=de(new Proxy(s,{set:(e,t,s,o)=>o!==r||i(e,t)?Reflect.set(e,t,s,o):Reflect.set(n,t,s)})),o={...e,scope:r};return s.$watch=be(o),s.$id=ye(),$t(r),o},$t=e=>{for(const t of Object.keys(e))"function"==typeof e[t]&&(e[t]=e[t].bind(e))};class kt{template;ctx;key;parentCtx;isFragment;start;end;get el(){return this.start||this.template}constructor(e,t,n=!1){this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=xt(t)),vt(this.template,this.ctx)}insert(e,t=null){if(this.isFragment)if(this.start){let n,s=this.start;for(;s&&(n=s.nextSibling,e.insertBefore(s,t),s!==this.end);)s=n}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else this.template.__teleported||e.insertBefore(this.template,t)}remove(){this.parentCtx&&((e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)})(this.parentCtx.blocks,this);const e=()=>{if(this.start){const e=this.start.parentNode;let t,n=this.start;for(;n&&(t=n.nextSibling,e.removeChild(n),n!==this.end);)n=t}else this.template.parentNode.removeChild(this.template);this.teardown()},t=this.isFragment?void 0:this.template.__leave;t?t().then(e):e()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(I),this.ctx.cleanups.forEach(e=>e())}}const Et=de(Object.create(null)),Ot=e=>e.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),Lt=e=>{const t=xt();if("function"==typeof e&&(e=e()),e&&(t.scope=de(e),$t(t.scope),e.$delimiters)){const[n,s]=t.delimiters=e.$delimiters;t.delimitersRE=new RegExp(Ot(n)+"([^]+?)"+Ot(s),"g")}t.scope.$s=Ze,t.scope.$nextTick=Me,t.scope.$refs=Object.create(null),t.scope.$store=Et,t.scope.$watch=be(t),t.scope.$id=ye(),Object.defineProperty(t.scope,"$root",{value:t.scope,enumerable:!1});let n=[];const s=new Set,r={get scope(){return t.scope},directive(e,n){return n?(t.dirs[e]=n,this):t.dirs[e]},use:(e,t)=>(s.has(e)||(s.add(e),("function"==typeof e?e:e.install)(r,t)),r),mount(e){if("string"==typeof e&&!(e=document.querySelector(e)))return;let s;s=(e=e||document.documentElement).hasAttribute("v-scope")?[e]:[...e.querySelectorAll("[v-scope]")].filter(e=>!e.matches("[v-scope] [v-scope]")),s.length||(s=[e]);for(const r of s){const e=r.getAttribute("v-name"),s=new kt(r,t,!0);Ne.scopes.has(r)||t.cleanups.push(Te(r,t.scope,void 0,e||void 0)),n.push(s)}return this},unmount(){n.forEach(e=>e.teardown()),n=[]}};return r},jt=document.currentScript;jt&&jt.hasAttribute("init")&&Lt().mount(),e.createApp=Lt,e.devtools=Ne,e.disableDevtools=()=>{ke=!0,we.clear(),xe.clear(),Se.clear(),$e.clear();for(const e in Oe)Oe[e].clear();"undefined"!=typeof window&&window.__LITE_VUE__===Ne&&delete window.__LITE_VUE__},e.nextTick=Me,e.reactive=de,e.store=(e,t)=>(void 0!==t&&(Et[e]=t,"function"==typeof Et[e].init&&Et[e].init(),((e,t)=>{Ee()||($e.set(e,t),Le("store:register",e,t))})(e,Et[e])),Et[e]),e.watchEffect=e=>{let t;return t=C(e,{scheduler:()=>Ce(t)}),()=>I(t)},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
|
12
|
+
**/let T;function N(e,t=void 0){t&&t.active&&t.effects.push(e)}class A{constructor(e,t,n,s){this.fn=e,this.trigger=t,this.scheduler=n,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,N(this,s)}get dirty(){if(2===this._dirtyLevel||3===this._dirtyLevel){this._dirtyLevel=1,K();for(let e=0;e<this._depsLength;e++){const t=this.deps[e];if(t.computed&&(R(t.computed),this._dirtyLevel>=4))break}1===this._dirtyLevel&&(this._dirtyLevel=0),D()}return this._dirtyLevel>=4}set dirty(e){this._dirtyLevel=e?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let e=B,t=T;try{return B=!0,T=this,this._runnings++,P(this),this.fn()}finally{M(this),this._runnings--,T=t,B=e}}stop(){this.active&&(P(this),M(this),this.onStop&&this.onStop(),this.active=!1)}}function R(e){return e.value}function P(e){e._trackId++,e._depsLength=0}function M(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)C(e.deps[t],e);e.deps.length=e._depsLength}}function C(e,t){const n=e.get(t);void 0!==n&&t._trackId!==n&&(e.delete(t),0===e.size&&e.cleanup())}function I(e,t){e.effect instanceof A&&(e=e.effect.fn);const r=new A(e,n,()=>{r.dirty&&r.run()});t&&(s(r,t),t.scope&&N(r,t.scope)),t&&t.lazy||r.run();const i=r.run.bind(r);return i.effect=r,i}function V(e){e.effect.stop()}let B=!0,W=0;const z=[];function K(){z.push(B),B=!1}function D(){const e=z.pop();B=void 0===e||e}function F(){W++}function U(){for(W--;!W&&H.length;)H.shift()()}function q(e,t,n){if(t.get(e)!==e._trackId){t.set(e,e._trackId);const n=e.deps[e._depsLength];n!==t?(n&&C(n,e),e.deps[e._depsLength++]=t):e._depsLength++}}const H=[];function J(e,t,n){F();for(const s of e.keys()){let n;s._dirtyLevel<t&&(null!=n?n:n=e.get(s)===s._trackId)&&(s._shouldSchedule||(s._shouldSchedule=0===s._dirtyLevel),s._dirtyLevel=t),s._shouldSchedule&&(null!=n?n:n=e.get(s)===s._trackId)&&(s.trigger(),s._runnings&&!s.allowRecurse||2===s._dirtyLevel||(s._shouldSchedule=!1,s.scheduler&&H.push(s.scheduler)))}U()}const Z=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},G=new WeakMap,Q=Symbol(""),X=Symbol("");function Y(e,t,n){if(B&&T){let t=G.get(e);t||G.set(e,t=new Map);let s=t.get(n);s||t.set(n,s=Z(()=>t.delete(n))),q(T,s)}}function ee(e,t,n,s,r,i){const l=G.get(e);if(!l)return;let u=[];if("clear"===t)u=[...l.values()];else if("length"===n&&o(e)){const e=Number(s);l.forEach((t,n)=>{("length"===n||!f(n)&&n>=e)&&u.push(t)})}else switch(void 0!==n&&u.push(l.get(n)),t){case"add":o(e)?h(n)&&u.push(l.get("length")):(u.push(l.get(Q)),c(e)&&u.push(l.get(X)));break;case"delete":o(e)||(u.push(l.get(Q)),c(e)&&u.push(l.get(X)));break;case"set":c(e)&&u.push(l.get(Q))}F();for(const o of u)o&&J(o,4);U()}const te=t("__proto__,__v_isRef,__isVue"),ne=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>"arguments"!==e&&"caller"!==e).map(e=>Symbol[e]).filter(f)),se=re();function re(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...e){const n=ye(this);for(let t=0,r=this.length;t<r;t++)Y(n,0,t+"");const s=n[t](...e);return-1===s||!1===s?n[t](...e.map(ye)):s}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...e){K(),F();const n=ye(this)[t].apply(this,e);return U(),D(),n}}),e}function ie(e){f(e)||(e=String(e));const t=ye(this);return Y(t,0,e),t.hasOwnProperty(e)}class oe{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){const s=this._isReadonly,r=this._isShallow;if("__v_isReactive"===t)return!s;if("__v_isReadonly"===t)return s;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(s?r?he:de:r?pe:ae).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const c=o(e);if(!s){if(c&&i(se,t))return Reflect.get(se,t,n);if("hasOwnProperty"===t)return ie}const l=Reflect.get(e,t,n);return(f(t)?ne.has(t):te(t))?l:(s||Y(e,0,t),r?l:xe(l)?c&&h(t)?l:l.value:a(l)?s?function(e){return _e(e,!0,fe,null,de)}(l):ge(l):l)}}class ce extends oe{constructor(e=!1){super(!1,e)}set(e,t,n,s){let r=e[t];if(!this._isShallow){const t=ve(r);if(function(e){return!(!e||!e.__v_isShallow)}(n)||ve(n)||(r=ye(r),n=ye(n)),!o(e)&&xe(r)&&!xe(n))return!t&&(r.value=n,!0)}const c=o(e)&&h(t)?Number(t)<e.length:i(e,t),l=Reflect.set(e,t,n,s);return e===ye(s)&&(c?b(n,r)&&ee(e,"set",t,n):ee(e,"add",t,n)),l}deleteProperty(e,t){const n=i(e,t);e[t];const s=Reflect.deleteProperty(e,t);return s&&n&&ee(e,"delete",t,void 0),s}has(e,t){const n=Reflect.has(e,t);return f(t)&&ne.has(t)||Y(e,0,t),n}ownKeys(e){return Y(e,0,o(e)?"length":Q),Reflect.ownKeys(e)}}class le extends oe{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const ue=new ce,fe=new le,ae=new WeakMap,pe=new WeakMap,de=new WeakMap,he=new WeakMap;function me(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>d(e).slice(8,-1))(e))}function ge(e){return ve(e)?e:_e(e,!1,ue,null,ae)}function _e(e,t,n,s,r){if(!a(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const o=me(e);if(0===o)return e;const c=new Proxy(e,2===o?s:n);return r.set(e,c),c}function ve(e){return!(!e||!e.__v_isReadonly)}function ye(e){const t=e&&e.__v_raw;return t?ye(t):e}class be{constructor(e,t,n,s){this.getter=e,this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this.effect=new A(()=>e(this._value),()=>we(this,2===this.effect._dirtyLevel?2:3)),this.effect.computed=this,this.effect.active=this._cacheable=!s,this.__v_isReadonly=n}get value(){const e=ye(this);var t,n;return e._cacheable&&!e.effect.dirty||!b(e._value,e._value=e.effect.run())||we(e,4),t=e,B&&T&&(t=ye(t),q(T,null!=(n=t.dep)?n:t.dep=Z(()=>t.dep=void 0,t instanceof be?t:void 0))),e.effect._dirtyLevel>=2&&we(e,2),e._value}set value(e){this._setter(e)}get _dirty(){return this.effect.dirty}set _dirty(e){this.effect.dirty=e}}function we(e,t=4,n,s){const r=(e=ye(e)).dep;r&&J(r,t)}function xe(e){return!(!e||!0!==e.__v_isRef)}let Se=0;const $e=()=>{const e=Object.create(null);return(t="id")=>e[t]||(e[t]=`${t}-${++Se}`)},ke=e=>(t,n)=>{const s="function"==typeof t?t:()=>t.split(".").reduce((e,t)=>null==e?e:e[t],e.scope);let r,i=!1;e.effect(()=>{const e=s();i&&e!==r&&(K(),n(e,r),D()),i=!0,r=e})},Ee=new Map,Oe=new Map,Le=new Map,je=new Map;let Te=!1;const Ne=()=>Te||"undefined"!=typeof window&&!1===window.__LITE_VUE_DEVTOOLS__,Ae={"scope:mount":new Set,"scope:unmount":new Set,"store:register":new Set,flush:new Set},Re=(e,...t)=>{Ae[e].forEach(e=>e(...t))},Pe=()=>{},Me=(e,t,n,s)=>Ne()?Pe:(Ee.set(e,t),n&&Oe.set(e,n),s&&Le.set(e,s),Re("scope:mount",e,t),()=>{Ee.delete(e)&&(Oe.delete(e),Le.delete(e),Re("scope:unmount",e))}),Ce={scopes:Ee,exps:Oe,names:Le,stores:je,getScopeByName(e){for(const[t,n]of Le)if(n===e)return Ee.get(t)},getScope(e){let t=1===e.nodeType?e:e.parentElement;for(;t;){const e=Ee.get(t);if(e)return e;t=t.parentElement}},on:(e,t)=>(Ae[e].add(t),()=>Ae[e].delete(t)),off(e,t){Ae[e].delete(t)}};"undefined"==typeof window||Ne()||(window.__LITE_VUE__=Ce);let Ie=!1;const Ve=[],Be=Promise.resolve(),We=e=>Be.then(e),ze=e=>{Ve.includes(e)||Ve.push(e),Ie||(Ie=!0,We(Ke))},Ke=()=>{for(const e of Ve)e();Ve.length=0,Ie=!1,Ae.flush.size&&Re("flush")},De=/^(spellcheck|draggable|form|list|type)$/,Fe=({el:e,get:t,effect:n,arg:s,modifiers:r})=>{let i;"class"===s&&(e._class=e.className),n(()=>{let n=t();if(s)r?.camel&&(s=_(s)),Ue(e,s,n,i);else{for(const t in n)Ue(e,t,n[t],i&&i[t]);for(const t in i)n&&t in n||Ue(e,t,null)}i=n})},Ue=(e,t,n,s)=>{if("class"===t)e.setAttribute("class",O(e._class?[e._class,n]:n)||"");else if("style"===t){n=x(n);const{style:t}=e;if(n)if(u(n))n!==s&&(t.cssText=n);else{for(const e in n)He(t,e,n[e]);if(s&&!u(s))for(const e in s)null==n[e]&&He(t,e,"")}else e.removeAttribute("style")}else e instanceof SVGElement||!(t in e)||De.test(t)?"true-value"===t?e._trueValue=n:"false-value"===t?e._falseValue=n:null!=n?e.setAttribute(t,n):e.removeAttribute(t):(e[t]=n,"value"===t&&(e._value=n))},qe=/\s*!important$/,He=(e,t,n)=>{o(n)?n.forEach(n=>He(e,t,n)):t.startsWith("--")?e.setProperty(t,n):qe.test(n)?e.setProperty(y(t),n.replace(qe,""),"important"):e[t]=n},Je=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ze=["ctrl","shift","alt","meta"],Ge={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>Ze.some(n=>e[`${n}Key`]&&!t[n])},Qe=/^(stop|prevent|self|ctrl|shift|alt|meta|left|middle|right|exact|once|capture|passive|window|document|outside|debounce(-\d+)?|throttle(-\d+)?|prop-.+|name-.+)$/,Xe=({el:e,get:t,exp:n,arg:s,modifiers:r})=>{if(!s)return;let i=Je.test(n)?t(`(e => ${n}(e))`):t(`($event => { ${n} })`);if("mounted"===s||"vue:mounted"===s)return void We(i);if("unmounted"===s||"vue:unmounted"===s)return()=>i();if(r){"click"===s&&(r.right&&(s="contextmenu"),r.middle&&(s="mouseup"));let t=i;for(const e in r){let n=/^debounce(?:-(\d+))?$/.exec(e);if(n){const e=t,s=n[1]?+n[1]:250;let r;t=t=>{clearTimeout(r),r=setTimeout(e,s,t)};continue}if(n=/^throttle(?:-(\d+))?$/.exec(e),n){const e=t,s=n[1]?+n[1]:250;let r=0;t=t=>{const n=Date.now();n-r>=s&&(r=n,e(t))}}}const n=Object.keys(r).filter(e=>!Qe.test(e));i=s=>{if(!(r.outside&&e.contains(s.target)||"key"in s&&n.length&&!(y(s.key)in r))){for(const e in r){const t=Ge[e];if(t&&t(s,r))return;if(e.startsWith("prop-")&&"propertyName"in s&&s.propertyName!==e.slice(5))return;if(e.startsWith("name-")&&"animationName"in s&&s.animationName!==e.slice(5))return}return t(s)}}}const o=r?.window?window:r?.document||r?.outside?document:e,c=s;return o.addEventListener(c,i,r),o!==e?()=>o.removeEventListener(c,i,r):void 0},Ye=({el:e,get:t,effect:n})=>{n(()=>{e.textContent=et(t())})},et=e=>null==e?"":a(e)?JSON.stringify(e,null,2):String(e),tt=(e,t)=>{const n=e.getAttribute(t);return null!=n&&e.removeAttribute(t),n},nt=(e,t,n,s)=>{e.addEventListener(t,n,s)},st=e=>"_value"in e?e._value:e.value,rt=(e,t)=>{const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t},it=e=>{e.target.composing=!0},ot=e=>{const t=e.target;t.composing&&(t.composing=!1,ct(t,"input"))},ct=(e,t)=>{const n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)},lt=Object.create(null),ut=(e,t,n)=>ft(e,`return(${t})`,n),ft=(e,t,n)=>{const s=lt[t]||(lt[t]=at(t));try{return s(e,n,n&&(e=>(t,n)=>e.dispatchEvent(new CustomEvent(t,{detail:n,bubbles:!0})))(n))}catch(r){console.error(r)}},at=e=>{try{return new Function("$data","$el","$dispatch",`with($data){${e}}`)}catch(t){return console.error(`${t.message} in expression: ${e}`),()=>{}}},pt={bind:Fe,on:Xe,show:({el:e,get:t,effect:n})=>{const s=e.style.display;n(()=>{e.style.display=t()?s:"none"})},text:Ye,html:({el:e,get:t,effect:n})=>{n(()=>{e.innerHTML=t()})},model:({el:e,exp:t,get:n,effect:s,modifiers:r})=>{const i=e.type,c=n(`(val) => { ${t} = val }`),{trim:l,number:u="number"===i,lazy:f,fill:a}=r||{};if("SELECT"===e.tagName){const t=e;nt(e,"change",()=>{const e=Array.prototype.filter.call(t.options,e=>e.selected).map(e=>u?w(st(e)):st(e));c(t.multiple?e:e[0])}),s(()=>{const e=n(),s=t.multiple;for(let n=0,r=t.options.length;n<r;n++){const r=t.options[n],i=st(r);if(s)o(e)?r.selected=j(e,i)>-1:r.selected=e.has(i);else if(L(st(r),e))return void(t.selectedIndex!==n&&(t.selectedIndex=n))}s||-1===t.selectedIndex||(t.selectedIndex=-1)})}else if("checkbox"===i){let t;nt(e,"change",()=>{const t=n(),s=e.checked;if(o(t)){const n=st(e),r=j(t,n),i=-1!==r;if(s&&!i)c(t.concat(n));else if(!s&&i){const e=[...t];e.splice(r,1),c(e)}}else c(rt(e,s))}),s(()=>{const s=n();o(s)?e.checked=j(s,st(e))>-1:s!==t&&(e.checked=L(s,rt(e,!0))),t=s})}else if("radio"===i){let t;nt(e,"change",()=>{c(st(e))}),s(()=>{const s=n();s!==t&&(e.checked=L(s,st(e)))})}else{const t=e=>l?e.trim():u?w(e):e;let i=c;for(const e in r||{}){const t=/^debounce(?:-(\d+))?$/.exec(e);if(t){const e=t[1]?+t[1]:250;let n;i=t=>{clearTimeout(n),n=setTimeout(c,e,t)}}}if(nt(e,"compositionstart",it),nt(e,"compositionend",ot),nt(e,f?"change":"input",()=>{e.composing||i(t(e.value))}),l&&nt(e,"change",()=>{e.value=e.value.trim()}),a){const s=n();null!=s&&""!==s||!e.value||c(t(e.value))}s(()=>{if(e.composing)return;const s=e.value,r=n();document.activeElement===e&&t(s)===r||s!==r&&(e.value=r)})}},effect:({el:e,ctx:t,exp:n,effect:s})=>{We(()=>s(()=>ft(t.scope,n,e)))}},dt=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,ht=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,mt=/^\(|\)$/g,gt=/^[{[]\s*((?:[\w_$]+\s*,?\s*)+)[\]}]$/,_t=(e,t,n)=>{const s=t.match(dt);if(!s)return;const r=e.nextSibling,i=e.parentElement,c=new Text("");i.insertBefore(c,e),i.removeChild(e);const l=s[2].trim();let u,f,p,d,h=s[1].trim().replace(mt,"").trim(),m=!1,g="key",_=e.getAttribute(g)||e.getAttribute(g=":key")||e.getAttribute(g="v-bind:key");_&&(e.removeAttribute(g),"key"===g&&(_=JSON.stringify(_))),(d=h.match(ht))&&(h=h.replace(ht,"").trim(),f=d[1].trim(),d[2]&&(p=d[2].trim())),(d=h.match(gt))&&(u=d[1].split(",").map(e=>e.trim()),m="["===h[0]);let v,y,b,w=!1;const x=(e,t,s,r)=>{const i={};u?u.forEach((e,n)=>i[e]=t[m?n:e]):i[h]=t,r?(f&&(i[f]=r),p&&(i[p]=s)):f&&(i[f]=s);const o=Lt(n,i),c=_?ut(o.scope,_):s;return e.set(c,s),o.key=c,o},S=(t,n)=>{const s=new Tt(e,t);return s.key=t.key,s.insert(i,n),s};return n.effect(()=>{const e=ut(n.scope,l),t=b;if([y,b]=(e=>{const t=new Map,n=[];if(o(e))for(let s=0;s<e.length;s++)n.push(x(t,e[s],s));else if("number"==typeof e)for(let s=0;s<e;s++)n.push(x(t,s+1,s));else if(a(e)){let s=0;for(const r in e)n.push(x(t,e[r],s++,r))}return[n,t]})(e),w){for(let t=0;t<v.length;t++)b.has(v[t].key)||v[t].remove();const e=[];let n,s,r=y.length;for(;r--;){const o=y[r],l=t.get(o.key);let u;null==l?u=S(o,n?n.el:c):(u=v[l],Object.assign(u.ctx.scope,o.scope),l!==r&&(v[l+1]===n&&s!==n||(s=u,u.insert(i,n?n.el:c)))),e.unshift(n=u)}v=e}else v=y.map(e=>S(e,c)),w=!0}),r},vt=({el:e,ctx:{scope:{$refs:t}},get:n,effect:s})=>{let r;return s(()=>{const s=n();t[s]=e,r&&s!==r&&delete t[r],r=s}),()=>{r&&delete t[r]}},yt=/^(?:v-|:|@)/,bt=/\.([\w-]+)/g;let wt=!1;const xt=(e,t)=>{const n=e.nodeType;if(1===n){const n=e;if(n.hasAttribute("v-pre"))return;let s;if(tt(n,"v-cloak"),s=tt(n,"v-if"))return((e,t,n)=>{const s=e.parentElement,r=new Comment("v-if");s.insertBefore(r,e);const i=[{exp:t,el:e}];let o,c;for(;(o=e.nextElementSibling)&&(c=null,""===tt(o,"v-else")||(c=tt(o,"v-else-if")));)s.removeChild(o),i.push({exp:c,el:o});const l=e.nextSibling;let u;s.removeChild(e);let f=-1;const a=()=>{u&&(u.el.parentNode===s&&s.insertBefore(r,u.el),u.remove(),u=void 0)};return n.effect(()=>{for(let e=0;e<i.length;e++){const{exp:t,el:o}=i[e];if(!t||ut(n.scope,t))return void(e!==f&&(a(),u=new Tt(o,n),u.insert(s,r),u.el.parentNode===s&&s.removeChild(r),f=e))}f=-1,a()}),l})(n,s,t);if(s=tt(n,"v-for"))return _t(n,s,t);const r=tt(n,"v-name");let i;if(s=tt(n,"v-teleport")){const e=document.querySelector(s);e&&(i=n.nextSibling,n.__teleported=!0,e.appendChild(n),t.cleanups.push(()=>n.remove()))}if((s=tt(n,"v-scope"))||""===s){const e=s?ut(t.scope,s):{};t=Lt(t,e),n.__ctx=t,t.cleanups.push(Me(n,t.scope,s||void 0,r||void 0)),e.$template&&Et(n,e.$template)}const o=null!=tt(n,"v-once");o&&(wt=!0),(s=tt(n,"ref"))&&kt(n,vt,`"${s}"`,t),St(n,t);const c=[];for(const{name:e,value:l}of[...n.attributes])yt.test(e)&&"v-cloak"!==e&&("v-model"===e?c.unshift([e,l]):"@"===e[0]||/^v-on\b/.test(e)?c.push([e,l]):$t(n,e,l,t));for(const[e,l]of c)$t(n,e,l,t);return o&&(wt=!1),i}if(3===n){const n=e.data;if(n.includes(t.delimiters[0])){let s,r=[],i=0;for(;s=t.delimitersRE.exec(n);){const e=n.slice(i,s.index);e&&r.push(JSON.stringify(e)),r.push(`$s(${s[1]})`),i=s.index+s[0].length}i<n.length&&r.push(JSON.stringify(n.slice(i))),kt(e,Ye,r.join("+"),t)}}else 11===n&&St(e,t)},St=(e,t)=>{let n=e.firstChild;for(;n;)n=xt(n,t)||n.nextSibling},$t=(e,t,n,s)=>{let r,i,o;if(":"===(t=t.replace(bt,(e,t)=>((o||(o={}))[t]=!0,"")))[0])r=Fe,i=t.slice(1);else if("@"===t[0])r=Xe,i=t.slice(1);else{const e=t.indexOf(":"),n=e>0?t.slice(2,e):t.slice(2);r=pt[n]||s.dirs[n],i=e>0?t.slice(e+1):void 0}r&&(r===Fe&&"ref"===i&&(r=vt),kt(e,r,n,s,i,o),e.removeAttribute(t))},kt=(e,t,n,s,r,i)=>{const o=t({el:e,get:(t=n)=>ut(s.scope,t,e),effect:s.effect,ctx:s,exp:n,arg:r,modifiers:i});o&&s.cleanups.push(o)},Et=(e,t)=>{if("#"===t[0]){const n=document.querySelector(t);return void e.appendChild(n.content.cloneNode(!0))}e.innerHTML=t},Ot=e=>{const t={delimiters:["{{","}}"],delimitersRE:/\{\{([^]+?)\}\}/g,...e,scope:e?e.scope:ge({}),dirs:e?e.dirs:{},effects:[],blocks:[],cleanups:[],effect:e=>{if(wt)return ze(e),e;const n=I(e,{scheduler:()=>ze(n)});return t.effects.push(n),n}};return t},Lt=(e,t={})=>{const n=e.scope,s=Object.create(n);Object.defineProperties(s,Object.getOwnPropertyDescriptors(t)),s.$refs=Object.create(n.$refs);const r=ge(new Proxy(s,{set:(e,t,s,o)=>o!==r||i(e,t)?Reflect.set(e,t,s,o):Reflect.set(n,t,s)})),o={...e,scope:r};return s.$watch=ke(o),s.$id=$e(),jt(r),o},jt=e=>{for(const t of Object.keys(e))"function"==typeof e[t]&&(e[t]=e[t].bind(e))};class Tt{template;ctx;key;parentCtx;isFragment;start;end;get el(){return this.start||this.template}constructor(e,t,n=!1){this.isFragment=e instanceof HTMLTemplateElement,n?this.template=e:this.isFragment?this.template=e.content.cloneNode(!0):this.template=e.cloneNode(!0),n?this.ctx=t:(this.parentCtx=t,t.blocks.push(this),this.ctx=Ot(t)),xt(this.template,this.ctx)}insert(e,t=null){if(this.isFragment)if(this.start){let n,s=this.start;for(;s&&(n=s.nextSibling,e.insertBefore(s,t),s!==this.end);)s=n}else this.start=new Text(""),this.end=new Text(""),e.insertBefore(this.end,t),e.insertBefore(this.start,this.end),e.insertBefore(this.template,this.end);else this.template.__teleported||e.insertBefore(this.template,t)}remove(){this.parentCtx&&((e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)})(this.parentCtx.blocks,this);const e=()=>{if(this.start){const e=this.start.parentNode;let t,n=this.start;for(;n&&(t=n.nextSibling,e.removeChild(n),n!==this.end);)n=t}else this.template.parentNode.removeChild(this.template);this.teardown()},t=this.isFragment?void 0:this.template.__leave;t?t().then(e):e()}teardown(){this.ctx.blocks.forEach(e=>{e.teardown()}),this.ctx.effects.forEach(V),this.ctx.cleanups.forEach(e=>e())}}const Nt=ge(Object.create(null)),At=e=>e.replace(/[-.*+?^${}()|[\]\/\\]/g,"\\$&"),Rt=e=>{const t=Ot();if("function"==typeof e&&(e=e()),e&&(t.scope=ge(e),jt(t.scope),e.$delimiters)){const[n,s]=t.delimiters=e.$delimiters;t.delimitersRE=new RegExp(At(n)+"([^]+?)"+At(s),"g")}t.scope.$s=et,t.scope.$nextTick=We,t.scope.$refs=Object.create(null),t.scope.$store=Nt,t.scope.$watch=ke(t),t.scope.$id=$e(),Object.defineProperty(t.scope,"$root",{value:t.scope,enumerable:!1});let n=[];const s=new Set,r={get scope(){return t.scope},directive(e,n){return n?(t.dirs[e]=n,this):t.dirs[e]},use:(e,t)=>(s.has(e)||(s.add(e),("function"==typeof e?e:e.install)(r,t)),r),mount(e){if("string"==typeof e&&!(e=document.querySelector(e)))return;let s;s=(e=e||document.documentElement).hasAttribute("v-scope")?[e]:[...e.querySelectorAll("[v-scope]")].filter(e=>!e.matches("[v-scope] [v-scope]")),s.length||(s=[e]),t.walk??=xt;for(const r of s){const e=r.getAttribute("v-name");r.__ctx??=t;const s=new Tt(r,t,!0);Ce.scopes.has(r)||t.cleanups.push(Me(r,t.scope,void 0,e||void 0)),n.push(s)}return this},unmount(){n.forEach(e=>e.teardown()),n=[]}};return r},Pt=document.currentScript;Pt&&Pt.hasAttribute("init")&&Rt().mount(),e.computed=function(e,t,s=!1){let r,i;const o="function"==typeof e;return o?(r=e,i=n):(r=e.get,i=e.set),new be(r,i,o||!i,s)},e.createApp=Rt,e.devtools=Ce,e.disableDevtools=()=>{Te=!0,Ee.clear(),Oe.clear(),Le.clear(),je.clear();for(const e in Ae)Ae[e].clear();"undefined"!=typeof window&&window.__LITE_VUE__===Ce&&delete window.__LITE_VUE__},e.nextTick=We,e.reactive=ge,e.store=(e,t)=>(void 0!==t&&(Nt[e]=t,"function"==typeof Nt[e].init&&Nt[e].init(),((e,t)=>{Ne()||(je.set(e,t),Re("store:register",e,t))})(e,Nt[e])),Nt[e]),e.watchEffect=e=>{let t;return t=I(e,{scheduler:()=>ze(t)}),()=>V(t)},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/dist/types/context.d.mts
CHANGED
|
@@ -11,6 +11,13 @@ export interface Context {
|
|
|
11
11
|
cleanups: (() => void)[];
|
|
12
12
|
delimiters: [string, string];
|
|
13
13
|
delimitersRE: RegExp;
|
|
14
|
+
/**
|
|
15
|
+
* The framework walker, published on the root context by `mount()` and
|
|
16
|
+
* inherited by every child context through the spreads below. Plugins that
|
|
17
|
+
* insert markup into a live tree (morph) need it to bind that markup, and
|
|
18
|
+
* reading it here keeps them from importing — and re-bundling — the core.
|
|
19
|
+
*/
|
|
20
|
+
walk?: (node: Node, ctx: Context) => ChildNode | null | void;
|
|
14
21
|
}
|
|
15
22
|
export declare const createContext: (parent?: Context) => Context;
|
|
16
23
|
export declare const createScopedContext: (ctx: Context, data?: {}) => Context;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export interface Context {
|
|
|
11
11
|
cleanups: (() => void)[];
|
|
12
12
|
delimiters: [string, string];
|
|
13
13
|
delimitersRE: RegExp;
|
|
14
|
+
/**
|
|
15
|
+
* The framework walker, published on the root context by `mount()` and
|
|
16
|
+
* inherited by every child context through the spreads below. Plugins that
|
|
17
|
+
* insert markup into a live tree (morph) need it to bind that markup, and
|
|
18
|
+
* reading it here keeps them from importing — and re-bundling — the core.
|
|
19
|
+
*/
|
|
20
|
+
walk?: (node: Node, ctx: Context) => ChildNode | null | void;
|
|
14
21
|
}
|
|
15
22
|
export declare const createContext: (parent?: Context) => Context;
|
|
16
23
|
export declare const createScopedContext: (ctx: Context, data?: {}) => Context;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -3,6 +3,7 @@ export type { App, Plugin } from './app.mjs';
|
|
|
3
3
|
export { store } from './store.mjs';
|
|
4
4
|
export { nextTick } from './scheduler.mjs';
|
|
5
5
|
export { watchEffect } from './effect.mjs';
|
|
6
|
-
export { reactive } from '@vue/reactivity';
|
|
6
|
+
export { computed, reactive } from '@vue/reactivity';
|
|
7
|
+
export type { ComputedRef, WritableComputedRef } from '@vue/reactivity';
|
|
7
8
|
export { devtools, disableDevtools } from './devtools.mjs';
|
|
8
9
|
export type { LiteVueDevtools, DevtoolsEvent } from './devtools.mjs';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type { App, Plugin } from './app';
|
|
|
3
3
|
export { store } from './store';
|
|
4
4
|
export { nextTick } from './scheduler';
|
|
5
5
|
export { watchEffect } from './effect';
|
|
6
|
-
export { reactive } from '@vue/reactivity';
|
|
6
|
+
export { computed, reactive } from '@vue/reactivity';
|
|
7
|
+
export type { ComputedRef, WritableComputedRef } from '@vue/reactivity';
|
|
7
8
|
export { devtools, disableDevtools } from './devtools';
|
|
8
9
|
export type { LiteVueDevtools, DevtoolsEvent } from './devtools';
|
|
@@ -5,3 +5,5 @@ export { persist, persistStore, registerStorage, setDefaultStorage, } from './pe
|
|
|
5
5
|
export type { PersistStorage } from './persist.mjs';
|
|
6
6
|
export { focus } from './focus.mjs';
|
|
7
7
|
export { collapse } from './collapse.mjs';
|
|
8
|
+
export { morph, morphPlugin } from './morph.mjs';
|
|
9
|
+
export type { MorphOptions } from './morph.mjs';
|
|
@@ -5,3 +5,5 @@ export { persist, persistStore, registerStorage, setDefaultStorage, } from './pe
|
|
|
5
5
|
export type { PersistStorage } from './persist';
|
|
6
6
|
export { focus } from './focus';
|
|
7
7
|
export { collapse } from './collapse';
|
|
8
|
+
export { morph, morphPlugin } from './morph';
|
|
9
|
+
export type { MorphOptions } from './morph';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Plugin } from '../app.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Update a live region in place from new HTML, instead of replacing it.
|
|
4
|
+
*
|
|
5
|
+
* Replacing markup (`el.innerHTML = html`, then re-mounting) destroys every
|
|
6
|
+
* element in the region, which means every scope, its state, and the browser
|
|
7
|
+
* state riding on those nodes — focus, cursor position, text selection, scroll
|
|
8
|
+
* offsets, media playback, `<details open>`. LiteVue also has no per-region
|
|
9
|
+
* teardown, so the discarded subtree's effects stay subscribed and keep writing
|
|
10
|
+
* to detached nodes.
|
|
11
|
+
*
|
|
12
|
+
* Morphing patches the differences onto the existing tree, so unchanged
|
|
13
|
+
* elements are never touched and none of that is lost.
|
|
14
|
+
*/
|
|
15
|
+
export interface MorphOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Identity used to match children across the update. Defaults to `id`.
|
|
18
|
+
* Elements that match keep their DOM node (and therefore their scope);
|
|
19
|
+
* unkeyed children fall back to matching by position.
|
|
20
|
+
*/
|
|
21
|
+
key?: (el: Element) => string | null | undefined;
|
|
22
|
+
/** Return true to leave a subtree completely untouched. */
|
|
23
|
+
skip?: (from: Element, to: Element) => boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* morph(from, to) — patch `from` in place so it matches `to`, which may be an
|
|
27
|
+
* element or an HTML string for the *outer* element.
|
|
28
|
+
*/
|
|
29
|
+
export declare const morph: (from: Element, to: Element | string, opts?: MorphOptions) => Element;
|
|
30
|
+
/**
|
|
31
|
+
* Registers `$morph` so templates can update a region from a fetch response
|
|
32
|
+
* without dropping into JavaScript.
|
|
33
|
+
*/
|
|
34
|
+
export declare const morphPlugin: Plugin;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Plugin } from '../app';
|
|
2
|
+
/**
|
|
3
|
+
* Update a live region in place from new HTML, instead of replacing it.
|
|
4
|
+
*
|
|
5
|
+
* Replacing markup (`el.innerHTML = html`, then re-mounting) destroys every
|
|
6
|
+
* element in the region, which means every scope, its state, and the browser
|
|
7
|
+
* state riding on those nodes — focus, cursor position, text selection, scroll
|
|
8
|
+
* offsets, media playback, `<details open>`. LiteVue also has no per-region
|
|
9
|
+
* teardown, so the discarded subtree's effects stay subscribed and keep writing
|
|
10
|
+
* to detached nodes.
|
|
11
|
+
*
|
|
12
|
+
* Morphing patches the differences onto the existing tree, so unchanged
|
|
13
|
+
* elements are never touched and none of that is lost.
|
|
14
|
+
*/
|
|
15
|
+
export interface MorphOptions {
|
|
16
|
+
/**
|
|
17
|
+
* Identity used to match children across the update. Defaults to `id`.
|
|
18
|
+
* Elements that match keep their DOM node (and therefore their scope);
|
|
19
|
+
* unkeyed children fall back to matching by position.
|
|
20
|
+
*/
|
|
21
|
+
key?: (el: Element) => string | null | undefined;
|
|
22
|
+
/** Return true to leave a subtree completely untouched. */
|
|
23
|
+
skip?: (from: Element, to: Element) => boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* morph(from, to) — patch `from` in place so it matches `to`, which may be an
|
|
27
|
+
* element or an HTML string for the *outer* element.
|
|
28
|
+
*/
|
|
29
|
+
export declare const morph: (from: Element, to: Element | string, opts?: MorphOptions) => Element;
|
|
30
|
+
/**
|
|
31
|
+
* Registers `$morph` so templates can update a region from a fetch response
|
|
32
|
+
* without dropping into JavaScript.
|
|
33
|
+
*/
|
|
34
|
+
export declare const morphPlugin: Plugin;
|