frosty 0.0.121 → 0.0.122

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 (47) hide show
  1. package/dist/_native.d.mts +1 -1
  2. package/dist/_native.d.ts +1 -1
  3. package/dist/_native.js +2 -2
  4. package/dist/_native.mjs +2 -2
  5. package/dist/dom.d.mts +2 -2
  6. package/dist/dom.d.ts +2 -2
  7. package/dist/dom.js +3 -3
  8. package/dist/dom.mjs +3 -3
  9. package/dist/index.js +2 -2
  10. package/dist/index.mjs +4 -4
  11. package/dist/internals/{index-CYqgonKo.mjs → index-B816bgQK.mjs} +5 -4
  12. package/dist/internals/{index-CYqgonKo.mjs.map → index-B816bgQK.mjs.map} +1 -1
  13. package/dist/internals/{index-Dxb4qbGJ.d.ts → index-C0U1mahm.d.ts} +2 -2
  14. package/dist/internals/index-C0U1mahm.d.ts.map +1 -0
  15. package/dist/internals/{index-B3K_At0T.js → index-CMpwCIOl.js} +5 -4
  16. package/dist/internals/{index-B3K_At0T.js.map → index-CMpwCIOl.js.map} +1 -1
  17. package/dist/internals/{index-Dm4wQ4OF.d.mts → index-D48WC6Fm.d.mts} +2 -2
  18. package/dist/internals/index-D48WC6Fm.d.mts.map +1 -0
  19. package/dist/internals/{renderer-DYHpS9Pb.d.ts → renderer-B32rcZz-.d.ts} +2 -2
  20. package/dist/internals/{renderer-DYHpS9Pb.d.ts.map → renderer-B32rcZz-.d.ts.map} +1 -1
  21. package/dist/internals/{renderer-eqt9d1wX.d.mts → renderer-BBdGlSnA.d.mts} +2 -2
  22. package/dist/internals/{renderer-eqt9d1wX.d.mts.map → renderer-BBdGlSnA.d.mts.map} +1 -1
  23. package/dist/internals/{renderer-PC8Rmcn8.mjs → renderer-C0Xb0VQ0.mjs} +4 -3
  24. package/dist/internals/renderer-C0Xb0VQ0.mjs.map +1 -0
  25. package/dist/internals/{renderer-tH1ZrzAE.mjs → renderer-COh5o0Z8.mjs} +3 -3
  26. package/dist/internals/{renderer-tH1ZrzAE.mjs.map → renderer-COh5o0Z8.mjs.map} +1 -1
  27. package/dist/internals/{renderer-BpxETChN.js → renderer-DsWFL-H7.js} +4 -3
  28. package/dist/internals/renderer-DsWFL-H7.js.map +1 -0
  29. package/dist/internals/{renderer-DafY1_-y.js → renderer-DyMJwSRp.js} +3 -3
  30. package/dist/internals/{renderer-DafY1_-y.js.map → renderer-DyMJwSRp.js.map} +1 -1
  31. package/dist/internals/{sync-BeQSFdEN.js → sync-BZI8Nn3y.js} +2 -2
  32. package/dist/internals/{sync-BeQSFdEN.js.map → sync-BZI8Nn3y.js.map} +1 -1
  33. package/dist/internals/{sync-Bx9yYmhM.mjs → sync-DG_CUlqG.mjs} +2 -2
  34. package/dist/internals/{sync-Bx9yYmhM.mjs.map → sync-DG_CUlqG.mjs.map} +1 -1
  35. package/dist/server-dom.d.mts +2 -2
  36. package/dist/server-dom.d.ts +2 -2
  37. package/dist/server-dom.js +3 -3
  38. package/dist/server-dom.mjs +3 -3
  39. package/dist/web.d.mts +2 -2
  40. package/dist/web.d.ts +2 -2
  41. package/dist/web.js +4 -4
  42. package/dist/web.mjs +5 -5
  43. package/package.json +1 -1
  44. package/dist/internals/index-Dm4wQ4OF.d.mts.map +0 -1
  45. package/dist/internals/index-Dxb4qbGJ.d.ts.map +0 -1
  46. package/dist/internals/renderer-BpxETChN.js.map +0 -1
  47. package/dist/internals/renderer-PC8Rmcn8.mjs.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { N as NativeElementType, c as PropsType, a as ComponentNode } from './internals/common-l_tn3GdO.mjs';
2
- export { V as VNode, _ as _Renderer } from './internals/index-Dm4wQ4OF.mjs';
2
+ export { V as VNode, _ as _Renderer } from './internals/index-D48WC6Fm.mjs';
3
3
  export { u as uniqueId } from './internals/utils-BYUPY_UY.mjs';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
package/dist/_native.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { N as NativeElementType, c as PropsType, a as ComponentNode } from './internals/common-l_tn3GdO.js';
2
- export { V as VNode, _ as _Renderer } from './internals/index-Dxb4qbGJ.js';
2
+ export { V as VNode, _ as _Renderer } from './internals/index-C0U1mahm.js';
3
3
  export { u as uniqueId } from './internals/utils-DkVDgsjY.js';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
package/dist/_native.js CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  var runtime = require('./internals/runtime-B6GnZi7A.js');
4
- var renderer = require('./internals/renderer-BpxETChN.js');
5
- var index = require('./internals/index-B3K_At0T.js');
4
+ var renderer = require('./internals/renderer-DsWFL-H7.js');
5
+ var index = require('./internals/index-CMpwCIOl.js');
6
6
  var events = require('./internals/events-DFlIK-gk.js');
7
7
  require('lodash');
8
8
  require('nextick');
package/dist/_native.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { _ as _createElement } from './internals/runtime-PoXcsgok.mjs';
2
2
  export { N as NativeElementType } from './internals/runtime-PoXcsgok.mjs';
3
- export { _ as _Renderer } from './internals/renderer-PC8Rmcn8.mjs';
4
- export { u as uniqueId } from './internals/index-CYqgonKo.mjs';
3
+ export { _ as _Renderer } from './internals/renderer-C0Xb0VQ0.mjs';
4
+ export { u as uniqueId } from './internals/index-B816bgQK.mjs';
5
5
  export { E as EventEmitter } from './internals/events-DIQH_mHX.mjs';
6
6
  import 'lodash';
7
7
  import 'nextick';
package/dist/dom.d.mts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as _DOMRenderer } from './internals/renderer-eqt9d1wX.mjs';
1
+ import { _ as _DOMRenderer } from './internals/renderer-BBdGlSnA.mjs';
2
2
  import './internals/common-l_tn3GdO.mjs';
3
3
  import '@o2ter/utils-js';
4
4
  import 'lodash';
5
5
  import 'csstype';
6
- import './internals/index-Dm4wQ4OF.mjs';
6
+ import './internals/index-D48WC6Fm.mjs';
7
7
  import 'jsdom';
8
8
 
