@meonode/ui 0.4.6 → 0.4.8

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 (43) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/client.d.ts +2 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +1 -1
  5. package/dist/components/html.node.d.ts +139 -139
  6. package/dist/components/html.node.js +139 -139
  7. package/dist/components/meonode-unmounter.client.d.ts +6 -3
  8. package/dist/components/meonode-unmounter.client.d.ts.map +1 -1
  9. package/dist/components/meonode-unmounter.client.js +4 -2
  10. package/dist/components/react.node.d.ts +3 -3
  11. package/dist/components/react.node.js +3 -3
  12. package/dist/components/registry.client.js +6 -6
  13. package/dist/components/styled-renderer.client.js +2 -2
  14. package/dist/components/theme-provider.client.js +2 -2
  15. package/dist/components/theme-provider.d.ts +1 -1
  16. package/dist/components/theme-provider.js +1 -1
  17. package/dist/constants/common.const.js +1 -1
  18. package/dist/constants/css-properties.const.js +1 -1
  19. package/dist/core.node.d.ts +10 -10
  20. package/dist/core.node.d.ts.map +1 -1
  21. package/dist/core.node.js +39 -37
  22. package/dist/helper/common.helper.js +9 -9
  23. package/dist/helper/obj.helper.js +14 -14
  24. package/dist/helper/react-is.helper.js +21 -21
  25. package/dist/hoc/component.hoc.js +1 -1
  26. package/dist/hoc/portal.hoc.js +13 -13
  27. package/dist/hook/usePortal.js +2 -2
  28. package/dist/hook/useTheme.js +3 -3
  29. package/dist/nextjs-registry/index.d.ts +1 -1
  30. package/dist/nextjs-registry/index.js +1 -1
  31. package/dist/types/node.type.d.ts +5 -0
  32. package/dist/types/node.type.d.ts.map +1 -1
  33. package/dist/util/mount-tracker.util.js +3 -3
  34. package/dist/util/navigation-cache-manager.util.d.ts +5 -0
  35. package/dist/util/navigation-cache-manager.util.d.ts.map +1 -1
  36. package/dist/util/navigation-cache-manager.util.js +7 -7
  37. package/dist/util/node.util.d.ts +22 -26
  38. package/dist/util/node.util.d.ts.map +1 -1
  39. package/dist/util/node.util.js +75 -69
  40. package/dist/util/theme.util.d.ts +6 -6
  41. package/dist/util/theme.util.d.ts.map +1 -1
  42. package/dist/util/theme.util.js +17 -16
  43. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}import{isContextConsumer,isContextProvider,isElement,isForwardRef,isFragment,isLazy,isMemo,isPortal,isProfiler,isReactClassComponent,isStrictMode,isSuspense,isSuspenseList}from"./react-is.helper.js";import cssProperties from"../constants/css-properties.const.js";import{noStyleTagsSet}from"../constants/common.const.js";/**
1
+ import{isContextConsumer,isContextProvider,isElement,isForwardRef,isFragment,isLazy,isMemo,isPortal,isProfiler,isReactClassComponent,isStrictMode,isSuspense,isSuspenseList}from"./react-is.helper.js";import cssProperties from"../constants/css-properties.const.js";import{noStyleTagsSet}from"../constants/common.const.js";/**
2
2
  * Retrieves a deeply nested value from an object using a dot-separated string path.
3
3
  *
4
4
  * This function traverses an object based on the provided path, which is a
@@ -8,7 +8,7 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
8
8
  * @param obj The object to traverse, defaults to an empty object if not provided.
9
9
  * @param path The dot-separated path string (e.g., 'background.primary').
10
10
  * @returns The value at the specified path, or undefined if not found.
11
- */export var getValueByPath=function getValueByPath(a,b){return b.split(".").reduce(function(a,b){return a&&a[b]!==void 0?a[b]:void 0},a)};/**
11
+ */export const getValueByPath=(a,b)=>b.split(".").reduce((a,b)=>a&&void 0!==a[b]?a[b]:void 0,a);/**
12
12
  * Returns a string describing the type of a given React component or element.
13
13
  *
14
14
  * Checks for common React types (class, forwardRef, memo, etc.) and returns a string
@@ -21,7 +21,7 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
21
21
  * getComponentType(React.forwardRef(() => <div/>)) // 'forwardRef'
22
22
  * getComponentType(React.memo(() => <div/>)) // 'memo'
23
23
  * getComponentType(() => <div/>) // 'function'
24
- */export var getComponentType=function getComponentType(a){return isForwardRef(a)?"forwardRef":isMemo(a)?"memo":isFragment(a)?"fragment":isPortal(a)?"portal":isProfiler(a)?"profiler":isStrictMode(a)?"strict-mode":isSuspense(a)?"suspense":isSuspenseList(a)?"suspense-list":isContextConsumer(a)?"context-consumer":isContextProvider(a)?"context-provider":isLazy(a)?"lazy":isElement(a)?"element":isReactClassComponent(a)?"class":_typeof(a)};/**
24
+ */export const getComponentType=a=>isForwardRef(a)?"forwardRef":isMemo(a)?"memo":isFragment(a)?"fragment":isPortal(a)?"portal":isProfiler(a)?"profiler":isStrictMode(a)?"strict-mode":isSuspense(a)?"suspense":isSuspenseList(a)?"suspense-list":isContextConsumer(a)?"context-consumer":isContextProvider(a)?"context-provider":isLazy(a)?"lazy":isElement(a)?"element":isReactClassComponent(a)?"class":typeof a;/**
25
25
  * Generates a string name for an ElementType or ReactElement.
26
26
  *
27
27
  * This function attempts to extract a meaningful name from a React ElementType
@@ -32,10 +32,10 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
32
32
  * If a name cannot be determined, it returns a fallback like 'UnknownElementType' or 'AnonymousComponent'.
33
33
  * @param node The ElementType or ReactElement (e.g., 'div', MyComponent, <MyComponent />).
34
34
  * @returns A string representation of the element type's name.
35
- */export function getElementTypeName(a){var b,c;function getDisplayName(a,b){var c=(null===a||void 0===a?void 0:a.displayName)||(null===a||void 0===a?void 0:a.name);return!c||"render"===c?b:c}if(null===a||a===void 0)return"UnknownElementType";var d=a,e=getComponentType(d);switch(e){case"string":return a;case"class":return getDisplayName(d,"ClassComponent");case"function":return getDisplayName(d,"AnonymousFunctionComponent");case"forwardRef":return getDisplayName(d,"")||getDisplayName(d.render,"")||"ForwardRefComponent";case"memo":return getDisplayName(d,"")||(d.type?getElementTypeName(d.type):"MemoComponent");case"element":return getElementTypeName(d.type);case"fragment":return"Fragment";case"portal":return"Portal";case"profiler":return getDisplayName(d,"Profiler");case"strict-mode":return"StrictMode";case"suspense":return getDisplayName(d,"Suspense");case"suspense-list":return"SuspenseList";case"context-consumer":return null!==(b=d._context)&&void 0!==b&&b.displayName?"".concat(d._context.displayName,".Consumer"):"ContextConsumer";case"context-provider":return null!==(c=d._context)&&void 0!==c&&c.displayName?"".concat(d._context.displayName,".Provider"):"ContextProvider";case"lazy":return getDisplayName(d,"LazyComponent");case"object":return getDisplayName(d,"")?getDisplayName(d,""):"function"==typeof d.render?getDisplayName(d.render,"ObjectWithRender"):d.type&&d.type!==a?"Wrapped<".concat(getElementTypeName(d.type),">"):getDisplayName(d,"ObjectComponent");case"symbol":if("symbol"===_typeof(a)){var f;return(null===(f=a.description)||void 0===f?void 0:f.replace(/^react\./,"").split(".").map(function(a){var b;return(null===(b=a[0])||void 0===b?void 0:b.toUpperCase())+a.slice(1)}).join(""))||a.toString()}return"SymbolComponent";case"unknown":return"UnknownElementType";default:return"UnsupportedType<".concat(e,">")}}/**
35
+ */export function getElementTypeName(a){function getDisplayName(a,b){const c=a?.displayName||a?.name;return!c||"render"===c?b:c}if(null===a||a===void 0)return"UnknownElementType";const b=a,c=getComponentType(b);return"string"===c?a:"class"===c?getDisplayName(b,"ClassComponent"):"function"===c?getDisplayName(b,"AnonymousFunctionComponent"):"forwardRef"===c?getDisplayName(b,"")||getDisplayName(b.render,"")||"ForwardRefComponent":"memo"===c?getDisplayName(b,"")||(b.type?getElementTypeName(b.type):"MemoComponent"):"element"===c?getElementTypeName(b.type):"fragment"===c?"Fragment":"portal"===c?"Portal":"profiler"===c?getDisplayName(b,"Profiler"):"strict-mode"===c?"StrictMode":"suspense"===c?getDisplayName(b,"Suspense"):"suspense-list"===c?"SuspenseList":"context-consumer"===c?b._context?.displayName?`${b._context.displayName}.Consumer`:"ContextConsumer":"context-provider"===c?b._context?.displayName?`${b._context.displayName}.Provider`:"ContextProvider":"lazy"===c?getDisplayName(b,"LazyComponent"):"object"===c?getDisplayName(b,"")?getDisplayName(b,""):"function"==typeof b.render?getDisplayName(b.render,"ObjectWithRender"):b.type&&b.type!==a?`Wrapped<${getElementTypeName(b.type)}>`:getDisplayName(b,"ObjectComponent"):"symbol"===c?"symbol"==typeof a?a.description?.replace(/^react\./,"").split(".").map(a=>a[0]?.toUpperCase()+a.slice(1)).join("")||a.toString():"SymbolComponent":"unknown"===c?"UnknownElementType":`UnsupportedType<${c}>`}/**
36
36
  * A set of valid CSS property names in camelCase, including CSS custom properties, used for validation.
37
37
  * This set contains all CSS properties including non-standard vendor prefixed properties.
38
- */export var CSSPropertySet=new Set(cssProperties);/**
38
+ */export const CSSPropertySet=new Set(cssProperties);/**
39
39
  * Filters an object to only include valid CSS properties
40
40
  * @param props The object containing potential CSS properties
41
41
  * @returns An object containing only valid CSS properties
@@ -46,7 +46,7 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
46
46
  * invalid: true
47
47
  * }) // { backgroundColor: 'red' }
48
48
  * ```
49
- */export function getCSSProps(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&CSSPropertySet.has(c)&&(b[c]=a[c]);return b}/**
49
+ */export function getCSSProps(a){const b={};for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&CSSPropertySet.has(c)&&(b[c]=a[c]);return b}/**
50
50
  * Filters component props to include only valid DOM properties and attributes.
51
51
  *
52
52
  * This function iterates through the provided props and retains only those that
@@ -57,7 +57,7 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
57
57
  * @typeParam T - The type of the component props.
58
58
  * @param props The component props to filter.
59
59
  * @returns An object containing only valid DOM props.
60
- */export function getDOMProps(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&!CSSPropertySet.has(c)&&(b[c]=a[c]);return b}/**
60
+ */export function getDOMProps(a){const b={};for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&!CSSPropertySet.has(c)&&(b[c]=a[c]);return b}/**
61
61
  * Checks if a given tag is in the set of tags that should not receive style props.
62
62
  * @param tag The tag name to check (e.g., 'script', 'style').
63
63
  * @returns `true` if the tag is in the no-style set, otherwise `false`.
@@ -66,8 +66,8 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
66
66
  * @param obj The source object.
67
67
  * @param keys The property keys to omit.
68
68
  * @returns A new object without the omitted keys.
69
- */export function omit(a){for(var b={},c=arguments.length,d=Array(1<c?c-1:0),e=1;e<c;e++)d[e-1]=arguments[e];for(var f in a)Object.prototype.hasOwnProperty.call(a,f)&&!d.includes(f)&&(b[f]=a[f]);return b}/**
69
+ */export function omit(a,...b){const c={};for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&!b.includes(d)&&(c[d]=a[d]);return c}/**
70
70
  * Removes keys from an object whose values are `undefined`.
71
71
  * @param obj The source object.
72
72
  * @returns A new object without keys that have `undefined` values.
73
- */export function omitUndefined(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&void 0!==a[c]&&(b[c]=a[c]);return b}
73
+ */export function omitUndefined(a){const b={};for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&void 0!==a[c]&&(b[c]=a[c]);return b}
@@ -1,23 +1,23 @@
1
- function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function F(){};return{s:f,n:function n(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function e(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function s(){d=d.call(b)},n:function n(){var a=d.next();return h=a.done,a},e:function e(a){i=!0,g=a},f:function f(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}export class ObjHelper{constructor(){}/**
1
+ export class ObjHelper{constructor(){}/**
2
2
  * Build a serializable representation of `value`.
3
3
  * - preserves encoded placeholders for special types
4
4
  * - emits { $type: 'Circular', ref: id } for circular refs
5
- */static buildSerializable(a,b){var c=this;// Fast path for primitives
6
- if(null===a||void 0===a)return a;var d=_typeof(a);// Handle primitives first (most common case)
7
- if("string"===d||"number"===d||"boolean"===d)return a;// Handle functions
8
- if("function"===d){var e=b.functionIds.get(a);return void 0===e&&(e=b.nextFunctionId++,b.functionIds.set(a,e)),{$type:"Function",name:a.name||"",id:e}}// Handle other primitives
9
- if("symbol"===d){var f;return{$type:"Symbol",key:null!==(f=a.description)&&void 0!==f?f:""}}if("bigint"===d)return{$type:"BigInt",value:a.toString()};// Only objects beyond this point
10
- if("object"!==d)// Fallback for unknown types
5
+ */static buildSerializable(a,b){// Fast path for primitives
6
+ if(null===a||void 0===a)return a;const c=typeof a;// Handle primitives first (most common case)
7
+ if("string"==c||"number"===c||"boolean"===c)return a;// Handle functions
8
+ if("function"==c){let c=b.functionIds.get(a);return void 0===c&&(c=b.nextFunctionId++,b.functionIds.set(a,c)),{$type:"Function",name:a.name||"",id:c}}// Handle other primitives
9
+ if("symbol"==c)return{$type:"Symbol",key:a.description??""};if("bigint"==c)return{$type:"BigInt",value:a.toString()};// Only objects beyond this point
10
+ if("object"!=c)// Fallback for unknown types
11
11
  try{return a+""}catch(a){return"<unserializable>"}// Handle built-in object types before circular check (they're less likely to be circular)
12
12
  if(a instanceof Date)return{$type:"Date",value:a.toISOString()};if(a instanceof RegExp)return{$type:"RegExp",source:a.source,flags:a.flags};// Circular detection
13
- var g=b.seen.get(a);if(void 0!==g)return{$type:"Circular",ref:g};// Assign ID and mark as seen
14
- var h=b.nextObjId++;// Handle Map
15
- if(b.seen.set(a,h),a instanceof Map){var i,j=[],l=_createForOfIteratorHelper(a.entries());try{for(l.s();!(i=l.n()).done;){var m=_slicedToArray(i.value,2),n=m[0],o=m[1];j.push([this.buildSerializable(n,b),this.buildSerializable(o,b)])}}catch(a){l.e(a)}finally{l.f()}return{$type:"Map",entries:j}}// Handle Set
16
- if(a instanceof Set){var p,q=[],r=_createForOfIteratorHelper(a.values());try{for(r.s();!(p=r.n()).done;){var s=p.value;q.push(this.buildSerializable(s,b))}}catch(a){r.e(a)}finally{r.f()}return{$type:"Set",values:q}}// Handle Arrays
13
+ const d=b.seen.get(a);if(void 0!==d)return{$type:"Circular",ref:d};// Assign ID and mark as seen
14
+ const e=b.nextObjId++;// Handle Map
15
+ if(b.seen.set(a,e),a instanceof Map){const c=[];for(const[d,e]of a.entries())c.push([this.buildSerializable(d,b),this.buildSerializable(e,b)]);return{$type:"Map",entries:c}}// Handle Set
16
+ if(a instanceof Set){const c=[];for(const d of a.values())c.push(this.buildSerializable(d,b));return{$type:"Set",values:c}}// Handle Arrays
17
17
  if(Array.isArray(a))// Use map for cleaner code and potential engine optimizations
18
- return a.map(function(a){return c.buildSerializable(a,b)});// Handle plain objects
19
- try{for(var t,u=Object.keys(a),w={},x=0,y=u;x<y.length;x++){t=y[x];try{w[t]=this.buildSerializable(a[t],b)}catch(a){w[t]="<unserializable>"}}return w}catch(a){return"<unserializable>"}}/**
18
+ return a.map(a=>this.buildSerializable(a,b));// Handle plain objects
19
+ try{const c=Object.keys(a),d={};for(const e of c)try{d[e]=this.buildSerializable(a[e],b)}catch(a){d[e]="<unserializable>"}return d}catch(a){return"<unserializable>"}}/**
20
20
  * Stringify with performance optimizations.
21
21
  * @param obj Object to serialize
22
22
  * @param space JSON.stringify space parameter
23
- */static stringify(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,c={nextObjId:0,nextFunctionId:0,seen:new Map,functionIds:new Map},d=this.buildSerializable(a,c);return JSON.stringify(d,null,b)}}
23
+ */static stringify(a,b=0){const c={nextObjId:0,nextFunctionId:0,seen:new Map,functionIds:new Map},d=this.buildSerializable(a,c);return JSON.stringify(d,null,b)}}
@@ -1,11 +1,11 @@
1
- function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}/**
1
+ /**
2
2
  * Custom React Type Checker (TypeScript Version)
3
3
  * Provides utilities for identifying and checking React component/element types.
4
4
  * Inspired by react-is package but implemented in TypeScript with type safety.
5
5
  *//**
6
6
  * Symbol identifiers for React internal component types
7
7
  * These are used to identify different kinds of React elements and components
8
- */export var REACT_ELEMENT_TYPE=Symbol["for"]("react.transitional.element");export var REACT_PORTAL_TYPE=Symbol["for"]("react.portal");export var REACT_FRAGMENT_TYPE=Symbol["for"]("react.fragment");export var REACT_STRICT_MODE_TYPE=Symbol["for"]("react.strict_mode");export var REACT_PROFILER_TYPE=Symbol["for"]("react.profiler");export var REACT_PROVIDER_TYPE=Symbol["for"]("react.provider");export var REACT_CONSUMER_TYPE=Symbol["for"]("react.consumer");export var REACT_CONTEXT_TYPE=Symbol["for"]("react.context");export var REACT_FORWARD_REF_TYPE=Symbol["for"]("react.forward_ref");export var REACT_SUSPENSE_TYPE=Symbol["for"]("react.suspense");export var REACT_SUSPENSE_LIST_TYPE=Symbol["for"]("react.suspense_list");export var REACT_MEMO_TYPE=Symbol["for"]("react.memo");export var REACT_LAZY_TYPE=Symbol["for"]("react.lazy");export var REACT_VIEW_TRANSITION_TYPE=Symbol["for"]("react.view_transition");export var REACT_CLIENT_REFERENCE=Symbol["for"]("react.client.reference");export var REACT_ACTIVITY_TYPE=Symbol["for"]("react.activity");/**
8
+ */export const REACT_ELEMENT_TYPE=Symbol.for("react.transitional.element");export const REACT_PORTAL_TYPE=Symbol.for("react.portal");export const REACT_FRAGMENT_TYPE=Symbol.for("react.fragment");export const REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode");export const REACT_PROFILER_TYPE=Symbol.for("react.profiler");export const REACT_PROVIDER_TYPE=Symbol.for("react.provider");export const REACT_CONSUMER_TYPE=Symbol.for("react.consumer");export const REACT_CONTEXT_TYPE=Symbol.for("react.context");export const REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref");export const REACT_SUSPENSE_TYPE=Symbol.for("react.suspense");export const REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list");export const REACT_MEMO_TYPE=Symbol.for("react.memo");export const REACT_LAZY_TYPE=Symbol.for("react.lazy");export const REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition");export const REACT_CLIENT_REFERENCE=Symbol.for("react.client.reference");export const REACT_ACTIVITY_TYPE=Symbol.for("react.activity");/**
9
9
  * Union type of all possible React internal type symbols.
10
10
  * Used to strongly type return values from type checking functions.
11
11
  *//**
@@ -17,78 +17,78 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
17
17
  * to identify what kind of React element or component it represents.
18
18
  * @param {unknown} object The object to check
19
19
  * @returns {boolean} - The matching React type symbol or undefined if not a React object
20
- */export function typeOf(a){if("object"===_typeof(a)&&null!==a){var b=a.$$typeof;switch(b){case REACT_ELEMENT_TYPE:{var c=a.type;switch(c){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:case REACT_VIEW_TRANSITION_TYPE:return c;default:{var d=null===c||void 0===c?void 0:c.$$typeof;return d===REACT_CONTEXT_TYPE||d===REACT_FORWARD_REF_TYPE||d===REACT_LAZY_TYPE||d===REACT_MEMO_TYPE||d===REACT_PROVIDER_TYPE||d===REACT_CONSUMER_TYPE?d:b}}}case REACT_PORTAL_TYPE:return b}}}/**
20
+ */export function typeOf(a){if("object"==typeof a&&null!==a){const b=a.$$typeof;switch(b){case REACT_ELEMENT_TYPE:{const c=a.type;switch(c){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:case REACT_VIEW_TRANSITION_TYPE:return c;default:{const a=c?.$$typeof;return a===REACT_CONTEXT_TYPE||a===REACT_FORWARD_REF_TYPE||a===REACT_LAZY_TYPE||a===REACT_MEMO_TYPE||a===REACT_PROVIDER_TYPE||a===REACT_CONSUMER_TYPE?a:b}}}case REACT_PORTAL_TYPE:return b}}}/**
21
21
  * Checks if an object is a React Context Consumer
22
22
  * @param {unknown} object Object to check
23
23
  * @returns {boolean} - True if object is a Context.Consumer
24
- */export var isContextConsumer=function isContextConsumer(a){return typeOf(a)===REACT_CONSUMER_TYPE};/**
24
+ */export const isContextConsumer=a=>typeOf(a)===REACT_CONSUMER_TYPE;/**
25
25
  * Checks if an object is a React Context Provider
26
26
  * @param {unknown} object Object to check
27
27
  * @returns {boolean} - True if object is a Context.Provider
28
- */export var isContextProvider=function isContextProvider(a){return typeOf(a)===REACT_PROVIDER_TYPE};/**
28
+ */export const isContextProvider=a=>typeOf(a)===REACT_PROVIDER_TYPE;/**
29
29
  * Checks if an object is a valid React element
30
30
  * @param {unknown} object Object to check
31
31
  * @returns {boolean} - True if object is a React element
32
- */export var isElement=function isElement(a){return"object"===_typeof(a)&&null!==a&&a.$$typeof===REACT_ELEMENT_TYPE};/**
32
+ */export const isElement=a=>"object"==typeof a&&null!==a&&a.$$typeof===REACT_ELEMENT_TYPE;/**
33
33
  * Checks if an object is a React forwardRef component
34
34
  * @param {unknown} object Object to check
35
35
  * @returns {boolean} - True if object is a forwardRef component
36
- */export var isForwardRef=function isForwardRef(a){return typeOf(a)===REACT_FORWARD_REF_TYPE};/**
36
+ */export const isForwardRef=a=>typeOf(a)===REACT_FORWARD_REF_TYPE;/**
37
37
  * Checks if an object is a React Fragment
38
38
  * @param {unknown} object Object to check
39
39
  * @returns {boolean} - True if object is a Fragment
40
- */export var isFragment=function isFragment(a){return typeOf(a)===REACT_FRAGMENT_TYPE};/**
40
+ */export const isFragment=a=>typeOf(a)===REACT_FRAGMENT_TYPE;/**
41
41
  * Checks if an object is a React lazy component
42
42
  * @param {unknown} object Object to check
43
43
  * @returns {boolean} - True if object is a lazy component
44
- */export var isLazy=function isLazy(a){return typeOf(a)===REACT_LAZY_TYPE};/**
44
+ */export const isLazy=a=>typeOf(a)===REACT_LAZY_TYPE;/**
45
45
  * Checks if an object is a React memo component
46
46
  * @param {unknown} object Object to check
47
47
  * @returns {boolean} - True if object is a memo component
48
- */export var isMemo=function isMemo(a){return typeOf(a)===REACT_MEMO_TYPE};/**
48
+ */export const isMemo=a=>typeOf(a)===REACT_MEMO_TYPE;/**
49
49
  * Checks if an object is a React portal
50
50
  * @param {unknown} object Object to check
51
51
  * @returns {boolean} - True if object is a portal
52
- */export var isPortal=function isPortal(a){return typeOf(a)===REACT_PORTAL_TYPE};/**
52
+ */export const isPortal=a=>typeOf(a)===REACT_PORTAL_TYPE;/**
53
53
  * Checks if an object is a React Profiler
54
54
  * @param {unknown} object Object to check
55
55
  * @returns {boolean} - True if object is a Profiler
56
- */export var isProfiler=function isProfiler(a){return typeOf(a)===REACT_PROFILER_TYPE};/**
56
+ */export const isProfiler=a=>typeOf(a)===REACT_PROFILER_TYPE;/**
57
57
  * Checks if an object is a React StrictMode component
58
58
  * @param {unknown} object Object to check
59
59
  * @returns {boolean} - True if object is StrictMode
60
- */export var isStrictMode=function isStrictMode(a){return typeOf(a)===REACT_STRICT_MODE_TYPE};/**
60
+ */export const isStrictMode=a=>typeOf(a)===REACT_STRICT_MODE_TYPE;/**
61
61
  * Checks if an object is a React Suspense component
62
62
  * @param {unknown} object Object to check
63
63
  * @returns {boolean} - True if object is Suspense
64
- */export var isSuspense=function isSuspense(a){return typeOf(a)===REACT_SUSPENSE_TYPE};/**
64
+ */export const isSuspense=a=>typeOf(a)===REACT_SUSPENSE_TYPE;/**
65
65
  * Checks if an object is a React SuspenseList component
66
66
  * @param {unknown} object Object to check
67
67
  * @returns {boolean} - True if `object` is SuspenseList
68
- */export var isSuspenseList=function isSuspenseList(a){return typeOf(a)===REACT_SUSPENSE_LIST_TYPE};/**
68
+ */export const isSuspenseList=a=>typeOf(a)===REACT_SUSPENSE_LIST_TYPE;/**
69
69
  * Checks if an object is a React ViewTransition component
70
70
  * @param {unknown} object Object to check
71
71
  * @returns {boolean} - True if object is ViewTransition
72
- */export var isViewTransition=function isViewTransition(a){return typeOf(a)===REACT_VIEW_TRANSITION_TYPE};/**
72
+ */export const isViewTransition=a=>typeOf(a)===REACT_VIEW_TRANSITION_TYPE;/**
73
73
  * Checks if an object is a React Activity component
74
74
  * @param {unknown} object Object to check
75
75
  * @returns {boolean} - True if object is Activity
76
- */export var isActivity=function isActivity(a){return typeOf(a)===REACT_ACTIVITY_TYPE};/**
76
+ */export const isActivity=a=>typeOf(a)===REACT_ACTIVITY_TYPE;/**
77
77
  * Set of known valid React special element types.
78
78
  * Used for quick validation of element types in isValidElementType().
79
79
  * Includes Fragment, Profiler, StrictMode, Suspense and SuspenseList.
80
- */var knownValidSymbols=new Set([REACT_FRAGMENT_TYPE,REACT_PROFILER_TYPE,REACT_STRICT_MODE_TYPE,REACT_SUSPENSE_TYPE,REACT_SUSPENSE_LIST_TYPE,REACT_VIEW_TRANSITION_TYPE,REACT_ACTIVITY_TYPE]);/**
80
+ */const knownValidSymbols=new Set([REACT_FRAGMENT_TYPE,REACT_PROFILER_TYPE,REACT_STRICT_MODE_TYPE,REACT_SUSPENSE_TYPE,REACT_SUSPENSE_LIST_TYPE,REACT_VIEW_TRANSITION_TYPE,REACT_ACTIVITY_TYPE]);/**
81
81
  * Checks if a type is a valid React element type that can be rendered.
82
82
  * This includes strings (for DOM elements), functions (for components),
83
83
  * and various React-specific types like Fragment, Context, etc.
84
84
  * @param {any} type The type to validate
85
85
  * @returns {boolean} - True if the type can be rendered as a React element
86
- */export var isValidElementType=function isValidElementType(a){if("string"==typeof a||"number"==typeof a||"bigint"==typeof a||"function"==typeof a)return!0;if(knownValidSymbols.has(a))return!0;if("object"===_typeof(a)&&null!==a){var b=a.$$typeof;return b===REACT_LAZY_TYPE||b===REACT_MEMO_TYPE||b===REACT_CONTEXT_TYPE||b===REACT_CONSUMER_TYPE||b===REACT_FORWARD_REF_TYPE||b===REACT_CLIENT_REFERENCE||b===REACT_PROVIDER_TYPE}return!1};/**
86
+ */export const isValidElementType=a=>{if("string"==typeof a||"number"==typeof a||"bigint"==typeof a||"function"==typeof a)return!0;if(knownValidSymbols.has(a))return!0;if("object"==typeof a&&null!==a){const b=a.$$typeof;return b===REACT_LAZY_TYPE||b===REACT_MEMO_TYPE||b===REACT_CONTEXT_TYPE||b===REACT_CONSUMER_TYPE||b===REACT_FORWARD_REF_TYPE||b===REACT_CLIENT_REFERENCE||b===REACT_PROVIDER_TYPE}return!1};/**
87
87
  * Type guard that checks if a component is a React class component.
88
88
  * Examines the component's prototype for the isReactComponent marker property
89
89
  * that React adds to all class components.
90
90
  * @param {unknown} component Component to check
91
91
  * @returns {boolean} - True if component is a React class component
92
- */export var isReactClassComponent=function isReactClassComponent(a){if("function"!=typeof a)return!1;// Check for `isReactComponent` flag which is set on class components.
92
+ */export const isReactClassComponent=a=>{if("function"!=typeof a)return!1;// Check for `isReactComponent` flag which is set on class components.
93
93
  // Also handles components created with React.createClass.
94
- var b=a.prototype;return!!(b&&b.isReactComponent)};
94
+ const b=a.prototype;return!!(b&&b.isReactComponent)};
@@ -47,4 +47,4 @@ import{BaseNode,Node}from"../core.node.js";import{getElementTypeName}from"../hel
47
47
  *//**
