@aevantec/litevue 0.5.0
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/LICENSE +22 -0
- package/README.md +73 -0
- package/dist/litevue-devtools.iife.js +1 -0
- package/dist/litevue-devtools.mjs +841 -0
- package/dist/litevue-devtools.umd.js +1 -0
- package/dist/litevue-plugins.iife.js +14 -0
- package/dist/litevue-plugins.mjs +1282 -0
- package/dist/litevue-plugins.umd.js +14 -0
- package/dist/litevue.iife.js +12 -0
- package/dist/litevue.mjs +1781 -0
- package/dist/litevue.umd.js +12 -0
- package/dist/types/app.d.mts +21 -0
- package/dist/types/app.d.ts +21 -0
- package/dist/types/block.d.mts +15 -0
- package/dist/types/block.d.ts +15 -0
- package/dist/types/context.d.mts +17 -0
- package/dist/types/context.d.ts +17 -0
- package/dist/types/devtools-panel.d.mts +1 -0
- package/dist/types/devtools-panel.d.ts +1 -0
- package/dist/types/devtools.d.mts +62 -0
- package/dist/types/devtools.d.ts +62 -0
- package/dist/types/directives/bind.d.mts +4 -0
- package/dist/types/directives/bind.d.ts +4 -0
- package/dist/types/directives/effect.d.mts +2 -0
- package/dist/types/directives/effect.d.ts +2 -0
- package/dist/types/directives/for.d.mts +2 -0
- package/dist/types/directives/for.d.ts +2 -0
- package/dist/types/directives/html.d.mts +2 -0
- package/dist/types/directives/html.d.ts +2 -0
- package/dist/types/directives/if.d.mts +2 -0
- package/dist/types/directives/if.d.ts +2 -0
- package/dist/types/directives/index.d.mts +15 -0
- package/dist/types/directives/index.d.ts +15 -0
- package/dist/types/directives/model.d.mts +2 -0
- package/dist/types/directives/model.d.ts +2 -0
- package/dist/types/directives/on.d.mts +2 -0
- package/dist/types/directives/on.d.ts +2 -0
- package/dist/types/directives/ref.d.mts +2 -0
- package/dist/types/directives/ref.d.ts +2 -0
- package/dist/types/directives/show.d.mts +2 -0
- package/dist/types/directives/show.d.ts +2 -0
- package/dist/types/directives/text.d.mts +3 -0
- package/dist/types/directives/text.d.ts +3 -0
- package/dist/types/effect.d.mts +15 -0
- package/dist/types/effect.d.ts +15 -0
- package/dist/types/eval.d.mts +2 -0
- package/dist/types/eval.d.ts +2 -0
- package/dist/types/index.d.mts +8 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/magics.d.mts +13 -0
- package/dist/types/magics.d.ts +13 -0
- package/dist/types/plugins/collapse.d.mts +10 -0
- package/dist/types/plugins/collapse.d.ts +10 -0
- package/dist/types/plugins/focus.d.mts +15 -0
- package/dist/types/plugins/focus.d.ts +15 -0
- package/dist/types/plugins/index.d.mts +7 -0
- package/dist/types/plugins/index.d.ts +7 -0
- package/dist/types/plugins/intersect.d.mts +11 -0
- package/dist/types/plugins/intersect.d.ts +11 -0
- package/dist/types/plugins/mask.d.mts +8 -0
- package/dist/types/plugins/mask.d.ts +8 -0
- package/dist/types/plugins/persist.d.mts +59 -0
- package/dist/types/plugins/persist.d.ts +59 -0
- package/dist/types/plugins/transition.d.mts +17 -0
- package/dist/types/plugins/transition.d.ts +17 -0
- package/dist/types/scheduler.d.mts +2 -0
- package/dist/types/scheduler.d.ts +2 -0
- package/dist/types/store.d.mts +10 -0
- package/dist/types/store.d.ts +10 -0
- package/dist/types/utils.d.mts +2 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/walk.d.mts +3 -0
- package/dist/types/walk.d.ts +3 -0
- package/package.json +124 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).LiteVue={})}(this,function(e){"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @vue/shared v3.4.38
|
|
4
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
+
* @license MIT
|
|
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,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 w(e){if(o(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],r=u(s)?k(s):w(s);if(r)for(const e in r)t[e]=r[e]}return t}if(u(e)||a(e))return e}const x=/;(?![^(]*\))/g,S=/:([^]+)/,$=/\/\*[^]*?\*\//g;function k(e){const t={};return e.replace($,"").split(x).forEach(e=>{if(e){const n=e.split(S);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function E(e){let t="";if(u(e))t=e;else if(o(e))for(let n=0;n<e.length;n++){const s=E(e[n]);s&&(t+=s+" ")}else if(a(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}function O(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=O(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||!O(e[n],t[n]))return!1}}return String(e)===String(t)}function L(e,t){return e.findIndex(e=>O(e,t))}
|
|
8
|
+
/**
|
|
9
|
+
* @vue/reactivity v3.4.38
|
|
10
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
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"})});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Directive } from './directives/index.mjs';
|
|
2
|
+
export interface App {
|
|
3
|
+
/**
|
|
4
|
+
* The reactive root scope. Plugins may attach helpers here (conventionally
|
|
5
|
+
* $-prefixed) to make them available to all expressions.
|
|
6
|
+
*/
|
|
7
|
+
scope: Record<string, any>;
|
|
8
|
+
directive(name: string, def?: Directive): any;
|
|
9
|
+
/**
|
|
10
|
+
* Install a plugin. A plugin is a function (or object with an install
|
|
11
|
+
* method) that receives the app and optional options. Installing the same
|
|
12
|
+
* plugin twice is a no-op.
|
|
13
|
+
*/
|
|
14
|
+
use<Options>(plugin: Plugin<Options>, options?: Options): App;
|
|
15
|
+
mount(el?: string | Element | null): App | void;
|
|
16
|
+
unmount(): void;
|
|
17
|
+
}
|
|
18
|
+
export type Plugin<Options = any> = ((app: App, options?: Options) => void) | {
|
|
19
|
+
install(app: App, options?: Options): void;
|
|
20
|
+
};
|
|
21
|
+
export declare const createApp: (initialData?: any) => App;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Directive } from './directives';
|
|
2
|
+
export interface App {
|
|
3
|
+
/**
|
|
4
|
+
* The reactive root scope. Plugins may attach helpers here (conventionally
|
|
5
|
+
* $-prefixed) to make them available to all expressions.
|
|
6
|
+
*/
|
|
7
|
+
scope: Record<string, any>;
|
|
8
|
+
directive(name: string, def?: Directive): any;
|
|
9
|
+
/**
|
|
10
|
+
* Install a plugin. A plugin is a function (or object with an install
|
|
11
|
+
* method) that receives the app and optional options. Installing the same
|
|
12
|
+
* plugin twice is a no-op.
|
|
13
|
+
*/
|
|
14
|
+
use<Options>(plugin: Plugin<Options>, options?: Options): App;
|
|
15
|
+
mount(el?: string | Element | null): App | void;
|
|
16
|
+
unmount(): void;
|
|
17
|
+
}
|
|
18
|
+
export type Plugin<Options = any> = ((app: App, options?: Options) => void) | {
|
|
19
|
+
install(app: App, options?: Options): void;
|
|
20
|
+
};
|
|
21
|
+
export declare const createApp: (initialData?: any) => App;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Context } from './context.mjs';
|
|
2
|
+
export declare class Block {
|
|
3
|
+
template: Element | DocumentFragment;
|
|
4
|
+
ctx: Context;
|
|
5
|
+
key?: any;
|
|
6
|
+
parentCtx?: Context;
|
|
7
|
+
isFragment: boolean;
|
|
8
|
+
start?: Text;
|
|
9
|
+
end?: Text;
|
|
10
|
+
get el(): Element | Text;
|
|
11
|
+
constructor(template: Element, parentCtx: Context, isRoot?: boolean);
|
|
12
|
+
insert(parent: Element, anchor?: Node | null): void;
|
|
13
|
+
remove(): void;
|
|
14
|
+
teardown(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Context } from './context';
|
|
2
|
+
export declare class Block {
|
|
3
|
+
template: Element | DocumentFragment;
|
|
4
|
+
ctx: Context;
|
|
5
|
+
key?: any;
|
|
6
|
+
parentCtx?: Context;
|
|
7
|
+
isFragment: boolean;
|
|
8
|
+
start?: Text;
|
|
9
|
+
end?: Text;
|
|
10
|
+
get el(): Element | Text;
|
|
11
|
+
constructor(template: Element, parentCtx: Context, isRoot?: boolean);
|
|
12
|
+
insert(parent: Element, anchor?: Node | null): void;
|
|
13
|
+
remove(): void;
|
|
14
|
+
teardown(): void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { effect as rawEffect, ReactiveEffectRunner } from '@vue/reactivity';
|
|
2
|
+
import { Block } from './block.mjs';
|
|
3
|
+
import { Directive } from './directives/index.mjs';
|
|
4
|
+
export interface Context {
|
|
5
|
+
key?: any;
|
|
6
|
+
scope: Record<string, any>;
|
|
7
|
+
dirs: Record<string, Directive>;
|
|
8
|
+
blocks: Block[];
|
|
9
|
+
effect: typeof rawEffect;
|
|
10
|
+
effects: ReactiveEffectRunner[];
|
|
11
|
+
cleanups: (() => void)[];
|
|
12
|
+
delimiters: [string, string];
|
|
13
|
+
delimitersRE: RegExp;
|
|
14
|
+
}
|
|
15
|
+
export declare const createContext: (parent?: Context) => Context;
|
|
16
|
+
export declare const createScopedContext: (ctx: Context, data?: {}) => Context;
|
|
17
|
+
export declare const bindContextMethods: (scope: Record<string, any>) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { effect as rawEffect, ReactiveEffectRunner } from '@vue/reactivity';
|
|
2
|
+
import { Block } from './block';
|
|
3
|
+
import { Directive } from './directives';
|
|
4
|
+
export interface Context {
|
|
5
|
+
key?: any;
|
|
6
|
+
scope: Record<string, any>;
|
|
7
|
+
dirs: Record<string, Directive>;
|
|
8
|
+
blocks: Block[];
|
|
9
|
+
effect: typeof rawEffect;
|
|
10
|
+
effects: ReactiveEffectRunner[];
|
|
11
|
+
cleanups: (() => void)[];
|
|
12
|
+
delimiters: [string, string];
|
|
13
|
+
delimitersRE: RegExp;
|
|
14
|
+
}
|
|
15
|
+
export declare const createContext: (parent?: Context) => Context;
|
|
16
|
+
export declare const createScopedContext: (ctx: Context, data?: {}) => Context;
|
|
17
|
+
export declare const bindContextMethods: (scope: Record<string, any>) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const init: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const init: () => void;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type DevtoolsEvent = 'scope:mount' | 'scope:unmount' | 'store:register' | 'flush';
|
|
2
|
+
type Listener = (...args: any[]) => void;
|
|
3
|
+
export interface LiteVueDevtools {
|
|
4
|
+
/**
|
|
5
|
+
* Live map of scope root elements (app roots and v-scope elements) to
|
|
6
|
+
* their reactive scope objects. Writing to a scope updates the page.
|
|
7
|
+
*/
|
|
8
|
+
scopes: Map<Element, Record<string, any>>;
|
|
9
|
+
/**
|
|
10
|
+
* Raw v-scope expressions for registered scope roots, for labeling in
|
|
11
|
+
* inspection UIs. App roots without v-scope have no entry.
|
|
12
|
+
*/
|
|
13
|
+
exps: Map<Element, string>;
|
|
14
|
+
/**
|
|
15
|
+
* User-given scope names from the v-name attribute, for elements that
|
|
16
|
+
* shouldn't rely on an id. The attribute is removed from the DOM at mount.
|
|
17
|
+
*/
|
|
18
|
+
names: Map<Element, string>;
|
|
19
|
+
/**
|
|
20
|
+
* Global stores registered via store(), keyed by name. Store objects are
|
|
21
|
+
* reactive — writing to one updates every app using it.
|
|
22
|
+
*/
|
|
23
|
+
stores: Map<string, Record<string, any>>;
|
|
24
|
+
/**
|
|
25
|
+
* Find the scope governing a node by walking up the DOM to the nearest
|
|
26
|
+
* registered scope root. Usable from the console: __LITE_VUE__.getScope($0)
|
|
27
|
+
*/
|
|
28
|
+
getScope(node: Node): Record<string, any> | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Find a scope by its v-name. Returns the first match in registration
|
|
31
|
+
* order: __LITE_VUE__.getScopeByName('cart')
|
|
32
|
+
*/
|
|
33
|
+
getScopeByName(name: string): Record<string, any> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Subscribe to registry events. Returns an unsubscribe function.
|
|
36
|
+
* - 'scope:mount' (el, scope): a scope was registered. May fire again for
|
|
37
|
+
* the same element (upsert semantics).
|
|
38
|
+
* - 'scope:unmount' (el): a scope root was torn down.
|
|
39
|
+
* - 'store:register' (name, store): a global store was registered.
|
|
40
|
+
* - 'flush': the reactive job queue flushed; state may have changed.
|
|
41
|
+
*/
|
|
42
|
+
on(event: DevtoolsEvent, fn: Listener): () => void;
|
|
43
|
+
off(event: DevtoolsEvent, fn: Listener): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const registerScope: (el: Element, scope: Record<string, any>, exp?: string, name?: string) => (() => void);
|
|
46
|
+
export declare const registerStore: (name: string, store: Record<string, any>) => void;
|
|
47
|
+
export declare const emitFlush: () => void;
|
|
48
|
+
export declare const devtools: LiteVueDevtools;
|
|
49
|
+
/**
|
|
50
|
+
* Turn devtools off for production: stops scope registration, clears
|
|
51
|
+
* everything already registered, and removes window.__LITE_VUE__. For
|
|
52
|
+
* script-tag users, setting window.__LITE_VUE_DEVTOOLS__ = false before the
|
|
53
|
+
* library loads has the same effect.
|
|
54
|
+
*/
|
|
55
|
+
export declare const disableDevtools: () => void;
|
|
56
|
+
declare global {
|
|
57
|
+
interface Window {
|
|
58
|
+
__LITE_VUE__?: LiteVueDevtools;
|
|
59
|
+
__LITE_VUE_DEVTOOLS__?: boolean;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
export type DevtoolsEvent = 'scope:mount' | 'scope:unmount' | 'store:register' | 'flush';
|
|
2
|
+
type Listener = (...args: any[]) => void;
|
|
3
|
+
export interface LiteVueDevtools {
|
|
4
|
+
/**
|
|
5
|
+
* Live map of scope root elements (app roots and v-scope elements) to
|
|
6
|
+
* their reactive scope objects. Writing to a scope updates the page.
|
|
7
|
+
*/
|
|
8
|
+
scopes: Map<Element, Record<string, any>>;
|
|
9
|
+
/**
|
|
10
|
+
* Raw v-scope expressions for registered scope roots, for labeling in
|
|
11
|
+
* inspection UIs. App roots without v-scope have no entry.
|
|
12
|
+
*/
|
|
13
|
+
exps: Map<Element, string>;
|
|
14
|
+
/**
|
|
15
|
+
* User-given scope names from the v-name attribute, for elements that
|
|
16
|
+
* shouldn't rely on an id. The attribute is removed from the DOM at mount.
|
|
17
|
+
*/
|
|
18
|
+
names: Map<Element, string>;
|
|
19
|
+
/**
|
|
20
|
+
* Global stores registered via store(), keyed by name. Store objects are
|
|
21
|
+
* reactive — writing to one updates every app using it.
|
|
22
|
+
*/
|
|
23
|
+
stores: Map<string, Record<string, any>>;
|
|
24
|
+
/**
|
|
25
|
+
* Find the scope governing a node by walking up the DOM to the nearest
|
|
26
|
+
* registered scope root. Usable from the console: __LITE_VUE__.getScope($0)
|
|
27
|
+
*/
|
|
28
|
+
getScope(node: Node): Record<string, any> | undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Find a scope by its v-name. Returns the first match in registration
|
|
31
|
+
* order: __LITE_VUE__.getScopeByName('cart')
|
|
32
|
+
*/
|
|
33
|
+
getScopeByName(name: string): Record<string, any> | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Subscribe to registry events. Returns an unsubscribe function.
|
|
36
|
+
* - 'scope:mount' (el, scope): a scope was registered. May fire again for
|
|
37
|
+
* the same element (upsert semantics).
|
|
38
|
+
* - 'scope:unmount' (el): a scope root was torn down.
|
|
39
|
+
* - 'store:register' (name, store): a global store was registered.
|
|
40
|
+
* - 'flush': the reactive job queue flushed; state may have changed.
|
|
41
|
+
*/
|
|
42
|
+
on(event: DevtoolsEvent, fn: Listener): () => void;
|
|
43
|
+
off(event: DevtoolsEvent, fn: Listener): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const registerScope: (el: Element, scope: Record<string, any>, exp?: string, name?: string) => (() => void);
|
|
46
|
+
export declare const registerStore: (name: string, store: Record<string, any>) => void;
|
|
47
|
+
export declare const emitFlush: () => void;
|
|
48
|
+
export declare const devtools: LiteVueDevtools;
|
|
49
|
+
/**
|
|
50
|
+
* Turn devtools off for production: stops scope registration, clears
|
|
51
|
+
* everything already registered, and removes window.__LITE_VUE__. For
|
|
52
|
+
* script-tag users, setting window.__LITE_VUE_DEVTOOLS__ = false before the
|
|
53
|
+
* library loads has the same effect.
|
|
54
|
+
*/
|
|
55
|
+
export declare const disableDevtools: () => void;
|
|
56
|
+
declare global {
|
|
57
|
+
interface Window {
|
|
58
|
+
__LITE_VUE__?: LiteVueDevtools;
|
|
59
|
+
__LITE_VUE_DEVTOOLS__?: boolean;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Context } from '../context.mjs';
|
|
2
|
+
import { effect as rawEffect } from '@vue/reactivity';
|
|
3
|
+
export interface Directive<T = Element> {
|
|
4
|
+
(ctx: DirectiveContext<T>): (() => void) | void;
|
|
5
|
+
}
|
|
6
|
+
export interface DirectiveContext<T = Element> {
|
|
7
|
+
el: T;
|
|
8
|
+
get: (exp?: string) => any;
|
|
9
|
+
effect: typeof rawEffect;
|
|
10
|
+
exp: string;
|
|
11
|
+
arg?: string;
|
|
12
|
+
modifiers?: Record<string, true>;
|
|
13
|
+
ctx: Context;
|
|
14
|
+
}
|
|
15
|
+
export declare const builtInDirectives: Record<string, Directive<any>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Context } from '../context';
|
|
2
|
+
import { effect as rawEffect } from '@vue/reactivity';
|
|
3
|
+
export interface Directive<T = Element> {
|
|
4
|
+
(ctx: DirectiveContext<T>): (() => void) | void;
|
|
5
|
+
}
|
|
6
|
+
export interface DirectiveContext<T = Element> {
|
|
7
|
+
el: T;
|
|
8
|
+
get: (exp?: string) => any;
|
|
9
|
+
effect: typeof rawEffect;
|
|
10
|
+
exp: string;
|
|
11
|
+
arg?: string;
|
|
12
|
+
modifiers?: Record<string, true>;
|
|
13
|
+
ctx: Context;
|
|
14
|
+
}
|
|
15
|
+
export declare const builtInDirectives: Record<string, Directive<any>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* watchEffect(fn) — run `fn` now, then again whenever any reactive state it
|
|
3
|
+
* read changes. The JS-side counterpart to `v-effect`, for work that isn't
|
|
4
|
+
* tied to an element: syncing state to storage or the URL, updating
|
|
5
|
+
* document.title, driving a non-LiteVue widget.
|
|
6
|
+
*
|
|
7
|
+
* Re-runs go through the framework scheduler, so a burst of mutations in one
|
|
8
|
+
* tick triggers a single run and the DOM is already up to date by then —
|
|
9
|
+
* unlike @vue/reactivity's raw `effect`, which fires synchronously on every
|
|
10
|
+
* mutation.
|
|
11
|
+
*
|
|
12
|
+
* Returns a function that stops watching. Nothing stops it automatically, so
|
|
13
|
+
* hold onto it for anything shorter-lived than the page.
|
|
14
|
+
*/
|
|
15
|
+
export declare const watchEffect: (fn: () => void) => (() => void);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* watchEffect(fn) — run `fn` now, then again whenever any reactive state it
|
|
3
|
+
* read changes. The JS-side counterpart to `v-effect`, for work that isn't
|
|
4
|
+
* tied to an element: syncing state to storage or the URL, updating
|
|
5
|
+
* document.title, driving a non-LiteVue widget.
|
|
6
|
+
*
|
|
7
|
+
* Re-runs go through the framework scheduler, so a burst of mutations in one
|
|
8
|
+
* tick triggers a single run and the DOM is already up to date by then —
|
|
9
|
+
* unlike @vue/reactivity's raw `effect`, which fires synchronously on every
|
|
10
|
+
* mutation.
|
|
11
|
+
*
|
|
12
|
+
* Returns a function that stops watching. Nothing stops it automatically, so
|
|
13
|
+
* hold onto it for anything shorter-lived than the page.
|
|
14
|
+
*/
|
|
15
|
+
export declare const watchEffect: (fn: () => void) => (() => void);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createApp } from './app.mjs';
|
|
2
|
+
export type { App, Plugin } from './app.mjs';
|
|
3
|
+
export { store } from './store.mjs';
|
|
4
|
+
export { nextTick } from './scheduler.mjs';
|
|
5
|
+
export { watchEffect } from './effect.mjs';
|
|
6
|
+
export { reactive } from '@vue/reactivity';
|
|
7
|
+
export { devtools, disableDevtools } from './devtools.mjs';
|
|
8
|
+
export type { LiteVueDevtools, DevtoolsEvent } from './devtools.mjs';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createApp } from './app';
|
|
2
|
+
export type { App, Plugin } from './app';
|
|
3
|
+
export { store } from './store';
|
|
4
|
+
export { nextTick } from './scheduler';
|
|
5
|
+
export { watchEffect } from './effect';
|
|
6
|
+
export { reactive } from '@vue/reactivity';
|
|
7
|
+
export { devtools, disableDevtools } from './devtools';
|
|
8
|
+
export type { LiteVueDevtools, DevtoolsEvent } from './devtools';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Context } from './context.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* $id('name') — unique ids for accessibility attributes. Stable within a
|
|
4
|
+
* scope (repeated calls with the same name return the same id, so
|
|
5
|
+
* label/input pairs match), unique across scopes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createId: () => (name?: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* $watch(source, callback) — watches a dot-path string or getter function
|
|
10
|
+
* and calls back with (value, oldValue) on change. Tied to the owning
|
|
11
|
+
* scope's effect list, so it stops when the scope unmounts.
|
|
12
|
+
*/
|
|
13
|
+
export declare const createWatch: (ctx: Context) => (source: string | (() => any), cb: (value: any, oldValue: any) => void) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Context } from './context';
|
|
2
|
+
/**
|
|
3
|
+
* $id('name') — unique ids for accessibility attributes. Stable within a
|
|
4
|
+
* scope (repeated calls with the same name return the same id, so
|
|
5
|
+
* label/input pairs match), unique across scopes.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createId: () => (name?: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* $watch(source, callback) — watches a dot-path string or getter function
|
|
10
|
+
* and calls back with (value, oldValue) on change. Tied to the owning
|
|
11
|
+
* scope's effect list, so it stops when the scope unmounts.
|
|
12
|
+
*/
|
|
13
|
+
export declare const createWatch: (ctx: Context) => (source: string | (() => any), cb: (value: any, oldValue: any) => void) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Plugin } from '../app.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* v-collapse="expression" — expands/collapses the element's height with a
|
|
4
|
+
* transition as the expression toggles. The initial state applies without
|
|
5
|
+
* animating.
|
|
6
|
+
*
|
|
7
|
+
* Modifiers:
|
|
8
|
+
* - .duration-<ms> transition duration (default 250)
|
|
9
|
+
*/
|
|
10
|
+
export declare const collapse: Plugin;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Plugin } from '../app';
|
|
2
|
+
/**
|
|
3
|
+
* v-collapse="expression" — expands/collapses the element's height with a
|
|
4
|
+
* transition as the expression toggles. The initial state applies without
|
|
5
|
+
* animating.
|
|
6
|
+
*
|
|
7
|
+
* Modifiers:
|
|
8
|
+
* - .duration-<ms> transition duration (default 250)
|
|
9
|
+
*/
|
|
10
|
+
export declare const collapse: Plugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Plugin } from '../app.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* Focus utilities.
|
|
4
|
+
*
|
|
5
|
+
* v-focus="expression" — focuses the element whenever the expression
|
|
6
|
+
* becomes truthy (including on mount, making it an autofocus).
|
|
7
|
+
* Modifiers:
|
|
8
|
+
* - .select also select the element's text (inputs/textareas)
|
|
9
|
+
*
|
|
10
|
+
* v-trap="expression" — while the expression is truthy, contains Tab /
|
|
11
|
+
* Shift+Tab focus cycling within the element (for accessible modals).
|
|
12
|
+
* Focus moves to the first focusable child on activation and returns to
|
|
13
|
+
* the previously focused element on release or unmount.
|
|
14
|
+
*/
|
|
15
|
+
export declare const focus: Plugin;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Plugin } from '../app';
|
|
2
|
+
/**
|
|
3
|
+
* Focus utilities.
|
|
4
|
+
*
|
|
5
|
+
* v-focus="expression" — focuses the element whenever the expression
|
|
6
|
+
* becomes truthy (including on mount, making it an autofocus).
|
|
7
|
+
* Modifiers:
|
|
8
|
+
* - .select also select the element's text (inputs/textareas)
|
|
9
|
+
*
|
|
10
|
+
* v-trap="expression" — while the expression is truthy, contains Tab /
|
|
11
|
+
* Shift+Tab focus cycling within the element (for accessible modals).
|
|
12
|
+
* Focus moves to the first focusable child on activation and returns to
|
|
13
|
+
* the previously focused element on release or unmount.
|
|
14
|
+
*/
|
|
15
|
+
export declare const focus: Plugin;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { intersect } from './intersect.mjs';
|
|
2
|
+
export { mask } from './mask.mjs';
|
|
3
|
+
export { transition } from './transition.mjs';
|
|
4
|
+
export { persist, persistStore, registerStorage, setDefaultStorage, } from './persist.mjs';
|
|
5
|
+
export type { PersistStorage } from './persist.mjs';
|
|
6
|
+
export { focus } from './focus.mjs';
|
|
7
|
+
export { collapse } from './collapse.mjs';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { intersect } from './intersect';
|
|
2
|
+
export { mask } from './mask';
|
|
3
|
+
export { transition } from './transition';
|
|
4
|
+
export { persist, persistStore, registerStorage, setDefaultStorage, } from './persist';
|
|
5
|
+
export type { PersistStorage } from './persist';
|
|
6
|
+
export { focus } from './focus';
|
|
7
|
+
export { collapse } from './collapse';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Plugin } from '../app.mjs';
|
|
2
|
+
/**
|
|
3
|
+
* v-intersect="expression" — evaluates the expression when the element
|
|
4
|
+
* enters the viewport.
|
|
5
|
+
*
|
|
6
|
+
* Modifiers:
|
|
7
|
+
* - .once stop observing after the first trigger
|
|
8
|
+
* - .leave trigger when the element leaves the viewport instead
|
|
9
|
+
* - .full require the element to be fully visible (threshold: 1)
|
|
10
|
+
*/
|
|
11
|
+
export declare const intersect: Plugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Plugin } from '../app';
|
|
2
|
+
/**
|
|
3
|
+
* v-intersect="expression" — evaluates the expression when the element
|
|
4
|
+
* enters the viewport.
|
|
5
|
+
*
|
|
6
|
+
* Modifiers:
|
|
7
|
+
* - .once stop observing after the first trigger
|
|
8
|
+
* - .leave trigger when the element leaves the viewport instead
|
|
9
|
+
* - .full require the element to be fully visible (threshold: 1)
|
|
10
|
+
*/
|
|
11
|
+
export declare const intersect: Plugin;
|