frosty 0.0.41 → 0.0.43

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.
@@ -70,7 +70,7 @@ class _Renderer {
70
70
  mountState.delete(node);
71
71
  }
72
72
  if (root)
73
- this._replaceChildren(runtime.node, root, _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)));
73
+ this._replaceChildren(runtime.node, root, _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)), true);
74
74
  _mount(runtime.node);
75
75
  };
76
76
  const update = (elements) => {
@@ -132,7 +132,7 @@ class _Renderer {
132
132
  },
133
133
  destroy: () => {
134
134
  if (root)
135
- this._replaceChildren(runtime.node, root, []);
135
+ this._replaceChildren(runtime.node, root, [], true);
136
136
  destroyed = true;
137
137
  listener.remove();
138
138
  for (const state of mountState.values()) {
@@ -160,4 +160,4 @@ class _Renderer {
160
160
  }
161
161
 
162
162
  exports._Renderer = _Renderer;
163
- //# sourceMappingURL=renderer-a9zN1_RB.js.map
163
+ //# sourceMappingURL=renderer-CD_mSOiL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer-CD_mSOiL.js","sources":["../../../src/core/renderer.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 { VNode } from './reconciler/vnode';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { reconciler } from './reconciler/state';\nimport nextick from 'nextick';\nimport { equalDeps } from './reconciler/utils';\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, stack: VNode[]): T;\n\n protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[], force?: boolean): void;\n\n abstract get _server(): boolean;\n\n private _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n const runtime = reconciler.buildVNodes(component, this);\n\n type _State = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const mountState = new Map<VNode, _State[]>();\n\n const children = (node: VNode, elements: Map<VNode, { native?: T }>): (string | T)[] => {\n return _.flatMap(node.children, x => _.isString(x) ? x : elements.get(x)?.native ?? children(x, elements));\n };\n\n const commit = (elements: Map<VNode, { native?: T }>) => {\n\n const _mount = (\n node: VNode,\n ) => {\n const element = elements.get(node)?.native;\n if (element) {\n this._replaceChildren(node, element, children(node, elements));\n }\n for (const item of node.children) {\n if (item instanceof VNode) _mount(item);\n }\n const state: _State[] = [];\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) unmount();\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : curState[i].mount?.(),\n });\n }\n mountState.set(node, state);\n };\n\n for (const [node, state] of mountState) {\n if (elements.has(node)) continue;\n for (const { unmount } of state) unmount?.();\n mountState.delete(node);\n }\n if (root) this._replaceChildren(\n runtime.node,\n root,\n _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)),\n true\n );\n _mount(runtime.node);\n };\n\n const update = (elements?: Map<VNode, { native?: T }>) => {\n this._beforeUpdate();\n const map = new Map<VNode, { native?: T }>();\n for (const { node, stack, updated } of runtime.excute()) {\n if (node.error) continue;\n if (_.isFunction(node.type) && !(node.type.prototype instanceof NativeElementType)) {\n map.set(node, {});\n continue;\n }\n if (updated) {\n let elem = elements?.get(node)?.native;\n if (elem) {\n this._updateElement(node, elem, stack);\n } else {\n elem = this._createElement(node, stack);\n }\n map.set(node, { native: elem });\n } else {\n map.set(node, { native: elements?.get(node)?.native ?? this._createElement(node, stack) });\n }\n }\n commit(map);\n if (elements) {\n for (const [node, element] of elements) {\n if (map.has(node) || !element.native) continue;\n this._destroyElement(node, element.native);\n }\n }\n this._afterUpdate();\n return map;\n };\n\n let update_count = 0;\n let render_count = 0;\n let destroyed = false;\n let elements = update();\n\n const listener = runtime.event.register('onchange', () => {\n if (render_count !== update_count++) return;\n nextick(() => {\n if (destroyed) return;\n render_count = update_count;\n elements = update(elements);\n });\n });\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements));\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n if (root) this._replaceChildren(runtime.node, root, [], true);\n destroyed = true;\n listener.remove();\n for (const state of mountState.values()) {\n for (const { unmount } of state) unmount?.();\n }\n },\n };\n }\n\n createRoot(root?: T) {\n let state: ReturnType<typeof this._createRoot> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\n };\n }\n}"],"names":["component","reconciler","VNode","state","equalDeps","NativeElementType"],"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;MASsB,SAAS,CAAA;AAgBrB,IAAA,WAAW,CACjB,IAAc,EACdA,WAAwB,EACxB,OAEC,EAAA;QAGD,MAAM,OAAO,GAAGC,gBAAU,CAAC,WAAW,CAACD,WAAS,EAAE,IAAI,CAAC;AAQvD,QAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB;AAE7C,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAE,QAAoC,KAAoB;AACrF,YAAA,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5G,SAAC;AAED,QAAA,MAAM,MAAM,GAAG,CAAC,QAAoC,KAAI;AAEtD,YAAA,MAAM,MAAM,GAAG,CACb,IAAW,KACT;gBACF,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM;gBAC1C,IAAI,OAAO,EAAE;AACX,oBAAA,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;;AAEhE,gBAAA,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,QAAQ,EAAE;oBAChC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AI,EAAE,QAAQ,CAAC,CAAC;gBACjG,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAQ;AACzD,gBAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,GAAG,KAAK;aAC7C;YACD,OAAO,EAAE,MAAK;AACZ,gBAAA,IAAI,IAAI;AAAE,oBAAA,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC;gBAC7D,SAAS,GAAG,IAAI;gBAChB,QAAQ,CAAC,MAAM,EAAE;gBACjB,KAAK,MAAM,KAAK,IAAI,UAAU,CAAC,MAAM,EAAE,EAAE;AACvC,oBAAA,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,KAAK;wBAAE,OAAO,IAAI;;aAE/C;SACF;;AAGH,IAAA,UAAU,CAAC,IAAQ,EAAA;AACjB,QAAA,IAAI,KAAsD;QAC1D,OAAO;AACL,YAAA,IAAI,IAAI,GAAA;gBACN,OAAO,KAAK,EAAE,IAAI;aACnB;AACD,YAAA,KAAK,EAAE,CACL,SAAwB,EACxB,OAEC,KACC;AACF,gBAAA,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;aAC3D;YACD,OAAO,EAAE,MAAK;gBACZ,KAAK,EAAE,OAAO,EAAE;gBAChB,KAAK,GAAG,SAAS;aAClB;SACF;;AAEJ;;;;"}
@@ -31,7 +31,7 @@ declare abstract class _Renderer<T> {
31
31
  protected abstract _createElement(node: VNode, stack: VNode[]): T;
32
32
  protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;
33
33
  protected abstract _destroyElement(node: VNode, element: T): void;
34
- protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[]): void;
34
+ protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[], force?: boolean): void;
35
35
  abstract get _server(): boolean;
36
36
  private _createRoot;
37
37
  createRoot(root?: T): {
@@ -44,4 +44,4 @@ declare abstract class _Renderer<T> {
44
44
  }
45
45
 
46
46
  export { VNode as V, _Renderer as _ };
47
- //# sourceMappingURL=renderer-DPoACdip.d.ts.map
47
+ //# sourceMappingURL=renderer-DDRMah6t.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer-DDRMah6t.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -68,7 +68,7 @@ class _Renderer {
68
68
  mountState.delete(node);
69
69
  }
70
70
  if (root)
71
- this._replaceChildren(runtime.node, root, _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)));
71
+ this._replaceChildren(runtime.node, root, _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)), true);
72
72
  _mount(runtime.node);