48
48
  * Internal implementation of the `Component` HOC.
49
49
  * Handles BaseNode conversion and wrapper creation.
50
- */export function Component(a){function Func(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},b=1<arguments.length?arguments[1]:void 0;return Node(c,a,b).render()}var b=getElementTypeName(a),c=function Renderer(b){var c=a(b);return c instanceof BaseNode||NodeUtil.isNodeInstance(c)?Node(c.element,c.rawProps).render():c};return c.displayName="Renderer(".concat(b,")"),Func.displayName="Component(".concat(b,")"),Func}
50
+ */export function Component(a){function Func(a={},b){return Node(c,a,b).render()}const b=getElementTypeName(a),c=b=>{const c=a(b);return c instanceof BaseNode||NodeUtil.isNodeInstance(c)?Node(c.element,c.rawProps).render():c};return c.displayName=`Renderer(${b})`,Func.displayName=`Component(${b})`,Func}
@@ -1,4 +1,4 @@
1
- var _excluded=["provider"];function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],-1===b.indexOf(c)&&{}.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c={};for(var d in a)if({}.hasOwnProperty.call(a,d)){if(-1!==b.indexOf(d))continue;c[d]=a[d]}return c}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{BaseNode,Node}from"../core.node.js";// --- Function Overloads ---
1
+ const _excluded=["provider"];function _objectWithoutProperties(a,b){if(null==a)return{};var c,d,e=_objectWithoutPropertiesLoose(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],-1===b.indexOf(c)&&{}.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}function _objectWithoutPropertiesLoose(a,b){if(null==a)return{};var c={};for(var d in a)if({}.hasOwnProperty.call(a,d)){if(-1!==b.indexOf(d))continue;c[d]=a[d]}return c}function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{BaseNode,Node}from"../core.node.js";// --- Function Overloads ---
2
2
  /**
3
3
  * Higher-Order Component (HOC) to create and manage React portals with optional provider wrapping.
4
4
  * This function supports two overloads:
@@ -48,26 +48,26 @@ var _excluded=["provider"];function _typeof(a){"@babel/helpers - typeof";return
48
48
  * const portalInstance = MyPortal({ provider: AnotherProviderNodeInstance, someProp: 'value' });
49
49
  */// --- Implementation ---
