@meonode/ui 0.4.7 → 0.4.9

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 (54) hide show
  1. package/CHANGELOG.md +73 -1
  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/constant/common.const.d.ts.map +1 -0
  18. package/dist/constant/common.const.js +1 -0
  19. package/dist/constant/css-properties.const.d.ts.map +1 -0
  20. package/dist/constant/css-properties.const.js +1 -0
  21. package/dist/core.node.d.ts +9 -9
  22. package/dist/core.node.d.ts.map +1 -1
  23. package/dist/core.node.js +44 -39
  24. package/dist/helper/common.helper.js +9 -9
  25. package/dist/helper/obj.helper.js +14 -14
  26. package/dist/helper/react-is.helper.js +21 -21
  27. package/dist/hoc/component.hoc.js +1 -1
  28. package/dist/hoc/portal.hoc.js +13 -13
  29. package/dist/hook/usePortal.js +2 -2
  30. package/dist/hook/useTheme.js +3 -3
  31. package/dist/main.d.ts +1 -1
  32. package/dist/main.d.ts.map +1 -1
  33. package/dist/main.js +1 -1
  34. package/dist/nextjs-registry/index.d.ts +1 -1
  35. package/dist/nextjs-registry/index.js +1 -1
  36. package/dist/types/node.type.d.ts +6 -1
  37. package/dist/types/node.type.d.ts.map +1 -1
  38. package/dist/util/mount-tracker.util.js +3 -3
  39. package/dist/util/navigation-cache-manager.util.d.ts +5 -0
  40. package/dist/util/navigation-cache-manager.util.d.ts.map +1 -1
  41. package/dist/util/navigation-cache-manager.util.js +7 -7
  42. package/dist/util/node.util.d.ts +15 -12
  43. package/dist/util/node.util.d.ts.map +1 -1
  44. package/dist/util/node.util.js +67 -75
  45. package/dist/util/theme.util.d.ts +6 -6
  46. package/dist/util/theme.util.d.ts.map +1 -1
  47. package/dist/util/theme.util.js +17 -16
  48. package/package.json +11 -8
  49. package/dist/constants/common.const.d.ts.map +0 -1
  50. package/dist/constants/common.const.js +0 -1
  51. package/dist/constants/css-properties.const.d.ts.map +0 -1
  52. package/dist/constants/css-properties.const.js +0 -1
  53. /package/dist/{constants → constant}/common.const.d.ts +0 -0
  54. /package/dist/{constants → constant}/css-properties.const.d.ts +0 -0
@@ -1,4 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
+ import type { NodeInstance } from '../types/node.type.js';
2
3
  /**
3
4
  * `MeoNodeUnmounter` is a client-side React component responsible for cleaning up
4
5
  * resources associated with a rendered node when it unmounts.
@@ -7,13 +8,15 @@ import { type ReactNode } from 'react';
7
8
  * unmounts or when its `stableKey` changes. The cleanup function checks if the node
8
9
  * identified by `stableKey` is currently tracked as mounted. If it is, it removes
9
10
  * the node from `BaseNode.elementCache` and untracks its mount status using `MountTrackerUtil`.
11
+ * Additionally, it clears the `lastPropsRef` and `lastSignature` of the associated `BaseNode`
12
+ * instance to prevent memory leaks from retained prop objects.
10
13
  * @param {object} props The component's props.
11
- * @param {string} props.stableKey A unique identifier for the rendered node.
14
+ * @param {NodeInstance} props.node The BaseNode instance associated with this component.
12
15
  * @param {ReactNode} [props.children] The children to be rendered by this component.
13
16
  * @returns {ReactNode} The `children` passed to the component.
14
17
  */
