lithent 0.34.0 → 0.36.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/dist/lithent.mjs +1 -1
- package/dist/lithent.mjs.map +1 -1
- package/dist/lithent.umd.js +1 -1
- package/dist/lithent.umd.js.map +1 -1
- package/examples/dist/assets/index.cf0229da.js +2 -0
- package/examples/dist/assets/index.cf0229da.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/package.json +1 -1
- package/src/render.ts +1 -1
- package/examples/dist/assets/index.31d5f7a4.js +0 -2
- package/examples/dist/assets/index.31d5f7a4.js.map +0 -1
package/dist/lithent.mjs
CHANGED
|
@@ -307,7 +307,7 @@ const recursiveRemoveEvent = (originalWDom) => {
|
|
|
307
307
|
});
|
|
308
308
|
};
|
|
309
309
|
const rootDelete = (newWDom) => {
|
|
310
|
-
const parent =
|
|
310
|
+
const parent = newWDom.wrapElement;
|
|
311
311
|
deleteRealDom(newWDom, parent);
|
|
312
312
|
};
|
|
313
313
|
const typeDelete = (newWDom) => {
|
package/dist/lithent.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithent.mjs","sources":["../src/utils/predicator.ts","../src/utils/index.ts","../src/utils/universalRef.ts","../src/hook/unmount.ts","../src/hook/mountCallback.ts","../src/hook/useUpdate.ts","../src/render.ts","../src/diff.ts","../src/hook/updateCallback.ts","../src/wDom.ts","../src/hook/ref.ts"],"sourcesContent":["import { Fragment } from '@/wDom';\nimport {\n WDom,\n TagFunction,\n TagFunctionResolver,\n FragmentFunction,\n WDomType,\n} from '@/types';\n\ntype WDomParam =\n | string\n | WDom\n | TagFunction\n | TagFunctionResolver\n | FragmentFunction;\n\n/**\n * Predicator\n */\nexport const checkCustemComponentFunction = (\n target: WDomParam\n): target is TagFunction | TagFunctionResolver =>\n (typeof target === 'function' && !checkFragmentFunction(target)) ||\n (typeof target === 'object' && 'resolve' in target);\n\nexport const checkFragmentFunction = (\n target: unknown\n): target is FragmentFunction =>\n typeof target === 'function' && target === Fragment;\n\nexport const checkPlainWDomType = (wDom: WDomParam): wDom is WDom =>\n typeof wDom === 'object' && !('resolve' in wDom);\n\nexport const checkPlainType = (wDom: WDomParam, typeName: string) =>\n checkPlainWDomType(wDom) && wDom.type === typeName;\n\nexport const checkEmptyElement = (wDom: WDomParam) =>\n checkPlainWDomType(wDom) && !wDom.type;\n\nexport const checkSameCustomComponent = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => newWDom.constructor === originalWDom?.constructor;\n\nexport const checkSameFragment = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'fragment' &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkSameTagElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'element' &&\n originalWDom?.tag === newWDom.tag &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n return (\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === newWDom.type &&\n (originalWDom?.children?.length === newWDom?.children?.length ||\n newWDom.type === 'loop')\n );\n};\n\nexport const checkExisty = (value: unknown) =>\n value !== null && value !== undefined;\n\nexport const checkFunction = (target: unknown): target is Function =>\n typeof target === 'function';\n\nexport const checkStyleData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is Record<string, string> =>\n dataKey === 'style' && typeof dataValue === 'object';\n\nexport const checkRefData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is { value: HTMLElement | DocumentFragment | Text | undefined } =>\n dataKey === 'ref' && typeof dataValue === 'object';\n\nexport const checkOptionElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'OPTION';\n};\n\nexport const checkTextareaElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'TEXTAREA';\n};\n\nexport const checkCheckboxElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'checkbox';\n};\n\nexport const checkRadioElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'radio';\n};\n\nexport const checkNormalAttribute = (\n dataValue: unknown\n): dataValue is number | string =>\n typeof dataValue === 'number' || typeof dataValue === 'string';\n\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType | undefined => {\n let result: WDomType | undefined;\n\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\n return result;\n};\n\nexport const checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement,\n};\n","import { WDom, TagFunctionResolver, Props } from '@/types';\n\nexport const getParent = (vDom: WDom) => {\n const parentVDom = vDom.getParent && vDom.getParent();\n\n if (!parentVDom) {\n throw Error('Not found parent vDom');\n }\n\n return parentVDom;\n};\n\nexport const reRender = (vDom: WDom, infoVdom: TagFunctionResolver) => {\n const { componentProps: props, componentChildren: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n\n if (props) {\n updateProps(props, infoProps);\n }\n\n if (children) {\n updateChildren(children, infoChidren);\n }\n\n const newVDom = vDom.reRender && vDom.reRender();\n\n if (!newVDom) {\n throw Error('Unable reRender');\n }\n\n return newVDom;\n};\n\nconst updateProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n Object.keys(props).forEach(key => delete props[key]);\n\n Object.entries(infoProps || {}).forEach(\n ([key, value]) => (props[key] = value)\n );\n }\n};\n\nconst updateChildren = (children: WDom[], infoChidren: WDom[]) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n\n if (infoChidren) {\n infoChidren.forEach(childrenItem => children.push(childrenItem));\n }\n }\n};\n","import { ComponentRef, ComponentSubKey, Props, WDom } from '@/types';\n\ntype RedrawQueueList = {\n componentKey: Props;\n exec: () => void;\n}[];\n\n/**\n * Common\n */\nexport const componentKeyRef: { value: Props } = { value: {} };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentRef: ComponentRef = new WeakMap();\nexport const redrawQueue: {\n value: { componentKey: Props; exec: () => void }[];\n} = { value: [] };\nexport const redrawQueueTimeout: { value: null | number } = { value: null };\nexport const componentRender = (componentKey: Props) => () => {\n const up = componentRef.get(componentKey)?.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n\n return result;\n};\n\nexport const setComponetRef = (componentKey: Props) => {\n componentRef.set(componentKey, {\n vd: { value: null },\n up: () => {},\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: [],\n });\n};\n\nexport const getComponentKey = () => componentKeyRef.value;\n\nexport const getComponentSubInfo = (\n componentKey: Props,\n subKey: ComponentSubKey\n) => componentRef.get(componentKey)![subKey];\n\nexport const setRedrawAction = (componentKey: Props, exec: () => void) => {\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};\n\nexport const initUpdateHookState = (componentKey: Props) =>\n (componentKeyRef.value = componentKey);\n\nexport const initMountHookState = (componentKey: Props) => {\n componentKeyRef.value = componentKey;\n setComponetRef(componentKey);\n};\n\nconst recursiveGetChildKeys = (wDom: WDom, result: Props[]) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.componentKey;\n if (childComKey) {\n result.push(childComKey);\n }\n\n recursiveGetChildKeys(item, result);\n });\n};\n\nconst execRedrawQueue = () => {\n let childItemList: Props[] = [];\n\n redrawQueue.value.forEach(item => {\n const childVd = componentRef.get(item.componentKey)?.vd?.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n\n const addedKey: Props[] = [];\n const result = redrawQueue.value.reduce((acc, item) => {\n const { componentKey } = item;\n\n if (\n childItemList.includes(componentKey) ||\n addedKey.includes(componentKey)\n ) {\n return acc;\n }\n\n addedKey.push(componentKey);\n acc.push(item);\n\n return acc;\n }, [] as RedrawQueueList);\n\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n};\n","import { WDom, Props } from '@/types';\nimport { componentRef, getComponentKey } from '@/utils/universalRef';\n\nexport const unmount = (effectAction: () => void) => {\n componentRef.get(getComponentKey())!.umts.push(effectAction);\n};\n\nexport const runUnmountQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n removeItem(componentKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: 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};\n\nconst removeItem = (componentKey: Props) => {\n const subInfo = componentRef.get(componentKey);\n if (subInfo) {\n subInfo!.umts.forEach(effect => effect());\n subInfo!.umts = [];\n componentRef.delete(componentKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { unmount } from '@/hook/unmount';\n\nexport const mountCallback = (effectAction: () => void) => {\n const mts = componentRef.get(getComponentKey())!.mts;\n\n mts.push(effectAction);\n};\n\nexport const runMountedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.mts;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (queue) {\n component.mts = [];\n\n queue.forEach((effect: Function) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nexport const useUpdated = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component!;\n const def = upD[upS.value];\n\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component!.upCB.push(callback);\n }\n }\n\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\n\nexport const runUpdatedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.upCB;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (newWDom.constructor && queue) {\n component.upCB = [];\n queue.forEach((effect: Function) => effect());\n }\n }\n};\n\nconst checkNeedPushQueue = (originalDefs: unknown[], newDefs: unknown[]) =>\n !originalDefs.length && !originalDefs.length\n ? true\n : originalDefs.some((def, index) => def !== newDefs[index]);\n","/**\n * Rerender시 실제 dom에 반영해줘야 하는 상태\n *\n * 1. (ADD). 가상돔 비교시 오리지날이 없으면 새로 추가되는 dom으로 판단한다.\n * 2. (REPLACE). 오리지날이 있고 같은 엘리먼트타입이 아닌 경우 해당 위치의 태그 자체를 교체해준다.\n * 3. (UPDATE). 오리지날이 있고 같은 타입이면 dom의 속성만 변경해 주며, 텍스트 노드일 경우는 텍스트를 교체해준다.\n * 4. (DELETE). 오리지날이 있고 새로운 엘리먼트 타입은 null타입일 경우 dom을 삭제한다.\n * 5. (SORTED-REPLACE). loop의 경우 REPLACE라도 키값에 의해 순서가 변경될 수 있으므로 새로운 dom을 단순히 기존 위치에 교체하지 않고 새로 삼입하여 정렬한다.\n * 6. (SORTED-UPDATE). loop의 경우 UPDATE라도 키값에 의해 순서가 변경될수 있으므로 재 삽입하여 정렬한다.\n * 7. (NONE). text타입의 경우 text가 같다면 변경이 필요 없으므로 방치한다. (Todo. 다른 타입의 경우 처리필요)\n */\n\nimport { WDom, Props } from '@/types';\nimport {\n checkStyleData,\n checkRefData,\n checkNormalAttribute,\n checkExisty,\n checkOptionElement,\n checkTextareaElement,\n checkCheckboxElement,\n checkRadioElement,\n} from '@/utils/predicator';\n\nimport { componentRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { runMountedQueueFromWDom } from '@/hook/mountCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/useUpdate';\nimport { getParent } from '@/utils';\n\nexport const render = (\n wDom: WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n if (!wrapElement) {\n throw Error('WrapELement is null');\n }\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n\n const Dom = wDomToDom(wDom, true);\n\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n\n return () => {\n if (wDom.componentProps) {\n const component = componentRef.get(wDom.componentProps)?.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n }\n };\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { needRerender } = newWDomTree;\n\n if (needRerender && needRerender !== 'N') {\n const exec = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate,\n }[needRerender];\n exec(newWDomTree);\n }\n};\n\nexport const recursiveRemoveEvent = (originalWDom: WDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n\n (originalWDom.children || []).forEach((childItem: WDom) => {\n recursiveRemoveEvent(childItem);\n });\n};\n\nconst rootDelete = (newWDom: WDom) => {\n const parent = findRealParentElement(newWDom) as HTMLElement;\n\n deleteRealDom(newWDom, parent);\n};\n\nconst typeDelete = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const parent = findRealParentElement(parentWDom) as HTMLElement;\n\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n\n deleteRealDom(newWDom, parent);\n};\n\nconst deleteRealDom = (newWDom: WDom, parent: HTMLElement) => {\n if (parent && newWDom.el) {\n if (newWDom.el?.nodeType === 1) {\n parent.removeChild(newWDom.el);\n } else if (newWDom.el?.nodeType === 11) {\n findChildWithRemoveElement(newWDom, parent as HTMLElement);\n }\n delete newWDom.el;\n }\n};\n\nconst findChildWithRemoveElement = (newWDom: WDom, parent: HTMLElement) => {\n (newWDom?.oldChildren || newWDom?.children || []).forEach(item => {\n if (item.el?.nodeType === 1) {\n parent.removeChild(item?.el);\n } else if (item.el?.nodeType === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\n\nconst typeSortedReplace = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\n\nconst typeSortedUpdate = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom, newWDom.el);\n};\n\nconst typeAdd = (\n newWDom: WDom,\n newElement?: HTMLElement | DocumentFragment | Text\n) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom, true);\n }\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === 'loop';\n\n let nextEl;\n if (isLoop) {\n nextEl = startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else {\n nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n }\n\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst startFindNextBrotherElement = (\n wDom: WDom,\n parentWDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || '';\n\n if (finedNextEl) {\n return finedNextEl;\n }\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\n return undefined;\n};\n\nconst findChildFragmentNextElement = (\n candidiateBrothers: WDom[]\n): HTMLElement | DocumentFragment | Text | undefined =>\n candidiateBrothers.reduce(\n (\n targetEl: HTMLElement | DocumentFragment | Text | undefined,\n bItem: WDom\n ) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && ['fragment', 'loop'].includes(type);\n\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\n return targetEl;\n },\n undefined\n );\n\nconst typeReplace = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n\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, true);\n\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst removeEvent = (\n oldProps: Props,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n if (element) {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey.match(/^on/)) {\n const eventName = dataKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n element.removeEventListener(\n eventName,\n dataValue as (e: Event) => void\n );\n }\n }\n );\n }\n};\n\nconst typeUpdate = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (newWDom.type === 'text') {\n updateText(newWDom);\n\n return;\n }\n\n if (element) {\n const { oldProps, props } = newWDom;\n\n updateProps(props, element, oldProps);\n\n delete newWDom.oldProps;\n\n if (newWDom.tag === 'input') {\n (element as HTMLInputElement).value = String(newWDom?.props?.value || '');\n }\n }\n\n (newWDom.children || []).forEach((childItem: WDom) => wDomUpdate(childItem));\n\n runUpdatedQueueFromWDom(newWDom);\n};\n\nconst updateText = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\n\nconst updateProps = (\n props?: Props,\n element?: HTMLElement | DocumentFragment | Text,\n oldProps?: Props\n) => {\n const originalProps = { ...oldProps };\n\n Object.entries(props || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey === 'key') {\n // Do nothing\n } else if (\n dataKey === 'innerHTML' &&\n element &&\n typeof dataValue === 'string'\n ) {\n (element as HTMLElement).innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n const style = dataValue;\n const oldStyle = checkStyleData(dataKey, originalProps.style) || {};\n\n updateStyle(style, oldStyle, element);\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else if (checkRadioElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkCheckboxElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === 'value') {\n (element as HTMLInputElement).value = dataValue as string;\n } else if (checkOptionElement(element) && dataKey === 'selected') {\n (element as HTMLOptionElement).selected = !!dataValue;\n } else if (checkNormalAttribute(dataValue)) {\n (element as HTMLElement).setAttribute(dataKey, String(dataValue));\n }\n\n delete originalProps[dataKey];\n }\n );\n\n Object.keys(originalProps).forEach(dataKey =>\n (element as HTMLElement).removeAttribute(dataKey)\n );\n};\n\nconst wDomToDom = (wDom: WDom, init: boolean) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = type === 'fragment' || type === 'loop';\n\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 }\n\n wDomChildrenToDom(children, element, init);\n updateProps(props, element);\n\n wDom.el = element;\n\n runMountedQueueFromWDom(wDom);\n\n return element || document.createElement('div');\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | DocumentFragment | Text,\n init?: boolean\n) => {\n if (init) {\n const elementChildren = children.reduce(\n (acc: DocumentFragment, childItem: WDom) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem, init));\n }\n\n return acc;\n },\n new DocumentFragment()\n );\n\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n }\n};\n\nconst updateEvent = (\n element: HTMLElement,\n eventKey: string,\n newEventHandler: (e: Event) => void,\n oldEventHandler: (e: Event) => void\n) => {\n const eventName = eventKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\n\nconst updateStyle = (\n style: Record<string, string>,\n oldStyle: Record<string, string>,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = (element as HTMLElement)?.style;\n\n if (elementStyle) {\n Object.entries(style).forEach(([styleKey, dataValue]) => {\n (elementStyle as any)[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n\n Object.entries(originalStyle).forEach(\n ([styleKey]) => ((elementStyle as any)[styleKey] = '')\n );\n }\n};\n\nconst findRealParentElement = (\n vDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const isVirtualType = vDom.type === 'fragment' || vDom.type === 'loop';\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n\n if (!isVirtualType) {\n return vDom.el as HTMLElement;\n }\n\n const parentVDom = getParent(vDom);\n\n return findRealParentElement(parentVDom);\n};\n","import { WDom, TagFunctionResolver, RenderType } from '@/types';\nimport { checkCustemComponentFunction } from '@/utils/predicator';\nimport { getParent, reRender } from '@/utils';\nimport { recursiveRemoveEvent } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExisty,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\n\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n const type = getWDomType(newWDom);\n\n if (!type) {\n throw new Error('Unknown type wdom');\n }\n\n const isSameType = checkSameWDomWithOriginal[type](newWDom, originalWDom);\n\n const result = remakeNewWDom(newWDom, isSameType, originalWDom);\n\n return result;\n};\n\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n\n remakeWDom.children = remakeChildrenForDiff(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n const needRerender = addReRenderTypeProperty(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n remakeWDom.needRerender = needRerender;\n\n if (needRerender !== 'A' && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n\n if (\n needRerender &&\n ['D', 'R', 'SR'].includes(needRerender) &&\n originalWDom?.componentKey\n ) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n remakeWDom.oldChildren = originalWDom.children;\n }\n\n remakeWDom.oldProps = originalWDom?.props;\n\n return remakeWDom;\n};\n\nconst addReRenderTypeProperty = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n): RenderType | undefined => {\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 =\n newWDom.type === 'text' &&\n isSameType &&\n newWDom.text === originalWDom?.text;\n\n let result: RenderType | undefined;\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\n return result;\n};\n\nconst generalize = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n): WDom => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom\n ? reRender(originalWDom, newWDom)\n : newWDom.resolve();\n }\n\n return newWDom;\n};\n\nconst remakeChildrenForDiff = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n) =>\n isSameType && originalWDom\n ? remakeChildrenForUpdate(newWDom, originalWDom)\n : remakeChildrenForAdd(newWDom);\n\nconst remakeChildrenForAdd = (newWDom: WDom) =>\n (newWDom.children || []).map((item: WDom) => {\n const childItem = makeNewWDomTree(item);\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) => {\n if (\n newWDom.type === 'loop' &&\n checkExisty(getKey((newWDom.children || [])[0]))\n ) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n\n return (newWDom.children || []).map((item: WDom, index: number) => {\n const childItem = makeNewWDomTree(\n item,\n (originalWDom.children || [])[index]\n );\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n};\n\nconst remakeChildrenForLoopUpdate = (newWDom: WDom, originalWDom: WDom) => {\n const { remakedChildren, unUsedChildren } = diffLoopChildren(\n newWDom,\n originalWDom\n );\n\n unUsedChildren.map(unusedItem => {\n const el = unusedItem.el;\n\n if (el && el.parentNode) {\n el.parentNode.removeChild(el);\n }\n });\n\n return remakedChildren;\n};\n\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\n const newChildren = [...(newWDom.children || [])];\n const originalChildren = [...(originalWDom.children || [])];\n\n const remakedChildren = newChildren.map(item => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\n return {\n remakedChildren,\n unUsedChildren: originalChildren,\n };\n};\n\nconst findSameKeyOriginalItem = (item: WDom, originalChildren: WDom[]) => {\n const key = getKey(item);\n\n return originalChildren.find(\n orignalChildItem => getKey(orignalChildItem) === key\n );\n};\n\nconst getKey = (target: WDom) =>\n target?.componentProps?.key ?? target?.props?.key;\n","import {\n componentRef,\n redrawQueue,\n redrawQueueTimeout,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { useUpdated } from '@/hook/useUpdate';\n\nexport const updateCallback = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const updateReqs = componentRef.get(getComponentKey())!.upR;\n\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\n\nexport const runUpdateCallback = () => {\n const updateReqs = componentRef.get(getComponentKey())?.upR;\n\n if (updateReqs?.length) {\n updateReqs.forEach(callback => callback());\n }\n\n redrawQueue.value = [];\n redrawQueueTimeout.value = null;\n};\n","import {\n WDom,\n TagFunction,\n FragmentFunction,\n Props,\n MiddleStateWDomChildren,\n MiddleStateWDom,\n NodePointer,\n Component,\n} from '@/types';\n\nimport { makeNewWDomTree } from '@/diff';\nimport { wDomUpdate } from '@/render';\nimport {\n initUpdateHookState,\n initMountHookState,\n setRedrawAction,\n needDiffRef,\n componentRender,\n getComponentSubInfo,\n} from '@/utils/universalRef';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\n\nexport type Children = WDom[];\n\nexport const Fragment = (_props: Props, ...children: WDom[]) => ({\n type: 'fragment',\n children,\n});\n\nexport const h = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n ...children: MiddleStateWDomChildren\n) => {\n const nodeParentPointer: NodePointer = { value: undefined };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n\n return node;\n};\n\nexport const mount =\n <T>(component: Component<T>) =>\n (_props: T, _children: WDom[]) =>\n component;\n\nconst reRenderCustomComponent = (\n tag: TagFunction,\n props: Props,\n children: WDom[],\n originalWDom: WDom\n) => {\n needDiffRef.value = true;\n\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent, wrapElement, afterElement } = originalWDom;\n\n newWDomTree.getParent = getParent;\n\n if (!isRoot && getParent) {\n const brothers = getParent()?.children || [];\n const index = brothers.indexOf(originalWDom);\n\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\n\nconst makeWDomResolver = (tag: TagFunction, props: Props, children: WDom[]) => {\n const tagName = tag.name;\n const constructor = tag;\n // 리졸브는 컴포넌트를 새로 만든다.\n const resolve = (componentKey = props) => {\n initMountHookState(componentKey);\n\n const component = tag(props, children);\n const componentMaker = component(\n componentRender(componentKey),\n props,\n children\n );\n\n const customNode = makeCustomNode(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n const originalWDom = customNode;\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n customNode;\n\n return customNode;\n };\n\n return { tagName, constructor, props, children, resolve };\n};\n\nconst makeCustomNode = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const customNode = componentMaker(props);\n const reRender = makeReRender(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n addComponentProps(customNode, componentKey, tag, props, children, reRender);\n\n return customNode;\n};\n\nconst makeReRender = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const reRender = () =>\n wDomMaker(componentMaker, componentKey, tag, props, children, reRender);\n return reRender;\n};\n\nconst wDomMaker = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n initUpdateHookState(componentKey);\n runUpdateCallback();\n\n const originalWDom = componentMaker(props);\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n addComponentProps(originalWDom, componentKey, tag, props, children, reRender);\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n originalWDom;\n\n return originalWDom;\n};\n\nconst addComponentProps = (\n wDom: WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n Object.assign(wDom, {\n componentProps: props,\n componentChildren: children,\n constructor: tag,\n tagName: tag.name,\n componentKey,\n reRender,\n });\n};\n\nconst makeNode = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n children: WDom[]\n) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n\n return needDiffRef.value\n ? componetMakeResolver\n : componetMakeResolver.resolve();\n }\n\n return {\n type: 'element',\n tag,\n props,\n children,\n };\n};\n\nconst remakeChildren = (\n nodeParentPointer: NodePointer,\n children: MiddleStateWDomChildren\n): WDom[] =>\n children.map((item: MiddleStateWDom) => {\n const childItem = makeChildrenItem(item);\n\n childItem.getParent = () => nodeParentPointer.value;\n\n return childItem;\n });\n\nconst makeChildrenItem = (item: MiddleStateWDom): WDom => {\n if (item === null || item === undefined || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer: NodePointer = { value: undefined };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: 'loop',\n children,\n };\n nodeParentPointer.value = node;\n\n return node;\n } else if (typeof item === 'string' || typeof item === 'number') {\n return { type: 'text', text: item };\n }\n\n return item;\n};\n","export const ref = <T>(initValue: T) => ({ value: initValue });\n"],"names":["updateProps","getParent","reRender"],"mappings":"AAmBO,MAAM,+BAA+B,CAC1C,WAEC,OAAO,WAAW,cAAc,CAAC,sBAAsB,MAAM,KAC7D,OAAO,WAAW,YAAY,aAAa;AAEvC,MAAM,wBAAwB,CACnC,WAEA,OAAO,WAAW,cAAc,WAAW;AAEtC,MAAM,qBAAqB,CAAC,SACjC,OAAO,SAAS,YAAY,EAAE,aAAa;AAEhC,MAAA,iBAAiB,CAAC,MAAiB,aAC9C,mBAAmB,IAAI,KAAK,KAAK,SAAS;AAErC,MAAM,oBAAoB,CAAC,SAChC,mBAAmB,IAAI,KAAK,CAAC,KAAK;AAE7B,MAAM,2BAA2B,CACtC,SACA,iBACG,QAAQ,iBAAgB,6CAAc;AAEpC,MAAM,oBAAoB,CAC/B,SACA,iBAEA;AA7BK;AA6BL,4BAAmB,OAAO,MAC1B,6CAAc,UAAS,gBACvB,kDAAc,aAAd,mBAAwB,cAAW,wCAAS,aAAT,mBAAmB;AAAA;AAEjD,MAAM,sBAAsB,CACjC,SACA,iBAEA;AArCK;AAqCL,4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AE,MAAM,QAAQ,MAAM,KAAK;AAAA,EACpC;AAEO,SAAA;AACT;AC3PO,MAAM,MAAM,CAAI,eAAkB,EAAE,OAAO,UAAU;"}
|
|
1
|
+
{"version":3,"file":"lithent.mjs","sources":["../src/utils/predicator.ts","../src/utils/index.ts","../src/utils/universalRef.ts","../src/hook/unmount.ts","../src/hook/mountCallback.ts","../src/hook/useUpdate.ts","../src/render.ts","../src/diff.ts","../src/hook/updateCallback.ts","../src/wDom.ts","../src/hook/ref.ts"],"sourcesContent":["import { Fragment } from '@/wDom';\nimport {\n WDom,\n TagFunction,\n TagFunctionResolver,\n FragmentFunction,\n WDomType,\n} from '@/types';\n\ntype WDomParam =\n | string\n | WDom\n | TagFunction\n | TagFunctionResolver\n | FragmentFunction;\n\n/**\n * Predicator\n */\nexport const checkCustemComponentFunction = (\n target: WDomParam\n): target is TagFunction | TagFunctionResolver =>\n (typeof target === 'function' && !checkFragmentFunction(target)) ||\n (typeof target === 'object' && 'resolve' in target);\n\nexport const checkFragmentFunction = (\n target: unknown\n): target is FragmentFunction =>\n typeof target === 'function' && target === Fragment;\n\nexport const checkPlainWDomType = (wDom: WDomParam): wDom is WDom =>\n typeof wDom === 'object' && !('resolve' in wDom);\n\nexport const checkPlainType = (wDom: WDomParam, typeName: string) =>\n checkPlainWDomType(wDom) && wDom.type === typeName;\n\nexport const checkEmptyElement = (wDom: WDomParam) =>\n checkPlainWDomType(wDom) && !wDom.type;\n\nexport const checkSameCustomComponent = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => newWDom.constructor === originalWDom?.constructor;\n\nexport const checkSameFragment = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'fragment' &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkSameTagElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'element' &&\n originalWDom?.tag === newWDom.tag &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n return (\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === newWDom.type &&\n (originalWDom?.children?.length === newWDom?.children?.length ||\n newWDom.type === 'loop')\n );\n};\n\nexport const checkExisty = (value: unknown) =>\n value !== null && value !== undefined;\n\nexport const checkFunction = (target: unknown): target is Function =>\n typeof target === 'function';\n\nexport const checkStyleData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is Record<string, string> =>\n dataKey === 'style' && typeof dataValue === 'object';\n\nexport const checkRefData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is { value: HTMLElement | DocumentFragment | Text | undefined } =>\n dataKey === 'ref' && typeof dataValue === 'object';\n\nexport const checkOptionElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'OPTION';\n};\n\nexport const checkTextareaElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'TEXTAREA';\n};\n\nexport const checkCheckboxElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'checkbox';\n};\n\nexport const checkRadioElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'radio';\n};\n\nexport const checkNormalAttribute = (\n dataValue: unknown\n): dataValue is number | string =>\n typeof dataValue === 'number' || typeof dataValue === 'string';\n\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType | undefined => {\n let result: WDomType | undefined;\n\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\n return result;\n};\n\nexport const checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement,\n};\n","import { WDom, TagFunctionResolver, Props } from '@/types';\n\nexport const getParent = (vDom: WDom) => {\n const parentVDom = vDom.getParent && vDom.getParent();\n\n if (!parentVDom) {\n throw Error('Not found parent vDom');\n }\n\n return parentVDom;\n};\n\nexport const reRender = (vDom: WDom, infoVdom: TagFunctionResolver) => {\n const { componentProps: props, componentChildren: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n\n if (props) {\n updateProps(props, infoProps);\n }\n\n if (children) {\n updateChildren(children, infoChidren);\n }\n\n const newVDom = vDom.reRender && vDom.reRender();\n\n if (!newVDom) {\n throw Error('Unable reRender');\n }\n\n return newVDom;\n};\n\nconst updateProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n Object.keys(props).forEach(key => delete props[key]);\n\n Object.entries(infoProps || {}).forEach(\n ([key, value]) => (props[key] = value)\n );\n }\n};\n\nconst updateChildren = (children: WDom[], infoChidren: WDom[]) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n\n if (infoChidren) {\n infoChidren.forEach(childrenItem => children.push(childrenItem));\n }\n }\n};\n","import { ComponentRef, ComponentSubKey, Props, WDom } from '@/types';\n\ntype RedrawQueueList = {\n componentKey: Props;\n exec: () => void;\n}[];\n\n/**\n * Common\n */\nexport const componentKeyRef: { value: Props } = { value: {} };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentRef: ComponentRef = new WeakMap();\nexport const redrawQueue: {\n value: { componentKey: Props; exec: () => void }[];\n} = { value: [] };\nexport const redrawQueueTimeout: { value: null | number } = { value: null };\nexport const componentRender = (componentKey: Props) => () => {\n const up = componentRef.get(componentKey)?.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n\n return result;\n};\n\nexport const setComponetRef = (componentKey: Props) => {\n componentRef.set(componentKey, {\n vd: { value: null },\n up: () => {},\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: [],\n });\n};\n\nexport const getComponentKey = () => componentKeyRef.value;\n\nexport const getComponentSubInfo = (\n componentKey: Props,\n subKey: ComponentSubKey\n) => componentRef.get(componentKey)![subKey];\n\nexport const setRedrawAction = (componentKey: Props, exec: () => void) => {\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};\n\nexport const initUpdateHookState = (componentKey: Props) =>\n (componentKeyRef.value = componentKey);\n\nexport const initMountHookState = (componentKey: Props) => {\n componentKeyRef.value = componentKey;\n setComponetRef(componentKey);\n};\n\nconst recursiveGetChildKeys = (wDom: WDom, result: Props[]) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.componentKey;\n if (childComKey) {\n result.push(childComKey);\n }\n\n recursiveGetChildKeys(item, result);\n });\n};\n\nconst execRedrawQueue = () => {\n let childItemList: Props[] = [];\n\n redrawQueue.value.forEach(item => {\n const childVd = componentRef.get(item.componentKey)?.vd?.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n\n const addedKey: Props[] = [];\n const result = redrawQueue.value.reduce((acc, item) => {\n const { componentKey } = item;\n\n if (\n childItemList.includes(componentKey) ||\n addedKey.includes(componentKey)\n ) {\n return acc;\n }\n\n addedKey.push(componentKey);\n acc.push(item);\n\n return acc;\n }, [] as RedrawQueueList);\n\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n};\n","import { WDom, Props } from '@/types';\nimport { componentRef, getComponentKey } from '@/utils/universalRef';\n\nexport const unmount = (effectAction: () => void) => {\n componentRef.get(getComponentKey())!.umts.push(effectAction);\n};\n\nexport const runUnmountQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n removeItem(componentKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: 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};\n\nconst removeItem = (componentKey: Props) => {\n const subInfo = componentRef.get(componentKey);\n if (subInfo) {\n subInfo!.umts.forEach(effect => effect());\n subInfo!.umts = [];\n componentRef.delete(componentKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { unmount } from '@/hook/unmount';\n\nexport const mountCallback = (effectAction: () => void) => {\n const mts = componentRef.get(getComponentKey())!.mts;\n\n mts.push(effectAction);\n};\n\nexport const runMountedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.mts;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (queue) {\n component.mts = [];\n\n queue.forEach((effect: Function) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nexport const useUpdated = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component!;\n const def = upD[upS.value];\n\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component!.upCB.push(callback);\n }\n }\n\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\n\nexport const runUpdatedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.upCB;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (newWDom.constructor && queue) {\n component.upCB = [];\n queue.forEach((effect: Function) => effect());\n }\n }\n};\n\nconst checkNeedPushQueue = (originalDefs: unknown[], newDefs: unknown[]) =>\n !originalDefs.length && !originalDefs.length\n ? true\n : originalDefs.some((def, index) => def !== newDefs[index]);\n","/**\n * Rerender시 실제 dom에 반영해줘야 하는 상태\n *\n * 1. (ADD). 가상돔 비교시 오리지날이 없으면 새로 추가되는 dom으로 판단한다.\n * 2. (REPLACE). 오리지날이 있고 같은 엘리먼트타입이 아닌 경우 해당 위치의 태그 자체를 교체해준다.\n * 3. (UPDATE). 오리지날이 있고 같은 타입이면 dom의 속성만 변경해 주며, 텍스트 노드일 경우는 텍스트를 교체해준다.\n * 4. (DELETE). 오리지날이 있고 새로운 엘리먼트 타입은 null타입일 경우 dom을 삭제한다.\n * 5. (SORTED-REPLACE). loop의 경우 REPLACE라도 키값에 의해 순서가 변경될 수 있으므로 새로운 dom을 단순히 기존 위치에 교체하지 않고 새로 삼입하여 정렬한다.\n * 6. (SORTED-UPDATE). loop의 경우 UPDATE라도 키값에 의해 순서가 변경될수 있으므로 재 삽입하여 정렬한다.\n * 7. (NONE). text타입의 경우 text가 같다면 변경이 필요 없으므로 방치한다. (Todo. 다른 타입의 경우 처리필요)\n */\n\nimport { WDom, Props } from '@/types';\nimport {\n checkStyleData,\n checkRefData,\n checkNormalAttribute,\n checkExisty,\n checkOptionElement,\n checkTextareaElement,\n checkCheckboxElement,\n checkRadioElement,\n} from '@/utils/predicator';\n\nimport { componentRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { runMountedQueueFromWDom } from '@/hook/mountCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/useUpdate';\nimport { getParent } from '@/utils';\n\nexport const render = (\n wDom: WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n if (!wrapElement) {\n throw Error('WrapELement is null');\n }\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n\n const Dom = wDomToDom(wDom, true);\n\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n\n return () => {\n if (wDom.componentProps) {\n const component = componentRef.get(wDom.componentProps)?.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n }\n };\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { needRerender } = newWDomTree;\n\n if (needRerender && needRerender !== 'N') {\n const exec = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate,\n }[needRerender];\n exec(newWDomTree);\n }\n};\n\nexport const recursiveRemoveEvent = (originalWDom: WDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n\n (originalWDom.children || []).forEach((childItem: WDom) => {\n recursiveRemoveEvent(childItem);\n });\n};\n\nconst rootDelete = (newWDom: WDom) => {\n const parent = newWDom.wrapElement as HTMLElement;\n\n deleteRealDom(newWDom, parent);\n};\n\nconst typeDelete = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const parent = findRealParentElement(parentWDom) as HTMLElement;\n\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n\n deleteRealDom(newWDom, parent);\n};\n\nconst deleteRealDom = (newWDom: WDom, parent: HTMLElement) => {\n if (parent && newWDom.el) {\n if (newWDom.el?.nodeType === 1) {\n parent.removeChild(newWDom.el);\n } else if (newWDom.el?.nodeType === 11) {\n findChildWithRemoveElement(newWDom, parent as HTMLElement);\n }\n delete newWDom.el;\n }\n};\n\nconst findChildWithRemoveElement = (newWDom: WDom, parent: HTMLElement) => {\n (newWDom?.oldChildren || newWDom?.children || []).forEach(item => {\n if (item.el?.nodeType === 1) {\n parent.removeChild(item?.el);\n } else if (item.el?.nodeType === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\n\nconst typeSortedReplace = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\n\nconst typeSortedUpdate = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom, newWDom.el);\n};\n\nconst typeAdd = (\n newWDom: WDom,\n newElement?: HTMLElement | DocumentFragment | Text\n) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom, true);\n }\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === 'loop';\n\n let nextEl;\n if (isLoop) {\n nextEl = startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else {\n nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n }\n\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst startFindNextBrotherElement = (\n wDom: WDom,\n parentWDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || '';\n\n if (finedNextEl) {\n return finedNextEl;\n }\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\n return undefined;\n};\n\nconst findChildFragmentNextElement = (\n candidiateBrothers: WDom[]\n): HTMLElement | DocumentFragment | Text | undefined =>\n candidiateBrothers.reduce(\n (\n targetEl: HTMLElement | DocumentFragment | Text | undefined,\n bItem: WDom\n ) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && ['fragment', 'loop'].includes(type);\n\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\n return targetEl;\n },\n undefined\n );\n\nconst typeReplace = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n\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, true);\n\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst removeEvent = (\n oldProps: Props,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n if (element) {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey.match(/^on/)) {\n const eventName = dataKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n element.removeEventListener(\n eventName,\n dataValue as (e: Event) => void\n );\n }\n }\n );\n }\n};\n\nconst typeUpdate = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (newWDom.type === 'text') {\n updateText(newWDom);\n\n return;\n }\n\n if (element) {\n const { oldProps, props } = newWDom;\n\n updateProps(props, element, oldProps);\n\n delete newWDom.oldProps;\n\n if (newWDom.tag === 'input') {\n (element as HTMLInputElement).value = String(newWDom?.props?.value || '');\n }\n }\n\n (newWDom.children || []).forEach((childItem: WDom) => wDomUpdate(childItem));\n\n runUpdatedQueueFromWDom(newWDom);\n};\n\nconst updateText = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\n\nconst updateProps = (\n props?: Props,\n element?: HTMLElement | DocumentFragment | Text,\n oldProps?: Props\n) => {\n const originalProps = { ...oldProps };\n\n Object.entries(props || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey === 'key') {\n // Do nothing\n } else if (\n dataKey === 'innerHTML' &&\n element &&\n typeof dataValue === 'string'\n ) {\n (element as HTMLElement).innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n const style = dataValue;\n const oldStyle = checkStyleData(dataKey, originalProps.style) || {};\n\n updateStyle(style, oldStyle, element);\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else if (checkRadioElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkCheckboxElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === 'value') {\n (element as HTMLInputElement).value = dataValue as string;\n } else if (checkOptionElement(element) && dataKey === 'selected') {\n (element as HTMLOptionElement).selected = !!dataValue;\n } else if (checkNormalAttribute(dataValue)) {\n (element as HTMLElement).setAttribute(dataKey, String(dataValue));\n }\n\n delete originalProps[dataKey];\n }\n );\n\n Object.keys(originalProps).forEach(dataKey =>\n (element as HTMLElement).removeAttribute(dataKey)\n );\n};\n\nconst wDomToDom = (wDom: WDom, init: boolean) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = type === 'fragment' || type === 'loop';\n\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 }\n\n wDomChildrenToDom(children, element, init);\n updateProps(props, element);\n\n wDom.el = element;\n\n runMountedQueueFromWDom(wDom);\n\n return element || document.createElement('div');\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | DocumentFragment | Text,\n init?: boolean\n) => {\n if (init) {\n const elementChildren = children.reduce(\n (acc: DocumentFragment, childItem: WDom) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem, init));\n }\n\n return acc;\n },\n new DocumentFragment()\n );\n\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n }\n};\n\nconst updateEvent = (\n element: HTMLElement,\n eventKey: string,\n newEventHandler: (e: Event) => void,\n oldEventHandler: (e: Event) => void\n) => {\n const eventName = eventKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\n\nconst updateStyle = (\n style: Record<string, string>,\n oldStyle: Record<string, string>,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = (element as HTMLElement)?.style;\n\n if (elementStyle) {\n Object.entries(style).forEach(([styleKey, dataValue]) => {\n (elementStyle as any)[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n\n Object.entries(originalStyle).forEach(\n ([styleKey]) => ((elementStyle as any)[styleKey] = '')\n );\n }\n};\n\nconst findRealParentElement = (\n vDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const isVirtualType = vDom.type === 'fragment' || vDom.type === 'loop';\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n\n if (!isVirtualType) {\n return vDom.el as HTMLElement;\n }\n\n const parentVDom = getParent(vDom);\n\n return findRealParentElement(parentVDom);\n};\n","import { WDom, TagFunctionResolver, RenderType } from '@/types';\nimport { checkCustemComponentFunction } from '@/utils/predicator';\nimport { getParent, reRender } from '@/utils';\nimport { recursiveRemoveEvent } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExisty,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\n\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n const type = getWDomType(newWDom);\n\n if (!type) {\n throw new Error('Unknown type wdom');\n }\n\n const isSameType = checkSameWDomWithOriginal[type](newWDom, originalWDom);\n\n const result = remakeNewWDom(newWDom, isSameType, originalWDom);\n\n return result;\n};\n\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n\n remakeWDom.children = remakeChildrenForDiff(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n const needRerender = addReRenderTypeProperty(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n remakeWDom.needRerender = needRerender;\n\n if (needRerender !== 'A' && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n\n if (\n needRerender &&\n ['D', 'R', 'SR'].includes(needRerender) &&\n originalWDom?.componentKey\n ) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n remakeWDom.oldChildren = originalWDom.children;\n }\n\n remakeWDom.oldProps = originalWDom?.props;\n\n return remakeWDom;\n};\n\nconst addReRenderTypeProperty = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n): RenderType | undefined => {\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 =\n newWDom.type === 'text' &&\n isSameType &&\n newWDom.text === originalWDom?.text;\n\n let result: RenderType | undefined;\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\n return result;\n};\n\nconst generalize = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n): WDom => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom\n ? reRender(originalWDom, newWDom)\n : newWDom.resolve();\n }\n\n return newWDom;\n};\n\nconst remakeChildrenForDiff = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n) =>\n isSameType && originalWDom\n ? remakeChildrenForUpdate(newWDom, originalWDom)\n : remakeChildrenForAdd(newWDom);\n\nconst remakeChildrenForAdd = (newWDom: WDom) =>\n (newWDom.children || []).map((item: WDom) => {\n const childItem = makeNewWDomTree(item);\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) => {\n if (\n newWDom.type === 'loop' &&\n checkExisty(getKey((newWDom.children || [])[0]))\n ) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n\n return (newWDom.children || []).map((item: WDom, index: number) => {\n const childItem = makeNewWDomTree(\n item,\n (originalWDom.children || [])[index]\n );\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n};\n\nconst remakeChildrenForLoopUpdate = (newWDom: WDom, originalWDom: WDom) => {\n const { remakedChildren, unUsedChildren } = diffLoopChildren(\n newWDom,\n originalWDom\n );\n\n unUsedChildren.map(unusedItem => {\n const el = unusedItem.el;\n\n if (el && el.parentNode) {\n el.parentNode.removeChild(el);\n }\n });\n\n return remakedChildren;\n};\n\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\n const newChildren = [...(newWDom.children || [])];\n const originalChildren = [...(originalWDom.children || [])];\n\n const remakedChildren = newChildren.map(item => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\n return {\n remakedChildren,\n unUsedChildren: originalChildren,\n };\n};\n\nconst findSameKeyOriginalItem = (item: WDom, originalChildren: WDom[]) => {\n const key = getKey(item);\n\n return originalChildren.find(\n orignalChildItem => getKey(orignalChildItem) === key\n );\n};\n\nconst getKey = (target: WDom) =>\n target?.componentProps?.key ?? target?.props?.key;\n","import {\n componentRef,\n redrawQueue,\n redrawQueueTimeout,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { useUpdated } from '@/hook/useUpdate';\n\nexport const updateCallback = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const updateReqs = componentRef.get(getComponentKey())!.upR;\n\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\n\nexport const runUpdateCallback = () => {\n const updateReqs = componentRef.get(getComponentKey())?.upR;\n\n if (updateReqs?.length) {\n updateReqs.forEach(callback => callback());\n }\n\n redrawQueue.value = [];\n redrawQueueTimeout.value = null;\n};\n","import {\n WDom,\n TagFunction,\n FragmentFunction,\n Props,\n MiddleStateWDomChildren,\n MiddleStateWDom,\n NodePointer,\n Component,\n} from '@/types';\n\nimport { makeNewWDomTree } from '@/diff';\nimport { wDomUpdate } from '@/render';\nimport {\n initUpdateHookState,\n initMountHookState,\n setRedrawAction,\n needDiffRef,\n componentRender,\n getComponentSubInfo,\n} from '@/utils/universalRef';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\n\nexport type Children = WDom[];\n\nexport const Fragment = (_props: Props, ...children: WDom[]) => ({\n type: 'fragment',\n children,\n});\n\nexport const h = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n ...children: MiddleStateWDomChildren\n) => {\n const nodeParentPointer: NodePointer = { value: undefined };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n\n return node;\n};\n\nexport const mount =\n <T>(component: Component<T>) =>\n (_props: T, _children: WDom[]) =>\n component;\n\nconst reRenderCustomComponent = (\n tag: TagFunction,\n props: Props,\n children: WDom[],\n originalWDom: WDom\n) => {\n needDiffRef.value = true;\n\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent, wrapElement, afterElement } = originalWDom;\n\n newWDomTree.getParent = getParent;\n\n if (!isRoot && getParent) {\n const brothers = getParent()?.children || [];\n const index = brothers.indexOf(originalWDom);\n\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\n\nconst makeWDomResolver = (tag: TagFunction, props: Props, children: WDom[]) => {\n const tagName = tag.name;\n const constructor = tag;\n // 리졸브는 컴포넌트를 새로 만든다.\n const resolve = (componentKey = props) => {\n initMountHookState(componentKey);\n\n const component = tag(props, children);\n const componentMaker = component(\n componentRender(componentKey),\n props,\n children\n );\n\n const customNode = makeCustomNode(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n const originalWDom = customNode;\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n customNode;\n\n return customNode;\n };\n\n return { tagName, constructor, props, children, resolve };\n};\n\nconst makeCustomNode = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const customNode = componentMaker(props);\n const reRender = makeReRender(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n addComponentProps(customNode, componentKey, tag, props, children, reRender);\n\n return customNode;\n};\n\nconst makeReRender = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const reRender = () =>\n wDomMaker(componentMaker, componentKey, tag, props, children, reRender);\n return reRender;\n};\n\nconst wDomMaker = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n initUpdateHookState(componentKey);\n runUpdateCallback();\n\n const originalWDom = componentMaker(props);\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n addComponentProps(originalWDom, componentKey, tag, props, children, reRender);\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n originalWDom;\n\n return originalWDom;\n};\n\nconst addComponentProps = (\n wDom: WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n Object.assign(wDom, {\n componentProps: props,\n componentChildren: children,\n constructor: tag,\n tagName: tag.name,\n componentKey,\n reRender,\n });\n};\n\nconst makeNode = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n children: WDom[]\n) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n\n return needDiffRef.value\n ? componetMakeResolver\n : componetMakeResolver.resolve();\n }\n\n return {\n type: 'element',\n tag,\n props,\n children,\n };\n};\n\nconst remakeChildren = (\n nodeParentPointer: NodePointer,\n children: MiddleStateWDomChildren\n): WDom[] =>\n children.map((item: MiddleStateWDom) => {\n const childItem = makeChildrenItem(item);\n\n childItem.getParent = () => nodeParentPointer.value;\n\n return childItem;\n });\n\nconst makeChildrenItem = (item: MiddleStateWDom): WDom => {\n if (item === null || item === undefined || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer: NodePointer = { value: undefined };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: 'loop',\n children,\n };\n nodeParentPointer.value = node;\n\n return node;\n } else if (typeof item === 'string' || typeof item === 'number') {\n return { type: 'text', text: item };\n }\n\n return item;\n};\n","export const ref = <T>(initValue: T) => ({ value: initValue });\n"],"names":["updateProps","getParent","reRender"],"mappings":"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Q;AAAA,EACnC;AAEO,SAAA;AAAA,IACL,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAEJ;AAEA,MAAM,iBAAiB,CACrB,mBACA,aAEA,SAAS,IAAI,CAAC,SAA0B;AAChC,QAAA,YAAY,iBAAiB,IAAI;AAE7B,YAAA,YAAY,MAAM,kBAAkB;AAEvC,SAAA;AACT,CAAC;AAEH,MAAM,mBAAmB,CAAC,SAAgC;AACxD,MAAI,SAAS,QAAQ,SAAS,UAAa,SAAS,OAAO;AAClD,WAAA,EAAE,MAAM;EACN,WAAA,MAAM,QAAQ,IAAI,GAAG;AACxB,UAAA,oBAAiC,EAAE,OAAO,OAAU;AACpD,UAAA,WAAW,eAAe,mBAAmB,IAAI;AACvD,UAAM,OAAO;AAAA,MACX,MAAM;AAAA,MACN;AAAA,IAAA;AAEF,sBAAkB,QAAQ;AAEnB,WAAA;AAAA,aACE,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU;AAC/D,WAAO,EAAE,MAAM,QAAQ,MAAM,KAAK;AAAA,EACpC;AAEO,SAAA;AACT;AC3PO,MAAM,MAAM,CAAI,eAAkB,EAAE,OAAO,UAAU;"}
|
package/dist/lithent.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lithent={})}(this,(function(e){"use strict";const t=e=>"function"==typeof e&&!n(e)||"object"==typeof e&&"resolve"in e,n=e=>"function"==typeof e&&e===ie,o=e=>"object"==typeof e&&!("resolve"in e),l=(e,t)=>o(e)&&e.type===t,r=e=>o(e)&&!e.type,u=(e,t)=>{var n,l;return o(e)&&(null==t?void 0:t.type)===e.type&&((null==(n=null==t?void 0:t.children)?void 0:n.length)===(null==(l=null==e?void 0:e.children)?void 0:l.length)||"loop"===e.type)},c=e=>null!=e,i=(e,t)=>"style"===e&&"object"==typeof t,d={c:(e,t)=>e.constructor===(null==t?void 0:t.constructor),l:u,t:u,e:(e,t)=>{var n,l;return o(e)&&"element"===(null==t?void 0:t.type)&&(null==t?void 0:t.tag)===e.tag&&(null==(n=null==t?void 0:t.children)?void 0:n.length)===(null==(l=null==e?void 0:e.children)?void 0:l.length)},f:(e,t)=>{var n,l;return o(e)&&"fragment"===(null==t?void 0:t.type)&&(null==(n=null==t?void 0:t.children)?void 0:n.length)===(null==(l=null==e?void 0:e.children)?void 0:l.length)},et:u},s=e=>{const t=e.getParent&&e.getParent();if(!t)throw Error("Not found parent vDom");return t},p=(e,t)=>{e&&t!==e&&(Object.keys(e).forEach((t=>delete e[t])),Object.entries(t||{}).forEach((([t,n])=>e[t]=n)))},a=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach((t=>e.push(t))))},v={value:{}},h={value:!1},f=new WeakMap,m={value:[]},y={value:null},g=()=>v.value,E=(e,t)=>f.get(e)[t],b=(e,t)=>{f.get(e).up=()=>{m.value.push({componentKey:e,exec:t}),y.value||(y.value=setTimeout(P))}},C=e=>{v.value=e,(e=>{f.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})})(e)},R=(e,t)=>{(e.children||[]).forEach((e=>{const n=e.componentKey;n&&t.push(n),R(e,t)}))},P=()=>{let e=[];m.value.forEach((t=>{var n,o;const l=null==(o=null==(n=f.get(t.componentKey))?void 0:n.vd)?void 0:o.value;l&&R(l,e)}));const t=[],n=m.value.reduce(((n,o)=>{const{componentKey:l}=o;return e.includes(l)||t.includes(l)||(t.push(l),n.push(o)),n}),[]);for(;n.length;){const e=n.shift();e&&e.exec()}},x=e=>{const{componentKey:t}=e;t&&w(t),T(e)},T=e=>{(e.children||[]).forEach((e=>{e.componentKey?x(e):T(e)}))},w=e=>{const t=f.get(e);t&&(t.umts.forEach((e=>e())),t.umts=[],f.delete(e))},k=e=>{const{componentKey:t}=e;if(t){const e=f.get(t),n=null==e?void 0:e.mts,o=null==e?void 0:e.upS;v.value=t,o&&(o.value=0),n&&(e.mts=[],n.forEach((e=>{const t=e();var n;t&&(n=t,f.get(g()).umts.push(n))})))}},S=(e,t=(()=>[]))=>{const n=f.get(g()),{upD:o,upS:l}=n,r=o[l.value];if(r&&j(r,t())){const t=e();t&&n.upCB.push(t)}o[l.value]=t(),l.value+=1},j=(e,t)=>!e.length&&!e.length||e.some(((e,n)=>e!==t[n])),O=e=>{const{needRerender:t}=e;if(t&&"N"!==t){(0,{A:M,D:A,R:W,U:I,SR:U,SU:B}[t])(e)}},N=e=>{e.props&&e.el&&_(e.props,e.el),(e.children||[]).forEach((e=>{N(e)}))},K=e=>{const t=Q(e);D(e,t)},A=e=>{const t=s(e),n=Q(t);e.oldProps&&e.el&&_(e.oldProps,e.el),D(e,n)},D=(e,t)=>{var n,o;t&&e.el&&(1===(null==(n=e.el)?void 0:n.nodeType)?t.removeChild(e.el):11===(null==(o=e.el)?void 0:o.nodeType)&&L(e,t),delete e.el)},L=(e,t)=>{((null==e?void 0:e.oldChildren)||(null==e?void 0:e.children)||[]).forEach((e=>{var n,o;1===(null==(n=e.el)?void 0:n.nodeType)?t.removeChild(null==e?void 0:e.el):11===(null==(o=e.el)?void 0:o.nodeType)&&L(e,t)}))},U=e=>{A(e),M(e)},B=e=>{A(e),M(e,e.el)},M=(e,t)=>{t||(t=q(e,!0));const n=s(e);if(n.type){const o=Q(n);let l;l="loop"===n.type?F(n,s(n)):F(e,n),t&&o&&(l?o.insertBefore(t,l):o.appendChild(t))}k(e)},F=(e,t)=>{const n=t.children||[],o=n.indexOf(e)+1,l=n.slice(o),r=H(l),u=t.type||"";return r||(!t.isRoot&&["fragment","loop"].includes(u)?F(t,s(t)):t.isRoot&&t.afterElement?t.afterElement:void 0)},H=e=>e.reduce(((e,t)=>{const n=t.type,o=t.el,l=n&&["fragment","loop"].includes(n);return e||(l?H(t.children||[]):o&&11!==o.nodeType?o:e)}),void 0),W=e=>{const t=s(e),n=e.el;if(t.type&&n)if(11===n.nodeType)U(e);else{const o=Q(t),l=q(e,!0);o&&o.replaceChild(l,n)}k(e)},_=(e,t)=>{t&&Object.entries(e||{}).forEach((([e,n])=>{if(e.match(/^on/)){const o=e.replace(/^on(.*)/,((e,t)=>t.toLowerCase()));t.removeEventListener(o,n)}}))},I=e=>{var t;const n=e.el;if("text"!==e.type){if(n){const{oldProps:o,props:l}=e;X(l,n,o),delete e.oldProps,"input"===e.tag&&(n.value=String((null==(t=null==e?void 0:e.props)?void 0:t.value)||""))}(e.children||[]).forEach((e=>O(e))),(e=>{const{componentKey:t}=e;if(t){const n=f.get(t),o=null==n?void 0:n.upCB,l=null==n?void 0:n.upS;v.value=t,l&&(l.value=0),e.constructor&&o&&(n.upCB=[],o.forEach((e=>e())))}})(e)}else V(e)},V=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},X=(e,t,n)=>{const o={...n};Object.entries(e||{}).forEach((([e,n])=>{if("key"===e);else if("innerHTML"===e&&t&&"string"==typeof n)t.innerHTML=n;else if(i(e,n)){const l=n,r=i(e,o.style)||{};J(l,r,t)}else((e,t)=>"ref"===e&&"object"==typeof t)(e,n)?n.value=t:e.match(/^on/)?G(t,e,n,o[e]):(e=>1===e.nodeType&&"radio"===e.type)(t)&&"checked"===e||(e=>1===e.nodeType&&"checkbox"===e.type)(t)&&"checked"===e?t.checked=!!n:(e=>1===e.nodeType&&"TEXTAREA"===e.tagName)(t)&&"value"===e?t.value=n:(e=>1===e.nodeType&&"OPTION"===e.tagName)(t)&&"selected"===e?t.selected=!!n:(e=>"number"==typeof e||"string"==typeof e)(n)&&t.setAttribute(e,String(n));delete o[e]})),Object.keys(o).forEach((e=>t.removeAttribute(e)))},q=(e,t)=>{let n;const{type:o,tag:l,text:r,props:u,children:i=[]}=e;return"fragment"===o||"loop"===o?n=new DocumentFragment:"element"===o&&l?n=document.createElement(l):"text"===o&&c(r)&&(n=document.createTextNode(String(r))),z(i,n,t),X(u,n),e.el=n,k(e),n||document.createElement("div")},z=(e,t,n)=>{if(n){const o=e.reduce(((e,t)=>(t.type&&e.appendChild(q(t,n)),e)),new DocumentFragment);t&&o.hasChildNodes()&&t.appendChild(o)}},G=(e,t,n,o)=>{const l=t.replace(/^on(.*)/,((e,t)=>t.toLowerCase()));o!==n&&(o&&e.removeEventListener(l,o),n&&e.addEventListener(l,n))},J=(e,t,n)=>{const o={...t},l=null==n?void 0:n.style;l&&(Object.entries(e).forEach((([e,t])=>{l[e]=t,delete o[e]})),Object.entries(o).forEach((([e])=>l[e]="")))},Q=e=>{const t="fragment"===e.type||"loop"===e.type;if(e.isRoot&&t)return e.wrapElement;if(!t)return e.el;const n=s(e);return Q(n)},Y=(e,n)=>{const o=(e=>{let n;return t(e)?n="c":l(e,"fragment")?n="f":l(e,"element")?n="e":l(e,"loop")?n="l":l(e,"text")?n="t":r(e)&&(n="et"),n})(e);if(!o)throw new Error("Unknown type wdom");const u=d[o](e,n);return Z(e,u,n)},Z=(e,t,n)=>{const o=ee(e,t,n);o.children=te(o,t,n);const l=$(o,t,n);return o.needRerender=l,"A"!==l&&n&&(o.el=n.el),l&&["D","R","SR"].includes(l)&&(null==n?void 0:n.componentKey)&&(x(n),N(n),o.oldChildren=n.children),o.oldProps=null==n?void 0:n.props,o},$=(e,t,n)=>{const o=n&&n.type,l=r(e),u=!!e.getParent&&s(e).type,i=ce(e),d="loop"===u&&c(i),p="text"===e.type&&t&&e.text===(null==n?void 0:n.text);let a;return a=l?"D":p?"N":o?t?d?"SU":"U":d?"SR":"R":"A",a},ee=(e,n,o)=>t(e)?n&&o?((e,t)=>{const{componentProps:n,componentChildren:o}=e,{props:l,children:r}=t;n&&p(n,l),o&&a(o,r);const u=e.reRender&&e.reRender();if(!u)throw Error("Unable reRender");return u})(o,e):e.resolve():e,te=(e,t,n)=>t&&n?oe(e,n):ne(e),ne=e=>(e.children||[]).map((t=>{const n=Y(t);return n.getParent=()=>e,n})),oe=(e,t)=>"loop"===e.type&&c(ce((e.children||[])[0]))?le(e,t):(e.children||[]).map(((n,o)=>{const l=Y(n,(t.children||[])[o]);return l.getParent=()=>e,l})),le=(e,t)=>{const{remakedChildren:n,unUsedChildren:o}=re(e,t);return o.map((e=>{const t=e.el;t&&t.parentNode&&t.parentNode.removeChild(t)})),n},re=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return{remakedChildren:n.map((t=>{const n=ue(t,o),l=Y(t,n);return n&&o.splice(o.indexOf(n),1),l.getParent=()=>e,l})),unUsedChildren:o}},ue=(e,t)=>{const n=ce(e);return t.find((e=>ce(e)===n))},ce=e=>{var t,n,o;return null!=(o=null==(t=null==e?void 0:e.componentProps)?void 0:t.key)?o:null==(n=null==e?void 0:e.props)?void 0:n.key},ie=(e,...t)=>({type:"fragment",children:t}),de=(e,t,n,o)=>{var l;h.value=!0;const r=se(e,t,n),u=Y(r,o),{isRoot:c,getParent:i,wrapElement:d,afterElement:s}=o;if(u.getParent=i,!c&&i){const e=(null==(l=i())?void 0:l.children)||[],t=e.indexOf(o);e.splice(t,1,u)}else u.isRoot=!0,u.wrapElement=d,u.afterElement=s;h.value=!1,O(u)},se=(e,t,n)=>({tagName:e.name,constructor:e,props:t,children:n,resolve:(o=t)=>{C(o);const l=e(t,n)((e=>()=>{var t;const n=null==(t=f.get(e))?void 0:t.up;let o=!1;return n&&(n(),o=!0),o})(o),t,n),r=pe(l,o,e,t,n),u=r;return b(o,(()=>de(e,t,n,u))),E(o,"vd").value=r,r}}),pe=(e,t,n,o,l)=>{const r=e(o),u=ae(e,t,n,o,l);return he(r,t,n,o,l,u),r},ae=(e,t,n,o,l)=>{const r=()=>ve(e,t,n,o,l,r);return r},ve=(e,t,n,o,l,r)=>{(e=>{v.value=e})(t),(()=>{var e;const t=null==(e=f.get(g()))?void 0:e.upR;(null==t?void 0:t.length)&&t.forEach((e=>e())),m.value=[],y.value=null})();const u=e(o);return b(t,(()=>de(n,o,l,u))),he(u,t,n,o,l,r),E(t,"vd").value=u,u},he=(e,t,n,o,l,r)=>{Object.assign(e,{componentProps:o,componentChildren:l,constructor:n,tagName:n.name,componentKey:t,reRender:r})},fe=(e,o,l)=>{if(n(e))return ie(o,...l);if(t(e)){const t=se(e,o,l);return h.value?t:t.resolve()}return{type:"element",tag:e,props:o,children:l}},me=(e,t)=>t.map((t=>{const n=ye(t);return n.getParent=()=>e.value,n})),ye=e=>{if(null==e||!1===e)return{type:null};if(Array.isArray(e)){const t={value:void 0},n={type:"loop",children:me(t,e)};return t.value=n,n}return"string"==typeof e||"number"==typeof e?{type:"text",text:e}:e};e.Fragment=ie,e.h=(e,n,...o)=>{const l={value:void 0},r=n||{},u=me(l,o),c=fe(e,r,u);return t(c)||(l.value=c),c},e.mount=e=>(t,n)=>e,e.mountCallback=e=>{f.get(g()).mts.push(e)},e.ref=e=>({value:e}),e.render=(e,t,n)=>{if(!t)throw Error("WrapELement is null");e.isRoot=!0,e.wrapElement=t;const o=q(e,!0);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),()=>{var t;if(e.componentProps){const n=null==(t=f.get(e.componentProps))?void 0:t.vd.value;n&&(x(n),N(n),K(n))}}},e.updateCallback=(e,t=(()=>[]))=>{f.get(g()).upR.push((()=>S(e,t))),S(e,t)},Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).lithent={})}(this,(function(e){"use strict";const t=e=>"function"==typeof e&&!n(e)||"object"==typeof e&&"resolve"in e,n=e=>"function"==typeof e&&e===ie,o=e=>"object"==typeof e&&!("resolve"in e),l=(e,t)=>o(e)&&e.type===t,r=e=>o(e)&&!e.type,u=(e,t)=>{var n,l;return o(e)&&(null==t?void 0:t.type)===e.type&&((null==(n=null==t?void 0:t.children)?void 0:n.length)===(null==(l=null==e?void 0:e.children)?void 0:l.length)||"loop"===e.type)},c=e=>null!=e,i=(e,t)=>"style"===e&&"object"==typeof t,d={c:(e,t)=>e.constructor===(null==t?void 0:t.constructor),l:u,t:u,e:(e,t)=>{var n,l;return o(e)&&"element"===(null==t?void 0:t.type)&&(null==t?void 0:t.tag)===e.tag&&(null==(n=null==t?void 0:t.children)?void 0:n.length)===(null==(l=null==e?void 0:e.children)?void 0:l.length)},f:(e,t)=>{var n,l;return o(e)&&"fragment"===(null==t?void 0:t.type)&&(null==(n=null==t?void 0:t.children)?void 0:n.length)===(null==(l=null==e?void 0:e.children)?void 0:l.length)},et:u},s=e=>{const t=e.getParent&&e.getParent();if(!t)throw Error("Not found parent vDom");return t},p=(e,t)=>{e&&t!==e&&(Object.keys(e).forEach((t=>delete e[t])),Object.entries(t||{}).forEach((([t,n])=>e[t]=n)))},a=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach((t=>e.push(t))))},v={value:{}},h={value:!1},f=new WeakMap,m={value:[]},y={value:null},g=()=>v.value,E=(e,t)=>f.get(e)[t],b=(e,t)=>{f.get(e).up=()=>{m.value.push({componentKey:e,exec:t}),y.value||(y.value=setTimeout(P))}},C=e=>{v.value=e,(e=>{f.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})})(e)},R=(e,t)=>{(e.children||[]).forEach((e=>{const n=e.componentKey;n&&t.push(n),R(e,t)}))},P=()=>{let e=[];m.value.forEach((t=>{var n,o;const l=null==(o=null==(n=f.get(t.componentKey))?void 0:n.vd)?void 0:o.value;l&&R(l,e)}));const t=[],n=m.value.reduce(((n,o)=>{const{componentKey:l}=o;return e.includes(l)||t.includes(l)||(t.push(l),n.push(o)),n}),[]);for(;n.length;){const e=n.shift();e&&e.exec()}},x=e=>{const{componentKey:t}=e;t&&w(t),T(e)},T=e=>{(e.children||[]).forEach((e=>{e.componentKey?x(e):T(e)}))},w=e=>{const t=f.get(e);t&&(t.umts.forEach((e=>e())),t.umts=[],f.delete(e))},k=e=>{const{componentKey:t}=e;if(t){const e=f.get(t),n=null==e?void 0:e.mts,o=null==e?void 0:e.upS;v.value=t,o&&(o.value=0),n&&(e.mts=[],n.forEach((e=>{const t=e();var n;t&&(n=t,f.get(g()).umts.push(n))})))}},S=(e,t=(()=>[]))=>{const n=f.get(g()),{upD:o,upS:l}=n,r=o[l.value];if(r&&j(r,t())){const t=e();t&&n.upCB.push(t)}o[l.value]=t(),l.value+=1},j=(e,t)=>!e.length&&!e.length||e.some(((e,n)=>e!==t[n])),O=e=>{const{needRerender:t}=e;if(t&&"N"!==t){(0,{A:M,D:A,R:W,U:I,SR:U,SU:B}[t])(e)}},N=e=>{e.props&&e.el&&_(e.props,e.el),(e.children||[]).forEach((e=>{N(e)}))},K=e=>{const t=e.wrapElement;D(e,t)},A=e=>{const t=s(e),n=Q(t);e.oldProps&&e.el&&_(e.oldProps,e.el),D(e,n)},D=(e,t)=>{var n,o;t&&e.el&&(1===(null==(n=e.el)?void 0:n.nodeType)?t.removeChild(e.el):11===(null==(o=e.el)?void 0:o.nodeType)&&L(e,t),delete e.el)},L=(e,t)=>{((null==e?void 0:e.oldChildren)||(null==e?void 0:e.children)||[]).forEach((e=>{var n,o;1===(null==(n=e.el)?void 0:n.nodeType)?t.removeChild(null==e?void 0:e.el):11===(null==(o=e.el)?void 0:o.nodeType)&&L(e,t)}))},U=e=>{A(e),M(e)},B=e=>{A(e),M(e,e.el)},M=(e,t)=>{t||(t=q(e,!0));const n=s(e);if(n.type){const o=Q(n);let l;l="loop"===n.type?F(n,s(n)):F(e,n),t&&o&&(l?o.insertBefore(t,l):o.appendChild(t))}k(e)},F=(e,t)=>{const n=t.children||[],o=n.indexOf(e)+1,l=n.slice(o),r=H(l),u=t.type||"";return r||(!t.isRoot&&["fragment","loop"].includes(u)?F(t,s(t)):t.isRoot&&t.afterElement?t.afterElement:void 0)},H=e=>e.reduce(((e,t)=>{const n=t.type,o=t.el,l=n&&["fragment","loop"].includes(n);return e||(l?H(t.children||[]):o&&11!==o.nodeType?o:e)}),void 0),W=e=>{const t=s(e),n=e.el;if(t.type&&n)if(11===n.nodeType)U(e);else{const o=Q(t),l=q(e,!0);o&&o.replaceChild(l,n)}k(e)},_=(e,t)=>{t&&Object.entries(e||{}).forEach((([e,n])=>{if(e.match(/^on/)){const o=e.replace(/^on(.*)/,((e,t)=>t.toLowerCase()));t.removeEventListener(o,n)}}))},I=e=>{var t;const n=e.el;if("text"!==e.type){if(n){const{oldProps:o,props:l}=e;X(l,n,o),delete e.oldProps,"input"===e.tag&&(n.value=String((null==(t=null==e?void 0:e.props)?void 0:t.value)||""))}(e.children||[]).forEach((e=>O(e))),(e=>{const{componentKey:t}=e;if(t){const n=f.get(t),o=null==n?void 0:n.upCB,l=null==n?void 0:n.upS;v.value=t,l&&(l.value=0),e.constructor&&o&&(n.upCB=[],o.forEach((e=>e())))}})(e)}else V(e)},V=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},X=(e,t,n)=>{const o={...n};Object.entries(e||{}).forEach((([e,n])=>{if("key"===e);else if("innerHTML"===e&&t&&"string"==typeof n)t.innerHTML=n;else if(i(e,n)){const l=n,r=i(e,o.style)||{};J(l,r,t)}else((e,t)=>"ref"===e&&"object"==typeof t)(e,n)?n.value=t:e.match(/^on/)?G(t,e,n,o[e]):(e=>1===e.nodeType&&"radio"===e.type)(t)&&"checked"===e||(e=>1===e.nodeType&&"checkbox"===e.type)(t)&&"checked"===e?t.checked=!!n:(e=>1===e.nodeType&&"TEXTAREA"===e.tagName)(t)&&"value"===e?t.value=n:(e=>1===e.nodeType&&"OPTION"===e.tagName)(t)&&"selected"===e?t.selected=!!n:(e=>"number"==typeof e||"string"==typeof e)(n)&&t.setAttribute(e,String(n));delete o[e]})),Object.keys(o).forEach((e=>t.removeAttribute(e)))},q=(e,t)=>{let n;const{type:o,tag:l,text:r,props:u,children:i=[]}=e;return"fragment"===o||"loop"===o?n=new DocumentFragment:"element"===o&&l?n=document.createElement(l):"text"===o&&c(r)&&(n=document.createTextNode(String(r))),z(i,n,t),X(u,n),e.el=n,k(e),n||document.createElement("div")},z=(e,t,n)=>{if(n){const o=e.reduce(((e,t)=>(t.type&&e.appendChild(q(t,n)),e)),new DocumentFragment);t&&o.hasChildNodes()&&t.appendChild(o)}},G=(e,t,n,o)=>{const l=t.replace(/^on(.*)/,((e,t)=>t.toLowerCase()));o!==n&&(o&&e.removeEventListener(l,o),n&&e.addEventListener(l,n))},J=(e,t,n)=>{const o={...t},l=null==n?void 0:n.style;l&&(Object.entries(e).forEach((([e,t])=>{l[e]=t,delete o[e]})),Object.entries(o).forEach((([e])=>l[e]="")))},Q=e=>{const t="fragment"===e.type||"loop"===e.type;if(e.isRoot&&t)return e.wrapElement;if(!t)return e.el;const n=s(e);return Q(n)},Y=(e,n)=>{const o=(e=>{let n;return t(e)?n="c":l(e,"fragment")?n="f":l(e,"element")?n="e":l(e,"loop")?n="l":l(e,"text")?n="t":r(e)&&(n="et"),n})(e);if(!o)throw new Error("Unknown type wdom");const u=d[o](e,n);return Z(e,u,n)},Z=(e,t,n)=>{const o=ee(e,t,n);o.children=te(o,t,n);const l=$(o,t,n);return o.needRerender=l,"A"!==l&&n&&(o.el=n.el),l&&["D","R","SR"].includes(l)&&(null==n?void 0:n.componentKey)&&(x(n),N(n),o.oldChildren=n.children),o.oldProps=null==n?void 0:n.props,o},$=(e,t,n)=>{const o=n&&n.type,l=r(e),u=!!e.getParent&&s(e).type,i=ce(e),d="loop"===u&&c(i),p="text"===e.type&&t&&e.text===(null==n?void 0:n.text);let a;return a=l?"D":p?"N":o?t?d?"SU":"U":d?"SR":"R":"A",a},ee=(e,n,o)=>t(e)?n&&o?((e,t)=>{const{componentProps:n,componentChildren:o}=e,{props:l,children:r}=t;n&&p(n,l),o&&a(o,r);const u=e.reRender&&e.reRender();if(!u)throw Error("Unable reRender");return u})(o,e):e.resolve():e,te=(e,t,n)=>t&&n?oe(e,n):ne(e),ne=e=>(e.children||[]).map((t=>{const n=Y(t);return n.getParent=()=>e,n})),oe=(e,t)=>"loop"===e.type&&c(ce((e.children||[])[0]))?le(e,t):(e.children||[]).map(((n,o)=>{const l=Y(n,(t.children||[])[o]);return l.getParent=()=>e,l})),le=(e,t)=>{const{remakedChildren:n,unUsedChildren:o}=re(e,t);return o.map((e=>{const t=e.el;t&&t.parentNode&&t.parentNode.removeChild(t)})),n},re=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return{remakedChildren:n.map((t=>{const n=ue(t,o),l=Y(t,n);return n&&o.splice(o.indexOf(n),1),l.getParent=()=>e,l})),unUsedChildren:o}},ue=(e,t)=>{const n=ce(e);return t.find((e=>ce(e)===n))},ce=e=>{var t,n,o;return null!=(o=null==(t=null==e?void 0:e.componentProps)?void 0:t.key)?o:null==(n=null==e?void 0:e.props)?void 0:n.key},ie=(e,...t)=>({type:"fragment",children:t}),de=(e,t,n,o)=>{var l;h.value=!0;const r=se(e,t,n),u=Y(r,o),{isRoot:c,getParent:i,wrapElement:d,afterElement:s}=o;if(u.getParent=i,!c&&i){const e=(null==(l=i())?void 0:l.children)||[],t=e.indexOf(o);e.splice(t,1,u)}else u.isRoot=!0,u.wrapElement=d,u.afterElement=s;h.value=!1,O(u)},se=(e,t,n)=>({tagName:e.name,constructor:e,props:t,children:n,resolve:(o=t)=>{C(o);const l=e(t,n)((e=>()=>{var t;const n=null==(t=f.get(e))?void 0:t.up;let o=!1;return n&&(n(),o=!0),o})(o),t,n),r=pe(l,o,e,t,n),u=r;return b(o,(()=>de(e,t,n,u))),E(o,"vd").value=r,r}}),pe=(e,t,n,o,l)=>{const r=e(o),u=ae(e,t,n,o,l);return he(r,t,n,o,l,u),r},ae=(e,t,n,o,l)=>{const r=()=>ve(e,t,n,o,l,r);return r},ve=(e,t,n,o,l,r)=>{(e=>{v.value=e})(t),(()=>{var e;const t=null==(e=f.get(g()))?void 0:e.upR;(null==t?void 0:t.length)&&t.forEach((e=>e())),m.value=[],y.value=null})();const u=e(o);return b(t,(()=>de(n,o,l,u))),he(u,t,n,o,l,r),E(t,"vd").value=u,u},he=(e,t,n,o,l,r)=>{Object.assign(e,{componentProps:o,componentChildren:l,constructor:n,tagName:n.name,componentKey:t,reRender:r})},fe=(e,o,l)=>{if(n(e))return ie(o,...l);if(t(e)){const t=se(e,o,l);return h.value?t:t.resolve()}return{type:"element",tag:e,props:o,children:l}},me=(e,t)=>t.map((t=>{const n=ye(t);return n.getParent=()=>e.value,n})),ye=e=>{if(null==e||!1===e)return{type:null};if(Array.isArray(e)){const t={value:void 0},n={type:"loop",children:me(t,e)};return t.value=n,n}return"string"==typeof e||"number"==typeof e?{type:"text",text:e}:e};e.Fragment=ie,e.h=(e,n,...o)=>{const l={value:void 0},r=n||{},u=me(l,o),c=fe(e,r,u);return t(c)||(l.value=c),c},e.mount=e=>(t,n)=>e,e.mountCallback=e=>{f.get(g()).mts.push(e)},e.ref=e=>({value:e}),e.render=(e,t,n)=>{if(!t)throw Error("WrapELement is null");e.isRoot=!0,e.wrapElement=t;const o=q(e,!0);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),()=>{var t;if(e.componentProps){const n=null==(t=f.get(e.componentProps))?void 0:t.vd.value;n&&(x(n),N(n),K(n))}}},e.updateCallback=(e,t=(()=>[]))=>{f.get(g()).upR.push((()=>S(e,t))),S(e,t)},Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
2
2
|
//# sourceMappingURL=lithent.umd.js.map
|
package/dist/lithent.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithent.umd.js","sources":["../src/utils/predicator.ts","../src/utils/index.ts","../src/utils/universalRef.ts","../src/hook/unmount.ts","../src/hook/mountCallback.ts","../src/hook/useUpdate.ts","../src/render.ts","../src/diff.ts","../src/wDom.ts","../src/hook/updateCallback.ts","../src/hook/ref.ts"],"sourcesContent":["import { Fragment } from '@/wDom';\nimport {\n WDom,\n TagFunction,\n TagFunctionResolver,\n FragmentFunction,\n WDomType,\n} from '@/types';\n\ntype WDomParam =\n | string\n | WDom\n | TagFunction\n | TagFunctionResolver\n | FragmentFunction;\n\n/**\n * Predicator\n */\nexport const checkCustemComponentFunction = (\n target: WDomParam\n): target is TagFunction | TagFunctionResolver =>\n (typeof target === 'function' && !checkFragmentFunction(target)) ||\n (typeof target === 'object' && 'resolve' in target);\n\nexport const checkFragmentFunction = (\n target: unknown\n): target is FragmentFunction =>\n typeof target === 'function' && target === Fragment;\n\nexport const checkPlainWDomType = (wDom: WDomParam): wDom is WDom =>\n typeof wDom === 'object' && !('resolve' in wDom);\n\nexport const checkPlainType = (wDom: WDomParam, typeName: string) =>\n checkPlainWDomType(wDom) && wDom.type === typeName;\n\nexport const checkEmptyElement = (wDom: WDomParam) =>\n checkPlainWDomType(wDom) && !wDom.type;\n\nexport const checkSameCustomComponent = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => newWDom.constructor === originalWDom?.constructor;\n\nexport const checkSameFragment = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'fragment' &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkSameTagElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'element' &&\n originalWDom?.tag === newWDom.tag &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n return (\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === newWDom.type &&\n (originalWDom?.children?.length === newWDom?.children?.length ||\n newWDom.type === 'loop')\n );\n};\n\nexport const checkExisty = (value: unknown) =>\n value !== null && value !== undefined;\n\nexport const checkFunction = (target: unknown): target is Function =>\n typeof target === 'function';\n\nexport const checkStyleData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is Record<string, string> =>\n dataKey === 'style' && typeof dataValue === 'object';\n\nexport const checkRefData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is { value: HTMLElement | DocumentFragment | Text | undefined } =>\n dataKey === 'ref' && typeof dataValue === 'object';\n\nexport const checkOptionElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'OPTION';\n};\n\nexport const checkTextareaElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'TEXTAREA';\n};\n\nexport const checkCheckboxElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'checkbox';\n};\n\nexport const checkRadioElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'radio';\n};\n\nexport const checkNormalAttribute = (\n dataValue: unknown\n): dataValue is number | string =>\n typeof dataValue === 'number' || typeof dataValue === 'string';\n\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType | undefined => {\n let result: WDomType | undefined;\n\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\n return result;\n};\n\nexport const checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement,\n};\n","import { WDom, TagFunctionResolver, Props } from '@/types';\n\nexport const getParent = (vDom: WDom) => {\n const parentVDom = vDom.getParent && vDom.getParent();\n\n if (!parentVDom) {\n throw Error('Not found parent vDom');\n }\n\n return parentVDom;\n};\n\nexport const reRender = (vDom: WDom, infoVdom: TagFunctionResolver) => {\n const { componentProps: props, componentChildren: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n\n if (props) {\n updateProps(props, infoProps);\n }\n\n if (children) {\n updateChildren(children, infoChidren);\n }\n\n const newVDom = vDom.reRender && vDom.reRender();\n\n if (!newVDom) {\n throw Error('Unable reRender');\n }\n\n return newVDom;\n};\n\nconst updateProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n Object.keys(props).forEach(key => delete props[key]);\n\n Object.entries(infoProps || {}).forEach(\n ([key, value]) => (props[key] = value)\n );\n }\n};\n\nconst updateChildren = (children: WDom[], infoChidren: WDom[]) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n\n if (infoChidren) {\n infoChidren.forEach(childrenItem => children.push(childrenItem));\n }\n }\n};\n","import { ComponentRef, ComponentSubKey, Props, WDom } from '@/types';\n\ntype RedrawQueueList = {\n componentKey: Props;\n exec: () => void;\n}[];\n\n/**\n * Common\n */\nexport const componentKeyRef: { value: Props } = { value: {} };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentRef: ComponentRef = new WeakMap();\nexport const redrawQueue: {\n value: { componentKey: Props; exec: () => void }[];\n} = { value: [] };\nexport const redrawQueueTimeout: { value: null | number } = { value: null };\nexport const componentRender = (componentKey: Props) => () => {\n const up = componentRef.get(componentKey)?.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n\n return result;\n};\n\nexport const setComponetRef = (componentKey: Props) => {\n componentRef.set(componentKey, {\n vd: { value: null },\n up: () => {},\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: [],\n });\n};\n\nexport const getComponentKey = () => componentKeyRef.value;\n\nexport const getComponentSubInfo = (\n componentKey: Props,\n subKey: ComponentSubKey\n) => componentRef.get(componentKey)![subKey];\n\nexport const setRedrawAction = (componentKey: Props, exec: () => void) => {\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};\n\nexport const initUpdateHookState = (componentKey: Props) =>\n (componentKeyRef.value = componentKey);\n\nexport const initMountHookState = (componentKey: Props) => {\n componentKeyRef.value = componentKey;\n setComponetRef(componentKey);\n};\n\nconst recursiveGetChildKeys = (wDom: WDom, result: Props[]) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.componentKey;\n if (childComKey) {\n result.push(childComKey);\n }\n\n recursiveGetChildKeys(item, result);\n });\n};\n\nconst execRedrawQueue = () => {\n let childItemList: Props[] = [];\n\n redrawQueue.value.forEach(item => {\n const childVd = componentRef.get(item.componentKey)?.vd?.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n\n const addedKey: Props[] = [];\n const result = redrawQueue.value.reduce((acc, item) => {\n const { componentKey } = item;\n\n if (\n childItemList.includes(componentKey) ||\n addedKey.includes(componentKey)\n ) {\n return acc;\n }\n\n addedKey.push(componentKey);\n acc.push(item);\n\n return acc;\n }, [] as RedrawQueueList);\n\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n};\n","import { WDom, Props } from '@/types';\nimport { componentRef, getComponentKey } from '@/utils/universalRef';\n\nexport const unmount = (effectAction: () => void) => {\n componentRef.get(getComponentKey())!.umts.push(effectAction);\n};\n\nexport const runUnmountQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n removeItem(componentKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: 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};\n\nconst removeItem = (componentKey: Props) => {\n const subInfo = componentRef.get(componentKey);\n if (subInfo) {\n subInfo!.umts.forEach(effect => effect());\n subInfo!.umts = [];\n componentRef.delete(componentKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { unmount } from '@/hook/unmount';\n\nexport const mountCallback = (effectAction: () => void) => {\n const mts = componentRef.get(getComponentKey())!.mts;\n\n mts.push(effectAction);\n};\n\nexport const runMountedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.mts;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (queue) {\n component.mts = [];\n\n queue.forEach((effect: Function) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nexport const useUpdated = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component!;\n const def = upD[upS.value];\n\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component!.upCB.push(callback);\n }\n }\n\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\n\nexport const runUpdatedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.upCB;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (newWDom.constructor && queue) {\n component.upCB = [];\n queue.forEach((effect: Function) => effect());\n }\n }\n};\n\nconst checkNeedPushQueue = (originalDefs: unknown[], newDefs: unknown[]) =>\n !originalDefs.length && !originalDefs.length\n ? true\n : originalDefs.some((def, index) => def !== newDefs[index]);\n","/**\n * Rerender시 실제 dom에 반영해줘야 하는 상태\n *\n * 1. (ADD). 가상돔 비교시 오리지날이 없으면 새로 추가되는 dom으로 판단한다.\n * 2. (REPLACE). 오리지날이 있고 같은 엘리먼트타입이 아닌 경우 해당 위치의 태그 자체를 교체해준다.\n * 3. (UPDATE). 오리지날이 있고 같은 타입이면 dom의 속성만 변경해 주며, 텍스트 노드일 경우는 텍스트를 교체해준다.\n * 4. (DELETE). 오리지날이 있고 새로운 엘리먼트 타입은 null타입일 경우 dom을 삭제한다.\n * 5. (SORTED-REPLACE). loop의 경우 REPLACE라도 키값에 의해 순서가 변경될 수 있으므로 새로운 dom을 단순히 기존 위치에 교체하지 않고 새로 삼입하여 정렬한다.\n * 6. (SORTED-UPDATE). loop의 경우 UPDATE라도 키값에 의해 순서가 변경될수 있으므로 재 삽입하여 정렬한다.\n * 7. (NONE). text타입의 경우 text가 같다면 변경이 필요 없으므로 방치한다. (Todo. 다른 타입의 경우 처리필요)\n */\n\nimport { WDom, Props } from '@/types';\nimport {\n checkStyleData,\n checkRefData,\n checkNormalAttribute,\n checkExisty,\n checkOptionElement,\n checkTextareaElement,\n checkCheckboxElement,\n checkRadioElement,\n} from '@/utils/predicator';\n\nimport { componentRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { runMountedQueueFromWDom } from '@/hook/mountCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/useUpdate';\nimport { getParent } from '@/utils';\n\nexport const render = (\n wDom: WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n if (!wrapElement) {\n throw Error('WrapELement is null');\n }\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n\n const Dom = wDomToDom(wDom, true);\n\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n\n return () => {\n if (wDom.componentProps) {\n const component = componentRef.get(wDom.componentProps)?.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n }\n };\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { needRerender } = newWDomTree;\n\n if (needRerender && needRerender !== 'N') {\n const exec = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate,\n }[needRerender];\n exec(newWDomTree);\n }\n};\n\nexport const recursiveRemoveEvent = (originalWDom: WDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n\n (originalWDom.children || []).forEach((childItem: WDom) => {\n recursiveRemoveEvent(childItem);\n });\n};\n\nconst rootDelete = (newWDom: WDom) => {\n const parent = findRealParentElement(newWDom) as HTMLElement;\n\n deleteRealDom(newWDom, parent);\n};\n\nconst typeDelete = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const parent = findRealParentElement(parentWDom) as HTMLElement;\n\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n\n deleteRealDom(newWDom, parent);\n};\n\nconst deleteRealDom = (newWDom: WDom, parent: HTMLElement) => {\n if (parent && newWDom.el) {\n if (newWDom.el?.nodeType === 1) {\n parent.removeChild(newWDom.el);\n } else if (newWDom.el?.nodeType === 11) {\n findChildWithRemoveElement(newWDom, parent as HTMLElement);\n }\n delete newWDom.el;\n }\n};\n\nconst findChildWithRemoveElement = (newWDom: WDom, parent: HTMLElement) => {\n (newWDom?.oldChildren || newWDom?.children || []).forEach(item => {\n if (item.el?.nodeType === 1) {\n parent.removeChild(item?.el);\n } else if (item.el?.nodeType === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\n\nconst typeSortedReplace = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\n\nconst typeSortedUpdate = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom, newWDom.el);\n};\n\nconst typeAdd = (\n newWDom: WDom,\n newElement?: HTMLElement | DocumentFragment | Text\n) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom, true);\n }\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === 'loop';\n\n let nextEl;\n if (isLoop) {\n nextEl = startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else {\n nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n }\n\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst startFindNextBrotherElement = (\n wDom: WDom,\n parentWDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || '';\n\n if (finedNextEl) {\n return finedNextEl;\n }\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\n return undefined;\n};\n\nconst findChildFragmentNextElement = (\n candidiateBrothers: WDom[]\n): HTMLElement | DocumentFragment | Text | undefined =>\n candidiateBrothers.reduce(\n (\n targetEl: HTMLElement | DocumentFragment | Text | undefined,\n bItem: WDom\n ) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && ['fragment', 'loop'].includes(type);\n\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\n return targetEl;\n },\n undefined\n );\n\nconst typeReplace = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n\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, true);\n\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst removeEvent = (\n oldProps: Props,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n if (element) {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey.match(/^on/)) {\n const eventName = dataKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n element.removeEventListener(\n eventName,\n dataValue as (e: Event) => void\n );\n }\n }\n );\n }\n};\n\nconst typeUpdate = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (newWDom.type === 'text') {\n updateText(newWDom);\n\n return;\n }\n\n if (element) {\n const { oldProps, props } = newWDom;\n\n updateProps(props, element, oldProps);\n\n delete newWDom.oldProps;\n\n if (newWDom.tag === 'input') {\n (element as HTMLInputElement).value = String(newWDom?.props?.value || '');\n }\n }\n\n (newWDom.children || []).forEach((childItem: WDom) => wDomUpdate(childItem));\n\n runUpdatedQueueFromWDom(newWDom);\n};\n\nconst updateText = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\n\nconst updateProps = (\n props?: Props,\n element?: HTMLElement | DocumentFragment | Text,\n oldProps?: Props\n) => {\n const originalProps = { ...oldProps };\n\n Object.entries(props || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey === 'key') {\n // Do nothing\n } else if (\n dataKey === 'innerHTML' &&\n element &&\n typeof dataValue === 'string'\n ) {\n (element as HTMLElement).innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n const style = dataValue;\n const oldStyle = checkStyleData(dataKey, originalProps.style) || {};\n\n updateStyle(style, oldStyle, element);\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else if (checkRadioElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkCheckboxElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === 'value') {\n (element as HTMLInputElement).value = dataValue as string;\n } else if (checkOptionElement(element) && dataKey === 'selected') {\n (element as HTMLOptionElement).selected = !!dataValue;\n } else if (checkNormalAttribute(dataValue)) {\n (element as HTMLElement).setAttribute(dataKey, String(dataValue));\n }\n\n delete originalProps[dataKey];\n }\n );\n\n Object.keys(originalProps).forEach(dataKey =>\n (element as HTMLElement).removeAttribute(dataKey)\n );\n};\n\nconst wDomToDom = (wDom: WDom, init: boolean) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = type === 'fragment' || type === 'loop';\n\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 }\n\n wDomChildrenToDom(children, element, init);\n updateProps(props, element);\n\n wDom.el = element;\n\n runMountedQueueFromWDom(wDom);\n\n return element || document.createElement('div');\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | DocumentFragment | Text,\n init?: boolean\n) => {\n if (init) {\n const elementChildren = children.reduce(\n (acc: DocumentFragment, childItem: WDom) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem, init));\n }\n\n return acc;\n },\n new DocumentFragment()\n );\n\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n }\n};\n\nconst updateEvent = (\n element: HTMLElement,\n eventKey: string,\n newEventHandler: (e: Event) => void,\n oldEventHandler: (e: Event) => void\n) => {\n const eventName = eventKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\n\nconst updateStyle = (\n style: Record<string, string>,\n oldStyle: Record<string, string>,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = (element as HTMLElement)?.style;\n\n if (elementStyle) {\n Object.entries(style).forEach(([styleKey, dataValue]) => {\n (elementStyle as any)[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n\n Object.entries(originalStyle).forEach(\n ([styleKey]) => ((elementStyle as any)[styleKey] = '')\n );\n }\n};\n\nconst findRealParentElement = (\n vDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const isVirtualType = vDom.type === 'fragment' || vDom.type === 'loop';\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n\n if (!isVirtualType) {\n return vDom.el as HTMLElement;\n }\n\n const parentVDom = getParent(vDom);\n\n return findRealParentElement(parentVDom);\n};\n","import { WDom, TagFunctionResolver, RenderType } from '@/types';\nimport { checkCustemComponentFunction } from '@/utils/predicator';\nimport { getParent, reRender } from '@/utils';\nimport { recursiveRemoveEvent } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExisty,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\n\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n const type = getWDomType(newWDom);\n\n if (!type) {\n throw new Error('Unknown type wdom');\n }\n\n const isSameType = checkSameWDomWithOriginal[type](newWDom, originalWDom);\n\n const result = remakeNewWDom(newWDom, isSameType, originalWDom);\n\n return result;\n};\n\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n\n remakeWDom.children = remakeChildrenForDiff(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n const needRerender = addReRenderTypeProperty(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n remakeWDom.needRerender = needRerender;\n\n if (needRerender !== 'A' && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n\n if (\n needRerender &&\n ['D', 'R', 'SR'].includes(needRerender) &&\n originalWDom?.componentKey\n ) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n remakeWDom.oldChildren = originalWDom.children;\n }\n\n remakeWDom.oldProps = originalWDom?.props;\n\n return remakeWDom;\n};\n\nconst addReRenderTypeProperty = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n): RenderType | undefined => {\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 =\n newWDom.type === 'text' &&\n isSameType &&\n newWDom.text === originalWDom?.text;\n\n let result: RenderType | undefined;\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\n return result;\n};\n\nconst generalize = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n): WDom => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom\n ? reRender(originalWDom, newWDom)\n : newWDom.resolve();\n }\n\n return newWDom;\n};\n\nconst remakeChildrenForDiff = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n) =>\n isSameType && originalWDom\n ? remakeChildrenForUpdate(newWDom, originalWDom)\n : remakeChildrenForAdd(newWDom);\n\nconst remakeChildrenForAdd = (newWDom: WDom) =>\n (newWDom.children || []).map((item: WDom) => {\n const childItem = makeNewWDomTree(item);\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) => {\n if (\n newWDom.type === 'loop' &&\n checkExisty(getKey((newWDom.children || [])[0]))\n ) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n\n return (newWDom.children || []).map((item: WDom, index: number) => {\n const childItem = makeNewWDomTree(\n item,\n (originalWDom.children || [])[index]\n );\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n};\n\nconst remakeChildrenForLoopUpdate = (newWDom: WDom, originalWDom: WDom) => {\n const { remakedChildren, unUsedChildren } = diffLoopChildren(\n newWDom,\n originalWDom\n );\n\n unUsedChildren.map(unusedItem => {\n const el = unusedItem.el;\n\n if (el && el.parentNode) {\n el.parentNode.removeChild(el);\n }\n });\n\n return remakedChildren;\n};\n\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\n const newChildren = [...(newWDom.children || [])];\n const originalChildren = [...(originalWDom.children || [])];\n\n const remakedChildren = newChildren.map(item => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\n return {\n remakedChildren,\n unUsedChildren: originalChildren,\n };\n};\n\nconst findSameKeyOriginalItem = (item: WDom, originalChildren: WDom[]) => {\n const key = getKey(item);\n\n return originalChildren.find(\n orignalChildItem => getKey(orignalChildItem) === key\n );\n};\n\nconst getKey = (target: WDom) =>\n target?.componentProps?.key ?? target?.props?.key;\n","import {\n WDom,\n TagFunction,\n FragmentFunction,\n Props,\n MiddleStateWDomChildren,\n MiddleStateWDom,\n NodePointer,\n Component,\n} from '@/types';\n\nimport { makeNewWDomTree } from '@/diff';\nimport { wDomUpdate } from '@/render';\nimport {\n initUpdateHookState,\n initMountHookState,\n setRedrawAction,\n needDiffRef,\n componentRender,\n getComponentSubInfo,\n} from '@/utils/universalRef';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\n\nexport type Children = WDom[];\n\nexport const Fragment = (_props: Props, ...children: WDom[]) => ({\n type: 'fragment',\n children,\n});\n\nexport const h = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n ...children: MiddleStateWDomChildren\n) => {\n const nodeParentPointer: NodePointer = { value: undefined };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n\n return node;\n};\n\nexport const mount =\n <T>(component: Component<T>) =>\n (_props: T, _children: WDom[]) =>\n component;\n\nconst reRenderCustomComponent = (\n tag: TagFunction,\n props: Props,\n children: WDom[],\n originalWDom: WDom\n) => {\n needDiffRef.value = true;\n\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent, wrapElement, afterElement } = originalWDom;\n\n newWDomTree.getParent = getParent;\n\n if (!isRoot && getParent) {\n const brothers = getParent()?.children || [];\n const index = brothers.indexOf(originalWDom);\n\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\n\nconst makeWDomResolver = (tag: TagFunction, props: Props, children: WDom[]) => {\n const tagName = tag.name;\n const constructor = tag;\n // 리졸브는 컴포넌트를 새로 만든다.\n const resolve = (componentKey = props) => {\n initMountHookState(componentKey);\n\n const component = tag(props, children);\n const componentMaker = component(\n componentRender(componentKey),\n props,\n children\n );\n\n const customNode = makeCustomNode(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n const originalWDom = customNode;\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n customNode;\n\n return customNode;\n };\n\n return { tagName, constructor, props, children, resolve };\n};\n\nconst makeCustomNode = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const customNode = componentMaker(props);\n const reRender = makeReRender(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n addComponentProps(customNode, componentKey, tag, props, children, reRender);\n\n return customNode;\n};\n\nconst makeReRender = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const reRender = () =>\n wDomMaker(componentMaker, componentKey, tag, props, children, reRender);\n return reRender;\n};\n\nconst wDomMaker = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n initUpdateHookState(componentKey);\n runUpdateCallback();\n\n const originalWDom = componentMaker(props);\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n addComponentProps(originalWDom, componentKey, tag, props, children, reRender);\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n originalWDom;\n\n return originalWDom;\n};\n\nconst addComponentProps = (\n wDom: WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n Object.assign(wDom, {\n componentProps: props,\n componentChildren: children,\n constructor: tag,\n tagName: tag.name,\n componentKey,\n reRender,\n });\n};\n\nconst makeNode = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n children: WDom[]\n) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n\n return needDiffRef.value\n ? componetMakeResolver\n : componetMakeResolver.resolve();\n }\n\n return {\n type: 'element',\n tag,\n props,\n children,\n };\n};\n\nconst remakeChildren = (\n nodeParentPointer: NodePointer,\n children: MiddleStateWDomChildren\n): WDom[] =>\n children.map((item: MiddleStateWDom) => {\n const childItem = makeChildrenItem(item);\n\n childItem.getParent = () => nodeParentPointer.value;\n\n return childItem;\n });\n\nconst makeChildrenItem = (item: MiddleStateWDom): WDom => {\n if (item === null || item === undefined || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer: NodePointer = { value: undefined };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: 'loop',\n children,\n };\n nodeParentPointer.value = node;\n\n return node;\n } else if (typeof item === 'string' || typeof item === 'number') {\n return { type: 'text', text: item };\n }\n\n return item;\n};\n","import {\n componentRef,\n redrawQueue,\n redrawQueueTimeout,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { useUpdated } from '@/hook/useUpdate';\n\nexport const updateCallback = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const updateReqs = componentRef.get(getComponentKey())!.upR;\n\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\n\nexport const runUpdateCallback = () => {\n const updateReqs = componentRef.get(getComponentKey())?.upR;\n\n if (updateReqs?.length) {\n updateReqs.forEach(callback => callback());\n }\n\n redrawQueue.value = [];\n redrawQueueTimeout.value = null;\n};\n","export const ref = <T>(initValue: T) => ({ value: initValue });\n"],"names":["checkCustemComponentFunction","target","checkFragmentFunction","Fragment","checkPlainWDomType","wDom","checkPlainType","typeName","type","checkEmptyElement","checkNormalTypeElement","newWDom","originalWDom","_a","children","length","_b","checkExisty","value","checkStyleData","dataKey","dataValue","checkSameWDomWithOriginal","c","constructor","l","t","e","tag","f","et","getParent","vDom","parentVDom","Error","updateProps","props","infoProps","Object","keys","forEach","key","entries","updateChildren","infoChidren","splice","childrenItem","push","componentKeyRef","needDiffRef","componentRef","WeakMap","redrawQueue","redrawQueueTimeout","getComponentKey","getComponentSubInfo","componentKey","subKey","get","setRedrawAction","exec","up","setTimeout","execRedrawQueue","initMountHookState","set","vd","upR","upS","upD","upCB","mts","umts","setComponetRef","recursiveGetChildKeys","result","item","childComKey","childItemList","childVd","addedKey","reduce","acc","includes","action","shift","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","subInfo","effect","delete","runMountedQueueFromWDom","component","queue","sequence","callback","effectAction","useUpdated","dependencies","def","checkNeedPushQueue","originalDefs","newDefs","some","index","wDomUpdate","newWDomTree","needRerender","A","typeAdd","D","typeDelete","R","typeReplace","U","typeUpdate","SR","typeSortedReplace","SU","typeSortedUpdate","recursiveRemoveEvent","el","removeEvent","childItem","rootDelete","parent","findRealParentElement","deleteRealDom","parentWDom","oldProps","nodeType","removeChild","findChildWithRemoveElement","oldChildren","newElement","wDomToDom","parentEl","nextEl","startFindNextBrotherElement","insertBefore","appendChild","brothers","nextIndex","indexOf","candidiateBrothers","slice","finedNextEl","findChildFragmentNextElement","parentType","isRoot","afterElement","targetEl","bItem","isFragment","orignalElement","parentElement","replaceChild","element","match","eventName","replace","_match","p1","toLowerCase","removeEventListener","String","runUpdatedQueueFromWDom","updateText","nodeValue","text","originalProps","innerHTML","style","oldStyle","updateStyle","checkRefData","updateEvent","checkRadioElement","checkCheckboxElement","checked","tagName","checkTextareaElement","checkOptionElement","selected","checkNormalAttribute","setAttribute","removeAttribute","init","DocumentFragment","document","createElement","createTextNode","wDomChildrenToDom","elementChildren","hasChildNodes","eventKey","newEventHandler","oldEventHandler","addEventListener","originalStyle","elementStyle","styleKey","isVirtualType","wrapElement","makeNewWDomTree","getWDomType","isSameType","remakeNewWDom","remakeWDom","generalize","remakeChildrenForDiff","addReRenderTypeProperty","existOriginalWDom","isEmptyElement","getKey","isKeyCheckedWDom","isSameText","infoVdom","componentProps","componentChildren","newVDom","reRender","resolve","remakeChildrenForUpdate","remakeChildrenForAdd","map","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","parentNode","newChildren","originalChildren","originalItem","findSameKeyOriginalItem","find","orignalChildItem","_c","_props","reRenderCustomComponent","makeWDomResolver","name","componentMaker","componentRender","customNode","makeCustomNode","makeReRender","addComponentProps","wDomMaker","initUpdateHookState","updateReqs","assign","makeNode","componetMakeResolver","remakeChildren","nodeParentPointer","makeChildrenItem","Array","isArray","node","newProps","_children","initValue","Dom"],"mappings":"+OAmBO,MAAMA,EACXC,GAEmB,mBAAXA,IAA0BC,EAAsBD,IACrC,iBAAXA,GAAuB,YAAaA,EAEjCC,EACXD,GAEkB,mBAAXA,GAAyBA,IAAWE,GAEhCC,EAAsBC,GACjB,iBAATA,KAAuB,YAAaA,GAEhCC,EAAiB,CAACD,EAAiBE,IAC9CH,EAAmBC,IAASA,EAAKG,OAASD,EAE/BE,EAAqBJ,GAChCD,EAAmBC,KAAUA,EAAKG,KAwBvBE,EAAyB,CACpCC,EACAC,aAEA,OACER,EAAmBO,KACL,MAAdC,OAAc,EAAAA,EAAAJ,QAASG,EAAQH,QAC9B,OAAAK,EAAA,MAAAD,OAAA,EAAAA,EAAcE,eAAd,EAAAD,EAAwBE,WAAW,OAAAC,EAAS,MAAAL,OAAA,EAAAA,EAAAG,eAAU,EAAAE,EAAAD,SACpC,SAAjBJ,EAAQH,KAAS,EAIVS,EAAeC,GAC1BA,QAKWC,EAAiB,CAC5BC,EACAC,IAEY,UAAZD,GAA4C,iBAAdC,EAmDnBC,EAA4B,CACvCC,EAhGsC,CACtCZ,EACAC,IACGD,EAAQa,eAA8B,MAAdZ,OAAc,EAAAA,EAAAY,aA8FzCC,EAAGf,EACHgB,EAAGhB,EACHiB,EAtFiC,CACjChB,EACAC,aAEA,OAAAR,EAAmBO,IACI,aAAT,MAAdC,OAAc,EAAAA,EAAAJ,QACA,MAAdI,OAAc,EAAAA,EAAAgB,OAAQjB,EAAQiB,MAC9B,OAAAf,mBAAcC,eAAd,EAAAD,EAAwBE,WAAW,OAAAC,EAAA,MAAAL,OAAA,EAAAA,EAASG,eAAU,EAAAE,EAAAD,OAAA,EAgFtDc,EA/F+B,CAC/BlB,EACAC,aAEmB,OAAAR,EAAAO,IAC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O,EAAU7B,GAM9B,OAJFzO,EAA6BqQ,KAChCJ,EAAkB/O,MAAQmP,GAGrBA,CAAA,UAIHxK,GACJ,CAACmJ,EAAWuB,IACV1K,kBJ7C0BI,IAChB/C,EAAaQ,IAAIJ,KAAoBiB,IAE7CxB,KAAKkD,EAAY,QMZAuK,IAAkB,CAAEtP,MAAOsP,aJ8B5B,CACpBnQ,EACAuM,EACArD,KAEA,IAAKqD,EACH,MAAM1K,MAAM,uBAEd7B,EAAKiJ,QAAS,EACdjJ,EAAKuM,YAAcA,EAEb,MAAA6D,EAAMjI,EAAUnI,GAAM,GAS5B,OAPIkJ,GACFlJ,EAAKkJ,aAAeA,EACRqD,EAAAhE,aAAa6H,EAAKlH,IAE9BqD,EAAY/D,YAAY4H,GAGnB,WACL,GAAIpQ,EAAKsN,eAAgB,CACvB,MAAM9H,EAAY,OAAAhF,EAAaqC,EAAAQ,IAAIrD,EAAKsN,0BAAiBzJ,GAAGhD,MACxD2E,IACFP,EAAwBO,GACxB4B,EAAqB5B,GACrBgC,EAAWhC,GAEf,EAAA,mBGjD0B,CAC5BI,EACAE,EAA4B,KAAM,OAEfjD,EAAaQ,IAAIJ,KAAoBa,IAE7CpB,MAAK,IAAMmD,EAAWD,EAAcE,KAC/CD,EAAWD,EAAcE,EAAY"}
|
|
1
|
+
{"version":3,"file":"lithent.umd.js","sources":["../src/utils/predicator.ts","../src/utils/index.ts","../src/utils/universalRef.ts","../src/hook/unmount.ts","../src/hook/mountCallback.ts","../src/hook/useUpdate.ts","../src/render.ts","../src/diff.ts","../src/wDom.ts","../src/hook/updateCallback.ts","../src/hook/ref.ts"],"sourcesContent":["import { Fragment } from '@/wDom';\nimport {\n WDom,\n TagFunction,\n TagFunctionResolver,\n FragmentFunction,\n WDomType,\n} from '@/types';\n\ntype WDomParam =\n | string\n | WDom\n | TagFunction\n | TagFunctionResolver\n | FragmentFunction;\n\n/**\n * Predicator\n */\nexport const checkCustemComponentFunction = (\n target: WDomParam\n): target is TagFunction | TagFunctionResolver =>\n (typeof target === 'function' && !checkFragmentFunction(target)) ||\n (typeof target === 'object' && 'resolve' in target);\n\nexport const checkFragmentFunction = (\n target: unknown\n): target is FragmentFunction =>\n typeof target === 'function' && target === Fragment;\n\nexport const checkPlainWDomType = (wDom: WDomParam): wDom is WDom =>\n typeof wDom === 'object' && !('resolve' in wDom);\n\nexport const checkPlainType = (wDom: WDomParam, typeName: string) =>\n checkPlainWDomType(wDom) && wDom.type === typeName;\n\nexport const checkEmptyElement = (wDom: WDomParam) =>\n checkPlainWDomType(wDom) && !wDom.type;\n\nexport const checkSameCustomComponent = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => newWDom.constructor === originalWDom?.constructor;\n\nexport const checkSameFragment = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'fragment' &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkSameTagElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === 'element' &&\n originalWDom?.tag === newWDom.tag &&\n originalWDom?.children?.length === newWDom?.children?.length;\n\nexport const checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n return (\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === newWDom.type &&\n (originalWDom?.children?.length === newWDom?.children?.length ||\n newWDom.type === 'loop')\n );\n};\n\nexport const checkExisty = (value: unknown) =>\n value !== null && value !== undefined;\n\nexport const checkFunction = (target: unknown): target is Function =>\n typeof target === 'function';\n\nexport const checkStyleData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is Record<string, string> =>\n dataKey === 'style' && typeof dataValue === 'object';\n\nexport const checkRefData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is { value: HTMLElement | DocumentFragment | Text | undefined } =>\n dataKey === 'ref' && typeof dataValue === 'object';\n\nexport const checkOptionElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'OPTION';\n};\n\nexport const checkTextareaElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.tagName === 'TEXTAREA';\n};\n\nexport const checkCheckboxElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'checkbox';\n};\n\nexport const checkRadioElement = (element: any): element is HTMLElement => {\n return element.nodeType === 1 && element.type === 'radio';\n};\n\nexport const checkNormalAttribute = (\n dataValue: unknown\n): dataValue is number | string =>\n typeof dataValue === 'number' || typeof dataValue === 'string';\n\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType | undefined => {\n let result: WDomType | undefined;\n\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\n return result;\n};\n\nexport const checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement,\n};\n","import { WDom, TagFunctionResolver, Props } from '@/types';\n\nexport const getParent = (vDom: WDom) => {\n const parentVDom = vDom.getParent && vDom.getParent();\n\n if (!parentVDom) {\n throw Error('Not found parent vDom');\n }\n\n return parentVDom;\n};\n\nexport const reRender = (vDom: WDom, infoVdom: TagFunctionResolver) => {\n const { componentProps: props, componentChildren: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n\n if (props) {\n updateProps(props, infoProps);\n }\n\n if (children) {\n updateChildren(children, infoChidren);\n }\n\n const newVDom = vDom.reRender && vDom.reRender();\n\n if (!newVDom) {\n throw Error('Unable reRender');\n }\n\n return newVDom;\n};\n\nconst updateProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n Object.keys(props).forEach(key => delete props[key]);\n\n Object.entries(infoProps || {}).forEach(\n ([key, value]) => (props[key] = value)\n );\n }\n};\n\nconst updateChildren = (children: WDom[], infoChidren: WDom[]) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n\n if (infoChidren) {\n infoChidren.forEach(childrenItem => children.push(childrenItem));\n }\n }\n};\n","import { ComponentRef, ComponentSubKey, Props, WDom } from '@/types';\n\ntype RedrawQueueList = {\n componentKey: Props;\n exec: () => void;\n}[];\n\n/**\n * Common\n */\nexport const componentKeyRef: { value: Props } = { value: {} };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentRef: ComponentRef = new WeakMap();\nexport const redrawQueue: {\n value: { componentKey: Props; exec: () => void }[];\n} = { value: [] };\nexport const redrawQueueTimeout: { value: null | number } = { value: null };\nexport const componentRender = (componentKey: Props) => () => {\n const up = componentRef.get(componentKey)?.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n\n return result;\n};\n\nexport const setComponetRef = (componentKey: Props) => {\n componentRef.set(componentKey, {\n vd: { value: null },\n up: () => {},\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: [],\n });\n};\n\nexport const getComponentKey = () => componentKeyRef.value;\n\nexport const getComponentSubInfo = (\n componentKey: Props,\n subKey: ComponentSubKey\n) => componentRef.get(componentKey)![subKey];\n\nexport const setRedrawAction = (componentKey: Props, exec: () => void) => {\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};\n\nexport const initUpdateHookState = (componentKey: Props) =>\n (componentKeyRef.value = componentKey);\n\nexport const initMountHookState = (componentKey: Props) => {\n componentKeyRef.value = componentKey;\n setComponetRef(componentKey);\n};\n\nconst recursiveGetChildKeys = (wDom: WDom, result: Props[]) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.componentKey;\n if (childComKey) {\n result.push(childComKey);\n }\n\n recursiveGetChildKeys(item, result);\n });\n};\n\nconst execRedrawQueue = () => {\n let childItemList: Props[] = [];\n\n redrawQueue.value.forEach(item => {\n const childVd = componentRef.get(item.componentKey)?.vd?.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n\n const addedKey: Props[] = [];\n const result = redrawQueue.value.reduce((acc, item) => {\n const { componentKey } = item;\n\n if (\n childItemList.includes(componentKey) ||\n addedKey.includes(componentKey)\n ) {\n return acc;\n }\n\n addedKey.push(componentKey);\n acc.push(item);\n\n return acc;\n }, [] as RedrawQueueList);\n\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n};\n","import { WDom, Props } from '@/types';\nimport { componentRef, getComponentKey } from '@/utils/universalRef';\n\nexport const unmount = (effectAction: () => void) => {\n componentRef.get(getComponentKey())!.umts.push(effectAction);\n};\n\nexport const runUnmountQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n removeItem(componentKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: 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};\n\nconst removeItem = (componentKey: Props) => {\n const subInfo = componentRef.get(componentKey);\n if (subInfo) {\n subInfo!.umts.forEach(effect => effect());\n subInfo!.umts = [];\n componentRef.delete(componentKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { unmount } from '@/hook/unmount';\n\nexport const mountCallback = (effectAction: () => void) => {\n const mts = componentRef.get(getComponentKey())!.mts;\n\n mts.push(effectAction);\n};\n\nexport const runMountedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.mts;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (queue) {\n component.mts = [];\n\n queue.forEach((effect: Function) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\n","import { WDom } from '@/types';\nimport {\n componentKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\n\nexport const useUpdated = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component!;\n const def = upD[upS.value];\n\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component!.upCB.push(callback);\n }\n }\n\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\n\nexport const runUpdatedQueueFromWDom = (newWDom: WDom) => {\n const { componentKey } = newWDom;\n\n if (componentKey) {\n const component = componentRef.get(componentKey);\n const queue = component?.upCB;\n const sequence = component?.upS;\n\n componentKeyRef.value = componentKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (newWDom.constructor && queue) {\n component.upCB = [];\n queue.forEach((effect: Function) => effect());\n }\n }\n};\n\nconst checkNeedPushQueue = (originalDefs: unknown[], newDefs: unknown[]) =>\n !originalDefs.length && !originalDefs.length\n ? true\n : originalDefs.some((def, index) => def !== newDefs[index]);\n","/**\n * Rerender시 실제 dom에 반영해줘야 하는 상태\n *\n * 1. (ADD). 가상돔 비교시 오리지날이 없으면 새로 추가되는 dom으로 판단한다.\n * 2. (REPLACE). 오리지날이 있고 같은 엘리먼트타입이 아닌 경우 해당 위치의 태그 자체를 교체해준다.\n * 3. (UPDATE). 오리지날이 있고 같은 타입이면 dom의 속성만 변경해 주며, 텍스트 노드일 경우는 텍스트를 교체해준다.\n * 4. (DELETE). 오리지날이 있고 새로운 엘리먼트 타입은 null타입일 경우 dom을 삭제한다.\n * 5. (SORTED-REPLACE). loop의 경우 REPLACE라도 키값에 의해 순서가 변경될 수 있으므로 새로운 dom을 단순히 기존 위치에 교체하지 않고 새로 삼입하여 정렬한다.\n * 6. (SORTED-UPDATE). loop의 경우 UPDATE라도 키값에 의해 순서가 변경될수 있으므로 재 삽입하여 정렬한다.\n * 7. (NONE). text타입의 경우 text가 같다면 변경이 필요 없으므로 방치한다. (Todo. 다른 타입의 경우 처리필요)\n */\n\nimport { WDom, Props } from '@/types';\nimport {\n checkStyleData,\n checkRefData,\n checkNormalAttribute,\n checkExisty,\n checkOptionElement,\n checkTextareaElement,\n checkCheckboxElement,\n checkRadioElement,\n} from '@/utils/predicator';\n\nimport { componentRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { runMountedQueueFromWDom } from '@/hook/mountCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/useUpdate';\nimport { getParent } from '@/utils';\n\nexport const render = (\n wDom: WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n if (!wrapElement) {\n throw Error('WrapELement is null');\n }\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n\n const Dom = wDomToDom(wDom, true);\n\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n\n return () => {\n if (wDom.componentProps) {\n const component = componentRef.get(wDom.componentProps)?.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n }\n };\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { needRerender } = newWDomTree;\n\n if (needRerender && needRerender !== 'N') {\n const exec = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate,\n }[needRerender];\n exec(newWDomTree);\n }\n};\n\nexport const recursiveRemoveEvent = (originalWDom: WDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n\n (originalWDom.children || []).forEach((childItem: WDom) => {\n recursiveRemoveEvent(childItem);\n });\n};\n\nconst rootDelete = (newWDom: WDom) => {\n const parent = newWDom.wrapElement as HTMLElement;\n\n deleteRealDom(newWDom, parent);\n};\n\nconst typeDelete = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const parent = findRealParentElement(parentWDom) as HTMLElement;\n\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n\n deleteRealDom(newWDom, parent);\n};\n\nconst deleteRealDom = (newWDom: WDom, parent: HTMLElement) => {\n if (parent && newWDom.el) {\n if (newWDom.el?.nodeType === 1) {\n parent.removeChild(newWDom.el);\n } else if (newWDom.el?.nodeType === 11) {\n findChildWithRemoveElement(newWDom, parent as HTMLElement);\n }\n delete newWDom.el;\n }\n};\n\nconst findChildWithRemoveElement = (newWDom: WDom, parent: HTMLElement) => {\n (newWDom?.oldChildren || newWDom?.children || []).forEach(item => {\n if (item.el?.nodeType === 1) {\n parent.removeChild(item?.el);\n } else if (item.el?.nodeType === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\n\nconst typeSortedReplace = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\n\nconst typeSortedUpdate = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom, newWDom.el);\n};\n\nconst typeAdd = (\n newWDom: WDom,\n newElement?: HTMLElement | DocumentFragment | Text\n) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom, true);\n }\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === 'loop';\n\n let nextEl;\n if (isLoop) {\n nextEl = startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else {\n nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n }\n\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst startFindNextBrotherElement = (\n wDom: WDom,\n parentWDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || '';\n\n if (finedNextEl) {\n return finedNextEl;\n }\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\n return undefined;\n};\n\nconst findChildFragmentNextElement = (\n candidiateBrothers: WDom[]\n): HTMLElement | DocumentFragment | Text | undefined =>\n candidiateBrothers.reduce(\n (\n targetEl: HTMLElement | DocumentFragment | Text | undefined,\n bItem: WDom\n ) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && ['fragment', 'loop'].includes(type);\n\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\n return targetEl;\n },\n undefined\n );\n\nconst typeReplace = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n\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, true);\n\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n }\n }\n\n runMountedQueueFromWDom(newWDom);\n};\n\nconst removeEvent = (\n oldProps: Props,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n if (element) {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey.match(/^on/)) {\n const eventName = dataKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n element.removeEventListener(\n eventName,\n dataValue as (e: Event) => void\n );\n }\n }\n );\n }\n};\n\nconst typeUpdate = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (newWDom.type === 'text') {\n updateText(newWDom);\n\n return;\n }\n\n if (element) {\n const { oldProps, props } = newWDom;\n\n updateProps(props, element, oldProps);\n\n delete newWDom.oldProps;\n\n if (newWDom.tag === 'input') {\n (element as HTMLInputElement).value = String(newWDom?.props?.value || '');\n }\n }\n\n (newWDom.children || []).forEach((childItem: WDom) => wDomUpdate(childItem));\n\n runUpdatedQueueFromWDom(newWDom);\n};\n\nconst updateText = (newWDom: WDom) => {\n const element = newWDom.el;\n\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\n\nconst updateProps = (\n props?: Props,\n element?: HTMLElement | DocumentFragment | Text,\n oldProps?: Props\n) => {\n const originalProps = { ...oldProps };\n\n Object.entries(props || {}).forEach(\n ([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey === 'key') {\n // Do nothing\n } else if (\n dataKey === 'innerHTML' &&\n element &&\n typeof dataValue === 'string'\n ) {\n (element as HTMLElement).innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n const style = dataValue;\n const oldStyle = checkStyleData(dataKey, originalProps.style) || {};\n\n updateStyle(style, oldStyle, element);\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else if (checkRadioElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkCheckboxElement(element) && dataKey === 'checked') {\n (element as HTMLInputElement).checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === 'value') {\n (element as HTMLInputElement).value = dataValue as string;\n } else if (checkOptionElement(element) && dataKey === 'selected') {\n (element as HTMLOptionElement).selected = !!dataValue;\n } else if (checkNormalAttribute(dataValue)) {\n (element as HTMLElement).setAttribute(dataKey, String(dataValue));\n }\n\n delete originalProps[dataKey];\n }\n );\n\n Object.keys(originalProps).forEach(dataKey =>\n (element as HTMLElement).removeAttribute(dataKey)\n );\n};\n\nconst wDomToDom = (wDom: WDom, init: boolean) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = type === 'fragment' || type === 'loop';\n\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 }\n\n wDomChildrenToDom(children, element, init);\n updateProps(props, element);\n\n wDom.el = element;\n\n runMountedQueueFromWDom(wDom);\n\n return element || document.createElement('div');\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | DocumentFragment | Text,\n init?: boolean\n) => {\n if (init) {\n const elementChildren = children.reduce(\n (acc: DocumentFragment, childItem: WDom) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem, init));\n }\n\n return acc;\n },\n new DocumentFragment()\n );\n\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n }\n};\n\nconst updateEvent = (\n element: HTMLElement,\n eventKey: string,\n newEventHandler: (e: Event) => void,\n oldEventHandler: (e: Event) => void\n) => {\n const eventName = eventKey.replace(/^on(.*)/, (_match, p1) =>\n p1.toLowerCase()\n );\n\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\n\nconst updateStyle = (\n style: Record<string, string>,\n oldStyle: Record<string, string>,\n element?: HTMLElement | DocumentFragment | Text\n) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = (element as HTMLElement)?.style;\n\n if (elementStyle) {\n Object.entries(style).forEach(([styleKey, dataValue]) => {\n (elementStyle as any)[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n\n Object.entries(originalStyle).forEach(\n ([styleKey]) => ((elementStyle as any)[styleKey] = '')\n );\n }\n};\n\nconst findRealParentElement = (\n vDom: WDom\n): HTMLElement | DocumentFragment | Text | undefined => {\n const isVirtualType = vDom.type === 'fragment' || vDom.type === 'loop';\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n\n if (!isVirtualType) {\n return vDom.el as HTMLElement;\n }\n\n const parentVDom = getParent(vDom);\n\n return findRealParentElement(parentVDom);\n};\n","import { WDom, TagFunctionResolver, RenderType } from '@/types';\nimport { checkCustemComponentFunction } from '@/utils/predicator';\nimport { getParent, reRender } from '@/utils';\nimport { recursiveRemoveEvent } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExisty,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\n\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) => {\n const type = getWDomType(newWDom);\n\n if (!type) {\n throw new Error('Unknown type wdom');\n }\n\n const isSameType = checkSameWDomWithOriginal[type](newWDom, originalWDom);\n\n const result = remakeNewWDom(newWDom, isSameType, originalWDom);\n\n return result;\n};\n\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n\n remakeWDom.children = remakeChildrenForDiff(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n const needRerender = addReRenderTypeProperty(\n remakeWDom,\n isSameType,\n originalWDom\n );\n\n remakeWDom.needRerender = needRerender;\n\n if (needRerender !== 'A' && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n\n if (\n needRerender &&\n ['D', 'R', 'SR'].includes(needRerender) &&\n originalWDom?.componentKey\n ) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n remakeWDom.oldChildren = originalWDom.children;\n }\n\n remakeWDom.oldProps = originalWDom?.props;\n\n return remakeWDom;\n};\n\nconst addReRenderTypeProperty = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n): RenderType | undefined => {\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 =\n newWDom.type === 'text' &&\n isSameType &&\n newWDom.text === originalWDom?.text;\n\n let result: RenderType | undefined;\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\n return result;\n};\n\nconst generalize = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n): WDom => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom\n ? reRender(originalWDom, newWDom)\n : newWDom.resolve();\n }\n\n return newWDom;\n};\n\nconst remakeChildrenForDiff = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n) =>\n isSameType && originalWDom\n ? remakeChildrenForUpdate(newWDom, originalWDom)\n : remakeChildrenForAdd(newWDom);\n\nconst remakeChildrenForAdd = (newWDom: WDom) =>\n (newWDom.children || []).map((item: WDom) => {\n const childItem = makeNewWDomTree(item);\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) => {\n if (\n newWDom.type === 'loop' &&\n checkExisty(getKey((newWDom.children || [])[0]))\n ) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n\n return (newWDom.children || []).map((item: WDom, index: number) => {\n const childItem = makeNewWDomTree(\n item,\n (originalWDom.children || [])[index]\n );\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n};\n\nconst remakeChildrenForLoopUpdate = (newWDom: WDom, originalWDom: WDom) => {\n const { remakedChildren, unUsedChildren } = diffLoopChildren(\n newWDom,\n originalWDom\n );\n\n unUsedChildren.map(unusedItem => {\n const el = unusedItem.el;\n\n if (el && el.parentNode) {\n el.parentNode.removeChild(el);\n }\n });\n\n return remakedChildren;\n};\n\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\n const newChildren = [...(newWDom.children || [])];\n const originalChildren = [...(originalWDom.children || [])];\n\n const remakedChildren = newChildren.map(item => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\n return {\n remakedChildren,\n unUsedChildren: originalChildren,\n };\n};\n\nconst findSameKeyOriginalItem = (item: WDom, originalChildren: WDom[]) => {\n const key = getKey(item);\n\n return originalChildren.find(\n orignalChildItem => getKey(orignalChildItem) === key\n );\n};\n\nconst getKey = (target: WDom) =>\n target?.componentProps?.key ?? target?.props?.key;\n","import {\n WDom,\n TagFunction,\n FragmentFunction,\n Props,\n MiddleStateWDomChildren,\n MiddleStateWDom,\n NodePointer,\n Component,\n} from '@/types';\n\nimport { makeNewWDomTree } from '@/diff';\nimport { wDomUpdate } from '@/render';\nimport {\n initUpdateHookState,\n initMountHookState,\n setRedrawAction,\n needDiffRef,\n componentRender,\n getComponentSubInfo,\n} from '@/utils/universalRef';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\n\nexport type Children = WDom[];\n\nexport const Fragment = (_props: Props, ...children: WDom[]) => ({\n type: 'fragment',\n children,\n});\n\nexport const h = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n ...children: MiddleStateWDomChildren\n) => {\n const nodeParentPointer: NodePointer = { value: undefined };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n\n return node;\n};\n\nexport const mount =\n <T>(component: Component<T>) =>\n (_props: T, _children: WDom[]) =>\n component;\n\nconst reRenderCustomComponent = (\n tag: TagFunction,\n props: Props,\n children: WDom[],\n originalWDom: WDom\n) => {\n needDiffRef.value = true;\n\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent, wrapElement, afterElement } = originalWDom;\n\n newWDomTree.getParent = getParent;\n\n if (!isRoot && getParent) {\n const brothers = getParent()?.children || [];\n const index = brothers.indexOf(originalWDom);\n\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\n\nconst makeWDomResolver = (tag: TagFunction, props: Props, children: WDom[]) => {\n const tagName = tag.name;\n const constructor = tag;\n // 리졸브는 컴포넌트를 새로 만든다.\n const resolve = (componentKey = props) => {\n initMountHookState(componentKey);\n\n const component = tag(props, children);\n const componentMaker = component(\n componentRender(componentKey),\n props,\n children\n );\n\n const customNode = makeCustomNode(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n const originalWDom = customNode;\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n customNode;\n\n return customNode;\n };\n\n return { tagName, constructor, props, children, resolve };\n};\n\nconst makeCustomNode = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const customNode = componentMaker(props);\n const reRender = makeReRender(\n componentMaker,\n componentKey,\n tag,\n props,\n children\n );\n\n addComponentProps(customNode, componentKey, tag, props, children, reRender);\n\n return customNode;\n};\n\nconst makeReRender = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const reRender = () =>\n wDomMaker(componentMaker, componentKey, tag, props, children, reRender);\n return reRender;\n};\n\nconst wDomMaker = (\n componentMaker: (props: Props) => WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n initUpdateHookState(componentKey);\n runUpdateCallback();\n\n const originalWDom = componentMaker(props);\n\n setRedrawAction(componentKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n addComponentProps(originalWDom, componentKey, tag, props, children, reRender);\n\n (getComponentSubInfo(componentKey, 'vd') as { value: WDom }).value =\n originalWDom;\n\n return originalWDom;\n};\n\nconst addComponentProps = (\n wDom: WDom,\n componentKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n Object.assign(wDom, {\n componentProps: props,\n componentChildren: children,\n constructor: tag,\n tagName: tag.name,\n componentKey,\n reRender,\n });\n};\n\nconst makeNode = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n children: WDom[]\n) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n\n return needDiffRef.value\n ? componetMakeResolver\n : componetMakeResolver.resolve();\n }\n\n return {\n type: 'element',\n tag,\n props,\n children,\n };\n};\n\nconst remakeChildren = (\n nodeParentPointer: NodePointer,\n children: MiddleStateWDomChildren\n): WDom[] =>\n children.map((item: MiddleStateWDom) => {\n const childItem = makeChildrenItem(item);\n\n childItem.getParent = () => nodeParentPointer.value;\n\n return childItem;\n });\n\nconst makeChildrenItem = (item: MiddleStateWDom): WDom => {\n if (item === null || item === undefined || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer: NodePointer = { value: undefined };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: 'loop',\n children,\n };\n nodeParentPointer.value = node;\n\n return node;\n } else if (typeof item === 'string' || typeof item === 'number') {\n return { type: 'text', text: item };\n }\n\n return item;\n};\n","import {\n componentRef,\n redrawQueue,\n redrawQueueTimeout,\n getComponentKey,\n} from '@/utils/universalRef';\n\nimport { useUpdated } from '@/hook/useUpdate';\n\nexport const updateCallback = (\n effectAction: () => (() => void) | void,\n dependencies: () => any[] = () => []\n) => {\n const updateReqs = componentRef.get(getComponentKey())!.upR;\n\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\n\nexport const runUpdateCallback = () => {\n const updateReqs = componentRef.get(getComponentKey())?.upR;\n\n if (updateReqs?.length) {\n updateReqs.forEach(callback => callback());\n }\n\n redrawQueue.value = [];\n redrawQueueTimeout.value = null;\n};\n","export const ref = <T>(initValue: T) => ({ value: initValue });\n"],"names":["checkCustemComponentFunction","target","checkFragmentFunction","Fragment","checkPlainWDomType","wDom","checkPlainType","typeName","type","checkEmptyElement","checkNormalTypeElement","newWDom","originalWDom","_a","children","length","_b","checkExisty","value","checkStyleData","dataKey","dataValue","checkSameWDomWithOriginal","c","constructor","l","t","e","tag","f","et","getParent","vDom","parentVDom","Error","updateProps","props","infoProps","Object","keys","forEach","key","entries","updateChildren","infoChidren","splice","childrenItem","push","componentKeyRef","needDiffRef","componentRef","WeakMap","redrawQueue","redrawQueueTimeout","getComponentKey","getComponentSubInfo","componentKey","subKey","get","setRedrawAction","exec","up","setTimeout","execRedrawQueue","initMountHookState","set","vd","upR","upS","upD","upCB","mts","umts","setComponetRef","recursiveGetChildKeys","result","item","childComKey","childItemList","childVd","addedKey","reduce","acc","includes","action","shift","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","subInfo","effect","delete","runMountedQueueFromWDom","component","queue","sequence","callback","effectAction","useUpdated","dependencies","def","checkNeedPushQueue","originalDefs","newDefs","some","index","wDomUpdate","newWDomTree","needRerender","A","typeAdd","D","typeDelete","R","typeReplace","U","typeUpdate","SR","typeSortedReplace","SU","typeSortedUpdate","recursiveRemoveEvent","el","removeEvent","childItem","rootDelete","parent","wrapElement","deleteRealDom","parentWDom","findRealParentElement","oldProps","nodeType","removeChild","findChildWithRemoveElement","oldChildren","newElement","wDomToDom","parentEl","nextEl","startFindNextBrotherElement","insertBefore","appendChild","brothers","nextIndex","indexOf","candidiateBrothers","slice","finedNextEl","findChildFragmentNextElement","parentType","isRoot","afterElement","targetEl","bItem","isFragment","orignalElement","parentElement","replaceChild","element","match","eventName","replace","_match","p1","toLowerCase","removeEventListener","String","runUpdatedQueueFromWDom","updateText","nodeValue","text","originalProps","innerHTML","style","oldStyle","updateStyle","checkRefData","updateEvent","checkRadioElement","checkCheckboxElement","checked","tagName","checkTextareaElement","checkOptionElement","selected","checkNormalAttribute","setAttribute","removeAttribute","init","DocumentFragment","document","createElement","createTextNode","wDomChildrenToDom","elementChildren","hasChildNodes","eventKey","newEventHandler","oldEventHandler","addEventListener","originalStyle","elementStyle","styleKey","isVirtualType","makeNewWDomTree","getWDomType","isSameType","remakeNewWDom","remakeWDom","generalize","remakeChildrenForDiff","addReRenderTypeProperty","existOriginalWDom","isEmptyElement","getKey","isKeyCheckedWDom","isSameText","infoVdom","componentProps","componentChildren","newVDom","reRender","resolve","remakeChildrenForUpdate","remakeChildrenForAdd","map","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","parentNode","newChildren","originalChildren","originalItem","findSameKeyOriginalItem","find","orignalChildItem","_c","_props","reRenderCustomComponent","makeWDomResolver","name","componentMaker","componentRender","customNode","makeCustomNode","makeReRender","addComponentProps","wDomMaker","initUpdateHookState","updateReqs","assign","makeNode","componetMakeResolver","remakeChildren","nodeParentPointer","makeChildrenItem","Array","isArray","node","newProps","_children","initValue","Dom"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oBiB,IAE7CxB,KAAKkD,EAAY,QMZAuK,IAAkB,CAAEtP,MAAOsP,aJ8B5B,CACpBnQ,EACA0H,EACAyB,KAEA,IAAKzB,EACH,MAAM7F,MAAM,uBAEd7B,EAAKkJ,QAAS,EACdlJ,EAAK0H,YAAcA,EAEb,MAAA0I,EAAMhI,EAAUpI,GAAM,GAS5B,OAPImJ,GACFnJ,EAAKmJ,aAAeA,EACRzB,EAAAc,aAAa4H,EAAKjH,IAE9BzB,EAAYe,YAAY2H,GAGnB,WACL,GAAIpQ,EAAKsN,eAAgB,CACvB,MAAM9H,EAAY,OAAAhF,EAAaqC,EAAAQ,IAAIrD,EAAKsN,0BAAiBzJ,GAAGhD,MACxD2E,IACFP,EAAwBO,GACxB4B,EAAqB5B,GACrBgC,EAAWhC,GAEf,EAAA,mBGjD0B,CAC5BI,EACAE,EAA4B,KAAM,OAEfjD,EAAaQ,IAAIJ,KAAoBa,IAE7CpB,MAAK,IAAMmD,EAAWD,EAAcE,KAC/CD,EAAWD,EAAcE,EAAY"}
|
|
@@ -0,0 +1,2 @@
|
|
|
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 m=e=>typeof e=="function"&&!Y(e)||typeof e=="object"&&"resolve"in e,Y=e=>typeof e=="function"&&e===T,v=e=>typeof e=="object"&&!("resolve"in e),C=(e,t)=>v(e)&&e.type===t,$=e=>v(e)&&!e.type,pe=(e,t)=>e.constructor===(t==null?void 0:t.constructor),fe=(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)},ve=(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")},I=e=>e!=null,q=(e,t)=>e==="style"&&typeof t=="object",he=(e,t)=>e==="ref"&&typeof t=="object",ye=e=>e.nodeType===1&&e.tagName==="OPTION",ke=e=>e.nodeType===1&&e.tagName==="TEXTAREA",Ce=e=>e.nodeType===1&&e.type==="checkbox",ge=e=>e.nodeType===1&&e.type==="radio",Ee=e=>typeof e=="number"||typeof e=="string",Re=e=>{let t;return m(e)?t="c":C(e,"fragment")?t="f":C(e,"element")?t="e":C(e,"loop")?t="l":C(e,"text")?t="t":$(e)&&(t="et"),t},me={c:pe,l:U,t:U,e:ve,f:fe,et:U},f=e=>{const t=e.getParent&&e.getParent();if(!t)throw Error("Not found parent vDom");return t},Pe=(e,t)=>{const{componentProps:n,componentChildren:o}=e,{props:r,children:c}=t;n&&be(n,r),o&&xe(o,c);const l=e.reRender&&e.reRender();if(!l)throw Error("Unable reRender");return l},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},i=new WeakMap,E={value:[]},F={value:null},Te=e=>()=>{var t;const n=(t=i.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},Ne=e=>{i.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},y=()=>h.value,z=(e,t)=>i.get(e)[t],G=(e,t)=>{i.get(e).up=()=>{E.value.push({componentKey:e,exec:t}),F.value||(F.value=setTimeout(_e))}},Se=e=>h.value=e,Ue=e=>{h.value=e,Ne(e)},J=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.componentKey;o&&t.push(o),J(n,t)})},_e=()=>{let e=[];E.value.forEach(o=>{var r,c;const l=(c=(r=i.get(o.componentKey))==null?void 0:r.vd)==null?void 0:c.value;l&&J(l,e)});const t=[],n=E.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=>{i.get(y()).umts.push(e)},A=e=>{const{componentKey:t}=e;t&&Oe(t),X(e)},X=e=>{(e.children||[]).forEach(t=>{t.componentKey?A(t):X(t)})},Oe=e=>{const t=i.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],i.delete(e))},H=e=>{i.get(y()).mts.push(e)},M=e=>{const{componentKey:t}=e;if(t){const n=i.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=i.get(y()),{upD:o,upS:r}=n,c=o[r.value];if(c&&Ie(c,t())){const l=e();l&&n.upCB.push(l)}o[r.value]=t(),r.value+=1},Le=e=>{const{componentKey:t}=e;if(t){const n=i.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()))}},Ie=(e,t)=>!e.length&&!e.length?!0:e.some((n,o)=>n!==t[o]),Ae=(e,t,n)=>{if(!t)throw Error("WrapELement is null");e.isRoot=!0,e.wrapElement=t;const o=P(e,!0);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),()=>{var r;if(e.componentProps){const c=(r=i.get(e.componentProps))==null?void 0:r.vd.value;c&&(A(c),j(c),Me(c))}}},Z=e=>{const{needRerender:t}=e;if(t&&t!=="N"){const n={A:B,D:V,R:Ve,U:Be,SR:D,SU:je}[t];n(e)}},j=e=>{e.props&&e.el&&ee(e.props,e.el),(e.children||[]).forEach(t=>{j(t)})},Me=e=>{const t=e.wrapElement;K(e,t)},V=e=>{const t=f(e),n=b(t);e.oldProps&&e.el&&ee(e.oldProps,e.el),K(e,n)},K=(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&&w(e,t),delete e.el)},w=(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&&w(n,t)})},D=e=>{V(e),B(e)},je=e=>{V(e),B(e,e.el)},B=(e,t)=>{t||(t=P(e,!0));const n=f(e);if(n.type){const o=b(n),r=n.type==="loop";let c;r?c=O(n,f(n)):c=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=W(c),u=t.type||"";if(l)return l;if(!t.isRoot&&["fragment","loop"].includes(u))return O(t,f(t));if(t.isRoot&&t.afterElement)return t.afterElement},W=e=>e.reduce((t,n)=>{const o=n.type,r=n.el,c=o&&["fragment","loop"].includes(o);return t||(c?W(n.children||[]):r&&r.nodeType!==11?r:t)},void 0),Ve=e=>{const t=f(e),n=e.el;if(t.type&&n)if(n.nodeType===11)D(e);else{const o=b(t),r=P(e,!0);o&&o.replaceChild(r,n)}M(e)},ee=(e,t)=>{t&&Object.entries(e||{}).forEach(([n,o])=>{if(n.match(/^on/)){const r=n.replace(/^on(.*)/,(c,l)=>l.toLowerCase());t.removeEventListener(r,o)}})},Be=e=>{var t;const n=e.el;if(e.type==="text"){qe(e);return}if(n){const{oldProps:o,props:r}=e;te(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=>Z(o)),Le(e)},qe=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},te=(e,t,n)=>{const o={...n};Object.entries(e||{}).forEach(([r,c])=>{if(r!=="key")if(r==="innerHTML"&&t&&typeof c=="string")t.innerHTML=c;else if(q(r,c)){const l=c,u=q(r,o.style)||{};$e(l,u,t)}else he(r,c)?c.value=t:r.match(/^on/)?Ye(t,r,c,o[r]):ge(t)&&r==="checked"||Ce(t)&&r==="checked"?t.checked=!!c:ke(t)&&r==="value"?t.value=c:ye(t)&&r==="selected"?t.selected=!!c:Ee(c)&&t.setAttribute(r,String(c));delete o[r]}),Object.keys(o).forEach(r=>t.removeAttribute(r))},P=(e,t)=>{let n;const{type:o,tag:r,text:c,props:l,children:u=[]}=e;return o==="fragment"||o==="loop"?n=new DocumentFragment:o==="element"&&r?n=document.createElement(r):o==="text"&&I(c)&&(n=document.createTextNode(String(c))),Qe(u,n,t),te(l,n),e.el=n,M(e),n||document.createElement("div")},Qe=(e,t,n)=>{if(n){const o=e.reduce((r,c)=>(c.type&&r.appendChild(P(c,n)),r),new DocumentFragment);t&&o.hasChildNodes()&&t.appendChild(o)}},Ye=(e,t,n,o)=>{const r=t.replace(/^on(.*)/,(c,l)=>l.toLowerCase());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";if(e.isRoot&&t)return e.wrapElement;if(!t)return e.el;const n=f(e);return b(n)},x=(e,t)=>{const n=Re(e);if(!n)throw new Error("Unknown type wdom");const o=me[n](e,t);return ze(e,o,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),j(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&&f(e).type,u=R(e),d=l==="loop"&&I(u),p=e.type==="text"&&t&&e.text===(n==null?void 0:n.text);let a;return r?a="D":p?a="N":o?t?a=d?"SU":"U":a=d?"SR":"R":a="A",a},Je=(e,t,n)=>m(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"&&I(R((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&&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),u=x(c,l);return l&&o.splice(o.indexOf(l),1),u.getParent=()=>e,u}),unUsedChildren:o}},De=(e,t)=>{const n=R(e);return t.find(o=>R(o)===n)},R=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},ne=(e,t=()=>[])=>{i.get(y()).upR.push(()=>Q(e,t)),Q(e,t)},We=()=>{var e;const t=(e=i.get(y()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n()),E.value=[],F.value=null},T=(e,...t)=>({type:"fragment",children:t}),s=(e,t,...n)=>{const o={value:void 0},r=t||{},c=se(o,n),l=ot(e,r,c);return m(l)||(o.value=l),l},oe=e=>(t,n)=>e,re=(e,t,n,o)=>{var r;_.value=!0;const c=ce(e,t,n),l=x(c,o),{isRoot:u,getParent:d,wrapElement:p,afterElement:a}=o;if(l.getParent=d,!u&&d){const k=((r=d())==null?void 0:r.children)||[],N=k.indexOf(o);k.splice(N,1,l)}else l.isRoot=!0,l.wrapElement=p,l.afterElement=a;_.value=!1,Z(l)},ce=(e,t,n)=>({tagName:e.name,constructor:e,props:t,children:n,resolve:(l=t)=>{Ue(l);const d=e(t,n)(Te(l),t,n),p=et(d,l,e,t,n),a=p;return G(l,()=>re(e,t,n,a)),z(l,"vd").value=p,p}}),et=(e,t,n,o,r)=>{const c=e(o),l=tt(e,t,n,o,r);return le(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 G(t,()=>re(n,o,r,l)),le(l,t,n,o,r,c),z(t,"vd").value=l,l},le=(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(m(e)){const o=ce(e,t,n);return _.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},se=(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:se(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}),L=(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=()=>[])=>{H(()=>(e(),t)),ne(()=>(t&&t(),e),n)},ue=new Map,g={},ut=e=>{const t=Symbol();return ue.set(t,e),n=>(g[t]!=null||(g[t]=[]),g[t].push(n),it(t))},it=e=>new Proxy(ue.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=oe((e,t,n)=>{const o=L(1,e),r=L('"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,u=lt(()=>o.v+p+t.parentValue),d=ut({text:"s",count:0})(e);let p=t.parentValue;const a=ct(null),k=()=>{o.v=o.v+1,p+=1},N=S=>{r.v=S.target.value},ie=()=>{d.count+=1,d.text+="1"},de=()=>(console.log("MOUNTED",a),()=>console.log("UNMOUNT")),ae=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return H(de),ne(ae,()=>[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:a},"count: ",o.v),s("div",null,"sum: ",o.v+p+t.parentValue),s("div",null,"sum(computed): ",u.v),s("div",null,"notRefValue: ",p),s("div",null,"localStore(text): ",d.text),s("div",null,"localStore(count): ",d.count)),s("button",{onClick:k},"Increase"),s("button",{onClick:ie},"localStoreUpdate"),n)}),at=oe(e=>{const t=L(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"))}),pt=s(at,null);Ae(pt,document.getElementById("root"));
|
|
2
|
+
//# sourceMappingURL=index.cf0229da.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cf0229da.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 checkCustemComponentFunction = (target) => typeof target === \"function\" && !checkFragmentFunction(target) || typeof target === \"object\" && \"resolve\" in target;\nconst checkFragmentFunction = (target) => typeof target === \"function\" && target === Fragment;\nconst checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkEmptyElement = (wDom) => checkPlainWDomType(wDom) && !wDom.type;\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 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) => {\n return element.nodeType === 1 && element.tagName === \"OPTION\";\n};\nconst checkTextareaElement = (element) => {\n return element.nodeType === 1 && element.tagName === \"TEXTAREA\";\n};\nconst checkCheckboxElement = (element) => {\n return element.nodeType === 1 && element.type === \"checkbox\";\n};\nconst checkRadioElement = (element) => {\n return element.nodeType === 1 && element.type === \"radio\";\n};\nconst checkNormalAttribute = (dataValue) => typeof dataValue === \"number\" || typeof dataValue === \"string\";\nconst getWDomType = (wDom) => {\n let result;\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 if (!parentVDom) {\n throw Error(\"Not found parent vDom\");\n }\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 if (!newVDom) {\n throw Error(\"Unable reRender\");\n }\n return newVDom;\n};\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 if (!wrapElement) {\n throw Error(\"WrapELement is null\");\n }\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n const Dom = wDomToDom(wDom, true);\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 const exec = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate\n }[needRerender];\n exec(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 const parent = newWDom.wrapElement;\n deleteRealDom(newWDom, parent);\n};\nconst typeDelete = (newWDom) => {\n const parentWDom = getParent(newWDom);\n const parent = findRealParentElement(parentWDom);\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n deleteRealDom(newWDom, parent);\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, true);\n }\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === \"loop\";\n let nextEl;\n if (isLoop) {\n nextEl = startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else {\n nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n }\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, true);\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n }\n }\n runMountedQueueFromWDom(newWDom);\n};\nconst removeEvent = (oldProps, element) => {\n if (element) {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n const eventName = dataKey.replace(\n /^on(.*)/,\n (_match, p1) => p1.toLowerCase()\n );\n element.removeEventListener(\n eventName,\n dataValue\n );\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 const style = dataValue;\n const oldStyle = checkStyleData(dataKey, originalProps.style) || {};\n updateStyle(style, oldStyle, element);\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 (checkRadioElement(element) && dataKey === \"checked\") {\n element.checked = !!dataValue;\n } else if (checkCheckboxElement(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, init) => {\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 }\n wDomChildrenToDom(children, element, init);\n updateProps(props, element);\n wDom.el = element;\n runMountedQueueFromWDom(wDom);\n return element || document.createElement(\"div\");\n};\nconst wDomChildrenToDom = (children, parentElement, init) => {\n if (init) {\n const elementChildren = children.reduce(\n (acc, childItem) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem, init));\n }\n return acc;\n },\n new DocumentFragment()\n );\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n }\n};\nconst updateEvent = (element, eventKey, newEventHandler, oldEventHandler) => {\n const eventName = eventKey.replace(\n /^on(.*)/,\n (_match, p1) => p1.toLowerCase()\n );\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 const parentVDom = getParent(vDom);\n return findRealParentElement(parentVDom);\n};\nconst makeNewWDomTree = (newWDom, originalWDom) => {\n const type = getWDomType(newWDom);\n if (!type) {\n throw new Error(\"Unknown type wdom\");\n }\n const isSameType = checkSameWDomWithOriginal[type](newWDom, originalWDom);\n const result = remakeNewWDom(newWDom, isSameType, originalWDom);\n return result;\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 && 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","checkCustemComponentFunction","target","checkFragmentFunction","Fragment","checkPlainWDomType","wDom","checkPlainType","typeName","checkEmptyElement","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkExisty","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckboxElement","checkRadioElement","checkNormalAttribute","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","parentVDom","reRender","infoVdom","props","children","infoProps","infoChidren","updateProps$1","updateChildren","newVDom","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","parent","deleteRealDom","parentWDom","findRealParentElement","findChildWithRemoveElement","newElement","parentEl","isLoop","nextEl","startFindNextBrotherElement","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","type","el","isFragment","orignalElement","parentElement","oldProps","eventName","_match","p1","updateText","updateProps","originalProps","style","oldStyle","updateStyle","updateEvent","init","tag","text","wDomChildrenToDom","elementChildren","eventKey","newEventHandler","oldEventHandler","originalStyle","elementStyle","styleKey","isVirtualType","makeNewWDomTree","isSameType","remakeNewWDom","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":"CAAq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@@
|
|
|
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.cf0229da.js"></script>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<section id="root"></section>
|
package/package.json
CHANGED
package/src/render.ts
CHANGED
|
@@ -87,7 +87,7 @@ export const recursiveRemoveEvent = (originalWDom: WDom) => {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
const rootDelete = (newWDom: WDom) => {
|
|
90
|
-
const parent =
|
|
90
|
+
const parent = newWDom.wrapElement as HTMLElement;
|
|
91
91
|
|
|
92
92
|
deleteRealDom(newWDom, parent);
|
|
93
93
|
};
|
|
@@ -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 P=e=>typeof e=="function"&&!Y(e)||typeof e=="object"&&"resolve"in e,Y=e=>typeof e=="function"&&e===T,v=e=>typeof e=="object"&&!("resolve"in e),g=(e,t)=>v(e)&&e.type===t,$=e=>v(e)&&!e.type,pe=(e,t)=>e.constructor===(t==null?void 0:t.constructor),fe=(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)},ve=(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")},I=e=>e!=null,q=(e,t)=>e==="style"&&typeof t=="object",he=(e,t)=>e==="ref"&&typeof t=="object",ye=e=>e.nodeType===1&&e.tagName==="OPTION",ke=e=>e.nodeType===1&&e.tagName==="TEXTAREA",Ce=e=>e.nodeType===1&&e.type==="checkbox",ge=e=>e.nodeType===1&&e.type==="radio",Re=e=>typeof e=="number"||typeof e=="string",Ee=e=>{let t;return P(e)?t="c":g(e,"fragment")?t="f":g(e,"element")?t="e":g(e,"loop")?t="l":g(e,"text")?t="t":$(e)&&(t="et"),t},me={c:pe,l:U,t:U,e:ve,f:fe,et:U},f=e=>{const t=e.getParent&&e.getParent();if(!t)throw Error("Not found parent vDom");return t},Pe=(e,t)=>{const{componentProps:n,componentChildren:o}=e,{props:r,children:c}=t;n&&be(n,r),o&&xe(o,c);const l=e.reRender&&e.reRender();if(!l)throw Error("Unable reRender");return l},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},i=new WeakMap,E={value:[]},F={value:null},Te=e=>()=>{var t;const n=(t=i.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},Ne=e=>{i.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},y=()=>h.value,z=(e,t)=>i.get(e)[t],G=(e,t)=>{i.get(e).up=()=>{E.value.push({componentKey:e,exec:t}),F.value||(F.value=setTimeout(_e))}},Se=e=>h.value=e,Ue=e=>{h.value=e,Ne(e)},J=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.componentKey;o&&t.push(o),J(n,t)})},_e=()=>{let e=[];E.value.forEach(o=>{var r,c;const l=(c=(r=i.get(o.componentKey))==null?void 0:r.vd)==null?void 0:c.value;l&&J(l,e)});const t=[],n=E.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=>{i.get(y()).umts.push(e)},A=e=>{const{componentKey:t}=e;t&&Oe(t),X(e)},X=e=>{(e.children||[]).forEach(t=>{t.componentKey?A(t):X(t)})},Oe=e=>{const t=i.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],i.delete(e))},H=e=>{i.get(y()).mts.push(e)},M=e=>{const{componentKey:t}=e;if(t){const n=i.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=i.get(y()),{upD:o,upS:r}=n,c=o[r.value];if(c&&Ie(c,t())){const l=e();l&&n.upCB.push(l)}o[r.value]=t(),r.value+=1},Le=e=>{const{componentKey:t}=e;if(t){const n=i.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()))}},Ie=(e,t)=>!e.length&&!e.length?!0:e.some((n,o)=>n!==t[o]),Ae=(e,t,n)=>{if(!t)throw Error("WrapELement is null");e.isRoot=!0,e.wrapElement=t;const o=b(e,!0);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),()=>{var r;if(e.componentProps){const c=(r=i.get(e.componentProps))==null?void 0:r.vd.value;c&&(A(c),j(c),Me(c))}}},Z=e=>{const{needRerender:t}=e;if(t&&t!=="N"){const n={A:B,D:V,R:Ve,U:Be,SR:D,SU:je}[t];n(e)}},j=e=>{e.props&&e.el&&ee(e.props,e.el),(e.children||[]).forEach(t=>{j(t)})},Me=e=>{const t=k(e);K(e,t)},V=e=>{const t=f(e),n=k(t);e.oldProps&&e.el&&ee(e.oldProps,e.el),K(e,n)},K=(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&&w(e,t),delete e.el)},w=(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&&w(n,t)})},D=e=>{V(e),B(e)},je=e=>{V(e),B(e,e.el)},B=(e,t)=>{t||(t=b(e,!0));const n=f(e);if(n.type){const o=k(n),r=n.type==="loop";let c;r?c=O(n,f(n)):c=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=W(c),u=t.type||"";if(l)return l;if(!t.isRoot&&["fragment","loop"].includes(u))return O(t,f(t));if(t.isRoot&&t.afterElement)return t.afterElement},W=e=>e.reduce((t,n)=>{const o=n.type,r=n.el,c=o&&["fragment","loop"].includes(o);return t||(c?W(n.children||[]):r&&r.nodeType!==11?r:t)},void 0),Ve=e=>{const t=f(e),n=e.el;if(t.type&&n)if(n.nodeType===11)D(e);else{const o=k(t),r=b(e,!0);o&&o.replaceChild(r,n)}M(e)},ee=(e,t)=>{t&&Object.entries(e||{}).forEach(([n,o])=>{if(n.match(/^on/)){const r=n.replace(/^on(.*)/,(c,l)=>l.toLowerCase());t.removeEventListener(r,o)}})},Be=e=>{var t;const n=e.el;if(e.type==="text"){qe(e);return}if(n){const{oldProps:o,props:r}=e;te(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=>Z(o)),Le(e)},qe=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},te=(e,t,n)=>{const o={...n};Object.entries(e||{}).forEach(([r,c])=>{if(r!=="key")if(r==="innerHTML"&&t&&typeof c=="string")t.innerHTML=c;else if(q(r,c)){const l=c,u=q(r,o.style)||{};$e(l,u,t)}else he(r,c)?c.value=t:r.match(/^on/)?Ye(t,r,c,o[r]):ge(t)&&r==="checked"||Ce(t)&&r==="checked"?t.checked=!!c:ke(t)&&r==="value"?t.value=c:ye(t)&&r==="selected"?t.selected=!!c:Re(c)&&t.setAttribute(r,String(c));delete o[r]}),Object.keys(o).forEach(r=>t.removeAttribute(r))},b=(e,t)=>{let n;const{type:o,tag:r,text:c,props:l,children:u=[]}=e;return o==="fragment"||o==="loop"?n=new DocumentFragment:o==="element"&&r?n=document.createElement(r):o==="text"&&I(c)&&(n=document.createTextNode(String(c))),Qe(u,n,t),te(l,n),e.el=n,M(e),n||document.createElement("div")},Qe=(e,t,n)=>{if(n){const o=e.reduce((r,c)=>(c.type&&r.appendChild(b(c,n)),r),new DocumentFragment);t&&o.hasChildNodes()&&t.appendChild(o)}},Ye=(e,t,n,o)=>{const r=t.replace(/^on(.*)/,(c,l)=>l.toLowerCase());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]=""))},k=e=>{const t=e.type==="fragment"||e.type==="loop";if(e.isRoot&&t)return e.wrapElement;if(!t)return e.el;const n=f(e);return k(n)},x=(e,t)=>{const n=Ee(e);if(!n)throw new Error("Unknown type wdom");const o=me[n](e,t);return ze(e,o,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),j(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&&f(e).type,u=m(e),d=l==="loop"&&I(u),p=e.type==="text"&&t&&e.text===(n==null?void 0:n.text);let a;return r?a="D":p?a="N":o?t?a=d?"SU":"U":a=d?"SR":"R":a="A",a},Je=(e,t,n)=>P(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"&&I(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&&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),u=x(c,l);return l&&o.splice(o.indexOf(l),1),u.getParent=()=>e,u}),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},ne=(e,t=()=>[])=>{i.get(y()).upR.push(()=>Q(e,t)),Q(e,t)},We=()=>{var e;const t=(e=i.get(y()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n()),E.value=[],F.value=null},T=(e,...t)=>({type:"fragment",children:t}),s=(e,t,...n)=>{const o={value:void 0},r=t||{},c=se(o,n),l=ot(e,r,c);return P(l)||(o.value=l),l},oe=e=>(t,n)=>e,re=(e,t,n,o)=>{var r;_.value=!0;const c=ce(e,t,n),l=x(c,o),{isRoot:u,getParent:d,wrapElement:p,afterElement:a}=o;if(l.getParent=d,!u&&d){const C=((r=d())==null?void 0:r.children)||[],N=C.indexOf(o);C.splice(N,1,l)}else l.isRoot=!0,l.wrapElement=p,l.afterElement=a;_.value=!1,Z(l)},ce=(e,t,n)=>({tagName:e.name,constructor:e,props:t,children:n,resolve:(l=t)=>{Ue(l);const d=e(t,n)(Te(l),t,n),p=et(d,l,e,t,n),a=p;return G(l,()=>re(e,t,n,a)),z(l,"vd").value=p,p}}),et=(e,t,n,o,r)=>{const c=e(o),l=tt(e,t,n,o,r);return le(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 G(t,()=>re(n,o,r,l)),le(l,t,n,o,r,c),z(t,"vd").value=l,l},le=(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(P(e)){const o=ce(e,t,n);return _.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},se=(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:se(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}),L=(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=()=>[])=>{H(()=>(e(),t)),ne(()=>(t&&t(),e),n)},ue=new Map,R={},ut=e=>{const t=Symbol();return ue.set(t,e),n=>(R[t]!=null||(R[t]=[]),R[t].push(n),it(t))},it=e=>new Proxy(ue.get(e),{get(t,n){return t[n]},set(t,n,o){t[n]=o;const r=R[e],c=[];return r.forEach(l=>{l()||c.push(l)}),c.forEach(l=>r.splice(r.indexOf(l),1)),!0}}),dt=oe((e,t,n)=>{const o=L(1,e),r=L('"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,u=lt(()=>o.v+p+t.parentValue),d=ut({text:"s",count:0})(e);let p=t.parentValue;const a=ct(null),C=()=>{o.v=o.v+1,p+=1},N=S=>{r.v=S.target.value},ie=()=>{d.count+=1,d.text+="1"},de=()=>(console.log("MOUNTED",a),()=>console.log("UNMOUNT")),ae=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return H(de),ne(ae,()=>[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:a},"count: ",o.v),s("div",null,"sum: ",o.v+p+t.parentValue),s("div",null,"sum(computed): ",u.v),s("div",null,"notRefValue: ",p),s("div",null,"localStore(text): ",d.text),s("div",null,"localStore(count): ",d.count)),s("button",{onClick:C},"Increase"),s("button",{onClick:ie},"localStoreUpdate"),n)}),at=oe(e=>{const t=L(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"))}),pt=s(at,null);Ae(pt,document.getElementById("root"));
|
|
2
|
-
//# sourceMappingURL=index.31d5f7a4.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.31d5f7a4.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 checkCustemComponentFunction = (target) => typeof target === \"function\" && !checkFragmentFunction(target) || typeof target === \"object\" && \"resolve\" in target;\nconst checkFragmentFunction = (target) => typeof target === \"function\" && target === Fragment;\nconst checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkEmptyElement = (wDom) => checkPlainWDomType(wDom) && !wDom.type;\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 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) => {\n return element.nodeType === 1 && element.tagName === \"OPTION\";\n};\nconst checkTextareaElement = (element) => {\n return element.nodeType === 1 && element.tagName === \"TEXTAREA\";\n};\nconst checkCheckboxElement = (element) => {\n return element.nodeType === 1 && element.type === \"checkbox\";\n};\nconst checkRadioElement = (element) => {\n return element.nodeType === 1 && element.type === \"radio\";\n};\nconst checkNormalAttribute = (dataValue) => typeof dataValue === \"number\" || typeof dataValue === \"string\";\nconst getWDomType = (wDom) => {\n let result;\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 if (!parentVDom) {\n throw Error(\"Not found parent vDom\");\n }\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 if (!newVDom) {\n throw Error(\"Unable reRender\");\n }\n return newVDom;\n};\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 if (!wrapElement) {\n throw Error(\"WrapELement is null\");\n }\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n const Dom = wDomToDom(wDom, true);\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 const exec = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate\n }[needRerender];\n exec(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 const parent = findRealParentElement(newWDom);\n deleteRealDom(newWDom, parent);\n};\nconst typeDelete = (newWDom) => {\n const parentWDom = getParent(newWDom);\n const parent = findRealParentElement(parentWDom);\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n deleteRealDom(newWDom, parent);\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, true);\n }\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === \"loop\";\n let nextEl;\n if (isLoop) {\n nextEl = startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else {\n nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n }\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, true);\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n }\n }\n runMountedQueueFromWDom(newWDom);\n};\nconst removeEvent = (oldProps, element) => {\n if (element) {\n Object.entries(oldProps || {}).forEach(\n ([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n const eventName = dataKey.replace(\n /^on(.*)/,\n (_match, p1) => p1.toLowerCase()\n );\n element.removeEventListener(\n eventName,\n dataValue\n );\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 const style = dataValue;\n const oldStyle = checkStyleData(dataKey, originalProps.style) || {};\n updateStyle(style, oldStyle, element);\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 (checkRadioElement(element) && dataKey === \"checked\") {\n element.checked = !!dataValue;\n } else if (checkCheckboxElement(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, init) => {\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 }\n wDomChildrenToDom(children, element, init);\n updateProps(props, element);\n wDom.el = element;\n runMountedQueueFromWDom(wDom);\n return element || document.createElement(\"div\");\n};\nconst wDomChildrenToDom = (children, parentElement, init) => {\n if (init) {\n const elementChildren = children.reduce(\n (acc, childItem) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem, init));\n }\n return acc;\n },\n new DocumentFragment()\n );\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n }\n};\nconst updateEvent = (element, eventKey, newEventHandler, oldEventHandler) => {\n const eventName = eventKey.replace(\n /^on(.*)/,\n (_match, p1) => p1.toLowerCase()\n );\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 const parentVDom = getParent(vDom);\n return findRealParentElement(parentVDom);\n};\nconst makeNewWDomTree = (newWDom, originalWDom) => {\n const type = getWDomType(newWDom);\n if (!type) {\n throw new Error(\"Unknown type wdom\");\n }\n const isSameType = checkSameWDomWithOriginal[type](newWDom, originalWDom);\n const result = remakeNewWDom(newWDom, isSameType, originalWDom);\n return result;\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 && 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","checkCustemComponentFunction","target","checkFragmentFunction","Fragment","checkPlainWDomType","wDom","checkPlainType","typeName","checkEmptyElement","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkExisty","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckboxElement","checkRadioElement","checkNormalAttribute","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","parentVDom","reRender","infoVdom","props","children","infoProps","infoChidren","updateProps$1","updateChildren","newVDom","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","parent","findRealParentElement","deleteRealDom","parentWDom","findChildWithRemoveElement","newElement","parentEl","isLoop","nextEl","startFindNextBrotherElement","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","type","el","isFragment","orignalElement","parentElement","oldProps","eventName","_match","p1","updateText","updateProps","originalProps","style","oldStyle","updateStyle","updateEvent","init","tag","text","wDomChildrenToDom","elementChildren","eventKey","newEventHandler","oldEventHandler","originalStyle","elementStyle","styleKey","isVirtualType","makeNewWDomTree","isSameType","remakeNewWDom","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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