@meonode/ui 0.1.111 → 0.1.113

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.
@@ -1,4 +1,4 @@
1
- import { type ElementType, type ReactNode } from 'react';
1
+ import { type ElementType, type ReactNode, type ReactElement } from 'react';
2
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
  /**
@@ -94,7 +94,7 @@ export declare class BaseNode<E extends NodeElement = NodeElement> implements No
94
94
  * Recursively processes child nodes and uses `React.createElement` to construct the final React element.
95
95
  * @returns A ReactNode representing the rendered element.
96
96
  */
97
- render(): ReactNode;
97
+ render(): ReactElement;
98
98
  private _ensurePortalInfrastructure;
99
99
  toPortal(): ReactDOMRoot | null;
100
100
  }
@@ -106,16 +106,38 @@ export declare class BaseNode<E extends NodeElement = NodeElement> implements No
106
106
  */
107
107
  export declare function Node<E extends NodeElement>(element: E, props?: NodeProps<E>): NodeInstance<E>;
108
108
  /**
109
- * Creates a curried node factory for a given React element type.
109
+ * Creates a curried node factory for a given React element or component type.
110
110
  *
111
- * This utility returns a function that, when called with props, produces a `BaseNode` instance.
112
- * It is useful for creating reusable node factories for specific components or element types.
111
+ * Returns a function that, when called with props, produces a `BaseNode` instance.
112
+ * Useful for creating reusable node factories for specific components or element types.
113
113
  * @template E The React element or component type.
114
+ * @template AdditionalInitialProps Additional props to merge with node props.
114
115
  * @param element The React element or component type to wrap.
116
+ * @param initialProps Initial props to apply to every node instance.
115
117
  * @returns A function that takes node props and returns a `NodeInstance<E>`.
116
118
  * @example
117
- * const ButtonNode = createNode('button');
119
+ * const ButtonNode = createNode('button', { type: 'button' });
118
120
  * const myButton = ButtonNode({ children: 'Click me', style: { color: 'red' } });
119
121
  */
120
- export declare function createNode<E extends ElementType>(element: E): HasRequiredProps<PropsOf<E>> extends true ? (props: NodeProps<E>) => NodeInstance<E> : (props?: NodeProps<E>) => NodeInstance<E>;
122
+ export declare function createNode<AdditionalInitialProps extends Record<string, any> = Record<string, any>, E extends ElementType = ElementType>(element: E, initialProps?: NodeProps<E> & AdditionalInitialProps): HasRequiredProps<PropsOf<E>> extends true ? <AdditionalProps extends Record<string, any> = AdditionalInitialProps>(props: NodeProps<E> & AdditionalProps) => NodeInstance<E> : <AdditionalProps extends Record<string, any> = AdditionalInitialProps>(props?: NodeProps<E> & AdditionalProps) => NodeInstance<E>;
123
+ /**
124
+ * Creates a node factory function where the first argument is `children` and the second is `props`.
125
+ *
126
+ * This is useful for ergonomic creation of nodes where children are the primary concern,
127
+ * such as for layout or container components.
128
+ *
129
+ * The returned function takes `children` as the first argument and `props` (excluding `children`) as the second.
130
+ * It merges any `initialProps` provided at factory creation, then creates a `BaseNode` instance.
131
+ *
132
+ * Type parameters:
133
+ * - `AdditionalInitialProps`: Extra props to merge with node props.
134
+ * - `E`: The React element or component type.
135
+ * @param element The React element or component type to wrap.
136
+ * @param initialProps Initial props to apply to every node instance (excluding `children`).
137
+ * @returns A function that takes `children` and `props`, returning a `NodeInstance<E>`.
138
+ * @example
139
+ * const DivNode = createChildrenFirstNode('div');
140
+ * const myDiv = DivNode([<span key="1" />, <span key="2" />], { className: 'container' });
141
+ */
142
+ export declare function createChildrenFirstNode<AdditionalInitialProps extends Record<string, any> = Record<string, any>, E extends ElementType = ElementType>(element: E, initialProps?: Omit<NodeProps<E> & AdditionalInitialProps, 'children'>): HasRequiredProps<PropsOf<E>> extends true ? <AdditionalProps extends Record<string, any> = AdditionalInitialProps>(children: NodeElement | NodeElement[], props: Omit<NodeProps<E> & AdditionalProps, 'children'>) => NodeInstance<E> : <AdditionalProps extends Record<string, any> = AdditionalInitialProps>(children?: NodeElement | NodeElement[], props?: Omit<NodeProps<E> & AdditionalProps, 'children'>) => NodeInstance<E>;
121
143
  //# sourceMappingURL=core.node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"core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AAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,eAAe,EAAE,UAAU,CAAC,KACrD,YAAY,CAAC,CAAC,CAAC,CAKvB"}