50
50
  export function Portal(a,b){// --- Initialization ---
51
- var c,d=void 0,e={unmount:function unmount(){console.warn("Portal instance not yet created. Cannot unmount.")},update:function update(a){console.warn("Portal instance not yet created. Cannot update.",a)}};// --- Argument Parsing and Overload Handling ---
51
+ let c,d,e={unmount:()=>{console.warn("Portal instance not yet created. Cannot unmount.")},update:a=>{console.warn("Portal instance not yet created. Cannot update.",a)}};// --- Argument Parsing and Overload Handling ---
52
52
  // Determines which Portal overload was called (e.g., with fixed provider or just component).
53
53
  if("function"==typeof b&&a instanceof BaseNode)// Handles the case where a fixed provider (single) is passed.
54
- d=[a],c=b;else if("function"==typeof a&&b===void 0)// Handles the case where only the component function is passed.
55
- c=a;else throw new Error("Invalid arguments for Portal HOC. Use Portal(component) or Portal(providerNodeInstance, component).");// --- Core Content Renderer Function ---
54
+ c=[a],d=b;else if("function"==typeof a&&b===void 0)// Handles the case where only the component function is passed.
55
+ d=a;else throw new Error("Invalid arguments for Portal HOC. Use Portal(component) or Portal(providerNodeInstance, component).");// --- Core Content Renderer Function ---
56
56
  // This function is the actual React component that will be rendered inside the portal.
57
- var f=function Renderer(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=c(_objectSpread(_objectSpread({},a),{},{portal:e// Passes the portal control object to the content component
57
+ const f=(a={})=>{const b=d(_objectSpread(_objectSpread({},a),{},{portal:e// Passes the portal control object to the content component
58
58
  }));// If the result is a BaseNode, render it.
59
59
  return b instanceof BaseNode?b.render():b};// --- Portal Launcher Function (Returned to User) ---
60
60
  // This is the function that developers call to actually create and manage a portal instance.
61
- return function Func(){// --- Helper for Deep Content Injection ---
61
+ return function Func(a={}){// --- Helper for Deep Content Injection ---
62
62
  // Recursively injects content into the deepest child of a provider chain.
63
- function injectContentDeeply(a,b){var c,d=null===(c=a.rawProps)||void 0===c?void 0:c.children;// If no children, or children is not a NodeInstance, inject directly
64
- if(!d||!(d instanceof BaseNode))return Node(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{children:b}));// Recursively inject into the deepest node
65
- var e=injectContentDeeply(d,b);return Node(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{children:e}))}// --- Provider Wrapping Logic ---
63
+ function injectContentDeeply(a,b){const c=a.rawProps?.children;// If no children, or children is not a NodeInstance, inject directly
64
+ if(!c||!(c instanceof BaseNode))return Node(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{children:b}));// Recursively inject into the deepest node
65
+ const d=injectContentDeeply(c,b);return Node(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{children:d}))}// --- Provider Wrapping Logic ---
66
66
  // Iterates through the combined providers (fixed + dynamic) to wrap the content.
67
67
  // Providers are applied in reverse order to ensure the innermost content is wrapped by the outermost provider.
68
- var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=[];// Combine fixed and dynamic providers
69
- b.provider&&c.push(b.provider);var g=[...(null!==d&&void 0!==d?d:[]),...c],h=b.provider,i=_objectWithoutProperties(b,_excluded),j=Node(f,i);// Separates props for the portal's content from internal props like 'provider'.
68
+ let b;// Combine fixed and dynamic providers
69
+ const d=[];a.provider&&d.push(a.provider);const g=[...(c??[]),...d],{provider:h}=a,i=_objectWithoutProperties(a,_excluded),j=Node(f,i);// Separates props for the portal's content from internal props like 'provider'.
70
70
  // Creates the base node for the portal's content.
71
- return a=0<g.length?g.reduceRight(function(a,b){var c;if(!(b instanceof BaseNode))return console.warn("Portal: Item in provider is not a valid NodeInstance. Skipping.",b),a;var d=(null===(c=b.rawProps)||void 0===c?void 0:c.children)instanceof BaseNode;// If the provider already has nested children, inject content deeply.
71
+ return b=0<g.length?g.reduceRight((a,b)=>{if(!(b instanceof BaseNode))return console.warn("Portal: Item in provider is not a valid NodeInstance. Skipping.",b),a;const c=b.rawProps?.children instanceof BaseNode;// If the provider already has nested children, inject content deeply.
72
72
  // Otherwise, simply set currentWrappedContent as its direct child.
73
- return d?injectContentDeeply(b,a):Node(b.element,_objectSpread(_objectSpread({},b.rawProps),{},{children:a}))},j):j,e=a.toPortal(),e}}
73
+ return c?injectContentDeeply(b,a):Node(b.element,_objectSpread(_objectSpread({},b.rawProps),{},{children:a}))},j):j,e=b.toPortal(),e}}
@@ -1,4 +1,4 @@
1
- "use client";function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}import{useCallback,useEffect,useRef}from"react";import{Node}from"../core.node.js";/**
1
+ "use client";import{useCallback,useEffect,useRef}from"react";import{Node}from"../core.node.js";/**
2
2
  * Hook for managing a portal that renders node components outside the React component tree.
3
3
  * @deprecated This hook is unstable and will likely be removed in future versions
4
- */export function usePortal(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:[],b=useRef({}),c=useCallback(function(a){return b.current.component=a,new Proxy(a,{apply:function apply(a,c,d){var e=_slicedToArray(d,1),f=e[0];return b.current.props=f,a.call(c,f)}})},[]);return useEffect(function(){var a=b.current,c=a.portal,d=a.component,e=a.props;c&&d&&c.update(Node(d,e))},a),useEffect(function(){return function(){var a;null===(a=b.current.portal)||void 0===a||a.unmount(),b.current.portal=void 0,b.current.component=void 0,b.current.props=void 0}},[]),{portal:b.current.portal,setPortal:function setPortal(a){return b.current.portal=a},createComponent:c}}
4
+ */export function usePortal(a=[]){const b=useRef({}),c=useCallback(a=>(b.current.component=a,new Proxy(a,{apply:(a,c,[d])=>(b.current.props=d,a.call(c,d))})),[]);return useEffect(()=>{const{portal:a,component:c,props:d}=b.current;a&&c&&a.update(Node(c,d))},a),useEffect(()=>()=>{b.current.portal?.unmount(),b.current.portal=void 0,b.current.component=void 0,b.current.props=void 0},[]),{portal:b.current.portal,setPortal:a=>b.current.portal=a,createComponent:c}}
@@ -3,6 +3,6 @@
3
3
  * It also handles side effects like updating localStorage and applying the theme to the document root.
