@meonode/ui 0.2.19 → 0.2.21
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 +29 -0
- package/dist/core.node.d.ts +19 -12
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +57 -49
- package/dist/helper/node.helper.d.ts.map +1 -1
- package/dist/helper/node.helper.js +6 -5
- package/dist/helper/obj.helper.d.ts +4 -5
- package/dist/helper/obj.helper.d.ts.map +1 -1
- package/dist/helper/obj.helper.js +20 -16
- package/dist/hoc/component.hoc.d.ts.map +1 -1
- package/dist/hoc/component.hoc.js +2 -2
- package/dist/node.type.d.ts +10 -4
- package/dist/node.type.d.ts.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,35 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.21] - 2025-09-23
|
|
9
|
+
|
|
10
|
+
### Refactor
|
|
11
|
+
|
|
12
|
+
- **refactor(core):** make node processing logic static and robust
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **feat:** update NodeFunction type to improve dynamic node content generation and update FunctionRendererProps interface to use NodeFunction
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **fix(component.hoc.ts):** enhance node instance check in Renderer for improved stability
|
|
21
|
+
- **fix(node.type.ts):** remove unused processRawNode property from Node type
|
|
22
|
+
|
|
23
|
+
### Changed
|
|
24
|
+
- **package:** update dependencies to latest versions
|
|
25
|
+
|
|
26
|
+
## [0.2.20] - 2025-09-22
|
|
27
|
+
|
|
28
|
+
### Refactor
|
|
29
|
+
|
|
30
|
+
- **refactor(obj.helper)**: streamline serialization logic and improve performance
|
|
31
|
+
|
|
32
|
+
### Fixed
|
|
33
|
+
|
|
34
|
+
- **fix(eslint)**: enforce no-unsafe-function-type rule for better type safety
|
|
35
|
+
- **fix(node.helper.ts)**: update nodeSignature function to accept Children type and improve circular reference handling
|
|
36
|
+
|
|
8
37
|
## [0.2.19] - 2025-09-21
|
|
9
38
|
|
|
10
39
|
### Refactor
|
package/dist/core.node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { Children, FinalNodeProps, HasRequiredProps, MergedProps,
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { Children, FinalNodeProps, HasRequiredProps, MergedProps, NodeElementType, NodeInstance, NodePortal, NodeProps, PropsOf, RawNodeProps } from './node.type.js';
|
|
3
3
|
/**
|
|
4
4
|
* Represents a node in a React component tree with theme and styling capabilities.
|
|
5
5
|
* This class wraps React elements and handles:
|
|
@@ -146,13 +146,18 @@ export declare class BaseNode<E extends NodeElementType> implements NodeInstance
|
|
|
146
146
|
* @private
|
|
147
147
|
* @static
|
|
148
148
|
*/
|
|
149
|
-
static _renderProcessedNode
|
|
149
|
+
private static _renderProcessedNode;
|
|
150
150
|
/**
|
|
151
|
-
*
|
|
152
|
-
* @param
|
|
151
|
+
* Renders this node into a `ReactNode`, handling function node element.
|
|
152
|
+
* @param node The node to render.
|
|
153
153
|
* @private
|
|
154
|
+
* @static
|
|
155
|
+
* @example
|
|
156
|
+
* ```typescript
|
|
157
|
+
* const myNode = Node('div', { children: [ () => 'Hello' ] });
|
|
158
|
+
* ```
|
|
154
159
|
*/
|
|
155
|
-
private _isFunctionChild;
|
|
160
|
+
private static _isFunctionChild;
|
|
156
161
|
/**
|
|
157
162
|
* Renders the output of a function-as-a-child, ensuring theme propagation.
|
|
158
163
|
*
|
|
@@ -162,11 +167,11 @@ export declare class BaseNode<E extends NodeElementType> implements NodeInstance
|
|
|
162
167
|
* @param props The properties for the function renderer.
|
|
163
168
|
* @param props.render The function to execute to get the child content.
|
|
164
169
|
* @param props.passedTheme The theme to propagate to the rendered child.
|
|
165
|
-
* @param props.processRawNode A reference to the `_processRawNode` method for recursive processing.
|
|
170
|
+
* // * @param props.processRawNode A reference to the `_processRawNode` method for recursive processing.
|
|
166
171
|
* @returns The rendered `ReactNode`.
|
|
167
172
|
* @private
|
|
168
173
|
*/
|
|
169
|
-
private _functionRenderer;
|
|
174
|
+
private static _functionRenderer;
|
|
170
175
|
/**
|
|
171
176
|
* Generates a stable key for a node, especially for elements within an array.
|
|
172
177
|
*
|
|
@@ -180,8 +185,9 @@ export declare class BaseNode<E extends NodeElementType> implements NodeInstance
|
|
|
180
185
|
* @param options.children The children of the node, used to add complexity to the key.
|
|
181
186
|
* @returns A React key, or `undefined` if no key could be generated.
|
|
182
187
|
* @private
|
|
188
|
+
* @static
|
|
183
189
|
*/
|
|
184
|
-
private _generateKey;
|
|
190
|
+
private static _generateKey;
|
|
185
191
|
/**
|
|
186
192
|
* Processes a single raw node, recursively converting it into a `BaseNode` or other renderable type.
|
|
187
193
|
*
|
|
@@ -194,13 +200,14 @@ export declare class BaseNode<E extends NodeElementType> implements NodeInstance
|
|
|
194
200
|
* - **React Component Instances**: Renders them and processes the output recursively.
|
|
195
201
|
*
|
|
196
202
|
* It also generates a stable key for elements within an array if one is not provided.
|
|
197
|
-
* @param
|
|
198
|
-
* @param
|
|
203
|
+
* @param node The raw child node to process.
|
|
204
|
+
* @param passedTheme The theme inherited from the parent.
|
|
199
205
|
* @param nodeIndex The index of the child if it is in an array, used for key generation.
|
|
200
206
|
* @returns A processed `NodeElement` (typically a `BaseNode` instance or a primitive).
|
|
201
207
|
* @private
|
|
208
|
+
* @static
|
|
202
209
|
*/
|
|
203
|
-
private _processRawNode;
|
|
210
|
+
private static _processRawNode;
|
|
204
211
|
/**
|
|
205
212
|
* Normalizes a processed child node into a final, renderable `ReactNode`.
|
|
206
213
|
*
|
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":"AACA,
|
|
1
|
+
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"AACA,OAAc,EAQZ,KAAK,YAAY,EAElB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EACV,QAAQ,EACR,cAAc,EAEd,gBAAgB,EAChB,WAAW,EAEX,eAAe,EAEf,YAAY,EACZ,UAAU,EACV,SAAS,EACT,OAAO,EACP,YAAY,EAEb,MAAM,mBAAmB,CAAA;AAQ1B;;;;;;;;GAQG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,eAAe,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IACzE,+EAA+E;IACxE,OAAO,EAAE,CAAC,CAAA;IACjB,kFAAkF;IAC3E,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAK;IACrC,0CAA0C;IAC1C,SAAgB,UAAU,UAAO;IAEjC,wFAAwF;IACxF,OAAO,CAAC,MAAM,CAAC,CAAgB;IAC/B,4CAA4C;IAC5C,OAAO,CAAC,iBAAiB,CAA8B;IACvD,+CAA+C;IAC/C,OAAO,CAAC,gBAAgB,CAA0E;IAClG,+DAA+D;IAC/D,OAAO,CAAC,aAAa,CAAC,CAAQ;IAC9B,oCAAoC;IACpC,OAAO,CAAC,mBAAmB,CAAC,CAAW;IACvC,mFAAmF;IACnF,OAAO,CAAC,MAAM,CAAC,SAAS,CAAgC;IAExD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,2BAA2B,CAOvC;IAEH;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B,CAMtC;IAEH,6EAA6E;IAC7E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,6BAA6B,QAAO;IAE5D;;;;;;;;OAQG;IACH,YAAY,OAAO,EAAE,CAAC,EAAE,QAAQ,GAAE,YAAY,CAAC,CAAC,CAAM,EAGrD;IAED;;;;;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E,UAAU,CAAC,KACrD,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,GACtC,CAAC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,QAAQ,CAAC,EAAE,QAAQ,EACnB,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,KACtD,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAQzC"}
|
package/dist/core.node.js
CHANGED
|
@@ -15,19 +15,6 @@
|
|
|
15
15
|
* @param element The React element or component type this node will represent.
|
|
16
16
|
* @param rawProps The initial, unprocessed props for the element.
|
|
17
17
|
*/constructor(a){var b=this,c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};/** The underlying React element or component type that this node represents *//** Original props passed during construction, preserved for cloning/recreation *//** Flag to identify BaseNode instances *//** DOM element used for portal rendering *//** React root instance for portal rendering *//**
|
|
18
|
-
* Generates a stable key for a node, especially for elements within an array.
|
|
19
|
-
*
|
|
20
|
-
* If an `existingKey` is provided, it is returned. Otherwise, a key is generated
|
|
21
|
-
* based on the element's type name and its index within a list of siblings.
|
|
22
|
-
* This helps prevent re-rendering issues in React when dealing with dynamic lists.
|
|
23
|
-
* @param options The options for key generation.
|
|
24
|
-
* @param options.nodeIndex The index of the node in an array of children.
|
|
25
|
-
* @param options.element The element for which to generate a key.
|
|
26
|
-
* @param options.existingKey An existing key, if one was already provided.
|
|
27
|
-
* @param options.children The children of the node, used to add complexity to the key.
|
|
28
|
-
* @returns A React key, or `undefined` if no key could be generated.
|
|
29
|
-
* @private
|
|
30
|
-
*//**
|
|
31
18
|
* Normalizes a processed child node into a final, renderable `ReactNode`.
|
|
32
19
|
*
|
|
33
20
|
* This method is called during the `render` phase. It takes a child that has already
|
|
@@ -40,7 +27,7 @@
|
|
|
40
27
|
* @returns A renderable `ReactNode`.
|
|
41
28
|
* @throws {Error} If the child is not a valid React element type.
|
|
42
29
|
* @private
|
|
43
|
-
*/_defineProperty(this,"rawProps",{}),_defineProperty(this,"isBaseNode",!0),_defineProperty(this,"_portalDOMElement",null),_defineProperty(this,"_portalReactRoot",null),_defineProperty(this,"
|
|
30
|
+
*/_defineProperty(this,"rawProps",{}),_defineProperty(this,"isBaseNode",!0),_defineProperty(this,"_portalDOMElement",null),_defineProperty(this,"_portalReactRoot",null),_defineProperty(this,"_normalizeChild",function(a){var c,d;// Handle null/undefined quickly
|
|
44
31
|
if(null===a||a===void 0)return a;// Primitives should be returned as-is (text nodes, numbers, booleans)
|
|
45
32
|
var e=_typeof(a);if("string"===e||"number"===e||"boolean"===e)return a;var f=(null===(c=b.rawProps)||void 0===c?void 0:c.nodetheme)||(null===(d=b.rawProps)||void 0===d?void 0:d.theme)||b.props.nodetheme||b.props.theme;// For BaseNode instances, apply current theme if child has no theme
|
|
46
33
|
if(a instanceof BaseNode||isNodeInstance(a)){var g;return null!==(g=a.rawProps)&&void 0!==g&&g.nodetheme||void 0===f?a.render():new BaseNode(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{nodetheme:f})).render()}// Handle React.Component instances
|
|
@@ -81,7 +68,7 @@ return"string"==typeof this.element&&(hasNoStyleTag(this.element)?w=omit(w,"css"
|
|
|
81
68
|
* @param processed The processed child or array of children to clone.
|
|
82
69
|
* @returns A deep clone of the processed children, safe for use in multiple parents.
|
|
83
70
|
* @private
|
|
84
|
-
*/static _cloneProcessedChildren(a){var b=function cloneOne(a){return a instanceof BaseNode?new BaseNode(a.element,_objectSpread({},a.rawProps)):a;// NodeInstance returns its own instances when render() is called - we avoid calling render here.
|
|
71
|
+
*/static _cloneProcessedChildren(a){var b=function cloneOne(a){return a instanceof BaseNode||isNodeInstance(a)?new BaseNode(a.element,_objectSpread({},a.rawProps)):a;// NodeInstance returns its own instances when render() is called - we avoid calling render here.
|
|
85
72
|
// For other objects/primitives, return as-is (they are immutable or safe to reuse).
|
|
86
73
|
};return Array.isArray(a)?a.map(function(a){return b(a)}):b(a)}/**
|
|
87
74
|
* Retrieves cached processed children for a given set of `children` and an optional `theme`.
|
|
@@ -124,8 +111,8 @@ if(BaseNode._processedChildrenMapCache.has(d))return void BaseNode._processedChi
|
|
|
124
111
|
* @param theme The theme to propagate to the children.
|
|
125
112
|
* @returns The processed children, ready for normalization and rendering.
|
|
126
113
|
* @private
|
|
127
|
-
*/_processChildren(a,b){
|
|
128
|
-
var
|
|
114
|
+
*/_processChildren(a,b){if(a){// Use RSC-safe caching strategy
|
|
115
|
+
var c=this._getCachedChildren(a,b);if(c)return c;var d;return d="function"==typeof a?a:Array.isArray(a)?a.map(function(a,c){return BaseNode._processRawNode(a,b,c)}):BaseNode._processRawNode(a,b),BaseNode._isServer||this._setCachedChildren(a,b,d),d}}/**
|
|
129
116
|
* Renders a processed `NodeElement` into a `ReactNode`, applying a theme and key if necessary.
|
|
130
117
|
*
|
|
131
118
|
* This static method centralizes the logic for converting various types of processed elements
|
|
@@ -143,21 +130,25 @@ var d=this._getCachedChildren(a,b);if(d)return d;var e;return e="function"==type
|
|
|
143
130
|
* @private
|
|
144
131
|
* @static
|
|
145
132
|
*/static _renderProcessedNode(a,b,c){var d={};// 1. BaseNode instance: re-wrap to apply key/theme if needed
|
|
146
|
-
if(void 0!==c&&(d.key=c),a instanceof BaseNode){var e,f,g,h,i,j=(null===(e=a.rawProps)||void 0===e?void 0:e.theme)||(null===(f=a.rawProps)||void 0===f?void 0:f.nodetheme)||b,k=null===(g=a.rawProps)||void 0===g?void 0:g.key;return k===c&&j===((null===(h=a.rawProps)||void 0===h?void 0:h.nodetheme)||(null===(i=a.rawProps)||void 0===i?void 0:i.theme))?a.render():new BaseNode(a.element,_objectSpread(_objectSpread(_objectSpread({},a.rawProps),d),{},{nodetheme:j})).render()}// 2. React class component type: wrap in BaseNode
|
|
133
|
+
if(void 0!==c&&(d.key=c),a instanceof BaseNode||isNodeInstance(a)){var e,f,g,h,i,j=(null===(e=a.rawProps)||void 0===e?void 0:e.theme)||(null===(f=a.rawProps)||void 0===f?void 0:f.nodetheme)||b,k=null===(g=a.rawProps)||void 0===g?void 0:g.key;return k===c&&j===((null===(h=a.rawProps)||void 0===h?void 0:h.nodetheme)||(null===(i=a.rawProps)||void 0===i?void 0:i.theme))?a.render():new BaseNode(a.element,_objectSpread(_objectSpread(_objectSpread({},a.rawProps),d),{},{nodetheme:j})).render()}// 2. React class component type: wrap in BaseNode
|
|
147
134
|
return isReactClassComponent(a)?new BaseNode(a,d).render():isNodeInstance(a)?a.render():a instanceof React.Component?a.render():"function"==typeof a?createElement(a,{key:c}):a;// 3. NodeInstance object: call its render
|
|
148
135
|
// 4. React.Component instance: call its render
|
|
149
136
|
// 5. Functional component: create element with key
|
|
150
137
|
// 6. Other valid ReactNode types
|
|
151
138
|
}/**
|
|
152
|
-
*
|
|
153
|
-
* @param
|
|
139
|
+
* Renders this node into a `ReactNode`, handling function node element.
|
|
140
|
+
* @param node The node to render.
|
|
154
141
|
* @private
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
142
|
+
* @static
|
|
143
|
+
* @example
|
|
144
|
+
* ```typescript
|
|
145
|
+
* const myNode = Node('div', { children: [ () => 'Hello' ] });
|
|
146
|
+
* ```
|
|
147
|
+
*/static _isFunctionChild(a){// Basic function check
|
|
148
|
+
if("function"!=typeof a)return!1;// Exclude React component types
|
|
149
|
+
if(isReactClassComponent(a))return!1;if(isMemo(a))return!1;if(isForwardRef(a))return!1;try{// Try to check if it's a React component instance using prototype
|
|
150
|
+
return!(a.prototype&&"function"==typeof a.prototype.render)}catch(a){// If accessing prototype fails (due to cross-realm), assume it's a function child
|
|
151
|
+
return!0}}/**
|
|
161
152
|
* Renders the output of a function-as-a-child, ensuring theme propagation.
|
|
162
153
|
*
|
|
163
154
|
* This method is designed to handle "render prop" style children (`() => ReactNode`).
|
|
@@ -166,19 +157,32 @@ return!("function"!=typeof a)&&!isReactClassComponent(a)&&!isMemo(a)&&!isForward
|
|
|
166
157
|
* @param props The properties for the function renderer.
|
|
167
158
|
* @param props.render The function to execute to get the child content.
|
|
168
159
|
* @param props.passedTheme The theme to propagate to the rendered child.
|
|
169
|
-
* @param props.processRawNode A reference to the `_processRawNode` method for recursive processing.
|
|
160
|
+
* // * @param props.processRawNode A reference to the `_processRawNode` method for recursive processing.
|
|
170
161
|
* @returns The rendered `ReactNode`.
|
|
171
162
|
* @private
|
|
172
|
-
*/_functionRenderer(a){var b,c=a.render,d=a.passedTheme
|
|
163
|
+
*/static _functionRenderer(a){var b,c=a.render,d=a.passedTheme;// Invoke the render function to get the child node.
|
|
173
164
|
try{b=c()}catch(a){b=null}// Handle null/undefined
|
|
174
165
|
if(null===b||b===void 0)return b;// Handle arrays of elements (common in render props)
|
|
175
|
-
if(Array.isArray(b))return b.map(function(a,b){var c=
|
|
176
|
-
if(b instanceof React.Component){var
|
|
177
|
-
if(b instanceof BaseNode||isNodeInstance(b)){var h
|
|
178
|
-
return void 0===(null===(h
|
|
179
|
-
if("string"==typeof b||"number"==typeof b||"boolean"==typeof b
|
|
180
|
-
)return b
|
|
181
|
-
|
|
166
|
+
if(Array.isArray(b))return b.map(function(a,b){var c=BaseNode._processRawNode(a,d,b);return BaseNode._renderProcessedNode(c,d,"".concat(getElementTypeName(a),"-").concat(b))});// Handle React.Component instance
|
|
167
|
+
if(b instanceof React.Component){var e=b.render(),f=BaseNode._processRawNode(e,d);return BaseNode._renderProcessedNode(f,d)}// Handle BaseNode instance or NodeInstance
|
|
168
|
+
if(b instanceof BaseNode||isNodeInstance(b)){var g,h=b;// If nodetheme is missing and passedTheme exists, inject it
|
|
169
|
+
return void 0===(null===(g=h.rawProps)||void 0===g?void 0:g.nodetheme)&&void 0!==d?new BaseNode(h.element,_objectSpread(_objectSpread({},h.rawProps),{},{nodetheme:d})).render():h.render()}// Handle primitives and valid React nodes (string, number, boolean)
|
|
170
|
+
if("string"==typeof b||"number"==typeof b||"boolean"==typeof b)return b;// Process any other result types
|
|
171
|
+
var i=BaseNode._processRawNode(b,d);return i?BaseNode._renderProcessedNode(i,d):b}/**
|
|
172
|
+
* Generates a stable key for a node, especially for elements within an array.
|
|
173
|
+
*
|
|
174
|
+
* If an `existingKey` is provided, it is returned. Otherwise, a key is generated
|
|
175
|
+
* based on the element's type name and its index within a list of siblings.
|
|
176
|
+
* This helps prevent re-rendering issues in React when dealing with dynamic lists.
|
|
177
|
+
* @param options The options for key generation.
|
|
178
|
+
* @param options.nodeIndex The index of the node in an array of children.
|
|
179
|
+
* @param options.element The element for which to generate a key.
|
|
180
|
+
* @param options.existingKey An existing key, if one was already provided.
|
|
181
|
+
* @param options.children The children of the node, used to add complexity to the key.
|
|
182
|
+
* @returns A React key, or `undefined` if no key could be generated.
|
|
183
|
+
* @private
|
|
184
|
+
* @static
|
|
185
|
+
*//**
|
|
182
186
|
* Processes a single raw node, recursively converting it into a `BaseNode` or other renderable type.
|
|
183
187
|
*
|
|
184
188
|
* This is a central method for normalizing children. It handles various types of input:
|
|
@@ -190,29 +194,33 @@ var j=e?e(b,d):b;return j?BaseNode._renderProcessedNode(j,d):b}/**
|
|
|
190
194
|
* - **React Component Instances**: Renders them and processes the output recursively.
|
|
191
195
|
*
|
|
192
196
|
* It also generates a stable key for elements within an array if one is not provided.
|
|
193
|
-
* @param
|
|
194
|
-
* @param
|
|
197
|
+
* @param node The raw child node to process.
|
|
198
|
+
* @param passedTheme The theme inherited from the parent.
|
|
195
199
|
* @param nodeIndex The index of the child if it is in an array, used for key generation.
|
|
196
200
|
* @returns A processed `NodeElement` (typically a `BaseNode` instance or a primitive).
|
|
197
201
|
* @private
|
|
198
|
-
|
|
202
|
+
* @static
|
|
203
|
+
*/static _processRawNode(a,b,c// Index for generating stable keys for array children
|
|
199
204
|
){var d=getComponentType(a);// Determine the type of the raw node
|
|
200
205
|
// Case 1: Child is already a BaseNode instance
|
|
201
|
-
if(a instanceof BaseNode){var e=a
|
|
206
|
+
if(a instanceof BaseNode||isNodeInstance(a)){var e=a.rawProps||{},f=e.theme||e.nodetheme||b;// Get initial raw props of the child
|
|
202
207
|
// Prefer child's own theme
|
|
203
208
|
// Check if we can reuse the existing node
|
|
204
|
-
if(
|
|
205
|
-
return new BaseNode(
|
|
206
|
-
key:
|
|
209
|
+
if(e.nodetheme===f&&e.key!==void 0)return a;var g=BaseNode._generateKey({nodeIndex:c,element:a.element,existingKey:e.key,children:e.children});// Generate key if needed
|
|
210
|
+
return new BaseNode(a.element,_objectSpread(_objectSpread({},e),{},{nodetheme:f,// Use the determined theme for the new node
|
|
211
|
+
key:g}));// Create a new BaseNode with merged props and theme
|
|
207
212
|
}// Case 2: Child is a primitive (string, number, boolean, null, undefined)
|
|
208
213
|
if("string"===d||"number"===d||"boolean"===d||null===a||void 0===a)return a;// Case 3: Child is a function that needs to be called during render (FunctionRenderer).
|
|
209
|
-
if(
|
|
210
|
-
|
|
211
|
-
|
|
214
|
+
if(BaseNode._isFunctionChild(a)){// The key is for the BaseNode that wraps the _functionRenderer component.
|
|
215
|
+
// Functions themselves don't have a .key prop that we can access here.
|
|
216
|
+
var h=BaseNode._generateKey({nodeIndex:c,element:BaseNode._functionRenderer});// Generate key for function renderer
|
|
217
|
+
return new BaseNode(BaseNode._functionRenderer,{render:a,passedTheme:b,key:h})}// Case 4: Child is a React Element (JSX element like <div> or <MyComponent>)
|
|
218
|
+
if(isValidElement(a)){var i=a.props,j=i.style,k=_objectWithoutProperties(i,_excluded4),l=_objectSpread(_objectSpread({},k),j||{}),m=l.theme||l.nodetheme||b,n=BaseNode._generateKey({nodeIndex:c,element:a.type,existingKey:a.key,children:l.children});return new BaseNode(a.type,_objectSpread(_objectSpread({},l),{},{nodetheme:m,key:n}))}// Case 5: Child is an ElementType (string tag, class component, Memo/ForwardRef)
|
|
219
|
+
if(isReactClassComponent(a)||"object"===d&&(isMemo(a)||isForwardRef(a))){var o,p=BaseNode._generateKey({nodeIndex:c,element:a,children:"object"===_typeof(a)&&"props"in a?null===(o=a.props)||void 0===o?void 0:o.children:void 0});// ElementTypes don't have an intrinsic key from the node itself.
|
|
212
220
|
return new BaseNode(a,{nodetheme:b,// Apply parent theme
|
|
213
|
-
key:
|
|
214
|
-
if(a instanceof React.Component){var
|
|
215
|
-
return
|
|
221
|
+
key:p})}// Case 6: Handle instances of React.Component
|
|
222
|
+
if(a instanceof React.Component){var q=a.render();// Recursively process the rendered element with a parent theme and index if available
|
|
223
|
+
return BaseNode._processRawNode(q,b,c)}// Case 7: Fallback for other ReactNode types (e.g., Fragments, Portals if not caught by isValidElement)
|
|
216
224
|
// These are returned as-is. If they are elements within an array, React expects them to have keys.
|
|
217
225
|
// This logic primarily adds keys to BaseNode instances we create, other ReactNodes are returned as-is.
|
|
218
226
|
return a}/**
|
|
@@ -285,7 +293,7 @@ return this._portalReactRoot}}}/**
|
|
|
285
293
|
* @param props The props for the node (optional).
|
|
286
294
|
* @param additionalProps Additional props to merge into the node (optional).
|
|
287
295
|
* @returns A new `BaseNode` instance as a `NodeInstance<E>`.
|
|
288
|
-
*/_defineProperty(BaseNode,"_isServer","undefined"==typeof window),_defineProperty(BaseNode,"_processedChildrenWeakCache",new WeakMap),_defineProperty(BaseNode,"_processedChildrenMapCache",new Map),_defineProperty(BaseNode,"_MAX_PROCESSED_CHILDREN_CACHE",1e3);export function Node(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},d=_objectSpread(_objectSpread({},b),c);return d.theme&&!d.nodetheme&&(d.nodetheme=d.theme),new BaseNode(a,d)}/**
|
|
296
|
+
*/_defineProperty(BaseNode,"_isServer","undefined"==typeof window),_defineProperty(BaseNode,"_processedChildrenWeakCache",new WeakMap),_defineProperty(BaseNode,"_processedChildrenMapCache",new Map),_defineProperty(BaseNode,"_MAX_PROCESSED_CHILDREN_CACHE",1e3),_defineProperty(BaseNode,"_generateKey",function(a){var b=a.nodeIndex,c=a.element,d=a.existingKey,e=a.children;if(d)return d;var f,g=getElementTypeName(c);return f=Array.isArray(e)&&0<e.length?void 0===b?"".concat(g,"-").concat(e.length):"".concat(g,"-").concat(b,"-").concat(e.length):void 0===b?g:"".concat(g,"-").concat(b),f});export function Node(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},d=_objectSpread(_objectSpread({},b),c);return d.theme&&!d.nodetheme&&(d.nodetheme=d.theme),new BaseNode(a,d)}/**
|
|
289
297
|
* Creates a curried node factory for a given React element or component type.
|
|
290
298
|
*
|
|
291
299
|
* Returns a function that, when called with props, produces a `NodeInstance<E>`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.helper.d.ts","sourceRoot":"","sources":["../../src/helper/node.helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAItE;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,4CAS1B,CAAA;AA4DD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiE/B,CAAA;AA8FD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,CAAC,EAAE,KAAK,UAIjE"}
|
|
@@ -115,11 +115,12 @@ minWidth:0},d)};/**
|
|
|
115
115
|
* - element type (string or component name)
|
|
116
116
|
* - key (if present)
|
|
117
117
|
* - basic children shape (recursing within limits)
|
|
118
|
-
*/function nodeSignature(a){var b=Math.min,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:5,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:6,e=3<arguments.length&&void 0!==arguments[3]?arguments[3]:new WeakSet;if(null===a)return"null";if(void 0===a)return"undefined";var f=_typeof(a);if("string"===f)return"s:".concat(a);if("number"===f)return"n:".concat(a+"");if("boolean"===f)return"b:".concat(a+"");if("function"===f)return"\u0192:(".concat(a+"",")");if("symbol"===f)return"sym:".concat(a+"");//
|
|
119
|
-
if(
|
|
120
|
-
if(
|
|
121
|
-
|
|
122
|
-
|
|
118
|
+
*/function nodeSignature(a){var b=Math.min,c=1<arguments.length&&void 0!==arguments[1]?arguments[1]:5,d=2<arguments.length&&void 0!==arguments[2]?arguments[2]:6,e=3<arguments.length&&void 0!==arguments[3]?arguments[3]:new WeakSet;if(null===a)return"null";if(void 0===a)return"undefined";var f=_typeof(a);if("string"===f)return"s:".concat(a);if("number"===f)return"n:".concat(a+"");if("boolean"===f)return"b:".concat(a+"");if("function"===f)return"\u0192:(".concat(a+"",")");if("symbol"===f)return"sym:".concat(a+"");// Circular reference check for all objects
|
|
119
|
+
if("object"===f){if(e.has(a))return"[Circular]";e.add(a)}// Arrays
|
|
120
|
+
if(Array.isArray(a)){if(0>=c)return"ary[...]";for(var g=[],h=b(a.length,d),j=0;j<h;j++)g.push(nodeSignature(a[j],c-1,d,e));return a.length>d&&g.push("...len:".concat(a.length)),"ary[".concat(g.join(","),"]")}// React element-ish: require a 'type' property
|
|
121
|
+
if("object"===f&&a&&"type"in a){// Type can be string (div) or function/class. Use helper to get name.
|
|
122
|
+
var l,m=a.type;try{l=getElementTypeName(m)}catch(a){try{l=m+""}catch(a){l="unknown"}}var n,o="object"===f&&"key"in a&&null!=a.key?"#".concat(a.key+""):"",p="props"in a&&"object"===_typeof(a.props)&&a.props||{};try{n=nodeSignature(p.children,c-1,d,e)}catch(a){n="<err>"}var q=p.id?"@id:".concat(p.id+""):"",r=p.className?"@class:".concat(p.className+""):"";return"el:".concat(l).concat(o).concat(q).concat(r,"{").concat(n,"}")}// Plain object: handles any other object
|
|
123
|
+
if("object"===f&&a){if(0>=c)return"obj[...]";for(var s,t=Object.keys(a).sort(),u=[],v=b(t.length,d),w=0;w<v;w++){s=t[w];try{u.push("".concat(s,":").concat(nodeSignature(a[s],c-1,d,e)))}catch(a){u.push("".concat(s,":<err>"))}}return t.length>d&&u.push("...keys:".concat(t.length)),"obj{".concat(u.join(","),"}")}// Fallback
|
|
123
124
|
try{return"o:".concat(a+"")}catch(a){return"o:<unserializable>"}}/**
|
|
124
125
|
* Public: createStableHash
|
|
125
126
|
* Produces a deterministic string signature for children + theme.
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
export declare class ObjHelper {
|
|
2
2
|
private constructor();
|
|
3
3
|
/**
|
|
4
|
-
* Build a
|
|
5
|
-
* - sorts plain object keys
|
|
4
|
+
* Build a serializable representation of `value`.
|
|
6
5
|
* - preserves encoded placeholders for special types
|
|
7
6
|
* - emits { $type: 'Circular', ref: id } for circular refs
|
|
8
7
|
*/
|
|
9
8
|
private static buildSerializable;
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Stringify with performance optimizations.
|
|
11
|
+
* @param obj Object to serialize
|
|
12
|
+
* @param space JSON.stringify space parameter
|
|
13
13
|
*/
|
|
14
14
|
static stringify(obj: any, space?: number): string;
|
|
15
|
-
static parse(str: string): any;
|
|
16
15
|
}
|
|
17
16
|
//# sourceMappingURL=obj.helper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obj.helper.d.ts","sourceRoot":"","sources":["../../src/helper/obj.helper.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"obj.helper.d.ts","sourceRoot":"","sources":["../../src/helper/obj.helper.ts"],"names":[],"mappings":"AAOA,qBAAa,SAAS;IACpB,OAAO,eAAiB;IAExB;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAmGhC;;;;OAIG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,KAAK,SAAI,GAAG,MAAM,CAU5C;CACF"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
function _slicedToArray(a,b){return _arrayWithHoles(a)||_iterableToArrayLimit(a,b)||_unsupportedIterableToArray(a,b)||_nonIterableRest()}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _iterableToArrayLimit(b,c){var d=null==b?null:"undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(null!=d){var g,h,j,k,l=[],a=!0,m=!1;try{if(j=(d=d.call(b)).next,0===c){if(Object(d)!==d)return;a=!1}else for(;!(a=(g=j.call(d)).done)&&(l.push(g.value),l.length!==c);a=!0);}catch(a){m=!0,h=a}finally{try{if(!a&&null!=d["return"]&&(k=d["return"](),Object(k)!==k))return}finally{if(m)throw h}}return l}}function _arrayWithHoles(a){if(Array.isArray(a))return a}function _createForOfIteratorHelper(b,c){var d="undefined"!=typeof Symbol&&b[Symbol.iterator]||b["@@iterator"];if(!d){if(Array.isArray(b)||(d=_unsupportedIterableToArray(b))||c&&b&&"number"==typeof b.length){d&&(b=d);var e=0,f=function F(){};return{s:f,n:function n(){return e>=b.length?{done:!0}:{done:!1,value:b[e++]}},e:function e(a){throw a},f:f}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var g,h=!0,i=!1;return{s:function s(){d=d.call(b)},n:function n(){var a=d.next();return h=a.done,a},e:function e(a){i=!0,g=a},f:function f(){try{h||null==d["return"]||d["return"]()}finally{if(i)throw g}}}}function _unsupportedIterableToArray(b,c){if(b){if("string"==typeof b)return _arrayLikeToArray(b,c);var a={}.toString.call(b).slice(8,-1);return"Object"===a&&b.constructor&&(a=b.constructor.name),"Map"===a||"Set"===a?Array.from(b):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?_arrayLikeToArray(b,c):void 0}}function _arrayLikeToArray(b,c){(null==c||c>b.length)&&(c=b.length);for(var d=0,f=Array(c);d<c;d++)f[d]=b[d];return f}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}export class ObjHelper{constructor(){}/**
|
|
2
|
-
* Build a
|
|
3
|
-
* - sorts plain object keys
|
|
2
|
+
* Build a serializable representation of `value`.
|
|
4
3
|
* - preserves encoded placeholders for special types
|
|
5
4
|
* - emits { $type: 'Circular', ref: id } for circular refs
|
|
6
|
-
*/static buildSerializable(a,b
|
|
7
|
-
if(null===a||
|
|
8
|
-
if(
|
|
9
|
-
if(a
|
|
10
|
-
if(
|
|
11
|
-
if(
|
|
12
|
-
|
|
13
|
-
if(
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
try{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
*/static buildSerializable(a,b){var c=this;// Fast path for primitives
|
|
6
|
+
if(null===a||void 0===a)return a;var d=_typeof(a);// Handle primitives first (most common case)
|
|
7
|
+
if("string"===d||"number"===d||"boolean"===d)return a;// Handle functions
|
|
8
|
+
if("function"===d){var e=b.functionIds.get(a);return void 0===e&&(e=b.nextFunctionId++,b.functionIds.set(a,e)),{$type:"Function",name:a.name||"",id:e}}// Handle other primitives
|
|
9
|
+
if("symbol"===d){var f;return{$type:"Symbol",key:null!==(f=a.description)&&void 0!==f?f:""}}if("bigint"===d)return{$type:"BigInt",value:a.toString()};// Only objects beyond this point
|
|
10
|
+
if("object"!==d)// Fallback for unknown types
|
|
11
|
+
try{return a+""}catch(a){return"<unserializable>"}// Handle built-in object types before circular check (they're less likely to be circular)
|
|
12
|
+
if(a instanceof Date)return{$type:"Date",value:a.toISOString()};if(a instanceof RegExp)return{$type:"RegExp",source:a.source,flags:a.flags};// Circular detection
|
|
13
|
+
var g=b.seen.get(a);if(void 0!==g)return{$type:"Circular",ref:g};// Assign ID and mark as seen
|
|
14
|
+
var h=b.nextObjId++;// Handle Map
|
|
15
|
+
if(b.seen.set(a,h),a instanceof Map){var i,j=[],l=_createForOfIteratorHelper(a.entries());try{for(l.s();!(i=l.n()).done;){var m=_slicedToArray(i.value,2),n=m[0],o=m[1];j.push([this.buildSerializable(n,b),this.buildSerializable(o,b)])}}catch(a){l.e(a)}finally{l.f()}return{$type:"Map",entries:j}}// Handle Set
|
|
16
|
+
if(a instanceof Set){var p,q=[],r=_createForOfIteratorHelper(a.values());try{for(r.s();!(p=r.n()).done;){var s=p.value;q.push(this.buildSerializable(s,b))}}catch(a){r.e(a)}finally{r.f()}return{$type:"Set",values:q}}// Handle Arrays
|
|
17
|
+
if(Array.isArray(a))// Use map for cleaner code and potential engine optimizations
|
|
18
|
+
return a.map(function(a){return c.buildSerializable(a,b)});// Handle plain objects
|
|
19
|
+
try{for(var t,u=Object.keys(a),w={},x=0,y=u;x<y.length;x++){t=y[x];try{w[t]=this.buildSerializable(a[t],b)}catch(a){w[t]="<unserializable>"}}return w}catch(a){return"<unserializable>"}}/**
|
|
20
|
+
* Stringify with performance optimizations.
|
|
21
|
+
* @param obj Object to serialize
|
|
22
|
+
* @param space JSON.stringify space parameter
|
|
23
|
+
*/static stringify(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:0,c={nextObjId:0,nextFunctionId:0,seen:new Map,functionIds:new Map},d=this.buildSerializable(a,c);return JSON.stringify(d,null,b)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.hoc.d.ts","sourceRoot":"","sources":["../../src/hoc/component.hoc.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"component.hoc.d.ts","sourceRoot":"","sources":["../../src/hoc/component.hoc.ts"],"names":[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|
-
"use strict";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)}import{BaseNode,Node}from"../core.node.js";import{getElementTypeName}from"../helper/common.helper.js";/**
|
|
1
|
+
"use strict";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)}import{BaseNode,Node}from"../core.node.js";import{getElementTypeName}from"../helper/common.helper.js";import{isNodeInstance}from"../helper/node.helper.js";/**
|
|
2
2
|
* Props definition for components wrapped using the `Component` higher-order function.
|
|
3
3
|
*
|
|
4
4
|
* This type adapts based on whether the underlying component defines its own props:
|
|
@@ -48,4 +48,4 @@
|
|
|
48
48
|
*//**
|
|
49
49
|
* Internal implementation of the `Component` HOC.
|
|
50
50
|
* Handles theme propagation, BaseNode conversion, and wrapper creation.
|
|
51
|
-
*/export function Component(a){function Func(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Node(c,a).render()}var b=getElementTypeName(a),c=function Renderer(b){var c=a(b);if(c instanceof BaseNode){var d,e,f=(null===(d=c.rawProps)||void 0===d?void 0:d.nodetheme)||(null===(e=c.rawProps)||void 0===e?void 0:e.theme)||b.nodetheme||b.theme;return Node(c.element,_objectSpread(_objectSpread({},c.rawProps),{},{nodetheme:f})).render()}return c};return c.displayName="Renderer(".concat(b,")"),Func.displayName="Component(".concat(b,")"),Func}
|
|
51
|
+
*/export function Component(a){function Func(){var a=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};return Node(c,a).render()}var b=getElementTypeName(a),c=function Renderer(b){var c=a(b);if(c instanceof BaseNode||isNodeInstance(c)){var d,e,f=(null===(d=c.rawProps)||void 0===d?void 0:d.nodetheme)||(null===(e=c.rawProps)||void 0===e?void 0:e.theme)||b.nodetheme||b.theme;return Node(c.element,_objectSpread(_objectSpread({},c.rawProps),{},{nodetheme:f})).render()}return c};return c.displayName="Renderer(".concat(b,")"),Func.displayName="Component(".concat(b,")"),Func}
|
package/dist/node.type.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type NonArrayReactNode = Exclude<ReactNode, ReactNode[]>;
|
|
|
20
20
|
* Defines the various types that can represent a "node" in the Meonode system.
|
|
21
21
|
* This includes React elements, components, promises resolving to React nodes, and NodeInstance objects.
|
|
22
22
|
*/
|
|
23
|
-
export type NodeElement = ExoticComponent<any> | NonArrayReactNode | Promise<Awaited<NonArrayReactNode>> | Component<any, any, any> | ElementType | ComponentType<any> | NodeInstance<any> | ((props?: any) =>
|
|
23
|
+
export type NodeElement = ExoticComponent<any> | NonArrayReactNode | Promise<Awaited<NonArrayReactNode>> | Component<any, any, any> | ElementType | ComponentType<any> | NodeInstance<any> | NodeFunction<any> | ((props?: Record<string, any>) => ExoticComponent<any> | NonArrayReactNode | Component<any, any, any> | ElementType | ComponentType<any> | NodeInstance<any>);
|
|
24
24
|
export type NodeElementType = ElementType | ExoticComponent<any>;
|
|
25
25
|
/** A single NodeElement or an array of NodeElements */
|
|
26
26
|
export type Children = NodeElement | NodeElement[];
|
|
@@ -127,6 +127,13 @@ export type NodeProps<E extends NodeElement> = Omit<PropsOf<E>, keyof CSSPropert
|
|
|
127
127
|
export type RawNodeProps<E extends NodeElement> = Partial<NodeProps<E>> & {
|
|
128
128
|
nodetheme?: Theme;
|
|
129
129
|
};
|
|
130
|
+
/**
|
|
131
|
+
* Function type for dynamic node content generation.
|
|
132
|
+
* Accepts optional NodeProps and returns a ReactNode or NodeInstance.
|
|
133
|
+
* Enables advanced patterns like render props and dynamic theming.
|
|
134
|
+
* @template E - The element type these props apply to
|
|
135
|
+
*/
|
|
136
|
+
export type NodeFunction<E extends ReactNode | NodeInstance = ReactNode | NodeInstance> = (props?: NodeProps<E>) => ReactNode | NodeInstance | React.Component;
|
|
130
137
|
/**
|
|
131
138
|
* Props interface for the internal FunctionRenderer component.
|
|
132
139
|
* Handles dynamic function children within React's component lifecycle:
|
|
@@ -134,12 +141,11 @@ export type RawNodeProps<E extends NodeElement> = Partial<NodeProps<E>> & {
|
|
|
134
141
|
* - Maintains theme context for rendered content
|
|
135
142
|
* - Enables hook usage in function children
|
|
136
143
|
*/
|
|
137
|
-
export interface FunctionRendererProps<E extends
|
|
144
|
+
export interface FunctionRendererProps<E extends ReactNode | NodeInstance> {
|
|
138
145
|
/** Function that returns the child content to render */
|
|
139
|
-
render:
|
|
146
|
+
render: NodeFunction<E>;
|
|
140
147
|
/** Theme context to be applied to the rendered content */
|
|
141
148
|
passedTheme?: Theme;
|
|
142
|
-
processRawNode: (node: NodeElement, parentTheme?: Theme, childIndex?: number) => NodeElement;
|
|
143
149
|
}
|
|
144
150
|
export type ComponentNode = (NodeInstance<any> | ReactNode) | (() => NodeInstance<any> | ReactNode);
|
|
145
151
|
/**
|
package/dist/node.type.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.type.d.ts","sourceRoot":"","sources":["../src/node.type.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EACZ,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,GAAG,EACR,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAA;AACd,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gC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OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAA;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,SAAS,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAC5E,KAAK,CAAC,EAAE,CAAC,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,KAC5E,UAAU,CAAA;AAEf;;;;;GAKG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,EAAE,MAAM,eAAe,CAAC,GACvJ,eAAe,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meonode/ui",
|
|
3
3
|
"description": "A structured approach to component composition, direct CSS-first prop styling, built-in theming, smart prop handling (including raw property pass-through), and dynamic children.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.21",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
@@ -48,19 +48,19 @@
|
|
|
48
48
|
"@babel/preset-typescript": "^7.27.1",
|
|
49
49
|
"@emotion/cache": "^11.14.0",
|
|
50
50
|
"@emotion/jest": "^11.13.0",
|
|
51
|
-
"@eslint/js": "^9.
|
|
51
|
+
"@eslint/js": "^9.36.0",
|
|
52
52
|
"@testing-library/dom": "^10.4.1",
|
|
53
53
|
"@testing-library/jest-dom": "^6.8.0",
|
|
54
54
|
"@testing-library/react": "^16.3.0",
|
|
55
55
|
"@types/jest": "^30.0.0",
|
|
56
|
-
"@types/react": "^19.1.
|
|
56
|
+
"@types/react": "^19.1.13",
|
|
57
57
|
"@types/react-dom": "^19.1.9",
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
59
|
-
"@typescript-eslint/parser": "^8.
|
|
60
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
58
|
+
"@typescript-eslint/eslint-plugin": "^8.44.1",
|
|
59
|
+
"@typescript-eslint/parser": "^8.44.1",
|
|
60
|
+
"@typescript/native-preview": "^7.0.0-dev.20250922.1",
|
|
61
61
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
62
62
|
"babel-preset-minify": "0.5.2",
|
|
63
|
-
"eslint": "^9.
|
|
63
|
+
"eslint": "^9.36.0",
|
|
64
64
|
"eslint-plugin-jsdoc": "^55.4.0",
|
|
65
65
|
"eslint-plugin-prettier": "^5.5.4",
|
|
66
66
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
@@ -71,10 +71,10 @@
|
|
|
71
71
|
"prettier": "^3.6.2",
|
|
72
72
|
"react": "^19.1.1",
|
|
73
73
|
"react-dom": "^19.1.1",
|
|
74
|
-
"ts-jest": "^29.4.
|
|
74
|
+
"ts-jest": "^29.4.4",
|
|
75
75
|
"tsc-alias": "^1.8.16",
|
|
76
76
|
"typescript": "^5.9.2",
|
|
77
|
-
"typescript-eslint": "^8.
|
|
77
|
+
"typescript-eslint": "^8.44.1"
|
|
78
78
|
},
|
|
79
79
|
"packageManager": "yarn@4.10.2",
|
|
80
80
|
"peerDependencies": {
|