@meonode/ui 0.1.97 → 0.1.99

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.
@@ -71,15 +71,4 @@ export declare function getCSSProps<T extends Record<string, any>>(props: T): Pa
71
71
  * @returns An object containing only valid DOM props.
72
72
  */
73
73
  export declare function getDOMProps<E extends ElementType, T extends ComponentProps<E>>(props: T): Partial<FinalNodeProps>;
74
- /**
75
- * Checks if a property on an object is writable.
76
- *
77
- * This function uses `Object.getOwnPropertyDescriptor` to determine if the specified
78
- * property is writable. If the property descriptor is not found (property does not exist
79
- * or is inherited), it returns `true` by default.
80
- * @param obj The object to check.
81
- * @param key The property name to check for writability.
82
- * @returns `true` if the property is writable or not explicitly defined, otherwise `false`.
83
- */
84
- export declare function isWritable(obj: Record<string, any>, key: string): boolean;
85
74
  //# sourceMappingURL=common.helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.helper.d.ts","sourceRoot":"","sources":["../src/common.helper.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAEvE;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,YAAK,EAAE,IAAI,EAAE,MAAM,uBAEzE;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAC3B,YAAY,WAAW,KAErB,OAAO,GACP,YAAY,GACZ,MAAM,GACN,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,UAAU,GACV,aAAa,GACb,UAAU,GACV,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,MAAM,GACN,SAAS,GACT,SAAS,GACT,MAgBH,CAAA;AAED;;;;;;;;;;;GAWG;AACH,wBAA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;GAWG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAsFxD;AAED;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,GAAG,CAAC,MAAM,CAA0B,CAAA;AAEjE;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,aAAa,CAAC,CAU3F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAAE,CAAC,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC,CAUjH"}
@@ -57,15 +57,4 @@ function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof
57
57
  * @typeParam T - The type of the component props.
58
58
  * @param props The component props to filter.
59
59
  * @returns An object containing only valid DOM props.
60
- */export function getDOMProps(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&!CSSPropertySet.has(c)&&(b[c]=a[c]);return b}/**
61
- * Checks if a property on an object is writable.
62
- *
63
- * This function uses `Object.getOwnPropertyDescriptor` to determine if the specified
64
- * property is writable. If the property descriptor is not found (property does not exist
65
- * or is inherited), it returns `true` by default.
66
- * @param obj The object to check.
67
- * @param key The property name to check for writability.
68
- * @returns `true` if the property is writable or not explicitly defined, otherwise `false`.
69
- */export function isWritable(a,b){var c=Object.getOwnPropertyDescriptor(a,b);// If the property doesn't exist or is inherited, desc will be undefined.
70
- // In such cases, it's typically considered writable unless explicitly defined otherwise.
71
- return!c||!!c.writable}
60
+ */export function getDOMProps(a){var b={};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&!CSSPropertySet.has(c)&&(b[c]=a[c]);return b}
@@ -17,9 +17,13 @@ export declare class BaseNode<E extends NodeElement = NodeElement> implements No
17
17
  rawProps: RawNodeProps<E>;
18
18
  /** Processed props after theme resolution, style processing, and child normalization */
19
19
  props: FinalNodeProps;
20
+ /** Flag to identify BaseNode instances */
20
21
  readonly isBaseNode = true;
22
+ /** DOM element used for portal rendering */
21
23
  private _portalDOMElement;
24
+ /** React root instance for portal rendering */
22
25
  private _portalReactRoot;
