lithent 1.23.0 → 1.24.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.
Files changed (128) hide show
  1. package/devHelper/dist/componentMapControl.d.cts +4 -0
  2. package/devHelper/dist/createBoundary.d.cts +10 -0
  3. package/devHelper/dist/index.d.cts +2 -0
  4. package/devHelper/dist/index.d.ts +2 -2
  5. package/devHelper/dist/lithentDevHelper.cjs +2 -0
  6. package/devHelper/dist/lithentDevHelper.cjs.map +1 -0
  7. package/devHelper/package.json +1 -1
  8. package/dist/diff.d.cts +5 -0
  9. package/dist/diff.d.ts +1 -1
  10. package/dist/hook/internal/unmount.d.cts +3 -0
  11. package/dist/hook/internal/unmount.d.ts +1 -1
  12. package/dist/hook/internal/useUpdate.d.cts +5 -0
  13. package/dist/hook/internal/useUpdate.d.ts +1 -1
  14. package/dist/hook/mountCallback.d.cts +13 -0
  15. package/dist/hook/mountCallback.d.ts +1 -1
  16. package/dist/hook/mountReadyCallback.d.cts +10 -0
  17. package/dist/hook/mountReadyCallback.d.ts +1 -1
  18. package/dist/hook/ref.d.cts +4 -0
  19. package/dist/hook/updateCallback.d.cts +4 -0
  20. package/dist/hook/useRenew.d.cts +6 -0
  21. package/dist/hook/useRenew.d.ts +1 -1
  22. package/dist/index.d.cts +19 -0
  23. package/dist/index.d.ts +12 -12
  24. package/dist/lithent-agent-addon.md +1 -1
  25. package/dist/lithent.cjs +2 -0
  26. package/dist/lithent.cjs.map +1 -0
  27. package/dist/lithent.mjs +266 -255
  28. package/dist/lithent.mjs.map +1 -1
  29. package/dist/lithent.umd.js +1 -1
  30. package/dist/lithent.umd.js.map +1 -1
  31. package/dist/render.d.cts +9 -0
  32. package/dist/render.d.ts +3 -3
  33. package/dist/skills/lithent/SKILL.md +2 -2
  34. package/dist/skills/lithent/constraints/mistakes.md +1 -1
  35. package/dist/skills/lithent/constraints/rules.md +1 -1
  36. package/dist/skills/lithent/constraints/troubleshooting.md +1 -1
  37. package/dist/skills/lithent/examples/quick-examples.md +1 -1
  38. package/dist/skills/lithent/reference/children-type.md +1 -1
  39. package/dist/skills/lithent/reference/concurrent.md +1 -1
  40. package/dist/skills/lithent/reference/element.md +1 -1
  41. package/dist/skills/lithent/reference/lstore-inference.md +1 -1
  42. package/dist/skills/lithent/reference/props-types.md +1 -1
  43. package/dist/types/index.d.cts +74 -0
  44. package/dist/types/index.d.ts +1 -1
  45. package/dist/utils/index.d.cts +23 -0
  46. package/dist/utils/index.d.ts +4 -1
  47. package/dist/utils/predicator.d.cts +33 -0
  48. package/dist/utils/predicator.d.ts +1 -1
  49. package/dist/utils/redraw.d.cts +9 -0
  50. package/dist/utils/redraw.d.ts +7 -1
  51. package/dist/utils/universalRef.d.cts +21 -0
  52. package/dist/utils/universalRef.d.ts +1 -1
  53. package/dist/wDom.d.cts +36 -0
  54. package/dist/wDom.d.ts +1 -1
  55. package/element/dist/index.d.cts +56 -0
  56. package/element/dist/lithentElement.cjs +3 -0
  57. package/element/dist/lithentElement.cjs.map +1 -0
  58. package/element/package.json +1 -1
  59. package/examples/dist/assets/index-Ch4u_8Bx.js +2 -0
  60. package/examples/dist/assets/index-Ch4u_8Bx.js.map +1 -0
  61. package/examples/dist/index.html +1 -1
  62. package/ftags/dist/index.d.cts +25 -0
  63. package/ftags/dist/lithentFTags.cjs +2 -0
  64. package/ftags/dist/lithentFTags.cjs.map +1 -0
  65. package/ftags/package.json +1 -1
  66. package/helper/dist/hook/cacheUpdate.d.cts +2 -0
  67. package/helper/dist/hook/computed.d.cts +5 -0
  68. package/helper/dist/hook/context.d.cts +26 -0
  69. package/helper/dist/hook/effect.d.cts +1 -0
  70. package/helper/dist/hook/lcontext.d.cts +18 -0
  71. package/helper/dist/hook/lstate.d.cts +5 -0
  72. package/helper/dist/hook/lstore.d.cts +28 -0
  73. package/helper/dist/hook/nextTickRender.d.cts +2 -0
  74. package/helper/dist/hook/state.d.cts +5 -0
  75. package/helper/dist/hook/store.d.cts +17 -0
  76. package/helper/dist/index.d.cts +16 -0
  77. package/helper/dist/index.d.ts +16 -16
  78. package/helper/dist/lithentHelper.cjs +2 -0
  79. package/helper/dist/lithentHelper.cjs.map +1 -0
  80. package/helper/dist/lithentHelper.mjs +8 -8
  81. package/helper/dist/lithentHelper.mjs.map +1 -1
  82. package/helper/dist/lithentHelper.umd.js +1 -1
  83. package/helper/dist/lithentHelper.umd.js.map +1 -1
  84. package/helper/dist/utils/children.d.cts +6 -0
  85. package/helper/dist/utils/children.d.ts +1 -1
  86. package/helper/dist/utils/types.d.cts +3 -0
  87. package/helper/package.json +1 -1
  88. package/helper/src/hook/cacheUpdate.ts +3 -1
  89. package/helper/src/tests/cacheupdate-contract.tsx +64 -0
  90. package/helper/src/tests/cacheupdate.tsx +10 -12
  91. package/jsx-runtime/dist/index.d.cts +15 -0
  92. package/jsx-runtime/dist/jsxRuntime.cjs +2 -0
  93. package/jsx-runtime/dist/jsxRuntime.cjs.map +1 -0
  94. package/jsx-runtime/package.json +1 -1
  95. package/package.json +74 -29
  96. package/src/diff.ts +16 -11
  97. package/src/hook/internal/unmount.ts +12 -0
  98. package/src/render.ts +41 -52
  99. package/src/tests/core-addedSubtrees.test.tsx +77 -0
  100. package/src/tests/core-cachedIdentity.test.tsx +150 -0
  101. package/src/tests/core-discardedListeners.test.tsx +281 -0
  102. package/src/tests/core-portal-events.test.ts +201 -0
  103. package/src/tests/core-props-enumeration.test.ts +142 -0
  104. package/src/tests/core-updatePaths.test.tsx +242 -0
  105. package/src/utils/index.ts +18 -0
  106. package/src/utils/redraw.ts +24 -7
  107. package/src/wDom.ts +21 -22
  108. package/ssr/dist/helper/index.d.cts +8 -0
  109. package/ssr/dist/hydration.d.cts +5 -0
  110. package/ssr/dist/index.d.cts +7 -0
  111. package/ssr/dist/index.d.ts +2 -2
  112. package/ssr/dist/lithentSsr.cjs +3 -0
  113. package/ssr/dist/lithentSsr.cjs.map +1 -0
  114. package/ssr/dist/lithentSsr.mjs +69 -65
  115. package/ssr/dist/lithentSsr.mjs.map +1 -1
  116. package/ssr/dist/lithentSsr.umd.js +2 -2
  117. package/ssr/dist/lithentSsr.umd.js.map +1 -1
  118. package/ssr/dist/renderToString.d.cts +5 -0
  119. package/ssr/dist/tests/tostring.d.cts +2 -0
  120. package/ssr/package.json +1 -1
  121. package/ssr/src/renderToString.ts +20 -3
  122. package/ssr/src/tests/renderToString.test.tsx +46 -0
  123. package/tag/dist/index.d.cts +11 -0
  124. package/tag/dist/lithentTag.cjs +3 -0
  125. package/tag/dist/lithentTag.cjs.map +1 -0
  126. package/tag/package.json +1 -1
  127. package/examples/dist/assets/index-BZ7HvV5V.js +0 -2
  128. package/examples/dist/assets/index-BZ7HvV5V.js.map +0 -1
