flexium 0.10.6 → 0.12.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/README.md +15 -15
- package/dist/canvas.d.cts +83 -23
- package/dist/canvas.d.ts +83 -23
- package/dist/canvas.js +1 -1
- package/dist/canvas.js.map +1 -1
- package/dist/canvas.mjs +1 -1
- package/dist/canvas.mjs.map +1 -1
- package/dist/chunk-44RZHCII.mjs +2 -0
- package/dist/chunk-44RZHCII.mjs.map +1 -0
- package/dist/chunk-7BXR4ZFD.js +2 -0
- package/dist/chunk-7BXR4ZFD.js.map +1 -0
- package/dist/chunk-7DXFHPWZ.mjs +2 -0
- package/dist/chunk-7DXFHPWZ.mjs.map +1 -0
- package/dist/chunk-ALTO2MGI.js +2 -0
- package/dist/chunk-ALTO2MGI.js.map +1 -0
- package/dist/chunk-C452JE6C.js +2 -0
- package/dist/chunk-C452JE6C.js.map +1 -0
- package/dist/chunk-CPJRQL2C.mjs +2 -0
- package/dist/chunk-CPJRQL2C.mjs.map +1 -0
- package/dist/chunk-EJ7Z5OMU.mjs +2 -0
- package/dist/chunk-EJ7Z5OMU.mjs.map +1 -0
- package/dist/chunk-ENWGYQNU.js +2 -0
- package/dist/chunk-ENWGYQNU.js.map +1 -0
- package/dist/chunk-EXLNKYSH.js +2 -0
- package/dist/chunk-EXLNKYSH.js.map +1 -0
- package/dist/chunk-LUREDEUB.mjs +2 -0
- package/dist/chunk-LUREDEUB.mjs.map +1 -0
- package/dist/chunk-LUW7DIEW.js +2 -0
- package/dist/chunk-LUW7DIEW.js.map +1 -0
- package/dist/chunk-ZCO4NIGC.mjs +2 -0
- package/dist/chunk-ZCO4NIGC.mjs.map +1 -0
- package/dist/core.d.cts +41 -2
- package/dist/core.d.ts +41 -2
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/dom.d.cts +10 -33
- package/dist/dom.d.ts +10 -33
- package/dist/dom.js +1 -1
- package/dist/dom.js.map +1 -1
- package/dist/dom.mjs +1 -1
- package/dist/dom.mjs.map +1 -1
- package/dist/index.d.cts +1 -24
- package/dist/index.d.ts +1 -24
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interactive.d.cts +65 -148
- package/dist/interactive.d.ts +65 -148
- package/dist/interactive.js +1 -1
- package/dist/interactive.js.map +1 -1
- package/dist/interactive.mjs +1 -1
- package/dist/interactive.mjs.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +6 -2
- package/dist/jsx-dev-runtime.d.ts +6 -2
- package/dist/jsx-dev-runtime.js +1 -1
- package/dist/jsx-dev-runtime.js.map +1 -1
- package/dist/jsx-dev-runtime.mjs +1 -1
- package/dist/jsx-dev-runtime.mjs.map +1 -1
- package/dist/jsx-runtime.d.cts +6 -68
- package/dist/jsx-runtime.d.ts +6 -68
- package/dist/jsx-runtime.js +1 -1
- package/dist/jsx-runtime.mjs +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/router.d.cts +48 -15
- package/dist/router.d.ts +48 -15
- package/dist/router.js +1 -1
- package/dist/router.js.map +1 -1
- package/dist/router.mjs +1 -1
- package/dist/router.mjs.map +1 -1
- package/package.json +13 -53
- package/dist/DrawText-CVAKQ5wZ.d.cts +0 -309
- package/dist/DrawText-Dlh1L1Ar.d.ts +0 -309
- package/dist/Motion-BrOAJzgH.d.cts +0 -87
- package/dist/Motion-BrOAJzgH.d.ts +0 -87
- package/dist/advanced.d.cts +0 -32
- package/dist/advanced.d.ts +0 -32
- package/dist/advanced.js +0 -2
- package/dist/advanced.js.map +0 -1
- package/dist/advanced.mjs +0 -2
- package/dist/advanced.mjs.map +0 -1
- package/dist/chunk-2L2QFYBL.mjs +0 -2
- package/dist/chunk-2L2QFYBL.mjs.map +0 -1
- package/dist/chunk-ANJNQW77.js +0 -2
- package/dist/chunk-ANJNQW77.js.map +0 -1
- package/dist/chunk-BYHIHYRR.mjs +0 -2
- package/dist/chunk-BYHIHYRR.mjs.map +0 -1
- package/dist/chunk-DZ7L3SHV.js +0 -2
- package/dist/chunk-DZ7L3SHV.js.map +0 -1
- package/dist/chunk-E5WYPGCV.mjs +0 -3
- package/dist/chunk-E5WYPGCV.mjs.map +0 -1
- package/dist/chunk-ECYYIQEX.mjs +0 -3
- package/dist/chunk-ECYYIQEX.mjs.map +0 -1
- package/dist/chunk-ERIXVRJ4.mjs +0 -3
- package/dist/chunk-ERIXVRJ4.mjs.map +0 -1
- package/dist/chunk-F23GIQDE.mjs +0 -2
- package/dist/chunk-F23GIQDE.mjs.map +0 -1
- package/dist/chunk-FDMJHFN7.mjs +0 -2
- package/dist/chunk-FDMJHFN7.mjs.map +0 -1
- package/dist/chunk-GKJQEOP7.mjs +0 -2
- package/dist/chunk-GKJQEOP7.mjs.map +0 -1
- package/dist/chunk-GYDP6MFV.js +0 -3
- package/dist/chunk-GYDP6MFV.js.map +0 -1
- package/dist/chunk-HB5VPQTB.mjs +0 -2
- package/dist/chunk-HB5VPQTB.mjs.map +0 -1
- package/dist/chunk-KNF5ERPK.mjs +0 -2
- package/dist/chunk-KNF5ERPK.mjs.map +0 -1
- package/dist/chunk-NF4RPLCK.js +0 -3
- package/dist/chunk-NF4RPLCK.js.map +0 -1
- package/dist/chunk-OPAAGNBO.mjs +0 -2
- package/dist/chunk-OPAAGNBO.mjs.map +0 -1
- package/dist/chunk-OPAQ4R4M.mjs +0 -2
- package/dist/chunk-OPAQ4R4M.mjs.map +0 -1
- package/dist/chunk-Q7IWDVJ4.js +0 -2
- package/dist/chunk-Q7IWDVJ4.js.map +0 -1
- package/dist/chunk-RLLO5M6F.js +0 -3
- package/dist/chunk-RLLO5M6F.js.map +0 -1
- package/dist/chunk-RMN5IPS5.js +0 -2
- package/dist/chunk-RMN5IPS5.js.map +0 -1
- package/dist/chunk-U6C6VDVZ.js +0 -2
- package/dist/chunk-U6C6VDVZ.js.map +0 -1
- package/dist/chunk-WQFQO5LK.js +0 -2
- package/dist/chunk-WQFQO5LK.js.map +0 -1
- package/dist/chunk-WVEJT7HD.mjs +0 -2
- package/dist/chunk-WVEJT7HD.mjs.map +0 -1
- package/dist/chunk-WWEWRI6S.js +0 -2
- package/dist/chunk-WWEWRI6S.js.map +0 -1
- package/dist/chunk-YDZ37ZZ4.js +0 -2
- package/dist/chunk-YDZ37ZZ4.js.map +0 -1
- package/dist/chunk-YEBBTVHG.js +0 -2
- package/dist/chunk-YEBBTVHG.js.map +0 -1
- package/dist/chunk-YPVRQKMW.js +0 -2
- package/dist/chunk-YPVRQKMW.js.map +0 -1
- package/dist/components-BMbqsbMY.d.cts +0 -126
- package/dist/components-C83mBQXW.d.ts +0 -126
- package/dist/core-CxHP8991.d.cts +0 -32
- package/dist/core-D0ggvjX3.d.ts +0 -32
- package/dist/effect-554ONNZR.js +0 -2
- package/dist/effect-554ONNZR.js.map +0 -1
- package/dist/effect-T2GVIS3T.mjs +0 -2
- package/dist/effect-T2GVIS3T.mjs.map +0 -1
- package/dist/owner-QS9tPwPr.d.cts +0 -27
- package/dist/owner-QS9tPwPr.d.ts +0 -27
- package/dist/portal-BK_0Z0hE.d.cts +0 -206
- package/dist/portal-CbguxtuQ.d.ts +0 -206
- package/dist/primitives/layout.d.cts +0 -295
- package/dist/primitives/layout.d.ts +0 -295
- package/dist/primitives/layout.js +0 -2
- package/dist/primitives/layout.js.map +0 -1
- package/dist/primitives/layout.mjs +0 -2
- package/dist/primitives/layout.mjs.map +0 -1
- package/dist/primitives/motion.d.cts +0 -230
- package/dist/primitives/motion.d.ts +0 -230
- package/dist/primitives/motion.js +0 -2
- package/dist/primitives/motion.js.map +0 -1
- package/dist/primitives/motion.mjs +0 -2
- package/dist/primitives/motion.mjs.map +0 -1
- package/dist/primitives/ui.d.cts +0 -81
- package/dist/primitives/ui.d.ts +0 -81
- package/dist/primitives/ui.js +0 -2
- package/dist/primitives/ui.js.map +0 -1
- package/dist/primitives/ui.mjs +0 -2
- package/dist/primitives/ui.mjs.map +0 -1
- package/dist/primitives.d.cts +0 -93
- package/dist/primitives.d.ts +0 -93
- package/dist/primitives.js +0 -2
- package/dist/primitives.js.map +0 -1
- package/dist/primitives.mjs +0 -2
- package/dist/primitives.mjs.map +0 -1
- package/dist/renderer-DSLb-FGg.d.cts +0 -135
- package/dist/renderer-DSLb-FGg.d.ts +0 -135
- package/dist/server.d.cts +0 -3
- package/dist/server.d.ts +0 -3
- package/dist/server.js +0 -2
- package/dist/server.js.map +0 -1
- package/dist/server.mjs +0 -2
- package/dist/server.mjs.map +0 -1
- package/dist/state-DitsMyev.d.cts +0 -96
- package/dist/state-DitsMyev.d.ts +0 -96
- package/dist/state-S3TSPDMB.js +0 -2
- package/dist/state-S3TSPDMB.js.map +0 -1
- package/dist/state-SUVOJZYY.mjs +0 -2
- package/dist/state-SUVOJZYY.mjs.map +0 -1
- package/dist/sync-Z4QqUDjF.d.cts +0 -25
- package/dist/sync-Z4QqUDjF.d.ts +0 -25
- package/dist/test-exports.d.cts +0 -68
- package/dist/test-exports.d.ts +0 -68
- package/dist/test-exports.js +0 -2
- package/dist/test-exports.js.map +0 -1
- package/dist/test-exports.mjs +0 -2
- package/dist/test-exports.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"effect-554ONNZR.js"}
|
package/dist/effect-T2GVIS3T.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"effect-T2GVIS3T.mjs"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execute a function without tracking signal dependencies.
|
|
3
|
-
* Useful when you need to read signals inside an effect without creating dependencies.
|
|
4
|
-
*
|
|
5
|
-
* @param fn - Function to execute without tracking
|
|
6
|
-
* @returns The return value of fn
|
|
7
|
-
*/
|
|
8
|
-
declare function untrack<T>(fn: () => T): T;
|
|
9
|
-
/**
|
|
10
|
-
* Creates a disposal scope.
|
|
11
|
-
* The return value of the function is returned, and a dispose function is returned.
|
|
12
|
-
*
|
|
13
|
-
* @param fn - Function to run within a new root scope
|
|
14
|
-
* @returns [return value of fn, dispose function]
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const [val, dispose] = root((dispose) => {
|
|
19
|
-
* effect(() => console.log('Inside root'));
|
|
20
|
-
* return 123;
|
|
21
|
-
* });
|
|
22
|
-
* dispose(); // Cleans up all effects created inside
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
declare function root<T>(fn: (dispose: () => void) => T): T;
|
|
26
|
-
|
|
27
|
-
export { root as r, untrack as u };
|
package/dist/owner-QS9tPwPr.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Execute a function without tracking signal dependencies.
|
|
3
|
-
* Useful when you need to read signals inside an effect without creating dependencies.
|
|
4
|
-
*
|
|
5
|
-
* @param fn - Function to execute without tracking
|
|
6
|
-
* @returns The return value of fn
|
|
7
|
-
*/
|
|
8
|
-
declare function untrack<T>(fn: () => T): T;
|
|
9
|
-
/**
|
|
10
|
-
* Creates a disposal scope.
|
|
11
|
-
* The return value of the function is returned, and a dispose function is returned.
|
|
12
|
-
*
|
|
13
|
-
* @param fn - Function to run within a new root scope
|
|
14
|
-
* @returns [return value of fn, dispose function]
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```tsx
|
|
18
|
-
* const [val, dispose] = root((dispose) => {
|
|
19
|
-
* effect(() => console.log('Inside root'));
|
|
20
|
-
* return 123;
|
|
21
|
-
* });
|
|
22
|
-
* dispose(); // Cleans up all effects created inside
|
|
23
|
-
* ```
|
|
24
|
-
*/
|
|
25
|
-
declare function root<T>(fn: (dispose: () => void) => T): T;
|
|
26
|
-
|
|
27
|
-
export { root as r, untrack as u };
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { R as Renderer, E as EventHandler, F as FNode } from './renderer-DSLb-FGg.cjs';
|
|
2
|
-
import { S as StateValue } from './state-DitsMyev.cjs';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* DOM Renderer implementation
|
|
6
|
-
*/
|
|
7
|
-
declare class DOMRenderer implements Renderer {
|
|
8
|
-
createNode(type: string, props: Record<string, any>): HTMLElement | SVGElement;
|
|
9
|
-
updateNode(node: HTMLElement | SVGElement, oldProps: Record<string, any>, newProps: Record<string, any>): void;
|
|
10
|
-
appendChild(parent: Node, child: Node): void;
|
|
11
|
-
insertBefore(parent: Node, child: Node, beforeChild: Node | null): void;
|
|
12
|
-
nextSibling(node: Node): Node | null;
|
|
13
|
-
removeChild(parent: Node, child: Node): void;
|
|
14
|
-
createTextNode(text: string): Text;
|
|
15
|
-
updateTextNode(node: Text, text: string): void;
|
|
16
|
-
addEventListener(node: Node, event: string, handler: EventHandler): void;
|
|
17
|
-
removeEventListener(node: Node, event: string, _handler: EventHandler): void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Default DOM renderer instance
|
|
21
|
-
*/
|
|
22
|
-
declare const domRenderer: DOMRenderer;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* JSX Factory Function (f)
|
|
26
|
-
*
|
|
27
|
-
* This module provides the JSX factory function for creating Flexium nodes.
|
|
28
|
-
* It's used by the JSX transpiler to convert JSX syntax into function calls.
|
|
29
|
-
*
|
|
30
|
-
* Usage in tsconfig.json:
|
|
31
|
-
* {
|
|
32
|
-
* "compilerOptions": {
|
|
33
|
-
* "jsx": "react",
|
|
34
|
-
* "jsxFactory": "f",
|
|
35
|
-
* "jsxFragmentFactory": "Fragment"
|
|
36
|
-
* }
|
|
37
|
-
* }
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* JSX factory function for Flexium
|
|
42
|
-
* Creates a Flexium node from JSX syntax
|
|
43
|
-
*
|
|
44
|
-
* @param type - Element type (string for built-in, function for components)
|
|
45
|
-
* @param props - Element properties
|
|
46
|
-
* @param children - Child elements
|
|
47
|
-
* @returns Flexium node
|
|
48
|
-
*/
|
|
49
|
-
declare function f(type: string | Function, props: Record<string, any> | null, ...children: any[]): FNode;
|
|
50
|
-
/**
|
|
51
|
-
* Fragment component
|
|
52
|
-
* Renders children without a wrapper element
|
|
53
|
-
*/
|
|
54
|
-
declare function Fragment(props: {
|
|
55
|
-
children?: any[];
|
|
56
|
-
}): FNode;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* DOM Render Function
|
|
60
|
-
*
|
|
61
|
-
* This module provides the main render function for mounting components to the DOM.
|
|
62
|
-
* It includes simple reconciliation logic for mounting and unmounting components.
|
|
63
|
-
*
|
|
64
|
-
* Note: This module uses reactive rendering internally via mountReactive.
|
|
65
|
-
* For root-level rendering with cleanup support, use createReactiveRoot.
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Render a component to a DOM container with automatic reactivity
|
|
70
|
-
*
|
|
71
|
-
* This function uses reactive rendering by default, which means:
|
|
72
|
-
* - Signals passed as children automatically update the DOM
|
|
73
|
-
* - Signals in props automatically update element properties
|
|
74
|
-
* - Component functions automatically re-render when signals change
|
|
75
|
-
*
|
|
76
|
-
* @param vnode - Flexium node to render
|
|
77
|
-
* @returns The rendered DOM node
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* const count = signal(0);
|
|
81
|
-
* render(f('div', {}, [count]), document.body);
|
|
82
|
-
* // The div will automatically update when count changes
|
|
83
|
-
*/
|
|
84
|
-
/**
|
|
85
|
-
* Mounts a Flexium node to a container
|
|
86
|
-
* @param node - Flexium node to render
|
|
87
|
-
* @param container - DOM element to mount to
|
|
88
|
-
*/
|
|
89
|
-
declare function render(node: FNode | string | number | null | undefined | Function, container: HTMLElement): Node | null;
|
|
90
|
-
/**
|
|
91
|
-
* Create a root for rendering with automatic reactivity
|
|
92
|
-
*
|
|
93
|
-
* This creates a root that supports fine-grained reactive updates.
|
|
94
|
-
* Signals are automatically tracked and only the affected DOM nodes are updated.
|
|
95
|
-
*
|
|
96
|
-
* @param container - DOM element to render into
|
|
97
|
-
* @returns Root object with render and unmount methods
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* const root = createRoot(document.body);
|
|
101
|
-
* const count = signal(0);
|
|
102
|
-
* root.render(f('div', {}, [count]));
|
|
103
|
-
* // Later: count.value++ will automatically update the DOM
|
|
104
|
-
*/
|
|
105
|
-
declare function createRoot(container: HTMLElement): {
|
|
106
|
-
render(node: FNode): void;
|
|
107
|
-
unmount(): void;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Getter function that returns the current value (signal-like)
|
|
112
|
-
*/
|
|
113
|
-
type ItemsGetter<T> = () => T[];
|
|
114
|
-
/**
|
|
115
|
-
* Fixed-height item configuration
|
|
116
|
-
*/
|
|
117
|
-
interface FixedSizeConfig {
|
|
118
|
-
mode: 'fixed';
|
|
119
|
-
itemHeight: number;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Variable-height item configuration
|
|
123
|
-
*/
|
|
124
|
-
interface VariableSizeConfig {
|
|
125
|
-
mode: 'variable';
|
|
126
|
-
estimatedItemHeight: number;
|
|
127
|
-
getItemHeight?: (index: number, item: unknown) => number;
|
|
128
|
-
}
|
|
129
|
-
type SizeConfig = FixedSizeConfig | VariableSizeConfig;
|
|
130
|
-
/**
|
|
131
|
-
* List component marker
|
|
132
|
-
*/
|
|
133
|
-
interface ListComponent<T> {
|
|
134
|
-
[key: symbol]: true;
|
|
135
|
-
each: ItemsGetter<T>;
|
|
136
|
-
renderItem: (item: T, index: () => number) => FNode;
|
|
137
|
-
virtual: boolean;
|
|
138
|
-
height?: number | string;
|
|
139
|
-
width?: number | string;
|
|
140
|
-
itemSize?: number | SizeConfig;
|
|
141
|
-
overscan: number;
|
|
142
|
-
getKey?: (item: T, index: number) => string | number;
|
|
143
|
-
onScroll?: (scrollTop: number) => void;
|
|
144
|
-
onVisibleRangeChange?: (startIndex: number, endIndex: number) => void;
|
|
145
|
-
class?: string;
|
|
146
|
-
style?: Record<string, string | number>;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Reactive DOM Rendering
|
|
151
|
-
*
|
|
152
|
-
* Integrates the signal system with the DOM renderer to enable fine-grained
|
|
153
|
-
* reactive updates. Only the specific DOM nodes that depend on changed signals
|
|
154
|
-
* will be updated, without re-rendering the entire component tree.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Mount a virtual node reactively to the DOM.
|
|
159
|
-
*
|
|
160
|
-
* This is the core rendering function that handles all node types:
|
|
161
|
-
* - FNodes (both built-in elements and function components)
|
|
162
|
-
* - Strings and numbers (text nodes)
|
|
163
|
-
* - Signals and computed values (reactive children)
|
|
164
|
-
* - StateValues from the state() API
|
|
165
|
-
* - ListComponents
|
|
166
|
-
* - Arrays and fragments
|
|
167
|
-
*
|
|
168
|
-
* Reactive values are automatically tracked and DOM updates occur
|
|
169
|
-
* only when the specific values change (fine-grained reactivity).
|
|
170
|
-
*
|
|
171
|
-
* @param vnode - The virtual node to mount
|
|
172
|
-
* @param container - Optional parent node to append to
|
|
173
|
-
* @returns The created DOM node, or null for empty/boolean values
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```tsx
|
|
177
|
-
* // Mount a simple element
|
|
178
|
-
* const node = mountReactive(<div>Hello</div>, document.body)
|
|
179
|
-
*
|
|
180
|
-
* // Mount a reactive signal
|
|
181
|
-
* const count = signal(0)
|
|
182
|
-
* mountReactive(() => <span>{count.value}</span>, container)
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
declare function mountReactive(node: FNode | string | number | boolean | StateValue<any> | null | undefined | Function | any[] | ListComponent<any>, container?: Node): Node | null;
|
|
186
|
-
declare function createReactiveRoot(container: HTMLElement): {
|
|
187
|
-
render(node: FNode): void;
|
|
188
|
-
unmount(): void;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
interface PortalProps {
|
|
192
|
-
mount?: HTMLElement;
|
|
193
|
-
children: any;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* <Portal> component renders its children into a different part of the DOM.
|
|
197
|
-
* Useful for modals, tooltips, etc.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* <Portal mount={document.body}>
|
|
201
|
-
* <div class="modal">...</div>
|
|
202
|
-
* </Portal>
|
|
203
|
-
*/
|
|
204
|
-
declare function Portal(props: PortalProps): Comment | null;
|
|
205
|
-
|
|
206
|
-
export { DOMRenderer as D, Fragment as F, type ListComponent as L, Portal as P, createReactiveRoot as a, createRoot as c, domRenderer as d, f, mountReactive as m, render as r };
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { R as Renderer, E as EventHandler, F as FNode } from './renderer-DSLb-FGg.js';
|
|
2
|
-
import { S as StateValue } from './state-DitsMyev.js';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* DOM Renderer implementation
|
|
6
|
-
*/
|
|
7
|
-
declare class DOMRenderer implements Renderer {
|
|
8
|
-
createNode(type: string, props: Record<string, any>): HTMLElement | SVGElement;
|
|
9
|
-
updateNode(node: HTMLElement | SVGElement, oldProps: Record<string, any>, newProps: Record<string, any>): void;
|
|
10
|
-
appendChild(parent: Node, child: Node): void;
|
|
11
|
-
insertBefore(parent: Node, child: Node, beforeChild: Node | null): void;
|
|
12
|
-
nextSibling(node: Node): Node | null;
|
|
13
|
-
removeChild(parent: Node, child: Node): void;
|
|
14
|
-
createTextNode(text: string): Text;
|
|
15
|
-
updateTextNode(node: Text, text: string): void;
|
|
16
|
-
addEventListener(node: Node, event: string, handler: EventHandler): void;
|
|
17
|
-
removeEventListener(node: Node, event: string, _handler: EventHandler): void;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Default DOM renderer instance
|
|
21
|
-
*/
|
|
22
|
-
declare const domRenderer: DOMRenderer;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* JSX Factory Function (f)
|
|
26
|
-
*
|
|
27
|
-
* This module provides the JSX factory function for creating Flexium nodes.
|
|
28
|
-
* It's used by the JSX transpiler to convert JSX syntax into function calls.
|
|
29
|
-
*
|
|
30
|
-
* Usage in tsconfig.json:
|
|
31
|
-
* {
|
|
32
|
-
* "compilerOptions": {
|
|
33
|
-
* "jsx": "react",
|
|
34
|
-
* "jsxFactory": "f",
|
|
35
|
-
* "jsxFragmentFactory": "Fragment"
|
|
36
|
-
* }
|
|
37
|
-
* }
|
|
38
|
-
*/
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* JSX factory function for Flexium
|
|
42
|
-
* Creates a Flexium node from JSX syntax
|
|
43
|
-
*
|
|
44
|
-
* @param type - Element type (string for built-in, function for components)
|
|
45
|
-
* @param props - Element properties
|
|
46
|
-
* @param children - Child elements
|
|
47
|
-
* @returns Flexium node
|
|
48
|
-
*/
|
|
49
|
-
declare function f(type: string | Function, props: Record<string, any> | null, ...children: any[]): FNode;
|
|
50
|
-
/**
|
|
51
|
-
* Fragment component
|
|
52
|
-
* Renders children without a wrapper element
|
|
53
|
-
*/
|
|
54
|
-
declare function Fragment(props: {
|
|
55
|
-
children?: any[];
|
|
56
|
-
}): FNode;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* DOM Render Function
|
|
60
|
-
*
|
|
61
|
-
* This module provides the main render function for mounting components to the DOM.
|
|
62
|
-
* It includes simple reconciliation logic for mounting and unmounting components.
|
|
63
|
-
*
|
|
64
|
-
* Note: This module uses reactive rendering internally via mountReactive.
|
|
65
|
-
* For root-level rendering with cleanup support, use createReactiveRoot.
|
|
66
|
-
*/
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Render a component to a DOM container with automatic reactivity
|
|
70
|
-
*
|
|
71
|
-
* This function uses reactive rendering by default, which means:
|
|
72
|
-
* - Signals passed as children automatically update the DOM
|
|
73
|
-
* - Signals in props automatically update element properties
|
|
74
|
-
* - Component functions automatically re-render when signals change
|
|
75
|
-
*
|
|
76
|
-
* @param vnode - Flexium node to render
|
|
77
|
-
* @returns The rendered DOM node
|
|
78
|
-
*
|
|
79
|
-
* @example
|
|
80
|
-
* const count = signal(0);
|
|
81
|
-
* render(f('div', {}, [count]), document.body);
|
|
82
|
-
* // The div will automatically update when count changes
|
|
83
|
-
*/
|
|
84
|
-
/**
|
|
85
|
-
* Mounts a Flexium node to a container
|
|
86
|
-
* @param node - Flexium node to render
|
|
87
|
-
* @param container - DOM element to mount to
|
|
88
|
-
*/
|
|
89
|
-
declare function render(node: FNode | string | number | null | undefined | Function, container: HTMLElement): Node | null;
|
|
90
|
-
/**
|
|
91
|
-
* Create a root for rendering with automatic reactivity
|
|
92
|
-
*
|
|
93
|
-
* This creates a root that supports fine-grained reactive updates.
|
|
94
|
-
* Signals are automatically tracked and only the affected DOM nodes are updated.
|
|
95
|
-
*
|
|
96
|
-
* @param container - DOM element to render into
|
|
97
|
-
* @returns Root object with render and unmount methods
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* const root = createRoot(document.body);
|
|
101
|
-
* const count = signal(0);
|
|
102
|
-
* root.render(f('div', {}, [count]));
|
|
103
|
-
* // Later: count.value++ will automatically update the DOM
|
|
104
|
-
*/
|
|
105
|
-
declare function createRoot(container: HTMLElement): {
|
|
106
|
-
render(node: FNode): void;
|
|
107
|
-
unmount(): void;
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Getter function that returns the current value (signal-like)
|
|
112
|
-
*/
|
|
113
|
-
type ItemsGetter<T> = () => T[];
|
|
114
|
-
/**
|
|
115
|
-
* Fixed-height item configuration
|
|
116
|
-
*/
|
|
117
|
-
interface FixedSizeConfig {
|
|
118
|
-
mode: 'fixed';
|
|
119
|
-
itemHeight: number;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Variable-height item configuration
|
|
123
|
-
*/
|
|
124
|
-
interface VariableSizeConfig {
|
|
125
|
-
mode: 'variable';
|
|
126
|
-
estimatedItemHeight: number;
|
|
127
|
-
getItemHeight?: (index: number, item: unknown) => number;
|
|
128
|
-
}
|
|
129
|
-
type SizeConfig = FixedSizeConfig | VariableSizeConfig;
|
|
130
|
-
/**
|
|
131
|
-
* List component marker
|
|
132
|
-
*/
|
|
133
|
-
interface ListComponent<T> {
|
|
134
|
-
[key: symbol]: true;
|
|
135
|
-
each: ItemsGetter<T>;
|
|
136
|
-
renderItem: (item: T, index: () => number) => FNode;
|
|
137
|
-
virtual: boolean;
|
|
138
|
-
height?: number | string;
|
|
139
|
-
width?: number | string;
|
|
140
|
-
itemSize?: number | SizeConfig;
|
|
141
|
-
overscan: number;
|
|
142
|
-
getKey?: (item: T, index: number) => string | number;
|
|
143
|
-
onScroll?: (scrollTop: number) => void;
|
|
144
|
-
onVisibleRangeChange?: (startIndex: number, endIndex: number) => void;
|
|
145
|
-
class?: string;
|
|
146
|
-
style?: Record<string, string | number>;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Reactive DOM Rendering
|
|
151
|
-
*
|
|
152
|
-
* Integrates the signal system with the DOM renderer to enable fine-grained
|
|
153
|
-
* reactive updates. Only the specific DOM nodes that depend on changed signals
|
|
154
|
-
* will be updated, without re-rendering the entire component tree.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* Mount a virtual node reactively to the DOM.
|
|
159
|
-
*
|
|
160
|
-
* This is the core rendering function that handles all node types:
|
|
161
|
-
* - FNodes (both built-in elements and function components)
|
|
162
|
-
* - Strings and numbers (text nodes)
|
|
163
|
-
* - Signals and computed values (reactive children)
|
|
164
|
-
* - StateValues from the state() API
|
|
165
|
-
* - ListComponents
|
|
166
|
-
* - Arrays and fragments
|
|
167
|
-
*
|
|
168
|
-
* Reactive values are automatically tracked and DOM updates occur
|
|
169
|
-
* only when the specific values change (fine-grained reactivity).
|
|
170
|
-
*
|
|
171
|
-
* @param vnode - The virtual node to mount
|
|
172
|
-
* @param container - Optional parent node to append to
|
|
173
|
-
* @returns The created DOM node, or null for empty/boolean values
|
|
174
|
-
*
|
|
175
|
-
* @example
|
|
176
|
-
* ```tsx
|
|
177
|
-
* // Mount a simple element
|
|
178
|
-
* const node = mountReactive(<div>Hello</div>, document.body)
|
|
179
|
-
*
|
|
180
|
-
* // Mount a reactive signal
|
|
181
|
-
* const count = signal(0)
|
|
182
|
-
* mountReactive(() => <span>{count.value}</span>, container)
|
|
183
|
-
* ```
|
|
184
|
-
*/
|
|
185
|
-
declare function mountReactive(node: FNode | string | number | boolean | StateValue<any> | null | undefined | Function | any[] | ListComponent<any>, container?: Node): Node | null;
|
|
186
|
-
declare function createReactiveRoot(container: HTMLElement): {
|
|
187
|
-
render(node: FNode): void;
|
|
188
|
-
unmount(): void;
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
interface PortalProps {
|
|
192
|
-
mount?: HTMLElement;
|
|
193
|
-
children: any;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* <Portal> component renders its children into a different part of the DOM.
|
|
197
|
-
* Useful for modals, tooltips, etc.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* <Portal mount={document.body}>
|
|
201
|
-
* <div class="modal">...</div>
|
|
202
|
-
* </Portal>
|
|
203
|
-
*/
|
|
204
|
-
declare function Portal(props: PortalProps): Comment | null;
|
|
205
|
-
|
|
206
|
-
export { DOMRenderer as D, Fragment as F, type ListComponent as L, Portal as P, createReactiveRoot as a, createRoot as c, domRenderer as d, f, mountReactive as m, render as r };
|