package/dist/core.node.js CHANGED
@@ -118,14 +118,34 @@ var i;return i=this.element===Fragment||isFragment(this.element)?{key:e}:_object
118
118
  * @param props The props for the node (optional).
119
119
  * @returns NodeInstance<E> - A new BaseNode instance.
120
120
  */export function Node(a,b){var c=_objectSpread({},b||{});return c.theme&&!c.nodetheme&&(c.nodetheme=c.theme),new BaseNode(a,c)}/**
121
- * Creates a curried node factory for a given React element type.
121
+ * Creates a curried node factory for a given React element or component type.
122
122
  *
123
- * This utility returns a function that, when called with props, produces a `BaseNode` instance.
124
- * It is useful for creating reusable node factories for specific components or element types.
123
+ * Returns a function that, when called with props, produces a `BaseNode` instance.
124
+ * Useful for creating reusable node factories for specific components or element types.
125
125
  * @template E The React element or component type.
126
+ * @template AdditionalInitialProps Additional props to merge with node props.
126
127
  * @param element The React element or component type to wrap.
128
+ * @param initialProps Initial props to apply to every node instance.
127
129
  * @returns A function that takes node props and returns a `NodeInstance<E>`.
128
130
  * @example
129
- * const ButtonNode = createNode('button');
131
+ * const ButtonNode = createNode('button', { type: 'button' });
130
132
  * const myButton = ButtonNode({ children: 'Click me', style: { color: 'red' } });
131
- */export function createNode(a){return function(b){return Node(a,b)}}
133
+ */export function createNode(a,b){return function(c){return Node(a,_objectSpread(_objectSpread({},b),c))}}/**
134
+ * Creates a node factory function where the first argument is `children` and the second is `props`.
135
+ *
136
+ * This is useful for ergonomic creation of nodes where children are the primary concern,
137
+ * such as for layout or container components.
138
+ *
139
+ * The returned function takes `children` as the first argument and `props` (excluding `children`) as the second.
140
+ * It merges any `initialProps` provided at factory creation, then creates a `BaseNode` instance.
141
+ *
142
+ * Type parameters:
143
+ * - `AdditionalInitialProps`: Extra props to merge with node props.
144
+ * - `E`: The React element or component type.
145
+ * @param element The React element or component type to wrap.
146
+ * @param initialProps Initial props to apply to every node instance (excluding `children`).
147
+ * @returns A function that takes `children` and `props`, returning a `NodeInstance<E>`.
148
+ * @example
149
+ * const DivNode = createChildrenFirstNode('div');
150
+ * const myDiv = DivNode([<span key="1" />, <span key="2" />], { className: 'container' });
151
+ */export function createChildrenFirstNode(a,b){return function(c,d){return Node(a,_objectSpread(_objectSpread(_objectSpread({},b),d),{},{children:c}))}}
@@ -1,5 +1,5 @@
1
1
  import type { ComponentNode, HasCSSCompatibleStyleProp, NodeElement, Theme } from '../node.type';
2
- import { type CSSProperties, type ReactNode } from 'react';
2
+ import { type CSSProperties, type ReactElement } from 'react';
3
3
  /**
4
4
  * Props definition for components wrapped using the `Component` higher-order function.
5
5
  *
@@ -36,7 +36,7 @@ export type ComponentNodeProps<TProps> = TProps extends undefined ? Partial<{
36
36
  * Title({ children: 'Hello' })
37
37
  * ```
38
38
  */
39
- export declare function Component<TProps extends undefined>(component: (props: ComponentNodeProps<TProps>) => ComponentNode): (props?: ComponentNodeProps<TProps>) => ReactNode | Promise<Awaited<ReactNode>>;
39
+ export declare function Component<TProps extends undefined>(component: (props: ComponentNodeProps<TProps>) => ComponentNode): (props?: ComponentNodeProps<TProps>) => ReactElement | Promise<Awaited<ReactElement>>;
40
40
  /**
41
41
  * Creates a component from a function that uses a defined props interface.
42
42
  * @template TProps Props interface expected by the component.
@@ -59,5 +59,5 @@ export declare function Component<TProps extends undefined>(component: (props: C
59
59
  * Button({ label: 'Click me', onClick: () => alert('clicked')})
60
60
  * ```
61
61
  */
62
- export declare function Component<TProps extends Record<string, any>>(component: (props: ComponentNodeProps<TProps>) => ComponentNode): (props: ComponentNodeProps<TProps>) => ReactNode | Promise<Awaited<ReactNode>>;
62
+ export declare function Component<TProps extends Record<string, any>>(component: (props: ComponentNodeProps<TProps>) => ComponentNode): (props: ComponentNodeProps<TProps>) => ReactElement | Promise<Awaited<ReactElement>>;
63
63
  //# sourceMappingURL=component.hoc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.hoc.d.ts","sourceRoot":"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EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAA"}