26
+ private _resolveAbleProps;
23
27
  /**
24
28
  * Creates a new BaseNode instance that wraps a React element.
25
29
  * Processes raw props by:
@@ -1 +1 @@
1
- {"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts"],"names":[],"mappings":"AACA,OAAc,EAAkF,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAC7H,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;AAGxE;;;;;;;;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;IAsCtD,OAAO,CAAC,gBAAgB;IAYxB;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,oBAAoB,CAAC,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;I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/C,OAAO,CAAC,gBAAgB,CAA4B;IAEpD,OAAO,CAAC,iBAAiB,CAAmC;IAE5D;;;;;;;;OAQG;gBACS,OAAO,EAAE,CAAC,EAAE,QAAQ,GAAE,YAAY,CAAC,CAAC,CAAM;IAwCtD,OAAO,CAAC,gBAAgB;IAYxB;;;;;;;;;;;;;;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
@@ -14,13 +14,13 @@
14
14
  * - Normalizing children with theme inheritance
15
15
  * @param element The React element/component to wrap
16
16
  * @param rawProps Initial props including theme, styles, and children
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
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,"_resolveAbleProps",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()}// Validate element type before returning
19
19
  if(!isValidElementType(a)){var g=getComponentType(a);throw new Error("Invalid element type: ".concat(g," provided!"))}// Return valid React elements as-is
20
20
  return a}),this.element=a,this.rawProps=c;// Destructure raw props into relevant parts
21
- var d=c.ref,e=c.children,f=c.nodetheme,g=c.theme,h=c.props,i=void 0===h?{}:h,j=_objectWithoutProperties(c,_excluded),k=g||f,l=i,m=l.style,n=_objectWithoutProperties(l,_excluded2),o=resolveObjWithTheme(_objectSpread(_objectSpread({},j),{},{style:_objectSpread(_objectSpread({},null===j||void 0===j?void 0:j.style),m)}),k),p=o.style,q=_objectWithoutProperties(o,_excluded3),r=getCSSProps(q),s=getDOMProps(q),t=resolveDefaultStyle(_objectSpread(_objectSpread({},r),p)),u=this._processChildren(e,k);// Process children while maintaining theme inheritance
21
+ var d=c.ref,e=c.children,f=c.nodetheme,g=c.theme,h=c.props,i=void 0===h?{}:h,j=_objectWithoutProperties(c,_excluded),k=g||f,l=i,m=l.style,n=_objectWithoutProperties(l,_excluded2),o=_objectSpread(_objectSpread({},j),{},{style:_objectSpread(_objectSpread({},null===j||void 0===j?void 0:j.style),m)}),p=resolveObjWithTheme(o,k),q=p.style,r=_objectWithoutProperties(p,_excluded3),s=getCSSProps(r),t=getDOMProps(r),u=resolveDefaultStyle(_objectSpread(_objectSpread({},s),q)),v=this._processChildren(e,k);// Process children while maintaining theme inheritance
22
22
  // Combine processed props into final normalized form
23
- this.props=_objectSpread(_objectSpread(_objectSpread({ref:d,nodetheme:k,theme:g,style:t},s),n),{},{children:u})}_processChildren(a,b){var c=this;return a?Array.isArray(a)?a.map(function(a,d){return c._processRawNode(a,b,d)}):this._processRawNode(a,b):void 0}/**
23
+ this.props=_objectSpread(_objectSpread(_objectSpread({ref:d,nodetheme:k,theme:g,style:u},t),n),{},{children:v})}_processChildren(a,b){var c=this;return a?Array.isArray(a)?a.map(function(a,d){return c._processRawNode(a,b,d)}):this._processRawNode(a,b):void 0}/**
24
24
  * Renders a processed NodeElement into a ReactNode, applying theme and key if needed.
25
25
  *
26
26
  * Handles the following cases:
@@ -13,12 +13,25 @@ import type { NodeInstance, Theme } from './node.type.js';
13
13
  */
14
14
  export declare const isNodeInstance: (obj: unknown) => obj is NodeInstance<any>;
15
15
  /**
16
- * Resolves theme variable references in an object's values recursively.
17
- * Handles nested objects and prevents circular references.
18
- * Theme variables are referenced using the format "theme.path.to.value".
19
- * @param obj The object whose values should be resolved against the theme
20
- * @param theme Optional theme object containing variable definitions
21
- * @returns A new object with all theme variables resolved to their values
16
+ *
17
+ *Resolves theme variable references in an object's values recursively.
18
+ *
19
+ *This function performs a "smart merge" to maintain object reference identity
20
+ *
21
+ *for parts of the object that do not contain resolved theme variables or
22
+ *
23
+ *other modifications. Only creates new objects or properties when a change occurs.
24
+ *
25
+ *
26
+ *
27
+ *Handles nested objects and prevents circular references.
28
+ *
29
+ *Theme variables are referenced using the format "theme.path.to.value".
30
+ * @param obj The object whose values should be resolved against the theme. Defaults to an empty object.
31
+ * @param theme The theme object containing variable definitions. Optional.
32
+ * @returns A new object with all theme variables resolved to their corresponding values,
33
+ *
34
+ * or the original object if no changes were necessary.
22
35
  */
23
36
  export declare const resolveObjWithTheme: (obj?: Record<string, any>, theme?: Theme) => Record<string, any>;