15
- export default function MeoNodeUnmounter({ stableKey, children }: {
16
- stableKey: string;
18
+ export default function MeoNodeUnmounter({ node, children }: {
19
+ node: NodeInstance;
17
20
  children?: ReactNode;
18
21
  }): ReactNode;
19
22
  //# sourceMappingURL=meonode-unmounter.client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meonode-unmounter.client.d.ts","sourceRoot":"","sources":["../../src/components/meonode-unmounter.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAA;AAIjE;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAaxH"}
1
+ {"version":3,"file":"meonode-unmounter.client.d.ts","sourceRoot":"","sources":["../../src/components/meonode-unmounter.client.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAA6B,MAAM,OAAO,CAAA;AAGjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AAE3D;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,GAAG,SAAS,CAmBpH"}
@@ -6,8 +6,10 @@
6
6
  * unmounts or when its `stableKey` changes. The cleanup function checks if the node
7
7
  * identified by `stableKey` is currently tracked as mounted. If it is, it removes
8
8
  * the node from `BaseNode.elementCache` and untracks its mount status using `MountTrackerUtil`.
9
+ * Additionally, it clears the `lastPropsRef` and `lastSignature` of the associated `BaseNode`
10
+ * instance to prevent memory leaks from retained prop objects.
9
11
  * @param {object} props The component's props.
10
- * @param {string} props.stableKey A unique identifier for the rendered node.
12
+ * @param {NodeInstance} props.node The BaseNode instance associated with this component.
11
13
  * @param {ReactNode} [props.children] The children to be rendered by this component.
12
14
  * @returns {ReactNode} The `children` passed to the component.
13
- */export default function MeoNodeUnmounter(a){var b=a.stableKey,c=a.children,d=useEffectEvent(function(){MountTrackerUtil.mountedNodes.has(b)&&(BaseNode.elementCache["delete"](b),MountTrackerUtil.untrackMount(b))});return useEffect(function(){return function(){return d()}},[]),c}
15
+ */export default function MeoNodeUnmounter({node:a,children:b}){const c=useEffectEvent(()=>{a.stableKey&&(BaseNode.elementCache.delete(a.stableKey),MountTrackerUtil.mountedNodes.has(a.stableKey)&&MountTrackerUtil.untrackMount(a.stableKey)),a.lastSignature=void 0});return useEffect(()=>()=>c(),[]),b}
@@ -15,7 +15,7 @@
15
15
  * })
16
16
  * ```
17
17
  */
18
- export declare const Fragment: (<AdditionalProps extends Record<string, any> = Record<string, any>>(props?: import("../main").MergedProps<import("react").ExoticComponent<import("react").FragmentProps>, AdditionalProps> | undefined, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<import("react").ExoticComponent<import("react").FragmentProps>>) & {
18
+ export declare const Fragment: (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props?: import("../main").MergedProps<import("react").ExoticComponent<import("react").FragmentProps>, AdditionalProps> | undefined, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<import("react").ExoticComponent<import("react").FragmentProps>>) & {
19
19
  element: import("react").ExoticComponent<import("react").FragmentProps>;
20
20
  };
21
21
  /**
@@ -32,7 +32,7 @@ export declare const Fragment: (<AdditionalProps extends Record<string, any> = R
32
32
  * })
33
33
  * ```
34
34
  */
35
- export declare const Activity: (<AdditionalProps extends Record<string, any> = Record<string, any>>(props: import("../main").MergedProps<import("react").ExoticComponent<import("react").ActivityProps>, AdditionalProps>, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<import("react").ExoticComponent<import("react").ActivityProps>>) & {
35
+ export declare const Activity: (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props: import("../main").MergedProps<import("react").ExoticComponent<import("react").ActivityProps>, AdditionalProps>, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<import("react").ExoticComponent<import("react").ActivityProps>>) & {
36
36
  element: import("react").ExoticComponent<import("react").ActivityProps>;
37
37
  };
38
38
  /**
@@ -49,7 +49,7 @@ export declare const Activity: (<AdditionalProps extends Record<string, any> = R
49
49
  * })
50
50
  * ```
51
51
  */
52
- export declare const Suspense: (<AdditionalProps extends Record<string, any> = Record<string, any>>(props?: import("../main").MergedProps<import("react").ExoticComponent<import("react").SuspenseProps>, AdditionalProps> | undefined, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<import("react").ExoticComponent<import("react").SuspenseProps>>) & {
52
+ export declare const Suspense: (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props?: import("../main").MergedProps<import("react").ExoticComponent<import("react").SuspenseProps>, AdditionalProps> | undefined, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<import("react").ExoticComponent<import("react").SuspenseProps>>) & {
53
53
  element: import("react").ExoticComponent<import("react").SuspenseProps>;
54
54
  };
55
55
  //# sourceMappingURL=react.node.d.ts.map
@@ -14,7 +14,7 @@ import{Fragment as BaseFragment,Activity as BaseActivity,Suspense as BaseSuspens
14
14
  * ],
15
15
  * })
16
16
  * ```
17
- */export var Fragment=createNode(BaseFragment);/**
17
+ */export const Fragment=createNode(BaseFragment);/**
18
18
  * Lets you hide and restore the UI and internal state of its children.
19
19
  * @see {@link https://react.dev/reference/react/Activity React Docs}
20
20
  * @example
@@ -27,7 +27,7 @@ import{Fragment as BaseFragment,Activity as BaseActivity,Suspense as BaseSuspens
27
27
  * children: Div(...),
28
28
  * })
29
29
  * ```
30
- */export var Activity=createNode(BaseActivity);/**
30
+ */export const Activity=createNode(BaseActivity);/**
31
31
  * Lets you display a fallback until its children have finished loading.
32
32
  * @see {@link https://react.dev/reference/react/Suspense React Docs}
33
33
  * @example
@@ -40,4 +40,4 @@ import{Fragment as BaseFragment,Activity as BaseActivity,Suspense as BaseSuspens
40
40
  * children: Div(...),
41
41
  * })
42
42
  * ```
43
- */export var Suspense=createNode(BaseSuspense);
43
+ */export const Suspense=createNode(BaseSuspense);
@@ -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{createElement,useState}from"react";import{CacheProvider}from"@emotion/react";import createCache from"@emotion/cache";import{Node}from"../core.node.js";import{useServerInsertedHTML}from"next/navigation.js";// Emotion cache setup
1
+ "use client";import{createElement,useState}from"react";import{CacheProvider}from"@emotion/react";import createCache from"@emotion/cache";import{Node}from"../core.node.js";import{useServerInsertedHTML}from"next/navigation.js";// Emotion cache setup
2
2
  function createEmotionCache(){return createCache({key:"meonode-css"})}/**
3
3
  * Style registry for Emotion to support SSR/streaming in Next.js App Router.
4
4
  *
@@ -6,9 +6,9 @@ function createEmotionCache(){return createCache({key:"meonode-css"})}/**
6
6
  * - Uses `useServerInsertedHTML` to inline critical CSS collected during render.
7
7
  * @param children React subtree that consumes Emotion styles.
8
8
  * @returns React element that provides the cache and injects critical CSS during SSR.
9
- */export default function StyleRegistry(a){var b=a.children,c=useState(function(){var a=createEmotionCache();return a.compat=!0,a}),d=_slicedToArray(c,1),e=d[0];// Lazily create a single Emotion cache; enable compat for SSR/legacy Emotion APIs.
10
- // During server rendering, collect styles inserted into the cache and inline them in the HTML.
9
+ */export default function StyleRegistry({children:a}){// Lazily create a single Emotion cache; enable compat for SSR/legacy Emotion APIs.
10
+ const[b]=useState(()=>{const a=createEmotionCache();return a.compat=!0,a});// During server rendering, collect styles inserted into the cache and inline them in the HTML.
11
11
  // Provide the Emotion cache to descendants.
12
- return useServerInsertedHTML(function(){// Ensure deterministic output by sorting ids.
13
- var a=Object.keys(e.inserted).sort(),b=a.map(function(a){return e.inserted[a]}).join(""),c=a.join(" ");return b?createElement("style",{"data-emotion":"".concat(e.key," ").concat(c),dangerouslySetInnerHTML:{__html:b}}):null;// Insert a single style tag with the tracked Emotion ids.
14
- }),Node(CacheProvider,{value:e,children:b}).render()}
12
+ return useServerInsertedHTML(()=>{// Ensure deterministic output by sorting ids.
13
+ const a=Object.keys(b.inserted).sort(),c=a.map(a=>b.inserted[a]).join(""),d=a.join(" ");return c?createElement("style",{"data-emotion":`${b.key} ${d}`,dangerouslySetInnerHTML:{__html:c}}):null;// Insert a single style tag with the tracked Emotion ids.
14
+ }),Node(CacheProvider,{value:b,children:a}).render()}
@@ -1,4 +1,4 @@
1
- "use client";var _excluded=["element","children"],_excluded2=["css"];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 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)}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}import{useContext}from"react";import{jsx}from"@emotion/react";import{ThemeContext}from"./theme-provider.client.js";import{ThemeUtil}from"../util/theme.util.js";/**
1
+ "use client";const _excluded=["element","children"],_excluded2=["css"];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)}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}import{useContext}from"react";import{jsx}from"@emotion/react";import{ThemeContext}from"./theme-provider.client.js";import{ThemeUtil}from"../util/theme.util.js";/**
2
2
  * A client-side component that renders a styled element using Emotion.
3
3
  * It resolves theme values and applies default styles.
4
4
  * @template E The type of the HTML element to render.
@@ -7,4 +7,4 @@
7
7
  * @param children Optional children to be rendered inside the element.
8
8
  * @param props
9
9
  * @returns {JSX.Element} The rendered JSX element.
10
- */export default function StyledRenderer(a){var b=a.element,c=a.children,d=_objectWithoutProperties(a,_excluded),e=useContext(ThemeContext),f=null===e||void 0===e?void 0:e.theme,g=d.css,h=_objectWithoutProperties(d,_excluded2),i=g,j=h;f&&(i=ThemeUtil.resolveObjWithTheme(g,f,{processFunctions:!0}),j=ThemeUtil.resolveObjWithTheme(h,f,{processFunctions:!1}));var k=ThemeUtil.resolveDefaultStyle(i);return jsx(b,_objectSpread(_objectSpread({},j),{},{css:k}),c)}StyledRenderer.displayName="Styled";
10
+ */export default function StyledRenderer(a){let{element:b,children:c}=a,d=_objectWithoutProperties(a,_excluded);const e=useContext(ThemeContext),f=e?.theme,{css:g}=d,h=_objectWithoutProperties(d,_excluded2);let i=g,j=h;f&&(i=ThemeUtil.resolveObjWithTheme(g,f,{processFunctions:!0}),j=ThemeUtil.resolveObjWithTheme(h,f,{processFunctions:!1}));const k=ThemeUtil.resolveDefaultStyle(i);return jsx(b,_objectSpread(_objectSpread({},j),{},{css:k}),c)}StyledRenderer.displayName="Styled";
@@ -1,8 +1,8 @@
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{createContext,useState}from"react";import{Node}from"../core.node.js";export var ThemeContext=createContext(null);/**
1
+ "use client";import{createContext,useState}from"react";import{Node}from"../core.node.js";export const ThemeContext=createContext(null);/**
2
2
  * The internal implementation of the ThemeProvider component.
3
3
  * @param {object} props The props for the component.
4
4
  * @param {Children} [props.children] The children to render.
5
5
  * @param {Theme} props.theme The theme to provide.
6
6
  * @returns {ReactNode} The rendered component.
7
7
  * @private
8
- */export default function ThemeProvider(a){var b=a.children,c=a.theme,d=useState(c),e=_slicedToArray(d,2),f=e[0],g=e[1];if(!c)throw new Error("`theme` prop must be defined");return Node(ThemeContext.Provider,{value:{theme:f,setTheme:function setTheme(a){document.cookie="theme=".concat(a.mode,"; path=/;"),g(a)}},children:b}).render()}
8
+ */export default function ThemeProvider({children:a,theme:b}){const[c,d]=useState(b);if(!b)throw new Error("`theme` prop must be defined");return Node(ThemeContext.Provider,{value:{theme:c,setTheme:a=>{document.cookie=`theme=${a.mode}; path=/;`,d(a)}},children:a}).render()}
@@ -2,7 +2,7 @@ import _ThemeProvider from '../components/theme-provider.client.js';
2
2
  /**
3
3
  * A component that provides a theme to its children.
4
4
  */
