frosty 0.0.158 → 0.0.159

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 (108) hide show
  1. package/dist/_native.d.mts +3 -3
  2. package/dist/_native.d.mts.map +1 -1
  3. package/dist/_native.d.ts +3 -3
  4. package/dist/_native.d.ts.map +1 -1
  5. package/dist/_native.js +5 -5
  6. package/dist/_native.js.map +1 -1
  7. package/dist/_native.mjs +4 -4
  8. package/dist/dom.d.mts +3 -3
  9. package/dist/dom.d.mts.map +1 -1
  10. package/dist/dom.d.ts +3 -3
  11. package/dist/dom.d.ts.map +1 -1
  12. package/dist/dom.js +4 -4
  13. package/dist/dom.mjs +4 -4
  14. package/dist/i18n.d.mts.map +1 -1
  15. package/dist/i18n.d.ts.map +1 -1
  16. package/dist/i18n.js +3 -3
  17. package/dist/i18n.mjs +3 -3
  18. package/dist/index.d.mts +4 -4
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.d.ts +4 -4
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +7 -7
  23. package/dist/index.mjs +7 -7
  24. package/dist/internals/{callback-DEKCuARB.mjs → callback-8cBbAwKI.mjs} +3 -3
  25. package/dist/internals/{callback-DEKCuARB.mjs.map → callback-8cBbAwKI.mjs.map} +1 -1
  26. package/dist/internals/{callback-DVD1MTA9.js → callback-l1HafY8p.js} +2 -2
  27. package/dist/internals/{callback-DVD1MTA9.js.map → callback-l1HafY8p.js.map} +1 -1
  28. package/dist/internals/{common-BMp06ZN_.d.mts → common-uQrs1G5-.d.mts} +2 -2
  29. package/dist/internals/common-uQrs1G5-.d.mts.map +1 -0
  30. package/dist/internals/{common-BMp06ZN_.d.ts → common-uQrs1G5-.d.ts} +2 -2
  31. package/dist/internals/common-uQrs1G5-.d.ts.map +1 -0
  32. package/dist/internals/{form-CC8A5nkh.js → form-CgyPc937.js} +3 -3
  33. package/dist/internals/{form-CC8A5nkh.js.map → form-CgyPc937.js.map} +1 -1
  34. package/dist/internals/{form-Cee86QUZ.mjs → form-DAr0GAYA.mjs} +3 -3
  35. package/dist/internals/{form-Cee86QUZ.mjs.map → form-DAr0GAYA.mjs.map} +1 -1
  36. package/dist/internals/{runtime-Bpq-U9sI.mjs → fragment-DnpshXqL.mjs} +32 -32
  37. package/dist/internals/fragment-DnpshXqL.mjs.map +1 -0
  38. package/dist/internals/{fragment-Dhp_GJso.d.mts → fragment-DuyNMgL3.d.mts} +2 -2
  39. package/dist/internals/fragment-DuyNMgL3.d.mts.map +1 -0
  40. package/dist/internals/{fragment-C8nMwgq0.d.ts → fragment-HkiF2xeJ.d.ts} +2 -2
  41. package/dist/internals/fragment-HkiF2xeJ.d.ts.map +1 -0
  42. package/dist/internals/{runtime-CeVOFcK_.js → fragment-JOzjl1Lc.js} +32 -32
  43. package/dist/internals/fragment-JOzjl1Lc.js.map +1 -0
  44. package/dist/internals/{index-Bvwj3lIq.js → index-BnS7TiLo.js} +52 -52
  45. package/dist/internals/{index-Bvwj3lIq.js.map → index-BnS7TiLo.js.map} +1 -1
  46. package/dist/internals/{index-CUCYNdr9.d.ts → index-CdMvWgIS.d.ts} +3 -3
  47. package/dist/internals/index-CdMvWgIS.d.ts.map +1 -0
  48. package/dist/internals/{index-CODWK-gF.mjs → index-CoURz_S4.mjs} +50 -50
  49. package/dist/internals/{index-CODWK-gF.mjs.map → index-CoURz_S4.mjs.map} +1 -1
  50. package/dist/internals/{index-CgIOFVc1.d.mts → index-D_01nFU0.d.mts} +3 -3
  51. package/dist/internals/index-D_01nFU0.d.mts.map +1 -0
  52. package/dist/internals/{renderer-C5NIsxDg.js → renderer-CRX8gzMA.js} +5 -5
  53. package/dist/internals/{renderer-C5NIsxDg.js.map → renderer-CRX8gzMA.js.map} +1 -1
  54. package/dist/internals/{renderer-DaX4zUo8.mjs → renderer-CoINnhjj.mjs} +3 -3
  55. package/dist/internals/{renderer-DaX4zUo8.mjs.map → renderer-CoINnhjj.mjs.map} +1 -1
  56. package/dist/internals/{renderer-DR_CVQzd.js → renderer-CoiNiH-1.js} +4 -4
  57. package/dist/internals/{renderer-DR_CVQzd.js.map → renderer-CoiNiH-1.js.map} +1 -1
  58. package/dist/internals/{renderer-BFv842Qz.d.ts → renderer-DWRFEffh.d.ts} +3 -3
  59. package/dist/internals/renderer-DWRFEffh.d.ts.map +1 -0
  60. package/dist/internals/{renderer-BvM6i6Cl.mjs → renderer-DXQYsBvG.mjs} +4 -4
  61. package/dist/internals/{renderer-BvM6i6Cl.mjs.map → renderer-DXQYsBvG.mjs.map} +1 -1
  62. package/dist/internals/{renderer-5Al4VWW1.d.mts → renderer-Qq2yni7e.d.mts} +3 -3
  63. package/dist/internals/renderer-Qq2yni7e.d.mts.map +1 -0
  64. package/dist/internals/{utils-BGg0L3IY.d.ts → utils-DeZcxzm0.d.ts} +2 -2
  65. package/dist/internals/utils-DeZcxzm0.d.ts.map +1 -0
  66. package/dist/internals/{utils-qS8tRYZD.d.mts → utils-LlN8w8CJ.d.mts} +2 -2
  67. package/dist/internals/utils-LlN8w8CJ.d.mts.map +1 -0
  68. package/dist/jsx-dev-runtime.d.mts +2 -2
  69. package/dist/jsx-dev-runtime.d.mts.map +1 -1
  70. package/dist/jsx-dev-runtime.d.ts +2 -2
  71. package/dist/jsx-dev-runtime.d.ts.map +1 -1
  72. package/dist/jsx-dev-runtime.js +2 -2
  73. package/dist/jsx-dev-runtime.mjs +1 -1
  74. package/dist/jsx-runtime.d.mts +2 -2
  75. package/dist/jsx-runtime.d.mts.map +1 -1
  76. package/dist/jsx-runtime.d.ts +2 -2
  77. package/dist/jsx-runtime.d.ts.map +1 -1
  78. package/dist/jsx-runtime.js +4 -4
  79. package/dist/jsx-runtime.js.map +1 -1
  80. package/dist/jsx-runtime.mjs +2 -2
  81. package/dist/server-dom.d.mts +3 -3
  82. package/dist/server-dom.d.mts.map +1 -1
  83. package/dist/server-dom.d.ts +3 -3
  84. package/dist/server-dom.d.ts.map +1 -1
  85. package/dist/server-dom.js +4 -4
  86. package/dist/server-dom.mjs +4 -4
  87. package/dist/web.d.mts +3 -3
  88. package/dist/web.d.mts.map +1 -1
  89. package/dist/web.d.ts +3 -3
  90. package/dist/web.d.ts.map +1 -1
  91. package/dist/web.js +6 -6
  92. package/dist/web.mjs +7 -7
  93. package/package.json +12 -12
  94. package/packages/frosty-cli/package.json +13 -13
  95. package/packages/frosty-cli/webpack.mjs +5 -5
  96. package/packages/frosty-cli/yarn.lock +1181 -1404
  97. package/dist/internals/common-BMp06ZN_.d.mts.map +0 -1
  98. package/dist/internals/common-BMp06ZN_.d.ts.map +0 -1
  99. package/dist/internals/fragment-C8nMwgq0.d.ts.map +0 -1
  100. package/dist/internals/fragment-Dhp_GJso.d.mts.map +0 -1
  101. package/dist/internals/index-CUCYNdr9.d.ts.map +0 -1
  102. package/dist/internals/index-CgIOFVc1.d.mts.map +0 -1
  103. package/dist/internals/renderer-5Al4VWW1.d.mts.map +0 -1
  104. package/dist/internals/renderer-BFv842Qz.d.ts.map +0 -1
  105. package/dist/internals/runtime-Bpq-U9sI.mjs.map +0 -1
  106. package/dist/internals/runtime-CeVOFcK_.js.map +0 -1
  107. package/dist/internals/utils-BGg0L3IY.d.ts.map +0 -1
  108. package/dist/internals/utils-qS8tRYZD.d.mts.map +0 -1