@@ -0,0 +1,4 @@
1
+ import type { CompKey } from 'lithent';
2
+ export declare const enableComponentMapManualMode: () => void;
3
+ export declare const disableComponentMapManualMode: () => void;
4
+ export declare const removeComponentEntry: (compKey: CompKey) => void;
@@ -0,0 +1,10 @@
1
+ import type { CompKey, TagFunction } from 'lithent';
2
+ export type BoundaryController = {
3
+ register: (compKey: CompKey) => () => void;
4
+ update: (nextCtor: TagFunction) => boolean;
5
+ dispose: () => void;
6
+ };
7
+ export declare const registerBoundaryInstance: (moduleId: string, compKey: CompKey) => () => void;
8
+ export declare const disposeBoundary: (moduleId: string) => void;
9
+ export declare const applyBoundaryUpdate: (moduleId: string, nextCtor: TagFunction) => boolean;
10
+ export declare const createBoundary: (moduleId: string) => BoundaryController;
@@ -0,0 +1,2 @@
1
+ export { createBoundary } from './createBoundary.cjs';
2
+ export type { BoundaryController } from './createBoundary.cjs';
@@ -1,2 +1,2 @@
1
- export { createBoundary } from './createBoundary';
2
- export type { BoundaryController } from './createBoundary';
1
+ export { createBoundary } from './createBoundary.js';
2
+ export type { BoundaryController } from './createBoundary.js';
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("lithent");let d=0;const m=()=>{d+=1,a.setComponentMapManualMode(!0)},b=()=>{d=Math.max(0,d-1),d===0&&a.setComponentMapManualMode(!1)},B=t=>{a.disposeComponentEntry(t)},w=3,s=new Map,E=t=>{let e=s.get(t);return e||(e={instances:new Set,domMap:new Map,scheduled:!1,pendingCtor:void 0,retryCount:0},s.set(t,e)),e},q=(t,e)=>{const n=E(t);return n.instances.add(e),queueMicrotask(()=>{var o;const r=a.componentMap.get(e),i=((o=r==null?void 0:r.vd)==null?void 0:o.value)??null;i&&n.domMap.set(e,i)}),()=>{const r=s.get(t);r&&(r.instances.delete(e),r.domMap.delete(e),r.instances.size||s.delete(t))}},D=t=>{const e=s.get(t);e&&Array.from(e.instances).forEach(n=>B(n)),s.delete(t),b()},P=(t,e)=>{const n=s.get(t);return n?(n.pendingCtor=e,n.retryCount=0,n.scheduled||(n.scheduled=!0,queueMicrotask(()=>v(t))),!0):!1},v=t=>{const e=s.get(t);if(!e)return;e.scheduled=!1;const n=e.pendingCtor;if(!n)return;e.pendingCtor=void 0;let r=!1,i=!1;e.instances.forEach(c=>{var h,y,C;const l=a.componentMap.get(c),R=e.domMap.get(c),u=((h=l==null?void 0:l.vd)==null?void 0:h.value)||R;if(!u||!u.el){i=!0;return}const{compProps:g,compChild:M}=u;if(!g||!M){i=!0;return}try{a.replaceWDom(n,g,M,u);const p=((C=(y=a.componentMap.get(c))==null?void 0:y.vd)==null?void 0:C.value)||u;e.domMap.set(c,p),r=!0}catch(p){console.warn(`[Lithent HMR] boundary update 실패: ${t}`,p)}});let o=e.pendingCtor;const f=i&&!r;if(!(f||!!o)){e.retryCount=0;return}if(f){if(e.retryCount+=1,e.retryCount>w){console.warn(`[Lithent HMR] boundary update failed after ${e.retryCount} attempts; aborting: ${t}`),e.pendingCtor=void 0,e.scheduled=!1;return}o||(o=n)}e.pendingCtor=o,e.scheduled||(e.scheduled=!0,setTimeout(()=>v(t),0))},S=t=>(m(),{register:e=>q(t,e),update:e=>P(t,e),dispose:()=>D(t)});exports.createBoundary=S;
2
+ //# sourceMappingURL=lithentDevHelper.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lithentDevHelper.cjs","sources":["../src/componentMapControl.ts","../src/createBoundary.ts"],"sourcesContent":["import type { CompKey } from 'lithent';\nimport { setComponentMapManualMode, disposeComponentEntry } from 'lithent';\n\nlet manualModeRefCount = 0;\n\nexport const enableComponentMapManualMode = (): void => {\n manualModeRefCount += 1;\n setComponentMapManualMode(true);\n};\n\nexport const disableComponentMapManualMode = (): void => {\n manualModeRefCount = Math.max(0, manualModeRefCount - 1);\n if (manualModeRefCount === 0) {\n setComponentMapManualMode(false);\n }\n};\n\nexport const removeComponentEntry = (compKey: CompKey): void => {\n disposeComponentEntry(compKey);\n};\n","import type { CompKey, TagFunction, WDom } from 'lithent';\nimport { componentMap, replaceWDom } from 'lithent';\nimport {\n disableComponentMapManualMode,\n enableComponentMapManualMode,\n removeComponentEntry,\n} from './componentMapControl';\n\nconst MAX_RETRY = 3;\n\ntype InstanceRegistry = {\n instances: Set<CompKey>;\n domMap: Map<CompKey, WDom>;\n scheduled: boolean;\n pendingCtor?: TagFunction;\n retryCount: number;\n};\n\nconst boundaryRegistry = new Map<string, InstanceRegistry>();\n\nconst getRegistry = (moduleId: string): InstanceRegistry => {\n let registry = boundaryRegistry.get(moduleId);\n\n if (!registry) {\n registry = {\n instances: new Set(),\n domMap: new Map(),\n scheduled: false,\n pendingCtor: undefined,\n retryCount: 0,\n };\n boundaryRegistry.set(moduleId, registry);\n }\n\n return registry;\n};\n\nexport type BoundaryController = {\n register: (compKey: CompKey) => () => void;\n update: (nextCtor: TagFunction) => boolean;\n dispose: () => void;\n};\n\nexport const registerBoundaryInstance = (\n moduleId: string,\n compKey: CompKey\n) => {\n const registry = getRegistry(moduleId);\n\n registry.instances.add(compKey);\n\n queueMicrotask(() => {\n const entry = componentMap.get(compKey);\n const currentWDom = entry?.vd?.value ?? null;\n\n if (currentWDom) {\n registry.domMap.set(compKey, currentWDom);\n }\n });\n\n return () => {\n const currentRegistry = boundaryRegistry.get(moduleId);\n if (!currentRegistry) return;\n\n currentRegistry.instances.delete(compKey);\n currentRegistry.domMap.delete(compKey);\n\n if (!currentRegistry.instances.size) {\n boundaryRegistry.delete(moduleId);\n }\n };\n};\n\nexport const disposeBoundary = (moduleId: string) => {\n const registry = boundaryRegistry.get(moduleId);\n\n if (registry) {\n Array.from(registry.instances).forEach(compKey =>\n removeComponentEntry(compKey)\n );\n }\n\n boundaryRegistry.delete(moduleId);\n disableComponentMapManualMode();\n};\n\nexport const applyBoundaryUpdate = (\n moduleId: string,\n nextCtor: TagFunction\n) => {\n const registry = boundaryRegistry.get(moduleId);\n\n if (!registry) return false;\n\n registry.pendingCtor = nextCtor;\n registry.retryCount = 0;\n\n if (!registry.scheduled) {\n registry.scheduled = true;\n queueMicrotask(() => flushBoundary(moduleId));\n }\n\n return true;\n};\n\nconst flushBoundary = (moduleId: string) => {\n const registry = boundaryRegistry.get(moduleId);\n if (!registry) return;\n\n registry.scheduled = false;\n\n const ctor = registry.pendingCtor;\n if (!ctor) {\n return;\n }\n\n registry.pendingCtor = undefined;\n\n let updated = false;\n let hasMissing = false;\n\n registry.instances.forEach(compKey => {\n const entry = componentMap.get(compKey);\n const cached = registry.domMap.get(compKey);\n const currentWDom = entry?.vd?.value || cached;\n\n if (!currentWDom || !currentWDom.el) {\n hasMissing = true;\n return;\n }\n\n const { compProps, compChild } = currentWDom;\n\n if (!compProps || !compChild) {\n hasMissing = true;\n return;\n }\n\n try {\n replaceWDom(ctor, compProps, compChild, currentWDom as any);\n const refreshed = componentMap.get(compKey)?.vd?.value || currentWDom;\n registry.domMap.set(compKey, refreshed as WDom);\n updated = true;\n } catch (error) {\n console.warn(`[Lithent HMR] boundary update 실패: ${moduleId}`, error);\n }\n });\n\n let nextPendingCtor: TagFunction | undefined = registry.pendingCtor;\n const shouldRetryMissing = hasMissing && !updated;\n const hasQueuedUpdate = Boolean(nextPendingCtor);\n const shouldRetry = shouldRetryMissing || hasQueuedUpdate;\n\n if (!shouldRetry) {\n registry.retryCount = 0;\n return;\n }\n\n if (shouldRetryMissing) {\n registry.retryCount += 1;\n\n if (registry.retryCount > MAX_RETRY) {\n console.warn(\n `[Lithent HMR] boundary update failed after ${registry.retryCount} attempts; aborting: ${moduleId}`\n );\n\n const hot = (\n import.meta as unknown as {\n hot?: { invalidate?: () => void };\n }\n ).hot;\n hot?.invalidate?.();\n\n registry.pendingCtor = undefined;\n registry.scheduled = false;\n return;\n }\n\n if (!nextPendingCtor) {\n nextPendingCtor = ctor;\n }\n }\n\n registry.pendingCtor = nextPendingCtor;\n\n if (!registry.scheduled) {\n registry.scheduled = true;\n setTimeout(() => flushBoundary(moduleId), 0);\n }\n};\n\nexport const createBoundary = (moduleId: string): BoundaryController => {\n enableComponentMapManualMode();\n\n return {\n register: (compKey: CompKey) => registerBoundaryInstance(moduleId, compKey),\n update: (nextCtor: TagFunction) => applyBoundaryUpdate(moduleId, nextCtor),\n dispose: () => disposeBoundary(moduleId),\n };\n};\n"],"names":["manualModeRefCount","enableComponentMapManualMode","setComponentMapManualMode","disableComponentMapManualMode","removeComponentEntry","compKey","disposeComponentEntry","MAX_RETRY","boundaryRegistry","getRegistry","moduleId","registry","registerBoundaryInstance","entry","componentMap","currentWDom","_a","currentRegistry","disposeBoundary","applyBoundaryUpdate","nextCtor","flushBoundary","ctor","updated","hasMissing","cached","compProps","compChild","replaceWDom","refreshed","error","nextPendingCtor","shouldRetryMissing","createBoundary"],"mappings":"2GAGA,IAAIA,EAAqB,EAElB,MAAMC,EAA+B,IAAY,CAChCD,GAAA,EACtBE,EAAA,0BAA0B,EAAI,CAChC,EAEaC,EAAgC,IAAY,CACvDH,EAAqB,KAAK,IAAI,EAAGA,EAAqB,CAAC,EACnDA,IAAuB,GACzBE,EAAA,0BAA0B,EAAK,CAEnC,EAEaE,EAAwBC,GAA2B,CAC9DC,EAAA,sBAAsBD,CAAO,CAC/B,ECXME,EAAY,EAUZC,MAAuB,IAEvBC,EAAeC,GAAuC,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GAAqBO,EAAyBF,EAAUL,CAAO,EAC1E,OAASe,GAA0BD,EAAoBT,EAAUU,CAAQ,EACzE,QAAS,IAAMF,EAAgBR,CAAQ,CAAA"}
@@ -5,7 +5,7 @@
5
5
  "description": "Lithent development helper utilities",
6
6
  "private": true,
7
7
  "packageManager": "pnpm@7.6.0",
8
- "main": "./dist/lithentDevHelper.umd.js",
8
+ "main": "./dist/lithentDevHelper.cjs",
9
9
  "module": "./dist/lithentDevHelper.mjs",
10
10
  "types": "./dist/index.d.ts",
