flexium 0.10.7 → 0.12.8

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.
Files changed (192) hide show
  1. package/README.md +10 -10
  2. package/dist/canvas.d.cts +83 -23
  3. package/dist/canvas.d.ts +83 -23
  4. package/dist/canvas.js +1 -1
  5. package/dist/canvas.js.map +1 -1
  6. package/dist/canvas.mjs +1 -1
  7. package/dist/canvas.mjs.map +1 -1
  8. package/dist/chunk-44RZHCII.mjs +2 -0
  9. package/dist/chunk-44RZHCII.mjs.map +1 -0
  10. package/dist/chunk-7BXR4ZFD.js +2 -0
  11. package/dist/chunk-7BXR4ZFD.js.map +1 -0
  12. package/dist/chunk-CPJRQL2C.mjs +2 -0
  13. package/dist/chunk-CPJRQL2C.mjs.map +1 -0
  14. package/dist/chunk-ENWGYQNU.js +2 -0
  15. package/dist/chunk-ENWGYQNU.js.map +1 -0
  16. package/dist/chunk-EXLNKYSH.js +2 -0
  17. package/dist/chunk-EXLNKYSH.js.map +1 -0
  18. package/dist/chunk-IA4FEBFE.js +2 -0
  19. package/dist/chunk-IA4FEBFE.js.map +1 -0
  20. package/dist/chunk-IOF6L2BT.mjs +2 -0
  21. package/dist/chunk-IOF6L2BT.mjs.map +1 -0
  22. package/dist/chunk-KBUONZI2.js +2 -0
  23. package/dist/chunk-KBUONZI2.js.map +1 -0
  24. package/dist/chunk-LUREDEUB.mjs +2 -0
  25. package/dist/chunk-LUREDEUB.mjs.map +1 -0
  26. package/dist/chunk-LUW7DIEW.js +2 -0
  27. package/dist/chunk-LUW7DIEW.js.map +1 -0
  28. package/dist/chunk-S6WF3XNF.mjs +2 -0
  29. package/dist/chunk-S6WF3XNF.mjs.map +1 -0
  30. package/dist/chunk-ZCO4NIGC.mjs +2 -0
  31. package/dist/chunk-ZCO4NIGC.mjs.map +1 -0
  32. package/dist/core.d.cts +41 -2
  33. package/dist/core.d.ts +41 -2
  34. package/dist/core.js +1 -1
  35. package/dist/core.mjs +1 -1
  36. package/dist/dom.d.cts +10 -33
  37. package/dist/dom.d.ts +10 -33
  38. package/dist/dom.js +1 -1
  39. package/dist/dom.js.map +1 -1
  40. package/dist/dom.mjs +1 -1
  41. package/dist/dom.mjs.map +1 -1
  42. package/dist/index.d.cts +1 -24
  43. package/dist/index.d.ts +1 -24
  44. package/dist/index.js +1 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/index.mjs +1 -1
  47. package/dist/index.mjs.map +1 -1
  48. package/dist/interactive.d.cts +65 -148
  49. package/dist/interactive.d.ts +65 -148
  50. package/dist/interactive.js +1 -1
  51. package/dist/interactive.js.map +1 -1
  52. package/dist/interactive.mjs +1 -1
  53. package/dist/interactive.mjs.map +1 -1
  54. package/dist/jsx-dev-runtime.d.cts +6 -2
  55. package/dist/jsx-dev-runtime.d.ts +6 -2
  56. package/dist/jsx-dev-runtime.js +1 -1
  57. package/dist/jsx-dev-runtime.js.map +1 -1
  58. package/dist/jsx-dev-runtime.mjs +1 -1
  59. package/dist/jsx-dev-runtime.mjs.map +1 -1
  60. package/dist/jsx-runtime.d.cts +6 -68
  61. package/dist/jsx-runtime.d.ts +6 -68
  62. package/dist/jsx-runtime.js +1 -1
  63. package/dist/jsx-runtime.mjs +1 -1
  64. package/dist/metafile-cjs.json +1 -1
  65. package/dist/metafile-esm.json +1 -1
  66. package/dist/router.d.cts +48 -15
  67. package/dist/router.d.ts +48 -15
  68. package/dist/router.js +1 -1
  69. package/dist/router.js.map +1 -1
  70. package/dist/router.mjs +1 -1
  71. package/dist/router.mjs.map +1 -1
  72. package/package.json +13 -53
  73. package/dist/DrawText-CVAKQ5wZ.d.cts +0 -309
  74. package/dist/DrawText-Dlh1L1Ar.d.ts +0 -309
  75. package/dist/Motion-BrOAJzgH.d.cts +0 -87
  76. package/dist/Motion-BrOAJzgH.d.ts +0 -87
  77. package/dist/advanced.d.cts +0 -32
  78. package/dist/advanced.d.ts +0 -32
  79. package/dist/advanced.js +0 -2
  80. package/dist/advanced.js.map +0 -1
  81. package/dist/advanced.mjs +0 -2
  82. package/dist/advanced.mjs.map +0 -1
  83. package/dist/chunk-5ICRQIS2.js +0 -3
  84. package/dist/chunk-5ICRQIS2.js.map +0 -1
  85. package/dist/chunk-5K55ASOD.mjs +0 -3
  86. package/dist/chunk-5K55ASOD.mjs.map +0 -1
  87. package/dist/chunk-AZEHBSBG.js +0 -3
  88. package/dist/chunk-AZEHBSBG.js.map +0 -1
  89. package/dist/chunk-BBNYMXE7.mjs +0 -2
  90. package/dist/chunk-BBNYMXE7.mjs.map +0 -1
  91. package/dist/chunk-BYHIHYRR.mjs +0 -2
  92. package/dist/chunk-BYHIHYRR.mjs.map +0 -1
  93. package/dist/chunk-DZ7L3SHV.js +0 -2
  94. package/dist/chunk-DZ7L3SHV.js.map +0 -1
  95. package/dist/chunk-ECYYIQEX.mjs +0 -3
  96. package/dist/chunk-ECYYIQEX.mjs.map +0 -1
  97. package/dist/chunk-FDMJHFN7.mjs +0 -2
  98. package/dist/chunk-FDMJHFN7.mjs.map +0 -1
  99. package/dist/chunk-GKJQEOP7.mjs +0 -2
  100. package/dist/chunk-GKJQEOP7.mjs.map +0 -1
  101. package/dist/chunk-GYDP6MFV.js +0 -3
  102. package/dist/chunk-GYDP6MFV.js.map +0 -1
  103. package/dist/chunk-HB5VPQTB.mjs +0 -2
  104. package/dist/chunk-HB5VPQTB.mjs.map +0 -1
  105. package/dist/chunk-KNF5ERPK.mjs +0 -2
  106. package/dist/chunk-KNF5ERPK.mjs.map +0 -1
  107. package/dist/chunk-OPAAGNBO.mjs +0 -2
  108. package/dist/chunk-OPAAGNBO.mjs.map +0 -1
  109. package/dist/chunk-OPAQ4R4M.mjs +0 -2
  110. package/dist/chunk-OPAQ4R4M.mjs.map +0 -1
  111. package/dist/chunk-Q7IWDVJ4.js +0 -2
  112. package/dist/chunk-Q7IWDVJ4.js.map +0 -1
  113. package/dist/chunk-QPCIDSMM.js +0 -2
  114. package/dist/chunk-QPCIDSMM.js.map +0 -1
  115. package/dist/chunk-QZIX4FXS.mjs +0 -2
  116. package/dist/chunk-QZIX4FXS.mjs.map +0 -1
  117. package/dist/chunk-RMN5IPS5.js +0 -2
  118. package/dist/chunk-RMN5IPS5.js.map +0 -1
  119. package/dist/chunk-U6C6VDVZ.js +0 -2
  120. package/dist/chunk-U6C6VDVZ.js.map +0 -1
  121. package/dist/chunk-WQFQO5LK.js +0 -2
  122. package/dist/chunk-WQFQO5LK.js.map +0 -1
  123. package/dist/chunk-WVEJT7HD.mjs +0 -2
  124. package/dist/chunk-WVEJT7HD.mjs.map +0 -1
  125. package/dist/chunk-WWEWRI6S.js +0 -2
  126. package/dist/chunk-WWEWRI6S.js.map +0 -1
  127. package/dist/chunk-XJHWMHKF.js +0 -2
  128. package/dist/chunk-XJHWMHKF.js.map +0 -1
  129. package/dist/chunk-Y6KKAHLS.mjs +0 -3
  130. package/dist/chunk-Y6KKAHLS.mjs.map +0 -1
  131. package/dist/chunk-YDZ37ZZ4.js +0 -2
  132. package/dist/chunk-YDZ37ZZ4.js.map +0 -1
  133. package/dist/chunk-YPVRQKMW.js +0 -2
  134. package/dist/chunk-YPVRQKMW.js.map +0 -1
  135. package/dist/components-BMbqsbMY.d.cts +0 -126
  136. package/dist/components-C83mBQXW.d.ts +0 -126
  137. package/dist/core-CxHP8991.d.cts +0 -32
  138. package/dist/core-D0ggvjX3.d.ts +0 -32
  139. package/dist/effect-554ONNZR.js +0 -2
  140. package/dist/effect-554ONNZR.js.map +0 -1
  141. package/dist/effect-T2GVIS3T.mjs +0 -2
  142. package/dist/effect-T2GVIS3T.mjs.map +0 -1
  143. package/dist/owner-QS9tPwPr.d.cts +0 -27
  144. package/dist/owner-QS9tPwPr.d.ts +0 -27
  145. package/dist/portal-BK_0Z0hE.d.cts +0 -206
  146. package/dist/portal-CbguxtuQ.d.ts +0 -206
  147. package/dist/primitives/layout.d.cts +0 -295
  148. package/dist/primitives/layout.d.ts +0 -295
  149. package/dist/primitives/layout.js +0 -2
  150. package/dist/primitives/layout.js.map +0 -1
  151. package/dist/primitives/layout.mjs +0 -2
  152. package/dist/primitives/layout.mjs.map +0 -1
  153. package/dist/primitives/motion.d.cts +0 -230
  154. package/dist/primitives/motion.d.ts +0 -230
  155. package/dist/primitives/motion.js +0 -2
  156. package/dist/primitives/motion.js.map +0 -1
  157. package/dist/primitives/motion.mjs +0 -2
  158. package/dist/primitives/motion.mjs.map +0 -1
  159. package/dist/primitives/ui.d.cts +0 -81
  160. package/dist/primitives/ui.d.ts +0 -81
  161. package/dist/primitives/ui.js +0 -2
  162. package/dist/primitives/ui.js.map +0 -1
  163. package/dist/primitives/ui.mjs +0 -2
  164. package/dist/primitives/ui.mjs.map +0 -1
  165. package/dist/primitives.d.cts +0 -93
  166. package/dist/primitives.d.ts +0 -93
  167. package/dist/primitives.js +0 -2
  168. package/dist/primitives.js.map +0 -1
  169. package/dist/primitives.mjs +0 -2
  170. package/dist/primitives.mjs.map +0 -1
  171. package/dist/renderer-DSLb-FGg.d.cts +0 -135
  172. package/dist/renderer-DSLb-FGg.d.ts +0 -135
  173. package/dist/server.d.cts +0 -3
  174. package/dist/server.d.ts +0 -3
  175. package/dist/server.js +0 -2
  176. package/dist/server.js.map +0 -1
  177. package/dist/server.mjs +0 -2
  178. package/dist/server.mjs.map +0 -1
  179. package/dist/state-DitsMyev.d.cts +0 -96
  180. package/dist/state-DitsMyev.d.ts +0 -96
  181. package/dist/state-RYKSC35A.mjs +0 -2
  182. package/dist/state-RYKSC35A.mjs.map +0 -1
  183. package/dist/state-XUXPMCFJ.js +0 -2
  184. package/dist/state-XUXPMCFJ.js.map +0 -1
  185. package/dist/sync-Z4QqUDjF.d.cts +0 -25
  186. package/dist/sync-Z4QqUDjF.d.ts +0 -25
  187. package/dist/test-exports.d.cts +0 -68
  188. package/dist/test-exports.d.ts +0 -68
  189. package/dist/test-exports.js +0 -2
  190. package/dist/test-exports.js.map +0 -1
  191. package/dist/test-exports.mjs +0 -2
  192. package/dist/test-exports.mjs.map +0 -1