@@ -1,36 +1,5 @@
1
1
  'use strict';
2
2
 
3
- //
4
- // fragment.ts
5
- //
6
- // The MIT License
7
- // Copyright (c) 2021 - 2026 O2ter Limited. All rights reserved.
8
- //
9
- // Permission is hereby granted, free of charge, to any person obtaining a copy
10
- // of this software and associated documentation files (the "Software"), to deal
11
- // in the Software without restriction, including without limitation the rights
12
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
- // copies of the Software, and to permit persons to whom the Software is
14
- // furnished to do so, subject to the following conditions:
15
- //
16
- // The above copyright notice and this permission notice shall be included in
17
- // all copies or substantial portions of the Software.
18
- //
19
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25
- // THE SOFTWARE.
26
- //
27
- /**
28
- * A component that renders its children without adding extra nodes to the DOM.
29
- */
30
- const Fragment = ({ children }) => {
31
- return children;
32
- };
33
-
34
3
  //
35
4
  // index.ts
36
5
  //
@@ -113,9 +82,40 @@ const _createElement = (type, props) => {
113
82
  };
114
83
  const createElement = (type, props, ...children) => _createElement(type, { ...props ?? {}, children });
115
84
 
85
+ //
86
+ // fragment.ts
87
+ //
88
+ // The MIT License
89
+ // Copyright (c) 2021 - 2026 O2ter Limited. All rights reserved.
90
+ //
91
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
92
+ // of this software and associated documentation files (the "Software"), to deal
93
+ // in the Software without restriction, including without limitation the rights
94
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
95
+ // copies of the Software, and to permit persons to whom the Software is
96
+ // furnished to do so, subject to the following conditions:
97
+ //
98
+ // The above copyright notice and this permission notice shall be included in
99
+ // all copies or substantial portions of the Software.
100
+ //
101
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
102
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
103
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
104
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
105
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
106
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
107
+ // THE SOFTWARE.
108
+ //
109
+ /**
110
+ * A component that renders its children without adding extra nodes to the DOM.
111
+ */
112
+ const Fragment = ({ children }) => {
113
+ return children;
114
+ };
115
+
116
116
  exports.ComponentNode = ComponentNode;
