lithent 0.36.2 → 0.37.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.
@@ -0,0 +1,44 @@
1
+ import { mount, render, Fragment, h } from '@/index';
2
+
3
+ const Svg = mount(() => {
4
+ return () => (
5
+ <Fragment>
6
+ <svg
7
+ id="toggleSidebarMobileHamburger"
8
+ class="w-6 h-6"
9
+ fill="currentColor"
10
+ viewBox="0 0 20 20"
11
+ xmlns="http://www.w3.org/2000/svg"
12
+ >
13
+ <path
14
+ fill-rule="evenodd"
15
+ d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
16
+ clip-rule="evenodd"
17
+ ></path>
18
+ <path
19
+ fill-rule="evenodd"
20
+ d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h6a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
21
+ clip-rule="evenodd"
22
+ ></path>
23
+ </svg>
24
+ <div>
25
+ <p>test</p>
26
+ </div>
27
+ <svg
28
+ id="toggleSidebarMobileClose"
29
+ class="hidden w-6 h-6"
30
+ fill="currentColor"
31
+ viewBox="0 0 20 20"
32
+ xmlns="http://www.w3.org/2000/svg"
33
+ >
34
+ <path
35
+ fill-rule="evenodd"
36
+ d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
37
+ clip-rule="evenodd"
38
+ ></path>
39
+ </svg>
40
+ </Fragment>
41
+ );
42
+ });
43
+
44
+ render(<Svg />, document.getElementById('root'));
package/src/render.ts CHANGED
@@ -9,11 +9,11 @@ import {
9
9
  checkCheckableElement,
10
10
  } from '@/utils/predicator';
11
11
 
12
- import { componentRef } from '@/utils/universalRef';
12
+ import { componentRef, xmlnsRef } from '@/utils/universalRef';
13
13
  import { runUnmountQueueFromWDom } from '@/hook/unmount';
14
14
  import { runMountedQueueFromWDom } from '@/hook/mountCallback';
15
15
  import { runUpdatedQueueFromWDom } from '@/hook/useUpdate';
16
- import { getParent, getEventName } from '@/utils';
16
+ import { getParent, getEventName, getAttrKey } from '@/utils';
17
17
 
