@meonode/ui 0.2.5 → 0.2.6
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/CHANGELOG.md +6 -0
- package/dist/core.node.d.ts +1 -1
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +11 -11
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.6] - 2025-09-04
|
|
9
|
+
|
|
10
|
+
- **deps**: update TypeScript ESLint, native-preview, and jsdoc to latest versions
|
|
11
|
+
- **core.node**: improve generateIndexedKeyIfNeeded to accept object parameters and enhance key uniqueness with children count
|
|
12
|
+
- **imports**: update import paths to include file extensions for compatibility
|
|
13
|
+
|
|
8
14
|
## [0.2.5] - 2025-09-03
|
|
9
15
|
|
|
10
16
|
- **imports**: Update import paths to include file extensions for compatibility.
|
package/dist/core.node.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ElementType, type ReactNode, type ReactElement } from 'react';
|
|
2
|
-
import type { FinalNodeProps, HasRequiredProps, NodeElement, NodeInstance, NodeProps, PropsOf, RawNodeProps, Theme } from './node.type';
|
|
2
|
+
import type { FinalNodeProps, HasRequiredProps, NodeElement, NodeInstance, NodeProps, PropsOf, RawNodeProps, Theme } from './node.type.js';
|
|
3
3
|
import { type Root as ReactDOMRoot } from 'react-dom/client';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a node in a React component tree with theme and styling capabilities.
|
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,EAAgD,KA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ode._renderProcessedNode(k,c,d):f}/**
|
|
|
65
65
|
* @param childIndex Optional index of the child if it's part of an array.
|
|
66
66
|
* @returns The processed child.
|
|
67
67
|
*/_processRawNode(a,b,c// Index for generating stable keys for array children
|
|
68
|
-
){var d=getComponentType(a),e=function generateIndexedKeyIfNeeded(a
|
|
69
|
-
return"".concat(
|
|
70
|
-
};// Determine the type of the raw node
|
|
68
|
+
){var d=getComponentType(a),e=function generateIndexedKeyIfNeeded(a){var b=a.element,d=a.existingKey,e=a.children;if(d)return d;var f=getElementTypeName(b);// Get element type name for key generation
|
|
69
|
+
return e&&Array.isArray(e)&&void 0!==c?"".concat(f,"-").concat(c,"-").concat(e.length):"".concat(f,"-").concat(c)};// Determine the type of the raw node
|
|
71
70
|
// Helper to generate an indexed key if no explicit key is present and an index is available.
|
|
72
71
|
// Case 1: Child is already a BaseNode instance
|
|
73
|
-
if(a instanceof BaseNode){var f=a,g=f.rawProps||{},h=g.theme||g.nodetheme||b,i=e(f.element,g.key);// Get initial raw props of the child
|
|
72
|
+
if(a instanceof BaseNode){var f=a,g=f.rawProps||{},h=g.theme||g.nodetheme||b,i=e({element:f.element,existingKey:g.key,children:g.children});// Get initial raw props of the child
|
|
74
73
|
// Prefer child's own theme
|
|
74
|
+
// Generate key if needed
|
|
75
75
|
return new BaseNode(f.element,_objectSpread(_objectSpread({},g),{},{nodetheme:h,// Use the determined theme for the new node
|
|
76
76
|
key:i}));// Create a new BaseNode with merged props and theme
|
|
77
77
|
}// Case 2: Child is a primitive (string, number, boolean, null, undefined)
|
|
78
78
|
if("string"===d||"number"===d||"boolean"===d||null===a||void 0===a)return a;// Case 3: Child is a function that needs to be called during render (FunctionRenderer).
|
|
79
79
|
if("function"===d&&!isReactClassComponent(a)&&!isMemo(a)&&!isForwardRef(a)){// The key is for the BaseNode that wraps the _functionRenderer component.
|
|
80
80
|
// Functions themselves don't have a .key prop that we can access here.
|
|
81
|
-
var j=e(this._functionRenderer
|
|
81
|
+
var j=e({element:this._functionRenderer});// Generate key for function renderer
|
|
82
82
|
return new BaseNode(this._functionRenderer,{processRawNode:this._processRawNode.bind(this),render:a,passedTheme:b,key:j})}// Case 4: Child is a React Element (JSX element like <div> or <MyComponent>)
|
|
83
|
-
if(isValidElement(a)){var k=a.props,l=k.style,m=_objectWithoutProperties(k,_excluded4),n=_objectSpread(_objectSpread({},m),l||{}),o=n.theme||n.nodetheme||b,p=e(a.type,a.key);// Combine top-level props from the element with its flattened style object properties
|
|
83
|
+
if(isValidElement(a)){var k=a.props,l=k.style,m=_objectWithoutProperties(k,_excluded4),n=_objectSpread(_objectSpread({},m),l||{}),o=n.theme||n.nodetheme||b,p=e({element:a.type,existingKey:a.key,children:n.children});// Combine top-level props from the element with its flattened style object properties
|
|
84
84
|
return new BaseNode(a.type,_objectSpread(_objectSpread({},n),{},{// Pass the combined props
|
|
85
85
|
nodetheme:o,key:p}))}// Case 5: Child is an ElementType (string tag, class component, Memo/ForwardRef)
|
|
86
|
-
if(isReactClassComponent(a)||"object"===d&&(isMemo(a)||isForwardRef(a))){
|
|
87
|
-
|
|
88
|
-
key:
|
|
89
|
-
if(a instanceof React.Component){var
|
|
90
|
-
return this._processRawNode(
|
|
86
|
+
if(isReactClassComponent(a)||"object"===d&&(isMemo(a)||isForwardRef(a))){var q,r=e({element:a,children:"object"===_typeof(a)&&"props"in a?null===(q=a.props)||void 0===q?void 0:q.children:void 0});// ElementTypes don't have an intrinsic key from the rawNode itself.
|
|
87
|
+
return new BaseNode(a,{nodetheme:b,// Apply parent theme
|
|
88
|
+
key:r})}// Case 6: Handle instances of React.Component
|
|
89
|
+
if(a instanceof React.Component){var s=a.render();// Recursively process the rendered element with a parent theme and index if available
|
|
90
|
+
return this._processRawNode(s,b,c)}// Case 7: Fallback for other ReactNode types (e.g., Fragments, Portals if not caught by isValidElement)
|
|
91
91
|
// These are returned as-is. If they are elements within an array, React expects them to have keys.
|
|
92
92
|
// This logic primarily adds keys to BaseNode instances we create, other ReactNodes are returned as-is.
|
|
93
93
|
return a}/**
|
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.2.
|
|
4
|
+
"version": "0.2.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@eslint/js": "^9.34.0",
|
|
44
44
|
"@types/react": "^19.1.12",
|
|
45
45
|
"@types/react-dom": "^19.1.9",
|
|
46
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
47
|
-
"@typescript-eslint/parser": "^8.
|
|
48
|
-
"@typescript/native-preview": "^7.0.0-dev.
|
|
46
|
+
"@typescript-eslint/eslint-plugin": "^8.42.0",
|
|
47
|
+
"@typescript-eslint/parser": "^8.42.0",
|
|
48
|
+
"@typescript/native-preview": "^7.0.0-dev.20250903.1",
|
|
49
49
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
50
50
|
"babel-preset-minify": "^0.5.2",
|
|
51
51
|
"eslint": "^9.34.0",
|
|
52
|
-
"eslint-plugin-jsdoc": "^54.
|
|
52
|
+
"eslint-plugin-jsdoc": "^54.3.1",
|
|
53
53
|
"eslint-plugin-prettier": "^5.5.4",
|
|
54
54
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
55
55
|
"next": "^15.5.2",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"react-dom": "^19.1.1",
|
|
58
58
|
"tsc-alias": "^1.8.16",
|
|
59
59
|
"typescript": "^5.9.2",
|
|
60
|
-
"typescript-eslint": "^8.
|
|
60
|
+
"typescript-eslint": "^8.42.0"
|
|
61
61
|
},
|
|
62
62
|
"packageManager": "yarn@4.9.1",
|
|
63
63
|
"peerDependencies": {
|