24
37
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"node.helper.d.ts","sourceRoot":"","sources":["../src/node.helper.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAG5D;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,KAAK,OAAO,KAAG,GAAG,IAAI,YAAY,CAAC,GAAG,CASpE,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,KAAK,wBAmE/E,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4BvD,CAAA"}
@@ -1,4 +1,4 @@
1
- "use strict";var _excluded=["flex"];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}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)}import{getValueByPath,isWritable}from"./common.helper";/**
1
+ "use strict";var _excluded=["flex"];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 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 _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)}import{getValueByPath}from"./common.helper";/**
2
2
  * Type guard to check if an object is a NodeInstance.
3
3
  *
4
4
  * A NodeInstance is expected to be a non-null object with:
@@ -9,26 +9,41 @@
9
9
  * @param obj The object to check.
10
10
  * @returns True if the object is a NodeInstance, false otherwise.
11
11
  */export var isNodeInstance=function isNodeInstance(a){return"object"===_typeof(a)&&null!==a&&"element"in a&&"function"==typeof a.render&&"function"==typeof a.toPortal&&"isBaseNode"in a};/**
12
- * Resolves theme variable references in an object's values recursively.
13
- * Handles nested objects and prevents circular references.
14
- * Theme variables are referenced using the format "theme.path.to.value".
15
- * @param obj The object whose values should be resolved against the theme
16
- * @param theme Optional theme object containing variable definitions
17
- * @returns A new object with all theme variables resolved to their values
18
- */export var resolveObjWithTheme=function resolveObjWithTheme(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=1<arguments.length?arguments[1]:void 0;// Early return if no theme or empty object
12
+ *
13
+ *Resolves theme variable references in an object's values recursively.
14
+ *
15
+ *This function performs a "smart merge" to maintain object reference identity
16
+ *
17
+ *for parts of the object that do not contain resolved theme variables or
18
+ *
19
+ *other modifications. Only creates new objects or properties when a change occurs.
20
+ *
21
+ *
22
+ *
23
+ *Handles nested objects and prevents circular references.
24
+ *
25
+ *Theme variables are referenced using the format "theme.path.to.value".
26
+ * @param obj The object whose values should be resolved against the theme. Defaults to an empty object.
27
+ * @param theme The theme object containing variable definitions. Optional.
28
+ * @returns A new object with all theme variables resolved to their corresponding values,
29
+ *
30
+ * or the original object if no changes were necessary.
31
+ */export var resolveObjWithTheme=function resolveObjWithTheme(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=1<arguments.length?arguments[1]:void 0;// Early return if no theme or empty object, no resolution needed.
19
32
  if(!b||0===Object.keys(a).length)return a;/**
20
- * Recursively resolves theme variables in an object, tracking visited objects
21
- * to prevent infinite recursion with circular references.
22
- */var c=function resolveRecursively(a,d){// Skip functions and non-plain objects to prevent unintended flattening or
23
- // modification of complex instances like React components, DOM elements, or Date objects.
24
- if(!a||"object"!==_typeof(a)||Array.isArray(a)||Object.getPrototypeOf(a)!==Object.prototype)return a;// Prevent processing same object multiple times
25
- if(d.has(a))return a;// Track this object to detect circular references
26
- for(var e in d.add(a),a){var f=a[e];// Conditions for direct assignment (no resolution or deep processing needed)
27
- if("function"!=typeof f&&"ref"!==e&&"key"!==e&&("object"!==_typeof(f)||null===f||Array.isArray(f)||Object.getPrototypeOf(f)===Object.prototype)&&("string"!=typeof f||f.includes("theme."))&&("object"===_typeof(f)||"string"==typeof f||"function"==typeof f)&&isWritable(a,e))// Resolve theme variables in string values
28
- if("string"==typeof f&&f.includes("theme.")){var g=f;g=g.replace(/theme\.([a-zA-Z0-9_.-]+)/g,function(a,c){var d=getValueByPath(b,c);// Only convert string/number theme values
29
- return void 0!==d&&null!==d?"object"===_typeof(d)&&!Array.isArray(d)&&"default"in d?d["default"]:d:a;// Keep original if no valid theme value found
30
- }),a[e]=g}// Recursively process nested objects
31
- else a[e]=c(f,d)}return a};return c(a,new Set)};/**
33
+ *
34
+ *Recursively resolves theme variables within an object.
35
+ *
36
+ *It tracks visited objects to prevent infinite recursion caused by circular references.
37
+ *
38
+ *This function implements a "smart merge" to preserve object identity for unchanged parts.
39
+ * @param currentObj The current object being processed in the recursion.
40
+ * @param visited A Set to keep track of objects that have already been visited to detect circular references.
41
+ * @returns The processed object with theme variables resolved, or the original `currentObj`
42
+ *
43
+ * if no changes were made to it or its direct children (excluding deeper nested changes).
44
+ */var c=function resolveRecursively(a,d){if(null===a||"object"!==_typeof(a)||Array.isArray(a)||Object.getPrototypeOf(a)!==Object.prototype)return a;if(d.has(a))return a;d.add(a);var e=a,f=!1,g=function _loop(){if(!Object.prototype.hasOwnProperty.call(a,h))return 1;// continue
45
+ var g,i=a[h];if("function"==typeof i||"ref"===h||"key"===h||"object"===_typeof(i)&&null!==i&&!Array.isArray(i)&&Object.getPrototypeOf(i)!==Object.prototype||"string"==typeof i&&!i.includes("theme.")||"object"!==_typeof(i)&&"string"!=typeof i&&"function"!=typeof i)g=i;else if("string"==typeof i&&i.includes("theme.")){var j=i,k=!1;j=j.replace(/theme\.([a-zA-Z0-9_.-]+)/g,function(a,c){var d=getValueByPath(b,c);return void 0!==d&&null!==d?(k=!0,"object"===_typeof(d)&&!Array.isArray(d)&&"default"in d?d["default"]:d):a}),g=k&&j!==i?j:i}// Recursively process nested objects.
46
+ else g="object"===_typeof(i)&&null!==i?c(i,d):i;g===i?f&&(e[h]=i):(!f&&(e=_objectSpread({},a),f=!0),e[h]=g)};for(var h in a)g();return d["delete"](a),e};return c(a,new Set)};/**
32
47
  * Resolves default styles for a given CSSProperties object.
33
48
  * This method ensures that certain default styles, such as `minHeight`, `minWidth`,
34
49
  * and `flexShrink`, are applied based on the provided style properties.
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.1.97",
4
+ "version": "0.1.99",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "types": "./dist/main.d.ts",