4
4
  * @returns {ThemeContextValue} The theme context value.
5
5
  * @throws {Error} If used outside a ThemeProvider.
6
- */export var useTheme=function useTheme(){var a=useContext(ThemeContext);if(!a)throw new Error("useTheme must be used within a ThemeProvider");var b=a.theme;return useEffect(function(){// Sync theme mode with localStorage
7
- var a=localStorage.getItem("theme");a&&a===b.mode||localStorage.setItem("theme",b.mode);// Apply theme to document root
8
- var c=document.documentElement;"dark"===b.mode?(c.setAttribute("data-theme","dark"),c.classList.add("dark-theme"),c.classList.remove("light-theme")):(c.setAttribute("data-theme","light"),c.classList.add("light-theme"),c.classList.remove("dark-theme"))},[b.mode,b.system]),a};
6
+ */export const useTheme=()=>{const a=useContext(ThemeContext);if(!a)throw new Error("useTheme must be used within a ThemeProvider");const{theme:b}=a;return useEffect(()=>{// Sync theme mode with localStorage
7
+ const a=localStorage.getItem("theme");a&&a===b.mode||localStorage.setItem("theme",b.mode);// Apply theme to document root
8
+ const c=document.documentElement;"dark"===b.mode?(c.setAttribute("data-theme","dark"),c.classList.add("dark-theme"),c.classList.remove("light-theme")):(c.setAttribute("data-theme","light"),c.classList.add("light-theme"),c.classList.remove("dark-theme"))},[b.mode,b.system]),a};
@@ -1,5 +1,5 @@
1
1
  import _StyleRegistry from '../components/registry.client.js';
