@meonode/ui 0.1.78 → 0.1.80

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 +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,EAAW,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAGlJ,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,gBAAgB,CAA4B;IAEpD;;;;;;;;OAQG;gBACS,OAAO,EAAE,CAAC,EAAE,QAAQ,GAAE,YAAY,CAAC,CAAC,CAAM;IA4CtD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IA8B5B;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAkE5B;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAwCpI;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,iBAAiB;IAgCzB;;;;;;;;OAQG;I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tD;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,oBAAoB;IA8B5B;;;;;;;OAOG;IACH,OAAO,CAAC,oBAAoB;IAkE5B;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS,EAAE,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,CAwBtB;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
@@ -15,8 +15,7 @@
15
15
  * @param element The React element/component to wrap
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
- 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,_objectSpread(_objectSpread({},a.props),{},{nodetheme:e})).render();// Validate element type before returning
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()}// Validate element type before returning
20
19
  if(!isValidElementType(a)){var g=getComponentType(a);throw new Error("Invalid element type: ".concat(g," provided!"))}// Return valid React elements as-is
21
20
  return a}),this.element=a,this.rawProps=c;// Destructure raw props into relevant parts
22
21
  var d=c.ref,e=c.children,f=c.nodetheme,g=c.theme,h=c.props,i=_objectWithoutProperties(c,_excluded),j=g||f,k=h||{},l=k.style,m=_objectWithoutProperties(k,_excluded2),n=this._resolveObjWithTheme(l,j),o=this._resolveObjWithTheme(i,j),p=getCSSProps(o),q=this._resolveDefaultStyle(_objectSpread(_objectSpread({},p),n)),r=getDOMProps(o),s=void 0;// Resolve any theme variables in the remaining props
@@ -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
- props?: Partial<Omit<P, 'children'>>;
27
- children?: NodeElement;
28
- }) => ComponentNode): (props?: P) => ReactNode;
35
+ export declare function Component<P>(component: (props: ComponentProps<P>) => ComponentNode): (props: 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;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,SAAS,CAAC,CAAC,EACzB,SAAS,EAAE,CACT,KAAK,EAAE,CAAC,GAAG;IACT,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAA;IACpC,QAAQ,CAAC,EAAE,WAAW,CAAA;CACvB,KACE,aAAa,IAiBG,QAAO,CAAW,eAGxC"}
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,IAgB5D,OAAO,CAAC,eAG9B"}
@@ -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
  *
@@ -22,4 +27,4 @@
22
27
  */export function Component(a){// Create a wrapper component that handles theme and rendering
23
28
  var b=function Renderer(b){var c=a(b);// Execute wrapped component
24
29
  // 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(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{};return Node(b,a).render()}}
30
+ 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.78",
4
+ "version": "0.1.80",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "types": "./dist/main.d.ts",