@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.
- package/CHANGELOG.md +57 -0
- package/dist/client.d.ts +2 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -1
- package/dist/components/html.node.d.ts +139 -139
- package/dist/components/html.node.js +139 -139
- package/dist/components/meonode-unmounter.client.d.ts +6 -3
- package/dist/components/meonode-unmounter.client.d.ts.map +1 -1
- package/dist/components/meonode-unmounter.client.js +4 -2
- package/dist/components/react.node.d.ts +3 -3
- package/dist/components/react.node.js +3 -3
- package/dist/components/registry.client.js +6 -6
- package/dist/components/styled-renderer.client.js +2 -2
- package/dist/components/theme-provider.client.js +2 -2
- package/dist/components/theme-provider.d.ts +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/constants/common.const.js +1 -1
- package/dist/constants/css-properties.const.js +1 -1
- package/dist/core.node.d.ts +10 -10
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +39 -37
- package/dist/helper/common.helper.js +9 -9
- package/dist/helper/obj.helper.js +14 -14
- package/dist/helper/react-is.helper.js +21 -21
- package/dist/hoc/component.hoc.js +1 -1
- package/dist/hoc/portal.hoc.js +13 -13
- package/dist/hook/usePortal.js +2 -2
- package/dist/hook/useTheme.js +3 -3
- package/dist/nextjs-registry/index.d.ts +1 -1
- package/dist/nextjs-registry/index.js +1 -1
- package/dist/types/node.type.d.ts +5 -0
- package/dist/types/node.type.d.ts.map +1 -1
- package/dist/util/mount-tracker.util.js +3 -3
- package/dist/util/navigation-cache-manager.util.d.ts +5 -0
- package/dist/util/navigation-cache-manager.util.d.ts.map +1 -1
- package/dist/util/navigation-cache-manager.util.js +7 -7
- package/dist/util/node.util.d.ts +22 -26
- package/dist/util/node.util.d.ts.map +1 -1
- package/dist/util/node.util.js +75 -69
- package/dist/util/theme.util.d.ts +6 -6
- package/dist/util/theme.util.d.ts.map +1 -1
- package/dist/util/theme.util.js +17 -16
- package/package.json +1 -1
|
@@ -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 {
|
|
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({
|
|
16
|
-
|
|
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;
|
|
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,CAiBpH"}
|
|
@@ -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 {
|
|
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){
|
|
15
|
+
*/export default function MeoNodeUnmounter({node:a,children:b}){const c=useEffectEvent(()=>{a.stableKey&&MountTrackerUtil.mountedNodes.has(a.stableKey)&&(BaseNode.elementCache.delete(a.stableKey),MountTrackerUtil.untrackMount(a.stableKey)),a.lastPropsRef=null,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,
|
|
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,
|
|
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,
|
|
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
|
|
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
|
|
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
|
|
43
|
+
*/export const Suspense=createNode(BaseSuspense);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use client";
|
|
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(
|
|
10
|
-
|
|
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(
|
|
13
|
-
|
|
14
|
-
}),Node(CacheProvider,{value:
|
|
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";
|
|
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){
|
|
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";
|
|
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){
|
|
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,
|
|
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 +1 @@
|
|
|
1
|
-
export
|
|
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.")}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var 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
|
+
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;
|
package/dist/core.node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import type { Children, FinalNodeProps, HasRequiredProps, MergedProps, NodeElementType, NodeInstance, NodePortal, NodeProps, PropProcessingCache, PropsOf
|
|
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,16 +8,16 @@ 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>>;
|
|
15
15
|
readonly isBaseNode: boolean;
|
|
16
16
|
private _props?;
|
|
17
17
|
private readonly _deps?;
|
|
18
|
-
stableKey
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
stableKey?: string;
|
|
19
|
+
lastPropsRef: 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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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
|
package/dist/core.node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"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"}
|
package/dist/core.node.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
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"./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";/**
|
|
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
|
|
9
|
-
if(_defineProperty(this,"instanceId",Math.random().toString(36).slice(2)+Date.now().toString(36)),_defineProperty(this,"rawProps",{}),_defineProperty(this,"isBaseNode",!0),_defineProperty(this,"
|
|
10
|
-
|
|
11
|
-
this.stableKey=this._getStableKey(
|
|
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),_defineProperty(this,"lastPropsRef",null),!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){
|
|
33
|
+
*/_getStableKey(a){let{key:b}=a,c=_objectWithoutProperties(a,_excluded2);if(NodeUtil.isServer)return;if(c===this.lastPropsRef)return this.lastSignature;if(this.lastPropsRef&&NodeUtil.shallowEqual(c,this.lastPropsRef))return this.lastPropsRef=c,this.lastSignature;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 this.lastPropsRef=c,void 0!==b&&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.
|
|
@@ -52,38 +52,40 @@ this.stableKey=this._getStableKey(g),NodeUtil.isServer||BaseNode._navigationStar
|
|
|
52
52
|
* 2. **Complete Phase:** After all of a node's descendants have been rendered, the loop returns to the node.
|
|
53
53
|
* It then collects the rendered children from a temporary map and creates its own React element.
|
|
54
54
|
* @method render
|
|
55
|
-
*/render(){
|
|
56
|
-
|
|
55
|
+
*/render(a=!1){!NodeUtil.isServer&&this.stableKey&&MountTrackerUtil.trackMount(this.stableKey);// On server, we never reuse cached elements because that can cause hydration mismatches.
|
|
56
|
+
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
57
|
// Fast return: if nothing should update and we have a cached element, reuse it.
|
|
58
|
-
if(!c&&
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
for(
|
|
64
|
-
|
|
58
|
+
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.
|
|
59
|
+
const d=Array(64);// Initial capacity based on heuristics
|
|
60
|
+
let e=0;// Push initial work item
|
|
61
|
+
d[e++]={node:this,isProcessed:!1,blocked:!c};// Map to collect rendered React elements for processed BaseNode instances.
|
|
62
|
+
const f=new Map;// Iterative depth-first traversal with explicit begin/complete phases to avoid recursion.
|
|
63
|
+
for(;0<e;){const a=d[e-1];if(!a){e--;continue}const{node:b,isProcessed:c,blocked:g}=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.
|
|
64
|
+
const a=(Array.isArray(c)?c:[c]).filter(NodeUtil.isNodeInstance),b=e+a.length;// Ensure capacity before pushing children
|
|
65
|
+
b>d.length&&(d.length=Math.max(Math.ceil(1.5*d.length),b));for(let b=a.length-1;0<=b;b--){const c=a[b],h=NodeUtil.isServer||!c.stableKey?void 0:BaseNode.elementCache.get(c.stableKey),i=NodeUtil.shouldNodeUpdate(h?.prevDeps,c._deps,g);// Respect server/client differences for child cache lookup.
|
|
65
66
|
// Determine whether the child should update given its deps and the parent's blocked state.
|
|
66
67
|
// If child doesn't need update and has cached element, reuse it immediately (no push).
|
|
67
|
-
if(!
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
if(
|
|
68
|
+
if(!i&&h?.renderedElement){f.set(c,h.renderedElement);continue}// Otherwise push child for processing; childBlocked inherits parent's blocked state.
|
|
69
|
+
d[e++]={node:c,isProcessed:!1,blocked:g||!i}}}}else{e--;// Extract node props. Non-present props default to undefined via destructuring.
|
|
70
|
+
const a=b.props,{children:c,key:d,css:g,nativeProps:h,disableEmotion:i}=a,j=_objectWithoutProperties(a,_excluded3);let k=[];c&&(k=(Array.isArray(c)?c:[c]).map(a=>NodeUtil.isNodeInstance(a)?f.get(a):isValidElement(a)?a:a));// Merge element props: explicit other props + DOM native props + React key.
|
|
71
|
+
const l=_objectSpread(_objectSpread({},j),{},{key:d},h);let m;// Handle fragments specially: create fragment element with key and children.
|
|
72
|
+
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
73
|
// StyledRenderer handles SSR hydration and emotion CSS injection when css prop exists or element has style tags.
|
|
73
|
-
|
|
74
|
-
if(!NodeUtil.isServer){
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
74
|
+
const a=!i&&(g||!hasNoStyleTag(b.element));m=a?createElement(StyledRenderer,_objectSpread(_objectSpread({element:b.element},l),{},{css:g,suppressHydrationWarning:!0}),...k):createElement(b.element,l,...k)}// Cache the generated element on client-side to speed up future renders.
|
|
75
|
+
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
|
|
76
|
+
const a={prevDeps:b._deps,renderedElement:m,nodeRef:new WeakRef(b),createdAt:Date.now(),accessCount:1,instanceId:b.instanceId};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.
|
|
77
|
+
f.set(b,m)}}// Clear references for GC unconditionally
|
|
78
|
+
d.length=0;// Get the final rendered element for the root node of this render cycle.
|
|
79
|
+
const g=f.get(this);return!NodeUtil.isServer&&this.stableKey?createElement(MeoNodeUnmounter,{node:this},g):g}/**
|
|
78
80
|
* Renders the node into a React Portal, mounting it directly under `document.body`.
|
|
79
81
|
* Returns a handle with `update` and `unmount` methods to control the portal's lifecycle.
|
|
80
82
|
* @method toPortal
|
|
81
|
-
*/toPortal(){
|
|
82
|
-
|
|
83
|
+
*/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
|
|
84
|
+
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
85
|
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(
|
|
85
|
-
NodeUtil.portalInfrastructure
|
|
86
|
-
try{
|
|
86
|
+
try{BaseNode.portalCleanupRegistry.unregister(this)}catch(a){__DEBUG__&&console.warn("[MeoNode] Portal unregister warning:",a)}// Remove from WeakMap
|
|
87
|
+
NodeUtil.portalInfrastructure.delete(this);// Now do the actual cleanup
|
|
88
|
+
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
89
|
* A static method to clear all internal caches.
|
|
88
90
|
*
|
|
89
91
|
* This method performs manual cleanup of all cache entries, calling their
|
|
@@ -92,9 +94,9 @@ try{null!==c&&void 0!==c&&c.isConnected&&f()}catch(a){__DEBUG__&&console.error("
|
|
|
92
94
|
* the associated nodes are collected.
|
|
93
95
|
* @method clearCaches
|
|
94
96
|
*/static clearCaches(){// Collect all cache keys first
|
|
95
|
-
|
|
96
|
-
for(
|
|
97
|
-
if(
|
|
97
|
+
const a=Array.from(BaseNode.elementCache.keys());__DEBUG__&&console.log(`[MeoNode] clearCaches: Clearing ${a.length} entries`);// Call onEvict for all entries (idempotent)
|
|
98
|
+
for(const b of a){const a=BaseNode.elementCache.get(b);if(a){// Try to unregister from FinalizationRegistry
|
|
99
|
+
const c=a.nodeRef?.deref();if(c)try{BaseNode.cacheCleanupRegistry.unregister(c)}catch(a){__DEBUG__&&console.warn(`[MeoNode] Could not unregister ${b} from FinalizationRegistry`)}}}// Clear all caches
|
|
98
100
|
// Clear mount tracking
|
|
99
101
|
BaseNode.propProcessingCache.clear(),BaseNode.elementCache.clear(),ThemeUtil.clearThemeCache(),MountTrackerUtil.cleanup(),__DEBUG__&&console.log("[MeoNode] All caches cleared")}// --- Utilities ---
|
|
100
102
|
}// --- Factory Functions ---
|
|
@@ -102,9 +104,9 @@ BaseNode.propProcessingCache.clear(),BaseNode.elementCache.clear(),ThemeUtil.cle
|
|
|
102
104
|
* The primary factory function for creating a `BaseNode` instance.
|
|
103
105
|
* It's the simplest way to wrap a component or element.
|
|
104
106
|
* @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(
|
|
107
|
+
*/_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);MountTrackerUtil.mountedNodes.has(b)&&d?.instanceId===c&&(_BaseNode.elementCache.delete(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
108
|
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{
|
|
109
|
+
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
110
|
* Static alias on the `Node` factory for clearing all internal caches used by `BaseNode`.
|
|
109
111
|
*
|
|
110
112
|
* Use cases include:
|
|
@@ -122,8 +124,8 @@ export{Node};/**
|
|
|
122
124
|
* Creates a curried node factory for a given React element or component type.
|
|
123
125
|
* This is useful for creating reusable, specialized factory functions (e.g., `const Div = createNode('div')`).
|
|
124
126
|
* @function createNode
|
|
125
|
-
*/export function createNode(a,b){
|
|
127
|
+
*/export function createNode(a,b){const c=(c,d)=>Node(a,_objectSpread(_objectSpread({},b),c),d);return c.element=a,c}/**
|
|
126
128
|
* Creates a node factory function where the first argument is `children` and the second is `props`.
|
|
127
129
|
* This provides a more ergonomic API for components that primarily wrap content (e.g., `P('Some text')`).
|
|
128
130
|
* @function createChildrenFirstNode
|
|
129
|
-
*/export function createChildrenFirstNode(a,b){
|
|
131
|
+
*/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}
|