117
117
  exports.Fragment = Fragment;
118
118
  exports.NativeElementType = NativeElementType;
119
119
  exports._createElement = _createElement;
120
120
  exports.createElement = createElement;
121
- //# sourceMappingURL=runtime-CeVOFcK_.js.map
121
+ //# sourceMappingURL=fragment-JOzjl1Lc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fragment-JOzjl1Lc.js","sources":["../../../src/core/types/component.ts","../../../src/core/types/runtime.ts","../../../src/core/components/fragment.ts"],"sourcesContent":["//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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 { _ElementType, PropsType } from './runtime';\n\nexport abstract class NativeElementType {\n constructor(...args: any[]) { };\n}\n\nexport class ComponentNode {\n\n #type: _ElementType | typeof NativeElementType;\n #props: PropsType;\n #key?: string | number | bigint | null;\n\n /** @internal */\n constructor(\n type: _ElementType | typeof NativeElementType,\n props: PropsType,\n key?: string | number\n ) {\n this.#type = type;\n this.#props = props;\n this.#key = key;\n }\n\n get type() {\n return this.#type;\n }\n\n get props() {\n return this.#props;\n }\n\n get key() {\n return this.#key;\n }\n\n equalType(other: ComponentNode) {\n return this.type === other.type && this.key === other.key;\n }\n}\n","//\n// basic.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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 { MergeObject, PickType, WritableKeys } from '@o2ter/utils-js';\nimport { ComponentType, ElementNode, PropsWithChildren, RefAttribute } from './common';\nimport { ClassName, StyleProp } from './style';\nimport { CSSProperties, ExtendedCSSProperties } from '../web/styles/css';\nimport { globalEvents } from '../web/event';\nimport { ComponentNode, NativeElementType } from './component';\nimport { _HTMLElementTagNameMap, _MathMLElementTagNameMap, _SVGElementTagNameMap } from '../web/props';\n\nexport type _ElementType = string | ComponentType<any>;\n\nexport type _IntrinsicAttributes = {\n key?: string | number | bigint | null;\n};\n\nexport type PropsType = Record<string, any>;\n\ntype EventHandler<E extends Event, C, T = EventTarget> = (this: C | void, event: E & {\n currentTarget: C;\n target: T;\n }) => void;\ntype EventMap = {\n [ev in keyof typeof globalEvents]: ev extends `on${infer x}`\n ? Lowercase<x> extends keyof GlobalEventHandlersEventMap ? GlobalEventHandlersEventMap[Lowercase<x>] : Event\n : never;\n};\n\ntype _PropsOfInstance<Instance> = Omit<\n PickType<{\n [k in WritableKeys<Instance>]: Instance[k];\n }, boolean | number | string | null | undefined>,\n 'className' | 'style' | 'innerText' | 'outerText' | 'outerHTML' | 'nodeValue'\n> & {\n [x in keyof EventMap]?: EventHandler<EventMap[x], Instance>;\n} & {\n [x in keyof EventMap as `${x}Capture`]?: EventHandler<EventMap[x], Instance>;\n};\n\ntype Combine<T, R> = Omit<T, keyof R> & R;\n\ntype _ElementProps<ElementMap extends { [x: string]: { type: any; props?: any; } }> = {\n [x in keyof ElementMap]: PropsWithChildren<\n Partial<\n _IntrinsicAttributes\n & RefAttribute<ElementMap[x]['type'] | null | undefined>\n & {\n className?: ClassName;\n style?: StyleProp<ExtendedCSSProperties>;\n inlineStyle?: CSSProperties;\n }\n & Combine<ElementMap[x]['props'], _PropsOfInstance<ElementMap[x]['type']>>\n >\n >\n};\n\nexport type _IntrinsicElements = MergeObject<\n | _ElementProps<_HTMLElementTagNameMap>\n | _ElementProps<_SVGElementTagNameMap>\n | _ElementProps<_MathMLElementTagNameMap>\n> & { [x: string]: any; };\n\nexport const _createElement = (\n type: _ElementType | typeof NativeElementType,\n props: PropsType\n) => {\n const { key, ..._props } = props;\n return new ComponentNode(type, _props, key);\n}\n\nexport const createElement = (\n type: _ElementType,\n props?: PropsType | null,\n ...children: ElementNode[]\n) => _createElement(type, { ...props ?? {}, children });\n","//\n// fragment.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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 '../types/common';\n\n/**\n * A component that renders its children without adding extra nodes to the DOM.\n */\nexport const Fragment: ComponentType<PropsWithChildren<{}>> = ({ children }) => {\n return children;\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;MAKsB,iBAAiB,CAAA;IACrC,WAAA,CAAY,GAAG,IAAW,EAAA,EAAI;;AAC/B;MAEY,aAAa,CAAA;AAExB,IAAA,KAAK;AACL,IAAA,MAAM;AACN,IAAA,IAAI;;AAGJ,IAAA,WAAA,CACE,IAA6C,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
2
2
 
