lithent 1.2.8 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/dist/lithent.mjs +18 -25
- 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-2e91d52a.js +2 -0
- package/examples/dist/assets/index-2e91d52a.js.map +1 -0
- package/examples/dist/index.html +1 -1
- package/helper/dist/hook/store.d.ts +1 -1
- package/helper/dist/lithentHelper.mjs +6 -6
- package/helper/dist/lithentHelper.mjs.map +1 -1
- package/helper/dist/lithentHelper.umd.js +1 -1
- package/helper/dist/lithentHelper.umd.js.map +1 -1
- package/helper/src/hook/store.ts +5 -3
- package/package.json +1 -1
- package/src/render.ts +26 -29
- package/examples/dist/assets/index-1a41ffdc.js +0 -2
- package/examples/dist/assets/index-1a41ffdc.js.map +0 -1
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/utils/redraw.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 */\n\nconst checkPlainWDomType = (wDom: WDomParam): wDom is WDom =>\n typeof wDom === 'object' && !('resolve' in wDom);\n\nconst checkPlainType = (wDom: WDomParam, typeName: string) =>\n checkPlainWDomType(wDom) && wDom.type === typeName;\n\nconst checkSameCustomComponent = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n 'ctor' in newWDom\n ? newWDom.ctor === originalWDom?.ctor\n : newWDom === originalWDom?.ctor;\n\nconst 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\nconst 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\nconst checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === newWDom.type &&\n (newWDom.type !== 'loop' ||\n (newWDom.type === 'loop' &&\n checkExisty(getKey((newWDom.children || [])[0])) &&\n checkExisty(getKey((originalWDom.children || [])[0]))));\n\nexport const getKey = (target: WDom) =>\n target?.compProps?.key ?? target?.props?.key;\n\nexport const checkVirtualType = (type: string | null) =>\n type && ['fragment', 'loop'].includes(type);\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 checkEmptyElement = (wDom: WDomParam) =>\n checkPlainWDomType(wDom) && !wDom.type;\n\nexport const checkExisty = (value: unknown) =>\n value !== null && value !== undefined;\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 {\n value: HTMLElement | Element | DocumentFragment | Text | undefined;\n} => dataKey === 'ref' && typeof dataValue === 'object';\n\nexport const checkOptionElement = (element: any): element is HTMLElement =>\n element.nodeType === 1 && element.tagName === 'OPTION';\n\nexport const checkTextareaElement = (element: any): element is HTMLElement =>\n element.nodeType === 1 && element.tagName === 'TEXTAREA';\n\nexport const checkCheckableElement = (element: any): element is HTMLElement =>\n element.nodeType === 1 && ['radio', 'checkbox'].includes(element.type);\n\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType => {\n let result: WDomType = 'et';\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 } from '@/types';\n\nexport const getParent = (vDom: WDom) =>\n (vDom.getParent && vDom.getParent()) as WDom;\n\nexport const entries = Object.entries;\nexport const keys = Object.keys;\nexport const assign = Object.assign;\n","import { ComponentRef, ComponentSubKey, Props } from '@/types';\n\nexport const xmlnsRef: { value: string } = { value: '' };\nexport const compKeyRef: { value: Props } = { value: {} };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentRef: ComponentRef = new WeakMap();\n\nconst setComponetRef = (compKey: Props) => {\n componentRef.set(compKey, {\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 = () => compKeyRef.value;\n\nexport const getComponentSubInfo = (compKey: Props, subKey: ComponentSubKey) =>\n componentRef.get(compKey)![subKey];\n\nexport const initUpdateHookState = (compKey: Props) =>\n (compKeyRef.value = compKey);\n\nexport const initMountHookState = (compKey: Props) => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\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 { compKey } = newWDom;\n\n if (compKey) {\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: WDom) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.compKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\n\nconst removeItem = (compKey: Props) => {\n const subInfo = componentRef.get(compKey);\n if (subInfo) {\n subInfo!.umts.forEach(effect => effect());\n subInfo!.umts = [];\n componentRef.delete(compKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n compKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\nimport { unmount } from '@/hook/unmount';\n\nlet mountedQueue: WDom[] = [];\n\nexport const execMountedQueue = () => {\n mountedQueue.forEach(item => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\nexport const addMountedQueue = (wDom: WDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\nexport const mountCallback = (effectAction: () => void) =>\n componentRef.get(getComponentKey())!.mts.push(effectAction);\n\nexport const runMountedQueueFromWDom = (newWDom: WDom) => {\n const { compKey } = newWDom;\n\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component?.mts;\n const sequence = component?.upS;\n\n compKeyRef.value = compKey;\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 compKeyRef,\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 { compKey } = newWDom;\n\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component?.upCB;\n const sequence = component?.upS;\n\n compKeyRef.value = compKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (newWDom.ctor && queue) {\n component.upCB = [];\n queue.forEach((effect: Function) => effect());\n }\n }\n};\n\nconst checkNeedPushQueue = (originalDefs: unknown[], newDefs: unknown[]) =>\n !originalDefs.length\n ? true\n : originalDefs.some((def, index) => def !== newDefs[index]);\n","import { WDom, Props } from '@/types';\nimport {\n checkStyleData,\n checkRefData,\n checkExisty,\n checkOptionElement,\n checkTextareaElement,\n checkCheckableElement,\n checkVirtualType,\n} from '@/utils/predicator';\n\nimport { componentRef, xmlnsRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { execMountedQueue, addMountedQueue } from '@/hook/mountCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/useUpdate';\nimport { getParent, entries, keys } from '@/utils';\n\nconst getAttrKey = (keyName: string) =>\n keyName === 'className' ? 'class' : keyName;\n\nconst getEventName = (eventKey: string) =>\n eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\n\nconst DF = () => new DocumentFragment();\nconst CE = (t: string) => document.createElement(t);\n\nexport const render = (\n wDom: WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n wrapElement ??= document.body;\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n\n const Dom = wDomToDom(wDom);\n\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n\n execMountedQueue();\n\n return () => {\n const component = componentRef.get(wDom.compProps || {})?.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n };\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { needRerender } = newWDomTree;\n\n if (needRerender && needRerender !== 'N') {\n ({\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n CNSU: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate,\n })[needRerender](newWDomTree);\n delete newWDomTree.needRerender;\n }\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 deleteRealDom(newWDom, newWDom.wrapElement as HTMLElement);\n};\n\nexport const typeDelete = (newWDom: WDom) => {\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n\n deleteRealDom(\n newWDom,\n findRealParentElement(getParent(newWDom)) as HTMLElement\n );\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 typeUpdate(newWDom);\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.needRerender !== 'CNSU') {\n const newElement = getElementFromFragment(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const nextEl = parentWDom.needRerender\n ? startFindNextBrotherElement(parentWDom, getParent(parentWDom))\n : 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 }\n};\n\nconst getElementFromFragment = (newWDom: WDom) => {\n if (checkVirtualType(newWDom.type)) {\n return (newWDom?.children || []).reduce((acc, item) => {\n const element = getElementFromFragment(item);\n\n if (element) {\n acc.appendChild(element);\n }\n return acc;\n }, DF());\n }\n\n return newWDom.el;\n};\n\nconst typeAdd = (newWDom: WDom) => {\n const newElement = wDomToDom(newWDom) as HTMLElement;\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const nextEl = startFindNextBrotherElement(newWDom, parentWDom);\n\n if (parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n\n execMountedQueue();\n }\n }\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 && checkVirtualType(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (\n parentWDom.isRoot &&\n checkVirtualType(parentType) &&\n parentWDom.afterElement\n ) {\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 && checkVirtualType(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);\n\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\n\nconst removeEvent = (\n oldProps: Props,\n element: HTMLElement | DocumentFragment | Text\n) => {\n entries(oldProps || {}).forEach(([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue as (e: Event) => void\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 | Element | DocumentFragment | Text,\n oldProps?: Props\n) => {\n const originalProps = { ...oldProps };\n\n entries(props || {}).forEach(([dataKey, dataValue]: [string, unknown]) => {\n let chkRemoveProp = true;\n if (dataKey === 'key') {\n // Do nothing\n } else if (dataKey === 'innerHTML' && typeof dataValue === 'string') {\n (element as HTMLElement).innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n updateStyle(\n dataValue,\n checkStyleData(dataKey, originalProps.style) ? originalProps.style : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else if (checkCheckableElement(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 (dataKey) {\n [chkRemoveProp, dataValue] = makeAttrDataValue(dataValue);\n\n if (chkRemoveProp) {\n setAttr(\n getAttrKey(dataKey),\n element as HTMLElement,\n dataValue as string\n );\n }\n }\n\n if (chkRemoveProp) {\n delete originalProps[dataKey];\n }\n });\n\n keys(originalProps).forEach(dataKey =>\n (element as HTMLElement).removeAttribute(dataKey)\n );\n};\n\nconst setAttr = (dataKey: string, element: HTMLElement, dataValue: string) => {\n if (xmlnsRef.value && dataKey !== 'xmlns') {\n element.setAttributeNS(null, dataKey, dataValue);\n } else {\n element.setAttribute(dataKey, dataValue);\n }\n};\n\nconst makeAttrDataValue = (dataValue: unknown): [boolean, string] => {\n let allowSetAttr = true;\n if (typeof dataValue === 'boolean') {\n if (!dataValue) {\n allowSetAttr = false;\n }\n\n dataValue = '';\n }\n\n return [allowSetAttr, String(dataValue)];\n};\n\nconst wDomToDom = (wDom: WDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n\n if (tag === 'svg') {\n xmlnsRef.value = String(props?.xmlns);\n }\n\n if (isVirtualType) {\n element = DF();\n } else if (type === 'element' && tag) {\n element = xmlnsRef.value\n ? document.createElementNS(xmlnsRef.value, tag)\n : CE(tag);\n } else if (type === 'text' && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = CE('e');\n }\n\n wDomChildrenToDom(children, element);\n updateProps(props, element);\n\n wDom.el = element as HTMLElement;\n\n addMountedQueue(wDom);\n\n if (tag === 'svg') {\n xmlnsRef.value = '';\n }\n\n return element;\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | Element | DocumentFragment | Text\n) => {\n const elementChildren = children.reduce(\n (acc: DocumentFragment, childItem: WDom) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem));\n }\n\n return acc;\n },\n DF()\n );\n\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\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 = getEventName(eventKey);\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 | Element | DocumentFragment | Text\n) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = (element as HTMLElement)?.style;\n\n if (elementStyle) {\n entries(style).forEach(([styleKey, dataValue]) => {\n (elementStyle as any)[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n\n 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 = checkVirtualType(vDom.type);\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n\n if (!isVirtualType) {\n return vDom.el as HTMLElement;\n }\n\n return findRealParentElement(getParent(vDom));\n};\n","import { WDom, TagFunctionResolver, RenderType, Props } from '@/types';\nimport { checkCustemComponentFunction, getKey } from '@/utils/predicator';\nimport { getParent } from '@/utils';\nimport { typeDelete, recursiveRemoveEvent } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExisty,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { assign, keys, entries } from '@/utils';\n\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n remakeNewWDom(\n newWDom,\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n );\n\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const param: [newWDom: WDom, isSameType: boolean, originalWDom?: WDom] = [\n remakeWDom,\n isSameType,\n originalWDom,\n ];\n const needRerender = addReRenderTypeProperty(...param);\n\n remakeWDom.children = remakeChildrenForDiff(...param);\n remakeWDom.needRerender = needRerender;\n\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n\n return remakeWDom;\n};\n\nconst inheritPropForRender = (\n remakeWDom: WDom,\n originalWDom?: WDom,\n needRerender?: RenderType\n) => {\n if (needRerender !== 'A' && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n\n if (needRerender && ['D', 'R', 'SR'].includes(needRerender)) {\n if (originalWDom?.compKey) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n }\n remakeWDom.oldChildren = originalWDom?.children;\n }\n\n remakeWDom.oldProps = originalWDom?.props;\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.isRoot;\n const originalParentWDom = originalWDom && getParent(originalWDom);\n const origParentType = !isRoot && originalParentWDom?.type;\n const key = getKey(newWDom);\n const isKeyCheckedWDom = origParentType === '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 if (\n newWDom.type === 'loop' &&\n result === 'U' &&\n originalWDom &&\n chkDiffLoopOrder(newWDom, originalWDom)\n ) {\n result = 'CNSU';\n }\n\n return result;\n};\n\nconst chkDiffLoopOrder = (newWDom: WDom, originalWDom: WDom) => {\n const origChildren = [...(originalWDom?.children || [])];\n const newChildren = [...(newWDom?.children || [])];\n const filteredChildren = origChildren.filter(item =>\n newChildren.find(newItem => getKey(item) === getKey(newItem))\n );\n let isSame = filteredChildren.length === newChildren.length;\n\n if (isSame) {\n isSame = filteredChildren.every(\n (item, index) => getKey(item) === getKey(newChildren[index])\n );\n }\n\n return isSame;\n};\n\nconst updateProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n keys(props).forEach(key => delete props[key]);\n\n entries(infoProps || {}).forEach(([key, value]) => (props[key] = value));\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\nconst runUpdate = (vDom: WDom, infoVdom: TagFunctionResolver) => {\n const { compProps: props, compChild: 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 return newVDom as WDom;\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 ? runUpdate(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 assign(makeNewWDomTree(item), { getParent: () => newWDom })\n );\n\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) =>\n newWDom.type === 'loop' && checkExisty(getKey((newWDom.children || [])[0]))\n ? remakeChildrenForLoopUpdate(newWDom, originalWDom)\n : (newWDom.children || []).map((item: WDom, index: number) =>\n assign(makeNewWDomTree(item, (originalWDom.children || [])[index]), {\n getParent: () => newWDom,\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 runUnmountQueueFromWDom(unusedItem);\n recursiveRemoveEvent(unusedItem);\n typeDelete(unusedItem);\n });\n\n return remakedChildren;\n};\n\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\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\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\n return [remakedChildren, originalChildren];\n};\n\nconst findSameKeyOriginalItem = (item: WDom, originalChildren: WDom[]) =>\n originalChildren.find(\n orignalChildItem => getKey(orignalChildItem) === getKey(item)\n );\n","import { Props, WDom, RedrawQueueList } from '@/types';\nimport { componentRef } from '@/utils/universalRef';\n\nlet redrawQueue: { compKey: Props; exec: () => void }[] = [];\nlet redrawQueueTimeout: boolean = false;\n\nexport const setRedrawAction = (compKey: Props, exec: () => void) => {\n componentRef.get(compKey)!.up = () => {\n redrawQueue.push({\n compKey,\n exec,\n });\n\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n };\n};\n\nexport const componentUpdate = (compKey: Props) => () => {\n const up = componentRef.get(compKey)?.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n\n return result;\n};\n\nconst recursiveGetChildKeys = (wDom: WDom, result: Props[]) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.compKey;\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.forEach(item => {\n const childVd = componentRef.get(item.compKey)?.vd?.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n\n const addedKey: Props[] = [];\n const result = redrawQueue.reduce((acc, item) => {\n const { compKey } = item;\n\n if (childItemList.includes(compKey) || addedKey.includes(compKey)) {\n return acc;\n }\n\n addedKey.push(compKey);\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 redrawQueue = [];\n redrawQueueTimeout = false;\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 needDiffRef,\n getComponentSubInfo,\n} from '@/utils/universalRef';\nimport { setRedrawAction, componentUpdate } from '@/utils/redraw';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\nimport { assign } from '@/utils';\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 ctor = tag;\n // 리졸브는 컴포넌트를 새로 만든다.\n const resolve = (compKey = props) => {\n initMountHookState(compKey);\n\n const component = tag(props, children);\n const componentMaker = component(componentUpdate(compKey), props, children);\n\n const customNode = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n children\n );\n\n const originalWDom = customNode;\n\n setRedrawAction(compKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n (getComponentSubInfo(compKey, 'vd') as { value: WDom }).value = customNode;\n\n return customNode;\n };\n\n return { tagName, ctor, props, children, resolve };\n};\n\nconst makeCustomNode = (\n componentMaker: (props: Props) => WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const customNode = componentMaker(props);\n if (customNode.reRender) {\n throw new Error(\n 'Avoid the case where the first element of a component is a component. Instead of \"mount(()=>()=><Component />)\" replace it with something like \"mount(()=>()=><Fragment><Component /></Fragment>)\".'\n );\n }\n\n addComponentProps(\n customNode,\n compKey,\n tag,\n props,\n children,\n makeReRender(componentMaker, compKey, tag, props, children)\n );\n\n return customNode;\n};\n\nconst makeReRender = (\n componentMaker: (props: Props) => WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const reRender = () =>\n wDomMaker(componentMaker, compKey, tag, props, children, reRender);\n return reRender;\n};\n\nconst wDomMaker = (\n componentMaker: (props: Props) => WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n initUpdateHookState(compKey);\n runUpdateCallback();\n\n const originalWDom = componentMaker(props);\n\n setRedrawAction(compKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n addComponentProps(originalWDom, compKey, tag, props, children, reRender);\n\n (getComponentSubInfo(compKey, 'vd') as { value: WDom }).value = originalWDom;\n\n return originalWDom;\n};\n\nconst addComponentProps = (\n wDom: WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n assign(wDom, {\n compProps: props,\n compChild: children,\n ctor: tag,\n tagName: tag.name,\n compKey,\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 assign(makeChildrenItem(item), { getParent: () => nodeParentPointer.value })\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 { componentRef, getComponentKey } 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","export const ref = <T>(initValue: T) => ({ value: initValue });\nexport const nextTick = () => Promise.resolve();\n"],"names":["checkPlainWDomType","wDom","checkPlainType","typeName","type","checkNormalTypeElement","newWDom","originalWDom","checkExisty","getKey","children","target","_a","compProps","key","_b","props","checkVirtualType","includes","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","value","checkStyleData","dataKey","dataValue","checkSameWDomWithOriginal","c","ctor","l","t","e","tag","length","f","et","getParent","vDom","entries","Object","keys","assign","xmlnsRef","compKeyRef","needDiffRef","componentRef","WeakMap","getComponentKey","getComponentSubInfo","compKey","subKey","get","initMountHookState","set","vd","up","upR","upS","upD","upCB","mts","umts","setComponetRef","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","forEach","item","subInfo","effect","delete","mountedQueue","execMountedQueue","runMountedQueueFromWDom","component","queue","sequence","callback","effectAction","push","useUpdated","dependencies","def","checkNeedPushQueue","originalDefs","newDefs","some","index","getEventName","eventKey","replace","_match","p1","toLowerCase","DF","DocumentFragment","CE","document","createElement","wDomUpdate","newWDomTree","needRerender","A","typeAdd","D","typeDelete","R","typeReplace","U","typeUpdate","CNSU","SR","typeSortedReplace","SU","typeSortedUpdate","recursiveRemoveEvent","el","removeEvent","childItem","rootDelete","deleteRealDom","wrapElement","oldProps","findRealParentElement","parent","nodeType","removeChild","findChildWithRemoveElement","oldChildren","parentWDom","newElement","getElementFromFragment","parentEl","nextEl","startFindNextBrotherElement","insertBefore","appendChild","reduce","acc","element","wDomToDom","brothers","nextIndex","indexOf","candidiateBrothers","slice","finedNextEl","findChildFragmentNextElement","parentType","isRoot","afterElement","targetEl","bItem","isFragment","orignalElement","parentElement","replaceChild","match","removeEventListener","updateProps$1","String","runUpdatedQueueFromWDom","updateText","nodeValue","text","updateProps","originalProps","chkRemoveProp","keyName","innerHTML","updateStyle","style","checkRefData","updateEvent","checkCheckableElement","checked","tagName","checkTextareaElement","checkOptionElement","selected","makeAttrDataValue","setAttr","removeAttribute","setAttributeNS","setAttribute","allowSetAttr","isVirtualType","xmlns","createElementNS","createTextNode","wDomChildrenToDom","addMountedQueue","elementChildren","hasChildNodes","newEventHandler","oldEventHandler","eventName","addEventListener","oldStyle","originalStyle","elementStyle","styleKey","makeNewWDomTree","remakeNewWDom","result","getWDomType","isSameType","remakeWDom","generalize","param","addReRenderTypeProperty","remakeChildrenForDiff","inheritPropForRender","existOriginalWDom","isEmptyElement","originalParentWDom","origParentType","isKeyCheckedWDom","isSameText","chkDiffLoopOrder","origChildren","newChildren","filteredChildren","filter","find","newItem","isSame","every","runUpdate","infoVdom","compChild","infoProps","infoChidren","splice","childrenItem","updateChildren","reRender","resolve","remakeChildrenForUpdate","remakeChildrenForAdd","map","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","redrawQueue","redrawQueueTimeout","setRedrawAction","exec","queueMicrotask","execRedrawQueue","recursiveGetChildKeys","childComKey","childItemList","childVd","addedKey","action","shift","_props","reRenderCustomComponent","makeWDomResolver","name","componentMaker","componentUpdate","customNode","makeCustomNode","Error","addComponentProps","makeReRender","wDomMaker","initUpdateHookState","updateReqs","makeNode","componetMakeResolver","remakeChildren","nodeParentPointer","makeChildrenItem","Array","isArray","node","newProps","_children","Promise","initValue","body","Dom"],"mappings":"+OAoBA,MAAMA,EAAsBC,GACV,iBAATA,KAAuB,YAAaA,GAEvCC,EAAiB,CAACD,EAAiBE,IACvCH,EAAmBC,IAASA,EAAKG,OAASD,EA2BtCE,EAAyB,CAC7BC,EACAC,IAEAP,EAAmBM,KACL,MAAdC,OAAc,EAAAA,EAAAH,QAASE,EAAQF,OACb,SAAjBE,EAAQF,MACW,SAAjBE,EAAQF,MACPI,EAAYC,GAAQH,EAAQI,UAAY,IAAI,MAC5CF,EAAYC,GAAQF,EAAaG,UAAY,IAAI,MAE1CD,EAAUE,YACrB,OAAA,OAAAC,EAAA,MAAAD,OAAA,EAAAA,EAAQE,gBAAR,EAAAD,EAAmBE,OAAO,OAAAC,EAAA,MAAAJ,OAAA,EAAAA,EAAQK,YAAO,EAAAD,EAAAD,IAAA,EAE9BG,EAAoBb,GAC/BA,GAAQ,CAAC,WAAY,QAAQc,SAASd,GAE3Be,EACXR,GAEmB,mBAAXA,IAA0BS,EAAsBT,IACrC,iBAAXA,GAAuB,YAAaA,EAEjCS,EACXT,GAEkB,mBAAXA,GAAyBA,IAAWU,GAEhCC,EAAqBrB,GAChCD,EA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AkBlQ,MAAQsQ,GAGrBA,CAAA,UAIHlN,GACJ,CAAC6L,EAAWuB,IACVpN,kBLjC0BI,GAC5BjC,EAAaM,IAAIJ,KAAoBa,IAAImB,KAAKD,cOnBxB,IAAMiN,QAAQlD,gBADfmD,IAAkB,CAAE1Q,MAAO0Q,aL0B5B,CACpBhS,EACAyH,EACA6B,KAEA7B,IAAAA,EAAgBxB,SAASgM,MACzBjS,EAAKqJ,QAAS,EACdrJ,EAAKyH,YAAcA,EAEb,MAAAyK,EAAMtJ,EAAU5I,GAWtB,OATIsJ,GACFtJ,EAAKsJ,aAAeA,EACR7B,EAAAc,aAAa2J,EAAK5I,IAE9B7B,EAAYe,YAAY0J,OAKnB,WACC,MAAAxN,EAAY,OAAA/D,IAAawC,IAAInD,EAAKY,WAAa,CAAE,SAArC,EAAAD,EAAwC2C,GAAGhC,MACzDoD,IACFX,EAAwBW,GACxByC,EAAqBzC,GACrB6C,EAAW7C,GACb,CAAA,mBIhD0B,CAC5BI,EACAG,EAA4B,KAAM,OAEfpC,EAAaM,IAAIJ,KAAoBS,IAE7CuB,MAAK,IAAMC,EAAWF,EAAcG,KAC/CD,EAAWF,EAAcG,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/utils/redraw.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 */\n\nconst checkPlainWDomType = (wDom: WDomParam): wDom is WDom =>\n typeof wDom === 'object' && !('resolve' in wDom);\n\nconst checkPlainType = (wDom: WDomParam, typeName: string) =>\n checkPlainWDomType(wDom) && wDom.type === typeName;\n\nconst checkSameCustomComponent = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n 'ctor' in newWDom\n ? newWDom.ctor === originalWDom?.ctor\n : newWDom === originalWDom?.ctor;\n\nconst 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\nconst 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\nconst checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n checkPlainWDomType(newWDom) &&\n originalWDom?.type === newWDom.type &&\n (newWDom.type !== 'loop' ||\n (newWDom.type === 'loop' &&\n checkExisty(getKey((newWDom.children || [])[0])) &&\n checkExisty(getKey((originalWDom.children || [])[0]))));\n\nexport const getKey = (target: WDom) =>\n target?.compProps?.key ?? target?.props?.key;\n\nexport const checkVirtualType = (type: string | null) =>\n type && ['fragment', 'loop'].includes(type);\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 checkEmptyElement = (wDom: WDomParam) =>\n checkPlainWDomType(wDom) && !wDom.type;\n\nexport const checkExisty = (value: unknown) =>\n value !== null && value !== undefined;\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 {\n value: HTMLElement | Element | DocumentFragment | Text | undefined;\n} => dataKey === 'ref' && typeof dataValue === 'object';\n\nexport const checkOptionElement = (element: any): element is HTMLElement =>\n element.nodeType === 1 && element.tagName === 'OPTION';\n\nexport const checkTextareaElement = (element: any): element is HTMLElement =>\n element.nodeType === 1 && element.tagName === 'TEXTAREA';\n\nexport const checkCheckableElement = (element: any): element is HTMLElement =>\n element.nodeType === 1 && ['radio', 'checkbox'].includes(element.type);\n\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType => {\n let result: WDomType = 'et';\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 } from '@/types';\n\nexport const getParent = (vDom: WDom) =>\n (vDom.getParent && vDom.getParent()) as WDom;\n\nexport const entries = Object.entries;\nexport const keys = Object.keys;\nexport const assign = Object.assign;\n","import { ComponentRef, ComponentSubKey, Props } from '@/types';\n\nexport const xmlnsRef: { value: string } = { value: '' };\nexport const compKeyRef: { value: Props } = { value: {} };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentRef: ComponentRef = new WeakMap();\n\nconst setComponetRef = (compKey: Props) => {\n componentRef.set(compKey, {\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 = () => compKeyRef.value;\n\nexport const getComponentSubInfo = (compKey: Props, subKey: ComponentSubKey) =>\n componentRef.get(compKey)![subKey];\n\nexport const initUpdateHookState = (compKey: Props) =>\n (compKeyRef.value = compKey);\n\nexport const initMountHookState = (compKey: Props) => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\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 { compKey } = newWDom;\n\n if (compKey) {\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: WDom) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.compKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\n\nconst removeItem = (compKey: Props) => {\n const subInfo = componentRef.get(compKey);\n if (subInfo) {\n subInfo!.umts.forEach(effect => effect());\n subInfo!.umts = [];\n componentRef.delete(compKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n compKeyRef,\n componentRef,\n getComponentKey,\n} from '@/utils/universalRef';\nimport { unmount } from '@/hook/unmount';\n\nlet mountedQueue: WDom[] = [];\n\nexport const execMountedQueue = () => {\n mountedQueue.forEach(item => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\nexport const addMountedQueue = (wDom: WDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\nexport const mountCallback = (effectAction: () => void) =>\n componentRef.get(getComponentKey())!.mts.push(effectAction);\n\nexport const runMountedQueueFromWDom = (newWDom: WDom) => {\n const { compKey } = newWDom;\n\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component?.mts;\n const sequence = component?.upS;\n\n compKeyRef.value = compKey;\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 compKeyRef,\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 { compKey } = newWDom;\n\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component?.upCB;\n const sequence = component?.upS;\n\n compKeyRef.value = compKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (newWDom.ctor && queue) {\n component.upCB = [];\n queue.forEach((effect: Function) => effect());\n }\n }\n};\n\nconst checkNeedPushQueue = (originalDefs: unknown[], newDefs: unknown[]) =>\n !originalDefs.length\n ? true\n : originalDefs.some((def, index) => def !== newDefs[index]);\n","import { WDom, Props } from '@/types';\nimport {\n checkStyleData,\n checkRefData,\n checkExisty,\n checkOptionElement,\n checkTextareaElement,\n checkCheckableElement,\n checkVirtualType,\n} from '@/utils/predicator';\n\nimport { componentRef, xmlnsRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { execMountedQueue, addMountedQueue } from '@/hook/mountCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/useUpdate';\nimport { getParent, entries, keys } from '@/utils';\n\nconst getAttrKey = (keyName: string) =>\n keyName === 'className' ? 'class' : keyName;\n\nconst getEventName = (eventKey: string) =>\n eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\n\nconst DF = () => new DocumentFragment();\nconst CE = (t: string) => document.createElement(t);\n\nexport const render = (\n wDom: WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n wrapElement ??= document.body;\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n\n const Dom = wDomToDom(wDom);\n\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n\n execMountedQueue();\n\n return () => {\n const component = componentRef.get(wDom.compProps || {})?.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n };\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { needRerender } = newWDomTree;\n\n if (needRerender && needRerender !== 'N') {\n ({\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n CNSU: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate,\n })[needRerender](newWDomTree);\n delete newWDomTree.needRerender;\n }\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 deleteRealDom(newWDom, newWDom.wrapElement as HTMLElement);\n};\n\nexport const typeDelete = (newWDom: WDom) => {\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n\n deleteRealDom(\n newWDom,\n findRealParentElement(getParent(newWDom)) as HTMLElement\n );\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 typeUpdate(newWDom);\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.needRerender !== 'CNSU') {\n const newElement = getElementFromFragment(newWDom);\n\n typeAdd(newWDom, newElement);\n }\n};\n\nconst typeAdd = (\n newWDom: WDom,\n newElement?: HTMLElement | DocumentFragment | Text\n) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom) as HTMLElement;\n }\n\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === 'loop';\n const nextEl =\n isLoop && parentWDom.needRerender && parentWDom.needRerender !== 'CNSU'\n ? startFindNextBrotherElement(parentWDom, getParent(parentWDom))\n : 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 execMountedQueue();\n }\n }\n};\n\nconst getElementFromFragment = (newWDom: WDom) => {\n if (checkVirtualType(newWDom.type)) {\n return (newWDom?.children || []).reduce((acc, item) => {\n const element = getElementFromFragment(item);\n\n if (element) {\n acc.appendChild(element);\n }\n return acc;\n }, DF());\n }\n\n return newWDom.el;\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 && checkVirtualType(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (\n parentWDom.isRoot &&\n checkVirtualType(parentType) &&\n parentWDom.afterElement\n ) {\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 && checkVirtualType(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);\n\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\n\nconst removeEvent = (\n oldProps: Props,\n element: HTMLElement | DocumentFragment | Text\n) => {\n entries(oldProps || {}).forEach(([dataKey, dataValue]: [string, unknown]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue as (e: Event) => void\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 | Element | DocumentFragment | Text,\n oldProps?: Props\n) => {\n const originalProps = { ...oldProps };\n\n entries(props || {}).forEach(([dataKey, dataValue]: [string, unknown]) => {\n let chkRemoveProp = true;\n if (dataKey === 'key') {\n // Do nothing\n } else if (dataKey === 'innerHTML' && typeof dataValue === 'string') {\n (element as HTMLElement).innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n updateStyle(\n dataValue,\n checkStyleData(dataKey, originalProps.style) ? originalProps.style : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else if (checkCheckableElement(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 (dataKey) {\n [chkRemoveProp, dataValue] = makeAttrDataValue(dataValue);\n\n if (chkRemoveProp) {\n setAttr(\n getAttrKey(dataKey),\n element as HTMLElement,\n dataValue as string\n );\n }\n }\n\n if (chkRemoveProp) {\n delete originalProps[dataKey];\n }\n });\n\n keys(originalProps).forEach(dataKey =>\n (element as HTMLElement).removeAttribute(dataKey)\n );\n};\n\nconst setAttr = (dataKey: string, element: HTMLElement, dataValue: string) => {\n if (xmlnsRef.value && dataKey !== 'xmlns') {\n element.setAttributeNS(null, dataKey, dataValue);\n } else {\n element.setAttribute(dataKey, dataValue);\n }\n};\n\nconst makeAttrDataValue = (dataValue: unknown): [boolean, string] => {\n let allowSetAttr = true;\n if (typeof dataValue === 'boolean') {\n if (!dataValue) {\n allowSetAttr = false;\n }\n\n dataValue = '';\n }\n\n return [allowSetAttr, String(dataValue)];\n};\n\nconst wDomToDom = (wDom: WDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n\n if (tag === 'svg') {\n xmlnsRef.value = String(props?.xmlns);\n }\n\n if (isVirtualType) {\n element = DF();\n } else if (type === 'element' && tag) {\n element = xmlnsRef.value\n ? document.createElementNS(xmlnsRef.value, tag)\n : CE(tag);\n } else if (type === 'text' && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = CE('e');\n }\n\n wDomChildrenToDom(children, element);\n updateProps(props, element);\n\n wDom.el = element as HTMLElement;\n\n addMountedQueue(wDom);\n\n if (tag === 'svg') {\n xmlnsRef.value = '';\n }\n\n return element;\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | Element | DocumentFragment | Text\n) => {\n const elementChildren = children.reduce(\n (acc: DocumentFragment, childItem: WDom) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem));\n }\n\n return acc;\n },\n DF()\n );\n\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\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 = getEventName(eventKey);\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 | Element | DocumentFragment | Text\n) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = (element as HTMLElement)?.style;\n\n if (elementStyle) {\n entries(style).forEach(([styleKey, dataValue]) => {\n (elementStyle as any)[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n\n 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 = checkVirtualType(vDom.type);\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n\n if (!isVirtualType) {\n return vDom.el as HTMLElement;\n }\n\n return findRealParentElement(getParent(vDom));\n};\n","import { WDom, TagFunctionResolver, RenderType, Props } from '@/types';\nimport { checkCustemComponentFunction, getKey } from '@/utils/predicator';\nimport { getParent } from '@/utils';\nimport { typeDelete, recursiveRemoveEvent } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExisty,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/unmount';\nimport { assign, keys, entries } from '@/utils';\n\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n remakeNewWDom(\n newWDom,\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n );\n\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const param: [newWDom: WDom, isSameType: boolean, originalWDom?: WDom] = [\n remakeWDom,\n isSameType,\n originalWDom,\n ];\n const needRerender = addReRenderTypeProperty(...param);\n\n remakeWDom.children = remakeChildrenForDiff(...param);\n remakeWDom.needRerender = needRerender;\n\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n\n return remakeWDom;\n};\n\nconst inheritPropForRender = (\n remakeWDom: WDom,\n originalWDom?: WDom,\n needRerender?: RenderType\n) => {\n if (needRerender !== 'A' && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n\n if (needRerender && ['D', 'R', 'SR'].includes(needRerender)) {\n if (originalWDom?.compKey) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n }\n remakeWDom.oldChildren = originalWDom?.children;\n }\n\n remakeWDom.oldProps = originalWDom?.props;\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.isRoot;\n const originalParentWDom = originalWDom && getParent(originalWDom);\n const origParentType = !isRoot && originalParentWDom?.type;\n const key = getKey(newWDom);\n const isKeyCheckedWDom = origParentType === '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 if (\n newWDom.type === 'loop' &&\n result === 'U' &&\n originalWDom &&\n chkDiffLoopOrder(newWDom, originalWDom)\n ) {\n result = 'CNSU';\n }\n\n return result;\n};\n\nconst chkDiffLoopOrder = (newWDom: WDom, originalWDom: WDom) => {\n const origChildren = [...(originalWDom?.children || [])];\n const newChildren = [...(newWDom?.children || [])];\n const filteredChildren = origChildren.filter(item =>\n newChildren.find(newItem => getKey(item) === getKey(newItem))\n );\n let isSame = filteredChildren.length === newChildren.length;\n\n if (isSame) {\n isSame = filteredChildren.every(\n (item, index) => getKey(item) === getKey(newChildren[index])\n );\n }\n\n return isSame;\n};\n\nconst updateProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n keys(props).forEach(key => delete props[key]);\n\n entries(infoProps || {}).forEach(([key, value]) => (props[key] = value));\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\nconst runUpdate = (vDom: WDom, infoVdom: TagFunctionResolver) => {\n const { compProps: props, compChild: 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 return newVDom as WDom;\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 ? runUpdate(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 assign(makeNewWDomTree(item), { getParent: () => newWDom })\n );\n\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) =>\n newWDom.type === 'loop' && checkExisty(getKey((newWDom.children || [])[0]))\n ? remakeChildrenForLoopUpdate(newWDom, originalWDom)\n : (newWDom.children || []).map((item: WDom, index: number) =>\n assign(makeNewWDomTree(item, (originalWDom.children || [])[index]), {\n getParent: () => newWDom,\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 runUnmountQueueFromWDom(unusedItem);\n recursiveRemoveEvent(unusedItem);\n typeDelete(unusedItem);\n });\n\n return remakedChildren;\n};\n\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\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\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n\n childItem.getParent = () => newWDom;\n\n return childItem;\n });\n\n return [remakedChildren, originalChildren];\n};\n\nconst findSameKeyOriginalItem = (item: WDom, originalChildren: WDom[]) =>\n originalChildren.find(\n orignalChildItem => getKey(orignalChildItem) === getKey(item)\n );\n","import { Props, WDom, RedrawQueueList } from '@/types';\nimport { componentRef } from '@/utils/universalRef';\n\nlet redrawQueue: { compKey: Props; exec: () => void }[] = [];\nlet redrawQueueTimeout: boolean = false;\n\nexport const setRedrawAction = (compKey: Props, exec: () => void) => {\n componentRef.get(compKey)!.up = () => {\n redrawQueue.push({\n compKey,\n exec,\n });\n\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n };\n};\n\nexport const componentUpdate = (compKey: Props) => () => {\n const up = componentRef.get(compKey)?.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n\n return result;\n};\n\nconst recursiveGetChildKeys = (wDom: WDom, result: Props[]) => {\n (wDom.children || []).forEach(item => {\n const childComKey = item.compKey;\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.forEach(item => {\n const childVd = componentRef.get(item.compKey)?.vd?.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n\n const addedKey: Props[] = [];\n const result = redrawQueue.reduce((acc, item) => {\n const { compKey } = item;\n\n if (childItemList.includes(compKey) || addedKey.includes(compKey)) {\n return acc;\n }\n\n addedKey.push(compKey);\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 redrawQueue = [];\n redrawQueueTimeout = false;\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 needDiffRef,\n getComponentSubInfo,\n} from '@/utils/universalRef';\nimport { setRedrawAction, componentUpdate } from '@/utils/redraw';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\nimport { assign } from '@/utils';\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 ctor = tag;\n // 리졸브는 컴포넌트를 새로 만든다.\n const resolve = (compKey = props) => {\n initMountHookState(compKey);\n\n const component = tag(props, children);\n const componentMaker = component(componentUpdate(compKey), props, children);\n\n const customNode = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n children\n );\n\n const originalWDom = customNode;\n\n setRedrawAction(compKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n (getComponentSubInfo(compKey, 'vd') as { value: WDom }).value = customNode;\n\n return customNode;\n };\n\n return { tagName, ctor, props, children, resolve };\n};\n\nconst makeCustomNode = (\n componentMaker: (props: Props) => WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const customNode = componentMaker(props);\n if (customNode.reRender) {\n throw new Error(\n 'Avoid the case where the first element of a component is a component. Instead of \"mount(()=>()=><Component />)\" replace it with something like \"mount(()=>()=><Fragment><Component /></Fragment>)\".'\n );\n }\n\n addComponentProps(\n customNode,\n compKey,\n tag,\n props,\n children,\n makeReRender(componentMaker, compKey, tag, props, children)\n );\n\n return customNode;\n};\n\nconst makeReRender = (\n componentMaker: (props: Props) => WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const reRender = () =>\n wDomMaker(componentMaker, compKey, tag, props, children, reRender);\n return reRender;\n};\n\nconst wDomMaker = (\n componentMaker: (props: Props) => WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n initUpdateHookState(compKey);\n runUpdateCallback();\n\n const originalWDom = componentMaker(props);\n\n setRedrawAction(compKey, () =>\n reRenderCustomComponent(tag, props, children, originalWDom)\n );\n\n addComponentProps(originalWDom, compKey, tag, props, children, reRender);\n\n (getComponentSubInfo(compKey, 'vd') as { value: WDom }).value = originalWDom;\n\n return originalWDom;\n};\n\nconst addComponentProps = (\n wDom: WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n assign(wDom, {\n compProps: props,\n compChild: children,\n ctor: tag,\n tagName: tag.name,\n compKey,\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 assign(makeChildrenItem(item), { getParent: () => nodeParentPointer.value })\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 { componentRef, getComponentKey } 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","export const ref = <T>(initValue: T) => ({ value: initValue });\nexport const nextTick = () => Promise.resolve();\n"],"names":["checkPlainWDomType","wDom","checkPlainType","typeName","type","checkNormalTypeElement","newWDom","originalWDom","checkExisty","getKey","children","target","_a","compProps","key","_b","props","checkVirtualType","includes","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","value","checkStyleData","dataKey","dataValue","checkSameWDomWithOriginal","c","ctor","l","t","e","tag","length","f","et","getParent","vDom","entries","Object","keys","assign","xmlnsRef","compKeyRef","needDiffRef","componentRef","WeakMap","getComponentKey","getComponentSubInfo","compKey","subKey","get","initMountHookState","set","vd","up","upR","upS","upD","upCB","mts","umts","setComponetRef","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","forEach","item","subInfo","effect","delete","mountedQueue","execMountedQueue","runMountedQueueFromWDom","component","queue","sequence","callback","effectAction","push","useUpdated","dependencies","def","checkNeedPushQueue","originalDefs","newDefs","some","index","getEventName","eventKey","replace","_match","p1","toLowerCase","DF","DocumentFragment","CE","document","createElement","wDomUpdate","newWDomTree","needRerender","A","typeAdd","D","typeDelete","R","typeReplace","U","typeUpdate","CNSU","SR","typeSortedReplace","SU","typeSortedUpdate","recursiveRemoveEvent","el","removeEvent","childItem","rootDelete","deleteRealDom","wrapElement","oldProps","findRealParentElement","parent","nodeType","removeChild","findChildWithRemoveElement","oldChildren","newElement","getElementFromFragment","wDomToDom","parentWDom","parentEl","nextEl","startFindNextBrotherElement","insertBefore","appendChild","reduce","acc","element","brothers","nextIndex","indexOf","candidiateBrothers","slice","finedNextEl","findChildFragmentNextElement","parentType","isRoot","afterElement","targetEl","bItem","isFragment","orignalElement","parentElement","replaceChild","match","removeEventListener","updateProps$1","String","runUpdatedQueueFromWDom","updateText","nodeValue","text","updateProps","originalProps","chkRemoveProp","keyName","innerHTML","updateStyle","style","checkRefData","updateEvent","checkCheckableElement","checked","tagName","checkTextareaElement","checkOptionElement","selected","makeAttrDataValue","setAttr","removeAttribute","setAttributeNS","setAttribute","allowSetAttr","isVirtualType","xmlns","createElementNS","createTextNode","wDomChildrenToDom","addMountedQueue","elementChildren","hasChildNodes","newEventHandler","oldEventHandler","eventName","addEventListener","oldStyle","originalStyle","elementStyle","styleKey","makeNewWDomTree","remakeNewWDom","result","getWDomType","isSameType","remakeWDom","generalize","param","addReRenderTypeProperty","remakeChildrenForDiff","inheritPropForRender","existOriginalWDom","isEmptyElement","originalParentWDom","origParentType","isKeyCheckedWDom","isSameText","chkDiffLoopOrder","origChildren","newChildren","filteredChildren","filter","find","newItem","isSame","every","runUpdate","infoVdom","compChild","infoProps","infoChidren","splice","childrenItem","updateChildren","reRender","resolve","remakeChildrenForUpdate","remakeChildrenForAdd","map","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","redrawQueue","redrawQueueTimeout","setRedrawAction","exec","queueMicrotask","execRedrawQueue","recursiveGetChildKeys","childComKey","childItemList","childVd","addedKey","action","shift","_props","reRenderCustomComponent","makeWDomResolver","name","componentMaker","componentUpdate","customNode","makeCustomNode","Error","addComponentProps","makeReRender","wDomMaker","initUpdateHookState","updateReqs","makeNode","componetMakeResolver","remakeChildren","nodeParentPointer","makeChildrenItem","Array","isArray","node","newProps","_children","Promise","initValue","body","Dom"],"mappings":"+OAoBA,MAAMA,EAAsBC,GACV,iBAATA,KAAuB,YAAaA,GAEvCC,EAAiB,CAACD,EAAiBE,IACvCH,EAAmBC,IAASA,EAAKG,OAASD,EA2BtCE,EAAyB,CAC7BC,EACAC,IAEAP,EAAmBM,KACL,MAAdC,OAAc,EAAAA,EAAAH,QAASE,EAAQF,OACb,SAAjBE,EAAQF,MACW,SAAjBE,EAAQF,MACPI,EAAYC,GAAQH,EAAQI,UAAY,IAAI,MAC5CF,EAAYC,GAAQF,EAAaG,UAAY,IAAI,MAE1CD,EAAUE,YACrB,OAAA,OAAAC,EAAA,MAAAD,OAAA,EAAAA,EAAQE,gBAAR,EAAAD,EAAmBE,OAAO,OAAAC,EAAA,MAAAJ,OAAA,EAAAA,EAAQK,YAAO,EAAAD,EAAAD,IAAA,EAE9BG,EAAoBb,GAC/BA,GAAQ,CAAC,WAAY,QAAQc,SAASd,GAE3Be,EACXR,GAEmB,mBAAXA,IAA0BS,EAAsBT,IACrC,iBAAXA,GAAuB,YAAaA,EAEjCS,EACXT,G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UAIHlN,GACJ,CAAC6L,EAAWuB,IACVpN,kBLjC0BI,GAC5BjC,EAAaM,IAAIJ,KAAoBa,IAAImB,KAAKD,cOnBxB,IAAMiN,QAAQlD,gBADfmD,IAAkB,CAAE1Q,MAAO0Q,aL0B5B,CACpBhS,EACAyH,EACA6B,KAEA7B,IAAAA,EAAgBxB,SAASgM,MACzBjS,EAAKqJ,QAAS,EACdrJ,EAAKyH,YAAcA,EAEb,MAAAyK,EAAM/J,EAAUnI,GAWtB,OATIsJ,GACFtJ,EAAKsJ,aAAeA,EACR7B,EAAAe,aAAa0J,EAAK5I,IAE9B7B,EAAYgB,YAAYyJ,OAKnB,WACC,MAAAxN,EAAY,OAAA/D,IAAawC,IAAInD,EAAKY,WAAa,CAAE,SAArC,EAAAD,EAAwC2C,GAAGhC,MACzDoD,IACFX,EAAwBW,GACxByC,EAAqBzC,GACrB6C,EAAW7C,GACb,CAAA,mBIhD0B,CAC5BI,EACAG,EAA4B,KAAM,OAEfpC,EAAaM,IAAIJ,KAAoBS,IAE7CuB,MAAK,IAAMC,EAAWF,EAAcG,KAC/CD,EAAWF,EAAcG,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 s of c.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&o(s)}).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 R=e=>typeof e=="object"&&!("resolve"in e),m=(e,t)=>R(e)&&e.type===t,me=(e,t)=>"ctor"in e?e.ctor===(t==null?void 0:t.ctor):e===(t==null?void 0:t.ctor),xe=(e,t)=>{var n,o;return R(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)},Se=(e,t)=>{var n,o;return R(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)},I=(e,t)=>R(e)&&(t==null?void 0:t.type)===e.type&&(e.type!=="loop"||e.type==="loop"&&g(a((e.children||[])[0]))&&g(a((t.children||[])[0]))),a=e=>{var t,n;return((t=e==null?void 0:e.compProps)==null?void 0:t.key)??((n=e==null?void 0:e.props)==null?void 0:n.key)},y=e=>e&&["fragment","loop"].includes(e),b=e=>typeof e=="function"&&!K(e)||typeof e=="object"&&"resolve"in e,K=e=>typeof e=="function"&&e===A,w=e=>R(e)&&!e.type,g=e=>e!=null,$=(e,t)=>e==="style"&&typeof t=="object",be=(e,t)=>e==="ref"&&typeof t=="object",Ne=e=>e.nodeType===1&&e.tagName==="OPTION",Te=e=>e.nodeType===1&&e.tagName==="TEXTAREA",Ue=e=>e.nodeType===1&&["radio","checkbox"].includes(e.type),Fe=e=>{let t="et";return b(e)?t="c":m(e,"fragment")?t="f":m(e,"element")?t="e":m(e,"loop")?t="l":m(e,"text")?t="t":w(e)&&(t="et"),t},Oe={c:me,l:I,t:I,e:Se,f:xe,et:I},h=e=>e.getParent&&e.getParent(),k=Object.entries,D=Object.keys,N=Object.assign,C={value:""},E={value:{}},Q={value:!1},i=new WeakMap,_e=e=>{i.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[]})},P=()=>E.value,W=(e,t)=>i.get(e)[t],Ae=e=>E.value=e,Le=e=>{E.value=e,_e(e)},Me=e=>{i.get(P()).umts.push(e)},T=e=>{const{compKey:t}=e;t&&Ie(t),ee(e)},ee=e=>{(e.children||[]).forEach(t=>{t.compKey?T(t):ee(t)})},Ie=e=>{const t=i.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[],i.delete(e))};let q=[];const z=()=>{q.forEach(e=>qe(e)),q=[]},Qe=e=>{e.compKey&&q.push(e)},te=e=>i.get(P()).mts.push(e),qe=e=>{const{compKey:t}=e;if(t){const n=i.get(t),o=n==null?void 0:n.mts,r=n==null?void 0:n.upS;E.value=t,r&&(r.value=0),o&&(n.mts=[],o.forEach(c=>{const s=c();s&&Me(s)}))}},H=(e,t=()=>[])=>{const n=i.get(P()),{upD:o,upS:r}=n,c=o[r.value];if(c&&Ve(c,t())){const s=e();s&&n.upCB.push(s)}o[r.value]=t(),r.value+=1},Be=e=>{const{compKey:t}=e;if(t){const n=i.get(t),o=n==null?void 0:n.upCB,r=n==null?void 0:n.upS;E.value=t,r&&(r.value=0),e.ctor&&o&&(n.upCB=[],o.forEach(c=>c()))}},Ve=(e,t)=>e.length?e.some((n,o)=>n!==t[o]):!0,je=e=>e==="className"?"class":e,ne=e=>e.replace(/^on(.*)/,(t,n)=>n.toLowerCase()),G=()=>new DocumentFragment,Z=e=>document.createElement(e),Ye=(e,t,n)=>{t??(t=document.body),e.isRoot=!0,e.wrapElement=t;const o=F(e);return n?(e.afterElement=n,t.insertBefore(o,n)):t.appendChild(o),z(),()=>{var r;const c=(r=i.get(e.compProps||{}))==null?void 0:r.vd.value;c&&(T(c),U(c),ze(c))}},oe=e=>{const{needRerender:t}=e;t&&t!=="N"&&({A:X,D:J,R:Je,U:V,CNSU:V,SR:se,SU:Ge}[t](e),delete e.needRerender)},U=e=>{e.props&&e.el&&ie(e.props,e.el),(e.children||[]).forEach(t=>{U(t)})},ze=e=>{re(e,e.wrapElement)},J=e=>{e.oldProps&&e.el&&ie(e.oldProps,e.el),re(e,O(h(e)))},re=(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&&ce(e,t),delete e.el)},ce=(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&&ce(n,t)})},se=e=>{J(e),X(e)},Ge=e=>{if(V(e),h(e).needRerender!=="CNSU"){const n=le(e);X(e,n)}},X=(e,t)=>{t||(t=F(e));const n=h(e);if(n.type){const o=O(n),c=n.type==="loop"&&n.needRerender&&n.needRerender!=="CNSU"?B(n,h(n)):B(e,n);t&&o&&(c?o.insertBefore(t,c):o.appendChild(t),z())}},le=e=>y(e.type)?((e==null?void 0:e.children)||[]).reduce((t,n)=>{const o=le(n);return o&&t.appendChild(o),t},G()):e.el,B=(e,t)=>{const n=t.children||[],r=n.indexOf(e)+1,c=n.slice(r),s=ue(c),u=t.type||"";if(s)return s;if(!t.isRoot&&y(u))return B(t,h(t));if(t.isRoot&&y(u)&&t.afterElement)return t.afterElement},ue=e=>e.reduce((t,n)=>{const o=n.type,r=n.el,c=o&&y(o);return t||(c?ue(n.children||[]):r&&r.nodeType!==11?r:t)},void 0),Je=e=>{const t=h(e),n=e.el;if(t.type&&n)if(n.nodeType===11)se(e);else{const o=O(t),r=F(e);o&&o.replaceChild(r,n),z()}},ie=(e,t)=>{k(e||{}).forEach(([n,o])=>{n.match(/^on/)&&t.removeEventListener(ne(n),o)})},V=e=>{var t;const n=e.el;if(e.type==="text"){Xe(e);return}if(n){const{oldProps:o,props:r}=e;de(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=>oe(o)),Be(e)},Xe=e=>{const t=e.el;t&&(t.nodeValue=String(e.text))},de=(e,t,n)=>{const o={...n};k(e||{}).forEach(([r,c])=>{let s=!0;r==="key"||(r==="innerHTML"&&typeof c=="string"?t.innerHTML=c:$(r,c)?we(c,$(r,o.style)?o.style:{},t):be(r,c)?c.value=t:r.match(/^on/)?Ke(t,r,c,o[r]):Ue(t)&&r==="checked"?t.checked=!!c:Te(t)&&r==="value"?t.value=c:Ne(t)&&r==="selected"?t.selected=!!c:r&&([s,c]=He(c),s&&$e(je(r),t,c))),s&&delete o[r]}),D(o).forEach(r=>t.removeAttribute(r))},$e=(e,t,n)=>{C.value&&e!=="xmlns"?t.setAttributeNS(null,e,n):t.setAttribute(e,n)},He=e=>{let t=!0;return typeof e=="boolean"&&(e||(t=!1),e=""),[t,String(e)]},F=e=>{let t;const{type:n,tag:o,text:r,props:c,children:s=[]}=e,u=y(n);return o==="svg"&&(C.value=String(c==null?void 0:c.xmlns)),u?t=G():n==="element"&&o?t=C.value?document.createElementNS(C.value,o):Z(o):n==="text"&&g(r)?t=document.createTextNode(String(r)):t=Z("e"),Ze(s,t),de(c,t),e.el=t,Qe(e),o==="svg"&&(C.value=""),t},Ze=(e,t)=>{const n=e.reduce((o,r)=>(r.type&&o.appendChild(F(r)),o),G());t&&n.hasChildNodes()&&t.appendChild(n)},Ke=(e,t,n,o)=>{const r=ne(t);o!==n&&(o&&e.removeEventListener(r,o),n&&e.addEventListener(r,n))},we=(e,t,n)=>{const o={...t},r=n==null?void 0:n.style;r&&(k(e).forEach(([c,s])=>{r[c]=s,delete o[c]}),k(o).forEach(([c])=>r[c]=""))},O=e=>{const t=y(e.type);return e.isRoot&&t?e.wrapElement:t?O(h(e)):e.el},_=(e,t)=>De(e,Oe[Fe(e)](e,t),t),De=(e,t,n)=>{const o=ct(e,t,n),r=[o,t,n],c=et(...r);return o.children=st(...r),o.needRerender=c,We(o,n,c),o},We=(e,t,n)=>{n!=="A"&&t&&(e.el=t.el),n&&["D","R","SR"].includes(n)&&(t!=null&&t.compKey&&(T(t),U(t)),e.oldChildren=t==null?void 0:t.children),e.oldProps=t==null?void 0:t.props},et=(e,t,n)=>{const o=n&&n.type,r=w(e),c=e.isRoot,s=n&&h(n),u=!c&&(s==null?void 0:s.type),p=a(e),d=u==="loop"&&g(p),v=e.type==="text"&&t&&e.text===(n==null?void 0:n.text);let f;return r?f="D":v?f="N":o?t?f=d?"SU":"U":f=d?"SR":"R":f="A",e.type==="loop"&&f==="U"&&n&&tt(e,n)&&(f="CNSU"),f},tt=(e,t)=>{const n=[...(t==null?void 0:t.children)||[]],o=[...(e==null?void 0:e.children)||[]],r=n.filter(s=>o.find(u=>a(s)===a(u)));let c=r.length===o.length;return c&&(c=r.every((s,u)=>a(s)===a(o[u]))),c},nt=(e,t)=>{e&&t!==e&&(D(e).forEach(n=>delete e[n]),k(t||{}).forEach(([n,o])=>e[n]=o))},ot=(e,t)=>{e&&t!==e&&(e.splice(0,e.length),t&&t.forEach(n=>e.push(n)))},rt=(e,t)=>{const{compProps:n,compChild:o}=e,{props:r,children:c}=t;return n&&nt(n,r),o&&ot(o,c),e.reRender&&e.reRender()},ct=(e,t,n)=>b(e)?t&&n?rt(n,e):e.resolve():e,st=(e,t,n)=>t&&n?ut(e,n):lt(e),lt=e=>(e.children||[]).map(t=>N(_(t),{getParent:()=>e})),ut=(e,t)=>e.type==="loop"&&g(a((e.children||[])[0]))?it(e,t):(e.children||[]).map((n,o)=>N(_(n,(t.children||[])[o]),{getParent:()=>e})),it=(e,t)=>{const[n,o]=dt(e,t);return o.map(r=>{T(r),U(r),J(r)}),n},dt=(e,t)=>{const n=[...e.children||[]],o=[...t.children||[]];return[n.map(c=>{const s=ft(c,o),u=_(c,s);return s&&o.splice(o.indexOf(s),1),u.getParent=()=>e,u}),o]},ft=(e,t)=>t.find(n=>a(n)===a(e));let x=[],j=!1;const fe=(e,t)=>{i.get(e).up=()=>{x.push({compKey:e,exec:t}),j||(j=!0,queueMicrotask(at))}},pt=e=>()=>{var t;const n=(t=i.get(e))==null?void 0:t.up;let o=!1;return n&&(n(),o=!0),o},pe=(e,t)=>{(e.children||[]).forEach(n=>{const o=n.compKey;o&&t.push(o),pe(n,t)})},at=()=>{let e=[];x.forEach(o=>{var r,c;const s=(c=(r=i.get(o.compKey))==null?void 0:r.vd)==null?void 0:c.value;s&&pe(s,e)});const t=[],n=x.reduce((o,r)=>{const{compKey: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()}x=[],j=!1},ae=(e,t=()=>[])=>{i.get(P()).upR.push(()=>H(e,t)),H(e,t)},vt=()=>{var e;const t=(e=i.get(P()))==null?void 0:e.upR;t!=null&&t.length&&t.forEach(n=>n())},A=(e,...t)=>({type:"fragment",children:t}),l=(e,t,...n)=>{const o={value:void 0},r=t||{},c=ge(o,n),s=gt(e,r,c);return b(s)||(o.value=s),s},ve=e=>(t,n)=>e,he=(e,t,n,o)=>{var r;Q.value=!0;const c=ye(e,t,n),s=_(c,o),{isRoot:u,getParent:p,wrapElement:d,afterElement:v}=o;if(s.getParent=p,!u&&p){const f=((r=p())==null?void 0:r.children)||[],L=f.indexOf(o);f.splice(L,1,s)}else s.isRoot=!0,s.wrapElement=d,s.afterElement=v;Q.value=!1,oe(s)},ye=(e,t,n)=>({tagName:e.name,ctor:e,props:t,children:n,resolve:(s=t)=>{Le(s);const p=e(t,n)(pt(s),t,n),d=ht(p,s,e,t,n),v=d;return fe(s,()=>he(e,t,n,v)),W(s,"vd").value=d,d}}),ht=(e,t,n,o,r)=>{const c=e(o);if(c.reRender)throw new Error('Avoid the case where the first element of a component is a component. Instead of "mount(()=>()=><Component />)" replace it with something like "mount(()=>()=><Fragment><Component /></Fragment>)".');return Ce(c,t,n,o,r,yt(e,t,n,o,r)),c},yt=(e,t,n,o,r)=>{const c=()=>Ct(e,t,n,o,r,c);return c},Ct=(e,t,n,o,r,c)=>{Ae(t),vt();const s=e(o);return fe(t,()=>he(n,o,r,s)),Ce(s,t,n,o,r,c),W(t,"vd").value=s,s},Ce=(e,t,n,o,r,c)=>{N(e,{compProps:o,compChild:r,ctor:n,tagName:n.name,compKey:t,reRender:c})},gt=(e,t,n)=>{if(K(e))return A(t,...n);if(b(e)){const o=ye(e,t,n);return Q.value?o:o.resolve()}return{type:"element",tag:e,props:t,children:n}},ge=(e,t)=>t.map(n=>N(kt(n),{getParent:()=>e.value})),kt=e=>{if(e==null||e===!1)return{type:null};if(Array.isArray(e)){const t={value:void 0},o={type:"loop",children:ge(t,e)};return t.value=o,o}else if(typeof e=="string"||typeof e=="number")return{type:"text",text:e};return e},Rt=e=>({value:e}),Y=(e,t)=>{let n=e;return{get value(){return n},get v(){return n},set value(o){n=o,t()},set v(o){n=o,t()}}},Et=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'")}}},Pt=(e,t=()=>{},n=()=>[])=>{te(()=>(e(),t)),ae(()=>(t&&t(),e),n)},ke=new Map,S={},mt=e=>{const t=Symbol();return ke.set(t,e),n=>(n&&(S[t]??(S[t]=[]),S[t].push(n)),xt(t))},xt=e=>new Proxy(ke.get(e),{get(t,n){return t[n]},set(t,n,o){t[n]=o;const r=S[e],c=[];return r.forEach(s=>{s()||c.push(s)}),c.forEach(s=>r.splice(r.indexOf(s),1)),!0}}),St=ve((e,t,n)=>{const o=Y(1,e),r=Y('"destructuring" the "props" value directly from the mount function will cause referencing issues, so if you want to use it, you need to "destructuring" it from the internal function (updater).',e),c=()=>t.parentValue,s=t.parentValue,u=Et(()=>o.v+d+t.parentValue),p=mt({text:"s",count:0})(e);let d=t.parentValue;const v=Rt(null),f=()=>{o.v=o.v+1,d+=1},L=M=>{r.v=M.target.value},Re=()=>{p.count+=1,p.text+="1"},Ee=()=>(console.log("MOUNTED",v),()=>console.log("UNMOUNT")),Pe=()=>(console.log("UPDATE - parentValue"),()=>console.log("UPDATED"));return te(Ee),ae(Pe,()=>[t.parentValue]),Pt(()=>console.log("INJECT"),()=>console.log("CLEAN_UP"),()=>[o.v]),({parentValue:M})=>l(A,null,l("div",null,l("textarea",{value:r.v,onInput:L,style:{width:"300px",height:"100px"}})),l("div",null,r.v),l("div",null,l("div",{style:{color:"blue"}},"parentValueFromRef: ",t.parentValue," (working)"),l("div",{style:{color:"blue"}},"parentValueFromFunction: ",c()," (working)"),l("div",{style:{color:"blue"}},"parentValueFromUpdaterDestructuring: ",M," (working)"),l("div",{style:{color:"red"}},"parentValueFromMounterDestructuring: ",s," (not working)")),l("div",null,l("div",{ref:v},"count: ",o.v),l("div",null,"sum: ",o.v+d+t.parentValue),l("div",null,"sum(computed): ",u.v),l("div",null,"notRefValue: ",d),l("div",null,"localStore(text): ",p.text),l("div",null,"localStore(count): ",p.count)),l("button",{onClick:f},"Increase"),l("button",{onClick:Re},"localStoreUpdate"),n)}),bt=ve(e=>{const t=Y(7,e),n=()=>{t.v=t.v+1},o=()=>{t.v=t.v-1};return()=>l(A,null,l(St,{parentValue:t.v},l("button",{onClick:n},"Increase - Parent")),l("button",{onClick:o},"Decrease - Parent"))}),Nt=l(bt,null);Ye(Nt,document.getElementById("root"));
|
|
2
|
+
//# sourceMappingURL=index-2e91d52a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-2e91d52a.js","sources":["../../../dist/lithent.mjs","../../../helper/dist/lithentHelper.mjs","../../src/index.tsx"],"sourcesContent":["const checkPlainWDomType = (wDom) => typeof wDom === \"object\" && !(\"resolve\" in wDom);\nconst checkPlainType = (wDom, typeName) => checkPlainWDomType(wDom) && wDom.type === typeName;\nconst checkSameCustomComponent = (newWDom, originalWDom) => \"ctor\" in newWDom ? newWDom.ctor === (originalWDom == null ? void 0 : originalWDom.ctor) : newWDom === (originalWDom == null ? void 0 : originalWDom.ctor);\nconst checkSameFragment = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"fragment\" && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkSameTagElement = (newWDom, originalWDom) => {\n var _a, _b;\n return checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === \"element\" && (originalWDom == null ? void 0 : originalWDom.tag) === newWDom.tag && ((_a = originalWDom == null ? void 0 : originalWDom.children) == null ? void 0 : _a.length) === ((_b = newWDom == null ? void 0 : newWDom.children) == null ? void 0 : _b.length);\n};\nconst checkNormalTypeElement = (newWDom, originalWDom) => checkPlainWDomType(newWDom) && (originalWDom == null ? void 0 : originalWDom.type) === newWDom.type && (newWDom.type !== \"loop\" || newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0])) && checkExisty(getKey((originalWDom.children || [])[0])));\nconst getKey = (target) => {\n var _a, _b;\n return ((_a = target == null ? void 0 : target.compProps) == null ? void 0 : _a.key) ?? ((_b = target == null ? void 0 : target.props) == null ? void 0 : _b.key);\n};\nconst checkVirtualType = (type) => type && [\"fragment\", \"loop\"].includes(type);\nconst checkCustemComponentFunction = (target) => typeof target === \"function\" && !checkFragmentFunction(target) || typeof target === \"object\" && \"resolve\" in target;\nconst checkFragmentFunction = (target) => typeof target === \"function\" && target === Fragment;\nconst checkEmptyElement = (wDom) => checkPlainWDomType(wDom) && !wDom.type;\nconst checkExisty = (value) => value !== null && value !== void 0;\nconst checkStyleData = (dataKey, dataValue) => dataKey === \"style\" && typeof dataValue === \"object\";\nconst checkRefData = (dataKey, dataValue) => dataKey === \"ref\" && typeof dataValue === \"object\";\nconst checkOptionElement = (element) => element.nodeType === 1 && element.tagName === \"OPTION\";\nconst checkTextareaElement = (element) => element.nodeType === 1 && element.tagName === \"TEXTAREA\";\nconst checkCheckableElement = (element) => element.nodeType === 1 && [\"radio\", \"checkbox\"].includes(element.type);\nconst getWDomType = (wDom) => {\n let result = \"et\";\n if (checkCustemComponentFunction(wDom)) {\n result = \"c\";\n } else if (checkPlainType(wDom, \"fragment\")) {\n result = \"f\";\n } else if (checkPlainType(wDom, \"element\")) {\n result = \"e\";\n } else if (checkPlainType(wDom, \"loop\")) {\n result = \"l\";\n } else if (checkPlainType(wDom, \"text\")) {\n result = \"t\";\n } else if (checkEmptyElement(wDom)) {\n result = \"et\";\n }\n return result;\n};\nconst checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkNormalTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement\n};\nconst getParent = (vDom) => vDom.getParent && vDom.getParent();\nconst entries = Object.entries;\nconst keys = Object.keys;\nconst assign = Object.assign;\nconst xmlnsRef = { value: \"\" };\nconst compKeyRef = { value: {} };\nconst needDiffRef = { value: false };\nconst componentRef = /* @__PURE__ */ new WeakMap();\nconst setComponetRef = (compKey) => {\n componentRef.set(compKey, {\n vd: { value: null },\n up: () => {\n },\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: []\n });\n};\nconst getComponentKey = () => compKeyRef.value;\nconst getComponentSubInfo = (compKey, subKey) => componentRef.get(compKey)[subKey];\nconst initUpdateHookState = (compKey) => compKeyRef.value = compKey;\nconst initMountHookState = (compKey) => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\n};\nconst unmount = (effectAction) => {\n componentRef.get(getComponentKey()).umts.push(effectAction);\n};\nconst runUnmountQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\nconst recursiveRunUnmount = (wDom) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n runUnmountQueueFromWDom(item);\n } else {\n recursiveRunUnmount(item);\n }\n });\n};\nconst removeItem = (compKey) => {\n const subInfo = componentRef.get(compKey);\n if (subInfo) {\n subInfo.umts.forEach((effect) => effect());\n subInfo.umts = [];\n componentRef.delete(compKey);\n }\n};\nlet mountedQueue = [];\nconst execMountedQueue = () => {\n mountedQueue.forEach((item) => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\nconst addMountedQueue = (wDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\nconst mountCallback = (effectAction) => componentRef.get(getComponentKey()).mts.push(effectAction);\nconst runMountedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.mts;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (queue) {\n component.mts = [];\n queue.forEach((effect) => {\n const callback = effect();\n if (callback) {\n unmount(callback);\n }\n });\n }\n }\n};\nconst useUpdated = (effectAction, dependencies = () => []) => {\n const component = componentRef.get(getComponentKey());\n const { upD, upS } = component;\n const def = upD[upS.value];\n if (def && checkNeedPushQueue(def, dependencies())) {\n const callback = effectAction();\n if (callback) {\n component.upCB.push(callback);\n }\n }\n upD[upS.value] = dependencies();\n upS.value += 1;\n};\nconst runUpdatedQueueFromWDom = (newWDom) => {\n const { compKey } = newWDom;\n if (compKey) {\n const component = componentRef.get(compKey);\n const queue = component == null ? void 0 : component.upCB;\n const sequence = component == null ? void 0 : component.upS;\n compKeyRef.value = compKey;\n if (sequence) {\n sequence.value = 0;\n }\n if (newWDom.ctor && queue) {\n component.upCB = [];\n queue.forEach((effect) => effect());\n }\n }\n};\nconst checkNeedPushQueue = (originalDefs, newDefs) => !originalDefs.length ? true : originalDefs.some((def, index) => def !== newDefs[index]);\nconst getAttrKey = (keyName) => keyName === \"className\" ? \"class\" : keyName;\nconst getEventName = (eventKey) => eventKey.replace(/^on(.*)/, (_match, p1) => p1.toLowerCase());\nconst DF = () => new DocumentFragment();\nconst CE = (t) => document.createElement(t);\nconst render = (wDom, wrapElement, afterElement) => {\n wrapElement ?? (wrapElement = document.body);\n wDom.isRoot = true;\n wDom.wrapElement = wrapElement;\n const Dom = wDomToDom(wDom);\n if (afterElement) {\n wDom.afterElement = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else {\n wrapElement.appendChild(Dom);\n }\n execMountedQueue();\n return () => {\n var _a;\n const component = (_a = componentRef.get(wDom.compProps || {})) == null ? void 0 : _a.vd.value;\n if (component) {\n runUnmountQueueFromWDom(component);\n recursiveRemoveEvent(component);\n rootDelete(component);\n }\n };\n};\nconst wDomUpdate = (newWDomTree) => {\n const { needRerender } = newWDomTree;\n if (needRerender && needRerender !== \"N\") {\n ({\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n CNSU: typeUpdate,\n SR: typeSortedReplace,\n SU: typeSortedUpdate\n })[needRerender](newWDomTree);\n delete newWDomTree.needRerender;\n }\n};\nconst recursiveRemoveEvent = (originalWDom) => {\n if (originalWDom.props && originalWDom.el) {\n removeEvent(originalWDom.props, originalWDom.el);\n }\n (originalWDom.children || []).forEach((childItem) => {\n recursiveRemoveEvent(childItem);\n });\n};\nconst rootDelete = (newWDom) => {\n deleteRealDom(newWDom, newWDom.wrapElement);\n};\nconst typeDelete = (newWDom) => {\n if (newWDom.oldProps && newWDom.el) {\n removeEvent(newWDom.oldProps, newWDom.el);\n }\n deleteRealDom(\n newWDom,\n findRealParentElement(getParent(newWDom))\n );\n};\nconst deleteRealDom = (newWDom, parent) => {\n var _a, _b;\n if (parent && newWDom.el) {\n if (((_a = newWDom.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(newWDom.el);\n } else if (((_b = newWDom.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(newWDom, parent);\n }\n delete newWDom.el;\n }\n};\nconst findChildWithRemoveElement = (newWDom, parent) => {\n ((newWDom == null ? void 0 : newWDom.oldChildren) || (newWDom == null ? void 0 : newWDom.children) || []).forEach((item) => {\n var _a, _b;\n if (((_a = item.el) == null ? void 0 : _a.nodeType) === 1) {\n parent.removeChild(item == null ? void 0 : item.el);\n } else if (((_b = item.el) == null ? void 0 : _b.nodeType) === 11) {\n findChildWithRemoveElement(item, parent);\n }\n });\n};\nconst typeSortedReplace = (newWDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\nconst typeSortedUpdate = (newWDom) => {\n typeUpdate(newWDom);\n const parentWDom = getParent(newWDom);\n if (parentWDom.needRerender !== \"CNSU\") {\n const newElement = getElementFromFragment(newWDom);\n typeAdd(newWDom, newElement);\n }\n};\nconst typeAdd = (newWDom, newElement) => {\n if (!newElement) {\n newElement = wDomToDom(newWDom);\n }\n const parentWDom = getParent(newWDom);\n if (parentWDom.type) {\n const parentEl = findRealParentElement(parentWDom);\n const isLoop = parentWDom.type === \"loop\";\n const nextEl = isLoop && parentWDom.needRerender && parentWDom.needRerender !== \"CNSU\" ? startFindNextBrotherElement(parentWDom, getParent(parentWDom)) : startFindNextBrotherElement(newWDom, parentWDom);\n if (newElement && parentEl) {\n if (nextEl) {\n parentEl.insertBefore(newElement, nextEl);\n } else {\n parentEl.appendChild(newElement);\n }\n execMountedQueue();\n }\n }\n};\nconst getElementFromFragment = (newWDom) => {\n if (checkVirtualType(newWDom.type)) {\n return ((newWDom == null ? void 0 : newWDom.children) || []).reduce((acc, item) => {\n const element = getElementFromFragment(item);\n if (element) {\n acc.appendChild(element);\n }\n return acc;\n }, DF());\n }\n return newWDom.el;\n};\nconst startFindNextBrotherElement = (wDom, parentWDom) => {\n const brothers = parentWDom.children || [];\n const index = brothers.indexOf(wDom);\n const nextIndex = index + 1;\n const candidiateBrothers = brothers.slice(nextIndex);\n const finedNextEl = findChildFragmentNextElement(candidiateBrothers);\n const parentType = parentWDom.type || \"\";\n if (finedNextEl) {\n return finedNextEl;\n }\n if (!parentWDom.isRoot && checkVirtualType(parentType)) {\n return startFindNextBrotherElement(parentWDom, getParent(parentWDom));\n } else if (parentWDom.isRoot && checkVirtualType(parentType) && parentWDom.afterElement) {\n return parentWDom.afterElement;\n }\n return void 0;\n};\nconst findChildFragmentNextElement = (candidiateBrothers) => candidiateBrothers.reduce(\n (targetEl, bItem) => {\n const type = bItem.type;\n const el = bItem.el;\n const isFragment = type && checkVirtualType(type);\n if (targetEl) {\n return targetEl;\n } else if (isFragment) {\n return findChildFragmentNextElement(bItem.children || []);\n } else if (el && el.nodeType !== 11) {\n return el;\n }\n return targetEl;\n },\n void 0\n);\nconst typeReplace = (newWDom) => {\n const parentWDom = getParent(newWDom);\n const orignalElement = newWDom.el;\n if (parentWDom.type && orignalElement) {\n if (orignalElement.nodeType === 11) {\n typeSortedReplace(newWDom);\n } else {\n const parentElement = findRealParentElement(parentWDom);\n const newElement = wDomToDom(newWDom);\n if (parentElement) {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\nconst removeEvent = (oldProps, element) => {\n entries(oldProps || {}).forEach(([dataKey, dataValue]) => {\n if (dataKey.match(/^on/)) {\n element.removeEventListener(\n getEventName(dataKey),\n dataValue\n );\n }\n });\n};\nconst typeUpdate = (newWDom) => {\n var _a;\n const element = newWDom.el;\n if (newWDom.type === \"text\") {\n updateText(newWDom);\n return;\n }\n if (element) {\n const { oldProps, props } = newWDom;\n updateProps$1(props, element, oldProps);\n delete newWDom.oldProps;\n if (newWDom.tag === \"input\") {\n element.value = String(((_a = newWDom == null ? void 0 : newWDom.props) == null ? void 0 : _a.value) || \"\");\n }\n }\n (newWDom.children || []).forEach((childItem) => wDomUpdate(childItem));\n runUpdatedQueueFromWDom(newWDom);\n};\nconst updateText = (newWDom) => {\n const element = newWDom.el;\n if (element) {\n element.nodeValue = String(newWDom.text);\n }\n};\nconst updateProps$1 = (props, element, oldProps) => {\n const originalProps = { ...oldProps };\n entries(props || {}).forEach(([dataKey, dataValue]) => {\n let chkRemoveProp = true;\n if (dataKey === \"key\")\n ;\n else if (dataKey === \"innerHTML\" && typeof dataValue === \"string\") {\n element.innerHTML = dataValue;\n } else if (checkStyleData(dataKey, dataValue)) {\n updateStyle(\n dataValue,\n checkStyleData(dataKey, originalProps.style) ? originalProps.style : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (dataKey.match(/^on/)) {\n updateEvent(\n element,\n dataKey,\n dataValue,\n originalProps[dataKey]\n );\n } else if (checkCheckableElement(element) && dataKey === \"checked\") {\n element.checked = !!dataValue;\n } else if (checkTextareaElement(element) && dataKey === \"value\") {\n element.value = dataValue;\n } else if (checkOptionElement(element) && dataKey === \"selected\") {\n element.selected = !!dataValue;\n } else if (dataKey) {\n [chkRemoveProp, dataValue] = makeAttrDataValue(dataValue);\n if (chkRemoveProp) {\n setAttr(\n getAttrKey(dataKey),\n element,\n dataValue\n );\n }\n }\n if (chkRemoveProp) {\n delete originalProps[dataKey];\n }\n });\n keys(originalProps).forEach(\n (dataKey) => element.removeAttribute(dataKey)\n );\n};\nconst setAttr = (dataKey, element, dataValue) => {\n if (xmlnsRef.value && dataKey !== \"xmlns\") {\n element.setAttributeNS(null, dataKey, dataValue);\n } else {\n element.setAttribute(dataKey, dataValue);\n }\n};\nconst makeAttrDataValue = (dataValue) => {\n let allowSetAttr = true;\n if (typeof dataValue === \"boolean\") {\n if (!dataValue) {\n allowSetAttr = false;\n }\n dataValue = \"\";\n }\n return [allowSetAttr, String(dataValue)];\n};\nconst wDomToDom = (wDom) => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n if (tag === \"svg\") {\n xmlnsRef.value = String(props == null ? void 0 : props.xmlns);\n }\n if (isVirtualType) {\n element = DF();\n } else if (type === \"element\" && tag) {\n element = xmlnsRef.value ? document.createElementNS(xmlnsRef.value, tag) : CE(tag);\n } else if (type === \"text\" && checkExisty(text)) {\n element = document.createTextNode(String(text));\n } else {\n element = CE(\"e\");\n }\n wDomChildrenToDom(children, element);\n updateProps$1(props, element);\n wDom.el = element;\n addMountedQueue(wDom);\n if (tag === \"svg\") {\n xmlnsRef.value = \"\";\n }\n return element;\n};\nconst wDomChildrenToDom = (children, parentElement) => {\n const elementChildren = children.reduce(\n (acc, childItem) => {\n if (childItem.type) {\n acc.appendChild(wDomToDom(childItem));\n }\n return acc;\n },\n DF()\n );\n if (parentElement && elementChildren.hasChildNodes()) {\n parentElement.appendChild(elementChildren);\n }\n};\nconst updateEvent = (element, eventKey, newEventHandler, oldEventHandler) => {\n const eventName = getEventName(eventKey);\n if (oldEventHandler !== newEventHandler) {\n if (oldEventHandler) {\n element.removeEventListener(eventName, oldEventHandler);\n }\n if (newEventHandler) {\n element.addEventListener(eventName, newEventHandler);\n }\n }\n};\nconst updateStyle = (style, oldStyle, element) => {\n const originalStyle = { ...oldStyle };\n const elementStyle = element == null ? void 0 : element.style;\n if (elementStyle) {\n entries(style).forEach(([styleKey, dataValue]) => {\n elementStyle[styleKey] = dataValue;\n delete originalStyle[styleKey];\n });\n entries(originalStyle).forEach(\n ([styleKey]) => elementStyle[styleKey] = \"\"\n );\n }\n};\nconst findRealParentElement = (vDom) => {\n const isVirtualType = checkVirtualType(vDom.type);\n if (vDom.isRoot && isVirtualType) {\n return vDom.wrapElement;\n }\n if (!isVirtualType) {\n return vDom.el;\n }\n return findRealParentElement(getParent(vDom));\n};\nconst makeNewWDomTree = (newWDom, originalWDom) => remakeNewWDom(\n newWDom,\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n);\nconst remakeNewWDom = (newWDom, isSameType, originalWDom) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const param = [\n remakeWDom,\n isSameType,\n originalWDom\n ];\n const needRerender = addReRenderTypeProperty(...param);\n remakeWDom.children = remakeChildrenForDiff(...param);\n remakeWDom.needRerender = needRerender;\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n return remakeWDom;\n};\nconst inheritPropForRender = (remakeWDom, originalWDom, needRerender) => {\n if (needRerender !== \"A\" && originalWDom) {\n remakeWDom.el = originalWDom.el;\n }\n if (needRerender && [\"D\", \"R\", \"SR\"].includes(needRerender)) {\n if (originalWDom == null ? void 0 : originalWDom.compKey) {\n runUnmountQueueFromWDom(originalWDom);\n recursiveRemoveEvent(originalWDom);\n }\n remakeWDom.oldChildren = originalWDom == null ? void 0 : originalWDom.children;\n }\n remakeWDom.oldProps = originalWDom == null ? void 0 : originalWDom.props;\n};\nconst addReRenderTypeProperty = (newWDom, isSameType, originalWDom) => {\n const existOriginalWDom = originalWDom && originalWDom.type;\n const isEmptyElement = checkEmptyElement(newWDom);\n const isRoot = newWDom.isRoot;\n const originalParentWDom = originalWDom && getParent(originalWDom);\n const origParentType = !isRoot && (originalParentWDom == null ? void 0 : originalParentWDom.type);\n const key = getKey(newWDom);\n const isKeyCheckedWDom = origParentType === \"loop\" && checkExisty(key);\n const isSameText = newWDom.type === \"text\" && isSameType && newWDom.text === (originalWDom == null ? void 0 : originalWDom.text);\n 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 if (newWDom.type === \"loop\" && result === \"U\" && originalWDom && chkDiffLoopOrder(newWDom, originalWDom)) {\n result = \"CNSU\";\n }\n return result;\n};\nconst chkDiffLoopOrder = (newWDom, originalWDom) => {\n const origChildren = [...(originalWDom == null ? void 0 : originalWDom.children) || []];\n const newChildren = [...(newWDom == null ? void 0 : newWDom.children) || []];\n const filteredChildren = origChildren.filter(\n (item) => newChildren.find((newItem) => getKey(item) === getKey(newItem))\n );\n let isSame = filteredChildren.length === newChildren.length;\n if (isSame) {\n isSame = filteredChildren.every(\n (item, index) => getKey(item) === getKey(newChildren[index])\n );\n }\n return isSame;\n};\nconst updateProps = (props, infoProps) => {\n if (props && infoProps !== props) {\n keys(props).forEach((key) => delete props[key]);\n entries(infoProps || {}).forEach(([key, value]) => props[key] = value);\n }\n};\nconst updateChildren = (children, infoChidren) => {\n if (children && infoChidren !== children) {\n children.splice(0, children.length);\n if (infoChidren) {\n infoChidren.forEach((childrenItem) => children.push(childrenItem));\n }\n }\n};\nconst runUpdate = (vDom, infoVdom) => {\n const { compProps: props, compChild: children } = vDom;\n const { props: infoProps, children: infoChidren } = infoVdom;\n if (props) {\n updateProps(props, infoProps);\n }\n if (children) {\n updateChildren(children, infoChidren);\n }\n const newVDom = vDom.reRender && vDom.reRender();\n return newVDom;\n};\nconst generalize = (newWDom, isSameType, originalWDom) => {\n if (checkCustemComponentFunction(newWDom)) {\n return isSameType && originalWDom ? runUpdate(originalWDom, newWDom) : newWDom.resolve();\n }\n return newWDom;\n};\nconst remakeChildrenForDiff = (newWDom, isSameType, originalWDom) => isSameType && originalWDom ? remakeChildrenForUpdate(newWDom, originalWDom) : remakeChildrenForAdd(newWDom);\nconst remakeChildrenForAdd = (newWDom) => (newWDom.children || []).map(\n (item) => assign(makeNewWDomTree(item), { getParent: () => newWDom })\n);\nconst remakeChildrenForUpdate = (newWDom, originalWDom) => newWDom.type === \"loop\" && checkExisty(getKey((newWDom.children || [])[0])) ? remakeChildrenForLoopUpdate(newWDom, originalWDom) : (newWDom.children || []).map(\n (item, index) => assign(makeNewWDomTree(item, (originalWDom.children || [])[index]), {\n getParent: () => newWDom\n })\n);\nconst remakeChildrenForLoopUpdate = (newWDom, originalWDom) => {\n const [remakedChildren, unUsedChildren] = diffLoopChildren(\n newWDom,\n originalWDom\n );\n unUsedChildren.map((unusedItem) => {\n runUnmountQueueFromWDom(unusedItem);\n recursiveRemoveEvent(unusedItem);\n typeDelete(unusedItem);\n });\n return remakedChildren;\n};\nconst diffLoopChildren = (newWDom, originalWDom) => {\n const newChildren = [...newWDom.children || []];\n const originalChildren = [...originalWDom.children || []];\n const remakedChildren = newChildren.map((item) => {\n const originalItem = findSameKeyOriginalItem(item, originalChildren);\n const childItem = makeNewWDomTree(item, originalItem);\n if (originalItem) {\n originalChildren.splice(originalChildren.indexOf(originalItem), 1);\n }\n childItem.getParent = () => newWDom;\n return childItem;\n });\n return [remakedChildren, originalChildren];\n};\nconst findSameKeyOriginalItem = (item, originalChildren) => originalChildren.find(\n (orignalChildItem) => getKey(orignalChildItem) === getKey(item)\n);\nlet redrawQueue = [];\nlet redrawQueueTimeout = false;\nconst setRedrawAction = (compKey, exec) => {\n componentRef.get(compKey).up = () => {\n redrawQueue.push({\n compKey,\n exec\n });\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n };\n};\nconst componentUpdate = (compKey) => () => {\n var _a;\n const up = (_a = componentRef.get(compKey)) == null ? void 0 : _a.up;\n let result = false;\n if (up) {\n up();\n result = true;\n }\n return result;\n};\nconst recursiveGetChildKeys = (wDom, result) => {\n (wDom.children || []).forEach((item) => {\n const childComKey = item.compKey;\n if (childComKey) {\n result.push(childComKey);\n }\n recursiveGetChildKeys(item, result);\n });\n};\nconst execRedrawQueue = () => {\n let childItemList = [];\n redrawQueue.forEach((item) => {\n var _a, _b;\n const childVd = (_b = (_a = componentRef.get(item.compKey)) == null ? void 0 : _a.vd) == null ? void 0 : _b.value;\n if (childVd) {\n recursiveGetChildKeys(childVd, childItemList);\n }\n });\n const addedKey = [];\n const result = redrawQueue.reduce((acc, item) => {\n const { compKey } = item;\n if (childItemList.includes(compKey) || addedKey.includes(compKey)) {\n return acc;\n }\n addedKey.push(compKey);\n acc.push(item);\n return acc;\n }, []);\n while (result.length) {\n const action = result.shift();\n if (action) {\n action.exec();\n }\n }\n redrawQueue = [];\n redrawQueueTimeout = false;\n};\nconst updateCallback = (effectAction, dependencies = () => []) => {\n const updateReqs = componentRef.get(getComponentKey()).upR;\n updateReqs.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\nconst runUpdateCallback = () => {\n var _a;\n const updateReqs = (_a = componentRef.get(getComponentKey())) == null ? void 0 : _a.upR;\n if (updateReqs == null ? void 0 : updateReqs.length) {\n updateReqs.forEach((callback) => callback());\n }\n};\nconst Fragment = (_props, ...children) => ({\n type: \"fragment\",\n children\n});\nconst h = (tag, props, ...children) => {\n const nodeParentPointer = { value: void 0 };\n const newProps = props || {};\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, newProps, newChildren);\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n return node;\n};\nconst mount = (component) => (_props, _children) => component;\nconst reRenderCustomComponent = (tag, props, children, originalWDom) => {\n var _a;\n needDiffRef.value = true;\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n const { isRoot, getParent: getParent2, wrapElement, afterElement } = originalWDom;\n newWDomTree.getParent = getParent2;\n if (!isRoot && getParent2) {\n const brothers = ((_a = getParent2()) == null ? void 0 : _a.children) || [];\n const index = brothers.indexOf(originalWDom);\n brothers.splice(index, 1, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.wrapElement = wrapElement;\n newWDomTree.afterElement = afterElement;\n }\n needDiffRef.value = false;\n wDomUpdate(newWDomTree);\n};\nconst makeWDomResolver = (tag, props, children) => {\n const tagName = tag.name;\n const ctor = tag;\n const resolve = (compKey = props) => {\n initMountHookState(compKey);\n const component = tag(props, children);\n const componentMaker = component(componentUpdate(compKey), props, children);\n const customNode = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n children\n );\n const originalWDom = customNode;\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n getComponentSubInfo(compKey, \"vd\").value = customNode;\n return customNode;\n };\n return { tagName, ctor, props, children, resolve };\n};\nconst makeCustomNode = (componentMaker, compKey, tag, props, children) => {\n const customNode = componentMaker(props);\n if (customNode.reRender) {\n throw new Error(\n 'Avoid the case where the first element of a component is a component. Instead of \"mount(()=>()=><Component />)\" replace it with something like \"mount(()=>()=><Fragment><Component /></Fragment>)\".'\n );\n }\n addComponentProps(\n customNode,\n compKey,\n tag,\n props,\n children,\n makeReRender(componentMaker, compKey, tag, props, children)\n );\n return customNode;\n};\nconst makeReRender = (componentMaker, compKey, tag, props, children) => {\n const reRender = () => wDomMaker(componentMaker, compKey, tag, props, children, reRender);\n return reRender;\n};\nconst wDomMaker = (componentMaker, compKey, tag, props, children, reRender) => {\n initUpdateHookState(compKey);\n runUpdateCallback();\n const originalWDom = componentMaker(props);\n setRedrawAction(\n compKey,\n () => reRenderCustomComponent(tag, props, children, originalWDom)\n );\n addComponentProps(originalWDom, compKey, tag, props, children, reRender);\n getComponentSubInfo(compKey, \"vd\").value = originalWDom;\n return originalWDom;\n};\nconst addComponentProps = (wDom, compKey, tag, props, children, reRender) => {\n assign(wDom, {\n compProps: props,\n compChild: children,\n ctor: tag,\n tagName: tag.name,\n compKey,\n reRender\n });\n};\nconst makeNode = (tag, props, children) => {\n if (checkFragmentFunction(tag)) {\n return Fragment(props, ...children);\n } else if (checkCustemComponentFunction(tag)) {\n const componetMakeResolver = makeWDomResolver(tag, props, children);\n return needDiffRef.value ? componetMakeResolver : componetMakeResolver.resolve();\n }\n return {\n type: \"element\",\n tag,\n props,\n children\n };\n};\nconst remakeChildren = (nodeParentPointer, children) => children.map(\n (item) => assign(makeChildrenItem(item), { getParent: () => nodeParentPointer.value })\n);\nconst makeChildrenItem = (item) => {\n if (item === null || item === void 0 || item === false) {\n return { type: null };\n } else if (Array.isArray(item)) {\n const nodeParentPointer = { value: void 0 };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: \"loop\",\n children\n };\n nodeParentPointer.value = node;\n return node;\n } else if (typeof item === \"string\" || typeof item === \"number\") {\n return { type: \"text\", text: item };\n }\n return item;\n};\nconst ref = (initValue) => ({ value: initValue });\nconst nextTick = () => Promise.resolve();\nexport {\n Fragment,\n h,\n mount,\n mountCallback,\n nextTick,\n ref,\n render,\n updateCallback\n};\n//# sourceMappingURL=lithent.mjs.map\n","import { mountCallback as a, updateCallback as p, nextTick as h, render as i } 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}, m = (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}, d = (r, t = () => {\n}, e = () => []) => {\n a(() => (r(), t)), p(() => (t && t(), r), e);\n}, l = /* @__PURE__ */ new Map(), u = {}, x = (r) => {\n const t = Symbol();\n return l.set(t, r), (e) => (e && (u[t] ?? (u[t] = []), u[t].push(e)), f(t));\n}, f = (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 c = u[r], s = [];\n return c.forEach((o) => {\n o() || s.push(o);\n }), s.forEach(\n (o) => c.splice(c.indexOf(o), 1)\n ), !0;\n }\n}), E = (r, t, e) => {\n let n = () => {\n };\n return h().then(() => {\n n = i(r(), t, e);\n }), () => n();\n};\nexport {\n m as computed,\n d as effect,\n E as nextTickRender,\n v as state,\n x as store\n};\n//# sourceMappingURL=lithentHelper.mjs.map\n","// example.jsx\nimport {\n h,\n Fragment,\n render,\n ref,\n mountCallback,\n updateCallback,\n mount,\n} from 'lithent';\nimport { state, computed, effect, store } from 'lithent/helper';\n\n// This is the \"mount\" function.\n// This function is only executed on mount, and on update, only updates `props` and then executes the internal return function.\n// childen is passed as the second argument.\nconst ChildComponent = mount<{ parentValue: number }>(\n (renew, props, children) => {\n // The value is used as a \"getter\" to make it easy to get and write to in the higher-order functions it returns\n const count = state<number>(1, renew);\n const text = state<string>(\n '\"destructuring\" the \"props\" value directly from the mount function will cause referencing issues, so if you want to use it, you need to \"destructuring\" it from the internal function (updater).',\n renew\n );\n const getParentValue = () => props.parentValue;\n const parentValueFromMount = props.parentValue;\n const summ = computed<number>(\n () => count.v + notRefValue + props.parentValue\n );\n\n const localStore = store<{ text: string; count: number }>({\n text: 's',\n count: 0,\n })(renew);\n /*\n // To share a store, make it externally and use `asign`.\n const asignStore = store<{ text: string; count: number }>({ text: 's', count: 0 });\n\n const sharedStore = asignStore(nenew);\n */\n\n // Even if you don't use a ref, the private value is always maintained as a regular variable.\n let notRefValue = props.parentValue;\n\n // Ref is only used to reference the DOM.\n const domRef = ref(null);\n\n const increase = () => {\n count.v = count.v + 1;\n notRefValue += 1;\n };\n\n const handleInputChane = (event: InputEvent) => {\n text.v = (event.target as HTMLInputElement).value;\n };\n\n const localStoreUpdate = () => {\n localStore.count += 1;\n localStore.text += '1';\n };\n\n const handleMounted = () => {\n console.log('MOUNTED', domRef);\n\n return () => console.log('UNMOUNT');\n };\n const handleUpdated = () => {\n console.log('UPDATE - parentValue');\n\n return () => console.log('UPDATED');\n };\n\n mountCallback(handleMounted);\n updateCallback(handleUpdated, () => [props.parentValue]); // Only Defs Updated (using a closure to update a value)\n\n // Behaves like `react`'s `useEffect`\n effect(\n () => console.log('INJECT'),\n () => console.log('CLEAN_UP'),\n () => [count.v]\n );\n\n // Wrap in a function and return (using a closure to hold the value)\n // This is the \"update\" function.\n return ({ parentValue }) => (\n <Fragment>\n {/* Note that the event is onInput (we use the native event name to avoid confusion). */}\n <div>\n <textarea\n value={text.v}\n onInput={handleInputChane}\n style={{ width: '300px', height: '100px' }}\n />\n </div>\n <div>{text.v}</div>\n <div>\n <div style={{ color: 'blue' }}>\n parentValueFromRef: {props.parentValue} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromFunction: {getParentValue()} (working)\n </div>\n <div style={{ color: 'blue' }}>\n parentValueFromUpdaterDestructuring: {parentValue} (working)\n </div>\n <div style={{ color: 'red' }}>\n parentValueFromMounterDestructuring: {parentValueFromMount} (not\n working)\n </div>\n </div>\n <div>\n <div ref={domRef}>count: {count.v}</div>\n <div>sum: {count.v + notRefValue + props.parentValue}</div>\n <div>sum(computed): {summ.v}</div>\n {/* It doesn't pull it out from under the reference, it uses the value directly, so you can just use it. */}\n <div>notRefValue: {notRefValue}</div>\n <div>localStore(text): {localStore.text}</div>\n <div>localStore(count): {localStore.count}</div>\n </div>\n <button onClick={increase}>Increase</button>\n <button onClick={localStoreUpdate}>localStoreUpdate</button>\n {children}\n </Fragment>\n );\n }\n);\n\nconst Root = mount(renew => {\n const parentNumber = state<number>(7, renew);\n\n const increaseParent = () => {\n parentNumber.v = parentNumber.v + 1;\n };\n\n const decreaseParent = () => {\n parentNumber.v = parentNumber.v - 1;\n };\n\n return () => (\n <Fragment>\n <ChildComponent parentValue={parentNumber.v}>\n <button onClick={increaseParent}>Increase - Parent</button>\n </ChildComponent>\n <button onClick={decreaseParent}>Decrease - Parent</button>\n </Fragment>\n );\n});\nconst root = <Root />;\n\nrender(root, document.getElementById('root'));\n"],"names":["checkPlainWDomType","wDom","checkPlainType","typeName","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","_a","_b","checkSameTagElement","checkNormalTypeElement","checkExisty","getKey","target","checkVirtualType","type","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","value","checkStyleData","dataKey","dataValue","checkRefData","checkOptionElement","element","checkTextareaElement","checkCheckableElement","getWDomType","result","checkSameWDomWithOriginal","getParent","vDom","entries","keys","assign","xmlnsRef","compKeyRef","needDiffRef","componentRef","setComponetRef","compKey","getComponentKey","getComponentSubInfo","subKey","initUpdateHookState","initMountHookState","unmount","effectAction","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","item","subInfo","effect","mountedQueue","execMountedQueue","runMountedQueueFromWDom","addMountedQueue","mountCallback","component","queue","sequence","callback","useUpdated","dependencies","upD","upS","def","checkNeedPushQueue","runUpdatedQueueFromWDom","originalDefs","newDefs","index","getAttrKey","keyName","getEventName","eventKey","_match","p1","DF","CE","t","render","wrapElement","afterElement","Dom","wDomToDom","recursiveRemoveEvent","rootDelete","wDomUpdate","newWDomTree","needRerender","typeAdd","typeDelete","typeReplace","typeUpdate","typeSortedReplace","typeSortedUpdate","removeEvent","childItem","deleteRealDom","findRealParentElement","parent","findChildWithRemoveElement","newElement","getElementFromFragment","parentWDom","parentEl","nextEl","startFindNextBrotherElement","acc","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","el","isFragment","orignalElement","parentElement","oldProps","updateText","props","updateProps$1","originalProps","chkRemoveProp","updateStyle","updateEvent","makeAttrDataValue","setAttr","allowSetAttr","tag","text","children","isVirtualType","wDomChildrenToDom","elementChildren","newEventHandler","oldEventHandler","eventName","style","oldStyle","originalStyle","elementStyle","styleKey","makeNewWDomTree","remakeNewWDom","isSameType","remakeWDom","generalize","param","addReRenderTypeProperty","remakeChildrenForDiff","inheritPropForRender","existOriginalWDom","isEmptyElement","isRoot","originalParentWDom","origParentType","key","isKeyCheckedWDom","isSameText","chkDiffLoopOrder","origChildren","newChildren","filteredChildren","newItem","isSame","updateProps","infoProps","updateChildren","infoChidren","childrenItem","runUpdate","infoVdom","remakeChildrenForUpdate","remakeChildrenForAdd","remakeChildrenForLoopUpdate","remakedChildren","unUsedChildren","diffLoopChildren","unusedItem","originalChildren","originalItem","findSameKeyOriginalItem","orignalChildItem","redrawQueue","redrawQueueTimeout","setRedrawAction","exec","execRedrawQueue","componentUpdate","up","recursiveGetChildKeys","childComKey","childItemList","childVd","addedKey","action","updateCallback","runUpdateCallback","updateReqs","_props","h","nodeParentPointer","newProps","remakeChildren","node","makeNode","mount","_children","reRenderCustomComponent","makeWDomResolver","getParent2","componentMaker","customNode","makeCustomNode","addComponentProps","makeReRender","reRender","wDomMaker","componetMakeResolver","makeChildrenItem","ref","initValue","v","r","e","n","m","d","a","p","l","u","x","f","c","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":"ssBAAA,MAAMA,EAAsBC,GAAS,OAAOA,GAAS,UAAY,EAAE,YAAaA,GAC1EC,EAAiB,CAACD,EAAME,IAAaH,EAAmBC,CAAI,GAAKA,EAAK,OAASE,EAC/EC,GAA2B,CAACC,EAASC,IAAiB,SAAUD,EAAUA,EAAQ,QAAUC,GAAgB,KAAO,OAASA,EAAa,MAAQD,KAAaC,GAAgB,KAAO,OAASA,EAAa,MAC3MC,GAA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K,IAAA,EAEnBpL,GAAOwL,GAAM,SAAS,eAAe,MAAM,CAAC"}
|
package/examples/dist/index.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>lithent</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-2e91d52a.js"></script>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<section id="root"></section>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const store: <T extends {}>(value: T) => (renew
|
|
1
|
+
export declare const store: <T extends {}>(value: T) => (renew?: () => boolean) => T;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { mountCallback as a, updateCallback as p, nextTick as h, render as
|
|
2
|
-
const
|
|
1
|
+
import { mountCallback as a, updateCallback as p, nextTick as h, render as i } from "lithent";
|
|
2
|
+
const v = (r, t) => {
|
|
3
3
|
let e = r;
|
|
4
4
|
return {
|
|
5
5
|
get value() {
|
|
@@ -36,8 +36,8 @@ const f = (r, t) => {
|
|
|
36
36
|
a(() => (r(), t)), p(() => (t && t(), r), e);
|
|
37
37
|
}, l = /* @__PURE__ */ new Map(), u = {}, x = (r) => {
|
|
38
38
|
const t = Symbol();
|
|
39
|
-
return l.set(t, r), (e) => (u[t] ?? (u[t] = []), u[t].push(e),
|
|
40
|
-
},
|
|
39
|
+
return l.set(t, r), (e) => (e && (u[t] ?? (u[t] = []), u[t].push(e)), f(t));
|
|
40
|
+
}, f = (r) => new Proxy(l.get(r), {
|
|
41
41
|
get(t, e) {
|
|
42
42
|
return t[e];
|
|
43
43
|
},
|
|
@@ -54,14 +54,14 @@ const f = (r, t) => {
|
|
|
54
54
|
let n = () => {
|
|
55
55
|
};
|
|
56
56
|
return h().then(() => {
|
|
57
|
-
n =
|
|
57
|
+
n = i(r(), t, e);
|
|
58
58
|
}), () => n();
|
|
59
59
|
};
|
|
60
60
|
export {
|
|
61
61
|
m as computed,
|
|
62
62
|
d as effect,
|
|
63
63
|
E as nextTickRender,
|
|
64
|
-
|
|
64
|
+
v as state,
|
|
65
65
|
x as store
|
|
66
66
|
};
|
|
67
67
|
//# sourceMappingURL=lithentHelper.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lithentHelper.mjs","sources":["../src/hook/state.ts","../src/hook/computed.ts","../src/hook/effect.ts","../src/hook/store.ts","../src/hook/nextTickRender.ts"],"sourcesContent":["export const state = <T>(\n value: T,\n renew: () => boolean\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result;\n },\n get v() {\n return result;\n },\n set value(newValue: T) {\n result = newValue;\n renew();\n },\n set v(newValue: T) {\n result = newValue;\n renew();\n },\n };\n};\n","export const computed = <T>(\n value: () => T\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result();\n },\n get v() {\n return result();\n },\n set value(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n set v(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n };\n};\n","import { updateCallback, mountCallback } from 'lithent';\n\nexport const effect = (\n forward: () => (() => void) | void,\n backward: () => (() => void) | void = () => {},\n dependencies: () => any[] = () => []\n) => {\n mountCallback(() => {\n forward();\n\n return backward;\n });\n\n updateCallback(() => {\n if (backward) {\n backward();\n }\n\n return forward;\n }, dependencies);\n};\n","/**\n * DataStore\n */\nconst storeGroup = new Map<string | symbol, unknown>();\nconst storeRenderList: {\n [key: string | symbol]: (() => boolean)[];\n} = {};\n\nexport const store = <T extends {}>(value: T) => {\n const storeKey = Symbol();\n storeGroup.set(storeKey, value);\n\n return (renew
|
|
1
|
+
{"version":3,"file":"lithentHelper.mjs","sources":["../src/hook/state.ts","../src/hook/computed.ts","../src/hook/effect.ts","../src/hook/store.ts","../src/hook/nextTickRender.ts"],"sourcesContent":["export const state = <T>(\n value: T,\n renew: () => boolean\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result;\n },\n get v() {\n return result;\n },\n set value(newValue: T) {\n result = newValue;\n renew();\n },\n set v(newValue: T) {\n result = newValue;\n renew();\n },\n };\n};\n","export const computed = <T>(\n value: () => T\n): {\n value: T;\n v: T;\n} => {\n let result = value;\n\n return {\n get value() {\n return result();\n },\n get v() {\n return result();\n },\n set value(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n set v(_newValue: T) {\n throw new Error(`You can't change 'computed'`);\n },\n };\n};\n","import { updateCallback, mountCallback } from 'lithent';\n\nexport const effect = (\n forward: () => (() => void) | void,\n backward: () => (() => void) | void = () => {},\n dependencies: () => any[] = () => []\n) => {\n mountCallback(() => {\n forward();\n\n return backward;\n });\n\n updateCallback(() => {\n if (backward) {\n backward();\n }\n\n return forward;\n }, dependencies);\n};\n","/**\n * DataStore\n */\nconst storeGroup = new Map<string | symbol, unknown>();\nconst storeRenderList: {\n [key: string | symbol]: (() => boolean)[];\n} = {};\n\nexport const store = <T extends {}>(value: T) => {\n const storeKey = Symbol();\n storeGroup.set(storeKey, value);\n\n return (renew?: () => boolean) => {\n if (renew) {\n storeRenderList[storeKey] ??= [];\n storeRenderList[storeKey].push(renew);\n }\n\n return updater<T>(storeKey);\n };\n};\n\nconst updater = <T extends { [key: string | symbol]: unknown }>(\n storeKey: string | symbol\n) =>\n new Proxy(storeGroup.get(storeKey) as T, {\n get(target: T, prop: string) {\n return target[prop];\n },\n set(target, prop: keyof T, value) {\n target[prop] = value;\n const renderList = storeRenderList[storeKey];\n const trashCollections: (() => boolean)[] = [];\n\n renderList.forEach(renew => {\n if (!renew()) {\n trashCollections.push(renew);\n }\n });\n\n trashCollections.forEach(deleteTarget =>\n renderList.splice(renderList.indexOf(deleteTarget), 1)\n );\n\n return true;\n },\n });\n","import { render, WDom, nextTick } from 'lithent';\n\nexport const nextTickRender = (\n wDomMaker: () => WDom,\n wrapElement: HTMLElement | null,\n afterElement?: HTMLElement | null\n) => {\n let destroy = () => {};\n\n nextTick().then(() => {\n destroy = render(wDomMaker(), wrapElement, afterElement);\n });\n\n return () => destroy();\n};\n"],"names":["state","value","renew","result","newValue","computed","_newValue","effect","forward","backward","dependencies","mountCallback","updateCallback","storeGroup","storeRenderList","store","storeKey","updater","target","prop","renderList","trashCollections","deleteTarget","nextTickRender","wDomMaker","wrapElement","afterElement","destroy","nextTick","render"],"mappings":";AAAa,MAAAA,IAAQ,CACnBC,GACAC,MAIG;AACH,MAAIC,IAASF;AAEN,SAAA;AAAA,IACL,IAAI,QAAQ;AACH,aAAAE;AAAA,IACT;AAAA,IACA,IAAI,IAAI;AACC,aAAAA;AAAA,IACT;AAAA,IACA,IAAI,MAAMC,GAAa;AACZ,MAAAD,IAAAC,GACHF;IACR;AAAA,IACA,IAAI,EAAEE,GAAa;AACR,MAAAD,IAAAC,GACHF;IACR;AAAA,EAAA;AAEJ,GCzBaG,IAAW,CACtBJ,MAIG;AACH,MAAIE,IAASF;AAEN,SAAA;AAAA,IACL,IAAI,QAAQ;AACV,aAAOE,EAAO;AAAA,IAChB;AAAA,IACA,IAAI,IAAI;AACN,aAAOA,EAAO;AAAA,IAChB;AAAA,IACA,IAAI,MAAMG,GAAc;AAChB,YAAA,IAAI,MAAM,6BAA6B;AAAA,IAC/C;AAAA,IACA,IAAI,EAAEA,GAAc;AACZ,YAAA,IAAI,MAAM,6BAA6B;AAAA,IAC/C;AAAA,EAAA;AAEJ,GCpBaC,IAAS,CACpBC,GACAC,IAAsC,MAAM;AAAC,GAC7CC,IAA4B,MAAM,OAC/B;AACH,EAAAC,EAAc,OACJH,KAEDC,EACR,GAEDG,EAAe,OACTH,KACOA,KAGJD,IACNE,CAAY;AACjB,GCjBMG,wBAAiB,OACjBC,IAEF,CAAA,GAESC,IAAQ,CAAed,MAAa;AAC/C,QAAMe,IAAW;AACN,SAAAH,EAAA,IAAIG,GAAUf,CAAK,GAEvB,CAACC,OACFA,MACcY,EAAAE,OAAAF,EAAAE,KAAc,KACdF,EAAAE,CAAQ,EAAE,KAAKd,CAAK,IAG/Be,EAAWD,CAAQ;AAE9B,GAEMC,IAAU,CACdD,MAEA,IAAI,MAAMH,EAAW,IAAIG,CAAQ,GAAQ;AAAA,EACvC,IAAIE,GAAWC,GAAc;AAC3B,WAAOD,EAAOC,CAAI;AAAA,EACpB;AAAA,EACA,IAAID,GAAQC,GAAelB,GAAO;AAChC,IAAAiB,EAAOC,CAAI,IAAIlB;AACT,UAAAmB,IAAaN,EAAgBE,CAAQ,GACrCK,IAAsC,CAAA;AAE5C,WAAAD,EAAW,QAAQ,CAASlB,MAAA;AACtB,MAACA,OACHmB,EAAiB,KAAKnB,CAAK;AAAA,IAC7B,CACD,GAEgBmB,EAAA;AAAA,MAAQ,OACvBD,EAAW,OAAOA,EAAW,QAAQE,CAAY,GAAG,CAAC;AAAA,IAAA,GAGhD;AAAA,EACT;AACF,CAAC,GC5CUC,IAAiB,CAC5BC,GACAC,GACAC,MACG;AACH,MAAIC,IAAU,MAAM;AAAA,EAAA;AAEX,SAAAC,EAAA,EAAE,KAAK,MAAM;AACpB,IAAAD,IAAUE,EAAOL,EAAa,GAAAC,GAAaC,CAAY;AAAA,EAAA,CACxD,GAEM,MAAMC,EAAQ;AACvB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(r,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("lithent")):typeof define=="function"&&define.amd?define(["exports","lithent"],u):(r=typeof globalThis<"u"?globalThis:r||self,u(r.lithentHelper={},r.lithent))})(this,function(r,u){"use strict";const d=(n,e)=>{let t=n;return{get value(){return t},get v(){return t},set value(o){t=o,e()},set v(o){t=o,e()}}},a=n=>{let e=n;return{get value(){return e()},get v(){return e()},set value(t){throw new Error("You can't change 'computed'")},set v(t){throw new Error("You can't change 'computed'")}}},p=(n,e=()=>{},t=()=>[])=>{u.mountCallback(()=>(n(),e)),u.updateCallback(()=>(e&&e(),n),t)},l=new Map,c={},h=n=>{const e=Symbol();return l.set(e,n),t=>(c[e]??(c[e]=[]),c[e].push(t),g(e))},g=n=>new Proxy(l.get(n),{get(e,t){return e[t]},set(e,t,o){e[t]=o;const i=c[n],f=[];return i.forEach(s=>{s()||f.push(s)}),f.forEach(s=>i.splice(i.indexOf(s),1)),!0}}),m=(n,e,t)=>{let o=()=>{};return u.nextTick().then(()=>{o=u.render(n(),e,t)}),()=>o()};r.computed=a,r.effect=p,r.nextTickRender=m,r.state=d,r.store=h,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
1
|
+
(function(r,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("lithent")):typeof define=="function"&&define.amd?define(["exports","lithent"],u):(r=typeof globalThis<"u"?globalThis:r||self,u(r.lithentHelper={},r.lithent))})(this,function(r,u){"use strict";const d=(n,e)=>{let t=n;return{get value(){return t},get v(){return t},set value(o){t=o,e()},set v(o){t=o,e()}}},a=n=>{let e=n;return{get value(){return e()},get v(){return e()},set value(t){throw new Error("You can't change 'computed'")},set v(t){throw new Error("You can't change 'computed'")}}},p=(n,e=()=>{},t=()=>[])=>{u.mountCallback(()=>(n(),e)),u.updateCallback(()=>(e&&e(),n),t)},l=new Map,c={},h=n=>{const e=Symbol();return l.set(e,n),t=>(t&&(c[e]??(c[e]=[]),c[e].push(t)),g(e))},g=n=>new Proxy(l.get(n),{get(e,t){return e[t]},set(e,t,o){e[t]=o;const i=c[n],f=[];return i.forEach(s=>{s()||f.push(s)}),f.forEach(s=>i.splice(i.indexOf(s),1)),!0}}),m=(n,e,t)=>{let o=()=>{};return u.nextTick().then(()=>{o=u.render(n(),e,t)}),()=>o()};r.computed=a,r.effect=p,r.nextTickRender=m,r.state=d,r.store=h,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
|
2
2
|
//# sourceMappingURL=lithentHelper.umd.js.map
|