11
11
  "scripts": {
@@ -0,0 +1,5 @@
1
+ import { WDom, TagFunctionResolver } from './types/index.cjs';
2
+ /**
3
+ * The starting point of the diffing process between the original virtual DOM and the new virtual DOM for re-rendering.
4
+ */
5
+ export declare const makeNewWDomTree: (newWDom: WDom | TagFunctionResolver, originalWDom?: WDom) => WDom;
package/dist/diff.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { WDom, TagFunctionResolver } from './types';
1
+ import { WDom, TagFunctionResolver } from './types/index.js';
2
2
  /**
3
3
  * The starting point of the diffing process between the original virtual DOM and the new virtual DOM for re-rendering.
4
4
  */
@@ -0,0 +1,3 @@
1
+ import { WDom } from '../../types/index.cjs';
2
+ export declare const unmount: (effectAction: () => void) => void;
3
+ export declare const runUnmountQueueFromWDom: (newWDom: WDom) => void;
@@ -1,3 +1,3 @@
1
- import { WDom } from '../../types';
1
+ import { WDom } from '../../types/index.js';
2
2
  export declare const unmount: (effectAction: () => void) => void;
3
3
  export declare const runUnmountQueueFromWDom: (newWDom: WDom) => void;
@@ -0,0 +1,5 @@
1
+ import { WDom } from '../../types/index.cjs';
2
+ type DependencyFactory = () => unknown[];
3
+ export declare const useUpdated: (effectAction: () => (() => void) | void, dependencies?: DependencyFactory) => void;
4
+ export declare const runUpdatedQueueFromWDom: (newWDom: WDom) => void;
5
+ export {};
@@ -1,4 +1,4 @@
1
- import { WDom } from '../../types';
1
+ import { WDom } from '../../types/index.js';
2
2
  type DependencyFactory = () => unknown[];
3
3
  export declare const useUpdated: (effectAction: () => (() => void) | void, dependencies?: DependencyFactory) => void;
4
4
  export declare const runUpdatedQueueFromWDom: (newWDom: WDom) => void;
@@ -0,0 +1,13 @@
1
+ import { WDom } from '../types/index.cjs';
2
+ /**
3
+ * WDom을 mountedQueue에 추가
4
+ */
5
+ export declare const addMountedQueue: (wDom: WDom) => void;
6
+ /**
7
+ * DOM 렌더링 후 mountCallback 실행
8
+ */
9
+ export declare const execMountedQueue: () => void;
10
+ /**
11
+ * mountCallback 등록
12
+ */
13
+ export declare const mountCallback: (effectAction: () => void) => void;
@@ -1,4 +1,4 @@
1
- import { WDom } from '../types';
1
+ import { WDom } from '../types/index.js';
2
2
  /**
3
3
  * WDom을 mountedQueue에 추가
4
4
  */
@@ -0,0 +1,10 @@
1
+ import { WDom } from '../types/index.cjs';
2
+ /**
3
+ * WDom이 생성된 직후(DOM 마운트 전)에 실행될 콜백 등록
4
+ */
5
+ export declare const mountReadyCallback: (effectAction: () => void | (() => void)) => void;
6
+ /**
7
+ * 특정 WDom의 wdomCallback 즉시 실행
8
+ * wDomToDom() 내부에서 각 WDom 생성 시점에 호출됨
9
+ */
10
+ export declare const runWDomCallbacksFromWDom: (newWDom: WDom) => void;
@@ -1,4 +1,4 @@
1
- import { WDom } from '../types';
1
+ import { WDom } from '../types/index.js';
2
2
  /**
3
3
  * WDom이 생성된 직후(DOM 마운트 전)에 실행될 콜백 등록
4
4
  */
@@ -0,0 +1,4 @@
1
+ export declare const ref: <T>(initValue: T) => {
2
+ value: T;
3
+ };
4
+ export declare const nextTick: () => Promise<void>;
@@ -0,0 +1,4 @@
1
+ type DependencyFactory = () => unknown[];
2
+ export declare const updateCallback: (effectAction: () => (() => void) | void, dependencies?: DependencyFactory) => void;
3
+ export declare const runUpdateCallback: () => void;
4
+ export {};
@@ -0,0 +1,6 @@
1
+ import { Renew } from '../types/index.cjs';
2
+ /**
3
+ * Hook to get the renew (component update) function.
4
+ * Useful for lmount components that need to trigger updates.
5
+ */
6
+ export declare const useRenew: () => Renew;
@@ -1,4 +1,4 @@
1
- import { Renew } from '../types';
1
+ import { Renew } from '../types/index.js';
2
2
  /**
3
3
  * Hook to get the renew (component update) function.
4
4
  * Useful for lmount components that need to trigger updates.
@@ -0,0 +1,19 @@
1
+ import type { Props } from './types/index.cjs';
2
+ export { h, Fragment, portal, mount, lmount, replaceWDom } from './wDom.cjs';
3
+ export { isPropType } from './utils/index.cjs';
4
+ export { componentUpdate } from './utils/redraw.cjs';
5
+ export { getComponentKey, componentMap, getComponentSubInfo, setComponentMapManualMode, disposeComponentEntry, lmountComponentSet, } from './utils/universalRef.cjs';
6
+ export { render } from './render.cjs';
7
+ export { mountCallback } from './hook/mountCallback.cjs';
8
+ export { mountReadyCallback } from './hook/mountReadyCallback.cjs';
9
+ export { updateCallback } from './hook/updateCallback.cjs';
10
+ export { ref, nextTick } from './hook/ref.cjs';
11
+ export { useRenew } from './hook/useRenew.cjs';
12
+ export type { WDom, TagFunction, TagFunctionResolver, FragmentFunction, Component, LComponent, ComponentSubKey, ComponentMap, ComponentInfo, CompKey, Props, Renew, MiddleStateWDomChildren, MiddleStateWDom, NodePointer, Param, } from './types/index.cjs';
13
+ declare global {
14
+ namespace JSX {
15
+ interface IntrinsicElements {
16
+ [name: string]: Props;
17
+ }
18
+ }
19
+ }
package/dist/index.d.ts CHANGED
@@ -1,15 +1,15 @@
1
- import type { Props } from './types';
2
- export { h, Fragment, portal, mount, lmount, replaceWDom } from './wDom';
3
- export { isPropType } from './utils';
4
- export { componentUpdate } from './utils/redraw';
5
- export { getComponentKey, componentMap, getComponentSubInfo, setComponentMapManualMode, disposeComponentEntry, lmountComponentSet, } from './utils/universalRef';
6
- export { render } from './render';
7
- export { mountCallback } from './hook/mountCallback';
8
- export { mountReadyCallback } from './hook/mountReadyCallback';
9
- export { updateCallback } from './hook/updateCallback';
10
- export { ref, nextTick } from './hook/ref';
11
- export { useRenew } from './hook/useRenew';
12
- export type { WDom, TagFunction, TagFunctionResolver, FragmentFunction, Component, LComponent, ComponentSubKey, ComponentMap, ComponentInfo, CompKey, Props, Renew, MiddleStateWDomChildren, MiddleStateWDom, NodePointer, Param, } from './types';
1
+ import type { Props } from './types/index.js';
2
+ export { h, Fragment, portal, mount, lmount, replaceWDom } from './wDom.js';
3
+ export { isPropType } from './utils/index.js';
4
+ export { componentUpdate } from './utils/redraw.js';
5
+ export { getComponentKey, componentMap, getComponentSubInfo, setComponentMapManualMode, disposeComponentEntry, lmountComponentSet, } from './utils/universalRef.js';
6
+ export { render } from './render.js';
7
+ export { mountCallback } from './hook/mountCallback.js';
8
+ export { mountReadyCallback } from './hook/mountReadyCallback.js';
9
+ export { updateCallback } from './hook/updateCallback.js';
10
+ export { ref, nextTick } from './hook/ref.js';
11
+ export { useRenew } from './hook/useRenew.js';
12
+ export type { WDom, TagFunction, TagFunctionResolver, FragmentFunction, Component, LComponent, ComponentSubKey, ComponentMap, ComponentInfo, CompKey, Props, Renew, MiddleStateWDomChildren, MiddleStateWDom, NodePointer, Param, } from './types/index.js';
13
13
  declare global {
14
14
  namespace JSX {
15
15
  interface IntrinsicElements {
@@ -1,6 +1,6 @@
1
1
  # Lithent Agent Addon
2
2
 
3
- > Version: 1.23.0
3
+ > Version: 1.24.1
4
4
 
5
5
  You are a coding agent with Lithent virtual DOM guidance enabled.
6
6
 
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=Symbol.for("lithentWDomSymbol"),S={value:""},R={value:null},k={value:!1},a=new WeakMap,J=new WeakSet;let re=!1;const Te=e=>{a.set(e,{vd:{value:null},up:()=>{},upR:[],upS:{value:0},upD:[],upCB:[],mts:[],umts:[],wdCB:[]})},v=()=>R.value,xe=(e,t)=>{const n=a.get(e);return n?n[t]:null},Ee=e=>{R.value=e},Ne=e=>{R.value=e,Te(e)},Fe=e=>{re=e},Le=()=>re,le=e=>{const t=a.get(e);t&&(t.umts.forEach(n=>n()),t.umts=[])},Ue=e=>{le(e),a.delete(e)},y=e=>e.getParent&&e.getParent(),X=e=>()=>e,D=Object.keys,ue=(e,t)=>Object.prototype.propertyIsEnumerable.call(e,t),ie=(e,t)=>{if(ue(e,t))return!0;const n=Object.getPrototypeOf(e);return!Object.prototype.hasOwnProperty.call(e,t)&&!!n&&ie(n,t)},P=e=>typeof e=="object"&&e!==null,Ae=e=>P(e)&&!Array.isArray(e)&&!Object.getOwnPropertySymbols(e).includes(C),M=e=>P(e)&&!("resolve"in e),E=(e,t)=>M(e)&&e.type===t,Oe=(e,t)=>"ctor"in e?e.ctor===(t&&t.ctor):e===(t&&t.ctor),Be=(e,t)=>!!(M(e)&&t&&t.type==="f"&&t.children&&t.children.length===(e.children&&e.children.length)),Ke=(e,t)=>!!(M(e)&&t&&t.type==="e"&&t.tag===e.tag&&t.children&&t.children.length===(e.children&&e.children.length)),ee=(e,t)=>!!(M(e)&&t&&t.type===e.type),Qe=(e,t)=>!!(M(e)&&t&&t.type===e.type&&(N((e.children||[])[0])&&N((t.children||[])[0])||t.children&&e.children&&t.children.length===e.children.length)),j=e=>(e&&e.compProps&&e.compProps.key)??(e&&e.props&&e.props.key),g=e=>e==="f"||e==="l",U=e=>typeof e=="function"&&!ae(e)||P(e)&&"resolve"in e,ae=e=>typeof e=="function"&&e===K,Ie=e=>M(e)&&!e.type,N=e=>fe(j(e)),fe=e=>e!=null,te=(e,t)=>e==="style"&&P(t),je=(e,t)=>e==="ref"&&P(t),ne=new WeakMap,ce=(e,t)=>{const n=e.constructor.prototype;let c=ne.get(n);c||ne.set(n,c=new Map);let o=c.get(t);if(o===void 0){const s=Object.getOwnPropertyDescriptor(n,t);o=!!(s&&s.get&&s.set),c.set(t,o)}return o},se=e=>e.localName.includes("-")&&e.constructor===HTMLElement,Ve=e=>U(e)?"c":E(e,"f")?"f":E(e,"e")?"e":E(e,"l")?"l":E(e,"t")?"t":"et",He={c:Oe,l:Qe,t:ee,e:Ke,f:Be,et:ee},pe=e=>{const t=v();if(t){const n=a.get(t);n&&n.umts.push(e)}},A=e=>{const{compKey:t}=e;t&&(e.il=!0,_e(t)),de(e)},de=e=>{if(e.tag==="portal"&&e.el)for(const t in e.props)t[0]==="o"&&t[1]==="n"&&e.el.removeEventListener(t.slice(2).toLowerCase(),e.props[t]);(e.children||[]).forEach(t=>{t.compKey?A(t):de(t)})},_e=e=>{le(e),Le()||a.delete(e)};let V=[];const ze=e=>{e.compKey&&V.push(e)},b=()=>{V.forEach(e=>qe(e)),V=[]},Ge=e=>{const t=v();if(t){const n=a.get(t);n&&n.mts.push(e)}},qe=e=>{const{compKey:t}=e;if(t){const n=a.get(t);if(!n)return;const{mts:c,upS:o}=n;R.value=t,o&&(o.value=0),c&&(n.mts=[],c.forEach(s=>{const r=s();r&&pe(r)}))}},Je=e=>{const t=v();if(t){const n=a.get(t);n&&n.wdCB.push(e)}},Xe=e=>{const{compKey:t}=e;if(t){const n=a.get(t),c=n&&n.wdCB;R.value=t,c&&c.length>0&&(n.wdCB=[],c.forEach(o=>{const s=o();s&&typeof s=="function"&&pe(s)}))}},oe=(e,t=()=>[])=>{const n=v();if(!n)return;const c=a.get(n);if(!c)return;const{upD:o,upS:s}=c,r=o[s.value],l=t();if(r&&Ze(r,l)){const u=e();u&&c.upCB.push(u)}o[s.value]=l,s.value+=1},Ye=e=>{const{compKey:t}=e;if(t){const n=a.get(t);if(!n)return;const{upCB:c,upS:o}=n;R.value=t,o&&(o.value=0),e.ctor&&c&&(n.upCB=[],c.forEach(s=>s()))}},Ze=(e,t)=>e.length?e.some((n,c)=>n!==t[c]):!0,H=()=>new DocumentFragment,$e=e=>document.createElement(e),me=(e,t,n,c)=>{e.isRoot=!0,t=t||document.body,e.we=t;const o=T(e,c);return n?(e.ae=n,t.insertBefore(o,n)):c||(t.tagName==="HTML"?t.replaceWith(o):t.appendChild(o)),b(),()=>{const s=a.get(e.compProps||{}),r=s&&s.vd.value||e;A(r),we(r)}},we=e=>he(e,e.we),O=e=>{const t=y(e),n=e.isRoot?e.we:t?x(t):void 0;n&&he(e,n)},he=(e,t)=>{if(t&&e.el){const n=e.el.nodeType;n===11||(e==null?void 0:e.tag)==="portal"?ye(e,t):(n===1||n===3)&&t.removeChild(e.el),e.el=void 0}},ye=(e,t)=>{const n=e&&e.oc||e&&e.children||[];if(n.length>1&&n.every(c=>{const o=c.el&&c.el.nodeType;return(o===1||o===3)&&c.el.tagName!=="HTML"&&c.tag!=="portal"})){let c=0;for(let o=t.firstChild;o&&c<=n.length;o=o.nextSibling)c++;if(c===n.length){t.textContent="",n.forEach(o=>o.el=void 0);return}}n.forEach(c=>{const o=c.el&&c.el.nodeType;if(o)if(o===1||o===3){const s=c.el;s.tagName==="HTML"?s.innerHTML="":s.remove()}else o===11&&ye(c,t)})},We=e=>{e.forEach(t=>{A(t),O(t)})},_=e=>{O(e),Y(e)},De=e=>{$(e),(y(e)||e.isRoot)&&Y(e,Z(e))},Y=(e,t)=>{t||(t=T(e));const n=y(e);if(!n||!n.type){e.isRoot&&e.we&&t&&e.tag!=="portal"&&(e.ae?e.we.insertBefore(t,e.ae):e.we.tagName==="HTML"?e.we.replaceWith(t):e.we.appendChild(t),b());return}const c=x(n),o=n.type==="l"&&n.nr?F(n,y(n)):F(e,n);t&&c&&(e.tag!=="portal"&&c.insertBefore(t,o||null),b())},Z=e=>g(e.type)?(e&&e.children||[]).reduce((t,n)=>{const c=Z(n);return c&&t.appendChild(c),t},H()):e.el,F=(e,t)=>{const n=t.children||[],o=n.indexOf(e)+1,s=n.slice(o),r=L(s),l=t.type||"";if(r)return r;if(!t.isRoot&&g(l))return F(t,y(t));if(t.isRoot&&g(l)&&t.ae)return t.ae},L=e=>e.reduce((t,n)=>{if(t)return t;const{type:c,el:o}=n;if(c&&g(c)){const s=L(n.children||[]);if(s)return s}return o&&o.nodeType!==11?o:t},void 0),et=e=>{const t=y(e),n=e.el;if(e.isRoot&&!t&&n){_(e);return}if(t&&t.type&&n)if(n.nodeType===11)_(e);else{const c=x(t),o=T(e);c&&e.tag!=="portal"&&c.replaceChild(o,n),b()}},$=e=>{if(e.type==="t"){st(e);return}if(e.el){const{op:t,props:n}=e;Ce(n,e.el,t),e.tag==="input"&&(e.el.value=String(n&&n.value||""))}tt(e),Ye(e)},tt=e=>{const t=e.children||[];let n=!1;if(e.type==="l"){for(const i of t)if("ATS".includes(i.nr)||i.oi!==void 0){n=!0;break}}if(!n){t.forEach(i=>z(i));return}const c=[],o=[],s=[];let r=0;t.forEach((i,p)=>{const h=i.nr;h==="A"||h==="S"?(h==="S"&&O(i),c[p]=T(i),r++):h==="T"?$(i):z(i),i.oi!==void 0&&c[p]===void 0&&(o.push(p),s.push(i.oi))});const l=new Set(nt(s).map(i=>o[i])),u=x(e),f=e.isRoot?e.ae:F(e,y(e));let d=t.length;for(;d>0&&c[d-1]!==void 0;)d--;for(let i=d;i<t.length;i++){const p=c[i];p&&u&&t[i].tag!=="portal"&&u.insertBefore(p,f||null)}if(l.size!==o.length||r>t.length-d){let i=L(t.slice(d))||f;for(let p=d-1;p>=0;p--){const h=t[p],Q=c[p]!==void 0,be=h.oi!==void 0&&!Q&&!l.has(p);if((Q||be)&&u&&h.tag!=="portal"){const W=Q?c[p]:Z(h);W&&u.insertBefore(W,i||null)}const w=L([h]);w&&(i=w)}}t.forEach(ve),b()},ve=e=>{e.oi=e.nr=e.oc=e.op=void 0},nt=e=>{const t=[];if(!e.length)return t;const n=new Array(e.length);t.push(0);for(let s=1;s<e.length;s++){const r=e[s];if(e[t[t.length-1]]<r){n[s]=t[t.length-1],t.push(s);continue}let l=0,u=t.length-1;for(;l<u;){const f=l+u>>1;e[t[f]]<r?l=f+1:u=f}r<e[t[l]]&&(l>0&&(n[s]=t[l-1]),t[l]=s)}let c=t.length,o=t[c-1];for(;c-- >0;)t[c]=o,o=n[o];return t},z=e=>{const{nr:t}=e;t!==void 0&&t!=="N"&&(ct[t](e),ve(e))},ct={A:Y,D:O,R:et,U:$,S:_,T:De},st=e=>{e.el&&(e.el.nodeValue=String(e.text))},Ce=(e,t,n,c)=>{const o=n||{};for(const s in e){const r=e[s];if(r===o[s])continue;const l=s[0]==="o"&&s[1]==="n";c&&l?I(t,s,r,o[s]):s==="key"||s==="portal"&&P(r)||(s==="innerHTML"&&typeof r=="string"?t.innerHTML=r:te(s,r)?lt(r,te(s,o.style)?o.style:{},t):je(s,r)?r.value=t:l?I(t,s,r,o[s]):s&&(s!=="type"&&ce(t,s)?t[s]=r:(ot(s==="className"?"class":s,t,r),se(t)&&!(s in HTMLElement.prototype)&&(t[s]=r))))}for(const s in o)if(!(e&&ie(e,s))){if(s[0]==="o"&&s[1]==="n"){I(t,s,void 0,o[s]);continue}t.removeAttribute(s),se(t)?delete t[s]:t.localName.includes("-")&&ce(t,s)&&(t[s]=void 0)}},ot=(e,t,n)=>S.value&&e!=="xmlns"?t.setAttributeNS(null,e,n):t.setAttribute(e,n),T=(e,t)=>{let n;const{type:c,tag:o,text:s,props:r,children:l=[]}=e,u=g(c);if(Xe(e),o==="svg"&&(S.value=String(r&&r.xmlns)),t)n=e.el;else{if(!c)n=H();else if(u)n=H();else if(c==="e"&&o)o==="portal"&&r&&r.portal?n=r.portal:n=S.value?document.createElementNS(S.value,o):$e(o);else if(c==="t"&&fe(s))n=document.createTextNode(String(s));else throw Error("Invalid wDom");e.el=n}return rt(l,n,t),Ce(r,n,null,t),ze(e),o==="svg"&&(S.value=""),n},rt=(e,t,n)=>{e.forEach(c=>{if(c.type){const o=T(c,n);c.tag!=="portal"&&!n&&t&&t.appendChild(o)}})},I=(e,t,n,c)=>{const o=t.slice(2).toLowerCase();c!==n&&(c&&e.removeEventListener(o,c),n&&e.addEventListener(o,n))},lt=(e,t,n)=>{const c={...t},o=n instanceof HTMLElement?n:null,s=o==null?void 0:o.style;if(!s)return;const r=s;for(const l in e)r[l]=e[l],delete c[l];for(const l in c)r[l]=""},x=e=>{const t=g(e.type);return e.isRoot&&t?e.we:t?x(y(e)):e.el},B=(e,t)=>ut(e,!!t&&He[Ve(e)](e,t),t),ut=(e,t,n)=>{const c=ht(e,t,n),o=at(c,t,n),s=o==="N";return s||(c.children=yt(c,t,n)),c.nr=o,it(c,n,o),!s&&n&&(n.il=!0,n.children=void 0),(n==null?void 0:n.tag)==="portal"&&(c.tag="portal"),c},it=(e,t,n)=>{n!=="A"&&t&&(e.el=t.el),(n==="D"||n==="R"||n==="S")&&(t&&A(t),e.oc=t&&t.children),e.op=t&&t.props},at=(e,t,n)=>{if(Ie(e))return"D";if(e.type==="t"&&t&&e.text===(n&&n.text)||e===n)return"N";if(!(n&&n.type))return"A";const s=y(n),r=!e.isRoot&&s&&s.type==="l"&&N(e);return t?r?"T":"U":r?"S":"R"},ft=(e,t)=>{e&&t!==e&&(t=t||{},D(e).forEach(n=>ue(t,n)||delete e[n]),D(t).forEach(n=>e[n]=t[n]))},pt=(e,t)=>{e&&(e.splice(0,e.length),t&&t.forEach(n=>e.push(n)))},dt=(e,t)=>{const{compProps:n,compChild:c}=e,{props:o,children:s}=t;return n&&ft(n,o),c&&s&&c!==s&&pt(c,s),e.reRender&&e.reRender()},ht=(e,t,n)=>U(e)?t&&n?dt(n,e):e.resolve():e,yt=(e,t,n)=>t&&n?Ct(e,n):vt(e),vt=e=>{const t=X(e);return(e.children||[]).map(n=>{const c=B(n);return c.getParent=t,c})},Ct=(e,t)=>{if(e.type==="l"&&N((e.children||[])[0]))return kt(e,t);const n=t.children||[],c=X(e);return(e.children||[]).map((o,s)=>{const r=B(o,n[s]);return r.getParent=c,r})},kt=(e,t)=>{const[n,c]=gt(e,t);return We(c),n},gt=(e,t)=>{const n=t.children||[],c=new Map;n.forEach((r,l)=>{const u=j(r);c.has(u)||c.set(u,l)});const o=X(e);return[(e.children||[]).map(r=>{const l=j(r),u=c.get(l),f=u!==void 0;f&&c.delete(l);const d=B(r,f?n[u]:void 0);return f&&(d.oi=u),d.getParent=o,d}),[...c.values()].map(r=>n[r])]},G=new Map;let q=!1;const Rt=(e,t)=>{G.set(e,t),q||(q=!0,queueMicrotask(Mt))},Pt=(e,t)=>{const n=a.get(e);n&&(n.up=()=>{const c=n.vd.value;Rt(e,()=>t(c))})},m=e=>()=>{const t=a.get(e),n=t&&t.up;return n?(n(),!0):!1},Mt=()=>{G.forEach(e=>{e()}),G.clear(),q=!1},St=(e,t=()=>[])=>{const n=v();if(!n)return;const c=a.get(n);c&&(c.upR.push(()=>oe(e,t)),oe(e,t))},bt=()=>{const e=v();if(!e)return;const t=a.get(e),n=t&&t.upR;n&&n.length&&n.forEach(c=>c())},K=(e,...t)=>({type:"f",[C]:!0,children:t}),ke=(e,t,...n)=>{const c={value:void 0},o=Re(c,n),s=Ft(e,t||{},o);return U(s)||(c.value=s),s},Tt=(e,t)=>ke("portal",{portal:t},e),xt=e=>(t,n)=>e,Et=e=>(t,n)=>(J.add(e),e),Nt=(e,t,n)=>{const c=(o,s)=>{if(!(!o||s.has(o))){if(s.add(o),o.compChild){const r=o.compChild.indexOf(t);r!==-1&&o.compChild.splice(r,1,n)}c(o.getParent?o.getParent():void 0,s)}};c(e,new Set)},ge=(e,t,n,c)=>{if(c.il)return;k.value=!0;const o=Me(e,t,n),s=B(o,c),{isRoot:r,getParent:l,we:u,ae:f}=c;if(s.getParent=l,!r&&l){const d=l(),i=d&&d.children||[],p=i.indexOf(c);p!==-1&&i.splice(p,1,s),Nt(d,c,s)}else s.isRoot=!0,s.we=u,s.ae=f;k.value=!1,z(s)},Ft=(e,t,n)=>{if(ae(e))return K(t,...n);if(U(e)){const c=Me(e,t,n);return k.value?c:c.resolve()}return{type:"e",[C]:!0,tag:e,props:t,children:n}},Re=(e,t)=>{const n=()=>e.value;return t.map(c=>{const o=Pe(c);return o.getParent=n,o})},Pe=e=>{if(e==null||e===!1)return{type:null,[C]:!0};if(Array.isArray(e)){const t={value:void 0},n=Re(t,e),c={type:"l",[C]:!0,children:n};return t.value=c,c}else if(typeof e=="string"||typeof e=="number")return{type:"t",[C]:!0,text:e};return e},Lt=(e,t,n)=>(c=t)=>{const o=k.value;k.value=!1,Ne(c);const s=e(t,n);let r;if(typeof s=="function"){const u=s;r=J.has(u)?u(t,n):u(m(c),t,n)}else r=u=>e(u,n);const l=Ut(r,c,e,t,n);return k.value=o,l},Me=(e,t,n)=>{const c=e,o=n,s=Lt(e,t,o);return{ctor:c,props:t,children:o,resolve:s}},Ut=(e,t,n,c,o)=>{const s=f=>Pe(e(f)),{wrappedComponentMaker:r,customNode:l}=Bt(s,c),u=At(r,t,n,c,o);return Se(l,t,n,c,o,u),Pt(t,f=>ge(n,f.compProps||c,f.compChild||o,f)),l},At=(e,t,n,c,o)=>{const s=()=>Ot(e,t,n,c,o,s);return s},Ot=(e,t,n,c,o,s)=>{Ee(t),bt();const r=e(c);return Se(r,t,n,c,o,s),r},Bt=(e,t)=>{const n=o=>{const s=e(o),r=K({},s);return s.getParent=()=>r,r},c=n(t);return{wrappedComponentMaker:n,customNode:c}},Se=(e,t,n,c,o,s)=>{e.compProps=c,e.compChild=o,e.ctor=n,e.compKey=t,e.reRender=s;const r=a.get(t);r&&(r.vd.value=e)},Kt=e=>({value:e}),Qt=()=>Promise.resolve(),It=()=>{const e=v();return e?m(e):()=>!1};exports.Fragment=K;exports.componentMap=a;exports.componentUpdate=m;exports.disposeComponentEntry=Ue;exports.getComponentKey=v;exports.getComponentSubInfo=xe;exports.h=ke;exports.isPropType=Ae;exports.lmount=Et;exports.lmountComponentSet=J;exports.mount=xt;exports.mountCallback=Ge;exports.mountReadyCallback=Je;exports.nextTick=Qt;exports.portal=Tt;exports.ref=Kt;exports.render=me;exports.replaceWDom=ge;exports.setComponentMapManualMode=Fe;exports.updateCallback=St;exports.useRenew=It;
2
+ //# sourceMappingURL=lithent.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lithent.cjs","sources":["../src/utils/universalRef.ts","../src/utils/index.ts","../src/utils/predicator.ts","../src/hook/internal/unmount.ts","../src/hook/mountCallback.ts","../src/hook/mountReadyCallback.ts","../src/hook/internal/useUpdate.ts","../src/render.ts","../src/diff.ts","../src/utils/redraw.ts","../src/hook/updateCallback.ts","../src/wDom.ts","../src/hook/ref.ts","../src/hook/useRenew.ts"],"sourcesContent":["import { ComponentMap, ComponentSubKey, CompKey, ComponentInfo } from '@/types';\n\nexport const wdomSymbol = Symbol.for('lithentWDomSymbol');\nexport const xmlnsRef: { value: string } = { value: '' };\nexport const compKeyRef: { value: CompKey | null } = { value: null };\nexport const needDiffRef: { value: boolean } = { value: false };\nexport const componentMap: ComponentMap = new WeakMap();\nexport const lmountComponentSet: WeakSet<Function> = new WeakSet();\nlet componentMapManualMode = false;\n\nconst setComponetRef = (compKey: CompKey): void => {\n componentMap.set(compKey, {\n vd: { value: null },\n up: () => {},\n upR: [],\n upS: { value: 0 },\n upD: [],\n upCB: [],\n mts: [],\n umts: [],\n wdCB: [], // WDom creation callback queue\n });\n};\n\nexport const getComponentKey = (): CompKey | null => compKeyRef.value;\n\nexport const getComponentSubInfo = <K extends ComponentSubKey>(\n compKey: CompKey,\n subKey: K\n): ComponentInfo[K] | null => {\n const component = componentMap.get(compKey);\n if (component) {\n return component[subKey];\n }\n return null;\n};\n\nexport const initUpdateHookState = (compKey: CompKey): void => {\n compKeyRef.value = compKey;\n};\n\nexport const initMountHookState = (compKey: CompKey): void => {\n compKeyRef.value = compKey;\n setComponetRef(compKey);\n};\n\nexport const setComponentMapManualMode = (enabled: boolean): void => {\n componentMapManualMode = enabled;\n};\n\nexport const isComponentMapManualMode = (): boolean => componentMapManualMode;\n\nexport const runUnmountEffects = (compKey: CompKey): void => {\n const subInfo = componentMap.get(compKey);\n if (subInfo) {\n subInfo.umts.forEach(effect => effect());\n subInfo.umts = [];\n }\n};\n\nexport const disposeComponentEntry = (compKey: CompKey): void => {\n runUnmountEffects(compKey);\n componentMap.delete(compKey);\n};\n","import { WDom, Props } from '@/types';\n\nimport { wdomSymbol } from '@/utils/universalRef';\n\nexport const getParent = (vDom: WDom) =>\n (vDom.getParent && vDom.getParent()) as WDom;\n\n// A separate scope keeps parent links from retaining a diff's old children.\nexport const makeParentGetter = (parent: WDom) => () => parent;\n\nexport const entries = Object.entries;\nexport const keys = Object.keys;\n\nexport const isEnumerableProp = (props: Props, key: string) =>\n Object.prototype.propertyIsEnumerable.call(props, key);\n\n// DOM props use for...in, including inherited enumerable keys. A hidden own\n// key shadows the same name on the prototype and must not keep an old prop.\nexport const hasEnumerableProp = (props: Props, key: string): boolean => {\n if (isEnumerableProp(props, key)) return true;\n const prototype = Object.getPrototypeOf(props);\n return (\n !Object.prototype.hasOwnProperty.call(props, key) &&\n !!prototype &&\n hasEnumerableProp(prototype, key)\n );\n};\n\nexport const isObject = (target: unknown): target is Record<string, unknown> =>\n typeof target === 'object' && target !== null;\n\nexport const assign = Object.assign;\nexport const isPropType = (obj: unknown): obj is Props => {\n return (\n isObject(obj) &&\n !Array.isArray(obj) &&\n !Object.getOwnPropertySymbols(obj).includes(wdomSymbol)\n );\n};\n","import { Fragment } from '@/wDom';\nimport {\n WDom,\n TagFunction,\n TagFunctionResolver,\n FragmentFunction,\n WDomType,\n} from '@/types';\nimport { isObject } from '@/utils';\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 isObject(wDom) && !('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): boolean =>\n 'ctor' in newWDom\n ? newWDom.ctor === (originalWDom && originalWDom.ctor)\n : newWDom === (originalWDom && originalWDom.ctor);\n\nconst checkSameFragment = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n): boolean =>\n !!(\n checkPlainWDomType(newWDom) &&\n originalWDom &&\n originalWDom.type === 'f' &&\n originalWDom.children &&\n originalWDom.children.length ===\n (newWDom.children && newWDom.children.length)\n );\n\nconst checkSameTagElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n): boolean =>\n !!(\n checkPlainWDomType(newWDom) &&\n originalWDom &&\n originalWDom.type === 'e' &&\n originalWDom.tag === newWDom.tag &&\n originalWDom.children &&\n originalWDom.children.length ===\n (newWDom.children && newWDom.children.length)\n );\n\nconst checkNormalTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n): boolean =>\n !!(\n checkPlainWDomType(newWDom) &&\n originalWDom &&\n originalWDom.type === newWDom.type\n );\n\nconst checkLoopTypeElement = (\n newWDom: WDom | TagFunction | TagFunctionResolver,\n originalWDom?: WDom\n): boolean =>\n !!(\n checkPlainWDomType(newWDom) &&\n originalWDom &&\n originalWDom.type === newWDom.type &&\n ((checkExistyKey((newWDom.children || [])[0]) &&\n checkExistyKey((originalWDom.children || [])[0])) ||\n (originalWDom.children &&\n newWDom.children &&\n originalWDom.children.length === newWDom.children.length))\n );\n\nexport const getKey = (target: WDom) =>\n (target && target.compProps && target.compProps.key) ??\n (target && target.props && target.props.key);\n\n/**\n * Check if the type is virtual (fragment or loop)\n * Virtual types don't create real DOM elements themselves\n */\nexport const checkVirtualType = (\n type?: string | null // 'f': fragment, 'l': loop\n) => type === 'f' || type === 'l';\n\nexport const checkCustemComponentFunction = (\n target: WDomParam\n): target is TagFunction | TagFunctionResolver =>\n (typeof target === 'function' && !checkFragmentFunction(target)) ||\n (isObject(target) && '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 checkExistyKey = (target: WDom) => checkExisty(getKey(target));\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' && isObject(dataValue);\n\nexport const checkRefData = (\n dataKey: string,\n dataValue: unknown\n): dataValue is {\n value: HTMLElement | Element | DocumentFragment | Text | undefined;\n} => dataKey === 'ref' && isObject(dataValue);\n\n// Descriptor lookups are cached per prototype+key. Keying by prototype\n// rather than nodeName matters for custom elements: one rendered before its\n// definition is upgraded later and gets a new prototype, which must be looked\n// up again instead of reusing the \"no accessor\" answer for its tag name.\nconst accessorCache = new WeakMap<object, Map<string, boolean>>();\n\nexport const hasAccessorMethods = (target: unknown, dataKey: string) => {\n const proto = target!.constructor.prototype;\n let byKey = accessorCache.get(proto);\n if (!byKey) accessorCache.set(proto, (byKey = new Map()));\n let result = byKey.get(dataKey);\n\n if (result === undefined) {\n const descriptor = Object.getOwnPropertyDescriptor(proto, dataKey);\n result = !!(descriptor && descriptor.get && descriptor.set);\n byKey.set(dataKey, result);\n }\n\n return result;\n};\n\n// A custom element tag whose definition has not arrived, or whose instance\n// has not been upgraded yet: still a plain HTMLElement, with no accessors.\nexport const isPendingCustomElement = (target: unknown) =>\n (target as Element).localName.includes('-') &&\n (target as Element).constructor === HTMLElement;\n\n/**\n * Get WDom type as a single character code\n * 'c': component, 'f': fragment, 'e': element, 'l': loop, 't': text, 'et': empty/null\n */\nexport const getWDomType = (\n wDom: WDom | TagFunction | TagFunctionResolver\n): WDomType =>\n checkCustemComponentFunction(wDom)\n ? 'c'\n : checkPlainType(wDom, 'f')\n ? 'f'\n : checkPlainType(wDom, 'e')\n ? 'e'\n : checkPlainType(wDom, 'l')\n ? 'l'\n : checkPlainType(wDom, 't')\n ? 't'\n : 'et';\n\nexport const checkSameWDomWithOriginal = {\n c: checkSameCustomComponent,\n l: checkLoopTypeElement,\n t: checkNormalTypeElement,\n e: checkSameTagElement,\n f: checkSameFragment,\n et: checkNormalTypeElement,\n};\n","import { WDom, CompKey } from '@/types';\nimport {\n componentMap,\n getComponentKey,\n isComponentMapManualMode,\n runUnmountEffects,\n} from '@/utils/universalRef';\n\nexport const unmount = (effectAction: () => void) => {\n const compKey = getComponentKey();\n if (compKey) {\n const comp = componentMap.get(compKey);\n comp && comp.umts.push(effectAction);\n }\n};\n\nexport const runUnmountQueueFromWDom = (newWDom: WDom) => {\n const { compKey } = newWDom;\n\n if (compKey) {\n // A redraw queued before this removal still holds the node. Marking it\n // retired makes that stale redraw a no-op instead of drawing it back in.\n newWDom.il = true;\n removeItem(compKey);\n }\n recursiveRunUnmount(newWDom);\n};\n\nconst recursiveRunUnmount = (wDom: WDom) => {\n // A portal host belongs to the caller and survives removal. Release its\n // handlers while leaving listeners on discarded ordinary DOM untouched.\n if (wDom.tag === 'portal' && wDom.el) {\n for (const key in wDom.props) {\n if (key[0] === 'o' && key[1] === 'n') {\n wDom.el.removeEventListener(\n key.slice(2).toLowerCase(),\n wDom.props[key] as EventListener\n );\n }\n }\n }\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: CompKey) => {\n runUnmountEffects(compKey);\n\n if (!isComponentMapManualMode()) {\n componentMap.delete(compKey);\n }\n};\n","import { WDom } from '@/types';\nimport {\n compKeyRef,\n componentMap,\n getComponentKey,\n} from '@/utils/universalRef';\nimport { unmount } from '@/hook/internal/unmount';\n\nlet mountedQueue: WDom[] = [];\n\n/**\n * WDom을 mountedQueue에 추가\n */\nexport const addMountedQueue = (wDom: WDom) => {\n if (wDom.compKey) {\n mountedQueue.push(wDom);\n }\n};\n\n/**\n * DOM 렌더링 후 mountCallback 실행\n */\nexport const execMountedQueue = () => {\n mountedQueue.forEach(item => runMountedQueueFromWDom(item));\n mountedQueue = [];\n};\n\n/**\n * mountCallback 등록\n */\nexport const mountCallback = (effectAction: () => void) => {\n const compKey = getComponentKey();\n if (compKey) {\n const comp = componentMap.get(compKey);\n if (comp) {\n comp.mts.push(effectAction);\n }\n }\n};\n\n/**\n * mountCallback만 실행\n */\nconst runMountedQueueFromWDom = (newWDom: WDom) => {\n const { compKey } = newWDom;\n\n if (compKey) {\n const component = componentMap.get(compKey);\n if (!component) return;\n const { mts: mountQueue, upS: sequence } = component;\n\n compKeyRef.value = compKey;\n\n if (sequence) {\n sequence.value = 0;\n }\n\n if (mountQueue) {\n component.mts = [];\n\n mountQueue.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 componentMap,\n getComponentKey,\n} from '@/utils/universalRef';\nimport { unmount } from '@/hook/internal/unmount';\n\n/**\n * WDom이 생성된 직후(DOM 마운트 전)에 실행될 콜백 등록\n */\nexport const mountReadyCallback = (effectAction: () => void | (() => void)) => {\n const compKey = getComponentKey();\n if (compKey) {\n const comp = componentMap.get(compKey);\n comp && comp.wdCB.push(effectAction);\n }\n};\n\n/**\n * 특정 WDom의 wdomCallback 즉시 실행\n * wDomToDom() 내부에서 각 WDom 생성 시점에 호출됨\n */\nexport const runWDomCallbacksFromWDom = (newWDom: WDom) => {\n const { compKey } = newWDom;\n\n if (compKey) {\n const component = componentMap.get(compKey);\n const wdCBQueue = component && component.wdCB;\n\n compKeyRef.value = compKey;\n\n if (wdCBQueue && wdCBQueue.length > 0) {\n component.wdCB = [];\n\n wdCBQueue.forEach((effect: Function) => {\n const cleanup = effect();\n if (cleanup && typeof cleanup === 'function') {\n unmount(cleanup);\n }\n });\n }\n }\n};\n","import { WDom } from '@/types';\nimport {\n compKeyRef,\n componentMap,\n getComponentKey,\n} from '@/utils/universalRef';\n\ntype DependencyFactory = () => unknown[];\n\nexport const useUpdated = (\n effectAction: () => (() => void) | void,\n dependencies: DependencyFactory = () => []\n) => {\n const compKey = getComponentKey();\n if (!compKey) return;\n\n const component = componentMap.get(compKey);\n if (!component) return;\n\n const { upD, upS } = component;\n const def = upD[upS.value];\n\n const nextDependencies = dependencies();\n\n if (def && checkNeedPushQueue(def, nextDependencies)) {\n const callback = effectAction();\n if (callback) {\n component.upCB.push(callback);\n }\n }\n\n upD[upS.value] = nextDependencies;\n upS.value += 1;\n};\n\nexport const runUpdatedQueueFromWDom = (newWDom: WDom) => {\n const { compKey } = newWDom;\n\n if (compKey) {\n const component = componentMap.get(compKey);\n if (!component) return;\n const { upCB: queue, upS: sequence } = component;\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 checkVirtualType,\n hasAccessorMethods,\n isPendingCustomElement,\n} from '@/utils/predicator';\n\nimport { componentMap, xmlnsRef } from '@/utils/universalRef';\nimport { runUnmountQueueFromWDom } from '@/hook/internal/unmount';\nimport { execMountedQueue, addMountedQueue } from '@/hook/mountCallback';\nimport { runWDomCallbacksFromWDom } from '@/hook/mountReadyCallback';\nimport { runUpdatedQueueFromWDom } from '@/hook/internal/useUpdate';\nimport { getParent, isObject, hasEnumerableProp } from '@/utils';\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 isHydration?: boolean\n) => {\n wDom.isRoot = true;\n wrapElement = wrapElement || document.body;\n wDom.we = wrapElement;\n\n const Dom = wDomToDom(wDom, isHydration);\n\n if (afterElement) {\n wDom.ae = afterElement;\n wrapElement.insertBefore(Dom, afterElement);\n } else if (!isHydration) {\n if (wrapElement.tagName === 'HTML') {\n wrapElement.replaceWith(Dom);\n } else {\n wrapElement.appendChild(Dom);\n }\n }\n\n execMountedQueue();\n\n return () => {\n const compData = componentMap.get(wDom.compProps || {});\n const comp = (compData && compData.vd.value) || wDom;\n runUnmountQueueFromWDom(comp);\n rootDelete(comp);\n };\n};\n\nconst rootDelete = (newWDom: WDom) =>\n deleteRealDom(newWDom, newWDom.we as HTMLElement);\n\nexport const typeDelete = (newWDom: WDom) => {\n const parentWDom = getParent(newWDom);\n const parentElement = newWDom.isRoot\n ? newWDom.we\n : parentWDom\n ? findRealParentElement(parentWDom)\n : undefined;\n\n if (parentElement) {\n deleteRealDom(newWDom, parentElement as HTMLElement);\n }\n};\n\nconst deleteRealDom = (newWDom: WDom, parent: HTMLElement) => {\n if (parent && newWDom.el) {\n const nt = newWDom.el.nodeType;\n if (nt === 11 || newWDom?.tag === 'portal') {\n findChildWithRemoveElement(newWDom, parent);\n } else if (nt === 1 || nt === 3) {\n parent.removeChild(newWDom.el);\n }\n\n newWDom.el = undefined;\n }\n};\n\nconst findChildWithRemoveElement = (newWDom: WDom, parent: HTMLElement) => {\n const items = (newWDom && newWDom.oc) || (newWDom && newWDom.children) || [];\n\n // Bulk fast path: the parent element contains exactly these children,\n // so they can all be dropped in a single operation.\n if (\n items.length > 1 &&\n items.every(item => {\n const nt = item.el && item.el.nodeType;\n return (\n (nt === 1 || nt === 3) &&\n (item.el as HTMLElement).tagName !== 'HTML' &&\n item.tag !== 'portal'\n );\n })\n ) {\n // Stop one past the candidates: a component in a long list calls this\n // once per component, so counting every sibling there is quadratic.\n // (counted via sibling pointers -- childNodes would materialize a live list)\n let count = 0;\n for (\n let node = parent.firstChild;\n node && count <= items.length;\n node = node.nextSibling\n ) {\n count++;\n }\n\n if (count === items.length) {\n parent.textContent = '';\n items.forEach(item => (item.el = undefined));\n return;\n }\n }\n\n items.forEach(item => {\n const nt = item.el && item.el.nodeType;\n if (nt) {\n if (nt === 1 || nt === 3) {\n const el = item.el as HTMLElement;\n el.tagName === 'HTML' ? (el.innerHTML = '') : el.remove();\n } else if (nt === 11) {\n findChildWithRemoveElement(item, parent);\n }\n }\n });\n};\n\n/**\n * Unmount and remove unused keyed children. Listeners are left on the\n * discarded DOM and go away with it.\n */\nexport const typeDeleteUnused = (items: WDom[]) => {\n items.forEach(item => {\n runUnmountQueueFromWDom(item);\n typeDelete(item);\n });\n};\n\nconst typeSortedReplace = (newWDom: WDom) => {\n typeDelete(newWDom);\n typeAdd(newWDom);\n};\n\nconst typeSortedUpdate = (newWDom: WDom) => {\n typeUpdate(newWDom);\n\n if (getParent(newWDom) || newWDom.isRoot) {\n typeAdd(newWDom, getElementFromFragment(newWDom));\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 || !parentWDom.type) {\n if (\n newWDom.isRoot &&\n newWDom.we &&\n newElement &&\n newWDom.tag !== 'portal'\n ) {\n if (newWDom.ae) {\n newWDom.we.insertBefore(newElement, newWDom.ae);\n } else if (newWDom.we.tagName === 'HTML') {\n newWDom.we.replaceWith(newElement);\n } else {\n newWDom.we.appendChild(newElement);\n }\n execMountedQueue();\n }\n return;\n }\n\n const parentEl = findRealParentElement(parentWDom);\n const nextEl =\n parentWDom.type === 'l' && parentWDom.nr\n ? startFindNextBrotherElement(parentWDom, getParent(parentWDom))\n : startFindNextBrotherElement(newWDom, parentWDom);\n\n if (newElement && parentEl) {\n if (newWDom.tag !== 'portal') {\n parentEl.insertBefore(newElement, nextEl || null);\n }\n execMountedQueue();\n }\n};\n\nconst getElementFromFragment = (newWDom: WDom) => {\n if (checkVirtualType(newWDom.type)) {\n return ((newWDom && 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.ae\n ) {\n return parentWDom.ae;\n }\n\n return undefined;\n};\n\nconst findChildFragmentNextElement = (\n candidiateBrothers: WDom[]\n): HTMLElement | DocumentFragment | Text | undefined =>\n candidiateBrothers.reduce<HTMLElement | DocumentFragment | Text | undefined>(\n (targetEl, bItem) => {\n if (targetEl) return targetEl;\n const { type, el } = bItem;\n if (type && checkVirtualType(type)) {\n const found = findChildFragmentNextElement(bItem.children || []);\n if (found) return found;\n }\n if (el && el.nodeType !== 11) return el;\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 (newWDom.isRoot && !parentWDom && orignalElement) {\n typeSortedReplace(newWDom);\n return;\n }\n\n if (parentWDom && 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 && newWDom.tag !== 'portal') {\n parentElement.replaceChild(newElement, orignalElement);\n }\n execMountedQueue();\n }\n }\n};\n\nconst typeUpdate = (newWDom: WDom) => {\n if (newWDom.type === 't') {\n updateText(newWDom);\n return;\n }\n\n if (newWDom.el) {\n const { op: oldProps, props } = newWDom;\n updateProps(props, newWDom.el, oldProps);\n\n if (newWDom.tag === 'input') {\n (newWDom.el as HTMLInputElement).value = String(\n (props && props.value) || ''\n );\n }\n }\n\n updateChildren(newWDom);\n runUpdatedQueueFromWDom(newWDom);\n};\n\n/**\n * Process child updates. Loop parents with added/moved children are handled\n * in O(n): a left-to-right content pass (keeps lifecycle order), an LIS over\n * the matched original indices (oi, recorded by the diff phase) to pick the\n * children that can stay in place, and a right-to-left placement pass that\n * inserts only added children and non-LIS moves before a running anchor.\n */\nconst updateChildren = (newWDom: WDom) => {\n const children = newWDom.children || [];\n let needPlace = false;\n\n if (newWDom.type === 'l') {\n for (const item of children) {\n if ('ATS'.includes(item.nr as string) || item.oi !== undefined) {\n needPlace = true;\n break;\n }\n }\n }\n\n if (!needPlace) {\n children.forEach(childItem => wDomUpdate(childItem));\n return;\n }\n\n // Content pass (left-to-right, keeps lifecycle order).\n // Added children are created here but inserted in the placement pass.\n const created: (HTMLElement | DocumentFragment | Text | undefined)[] = [];\n const matchedIndexes: number[] = [];\n const oiSeq: number[] = [];\n let createdCount = 0;\n\n children.forEach((item, index) => {\n const nr = item.nr;\n\n if (nr === 'A' || nr === 'S') {\n if (nr === 'S') {\n typeDelete(item);\n }\n created[index] = wDomToDom(item);\n createdCount++;\n } else if (nr === 'T') {\n typeUpdate(item);\n } else {\n wDomUpdate(item);\n }\n\n if (item.oi !== undefined && created[index] === undefined) {\n matchedIndexes.push(index);\n oiSeq.push(item.oi);\n }\n });\n\n const stay = new Set(getLisPositions(oiSeq).map(pos => matchedIndexes[pos]));\n const parentEl = findRealParentElement(newWDom);\n const baseAnchor = newWDom.isRoot\n ? newWDom.ae\n : startFindNextBrotherElement(newWDom, getParent(newWDom));\n\n // Fast-append the trailing run of added children in order\n // (a null anchor makes insertBefore behave as appendChild).\n let tail = children.length;\n while (tail > 0 && created[tail - 1] !== undefined) {\n tail--;\n }\n\n for (let i = tail; i < children.length; i++) {\n const el = created[i];\n\n if (el && parentEl && children[i].tag !== 'portal') {\n parentEl.insertBefore(el, baseAnchor || null);\n }\n }\n\n if (\n stay.size !== matchedIndexes.length ||\n createdCount > children.length - tail\n ) {\n // Placement pass (right-to-left): insert added children and non-LIS\n // moves before a running anchor.\n let anchor =\n findChildFragmentNextElement(children.slice(tail)) || baseAnchor;\n\n for (let i = tail - 1; i >= 0; i--) {\n const item = children[i];\n const isNew = created[i] !== undefined;\n const needMove = item.oi !== undefined && !isNew && !stay.has(i);\n\n if ((isNew || needMove) && parentEl && item.tag !== 'portal') {\n const el = isNew ? created[i] : getElementFromFragment(item);\n\n if (el) {\n parentEl.insertBefore(el, anchor || null);\n }\n }\n\n const first = findChildFragmentNextElement([item]);\n if (first) {\n anchor = first;\n }\n }\n }\n\n children.forEach(clearDiffMeta);\n execMountedQueue();\n};\n\n// Assigned, not deleted: `delete` changes the object's shape, which makes\n// every later access to the node slower.\nconst clearDiffMeta = (item: WDom) => {\n item.oi = item.nr = item.oc = item.op = undefined;\n};\n\n/**\n * Longest increasing subsequence positions (binary search, O(n log n)).\n * Returns the positions in seq that form the LIS.\n */\nconst getLisPositions = (seq: number[]) => {\n const result: number[] = [];\n\n if (!seq.length) {\n return result;\n }\n\n const prev = new Array(seq.length);\n result.push(0);\n\n for (let i = 1; i < seq.length; i++) {\n const value = seq[i];\n\n if (seq[result[result.length - 1]] < value) {\n prev[i] = result[result.length - 1];\n result.push(i);\n continue;\n }\n\n let lo = 0;\n let hi = result.length - 1;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (seq[result[mid]] < value) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n\n if (value < seq[result[lo]]) {\n if (lo > 0) {\n prev[i] = result[lo - 1];\n }\n result[lo] = i;\n }\n }\n\n let i = result.length;\n let last = result[i - 1];\n while (i-- > 0) {\n result[i] = last;\n last = prev[last];\n }\n\n return result;\n};\n\nexport const wDomUpdate = (newWDomTree: WDom) => {\n const { nr: needRerender } = newWDomTree;\n\n if (needRerender !== undefined && needRerender !== 'N') {\n renderHandlers[needRerender](newWDomTree);\n clearDiffMeta(newWDomTree);\n }\n};\n\nconst renderHandlers = {\n A: typeAdd,\n D: typeDelete,\n R: typeReplace,\n U: typeUpdate,\n S: typeSortedReplace,\n T: typeSortedUpdate,\n} as const;\n\nconst updateText = (newWDom: WDom) => {\n if (newWDom.el) {\n newWDom.el.nodeValue = String(newWDom.text);\n }\n};\n\nconst updateProps = (\n props?: Props,\n element?: HTMLElement | Element | DocumentFragment | Text,\n oldProps?: Props | null,\n isHydration?: boolean\n) => {\n const originalProps = oldProps || {};\n\n for (const dataKey in props) {\n const dataValue: unknown = props[dataKey];\n\n if (dataValue === originalProps[dataKey]) {\n continue;\n }\n\n const isEvent = dataKey[0] === 'o' && dataKey[1] === 'n';\n\n if (isHydration && isEvent) {\n updateEvent(\n element as HTMLElement,\n dataKey,\n dataValue as (e: Event) => void,\n originalProps[dataKey] as (e: Event) => void\n );\n } else {\n if (dataKey === 'key') {\n // Do nothing\n } else if (dataKey === 'portal' && isObject(dataValue)) {\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)\n ? originalProps.style\n : {},\n element\n );\n } else if (checkRefData(dataKey, dataValue)) {\n dataValue.value = element;\n } else if (isEvent) {\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 (dataKey) {\n if (dataKey !== 'type' && hasAccessorMethods(element, dataKey)) {\n (element as HTMLElement & Record<string, unknown>)[dataKey] =\n dataValue;\n } else {\n setAttr(\n dataKey === 'className' ? 'class' : dataKey,\n element as HTMLElement,\n dataValue as string\n );\n // Keep the real value too: once defined, the element absorbs own\n // properties through its accessors, so an object or `false` is not\n // left as the attribute string (B-3).\n // Only keys HTMLElement lacks: `textContent` or `offsetWidth` would\n // run a DOM setter or throw.\n if (\n isPendingCustomElement(element) &&\n !(dataKey in HTMLElement.prototype)\n ) {\n (element as HTMLElement & Record<string, unknown>)[dataKey] =\n dataValue;\n }\n }\n }\n }\n }\n\n // Props that are gone. The previous props object is left as it was: it may\n // be the caller's own object.\n for (const dataKey in originalProps) {\n if (props && hasEnumerableProp(props, dataKey)) {\n continue;\n }\n\n if (dataKey[0] === 'o' && dataKey[1] === 'n') {\n updateEvent(\n element as HTMLElement,\n dataKey,\n undefined,\n originalProps[dataKey] as (e: Event) => void\n );\n continue;\n }\n\n (element as HTMLElement).removeAttribute(dataKey);\n // A prop that went in as a custom element property is unset there too\n // (B-4). Not upgraded yet: drop the value kept for it (B-3); `delete`\n // never touches an inherited DOM property such as `title`. Upgraded:\n // only through the element's own accessors, never built-in ones such as\n // input.value, where `undefined` would read as \"undefined\".\n if (isPendingCustomElement(element)) {\n delete (element as HTMLElement & Record<string, unknown>)[dataKey];\n } else if (\n (element as Element).localName.includes('-') &&\n hasAccessorMethods(element, dataKey)\n ) {\n (element as HTMLElement & Record<string, unknown>)[dataKey] = undefined;\n }\n }\n};\n\nconst setAttr = (k: string, el: HTMLElement, v: string) =>\n xmlnsRef.value && k !== 'xmlns'\n ? el.setAttributeNS(null, k, v)\n : el.setAttribute(k, v);\n\nconst wDomToDom = (wDom: WDom, isHydration?: boolean): HTMLElement => {\n let element;\n const { type, tag, text, props, children = [] } = wDom;\n const isVirtualType = checkVirtualType(type);\n\n runWDomCallbacksFromWDom(wDom);\n\n if (tag === 'svg') {\n xmlnsRef.value = String(props && props.xmlns);\n }\n\n if (!isHydration) {\n if (!type) {\n element = DF();\n } else if (isVirtualType) {\n element = DF();\n } else if (type === 'e' && tag) {\n // element\n if (tag === 'portal' && props && props.portal) {\n element = props.portal as HTMLElement;\n } else {\n element = xmlnsRef.value\n ? document.createElementNS(xmlnsRef.value, tag)\n : CE(tag);\n }\n } else if (type === 't' && checkExisty(text)) {\n // text node\n element = document.createTextNode(String(text));\n } else {\n throw Error('Invalid wDom');\n }\n\n wDom.el = element as HTMLElement;\n } else {\n element = wDom.el;\n }\n\n wDomChildrenToDom(children, element, isHydration);\n\n updateProps(props, element, null, isHydration);\n\n addMountedQueue(wDom);\n\n if (tag === 'svg') {\n xmlnsRef.value = '';\n }\n\n return element as HTMLElement;\n};\n\nconst wDomChildrenToDom = (\n children: WDom[],\n parentElement?: HTMLElement | Element | DocumentFragment | Text,\n isHydration?: boolean\n) => {\n // The parent is not attached to the document yet, so children can be\n // appended directly (no intermediate fragment allocation).\n children.forEach((childItem: WDom) => {\n if (childItem.type) {\n const childElement = wDomToDom(childItem, isHydration);\n if (childItem.tag !== 'portal' && !isHydration && parentElement) {\n parentElement.appendChild(childElement);\n }\n }\n });\n};\n\nconst updateEvent = (\n element: HTMLElement,\n eventKey: string,\n newEventHandler: ((e: Event) => void) | undefined,\n oldEventHandler: (e: Event) => void\n) => {\n const eventName = eventKey.slice(2).toLowerCase();\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 orig = { ...oldStyle };\n const htmlElement = element instanceof HTMLElement ? element : null;\n const cssStyle = htmlElement?.style;\n\n if (!cssStyle) return;\n\n const styleProxy = cssStyle as unknown as Record<string, string>;\n\n for (const k in style) {\n styleProxy[k] = style[k];\n delete orig[k];\n }\n\n for (const k in orig) {\n styleProxy[k] = '';\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.we;\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, makeParentGetter } from '@/utils';\nimport { typeDeleteUnused } from '@/render';\nimport {\n checkEmptyElement,\n checkSameWDomWithOriginal,\n getWDomType,\n checkExistyKey,\n} from '@/utils/predicator';\n\nimport { runUnmountQueueFromWDom } from '@/hook/internal/unmount';\nimport { keys, isEnumerableProp } from '@/utils';\n\n/**\n * The starting point of the diffing process between the original virtual DOM and the new virtual DOM for re-rendering.\n */\nexport const makeNewWDomTree = (\n newWDom: WDom | TagFunctionResolver,\n originalWDom?: WDom\n) =>\n remakeNewWDom(\n newWDom,\n !!originalWDom &&\n checkSameWDomWithOriginal[getWDomType(newWDom)](newWDom, originalWDom),\n originalWDom\n );\n\n/**\n * Create a new virtual DOM after comparing with the previous virtual DOM\n */\nconst remakeNewWDom = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n) => {\n const remakeWDom = generalize(newWDom, isSameType, originalWDom);\n const needRerender = addReRenderTypeProperty(\n remakeWDom,\n isSameType,\n originalWDom\n );\n const isNoting = needRerender === 'N';\n\n if (!isNoting) {\n remakeWDom.children = remakeChildrenForDiff(\n remakeWDom,\n isSameType,\n originalWDom\n );\n }\n\n // NOTE: short-key metadata (nr = needRerender) keeps bundle size down\n remakeWDom.nr = needRerender;\n inheritPropForRender(remakeWDom, originalWDom, needRerender);\n\n if (!isNoting && originalWDom) {\n originalWDom.il = true;\n originalWDom.children = undefined;\n }\n if (originalWDom?.tag === 'portal') {\n remakeWDom.tag = 'portal';\n }\n\n return remakeWDom;\n};\n\n/**\n * Handle what the new virtual DOM should inherit or reconcile from the original virtual DOM.\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' || needRerender === 'R' || needRerender === 'S') {\n if (originalWDom) {\n runUnmountQueueFromWDom(originalWDom);\n }\n remakeWDom.oc = originalWDom && originalWDom.children;\n }\n\n remakeWDom.op = originalWDom && originalWDom.props;\n};\n\n/**\n * Determine the render operation type (Add/Delete/Replace/Update/etc)\n * based on comparison between new and original WDom\n */\nconst addReRenderTypeProperty = (\n newWDom: WDom,\n isSameType: boolean,\n originalWDom?: WDom\n): RenderType | undefined => {\n if (checkEmptyElement(newWDom)) return 'D';\n\n const isSameText =\n newWDom.type === 't' &&\n isSameType &&\n newWDom.text === (originalWDom && originalWDom.text);\n if (isSameText || newWDom === originalWDom) return 'N';\n\n const existOriginalWDom = originalWDom && originalWDom.type;\n if (!existOriginalWDom) return 'A';\n\n const parent = getParent(originalWDom);\n const isKeyChecked =\n !newWDom.isRoot && parent && parent.type === 'l' && checkExistyKey(newWDom);\n\n return isSameType ? (isKeyChecked ? 'T' : 'U') : isKeyChecked ? 'S' : 'R';\n};\n\n/**\n * Handling virtual DOM attribute updates.\n */\nconst syncResolverProps = (props: Props, infoProps: Props) => {\n if (props && infoProps !== props) {\n // Only the keys that are gone: deleting and re-adding every key on every\n // render changes the object's shape each time.\n infoProps = infoProps || {};\n keys(props).forEach(\n key => isEnumerableProp(infoProps, key) || delete props[key]\n );\n keys(infoProps).forEach(key => (props[key] = infoProps[key]));\n }\n};\n\nconst syncResolverChildren = (children: WDom[], infoChidren: WDom[]) => {\n if (children) {\n children.splice(0, children.length);\n\n if (infoChidren) {\n infoChidren.forEach(childrenItem => children.push(childrenItem));\n }\n }\n};\n\n/**\n * Keep the existing component node while injecting the props/children from the freshly computed TagFunctionResolver.\n * originalWDom is the fully evaluated node from the previous render, whereas infoVdom is the intermediate resolver,\n * so updating compProps/compChild in place lets reRender() evaluate with the latest slots and props.\n * It is crucial that props and children references remain stable as nodes update—many ancestors/closures share these arrays,\n * so mutate the existing arrays instead of replacing their references.\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 syncResolverProps(props, infoProps);\n }\n\n /**\n * In runUpdate, the original DOM (vDom) is already fully evaluated and completed, whereas infoVdom represents an intermediate state. Therefore, vdom.compChild and infoVdom.children are indeed the correct counterparts to compare.\n\n * Keep shared child array references intact (<= same slot array instance)\n * When the reference changes, sync the stored compChild contents so reRender sees fresh nodes\n * Only update children if they're different references\n * If it's the same Fragment reference, the diff process will handle updating its children\n */\n if (children && infoChidren && children !== infoChidren) {\n syncResolverChildren(children, infoChidren);\n }\n\n const newVDom = vDom.reRender && vDom.reRender();\n\n return newVDom as WDom;\n};\n\n/**\n * Replace the compared virtual DOM with the new virtual DOM or simply update it.\n */\nconst generalize = (\n newWDom: WDom | TagFunctionResolver,\n isSameType: boolean,\n originalWDom?: WDom\n): WDom => {\n return checkCustemComponentFunction(newWDom)\n ? isSameType && originalWDom\n ? runUpdate(originalWDom, newWDom)\n : newWDom.resolve()\n : newWDom;\n};\n\n/**\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\n/**\n * Recursive handling for the creation of a new virtual DOM.\n */\nconst remakeChildrenForAdd = (newWDom: WDom) => {\n const getParent = makeParentGetter(newWDom);\n\n return (newWDom.children || []).map((item: WDom) => {\n const child = makeNewWDomTree(item);\n child.getParent = getParent;\n return child;\n });\n};\n\n/**\n * Recursive handling for updates, not additions.\n * Uses key-based diffing for loops, index-based for others\n */\nconst remakeChildrenForUpdate = (newWDom: WDom, originalWDom: WDom) => {\n if (newWDom.type === 'l' && checkExistyKey((newWDom.children || [])[0])) {\n return remakeChildrenForLoopUpdate(newWDom, originalWDom);\n }\n\n const origChildren = originalWDom.children || [];\n const getParent = makeParentGetter(newWDom);\n\n return (newWDom.children || []).map((item: WDom, index: number) => {\n const child = makeNewWDomTree(item, origChildren[index]);\n child.getParent = getParent;\n return child;\n });\n};\n\n/**\n * Handling virtual DOM of loop-type elements.\n */\nconst remakeChildrenForLoopUpdate = (newWDom: WDom, originalWDom: WDom) => {\n const [remakedChildren, unUsedChildren] = diffLoopChildren(\n newWDom,\n originalWDom\n );\n\n typeDeleteUnused(unUsedChildren);\n\n return remakedChildren;\n};\n\n/**\n * Recursive handling of loop-type virtual DOM elements.\n * Matches children against the originals by key via a Map in O(n) and\n * records each match's original index (oi) for the render phase to\n * minimize moves via LIS.\n */\nconst diffLoopChildren = (newWDom: WDom, originalWDom: WDom) => {\n const origChildren = originalWDom.children || [];\n const keyMap = new Map<unknown, number>();\n origChildren.forEach((item, index) => {\n const key = getKey(item);\n if (!keyMap.has(key)) {\n keyMap.set(key, index);\n }\n });\n\n const getParent = makeParentGetter(newWDom);\n const remaked = (newWDom.children || []).map(item => {\n const key = getKey(item);\n const origIndex = keyMap.get(key);\n const matched = origIndex !== undefined;\n\n if (matched) {\n keyMap.delete(key);\n }\n\n const child = makeNewWDomTree(\n item,\n matched ? origChildren[origIndex] : undefined\n );\n if (matched) {\n child.oi = origIndex;\n }\n child.getParent = getParent;\n\n return child;\n });\n\n return [remaked, [...keyMap.values()].map(index => origChildren[index])];\n};\n","import { Props, WDom } from '@/types';\nimport { componentMap } from '@/utils/universalRef';\n\nconst redrawQueue = new Map<Props, () => void>();\nlet redrawQueueTimeout: boolean = false;\n\nconst schedule = (compKey: Props, exec: () => void) => {\n redrawQueue.set(compKey, exec);\n\n if (!redrawQueueTimeout) {\n redrawQueueTimeout = true;\n queueMicrotask(execRedrawQueue);\n }\n};\n\nexport const setRedrawAction = (compKey: Props, exec: () => void) => {\n const comp = componentMap.get(compKey);\n if (comp) {\n comp.up = () => schedule(compKey, exec);\n }\n};\n\n/**\n * Like setRedrawAction, but bound once per component instead of on every\n * render: the node to redraw is the component's current one when renew() is\n * called.\n */\nexport const bindRedraw = (compKey: Props, exec: (wDom: WDom) => void) => {\n const comp = componentMap.get(compKey);\n if (comp) {\n comp.up = () => {\n const wDom = comp.vd.value as WDom;\n schedule(compKey, () => exec(wDom));\n };\n }\n};\n\nexport const componentUpdate = (compKey: Props) => () => {\n const comp = componentMap.get(compKey);\n const up = comp && comp.up;\n if (up) {\n up();\n return true;\n }\n return false;\n};\n\nconst execRedrawQueue = () => {\n redrawQueue.forEach((item: () => void) => {\n item();\n });\n\n redrawQueue.clear();\n redrawQueueTimeout = false;\n};\n","import { componentMap, getComponentKey } from '@/utils/universalRef';\n\nimport { useUpdated } from '@/hook/internal/useUpdate';\n\ntype DependencyFactory = () => unknown[];\n\nexport const updateCallback = (\n effectAction: () => (() => void) | void,\n dependencies: DependencyFactory = () => []\n) => {\n const compKey = getComponentKey();\n if (!compKey) return;\n\n const component = componentMap.get(compKey);\n if (!component) return;\n\n component.upR.push(() => useUpdated(effectAction, dependencies));\n useUpdated(effectAction, dependencies);\n};\n\nexport const runUpdateCallback = () => {\n const compKey = getComponentKey();\n if (!compKey) return;\n\n const comp = componentMap.get(compKey);\n const updateReqs = comp && comp.upR;\n\n if (updateReqs && updateReqs.length) {\n updateReqs.forEach(callback => callback());\n }\n};\n","import {\n WDom,\n TagFunction,\n FragmentFunction,\n Props,\n MiddleStateWDomChildren,\n MiddleStateWDom,\n NodePointer,\n Component,\n LComponent,\n} from '@/types';\n\nimport { makeNewWDomTree } from '@/diff';\nimport { wDomUpdate } from '@/render';\nimport {\n initUpdateHookState,\n initMountHookState,\n needDiffRef,\n componentMap,\n wdomSymbol,\n lmountComponentSet,\n} from '@/utils/universalRef';\nimport { bindRedraw, componentUpdate } from '@/utils/redraw';\nimport { runUpdateCallback } from '@/hook/updateCallback';\nimport {\n checkFragmentFunction,\n checkCustemComponentFunction,\n} from '@/utils/predicator';\n\n// ============================================================================\n// Public API - Highest Level (User-facing API)\n// ============================================================================\n\n/**\n * It allows grouping multiple elements together.\n */\nexport const Fragment = (_props: Props, ...children: WDom[]) =>\n ({\n type: 'f', // fragment\n [wdomSymbol]: true,\n children,\n }) as WDom;\n\n/**\n * Element creation\n */\nexport const h = (\n tag: TagFunction | FragmentFunction | string,\n props: Props,\n ...children: MiddleStateWDomChildren\n) => {\n const nodeParentPointer: NodePointer = { value: undefined };\n const newChildren = remakeChildren(nodeParentPointer, children);\n const node = makeNode(tag, props || {}, newChildren);\n\n if (!checkCustemComponentFunction(node)) {\n nodeParentPointer.value = node;\n }\n\n return node;\n};\n\n/**\n * Enables portals\n */\nexport const portal = (wDom: WDom, portal: HTMLElement) =>\n h('portal', { portal }, wDom);\n\n/**\n * It helps with component creation.\n */\nexport const mount =\n <T>(component: Component<T>) =>\n (_props: T, _children?: MiddleStateWDomChildren) =>\n component;\n\n/**\n * It helps with component creation without renew parameter.\n * Use useRenew() hook to get renew function if needed.\n */\nexport const lmount =\n <T>(component: LComponent<T>) =>\n (_props: T, _children?: MiddleStateWDomChildren) => {\n lmountComponentSet.add(component);\n return component;\n };\n\n/**\n * Maintain compChild references for upward updates (render props, slots, etc.).\n * JSX always returns a fresh children array, so when a subtree re-renders\n * bottom-up we must manually swap the old child instance out of each ancestor's\n * compChild.\n *\n * Fragment-wrapping solved this by keeping a stable wrapper node,\n * but that hides the actual child tree. We prefer this explicit sync for DX.\n *\n * In practice slot consumers rarely thread children more than a layer or two—\n * usually shallow composed pieces like dropdowns or drag-and-drop shells—so the\n * directed walk keeps DX high without introducing observable overhead.\n */\nconst syncAncestorComponentChildren = (\n parent: WDom | undefined,\n prevChild: WDom,\n nextChild: WDom\n) => {\n const walk = (node: WDom | undefined, visited: Set<WDom>): void => {\n if (!node || visited.has(node)) {\n return;\n }\n\n visited.add(node);\n\n if (node.compChild) {\n const childIndex = node.compChild.indexOf(prevChild);\n\n if (childIndex !== -1) {\n node.compChild.splice(childIndex, 1, nextChild);\n }\n }\n\n walk(node.getParent ? node.getParent() : undefined, visited);\n };\n\n walk(parent, new Set<WDom>());\n};\n\n/**\n * It re-renders starting from a specific component.\n */\nexport const replaceWDom = (\n tag: TagFunction,\n props: Props,\n children: WDom[],\n originalWDom: WDom\n) => {\n if (originalWDom.il) {\n return;\n }\n needDiffRef.value = true;\n\n const newWDom = makeWDomResolver(tag, props, children);\n const newWDomTree = makeNewWDomTree(newWDom, originalWDom);\n // NOTE: we/ae are short for wrapElement/afterElement\n const { isRoot, getParent, we, ae } = originalWDom;\n\n newWDomTree.getParent = getParent;\n\n if (!isRoot && getParent) {\n const parent = getParent();\n const brothers = (parent && parent.children) || [];\n const index = brothers.indexOf(originalWDom);\n\n if (index !== -1) {\n brothers.splice(index, 1, newWDomTree);\n }\n\n syncAncestorComponentChildren(parent, originalWDom, newWDomTree);\n } else {\n newWDomTree.isRoot = true;\n newWDomTree.we = we;\n newWDomTree.ae = ae;\n }\n\n needDiffRef.value = false;\n\n wDomUpdate(newWDomTree);\n};\n\n// ============================================================================\n// Mid-Level - Virtual DOM Node Creation (Intermediate abstraction level)\n// ============================================================================\n\n/**\n * The starting point where the virtual DOM is created from the h function.\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: 'e', // element\n [wdomSymbol]: true,\n tag,\n props,\n children,\n } as WDom;\n};\n\n/**\n * The starting point for recursively processing the child virtual DOM elements.\n */\nconst remakeChildren = (\n nodeParentPointer: NodePointer,\n children: MiddleStateWDomChildren\n): WDom[] => {\n // Siblings share a single getParent closure (one allocation per parent)\n const getParent = () => nodeParentPointer.value;\n\n return children.map((item: MiddleStateWDom) => {\n const childItem = makeChildrenItem(item);\n childItem.getParent = getParent;\n return childItem;\n });\n};\n\n/**\n * Recursively process the child virtual DOM elements.\n */\nconst makeChildrenItem = (item: MiddleStateWDom): WDom => {\n if (item === null || item === undefined || item === false) {\n return { type: null, [wdomSymbol]: true } as WDom;\n } else if (Array.isArray(item)) {\n const nodeParentPointer: NodePointer = { value: undefined };\n const children = remakeChildren(nodeParentPointer, item);\n const node = {\n type: 'l', // loop (array mapping)\n [wdomSymbol]: true,\n children,\n } as WDom;\n nodeParentPointer.value = node;\n\n return node;\n } else if (typeof item === 'string' || typeof item === 'number') {\n return { type: 't', [wdomSymbol]: true, text: item } as WDom; // text node\n }\n\n return item;\n};\n\n// ============================================================================\n// Component Lifecycle - Component Creation & Re-rendering\n// ============================================================================\n\n/**\n * Create component resolver function\n */\nconst createComponentResolver = (\n tag: TagFunction,\n props: Props,\n wrappedChildren: WDom[]\n) => {\n return (compKey = props) => {\n // Diff mode sets needDiffRef to true so h()/makeNode return a resolver\n // placeholder. During actual resolution we must force a real WDom tree,\n // otherwise nested components leave only resolvers (no getParent/children)\n // and CSR renders a blank area. Temporarily drop needDiffRef, then restore.\n // Regression tests: src/tests/core-composedRenew.test.tsx,\n // src/tests/core-component-remount.test.tsx\n const prevNeedDiff = needDiffRef.value;\n needDiffRef.value = false;\n\n initMountHookState(compKey);\n\n const initialComponent = tag(props, wrappedChildren);\n\n let componentMaker: (nextProps: Props) => MiddleStateWDom;\n\n if (typeof initialComponent === 'function') {\n const component = initialComponent;\n // Check if component is created with lmount (no renew parameter)\n // TypeScript cannot infer that component is LComponent when has() returns true,\n // because WeakSet.has() is a runtime check that doesn't narrow types.\n // We use 'as any' since the runtime check guarantees type safety.\n componentMaker = lmountComponentSet.has(component)\n ? (component as any)(props, wrappedChildren)\n : component(componentUpdate(compKey), props, wrappedChildren);\n } else {\n // For components that directly return a VDom, recreate it each render.\n componentMaker = (nextProps: Props) =>\n tag(nextProps, wrappedChildren) as MiddleStateWDom;\n }\n\n const node = makeCustomNode(\n componentMaker,\n compKey,\n tag,\n props,\n wrappedChildren\n );\n needDiffRef.value = prevNeedDiff;\n return node;\n };\n};\n\n/**\n * Create an intermediate step for diffing between the existing virtual DOM and the new one during re-rendering\n */\nconst makeWDomResolver = (tag: TagFunction, props: Props, children: WDom[]) => {\n const ctor = tag;\n\n const wrappedChildren = children;\n\n const resolve = createComponentResolver(tag, props, wrappedChildren);\n\n return { ctor, props, children: wrappedChildren, resolve };\n};\n\n/**\n * Create the actual virtual DOM node from the component.\n */\nconst makeCustomNode = (\n componentMaker: (props: Props) => MiddleStateWDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[]\n) => {\n const normalizedComponentMaker = (nextProps: Props): WDom =>\n makeChildrenItem(componentMaker(nextProps));\n const { wrappedComponentMaker, customNode } = wrapComponentMakerIfNeeded(\n normalizedComponentMaker,\n props\n );\n const reRender = makeReRender(\n wrappedComponentMaker,\n compKey,\n tag,\n props,\n children\n );\n\n addComponentProps(customNode, compKey, tag, props, children, reRender);\n bindRedraw(compKey, wDom =>\n replaceWDom(\n tag,\n (wDom.compProps as Props) || props,\n (wDom.compChild as WDom[]) || children,\n wDom\n )\n );\n return customNode;\n};\n\n/**\n * When the virtual DOM is actually created from the component, generate a re-render method for future redraws.\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\n/**\n * The starting point for redrawing from the re-render method\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 customNode = componentMaker(props);\n addComponentProps(customNode, compKey, tag, props, children, reRender);\n\n return customNode;\n};\n\n// ============================================================================\n// Low-Level Utilities - Component Node Manipulation\n// ============================================================================\n\n/**\n * Wrap component output in a stable Fragment so component metadata lives on a\n * dedicated node. This prevents parent/child sharing when a component returns\n * another component and keeps updates stable even when output becomes empty.\n */\nconst wrapComponentMakerIfNeeded = (\n componentMaker: (props: Props) => WDom,\n props: Props\n): { wrappedComponentMaker: (props: Props) => WDom; customNode: WDom } => {\n const wrappedComponentMaker = (newProps: Props): WDom => {\n const next = componentMaker(newProps);\n const wrapper = Fragment({}, next);\n next.getParent = () => wrapper;\n return wrapper;\n };\n\n const customNode = wrappedComponentMaker(props);\n\n return { wrappedComponentMaker, customNode };\n};\n\n/**\n * When creating a custom component node, attach additional information attributes to the virtual DOM object.\n */\nconst addComponentProps = (\n wDom: WDom,\n compKey: Props,\n tag: TagFunction,\n props: Props,\n children: WDom[],\n reRender: () => WDom\n) => {\n // Runs on every render of every component: plain assignments, and the\n // redraw action is bound once in makeCustomNode.\n wDom.compProps = props;\n wDom.compChild = children;\n wDom.ctor = tag;\n wDom.compKey = compKey;\n wDom.reRender = reRender;\n\n const comp = componentMap.get(compKey);\n if (comp) {\n comp.vd.value = wDom;\n }\n};\n","export const ref = <T>(initValue: T) => ({ value: initValue });\nexport const nextTick = () => Promise.resolve();\n","import { Renew } from '@/types';\nimport { getComponentKey } from '@/utils/universalRef';\nimport { componentUpdate } from '@/utils/redraw';\n\n/**\n * Hook to get the renew (component update) function.\n * Useful for lmount components that need to trigger updates.\n */\nexport const useRenew = (): Renew => {\n const compKey = getComponentKey();\n\n if (!compKey) {\n return () => false;\n }\n\n return componentUpdate(compKey);\n};\n"],"names":["wdomSymbol","xmlnsRef","compKeyRef","needDiffRef","componentMap","lmountComponentSet","componentMapManualMode","setComponetRef","compKey","getComponentKey","getComponentSubInfo","subKey","component","initUpdateHookState","initMountHookState","setComponentMapManualMode","enabled","isComponentMapManualMode","runUnmountEffects","subInfo","effect","disposeComponentEntry","getParent","vDom","makeParentGetter","parent","keys","isEnumerableProp","props","key","hasEnumerableProp","prototype","isObject","target","isPropType","obj","checkPlainWDomType","wDom","checkPlainType","typeName","checkSameCustomComponent","newWDom","originalWDom","checkSameFragment","checkSameTagElement","checkNormalTypeElement","checkLoopTypeElement","checkExistyKey","getKey","checkVirtualType","type","checkCustemComponentFunction","checkFragmentFunction","Fragment","checkEmptyElement","checkExisty","value","checkStyleData","dataKey","dataValue","checkRefData","accessorCache","hasAccessorMethods","proto","byKey","result","descriptor","isPendingCustomElement","getWDomType","checkSameWDomWithOriginal","unmount","effectAction","comp","runUnmountQueueFromWDom","removeItem","recursiveRunUnmount","item","mountedQueue","addMountedQueue","execMountedQueue","runMountedQueueFromWDom","mountCallback","mountQueue","sequence","callback","mountReadyCallback","runWDomCallbacksFromWDom","wdCBQueue","cleanup","useUpdated","dependencies","upD","upS","def","nextDependencies","checkNeedPushQueue","runUpdatedQueueFromWDom","queue","originalDefs","newDefs","index","DF","CE","t","render","wrapElement","afterElement","isHydration","Dom","wDomToDom","compData","rootDelete","deleteRealDom","typeDelete","parentWDom","parentElement","findRealParentElement","nt","findChildWithRemoveElement","items","count","node","el","typeDeleteUnused","typeSortedReplace","typeAdd","typeSortedUpdate","typeUpdate","getElementFromFragment","newElement","parentEl","nextEl","startFindNextBrotherElement","acc","element","brothers","nextIndex","candidiateBrothers","finedNextEl","findChildFragmentNextElement","parentType","targetEl","bItem","found","typeReplace","orignalElement","updateText","oldProps","updateProps","updateChildren","children","needPlace","childItem","wDomUpdate","created","matchedIndexes","oiSeq","createdCount","nr","stay","getLisPositions","pos","baseAnchor","tail","anchor","i","isNew","needMove","first","clearDiffMeta","seq","prev","lo","hi","mid","last","newWDomTree","needRerender","renderHandlers","originalProps","isEvent","updateEvent","updateStyle","setAttr","k","v","tag","text","isVirtualType","wDomChildrenToDom","childElement","eventKey","newEventHandler","oldEventHandler","eventName","style","oldStyle","orig","htmlElement","cssStyle","styleProxy","makeNewWDomTree","remakeNewWDom","isSameType","remakeWDom","generalize","addReRenderTypeProperty","isNoting","remakeChildrenForDiff","inheritPropForRender","isKeyChecked","syncResolverProps","infoProps","syncResolverChildren","infoChidren","childrenItem","runUpdate","infoVdom","remakeChildrenForUpdate","remakeChildrenForAdd","child","remakeChildrenForLoopUpdate","origChildren","remakedChildren","unUsedChildren","diffLoopChildren","keyMap","origIndex","matched","redrawQueue","redrawQueueTimeout","schedule","exec","execRedrawQueue","bindRedraw","componentUpdate","up","updateCallback","runUpdateCallback","updateReqs","_props","h","nodeParentPointer","newChildren","remakeChildren","makeNode","portal","mount","_children","lmount","syncAncestorComponentChildren","prevChild","nextChild","walk","visited","childIndex","replaceWDom","makeWDomResolver","isRoot","we","ae","componetMakeResolver","makeChildrenItem","createComponentResolver","wrappedChildren","prevNeedDiff","initialComponent","componentMaker","nextProps","makeCustomNode","ctor","resolve","normalizedComponentMaker","wrappedComponentMaker","customNode","wrapComponentMakerIfNeeded","reRender","makeReRender","addComponentProps","wDomMaker","newProps","next","wrapper","ref","initValue","nextTick","useRenew"],"mappings":"gFAEa,MAAAA,EAAa,OAAO,IAAI,mBAAmB,EAC3CC,EAA8B,CAAE,MAAO,IACvCC,EAAwC,CAAE,MAAO,MACjDC,EAAkC,CAAE,MAAO,IAC3CC,MAAiC,QACjCC,MAA4C,QACzD,IAAIC,GAAyB,GAE7B,MAAMC,GAAkBC,GAA2B,CACjDJ,EAAa,IAAII,EAAS,CACxB,GAAI,CAAE,MAAO,IAAK,EAClB,GAAI,IAAM,CAAC,EACX,IAAK,CAAC,EACN,IAAK,CAAE,MAAO,CAAE,EAChB,IAAK,CAAC,EACN,KAAM,CAAC,EACP,IAAK,CAAC,EACN,KAAM,CAAC,EACP,KAAM,CAAC,CAAA,CACR,CACH,EAEaC,EAAkB,IAAsBP,EAAW,MAEnDQ,GAAsB,CACjCF,EACAG,IAC4B,CACtB,MAAAC,EAAYR,EAAa,IAAII,CAAO,EAC1C,OAAII,EACKA,EAAUD,CAAM,EAElB,IACT,EAEaE,GAAuBL,GAA2B,CAC7DN,EAAW,MAAQM,CACrB,EAEaM,GAAsBN,GAA2B,CAC5DN,EAAW,MAAQM,EACnBD,GAAeC,CAAO,CACxB,EAEaO,GAA6BC,GAA2B,CAC1CV,GAAAU,CAC3B,EAEaC,GAA2B,IAAeX,GAE1CY,GAAqBV,GAA2B,CACrD,MAAAW,EAAUf,EAAa,IAAII,CAAO,EACpCW,IACFA,EAAQ,KAAK,QAAkBC,GAAAA,EAAQ,CAAA,EACvCD,EAAQ,KAAO,GAEnB,EAEaE,GAAyBb,GAA2B,CAC/DU,GAAkBV,CAAO,EACzBJ,EAAa,OAAOI,CAAO,CAC7B,EC3Dac,EAAaC,GACvBA,EAAK,WAAaA,EA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