2
- export declare const StyleRegistry: (<AdditionalProps extends Record<string, any> = Record<string, any>>(props: import("../main").MergedProps<typeof _StyleRegistry, AdditionalProps>, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<typeof _StyleRegistry>) & {
2
+ export declare const StyleRegistry: (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props: import("../main").MergedProps<typeof _StyleRegistry, AdditionalProps>, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<typeof _StyleRegistry>) & {
3
3
  element: typeof _StyleRegistry;
4
4
  };
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- import _StyleRegistry from"../components/registry.client.js";import{createNode}from"../core.node.js";export var StyleRegistry=createNode(_StyleRegistry);
1
+ import _StyleRegistry from"../components/registry.client.js";import{createNode}from"../core.node.js";export const StyleRegistry=createNode(_StyleRegistry);
@@ -237,5 +237,10 @@ export type PortalLauncher<P extends BasePortalProps | Record<string, any>> = (p
237
237
  * @template AdditionalProps - The additional props to merge in
238
238
  */
239
239
  export type MergedProps<E extends NodeElement, AdditionalProps extends Record<string, any>> = Omit<NodeProps<E> & AdditionalProps, keyof AdditionalProps> & AdditionalProps;
240
+ export interface WorkItem {
241
+ node: NodeInstance;
242
+ isProcessed: boolean;
243
+ blocked: boolean;
244
+ }
240
245
  export {};
241
246
  //# sourceMappingURL=node.type.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.type.d.ts","sourceRoot":"","sources":["../../src/types/node.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,aAAa,EACnB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE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CAAC,GAAG,eAAe,EAAE,MAAM,eAAe,CAAC,GACvJ,eAAe,CAAA;AAEjB,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,YAAY,CAAA;IAClB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;CACjB"}
@@ -1,15 +1,15 @@
1
- function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{__DEBUG__}from"../constants/common.const.js";/**
1
+ function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{__DEBUG__}from"../constants/common.const.js";/**
2
2
  * MountTrackerUtil keeps track of which BaseNode instances are currently mounted in the DOM.
3
3
  * It provides a simple registry for mount/unmount state that other systems
4
4
  * (like NavigationCacheManager) can query for safe cache eviction.
5
5
  */export class MountTrackerUtil{constructor(){}// Debug only
6
6
  /**
7
7
  * Tracks a node as mounted. Adds its stable key and a WeakRef to the node to the map of mounted nodes.
8
- */static trackMount(a){this.mountedNodes.add(a),__DEBUG__&&this._unmountCallCount["delete"](a)}/**
8
+ */static trackMount(a){this.mountedNodes.add(a),__DEBUG__&&this._unmountCallCount.delete(a)}/**
9
9
  * Removes its stable key from the set of mounted nodes.
10
10
  * In development mode, it also tracks multiple unmount calls for debugging purposes.
11
11
  * @returns True if the node was previously tracked as mounted and is now removed, false otherwise.
12
- */static untrackMount(a){var b=this.mountedNodes["delete"](a);if(__DEBUG__&&!b){var c=(this._unmountCallCount.get(a)||0)+1;this._unmountCallCount.set(a,c),1<c&&console.warn("[MeoNode] untrackMount called ".concat(c," times for an already unmounted node: ").concat(a,". This could indicate a memory leak or a bug in a component's lifecycle."))}return b}/**
12
+ */static untrackMount(a){const b=this.mountedNodes.delete(a);if(__DEBUG__&&!b){const b=(this._unmountCallCount.get(a)||0)+1;this._unmountCallCount.set(a,b),1<b&&console.warn(`[MeoNode] untrackMount called ${b} times for an already unmounted node: ${a}. This could indicate a memory leak or a bug in a component's lifecycle.`)}return b}/**
13
13
  * Cleans up all internal state of the MountTrackerUtil.
14
14
  * Removes all tracked nodes and debug counters.
15
15
  */static cleanup(){this.mountedNodes.clear(),__DEBUG__&&this._unmountCallCount.clear()}}_defineProperty(MountTrackerUtil,"mountedNodes",new Set),_defineProperty(MountTrackerUtil,"_unmountCallCount",new Map);
@@ -1,3 +1,8 @@
1
+ declare global {
2
+ interface Window {
3
+ __MEONODE_CLEANUP_REGISTERED?: boolean;
4
+ }
5
+ }
1
6
  /**
2
7
  * Lightweight navigation handler that clears cache on SPA navigation.
3
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-cache-manager.util.d.ts","sourceRoot":"","sources":["../../src/util/navigation-cache-manager.util.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,qBAAa,0BAA0B;IACrC,OAAO,eAAiB;IAExB,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0C;IAClE,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAwC;IACzE,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA2C;IAC/E,OAAO,CAAC,MAAM,CAAC,UAAU,CAAQ;IAEjC,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,eAAe,CAAY;IAEnC,OAAc,WAAW,IAAI,0BAA0B,CAKtD;IAED;;OAEG;IACI,KAAK,SAaX;IAED;;;OAGG;IACH,OAAO,CAAC,KAAK;IAkBb;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAyBxB;IAED;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmB5B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAW1B"}
1
+ {"version":3,"file":"navigation-cache-manager.util.d.ts","sourceRoot":"","sources":["../../src/util/navigation-cache-manager.util.ts"],"names":[],"mappings":"AAIA,OAAO,CAAC,MAAM,CAAC,CAAC;IACd,UAAU,MAAM;QACd,4BAA4B,CAAC,EAAE,OAAO,CAAA;KACvC;CACF;AAED;;GAEG;AACH,qBAAa,0BAA0B;IACrC,OAAO,eAAiB;IAExB,OAAO,CAAC,MAAM,CAAC,SAAS,CAA0C;IAClE,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAwC;IACzE,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAA2C;IAC/E,OAAO,CAAC,MAAM,CAAC,UAAU,CAAQ;IAEjC,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,eAAe,CAA8B;IAErD,OAAc,WAAW,IAAI,0BAA0B,CAKtD;IAED;;OAEG;IACI,KAAK,SAaX;IAED;;;OAGG;IACH,OAAO,CAAC,KAAK;IAkBb;;OAEG;IACH,OAAO,CAAC,iBAAiB,CA4BxB;IAED;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAmB5B;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAW1B"}
@@ -1,9 +1,9 @@
1
- function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==_typeof(b)?b:b+""}function _toPrimitive(a,b){if("object"!=_typeof(a)||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=_typeof(d))return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{__DEBUG__}from"../constants/common.const.js";import{BaseNode}from"../core.node.js";import{MountTrackerUtil}from"./mount-tracker.util.js";/**
1
+ function _defineProperty(a,b,c){return(b=_toPropertyKey(b))in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}import{__DEBUG__}from"../constants/common.const.js";import{BaseNode}from"../core.node.js";import{MountTrackerUtil}from"./mount-tracker.util.js";/**
2
2
  * Lightweight navigation handler that clears cache on SPA navigation.
3
- */export class NavigationCacheManagerUtil{constructor(){var a=this;/**
3
+ */export class NavigationCacheManagerUtil{constructor(){/**
4
4
  * Debounced navigation handler. Clears mounted element cache and props cache.
5
- */_defineProperty(this,"_isListening",!1),_defineProperty(this,"_cleanupTimeout",null),_defineProperty(this,"_handleNavigation",function(){a._cleanupTimeout&&clearTimeout(a._cleanupTimeout),a._cleanupTimeout=setTimeout(function(){var a=BaseNode.propProcessingCache.size,b=0;// Only clean UNMOUNTED elements
6
- BaseNode.elementCache.keys().forEach(function(a){MountTrackerUtil.mountedNodes.has(a)||(BaseNode.elementCache["delete"](a),b++)}),200<a&&BaseNode.propProcessingCache.clear(),__DEBUG__&&console.log("[MeoNode] Navigation: cleared ".concat(b," unmounted elements, ").concat(a," props entries"))},100)})}static getInstance(){return this._instance||(this._instance=new NavigationCacheManagerUtil),this._instance}/**
5
+ */_defineProperty(this,"_isListening",!1),_defineProperty(this,"_cleanupTimeout",null),_defineProperty(this,"_handleNavigation",()=>{this._cleanupTimeout&&clearTimeout(this._cleanupTimeout);const a=BaseNode.elementCache.size,b=100>a?50:500>a?100:200;this._cleanupTimeout=setTimeout(()=>{const a=BaseNode.propProcessingCache.size;let b=0;// Only clean UNMOUNTED elements
6
+ BaseNode.elementCache.keys().forEach(a=>{MountTrackerUtil.mountedNodes.has(a)||(BaseNode.elementCache.delete(a),b++)}),200<a&&BaseNode.propProcessingCache.clear(),__DEBUG__&&console.log(`[MeoNode] Navigation: cleared ${b} unmounted elements, ${a} props entries`)},b)})}static getInstance(){return this._instance||(this._instance=new NavigationCacheManagerUtil),this._instance}/**
7
7
  * Start listening for navigation events. Idempotent.
8
8
  */start(){this._isListening||"undefined"==typeof window||(// Setup automatic cleanup on page unload
9
9
  this._isListening=!0,window.addEventListener("popstate",this._handleNavigation),this._patchHistoryMethods(),this._setupAutoCleanup(),__DEBUG__&&console.log("[MeoNode] NavigationCacheManagerUtil started"))}/**
@@ -11,9 +11,9 @@ this._isListening=!0,window.addEventListener("popstate",this._handleNavigation),
11
11
  * This is important for cleanup during HMR or when unmounting the library.
12
12
  */_stop(){this._isListening&&"undefined"!=typeof window&&(window.removeEventListener("popstate",this._handleNavigation),this._cleanupTimeout&&(clearTimeout(this._cleanupTimeout),this._cleanupTimeout=null),this._isListening=!1,__DEBUG__&&console.log("[MeoNode] NavigationCacheManagerUtil stopped"))}/**
13
13
  * Patch history.pushState/replaceState to detect SPA navigation.
14
- */_patchHistoryMethods(){var a=this;NavigationCacheManagerUtil._isPatched||(NavigationCacheManagerUtil._originalPushState=history.pushState,NavigationCacheManagerUtil._originalReplaceState=history.replaceState,history.pushState=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];NavigationCacheManagerUtil._originalPushState.apply(history,c),a._handleNavigation()},history.replaceState=function(){for(var b=arguments.length,c=Array(b),d=0;d<b;d++)c[d]=arguments[d];NavigationCacheManagerUtil._originalReplaceState.apply(history,c),a._handleNavigation()},NavigationCacheManagerUtil._isPatched=!0)}/**
14
+ */_patchHistoryMethods(){NavigationCacheManagerUtil._isPatched||(NavigationCacheManagerUtil._originalPushState=history.pushState,NavigationCacheManagerUtil._originalReplaceState=history.replaceState,history.pushState=(...a)=>{NavigationCacheManagerUtil._originalPushState.apply(history,a),this._handleNavigation()},history.replaceState=(...a)=>{NavigationCacheManagerUtil._originalReplaceState.apply(history,a),this._handleNavigation()},NavigationCacheManagerUtil._isPatched=!0)}/**
15
15
  * Setup automatic cleanup on page unload.
16
16
  * Covers HMR, navigation away, and browser close.
17
- */_setupAutoCleanup(){var a=this;// Only set up once
17
+ */_setupAutoCleanup(){// Only set up once
18
18
  window.__MEONODE_CLEANUP_REGISTERED||(// Handle page unload (navigation away, refresh, close)
19
- window.addEventListener("beforeunload",function(){a._stop(),BaseNode.clearCaches()}),window.__MEONODE_CLEANUP_REGISTERED=!0)}}_defineProperty(NavigationCacheManagerUtil,"_instance",null),_defineProperty(NavigationCacheManagerUtil,"_originalPushState",null),_defineProperty(NavigationCacheManagerUtil,"_originalReplaceState",null),_defineProperty(NavigationCacheManagerUtil,"_isPatched",!1);
19
+ window.addEventListener("beforeunload",()=>{this._stop(),BaseNode.clearCaches()}),window.__MEONODE_CLEANUP_REGISTERED=!0)}}_defineProperty(NavigationCacheManagerUtil,"_instance",null),_defineProperty(NavigationCacheManagerUtil,"_originalPushState",null),_defineProperty(NavigationCacheManagerUtil,"_originalReplaceState",null),_defineProperty(NavigationCacheManagerUtil,"_isPatched",!1);
@@ -1,5 +1,6 @@
1
1
  import React, { type ReactNode } from 'react';