9
9
  declare class DOMRenderer extends _DOMRenderer {
package/dist/dom.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { _ as _DOMRenderer } from './internals/renderer-DYHpS9Pb.js';
1
+ import { _ as _DOMRenderer } from './internals/renderer-B32rcZz-.js';
2
2
  import './internals/common-l_tn3GdO.js';
3
3
  import '@o2ter/utils-js';
4
4
  import 'lodash';
5
5
  import 'csstype';
6
- import './internals/index-Dxb4qbGJ.js';
6
+ import './internals/index-C0U1mahm.js';
7
7
  import 'jsdom';
8
8
 
9
9
  declare class DOMRenderer extends _DOMRenderer {
package/dist/dom.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var renderer = require('./internals/renderer-DafY1_-y.js');
3
+ var renderer = require('./internals/renderer-DyMJwSRp.js');
4
4
  require('lodash');
5
5
  require('myers.js');
6
- require('./internals/renderer-BpxETChN.js');
7
- require('./internals/index-B3K_At0T.js');
6
+ require('./internals/renderer-DsWFL-H7.js');
7
+ require('./internals/index-CMpwCIOl.js');
8
8
  require('./internals/runtime-B6GnZi7A.js');
9
9
  require('nextick');
10
10
  require('postcss');
package/dist/dom.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { _ as _DOMRenderer } from './internals/renderer-tH1ZrzAE.mjs';
1
+ import { _ as _DOMRenderer } from './internals/renderer-COh5o0Z8.mjs';
2
2
  import 'lodash';
3
3
  import 'myers.js';
4
- import './internals/renderer-PC8Rmcn8.mjs';
5
- import './internals/index-CYqgonKo.mjs';
4
+ import './internals/renderer-C0Xb0VQ0.mjs';
5
+ import './internals/index-B816bgQK.mjs';
6
6
  import './internals/runtime-PoXcsgok.mjs';
7
7
  import 'nextick';
8
8
  import 'postcss';
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
3
  var runtime = require('./internals/runtime-B6GnZi7A.js');
4
- var index = require('./internals/index-B3K_At0T.js');
4
+ var index = require('./internals/index-CMpwCIOl.js');
5
5
  var _ = require('lodash');
6
- var sync = require('./internals/sync-BeQSFdEN.js');
6
+ var sync = require('./internals/sync-BZI8Nn3y.js');
7
7
  require('myers.js');
8
8
  require('./jsx-runtime.js');
9
9
 
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  export { C as ComponentNode, F as Fragment, c as createElement } from './internals/runtime-PoXcsgok.mjs';
2
- import { u as uniqueId, r as reconciler } from './internals/index-CYqgonKo.mjs';
3
- export { E as ErrorBoundary, P as PropsProvider, a as createContext, c as createPairs, m as mergeRefs, b as useContext } from './internals/index-CYqgonKo.mjs';
2
+ import { u as uniqueId, r as reconciler } from './internals/index-B816bgQK.mjs';
3
+ export { E as ErrorBoundary, P as PropsProvider, a as createContext, c as createPairs, m as mergeRefs, b as useContext } from './internals/index-B816bgQK.mjs';
4
4
  import _ from 'lodash';
5
- import { _ as _useMemo, u as useState, a as useEffect, b as useCallback, c as useErrorContext, d as useSyncExternalStore, e as _useEffect } from './internals/sync-Bx9yYmhM.mjs';
6
- export { R as ResourceErrors, f as useMemo, g as useRendererStorage, h as useResourceErrors } from './internals/sync-Bx9yYmhM.mjs';
5
+ import { _ as _useMemo, u as useState, a as useEffect, b as useCallback, c as useErrorContext, d as useSyncExternalStore, e as _useEffect } from './internals/sync-DG_CUlqG.mjs';
6
+ export { R as ResourceErrors, f as useMemo, g as useRendererStorage, h as useResourceErrors } from './internals/sync-DG_CUlqG.mjs';
7
7
  import 'myers.js';
8
8
  import './jsx-runtime.mjs';
9
9
 
@@ -496,7 +496,7 @@ class VNode {
496
496
  }
497
497
  }
498
498
  if (_.some(diff, x => !x.equivalent)) {
499
- this._children_updated(event);
499
+ this._remount_parent(event);
500
500
  }
501
501
  }
502
502
  catch (error) {
@@ -514,13 +514,14 @@ class VNode {
514
514
  console.error(e);
515
515
  }
516
516
  })();
517
- this._children_updated(event);
517
+ event.remount(this);
518
+ this._remount_parent(event);
518
519
  }
519
520
  finally {
520
521
  reconciler._currentHookState = undefined;
521
522
  }
522
523
  }