3
3
  var _ = require('lodash');
4
- var runtime = require('./runtime-CeVOFcK_.js');
4
+ var fragment = require('./fragment-JOzjl1Lc.js');
5
5
  var myers_js = require('myers.js');
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
9
9
  var ___default = /*#__PURE__*/_interopDefault(_);
10
10
 
11
- //
12
- // pairs.ts
13
- //
14
- // The MIT License
15
- // Copyright (c) 2021 - 2026 O2ter Limited. All rights reserved.
16
- //
17
- // Permission is hereby granted, free of charge, to any person obtaining a copy
18
- // of this software and associated documentation files (the "Software"), to deal
19
- // in the Software without restriction, including without limitation the rights
20
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
21
- // copies of the Software, and to permit persons to whom the Software is
22
- // furnished to do so, subject to the following conditions:
23
- //
24
- // The above copyright notice and this permission notice shall be included in
25
- // all copies or substantial portions of the Software.
26
- //
27
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
28
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
29
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
30
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
31
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
32
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
33
- // THE SOFTWARE.
34
- //
35
- class _ParentComponent extends runtime.NativeElementType {
36
- }
37
- /**
38
- * Create a pair of Parent and Child components.
39
- *
40
- * @param allowTextChildren - Whether to allow text children in the Parent component.
41
- * @param allowedChildTypes - An array of additional allowed child component types.
42
- * @returns An object containing the Parent and Child components.
43
- */
44
- const createPairs = ({ allowTextChildren, allowedChildTypes = [] } = {}) => {
45
- const ChildComponent = ({ children }) => runtime._createElement(runtime.Fragment, { children });
46
- class ParentComponent extends _ParentComponent {
47
- isChildNode(child) {
48
- if (___default.default.isString(child))
49
- return !!allowTextChildren;
50
- return child.type === ChildComponent || ___default.default.some(allowedChildTypes, x => child.type === x);
51
- }
52
- }
53
- return {
54
- Parent: ({ children }) => runtime._createElement(ParentComponent, { children }),
55
- Child: ChildComponent,
56
- };
57
- };
58
-
59
11
  //
60
12
  // utils.ts
61
13
  //
@@ -322,6 +274,54 @@ const equalProps = (lhs, rhs) => {
322
274
  return true;
323
275
  };
324
276
 