2
- import type { FunctionRendererProps, NodeElement, NodeElementType, NodeFunction, NodeInstance, DependencyList, NodePortal, FinalNodeProps } from '../types/node.type.js';
2
+ import type { FunctionRendererProps, NodeElement, NodeElementType, NodeFunction, NodeInstance, NodeProps, DependencyList, FinalNodeProps, NodePortal } from '../types/node.type.js';
3
+ import { type Root } from 'react-dom/client';
3
4
  /**
4
5
  * NodeUtil provides a collection of static utility methods and properties
5
6
  * used internally by BaseNode for various tasks such as hashing, shallow comparison,
@@ -9,11 +10,10 @@ import type { FunctionRendererProps, NodeElement, NodeElementType, NodeFunction,
9
10
  export declare class NodeUtil {
10
11
  private constructor();
11
12
  static isServer: boolean;
12
- private static _elementIdMap;
13
- private static _elementIdCounter;
14
13
  private static _functionSignatureCache;
15
14
  private static readonly CACHE_SIZE_LIMIT = 500;
16
15
  private static readonly CACHE_CLEANUP_BATCH = 50;
16
+ private static readonly CRITICAL_PROPS;
17
17
  static portalInfrastructure: WeakMap<NodeInstance, {
18
18
  domElement: HTMLDivElement;
19
19
  reactRoot: NodePortal & {
@@ -32,17 +32,13 @@ export declare class NodeUtil {
32
32
  * @returns True if the object is a NodeInstance, false otherwise.
33
33
  */
