@meonode/ui 1.0.1 → 1.1.1
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 +39 -0
- package/README.md +0 -1
- package/dist/cjs/hoc/component.hoc.js +1 -1
- package/dist/cjs/util/theme.util.js +1 -1
- package/dist/esm/components/html.node.d.ts +549 -139
- package/dist/esm/components/html.node.d.ts.map +1 -1
- package/dist/esm/components/react.node.d.ts +3 -3
- package/dist/esm/components/theme-provider.d.ts +1 -1
- package/dist/esm/core.node.d.ts +10 -6
- package/dist/esm/core.node.d.ts.map +1 -1
- package/dist/esm/hoc/component.hoc.d.ts +6 -4
- package/dist/esm/hoc/component.hoc.d.ts.map +1 -1
- package/dist/esm/hoc/component.hoc.js +1 -1
- package/dist/esm/hoc/portal.hoc.d.ts +1 -1
- package/dist/esm/hoc/portal.hoc.d.ts.map +1 -1
- package/dist/esm/nextjs-registry/index.d.ts +1 -1
- package/dist/esm/types/node.type.d.ts +166 -85
- package/dist/esm/types/node.type.d.ts.map +1 -1
- package/dist/esm/util/node.util.d.ts +2 -2
- package/dist/esm/util/node.util.d.ts.map +1 -1
- package/dist/esm/util/theme.util.d.ts.map +1 -1
- package/dist/esm/util/theme.util.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [1.1.1] - 2025-12-05
|
|
6
|
+
|
|
7
|
+
### Fix
|
|
8
|
+
- **types**: update HasCSSCompatibleStyleProp to use CSSProperties directly ([`4e23499`](https://github.com/l7aromeo/meonode-ui/commit/4e234990147baba72064a2f7b4ff03fedfe23a98))
|
|
9
|
+
|
|
10
|
+
## [1.1.0] - 2025-12-05
|
|
11
|
+
|
|
12
|
+
### Feat
|
|
13
|
+
|
|
14
|
+
- **types**: enforce strict component props and improve type inference ([`047c0f8`](https://github.com/l7aromeo/meonode-ui/commit/047c0f8))
|
|
15
|
+
- Redefined `MergedProps` and introduced `ValidateComponentProps` to strictly validate props passed to `Node` and `createNode`.
|
|
16
|
+
- Added `ExactProps` generic constraint to prevent excess property passing, improving type safety.
|
|
17
|
+
- Enhanced `PropsOf` to better infer props from React components, including `forwardRef` and `Memo` components.
|
|
18
|
+
- **theme**: enable theme variable resolution in style keys ([`30ca1fd`](https://github.com/l7aromeo/meonode-ui/commit/30ca1fd))
|
|
19
|
+
- Updated `ThemeUtil` to resolve theme variables within style keys (e.g., media queries like `@media (max-width: theme.breakpoint.lg)`).
|
|
20
|
+
|
|
21
|
+
### Refactor
|
|
22
|
+
|
|
23
|
+
- **portal**: optimize portal implementation and fix types ([`9643682`](https://github.com/l7aromeo/meonode-ui/commit/9643682))
|
|
24
|
+
- Refactored `Portal` HOC to use a cleaner, more efficient implementation for provider wrapping.
|
|
25
|
+
- Improved type definitions for `PortalLauncher` and `PortalProps` to ensure correct prop inference.
|
|
26
|
+
|
|
27
|
+
### Fix
|
|
28
|
+
|
|
29
|
+
- **util**: correct function child detection and rendering logic ([`944cfbd`](https://github.com/l7aromeo/meonode-ui/commit/944cfbd))
|
|
30
|
+
- Updated `isFunctionChild` type definition to correctly identify function children while excluding React components (Class, Memo, ForwardRef).
|
|
31
|
+
- Updated `functionRenderer` type definition to properly handle function child execution.
|
|
32
|
+
|
|
33
|
+
### Test
|
|
34
|
+
|
|
35
|
+
- **test**: refactor tests to align with strict types and fix leaks ([`40c87c7`](https://github.com/l7aromeo/meonode-ui/commit/40c87c7))
|
|
36
|
+
- Updated various tests (`advanced-features`, `leak-repro`, `memoization`) to comply with the new strict type requirements.
|
|
37
|
+
- Added `strict-component-props.test.ts` and `theme-key-resolution.test.ts` to verify new features.
|
|
38
|
+
|
|
39
|
+
### Chore
|
|
40
|
+
|
|
41
|
+
- **build**: update build config and dependencies ([`a9367e0`](https://github.com/l7aromeo/meonode-ui/commit/a9367e0))
|
|
42
|
+
- Updated `package.json` scripts and `tsconfig.json` for better build and test processes.
|
|
43
|
+
|
|
5
44
|
## [1.0.1] - 2025-11-30
|
|
6
45
|
|
|
7
46
|
### Fix
|
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../core.node.js")
|
|
1
|
+
"use strict";var e=require("../core.node.js"),r=require("../helper/common.helper.js"),n=require("../util/node.util.js");exports.Component=function(o){const t=r.getElementTypeName(o),s=r=>{const t=o(r);return t instanceof e.BaseNode||n.NodeUtil.isNodeInstance(t)?e.Node(t.element,t.rawProps).render():t};function i(r={},n){return e.Node(s,r,n).render()}return s.displayName=`Renderer(${t})`,i.displayName=`Component(${t})`,i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("../helper/common.helper.js");class t{constructor(){}static parseFlexShorthand(e){if(null==e)return null;if("number"==typeof e)return{grow:e,shrink:1,basis:"0%"};if("string"!=typeof e)return null;const t=e.trim().toLowerCase();if(!t)return null;switch(t){case"none":return{grow:0,shrink:0,basis:"auto"};case"auto":return{grow:1,shrink:1,basis:"auto"};case"initial":return{grow:0,shrink:1,basis:"auto"};default:return null}}static isPlainObject=e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};static resolveObjWithTheme=(r,l,s={})=>{const{processFunctions:n=!1}=s;if(!l||!l.system||"object"!=typeof l.system||0===Object.keys(l.system).length||!r||0===Object.keys(r).length)return r;const i=l.system,o=[{value:r,isProcessed:!1}],a=new Map,u=new Set,c=/theme\.([a-zA-Z0-9_.-]+)/g,f=t=>{c.lastIndex=0;let r=!1;const l=t.replace(c,(t,l)=>{const s=e.getValueByPath(i,l);if(null!=s){if(r=!0,"object"==typeof s){if(!Array.isArray(s)&&"default"in s)return s.default;throw new Error("The provided theme path is invalid!")}return s}return t});return r?l:t};for(;o.length>0;){const e=o[o.length-1],r=e.value;if(t.isPlainObject(r)||Array.isArray(r))if(a.has(r))o.pop();else if(e.isProcessed){o.pop(),u.delete(r);let e=r;if(Array.isArray(r)){let t=null;for(let e=0;e<r.length;e++){const l=r[e],s=a.get(l)??l;s!==l&&(null===t&&(t=[...r]),t[e]=s)}null!==t&&(e=t)}else{let t=null;for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const s=r[e];let i=a.get(s)??s;if("function"==typeof i&&n){const e=i(l);i="string"==typeof e&&e.includes("theme.")?f(e):e}else"string"==typeof i&&i.includes("theme.")&&(i=f(i));i
|
|
1
|
+
"use strict";var e=require("../helper/common.helper.js");class t{constructor(){}static parseFlexShorthand(e){if(null==e)return null;if("number"==typeof e)return{grow:e,shrink:1,basis:"0%"};if("string"!=typeof e)return null;const t=e.trim().toLowerCase();if(!t)return null;switch(t){case"none":return{grow:0,shrink:0,basis:"auto"};case"auto":return{grow:1,shrink:1,basis:"auto"};case"initial":return{grow:0,shrink:1,basis:"auto"};default:return null}}static isPlainObject=e=>{if("object"!=typeof e||null===e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype};static resolveObjWithTheme=(r,l,s={})=>{const{processFunctions:n=!1}=s;if(!l||!l.system||"object"!=typeof l.system||0===Object.keys(l.system).length||!r||0===Object.keys(r).length)return r;const i=l.system,o=[{value:r,isProcessed:!1}],a=new Map,u=new Set,c=/theme\.([a-zA-Z0-9_.-]+)/g,f=t=>{c.lastIndex=0;let r=!1;const l=t.replace(c,(t,l)=>{const s=e.getValueByPath(i,l);if(null!=s){if(r=!0,"object"==typeof s){if(!Array.isArray(s)&&"default"in s)return s.default;throw new Error("The provided theme path is invalid!")}return s}return t});return r?l:t};for(;o.length>0;){const e=o[o.length-1],r=e.value;if(t.isPlainObject(r)||Array.isArray(r))if(a.has(r))o.pop();else if(e.isProcessed){o.pop(),u.delete(r);let e=r;if(Array.isArray(r)){let t=null;for(let e=0;e<r.length;e++){const l=r[e],s=a.get(l)??l;s!==l&&(null===t&&(t=[...r]),t[e]=s)}null!==t&&(e=t)}else{let t=null;for(const e in r)if(Object.prototype.hasOwnProperty.call(r,e)){const s=r[e];let i=a.get(s)??s,o=e;if("string"==typeof e&&e.includes("theme.")&&(o=f(e)),"function"==typeof i&&n){const e=i(l);i="string"==typeof e&&e.includes("theme.")?f(e):e}else"string"==typeof i&&i.includes("theme.")&&(i=f(i));i===s&&o===e||(null===t&&(t={...r}),o!==e&&delete t[e],t[o]=i)}null!==t&&(e=t)}a.set(r,e)}else{e.isProcessed=!0,u.add(r);const l=Array.isArray(r)?r:Object.values(r);for(let e=l.length-1;e>=0;e--){const r=l[e];!t.isPlainObject(r)&&!Array.isArray(r)||u.has(r)||o.push({value:r,isProcessed:!1})}}else o.pop()}return a.get(r)??r};static resolveDefaultStyle=e=>{if(null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e)return{};const{flex:r,...l}=e,s="flex"===l.display||"inline-flex"===l.display,n=!!(l.overflow||l.overflowY||l.overflowX),i=l.flexFlow?.includes("wrap")||"wrap"===l.flexWrap||"wrap-reverse"===l.flexWrap,o="flexShrink"in e&&void 0!==e.flexShrink,a=r?t.parseFlexShorthand(r):null;let u;if(!o)if(a)u=a.shrink;else if(s){if(!n){const e="column"===l.flexDirection||"column-reverse"===l.flexDirection,t="row"===l.flexDirection||"row-reverse"===l.flexDirection||!l.flexDirection;(e&&!i||t&&!i)&&(u=0)}}else u=0;return{flex:r,flexShrink:u,minHeight:0,minWidth:0,...l}}}exports.ThemeUtil=t;
|