277
+ //
278
+ // pairs.ts
279
+ //
280
+ // The MIT License
281
+ // Copyright (c) 2021 - 2026 O2ter Limited. All rights reserved.
282
+ //
283
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
284
+ // of this software and associated documentation files (the "Software"), to deal
285
+ // in the Software without restriction, including without limitation the rights
286
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
287
+ // copies of the Software, and to permit persons to whom the Software is
288
+ // furnished to do so, subject to the following conditions:
289
+ //
290
+ // The above copyright notice and this permission notice shall be included in
291
+ // all copies or substantial portions of the Software.
292
+ //
293
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
294
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
295
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
296
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
297
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
298
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
299
+ // THE SOFTWARE.
300
+ //
301
+ class _ParentComponent extends fragment.NativeElementType {
302
+ }
303
+ /**
304
+ * Create a pair of Parent and Child components.
305
+ *
306
+ * @param allowTextChildren - Whether to allow text children in the Parent component.
307
+ * @param allowedChildTypes - An array of additional allowed child component types.
308
+ * @returns An object containing the Parent and Child components.
309
+ */
310
+ const createPairs = ({ allowTextChildren, allowedChildTypes = [] } = {}) => {
311
+ const ChildComponent = ({ children }) => fragment._createElement(fragment.Fragment, { children });
312
+ class ParentComponent extends _ParentComponent {
313
+ isChildNode(child) {
314
+ if (___default.default.isString(child))
315
+ return !!allowTextChildren;
316
+ return child.type === ChildComponent || ___default.default.some(allowedChildTypes, x => child.type === x);
317
+ }
318
+ }
319
+ return {
320
+ Parent: ({ children }) => fragment._createElement(ParentComponent, { children }),
321
+ Child: ChildComponent,
322
+ };
323
+ };
324
+
325
325
  //
326
326
  // index.ts
327
327
  //
