@meonode/ui 0.1.72 → 0.1.73
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/dist/core.node.d.ts +1 -1
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +5 -7
- package/package.json +1 -1
package/dist/core.node.d.ts
CHANGED
|
@@ -69,7 +69,7 @@ export declare class BaseNode<E extends NodeElement = NodeElement> implements No
|
|
|
69
69
|
* @param passedKey The key to assign, if any.
|
|
70
70
|
* @returns The rendered ReactNode.
|
|
71
71
|
*/
|
|
72
|
-
|
|
72
|
+
static _renderProcessedNode(processedElement: NodeElement, passedTheme: Theme | undefined, passedKey: string | undefined): ReactNode;
|
|
73
73
|
/**
|
|
74
74
|
* Renders the result of a function child, supporting theme propagation.
|
|
75
75
|
*
|
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,OAAc,EAAsG,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AACjJ,OAAO,KAAK,EAAE,cAAc,EAAyB,WAAW,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGzI,OAAO,EAAc,KAAK,IAAI,IAAI,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAExE;;;;;;;;GAQG;AACH,qBAAa,QAAQ,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;IACnF,+EAA+E;IACxE,OAAO,EAAE,CAAC,CAAA;IAEjB,kFAAkF;IAC3E,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAK;IAErC,wFAAwF;IACjF,KAAK,EAAE,cAAc,CAAA;IAE5B,SAAgB,UAAU,QAAO;IAEjC,OAAO,CAAC,iBAAiB,CAA8B;IACvD,OAAO,CAAC,gBAA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,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAwCpI;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IAgCzB;;;;;;;;OAQG;IACI,eAAe,CACpB,OAAO,EAAE,WAAW,EACpB,WAAW,CAAC,EAAE,KAAK,EACnB,UAAU,CAAC,EAAE,MAAM,GAClB,WAAW;IAyFd;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,eAAe,CAmCtB;IAED;;;;OAIG;IACI,MAAM,IAAI,SAAS;IAsC1B,OAAO,CAAC,2BAA2B;IAsB5B,QAAQ,IAAI,YAAY,GAAG,IAAI;CAsBvC;AAED;;;;;GAKG;AACH,wBAAgB,IAAI,CAAC,CAAC,SAAS,WAAW,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,GAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAU1G"}
|
package/dist/core.node.js
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* @param rawProps Initial props including theme, styles, and children
|
|
17
17
|
*/constructor(a){var b=this,c=1<arguments.length&&arguments[1]!==void 0?arguments[1]:{};_defineProperty(this,"rawProps",{}),_defineProperty(this,"isBaseNode",!0),_defineProperty(this,"_portalDOMElement",null),_defineProperty(this,"_portalReactRoot",null),_defineProperty(this,"_normalizeChild",function(a){var c,d;if(!a)return a;var e=(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
|
|
18
18
|
if(a instanceof BaseNode){var f;return null!==(f=a.rawProps)&&void 0!==f&&f.nodetheme||void 0===e?a.render():new BaseNode(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{nodetheme:e})).render()}// For React.Component instances, wrap in BaseNode with theme if needed
|
|
19
|
-
if(a instanceof React.Component)return a.props.nodetheme||void 0===e?a.render():new BaseNode(a
|
|
19
|
+
if(a instanceof React.Component)return a.props.nodetheme||void 0===e?a.render():new BaseNode(a,_objectSpread(_objectSpread({},a.props),{},{nodetheme:e})).render();// Validate element type before returning
|
|
20
20
|
if(!isValidElementType(a)){var g=getComponentType(a);throw new Error("Invalid element type: ".concat(g," provided!"))}// Return valid React elements as-is
|
|
21
21
|
return a}),this.element=a,this.rawProps=c;// Destructure raw props into relevant parts
|
|
22
22
|
var d=c.ref,e=c.children,f=c.nodetheme,g=c.theme,h=c.props,i=_objectWithoutProperties(c,_excluded),j=g||f,k=this._resolveObjWithTheme(i,j),l=getCSSProps(k),m=this._resolveDefaultStyle(l),n=_objectSpread(_objectSpread({},m),k.style),o=getDOMProps(k),p=void 0;// Resolve any theme variables in the remaining props
|
|
@@ -75,7 +75,7 @@ else c[f]=g&&"object"===_typeof(g)&&!Array.isArray(g)?e(g,b):g}return c};/**
|
|
|
75
75
|
* @param passedTheme The theme to apply, if any.
|
|
76
76
|
* @param passedKey The key to assign, if any.
|
|
77
77
|
* @returns The rendered ReactNode.
|
|
78
|
-
*/_renderProcessedNode(a,b,c){var d={};// 1. BaseNode instance: re-wrap to apply key/theme if needed
|
|
78
|
+
*/static _renderProcessedNode(a,b,c){var d={};// 1. BaseNode instance: re-wrap to apply key/theme if needed
|
|
79
79
|
if(void 0!==c&&(d.key=c),a instanceof BaseNode){var e,f,g=(null===(e=a.rawProps)||void 0===e?void 0:e.theme)||(null===(f=a.rawProps)||void 0===f?void 0:f.nodetheme)||b;return new BaseNode(a.element,_objectSpread(_objectSpread(_objectSpread({},a.rawProps),d),{},{nodetheme:g})).render()}// 2. React class component type: wrap in BaseNode
|
|
80
80
|
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
|
|
81
81
|
// 4. React.Component instance: call its render
|
|
@@ -95,11 +95,9 @@ return isReactClassComponent(a)?new BaseNode(a,d).render():isNodeInstance(a)?a.r
|
|
|
95
95
|
* @returns The rendered ReactNode, with theme applied if necessary.
|
|
96
96
|
*/_functionRenderer(a){var b=a.render,c=a.passedTheme,d=a.passedKey,e=a.processRawNode,f=b();// Invoke the render function to get the child node.
|
|
97
97
|
// Handle React.Component instance
|
|
98
|
-
if(f instanceof React.Component){var g=f.render(),h=e(g,c);return
|
|
99
|
-
if(f instanceof BaseNode){var i,j=f;return void 0===(null===(i=j.rawProps)||void 0===i?void 0:i.nodetheme)&&void 0!==c?new BaseNode(j.element,_objectSpread(_objectSpread({key:d},j.rawProps),{},{nodetheme:c})).render():j.render()}// Process other result types
|
|
100
|
-
var k=e(f,c);return k?
|
|
101
|
-
// Non-BaseNode results will not automatically receive the theme.
|
|
102
|
-
}/**
|
|
98
|
+
if(f instanceof React.Component){var g=f.render(),h=e(g,c);return BaseNode._renderProcessedNode(h,c,d)}// Handle BaseNode instance
|
|
99
|
+
if(f instanceof BaseNode||isNodeInstance(f)){var i,j=f;return void 0===(null===(i=j.rawProps)||void 0===i?void 0:i.nodetheme)&&void 0!==c?new BaseNode(j.element,_objectSpread(_objectSpread({key:d},j.rawProps),{},{nodetheme:c})).render():j.render()}// Process other result types
|
|
100
|
+
var k=e(f,c);return k?BaseNode._renderProcessedNode(k,c,d):f}/**
|
|
103
101
|
* Processes a single raw child element, converting it into a ProcessedChild.
|
|
104
102
|
* If the child is part of an array and lacks an explicit key, a stable indexed key
|
|
105
103
|
* (`elementName_child_index`) is generated for new BaseNode instances.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meonode/ui",
|
|
3
3
|
"description": "A structured approach to component composition with built-in theming, prop separation, and dynamic children handling.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.73",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|