@@ -58,16 +58,16 @@ var f=function Renderer(){var a=0<arguments.length&&arguments[0]!==void 0?argume
58
58
  }));// Ensures that the theme is correctly applied if the result is a BaseNode.
59
59
  if(f instanceof BaseNode){var g,h;return Node(f.element,_objectSpread(_objectSpread({},f.rawProps),{},{nodetheme:(null===(g=f.rawProps)||void 0===g?void 0:g.nodetheme)||(null===(h=f.rawProps)||void 0===h?void 0:h.theme)||a.nodetheme})).render()}return f};// --- Portal Launcher Function (Returned to User) ---
60
60
  // This is the function that developers call to actually create and manage a portal instance.
61
- return function Func(a){// --- Helper for Deep Content Injection ---
61
+ return function Func(){// --- Helper for Deep Content Injection ---
62
62
  // Recursively injects content into the deepest child of a provider chain.
63
63
  function injectContentDeeply(a,b,c){var d,e,f,g=null===(d=a.rawProps)||void 0===d?void 0:d.children;// If no children, or children is not a NodeInstance, inject directly
64
64
  if(!g||!(g instanceof BaseNode)){var h,i;return Node(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{children:b,nodetheme:(null===(h=a.rawProps)||void 0===h?void 0:h.nodetheme)||(null===(i=a.rawProps)||void 0===i?void 0:i.theme)||c}))}// Recursively inject into the deepest node
65
65
  var j=injectContentDeeply(g,b);return Node(a.element,_objectSpread(_objectSpread({},a.rawProps),{},{children:j,nodetheme:(null===(e=a.rawProps)||void 0===e?void 0:e.nodetheme)||(null===(f=a.rawProps)||void 0===f?void 0:f.theme)||c}))}// --- Provider Wrapping Logic ---
66
66
  // Iterates through the combined providers (fixed + dynamic) to wrap the content.
67
67
  // Providers are applied in reverse order to ensure the innermost content is wrapped by the outermost provider.
68
- var b,c=[];// Combine fixed and dynamic providers
69
- a.provider&&c.push(a.provider);var g=[...(null!==d&&void 0!==d?d:[]),...c],h=a.provider,i=a.nodetheme,j=_objectWithoutProperties(a,_excluded2),k=_objectSpread(_objectSpread({},j),{},{nodetheme:i}),l=Node(f,k);// Separates props for the portal's content from internal props like 'provider' or 'nodetheme'.
68
+ var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=[];// Combine fixed and dynamic providers
69
+ b.provider&&c.push(b.provider);var g=[...(null!==d&&void 0!==d?d:[]),...c],h=b.provider,i=b.nodetheme,j=_objectWithoutProperties(b,_excluded2),k=_objectSpread(_objectSpread({},j),{},{nodetheme:i}),l=Node(f,k);// Separates props for the portal's content from internal props like 'provider' or 'nodetheme'.
70
70
  // Creates the base node for the portal's content.
71
- return b=0<g.length?g.reduceRight(function(a,b){var c,d,e;if(!(b instanceof BaseNode))return console.warn("Portal: Item in provider is not a valid NodeInstance. Skipping.",b),a;var f=(null===(c=b.rawProps)||void 0===c?void 0:c.children)instanceof BaseNode;// If the provider already has nested children, inject content deeply.
71
+ return a=0<g.length?g.reduceRight(function(a,b){var c,d,e;if(!(b instanceof BaseNode))return console.warn("Portal: Item in provider is not a valid NodeInstance. Skipping.",b),a;var f=(null===(c=b.rawProps)||void 0===c?void 0:c.children)instanceof BaseNode;// If the provider already has nested children, inject content deeply.
72
72
  // Otherwise, simply set currentWrappedContent as its direct child.
73
- return f?injectContentDeeply(b,a,i):Node(b.element,_objectSpread(_objectSpread({},b.rawProps),{},{children:a,nodetheme:(null===(d=b.rawProps)||void 0===d?void 0:d.nodetheme)||(null===(e=b.rawProps)||void 0===e?void 0:e.theme)||i}))},l):l,e=b.toPortal(),e}}
73
+ return f?injectContentDeeply(b,a,i):Node(b.element,_objectSpread(_objectSpread({},b.rawProps),{},{children:a,nodetheme:(null===(d=b.rawProps)||void 0===d?void 0:d.nodetheme)||(null===(e=b.rawProps)||void 0===e?void 0:e.theme)||i}))},l):l,e=a.toPortal(),e}}