18
18
  export const render = (
19
19
  wDom: WDom,
@@ -34,13 +34,11 @@ export const render = (
34
34
  }
35
35
 
36
36
  return () => {
37
- if (wDom.componentProps) {
38
- const component = componentRef.get(wDom.componentProps)?.vd.value;
39
- if (component) {
40
- runUnmountQueueFromWDom(component);
41
- recursiveRemoveEvent(component);
42
- rootDelete(component);
43
- }
37
+ const component = componentRef.get(wDom.componentProps || {})?.vd.value;
38
+ if (component) {
39
+ runUnmountQueueFromWDom(component);
40
+ recursiveRemoveEvent(component);
41
+ rootDelete(component);
44
42
  }
45
43
  };
46
44
  };
@@ -121,7 +119,7 @@ const typeAdd = (
121
119
  newElement?: HTMLElement | DocumentFragment | Text
122
120
  ) => {
123
121
  if (!newElement) {
124
- newElement = wDomToDom(newWDom);
122
+ newElement = wDomToDom(newWDom) as HTMLElement;
125
123
  }
126
124
 
127
125
  const parentWDom = getParent(newWDom);
@@ -266,7 +264,7 @@ const updateText = (newWDom: WDom) => {
266
264
 
267
265
  const updateProps = (
268
266
  props?: Props,
269
- element?: HTMLElement | DocumentFragment | Text,
267
+ element?: HTMLElement | Element | DocumentFragment | Text,
270
268
  oldProps?: Props
271
269
  ) => {
272
270
  const originalProps = { ...oldProps };
@@ -275,11 +273,7 @@ const updateProps = (
275
273
  ([dataKey, dataValue]: [string, unknown]) => {
276
274
  if (dataKey === 'key') {
277
275
  // Do nothing
278
- } else if (
279
- dataKey === 'innerHTML' &&
280
- element &&
281
- typeof dataValue === 'string'
282
- ) {
276
+ } else if (dataKey === 'innerHTML' && typeof dataValue === 'string') {
283
277
  (element as HTMLElement).innerHTML = dataValue;
284
278
  } else if (checkStyleData(dataKey, dataValue)) {
285
279
  updateStyle(
@@ -305,7 +299,18 @@ const updateProps = (
305
299
  } else if (checkOptionElement(element) && dataKey === 'selected') {
306
300
  (element as HTMLOptionElement).selected = !!dataValue;
307
301
  } else if (checkNormalAttribute(dataValue)) {
308
- (element as HTMLElement).setAttribute(dataKey, String(dataValue));
302
+ if (xmlnsRef.value && dataKey !== 'xmlns') {
303
+ (element as HTMLElement).setAttributeNS(
304
+ null,
305
+ getAttrKey(dataKey),
306
+ String(dataValue)
307
+ );
308
+ } else {
309
+ (element as HTMLElement).setAttribute(
310
+ getAttrKey(dataKey),
311
+ String(dataValue)
312
+ );
313
+ }
309
314
  }
310
315
 
311
316
  delete originalProps[dataKey];
@@ -322,10 +327,16 @@ const wDomToDom = (wDom: WDom) => {
322
327
  const { type, tag, text, props, children = [] } = wDom;
323
328
  const isVirtualType = type === 'fragment' || type === 'loop';
324
329
 
330
+ if (tag === 'svg') {
331
+ xmlnsRef.value = String(props?.xmlns);
332
+ }
333
+
325
334
  if (isVirtualType) {
326
335
  element = new DocumentFragment();
327
336
  } else if (type === 'element' && tag) {
328
- element = document.createElement(tag);
337
+ element = xmlnsRef.value
338
+ ? document.createElementNS(xmlnsRef.value, tag)
339
+ : document.createElement(tag);
329
340
  } else if (type === 'text' && checkExisty(text)) {
330
341
  element = document.createTextNode(String(text));
331
342
  } else {
@@ -335,16 +346,20 @@ const wDomToDom = (wDom: WDom) => {
335
346
  wDomChildrenToDom(children, element);
336
347
  updateProps(props, element);
337
348
 
338
- wDom.el = element;
349
+ wDom.el = element as HTMLElement;
339
350
 
340
351
  runMountedQueueFromWDom(wDom);
341
352
 
353
+ if (tag === 'svg') {
354
+ xmlnsRef.value = '';
355
+ }
356
+
342
357
  return element;
343
358
  };
344
359
 
345
360
  const wDomChildrenToDom = (
346
361
  children: WDom[],
347
- parentElement?: HTMLElement | DocumentFragment | Text
362
+ parentElement?: HTMLElement | Element | DocumentFragment | Text
348
363
  ) => {
349
364
  const elementChildren = children.reduce(
350
365
  (acc: DocumentFragment, childItem: WDom) => {
@@ -384,7 +399,7 @@ const updateEvent = (
384
399
  const updateStyle = (
385
400
  style: Record<string, string>,
386
401
  oldStyle: Record<string, string>,
387
- element?: HTMLElement | DocumentFragment | Text
402
+ element?: HTMLElement | Element | DocumentFragment | Text
388
403
  ) => {
389
404
  const originalStyle = { ...oldStyle };
390
405
  const elementStyle = (element as HTMLElement)?.style;
@@ -26,6 +26,9 @@ export const reRender = (vDom: WDom, infoVdom: TagFunctionResolver) => {
26
26
  export const getEventName = (eventKey: string) =>
27
27
  eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());
28
28
 
29
+ export const getAttrKey = (keyName: string) =>
30
+ keyName === 'className' ? 'class' : keyName;
31
+
29
32
  const updateProps = (props: Props, infoProps: Props) => {
30
33
  if (props && infoProps !== props) {
31
34
  Object.keys(props).forEach(key => delete props[key]);
@@ -81,8 +81,9 @@ export const checkStyleData = (
81
81
  export const checkRefData = (
82
82
  dataKey: string,
83
83
  dataValue: unknown
84
- ): dataValue is { value: HTMLElement | DocumentFragment | Text | undefined } =>
85
- dataKey === 'ref' && typeof dataValue === 'object';
84
+ ): dataValue is {
85
+ value: HTMLElement | Element | DocumentFragment | Text | undefined;
86
+ } => dataKey === 'ref' && typeof dataValue === 'object';
86
87
 
87
88
  export const checkOptionElement = (element: any): element is HTMLElement =>
88
89
  element.nodeType === 1 && element.tagName === 'OPTION';
@@ -8,6 +8,7 @@ type RedrawQueueList = {
8
8
  /**
9
9
  * Common
10
10
  */
11
+ export const xmlnsRef: { value: string } = { value: '' };
11
12
  export const componentKeyRef: { value: Props } = { value: {} };
12
13
  export const needDiffRef: { value: boolean } = { value: false };
13
14
  export const componentRef: ComponentRef = new WeakMap();
package/src/wDom.ts CHANGED
@@ -25,8 +25,6 @@ import {
25
25
  checkCustemComponentFunction,
26
26
  } from '@/utils/predicator';
27
27
 
28
- export type Children = WDom[];
29
-
30
28
  export const Fragment = (_props: Props, ...children: WDom[]) => ({
31
29
  type: 'fragment',
32
30
  children,
@@ -128,16 +126,16 @@ const makeCustomNode = (
128
126
  children: WDom[]
129
127
  ) => {
130
128
  const customNode = componentMaker(props);
131
- const reRender = makeReRender(
132
- componentMaker,
129
+
130
+ addComponentProps(
131
+ customNode,
133
132
  componentKey,
134
133
  tag,
135
134
  props,
136
- children
135
+ children,
136
+ makeReRender(componentMaker, componentKey, tag, props, children)
137
137
  );
138
138
 
139
- addComponentProps(customNode, componentKey, tag, props, children, reRender);
140
-
141
139
  return customNode;
142
140
  };
143
141
 
@@ -1,2 +0,0 @@
1
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))o(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerpolicy&&(c.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?c.credentials="include":r.crossorigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(r){if(r.ep)return;r.ep=!0;const c=n(r);fetch(r.href,c)}})();const v=e=>typeof e=="object"&&!("resolve"in e),k=(e,t)=>v(e)&&e.type===t,pe=(e,t)=>e.constructor===(t==null?void 0:t.constructor),ve=(e,t)=>{var n,o;return v(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)},he=(e,t)=>{var n,o;return v(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)},U=(e,t)=>{var n,o;return v(e)&&(t==null?void 0:t.type)===e.type&&(((n=t==null?void 0:t.children)==null?void 0:n.length)===((o=e==null?void 0:e.children)==null?void 0:o.length)||e.type==="loop")},E=e=>typeof e=="function"&&!Y(e)||typeof e=="object"&&"resolve"in e,Y=e=>typeof e=="function"&&e===T,$=e=>v(e)&&!e.type,L=e=>e!=null,q=(e,t)=>e==="style"&&typeof t=="object",ye=(e,t)=>e==="ref"&&typeof t=="object",Ce=e=>e.nodeType===1&&e.tagName==="OPTION",ke=e=>e.nodeType===1&&e.tagName==="TEXTAREA",ge=e=>e.nodeType===1&&["radio","checkbox"].includes(e.type),Re=e=>typeof e=="number"||typeof e=="string",me=e=>{let t="et";return E(e)?t="c":k(e,"fragment")?t="f":k(e,"element")?t="e":k(e,"loop")?t="l":k(e,"text")?t="t":$(e)&&(t="et"),t},Ee={c:pe,l:U,t:U,e:he,f:ve,et:U},p=e=>e.getParent&&e.getParent(),Pe=(e,t)=>{const{componentProps:n,componentChildren:o}=e,{props:r,children:c}=t;return n&&be(n,r),o&&xe(o,c),e.reRender&&e.reRender()},z=e=>e.replace(/^on(.*)/,(t,n)=>n.toLowerCase()),be=(e,t)=>{e&&t!==e&&(Object.keys(e).forEach(n=>delete e[n]),Object.entries(t||{}).forEach(([n,o])=>e[n]=o))},xe=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach(n=>e.push(n)))},h={value:{}},_={value:!1},u=new WeakMap,R={value:[]},F={value:null},Te=e=>()=>{var t;const n=(t=u.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},Ne=e=>{u.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},y=()=>h.value,G=(e,t)=>u.get(e)[t],J=(e,t)=>{u.get(e).up=()=>{R.value.push({componentKey:e,exec:t}),F.value||(F.value=setTimeout(_e))}},Se=e=>h.value=e,Ue=e=>{h.value=e,Ne(e)},X=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.componentKey;o&&t.push(o),X(n,t)})},_e=()=>{let e=[];R.value.forEach(o=>{var r,c;const l=(c=(r=u.get(o.componentKey))==null?void 0:r.vd)==null?void 0:c.value;l&&X(l,e)});const t=[],n=R.value.reduce((o,r)=>{const{componentKey:c}=r;return e.includes(c)||t.includes(c)||(t.push(c),o.push(r)),o},[]);for(;n.length;){const o=n.shift();o&&o.exec()}},Fe=e=>{u.get(y()).umts.push(e)},A=e=>{const{componentKey:t}=e;t&&Oe(t),H(e)},H=e=>{(e.children||[]).forEach(t=>{t.componentKey?A(t):H(t)})},Oe=e=>{const t=u.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],u.delete(e))},Z=e=>{u.get(y()).mts.push(e)},M=e=>{const{componentKey:t}=e;if(t){const n=u.get(t),o=n==null?void 0:n.mts,r=n==null?void 0:n.upS;h.value=t,r&&(r.value=0),o&&(n.mts=[],o.forEach(c=>{const l=c();l&&Fe(l)}))}},Q=(e,t=()=>[])=>{const n=u.get(y()),{upD:o,upS:r}=n,c=o[r.value];if(c&&Le(c,t())){const l=e();l&&n.upCB.push(l)}o[r.value]=t(),r.value+=1},Ie=e=>{const{componentKey:t}=e;if(t){const n=u.get(t),o=n==null?void 0:n.upCB,r=n==null?void 0:n.upS;h.value=t,r&&(r.value=0),e.constructor&&o&&(n.upCB=[],o.forEach(c=>c()))}},Le=(e,t)=>!e.length&&!e.length?!0:e.some((n,o)=>n!==t[o]),Ae=(e,t,n)=>{t!=null||(t=document.body),e.isRoot=!0,e.wrapElement=t;const o=P(e);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),()=>{var r;if(e.componentProps){const c=(r=u.get(e.componentProps))==null?void 0:r.vd.value;c&&(A(c),V(c),Me(c))}}},K=e=>{const{needRerender:t}=e;t&&t!=="N"&&{A:B,D:j,R:je,U:Be,SR:W,SU:Ve}[t](e)},V=e=>{e.props&&e.el&&te(e.props,e.el),(e.children||[]).forEach(t=>{V(t)})},Me=e=>{w(e,e.wrapElement)},j=e=>{e.oldProps&&e.el&&te(e.oldProps,e.el),w(e,b(p(e)))},w=(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&&D(e,t),delete e.el)},D=(e,t)=>{((e==null?void 0:e.oldChildren)||(e==null?void 0:e.children)||[]).forEach(n=>{var o,r;((o=n.el)==null?void 0:o.nodeType)===1?t.removeChild(n==null?void 0:n.el):((r=n.el)==null?void 0:r.nodeType)===11&&D(n,t)})},W=e=>{j(e),B(e)},Ve=e=>{j(e),B(e,e.el)},B=(e,t)=>{t||(t=P(e));const n=p(e);if(n.type){const o=b(n),c=n.type==="loop"?O(n,p(n)):O(e,n);t&&o&&(c?o.insertBefore(t,c):o.appendChild(t))}M(e)},O=(e,t)=>{const n=t.children||[],r=n.indexOf(e)+1,c=n.slice(r),l=ee(c),a=t.type||"";if(l)return l;if(!t.isRoot&&["fragment","loop"].includes(a))return O(t,p(t));if(t.isRoot&&t.afterElement)return t.afterElement},ee=e=>e.reduce((t,n)=>{const o=n.type,r=n.el,c=o&&["fragment","loop"].includes(o);return t||(c?ee(n.children||[]):r&&r.nodeType!==11?r:t)},void 0),je=e=>{const t=p(e),n=e.el;if(t.type&&n)if(n.nodeType===11)W(e);else{const o=b(t),r=P(e);o&&o.replaceChild(r,n)}M(e)},te=(e,t)=>{Object.entries(e||{}).forEach(([n,o])=>{n.match(/^on/)&&t.removeEventListener(z(n),o)})},Be=e=>{var t;const n=e.el;if(e.type==="text"){qe(e);return}if(n){const{oldProps:o,props:r}=e;ne(r,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=>K(o)),Ie(e)},qe=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},ne=(e,t,n)=>{const o={...n};Object.entries(e||{}).forEach(([r,c])=>{r==="key"||(r==="innerHTML"&&t&&typeof c=="string"?t.innerHTML=c:q(r,c)?$e(c,q(r,o.style)?o.style:{},t):ye(r,c)?c.value=t:r.match(/^on/)?Ye(t,r,c,o[r]):ge(t)&&r==="checked"?t.checked=!!c:ke(t)&&r==="value"?t.value=c:Ce(t)&&r==="selected"?t.selected=!!c:Re(c)&&t.setAttribute(r,String(c))),delete o[r]}),Object.keys(o).forEach(r=>t.removeAttribute(r))},P=e=>{let t;const{type:n,tag:o,text:r,props:c,children:l=[]}=e;return n==="fragment"||n==="loop"?t=new DocumentFragment:n==="element"&&o?t=document.createElement(o):n==="text"&&L(r)?t=document.createTextNode(String(r)):t=document.createElement("e"),Qe(l,t),ne(c,t),e.el=t,M(e),t},Qe=(e,t)=>{const n=e.reduce((o,r)=>(r.type&&o.appendChild(P(r)),o),new DocumentFragment);t&&n.hasChildNodes()&&t.appendChild(n)},Ye=(e,t,n,o)=>{const r=z(t);o!==n&&(o&&e.removeEventListener(r,o),n&&e.addEventListener(r,n))},$e=(e,t,n)=>{const o={...t},r=n==null?void 0:n.style;r&&(Object.entries(e).forEach(([c,l])=>{r[c]=l,delete o[c]}),Object.entries(o).forEach(([c])=>r[c]=""))},b=e=>{const t=e.type==="fragment"||e.type==="loop";return e.isRoot&&t?e.wrapElement:t?b(p(e)):e.el},x=(e,t)=>ze(e,Ee[me(e)](e,t),t),ze=(e,t,n)=>{const o=Je(e,t,n);o.children=Xe(o,t,n);const r=Ge(o,t,n);return o.needRerender=r,r!=="A"&&n&&(o.el=n.el),r&&["D","R","SR"].includes(r)&&(n==null?void 0:n.componentKey)&&(A(n),V(n),o.oldChildren=n.children),o.oldProps=n==null?void 0:n.props,o},Ge=(e,t,n)=>{const o=n&&n.type,r=$(e),l=!!e.getParent&&p(e).type,a=m(e),i=l==="loop"&&L(a),f=e.type==="text"&&t&&e.text===(n==null?void 0:n.text);let d;return r?d="D":f?d="N":o?t?d=i?"SU":"U":d=i?"SR":"R":d="A",d},Je=(e,t,n)=>E(e)?t&&n?Pe(n,e):e.resolve():e,Xe=(e,t,n)=>t&&n?Ze(e,n):He(e),He=e=>(e.children||[]).map(t=>{const n=x(t);return n.getParent=()=>e,n}),Ze=(e,t)=>e.type==="loop"&&L(m((e.children||[])[0]))?Ke(e,t):(e.children||[]).map((n,o)=>{const r=x(n,(t.children||[])[o]);return r.getParent=()=>e,r}),Ke=(e,t)=>{const{remakedChildren:n,unUsedChildren:o}=we(e,t);return o.map(r=>{const c=r.el;c!=null&&c.parentNode&&c.parentNode.removeChild(c)}),n},we=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return{remakedChildren:n.map(c=>{const l=De(c,o),a=x(c,l);return l&&o.splice(o.indexOf(l),1),a.getParent=()=>e,a}),unUsedChildren:o}},De=(e,t)=>{const n=m(e);return t.find(o=>m(o)===n)},m=e=>{var t,n,o;return(o=(t=e==null?void 0:e.componentProps)==null?void 0:t.key)!=null?o:(n=e==null?void 0:e.props)==null?void 0:n.key},oe=(e,t=()=>[])=>{u.get(y()).upR.push(()=>Q(e,t)),Q(e,t)},We=()=>{var e;const t=(e=u.get(y()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n()),R.value=[],F.value=null},T=(e,...t)=>({type:"fragment",children:t}),s=(e,t,...n)=>{const o={value:void 0},r=t||{},c=ue(o,n),l=ot(e,r,c);return E(l)||(o.value=l),l},re=e=>(t,n)=>e,ce=(e,t,n,o)=>{var r;_.value=!0;const c=le(e,t,n),l=x(c,o),{isRoot:a,getParent:i,wrapElement:f,afterElement:d}=o;if(l.getParent=i,!a&&i){const C=((r=i())==null?void 0:r.children)||[],N=C.indexOf(o);C.splice(N,1,l)}else l.isRoot=!0,l.wrapElement=f,l.afterElement=d;_.value=!1,K(l)},le=(e,t,n)=>({tagName:e.name,constructor:e,props:t,children:n,resolve:(l=t)=>{Ue(l);const i=e(t,n)(Te(l),t,n),f=et(i,l,e,t,n),d=f;return J(l,()=>ce(e,t,n,d)),G(l,"vd").value=f,f}}),et=(e,t,n,o,r)=>{const c=e(o),l=tt(e,t,n,o,r);return se(c,t,n,o,r,l),c},tt=(e,t,n,o,r)=>{const c=()=>nt(e,t,n,o,r,c);return c},nt=(e,t,n,o,r,c)=>{Se(t),We();const l=e(o);return J(t,()=>ce(n,o,r,l)),se(l,t,n,o,r,c),G(t,"vd").value=l,l},se=(e,t,n,o,r,c)=>{Object.assign(e,{componentProps:o,componentChildren:r,constructor:n,tagName:n.name,componentKey:t,reRender:c})},ot=(e,t,n)=>{if(Y(e))return T(t,...n);if(E(e)){const o=le(e,t,n);return _.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},ue=(e,t)=>t.map(n=>{const o=rt(n);return o.getParent=()=>e.value,o}),rt=e=>{if(e==null||e===!1)return{type:null};if(Array.isArray(e)){const t={value:void 0},o={type:"loop",children:ue(t,e)};return t.value=o,o}else if(typeof e=="string"||typeof e=="number")return{type:"text",text:e};return e},ct=e=>({value:e}),I=(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()}}},lt=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'")}}},st=(e,t=()=>{},n=()=>[])=>{Z(()=>(e(),t)),oe(()=>(t&&t(),e),n)},ie=new Map,g={},ut=e=>{const t=Symbol();return ie.set(t,e),n=>(g[t]!=null||(g[t]=[]),g[t].push(n),it(t))},it=e=>new Proxy(ie.get(e),{get(t,n){return t[n]},set(t,n,o){t[n]=o;const r=g[e],c=[];return r.forEach(l=>{l()||c.push(l)}),c.forEach(l=>r.splice(r.indexOf(l),1)),!0}}),dt=re((e,t,n)=>{const o=I(1,e),r=I('"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),c=()=>t.parentValue,l=t.parentValue,a=lt(()=>o.v+f+t.parentValue),i=ut({text:"s",count:0})(e);let f=t.parentValue;const d=ct(null),C=()=>{o.v=o.v+1,f+=1},N=S=>{r.v=S.target.value},de=()=>{i.count+=1,i.text+="1"},ae=()=>(console.log("MOUNTED",d),()=>console.log("UNMOUNT")),fe=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return Z(ae),oe(fe,()=>[t.parentValue]),st(()=>console.log("INJECT"),()=>console.log("CLEAN_UP"),()=>[o.v]),({parentValue:S})=>s(T,null,s("div",null,s("textarea",{value:r.v,onInput:N,style:{width:"300px",height:"100px"}})),s("div",null,r.v),s("div",null,s("div",{style:{color:"blue"}},"parentValueFromRef: ",t.parentValue," (working)"),s("div",{style:{color:"blue"}},"parentValueFromFunction: ",c()," (working)"),s("div",{style:{color:"blue"}},"parentValueFromUpdaterDestructuring: ",S," (working)"),s("div",{style:{color:"red"}},"parentValueFromMounterDestructuring: ",l," (not working)")),s("div",null,s("div",{ref:d},"count: ",o.v),s("div",null,"sum: ",o.v+f+t.parentValue),s("div",null,"sum(computed): ",a.v),s("div",null,"notRefValue: ",f),s("div",null,"localStore(text): ",i.text),s("div",null,"localStore(count): ",i.count)),s("button",{onClick:C},"Increase"),s("button",{onClick:de},"localStoreUpdate"),n)}),at=re(e=>{const t=I(7,e),n=()=>{t.v=t.v+1},o=()=>{t.v=t.v-1};return()=>s(T,null,s(dt,{parentValue:t.v},s("button",{onClick:n},"Increase - Parent")),s("button",{onClick:o},"Decrease - Parent"))}),ft=s(at,null);Ae(ft,document.getElementById("root"));
2
- //# sourceMappingURL=index.f15c0062.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.f15c0062.js","sources":["../../vite/modulepreload-polyfill","../../../dist/lithent.mjs","../../../helper/dist/lithentHelper.mjs","../../src/index.tsx"],"sourcesContent":["__VITE_IS_MODERN__&&(function polyfill() {\n const relList = document.createElement('link').relList;\n if (relList && relList.supports && relList.supports('modulepreload')) {\n return;\n }\n for (const link of document.querySelectorAll('link[rel=\"modulepreload\"]')) {\n processPreload(link);\n }\n new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type !== 'childList') {\n continue;\n }\n for (const node of mutation.addedNodes) {\n if (node.tagName === 'LINK' && node.rel === 'modulepreload')\n processPreload(node);\n }\n }\n }).observe(document, { childList: true, subtree: true });\n function getFetchOpts(script) {\n const fetchOpts = {};\n if (script.integrity)\n fetchOpts.integrity = script.integrity;\n if (script.referrerpolicy)\n fetchOpts.referrerPolicy = script.referrerpolicy;\n if (script.crossorigin === 'use-credentials')\n fetchOpts.credentials = 'include';\n else if (script.crossorigin === 'anonymous')\n fetchOpts.credentials = 'omit';\n else\n fetchOpts.credentials = 'same-origin';\n return fetchOpts;\n }\n function processPreload(link) {\n if (link.ep)\n // ep marker = processed\n return;\n link.ep = true;\n // prepopulate the load record\n const fetchOpts = getFetchOpts(link);\n fetch(link.href, fetchOpts);\n }\n}());","const checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkSameCustomComponent = (newWDom, originalWDom) => newWDom.constructor === (originalWDom == null ? void 0 : originalWDom.constructor);\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) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type && (((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length) || newWDom.type === \"loop\");\n};\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 checkNormalAttribute = (dataValue) => typeof dataValue === \"number\" || typeof dataValue === \"string\";\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: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement\n};\nconst getParent = (vDom) => {\n const parentVDom = vDom.getParent && vDom.getParent();\n return parentVDom;\n};\nconst reRender = (vDom, infoVdom) => {\n const { componentProps: props, componentChildren: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n if (props) {\n updateProps$1(props, infoProps);\n }\n if (children) {\n updateChildren(children, infoChidren);\n }\n const newVDom = vDom.reRender && vDom.reRender();\n return newVDom;\n};\nconst getEventName = (eventKey) => eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\nconst updateProps$1 = (props, infoProps) => {\n if (props && infoProps !== props) {\n Object.keys(props).forEach((key) => delete props[key]);\n Object.entries(infoProps || {}).forEach(\n ([key, value]) => props[key] = value\n );\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 componentKeyRef = { value: {} };\nconst needDiffRef = { value: false };\nconst componentRef = /* @__PURE__ */ new WeakMap();\nconst redrawQueue = { value: [] };\nconst redrawQueueTimeout = { value: null };\nconst componentRender = (componentKey) => () => {\n var _a;\n const up = (_a = componentRef.get(componentKey)) == null ? void 0 : _a.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n return result;\n};\nconst setComponetRef = (componentKey) => {\n componentRef.set(componentKey, {\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 = () => componentKeyRef.value;\nconst getComponentSubInfo = (componentKey, subKey) => componentRef.get(componentKey)[subKey];\nconst setRedrawAction = (componentKey, exec) => {\n componentRef.get(componentKey).up = () => {\n redrawQueue.value.push({\n componentKey,\n exec\n });\n if (!redrawQueueTimeout.value) {\n redrawQueueTimeout.value = setTimeout(execRedrawQueue);\n }\n };\n};\nconst initUpdateHookState = (componentKey) => componentKeyRef.value = componentKey;\nconst initMountHookState = (componentKey) => {\n componentKeyRef.value = componentKey;\n setComponetRef(componentKey);\n};\nconst recursiveGetChildKeys = (wDom, result) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.componentKey;\n if (childComKey) {\n result.push(childComKey);\n }\n recursiveGetChildKeys(item, result);\n });\n};\nconst execRedrawQueue = () => {\n let childItemList = [];\n redrawQueue.value.forEach((item) => {\n var _a, _b;\n const childVd = (_b = (_a = componentRef.get(item.componentKey)) == 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.value.reduce((acc, item) => {\n const { componentKey } = item;\n if (childItemList.includes(componentKey) || addedKey.includes(componentKey)) {\n return acc;\n }\n addedKey.push(componentKey);\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};\nconst unmount = (effectAction) => {\n componentRef.get(getComponentKey()).umts.push(effectAction);\n};\nconst runUnmountQueueFromWDom = (newWDom) => {\n const { componentKey } = newWDom;\n if (componentKey) {\n removeItem(componentKey);\n }\n recursiveRunUnmount(newWDom);\n};\nconst recursiveRunUnmount = (wDom) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.componentKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\nconst removeItem = (componentKey) => {\n const subInfo = componentRef.get(componentKey);\n if (subInfo) {\n subInfo.umts.forEach((effect) => effect());\n subInfo.umts = [];\n componentRef.delete(componentKey);\n }\n};\nconst mountCallback = (effectAction) => {\n const mts = componentRef.get(getComponentKey()).mts;\n mts.push(effectAction);\n};\nconst runMountedQueueFromWDom = (newWDom) => {\n const { componentKey } = newWDom;\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component == null ? void 0 : component.mts;\n const sequence = component == null ? void 0 : component.upS;\n componentKeyRef.value = componentKey;\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 { componentKey } = newWDom;\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component == null ? void 0 : component.upCB;\n const sequence = component == null ? void 0 : component.upS;\n componentKeyRef.value = componentKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (newWDom.constructor && queue) {\n component.upCB = [];\n queue.forEach((effect) => effect());\n }\n }\n};\nconst checkNeedPushQueue = (originalDefs, newDefs) => !originalDefs.length && !originalDefs.length ? true : originalDefs.some((def, index) => def !== newDefs[index]);\nconst render = (wDom, wrapElement, afterElement) => {\n wrapElement != null ? 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 return () => {\n var _a;\n if (wDom.componentProps) {\n const component = (_a = componentRef.get(wDom.componentProps)) == null ? void 0 : _a.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\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 SR: typeSortedReplace,\n SU: typeSortedUpdate\n })[needRerender](newWDomTree);\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 typeDelete(newWDom);\n typeAdd(newWDom, newWDom.el);\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 ? 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 }\n }\n runMountedQueueFromWDom(newWDom);\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 && [\"fragment\", \"loop\"].includes(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (parentWDom.isRoot && 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 && [\"fragment\", \"loop\"].includes(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 }\n }\n runMountedQueueFromWDom(newWDom);\n};\nconst removeEvent = (oldProps, element) => {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue\n );\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(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 = (props, element, oldProps) => {\n const originalProps = { ...oldProps };\n Object.entries(props || {}).forEach(\n ([dataKey, dataValue]) => {\n if (dataKey === \"key\")\n ;\n else if (dataKey === \"innerHTML\" && element && 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 (checkNormalAttribute(dataValue)) {\n element.setAttribute(dataKey, String(dataValue));\n }\n delete originalProps[dataKey];\n }\n );\n Object.keys(originalProps).forEach(\n (dataKey) => element.removeAttribute(dataKey)\n );\n};\nconst wDomToDom = (wDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = type === \"fragment\" || type === \"loop\";\n if (isVirtualType) {\n element = new DocumentFragment();\n } else if (type === \"element\" && tag) {\n element = document.createElement(tag);\n } else if (type === \"text\" && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = document.createElement(\"e\");\n }\n wDomChildrenToDom(children, element);\n updateProps(props, element);\n wDom.el = element;\n runMountedQueueFromWDom(wDom);\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 new DocumentFragment()\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 Object.entries(style).forEach(([styleKey, dataValue]) => {\n elementStyle[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n Object.entries(originalStyle).forEach(\n ([styleKey]) => elementStyle[styleKey] = \"\"\n );\n }\n};\nconst findRealParentElement = (vDom) => {\n const isVirtualType = vDom.type === \"fragment\" || vDom.type === \"loop\";\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 remakeWDom.children = remakeChildrenForDiff(\n remakeWDom,\n isSameType,\n originalWDom\n );\n const needRerender = addReRenderTypeProperty(\n remakeWDom,\n isSameType,\n originalWDom\n );\n remakeWDom.needRerender = needRerender;\n if (needRerender !== \"A\" && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n if (needRerender && [\"D\", \"R\", \"SR\"].includes(needRerender) && (originalWDom == null ? void 0 : originalWDom.componentKey)) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n remakeWDom.oldChildren = originalWDom.children;\n }\n remakeWDom.oldProps = originalWDom == null ? void 0 : originalWDom.props;\n return remakeWDom;\n};\nconst addReRenderTypeProperty = (newWDom, isSameType, originalWDom) => {\n const existOriginalWDom = originalWDom && originalWDom.type;\n const isEmptyElement = checkEmptyElement(newWDom);\n const isRoot = !newWDom.getParent;\n const parentType = !isRoot && getParent(newWDom).type;\n const key = getKey(newWDom);\n const isKeyCheckedWDom = parentType === \"loop\" && checkExisty(key);\n const isSameText = newWDom.type === \"text\" && isSameType && newWDom.text === (originalWDom == null ? void 0 : originalWDom.text);\n let result;\n if (isEmptyElement) {\n result = \"D\";\n } else if (isSameText) {\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 return result;\n};\nconst generalize = (newWDom, isSameType, originalWDom) => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom ? reRender(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((item) => {\n const childItem = makeNewWDomTree(item);\n childItem.getParent = () => newWDom;\n return childItem;\n});\nconst remakeChildrenForUpdate = (newWDom, originalWDom) => {\n if (newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0]))) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n return (newWDom.children || []).map((item, index) => {\n const childItem = makeNewWDomTree(\n item,\n (originalWDom.children || [])[index]\n );\n childItem.getParent = () => newWDom;\n return childItem;\n });\n};\nconst remakeChildrenForLoopUpdate = (newWDom, originalWDom) => {\n const { remakedChildren, unUsedChildren } = diffLoopChildren(\n newWDom,\n originalWDom\n );\n unUsedChildren.map((unusedItem) => {\n const el = unusedItem.el;\n if (el == null ? void 0 : el.parentNode) {\n el.parentNode.removeChild(el);\n }\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 {\n remakedChildren,\n unUsedChildren: originalChildren\n };\n};\nconst findSameKeyOriginalItem = (item, originalChildren) => {\n const key = getKey(item);\n return originalChildren.find(\n (orignalChildItem) => getKey(orignalChildItem) === key\n );\n};\nconst getKey = (target) => {\n var _a, _b, _c;\n return (_c = (_a = target == null ? void 0 : target.componentProps) == null ? void 0 : _a.key) != null ? _c : (_b = target == null ? void 0 : target.props) == null ? void 0 : _b.key;\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 redrawQueue.value = [];\n redrawQueueTimeout.value = null;\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 constructor = tag;\n const resolve = (componentKey = props) => {\n initMountHookState(componentKey);\n const component = tag(props, children);\n const componentMaker = component(\n componentRender(componentKey),\n props,\n children\n );\n const customNode = makeCustomNode(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n const originalWDom = customNode;\n setRedrawAction(\n componentKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n getComponentSubInfo(componentKey, \"vd\").value = customNode;\n return customNode;\n };\n return { tagName, constructor, props, children, resolve };\n};\nconst makeCustomNode = (componentMaker, componentKey, tag, props, children) => {\n const customNode = componentMaker(props);\n const reRender2 = makeReRender(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n addComponentProps(customNode, componentKey, tag, props, children, reRender2);\n return customNode;\n};\nconst makeReRender = (componentMaker, componentKey, tag, props, children) => {\n const reRender2 = () => wDomMaker(componentMaker, componentKey, tag, props, children, reRender2);\n return reRender2;\n};\nconst wDomMaker = (componentMaker, componentKey, tag, props, children, reRender2) => {\n initUpdateHookState(componentKey);\n runUpdateCallback();\n const originalWDom = componentMaker(props);\n setRedrawAction(\n componentKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n addComponentProps(originalWDom, componentKey, tag, props, children, reRender2);\n getComponentSubInfo(componentKey, \"vd\").value = originalWDom;\n return originalWDom;\n};\nconst addComponentProps = (wDom, componentKey, tag, props, children, reRender2) => {\n Object.assign(wDom, {\n componentProps: props,\n componentChildren: children,\n constructor: tag,\n tagName: tag.name,\n componentKey,\n reRender: reRender2\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((item) => {\n const childItem = makeChildrenItem(item);\n childItem.getParent = () => nodeParentPointer.value;\n return childItem;\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 });\nexport {\n Fragment,\n h,\n mount,\n mountCallback,\n ref,\n render,\n updateCallback\n};\n//# sourceMappingURL=lithent.mjs.map\n","import { mountCallback as a, updateCallback as p } from \"lithent\";\nconst v = (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}, f = (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}, m = (r, t = () => {\n}, e = () => []) => {\n a(() => (r(), t)), p(() => (t && t(), r), e);\n}, l = /* @__PURE__ */ new Map(), u = {}, i = (r) => {\n const t = Symbol();\n return l.set(t, r), (e) => {\n var n;\n return (n = u[t]) != null || (u[t] = []), u[t].push(e), h(t);\n };\n}, h = (r) => new Proxy(l.get(r), {\n get(t, e) {\n return t[e];\n },\n set(t, e, n) {\n t[e] = n;\n const s = u[r], c = [];\n return s.forEach((o) => {\n o() || c.push(o);\n }), c.forEach(\n (o) => s.splice(s.indexOf(o), 1)\n ), !0;\n }\n});\nexport {\n f as computed,\n m as effect,\n v as state,\n i 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":["relList","link","processPreload","mutations","mutation","node","getFetchOpts","script","fetchOpts","checkPlainWDomType","wDom","checkPlainType","typeName","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkCustemComponentFunction","target","checkFragmentFunction","Fragment","checkEmptyElement","checkExisty","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckableElement","checkNormalAttribute","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","reRender","infoVdom","props","children","infoProps","infoChidren","updateProps$1","updateChildren","getEventName","eventKey","_match","p1","key","childrenItem","componentKeyRef","needDiffRef","componentRef","redrawQueue","redrawQueueTimeout","componentRender","componentKey","up","setComponetRef","getComponentKey","getComponentSubInfo","subKey","setRedrawAction","exec","execRedrawQueue","initUpdateHookState","initMountHookState","recursiveGetChildKeys","item","childComKey","childItemList","childVd","addedKey","acc","action","unmount","effectAction","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","subInfo","effect","mountCallback","runMountedQueueFromWDom","component","queue","sequence","callback","useUpdated","dependencies","upD","upS","def","checkNeedPushQueue","runUpdatedQueueFromWDom","originalDefs","newDefs","index","render","wrapElement","afterElement","Dom","wDomToDom","recursiveRemoveEvent","rootDelete","wDomUpdate","newWDomTree","needRerender","typeAdd","typeDelete","typeReplace","typeUpdate","typeSortedReplace","typeSortedUpdate","removeEvent","childItem","deleteRealDom","findRealParentElement","parent","findChildWithRemoveElement","newElement","parentWDom","parentEl","nextEl","startFindNextBrotherElement","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","type","el","isFragment","orignalElement","parentElement","oldProps","updateText","updateProps","originalProps","updateStyle","updateEvent","tag","text","wDomChildrenToDom","elementChildren","newEventHandler","oldEventHandler","eventName","style","oldStyle","originalStyle","elementStyle","styleKey","isVirtualType","makeNewWDomTree","remakeNewWDom","isSameType","remakeWDom","generalize","remakeChildrenForDiff","addReRenderTypeProperty","existOriginalWDom","isEmptyElement","getKey","isKeyCheckedWDom","isSameText","remakeChildrenForUpdate","remakeChildrenForAdd","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","newChildren","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","_c","updateCallback","runUpdateCallback","updateReqs","_props","h","nodeParentPointer","newProps","remakeChildren","makeNode","mount","_children","reRenderCustomComponent","makeWDomResolver","isRoot","getParent2","componentMaker","customNode","makeCustomNode","reRender2","makeReRender","addComponentProps","wDomMaker","componetMakeResolver","makeChildrenItem","ref","initValue","v","r","e","n","f","m","a","p","l","u","i","s","o","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":"CAAqB,UAAoB,CACrC,MAAMA,EAAU,SAAS,cAAc,MAAM,EAAE,QAC/C,GAAIA,GAAWA,EAAQ,UAAYA,EAAQ,SAAS,eAAe,EAC/D,OAEJ,UAAWC,KAAQ,SAAS,iBAAiB,2BAA2B,EACpEC,EAAeD,CAAI,EAEvB,IAAI,iBAAkBE,GAAc,CAChC,UAAWC,KAAYD,EACnB,GAAIC,EAAS,OAAS,YAGtB,UAAWC,KAAQD,EAAS,WACpBC,EAAK,UAAY,QAAUA,EAAK,MAAQ,iBACxCH,EAAeG,CAAI,CAGvC,CAAK,EAAE,QAAQ,SAAU,CAAE,UAAW,GAAM,QAAS,EAAI,CAAE,EACvD,SAASC,EAAaC,EAAQ,CAC1B,MAAMC,EAAY,CAAA,EAClB,OAAID,EAAO,YACPC,EAAU,UAAYD,EAAO,WAC7BA,EAAO,iBACPC,EAAU,eAAiBD,EAAO,gBAClCA,EAAO,cAAgB,kBACvBC,EAAU,YAAc,UACnBD,EAAO,cAAgB,YAC5BC,EAAU,YAAc,OAExBA,EAAU,YAAc,cACrBA,CACV,CACD,SAASN,EAAeD,EAAM,CAC1B,GAAIA,EAAK,GAEL,OACJA,EAAK,GAAK,GAEV,MAAMO,EAAYF,EAAaL,CAAI,EACnC,MAAMA,EAAK,KAAMO,CAAS,CAC7B,CACL,KC1CA,MAAMC,EAAsBC,GAAS,OAAOA,GAAS,UAAY,EAAE,YAAaA,GAC1EC,EAAiB,CA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