34
34
  static isNodeInstance: (obj: unknown) => obj is NodeInstance;
35
- static isStyleProp: (k: string) => boolean;
36
- /**
37
- * FNV-1a hash function.
38
- * @method fnv1aHash
39
- */
40
- static fnv1aHash(str: string): number;
41
35
  /**
42
- * djb2 hash function.
43
- * @method djb2Hash
36
+ * Determines if a given string `k` is a valid CSS style property.
37
+ * This check is performed only on the client-side by checking if the property exists in `document.body.style`.
38
+ * On the server-side, it always returns `false`.
39
+ * @param k The string to check.
44
40
  */
45
- static djb2Hash(str: string): number;
41
+ static isStyleProp: (k: string) => boolean;
46
42
  /**
47
43
  * Combines FNV-1a and djb2 hash functions for a more robust signature.
48
44
  * @method hashString
@@ -52,29 +48,29 @@ export declare class NodeUtil {
52
48
  * Performs a shallow equality check between two objects.
53
49
  * @method shallowEqual
54
50
  */
55
- static shallowEqual(a: Record<string, any>, b: Record<string, any>): boolean;
56
- /**
57
- * Generates a stable identifier for the given element type.
58
- * For primitive types (strings), it returns the string itself.
59
- * For component types (functions, classes, exotic components), it generates
60
- * and caches a unique ID using a WeakMap to ensure stability across calls.
61
- * @method getStableElementId
62
- */
63
- static getStableElementId(element: NodeElementType): string | undefined;
51
+ static shallowEqual(a: Record<string, unknown>, b: Record<string, unknown>): boolean;
64
52
  /**
65
53
  * Creates a unique, stable signature from the element type and props.
66
54
  * This signature includes the element's type to prevent collisions between different components
67
55
  * and handles primitive values in arrays and objects for better caching.
68
56
  * @method createPropSignature
69
57
  */