@@ -1,126 +0,0 @@
1
- import { S as StateValue } from './state-DitsMyev.js';
2
- import { a as FNodeChild, F as FNode } from './renderer-DSLb-FGg.js';
3
-
4
- interface Location {
5
- pathname: string;
6
- search: string;
7
- hash: string;
8
- query: Record<string, string>;
9
- }
10
- interface RouterContext {
11
- location: StateValue<Location>;
12
- params: StateValue<Record<string, string>>;
13
- navigate: (path: string) => void;
14
- matches: StateValue<RouteMatch[]>;
15
- }
16
- interface RouteProps {
17
- path?: string;
18
- index?: boolean;
19
- component: Function;
20
- children?: FNodeChild;
21
- beforeEnter?: (params: Record<string, string>) => boolean | Promise<boolean>;
22
- }
23
- interface RouteMatch {
24
- route: RouteDef;
25
- params: Record<string, string>;
26
- pathname: string;
27
- }
28
- interface RouteDef {
29
- path: string;
30
- index: boolean;
31
- component: Function;
32
- children: RouteDef[];
33
- beforeEnter?: (params: Record<string, string>) => boolean | Promise<boolean>;
34
- }
35
- interface LinkProps {
36
- to: string;
37
- class?: string;
38
- children?: FNodeChild;
39
- }
40
-
41
- /**
42
- * Router Core Module
43
- *
44
- * Provides core routing functionality including location management,
45
- * path matching, and navigation.
46
- */
47
-
48
- /**
49
- * Creates a reactive location signal and navigate function.
50
- *
51
- * The location signal automatically updates when:
52
- * - navigate() is called
53
- * - Browser back/forward buttons are used (popstate event)
54
- *
55
- * @returns Tuple of [location signal, navigate function, cleanup function]
56
- *
57
- * @example
58
- * ```tsx
59
- * const [location, navigate, cleanup] = createLocation();
60
- * // Access current path
61
- * console.log(location().pathname);
62
- * // Navigate to new path
63
- * navigate('/users/123');
64
- * // Cleanup when done (removes popstate listener)
65
- * cleanup();
66
- * ```
67
- */
68
- declare function createLocation(): [StateValue<Location>, (path: string) => void, () => void];
69
- /**
70
- * Check if a path contains unsafe protocols (XSS prevention)
71
- * @param path - Path to validate
72
- * @returns true if path is unsafe
73
- */
74
- declare function isUnsafePath(path: string): boolean;
75
- /**
76
- * Sanitize query parameter value to prevent XSS
77
- * @param value - Query parameter value
78
- * @returns Sanitized value
79
- */
80
- declare function sanitizeQueryValue(value: string): string;
81
- /**
82
- * Matches a pathname against a route pattern.
83
- *
84
- * Supports dynamic segments with `:param` syntax.
85
- *
86
- * @param pathname - Current URL pathname (e.g., "/users/123")
87
- * @param routePath - Route pattern (e.g., "/users/:id")
88
- * @returns Object with `matches` boolean and extracted `params`
89
- *
90
- * @example
91
- * ```tsx
92
- * const result = matchPath('/users/123', '/users/:id');
93
- * // { matches: true, params: { id: '123' } }
94
- * ```
95
- */
96
- declare function matchPath(pathname: string, routePath: string): {
97
- matches: boolean;
98
- params: Record<string, string>;
99
- };
100
-
101
- /**
102
- * Get the current router context.
103
- * Must be called within a <Router> component.
104
- *
105
- * @example
106
- * ```tsx
107
- * const r = router()
108
- * r.navigate('/dashboard')
109
- * ```
110
- */
111
- declare function router(): RouterContext;
112
- declare function Router(props: {
113
- children: FNodeChild;
114
- }): () => FNode;
115
- /**
116
- * Route configuration component.
117
- * Doesn't render anything directly; used by Router to build the route tree.
118
- */
119
- declare function Route(_props: RouteProps): null;
120
- /**
121
- * Renders the child route content.
122
- */
123
- declare function Outlet(): (() => FNode | null) | null;
124
- declare function Link(props: LinkProps): FNode;
125
-
126
- export { type Location as L, Outlet as O, type RouteDef as R, type RouteMatch as a, type RouterContext as b, type RouteProps as c, type LinkProps as d, createLocation as e, Router as f, Route as g, Link as h, isUnsafePath as i, matchPath as m, router as r, sanitizeQueryValue as s };
@@ -1,32 +0,0 @@
1
- import './state-DitsMyev.cjs';
2
-
3
- /**
4
- * Creates a side effect that runs when dependencies change
5
- *
6
- * @param fn - Effect function, can return a cleanup function
7
- * @param options - Optional error handler
8
- * @returns Dispose function to stop the effect
9
- *
10
- * @example
11
- * ```ts
12
- * const [count, setCount] = state(0);
13
- *
14
- * effect(() => {
15
- * console.log(count());
16
- * });
17
- *
18
- * setCount(1); // logs: 1
19
- * ```
20
- */
21
- declare function effect(fn: () => void | (() => void), options?: {
22
- onError?: (error: Error) => void;
23
- name?: string;
24
- }): () => void;
25
- /**
26
- * Registers a cleanup function that runs before the current effect re-runs or is disposed
27
- *
28
- * @param fn - Cleanup function
29
- */
30
- declare function onCleanup(fn: () => void): void;
31
-
32
- export { effect as e, onCleanup as o };
@@ -1,32 +0,0 @@
1
- import './state-DitsMyev.js';
2
-
3
- /**
4
- * Creates a side effect that runs when dependencies change
5
- *
6
- * @param fn - Effect function, can return a cleanup function
7
- * @param options - Optional error handler
8
- * @returns Dispose function to stop the effect
9
- *
10
- * @example
11
- * ```ts
12
- * const [count, setCount] = state(0);
13
- *
14
- * effect(() => {
15
- * console.log(count());
16
- * });
17
- *
18
- * setCount(1); // logs: 1
19
- * ```
20
- */
21
- declare function effect(fn: () => void | (() => void), options?: {
22
- onError?: (error: Error) => void;
23
- name?: string;
24
- }): () => void;
25
- /**
26
- * Registers a cleanup function that runs before the current effect re-runs or is disposed
27
- *
28
- * @param fn - Cleanup function
29
- */
30
- declare function onCleanup(fn: () => void): void;
31
-
32
- export { effect as e, onCleanup as o };
@@ -1,2 +0,0 @@
1
- 'use strict';var chunkWWEWRI6S_js=require('./chunk-WWEWRI6S.js');require('./chunk-GYDP6MFV.js');Object.defineProperty(exports,"EffectNode",{enumerable:true,get:function(){return chunkWWEWRI6S_js.b}});Object.defineProperty(exports,"effect",{enumerable:true,get:function(){return chunkWWEWRI6S_js.c}});Object.defineProperty(exports,"onCleanup",{enumerable:true,get:function(){return chunkWWEWRI6S_js.d}});//# sourceMappingURL=effect-554ONNZR.js.map
2
- //# sourceMappingURL=effect-554ONNZR.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"effect-554ONNZR.js"}
@@ -1,2 +0,0 @@
1
- export{b as EffectNode,c as effect,d as onCleanup}from'./chunk-HB5VPQTB.mjs';import'./chunk-ECYYIQEX.mjs';//# sourceMappingURL=effect-T2GVIS3T.mjs.map
2
- //# sourceMappingURL=effect-T2GVIS3T.mjs.map
@@ -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 };
@@ -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 };