73
73
  };
74
74
  const update = (elements) => {
@@ -130,7 +130,7 @@ class _Renderer {
130
130
  },
131
131
  destroy: () => {
132
132
  if (root)
133
- this._replaceChildren(runtime.node, root, []);
133
+ this._replaceChildren(runtime.node, root, [], true);
134
134
  destroyed = true;
135
135
  listener.remove();
136
136
  for (const state of mountState.values()) {
@@ -158,4 +158,4 @@ class _Renderer {
158
158
  }
159
159
 
160
160
  export { _Renderer as _ };
161
- //# sourceMappingURL=renderer-ClDlweEF.mjs.map
161
+ //# sourceMappingURL=renderer-DMJ6PnD6.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer-DMJ6PnD6.mjs","sources":["../../../src/core/renderer.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 { VNode } from './reconciler/vnode';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { reconciler } from './reconciler/state';\nimport nextick from 'nextick';\nimport { equalDeps } from './reconciler/utils';\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, stack: VNode[]): T;\n\n protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[], force?: boolean): void;\n\n abstract get _server(): boolean;\n\n private _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n const runtime = reconciler.buildVNodes(component, this);\n\n type _State = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const mountState = new Map<VNode, _State[]>();\n\n const children = (node: VNode, elements: Map<VNode, { native?: T }>): (string | T)[] => {\n return _.flatMap(node.children, x => _.isString(x) ? x : elements.get(x)?.native ?? children(x, elements));\n };\n\n const commit = (elements: Map<VNode, { native?: T }>) => {\n\n const _mount = (\n node: VNode,\n ) => {\n const element = elements.get(node)?.native;\n if (element) {\n this._replaceChildren(node, element, children(node, elements));\n }\n for (const item of node.children) {\n if (item instanceof VNode) _mount(item);\n }\n const state: _State[] = [];\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) unmount();\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : curState[i].mount?.(),\n });\n }\n mountState.set(node, state);\n };\n\n for (const [node, state] of mountState) {\n if (elements.has(node)) continue;\n for (const { unmount } of state) unmount?.();\n mountState.delete(node);\n }\n if (root) this._replaceChildren(\n runtime.node,\n root,\n _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)),\n true\n );\n _mount(runtime.node);\n };\n\n const update = (elements?: Map<VNode, { native?: T }>) => {\n this._beforeUpdate();\n const map = new Map<VNode, { native?: T }>();\n for (const { node, stack, updated } of runtime.excute()) {\n if (node.error) continue;\n if (_.isFunction(node.type) && !(node.type.prototype instanceof NativeElementType)) {\n map.set(node, {});\n continue;\n }\n if (updated) {\n let elem = elements?.get(node)?.native;\n if (elem) {\n this._updateElement(node, elem, stack);\n } else {\n elem = this._createElement(node, stack);\n }\n map.set(node, { native: elem });\n } else {\n map.set(node, { native: elements?.get(node)?.native ?? this._createElement(node, stack) });\n }\n }\n commit(map);\n if (elements) {\n for (const [node, element] of elements) {\n if (map.has(node) || !element.native) continue;\n this._destroyElement(node, element.native);\n }\n }\n this._afterUpdate();\n return map;\n };\n\n let update_count = 0;\n let render_count = 0;\n let destroyed = false;\n let elements = update();\n\n const listener = runtime.event.register('onchange', () => {\n if (render_count !== update_count++) return;\n nextick(() => {\n if (destroyed) return;\n render_count = update_count;\n elements = update(elements);\n });\n });\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements));\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n if (root) this._replaceChildren(runtime.node, root, [], true);\n destroyed = true;\n listener.remove();\n for (const state of mountState.values()) {\n for (const { unmount } of state) unmount?.();\n }\n },\n };\n }\n\n createRoot(root?: T) {\n let state: ReturnType<typeof this._createRoot> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\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;MASsB,SAAS,CAAA;AAgBrB,IAAA,WAAW,CACjB,IAAc,EACd,SAAwB,EACxB,OAEC,EAAA;QAGD,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC;AAQvD,QAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB;AAE7C,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAE,QAAoC,KAAoB;AACrF,YAAA,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC5G,SAAC;AAED,QAAA,MAAM,MAAM,GAAG,CAAC,QAAoC,KAAI;AAEtD,YAAA,MAAM,MAAM,GAAG,CACb,IAAW,KACT;gBACF,MAAM,OAAO,GAAG,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,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@
1
1
  import { JSDOM } from 'jsdom';
2
2
  export * from 'jsdom';
3
- import { _ as _DOMRenderer } from './internals/common-BG8cT1kV.js';
3
+ import { _ as _DOMRenderer } from './internals/common-CDZcUGUM.js';
4
4
  import './internals/common-CUIKizze.js';
5
5
  import '@o2ter/utils-js';
6
6
  import 'lodash';
7
7
  import 'csstype';
8
- import './internals/renderer-DPoACdip.js';
8
+ import './internals/renderer-DDRMah6t.js';
9
9
 
10
10
  declare class ServerDOMRenderer extends _DOMRenderer {
11
11
  constructor(dom?: JSDOM);
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
3
  var jsdom = require('jsdom');
4
- var common = require('./internals/common-DB-05wD7.js');
4
+ var common = require('./internals/common-P5AZ4-Yt.js');
5
5
  require('lodash');
6
6
  require('myers.js');
7
7
  require('./internals/component-BiP3XIPe.js');
8
- require('./internals/renderer-a9zN1_RB.js');
8
+ require('./internals/renderer-CD_mSOiL.js');
9
9
  require('./internals/state-Lf_tbWNd.js');
10
10
  require('nextick');
11
11
  require('postcss');
@@ -1,10 +1,10 @@
1
1
  import { JSDOM } from 'jsdom';
2
2
  export * from 'jsdom';
3
- import { _ as _DOMRenderer } from './internals/common-iw--21Y0.mjs';
3
+ import { _ as _DOMRenderer } from './internals/common-Cmc9qJmA.mjs';
4
4
  import 'lodash';
5
5
  import 'myers.js';
6
6
  import './internals/component-BzurKp_J.mjs';
7
- import './internals/renderer-ClDlweEF.mjs';
7
+ import './internals/renderer-DMJ6PnD6.mjs';
8
8
  import './internals/state-5PNx91ec.mjs';
9
9
  import 'nextick';
10
10
  import 'postcss';
package/dist/web.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import { S as SetStateAction } from './internals/common-CUIKizze.js';
2
2
  import * as jsdom from 'jsdom';
3
- export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/common-BG8cT1kV.js';
3
+ export { D as DOMNativeNode, _ as _DOMRenderer } from './internals/common-CDZcUGUM.js';
4
4
  import '@o2ter/utils-js';
5
5
  import 'lodash';
6
6
  import 'csstype';
7
- import './internals/renderer-DPoACdip.js';
7
+ import './internals/renderer-DDRMah6t.js';
8
8
 
9
9
  declare const useDocument: () => Document;
10
10
 
package/dist/web.js CHANGED
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var state = require('./internals/state-Lf_tbWNd.js');
4
- var common = require('./internals/common-DB-05wD7.js');
4
+ var common = require('./internals/common-P5AZ4-Yt.js');
5
5
  var _ = require('lodash');
6
6
  var sync = require('./internals/sync-e3464vDv.js');
7
7
  require('./internals/component-BiP3XIPe.js');
8
8
  require('myers.js');
9
- require('./internals/renderer-a9zN1_RB.js');
9
+ require('./internals/renderer-CD_mSOiL.js');
10
10
  require('nextick');
11
11
  require('postcss');
12
12
  require('postcss-js');
package/dist/web.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  import { r as reconciler, b as EventEmitter, a as uniqueId } from './internals/state-5PNx91ec.mjs';
2
- import { _ as _DOMRenderer } from './internals/common-iw--21Y0.mjs';
3
- export { D as DOMNativeNode } from './internals/common-iw--21Y0.mjs';
2
+ import { _ as _DOMRenderer } from './internals/common-Cmc9qJmA.mjs';
3
+ export { D as DOMNativeNode } from './internals/common-Cmc9qJmA.mjs';
4
4
  import _ from 'lodash';
5
5
  import { d as useSyncExternalStore, b as useMemo, u as useCallback, c as useEffect } from './internals/sync-C4RmxDzS.mjs';
6
6
  import './internals/component-BzurKp_J.mjs';
7
7
  import 'myers.js';
8
- import './internals/renderer-ClDlweEF.mjs';
8
+ import './internals/renderer-DMJ6PnD6.mjs';
9
9
  import 'nextick';
10
10
  import 'postcss';
11
11
  import 'postcss-js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frosty",
3
- "version": "0.0.41",
3
+ "version": "0.0.43",
4
4
  "main": "dist/index",
5
5
  "module": "dist/index",
6
6
  "types": "dist/index",
@@ -1 +0,0 @@
1
- {"version":3,"file":"common-BG8cT1kV.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer-ClDlweEF.mjs","sources":["../../../src/core/renderer.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 { VNode } from './reconciler/vnode';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { reconciler } from './reconciler/state';\nimport nextick from 'nextick';\nimport { equalDeps } from './reconciler/utils';\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, stack: VNode[]): T;\n\n protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[]): void;\n\n abstract get _server(): boolean;\n\n private _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n const runtime = reconciler.buildVNodes(component, this);\n\n type _State = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const mountState = new Map<VNode, _State[]>();\n\n const children = (node: VNode, elements: Map<VNode, { native?: T }>): (string | T)[] => {\n return _.flatMap(node.children, x => _.isString(x) ? x : elements.get(x)?.native ?? children(x, elements));\n };\n\n const commit = (elements: Map<VNode, { native?: T }>) => {\n\n const _mount = (\n node: VNode,\n ) => {\n const element = elements.get(node)?.native;\n if (element) {\n this._replaceChildren(node, element, children(node, elements));\n }\n for (const item of node.children) {\n if (item instanceof VNode) _mount(item);\n }\n const state: _State[] = [];\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) unmount();\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : curState[i].mount?.(),\n });\n }\n mountState.set(node, state);\n };\n\n for (const [node, state] of mountState) {\n if (elements.has(node)) continue;\n for (const { unmount } of state) unmount?.();\n mountState.delete(node);\n }\n if (root) this._replaceChildren(runtime.node, root, _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)));\n _mount(runtime.node);\n };\n\n const update = (elements?: Map<VNode, { native?: T }>) => {\n this._beforeUpdate();\n const map = new Map<VNode, { native?: T }>();\n for (const { node, stack, updated } of runtime.excute()) {\n if (node.error) continue;\n if (_.isFunction(node.type) && !(node.type.prototype instanceof NativeElementType)) {\n map.set(node, {});\n continue;\n }\n if (updated) {\n let elem = elements?.get(node)?.native;\n if (elem) {\n this._updateElement(node, elem, stack);\n } else {\n elem = this._createElement(node, stack);\n }\n map.set(node, { native: elem });\n } else {\n map.set(node, { native: elements?.get(node)?.native ?? this._createElement(node, stack) });\n }\n }\n commit(map);\n if (elements) {\n for (const [node, element] of elements) {\n if (map.has(node) || !element.native) continue;\n this._destroyElement(node, element.native);\n }\n }\n this._afterUpdate();\n return map;\n };\n\n let update_count = 0;\n let render_count = 0;\n let destroyed = false;\n let elements = update();\n\n const listener = runtime.event.register('onchange', () => {\n if (render_count !== update_count++) return;\n nextick(() => {\n if (destroyed) return;\n render_count = update_count;\n elements = update(elements);\n });\n });\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements));\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n if (root) this._replaceChildren(runtime.node, root, []);\n destroyed = true;\n listener.remove();\n for (const state of mountState.values()) {\n for (const { unmount } of state) unmount?.();\n }\n },\n };\n }\n\n createRoot(root?: T) {\n let state: ReturnType<typeof this._createRoot> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\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;MASsB,SAAS,CAAA;AAgBrB,IAAA,WAAW,CACjB,IAAc,EACd,SAAwB,EACxB,OAEC,EAAA;QAGD,MAAM,OAAO,GAAG,UAAU,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC;AAQvD,QAAA,MAAM,UAAU,GAAG,IAAI,GAAG,EAAmB;AAE7C,QAAA,MAAM,QAAQ,GAAG,CAAC,IAAW,EAAE,QAAoC,KAAoB;AACrF,YAAA,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,CA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;AACD,YAAA,KAAK,EAAE,CACL,SAAwB,EACxB,OAEC,KACC;AACF,gBAAA,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC;aAC3D;YACD,OAAO,EAAE,MAAK;gBACZ,KAAK,EAAE,OAAO,EAAE;gBAChB,KAAK,GAAG,SAAS;aAClB;SACF;;AAEJ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer-DPoACdip.d.ts","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer-a9zN1_RB.js","sources":["../../../src/core/renderer.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 { VNode } from './reconciler/vnode';\nimport { ComponentNode, NativeElementType } from './types/component';\nimport { reconciler } from './reconciler/state';\nimport nextick from 'nextick';\nimport { equalDeps } from './reconciler/utils';\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, stack: VNode[]): T;\n\n protected abstract _updateElement(node: VNode, element: T, stack: VNode[]): void;\n\n protected abstract _destroyElement(node: VNode, element: T): void;\n\n protected abstract _replaceChildren(node: VNode, element: T, children: (T | string)[]): void;\n\n abstract get _server(): boolean;\n\n private _createRoot(\n root: T | null,\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) {\n\n const runtime = reconciler.buildVNodes(component, this);\n\n type _State = {\n hook: string;\n deps: any;\n unmount?: () => void;\n };\n\n const mountState = new Map<VNode, _State[]>();\n\n const children = (node: VNode, elements: Map<VNode, { native?: T }>): (string | T)[] => {\n return _.flatMap(node.children, x => _.isString(x) ? x : elements.get(x)?.native ?? children(x, elements));\n };\n\n const commit = (elements: Map<VNode, { native?: T }>) => {\n\n const _mount = (\n node: VNode,\n ) => {\n const element = elements.get(node)?.native;\n if (element) {\n this._replaceChildren(node, element, children(node, elements));\n }\n for (const item of node.children) {\n if (item instanceof VNode) _mount(item);\n }\n const state: _State[] = [];\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) unmount();\n state.push({\n hook: curState[i].hook,\n deps: curState[i].deps,\n unmount: options?.skipMount || !changed ? prevState[i]?.unmount : curState[i].mount?.(),\n });\n }\n mountState.set(node, state);\n };\n\n for (const [node, state] of mountState) {\n if (elements.has(node)) continue;\n for (const { unmount } of state) unmount?.();\n mountState.delete(node);\n }\n if (root) this._replaceChildren(runtime.node, root, _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements)));\n _mount(runtime.node);\n };\n\n const update = (elements?: Map<VNode, { native?: T }>) => {\n this._beforeUpdate();\n const map = new Map<VNode, { native?: T }>();\n for (const { node, stack, updated } of runtime.excute()) {\n if (node.error) continue;\n if (_.isFunction(node.type) && !(node.type.prototype instanceof NativeElementType)) {\n map.set(node, {});\n continue;\n }\n if (updated) {\n let elem = elements?.get(node)?.native;\n if (elem) {\n this._updateElement(node, elem, stack);\n } else {\n elem = this._createElement(node, stack);\n }\n map.set(node, { native: elem });\n } else {\n map.set(node, { native: elements?.get(node)?.native ?? this._createElement(node, stack) });\n }\n }\n commit(map);\n if (elements) {\n for (const [node, element] of elements) {\n if (map.has(node) || !element.native) continue;\n this._destroyElement(node, element.native);\n }\n }\n this._afterUpdate();\n return map;\n };\n\n let update_count = 0;\n let render_count = 0;\n let destroyed = false;\n let elements = update();\n\n const listener = runtime.event.register('onchange', () => {\n if (render_count !== update_count++) return;\n nextick(() => {\n if (destroyed) return;\n render_count = update_count;\n elements = update(elements);\n });\n });\n\n return {\n get root() {\n if (root) return root;\n const elems = _.castArray(elements.get(runtime.node)?.native ?? children(runtime.node, elements));\n const nodes = _.filter(elems, x => !_.isString(x)) as T[];\n return nodes.length === 1 ? nodes[0] : nodes;\n },\n destroy: () => {\n if (root) this._replaceChildren(runtime.node, root, []);\n destroyed = true;\n listener.remove();\n for (const state of mountState.values()) {\n for (const { unmount } of state) unmount?.();\n }\n },\n };\n }\n\n createRoot(root?: T) {\n let state: ReturnType<typeof this._createRoot> | undefined;\n return {\n get root() {\n return state?.root;\n },\n mount: (\n component: ComponentNode,\n options?: {\n skipMount?: boolean;\n },\n ) => {\n state = this._createRoot(root ?? null, component, options);\n },\n unmount: () => {\n state?.destroy();\n state = undefined;\n },\n };\n }\n}"],"names":["component","reconciler","VNode","state","equalDeps","NativeElementType"],"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;MASsB,SAAS,CAA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