70
- static createPropSignature(element: NodeElementType, props: Record<string, any>): string;
58
+ static createPropSignature(element: NodeElementType, props: Record<string, unknown>): string | undefined;
59
+ /**
60
+ * Extracts "critical" props from a given set of props. Critical props are those
61
+ * that are frequently used for styling or event handling, such as `on*` handlers,
62
+ * `aria-*` attributes, `data-*` attributes, `css`, `className`, and `style`.
63
+ * This method is used to optimize prop processing by focusing on props that are
64
+ * most likely to influence rendering or behavior.
65
+ */
66
+ static extractCriticalProps(props: Record<string, unknown>, keys: string[]): Record<string, unknown>;
71
67
  /**
72
68
  * Retrieves computed CSS props from the cache with LRU tracking.
73
69
  * Access time and hit count are tracked for smarter eviction.
74
70
  * @method getCachedCssProps
75
71
  */
76
- static getCachedCssProps(cacheableProps: Record<string, any>, signature?: string): {
77
- cssProps: Record<string, any>;
72
+ static getCachedCssProps(cacheableProps: Record<string, unknown>, signature?: string): {
73
+ cssProps: Record<string, unknown>;
78
74
  };
79
75
  /**
80
76
  * Implements an LRU eviction strategy that removes multiple entries at once.
@@ -87,7 +83,7 @@ export declare class NodeUtil {
87
83
  * generates a signature for caching, and assembles the final props object.
88
84
  * @method processProps
89
85
  */
90
- static processProps(element: NodeElementType, rawProps: Partial<any> | undefined, stableKey: string): FinalNodeProps;
86
+ static processProps(element: NodeElementType, rawProps?: Partial<NodeProps<NodeElementType>>, stableKey?: string): FinalNodeProps;
91
87
  /**
92
88
  * Processes and normalizes children of the node.
93
89
  * Converts raw children (React elements, primitives, or other BaseNodes) into a consistent format.
@@ -153,7 +149,7 @@ export declare class NodeUtil {
153
149
  static ensurePortalInfrastructure(node: NodeInstance): boolean;
154
150
  static cleanupPortalInfra(infra: {
155
151
  domElement: HTMLDivElement;
156
- reactRoot: any;
152
+ reactRoot: Root;
157
153
  }): void;
158
154
  }
159
155
  //# sourceMappingURL=node.util.d.ts.map