lithent 1.5.2 → 1.6.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/README.md +9 -9
- package/dist/index.d.ts +5 -6
- package/examples/dist/assets/index-fec613d6.js +2 -0
- package/examples/dist/assets/index-fec613d6.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/helper/dist/hook/store.d.ts +1 -1
- package/helper/dist/lithentHelper.mjs +64 -50
- package/helper/dist/lithentHelper.mjs.map +1 -1
- package/helper/dist/lithentHelper.umd.js +1 -1
- package/helper/dist/lithentHelper.umd.js.map +1 -1
- package/helper/src/hook/store.ts +61 -15
- package/package.json +1 -6
- package/src/index.ts +5 -16
- package/src/tests/storeObserver.tsx +190 -0
- package/src/tests/test2.tsx +63 -15
- package/examples/dist/assets/index-85bc9221.js +0 -2
- package/examples/dist/assets/index-85bc9221.js.map +0 -1
package/README.md
CHANGED
|
@@ -65,12 +65,12 @@ pnpm add lithent
|
|
|
65
65
|
|
|
66
66
|
#### Or Use CDN
|
|
67
67
|
|
|
68
|
-
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.
|
|
69
|
-
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
70
|
-
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
71
|
-
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.
|
|
72
|
-
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
73
|
-
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.
|
|
68
|
+
* UMD : https://cdn.jsdelivr.net/npm/lithent@1.6.0/dist/lithent.umd.js
|
|
69
|
+
* UMD-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.6.0/helper/dist/lithentHelper.umd.js
|
|
70
|
+
* UMD-TAG: https://cdn.jsdelivr.net/npm/lithent@1.6.0/tag/dist/lithentTag.umd.js
|
|
71
|
+
* ESM : https://cdn.jsdelivr.net/npm/lithent@1.6.0/dist/lithent.mjs
|
|
72
|
+
* ESM-HELPER: https://cdn.jsdelivr.net/npm/lithent@1.6.0/helper/dist/lithentHelper.mjs
|
|
73
|
+
* ESM-TAG: https://cdn.jsdelivr.net/npm/lithent@1.6.0/tag/dist/lithentTag.mjs
|
|
74
74
|
|
|
75
75
|
|
|
76
76
|
It's easier to use lithent with JSX or HTM.
|
|
@@ -122,9 +122,9 @@ const destroy = render(lTag`<${Component} />`, document.getElementById('root'),
|
|
|
122
122
|
#### With UMD
|
|
123
123
|
|
|
124
124
|
```html
|
|
125
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
126
|
-
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
127
|
-
<script src="https://cdn.jsdelivr.net/npm/lithent@1.
|
|
125
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.6.0/dist/lithent.umd.js"></script>
|
|
126
|
+
<!--script src="https://cdn.jsdelivr.net/npm/lithent@1.6.0/helper/dist/lithentHelper.umd.js"></script-->
|
|
127
|
+
<script src="https://cdn.jsdelivr.net/npm/lithent@1.6.0/tag/dist/lithentTag.umd.js"></script>
|
|
128
128
|
|
|
129
129
|
<div id="root"></div>
|
|
130
130
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export { h, Fragment, mount } from './wDom';
|
|
2
|
+
export { render } from './render';
|
|
3
|
+
export { mountCallback } from './hook/mountCallback';
|
|
4
|
+
export { updateCallback } from './hook/updateCallback';
|
|
5
|
+
export { ref, nextTick } from './hook/ref';
|
|
6
6
|
export type { WDom, TagFunction, TagFunctionResolver, FragmentFunction, ComponentSubKey, ComponentRef, Props, Renew, MiddleStateWDomChildren, MiddleStateWDom, NodePointer, Param, } from './types';
|
|
7
7
|
declare global {
|
|
8
8
|
namespace JSX {
|
|
@@ -11,4 +11,3 @@ declare global {
|
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
export { h, Fragment, render, mount, mountCallback, updateCallback, ref, nextTick, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const r of c)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(c){const r={};return c.integrity&&(r.integrity=c.integrity),c.referrerPolicy&&(r.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?r.credentials="include":c.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(c){if(c.ep)return;c.ep=!0;const r=n(c);fetch(c.href,r)}})();const E=e=>typeof e=="object"&&!("resolve"in e),b=(e,t)=>E(e)&&e.type===t,Ne=(e,t)=>"ctor"in e?e.ctor===(t==null?void 0:t.ctor):e===(t==null?void 0:t.ctor),be=(e,t)=>{var n,o;return E(e)&&(t==null?void 0:t.type)==="fragment"&&((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)},Te=(e,t)=>{var n,o;return E(e)&&(t==null?void 0:t.type)==="element"&&(t==null?void 0:t.tag)===e.tag&&((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)},X=(e,t)=>E(e)&&(t==null?void 0:t.type)===e.type,Ue=(e,t)=>{var n,o;return E(e)&&(t==null?void 0:t.type)===e.type&&(g(a((e.children||[])[0]))&&g(a((t.children||[])[0]))||((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length))},a=e=>{var t,n;return((t=e==null?void 0:e.compProps)==null?void 0:t.key)??((n=e==null?void 0:e.props)==null?void 0:n.key)},k=e=>e&&["fragment","loop"].includes(e),m=e=>typeof e=="function"&&!D(e)||typeof e=="object"&&"resolve"in e,D=e=>typeof e=="function"&&e===N,W=e=>E(e)&&!e.type,g=e=>e!=null,H=(e,t)=>e==="style"&&typeof t=="object",me=(e,t)=>e==="ref"&&typeof t=="object",Fe=e=>e.nodeType===1&&e.tagName==="OPTION",_e=e=>e.nodeType===1&&e.tagName==="TEXTAREA",Oe=e=>e.nodeType===1&&["radio","checkbox"].includes(e.type),Ae=e=>{let t="et";return m(e)?t="c":b(e,"fragment")?t="f":b(e,"element")?t="e":b(e,"loop")?t="l":b(e,"text")?t="t":W(e)&&(t="et"),t},Le={c:Ne,l:Ue,t:X,e:Te,f:be,et:X},h=e=>e.getParent&&e.getParent(),P=Object.entries,ee=Object.keys,F=Object.assign,R={value:""},x={value:{}},Q={value:!1},f=new WeakMap,Me=e=>{f.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},S=()=>x.value,te=(e,t)=>f.get(e)[t],Ie=e=>x.value=e,Qe=e=>{x.value=e,Me(e)},qe=e=>{f.get(S()).umts.push(e)},_=e=>{const{compKey:t}=e;t&&Be(t),ne(e)},ne=e=>{(e.children||[]).forEach(t=>{t.compKey?_(t):ne(t)})},Be=e=>{const t=f.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],f.delete(e))};let q=[];const $=()=>{q.forEach(e=>je(e)),q=[]},Ve=e=>{e.compKey&&q.push(e)},oe=e=>f.get(S()).mts.push(e),je=e=>{const{compKey:t}=e;if(t){const n=f.get(t),o=n==null?void 0:n.mts,c=n==null?void 0:n.upS;x.value=t,c&&(c.value=0),o&&(n.mts=[],o.forEach(r=>{const l=r();l&&qe(l)}))}},Z=(e,t=()=>[])=>{const n=f.get(S()),{upD:o,upS:c}=n,r=o[c.value];if(r&&$e(r,t())){const l=e();l&&n.upCB.push(l)}o[c.value]=t(),c.value+=1},Ye=e=>{const{compKey:t}=e;if(t){const n=f.get(t),o=n==null?void 0:n.upCB,c=n==null?void 0:n.upS;x.value=t,c&&(c.value=0),e.ctor&&o&&(n.upCB=[],o.forEach(r=>r()))}},$e=(e,t)=>e.length?e.some((n,o)=>n!==t[o]):!0,ze=e=>e==="className"?"class":e,ce=e=>e.replace(/^on(.*)/,(t,n)=>n.toLowerCase()),z=()=>new DocumentFragment,K=e=>document.createElement(e),Ge=(e,t,n)=>{t??(t=document.body),e.isRoot=!0,e.wrapElement=t;const o=A(e);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),$(),()=>{var c;const r=(c=f.get(e.compProps||{}))==null?void 0:c.vd.value;r&&(_(r),O(r),Je(r))}},re=e=>{const{needRerender:t}=e;t&&t!=="N"&&({A:J,D:G,R:He,U:V,CNSU:V,SR:ue,SU:Xe}[t](e),delete e.needRerender,delete e.oldChildren,delete e.oldProps)},O=e=>{e.props&&e.el&&fe(e.props,e.el),(e.children||[]).forEach(t=>{O(t)})},Je=e=>{le(e,e.wrapElement)},G=e=>{e.oldProps&&e.el&&fe(e.oldProps,e.el),le(e,L(h(e)))},le=(e,t)=>{var n,o;t&&e.el&&(((n=e.el)==null?void 0:n.nodeType)===1?t.removeChild(e.el):((o=e.el)==null?void 0:o.nodeType)===11&&se(e,t),delete e.el)},se=(e,t)=>{((e==null?void 0:e.oldChildren)||(e==null?void 0:e.children)||[]).forEach(n=>{var o,c;((o=n.el)==null?void 0:o.nodeType)===1?t.removeChild(n==null?void 0:n.el):((c=n.el)==null?void 0:c.nodeType)===11&&se(n,t)})},ue=e=>{G(e),J(e)},Xe=e=>{if(V(e),h(e).needRerender!=="CNSU"){const n=ie(e);J(e,n)}},J=(e,t)=>{t||(t=A(e));const n=h(e);if(n.type){const o=L(n),r=n.type==="loop"&&n.needRerender&&n.needRerender!=="CNSU"?B(n,h(n)):B(e,n);t&&o&&(r?o.insertBefore(t,r):o.appendChild(t),$())}},ie=e=>k(e.type)?((e==null?void 0:e.children)||[]).reduce((t,n)=>{const o=ie(n);return o&&t.appendChild(o),t},z()):e.el,B=(e,t)=>{const n=t.children||[],c=n.indexOf(e)+1,r=n.slice(c),l=de(r),s=t.type||"";if(l)return l;if(!t.isRoot&&k(s))return B(t,h(t));if(t.isRoot&&k(s)&&t.afterElement)return t.afterElement},de=e=>e.reduce((t,n)=>{const o=n.type,c=n.el,r=o&&k(o);return t||(r?de(n.children||[]):c&&c.nodeType!==11?c:t)},void 0),He=e=>{const t=h(e),n=e.el;if(t.type&&n)if(n.nodeType===11)ue(e);else{const o=L(t),c=A(e);o&&o.replaceChild(c,n),$()}},fe=(e,t)=>{P(e||{}).forEach(([n,o])=>{n.match(/^on/)&&t.removeEventListener(ce(n),o)})},V=e=>{var t;const n=e.el;if(e.type==="text"){Ze(e);return}if(n){const{oldProps:o,props:c}=e;pe(c,n,o),delete e.oldProps,e.tag==="input"&&(n.value=String(((t=e==null?void 0:e.props)==null?void 0:t.value)||""))}(e.children||[]).forEach(o=>re(o)),Ye(e)},Ze=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},pe=(e,t,n)=>{const o={...n};P(e||{}).forEach(([c,r])=>{let l=!0;c==="key"||r===o[c]||(c==="innerHTML"&&typeof r=="string"?t.innerHTML=r:H(c,r)?et(r,H(c,o.style)?o.style:{},t):me(c,r)?r.value=t:c.match(/^on/)?We(t,c,r,o[c]):Oe(t)&&c==="checked"?t.checked=!!r:_e(t)&&c==="value"?t.value=r:Fe(t)&&c==="selected"?t.selected=!!r:c&&([l,r]=we(r),l&&Ke(ze(c),t,r))),l&&delete o[c]}),ee(o).forEach(c=>t.removeAttribute(c))},Ke=(e,t,n)=>{R.value&&e!=="xmlns"?t.setAttributeNS(null,e,n):t.setAttribute(e,n)},we=e=>{let t=!0;return typeof e=="boolean"&&(e||(t=!1),e=""),[t,String(e)]},A=e=>{let t;const{type:n,tag:o,text:c,props:r,children:l=[]}=e,s=k(n);return o==="svg"&&(R.value=String(r==null?void 0:r.xmlns)),s?t=z():n==="element"&&o?t=R.value?document.createElementNS(R.value,o):K(o):n==="text"&&g(c)?t=document.createTextNode(String(c)):t=K("e"),De(l,t),pe(r,t),e.el=t,Ve(e),o==="svg"&&(R.value=""),t},De=(e,t)=>{const n=e.reduce((o,c)=>(c.type&&o.appendChild(A(c)),o),z());t&&n.hasChildNodes()&&t.appendChild(n)},We=(e,t,n,o)=>{const c=ce(t);o!==n&&(o&&e.removeEventListener(c,o),n&&e.addEventListener(c,n))},et=(e,t,n)=>{const o={...t},c=n==null?void 0:n.style;c&&(P(e).forEach(([r,l])=>{c[r]=l,delete o[r]}),P(o).forEach(([r])=>c[r]=""))},L=e=>{const t=k(e.type);return e.isRoot&&t?e.wrapElement:t?L(h(e)):e.el},M=(e,t)=>tt(e,Le[Ae(e)](e,t),t),tt=(e,t,n)=>{const o=ut(e,t,n),c=[o,t,n],r=ot(...c),l=r==="N";return l||(o.children=it(...c)),o.needRerender=r,nt(o,n,r),!l&&n&&delete n.children,o},nt=(e,t,n)=>{n!=="A"&&t&&(e.el=t.el),n&&["D","R","SR"].includes(n)&&(t!=null&&t.compKey&&(_(t),O(t)),e.oldChildren=t==null?void 0:t.children),e.oldProps=t==null?void 0:t.props},ot=(e,t,n)=>{const o=n&&n.type,c=W(e),r=e.isRoot,l=n&&h(n),s=!r&&(l==null?void 0:l.type),d=a(e),u=s==="loop"&&g(d),v=e.type==="text"&&t&&e.text===(n==null?void 0:n.text),y=e===n;let p;return c?p="D":v||y?p="N":o?t?p=u?"SU":"U":p=u?"SR":"R":p="A",e.type==="loop"&&p==="U"&&n&&ct(e,n)&&(p="CNSU"),p},ct=(e,t)=>{const n=[...(t==null?void 0:t.children)||[]],o=[...(e==null?void 0:e.children)||[]].filter(l=>n.find(s=>a(l)===a(s))),c=n.filter(l=>o.find(s=>a(l)===a(s)));let r=c.length===o.length;return r&&(r=c.every((l,s)=>a(l)===a(o[s]))),r},rt=(e,t)=>{e&&t!==e&&(ee(e).forEach(n=>delete e[n]),P(t||{}).forEach(([n,o])=>e[n]=o))},lt=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach(n=>e.push(n)))},st=(e,t)=>{const{compProps:n,compChild:o}=e,{props:c,children:r}=t;return n&&rt(n,c),o&<(o,r),e.reRender&&e.reRender()},ut=(e,t,n)=>m(e)?t&&n?st(n,e):e.resolve():e,it=(e,t,n)=>t&&n?ft(e,n):dt(e),dt=e=>(e.children||[]).map(t=>F(M(t),{getParent:()=>e})),ft=(e,t)=>e.type==="loop"&&g(a((e.children||[])[0]))?pt(e,t):(e.children||[]).map((n,o)=>F(M(n,(t.children||[])[o]),{getParent:()=>e})),pt=(e,t)=>{const[n,o]=at(e,t);return o.forEach(c=>{_(c),O(c),G(c)}),n},at=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return[n.map(r=>{const l=vt(r,o),s=M(r,l);return l&&o.splice(o.indexOf(l),1),s.getParent=()=>e,s}),o]},vt=(e,t)=>t.find(n=>a(n)===a(e));let T=[],j=!1;const ae=(e,t)=>{f.get(e).up=()=>{T.push({compKey:e,exec:t}),j||(j=!0,queueMicrotask(yt))}},ht=e=>()=>{var t;const n=(t=f.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},ve=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.compKey;o&&t.push(o),ve(n,t)})},yt=()=>{let e=[];T.forEach(o=>{var c,r;const l=(r=(c=f.get(o.compKey))==null?void 0:c.vd)==null?void 0:r.value;l&&ve(l,e)});const t=[],n=T.reduce((o,c)=>{const{compKey:r}=c;return e.includes(r)||t.includes(r)||(t.push(r),o.push(c)),o},[]);for(;n.length;){const o=n.shift();o&&o.exec()}T=[],j=!1},he=(e,t=()=>[])=>{f.get(S()).upR.push(()=>Z(e,t)),Z(e,t)},Ct=()=>{var e;const t=(e=f.get(S()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n())},N=(e,...t)=>({type:"fragment",children:t}),i=(e,t,...n)=>{const o={value:void 0},c=t||{},r=Re(o,n),l=gt(e,c,r);return m(l)||(o.value=l),l},ye=e=>(t,n)=>e,Ce=(e,t,n,o)=>{var c;Q.value=!0;const r=ke(e,t,n),l=M(r,o),{isRoot:s,getParent:d,wrapElement:u,afterElement:v}=o;if(l.getParent=d,!s&&d){const y=((c=d())==null?void 0:c.children)||[],p=y.indexOf(o);y.splice(p,1,l)}else l.isRoot=!0,l.wrapElement=u,l.afterElement=v;Q.value=!1,re(l)},ke=(e,t,n)=>({tagName:e.name,ctor:e,props:t,children:n,resolve:(l=t)=>{Qe(l);const d=e(t,n)(ht(l),t,n),u=kt(d,l,e,t,n),v=u;return ae(l,()=>Ce(e,t,n,v)),te(l,"vd").value=u,u}}),kt=(e,t,n,o,c)=>{let r=e,l=e(o);return l.reRender&&(r=s=>{const d=e(s),u=N({},d);return d.getParent=()=>u,u},l=r(o)),Ee(l,t,n,o,c,Et(r,t,n,o,c)),l},Et=(e,t,n,o,c)=>{const r=()=>Rt(e,t,n,o,c,r);return r},Rt=(e,t,n,o,c,r)=>{Ie(t),Ct();const l=e(o);return ae(t,()=>Ce(n,o,c,l)),Ee(l,t,n,o,c,r),te(t,"vd").value=l,l},Ee=(e,t,n,o,c,r)=>{F(e,{compProps:o,compChild:c,ctor:n,tagName:n.name,compKey:t,reRender:r})},gt=(e,t,n)=>{if(D(e))return N(t,...n);if(m(e)){const o=ke(e,t,n);return Q.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},Re=(e,t)=>t.map(n=>F(Pt(n),{getParent:()=>e.value})),Pt=e=>{if(e==null||e===!1)return{type:null};if(Array.isArray(e)){const t={value:void 0},o={type:"loop",children:Re(t,e)};return t.value=o,o}else if(typeof e=="string"||typeof e=="number")return{type:"text",text:e};return e},xt=e=>({value:e}),Y=(e,t)=>{let n=e;return{get value(){return n},get v(){return n},set value(o){n=o,t()},set v(o){n=o,t()}}},St=e=>{let t=e;return{get value(){return t()},get v(){return t()},set value(n){throw new Error("You can't change 'computed'")},set v(n){throw new Error("You can't change 'computed'")}}},Nt=(e,t=()=>{},n=()=>[])=>{oe(()=>(e(),t)),he(()=>(t&&t(),e),n)},ge=new Map,U={},C={},bt=e=>{const t=Symbol();return ge.set(t,e),(n,o)=>{if(n)if(o){const c={value:n},r=w(t,c);return o(r),c.value=null,r}else U[t]??(U[t]=[]),U[t].push(n);return w(t)}},w=(e,t)=>{const n=[];return new Proxy(ge.get(e),{get(o,c){var r;return t!=null&&t.value&&(C[e]??(C[e]={}),(r=C[e])[c]??(r[c]=[]),C[e][c].includes(t.value)||(C[e][c].push(t.value),n.push(c))),n.includes(c)||!t?o[c]:null},set(o,c,r){(n.includes(c)||!t)&&(o[c]=r);const l=U[e]||[],s=t?C[e][c]||[]:[],d=[];return l.forEach(u=>{u()||d.push(u)}),s.forEach(u=>{u()||d.push(u)}),d.forEach(u=>{l.splice(l.indexOf(u),1),s.splice(s.indexOf(u),1)}),!0}})},Tt=ye((e,t,n)=>{const o=Y(1,e),c=Y('"destructuring" the "props" value directly from the mount function will cause referencing issues, so if you want to use it, you need to "destructuring" it from the internal function (updater).',e),r=()=>t.parentValue,l=t.parentValue,s=St(()=>o.v+u+t.parentValue),d=bt({text:"s",count:0})(e);let u=t.parentValue;const v=xt(null),y=()=>{o.v=o.v+1,u+=1},p=I=>{c.v=I.target.value},Pe=()=>{d.count+=1,d.text+="1"},xe=()=>(console.log("MOUNTED",v),()=>console.log("UNMOUNT")),Se=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return oe(xe),he(Se,()=>[t.parentValue]),Nt(()=>console.log("INJECT"),()=>console.log("CLEAN_UP"),()=>[o.v]),({parentValue:I})=>i(N,null,i("div",null,i("textarea",{value:c.v,onInput:p,style:{width:"300px",height:"100px"}})),i("div",null,c.v),i("div",null,i("div",{style:{color:"blue"}},"parentValueFromRef: ",t.parentValue," (working)"),i("div",{style:{color:"blue"}},"parentValueFromFunction: ",r()," (working)"),i("div",{style:{color:"blue"}},"parentValueFromUpdaterDestructuring: ",I," (working)"),i("div",{style:{color:"red"}},"parentValueFromMounterDestructuring: ",l," (not working)")),i("div",null,i("div",{ref:v},"count: ",o.v),i("div",null,"sum: ",o.v+u+t.parentValue),i("div",null,"sum(computed): ",s.v),i("div",null,"notRefValue: ",u),i("div",null,"localStore(text): ",d.text),i("div",null,"localStore(count): ",d.count)),i("button",{onClick:y},"Increase"),i("button",{onClick:Pe},"localStoreUpdate"),n)}),Ut=ye(e=>{const t=Y(7,e),n=()=>{t.v=t.v+1},o=()=>{t.v=t.v-1};return()=>i(N,null,i(Tt,{parentValue:t.v},i("button",{onClick:n},"Increase - Parent")),i("button",{onClick:o},"Decrease - Parent"))}),mt=i(Ut,null);Ge(mt,document.getElementById("root"));
|
|
2
|
+
//# sourceMappingURL=index-fec613d6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-fec613d6.js","sources":["../../../dist/lithent.mjs","../../../helper/dist/lithentHelper.mjs","../../src/index.tsx"],"sourcesContent":["const checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkSameCustomComponent = (newWDom, originalWDom) => \"ctor\" in newWDom ? newWDom.ctor === (originalWDom == null ? void 0 : originalWDom.ctor) : newWDom === (originalWDom == null ? void 0 : originalWDom.ctor);\nconst checkSameFragment = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"fragment\" && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkSameTagElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"element\" && (originalWDom == null ? void 0 : originalWDom.tag) === newWDom.tag && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkNormalTypeElement = (newWDom, originalWDom) => checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type;\nconst checkLoopTypeElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type && (checkExisty(getKey((newWDom.children || [])[0])) && checkExisty(getKey((originalWDom.children || [])[0])) || ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length));\n};\nconst getKey = (target) => {\n var _a, _b;\n return ((_a = target == null ? void 0 : target.compProps) == null ? void 0 : _a.key) ?? ((_b = target == null ? void 0 : target.props) == null ? void 0 : _b.key);\n};\nconst checkVirtualType = (type) => type && [\"fragment\", \"loop\"].includes(type);\nconst checkCustemComponentFunction = (target) => typeof target === \"function\" && !checkFragmentFunction(target) || typeof target === \"object\" && \"resolve\" in target;\nconst checkFragmentFunction = (target) => typeof target === \"function\" && target === Fragment;\nconst checkEmptyElement = (wDom) => checkPlainWDomType(wDom) && !wDom.type;\nconst checkExisty = (value) => value !== null && value !== void 0;\nconst checkStyleData = (dataKey, dataValue) => dataKey === \"style\" && typeof dataValue === \"object\";\nconst checkRefData = (dataKey, dataValue) => dataKey === \"ref\" && typeof dataValue === \"object\";\nconst checkOptionElement = (element) => element.nodeType === 1 && element.tagName === \"OPTION\";\nconst checkTextareaElement = (element) => element.nodeType === 1 && element.tagName === \"TEXTAREA\";\nconst checkCheckableElement = (element) => element.nodeType === 1 && [\"radio\", \"checkbox\"].includes(element.type);\nconst getWDomType = (wDom) => {\n let result = \"et\";\n if (checkCustemComponentFunction(wDom)) {\n result = \"c\";\n } else if (checkPlainType(wDom, \"fragment\")) {\n result = \"f\";\n } else if (checkPlainType(wDom, \"element\")) {\n result = \"e\";\n } else if (checkPlainType(wDom, \"loop\")) {\n result = \"l\";\n } else if (checkPlainType(wDom, \"text\")) {\n result = \"t\";\n } else if (checkEmptyElement(wDom)) {\n result = \"et\";\n }\n return result;\n};\nconst checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkLoopTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement\n};\nconst getParent = (vDom) => vDom.getParent && vDom.getParent();\nconst entries = Object.entries;\nconst keys = Object.keys;\nconst assign = Object.assign;\nconst xmlnsRef = { value: \"\" };\nconst compKeyRef = { value: {} };\nconst needDiffRef = { value: false };\nconst componentRef = /* @__PURE__ */ new WeakMap();\nconst setComponetRef = (compKey) => {\n componentRef.set(compKey, {\n vd: { value: null },\n up: () => {\n },\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: []\n });\n};\nconst getComponentKey = () => compKeyRef.value;\nconst getComponentSubInfo = (compKey, subKey) => componentRef.get(compKey)[subKey];\nconst initUpdateHookState = (compKey) => compKeyRef.value = compKey;\nconst initMountHookState = (compKey) => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\n};\nconst unmount = (effectAction) => {\n componentRef.get(getComponentKey()).umts.push(effectAction);\n};\nconst runUnmountQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\nconst recursiveRunUnmount = (wDom) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\nconst removeItem = (compKey) => {\n const subInfo = componentRef.get(compKey);\n if (subInfo) {\n subInfo.umts.forEach((effect) => effect());\n subInfo.umts = [];\n componentRef.delete(compKey);\n }\n};\nlet mountedQueue = [];\nconst execMountedQueue = () => {\n mountedQueue.forEach((item) => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\nconst addMountedQueue = (wDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\nconst mountCallback = (effectAction) => componentRef.get(getComponentKey()).mts.push(effectAction);\nconst runMountedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.mts;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (queue) {\n component.mts = [];\n queue.forEach((effect) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\nconst useUpdated = (effectAction, dependencies = () => []) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component;\n const def = upD[upS.value];\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component.upCB.push(callback);\n }\n }\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\nconst runUpdatedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.upCB;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (newWDom.ctor && queue) {\n component.upCB = [];\n queue.forEach((effect) => effect());\n }\n }\n};\nconst checkNeedPushQueue = (originalDefs, newDefs) => !originalDefs.length ? true : originalDefs.some((def, index) => def !== newDefs[index]);\nconst getAttrKey = (keyName) => keyName === \"className\" ? \"class\" : keyName;\nconst getEventName = (eventKey) => eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\nconst DF = () => new DocumentFragment();\nconst CE = (t) => document.createElement(t);\nconst render = (wDom, wrapElement, afterElement) => {\n wrapElement ?? (wrapElement = document.body);\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n const Dom = wDomToDom(wDom);\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n execMountedQueue();\n return () => {\n var _a;\n const component = (_a = componentRef.get(wDom.compProps || {})) == null ? void 0 : _a.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n };\n};\nconst wDomUpdate = (newWDomTree) => {\n const { needRerender } = newWDomTree;\n if (needRerender && needRerender !== \"N\") {\n ({\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n CNSU: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate\n })[needRerender](newWDomTree);\n delete newWDomTree.needRerender;\n delete newWDomTree.oldChildren;\n delete newWDomTree.oldProps;\n }\n};\nconst recursiveRemoveEvent = (originalWDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n (originalWDom.children || []).forEach((childItem) => {\n recursiveRemoveEvent(childItem);\n });\n};\nconst rootDelete = (newWDom) => {\n deleteRealDom(newWDom, newWDom.wrapElement);\n};\nconst typeDelete = (newWDom) => {\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n deleteRealDom(\n newWDom,\n findRealParentElement(getParent(newWDom))\n );\n};\nconst deleteRealDom = (newWDom, parent) => {\n var _a, _b;\n if (parent && newWDom.el) {\n if (((_a = newWDom.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(newWDom.el);\n } else if (((_b = newWDom.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(newWDom, parent);\n }\n delete newWDom.el;\n }\n};\nconst findChildWithRemoveElement = (newWDom, parent) => {\n ((newWDom == null ? void 0 : newWDom.oldChildren) || (newWDom == null ? void 0 : newWDom.children) || []).forEach((item) => {\n var _a, _b;\n if (((_a = item.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(item == null ? void 0 : item.el);\n } else if (((_b = item.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\nconst typeSortedReplace = (newWDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\nconst typeSortedUpdate = (newWDom) => {\n typeUpdate(newWDom);\n const parentWDom = getParent(newWDom);\n if (parentWDom.needRerender !== \"CNSU\") {\n const newElement = getElementFromFragment(newWDom);\n typeAdd(newWDom, newElement);\n }\n};\nconst typeAdd = (newWDom, newElement) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom);\n }\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === \"loop\";\n const nextEl = isLoop && parentWDom.needRerender && parentWDom.needRerender !== \"CNSU\" ? startFindNextBrotherElement(parentWDom, getParent(parentWDom)) : startFindNextBrotherElement(newWDom, parentWDom);\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n execMountedQueue();\n }\n }\n};\nconst getElementFromFragment = (newWDom) => {\n if (checkVirtualType(newWDom.type)) {\n return ((newWDom == null ? void 0 : newWDom.children) || []).reduce((acc, item) => {\n const element = getElementFromFragment(item);\n if (element) {\n acc.appendChild(element);\n }\n return acc;\n }, DF());\n }\n return newWDom.el;\n};\nconst startFindNextBrotherElement = (wDom, parentWDom) => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || \"\";\n if (finedNextEl) {\n return finedNextEl;\n }\n if (!parentWDom.isRoot && checkVirtualType(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (parentWDom.isRoot && checkVirtualType(parentType) && parentWDom.afterElement) {\n return parentWDom.afterElement;\n }\n return void 0;\n};\nconst findChildFragmentNextElement = (candidiateBrothers) => candidiateBrothers.reduce(\n (targetEl, bItem) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && checkVirtualType(type);\n if (targetEl) {\n return targetEl;\n } else if (isFragment) {\n return findChildFragmentNextElement(bItem.children || []);\n } else if (el && el.nodeType !== 11) {\n return el;\n }\n return targetEl;\n },\n void 0\n);\nconst typeReplace = (newWDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n if (parentWDom.type && orignalElement) {\n if (orignalElement.nodeType === 11) {\n typeSortedReplace(newWDom);\n } else {\n const parentElement = findRealParentElement(parentWDom);\n const newElement = wDomToDom(newWDom);\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\nconst removeEvent = (oldProps, element) => {\n entries(oldProps || {}).forEach(([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue\n );\n }\n });\n};\nconst typeUpdate = (newWDom) => {\n var _a;\n const element = newWDom.el;\n if (newWDom.type === \"text\") {\n updateText(newWDom);\n return;\n }\n if (element) {\n const { oldProps, props } = newWDom;\n updateProps$1(props, element, oldProps);\n delete newWDom.oldProps;\n if (newWDom.tag === \"input\") {\n element.value = String(((_a = newWDom == null ? void 0 : newWDom.props) == null ? void 0 : _a.value) || \"\");\n }\n }\n (newWDom.children || []).forEach((childItem) => wDomUpdate(childItem));\n runUpdatedQueueFromWDom(newWDom);\n};\nconst updateText = (newWDom) => {\n const element = newWDom.el;\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\nconst updateProps$1 = (props, element, oldProps) => {\n const originalProps = { ...oldProps };\n entries(props || {}).forEach(([dataKey, dataValue]) => {\n let chkRemoveProp = true;\n if (dataKey === \"key\" || dataValue === originalProps[dataKey])\n ;\n else if (dataKey === \"innerHTML\" && typeof dataValue === \"string\") {\n element.innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n updateStyle(\n dataValue,\n checkStyleData(dataKey, originalProps.style) ? originalProps.style : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element,\n dataKey,\n dataValue,\n originalProps[dataKey]\n );\n } else if (checkCheckableElement(element) && dataKey === \"checked\") {\n element.checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === \"value\") {\n element.value = dataValue;\n } else if (checkOptionElement(element) && dataKey === \"selected\") {\n element.selected = !!dataValue;\n } else if (dataKey) {\n [chkRemoveProp, dataValue] = makeAttrDataValue(dataValue);\n if (chkRemoveProp) {\n setAttr(\n getAttrKey(dataKey),\n element,\n dataValue\n );\n }\n }\n if (chkRemoveProp) {\n delete originalProps[dataKey];\n }\n });\n keys(originalProps).forEach(\n (dataKey) => element.removeAttribute(dataKey)\n );\n};\nconst setAttr = (dataKey, element, dataValue) => {\n if (xmlnsRef.value && dataKey !== \"xmlns\") {\n element.setAttributeNS(null, dataKey, dataValue);\n } else {\n element.setAttribute(dataKey, dataValue);\n }\n};\nconst makeAttrDataValue = (dataValue) => {\n let allowSetAttr = true;\n if (typeof dataValue === \"boolean\") {\n if (!dataValue) {\n allowSetAttr = false;\n }\n dataValue = \"\";\n }\n return [allowSetAttr, String(dataValue)];\n};\nconst wDomToDom = (wDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n if (tag === \"svg\") {\n xmlnsRef.value = String(props == null ? void 0 : props.xmlns);\n }\n if (isVirtualType) {\n element = DF();\n } else if (type === \"element\" && tag) {\n element = xmlnsRef.value ? document.createElementNS(xmlnsRef.value, tag) : CE(tag);\n } else if (type === \"text\" && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = CE(\"e\");\n }\n wDomChildrenToDom(children, element);\n updateProps$1(props, element);\n wDom.el = element;\n addMountedQueue(wDom);\n if (tag === \"svg\") {\n xmlnsRef.value = \"\";\n }\n return element;\n};\nconst wDomChildrenToDom = (children, parentElement) => {\n const elementChildren = children.reduce(\n (acc, childItem) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem));\n }\n return acc;\n },\n DF()\n );\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n};\nconst updateEvent = (element, eventKey, newEventHandler, oldEventHandler) => {\n const eventName = getEventName(eventKey);\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\nconst updateStyle = (style, oldStyle, element) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = element == null ? void 0 : element.style;\n if (elementStyle) {\n entries(style).forEach(([styleKey, dataValue]) => {\n elementStyle[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n entries(originalStyle).forEach(\n ([styleKey]) => elementStyle[styleKey] = \"\"\n );\n }\n};\nconst findRealParentElement = (vDom) => {\n const isVirtualType = checkVirtualType(vDom.type);\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n if (!isVirtualType) {\n return vDom.el;\n }\n return findRealParentElement(getParent(vDom));\n};\nconst makeNewWDomTree = (newWDom, originalWDom) => remakeNewWDom(\n newWDom,\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n);\nconst remakeNewWDom = (newWDom, isSameType, originalWDom) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const param = [\n remakeWDom,\n isSameType,\n originalWDom\n ];\n const needRerender = addReRenderTypeProperty(...param);\n const isNoting = needRerender === \"N\";\n if (!isNoting) {\n remakeWDom.children = remakeChildrenForDiff(...param);\n }\n remakeWDom.needRerender = needRerender;\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n if (!isNoting && originalWDom) {\n delete originalWDom.children;\n }\n return remakeWDom;\n};\nconst inheritPropForRender = (remakeWDom, originalWDom, needRerender) => {\n if (needRerender !== \"A\" && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n if (needRerender && [\"D\", \"R\", \"SR\"].includes(needRerender)) {\n if (originalWDom == null ? void 0 : originalWDom.compKey) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n }\n remakeWDom.oldChildren = originalWDom == null ? void 0 : originalWDom.children;\n }\n remakeWDom.oldProps = originalWDom == null ? void 0 : originalWDom.props;\n};\nconst addReRenderTypeProperty = (newWDom, isSameType, originalWDom) => {\n const existOriginalWDom = originalWDom && originalWDom.type;\n const isEmptyElement = checkEmptyElement(newWDom);\n const isRoot = newWDom.isRoot;\n const originalParentWDom = originalWDom && getParent(originalWDom);\n const origParentType = !isRoot && (originalParentWDom == null ? void 0 : originalParentWDom.type);\n const key = getKey(newWDom);\n const isKeyCheckedWDom = origParentType === \"loop\" && checkExisty(key);\n const isSameText = newWDom.type === \"text\" && isSameType && newWDom.text === (originalWDom == null ? void 0 : originalWDom.text);\n const isSameWDom = newWDom === originalWDom;\n let result;\n if (isEmptyElement) {\n result = \"D\";\n } else if (isSameText || isSameWDom) {\n result = \"N\";\n } else if (!existOriginalWDom) {\n result = \"A\";\n } else if (isSameType) {\n result = isKeyCheckedWDom ? \"SU\" : \"U\";\n } else {\n result = isKeyCheckedWDom ? \"SR\" : \"R\";\n }\n if (newWDom.type === \"loop\" && result === \"U\" && originalWDom && chkDiffLoopOrder(newWDom, originalWDom)) {\n result = \"CNSU\";\n }\n return result;\n};\nconst chkDiffLoopOrder = (newWDom, originalWDom) => {\n const origChildren = [...(originalWDom == null ? void 0 : originalWDom.children) || []];\n const newChildren = [...(newWDom == null ? void 0 : newWDom.children) || []].filter(\n (item) => origChildren.find((newItem) => getKey(item) === getKey(newItem))\n );\n const filteredChildren = origChildren.filter(\n (item) => newChildren.find((newItem) => getKey(item) === getKey(newItem))\n );\n let isSame = filteredChildren.length === newChildren.length;\n if (isSame) {\n isSame = filteredChildren.every(\n (item, index) => getKey(item) === getKey(newChildren[index])\n );\n }\n return isSame;\n};\nconst updateProps = (props, infoProps) => {\n if (props && infoProps !== props) {\n keys(props).forEach((key) => delete props[key]);\n entries(infoProps || {}).forEach(([key, value]) => props[key] = value);\n }\n};\nconst updateChildren = (children, infoChidren) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n if (infoChidren) {\n infoChidren.forEach((childrenItem) => children.push(childrenItem));\n }\n }\n};\nconst runUpdate = (vDom, infoVdom) => {\n const { compProps: props, compChild: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n if (props) {\n updateProps(props, infoProps);\n }\n if (children) {\n updateChildren(children, infoChidren);\n }\n const newVDom = vDom.reRender && vDom.reRender();\n return newVDom;\n};\nconst generalize = (newWDom, isSameType, originalWDom) => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom ? runUpdate(originalWDom, newWDom) : newWDom.resolve();\n }\n return newWDom;\n};\nconst remakeChildrenForDiff = (newWDom, isSameType, originalWDom) => isSameType && originalWDom ? remakeChildrenForUpdate(newWDom, originalWDom) : remakeChildrenForAdd(newWDom);\nconst remakeChildrenForAdd = (newWDom) => (newWDom.children || []).map(\n (item) => assign(makeNewWDomTree(item), { getParent: () => newWDom })\n);\nconst remakeChildrenForUpdate = (newWDom, originalWDom) => newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0])) ? remakeChildrenForLoopUpdate(newWDom, originalWDom) : (newWDom.children || []).map(\n (item, index) => assign(makeNewWDomTree(item, (originalWDom.children || [])[index]), {\n getParent: () => newWDom\n })\n);\nconst remakeChildrenForLoopUpdate = (newWDom, originalWDom) => {\n const [remakedChildren, unUsedChildren] = diffLoopChildren(\n newWDom,\n originalWDom\n );\n unUsedChildren.forEach((unusedItem) => {\n runUnmountQueueFromWDom(unusedItem);\n recursiveRemoveEvent(unusedItem);\n typeDelete(unusedItem);\n });\n return remakedChildren;\n};\nconst diffLoopChildren = (newWDom, originalWDom) => {\n const newChildren = [...newWDom.children || []];\n const originalChildren = [...originalWDom.children || []];\n const remakedChildren = newChildren.map((item) => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n childItem.getParent = () => newWDom;\n return childItem;\n });\n return [remakedChildren, originalChildren];\n};\nconst findSameKeyOriginalItem = (item, originalChildren) => originalChildren.find(\n (orignalChildItem) => getKey(orignalChildItem) === getKey(item)\n);\nlet redrawQueue = [];\nlet redrawQueueTimeout = false;\nconst setRedrawAction = (compKey, exec) => {\n componentRef.get(compKey).up = () => {\n redrawQueue.push({\n compKey,\n exec\n });\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n };\n};\nconst componentUpdate = (compKey) => () => {\n var _a;\n const up = (_a = componentRef.get(compKey)) == null ? void 0 : _a.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n return result;\n};\nconst recursiveGetChildKeys = (wDom, result) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n result.push(childComKey);\n }\n recursiveGetChildKeys(item, result);\n });\n};\nconst execRedrawQueue = () => {\n let childItemList = [];\n redrawQueue.forEach((item) => {\n var _a, _b;\n const childVd = (_b = (_a = componentRef.get(item.compKey)) == null ? void 0 : _a.vd) == null ? void 0 : _b.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n const addedKey = [];\n const result = redrawQueue.reduce((acc, item) => {\n const { compKey } = item;\n if (childItemList.includes(compKey) || addedKey.includes(compKey)) {\n return acc;\n }\n addedKey.push(compKey);\n acc.push(item);\n return acc;\n }, []);\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n redrawQueue = [];\n redrawQueueTimeout = false;\n};\nconst updateCallback = (effectAction, dependencies = () => []) => {\n const updateReqs = componentRef.get(getComponentKey()).upR;\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\nconst runUpdateCallback = () => {\n var _a;\n const updateReqs = (_a = componentRef.get(getComponentKey())) == null ? void 0 : _a.upR;\n if (updateReqs == null ? void 0 : updateReqs.length) {\n updateReqs.forEach((callback) => callback());\n }\n};\nconst Fragment = (_props, ...children) => ({\n type: \"fragment\",\n children\n});\nconst h = (tag, props, ...children) => {\n const nodeParentPointer = { value: void 0 };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n return node;\n};\nconst mount = (component) => (_props, _children) => component;\nconst reRenderCustomComponent = (tag, props, children, originalWDom) => {\n var _a;\n needDiffRef.value = true;\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent: getParent2, wrapElement, afterElement } = originalWDom;\n newWDomTree.getParent = getParent2;\n if (!isRoot && getParent2) {\n const brothers = ((_a = getParent2()) == null ? void 0 : _a.children) || [];\n const index = brothers.indexOf(originalWDom);\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\nconst makeWDomResolver = (tag, props, children) => {\n const tagName = tag.name;\n const ctor = tag;\n const resolve = (compKey = props) => {\n initMountHookState(compKey);\n const component = tag(props, children);\n const componentMaker = component(componentUpdate(compKey), props, children);\n const customNode = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n children\n );\n const originalWDom = customNode;\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n getComponentSubInfo(compKey, \"vd\").value = customNode;\n return customNode;\n };\n return { tagName, ctor, props, children, resolve };\n};\nconst makeCustomNode = (componentMaker, compKey, tag, props, children) => {\n let newCustomComponentMaker = componentMaker;\n let customNode = componentMaker(props);\n if (customNode.reRender) {\n newCustomComponentMaker = (newProps) => {\n const customNode2 = componentMaker(newProps);\n const newNode = Fragment({}, customNode2);\n customNode2.getParent = () => newNode;\n return newNode;\n };\n customNode = newCustomComponentMaker(props);\n }\n addComponentProps(\n customNode,\n compKey,\n tag,\n props,\n children,\n makeReRender(newCustomComponentMaker, compKey, tag, props, children)\n );\n return customNode;\n};\nconst makeReRender = (componentMaker, compKey, tag, props, children) => {\n const reRender = () => wDomMaker(componentMaker, compKey, tag, props, children, reRender);\n return reRender;\n};\nconst wDomMaker = (componentMaker, compKey, tag, props, children, reRender) => {\n initUpdateHookState(compKey);\n runUpdateCallback();\n const originalWDom = componentMaker(props);\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n addComponentProps(originalWDom, compKey, tag, props, children, reRender);\n getComponentSubInfo(compKey, \"vd\").value = originalWDom;\n return originalWDom;\n};\nconst addComponentProps = (wDom, compKey, tag, props, children, reRender) => {\n assign(wDom, {\n compProps: props,\n compChild: children,\n ctor: tag,\n tagName: tag.name,\n compKey,\n reRender\n });\n};\nconst makeNode = (tag, props, children) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n return needDiffRef.value ? componetMakeResolver : componetMakeResolver.resolve();\n }\n return {\n type: \"element\",\n tag,\n props,\n children\n };\n};\nconst remakeChildren = (nodeParentPointer, children) => children.map(\n (item) => assign(makeChildrenItem(item), { getParent: () => nodeParentPointer.value })\n);\nconst makeChildrenItem = (item) => {\n if (item === null || item === void 0 || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer = { value: void 0 };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: \"loop\",\n children\n };\n nodeParentPointer.value = node;\n return node;\n } else if (typeof item === \"string\" || typeof item === \"number\") {\n return { type: \"text\", text: item };\n }\n return item;\n};\nconst ref = (initValue) => ({ value: initValue });\nconst nextTick = () => Promise.resolve();\nexport {\n Fragment,\n h,\n mount,\n mountCallback,\n nextTick,\n ref,\n render,\n updateCallback\n};\n//# sourceMappingURL=lithent.mjs.map\n","import { mountCallback as f, updateCallback as g, nextTick as m, render as x } from \"lithent\";\nconst C = (n, t) => {\n let u = n;\n return {\n get value() {\n return u;\n },\n get v() {\n return u;\n },\n set value(c) {\n u = c, t();\n },\n set v(c) {\n u = c, t();\n }\n };\n}, P = (n) => {\n let t = n;\n return {\n get value() {\n return t();\n },\n get v() {\n return t();\n },\n set value(u) {\n throw new Error(\"You can't change 'computed'\");\n },\n set v(u) {\n throw new Error(\"You can't change 'computed'\");\n }\n };\n}, U = (n, t = () => {\n}, u = () => []) => {\n f(() => (n(), t)), g(() => (t && t(), n), u);\n}, v = /* @__PURE__ */ new Map(), h = {}, r = {}, k = (n) => {\n const t = Symbol();\n return v.set(t, n), (u, c) => {\n if (u)\n if (c) {\n const l = { value: u }, s = d(t, l);\n return c(s), l.value = null, s;\n } else\n h[t] ?? (h[t] = []), h[t].push(u);\n return d(t);\n };\n}, d = (n, t) => {\n const u = [];\n return new Proxy(v.get(n), {\n get(c, l) {\n var s;\n return t != null && t.value && (r[n] ?? (r[n] = {}), (s = r[n])[l] ?? (s[l] = []), r[n][l].includes(t.value) || (r[n][l].push(t.value), u.push(l))), u.includes(l) || !t ? c[l] : null;\n },\n set(c, l, s) {\n (u.includes(l) || !t) && (c[l] = s);\n const i = h[n] || [], a = t ? r[n][l] || [] : [], o = [];\n return i.forEach((e) => {\n e() || o.push(e);\n }), a.forEach((e) => {\n e() || o.push(e);\n }), o.forEach((e) => {\n i.splice(i.indexOf(e), 1), a.splice(a.indexOf(e), 1);\n }), !0;\n }\n });\n}, D = (n, t) => {\n let u = [], c = null;\n return (l) => {\n const s = n(), i = u.every((o, e) => o === s[e]);\n if (u = s, i && c)\n return c;\n const a = t(l);\n return c = a, a;\n };\n}, S = (n, t, u) => {\n let c = () => {\n };\n return m().then(() => {\n c = x(n(), t, u);\n }), () => c();\n};\nexport {\n D as cacheUpdate,\n P as computed,\n U as effect,\n S as nextTickRender,\n C as state,\n k as store\n};\n//# sourceMappingURL=lithentHelper.mjs.map\n","// example.jsx\nimport {\n h,\n Fragment,\n render,\n ref,\n mountCallback,\n updateCallback,\n mount,\n} from 'lithent';\nimport { state, computed, effect, store } from 'lithent/helper';\n\n// This is the \"mount\" function.\n// This function is only executed on mount, and on update, only updates `props` and then executes the internal return function.\n// childen is passed as the second argument.\nconst ChildComponent = mount<{ parentValue: number }>(\n (renew, props, children) => {\n // The value is used as a \"getter\" to make it easy to get and write to in the higher-order functions it returns\n const count = state<number>(1, renew);\n const text = state<string>(\n '\"destructuring\" the \"props\" value directly from the mount function will cause referencing issues, so if you want to use it, you need to \"destructuring\" it from the internal function (updater).',\n renew\n );\n const getParentValue = () => props.parentValue;\n const parentValueFromMount = props.parentValue;\n const summ = computed<number>(\n () => count.v + notRefValue + props.parentValue\n );\n\n const localStore = store<{ text: string; count: number }>({\n text: 's',\n count: 0,\n })(renew);\n /*\n // To share a store, make it externally and use `asign`.\n const asignStore = store<{ text: string; count: number }>({ text: 's', count: 0 });\n\n const sharedStore = asignStore(nenew);\n */\n\n // Even if you don't use a ref, the private value is always maintained as a regular variable.\n let notRefValue = props.parentValue;\n\n // Ref is only used to reference the DOM.\n const domRef = ref(null);\n\n const increase = () => {\n count.v = count.v + 1;\n notRefValue += 1;\n };\n\n const handleInputChane = (event: InputEvent) => {\n text.v = (event.target as HTMLInputElement).value;\n };\n\n const localStoreUpdate = () => {\n localStore.count += 1;\n localStore.text += '1';\n };\n\n const handleMounted = () => {\n console.log('MOUNTED', domRef);\n\n return () => console.log('UNMOUNT');\n };\n const handleUpdated = () => {\n console.log('UPDATE - parentValue');\n\n return () => console.log('UPDATED');\n };\n\n mountCallback(handleMounted);\n updateCallback(handleUpdated, () => [props.parentValue]); // Only Defs Updated (using a closure to update a value)\n\n // Behaves like `react`'s `useEffect`\n effect(\n () => console.log('INJECT'),\n () => console.log('CLEAN_UP'),\n () => [count.v]\n );\n\n // Wrap in a function and return (using a closure to hold the value)\n // This is the \"update\" function.\n return ({ parentValue }) => (\n <Fragment>\n {/* Note that the event is onInput (we use the native event name to avoid confusion). */}\n <div>\n <textarea\n value={text.v}\n onInput={handleInputChane}\n style={{ width: '300px', height: '100px' }}\n />\n </div>\n <div>{text.v}</div>\n <div>\n <div style={{ color: 'blue' }}>\n parentValueFromRef: {props.parentValue} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromFunction: {getParentValue()} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromUpdaterDestructuring: {parentValue} (working)\n </div>\n <div style={{ color: 'red' }}>\n parentValueFromMounterDestructuring: {parentValueFromMount} (not\n working)\n </div>\n </div>\n <div>\n <div ref={domRef}>count: {count.v}</div>\n <div>sum: {count.v + notRefValue + props.parentValue}</div>\n <div>sum(computed): {summ.v}</div>\n {/* It doesn't pull it out from under the reference, it uses the value directly, so you can just use it. */}\n <div>notRefValue: {notRefValue}</div>\n <div>localStore(text): {localStore.text}</div>\n <div>localStore(count): {localStore.count}</div>\n </div>\n <button onClick={increase}>Increase</button>\n <button onClick={localStoreUpdate}>localStoreUpdate</button>\n {children}\n </Fragment>\n );\n }\n);\n\nconst Root = mount(renew => {\n const parentNumber = state<number>(7, renew);\n\n const increaseParent = () => {\n parentNumber.v = parentNumber.v + 1;\n };\n\n const decreaseParent = () => {\n parentNumber.v = parentNumber.v - 1;\n };\n\n return () => (\n <Fragment>\n <ChildComponent parentValue={parentNumber.v}>\n <button onClick={increaseParent}>Increase - Parent</button>\n </ChildComponent>\n <button onClick={decreaseParent}>Decrease - Parent</button>\n </Fragment>\n );\n});\nconst root = <Root />;\n\nrender(root, document.getElementById('root'));\n"],"names":["checkPlainWDomType","wDom","checkPlainType","typeName","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkLoopTypeElement","checkExisty","getKey","target","checkVirtualType","type","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckableElement","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","entries","keys","assign","xmlnsRef","compKeyRef","needDiffRef","componentRef","setComponetRef","compKey","getComponentKey","getComponentSubInfo","subKey","initUpdateHookState","initMountHookState","unmount","effectAction","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","item","subInfo","effect","mountedQueue","execMountedQueue","runMountedQueueFromWDom","addMountedQueue","mountCallback","component","queue","sequence","callback","useUpdated","dependencies","upD","upS","def","checkNeedPushQueue","runUpdatedQueueFromWDom","originalDefs","newDefs","index","getAttrKey","keyName","getEventName","eventKey","_match","p1","DF","CE","t","render","wrapElement","afterElement","Dom","wDomToDom","recursiveRemoveEvent","rootDelete","wDomUpdate","newWDomTree","needRerender","typeAdd","typeDelete","typeReplace","typeUpdate","typeSortedReplace","typeSortedUpdate","removeEvent","childItem","deleteRealDom","findRealParentElement","parent","findChildWithRemoveElement","newElement","getElementFromFragment","parentWDom","parentEl","nextEl","startFindNextBrotherElement","acc","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","el","isFragment","orignalElement","parentElement","oldProps","updateText","props","updateProps$1","originalProps","chkRemoveProp","updateStyle","updateEvent","makeAttrDataValue","setAttr","allowSetAttr","tag","text","children","isVirtualType","wDomChildrenToDom","elementChildren","newEventHandler","oldEventHandler","eventName","style","oldStyle","originalStyle","elementStyle","styleKey","makeNewWDomTree","remakeNewWDom","isSameType","remakeWDom","generalize","param","addReRenderTypeProperty","isNoting","remakeChildrenForDiff","inheritPropForRender","existOriginalWDom","isEmptyElement","isRoot","originalParentWDom","origParentType","key","isKeyCheckedWDom","isSameText","isSameWDom","chkDiffLoopOrder","origChildren","newChildren","newItem","filteredChildren","isSame","updateProps","infoProps","updateChildren","infoChidren","childrenItem","runUpdate","infoVdom","remakeChildrenForUpdate","remakeChildrenForAdd","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","redrawQueue","redrawQueueTimeout","setRedrawAction","exec","execRedrawQueue","componentUpdate","up","recursiveGetChildKeys","childComKey","childItemList","childVd","addedKey","action","updateCallback","runUpdateCallback","updateReqs","_props","h","nodeParentPointer","newProps","remakeChildren","node","makeNode","mount","_children","reRenderCustomComponent","makeWDomResolver","getParent2","componentMaker","customNode","makeCustomNode","newCustomComponentMaker","customNode2","newNode","addComponentProps","makeReRender","reRender","wDomMaker","componetMakeResolver","makeChildrenItem","ref","initValue","C","n","u","c","P","U","f","g","v","r","k","l","s","d","i","a","o","e","ChildComponent","renew","count","state","getParentValue","parentValueFromMount","summ","computed","notRefValue","localStore","store","domRef","increase","handleInputChane","event","localStoreUpdate","handleMounted","handleUpdated","parentValue","Root","parentNumber","increaseParent","decreaseParent","root"],"mappings":"ssBAAA,MAAMA,EAAsBC,GAAS,OAAOA,GAAS,UAAY,EAAE,YAAaA,GAC1EC,EAAiB,CAACD,EAAME,IAAaH,EAAmBC,CAAI,GAAKA,EAAK,OAASE,EAC/EC,GAA2B,CAACC,EAASC,IAAiB,SAAUD,EAAUA,EAAQ,QAAUC,GAAgB,KAAO,OAASA,EAAa,MAAQD,KAAaC,GAAgB,KAAO,OAASA,EAAa,MAC3MC,GAAoB,CAACF,EAASC,IAAiB,CACnD,IAAIE,EAAIC,EACR,OAAOT,EAAmBK,CAAO,IAAMC,GAAgB,KAAO,OAASA,EAAa,QAAU,cAAgBE,EAAKF,GAAgB,KAAO,OAASA,EAAa,WAAa,KAAO,OAASE,EAAG,YAAcC,EAAKJ,GAAW,KAAO,OAASA,EAAQ,WAAa,KAAO,OAASI,EAAG,OACxR,EACMC,GAAsB,CAACL,EAASC,IAAiB,CACrD,IAAIE,EAAIC,EACR,OAAOT,EAAmBK,CAAO,IAAMC,GAAgB,KAAO,OAASA,EAAa,QAAU,YAAcA,GAAgB,KAAO,OAASA,EAAa,OAASD,EAAQ,OAASG,EAAKF,GAAgB,KAAO,OAASA,EAAa,WAAa,KAAO,OAASE,EAAG,YAA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C,IACC,MAAI,CAAA,MAAO,CAAE,MAAO,MAAO,CAAA,EAAG,wCACSc,EAAY,YACpD,EACA7D,EAAC,MAAI,CAAA,MAAO,CAAE,MAAO,KAAM,CAAA,EAAG,wCACUgD,EAAqB,gBAE7D,CACF,EACChD,EAAA,MAAA,KACEA,EAAA,MAAA,CAAI,IAAKsD,GAAQ,UAAQT,EAAM,CAAE,EAClC7C,EAAC,MAAI,KAAA,QAAM6C,EAAM,EAAIM,EAActI,EAAM,WAAY,EACrDmF,EAAC,MAAI,KAAA,kBAAgBiD,EAAK,CAAE,EAE5BjD,EAAC,MAAI,KAAA,gBAAcmD,CAAY,EAC/BnD,EAAC,MAAI,KAAA,qBAAmBoD,EAAW,IAAK,EACvCpD,EAAA,MAAA,KAAI,sBAAoBoD,EAAW,KAAM,CAC5C,EACCpD,EAAA,SAAA,CAAO,QAASuD,GAAU,UAAQ,EAClCvD,EAAA,SAAA,CAAO,QAAS0D,EAAA,EAAkB,kBAAgB,EAClDlI,CACH,CAEJ,CACF,EAEMsI,GAAOxD,GAAesC,GAAA,CACpB,MAAAmB,EAAejB,EAAc,EAAGF,CAAK,EAErCoB,EAAiB,IAAM,CACdD,EAAA,EAAIA,EAAa,EAAI,CAAA,EAG9BE,EAAiB,IAAM,CACdF,EAAA,EAAIA,EAAa,EAAI,CAAA,EAG7B,MAAA,MACJ/P,EACC,KAAAgM,EAAC2C,IAAe,YAAaoB,EAAa,GACvC/D,EAAA,SAAA,CAAO,QAASgE,CAAgB,EAAA,mBAAiB,CACpD,EACAhE,EAAC,UAAO,QAASiE,GAAgB,mBAAiB,CACpD,CAEJ,CAAC,EACKC,KAAQJ,GAAK,IAAA,EAEnB5L,GAAOgM,GAAM,SAAS,eAAe,MAAM,CAAC"}
|
package/examples/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>lithent</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-fec613d6.js"></script>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<section id="root"></section>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const store: <T extends {}>(value: T) => (renew?: () => boolean) => T;
|
|
1
|
+
export declare const store: <T extends {}>(value: T) => (renew?: () => boolean, makeObserver?: ((store: T) => unknown[]) | undefined) => T;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { mountCallback as f, updateCallback as
|
|
2
|
-
const
|
|
3
|
-
let
|
|
1
|
+
import { mountCallback as f, updateCallback as g, nextTick as m, render as x } from "lithent";
|
|
2
|
+
const C = (n, t) => {
|
|
3
|
+
let u = n;
|
|
4
4
|
return {
|
|
5
5
|
get value() {
|
|
6
|
-
return
|
|
6
|
+
return u;
|
|
7
7
|
},
|
|
8
8
|
get v() {
|
|
9
|
-
return
|
|
9
|
+
return u;
|
|
10
10
|
},
|
|
11
|
-
set value(
|
|
12
|
-
|
|
11
|
+
set value(c) {
|
|
12
|
+
u = c, t();
|
|
13
13
|
},
|
|
14
|
-
set v(
|
|
15
|
-
|
|
14
|
+
set v(c) {
|
|
15
|
+
u = c, t();
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
},
|
|
19
|
-
let t =
|
|
18
|
+
}, P = (n) => {
|
|
19
|
+
let t = n;
|
|
20
20
|
return {
|
|
21
21
|
get value() {
|
|
22
22
|
return t();
|
|
@@ -24,54 +24,68 @@ const x = (r, t) => {
|
|
|
24
24
|
get v() {
|
|
25
25
|
return t();
|
|
26
26
|
},
|
|
27
|
-
set value(
|
|
27
|
+
set value(u) {
|
|
28
28
|
throw new Error("You can't change 'computed'");
|
|
29
29
|
},
|
|
30
|
-
set v(
|
|
30
|
+
set v(u) {
|
|
31
31
|
throw new Error("You can't change 'computed'");
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
f(() => (
|
|
37
|
-
},
|
|
34
|
+
}, U = (n, t = () => {
|
|
35
|
+
}, u = () => []) => {
|
|
36
|
+
f(() => (n(), t)), g(() => (t && t(), n), u);
|
|
37
|
+
}, v = /* @__PURE__ */ new Map(), h = {}, r = {}, k = (n) => {
|
|
38
38
|
const t = Symbol();
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
return o.forEach((u) => {
|
|
48
|
-
u() || s.push(u);
|
|
49
|
-
}), s.forEach(
|
|
50
|
-
(u) => o.splice(o.indexOf(u), 1)
|
|
51
|
-
), !0;
|
|
52
|
-
}
|
|
53
|
-
}), U = (r, t) => {
|
|
54
|
-
let e = [], n = null;
|
|
55
|
-
return (o) => {
|
|
56
|
-
const s = r(), u = e.every((i, p) => i === s[p]);
|
|
57
|
-
if (e = s, u && n)
|
|
58
|
-
return n;
|
|
59
|
-
const l = t(o);
|
|
60
|
-
return n = l, l;
|
|
39
|
+
return v.set(t, n), (u, c) => {
|
|
40
|
+
if (u)
|
|
41
|
+
if (c) {
|
|
42
|
+
const l = { value: u }, s = d(t, l);
|
|
43
|
+
return c(s), l.value = null, s;
|
|
44
|
+
} else
|
|
45
|
+
h[t] ?? (h[t] = []), h[t].push(u);
|
|
46
|
+
return d(t);
|
|
61
47
|
};
|
|
62
|
-
},
|
|
63
|
-
|
|
48
|
+
}, d = (n, t) => {
|
|
49
|
+
const u = [];
|
|
50
|
+
return new Proxy(v.get(n), {
|
|
51
|
+
get(c, l) {
|
|
52
|
+
var s;
|
|
53
|
+
return t != null && t.value && (r[n] ?? (r[n] = {}), (s = r[n])[l] ?? (s[l] = []), r[n][l].includes(t.value) || (r[n][l].push(t.value), u.push(l))), u.includes(l) || !t ? c[l] : null;
|
|
54
|
+
},
|
|
55
|
+
set(c, l, s) {
|
|
56
|
+
(u.includes(l) || !t) && (c[l] = s);
|
|
57
|
+
const i = h[n] || [], a = t ? r[n][l] || [] : [], o = [];
|
|
58
|
+
return i.forEach((e) => {
|
|
59
|
+
e() || o.push(e);
|
|
60
|
+
}), a.forEach((e) => {
|
|
61
|
+
e() || o.push(e);
|
|
62
|
+
}), o.forEach((e) => {
|
|
63
|
+
i.splice(i.indexOf(e), 1), a.splice(a.indexOf(e), 1);
|
|
64
|
+
}), !0;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}, D = (n, t) => {
|
|
68
|
+
let u = [], c = null;
|
|
69
|
+
return (l) => {
|
|
70
|
+
const s = n(), i = u.every((o, e) => o === s[e]);
|
|
71
|
+
if (u = s, i && c)
|
|
72
|
+
return c;
|
|
73
|
+
const a = t(l);
|
|
74
|
+
return c = a, a;
|
|
75
|
+
};
|
|
76
|
+
}, S = (n, t, u) => {
|
|
77
|
+
let c = () => {
|
|
64
78
|
};
|
|
65
|
-
return
|
|
66
|
-
|
|
67
|
-
}), () =>
|
|
79
|
+
return m().then(() => {
|
|
80
|
+
c = x(n(), t, u);
|
|
81
|
+
}), () => c();
|
|
68
82
|
};
|
|
69
83
|
export {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
84
|
+
D as cacheUpdate,
|
|
85
|
+
P as computed,
|
|
86
|
+
U as effect,
|
|
87
|
+
S as nextTickRender,
|
|
88
|
+
C as state,
|
|
89
|
+
k as store
|
|
76
90
|
};
|
|
77
91
|
//# sourceMappingURL=lithentHelper.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithentHelper.mjs","sources":["../src/hook/state.ts","../src/hook/computed.ts","../src/hook/effect.ts","../src/hook/store.ts","../src/hook/cacheUpdate.ts","../src/hook/nextTickRender.ts"],"sourcesContent":["export const state = <T>(\n value: T,\n renew: () => boolean\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result;\n },\n get v() {\n return result;\n },\n set value(newValue: T) {\n result = newValue;\n renew();\n },\n set v(newValue: T) {\n result = newValue;\n renew();\n },\n };\n};\n","export const computed = <T>(\n value: () => T\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result();\n },\n get v() {\n return result();\n },\n set value(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n set v(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n };\n};\n","import { updateCallback, mountCallback } from 'lithent';\n\nexport const effect = (\n forward: () => (() => void) | void,\n backward: () => (() => void) | void = () => {},\n dependencies: () => any[] = () => []\n) => {\n mountCallback(() => {\n forward();\n\n return backward;\n });\n\n updateCallback(() => {\n if (backward) {\n backward();\n }\n\n return forward;\n }, dependencies);\n};\n","/**\n * DataStore\n */\nconst storeGroup = new Map<string | symbol, unknown>();\nconst storeRenderList: {\n [key: string | symbol]:
|
|
1
|
+
{"version":3,"file":"lithentHelper.mjs","sources":["../src/hook/state.ts","../src/hook/computed.ts","../src/hook/effect.ts","../src/hook/store.ts","../src/hook/cacheUpdate.ts","../src/hook/nextTickRender.ts"],"sourcesContent":["export const state = <T>(\n value: T,\n renew: () => boolean\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result;\n },\n get v() {\n return result;\n },\n set value(newValue: T) {\n result = newValue;\n renew();\n },\n set v(newValue: T) {\n result = newValue;\n renew();\n },\n };\n};\n","export const computed = <T>(\n value: () => T\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result();\n },\n get v() {\n return result();\n },\n set value(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n set v(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n };\n};\n","import { updateCallback, mountCallback } from 'lithent';\n\nexport const effect = (\n forward: () => (() => void) | void,\n backward: () => (() => void) | void = () => {},\n dependencies: () => any[] = () => []\n) => {\n mountCallback(() => {\n forward();\n\n return backward;\n });\n\n updateCallback(() => {\n if (backward) {\n backward();\n }\n\n return forward;\n }, dependencies);\n};\n","/**\n * DataStore\n */\ntype StoreValue = {\n [key: string | symbol]: (() => boolean)[];\n};\n\nconst storeGroup = new Map<string | symbol, unknown>();\nconst storeRenderList: StoreValue = {};\nconst storeRenderObserveMap: {\n [key: string | symbol]: StoreValue;\n} = {};\n\nexport const store = <T extends {}>(value: T) => {\n const storeKey = Symbol();\n storeGroup.set(storeKey, value);\n\n return (renew?: () => boolean, makeObserver?: (store: T) => unknown[]) => {\n if (renew) {\n if (makeObserver) {\n const renewRef: { value: (() => boolean) | null } = { value: renew };\n const makedProxy = updater<T>(storeKey, renewRef);\n\n makeObserver(makedProxy);\n renewRef.value = null;\n\n return makedProxy;\n } else {\n storeRenderList[storeKey] ??= [];\n storeRenderList[storeKey].push(renew);\n }\n }\n\n return updater<T>(storeKey);\n };\n};\n\nconst updater = <T extends { [key: string | symbol]: unknown }>(\n storeKey: string | symbol,\n renewRef?: { value: (() => boolean) | null }\n) => {\n const allowedAccessProp: (keyof T)[] = [];\n\n return new Proxy(storeGroup.get(storeKey) as T, {\n get(target: T, prop: keyof T) {\n if (renewRef?.value) {\n storeRenderObserveMap[storeKey] ??= {};\n storeRenderObserveMap[storeKey][prop] ??= [];\n\n if (!storeRenderObserveMap[storeKey][prop].includes(renewRef.value)) {\n storeRenderObserveMap[storeKey][prop].push(renewRef.value);\n allowedAccessProp.push(prop);\n }\n }\n\n if (allowedAccessProp.includes(prop) || !renewRef) {\n return target[prop];\n }\n\n return null;\n },\n set(target, prop: keyof T, value) {\n if (allowedAccessProp.includes(prop) || !renewRef) {\n target[prop] = value;\n }\n\n const renderList = storeRenderList[storeKey] || [];\n const renderObserveList: (() => boolean)[] = renewRef\n ? storeRenderObserveMap[storeKey][prop] || []\n : [];\n const trashCollections: (() => boolean)[] = [];\n\n renderList.forEach(renew => {\n if (!renew()) {\n trashCollections.push(renew);\n }\n });\n\n renderObserveList.forEach(renew => {\n if (!renew()) {\n trashCollections.push(renew);\n }\n });\n\n trashCollections.forEach(deleteTarget => {\n renderList.splice(renderList.indexOf(deleteTarget), 1);\n renderObserveList.splice(renderObserveList.indexOf(deleteTarget), 1);\n });\n\n return true;\n },\n });\n};\n","import { WDom, Props } from 'lithent';\n\nexport const cacheUpdate = (\n checkFunction: () => unknown[],\n updater: (props: Props) => WDom\n) => {\n let originalDefs: unknown[] = [];\n let originalUpdater: WDom | null = null;\n\n return (props: Props) => {\n const newDefs = checkFunction();\n const isSame = originalDefs.every((def, index) => def === newDefs[index]);\n\n originalDefs = newDefs;\n\n if (isSame && originalUpdater) {\n return originalUpdater;\n }\n\n const newUpdater = updater(props);\n originalUpdater = newUpdater;\n\n return newUpdater;\n };\n};\n","import { render, WDom, nextTick } from 'lithent';\n\nexport const nextTickRender = (\n wDomMaker: () => WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n let destroy = () => {};\n\n nextTick().then(() => {\n destroy = render(wDomMaker(), wrapElement, afterElement);\n });\n\n return () => destroy();\n};\n"],"names":["state","value","renew","result","newValue","computed","_newValue","effect","forward","backward","dependencies","mountCallback","updateCallback","storeGroup","storeRenderList","storeRenderObserveMap","store","storeKey","makeObserver","renewRef","makedProxy","updater","allowedAccessProp","target","prop","_a","renderList","renderObserveList","trashCollections","deleteTarget","cacheUpdate","checkFunction","originalDefs","originalUpdater","props","newDefs","isSame","def","index","newUpdater","nextTickRender","wDomMaker","wrapElement","afterElement","destroy","nextTick","render"],"mappings":";AAAa,MAAAA,IAAQ,CACnBC,GACAC,MAIG;AACH,MAAIC,IAASF;AAEN,SAAA;AAAA,IACL,IAAI,QAAQ;AACH,aAAAE;AAAA,IACT;AAAA,IACA,IAAI,IAAI;AACC,aAAAA;AAAA,IACT;AAAA,IACA,IAAI,MAAMC,GAAa;AACZ,MAAAD,IAAAC,GACHF;IACR;AAAA,IACA,IAAI,EAAEE,GAAa;AACR,MAAAD,IAAAC,GACHF;IACR;AAAA,EAAA;AAEJ,GCzBaG,IAAW,CACtB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,GACAC,GACAC,MACG;AACH,MAAIC,IAAU,MAAM;AAAA,EAAA;AAEX,SAAAC,EAAA,EAAE,KAAK,MAAM;AACpB,IAAAD,IAAUE,EAAOL,EAAa,GAAAC,GAAaC,CAAY;AAAA,EAAA,CACxD,GAEM,MAAMC,EAAQ;AACvB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(l,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("lithent")):typeof define=="function"&&define.amd?define(["exports","lithent"],a):(l=typeof globalThis<"u"?globalThis:l||self,a(l.lithentHelper={},l.lithent))})(this,function(l,a){"use strict";const m=(n,t)=>{let e=n;return{get value(){return e},get v(){return e},set value(u){e=u,t()},set v(u){e=u,t()}}},E=n=>{let t=n;return{get value(){return t()},get v(){return t()},set value(e){throw new Error("You can't change 'computed'")},set v(e){throw new Error("You can't change 'computed'")}}},T=(n,t=()=>{},e=()=>[])=>{a.mountCallback(()=>(n(),t)),a.updateCallback(()=>(t&&t(),n),e)},v=new Map,d={},r={},x=n=>{const t=Symbol();return v.set(t,n),(e,u)=>{if(e)if(u){const c={value:e},i=g(t,c);return u(i),c.value=null,i}else d[t]??(d[t]=[]),d[t].push(e);return g(t)}},g=(n,t)=>{const e=[];return new Proxy(v.get(n),{get(u,c){var i;return t!=null&&t.value&&(r[n]??(r[n]={}),(i=r[n])[c]??(i[c]=[]),r[n][c].includes(t.value)||(r[n][c].push(t.value),e.push(c))),e.includes(c)||!t?u[c]:null},set(u,c,i){(e.includes(c)||!t)&&(u[c]=i);const f=d[n]||[],o=t?r[n][c]||[]:[],h=[];return f.forEach(s=>{s()||h.push(s)}),o.forEach(s=>{s()||h.push(s)}),h.forEach(s=>{f.splice(f.indexOf(s),1),o.splice(o.indexOf(s),1)}),!0}})},P=(n,t)=>{let e=[],u=null;return c=>{const i=n(),f=e.every((h,s)=>h===i[s]);if(e=i,f&&u)return u;const o=t(c);return u=o,o}},S=(n,t,e)=>{let u=()=>{};return a.nextTick().then(()=>{u=a.render(n(),t,e)}),()=>u()};l.cacheUpdate=P,l.computed=E,l.effect=T,l.nextTickRender=S,l.state=m,l.store=x,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=lithentHelper.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithentHelper.umd.js","sources":["../src/hook/state.ts","../src/hook/computed.ts","../src/hook/effect.ts","../src/hook/store.ts","../src/hook/cacheUpdate.ts","../src/hook/nextTickRender.ts"],"sourcesContent":["export const state = <T>(\n value: T,\n renew: () => boolean\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result;\n },\n get v() {\n return result;\n },\n set value(newValue: T) {\n result = newValue;\n renew();\n },\n set v(newValue: T) {\n result = newValue;\n renew();\n },\n };\n};\n","export const computed = <T>(\n value: () => T\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result();\n },\n get v() {\n return result();\n },\n set value(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n set v(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n };\n};\n","import { updateCallback, mountCallback } from 'lithent';\n\nexport const effect = (\n forward: () => (() => void) | void,\n backward: () => (() => void) | void = () => {},\n dependencies: () => any[] = () => []\n) => {\n mountCallback(() => {\n forward();\n\n return backward;\n });\n\n updateCallback(() => {\n if (backward) {\n backward();\n }\n\n return forward;\n }, dependencies);\n};\n","/**\n * DataStore\n */\nconst storeGroup = new Map<string | symbol, unknown>();\nconst storeRenderList: {\n [key: string | symbol]:
|
|
1
|
+
{"version":3,"file":"lithentHelper.umd.js","sources":["../src/hook/state.ts","../src/hook/computed.ts","../src/hook/effect.ts","../src/hook/store.ts","../src/hook/cacheUpdate.ts","../src/hook/nextTickRender.ts"],"sourcesContent":["export const state = <T>(\n value: T,\n renew: () => boolean\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result;\n },\n get v() {\n return result;\n },\n set value(newValue: T) {\n result = newValue;\n renew();\n },\n set v(newValue: T) {\n result = newValue;\n renew();\n },\n };\n};\n","export const computed = <T>(\n value: () => T\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result();\n },\n get v() {\n return result();\n },\n set value(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n set v(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n };\n};\n","import { updateCallback, mountCallback } from 'lithent';\n\nexport const effect = (\n forward: () => (() => void) | void,\n backward: () => (() => void) | void = () => {},\n dependencies: () => any[] = () => []\n) => {\n mountCallback(() => {\n forward();\n\n return backward;\n });\n\n updateCallback(() => {\n if (backward) {\n backward();\n }\n\n return forward;\n }, dependencies);\n};\n","/**\n * DataStore\n */\ntype StoreValue = {\n [key: string | symbol]: (() => boolean)[];\n};\n\nconst storeGroup = new Map<string | symbol, unknown>();\nconst storeRenderList: StoreValue = {};\nconst storeRenderObserveMap: {\n [key: string | symbol]: StoreValue;\n} = {};\n\nexport const store = <T extends {}>(value: T) => {\n const storeKey = Symbol();\n storeGroup.set(storeKey, value);\n\n return (renew?: () => boolean, makeObserver?: (store: T) => unknown[]) => {\n if (renew) {\n if (makeObserver) {\n const renewRef: { value: (() => boolean) | null } = { value: renew };\n const makedProxy = updater<T>(storeKey, renewRef);\n\n makeObserver(makedProxy);\n renewRef.value = null;\n\n return makedProxy;\n } else {\n storeRenderList[storeKey] ??= [];\n storeRenderList[storeKey].push(renew);\n }\n }\n\n return updater<T>(storeKey);\n };\n};\n\nconst updater = <T extends { [key: string | symbol]: unknown }>(\n storeKey: string | symbol,\n renewRef?: { value: (() => boolean) | null }\n) => {\n const allowedAccessProp: (keyof T)[] = [];\n\n return new Proxy(storeGroup.get(storeKey) as T, {\n get(target: T, prop: keyof T) {\n if (renewRef?.value) {\n storeRenderObserveMap[storeKey] ??= {};\n storeRenderObserveMap[storeKey][prop] ??= [];\n\n if (!storeRenderObserveMap[storeKey][prop].includes(renewRef.value)) {\n storeRenderObserveMap[storeKey][prop].push(renewRef.value);\n allowedAccessProp.push(prop);\n }\n }\n\n if (allowedAccessProp.includes(prop) || !renewRef) {\n return target[prop];\n }\n\n return null;\n },\n set(target, prop: keyof T, value) {\n if (allowedAccessProp.includes(prop) || !renewRef) {\n target[prop] = value;\n }\n\n const renderList = storeRenderList[storeKey] || [];\n const renderObserveList: (() => boolean)[] = renewRef\n ? storeRenderObserveMap[storeKey][prop] || []\n : [];\n const trashCollections: (() => boolean)[] = [];\n\n renderList.forEach(renew => {\n if (!renew()) {\n trashCollections.push(renew);\n }\n });\n\n renderObserveList.forEach(renew => {\n if (!renew()) {\n trashCollections.push(renew);\n }\n });\n\n trashCollections.forEach(deleteTarget => {\n renderList.splice(renderList.indexOf(deleteTarget), 1);\n renderObserveList.splice(renderObserveList.indexOf(deleteTarget), 1);\n });\n\n return true;\n },\n });\n};\n","import { WDom, Props } from 'lithent';\n\nexport const cacheUpdate = (\n checkFunction: () => unknown[],\n updater: (props: Props) => WDom\n) => {\n let originalDefs: unknown[] = [];\n let originalUpdater: WDom | null = null;\n\n return (props: Props) => {\n const newDefs = checkFunction();\n const isSame = originalDefs.every((def, index) => def === newDefs[index]);\n\n originalDefs = newDefs;\n\n if (isSame && originalUpdater) {\n return originalUpdater;\n }\n\n const newUpdater = updater(props);\n originalUpdater = newUpdater;\n\n return newUpdater;\n };\n};\n","import { render, WDom, nextTick } from 'lithent';\n\nexport const nextTickRender = (\n wDomMaker: () => WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n let destroy = () => {};\n\n nextTick().then(() => {\n destroy = render(wDomMaker(), wrapElement, afterElement);\n });\n\n return () => destroy();\n};\n"],"names":["state","value","renew","result","newValue","computed","_newValue","effect","forward","backward","dependencies","mountCallback","updateCallback","storeGroup","storeRenderList","storeRenderObserveMap","store","storeKey","makeObserver","renewRef","makedProxy","updater","allowedAccessProp","target","prop","_a","renderList","renderObserveList","trashCollections","deleteTarget","cacheUpdate","checkFunction","originalDefs","originalUpdater","props","newDefs","isSame","def","index","newUpdater","nextTickRender","wDomMaker","wrapElement","afterElement","destroy","nextTick","render"],"mappings":"8QAAa,MAAAA,EAAQ,CACnBC,EACAC,IAIG,CACH,IAAIC,EAASF,EAEN,MAAA,CACL,IAAI,OAAQ,CACH,OAAAE,CACT,EACA,IAAI,GAAI,CACC,OAAAA,CACT,EACA,IAAI,MAAMC,EAAa,CACZD,EAAAC,EACHF,GACR,EACA,IAAI,EAAEE,EAAa,CACRD,EAAAC,EACHF,GACR,CAAA,CAEJ,ECzBaG,EACXJ,GAIG,CACH,IAAIE,EAASF,EAEN,MAAA,CACL,IAAI,OAAQ,CACV,OAAOE,EAAO,CAChB,EACA,IAAI,GAAI,CACN,OAAOA,EAAO,CAChB,EACA,IAAI,MAAMG,EAAc,CAChB,MAAA,IAAI,MAAM,6BAA6B,CAC/C,EACA,IAAI,EAAEA,EAAc,CACZ,MAAA,IAAI,MAAM,6BAA6B,CAC/C,CAAA,CAEJ,ECpBaC,EAAS,CACpBC,EACAC,EAAsC,IAAM,CAAC,EAC7CC,EAA4B,IAAM,KAC/B,CACHC,EAAAA,cAAc,KACJH,IAEDC,EACR,EAEDG,EAAAA,eAAe,KACTH,GACOA,IAGJD,GACNE,CAAY,CACjB,ECbMG,MAAiB,IACjBC,EAA8B,CAAA,EAC9BC,EAEF,CAAA,EAESC,EAAuBf,GAAa,CAC/C,MAAMgB,EAAW,SACN,OAAAJ,EAAA,IAAII,EAAUhB,CAAK,EAEvB,CAACC,EAAuBgB,IAA2C,CACxE,GAAIhB,EACF,GAAIgB,EAAc,CACV,MAAAC,EAA8C,CAAE,MAAOjB,GACvDkB,EAAaC,EAAWJ,EAAUE,CAAQ,EAEhD,OAAAD,EAAaE,CAAU,EACvBD,EAAS,MAAQ,KAEVC,CAAA,MAESN,EAAAG,KAAAH,EAAAG,GAAc,IACdH,EAAAG,CAAQ,EAAE,KAAKf,CAAK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EAAUJ,IACVK,EAASJ,EAAa,MAAM,CAACK,EAAKC,IAAUD,IAAQF,EAAQG,CAAK,CAAC,EAIxE,GAFeN,EAAAG,EAEXC,GAAUH,EACL,OAAAA,EAGH,MAAAM,EAAalB,EAAQa,CAAK,EACd,OAAAD,EAAAM,EAEXA,CAAA,CAEX,ECtBaC,EAAiB,CAC5BC,EACAC,EACAC,IACG,CACH,IAAIC,EAAU,IAAM,CAAA,EAEXC,OAAAA,EAAA,SAAA,EAAE,KAAK,IAAM,CACpBD,EAAUE,EAAAA,OAAOL,EAAa,EAAAC,EAAaC,CAAY,CAAA,CACxD,EAEM,IAAMC,EAAQ,CACvB"}
|
package/helper/src/hook/store.ts
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DataStore
|
|
3
3
|
*/
|
|
4
|
-
|
|
5
|
-
const storeRenderList: {
|
|
4
|
+
type StoreValue = {
|
|
6
5
|
[key: string | symbol]: (() => boolean)[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const storeGroup = new Map<string | symbol, unknown>();
|
|
9
|
+
const storeRenderList: StoreValue = {};
|
|
10
|
+
const storeRenderObserveMap: {
|
|
11
|
+
[key: string | symbol]: StoreValue;
|
|
7
12
|
} = {};
|
|
8
13
|
|
|
9
14
|
export const store = <T extends {}>(value: T) => {
|
|
10
15
|
const storeKey = Symbol();
|
|
11
16
|
storeGroup.set(storeKey, value);
|
|
12
17
|
|
|
13
|
-
return (renew?: () => boolean) => {
|
|
18
|
+
return (renew?: () => boolean, makeObserver?: (store: T) => unknown[]) => {
|
|
14
19
|
if (renew) {
|
|
15
|
-
|
|
16
|
-
|
|
20
|
+
if (makeObserver) {
|
|
21
|
+
const renewRef: { value: (() => boolean) | null } = { value: renew };
|
|
22
|
+
const makedProxy = updater<T>(storeKey, renewRef);
|
|
23
|
+
|
|
24
|
+
makeObserver(makedProxy);
|
|
25
|
+
renewRef.value = null;
|
|
26
|
+
|
|
27
|
+
return makedProxy;
|
|
28
|
+
} else {
|
|
29
|
+
storeRenderList[storeKey] ??= [];
|
|
30
|
+
storeRenderList[storeKey].push(renew);
|
|
31
|
+
}
|
|
17
32
|
}
|
|
18
33
|
|
|
19
34
|
return updater<T>(storeKey);
|
|
@@ -21,15 +36,38 @@ export const store = <T extends {}>(value: T) => {
|
|
|
21
36
|
};
|
|
22
37
|
|
|
23
38
|
const updater = <T extends { [key: string | symbol]: unknown }>(
|
|
24
|
-
storeKey: string | symbol
|
|
25
|
-
) =>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
storeKey: string | symbol,
|
|
40
|
+
renewRef?: { value: (() => boolean) | null }
|
|
41
|
+
) => {
|
|
42
|
+
const allowedAccessProp: (keyof T)[] = [];
|
|
43
|
+
|
|
44
|
+
return new Proxy(storeGroup.get(storeKey) as T, {
|
|
45
|
+
get(target: T, prop: keyof T) {
|
|
46
|
+
if (renewRef?.value) {
|
|
47
|
+
storeRenderObserveMap[storeKey] ??= {};
|
|
48
|
+
storeRenderObserveMap[storeKey][prop] ??= [];
|
|
49
|
+
|
|
50
|
+
if (!storeRenderObserveMap[storeKey][prop].includes(renewRef.value)) {
|
|
51
|
+
storeRenderObserveMap[storeKey][prop].push(renewRef.value);
|
|
52
|
+
allowedAccessProp.push(prop);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (allowedAccessProp.includes(prop) || !renewRef) {
|
|
57
|
+
return target[prop];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return null;
|
|
29
61
|
},
|
|
30
62
|
set(target, prop: keyof T, value) {
|
|
31
|
-
|
|
32
|
-
|
|
63
|
+
if (allowedAccessProp.includes(prop) || !renewRef) {
|
|
64
|
+
target[prop] = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const renderList = storeRenderList[storeKey] || [];
|
|
68
|
+
const renderObserveList: (() => boolean)[] = renewRef
|
|
69
|
+
? storeRenderObserveMap[storeKey][prop] || []
|
|
70
|
+
: [];
|
|
33
71
|
const trashCollections: (() => boolean)[] = [];
|
|
34
72
|
|
|
35
73
|
renderList.forEach(renew => {
|
|
@@ -38,10 +76,18 @@ const updater = <T extends { [key: string | symbol]: unknown }>(
|
|
|
38
76
|
}
|
|
39
77
|
});
|
|
40
78
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
79
|
+
renderObserveList.forEach(renew => {
|
|
80
|
+
if (!renew()) {
|
|
81
|
+
trashCollections.push(renew);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
trashCollections.forEach(deleteTarget => {
|
|
86
|
+
renderList.splice(renderList.indexOf(deleteTarget), 1);
|
|
87
|
+
renderObserveList.splice(renderObserveList.indexOf(deleteTarget), 1);
|
|
88
|
+
});
|
|
44
89
|
|
|
45
90
|
return true;
|
|
46
91
|
},
|
|
47
92
|
});
|
|
93
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lithent",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "An extensible virtual DOM library for lightweight use in a variety of environments.",
|
|
5
5
|
"packageManager": "pnpm@7.6.0",
|
|
6
6
|
"main": "./dist/lithent.umd.js",
|
|
@@ -68,15 +68,10 @@
|
|
|
68
68
|
"lithent"
|
|
69
69
|
],
|
|
70
70
|
"devDependencies": {
|
|
71
|
-
"@babel/cli": "^7.18.9",
|
|
72
|
-
"@babel/core": "^7.18.9",
|
|
73
|
-
"@babel/plugin-transform-react-jsx": "^7.18.6",
|
|
74
|
-
"@babel/preset-typescript": "^7.18.6",
|
|
75
71
|
"@nabla/vite-plugin-eslint": "^1.4.1",
|
|
76
72
|
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
77
73
|
"@typescript-eslint/parser": "^5.30.7",
|
|
78
74
|
"@vitest/coverage-v8": "^0.32.2",
|
|
79
|
-
"babel-plugin-module-resolver": "^4.1.0",
|
|
80
75
|
"eslint": "^7.32.0",
|
|
81
76
|
"eslint-config-prettier": "^8.3.0",
|
|
82
77
|
"eslint-plugin-prettier": "^4.0.0",
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
export { h, Fragment, mount } from '@/wDom';
|
|
2
|
+
export { render } from '@/render';
|
|
3
|
+
export { mountCallback } from '@/hook/mountCallback';
|
|
4
|
+
export { updateCallback } from '@/hook/updateCallback';
|
|
5
|
+
export { ref, nextTick } from '@/hook/ref';
|
|
6
6
|
|
|
7
7
|
export type {
|
|
8
8
|
WDom,
|
|
@@ -26,14 +26,3 @@ declare global {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
h,
|
|
32
|
-
Fragment,
|
|
33
|
-
render,
|
|
34
|
-
mount,
|
|
35
|
-
mountCallback,
|
|
36
|
-
updateCallback,
|
|
37
|
-
ref,
|
|
38
|
-
nextTick,
|
|
39
|
-
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { h, render, mount, Fragment, ref, nextTick } from '@/index';
|
|
2
|
+
|
|
3
|
+
type StoreValue = {
|
|
4
|
+
[key: string | symbol]: (() => boolean)[];
|
|
5
|
+
};
|
|
6
|
+
|
|
7
|
+
const testChangeRef1 = ref<null | (() => void)>(null);
|
|
8
|
+
const testChangeRef2 = ref<null | (() => void)>(null);
|
|
9
|
+
const testChangeRef3 = ref<null | (() => void)>(null);
|
|
10
|
+
|
|
11
|
+
const storeGroup = new Map<string | symbol, unknown>();
|
|
12
|
+
|
|
13
|
+
const storeRenderList: StoreValue = {};
|
|
14
|
+
|
|
15
|
+
const storeRenderObserveMap: {
|
|
16
|
+
[key: string | symbol]: StoreValue;
|
|
17
|
+
} = {};
|
|
18
|
+
|
|
19
|
+
export const store = <T extends {}>(value: T) => {
|
|
20
|
+
const storeKey = Symbol();
|
|
21
|
+
storeGroup.set(storeKey, value);
|
|
22
|
+
|
|
23
|
+
return (renew?: () => boolean, makeObserver?: (store: T) => unknown[]) => {
|
|
24
|
+
if (renew) {
|
|
25
|
+
if (makeObserver) {
|
|
26
|
+
const renewRef: { value: (() => boolean) | null } = { value: renew };
|
|
27
|
+
const makedProxy = updater<T>(storeKey, renewRef);
|
|
28
|
+
|
|
29
|
+
makeObserver(makedProxy);
|
|
30
|
+
renewRef.value = null;
|
|
31
|
+
|
|
32
|
+
return makedProxy;
|
|
33
|
+
} else {
|
|
34
|
+
storeRenderList[storeKey] ??= [];
|
|
35
|
+
storeRenderList[storeKey].push(renew);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return updater<T>(storeKey);
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const updater = <T extends { [key: string | symbol]: unknown }>(
|
|
44
|
+
storeKey: string | symbol,
|
|
45
|
+
renewRef?: { value: (() => boolean) | null }
|
|
46
|
+
) => {
|
|
47
|
+
const allowedAccessProp: (keyof T)[] = [];
|
|
48
|
+
|
|
49
|
+
return new Proxy(storeGroup.get(storeKey) as T, {
|
|
50
|
+
get(target: T, prop: keyof T) {
|
|
51
|
+
if (renewRef?.value) {
|
|
52
|
+
storeRenderObserveMap[storeKey] ??= {};
|
|
53
|
+
storeRenderObserveMap[storeKey][prop] ??= [];
|
|
54
|
+
|
|
55
|
+
if (!storeRenderObserveMap[storeKey][prop].includes(renewRef.value)) {
|
|
56
|
+
storeRenderObserveMap[storeKey][prop].push(renewRef.value);
|
|
57
|
+
allowedAccessProp.push(prop);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (allowedAccessProp.includes(prop) || !renewRef) {
|
|
62
|
+
return target[prop];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return null;
|
|
66
|
+
},
|
|
67
|
+
set(target, prop: keyof T, value) {
|
|
68
|
+
if (allowedAccessProp.includes(prop) || !renewRef) {
|
|
69
|
+
target[prop] = value;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const renderList = storeRenderList[storeKey] || [];
|
|
73
|
+
const renderObserveList: (() => boolean)[] = renewRef
|
|
74
|
+
? storeRenderObserveMap[storeKey][prop] || []
|
|
75
|
+
: [];
|
|
76
|
+
const trashCollections: (() => boolean)[] = [];
|
|
77
|
+
|
|
78
|
+
renderList.forEach(renew => {
|
|
79
|
+
if (!renew()) {
|
|
80
|
+
trashCollections.push(renew);
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
renderObserveList.forEach(renew => {
|
|
85
|
+
if (!renew()) {
|
|
86
|
+
trashCollections.push(renew);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
trashCollections.forEach(deleteTarget => {
|
|
91
|
+
renderList.splice(renderList.indexOf(deleteTarget), 1);
|
|
92
|
+
renderObserveList.splice(renderObserveList.indexOf(deleteTarget), 1);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
return true;
|
|
96
|
+
},
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const assignShardStore = store<{
|
|
101
|
+
count1: number;
|
|
102
|
+
count2: number;
|
|
103
|
+
count3: number;
|
|
104
|
+
}>({
|
|
105
|
+
count1: 0,
|
|
106
|
+
count2: 0,
|
|
107
|
+
count3: 0,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const Component = mount(renew => {
|
|
111
|
+
const shardStore = assignShardStore(renew, store => [
|
|
112
|
+
store.count1,
|
|
113
|
+
store.count3,
|
|
114
|
+
]);
|
|
115
|
+
|
|
116
|
+
const changeCount1 = () => {
|
|
117
|
+
shardStore.count1 += 1;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const changeCount2 = () => {
|
|
121
|
+
shardStore.count2 += 1;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const changeCount3 = () => {
|
|
125
|
+
shardStore.count3 += 1;
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
testChangeRef1.value = changeCount1;
|
|
129
|
+
testChangeRef2.value = changeCount2;
|
|
130
|
+
testChangeRef3.value = changeCount3;
|
|
131
|
+
|
|
132
|
+
return () => (
|
|
133
|
+
<Fragment>
|
|
134
|
+
<button type="button" onClick={changeCount1}>
|
|
135
|
+
count1: {shardStore.count1}
|
|
136
|
+
</button>
|
|
137
|
+
<button type="button" onClick={changeCount2}>
|
|
138
|
+
count2: {shardStore.count2}
|
|
139
|
+
</button>
|
|
140
|
+
<button type="button" onClick={changeCount3}>
|
|
141
|
+
count3: {shardStore.count3}
|
|
142
|
+
</button>
|
|
143
|
+
</Fragment>
|
|
144
|
+
);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
document.body.innerHTML = `<div id="root"><span>1</span><span>2</span><span>3</span></div>`;
|
|
148
|
+
const testbad = document.createElement('div');
|
|
149
|
+
testbad.id = 'root';
|
|
150
|
+
|
|
151
|
+
testbad.innerHTML = '<span>1</span><span>2</span><span>3</span>';
|
|
152
|
+
|
|
153
|
+
const testWrap =
|
|
154
|
+
(document.getElementById('root') as HTMLElement) ||
|
|
155
|
+
document.createElement('div');
|
|
156
|
+
|
|
157
|
+
render(
|
|
158
|
+
<Component />,
|
|
159
|
+
testWrap,
|
|
160
|
+
testWrap.querySelector('span:nth-of-type(2)') as HTMLElement
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
render(
|
|
164
|
+
<Component />,
|
|
165
|
+
testWrap,
|
|
166
|
+
testWrap.querySelector('span:nth-of-type(3)') as HTMLElement
|
|
167
|
+
);
|
|
168
|
+
|
|
169
|
+
if (import.meta.vitest) {
|
|
170
|
+
const { it, expect } = import.meta.vitest;
|
|
171
|
+
|
|
172
|
+
it('If the observer function is specified when assigning from helper/store, only the specified value can be retrieved.', () => {
|
|
173
|
+
expect(testWrap.outerHTML).toBe(
|
|
174
|
+
'<div id="root"><span>1</span><button type="button">count1: 0</button><button type="button">count2: </button><button type="button">count3: 0</button><span>2</span><button type="button">count1: 0</button><button type="button">count2: </button><button type="button">count3: 0</button><span>3</span></div>'
|
|
175
|
+
);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
it('If you define an observer function to get a value from store, you must also restrict updates to the value.', () => {
|
|
179
|
+
if (testChangeRef1.value && testChangeRef2.value && testChangeRef3.value) {
|
|
180
|
+
testChangeRef1.value();
|
|
181
|
+
testChangeRef2.value();
|
|
182
|
+
testChangeRef3.value();
|
|
183
|
+
}
|
|
184
|
+
nextTick().then(() => {
|
|
185
|
+
expect(testWrap.outerHTML).toBe(
|
|
186
|
+
'<div id="root"><span>1</span><button type="button">count1: 1</button><button type="button">count2: </button><button type="button">count3: 1</button><span>2</span><button type="button">count1: 1</button><button type="button">count2: </button><button type="button">count3: 1</button><span>3</span></div>'
|
|
187
|
+
);
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
}
|
package/src/tests/test2.tsx
CHANGED
|
@@ -1,33 +1,73 @@
|
|
|
1
1
|
import { h, render, mount, ref, nextTick } from '@/index';
|
|
2
2
|
const testChangeRef = ref<null | (() => void)>(null);
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
const storeRenderList: {
|
|
4
|
+
type StoreValue = {
|
|
6
5
|
[key: string | symbol]: (() => boolean)[];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
const storeGroup = new Map<string | symbol, unknown>();
|
|
9
|
+
const storeRenderList: StoreValue = {};
|
|
10
|
+
const storeRenderObserveMap: {
|
|
11
|
+
[key: string | symbol]: StoreValue;
|
|
7
12
|
} = {};
|
|
8
13
|
|
|
9
14
|
export const store = <T extends {}>(value: T) => {
|
|
10
15
|
const storeKey = Symbol();
|
|
11
16
|
storeGroup.set(storeKey, value);
|
|
12
17
|
|
|
13
|
-
return (renew
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
return (renew?: () => boolean, makeObserver?: (store: T) => unknown[]) => {
|
|
19
|
+
if (renew) {
|
|
20
|
+
if (makeObserver) {
|
|
21
|
+
const renewRef: { value: (() => boolean) | null } = { value: renew };
|
|
22
|
+
const makedProxy = updater<T>(storeKey, renewRef);
|
|
23
|
+
|
|
24
|
+
makeObserver(makedProxy);
|
|
25
|
+
renewRef.value = null;
|
|
26
|
+
|
|
27
|
+
return makedProxy;
|
|
28
|
+
} else {
|
|
29
|
+
storeRenderList[storeKey] ??= [];
|
|
30
|
+
storeRenderList[storeKey].push(renew);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
16
33
|
|
|
17
34
|
return updater<T>(storeKey);
|
|
18
35
|
};
|
|
19
36
|
};
|
|
20
37
|
|
|
21
38
|
const updater = <T extends { [key: string | symbol]: unknown }>(
|
|
22
|
-
storeKey: string | symbol
|
|
23
|
-
) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
39
|
+
storeKey: string | symbol,
|
|
40
|
+
renewRef?: { value: (() => boolean) | null }
|
|
41
|
+
) => {
|
|
42
|
+
const allowedAccessProp: (keyof T)[] = [];
|
|
43
|
+
|
|
44
|
+
return new Proxy(storeGroup.get(storeKey) as T, {
|
|
45
|
+
get(target: T, prop: keyof T) {
|
|
46
|
+
if (renewRef?.value) {
|
|
47
|
+
storeRenderObserveMap[storeKey] ??= {};
|
|
48
|
+
storeRenderObserveMap[storeKey][prop] ??= [];
|
|
49
|
+
|
|
50
|
+
if (!storeRenderObserveMap[storeKey][prop].includes(renewRef.value)) {
|
|
51
|
+
storeRenderObserveMap[storeKey][prop].push(renewRef.value);
|
|
52
|
+
allowedAccessProp.push(prop);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (allowedAccessProp.includes(prop) || !renewRef) {
|
|
57
|
+
return target[prop];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return null;
|
|
27
61
|
},
|
|
28
62
|
set(target, prop: keyof T, value) {
|
|
29
|
-
|
|
30
|
-
|
|
63
|
+
if (allowedAccessProp.includes(prop) || !renewRef) {
|
|
64
|
+
target[prop] = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const renderList = storeRenderList[storeKey] || [];
|
|
68
|
+
const renderObserveList: (() => boolean)[] = renewRef
|
|
69
|
+
? storeRenderObserveMap[storeKey][prop] || []
|
|
70
|
+
: [];
|
|
31
71
|
const trashCollections: (() => boolean)[] = [];
|
|
32
72
|
|
|
33
73
|
renderList.forEach(renew => {
|
|
@@ -36,13 +76,21 @@ const updater = <T extends { [key: string | symbol]: unknown }>(
|
|
|
36
76
|
}
|
|
37
77
|
});
|
|
38
78
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
79
|
+
renderObserveList.forEach(renew => {
|
|
80
|
+
if (!renew()) {
|
|
81
|
+
trashCollections.push(renew);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
trashCollections.forEach(deleteTarget => {
|
|
86
|
+
renderList.splice(renderList.indexOf(deleteTarget), 1);
|
|
87
|
+
renderObserveList.splice(renderObserveList.indexOf(deleteTarget), 1);
|
|
88
|
+
});
|
|
42
89
|
|
|
43
90
|
return true;
|
|
44
91
|
},
|
|
45
92
|
});
|
|
93
|
+
};
|
|
46
94
|
|
|
47
95
|
const assignShardStore = store<{ text: string; count: number }>({
|
|
48
96
|
text: 'sharedText',
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))o(c);new MutationObserver(c=>{for(const r of c)if(r.type==="childList")for(const l of r.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(c){const r={};return c.integrity&&(r.integrity=c.integrity),c.referrerPolicy&&(r.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?r.credentials="include":c.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function o(c){if(c.ep)return;c.ep=!0;const r=n(c);fetch(c.href,r)}})();const k=e=>typeof e=="object"&&!("resolve"in e),N=(e,t)=>k(e)&&e.type===t,xe=(e,t)=>"ctor"in e?e.ctor===(t==null?void 0:t.ctor):e===(t==null?void 0:t.ctor),Se=(e,t)=>{var n,o;return k(e)&&(t==null?void 0:t.type)==="fragment"&&((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)},Ne=(e,t)=>{var n,o;return k(e)&&(t==null?void 0:t.type)==="element"&&(t==null?void 0:t.tag)===e.tag&&((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)},X=(e,t)=>k(e)&&(t==null?void 0:t.type)===e.type,be=(e,t)=>{var n,o;return k(e)&&(t==null?void 0:t.type)===e.type&&(R(a((e.children||[])[0]))&&R(a((t.children||[])[0]))||((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length))},a=e=>{var t,n;return((t=e==null?void 0:e.compProps)==null?void 0:t.key)??((n=e==null?void 0:e.props)==null?void 0:n.key)},C=e=>e&&["fragment","loop"].includes(e),U=e=>typeof e=="function"&&!K(e)||typeof e=="object"&&"resolve"in e,K=e=>typeof e=="function"&&e===S,w=e=>k(e)&&!e.type,R=e=>e!=null,$=(e,t)=>e==="style"&&typeof t=="object",Te=(e,t)=>e==="ref"&&typeof t=="object",Ue=e=>e.nodeType===1&&e.tagName==="OPTION",me=e=>e.nodeType===1&&e.tagName==="TEXTAREA",Fe=e=>e.nodeType===1&&["radio","checkbox"].includes(e.type),_e=e=>{let t="et";return U(e)?t="c":N(e,"fragment")?t="f":N(e,"element")?t="e":N(e,"loop")?t="l":N(e,"text")?t="t":w(e)&&(t="et"),t},Oe={c:xe,l:be,t:X,e:Ne,f:Se,et:X},h=e=>e.getParent&&e.getParent(),g=Object.entries,D=Object.keys,m=Object.assign,E={value:""},P={value:{}},I={value:!1},f=new WeakMap,Ae=e=>{f.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},x=()=>P.value,W=(e,t)=>f.get(e)[t],Le=e=>P.value=e,Me=e=>{P.value=e,Ae(e)},Ie=e=>{f.get(x()).umts.push(e)},F=e=>{const{compKey:t}=e;t&&Qe(t),ee(e)},ee=e=>{(e.children||[]).forEach(t=>{t.compKey?F(t):ee(t)})},Qe=e=>{const t=f.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],f.delete(e))};let Q=[];const Y=()=>{Q.forEach(e=>Be(e)),Q=[]},qe=e=>{e.compKey&&Q.push(e)},te=e=>f.get(x()).mts.push(e),Be=e=>{const{compKey:t}=e;if(t){const n=f.get(t),o=n==null?void 0:n.mts,c=n==null?void 0:n.upS;P.value=t,c&&(c.value=0),o&&(n.mts=[],o.forEach(r=>{const l=r();l&&Ie(l)}))}},H=(e,t=()=>[])=>{const n=f.get(x()),{upD:o,upS:c}=n,r=o[c.value];if(r&&je(r,t())){const l=e();l&&n.upCB.push(l)}o[c.value]=t(),c.value+=1},Ve=e=>{const{compKey:t}=e;if(t){const n=f.get(t),o=n==null?void 0:n.upCB,c=n==null?void 0:n.upS;P.value=t,c&&(c.value=0),e.ctor&&o&&(n.upCB=[],o.forEach(r=>r()))}},je=(e,t)=>e.length?e.some((n,o)=>n!==t[o]):!0,Ye=e=>e==="className"?"class":e,ne=e=>e.replace(/^on(.*)/,(t,n)=>n.toLowerCase()),z=()=>new DocumentFragment,Z=e=>document.createElement(e),ze=(e,t,n)=>{t??(t=document.body),e.isRoot=!0,e.wrapElement=t;const o=O(e);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),Y(),()=>{var c;const r=(c=f.get(e.compProps||{}))==null?void 0:c.vd.value;r&&(F(r),_(r),Ge(r))}},oe=e=>{const{needRerender:t}=e;t&&t!=="N"&&({A:J,D:G,R:Xe,U:B,CNSU:B,SR:le,SU:Je}[t](e),delete e.needRerender,delete e.oldChildren,delete e.oldProps)},_=e=>{e.props&&e.el&&ie(e.props,e.el),(e.children||[]).forEach(t=>{_(t)})},Ge=e=>{ce(e,e.wrapElement)},G=e=>{e.oldProps&&e.el&&ie(e.oldProps,e.el),ce(e,A(h(e)))},ce=(e,t)=>{var n,o;t&&e.el&&(((n=e.el)==null?void 0:n.nodeType)===1?t.removeChild(e.el):((o=e.el)==null?void 0:o.nodeType)===11&&re(e,t),delete e.el)},re=(e,t)=>{((e==null?void 0:e.oldChildren)||(e==null?void 0:e.children)||[]).forEach(n=>{var o,c;((o=n.el)==null?void 0:o.nodeType)===1?t.removeChild(n==null?void 0:n.el):((c=n.el)==null?void 0:c.nodeType)===11&&re(n,t)})},le=e=>{G(e),J(e)},Je=e=>{if(B(e),h(e).needRerender!=="CNSU"){const n=se(e);J(e,n)}},J=(e,t)=>{t||(t=O(e));const n=h(e);if(n.type){const o=A(n),r=n.type==="loop"&&n.needRerender&&n.needRerender!=="CNSU"?q(n,h(n)):q(e,n);t&&o&&(r?o.insertBefore(t,r):o.appendChild(t),Y())}},se=e=>C(e.type)?((e==null?void 0:e.children)||[]).reduce((t,n)=>{const o=se(n);return o&&t.appendChild(o),t},z()):e.el,q=(e,t)=>{const n=t.children||[],c=n.indexOf(e)+1,r=n.slice(c),l=ue(r),u=t.type||"";if(l)return l;if(!t.isRoot&&C(u))return q(t,h(t));if(t.isRoot&&C(u)&&t.afterElement)return t.afterElement},ue=e=>e.reduce((t,n)=>{const o=n.type,c=n.el,r=o&&C(o);return t||(r?ue(n.children||[]):c&&c.nodeType!==11?c:t)},void 0),Xe=e=>{const t=h(e),n=e.el;if(t.type&&n)if(n.nodeType===11)le(e);else{const o=A(t),c=O(e);o&&o.replaceChild(c,n),Y()}},ie=(e,t)=>{g(e||{}).forEach(([n,o])=>{n.match(/^on/)&&t.removeEventListener(ne(n),o)})},B=e=>{var t;const n=e.el;if(e.type==="text"){$e(e);return}if(n){const{oldProps:o,props:c}=e;de(c,n,o),delete e.oldProps,e.tag==="input"&&(n.value=String(((t=e==null?void 0:e.props)==null?void 0:t.value)||""))}(e.children||[]).forEach(o=>oe(o)),Ve(e)},$e=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},de=(e,t,n)=>{const o={...n};g(e||{}).forEach(([c,r])=>{let l=!0;c==="key"||r===o[c]||(c==="innerHTML"&&typeof r=="string"?t.innerHTML=r:$(c,r)?De(r,$(c,o.style)?o.style:{},t):Te(c,r)?r.value=t:c.match(/^on/)?we(t,c,r,o[c]):Fe(t)&&c==="checked"?t.checked=!!r:me(t)&&c==="value"?t.value=r:Ue(t)&&c==="selected"?t.selected=!!r:c&&([l,r]=Ze(r),l&&He(Ye(c),t,r))),l&&delete o[c]}),D(o).forEach(c=>t.removeAttribute(c))},He=(e,t,n)=>{E.value&&e!=="xmlns"?t.setAttributeNS(null,e,n):t.setAttribute(e,n)},Ze=e=>{let t=!0;return typeof e=="boolean"&&(e||(t=!1),e=""),[t,String(e)]},O=e=>{let t;const{type:n,tag:o,text:c,props:r,children:l=[]}=e,u=C(n);return o==="svg"&&(E.value=String(r==null?void 0:r.xmlns)),u?t=z():n==="element"&&o?t=E.value?document.createElementNS(E.value,o):Z(o):n==="text"&&R(c)?t=document.createTextNode(String(c)):t=Z("e"),Ke(l,t),de(r,t),e.el=t,qe(e),o==="svg"&&(E.value=""),t},Ke=(e,t)=>{const n=e.reduce((o,c)=>(c.type&&o.appendChild(O(c)),o),z());t&&n.hasChildNodes()&&t.appendChild(n)},we=(e,t,n,o)=>{const c=ne(t);o!==n&&(o&&e.removeEventListener(c,o),n&&e.addEventListener(c,n))},De=(e,t,n)=>{const o={...t},c=n==null?void 0:n.style;c&&(g(e).forEach(([r,l])=>{c[r]=l,delete o[r]}),g(o).forEach(([r])=>c[r]=""))},A=e=>{const t=C(e.type);return e.isRoot&&t?e.wrapElement:t?A(h(e)):e.el},L=(e,t)=>We(e,Oe[_e(e)](e,t),t),We=(e,t,n)=>{const o=lt(e,t,n),c=[o,t,n],r=tt(...c),l=r==="N";return l||(o.children=st(...c)),o.needRerender=r,et(o,n,r),!l&&n&&delete n.children,o},et=(e,t,n)=>{n!=="A"&&t&&(e.el=t.el),n&&["D","R","SR"].includes(n)&&(t!=null&&t.compKey&&(F(t),_(t)),e.oldChildren=t==null?void 0:t.children),e.oldProps=t==null?void 0:t.props},tt=(e,t,n)=>{const o=n&&n.type,c=w(e),r=e.isRoot,l=n&&h(n),u=!r&&(l==null?void 0:l.type),d=a(e),i=u==="loop"&&R(d),v=e.type==="text"&&t&&e.text===(n==null?void 0:n.text),y=e===n;let p;return c?p="D":v||y?p="N":o?t?p=i?"SU":"U":p=i?"SR":"R":p="A",e.type==="loop"&&p==="U"&&n&&nt(e,n)&&(p="CNSU"),p},nt=(e,t)=>{const n=[...(t==null?void 0:t.children)||[]],o=[...(e==null?void 0:e.children)||[]].filter(l=>n.find(u=>a(l)===a(u))),c=n.filter(l=>o.find(u=>a(l)===a(u)));let r=c.length===o.length;return r&&(r=c.every((l,u)=>a(l)===a(o[u]))),r},ot=(e,t)=>{e&&t!==e&&(D(e).forEach(n=>delete e[n]),g(t||{}).forEach(([n,o])=>e[n]=o))},ct=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach(n=>e.push(n)))},rt=(e,t)=>{const{compProps:n,compChild:o}=e,{props:c,children:r}=t;return n&&ot(n,c),o&&ct(o,r),e.reRender&&e.reRender()},lt=(e,t,n)=>U(e)?t&&n?rt(n,e):e.resolve():e,st=(e,t,n)=>t&&n?it(e,n):ut(e),ut=e=>(e.children||[]).map(t=>m(L(t),{getParent:()=>e})),it=(e,t)=>e.type==="loop"&&R(a((e.children||[])[0]))?dt(e,t):(e.children||[]).map((n,o)=>m(L(n,(t.children||[])[o]),{getParent:()=>e})),dt=(e,t)=>{const[n,o]=ft(e,t);return o.forEach(c=>{F(c),_(c),G(c)}),n},ft=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return[n.map(r=>{const l=pt(r,o),u=L(r,l);return l&&o.splice(o.indexOf(l),1),u.getParent=()=>e,u}),o]},pt=(e,t)=>t.find(n=>a(n)===a(e));let b=[],V=!1;const fe=(e,t)=>{f.get(e).up=()=>{b.push({compKey:e,exec:t}),V||(V=!0,queueMicrotask(vt))}},at=e=>()=>{var t;const n=(t=f.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},pe=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.compKey;o&&t.push(o),pe(n,t)})},vt=()=>{let e=[];b.forEach(o=>{var c,r;const l=(r=(c=f.get(o.compKey))==null?void 0:c.vd)==null?void 0:r.value;l&&pe(l,e)});const t=[],n=b.reduce((o,c)=>{const{compKey:r}=c;return e.includes(r)||t.includes(r)||(t.push(r),o.push(c)),o},[]);for(;n.length;){const o=n.shift();o&&o.exec()}b=[],V=!1},ae=(e,t=()=>[])=>{f.get(x()).upR.push(()=>H(e,t)),H(e,t)},ht=()=>{var e;const t=(e=f.get(x()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n())},S=(e,...t)=>({type:"fragment",children:t}),s=(e,t,...n)=>{const o={value:void 0},c=t||{},r=ke(o,n),l=Et(e,c,r);return U(l)||(o.value=l),l},ve=e=>(t,n)=>e,he=(e,t,n,o)=>{var c;I.value=!0;const r=ye(e,t,n),l=L(r,o),{isRoot:u,getParent:d,wrapElement:i,afterElement:v}=o;if(l.getParent=d,!u&&d){const y=((c=d())==null?void 0:c.children)||[],p=y.indexOf(o);y.splice(p,1,l)}else l.isRoot=!0,l.wrapElement=i,l.afterElement=v;I.value=!1,oe(l)},ye=(e,t,n)=>({tagName:e.name,ctor:e,props:t,children:n,resolve:(l=t)=>{Me(l);const d=e(t,n)(at(l),t,n),i=yt(d,l,e,t,n),v=i;return fe(l,()=>he(e,t,n,v)),W(l,"vd").value=i,i}}),yt=(e,t,n,o,c)=>{let r=e,l=e(o);return l.reRender&&(r=u=>{const d=e(u),i=S({},d);return d.getParent=()=>i,i},l=r(o)),Ce(l,t,n,o,c,Ct(r,t,n,o,c)),l},Ct=(e,t,n,o,c)=>{const r=()=>kt(e,t,n,o,c,r);return r},kt=(e,t,n,o,c,r)=>{Le(t),ht();const l=e(o);return fe(t,()=>he(n,o,c,l)),Ce(l,t,n,o,c,r),W(t,"vd").value=l,l},Ce=(e,t,n,o,c,r)=>{m(e,{compProps:o,compChild:c,ctor:n,tagName:n.name,compKey:t,reRender:r})},Et=(e,t,n)=>{if(K(e))return S(t,...n);if(U(e)){const o=ye(e,t,n);return I.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},ke=(e,t)=>t.map(n=>m(Rt(n),{getParent:()=>e.value})),Rt=e=>{if(e==null||e===!1)return{type:null};if(Array.isArray(e)){const t={value:void 0},o={type:"loop",children:ke(t,e)};return t.value=o,o}else if(typeof e=="string"||typeof e=="number")return{type:"text",text:e};return e},gt=e=>({value:e}),j=(e,t)=>{let n=e;return{get value(){return n},get v(){return n},set value(o){n=o,t()},set v(o){n=o,t()}}},Pt=e=>{let t=e;return{get value(){return t()},get v(){return t()},set value(n){throw new Error("You can't change 'computed'")},set v(n){throw new Error("You can't change 'computed'")}}},xt=(e,t=()=>{},n=()=>[])=>{te(()=>(e(),t)),ae(()=>(t&&t(),e),n)},Ee=new Map,T={},St=e=>{const t=Symbol();return Ee.set(t,e),n=>(n&&(T[t]??(T[t]=[]),T[t].push(n)),Nt(t))},Nt=e=>new Proxy(Ee.get(e),{get(t,n){return t[n]},set(t,n,o){t[n]=o;const c=T[e],r=[];return c.forEach(l=>{l()||r.push(l)}),r.forEach(l=>c.splice(c.indexOf(l),1)),!0}}),bt=ve((e,t,n)=>{const o=j(1,e),c=j('"destructuring" the "props" value directly from the mount function will cause referencing issues, so if you want to use it, you need to "destructuring" it from the internal function (updater).',e),r=()=>t.parentValue,l=t.parentValue,u=Pt(()=>o.v+i+t.parentValue),d=St({text:"s",count:0})(e);let i=t.parentValue;const v=gt(null),y=()=>{o.v=o.v+1,i+=1},p=M=>{c.v=M.target.value},Re=()=>{d.count+=1,d.text+="1"},ge=()=>(console.log("MOUNTED",v),()=>console.log("UNMOUNT")),Pe=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return te(ge),ae(Pe,()=>[t.parentValue]),xt(()=>console.log("INJECT"),()=>console.log("CLEAN_UP"),()=>[o.v]),({parentValue:M})=>s(S,null,s("div",null,s("textarea",{value:c.v,onInput:p,style:{width:"300px",height:"100px"}})),s("div",null,c.v),s("div",null,s("div",{style:{color:"blue"}},"parentValueFromRef: ",t.parentValue," (working)"),s("div",{style:{color:"blue"}},"parentValueFromFunction: ",r()," (working)"),s("div",{style:{color:"blue"}},"parentValueFromUpdaterDestructuring: ",M," (working)"),s("div",{style:{color:"red"}},"parentValueFromMounterDestructuring: ",l," (not working)")),s("div",null,s("div",{ref:v},"count: ",o.v),s("div",null,"sum: ",o.v+i+t.parentValue),s("div",null,"sum(computed): ",u.v),s("div",null,"notRefValue: ",i),s("div",null,"localStore(text): ",d.text),s("div",null,"localStore(count): ",d.count)),s("button",{onClick:y},"Increase"),s("button",{onClick:Re},"localStoreUpdate"),n)}),Tt=ve(e=>{const t=j(7,e),n=()=>{t.v=t.v+1},o=()=>{t.v=t.v-1};return()=>s(S,null,s(bt,{parentValue:t.v},s("button",{onClick:n},"Increase - Parent")),s("button",{onClick:o},"Decrease - Parent"))}),Ut=s(Tt,null);ze(Ut,document.getElementById("root"));
|
|
2
|
-
//# sourceMappingURL=index-85bc9221.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-85bc9221.js","sources":["../../../dist/lithent.mjs","../../../helper/dist/lithentHelper.mjs","../../src/index.tsx"],"sourcesContent":["const checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkSameCustomComponent = (newWDom, originalWDom) => \"ctor\" in newWDom ? newWDom.ctor === (originalWDom == null ? void 0 : originalWDom.ctor) : newWDom === (originalWDom == null ? void 0 : originalWDom.ctor);\nconst checkSameFragment = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"fragment\" && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkSameTagElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"element\" && (originalWDom == null ? void 0 : originalWDom.tag) === newWDom.tag && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkNormalTypeElement = (newWDom, originalWDom) => checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type;\nconst checkLoopTypeElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type && (checkExisty(getKey((newWDom.children || [])[0])) && checkExisty(getKey((originalWDom.children || [])[0])) || ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length));\n};\nconst getKey = (target) => {\n var _a, _b;\n return ((_a = target == null ? void 0 : target.compProps) == null ? void 0 : _a.key) ?? ((_b = target == null ? void 0 : target.props) == null ? void 0 : _b.key);\n};\nconst checkVirtualType = (type) => type && [\"fragment\", \"loop\"].includes(type);\nconst checkCustemComponentFunction = (target) => typeof target === \"function\" && !checkFragmentFunction(target) || typeof target === \"object\" && \"resolve\" in target;\nconst checkFragmentFunction = (target) => typeof target === \"function\" && target === Fragment;\nconst checkEmptyElement = (wDom) => checkPlainWDomType(wDom) && !wDom.type;\nconst checkExisty = (value) => value !== null && value !== void 0;\nconst checkStyleData = (dataKey, dataValue) => dataKey === \"style\" && typeof dataValue === \"object\";\nconst checkRefData = (dataKey, dataValue) => dataKey === \"ref\" && typeof dataValue === \"object\";\nconst checkOptionElement = (element) => element.nodeType === 1 && element.tagName === \"OPTION\";\nconst checkTextareaElement = (element) => element.nodeType === 1 && element.tagName === \"TEXTAREA\";\nconst checkCheckableElement = (element) => element.nodeType === 1 && [\"radio\", \"checkbox\"].includes(element.type);\nconst getWDomType = (wDom) => {\n let result = \"et\";\n if (checkCustemComponentFunction(wDom)) {\n result = \"c\";\n } else if (checkPlainType(wDom, \"fragment\")) {\n result = \"f\";\n } else if (checkPlainType(wDom, \"element\")) {\n result = \"e\";\n } else if (checkPlainType(wDom, \"loop\")) {\n result = \"l\";\n } else if (checkPlainType(wDom, \"text\")) {\n result = \"t\";\n } else if (checkEmptyElement(wDom)) {\n result = \"et\";\n }\n return result;\n};\nconst checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkLoopTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement\n};\nconst getParent = (vDom) => vDom.getParent && vDom.getParent();\nconst entries = Object.entries;\nconst keys = Object.keys;\nconst assign = Object.assign;\nconst xmlnsRef = { value: \"\" };\nconst compKeyRef = { value: {} };\nconst needDiffRef = { value: false };\nconst componentRef = /* @__PURE__ */ new WeakMap();\nconst setComponetRef = (compKey) => {\n componentRef.set(compKey, {\n vd: { value: null },\n up: () => {\n },\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: []\n });\n};\nconst getComponentKey = () => compKeyRef.value;\nconst getComponentSubInfo = (compKey, subKey) => componentRef.get(compKey)[subKey];\nconst initUpdateHookState = (compKey) => compKeyRef.value = compKey;\nconst initMountHookState = (compKey) => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\n};\nconst unmount = (effectAction) => {\n componentRef.get(getComponentKey()).umts.push(effectAction);\n};\nconst runUnmountQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\nconst recursiveRunUnmount = (wDom) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\nconst removeItem = (compKey) => {\n const subInfo = componentRef.get(compKey);\n if (subInfo) {\n subInfo.umts.forEach((effect) => effect());\n subInfo.umts = [];\n componentRef.delete(compKey);\n }\n};\nlet mountedQueue = [];\nconst execMountedQueue = () => {\n mountedQueue.forEach((item) => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\nconst addMountedQueue = (wDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\nconst mountCallback = (effectAction) => componentRef.get(getComponentKey()).mts.push(effectAction);\nconst runMountedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.mts;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (queue) {\n component.mts = [];\n queue.forEach((effect) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\nconst useUpdated = (effectAction, dependencies = () => []) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component;\n const def = upD[upS.value];\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component.upCB.push(callback);\n }\n }\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\nconst runUpdatedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.upCB;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (newWDom.ctor && queue) {\n component.upCB = [];\n queue.forEach((effect) => effect());\n }\n }\n};\nconst checkNeedPushQueue = (originalDefs, newDefs) => !originalDefs.length ? true : originalDefs.some((def, index) => def !== newDefs[index]);\nconst getAttrKey = (keyName) => keyName === \"className\" ? \"class\" : keyName;\nconst getEventName = (eventKey) => eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\nconst DF = () => new DocumentFragment();\nconst CE = (t) => document.createElement(t);\nconst render = (wDom, wrapElement, afterElement) => {\n wrapElement ?? (wrapElement = document.body);\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n const Dom = wDomToDom(wDom);\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n execMountedQueue();\n return () => {\n var _a;\n const component = (_a = componentRef.get(wDom.compProps || {})) == null ? void 0 : _a.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n };\n};\nconst wDomUpdate = (newWDomTree) => {\n const { needRerender } = newWDomTree;\n if (needRerender && needRerender !== \"N\") {\n ({\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n CNSU: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate\n })[needRerender](newWDomTree);\n delete newWDomTree.needRerender;\n delete newWDomTree.oldChildren;\n delete newWDomTree.oldProps;\n }\n};\nconst recursiveRemoveEvent = (originalWDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n (originalWDom.children || []).forEach((childItem) => {\n recursiveRemoveEvent(childItem);\n });\n};\nconst rootDelete = (newWDom) => {\n deleteRealDom(newWDom, newWDom.wrapElement);\n};\nconst typeDelete = (newWDom) => {\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n deleteRealDom(\n newWDom,\n findRealParentElement(getParent(newWDom))\n );\n};\nconst deleteRealDom = (newWDom, parent) => {\n var _a, _b;\n if (parent && newWDom.el) {\n if (((_a = newWDom.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(newWDom.el);\n } else if (((_b = newWDom.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(newWDom, parent);\n }\n delete newWDom.el;\n }\n};\nconst findChildWithRemoveElement = (newWDom, parent) => {\n ((newWDom == null ? void 0 : newWDom.oldChildren) || (newWDom == null ? void 0 : newWDom.children) || []).forEach((item) => {\n var _a, _b;\n if (((_a = item.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(item == null ? void 0 : item.el);\n } else if (((_b = item.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\nconst typeSortedReplace = (newWDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\nconst typeSortedUpdate = (newWDom) => {\n typeUpdate(newWDom);\n const parentWDom = getParent(newWDom);\n if (parentWDom.needRerender !== \"CNSU\") {\n const newElement = getElementFromFragment(newWDom);\n typeAdd(newWDom, newElement);\n }\n};\nconst typeAdd = (newWDom, newElement) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom);\n }\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === \"loop\";\n const nextEl = isLoop && parentWDom.needRerender && parentWDom.needRerender !== \"CNSU\" ? startFindNextBrotherElement(parentWDom, getParent(parentWDom)) : startFindNextBrotherElement(newWDom, parentWDom);\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n execMountedQueue();\n }\n }\n};\nconst getElementFromFragment = (newWDom) => {\n if (checkVirtualType(newWDom.type)) {\n return ((newWDom == null ? void 0 : newWDom.children) || []).reduce((acc, item) => {\n const element = getElementFromFragment(item);\n if (element) {\n acc.appendChild(element);\n }\n return acc;\n }, DF());\n }\n return newWDom.el;\n};\nconst startFindNextBrotherElement = (wDom, parentWDom) => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || \"\";\n if (finedNextEl) {\n return finedNextEl;\n }\n if (!parentWDom.isRoot && checkVirtualType(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (parentWDom.isRoot && checkVirtualType(parentType) && parentWDom.afterElement) {\n return parentWDom.afterElement;\n }\n return void 0;\n};\nconst findChildFragmentNextElement = (candidiateBrothers) => candidiateBrothers.reduce(\n (targetEl, bItem) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && checkVirtualType(type);\n if (targetEl) {\n return targetEl;\n } else if (isFragment) {\n return findChildFragmentNextElement(bItem.children || []);\n } else if (el && el.nodeType !== 11) {\n return el;\n }\n return targetEl;\n },\n void 0\n);\nconst typeReplace = (newWDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n if (parentWDom.type && orignalElement) {\n if (orignalElement.nodeType === 11) {\n typeSortedReplace(newWDom);\n } else {\n const parentElement = findRealParentElement(parentWDom);\n const newElement = wDomToDom(newWDom);\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\nconst removeEvent = (oldProps, element) => {\n entries(oldProps || {}).forEach(([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue\n );\n }\n });\n};\nconst typeUpdate = (newWDom) => {\n var _a;\n const element = newWDom.el;\n if (newWDom.type === \"text\") {\n updateText(newWDom);\n return;\n }\n if (element) {\n const { oldProps, props } = newWDom;\n updateProps$1(props, element, oldProps);\n delete newWDom.oldProps;\n if (newWDom.tag === \"input\") {\n element.value = String(((_a = newWDom == null ? void 0 : newWDom.props) == null ? void 0 : _a.value) || \"\");\n }\n }\n (newWDom.children || []).forEach((childItem) => wDomUpdate(childItem));\n runUpdatedQueueFromWDom(newWDom);\n};\nconst updateText = (newWDom) => {\n const element = newWDom.el;\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\nconst updateProps$1 = (props, element, oldProps) => {\n const originalProps = { ...oldProps };\n entries(props || {}).forEach(([dataKey, dataValue]) => {\n let chkRemoveProp = true;\n if (dataKey === \"key\" || dataValue === originalProps[dataKey])\n ;\n else if (dataKey === \"innerHTML\" && typeof dataValue === \"string\") {\n element.innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n updateStyle(\n dataValue,\n checkStyleData(dataKey, originalProps.style) ? originalProps.style : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element,\n dataKey,\n dataValue,\n originalProps[dataKey]\n );\n } else if (checkCheckableElement(element) && dataKey === \"checked\") {\n element.checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === \"value\") {\n element.value = dataValue;\n } else if (checkOptionElement(element) && dataKey === \"selected\") {\n element.selected = !!dataValue;\n } else if (dataKey) {\n [chkRemoveProp, dataValue] = makeAttrDataValue(dataValue);\n if (chkRemoveProp) {\n setAttr(\n getAttrKey(dataKey),\n element,\n dataValue\n );\n }\n }\n if (chkRemoveProp) {\n delete originalProps[dataKey];\n }\n });\n keys(originalProps).forEach(\n (dataKey) => element.removeAttribute(dataKey)\n );\n};\nconst setAttr = (dataKey, element, dataValue) => {\n if (xmlnsRef.value && dataKey !== \"xmlns\") {\n element.setAttributeNS(null, dataKey, dataValue);\n } else {\n element.setAttribute(dataKey, dataValue);\n }\n};\nconst makeAttrDataValue = (dataValue) => {\n let allowSetAttr = true;\n if (typeof dataValue === \"boolean\") {\n if (!dataValue) {\n allowSetAttr = false;\n }\n dataValue = \"\";\n }\n return [allowSetAttr, String(dataValue)];\n};\nconst wDomToDom = (wDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n if (tag === \"svg\") {\n xmlnsRef.value = String(props == null ? void 0 : props.xmlns);\n }\n if (isVirtualType) {\n element = DF();\n } else if (type === \"element\" && tag) {\n element = xmlnsRef.value ? document.createElementNS(xmlnsRef.value, tag) : CE(tag);\n } else if (type === \"text\" && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = CE(\"e\");\n }\n wDomChildrenToDom(children, element);\n updateProps$1(props, element);\n wDom.el = element;\n addMountedQueue(wDom);\n if (tag === \"svg\") {\n xmlnsRef.value = \"\";\n }\n return element;\n};\nconst wDomChildrenToDom = (children, parentElement) => {\n const elementChildren = children.reduce(\n (acc, childItem) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem));\n }\n return acc;\n },\n DF()\n );\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n};\nconst updateEvent = (element, eventKey, newEventHandler, oldEventHandler) => {\n const eventName = getEventName(eventKey);\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\nconst updateStyle = (style, oldStyle, element) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = element == null ? void 0 : element.style;\n if (elementStyle) {\n entries(style).forEach(([styleKey, dataValue]) => {\n elementStyle[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n entries(originalStyle).forEach(\n ([styleKey]) => elementStyle[styleKey] = \"\"\n );\n }\n};\nconst findRealParentElement = (vDom) => {\n const isVirtualType = checkVirtualType(vDom.type);\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n if (!isVirtualType) {\n return vDom.el;\n }\n return findRealParentElement(getParent(vDom));\n};\nconst makeNewWDomTree = (newWDom, originalWDom) => remakeNewWDom(\n newWDom,\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n);\nconst remakeNewWDom = (newWDom, isSameType, originalWDom) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const param = [\n remakeWDom,\n isSameType,\n originalWDom\n ];\n const needRerender = addReRenderTypeProperty(...param);\n const isNoting = needRerender === \"N\";\n if (!isNoting) {\n remakeWDom.children = remakeChildrenForDiff(...param);\n }\n remakeWDom.needRerender = needRerender;\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n if (!isNoting && originalWDom) {\n delete originalWDom.children;\n }\n return remakeWDom;\n};\nconst inheritPropForRender = (remakeWDom, originalWDom, needRerender) => {\n if (needRerender !== \"A\" && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n if (needRerender && [\"D\", \"R\", \"SR\"].includes(needRerender)) {\n if (originalWDom == null ? void 0 : originalWDom.compKey) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n }\n remakeWDom.oldChildren = originalWDom == null ? void 0 : originalWDom.children;\n }\n remakeWDom.oldProps = originalWDom == null ? void 0 : originalWDom.props;\n};\nconst addReRenderTypeProperty = (newWDom, isSameType, originalWDom) => {\n const existOriginalWDom = originalWDom && originalWDom.type;\n const isEmptyElement = checkEmptyElement(newWDom);\n const isRoot = newWDom.isRoot;\n const originalParentWDom = originalWDom && getParent(originalWDom);\n const origParentType = !isRoot && (originalParentWDom == null ? void 0 : originalParentWDom.type);\n const key = getKey(newWDom);\n const isKeyCheckedWDom = origParentType === \"loop\" && checkExisty(key);\n const isSameText = newWDom.type === \"text\" && isSameType && newWDom.text === (originalWDom == null ? void 0 : originalWDom.text);\n const isSameWDom = newWDom === originalWDom;\n let result;\n if (isEmptyElement) {\n result = \"D\";\n } else if (isSameText || isSameWDom) {\n result = \"N\";\n } else if (!existOriginalWDom) {\n result = \"A\";\n } else if (isSameType) {\n result = isKeyCheckedWDom ? \"SU\" : \"U\";\n } else {\n result = isKeyCheckedWDom ? \"SR\" : \"R\";\n }\n if (newWDom.type === \"loop\" && result === \"U\" && originalWDom && chkDiffLoopOrder(newWDom, originalWDom)) {\n result = \"CNSU\";\n }\n return result;\n};\nconst chkDiffLoopOrder = (newWDom, originalWDom) => {\n const origChildren = [...(originalWDom == null ? void 0 : originalWDom.children) || []];\n const newChildren = [...(newWDom == null ? void 0 : newWDom.children) || []].filter(\n (item) => origChildren.find((newItem) => getKey(item) === getKey(newItem))\n );\n const filteredChildren = origChildren.filter(\n (item) => newChildren.find((newItem) => getKey(item) === getKey(newItem))\n );\n let isSame = filteredChildren.length === newChildren.length;\n if (isSame) {\n isSame = filteredChildren.every(\n (item, index) => getKey(item) === getKey(newChildren[index])\n );\n }\n return isSame;\n};\nconst updateProps = (props, infoProps) => {\n if (props && infoProps !== props) {\n keys(props).forEach((key) => delete props[key]);\n entries(infoProps || {}).forEach(([key, value]) => props[key] = value);\n }\n};\nconst updateChildren = (children, infoChidren) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n if (infoChidren) {\n infoChidren.forEach((childrenItem) => children.push(childrenItem));\n }\n }\n};\nconst runUpdate = (vDom, infoVdom) => {\n const { compProps: props, compChild: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n if (props) {\n updateProps(props, infoProps);\n }\n if (children) {\n updateChildren(children, infoChidren);\n }\n const newVDom = vDom.reRender && vDom.reRender();\n return newVDom;\n};\nconst generalize = (newWDom, isSameType, originalWDom) => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom ? runUpdate(originalWDom, newWDom) : newWDom.resolve();\n }\n return newWDom;\n};\nconst remakeChildrenForDiff = (newWDom, isSameType, originalWDom) => isSameType && originalWDom ? remakeChildrenForUpdate(newWDom, originalWDom) : remakeChildrenForAdd(newWDom);\nconst remakeChildrenForAdd = (newWDom) => (newWDom.children || []).map(\n (item) => assign(makeNewWDomTree(item), { getParent: () => newWDom })\n);\nconst remakeChildrenForUpdate = (newWDom, originalWDom) => newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0])) ? remakeChildrenForLoopUpdate(newWDom, originalWDom) : (newWDom.children || []).map(\n (item, index) => assign(makeNewWDomTree(item, (originalWDom.children || [])[index]), {\n getParent: () => newWDom\n })\n);\nconst remakeChildrenForLoopUpdate = (newWDom, originalWDom) => {\n const [remakedChildren, unUsedChildren] = diffLoopChildren(\n newWDom,\n originalWDom\n );\n unUsedChildren.forEach((unusedItem) => {\n runUnmountQueueFromWDom(unusedItem);\n recursiveRemoveEvent(unusedItem);\n typeDelete(unusedItem);\n });\n return remakedChildren;\n};\nconst diffLoopChildren = (newWDom, originalWDom) => {\n const newChildren = [...newWDom.children || []];\n const originalChildren = [...originalWDom.children || []];\n const remakedChildren = newChildren.map((item) => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n childItem.getParent = () => newWDom;\n return childItem;\n });\n return [remakedChildren, originalChildren];\n};\nconst findSameKeyOriginalItem = (item, originalChildren) => originalChildren.find(\n (orignalChildItem) => getKey(orignalChildItem) === getKey(item)\n);\nlet redrawQueue = [];\nlet redrawQueueTimeout = false;\nconst setRedrawAction = (compKey, exec) => {\n componentRef.get(compKey).up = () => {\n redrawQueue.push({\n compKey,\n exec\n });\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n };\n};\nconst componentUpdate = (compKey) => () => {\n var _a;\n const up = (_a = componentRef.get(compKey)) == null ? void 0 : _a.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n return result;\n};\nconst recursiveGetChildKeys = (wDom, result) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n result.push(childComKey);\n }\n recursiveGetChildKeys(item, result);\n });\n};\nconst execRedrawQueue = () => {\n let childItemList = [];\n redrawQueue.forEach((item) => {\n var _a, _b;\n const childVd = (_b = (_a = componentRef.get(item.compKey)) == null ? void 0 : _a.vd) == null ? void 0 : _b.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n const addedKey = [];\n const result = redrawQueue.reduce((acc, item) => {\n const { compKey } = item;\n if (childItemList.includes(compKey) || addedKey.includes(compKey)) {\n return acc;\n }\n addedKey.push(compKey);\n acc.push(item);\n return acc;\n }, []);\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n redrawQueue = [];\n redrawQueueTimeout = false;\n};\nconst updateCallback = (effectAction, dependencies = () => []) => {\n const updateReqs = componentRef.get(getComponentKey()).upR;\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\nconst runUpdateCallback = () => {\n var _a;\n const updateReqs = (_a = componentRef.get(getComponentKey())) == null ? void 0 : _a.upR;\n if (updateReqs == null ? void 0 : updateReqs.length) {\n updateReqs.forEach((callback) => callback());\n }\n};\nconst Fragment = (_props, ...children) => ({\n type: \"fragment\",\n children\n});\nconst h = (tag, props, ...children) => {\n const nodeParentPointer = { value: void 0 };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n return node;\n};\nconst mount = (component) => (_props, _children) => component;\nconst reRenderCustomComponent = (tag, props, children, originalWDom) => {\n var _a;\n needDiffRef.value = true;\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent: getParent2, wrapElement, afterElement } = originalWDom;\n newWDomTree.getParent = getParent2;\n if (!isRoot && getParent2) {\n const brothers = ((_a = getParent2()) == null ? void 0 : _a.children) || [];\n const index = brothers.indexOf(originalWDom);\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\nconst makeWDomResolver = (tag, props, children) => {\n const tagName = tag.name;\n const ctor = tag;\n const resolve = (compKey = props) => {\n initMountHookState(compKey);\n const component = tag(props, children);\n const componentMaker = component(componentUpdate(compKey), props, children);\n const customNode = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n children\n );\n const originalWDom = customNode;\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n getComponentSubInfo(compKey, \"vd\").value = customNode;\n return customNode;\n };\n return { tagName, ctor, props, children, resolve };\n};\nconst makeCustomNode = (componentMaker, compKey, tag, props, children) => {\n let newCustomComponentMaker = componentMaker;\n let customNode = componentMaker(props);\n if (customNode.reRender) {\n newCustomComponentMaker = (newProps) => {\n const customNode2 = componentMaker(newProps);\n const newNode = Fragment({}, customNode2);\n customNode2.getParent = () => newNode;\n return newNode;\n };\n customNode = newCustomComponentMaker(props);\n }\n addComponentProps(\n customNode,\n compKey,\n tag,\n props,\n children,\n makeReRender(newCustomComponentMaker, compKey, tag, props, children)\n );\n return customNode;\n};\nconst makeReRender = (componentMaker, compKey, tag, props, children) => {\n const reRender = () => wDomMaker(componentMaker, compKey, tag, props, children, reRender);\n return reRender;\n};\nconst wDomMaker = (componentMaker, compKey, tag, props, children, reRender) => {\n initUpdateHookState(compKey);\n runUpdateCallback();\n const originalWDom = componentMaker(props);\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n addComponentProps(originalWDom, compKey, tag, props, children, reRender);\n getComponentSubInfo(compKey, \"vd\").value = originalWDom;\n return originalWDom;\n};\nconst addComponentProps = (wDom, compKey, tag, props, children, reRender) => {\n assign(wDom, {\n compProps: props,\n compChild: children,\n ctor: tag,\n tagName: tag.name,\n compKey,\n reRender\n });\n};\nconst makeNode = (tag, props, children) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n return needDiffRef.value ? componetMakeResolver : componetMakeResolver.resolve();\n }\n return {\n type: \"element\",\n tag,\n props,\n children\n };\n};\nconst remakeChildren = (nodeParentPointer, children) => children.map(\n (item) => assign(makeChildrenItem(item), { getParent: () => nodeParentPointer.value })\n);\nconst makeChildrenItem = (item) => {\n if (item === null || item === void 0 || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer = { value: void 0 };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: \"loop\",\n children\n };\n nodeParentPointer.value = node;\n return node;\n } else if (typeof item === \"string\" || typeof item === \"number\") {\n return { type: \"text\", text: item };\n }\n return item;\n};\nconst ref = (initValue) => ({ value: initValue });\nconst nextTick = () => Promise.resolve();\nexport {\n Fragment,\n h,\n mount,\n mountCallback,\n nextTick,\n ref,\n render,\n updateCallback\n};\n//# sourceMappingURL=lithent.mjs.map\n","import { mountCallback as f, updateCallback as h, nextTick as g, render as d } from \"lithent\";\nconst x = (r, t) => {\n let e = r;\n return {\n get value() {\n return e;\n },\n get v() {\n return e;\n },\n set value(n) {\n e = n, t();\n },\n set v(n) {\n e = n, t();\n }\n };\n}, w = (r) => {\n let t = r;\n return {\n get value() {\n return t();\n },\n get v() {\n return t();\n },\n set value(e) {\n throw new Error(\"You can't change 'computed'\");\n },\n set v(e) {\n throw new Error(\"You can't change 'computed'\");\n }\n };\n}, E = (r, t = () => {\n}, e = () => []) => {\n f(() => (r(), t)), h(() => (t && t(), r), e);\n}, a = /* @__PURE__ */ new Map(), c = {}, C = (r) => {\n const t = Symbol();\n return a.set(t, r), (e) => (e && (c[t] ?? (c[t] = []), c[t].push(e)), v(t));\n}, v = (r) => new Proxy(a.get(r), {\n get(t, e) {\n return t[e];\n },\n set(t, e, n) {\n t[e] = n;\n const o = c[r], s = [];\n return o.forEach((u) => {\n u() || s.push(u);\n }), s.forEach(\n (u) => o.splice(o.indexOf(u), 1)\n ), !0;\n }\n}), U = (r, t) => {\n let e = [], n = null;\n return (o) => {\n const s = r(), u = e.every((i, p) => i === s[p]);\n if (e = s, u && n)\n return n;\n const l = t(o);\n return n = l, l;\n };\n}, k = (r, t, e) => {\n let n = () => {\n };\n return g().then(() => {\n n = d(r(), t, e);\n }), () => n();\n};\nexport {\n U as cacheUpdate,\n w as computed,\n E as effect,\n k as nextTickRender,\n x as state,\n C as store\n};\n//# sourceMappingURL=lithentHelper.mjs.map\n","// example.jsx\nimport {\n h,\n Fragment,\n render,\n ref,\n mountCallback,\n updateCallback,\n mount,\n} from 'lithent';\nimport { state, computed, effect, store } from 'lithent/helper';\n\n// This is the \"mount\" function.\n// This function is only executed on mount, and on update, only updates `props` and then executes the internal return function.\n// childen is passed as the second argument.\nconst ChildComponent = mount<{ parentValue: number }>(\n (renew, props, children) => {\n // The value is used as a \"getter\" to make it easy to get and write to in the higher-order functions it returns\n const count = state<number>(1, renew);\n const text = state<string>(\n '\"destructuring\" the \"props\" value directly from the mount function will cause referencing issues, so if you want to use it, you need to \"destructuring\" it from the internal function (updater).',\n renew\n );\n const getParentValue = () => props.parentValue;\n const parentValueFromMount = props.parentValue;\n const summ = computed<number>(\n () => count.v + notRefValue + props.parentValue\n );\n\n const localStore = store<{ text: string; count: number }>({\n text: 's',\n count: 0,\n })(renew);\n /*\n // To share a store, make it externally and use `asign`.\n const asignStore = store<{ text: string; count: number }>({ text: 's', count: 0 });\n\n const sharedStore = asignStore(nenew);\n */\n\n // Even if you don't use a ref, the private value is always maintained as a regular variable.\n let notRefValue = props.parentValue;\n\n // Ref is only used to reference the DOM.\n const domRef = ref(null);\n\n const increase = () => {\n count.v = count.v + 1;\n notRefValue += 1;\n };\n\n const handleInputChane = (event: InputEvent) => {\n text.v = (event.target as HTMLInputElement).value;\n };\n\n const localStoreUpdate = () => {\n localStore.count += 1;\n localStore.text += '1';\n };\n\n const handleMounted = () => {\n console.log('MOUNTED', domRef);\n\n return () => console.log('UNMOUNT');\n };\n const handleUpdated = () => {\n console.log('UPDATE - parentValue');\n\n return () => console.log('UPDATED');\n };\n\n mountCallback(handleMounted);\n updateCallback(handleUpdated, () => [props.parentValue]); // Only Defs Updated (using a closure to update a value)\n\n // Behaves like `react`'s `useEffect`\n effect(\n () => console.log('INJECT'),\n () => console.log('CLEAN_UP'),\n () => [count.v]\n );\n\n // Wrap in a function and return (using a closure to hold the value)\n // This is the \"update\" function.\n return ({ parentValue }) => (\n <Fragment>\n {/* Note that the event is onInput (we use the native event name to avoid confusion). */}\n <div>\n <textarea\n value={text.v}\n onInput={handleInputChane}\n style={{ width: '300px', height: '100px' }}\n />\n </div>\n <div>{text.v}</div>\n <div>\n <div style={{ color: 'blue' }}>\n parentValueFromRef: {props.parentValue} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromFunction: {getParentValue()} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromUpdaterDestructuring: {parentValue} (working)\n </div>\n <div style={{ color: 'red' }}>\n parentValueFromMounterDestructuring: {parentValueFromMount} (not\n working)\n </div>\n </div>\n <div>\n <div ref={domRef}>count: {count.v}</div>\n <div>sum: {count.v + notRefValue + props.parentValue}</div>\n <div>sum(computed): {summ.v}</div>\n {/* It doesn't pull it out from under the reference, it uses the value directly, so you can just use it. */}\n <div>notRefValue: {notRefValue}</div>\n <div>localStore(text): {localStore.text}</div>\n <div>localStore(count): {localStore.count}</div>\n </div>\n <button onClick={increase}>Increase</button>\n <button onClick={localStoreUpdate}>localStoreUpdate</button>\n {children}\n </Fragment>\n );\n }\n);\n\nconst Root = mount(renew => {\n const parentNumber = state<number>(7, renew);\n\n const increaseParent = () => {\n parentNumber.v = parentNumber.v + 1;\n };\n\n const decreaseParent = () => {\n parentNumber.v = parentNumber.v - 1;\n };\n\n return () => (\n <Fragment>\n <ChildComponent parentValue={parentNumber.v}>\n <button onClick={increaseParent}>Increase - Parent</button>\n </ChildComponent>\n <button onClick={decreaseParent}>Decrease - Parent</button>\n </Fragment>\n );\n});\nconst root = <Root />;\n\nrender(root, document.getElementById('root'));\n"],"names":["checkPlainWDomType","wDom","checkPlainType","typeName","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkLoopTypeElement","checkExisty","getKey","target","checkVirtualType","type","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckableElement","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","entries","keys","assign","xmlnsRef","compKeyRef","needDiffRef","componentRef","setComponetRef","compKey","getComponentKey","getComponentSubInfo","subKey","initUpdateHookState","initMountHookState","unmount","effectAction","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","item","subInfo","effect","mountedQueue","execMountedQueue","runMountedQueueFromWDom","addMountedQueue","mountCallback","component","queue","sequence","callback","useUpdated","dependencies","upD","upS","def","checkNeedPushQueue","runUpdatedQueueFromWDom","originalDefs","newDefs","index","getAttrKey","keyName","getEventName","eventKey","_match","p1","DF","CE","t","render","wrapElement","afterElement","Dom","wDomToDom","recursiveRemoveEvent","rootDelete","wDomUpdate","newWDomTree","needRerender","typeAdd","typeDelete","typeReplace","typeUpdate","typeSortedReplace","typeSortedUpdate","removeEvent","childItem","deleteRealDom","findRealParentElement","parent","findChildWithRemoveElement","newElement","getElementFromFragment","parentWDom","parentEl","nextEl","startFindNextBrotherElement","acc","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","el","isFragment","orignalElement","parentElement","oldProps","updateText","props","updateProps$1","originalProps","chkRemoveProp","updateStyle","updateEvent","makeAttrDataValue","setAttr","allowSetAttr","tag","text","children","isVirtualType","wDomChildrenToDom","elementChildren","newEventHandler","oldEventHandler","eventName","style","oldStyle","originalStyle","elementStyle","styleKey","makeNewWDomTree","remakeNewWDom","isSameType","remakeWDom","generalize","param","addReRenderTypeProperty","isNoting","remakeChildrenForDiff","inheritPropForRender","existOriginalWDom","isEmptyElement","isRoot","originalParentWDom","origParentType","key","isKeyCheckedWDom","isSameText","isSameWDom","chkDiffLoopOrder","origChildren","newChildren","newItem","filteredChildren","isSame","updateProps","infoProps","updateChildren","infoChidren","childrenItem","runUpdate","infoVdom","remakeChildrenForUpdate","remakeChildrenForAdd","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","redrawQueue","redrawQueueTimeout","setRedrawAction","exec","execRedrawQueue","componentUpdate","up","recursiveGetChildKeys","childComKey","childItemList","childVd","addedKey","action","updateCallback","runUpdateCallback","updateReqs","_props","h","nodeParentPointer","newProps","remakeChildren","node","makeNode","mount","_children","reRenderCustomComponent","makeWDomResolver","getParent2","componentMaker","customNode","makeCustomNode","newCustomComponentMaker","customNode2","newNode","addComponentProps","makeReRender","reRender","wDomMaker","componetMakeResolver","makeChildrenItem","ref","initValue","x","r","e","n","w","E","f","a","c","C","v","o","s","u","ChildComponent","renew","count","state","getParentValue","parentValueFromMount","summ","computed","notRefValue","localStore","store","domRef","increase","handleInputChane","event","localStoreUpdate","handleMounted","handleUpdated","parentValue","Root","parentNumber","increaseParent","decreaseParent","root"],"mappings":"ssBAAA,MAAMA,EAAsBC,GAAS,OAAOA,GAAS,UAAY,EAAE,YAAaA,GAC1EC,EAAiB,CAACD,EAAME,IAAaH,EAAmBC,CAAI,GAAKA,EAAK,OAASE,EAC/EC,GAA2B,CAACC,EAASC,IAAiB,SAAUD,EAAUA,EAAQ,QAAUC,GAAgB,KAAO,OAASA,EAAa,MAAQD,KAAaC,GAAgB,KAAO,OAASA,EAAa,MAC3MC,GAAoB,CAACF,EAASC,IAAiB,CACnD,IAAIE,EAAIC,EACR,OAAOT,EAAmBK,CAAO,IAAMC,GAAgB,KAAO,OAASA,EAAa,QAAU,cAAgBE,EAAKF,GAAgB,KAAO,OAASA,EAAa,WAAa,KAAO,OAASE,EAAG,YAAcC,EAAKJ,GAAW,KAAO,OAASA,EAAQ,WAAa,KAAO,OAASI,EAAG,OACxR,EACMC,GAAsB,CAACL,EAASC,IAAiB,CACrD,IAAIE,EAAIC,EACR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