@meonode/ui 0.1.99 → 0.1.100

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.
@@ -15,22 +15,14 @@ export declare const isNodeInstance: (obj: unknown) => obj is NodeInstance<any>;
15
15
  /**
16
16
  *
17
17
  *Resolves theme variable references in an object's values recursively.
18
- *
19
18
  *This function performs a "smart merge" to maintain object reference identity
20
- *
21
19
  *for parts of the object that do not contain resolved theme variables or
22
- *
23
20
  *other modifications. Only creates new objects or properties when a change occurs.
24
- *
25
- *
26
- *
27
21
  *Handles nested objects and prevents circular references.
28
- *
29
22
  *Theme variables are referenced using the format "theme.path.to.value".
30
23
  * @param obj The object whose values should be resolved against the theme. Defaults to an empty object.
31
24
  * @param theme The theme object containing variable definitions. Optional.
32
25
  * @returns A new object with all theme variables resolved to their corresponding values,
33
- *
34
26
  * or the original object if no changes were necessary.
35
27
  */
36
28
  export declare const resolveObjWithTheme: (obj?: Record<string, any>, theme?: Theme) => Record<string, any>;
@@ -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;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,mBAAmB,GAAI,MAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,EAAE,QAAQ,KAAK,wBAwG/E,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,GAAI,OAAO,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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@ -11,39 +11,27 @@
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
12
  *
13
13
  *Resolves theme variable references in an object's values recursively.
14
- *
15
14
  *This function performs a "smart merge" to maintain object reference identity
16
- *
17
15
  *for parts of the object that do not contain resolved theme variables or
18
- *
19
16
  *other modifications. Only creates new objects or properties when a change occurs.
20
- *
21
- *
22
- *
23
17
  *Handles nested objects and prevents circular references.
24
- *
25
18
  *Theme variables are referenced using the format "theme.path.to.value".
26
19
  * @param obj The object whose values should be resolved against the theme. Defaults to an empty object.
27
20
  * @param theme The theme object containing variable definitions. Optional.
28
21
  * @returns A new object with all theme variables resolved to their corresponding values,
29
- *
30
22
  * or the original object if no changes were necessary.
31
23
  */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.
32
24
  if(!b||0===Object.keys(a).length)return a;/**
33
25
  *
34
26
  *Recursively resolves theme variables within an object.
35
- *
36
27
  *It tracks visited objects to prevent infinite recursion caused by circular references.
37
- *
38
28
  *This function implements a "smart merge" to preserve object identity for unchanged parts.
39
29
  * @param currentObj The current object being processed in the recursion.
40
30
  * @param visited A Set to keep track of objects that have already been visited to detect circular references.
41
31
  * @returns The processed object with theme variables resolved, or the original `currentObj`
42
- *
43
32
  * 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)};/**
33
+ */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(){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.
34
+ 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 e};return c(a,new Set)};/**
47
35
  * Resolves default styles for a given CSSProperties object.
48
36
  * This method ensures that certain default styles, such as `minHeight`, `minWidth`,
49
37
  * 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.99",
4
+ "version": "0.1.100",
5
5
  "type": "module",
6
6
  "main": "./dist/main.js",
7
7
  "types": "./dist/main.d.ts",