523
- _children_updated(event) {
524
+ _remount_parent(event) {
524
525
  const node = this._nativeParent;
525
526
  if (node && node !== this)
526
527
  event.remount(node);
@@ -597,4 +598,4 @@ const reconciler = new class {
597
598
  };
598
599
 
599
600
  export { ErrorBoundary as E, PropsProvider as P, UpdateManager as U, VNode as V, _ParentComponent as _, createContext as a, useContext as b, createPairs as c, equalDeps as e, mergeRefs as m, reconciler as r, uniqueId as u };
600
- //# sourceMappingURL=index-CYqgonKo.mjs.map
601
+ //# sourceMappingURL=index-B816bgQK.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-CYqgonKo.mjs","sources":["../../../src/core/components/pairs.ts","../../../src/core/utils.ts","../../../src/core/hooks/context.ts","../../../src/core/types/props.ts","../../../src/core/types/error.ts","../../../src/core/reconciler/utils.ts","../../../src/core/reconciler/index.ts"],"sourcesContent":["//\n// pairs.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from \"lodash\";\nimport { PropsWithChildren } from \"../types/common\";\nimport { NativeElementType } from \"../types/component\";\nimport { _createElement, _ElementType } from \"../types/runtime\";\nimport { VNode } from \"../reconciler\";\nimport { Fragment } from \"./fragment\";\n\nexport abstract class _ParentComponent extends NativeElementType {\n abstract isChildNode(child: string | VNode): boolean;\n}\n\n/**\n * Create a pair of Parent and Child components.\n * \n * @param allowTextChildren - Whether to allow text children in the Parent component.\n * @param allowedChildTypes - An array of additional allowed child component types.\n * @returns An object containing the Parent and Child components.\n */\nexport const createPairs = ({ allowTextChildren, allowedChildTypes = [] }: {\n allowTextChildren?: boolean;\n allowedChildTypes?: (_ElementType | typeof NativeElementType)[];\n} = {}) => {\n const ChildComponent = ({ children }: PropsWithChildren<{}>) => _createElement(Fragment, { children });\n class ParentComponent extends _ParentComponent {\n isChildNode(child: string | VNode) {\n if (_.isString(child)) return !!allowTextChildren;\n return child.type === ChildComponent || _.some(allowedChildTypes, x => child.type === x);\n }\n }\n return {\n Parent: ({ children }: PropsWithChildren<{}>) => _createElement(ParentComponent, { children }),\n Child: ChildComponent,\n }\n}\n","//\n// utils.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { Ref } from './types/common';\n\nexport const mergeRefs = <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => {\n for (const ref of refs) {\n if (_.isNil(ref)) continue;\n else if (typeof ref === 'function') ref(x);\n else if (typeof ref === 'object') ref.current = x;\n else {\n console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref ${ref}`);\n }\n }\n}\n\nlet counter = 0;\n\nexport const uniqueId = () => `${Date.now().toString(36)}${(counter++).toString(36)}${Math.random().toString(36).slice(2)}`;\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../reconciler';\nimport { ComponentType, ElementNode } from '../types/common';\n\nconst _contextDefaultValue = new WeakMap<Context<any>, any>();\n\nexport const isContext = (type: any): type is Context<any> => {\n return _contextDefaultValue.has(type as any);\n};\n\nexport type Context<Value> = ReturnType<typeof _createContext<Value>>;\nexport type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;\n\nconst _createContext = <Value extends unknown>(defaultValue: Value) => {\n const _context: ComponentType<{\n value: Value;\n children?: ElementNode | ((value: Value) => ElementNode);\n }> = ({ value, children }) => {\n return _.isFunction(children) ? children(value) : children;\n };\n const Consumer: ComponentType<{\n children: (value: Value) => ElementNode;\n }> = ({ children }) => {\n const value = useContext(_context as Context<Value>);\n return children(value);\n };\n _contextDefaultValue.set(_context as Context<Value>, defaultValue);\n return _.assign(_context, { Consumer });\n};\n\n/**\n * Creates a new context object with an optional default value.\n *\n * A context object allows you to share a value across a component tree\n * without explicitly passing it as a prop to every level.\n *\n * @template Value - The type of the value to be stored in the context.\n * @param - The default value for the context.\n * @returns A context object that can be used to provide and consume the value.\n */\n\nexport function createContext<Value>(defaultValue: Value): Context<Value>;\nexport function createContext<Value = undefined>(): Context<Value | undefined>;\n\nexport function createContext(defaultValue?: any) {\n return _createContext(defaultValue);\n}\n\n/**\n * A hook that retrieves the current value of a context and optionally applies\n * a selector function to transform the context value. This hook ensures that the component\n * subscribes to the context and re-renders when the context value changes.\n *\n * @template T - The type of the context value.\n * @template R - The type of the transformed value returned by the selector.\n * @param context - The context object to retrieve the value from.\n * @param selector - An optional selector function to transform the context value.\n * Defaults to an identity function.\n * @returns - The current value of the context, optionally transformed by the selector.\n *\n * @throws - Throws an error if the provided context is invalid or if the hook\n * is used outside of a render function.\n *\n * @example\n * const MyContext = createContext({ user: null });\n * \n * function MyComponent() {\n * const user = useContext(MyContext, context => context.user);\n * return <div>{user ? `Hello, ${user.name}` : 'Hello, Guest'}</div>;\n * }\n */\nexport const useContext = <T, R = T>(\n context: Context<T>,\n selector: (state: T) => R = v => v as any\n) => {\n if (!isContext(context)) throw Error(`Invalid type of ${context}`);\n const state = reconciler.currentHookState;\n if (!state) throw Error('useContext must be used within a render function.');\n const node = state.resolveContextNode(context);\n if (node) {\n state.context.add(node);\n return selector(node.props.value);\n }\n return selector(_contextDefaultValue.get(context));\n};\n","//\n// props.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentType, PropsWithChildren } from './common';\nimport { NativeElementType } from './component';\nimport { _ElementType, PropsType } from './runtime';\n\ntype PropsProviderProps = PropsWithChildren<{\n callback: (v: {\n type: _ElementType | typeof NativeElementType,\n props: PropsType\n }) => PropsType | undefined | null;\n}>;\n\nexport const PropsProvider: ComponentType<PropsProviderProps> = ({ children }) => {\n return children;\n}\n","//\n// error.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentType, PropsWithChildren } from './common';\nimport { ComponentNode } from './component';\n\ntype ErrorBoundaryProps = PropsWithChildren<{\n silent?: boolean;\n onError?: (\n error: any,\n component: ComponentNode,\n stack: ComponentNode[],\n ) => void;\n}>;\n\nexport const ErrorBoundary: ComponentType<ErrorBoundaryProps> = ({ children }) => {\n return children;\n}\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\n\nconst _equalDeps = (lhs: any, rhs: any, stack: [any, any][]) => {\n if (lhs === rhs) return true;\n if (_.isFunction(lhs) || _.isFunction(rhs)) return false;\n\n // Check if we've already compared these objects (circular reference detection)\n const lhsIndex = _.findIndex(stack, s => s[0] === lhs);\n const rhsIndex = _.findIndex(stack, s => s[1] === rhs);\n\n // If both are in the stack at the same position, they're part of the same circular structure\n if (lhsIndex !== -1 && rhsIndex !== -1 && lhsIndex === rhsIndex) return true;\n\n // If only one is in the stack, they're not equal\n if (lhsIndex !== -1 || rhsIndex !== -1) return false;\n\n if (_.isArray(lhs) && _.isArray(rhs)) {\n if (lhs.length !== rhs.length) return false;\n const newStack: [any, any][] = [...stack, [lhs, rhs]];\n for (let i = 0; i < lhs.length; i++) {\n if (!_equalDeps(lhs[i], rhs[i], newStack)) return false;\n }\n return true;\n }\n if (_.isPlainObject(lhs) && _.isPlainObject(rhs)) {\n const lkeys = _.keys(lhs);\n const rkeys = _.keys(rhs);\n if (lkeys.length !== rkeys.length) return false;\n const newStack: [any, any][] = [...stack, [lhs, rhs]];\n for (const key of lkeys) {\n if (!_equalDeps(lhs[key], rhs[key], newStack)) return false;\n }\n return true;\n }\n return false;\n}\n\nexport const equalDeps = (lhs: any, rhs: any) => {\n return _equalDeps(lhs, rhs, []);\n}\n\nexport const equalProps = (lhs: Record<string, any>, rhs: Record<string, any>) => {\n if (lhs === rhs) return true;\n const lkeys = _.keys(lhs);\n const rkeys = _.keys(rhs);\n if (lkeys.length !== rkeys.length) return false;\n for (const key of lkeys) {\n if (_.isFunction(lhs[key]) && _.isFunction(rhs[key])) continue;\n if (!equalDeps(lhs[key], rhs[key])) return false;\n }\n return true;\n};\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { ComponentNode, NativeElementType } from '../types/component';\nimport { uniqueId } from '../utils';\nimport { Context, isContext } from '../hooks/context';\nimport { PropsProvider } from '../types/props';\nimport { ErrorBoundary } from '../types/error';\nimport { _Renderer } from '../renderer';\nimport { myersSync } from 'myers.js';\nimport { equalDeps, equalProps } from './utils';\nimport { PropsType } from '../types/runtime';\n\ntype VNodeState = {\n hook: string;\n deps: any;\n data?: any;\n mount?: () => () => void;\n};\n\nexport class UpdateManager {\n\n /** @internal */\n _dirty: Set<VNode>[] = [];\n\n /** @internal */\n _remount: Set<VNode>[] = [];\n\n /** @internal */\n _removed: Set<VNode> = new Set();\n\n /** @internal */\n private _refresh: (x: UpdateManager, force: boolean) => Promise<void>;\n\n constructor(refresh: (x: UpdateManager, force: boolean) => Promise<void>) {\n this._refresh = refresh;\n }\n\n async refresh(force: boolean = false) {\n await this._refresh(this, force);\n }\n\n _setDirty(node: VNode) {\n if (!this._dirty[node._level]) this._dirty[node._level] = new Set();\n this._dirty[node._level].add(node);\n }\n\n setDirty(node: VNode) {\n this._setDirty(node);\n this.refresh();\n }\n\n remount(node: VNode) {\n if (!this._remount[node._level]) this._remount[node._level] = new Set();\n this._remount[node._level].add(node);\n }\n\n removed(node: VNode) {\n this._removed.add(node);\n }\n\n get isDirty() {\n return this._dirty.some(x => !!x.size) || this._remount.some(x => !!x.size);\n }\n}\n\nexport class VNode {\n\n /** @internal */\n _component: ComponentNode;\n\n private _id = uniqueId();\n\n private _props: PropsType = {};\n private _error?: any;\n private _children: (VNode | string)[] = [];\n\n /** @internal */\n _state?: VNodeState[];\n\n /** @internal */\n _content_listeners: Set<VNode> = new Set();\n private _content_value?: any;\n\n /** @internal */\n _context: Set<VNode> = new Set();\n\n /** @internal */\n _parent?: VNode;\n\n /** @internal */\n _nativeParent?: VNode;\n\n /** @internal */\n _level = 0;\n\n /** @internal */\n constructor(component: ComponentNode) {\n this._component = component;\n }\n\n get id() {\n return this._id;\n }\n\n get type() {\n return this._component.type;\n }\n\n get props() {\n return this._props;\n }\n\n get key() {\n return this._component.key;\n }\n\n get children() {\n return this._children;\n }\n\n get error() {\n return this._error;\n }\n\n get stack() {\n let node: VNode | undefined = this;\n return (function* () {\n while (node) {\n yield node;\n node = node._parent;\n }\n })();\n }\n\n /** @internal */\n async _render(event: UpdateManager, renderer: _Renderer<any>) {\n try {\n const { type } = this._component;\n const props = this._resolve_props();\n let children: (VNode | string)[];\n let native = this._nativeParent;\n if (_.isString(type) || type?.prototype instanceof NativeElementType) {\n children = this._resolve_children(props.children, event);\n event.remount(this);\n native = this;\n } else if (isContext(type)) {\n const { value } = props;\n if (!equalDeps(this._content_value, value)) {\n for (const node of this._content_listeners) {\n event.setDirty(node);\n }\n }\n this._content_value = value;\n children = this._resolve_children(type(props as any), event);\n } else if (_.isFunction(type)) {\n while (true) {\n const state = new HookState(this, event, renderer);\n reconciler._currentHookState = state;\n const rendered = type(props);\n for (const node of this._context.difference(state.context)) {\n node._content_listeners.delete(this);\n }\n for (const node of state.context.difference(this._context)) {\n node._content_listeners.add(this);\n }\n this._state = state.state;\n this._context = state.context;\n if (_.isEmpty(state.tasks)) {\n children = this._resolve_children(rendered, event);\n break;\n }\n await Promise.all(state.tasks);\n }\n event.remount(this);\n } else {\n throw Error(`Invalid node type ${type}`);\n }\n const diff = myersSync(this._children, children, {\n compare: (lhs, rhs) => {\n if (_.isString(lhs) && _.isString(rhs)) return lhs === rhs;\n if (lhs instanceof VNode && rhs instanceof VNode) return lhs._component.equalType(rhs._component);\n return false;\n },\n });\n this._props = props;\n this._children = _.flatMap(diff, x => x.equivalent ?? x.insert ?? []);\n this._error = undefined;\n for (const [lhs, rhs] of _.zip(this._children, children)) {\n if (!(lhs instanceof VNode) || !(rhs instanceof VNode)) continue;\n if (lhs === rhs) {\n event.setDirty(lhs);\n } else {\n if (!equalProps(lhs._component.props, rhs._component.props)) event.setDirty(lhs);\n lhs._component = rhs._component;\n }\n lhs._parent = this;\n lhs._nativeParent = native;\n lhs._level = this._level + 1;\n }\n for (const removed of _.flatMap(diff, x => x.remove ?? [])) {\n if (removed instanceof VNode) {\n event.removed(removed);\n }\n }\n if (_.some(diff, x => !x.equivalent)) {\n this._children_updated(event);\n }\n } catch (error) {\n this._children = [];\n this._error = error;\n (async () => {\n try {\n const { onError, silent } = this._resolve_error_boundary() ?? {};\n if (!silent) console.error(error);\n if (_.isFunction(onError)) await onError(error, this._component, this.stack.map(x => x._component));\n } catch (e) {\n console.error(e);\n }\n })();\n this._children_updated(event);\n } finally {\n reconciler._currentHookState = undefined;\n }\n }\n\n private _children_updated(event: UpdateManager) {\n const node = this._nativeParent;\n if (node && node !== this) event.remount(node);\n }\n\n private _resolve_props() {\n const self = this;\n const { type, props: _props } = this._component;\n if (type === PropsProvider) return _props;\n let props = { ..._props };\n for (const node of this.stack.drop(1)) {\n if (node.type === PropsProvider) {\n props = node.props.callback({ type, props });\n }\n }\n return _.mapValues(props, (v, k) => _.isFunction(v) ? function (this: any, ...args: any[]) {\n const current = self._component.props[k];\n return _.isFunction(current) ? current.call(this, ...args) : v.call(this, ...args);\n } : v);\n }\n\n private _resolve_children(child: any, event: UpdateManager): (VNode | string)[] {\n if (_.isBoolean(child) || _.isNil(child)) return [];\n if (_.isString(child)) return [child];\n if (_.isNumber(child)) return [`${child}`];\n if (child instanceof ComponentNode) return [new VNode(child)];\n if (_.isArrayLikeObject(child)) return _.flatMap(child, x => this._resolve_children(x, event));\n if (typeof child[Symbol.iterator] === 'function') return _.flatMap([...child], x => this._resolve_children(x, event));\n throw Error(`${child} are not valid as a child.`);\n }\n\n private _resolve_error_boundary() {\n return this.stack.drop(1).find(node => node.type === ErrorBoundary)?.props;\n }\n}\n\nclass HookState {\n\n node: VNode;\n event: UpdateManager;\n renderer: _Renderer<any>;\n\n state: VNodeState[] = [];\n tasks: PromiseLike<void>[] = [];\n context: Set<VNode> = new Set();\n\n constructor(\n node: VNode,\n event: UpdateManager,\n renderer: _Renderer<any>,\n ) {\n this.node = node;\n this.event = event;\n this.renderer = renderer;\n }\n\n get prevState() {\n return this.node._state;\n }\n\n get stack() {\n const [, ...stack] = this.node.stack;\n return stack;\n }\n\n setDirty() {\n this.event.setDirty(this.node);\n }\n\n resolveContextNode(context: Context<any>) {\n return this.stack.find(node => node.type === context);\n }\n}\n\nexport const reconciler = new class {\n\n /** @internal */\n _registry = new WeakMap<any, string>();\n\n /** @internal */\n _currentHookState?: HookState;\n\n get currentHookState() {\n return this._currentHookState;\n }\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASM,MAAgB,gBAAiB,SAAQ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B;AAEA,IAAA,IAAI,SAAS,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM;IACzB;AAEA,IAAA,IAAI,KAAK,GAAA;QACP,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;AACpC,QAAA,OAAO,KAAK;IACd;IAEA,QAAQ,GAAA;QACN,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAChC;AAEA,IAAA,kBAAkB,CAAC,OAAqB,EAAA;AACtC,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;IACvD;AACD;AAEM,MAAM,UAAU,GAAG,IAAI,MAAA;;AAG5B,IAAA,SAAS,GAAG,IAAI,OAAO,EAAe;;AAGtC,IAAA,iBAAiB;AAEjB,IAAA,IAAI,gBAAgB,GAAA;QAClB,OAAO,IAAI,CAAC,iBAAiB;IAC/B;;;;;"}
1
+ {"version":3,"file":"index-B816bgQK.mjs","sources":["../../../src/core/components/pairs.ts","../../../src/core/utils.ts","../../../src/core/hooks/context.ts","../../../src/core/types/props.ts","../../../src/core/types/error.ts","../../../src/core/reconciler/utils.ts","../../../src/core/reconciler/index.ts"],"sourcesContent":["//\n// pairs.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from \"lodash\";\nimport { PropsWithChildren } from \"../types/common\";\nimport { NativeElementType } from \"../types/component\";\nimport { _createElement, _ElementType } from \"../types/runtime\";\nimport { VNode } from \"../reconciler\";\nimport { Fragment } from \"./fragment\";\n\nexport abstract class _ParentComponent extends NativeElementType {\n abstract isChildNode(child: string | VNode): boolean;\n}\n\n/**\n * Create a pair of Parent and Child components.\n * \n * @param allowTextChildren - Whether to allow text children in the Parent component.\n * @param allowedChildTypes - An array of additional allowed child component types.\n * @returns An object containing the Parent and Child components.\n */\nexport const createPairs = ({ allowTextChildren, allowedChildTypes = [] }: {\n allowTextChildren?: boolean;\n allowedChildTypes?: (_ElementType | typeof NativeElementType)[];\n} = {}) => {\n const ChildComponent = ({ children }: PropsWithChildren<{}>) => _createElement(Fragment, { children });\n class ParentComponent extends _ParentComponent {\n isChildNode(child: string | VNode) {\n if (_.isString(child)) return !!allowTextChildren;\n return child.type === ChildComponent || _.some(allowedChildTypes, x => child.type === x);\n }\n }\n return {\n Parent: ({ children }: PropsWithChildren<{}>) => _createElement(ParentComponent, { children }),\n Child: ChildComponent,\n }\n}\n","//\n// utils.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { Ref } from './types/common';\n\nexport const mergeRefs = <T>(...refs: (Ref<T> | null | undefined)[]) => (x: T) => {\n for (const ref of refs) {\n if (_.isNil(ref)) continue;\n else if (typeof ref === 'function') ref(x);\n else if (typeof ref === 'object') ref.current = x;\n else {\n console.error(`mergeRefs cannot handle Refs of type boolean, number or string, received ref ${ref}`);\n }\n }\n}\n\nlet counter = 0;\n\nexport const uniqueId = () => `${Date.now().toString(36)}${(counter++).toString(36)}${Math.random().toString(36).slice(2)}`;\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { reconciler } from '../reconciler';\nimport { ComponentType, ElementNode } from '../types/common';\n\nconst _contextDefaultValue = new WeakMap<Context<any>, any>();\n\nexport const isContext = (type: any): type is Context<any> => {\n return _contextDefaultValue.has(type as any);\n};\n\nexport type Context<Value> = ReturnType<typeof _createContext<Value>>;\nexport type ContextType<C extends Context<any>> = C extends Context<infer T> ? T : never;\n\nconst _createContext = <Value extends unknown>(defaultValue: Value) => {\n const _context: ComponentType<{\n value: Value;\n children?: ElementNode | ((value: Value) => ElementNode);\n }> = ({ value, children }) => {\n return _.isFunction(children) ? children(value) : children;\n };\n const Consumer: ComponentType<{\n children: (value: Value) => ElementNode;\n }> = ({ children }) => {\n const value = useContext(_context as Context<Value>);\n return children(value);\n };\n _contextDefaultValue.set(_context as Context<Value>, defaultValue);\n return _.assign(_context, { Consumer });\n};\n\n/**\n * Creates a new context object with an optional default value.\n *\n * A context object allows you to share a value across a component tree\n * without explicitly passing it as a prop to every level.\n *\n * @template Value - The type of the value to be stored in the context.\n * @param - The default value for the context.\n * @returns A context object that can be used to provide and consume the value.\n */\n\nexport function createContext<Value>(defaultValue: Value): Context<Value>;\nexport function createContext<Value = undefined>(): Context<Value | undefined>;\n\nexport function createContext(defaultValue?: any) {\n return _createContext(defaultValue);\n}\n\n/**\n * A hook that retrieves the current value of a context and optionally applies\n * a selector function to transform the context value. This hook ensures that the component\n * subscribes to the context and re-renders when the context value changes.\n *\n * @template T - The type of the context value.\n * @template R - The type of the transformed value returned by the selector.\n * @param context - The context object to retrieve the value from.\n * @param selector - An optional selector function to transform the context value.\n * Defaults to an identity function.\n * @returns - The current value of the context, optionally transformed by the selector.\n *\n * @throws - Throws an error if the provided context is invalid or if the hook\n * is used outside of a render function.\n *\n * @example\n * const MyContext = createContext({ user: null });\n * \n * function MyComponent() {\n * const user = useContext(MyContext, context => context.user);\n * return <div>{user ? `Hello, ${user.name}` : 'Hello, Guest'}</div>;\n * }\n */\nexport const useContext = <T, R = T>(\n context: Context<T>,\n selector: (state: T) => R = v => v as any\n) => {\n if (!isContext(context)) throw Error(`Invalid type of ${context}`);\n const state = reconciler.currentHookState;\n if (!state) throw Error('useContext must be used within a render function.');\n const node = state.resolveContextNode(context);\n if (node) {\n state.context.add(node);\n return selector(node.props.value);\n }\n return selector(_contextDefaultValue.get(context));\n};\n","//\n// props.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentType, PropsWithChildren } from './common';\nimport { NativeElementType } from './component';\nimport { _ElementType, PropsType } from './runtime';\n\ntype PropsProviderProps = PropsWithChildren<{\n callback: (v: {\n type: _ElementType | typeof NativeElementType,\n props: PropsType\n }) => PropsType | undefined | null;\n}>;\n\nexport const PropsProvider: ComponentType<PropsProviderProps> = ({ children }) => {\n return children;\n}\n","//\n// error.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport { ComponentType, PropsWithChildren } from './common';\nimport { ComponentNode } from './component';\n\ntype ErrorBoundaryProps = PropsWithChildren<{\n silent?: boolean;\n onError?: (\n error: any,\n component: ComponentNode,\n stack: ComponentNode[],\n ) => void;\n}>;\n\nexport const ErrorBoundary: ComponentType<ErrorBoundaryProps> = ({ children }) => {\n return children;\n}\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\n\nconst _equalDeps = (lhs: any, rhs: any, stack: [any, any][]) => {\n if (lhs === rhs) return true;\n if (_.isFunction(lhs) || _.isFunction(rhs)) return false;\n\n // Check if we've already compared these objects (circular reference detection)\n const lhsIndex = _.findIndex(stack, s => s[0] === lhs);\n const rhsIndex = _.findIndex(stack, s => s[1] === rhs);\n\n // If both are in the stack at the same position, they're part of the same circular structure\n if (lhsIndex !== -1 && rhsIndex !== -1 && lhsIndex === rhsIndex) return true;\n\n // If only one is in the stack, they're not equal\n if (lhsIndex !== -1 || rhsIndex !== -1) return false;\n\n if (_.isArray(lhs) && _.isArray(rhs)) {\n if (lhs.length !== rhs.length) return false;\n const newStack: [any, any][] = [...stack, [lhs, rhs]];\n for (let i = 0; i < lhs.length; i++) {\n if (!_equalDeps(lhs[i], rhs[i], newStack)) return false;\n }\n return true;\n }\n if (_.isPlainObject(lhs) && _.isPlainObject(rhs)) {\n const lkeys = _.keys(lhs);\n const rkeys = _.keys(rhs);\n if (lkeys.length !== rkeys.length) return false;\n const newStack: [any, any][] = [...stack, [lhs, rhs]];\n for (const key of lkeys) {\n if (!_equalDeps(lhs[key], rhs[key], newStack)) return false;\n }\n return true;\n }\n return false;\n}\n\nexport const equalDeps = (lhs: any, rhs: any) => {\n return _equalDeps(lhs, rhs, []);\n}\n\nexport const equalProps = (lhs: Record<string, any>, rhs: Record<string, any>) => {\n if (lhs === rhs) return true;\n const lkeys = _.keys(lhs);\n const rkeys = _.keys(rhs);\n if (lkeys.length !== rkeys.length) return false;\n for (const key of lkeys) {\n if (_.isFunction(lhs[key]) && _.isFunction(rhs[key])) continue;\n if (!equalDeps(lhs[key], rhs[key])) return false;\n }\n return true;\n};\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { ComponentNode, NativeElementType } from '../types/component';\nimport { uniqueId } from '../utils';\nimport { Context, isContext } from '../hooks/context';\nimport { PropsProvider } from '../types/props';\nimport { ErrorBoundary } from '../types/error';\nimport { _Renderer } from '../renderer';\nimport { myersSync } from 'myers.js';\nimport { equalDeps, equalProps } from './utils';\nimport { PropsType } from '../types/runtime';\n\ntype VNodeState = {\n hook: string;\n deps: any;\n data?: any;\n mount?: () => () => void;\n};\n\nexport class UpdateManager {\n\n /** @internal */\n _dirty: Set<VNode>[] = [];\n\n /** @internal */\n _remount: Set<VNode>[] = [];\n\n /** @internal */\n _removed: Set<VNode> = new Set();\n\n /** @internal */\n private _refresh: (x: UpdateManager, force: boolean) => Promise<void>;\n\n constructor(refresh: (x: UpdateManager, force: boolean) => Promise<void>) {\n this._refresh = refresh;\n }\n\n async refresh(force: boolean = false) {\n await this._refresh(this, force);\n }\n\n _setDirty(node: VNode) {\n if (!this._dirty[node._level]) this._dirty[node._level] = new Set();\n this._dirty[node._level].add(node);\n }\n\n setDirty(node: VNode) {\n this._setDirty(node);\n this.refresh();\n }\n\n remount(node: VNode) {\n if (!this._remount[node._level]) this._remount[node._level] = new Set();\n this._remount[node._level].add(node);\n }\n\n removed(node: VNode) {\n this._removed.add(node);\n }\n\n get isDirty() {\n return this._dirty.some(x => !!x.size) || this._remount.some(x => !!x.size);\n }\n}\n\nexport class VNode {\n\n /** @internal */\n _component: ComponentNode;\n\n private _id = uniqueId();\n\n private _props: PropsType = {};\n private _error?: any;\n private _children: (VNode | string)[] = [];\n\n /** @internal */\n _state?: VNodeState[];\n\n /** @internal */\n _content_listeners: Set<VNode> = new Set();\n private _content_value?: any;\n\n /** @internal */\n _context: Set<VNode> = new Set();\n\n /** @internal */\n _parent?: VNode;\n\n /** @internal */\n _nativeParent?: VNode;\n\n /** @internal */\n _level = 0;\n\n /** @internal */\n constructor(component: ComponentNode) {\n this._component = component;\n }\n\n get id() {\n return this._id;\n }\n\n get type() {\n return this._component.type;\n }\n\n get props() {\n return this._props;\n }\n\n get key() {\n return this._component.key;\n }\n\n get children() {\n return this._children;\n }\n\n get error() {\n return this._error;\n }\n\n get stack() {\n let node: VNode | undefined = this;\n return (function* () {\n while (node) {\n yield node;\n node = node._parent;\n }\n })();\n }\n\n /** @internal */\n async _render(event: UpdateManager, renderer: _Renderer<any>) {\n try {\n const { type } = this._component;\n const props = this._resolve_props();\n let children: (VNode | string)[];\n let native = this._nativeParent;\n if (_.isString(type) || type?.prototype instanceof NativeElementType) {\n children = this._resolve_children(props.children, event);\n event.remount(this);\n native = this;\n } else if (isContext(type)) {\n const { value } = props;\n if (!equalDeps(this._content_value, value)) {\n for (const node of this._content_listeners) {\n event.setDirty(node);\n }\n }\n this._content_value = value;\n children = this._resolve_children(type(props as any), event);\n } else if (_.isFunction(type)) {\n while (true) {\n const state = new HookState(this, event, renderer);\n reconciler._currentHookState = state;\n const rendered = type(props);\n for (const node of this._context.difference(state.context)) {\n node._content_listeners.delete(this);\n }\n for (const node of state.context.difference(this._context)) {\n node._content_listeners.add(this);\n }\n this._state = state.state;\n this._context = state.context;\n if (_.isEmpty(state.tasks)) {\n children = this._resolve_children(rendered, event);\n break;\n }\n await Promise.all(state.tasks);\n }\n event.remount(this);\n } else {\n throw Error(`Invalid node type ${type}`);\n }\n const diff = myersSync(this._children, children, {\n compare: (lhs, rhs) => {\n if (_.isString(lhs) && _.isString(rhs)) return lhs === rhs;\n if (lhs instanceof VNode && rhs instanceof VNode) return lhs._component.equalType(rhs._component);\n return false;\n },\n });\n this._props = props;\n this._children = _.flatMap(diff, x => x.equivalent ?? x.insert ?? []);\n this._error = undefined;\n for (const [lhs, rhs] of _.zip(this._children, children)) {\n if (!(lhs instanceof VNode) || !(rhs instanceof VNode)) continue;\n if (lhs === rhs) {\n event.setDirty(lhs);\n } else {\n if (!equalProps(lhs._component.props, rhs._component.props)) event.setDirty(lhs);\n lhs._component = rhs._component;\n }\n lhs._parent = this;\n lhs._nativeParent = native;\n lhs._level = this._level + 1;\n }\n for (const removed of _.flatMap(diff, x => x.remove ?? [])) {\n if (removed instanceof VNode) {\n event.removed(removed);\n }\n }\n if (_.some(diff, x => !x.equivalent)) {\n this._remount_parent(event);\n }\n } catch (error) {\n this._children = [];\n this._error = error;\n (async () => {\n try {\n const { onError, silent } = this._resolve_error_boundary() ?? {};\n if (!silent) console.error(error);\n if (_.isFunction(onError)) await onError(error, this._component, this.stack.map(x => x._component));\n } catch (e) {\n console.error(e);\n }\n })();\n event.remount(this);\n this._remount_parent(event);\n } finally {\n reconciler._currentHookState = undefined;\n }\n }\n\n private _remount_parent(event: UpdateManager) {\n const node = this._nativeParent;\n if (node && node !== this) event.remount(node);\n }\n\n private _resolve_props() {\n const self = this;\n const { type, props: _props } = this._component;\n if (type === PropsProvider) return _props;\n let props = { ..._props };\n for (const node of this.stack.drop(1)) {\n if (node.type === PropsProvider) {\n props = node.props.callback({ type, props });\n }\n }\n return _.mapValues(props, (v, k) => _.isFunction(v) ? function (this: any, ...args: any[]) {\n const current = self._component.props[k];\n return _.isFunction(current) ? current.call(this, ...args) : v.call(this, ...args);\n } : v);\n }\n\n private _resolve_children(child: any, event: UpdateManager): (VNode | string)[] {\n if (_.isBoolean(child) || _.isNil(child)) return [];\n if (_.isString(child)) return [child];\n if (_.isNumber(child)) return [`${child}`];\n if (child instanceof ComponentNode) return [new VNode(child)];\n if (_.isArrayLikeObject(child)) return _.flatMap(child, x => this._resolve_children(x, event));\n if (typeof child[Symbol.iterator] === 'function') return _.flatMap([...child], x => this._resolve_children(x, event));\n throw Error(`${child} are not valid as a child.`);\n }\n\n private _resolve_error_boundary() {\n return this.stack.drop(1).find(node => node.type === ErrorBoundary)?.props;\n }\n}\n\nclass HookState {\n\n node: VNode;\n event: UpdateManager;\n renderer: _Renderer<any>;\n\n state: VNodeState[] = [];\n tasks: PromiseLike<void>[] = [];\n context: Set<VNode> = new Set();\n\n constructor(\n node: VNode,\n event: UpdateManager,\n renderer: _Renderer<any>,\n ) {\n this.node = node;\n this.event = event;\n this.renderer = renderer;\n }\n\n get prevState() {\n return this.node._state;\n }\n\n get stack() {\n const [, ...stack] = this.node.stack;\n return stack;\n }\n\n setDirty() {\n this.event.setDirty(this.node);\n }\n\n resolveContextNode(context: Context<any>) {\n return this.stack.find(node => node.type === context);\n }\n}\n\nexport const reconciler = new class {\n\n /** @internal */\n _registry = new WeakMap<any, string>();\n\n /** @internal */\n _currentHookState?: HookState;\n\n get currentHookState() {\n return this._currentHookState;\n }\n};\n"],"names":[],"mappings":";;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AASM,MAAgB,gBAAiB,SAAQ,iBAAiB,CAAA;AAE/D;AAED;;;;;;AAMG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,iBAAiB,EAAE,iBAAiB,GAAG,EAAE,EAAA,GAGnE,EAAE,KAAI;AACR,IAAA,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAyB,KAAK,cAAc,CAAC,QAAQ,EAAE,EAAE,QAAQ,EAAE,CAAC;IACtG,MAAM,eAAgB,SAAQ,gBAAgB,CAAA;AAC5C,QAAA,WAAW,CAAC,KAAqB,EAAA;AAC/B,YAAA,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;gBAAE,OAAO,CAAC,CAAC,iBAAiB;YACjD,OAAO,KAAK,CAAC,IAAI,KAAK,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,CAAC,CAAC;QAC1F;AACD;IACD,OAAO;AACL,QAAA,MAAM,EAAE,CAAC,EAAE,QAAQ,EAAyB,KAAK,cAAc,CAAC,eAAe,EAAE,EAAE,QAAQ,EAAE,CAAC;AAC9F,QAAA,KAAK,EAAE,cAAc;KACtB;AACH;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAKO,MAAM,SAAS,GAAG,CAAI,GAAG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Aa,CAAC,EAAE,KAAK;IAC5E;AACD;AAED,MAAM,SAAS,CAAA;AAEb,IAAA,IAAI;AACJ,IAAA,KAAK;AACL,IAAA,QAAQ;IAER,KAAK,GAAiB,EAAE;IACxB,KAAK,GAAwB,EAAE;AAC/B,IAAA,OAAO,GAAe,IAAI,GAAG,EAAE;AAE/B,IAAA,WAAA,CACE,IAAW,EACX,KAAoB,EACpB,QAAwB,EAAA;AAExB,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI;AAChB,QAAA,IAAI,CAAC,KAAK,GAAG,KAAK;AAClB,QAAA,IAAI,CAAC,QAAQ,GAAG,QAAQ;IAC1B;AAEA,IAAA,IAAI,SAAS,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM;IACzB;AAEA,IAAA,IAAI,KAAK,GAAA;QACP,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK;AACpC,QAAA,OAAO,KAAK;IACd;IAEA,QAAQ,GAAA;QACN,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;IAChC;AAEA,IAAA,kBAAkB,CAAC,OAAqB,EAAA;AACtC,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,CAAC;IACvD;AACD;AAEM,MAAM,UAAU,GAAG,IAAI,MAAA;;AAG5B,IAAA,SAAS,GAAG,IAAI,OAAO,EAAe;;AAGtC,IAAA,iBAAiB;AAEjB,IAAA,IAAI,gBAAgB,GAAA;QAClB,OAAO,IAAI,CAAC,iBAAiB;IAC/B;;;;;"}
@@ -32,11 +32,11 @@ declare class VNode {
32
32
  get children(): (string | VNode)[];
33
33
  get error(): any;
34
34
  get stack(): Generator<VNode, void, unknown>;
35
- private _children_updated;
35
+ private _remount_parent;
36
36
  private _resolve_props;
37
37
  private _resolve_children;
38
38
  private _resolve_error_boundary;
39
39
  }
40
40
 
41
41
  export { VNode as V, _Renderer as _ };
42
- //# sourceMappingURL=index-Dxb4qbGJ.d.ts.map
42
+ //# sourceMappingURL=index-C0U1mahm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C0U1mahm.d.ts","sources":["../../src/core/renderer.ts","../../src/core/reconciler/index.ts"],"sourcesContent":["//\n// renderer.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { UpdateManager, VNode } from './reconciler';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { equalDeps } from './reconciler/utils';\nimport { _ParentComponent } from './components/pairs';\nimport nextick from 'nextick';\n\nexport abstract class _Renderer<T> {\n\n protected abstract _beforeUpdate(): void;\n\n protected abstract _afterUpdate(): void;\n\n protected abstract _createElement(node: VNode): T;\n\n protected abstract _updateElement(node: VNode, element: T, children: (T | string)[], force?: boolean): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n abstract get _server(): boolean;\n\n private _renderStorage = new Map<any, any>();\n\n get renderStorage() {\n return this._renderStorage;\n }\n\n private async _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n type MountState = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const elements = new Map<VNode, T>();\n const mountState = new Map<VNode, MountState[]>();\n\n const childrenDeep = function* (node: VNode): Generator<VNode> {\n for (const child of node.children) {\n if (child instanceof VNode) {\n yield child;\n yield* childrenDeep(child);\n }\n }\n };\n\n const nativeChildren = (node: VNode) => {\n const children = function* (\n node: VNode,\n filter?: (x: string | VNode) => boolean\n ): Generator<T | string> {\n for (const child of node.children) {\n if (_.isString(child)) {\n if (filter && !filter(child)) continue;\n yield child;\n } else {\n const element = elements.get(child);\n if (!filter || filter(child)) {\n if (element instanceof _ParentComponent) {\n yield* children(child, x => element.isChildNode(x));\n } else if (element) {\n yield element;\n } else {\n yield* children(child);\n }\n } else if (!element) {\n yield* children(child, filter);\n }\n }\n }\n }\n const element = elements.get(node);\n if (element instanceof _ParentComponent) {\n return children(node, x => element.isChildNode(x));\n } else {\n return children(node);\n }\n }\n\n const unmount = (nodes: Iterable<VNode>) => {\n for (const node of nodes) {\n for (const context of node._context) {\n context._content_listeners.delete(node);\n }\n const element = elements.get(node);\n if (element) {\n const state = mountState.get(node) ?? [];\n for (const { unmount } of state) {\n if (unmount) {\n try {\n unmount();\n } catch (e) {\n console.error(e);\n }\n }\n }\n try {\n this._destroyElement(node, element);\n } catch (e) {\n console.error(e);\n }\n elements.delete(node);\n }\n unmount(_.filter(node.children, x => x instanceof VNode));\n }\n };\n\n const refresh = async (event: UpdateManager, force: boolean) => {\n\n try {\n this._beforeUpdate();\n } catch (e) {\n console.error(e);\n }\n\n for (const idx in event._dirty) {\n const nodes = event._dirty[idx];\n for (const node of nodes || []) {\n await node._render(event, this);\n nodes.delete(node);\n }\n }\n\n for (const nodes of event._remount.toReversed()) {\n for (const node of nodes || []) {\n if (_.isFunction(node.type) && node.type.prototype instanceof _ParentComponent) {\n let elem: any = elements?.get(node);\n if (!elem) {\n const Component = node.type as any;\n elem = new Component();\n }\n elements.set(node, elem);\n } else {\n if (_.isString(node.type) || node.type?.prototype instanceof NativeElementType) {\n const element = elements.get(node) ?? this._createElement(node);\n elements.set(node, element);\n try {\n this._updateElement(node, element, nativeChildren(node).toArray(), force);\n } catch (e) {\n console.error(e);\n }\n }\n const state: MountState[] = [];\n const prevState = mountState.get(node) ?? [];\n const curState = node._state ?? [];\n for (const i of _.range(Math.max(prevState.length, curState.length))) {\n const unmount = prevState[i]?.unmount;\n const changed = prevState[i]?.hook !== curState[i]?.hook || !equalDeps(prevState[i].deps, curState[i]?.deps);\n if (unmount && changed) {\n try {\n unmount();\n } catch (e) {\n console.error(e);\n }\n }\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : (() => {\n try {\n return curState[i].mount?.();\n } catch (e) {\n console.error(e);\n }\n })(),\n });\n }\n mountState.set(node, state);\n }\n }\n }\n event._remount = [];\n\n unmount(event._removed);\n event._removed.clear();\n\n if (root) this._updateElement(\n rootNode, root,\n _.castArray(elements.get(rootNode) ?? nativeChildren(rootNode).toArray()),\n force,\n );\n\n try {\n this._afterUpdate();\n } catch (e) {\n console.error(e);\n }\n };\n\n let destroyed = false;\n let updating = false;\n const event = new UpdateManager(async (event, force) => {\n if (updating) return;\n updating = true;\n if (event.isDirty) {\n await refresh(event, force);\n }\n while (event.isDirty) {\n if (destroyed) return;\n await new Promise<void>(resolve => nextick(resolve));\n await refresh(event, force);\n }\n updating = false;\n });\n\n const rootNode = new VNode(component);\n event._setDirty(rootNode);\n await event.refresh(true);\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(rootNode) ?? nativeChildren(rootNode).toArray());\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n destroyed = true;\n if (root) this._updateElement(rootNode, root, [], true);\n unmount(elements.keys());\n },\n };\n }\n\n createRoot(root?: T) {\n let state: Awaited<ReturnType<typeof this._createRoot>> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: async (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = await this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\n };\n }\n}","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2025 O2ter Limited. All rights reserved.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n//\n\nimport _ from 'lodash';\nimport { ComponentNode, NativeElementType } from '../types/component';\nimport { uniqueId } from '../utils';\nimport { Context, isContext } from '../hooks/context';\nimport { PropsProvider } from '../types/props';\nimport { ErrorBoundary } from '../types/error';\nimport { _Renderer } from '../renderer';\nimport { myersSync } from 'myers.js';\nimport { equalDeps, equalProps } from './utils';\nimport { PropsType } from '../types/runtime';\n\ntype VNodeState = {\n hook: string;\n deps: any;\n data?: any;\n mount?: () => () => void;\n};\n\nexport class UpdateManager {\n\n /** @internal */\n _dirty: Set<VNode>[] = [];\n\n /** @internal */\n _remount: Set<VNode>[] = [];\n\n /** @internal */\n _removed: Set<VNode> = new Set();\n\n /** @internal */\n private _refresh: (x: UpdateManager, force: boolean) => Promise<void>;\n\n constructor(refresh: (x: UpdateManager, force: boolean) => Promise<void>) {\n this._refresh = refresh;\n }\n\n async refresh(force: boolean = false) {\n await this._refresh(this, force);\n }\n\n _setDirty(node: VNode) {\n if (!this._dirty[node._level]) this._dirty[node._level] = new Set();\n this._dirty[node._level].add(node);\n }\n\n setDirty(node: VNode) {\n this._setDirty(node);\n this.refresh();\n }\n\n remount(node: VNode) {\n if (!this._remount[node._level]) this._remount[node._level] = new Set();\n this._remount[node._level].add(node);\n }\n\n removed(node: VNode) {\n this._removed.add(node);\n }\n\n get isDirty() {\n return this._dirty.some(x => !!x.size) || this._remount.some(x => !!x.size);\n }\n}\n\nexport class VNode {\n\n /** @internal */\n _component: ComponentNode;\n\n private _id = uniqueId();\n\n private _props: PropsType = {};\n private _error?: any;\n private _children: (VNode | string)[] = [];\n\n /** @internal */\n _state?: VNodeState[];\n\n /** @internal */\n _content_listeners: Set<VNode> = new Set();\n private _content_value?: any;\n\n /** @internal */\n _context: Set<VNode> = new Set();\n\n /** @internal */\n _parent?: VNode;\n\n /** @internal */\n _nativeParent?: VNode;\n\n /** @internal */\n _level = 0;\n\n /** @internal */\n constructor(component: ComponentNode) {\n this._component = component;\n }\n\n get id() {\n return this._id;\n }\n\n get type() {\n return this._component.type;\n }\n\n get props() {\n return this._props;\n }\n\n get key() {\n return this._component.key;\n }\n\n get children() {\n return this._children;\n }\n\n get error() {\n return this._error;\n }\n\n get stack() {\n let node: VNode | undefined = this;\n return (function* () {\n while (node) {\n yield node;\n node = node._parent;\n }\n })();\n }\n\n /** @internal */\n async _render(event: UpdateManager, renderer: _Renderer<any>) {\n try {\n const { type } = this._component;\n const props = this._resolve_props();\n let children: (VNode | string)[];\n let native = this._nativeParent;\n if (_.isString(type) || type?.prototype instanceof NativeElementType) {\n children = this._resolve_children(props.children, event);\n event.remount(this);\n native = this;\n } else if (isContext(type)) {\n const { value } = props;\n if (!equalDeps(this._content_value, value)) {\n for (const node of this._content_listeners) {\n event.setDirty(node);\n }\n }\n this._content_value = value;\n children = this._resolve_children(type(props as any), event);\n } else if (_.isFunction(type)) {\n while (true) {\n const state = new HookState(this, event, renderer);\n reconciler._currentHookState = state;\n const rendered = type(props);\n for (const node of this._context.difference(state.context)) {\n node._content_listeners.delete(this);\n }\n for (const node of state.context.difference(this._context)) {\n node._content_listeners.add(this);\n }\n this._state = state.state;\n this._context = state.context;\n if (_.isEmpty(state.tasks)) {\n children = this._resolve_children(rendered, event);\n break;\n }\n await Promise.all(state.tasks);\n }\n event.remount(this);\n } else {\n throw Error(`Invalid node type ${type}`);\n }\n const diff = myersSync(this._children, children, {\n compare: (lhs, rhs) => {\n if (_.isString(lhs) && _.isString(rhs)) return lhs === rhs;\n if (lhs instanceof VNode && rhs instanceof VNode) return lhs._component.equalType(rhs._component);\n return false;\n },\n });\n this._props = props;\n this._children = _.flatMap(diff, x => x.equivalent ?? x.insert ?? []);\n this._error = undefined;\n for (const [lhs, rhs] of _.zip(this._children, children)) {\n if (!(lhs instanceof VNode) || !(rhs instanceof VNode)) continue;\n if (lhs === rhs) {\n event.setDirty(lhs);\n } else {\n if (!equalProps(lhs._component.props, rhs._component.props)) event.setDirty(lhs);\n lhs._component = rhs._component;\n }\n lhs._parent = this;\n lhs._nativeParent = native;\n lhs._level = this._level + 1;\n }\n for (const removed of _.flatMap(diff, x => x.remove ?? [])) {\n if (removed instanceof VNode) {\n event.removed(removed);\n }\n }\n if (_.some(diff, x => !x.equivalent)) {\n this._remount_parent(event);\n }\n } catch (error) {\n this._children = [];\n this._error = error;\n (async () => {\n try {\n const { onError, silent } = this._resolve_error_boundary() ?? {};\n if (!silent) console.error(error);\n if (_.isFunction(onError)) await onError(error, this._component, this.stack.map(x => x._component));\n } catch (e) {\n console.error(e);\n }\n })();\n event.remount(this);\n this._remount_parent(event);\n } finally {\n reconciler._currentHookState = undefined;\n }\n }\n\n private _remount_parent(event: UpdateManager) {\n const node = this._nativeParent;\n if (node && node !== this) event.remount(node);\n }\n\n private _resolve_props() {\n const self = this;\n const { type, props: _props } = this._component;\n if (type === PropsProvider) return _props;\n let props = { ..._props };\n for (const node of this.stack.drop(1)) {\n if (node.type === PropsProvider) {\n props = node.props.callback({ type, props });\n }\n }\n return _.mapValues(props, (v, k) => _.isFunction(v) ? function (this: any, ...args: any[]) {\n const current = self._component.props[k];\n return _.isFunction(current) ? current.call(this, ...args) : v.call(this, ...args);\n } : v);\n }\n\n private _resolve_children(child: any, event: UpdateManager): (VNode | string)[] {\n if (_.isBoolean(child) || _.isNil(child)) return [];\n if (_.isString(child)) return [child];\n if (_.isNumber(child)) return [`${child}`];\n if (child instanceof ComponentNode) return [new VNode(child)];\n if (_.isArrayLikeObject(child)) return _.flatMap(child, x => this._resolve_children(x, event));\n if (typeof child[Symbol.iterator] === 'function') return _.flatMap([...child], x => this._resolve_children(x, event));\n throw Error(`${child} are not valid as a child.`);\n }\n\n private _resolve_error_boundary() {\n return this.stack.drop(1).find(node => node.type === ErrorBoundary)?.props;\n }\n}\n\nclass HookState {\n\n node: VNode;\n event: UpdateManager;\n renderer: _Renderer<any>;\n\n state: VNodeState[] = [];\n tasks: PromiseLike<void>[] = [];\n context: Set<VNode> = new Set();\n\n constructor(\n node: VNode,\n event: UpdateManager,\n renderer: _Renderer<any>,\n ) {\n this.node = node;\n this.event = event;\n this.renderer = renderer;\n }\n\n get prevState() {\n return this.node._state;\n }\n\n get stack() {\n const [, ...stack] = this.node.stack;\n return stack;\n }\n\n setDirty() {\n this.event.setDirty(this.node);\n }\n\n resolveContextNode(context: Context<any>) {\n return this.stack.find(node => node.type === context);\n }\n}\n\nexport const reconciler = new class {\n\n /** @internal */\n _registry = new WeakMap<any, string>();\n\n /** @internal */\n _currentHookState?: HookState;\n\n get currentHookState() {\n return this._currentHookState;\n }\n};\n"],"names":["_____.ElementType"],"mappings":";;AAEO,uBAAA,SAAA;AACP;AACA;AACA,4CAAA,KAAA;AACA,4CAAA,KAAA;AACA,6CAAA,KAAA;AACA;AACA;AACA,yBAAA,GAAA;AACA;AACA;AACA;AACA,2BAAA,aAAA;AACA;AACA,cAAA,OAAA;AACA;AACA;AACA;;ACAO,cAAA,KAAA;AACP;AACA;AACA;AACA;AACA;AACA;AACA,uBAAA,iBAAA,GAA2CA,YAAe;AAC1D,iBAAA,SAAA;AACA;AACA,8BAAA,KAAA;AACA;AACA,iBAAA,SAAA,CAAA,KAAA;AACA;AACA;AACA;AACA;AACA;;;;"}
@@ -498,7 +498,7 @@ class VNode {
498
498
  }
499
499
  }
500
500
  if (_.some(diff, x => !x.equivalent)) {
501
- this._children_updated(event);
501
+ this._remount_parent(event);
502
502
  }
503
503
  }
504
504
  catch (error) {
@@ -516,13 +516,14 @@ class VNode {
516
516
  console.error(e);
517
517
  }
518
518
  })();
519
- this._children_updated(event);
519
+ event.remount(this);
520
+ this._remount_parent(event);
520
521
  }
521
522
  finally {
522
523
  reconciler._currentHookState = undefined;
523
524
  }
524
525
  }
525
- _children_updated(event) {
526
+ _remount_parent(event) {
526
527
  const node = this._nativeParent;
527
528
  if (node && node !== this)
528
529
  event.remount(node);
@@ -610,4 +611,4 @@ exports.mergeRefs = mergeRefs;
610
611
  exports.reconciler = reconciler;
611
612
  exports.uniqueId = uniqueId;
612
613
  exports.useContext = useContext;
613
- //# sourceMappingURL=index-B3K_At0T.js.map
614
+ //# sourceMappingURL=index-CMpwCIOl.js.map