@@ -453,7 +453,7 @@ class VNode {
453
453
  return [child];
454
454
  if (___default.default.isNumber(child) || typeof child === 'bigint')
455
455
  return [`${child}`];
456
- if (child instanceof runtime.ComponentNode)
456
+ if (child instanceof fragment.ComponentNode)
457
457
  return [new VNode(child)];
458
458
  if (___default.default.isArrayLikeObject(child))
459
459
  return ___default.default.flatMap(child, x => _resolve_children(x));
@@ -466,7 +466,7 @@ class VNode {
466
466
  this.#props = _resolve_props();
467
467
  let children;
468
468
  let native = this.#nativeParent;
469
- if (___default.default.isString(type) || type?.prototype instanceof runtime.NativeElementType) {
469
+ if (___default.default.isString(type) || type?.prototype instanceof fragment.NativeElementType) {
470
470
  children = _resolve_children(this.#props.children);
471
471
  if (___default.default.isString(type) || !(type?.prototype instanceof _ParentComponent)) {
472
472
  native = this;
@@ -624,4 +624,4 @@ exports.mergeRefs = mergeRefs;
624
624
  exports.reconciler = reconciler;
625
625
  exports.uniqueId = uniqueId;
626
626
  exports.useContext = useContext;
627
- //# sourceMappingURL=index-Bvwj3lIq.js.map
627
+ //# sourceMappingURL=index-BnS7TiLo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-Bvwj3lIq.js","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 - 2026 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 - 2026 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\nexport const createCache = () => {\n const map = new WeakMap();\n return <V extends any>(key: any, factory: () => V) => {\n if (map.has(key)) return map.get(key) as V;\n const value = factory();\n map.set(key, value);\n return value;\n };\n};\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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 - 2026 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 - 2026 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 - 2026 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 - 2026 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';\nimport { _ParentComponent } from '../components/pairs';\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 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 get isDirty() {\n return this._dirty.some(x => !!x.size);\n }\n}\n\nexport class VNode {\n\n #component: ComponentNode;\n \n #id = uniqueId();\n #props: PropsType = {};\n #error?: any;\n #children: (VNode | string)[] = [];\n\n #state?: VNodeState[];\n\n #context: Set<VNode> = new Set();\n #content_listeners: Set<VNode> = new Set();\n #content_value?: any;\n\n #parent?: VNode;\n #nativeParent?: VNode;\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 /** @internal */\n get component() {\n return this.#component;\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 /** @internal */\n get state() {\n return this.#state;\n }\n\n get children() {\n return this.#children;\n }\n\n get error() {\n return this.#error;\n }\n\n get parent() {\n return this.#parent;\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 get level() {\n return this.#level;\n }\n\n /** @internal */\n async* _render(event: UpdateManager, renderer: _Renderer<any>) {\n\n const _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 const _resolve_children = (child: any): (VNode | string)[] => {\n if (_.isBoolean(child) || _.isNil(child)) return [];\n if (_.isString(child)) return [child];\n if (_.isNumber(child) || typeof child === 'bigint') return [`${child}`];\n if (child instanceof ComponentNode) return [new VNode(child)];\n if (_.isArrayLikeObject(child)) return _.flatMap(child, x => _resolve_children(x));\n if (typeof child[Symbol.iterator] === 'function') return _.flatMap([...child], x => _resolve_children(x));\n throw Error(`${child} are not valid as a child.`);\n };\n\n try {\n const { type } = this.#component;\n this.#props = _resolve_props();\n let children: (VNode | string)[];\n let native = this.#nativeParent;\n if (_.isString(type) || type?.prototype instanceof NativeElementType) {\n children = _resolve_children(this.#props.children);\n if (_.isString(type) || !(type?.prototype instanceof _ParentComponent)) {\n native = this;\n }\n yield { mount: this };\n } else if (isContext(type)) {\n const { value } = this.#props;\n if (!equalDeps(this.#content_value, value)) {\n for (const node of this.#content_listeners) {\n yield { dirty: node };\n }\n }\n this.#content_value = value;\n children = _resolve_children(type(this.#props as any));\n } else if (_.isFunction(type)) {\n while (true) {\n const state = new HookState(this, event, renderer);\n reconciler._currentHookState = state;\n const rendered = type(this.#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 = _resolve_children(rendered);\n break;\n }\n await Promise.all(state.tasks);\n }\n yield { mount: 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.#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 (_.isNil(lhs.#state)) {\n yield { dirty: lhs };\n } else if (!equalProps(lhs.#component.props, rhs.#component.props)) {\n yield { dirty: lhs };\n }\n lhs.#component = rhs.#component;\n lhs.#parent = this;\n lhs.#nativeParent = native;\n lhs.#level = this.#level + 1;\n }\n for (const item of _.flatMap(diff, x => x.remove ?? [])) {\n if (item instanceof VNode) yield { removed: item };\n }\n if (_.some(diff, x => !x.equivalent) && this.#nativeParent && this.#nativeParent !== this) {\n yield { mount: this.#nativeParent };\n }\n } catch (error) {\n for (const item of this.#children) {\n if (item instanceof VNode) yield { removed: item };\n }\n this.#children = [];\n this.#error = error;\n (async () => {\n try {\n const { onError, silent } = this.stack.drop(1).find(node => node.type === ErrorBoundary)?.props ?? {};\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 yield { removed: this };\n if (this.#nativeParent && this.#nativeParent !== this) {\n yield { mount: this.#nativeParent };\n }\n } finally {\n reconciler._currentHookState = undefined;\n }\n }\n\n /** @internal */\n _release() {\n for (const context of this.#context) {\n context.#content_listeners.delete(this);\n }\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":["NativeElementType","_createElement","Fragment","_","ComponentNode","myersSync"],"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,SAAQA,yBAAiB,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,KAAKC,sBAAc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,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,KAAK;IACxB;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-BnS7TiLo.js","sources":["../../../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/components/pairs.ts","../../../src/core/reconciler/index.ts"],"sourcesContent":["//\n// utils.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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\nexport const createCache = () => {\n const map = new WeakMap();\n return <V extends any>(key: any, factory: () => V) => {\n if (map.has(key)) return map.get(key) as V;\n const value = factory();\n map.set(key, value);\n return value;\n };\n};\n","//\n// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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 - 2026 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 - 2026 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 - 2026 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// pairs.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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// index.ts\n//\n// The MIT License\n// Copyright (c) 2021 - 2026 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';\nimport { _ParentComponent } from '../components/pairs';\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 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 get isDirty() {\n return this._dirty.some(x => !!x.size);\n }\n}\n\nexport class VNode {\n\n #component: ComponentNode;\n \n #id = uniqueId();\n #props: PropsType = {};\n #error?: any;\n #children: (VNode | string)[] = [];\n\n #state?: VNodeState[];\n\n #context: Set<VNode> = new Set();\n #content_listeners: Set<VNode> = new Set();\n #content_value?: any;\n\n #parent?: VNode;\n #nativeParent?: VNode;\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 /** @internal */\n get component() {\n return this.#component;\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 /** @internal */\n get state() {\n return this.#state;\n }\n\n get children() {\n return this.#children;\n }\n\n get error() {\n return this.#error;\n }\n\n get parent() {\n return this.#parent;\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 get level() {\n return this.#level;\n }\n\n /** @internal */\n async* _render(event: UpdateManager, renderer: _Renderer<any>) {\n\n const _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 const _resolve_children = (child: any): (VNode | string)[] => {\n if (_.isBoolean(child) || _.isNil(child)) return [];\n if (_.isString(child)) return [child];\n if (_.isNumber(child) || typeof child === 'bigint') return [`${child}`];\n if (child instanceof ComponentNode) return [new VNode(child)];\n if (_.isArrayLikeObject(child)) return _.flatMap(child, x => _resolve_children(x));\n if (typeof child[Symbol.iterator] === 'function') return _.flatMap([...child], x => _resolve_children(x));\n throw Error(`${child} are not valid as a child.`);\n };\n\n try {\n const { type } = this.#component;\n this.#props = _resolve_props();\n let children: (VNode | string)[];\n let native = this.#nativeParent;\n if (_.isString(type) || type?.prototype instanceof NativeElementType) {\n children = _resolve_children(this.#props.children);\n if (_.isString(type) || !(type?.prototype instanceof _ParentComponent)) {\n native = this;\n }\n yield { mount: this };\n } else if (isContext(type)) {\n const { value } = this.#props;\n if (!equalDeps(this.#content_value, value)) {\n for (const node of this.#content_listeners) {\n yield { dirty: node };\n }\n }\n this.#content_value = value;\n children = _resolve_children(type(this.#props as any));\n } else if (_.isFunction(type)) {\n while (true) {\n const state = new HookState(this, event, renderer);\n reconciler._currentHookState = state;\n const rendered = type(this.#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 = _resolve_children(rendered);\n break;\n }\n await Promise.all(state.tasks);\n }\n yield { mount: 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.#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 (_.isNil(lhs.#state)) {\n yield { dirty: lhs };\n } else if (!equalProps(lhs.#component.props, rhs.#component.props)) {\n yield { dirty: lhs };\n }\n lhs.#component = rhs.#component;\n lhs.#parent = this;\n lhs.#nativeParent = native;\n lhs.#level = this.#level + 1;\n }\n for (const item of _.flatMap(diff, x => x.remove ?? [])) {\n if (item instanceof VNode) yield { removed: item };\n }\n if (_.some(diff, x => !x.equivalent) && this.#nativeParent && this.#nativeParent !== this) {\n yield { mount: this.#nativeParent };\n }\n } catch (error) {\n for (const item of this.#children) {\n if (item instanceof VNode) yield { removed: item };\n }\n this.#children = [];\n this.#error = error;\n (async () => {\n try {\n const { onError, silent } = this.stack.drop(1).find(node => node.type === ErrorBoundary)?.props ?? {};\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 yield { removed: this };\n if (this.#nativeParent && this.#nativeParent !== this) {\n yield { mount: this.#nativeParent };\n }\n } finally {\n reconciler._currentHookState = undefined;\n }\n }\n\n /** @internal */\n _release() {\n for (const context of this.#context) {\n context.#content_listeners.delete(this);\n }\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":["_","NativeElementType","_createElement","Fragment","ComponentNode","myersSync"],"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;AAKO,MAAM,SAAS,GAAG,CAAI,GAAG,IAAmC,KAAK,CAAC,CAAI,KAAI;AAC/E,IAAA,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;AACtB,QAAA,IAAIA,kBAAC,CAAC,KAAK,CAAC,GAAG,CAAC;YAAE;aACb,IAAI,OAAO,GAAG,KAAK,UAAU;YAAE,GAAG,CAAC,CAAC,CAAC;aACrC,IAAI,OAAO,GAAG,KAAK,QAAQ;AAAE,YAAA,GAAG,CAAC,OAAO,GAAG,CAAC;aAC5C;AACH,YAAA,OAAO,CAAC,KAAK,CAAC,gFAAgF,GAAG,CAAA,CAAE,CAAC;Q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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,KAAK;IACxB;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,4 +1,4 @@
1
- import { a as ComponentNode, _ as _ElementType, N as NativeElementType, c as PropsType } from './common-BMp06ZN_.js';
1
+ import { a as ComponentNode, N as NativeElementType, _ as _ElementType, c as PropsType } from './common-uQrs1G5-.js';
2
2
  import nextick from 'nextick';
3
3
 
4
4
  declare abstract class _Renderer<T> {
@@ -24,7 +24,7 @@ declare abstract class _Renderer<T> {
24
24
  declare class VNode {
25
25
  #private;
26
26
  get id(): string;
27
- get type(): _ElementType | typeof NativeElementType;
27
+ get type(): typeof NativeElementType | _ElementType;
28
28
  get props(): PropsType;
29
29
  get key(): string | number | bigint | null | undefined;
30
30
  get children(): (string | VNode)[];
@@ -35,4 +35,4 @@ declare class VNode {
35
35
  }
36
36
 
37
37
  export { VNode as V, _Renderer as _ };
38
- //# sourceMappingURL=index-CUCYNdr9.d.ts.map
38
+ //# sourceMappingURL=index-CdMvWgIS.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CdMvWgIS.d.ts","sources":["../../src/core/renderer.ts","../../src/core/reconciler/index.ts"],"mappings":";;;AAGA,uBAAuB,SAAS;AAChC;AACA;AACA;AACA,4CAA4C,KAAK;AACjD,4CAA4C,KAAK;AACjD,6CAA6C,KAAK;AAClD;AACA,yBAAyB,GAAG;AAC5B;AACA;AACA;AACA,2BAA2B,aAAa;AACxC;AACA,6BAA6B,OAAO;AACpC,cAAc,OAAO;AACrB;AACA;AACA;;ACHA,cAAc,KAAK;AACnB;AACA;AACA,uBAAuB,iBAAiB,GAAGA,YAAiB;AAC5D,iBAAiB,SAAS;AAC1B;AACA,8BAA8B,KAAK;AACnC;AACA,kBAAkB,KAAK;AACvB,iBAAiB,SAAS,CAAC,KAAK;AAChC;AACA;;;;","names":["_____.ElementType"]}
@@ -1,55 +1,7 @@
1
1
  import _ from 'lodash';
2
- import { N as NativeElementType, _ as _createElement, F as Fragment, C as ComponentNode } from './runtime-Bpq-U9sI.mjs';
2
+ import { N as NativeElementType, _ as _createElement, F as Fragment, C as ComponentNode } from './fragment-DnpshXqL.mjs';
3
3
  import { myersSync } from 'myers.js';
4
4
 
5
- //
6
- // pairs.ts
7
- //
8
- // The MIT License
9
- // Copyright (c) 2021 - 2026 O2ter Limited. All rights reserved.
10
- //
11
- // Permission is hereby granted, free of charge, to any person obtaining a copy
12
- // of this software and associated documentation files (the "Software"), to deal
13
- // in the Software without restriction, including without limitation the rights
14
- // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- // copies of the Software, and to permit persons to whom the Software is
16
- // furnished to do so, subject to the following conditions:
17
- //
18
- // The above copyright notice and this permission notice shall be included in
19
- // all copies or substantial portions of the Software.
20
- //
21
- // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- // THE SOFTWARE.
28
- //
29
- class _ParentComponent extends NativeElementType {
30
- }
31
- /**
32
- * Create a pair of Parent and Child components.
33
- *
34
- * @param allowTextChildren - Whether to allow text children in the Parent component.
35
- * @param allowedChildTypes - An array of additional allowed child component types.
36
- * @returns An object containing the Parent and Child components.
37
- */
38
- const createPairs = ({ allowTextChildren, allowedChildTypes = [] } = {}) => {
39
- const ChildComponent = ({ children }) => _createElement(Fragment, { children });
40
- class ParentComponent extends _ParentComponent {
41
- isChildNode(child) {
42
- if (_.isString(child))
43
- return !!allowTextChildren;
44
- return child.type === ChildComponent || _.some(allowedChildTypes, x => child.type === x);
45
- }
46
- }
47
- return {
48
- Parent: ({ children }) => _createElement(ParentComponent, { children }),
49
- Child: ChildComponent,
50
- };
51
- };
52
-
53
5
  //
54
6
  // utils.ts
55
7
  //
@@ -316,6 +268,54 @@ const equalProps = (lhs, rhs) => {
316
268
  return true;
317
269
  };
318
270
 
271
+ //
272
+ // pairs.ts
273
+ //
274
+ // The MIT License
275
+ // Copyright (c) 2021 - 2026 O2ter Limited. All rights reserved.
276
+ //
277
+ // Permission is hereby granted, free of charge, to any person obtaining a copy
278
+ // of this software and associated documentation files (the "Software"), to deal
279
+ // in the Software without restriction, including without limitation the rights
280
+ // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
281
+ // copies of the Software, and to permit persons to whom the Software is
282
+ // furnished to do so, subject to the following conditions:
283
+ //
284
+ // The above copyright notice and this permission notice shall be included in
285
+ // all copies or substantial portions of the Software.
286
+ //
287
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
288
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
289
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
290
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
291
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
292
+ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
293
+ // THE SOFTWARE.
294
+ //
295
+ class _ParentComponent extends NativeElementType {
296
+ }
297
+ /**
298
+ * Create a pair of Parent and Child components.
299
+ *
300
+ * @param allowTextChildren - Whether to allow text children in the Parent component.
301
+ * @param allowedChildTypes - An array of additional allowed child component types.
302
+ * @returns An object containing the Parent and Child components.
303
+ */
304
+ const createPairs = ({ allowTextChildren, allowedChildTypes = [] } = {}) => {
305
+ const ChildComponent = ({ children }) => _createElement(Fragment, { children });
306
+ class ParentComponent extends _ParentComponent {
307
+ isChildNode(child) {
308
+ if (_.isString(child))
309
+ return !!allowTextChildren;
310
+ return child.type === ChildComponent || _.some(allowedChildTypes, x => child.type === x);
311
+ }
312
+ }
313
+ return {
314
+ Parent: ({ children }) => _createElement(ParentComponent, { children }),
315
+ Child: ChildComponent,
316
+ };
317
+ };
318
+
319
319
  //
320
320
  // index.ts
321
321
  //
@@ -606,4 +606,4 @@ const reconciler = new class {
606
606
  };
607
607
 
608
608
  export { ErrorBoundary as E, PropsProvider as P, UpdateManager as U, VNode as V, _ParentComponent as _, createPairs as a, useContext as b, createContext as c, createCache as d, equalDeps as e, mergeRefs as m, reconciler as r, uniqueId as u };
609
- //# sourceMappingURL=index-CODWK-gF.mjs.map
609
+ //# sourceMappingURL=index-CoURz_S4.mjs.map