@meonode/ui 0.2.11 → 0.2.13
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 +16 -0
- package/dist/constants/common.const.d.ts +2 -2
- package/dist/constants/common.const.d.ts.map +1 -1
- package/dist/constants/common.const.js +1 -1
- package/dist/core.node.d.ts +0 -2
- package/dist/core.node.d.ts.map +1 -1
- package/dist/core.node.js +4 -6
- package/dist/helper/node.helper.js +1 -1
- package/package.json +17 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ 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.13] - 2025-09-11
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **feat**: Add pre-commit hook for linting and testing, update package.json scripts.
|
|
12
|
+
- **feat**: Add Jest configuration and setup for testing with TypeScript.
|
|
13
|
+
- **test**: Add comprehensive tests for BaseNode core functionality.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
- **core**: Remove stylable elements from NO_STYLE_TAGS to ensure only non-visual/metadata tags are excluded from CSS styling.
|
|
17
|
+
|
|
18
|
+
## [0.2.12] - 2025-09-11
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **core.node**: Removed the child processing cache to fix a critical bug that caused infinite page loads in server-side rendering environments.
|
|
22
|
+
- **helper**: Corrected the element type retrieval logic within the hashing function used for child node processing.
|
|
23
|
+
|
|
8
24
|
## [0.2.11] - 2025-09-11
|
|
9
25
|
|
|
10
26
|
### Enhanced
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const NO_STYLE_TAGS: readonly ["html", "head", "
|
|
2
|
-
export declare const noStyleTagsSet: Set<"applet" | "
|
|
1
|
+
export declare const NO_STYLE_TAGS: readonly ["html", "head", "meta", "link", "script", "style", "noscript", "template", "slot", "base", "param", "source", "track", "wbr", "embed", "object", "iframe", "frame", "frameset", "applet", "bgsound", "noembed", "noframes"];
|
|
2
|
+
export declare const noStyleTagsSet: Set<"applet" | "base" | "bgsound" | "embed" | "frame" | "frameset" | "head" | "html" | "iframe" | "link" | "meta" | "noembed" | "noframes" | "noscript" | "object" | "param" | "script" | "slot" | "source" | "style" | "template" | "track" | "wbr">;
|
|
3
3
|
//# sourceMappingURL=common.const.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.const.d.ts","sourceRoot":"","sources":["../../src/constants/common.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"common.const.d.ts","sourceRoot":"","sources":["../../src/constants/common.const.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,uOAwBhB,CAAA;AAEV,eAAO,MAAM,cAAc,uPAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var NO_STYLE_TAGS=["html","head","
|
|
1
|
+
export var NO_STYLE_TAGS=["html","head","meta","link","script","style","noscript","template","slot","base","param","source","track","wbr","embed","object","iframe","frame","frameset","applet","bgsound","noembed","noframes"];export var noStyleTagsSet=new Set(NO_STYLE_TAGS);
|
package/dist/core.node.d.ts
CHANGED
|
@@ -27,8 +27,6 @@ export declare class BaseNode<E extends NodeElement> implements NodeInstance<E>
|
|
|
27
27
|
private _childrenHash?;
|
|
28
28
|
/** Cache for normalized children */
|
|
29
29
|
private _normalizedChildren?;
|
|
30
|
-
/** Cache for processed children on the server (uses stringified keys for effective caching) */
|
|
31
|
-
private static _childProcessingCache;
|
|
32
30
|
/**
|
|
33
31
|
* Constructs a new BaseNode instance.
|
|
34
32
|
*
|
package/dist/core.node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.node.d.ts","sourceRoot":"","sources":["../src/core.node.ts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AE,GAAG,CAAC,EAAE,CAAC,SAAS,WAAW,EAC/G,OAAO,EAAE,CAAC,EACV,YAAY,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,sBAAsB,GAAG,UAAU,CAAC,GAAG,sBAAsB,GACpG,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,GACxC,CAAC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,QAAQ,EAAE,WAAW,GAAG,WAAW,EAAE,EACrC,KAAK,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,KACrD,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,GACtC,CAAC,CAAC,eAAe,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,QAAQ,CAAC,EAAE,WAAW,GAAG,WAAW,EAAE,EACtC,KAAK,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,eAAe,CAAC,EAAE,UAAU,CAAC,KACtD,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG;IAAE,OAAO,EAAE,CAAC,CAAA;CAAE,CAQzC"}
|
package/dist/core.node.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - Child node processing and management
|
|
7
7
|
* - Style processing with theme variables
|
|
8
8
|
* @template E The type of React element or component this node represents
|
|
9
|
-
*/export class BaseNode{/**
|
|
9
|
+
*/export class BaseNode{/** Hash of the current children and theme to detect changes *//** Cache for normalized children *//**
|
|
10
10
|
* Constructs a new BaseNode instance.
|
|
11
11
|
*
|
|
12
12
|
* This constructor initializes a node with a given React element or component type
|
|
@@ -76,10 +76,8 @@ return _objectSpread(_objectSpread({ref:b,key:c,nodetheme:j,theme:f,css:_objectS
|
|
|
76
76
|
* @param theme The theme to propagate to the children.
|
|
77
77
|
* @returns The processed children, ready to be normalized for rendering.
|
|
78
78
|
* @private
|
|
79
|
-
*/_processChildren(a,b){var c=this;
|
|
80
|
-
|
|
81
|
-
// Processing children on the client is fast enough and avoids complex, buggy cache logic.
|
|
82
|
-
return Array.isArray(a)?a.map(function(a,d){return c._processRawNode(a,b,d)}):this._processRawNode(a,b)}}/**
|
|
79
|
+
*/_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;// No caching on the client, as it was ineffective and complex.
|
|
80
|
+
}/**
|
|
83
81
|
* Renders a processed `NodeElement` into a `ReactNode`, applying a theme and key if necessary.
|
|
84
82
|
*
|
|
85
83
|
* This static method centralizes the logic for converting various types of processed elements
|
|
@@ -208,7 +206,7 @@ return j=this.element===Fragment||isFragment(this.element)?{key:e}:_objectSpread
|
|
|
208
206
|
* @param props The props for the node (optional).
|
|
209
207
|
* @param additionalProps Additional props to merge into the node (optional).
|
|
210
208
|
* @returns A new `BaseNode` instance as a `NodeInstance<E>`.
|
|
211
|
-
*/
|
|
209
|
+
*/export function Node(a){var b=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},c=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},d=_objectSpread(_objectSpread({},b),c);return d.theme&&!d.nodetheme&&(d.nodetheme=d.theme),new BaseNode(a,d)}/**
|
|
212
210
|
* Creates a curried node factory for a given React element or component type.
|
|
213
211
|
*
|
|
214
212
|
* Returns a function that, when called with props, produces a `BaseNode` instance.
|
|
@@ -128,4 +128,4 @@ minWidth:0},d)};/**
|
|
|
128
128
|
* @param children The child nodes to hash, which can be a single node or an array of nodes.
|
|
129
129
|
* @param theme An optional theme object or string to include in the hash.
|
|
130
130
|
* @returns A stable hash string representing the structure and types of the children and theme.
|
|
131
|
-
*/export function createStableHash(a,b){var c=Math.min,d="";if(b&&(d+="t:".concat("object"===_typeof(b)?ObjHelper.stringify(b):b+"",";")),Array.isArray(a)){d+="a:".concat(a.length,";");for(var e,f=c(3,a.length),g=0;g<f;g++)e=a[g],d+=e&&"object"===_typeof(e)&&"type"in e?"c".concat(g,":").concat(getElementTypeName(e
|
|
131
|
+
*/export function createStableHash(a,b){var c=Math.min,d="";if(b&&(d+="t:".concat("object"===_typeof(b)?ObjHelper.stringify(b):b+"",";")),Array.isArray(a)){d+="a:".concat(a.length,";");for(var e,f=c(3,a.length),g=0;g<f;g++)e=a[g],d+=e&&"object"===_typeof(e)&&"type"in e?"c".concat(g,":").concat(getElementTypeName(e),";"):"c".concat(g,":").concat(_typeof(e),";")}else d+=a&&"object"===_typeof(a)&&"type"in a?"s:".concat(getElementTypeName(a),";"):"s:".concat(_typeof(a),";");return d}
|
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.13",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/main.js",
|
|
7
7
|
"types": "./dist/main.d.ts",
|
|
@@ -29,11 +29,14 @@
|
|
|
29
29
|
"scripts": {
|
|
30
30
|
"watch:build": "yarn dlx nodemon --watch src --ext ts,tsx,js,json --exec \"yarn build\"",
|
|
31
31
|
"lint": "eslint --fix",
|
|
32
|
-
"
|
|
32
|
+
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js --ci",
|
|
33
|
+
"prebuild": "yarn lint && yarn test",
|
|
34
|
+
"build": "yarn prebuild && rm -rf ./dist && babel src --out-dir dist --extensions \".ts,.tsx,.js\" && tsgo --project tsconfig.build.json --diagnostics && tsc-alias",
|
|
33
35
|
"publish:pre": "./prepublish.sh && yarn version -i prerelease && yarn npm publish --tag next",
|
|
34
36
|
"publish:patch": "./prepublish.sh && yarn version -i patch && yarn npm publish --tag latest",
|
|
35
37
|
"publish:minor": "./prepublish.sh && yarn version -i minor && yarn npm publish --tag latest",
|
|
36
|
-
"publish:major": "./prepublish.sh && yarn version -i major && yarn npm publish --tag latest"
|
|
38
|
+
"publish:major": "./prepublish.sh && yarn version -i major && yarn npm publish --tag latest",
|
|
39
|
+
"prepare": "husky"
|
|
37
40
|
},
|
|
38
41
|
"dependencies": {
|
|
39
42
|
"@emotion/react": "^11.14.0"
|
|
@@ -44,21 +47,31 @@
|
|
|
44
47
|
"@babel/preset-env": "^7.28.3",
|
|
45
48
|
"@babel/preset-typescript": "^7.27.1",
|
|
46
49
|
"@emotion/cache": "^11.14.0",
|
|
50
|
+
"@emotion/jest": "^11.13.0",
|
|
47
51
|
"@eslint/js": "^9.35.0",
|
|
52
|
+
"@testing-library/dom": "^10.4.1",
|
|
53
|
+
"@testing-library/jest-dom": "^6.8.0",
|
|
54
|
+
"@testing-library/react": "^16.3.0",
|
|
55
|
+
"@types/jest": "^30.0.0",
|
|
48
56
|
"@types/react": "^19.1.12",
|
|
49
57
|
"@types/react-dom": "^19.1.9",
|
|
50
58
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
51
59
|
"@typescript-eslint/parser": "^8.43.0",
|
|
52
60
|
"@typescript/native-preview": "^7.0.0-dev.20250909.1",
|
|
53
61
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
54
|
-
"babel-preset-minify": "
|
|
62
|
+
"babel-preset-minify": "0.5.2",
|
|
55
63
|
"eslint": "^9.35.0",
|
|
56
64
|
"eslint-plugin-jsdoc": "^55.4.0",
|
|
57
65
|
"eslint-plugin-prettier": "^5.5.4",
|
|
58
66
|
"eslint-plugin-unused-imports": "^4.2.0",
|
|
67
|
+
"husky": "^9.1.7",
|
|
68
|
+
"jest": "^30.1.3",
|
|
69
|
+
"jest-environment-jsdom": "^30.1.2",
|
|
59
70
|
"next": "^15.5.3",
|
|
60
71
|
"prettier": "^3.6.2",
|
|
72
|
+
"react": "^19.1.1",
|
|
61
73
|
"react-dom": "^19.1.1",
|
|
74
|
+
"ts-jest": "^29.4.1",
|
|
62
75
|
"tsc-alias": "^1.8.16",
|
|
63
76
|
"typescript": "^5.9.2",
|
|
64
77
|
"typescript-eslint": "^8.43.0"
|