5
- export declare const ThemeProvider: (<AdditionalProps extends Record<string, any> = Record<string, any>>(props: import("../main").MergedProps<typeof _ThemeProvider, AdditionalProps>, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<typeof _ThemeProvider>) & {
5
+ export declare const ThemeProvider: (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props: import("../main").MergedProps<typeof _ThemeProvider, AdditionalProps>, deps?: import("../main").DependencyList | undefined) => import("../main").NodeInstance<typeof _ThemeProvider>) & {
6
6
  element: typeof _ThemeProvider;
7
7
  };
8
8
  //# sourceMappingURL=theme-provider.d.ts.map
@@ -1,3 +1,3 @@
1
1
  import{createNode}from"../core.node.js";import _ThemeProvider from"./theme-provider.client.js";/**
2
2
  * A component that provides a theme to its children.
3
- */export var ThemeProvider=createNode(_ThemeProvider);
3
+ */export const ThemeProvider=createNode(_ThemeProvider);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.const.d.ts","sourceRoot":"","sources":["../../src/constant/common.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,uOAwBhB,CAAA;AAEV,eAAO,MAAM,cAAc,uPAAyB,CAAA;AACpD,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAA;AAEhD,eAAO,IAAI,SAAS,SAAQ,CAAA;AAE5B,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,QAK5C"}
@@ -0,0 +1 @@
1
+ export const NO_STYLE_TAGS=["html","head","meta","link","script","style","noscript","template","slot","base","param","source","track","wbr","embed","object","iframe","frame","frameset","applet","bgsound","noembed","noframes"];export const noStyleTagsSet=new Set(NO_STYLE_TAGS);export let __DEBUG__=!1;export function setDebugMode(a){__DEBUG__=a,__DEBUG__&&console.log("[MeoNode] Debug mode enabled.")}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-properties.const.d.ts","sourceRoot":"","sources":["../../src/constant/css-properties.const.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa,k0ZAirBT,CAAA;AAEV,eAAe,aAAa,CAAA"}
@@ -0,0 +1 @@
1
+ const cssProperties=["MozAnimation","MozAnimationDelay","MozAnimationDirection","MozAnimationDuration","MozAnimationFillMode","MozAnimationIterationCount","MozAnimationName","MozAnimationPlayState","MozAnimationTimingFunction","MozAppearance","MozBinding","MozBorderBottomColors","MozBorderEndColor","MozBorderEndStyle","MozBorderEndWidth","MozBorderImage","MozBorderLeftColors","MozBorderRightColors","MozBorderStartColor","MozBorderStartStyle","MozBorderTopColors","MozBoxSizing","MozColumnCount","MozColumnFill","MozColumnRule","MozColumnRuleColor","MozColumnRuleStyle","MozColumnRuleWidth","MozColumnWidth","MozColumns","MozContextProperties","MozFontFeatureSettings","MozFontLanguageOverride","MozHyphens","MozImageRegion","MozMarginEnd","MozMarginStart","MozOrient","MozOsxFontSmoothing","MozOutlineRadius","MozOutlineRadiusBottomleft","MozOutlineRadiusBottomright","MozOutlineRadiusTopleft","MozOutlineRadiusTopright","MozPaddingEnd","MozPaddingStart","MozStackSizing","MozTabSize","MozTextBlink","MozTextSizeAdjust","MozUserFocus","MozUserModify","MozUserSelect","MozWindowDragging","MozWindowShadow","WebkitAlignContent","WebkitAlignItems","WebkitAlignSelf","WebkitAnimation","WebkitAnimationDelay","WebkitAnimationDirection","WebkitAnimationDuration","WebkitAnimationFillMode","WebkitAnimationIterationCount","WebkitAnimationName","WebkitAnimationPlayState","WebkitAnimationTimingFunction","WebkitAppearance","WebkitBackdropFilter","WebkitBackfaceVisibility","WebkitBackgroundClip","WebkitBackgroundOrigin","WebkitBackgroundSize","WebkitBorderBefore","WebkitBorderBeforeColor","WebkitBorderBeforeStyle","WebkitBorderBeforeWidth","WebkitBorderBottomLeftRadius","WebkitBorderBottomRightRadius","WebkitBorderImage","WebkitBorderImageSlice","WebkitBorderRadius","WebkitBorderTopLeftRadius","WebkitBorderTopRightRadius","WebkitBoxDecorationBreak","WebkitBoxReflect","WebkitBoxShadow","WebkitBoxSizing","WebkitClipPath","WebkitColumnCount","WebkitColumnFill","WebkitColumnRule","WebkitColumnRuleColor","WebkitColumnRuleStyle","WebkitColumnRuleWidth","WebkitColumnSpan","WebkitColumnWidth","WebkitColumns","WebkitFilter","WebkitFlex","WebkitFlexBasis","WebkitFlexDirection","WebkitFlexFlow","WebkitFlexGrow","WebkitFlexShrink","WebkitFlexWrap","WebkitFontFeatureSettings","WebkitFontKerning","WebkitFontSmoothing","WebkitFontVariantLigatures","WebkitHyphenateCharacter","WebkitHyphens","WebkitInitialLetter","WebkitJustifyContent","WebkitLineBreak","WebkitLineClamp","WebkitMarginEnd","WebkitMarginStart","WebkitMask","WebkitMaskAttachment","WebkitMaskBoxImage","WebkitMaskBoxImageOutset","WebkitMaskBoxImageRepeat","WebkitMaskBoxImageSlice","WebkitMaskBoxImageSource","WebkitMaskBoxImageWidth","WebkitMaskClip","WebkitMaskComposite","WebkitMaskImage","WebkitMaskOrigin","WebkitMaskPosition","WebkitMaskPositionX","WebkitMaskPositionY","WebkitMaskRepeat","WebkitMaskRepeatX","WebkitMaskRepeatY","WebkitMaskSize","WebkitMaxInlineSize","WebkitOrder","WebkitOverflowScrolling","WebkitPaddingEnd","WebkitPaddingStart","WebkitPerspective","WebkitPerspectiveOrigin","WebkitPrintColorAdjust","WebkitRubyPosition","WebkitScrollSnapType","WebkitShapeMargin","WebkitTapHighlightColor","WebkitTextCombine","WebkitTextDecorationColor","WebkitTextDecorationLine","WebkitTextDecorationSkip","WebkitTextDecorationStyle","WebkitTextEmphasis","WebkitTextEmphasisColor","WebkitTextEmphasisPosition","WebkitTextEmphasisStyle","WebkitTextFillColor","WebkitTextOrientation","WebkitTextSizeAdjust","WebkitTextStroke","WebkitTextStrokeColor","WebkitTextStrokeWidth","WebkitTextUnderlinePosition","WebkitTouchCallout","WebkitTransform","WebkitTransformOrigin","WebkitTransformStyle","WebkitTransition","WebkitTransitionDelay","WebkitTransitionDuration","WebkitTransitionProperty","WebkitTransitionTimingFunction","WebkitUserModify","WebkitUserSelect","WebkitWritingMode","accentColor","alignContent","alignItems","alignSelf","alignTracks","all","animation","animationComposition","animationDelay","animationDirection","animationDuration","animationFillMode","animationIterationCount","animationName","animationPlayState","animationRange","animationRangeEnd","animationRangeStart","animationTimeline","animationTimingFunction","appearance","aspectRatio","backdropFilter","backfaceVisibility","background","backgroundAttachment","backgroundBlendMode","backgroundClip","backgroundColor","backgroundImage","backgroundOrigin","backgroundPosition","backgroundPositionX","backgroundPositionY","backgroundRepeat","backgroundSize","blockOverflow","blockSize","border","borderBlock","borderBlockColor","borderBlockEnd","borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth","borderBlockStart","borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth","borderBlockStyle","borderBlockWidth","borderBottom","borderBottomColor","borderBottomLeftRadius","borderBottomRightRadius","borderBottomStyle","borderBottomWidth","borderCollapse","borderColor","borderEndEndRadius","borderEndStartRadius","borderImage","borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth","borderInline","borderInlineColor","borderInlineEnd","borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth","borderInlineStart","borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth","borderInlineStyle","borderInlineWidth","borderLeft","borderLeftColor","borderLeftStyle","borderLeftWidth","borderRadius","borderRight","borderRightColor","borderRightStyle","borderRightWidth","borderSpacing","borderStartEndRadius","borderStartStartRadius","borderStyle","borderTop","borderTopColor","borderTopLeftRadius","borderTopRightRadius","borderTopStyle","borderTopWidth","borderWidth","bottom","boxDecorationBreak","boxShadow","boxSizing","breakAfter","breakBefore","breakInside","captionSide","caret","caretColor","caretShape","clear","clipPath","color","colorAdjust","colorScheme","columnCount","columnFill","columnGap","columnRule","columnRuleColor","columnRuleStyle","columnRuleWidth","columnSpan","columnWidth","columns","contain","containIntrinsicBlockSize","containIntrinsicHeight","containIntrinsicInlineSize","containIntrinsicSize","containIntrinsicWidth","container","containerName","containerType","content","contentVisibility","counterIncrement","counterReset","counterSet","cursor","direction","display","emptyCells","filter","flex","flexBasis","flexDirection","flexFlow","flexGrow","flexShrink","flexWrap","float","font","fontFamily","fontFeatureSettings","fontKerning","fontLanguageOverride","fontOpticalSizing","fontPalette","fontSize","fontSizeAdjust","fontSmooth","fontStretch","fontStyle","fontSynthesis","fontSynthesisPosition","fontSynthesisSmallCaps","fontSynthesisStyle","fontSynthesisWeight","fontVariant","fontVariantAlternates","fontVariantCaps","fontVariantEastAsian","fontVariantEmoji","fontVariantLigatures","fontVariantNumeric","fontVariantPosition","fontVariationSettings","fontWeight","forcedColorAdjust","gap","grid","gridArea","gridAutoColumns","gridAutoFlow","gridAutoRows","gridColumn","gridColumnEnd","gridColumnStart","gridRow","gridRowEnd","gridRowStart","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","hangingPunctuation","height","hyphenateCharacter","hyphenateLimitChars","hyphens","imageOrientation","imageRendering","imageResolution","initialLetter","inlineSize","inputSecurity","inset","insetBlock","insetBlockEnd","insetBlockStart","insetInline","insetInlineEnd","insetInlineStart","isolation","justifyContent","justifyItems","justifySelf","justifyTracks","left","letterSpacing","lineBreak","lineClamp","lineHeight","lineHeightStep","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginBlock","marginBlockEnd","marginBlockStart","marginBottom","marginInline","marginInlineEnd","marginInlineStart","marginLeft","marginRight","marginTop","marginTrim","mask","maskBorder","maskBorderMode","maskBorderOutset","maskBorderRepeat","maskBorderSlice","maskBorderSource","maskBorderWidth","maskClip","maskComposite","maskImage","maskMode","maskOrigin","maskPosition","maskRepeat","maskSize","maskType","masonryAutoFlow","mathDepth","mathShift","mathStyle","maxBlockSize","maxHeight","maxInlineSize","maxLines","maxWidth","minBlockSize","minHeight","minInlineSize","minWidth","mixBlendMode","motion","motionDistance","motionPath","motionRotation","msAccelerator","msBlockProgression","msContentZoomChaining","msContentZoomLimit","msContentZoomLimitMax","msContentZoomLimitMin","msContentZoomSnap","msContentZoomSnapPoints","msContentZoomSnapType","msContentZooming","msFilter","msFlex","msFlexDirection","msFlexPositive","msFlowFrom","msFlowInto","msGridColumns","msGridRows","msHighContrastAdjust","msHyphenateLimitChars","msHyphenateLimitLines","msHyphenateLimitZone","msHyphens","msImeAlign","msLineBreak","msOrder","msOverflowStyle","msOverflowX","msOverflowY","msScrollChaining","msScrollLimit","msScrollLimitXMax","msScrollLimitXMin","msScrollLimitYMax","msScrollLimitYMin","msScrollRails","msScrollSnapPointsX","msScrollSnapPointsY","msScrollSnapType","msScrollSnapX","msScrollSnapY","msScrollTranslation","msScrollbar3dlightColor","msScrollbarArrowColor","msScrollbarBaseColor","msScrollbarDarkshadowColor","msScrollbarFaceColor","msScrollbarHighlightColor","msScrollbarShadowColor","msScrollbarTrackColor","msTextAutospace","msTextCombineHorizontal","msTextOverflow","msTouchAction","msTouchSelect","msTransform","msTransformOrigin","msTransition","msTransitionDelay","msTransitionDuration","msTransitionProperty","msTransitionTimingFunction","msUserSelect","msWordBreak","msWrapFlow","msWrapMargin","msWrapThrough","msWritingMode","objectFit","objectPosition","offset","offsetAnchor","offsetDistance","offsetPath","offsetPosition","offsetRotate","offsetRotation","opacity","order","orphans","outline","outlineColor","outlineOffset","outlineStyle","outlineWidth","overflow","overflowAnchor","overflowBlock","overflowClipBox","overflowClipMargin","overflowInline","overflowWrap","overflowX","overflowY","overlay","overscrollBehavior","overscrollBehaviorBlock","overscrollBehaviorInline","overscrollBehaviorX","overscrollBehaviorY","padding","paddingBlock","paddingBlockEnd","paddingBlockStart","paddingBottom","paddingInline","paddingInlineEnd","paddingInlineStart","paddingLeft","paddingRight","paddingTop","page","pageBreakAfter","pageBreakBefore","pageBreakInside","paintOrder","perspective","perspectiveOrigin","placeContent","placeItems","placeSelf","pointerEvents","position","printColorAdjust","quotes","resize","right","rotate","rowGap","rubyAlign","rubyMerge","rubyPosition","scale","scrollBehavior","scrollMargin","scrollMarginBlock","scrollMarginBlockEnd","scrollMarginBlockStart","scrollMarginBottom","scrollMarginInline","scrollMarginInlineEnd","scrollMarginInlineStart","scrollMarginLeft","scrollMarginRight","scrollMarginTop","scrollPadding","scrollPaddingBlock","scrollPaddingBlockEnd","scrollPaddingBlockStart","scrollPaddingBottom","scrollPaddingInline","scrollPaddingInlineEnd","scrollPaddingInlineStart","scrollPaddingLeft","scrollPaddingRight","scrollPaddingTop","scrollSnapAlign","scrollSnapMargin","scrollSnapMarginBottom","scrollSnapMarginLeft","scrollSnapMarginRight","scrollSnapMarginTop","scrollSnapStop","scrollSnapType","scrollTimeline","scrollTimelineAxis","scrollTimelineName","scrollbarColor","scrollbarGutter","scrollbarWidth","shapeImageThreshold","shapeMargin","shapeOutside","tabSize","tableLayout","textAlign","textAlignLast","textCombineUpright","textDecoration","textDecorationColor","textDecorationLine","textDecorationSkip","textDecorationSkipInk","textDecorationStyle","textDecorationThickness","textEmphasis","textEmphasisColor","textEmphasisPosition","textEmphasisStyle","textIndent","textJustify","textOrientation","textOverflow","textRendering","textShadow","textSizeAdjust","textTransform","textUnderlineOffset","textUnderlinePosition","textWrap","timelineScope","top","touchAction","transform","transformBox","transformOrigin","transformStyle","transition","transitionBehavior","transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction","translate","unicodeBidi","userSelect","verticalAlign","viewTimeline","viewTimelineAxis","viewTimelineInset","viewTimelineName","viewTransitionName","visibility","whiteSpace","whiteSpaceCollapse","whiteSpaceTrim","widows","width","willChange","wordBreak","wordSpacing","wordWrap","writingMode","zIndex","zoom"];export default cssProperties;
@@ -1,5 +1,5 @@
1
1
  import { type ReactElement } from 'react';
2
- import type { Children, FinalNodeProps, HasRequiredProps, MergedProps, NodeElementType, NodeInstance, NodePortal, NodeProps, PropProcessingCache, PropsOf, DependencyList, ElementCacheEntry } from './types/node.type.js';
2
+ import type { Children, DependencyList, ElementCacheEntry, FinalNodeProps, HasRequiredProps, MergedProps, NodeElementType, NodeInstance, NodePortal, NodeProps, PropProcessingCache, PropsOf } from './types/node.type.js';
3
3
  /**
4
4
  * The core abstraction of the MeoNode library. It wraps a React element or component,
5
5
  * providing a unified interface for processing props, normalizing children, and handling styles.
@@ -8,7 +8,7 @@ import type { Children, FinalNodeProps, HasRequiredProps, MergedProps, NodeEleme
8
8
  * @class BaseNode
9
9
  * @template E - The type of React element or component this node represents.
10
10
  */
11
- export declare class BaseNode<E extends NodeElementType> {
11
+ export declare class BaseNode<E extends NodeElementType = NodeElementType> {
12
12
  instanceId: string;
13
13
  element: E;
14
14
  rawProps: Partial<NodeProps<E>>;
@@ -16,8 +16,8 @@ export declare class BaseNode<E extends NodeElementType> {
16
16
  private _props?;
17
17
  private readonly _deps?;
18
18
  stableKey?: string;
19
- private _lastPropsRef;
20
- private _lastSignature?;
19
+ lastPropsObj?: Record<string, unknown>;
20
+ lastSignature?: string;
21
21
  static elementCache: Map<string, ElementCacheEntry>;
22
22
  static propProcessingCache: Map<string, PropProcessingCache>;
23
23
  static scheduledCleanup: boolean;
@@ -122,7 +122,7 @@ export declare class BaseNode<E extends NodeElementType> {
122
122
  * It's the simplest way to wrap a component or element.
123
123
  * @function Node
124
124
  */
125
- declare function Node<AdditionalProps extends Record<string, any>, E extends NodeElementType>(element: E, props?: MergedProps<E, AdditionalProps>, deps?: DependencyList): NodeInstance<E>;
125
+ declare function Node<AdditionalProps extends Record<string, unknown>, E extends NodeElementType>(element: E, props?: MergedProps<E, AdditionalProps>, deps?: DependencyList): NodeInstance<E>;
126
126
  declare namespace Node {
127
127
  var clearCaches: typeof BaseNode.clearCaches;
128
128
  }
@@ -132,9 +132,9 @@ export { Node };
132
132
  * This is useful for creating reusable, specialized factory functions (e.g., `const Div = createNode('div')`).
133
133
  * @function createNode
134
134
  */
135
- export declare function createNode<AdditionalInitialProps extends Record<string, any>, E extends NodeElementType>(element: E, initialProps?: MergedProps<E, AdditionalInitialProps>): HasRequiredProps<PropsOf<E>> extends true ? (<AdditionalProps extends Record<string, any> = Record<string, any>>(props: MergedProps<E, AdditionalProps>, deps?: DependencyList) => NodeInstance<E>) & {
135
+ export declare function createNode<AdditionalInitialProps extends Record<string, unknown>, E extends NodeElementType>(element: E, initialProps?: MergedProps<E, AdditionalInitialProps>): HasRequiredProps<PropsOf<E>> extends true ? (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props: MergedProps<E, AdditionalProps>, deps?: DependencyList) => NodeInstance<E>) & {
136
136
  element: E;
137
- } : (<AdditionalProps extends Record<string, any> = Record<string, any>>(props?: MergedProps<E, AdditionalProps>, deps?: DependencyList) => NodeInstance<E>) & {
137
+ } : (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(props?: MergedProps<E, AdditionalProps>, deps?: DependencyList) => NodeInstance<E>) & {
138
138
  element: E;
139
139
  };
140
140
  /**
@@ -142,9 +142,9 @@ export declare function createNode<AdditionalInitialProps extends Record<string,
142
142
  * This provides a more ergonomic API for components that primarily wrap content (e.g., `P('Some text')`).
143
143
  * @function createChildrenFirstNode
144
144
  */
145
- export declare function createChildrenFirstNode<AdditionalInitialProps extends Record<string, any>, E extends NodeElementType>(element: E, initialProps?: Omit<NodeProps<E>, keyof AdditionalInitialProps | 'children'> & AdditionalInitialProps): HasRequiredProps<PropsOf<E>> extends true ? (<AdditionalProps extends Record<string, any> = Record<string, any>>(children: Children, props: Omit<MergedProps<E, AdditionalProps>, 'children'>, deps?: DependencyList) => NodeInstance<E>) & {
145
+ export declare function createChildrenFirstNode<AdditionalInitialProps extends Record<string, unknown>, E extends NodeElementType>(element: E, initialProps?: Omit<NodeProps<E>, keyof AdditionalInitialProps | 'children'> & AdditionalInitialProps): HasRequiredProps<PropsOf<E>> extends true ? (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(children: Children, props: Omit<MergedProps<E, AdditionalProps>, 'children'>, deps?: DependencyList) => NodeInstance<E>) & {
146
146
  element: E;
147
- } : (<AdditionalProps extends Record<string, any> = Record<string, any>>(children?: Children, props?: Omit<MergedProps<E, AdditionalProps>, 'children'>, deps?: DependencyList) => NodeInstance<E>) & {
147
+ } : (<AdditionalProps extends Record<string, unknown> = Record<string, unknown>>(children?: Children, props?: Omit<MergedProps<E, AdditionalProps>, 'children'>, deps?: DependencyList) => NodeInstance<E>) & {
148
148
  element: E;
149
149
  };
150
150
  //# sourceMappingURL=core.node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,YAAY,EAKlB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,WAAW,EAEX,eAAe,EACf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,cAAc,EACd,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAWhC;;;;;;;GAOG;AACH,qBAAa,QAAQ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AC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzE,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,EACxD,IAAI,CAAC,EAAE,cAAc,KAClB,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,GACtC,CAAC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzE,QAAQ,CAAC,EAAE,QAAQ,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,EACzD,IAAI,CAAC,EAAE,cAAc,KAClB,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAQzC"}
package/dist/core.node.js CHANGED
@@ -1,14 +1,14 @@
1
- var _BaseNode,_excluded=["ref","children"],_excluded2=["key"],_excluded3=["children","key","css","nativeProps","disableEmotion"];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 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 _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 _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{createElement,isValidElement,Fragment}from"react";import{isFragment,isValidElementType}from"./helper/react-is.helper.js";import{getComponentType,getElementTypeName,hasNoStyleTag}from"./helper/common.helper.js";import StyledRenderer from"./components/styled-renderer.client.js";import{__DEBUG__}from"./constants/common.const.js";import{MountTrackerUtil}from"./util/mount-tracker.util.js";import MeoNodeUnmounter from"./components/meonode-unmounter.client.js";import{NavigationCacheManagerUtil}from"./util/navigation-cache-manager.util.js";import{NodeUtil}from"./util/node.util.js";import{ThemeUtil}from"./util/theme.util.js";/**
1
+ const _excluded=["ref","children"],_excluded2=["key"],_excluded3=["children","key","css","nativeProps","disableEmotion"];var _BaseNode;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 _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 _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{createElement,Fragment,isValidElement}from"react";import{isFragment,isValidElementType}from"./helper/react-is.helper.js";import{getComponentType,getElementTypeName,hasNoStyleTag}from"./helper/common.helper.js";import StyledRenderer from"./components/styled-renderer.client.js";import{__DEBUG__}from"./constant/common.const.js";import{MountTrackerUtil}from"./util/mount-tracker.util.js";import MeoNodeUnmounter from"./components/meonode-unmounter.client.js";import{NavigationCacheManagerUtil}from"./util/navigation-cache-manager.util.js";import{NodeUtil}from"./util/node.util.js";import{ThemeUtil}from"./util/theme.util.js";/**
2
2
  * The core abstraction of the MeoNode library. It wraps a React element or component,
3
3
  * providing a unified interface for processing props, normalizing children, and handling styles.
4
4
  * This class is central to the library's ability to offer a JSX-free, fluent API for building UIs.
5
5
  * It uses an iterative rendering approach to handle deeply nested structures without causing stack overflows.
6
6
  * @class BaseNode
7
7
  * @template E - The type of React element or component this node represents.
8
- */export class BaseNode{constructor(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length?arguments[2]:void 0;// Element type validation is performed once at construction to prevent invalid nodes from being created.
9
- if(_defineProperty(this,"instanceId",Math.random().toString(36).slice(2)+Date.now().toString(36)),_defineProperty(this,"rawProps",{}),_defineProperty(this,"isBaseNode",!0),_defineProperty(this,"_lastPropsRef",null),!isValidElementType(a)){var d=getComponentType(a);throw new Error("Invalid element type: ".concat(d," provided!"))}this.element=a,this.rawProps=b,this._deps=c;// Extract commonly handled props; the remaining `propsForSignature` are used to compute a stable hash.
10
- var e=b.ref,f=b.children,g=_objectWithoutProperties(b,_excluded);// Generate or get cached stable key
11
- this.stableKey=this._getStableKey(g),NodeUtil.isServer||BaseNode._navigationStarted||(NavigationCacheManagerUtil.getInstance().start(),BaseNode._navigationStarted=!0)}/**
8
+ */export class BaseNode{constructor(a,b={},c){// Element type validation is performed once at construction to prevent invalid nodes from being created.
9
+ if(_defineProperty(this,"instanceId",Math.random().toString(36).slice(2)+Date.now().toString(36)),_defineProperty(this,"rawProps",{}),_defineProperty(this,"isBaseNode",!0),!isValidElementType(a)){const b=getComponentType(a);throw new Error(`Invalid element type: ${b} provided!`)}this.element=a,this.rawProps=b,this._deps=c;// Extract commonly handled props; the remaining `propsForSignature` are used to compute a stable hash.
10
+ const{ref:d,children:e}=b,f=_objectWithoutProperties(b,_excluded);// Generate or get cached stable key
11
+ this.stableKey=this._getStableKey(f),NodeUtil.isServer||BaseNode._navigationStarted||(NavigationCacheManagerUtil.getInstance().start(),BaseNode._navigationStarted=!0)}/**
12
12
  * Lazily processes and retrieves the final, normalized props for the node.
13
13
  * The props are processed only once and then cached for subsequent accesses.
14
14
  * @getter props
@@ -30,7 +30,7 @@ this.stableKey=this._getStableKey(g),NodeUtil.isServer||BaseNode._navigationStar
30
30
  * @param key Key passed for prefix if exist
31
31
  * @param props The props object to create a signature for.
32
32
  * @returns A compact string signature suitable for use as a cache key.
33
- */_getStableKey(a){var b=a.key,c=_objectWithoutProperties(a,_excluded2);if(!NodeUtil.isServer){if(c===this._lastPropsRef)return this._lastSignature;if(this._lastPropsRef&&NodeUtil.shallowEqual(c,this._lastPropsRef))return this._lastPropsRef=c,this._lastSignature;var d=Object.keys(c),e=d.length;if(100<e){var f=NodeUtil.extractCriticalProps(c,d);this._lastSignature=NodeUtil.createPropSignature(this.element,f),__DEBUG__&&200<e&&console.warn("MeoNode: Large props (".concat(e," keys) on \"").concat(getElementTypeName(this.element),"\". Consider splitting."))}else this._lastSignature=NodeUtil.createPropSignature(this.element,c);return this._lastPropsRef=c,void 0!==b&&null!==b?"".concat(b+"",":").concat(this._lastSignature):this._lastSignature}}/**
33
+ */_getStableKey(a){let{key:b}=a,c=_objectWithoutProperties(a,_excluded2);if(NodeUtil.isServer)return;if(this.lastPropsObj===c)return this.lastSignature;this.lastPropsObj=c;const d=Object.keys(c),e=d.length;if(100<e){const a=NodeUtil.extractCriticalProps(c,d);this.lastSignature=NodeUtil.createPropSignature(this.element,a),__DEBUG__&&200<e&&console.warn(`MeoNode: Large props (${e} keys) on "${getElementTypeName(this.element)}". Consider splitting.`)}else this.lastSignature=NodeUtil.createPropSignature(this.element,c);return b!==void 0&&null!==b?`${b+""}:${this.lastSignature}`:this.lastSignature}/**
34
34
  * FinalizationRegistry for cleaning up `elementCache` entries when the associated `BaseNode` instance
35
35
  * is garbage-collected. This helps prevent memory leaks by ensuring that cache entries for
36
36
  * unreferenced nodes are eventually removed.
@@ -38,8 +38,7 @@ this.stableKey=this._getStableKey(g),NodeUtil.isServer||BaseNode._navigationStar
38
38
  * The held value must include `cacheKey` which is used to identify and delete the corresponding
39
39
  * entry from `BaseNode.elementCache`.
40
40
  * @public
41
- */// --- Iterative Renderer with Deps Support ---
42
- /**
41
+ *//**
43
42
  * Renders the `BaseNode` and its entire subtree into a ReactElement, with support for opt-in reactivity
44
43
  * via dependency arrays and inherited blocking.
45
44
  *
@@ -52,38 +51,44 @@ this.stableKey=this._getStableKey(g),NodeUtil.isServer||BaseNode._navigationStar
52
51
  * 2. **Complete Phase:** After all of a node's descendants have been rendered, the loop returns to the node.
53
52
  * It then collects the rendered children from a temporary map and creates its own React element.
54
53
  * @method render
55
- */render(){var a=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0];!NodeUtil.isServer&&this.stableKey&&MountTrackerUtil.trackMount(this.stableKey);// On server, we never reuse cached elements because that can cause hydration mismatches.
56
- var b=NodeUtil.isServer||!this.stableKey?void 0:BaseNode.elementCache.get(this.stableKey),c=NodeUtil.shouldNodeUpdate(null===b||void 0===b?void 0:b.prevDeps,this._deps,a);// Decide whether this node (and its subtree) should update given dependency arrays.
54
+ */render(a=!1){!NodeUtil.isServer&&this.stableKey&&MountTrackerUtil.trackMount(this.stableKey);// On server, we never reuse cached elements because that can cause hydration mismatches.
55
+ const b=NodeUtil.isServer||!this.stableKey?void 0:BaseNode.elementCache.get(this.stableKey),c=NodeUtil.shouldNodeUpdate(b?.prevDeps,this._deps,a);// Decide whether this node (and its subtree) should update given dependency arrays.
57
56
  // Fast return: if nothing should update and we have a cached element, reuse it.
58
- if(!c&&null!==b&&void 0!==b&&b.renderedElement)return b.accessCount+=1,b.renderedElement;// When this node doesn't need update, its children are considered "blocked" and may be skipped.
59
- // Work stack for iterative, non-recursive traversal.
60
- // Each entry tracks the BaseNode, whether its children were pushed (isProcessed) and whether it is blocked.
61
- // Map to collect rendered React elements for processed BaseNode instances.
62
- // Iterative depth-first traversal with explicit begin/complete phases to avoid recursion.
63
- for(var d=[{node:this,isProcessed:!1,blocked:!c}],e=new Map;0<d.length;){var f=d[d.length-1],g=f.node,h=f.isProcessed,j=f.blocked;if(!h){f.isProcessed=!0;var k=g.props.children;if(k)// Only consider BaseNode children for further traversal; primitives and React elements are terminal.
64
- for(var l=(Array.isArray(k)?k:[k]).filter(NodeUtil.isNodeInstance),m=l.length-1;0<=m;m--){var n=l[m],o=NodeUtil.isServer||!n.stableKey?void 0:BaseNode.elementCache.get(n.stableKey),p=NodeUtil.shouldNodeUpdate(null===o||void 0===o?void 0:o.prevDeps,n._deps,j);// Respect server/client differences for child cache lookup.
57
+ if(!c&&b?.renderedElement)return b.accessCount+=1,b.renderedElement;// When this node doesn't need update, its children are considered "blocked" and may be skipped.
58
+ // Start with aggressive initial capacity to minimize reallocations
59
+ let d=Array(512),e=0;// Fast capacity check with exponential growth
60
+ const f=a=>{if(a>d.length){// Double capacity or use exact requirement (whichever is larger)
61
+ const b=Math.max(a,d.length<<1),c=Array(b);// Manual copy is faster than Array methods for primitive/object arrays
62
+ for(let a=0;a<e;a++)c[a]=d[a];d=c}};// Push initial work item
63
+ d[e++]={node:this,isProcessed:!1,blocked:!c};// Map to collect rendered React elements for processed BaseNode instances.
64
+ const g=new Map;// Iterative depth-first traversal with explicit begin/complete phases to avoid recursion.
65
+ for(;0<e;){const a=d[e-1];if(!a){e--;continue}const{node:b,isProcessed:c,blocked:h}=a;if(!c){a.isProcessed=!0;const c=b.props.children;if(c){// Only consider BaseNode children for further traversal; primitives and React elements are terminal.
66
+ const a=(Array.isArray(c)?c:[c]).filter(NodeUtil.isNodeInstance),b=e+a.length;// --- Check capacity ONCE before loop ---
67
+ f(b);for(let b=a.length-1;0<=b;b--){const c=a[b],f=NodeUtil.isServer||!c.stableKey?void 0:BaseNode.elementCache.get(c.stableKey),i=NodeUtil.shouldNodeUpdate(f?.prevDeps,c._deps,h);// Respect server/client differences for child cache lookup.
65
68
  // Determine whether the child should update given its deps and the parent's blocked state.
66
69
  // If child doesn't need update and has cached element, reuse it immediately (no push).
67
- if(!p&&null!==o&&void 0!==o&&o.renderedElement){e.set(n,o.renderedElement);continue}// Otherwise push child for processing; childBlocked inherits parent's blocked state.
68
- var q=j||!p;d.push({node:n,isProcessed:!1,blocked:q})}}else{d.pop();// Extract node props. Non-present props default to undefined via destructuring.
69
- var r=g.props,s=r.children,t=r.key,u=r.css,v=r.nativeProps,w=r.disableEmotion,x=_objectWithoutProperties(r,_excluded3),y=[];s&&(y=(Array.isArray(s)?s:[s]).map(function(a){return NodeUtil.isNodeInstance(a)?e.get(a):isValidElement(a)?a:a}));// Merge element props: explicit other props + DOM native props + React key.
70
- var z=_objectSpread(_objectSpread({},x),{},{key:t},v),A=void 0;// Handle fragments specially: create fragment element with key and children.
71
- if(g.element===Fragment||isFragment(g.element))A=createElement(g.element,{key:t},...y);else{// StyledRenderer for emotion-based styling unless explicitly disabled or no styles are present.
70
+ if(!i&&f?.renderedElement){g.set(c,f.renderedElement);continue}// Otherwise push child for processing; childBlocked inherits parent's blocked state.
71
+ const j=h||!i;d[e++]={node:c,isProcessed:!1,blocked:j}}}}else{e--;// Extract node props. Non-present props default to undefined via destructuring.
72
+ const a=b.props,{children:c,key:d,css:f,nativeProps:h,disableEmotion:i}=a,j=_objectWithoutProperties(a,_excluded3);let k=[];c&&(k=(Array.isArray(c)?c:[c]).map(a=>NodeUtil.isNodeInstance(a)?g.get(a):isValidElement(a)?a:a));// Merge element props: explicit other props + DOM native props + React key.
73
+ const l=_objectSpread(_objectSpread({},j),{},{key:d},h);let m;// Handle fragments specially: create fragment element with key and children.
74
+ if(b.element===Fragment||isFragment(b.element))m=createElement(b.element,{key:d},...k);else{// StyledRenderer for emotion-based styling unless explicitly disabled or no styles are present.
72
75
  // StyledRenderer handles SSR hydration and emotion CSS injection when css prop exists or element has style tags.
73
- var B=!w&&(u||!hasNoStyleTag(g.element));A=B?createElement(StyledRenderer,_objectSpread(_objectSpread({element:g.element},z),{},{css:u,suppressHydrationWarning:!0}),...y):createElement(g.element,z,...y)}// Cache the generated element on client-side to speed up future renders.
74
- if(!NodeUtil.isServer&&g.stableKey){var C=BaseNode.elementCache.get(g.stableKey);if(C)C.prevDeps=g._deps,C.renderedElement=A,C.accessCount+=1;else{// Create new cache entry and register for cleanup
75
- var D={prevDeps:g._deps,renderedElement:A,nodeRef:new WeakRef(g),createdAt:Date.now(),accessCount:1,instanceId:g.instanceId};BaseNode.elementCache.set(g.stableKey,D),BaseNode.cacheCleanupRegistry.register(g,{cacheKey:g.stableKey,instanceId:g.instanceId},g)}}// Store the rendered element so parent nodes can reference it.
76
- e.set(g,A)}}// Get the final rendered element for the root node of this render cycle.
77
- var E=e.get(this);return!NodeUtil.isServer&&this.stableKey?createElement(MeoNodeUnmounter,{stableKey:this.stableKey},E):E}/**
76
+ const a=!i&&(f||!hasNoStyleTag(b.element));m=a?createElement(StyledRenderer,_objectSpread(_objectSpread({element:b.element},l),{},{css:f,suppressHydrationWarning:!0}),...k):createElement(b.element,l,...k)}// Cache the generated element on client-side to speed up future renders.
77
+ if(!NodeUtil.isServer&&b.stableKey){const a=BaseNode.elementCache.get(b.stableKey);if(a)a.prevDeps=b._deps,a.renderedElement=m,a.accessCount+=1;else{// Create new cache entry and register for cleanup
78
+ const a={prevDeps:b._deps,renderedElement:m,nodeRef:new WeakRef(b),createdAt:Date.now(),accessCount:1,instanceId:b.instanceId};// Set new cache entry
79
+ BaseNode.elementCache.set(b.stableKey,a),BaseNode.cacheCleanupRegistry.register(b,{cacheKey:b.stableKey,instanceId:b.instanceId},b)}}// Store the rendered element so parent nodes can reference it.
80
+ g.set(b,m)}}// Clear references for GC unconditionally
81
+ d.length=0;// Get the final rendered element for the root node of this render cycle.
82
+ const h=g.get(this);return!NodeUtil.isServer&&this.stableKey?createElement(MeoNodeUnmounter,{node:this},h):h}/**
78
83
  * Renders the node into a React Portal, mounting it directly under `document.body`.
79
84
  * Returns a handle with `update` and `unmount` methods to control the portal's lifecycle.
80
85
  * @method toPortal
81
- */toPortal(){var a=this;if(!NodeUtil.ensurePortalInfrastructure(this))throw new Error("toPortal() can only be called in a client-side environment");var b=NodeUtil.portalInfrastructure.get(this),c=b.domElement,d=b.reactRoot;(function renderCurrent(){try{d.render(a.render())}catch(a){__DEBUG__&&console.error("[MeoNode] Portal render error:",a)}})();// Track if already unmounted to make unmount idempotent
82
- var e=!1,f=d.unmount.bind(d);return d.update=function(a){if(e)return void(__DEBUG__&&console.warn("[MeoNode] Attempt to update already-unmounted portal"));try{var b=NodeUtil.isNodeInstance(a)?a.render():a;d.render(b)}catch(a){__DEBUG__&&console.error("[MeoNode] Portal update error:",a)}},d.unmount=function(){// Idempotent guard
86
+ */toPortal(){if(!NodeUtil.ensurePortalInfrastructure(this))throw new Error("toPortal() can only be called in a client-side environment");const a=NodeUtil.portalInfrastructure.get(this),{domElement:b,reactRoot:c}=a,d=()=>{try{c.render(this.render())}catch(a){__DEBUG__&&console.error("[MeoNode] Portal render error:",a)}};d();// Track if already unmounted to make unmount idempotent
87
+ let e=!1;const f=c.unmount.bind(c);return c.update=a=>{if(e)return void(__DEBUG__&&console.warn("[MeoNode] Attempt to update already-unmounted portal"));try{const b=NodeUtil.isNodeInstance(a)?a.render():a;c.render(b)}catch(a){__DEBUG__&&console.error("[MeoNode] Portal update error:",a)}},c.unmount=()=>{// Idempotent guard
83
88
  if(e)return void(__DEBUG__&&console.warn("[MeoNode] Portal already unmounted"));e=!0;// Unregister FIRST to prevent FinalizationRegistry from firing
84
- try{BaseNode.portalCleanupRegistry.unregister(a)}catch(a){__DEBUG__&&console.warn("[MeoNode] Portal unregister warning:",a)}// Remove from WeakMap
85
- NodeUtil.portalInfrastructure["delete"](a);// Now do the actual cleanup
86
- try{null!==c&&void 0!==c&&c.isConnected&&f()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal unmount error:",a)}try{null!==c&&void 0!==c&&c.isConnected&&c.remove()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal DOM cleanup error:",a)}},d}/**
89
+ try{BaseNode.portalCleanupRegistry.unregister(this)}catch(a){__DEBUG__&&console.warn("[MeoNode] Portal unregister warning:",a)}// Remove from WeakMap
90
+ NodeUtil.portalInfrastructure.delete(this);// Now do the actual cleanup
91
+ try{b?.isConnected&&f()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal unmount error:",a)}try{b?.isConnected&&b.remove()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal DOM cleanup error:",a)}},c}/**
87
92
  * A static method to clear all internal caches.
88
93
  *
89
94
  * This method performs manual cleanup of all cache entries, calling their
@@ -92,9 +97,9 @@ try{null!==c&&void 0!==c&&c.isConnected&&f()}catch(a){__DEBUG__&&console.error("
92
97
  * the associated nodes are collected.
93
98
  * @method clearCaches
94
99
  */static clearCaches(){// Collect all cache keys first
95
- var a=Array.from(BaseNode.elementCache.keys());__DEBUG__&&console.log("[MeoNode] clearCaches: Clearing ".concat(a.length," entries"));// Call onEvict for all entries (idempotent)
96
- for(var b=0,c=a;b<c.length;b++){var d=c[b],e=BaseNode.elementCache.get(d);if(e){var f,g=null===(f=e.nodeRef)||void 0===f?void 0:f.deref();// Try to unregister from FinalizationRegistry
97
- if(g)try{BaseNode.cacheCleanupRegistry.unregister(g)}catch(a){__DEBUG__&&console.warn("[MeoNode] Could not unregister ".concat(d," from FinalizationRegistry"))}}}// Clear all caches
100
+ const a=Array.from(BaseNode.elementCache.keys());__DEBUG__&&console.log(`[MeoNode] clearCaches: Clearing ${a.length} entries`);// Call onEvict for all entries (idempotent) and clear node properties
101
+ for(const b of a){const a=BaseNode.elementCache.get(b);if(a){// Try to unregister from FinalizationRegistry
102
+ const c=a.nodeRef?.deref();if(c)try{BaseNode.cacheCleanupRegistry.unregister(c),c.lastSignature=void 0,c.lastPropsObj=void 0}catch(a){__DEBUG__&&console.warn(`[MeoNode] Could not unregister ${b} from FinalizationRegistry`)}}}// Clear all caches
98
103
  // Clear mount tracking
99
104
  BaseNode.propProcessingCache.clear(),BaseNode.elementCache.clear(),ThemeUtil.clearThemeCache(),MountTrackerUtil.cleanup(),__DEBUG__&&console.log("[MeoNode] All caches cleared")}// --- Utilities ---
100
105
  }// --- Factory Functions ---
@@ -102,9 +107,9 @@ BaseNode.propProcessingCache.clear(),BaseNode.elementCache.clear(),ThemeUtil.cle
102
107
  * The primary factory function for creating a `BaseNode` instance.
103
108
  * It's the simplest way to wrap a component or element.
104
109
  * @function Node
105
- */_BaseNode=BaseNode,_defineProperty(BaseNode,"elementCache",new Map),_defineProperty(BaseNode,"propProcessingCache",new Map),_defineProperty(BaseNode,"scheduledCleanup",!1),_defineProperty(BaseNode,"_navigationStarted",!1),_defineProperty(BaseNode,"cacheCleanupRegistry",new FinalizationRegistry(function(a){var b=a.cacheKey,c=a.instanceId,d=_BaseNode.elementCache.get(b);MountTrackerUtil.mountedNodes.has(b)&&(null===d||void 0===d?void 0:d.instanceId)===c&&(_BaseNode.elementCache["delete"](b),MountTrackerUtil.untrackMount(b))})),_defineProperty(BaseNode,"portalCleanupRegistry",new FinalizationRegistry(function(a){var b=a.domElement,c=a.reactRoot;__DEBUG__&&console.log("[MeoNode] FinalizationRegistry auto-cleaning portal");// Guard: Check if already unmounted
110
+ */_BaseNode=BaseNode,_defineProperty(BaseNode,"elementCache",new Map),_defineProperty(BaseNode,"propProcessingCache",new Map),_defineProperty(BaseNode,"scheduledCleanup",!1),_defineProperty(BaseNode,"_navigationStarted",!1),_defineProperty(BaseNode,"cacheCleanupRegistry",new FinalizationRegistry(a=>{const{cacheKey:b,instanceId:c}=a,d=_BaseNode.elementCache.get(b);d?.instanceId===c&&_BaseNode.elementCache.delete(b),MountTrackerUtil.mountedNodes.has(b)&&MountTrackerUtil.untrackMount(b)})),_defineProperty(BaseNode,"portalCleanupRegistry",new FinalizationRegistry(a=>{const{domElement:b,reactRoot:c}=a;__DEBUG__&&console.log("[MeoNode] FinalizationRegistry auto-cleaning portal");// Guard: Check if already unmounted
106
111
  try{c&&"function"==typeof c.unmount&&c.unmount()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal auto-cleanup unmount error:",a)}// Guard: Check if DOM element still connected
107
- try{null!==b&&void 0!==b&&b.isConnected&&b.remove()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal auto-cleanup DOM removal error:",a)}}));function Node(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{},c=2<arguments.length?arguments[2]:void 0;return new BaseNode(a,b,c)}/**
112
+ try{b?.isConnected&&b.remove()}catch(a){__DEBUG__&&console.error("[MeoNode] Portal auto-cleanup DOM removal error:",a)}}));function Node(a,b={},c){return new BaseNode(a,b,c)}/**
108
113
  * Static alias on the `Node` factory for clearing all internal caches used by `BaseNode`.
109
114
  *
110
115
  * Use cases include:
@@ -122,8 +127,8 @@ export{Node};/**
122
127
  * Creates a curried node factory for a given React element or component type.
123
128
  * This is useful for creating reusable, specialized factory functions (e.g., `const Div = createNode('div')`).
124
129
  * @function createNode
125
- */export function createNode(a,b){var c=function Instance(c,d){return Node(a,_objectSpread(_objectSpread({},b),c),d)};return c.element=a,c}/**
130
+ */export function createNode(a,b){const c=(c,d)=>Node(a,_objectSpread(_objectSpread({},b),c),d);return c.element=a,c}/**
126
131
  * Creates a node factory function where the first argument is `children` and the second is `props`.
127
132
  * This provides a more ergonomic API for components that primarily wrap content (e.g., `P('Some text')`).
128
133
  * @function createChildrenFirstNode
129
- */export function createChildrenFirstNode(a,b){var c=function Instance(c,d,e){return Node(a,_objectSpread(_objectSpread(_objectSpread({},b),d),{},{children:c}),e)};return c.element=a,c}
134
+ */export function createChildrenFirstNode(a,b){const c=(c,d,e)=>Node(a,_objectSpread(_objectSpread(_objectSpread({},b),d),{},{children:c}),e);return c.element=a,c}