@meonode/ui 0.1.79 → 0.1.81
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.
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
import type { ComponentNode, NodeElement } from '../node.type';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Props for a component wrapped by the Component HOC.
|
|
5
|
+
*
|
|
6
|
+
* - `props`: Optional partial props (excluding `children`) to override or extend the main props.
|
|
7
|
+
* - `children`: Optional child nodes to be rendered within the component.
|
|
8
|
+
*/
|
|
9
|
+
type ComponentProps<P> = P & {
|
|
10
|
+
props?: Partial<Omit<P, 'children'>>;
|
|
11
|
+
children?: NodeElement;
|
|
12
|
+
};
|
|
3
13
|
/**
|
|
4
14
|
* Higher-order component wrapper that converts BaseNode components into React components.
|
|
5
15
|
* This wrapper ensures proper theme propagation and component rendering in the React ecosystem.
|
|
@@ -22,8 +32,6 @@ import type { ReactNode } from 'react';
|
|
|
22
32
|
* })
|
|
23
33
|
* ```
|
|
24
34
|
*/
|
|
25
|
-
export declare function Component<P>(component: (props: P
|
|
26
|
-
|
|
27
|
-
children?: NodeElement;
|
|
28
|
-
}) => ComponentNode): (props?: P) => ReactNode;
|
|
35
|
+
export declare function Component<P>(component: (props: ComponentProps<P>) => ComponentNode): (props: P extends undefined ? undefined : P) => ReactNode;
|
|
36
|
+
export {};
|
|
29
37
|
//# sourceMappingURL=component.hoc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.hoc.d.ts","sourceRoot":"","sources":["../../src/hoc/component.hoc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAS,MAAM,gBAAgB,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC
|
|
1
|
+
{"version":3,"file":"component.hoc.d.ts","sourceRoot":"","sources":["../../src/hoc/component.hoc.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAS,MAAM,gBAAgB,CAAA;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEtC;;;;;GAKG;AACH,KAAK,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,aAAa,IAuB5D,OAAO,CAAC,SAAS,SAAS,GAAG,SAAS,GAAG,CAAC,eAGhE"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
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";/**
|
|
2
|
+
* Props for a component wrapped by the Component HOC.
|
|
3
|
+
*
|
|
4
|
+
* - `props`: Optional partial props (excluding `children`) to override or extend the main props.
|
|
5
|
+
* - `children`: Optional child nodes to be rendered within the component.
|
|
6
|
+
*//**
|
|
2
7
|
* Higher-order component wrapper that converts BaseNode components into React components.
|
|
3
8
|
* This wrapper ensures proper theme propagation and component rendering in the React ecosystem.
|
|
4
9
|
*
|
|
@@ -19,7 +24,11 @@
|
|
|
19
24
|
* })
|
|
20
25
|
* })
|
|
21
26
|
* ```
|
|
22
|
-
*/export function Component(a){
|
|
23
|
-
|
|
27
|
+
*/export function Component(a){/**
|
|
28
|
+
* Props for the internal Renderer component.
|
|
29
|
+
* - Inherits all props from ComponentProps\<P\>
|
|
30
|
+
* - Adds optional `nodetheme` and `theme` for theme propagation and merging
|
|
31
|
+
*/// Create a wrapper component that handles theme and rendering
|
|
32
|
+
var b=function Renderer(){var b=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},c=a(b);// Execute wrapped component
|
|
24
33
|
// Handle BaseNode results - requires special processing
|
|
25
|
-
if(c instanceof BaseNode){var d,e;return Node(c.element,_objectSpread(_objectSpread({},c.rawProps),{},{nodetheme:(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})).render()}return c};return function Func(){
|
|
34
|
+
if(c instanceof BaseNode){var d,e;return Node(c.element,_objectSpread(_objectSpread({},c.rawProps),{},{nodetheme:(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})).render()}return c};return function Func(a){return Node(b,a).render()}}
|
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.81",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|