flexium 0.8.15 → 0.9.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.
Files changed (125) hide show
  1. package/dist/{DrawText-CeXBL8Ev.d.ts → DrawText-Bvzl40Vi.d.ts} +1 -1
  2. package/dist/{DrawText-JB58mpQT.d.cts → DrawText-CJikXQjL.d.cts} +1 -1
  3. package/dist/advanced.d.cts +3 -1
  4. package/dist/advanced.d.ts +3 -1
  5. package/dist/advanced.js +1 -1
  6. package/dist/advanced.mjs +1 -1
  7. package/dist/advanced.mjs.map +1 -1
  8. package/dist/canvas.d.cts +5 -3
  9. package/dist/canvas.d.ts +5 -3
  10. package/dist/canvas.js +1 -1
  11. package/dist/canvas.mjs +1 -1
  12. package/dist/chunk-2ZHUQBNI.mjs +2 -0
  13. package/dist/chunk-2ZHUQBNI.mjs.map +1 -0
  14. package/dist/{chunk-CNY6FPKJ.js → chunk-DFG62GKW.js} +2 -2
  15. package/dist/{chunk-CZYIK6FD.mjs.map → chunk-DFG62GKW.js.map} +1 -1
  16. package/dist/{chunk-ZNPYN2TZ.mjs → chunk-HDCPA76O.mjs} +2 -2
  17. package/dist/{chunk-ZNPYN2TZ.mjs.map → chunk-HDCPA76O.mjs.map} +1 -1
  18. package/dist/chunk-J4CK5NRW.mjs +3 -0
  19. package/dist/chunk-J4CK5NRW.mjs.map +1 -0
  20. package/dist/chunk-JEDCNAAI.mjs +3 -0
  21. package/dist/chunk-JEDCNAAI.mjs.map +1 -0
  22. package/dist/{chunk-DOGIWSDA.js → chunk-JHJHIMWD.js} +2 -2
  23. package/dist/{chunk-DOGIWSDA.js.map → chunk-JHJHIMWD.js.map} +1 -1
  24. package/dist/{chunk-GDBJ322I.js → chunk-L4C5UBOX.js} +2 -2
  25. package/dist/{chunk-GDBJ322I.js.map → chunk-L4C5UBOX.js.map} +1 -1
  26. package/dist/chunk-M4ANLZ6P.js +3 -0
  27. package/dist/chunk-M4ANLZ6P.js.map +1 -0
  28. package/dist/chunk-RDA77IE6.js +2 -0
  29. package/dist/chunk-RDA77IE6.js.map +1 -0
  30. package/dist/{chunk-CZYIK6FD.mjs → chunk-RUXAK74B.mjs} +2 -2
  31. package/dist/chunk-RUXAK74B.mjs.map +1 -0
  32. package/dist/chunk-TRIEKNVZ.mjs +2 -0
  33. package/dist/{chunk-MLZTCKTH.mjs.map → chunk-TRIEKNVZ.mjs.map} +1 -1
  34. package/dist/chunk-VIVO4FHN.js +3 -0
  35. package/dist/chunk-VIVO4FHN.js.map +1 -0
  36. package/dist/chunk-XLE6SMWX.mjs +3 -0
  37. package/dist/chunk-XLE6SMWX.mjs.map +1 -0
  38. package/dist/chunk-YGMMJWAA.js +3 -0
  39. package/dist/chunk-YGMMJWAA.js.map +1 -0
  40. package/dist/components-D4WeooPi.d.ts +126 -0
  41. package/dist/components-DZy2r6m5.d.cts +126 -0
  42. package/dist/core.d.cts +159 -15
  43. package/dist/core.d.ts +159 -15
  44. package/dist/core.js +1 -1
  45. package/dist/core.mjs +1 -1
  46. package/dist/dom.d.cts +2 -3
  47. package/dist/dom.d.ts +2 -3
  48. package/dist/dom.js +1 -1
  49. package/dist/dom.js.map +1 -1
  50. package/dist/dom.mjs +1 -1
  51. package/dist/dom.mjs.map +1 -1
  52. package/dist/effect-BlnnM1t5.d.cts +20 -0
  53. package/dist/effect-BlnnM1t5.d.ts +20 -0
  54. package/dist/index.d.cts +2 -2
  55. package/dist/index.d.ts +2 -2
  56. package/dist/index.js +1 -1
  57. package/dist/index.js.map +1 -1
  58. package/dist/index.mjs +1 -1
  59. package/dist/index.mjs.map +1 -1
  60. package/dist/interactive.d.cts +1 -1
  61. package/dist/interactive.d.ts +1 -1
  62. package/dist/interactive.js +1 -1
  63. package/dist/interactive.mjs +1 -1
  64. package/dist/interactive.mjs.map +1 -1
  65. package/dist/metafile-cjs.json +1 -1
  66. package/dist/metafile-esm.json +1 -1
  67. package/dist/owner-QS9tPwPr.d.cts +27 -0
  68. package/dist/owner-QS9tPwPr.d.ts +27 -0
  69. package/dist/{portal-DBwz7gD0.d.ts → portal-C3ESJhlv.d.ts} +1 -1
  70. package/dist/{portal-BpcIlK9y.d.cts → portal-CAEbiMUZ.d.cts} +1 -1
  71. package/dist/primitives/motion.js +1 -1
  72. package/dist/primitives/motion.mjs +1 -1
  73. package/dist/primitives/ui.d.cts +1 -1
  74. package/dist/primitives/ui.d.ts +1 -1
  75. package/dist/primitives/ui.js +1 -1
  76. package/dist/primitives/ui.mjs +1 -1
  77. package/dist/primitives/ui.mjs.map +1 -1
  78. package/dist/primitives.d.cts +6 -4
  79. package/dist/primitives.d.ts +6 -4
  80. package/dist/primitives.js +1 -1
  81. package/dist/primitives.mjs +1 -1
  82. package/dist/router.d.cts +11 -120
  83. package/dist/router.d.ts +11 -120
  84. package/dist/router.js +1 -1
  85. package/dist/router.mjs +1 -1
  86. package/dist/server.js +1 -1
  87. package/dist/server.mjs +1 -1
  88. package/dist/server.mjs.map +1 -1
  89. package/dist/signal-3YZHUCLL.js +2 -0
  90. package/dist/{signal-XZXQ4VYQ.js.map → signal-3YZHUCLL.js.map} +1 -1
  91. package/dist/signal-Dxh9PsKr.d.cts +69 -0
  92. package/dist/signal-Dxh9PsKr.d.ts +69 -0
  93. package/dist/signal-F2HEYB6F.mjs +2 -0
  94. package/dist/{signal-PWBIM6JV.mjs.map → signal-F2HEYB6F.mjs.map} +1 -1
  95. package/dist/sync-Z4QqUDjF.d.cts +25 -0
  96. package/dist/sync-Z4QqUDjF.d.ts +25 -0
  97. package/dist/test-exports.d.cts +29 -8
  98. package/dist/test-exports.d.ts +29 -8
  99. package/dist/test-exports.js +1 -1
  100. package/dist/test-exports.mjs +1 -1
  101. package/package.json +1 -1
  102. package/dist/chunk-2MVKTSFR.mjs +0 -3
  103. package/dist/chunk-2MVKTSFR.mjs.map +0 -1
  104. package/dist/chunk-2U4DW375.mjs +0 -2
  105. package/dist/chunk-2U4DW375.mjs.map +0 -1
  106. package/dist/chunk-5S3ZQ2LB.mjs +0 -3
  107. package/dist/chunk-5S3ZQ2LB.mjs.map +0 -1
  108. package/dist/chunk-CNY6FPKJ.js.map +0 -1
  109. package/dist/chunk-EX2GURH5.mjs +0 -3
  110. package/dist/chunk-EX2GURH5.mjs.map +0 -1
  111. package/dist/chunk-I7UCVARB.js +0 -2
  112. package/dist/chunk-I7UCVARB.js.map +0 -1
  113. package/dist/chunk-MLZTCKTH.mjs +0 -2
  114. package/dist/chunk-REETNY2Z.js +0 -3
  115. package/dist/chunk-REETNY2Z.js.map +0 -1
  116. package/dist/chunk-ROYFUJN5.js +0 -3
  117. package/dist/chunk-ROYFUJN5.js.map +0 -1
  118. package/dist/chunk-V4K6WOXN.js +0 -3
  119. package/dist/chunk-V4K6WOXN.js.map +0 -1
  120. package/dist/signal-PWBIM6JV.mjs +0 -2
  121. package/dist/signal-XZXQ4VYQ.js +0 -2
  122. package/dist/signal-mNtlF8-v.d.cts +0 -158
  123. package/dist/signal-mNtlF8-v.d.ts +0 -158
  124. package/dist/state-kK9sQh9s.d.cts +0 -73
  125. package/dist/state-kK9sQh9s.d.ts +0 -73
package/dist/router.d.cts CHANGED
@@ -1,126 +1,17 @@
1
- import { S as Signal, C as Computed } from './signal-mNtlF8-v.cjs';
2
- import { a as FNodeChild, F as FNode } from './renderer-DSLb-FGg.cjs';
1
+ import { R as RouteDef, a as RouteMatch } from './components-DZy2r6m5.cjs';
2
+ export { h as Link, d as LinkProps, L as Location, O as Outlet, g as Route, c as RouteProps, f as Router, b as RouterContext, e as createLocation, i as isUnsafePath, m as matchPath, r as router, s as sanitizeQueryValue } from './components-DZy2r6m5.cjs';
3
+ import { a as FNodeChild } from './renderer-DSLb-FGg.cjs';
4
+ import './signal-Dxh9PsKr.cjs';
3
5
 
4
- interface Location {
5
- pathname: string;
6
- search: string;
7
- hash: string;
8
- query: Record<string, string>;
9
- }
10
- interface RouterContext {
11
- location: Signal<Location> | Computed<Location>;
12
- params: Signal<Record<string, string>> | Computed<Record<string, string>>;
13
- navigate: (path: string) => void;
14
- matches: Signal<RouteMatch[]> | Computed<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(): [Signal<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
6
  /**
116
- * Route configuration component.
117
- * Doesn't render anything directly; used by Router to build the route tree.
7
+ * Flatten the children of <Router> or <Route> into a route configuration tree.
8
+ * Note: This assumes `children` are FNodes representing <Route> components.
118
9
  */
119
- declare function Route(_props: RouteProps): null;
10
+ declare function createRoutesFromChildren(children: FNodeChild): RouteDef[];
120
11
  /**
121
- * Renders the child route content.
12
+ * Match a URL against a route tree.
13
+ * Returns an array of matches (from root to leaf).
122
14
  */
123
- declare function Outlet(): (() => FNode | null) | null;
124
- declare function Link(props: LinkProps): FNode;
15
+ declare function matchRoutes(routes: RouteDef[], location: string): RouteMatch[] | null;
125
16
 
126
- export { Link, type LinkProps, type Location, Outlet, Route, type RouteDef, type RouteMatch, type RouteProps, Router, type RouterContext, createLocation, isUnsafePath, matchPath, router, sanitizeQueryValue };
17
+ export { RouteDef, RouteMatch, createRoutesFromChildren, matchRoutes };
package/dist/router.d.ts CHANGED
@@ -1,126 +1,17 @@
1
- import { S as Signal, C as Computed } from './signal-mNtlF8-v.js';
2
- import { a as FNodeChild, F as FNode } from './renderer-DSLb-FGg.js';
1
+ import { R as RouteDef, a as RouteMatch } from './components-D4WeooPi.js';
2
+ export { h as Link, d as LinkProps, L as Location, O as Outlet, g as Route, c as RouteProps, f as Router, b as RouterContext, e as createLocation, i as isUnsafePath, m as matchPath, r as router, s as sanitizeQueryValue } from './components-D4WeooPi.js';
3
+ import { a as FNodeChild } from './renderer-DSLb-FGg.js';
4
+ import './signal-Dxh9PsKr.js';
3
5
 
4
- interface Location {
5
- pathname: string;
6
- search: string;
7
- hash: string;
8
- query: Record<string, string>;
9
- }
10
- interface RouterContext {
11
- location: Signal<Location> | Computed<Location>;
12
- params: Signal<Record<string, string>> | Computed<Record<string, string>>;
13
- navigate: (path: string) => void;
14
- matches: Signal<RouteMatch[]> | Computed<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(): [Signal<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
6
  /**
116
- * Route configuration component.
117
- * Doesn't render anything directly; used by Router to build the route tree.
7
+ * Flatten the children of <Router> or <Route> into a route configuration tree.
8
+ * Note: This assumes `children` are FNodes representing <Route> components.
118
9
  */
119
- declare function Route(_props: RouteProps): null;
10
+ declare function createRoutesFromChildren(children: FNodeChild): RouteDef[];
120
11
  /**
121
- * Renders the child route content.
12
+ * Match a URL against a route tree.
13
+ * Returns an array of matches (from root to leaf).
122
14
  */
123
- declare function Outlet(): (() => FNode | null) | null;
124
- declare function Link(props: LinkProps): FNode;
15
+ declare function matchRoutes(routes: RouteDef[], location: string): RouteMatch[] | null;
125
16
 
126
- export { Link, type LinkProps, type Location, Outlet, Route, type RouteDef, type RouteMatch, type RouteProps, Router, type RouterContext, createLocation, isUnsafePath, matchPath, router, sanitizeQueryValue };
17
+ export { RouteDef, RouteMatch, createRoutesFromChildren, matchRoutes };
package/dist/router.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkV4K6WOXN_js=require('./chunk-V4K6WOXN.js');require('./chunk-CNY6FPKJ.js'),require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js'),require('./chunk-ROYFUJN5.js');Object.defineProperty(exports,"Link",{enumerable:true,get:function(){return chunkV4K6WOXN_js.i}});Object.defineProperty(exports,"Outlet",{enumerable:true,get:function(){return chunkV4K6WOXN_js.h}});Object.defineProperty(exports,"Route",{enumerable:true,get:function(){return chunkV4K6WOXN_js.g}});Object.defineProperty(exports,"Router",{enumerable:true,get:function(){return chunkV4K6WOXN_js.f}});Object.defineProperty(exports,"createLocation",{enumerable:true,get:function(){return chunkV4K6WOXN_js.a}});Object.defineProperty(exports,"isUnsafePath",{enumerable:true,get:function(){return chunkV4K6WOXN_js.b}});Object.defineProperty(exports,"matchPath",{enumerable:true,get:function(){return chunkV4K6WOXN_js.d}});Object.defineProperty(exports,"router",{enumerable:true,get:function(){return chunkV4K6WOXN_js.e}});Object.defineProperty(exports,"sanitizeQueryValue",{enumerable:true,get:function(){return chunkV4K6WOXN_js.c}});//# sourceMappingURL=router.js.map
1
+ 'use strict';var chunkM4ANLZ6P_js=require('./chunk-M4ANLZ6P.js');require('./chunk-DFG62GKW.js'),require('./chunk-Q7IWDVJ4.js'),require('./chunk-WQFQO5LK.js'),require('./chunk-YGMMJWAA.js');Object.defineProperty(exports,"Link",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.k}});Object.defineProperty(exports,"Outlet",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.j}});Object.defineProperty(exports,"Route",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.i}});Object.defineProperty(exports,"Router",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.h}});Object.defineProperty(exports,"createLocation",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.a}});Object.defineProperty(exports,"createRoutesFromChildren",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.e}});Object.defineProperty(exports,"isUnsafePath",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.b}});Object.defineProperty(exports,"matchPath",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.d}});Object.defineProperty(exports,"matchRoutes",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.f}});Object.defineProperty(exports,"router",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.g}});Object.defineProperty(exports,"sanitizeQueryValue",{enumerable:true,get:function(){return chunkM4ANLZ6P_js.c}});//# sourceMappingURL=router.js.map
2
2
  //# sourceMappingURL=router.js.map
package/dist/router.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export{i as Link,h as Outlet,g as Route,f as Router,a as createLocation,b as isUnsafePath,d as matchPath,e as router,c as sanitizeQueryValue}from'./chunk-2MVKTSFR.mjs';import'./chunk-CZYIK6FD.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';import'./chunk-5S3ZQ2LB.mjs';//# sourceMappingURL=router.mjs.map
1
+ export{k as Link,j as Outlet,i as Route,h as Router,a as createLocation,e as createRoutesFromChildren,b as isUnsafePath,d as matchPath,f as matchRoutes,g as router,c as sanitizeQueryValue}from'./chunk-XLE6SMWX.mjs';import'./chunk-RUXAK74B.mjs';import'./chunk-WVEJT7HD.mjs';import'./chunk-KNF5ERPK.mjs';import'./chunk-J4CK5NRW.mjs';//# sourceMappingURL=router.mjs.map
2
2
  //# sourceMappingURL=router.mjs.map
package/dist/server.js CHANGED
@@ -1,2 +1,2 @@
1
- 'use strict';var chunkROYFUJN5_js=require('./chunk-ROYFUJN5.js');var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(chunkROYFUJN5_js.n(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}exports.renderToString=s;//# sourceMappingURL=server.js.map
1
+ 'use strict';var chunkYGMMJWAA_js=require('./chunk-YGMMJWAA.js');var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(chunkYGMMJWAA_js.l(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}exports.renderToString=s;//# sourceMappingURL=server.js.map
2
2
  //# sourceMappingURL=server.js.map
package/dist/server.mjs CHANGED
@@ -1,2 +1,2 @@
1
- import {n}from'./chunk-5S3ZQ2LB.mjs';var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(n(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}export{s as renderToString};//# sourceMappingURL=server.mjs.map
1
+ import {l as l$1}from'./chunk-J4CK5NRW.mjs';var g=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function s(r){if(r==null||r===false)return "";if(typeof r=="string"||typeof r=="number")return l(String(r));if(Array.isArray(r))return r.map(s).join("");if(l$1(r))return s(r.value);if(r.type===null||r.type==="fragment"){let t=r.children||r.props?.children;return t?Array.isArray(t)?t.map(s).join(""):s(t):""}if(typeof r.type=="function"){let t=r.type({...r.props,children:r.children});return s(t)}if(typeof r.type=="string"){let{type:t,props:c,children:a}=r,e=`<${t}`;if(c)for(let i in c){let n=c[i];if(!(i==="children"||i.startsWith("on")||n===null||n===void 0||n===false)&&/^[a-zA-Z0-9-:]+$/.test(i))if(i==="className"||i==="class")e+=` class="${l(n)}"`;else if(i==="style"&&typeof n=="object"){let f=Object.entries(n).map(([u,y])=>`${u.replace(/([A-Z])/g,"-$1").toLowerCase()}:${y}`).join(";");e+=` style="${l(f)}"`;}else e+=` ${i}="${l(String(n))}"`;}return g.has(t)?e+="/>":(e+=">",a&&(e+=Array.isArray(a)?a.map(s).join(""):s(a)),e+=`</${t}>`),e}return ""}function l(r){return r.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}export{s as renderToString};//# sourceMappingURL=server.mjs.map
2
2
  //# sourceMappingURL=server.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/server/index.ts"],"names":["VOID_ELEMENTS","renderToString","node","escapeHtml","isSignal","children","result","type","props","html","key","value","styleStr","k","v","str"],"mappings":"qCAEA,IAAMA,CAAAA,CAAgB,IAAI,GAAA,CAAI,CAC5B,OACA,MAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,MAAA,CACA,OACA,OAAA,CACA,QAAA,CACA,OAAA,CACA,KACF,CAAC,CAAA,CAGM,SAASC,CAAAA,CAAeC,EAAmB,CAChD,GAAIA,CAAAA,EAAS,IAAA,EAA8BA,IAAS,KAAA,CAClD,OAAO,EAAA,CAGT,GAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAC9C,OAAOC,CAAAA,CAAW,MAAA,CAAOD,CAAI,CAAC,CAAA,CAGhC,GAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CACpB,OAAOA,EAAK,GAAA,CAAID,CAAc,CA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AAA,CAAQ,KAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B","file":"server.mjs","sourcesContent":["import { isSignal } from '../core/signal'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function renderToString(node: any): string {\n if (node === null || node === undefined || node === false) {\n return ''\n }\n\n if (typeof node === 'string' || typeof node === 'number') {\n return escapeHtml(String(node))\n }\n\n if (Array.isArray(node)) {\n return node.map(renderToString).join('')\n }\n\n if (isSignal(node)) {\n return renderToString(node.value)\n }\n\n // Handle fragments (type === null or type === 'fragment')\n if (node.type === null || node.type === 'fragment') {\n const children = node.children || node.props?.children\n if (children) {\n return Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n return ''\n }\n\n if (typeof node.type === 'function') {\n const result = node.type({ ...node.props, children: node.children })\n return renderToString(result)\n }\n\n if (typeof node.type === 'string') {\n const { type, props, children } = node\n let html = `<${type}`\n\n if (props) {\n for (const key in props) {\n const value = props[key]\n if (\n key === 'children' ||\n key.startsWith('on') ||\n value === null ||\n value === undefined ||\n value === false\n ) {\n continue\n }\n\n // Security: Validate attribute name to prevent injection\n // Only allow alphanumeric, hyphens, and colons\n if (!/^[a-zA-Z0-9-:]+$/.test(key)) {\n continue\n }\n\n if (key === 'className' || key === 'class') {\n html += ` class=\"${escapeHtml(value)}\"`\n } else if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .map(\n ([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}:${v}`\n )\n .join(';')\n html += ` style=\"${escapeHtml(styleStr)}\"`\n } else {\n html += ` ${key}=\"${escapeHtml(String(value))}\"`\n }\n }\n }\n\n if (VOID_ELEMENTS.has(type)) {\n html += '/>'\n } else {\n html += '>'\n if (children) {\n html += Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n html += `</${type}>`\n }\n\n return html\n }\n\n return ''\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;')\n}\n"]}
1
+ {"version":3,"sources":["../src/server/index.ts"],"names":["VOID_ELEMENTS","renderToString","node","escapeHtml","isSignal","children","result","type","props","html","key","value","styleStr","k","v","str"],"mappings":"4CAEA,IAAMA,CAAAA,CAAgB,IAAI,GAAA,CAAI,CAC5B,OACA,MAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,IAAA,CACA,KAAA,CACA,OAAA,CACA,MAAA,CACA,OACA,OAAA,CACA,QAAA,CACA,OAAA,CACA,KACF,CAAC,CAAA,CAGM,SAASC,CAAAA,CAAeC,EAAmB,CAChD,GAAIA,CAAAA,EAAS,IAAA,EAA8BA,IAAS,KAAA,CAClD,OAAO,EAAA,CAGT,GAAI,OAAOA,CAAAA,EAAS,QAAA,EAAY,OAAOA,CAAAA,EAAS,QAAA,CAC9C,OAAOC,CAAAA,CAAW,MAAA,CAAOD,CAAI,CAAC,CAAA,CAGhC,GAAI,KAAA,CAAM,OAAA,CAAQA,CAAI,CAAA,CACpB,OAAOA,EAAK,GAAA,CAAID,CAAc,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CAGzC,GAAIG,GAAAA,CAASF,CAAI,CAAA,CACf,OAAOD,CAAAA,CAAeC,CAAAA,CAAK,KAAK,CAAA,CAIlC,GAAIA,CAAAA,CAAK,IAAA,GAAS,MAAQA,CAAAA,CAAK,IAAA,GAAS,UAAA,CAAY,CAClD,IAAMG,CAAAA,CAAWH,CAAAA,CAAK,QAAA,EAAYA,EAAK,KAAA,EAAO,QAAA,CAC9C,OAAIG,CAAAA,CACK,KAAA,CAAM,OAAA,CAAQA,CAAQ,CAA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AAE,OAAA,CAAQ,UAAA,CAAY,KAAK,CAAA,CAAE,aAAa,CAAA,CAAA,EAAIC,CAAC,CAAA,CAChE,EACC,IAAA,CAAK,GAAG,CAAA,CACXL,CAAAA,EAAQ,WAAWN,CAAAA,CAAWS,CAAQ,CAAC,CAAA,CAAA,EACzC,CAAA,KACEH,CAAAA,EAAQ,CAAA,CAAA,EAAIC,CAAG,KAAKP,CAAAA,CAAW,MAAA,CAAOQ,CAAK,CAAC,CAAC,CAAA,CAAA,EAEjD,CAGF,OAAIX,EAAc,GAAA,CAAIO,CAAI,CAAA,CACxBE,CAAAA,EAAQ,IAAA,EAERA,CAAAA,EAAQ,GAAA,CACJJ,CAAAA,GACFI,GAAQ,KAAA,CAAM,OAAA,CAAQJ,CAAQ,CAAA,CAC1BA,EAAS,GAAA,CAAIJ,CAAc,CAAA,CAAE,IAAA,CAAK,EAAE,CAAA,CACpCA,CAAAA,CAAeI,CAAQ,CAAA,CAAA,CAE7BI,CAAAA,EAAQ,CAAA,EAAA,EAAKF,CAAI,CAAA,CAAA,CAAA,CAAA,CAGZE,CACT,CAEA,OAAO,EACT,CAEA,SAASN,CAAAA,CAAWY,CAAAA,CAAqB,CACvC,OAAOA,EACJ,OAAA,CAAQ,IAAA,CAAM,OAAO,CAAA,CACrB,OAAA,CAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,QAAQ,IAAA,CAAM,MAAM,CAAA,CACpB,OAAA,CAAQ,KAAM,QAAQ,CAAA,CACtB,OAAA,CAAQ,IAAA,CAAM,QAAQ,CAC3B","file":"server.mjs","sourcesContent":["import { isSignal } from '../core/signal'\n\nconst VOID_ELEMENTS = new Set([\n 'area',\n 'base',\n 'br',\n 'col',\n 'embed',\n 'hr',\n 'img',\n 'input',\n 'link',\n 'meta',\n 'param',\n 'source',\n 'track',\n 'wbr',\n])\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function renderToString(node: any): string {\n if (node === null || node === undefined || node === false) {\n return ''\n }\n\n if (typeof node === 'string' || typeof node === 'number') {\n return escapeHtml(String(node))\n }\n\n if (Array.isArray(node)) {\n return node.map(renderToString).join('')\n }\n\n if (isSignal(node)) {\n return renderToString(node.value)\n }\n\n // Handle fragments (type === null or type === 'fragment')\n if (node.type === null || node.type === 'fragment') {\n const children = node.children || node.props?.children\n if (children) {\n return Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n return ''\n }\n\n if (typeof node.type === 'function') {\n const result = node.type({ ...node.props, children: node.children })\n return renderToString(result)\n }\n\n if (typeof node.type === 'string') {\n const { type, props, children } = node\n let html = `<${type}`\n\n if (props) {\n for (const key in props) {\n const value = props[key]\n if (\n key === 'children' ||\n key.startsWith('on') ||\n value === null ||\n value === undefined ||\n value === false\n ) {\n continue\n }\n\n // Security: Validate attribute name to prevent injection\n // Only allow alphanumeric, hyphens, and colons\n if (!/^[a-zA-Z0-9-:]+$/.test(key)) {\n continue\n }\n\n if (key === 'className' || key === 'class') {\n html += ` class=\"${escapeHtml(value)}\"`\n } else if (key === 'style' && typeof value === 'object') {\n const styleStr = Object.entries(value)\n .map(\n ([k, v]) => `${k.replace(/([A-Z])/g, '-$1').toLowerCase()}:${v}`\n )\n .join(';')\n html += ` style=\"${escapeHtml(styleStr)}\"`\n } else {\n html += ` ${key}=\"${escapeHtml(String(value))}\"`\n }\n }\n }\n\n if (VOID_ELEMENTS.has(type)) {\n html += '/>'\n } else {\n html += '>'\n if (children) {\n html += Array.isArray(children)\n ? children.map(renderToString).join('')\n : renderToString(children)\n }\n html += `</${type}>`\n }\n\n return html\n }\n\n return ''\n}\n\nfunction escapeHtml(str: string): string {\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#039;')\n}\n"]}
@@ -0,0 +1,2 @@
1
+ 'use strict';var chunkYGMMJWAA_js=require('./chunk-YGMMJWAA.js');Object.defineProperty(exports,"computed",{enumerable:true,get:function(){return chunkYGMMJWAA_js.k}});Object.defineProperty(exports,"createResource",{enumerable:true,get:function(){return chunkYGMMJWAA_js.n}});Object.defineProperty(exports,"effect",{enumerable:true,get:function(){return chunkYGMMJWAA_js.h}});Object.defineProperty(exports,"isSignal",{enumerable:true,get:function(){return chunkYGMMJWAA_js.l}});Object.defineProperty(exports,"onCleanup",{enumerable:true,get:function(){return chunkYGMMJWAA_js.m}});Object.defineProperty(exports,"root",{enumerable:true,get:function(){return chunkYGMMJWAA_js.f}});Object.defineProperty(exports,"setDevToolsHooks",{enumerable:true,get:function(){return chunkYGMMJWAA_js.i}});Object.defineProperty(exports,"signal",{enumerable:true,get:function(){return chunkYGMMJWAA_js.j}});Object.defineProperty(exports,"untrack",{enumerable:true,get:function(){return chunkYGMMJWAA_js.d}});//# sourceMappingURL=signal-3YZHUCLL.js.map
2
+ //# sourceMappingURL=signal-3YZHUCLL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"signal-XZXQ4VYQ.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"signal-3YZHUCLL.js"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Base interface for reactive signals
3
+ * @internal
4
+ */
5
+ interface Signal<T> {
6
+ value: T;
7
+ (): T;
8
+ set(value: T): void;
9
+ peek(): T;
10
+ }
11
+ /**
12
+ * Computed signal interface (read-only)
13
+ * @internal
14
+ */
15
+ interface Computed<T> {
16
+ readonly value: T;
17
+ (): T;
18
+ peek(): T;
19
+ }
20
+ /**
21
+ * Creates a reactive signal
22
+ *
23
+ * @param initialValue - The initial value of the signal
24
+ * @returns A signal object with value getter/setter
25
+ *
26
+ * @example
27
+ * const count = signal(0);
28
+ * count.value++; // triggers subscribers
29
+ * console.log(count()); // alternative getter syntax
30
+ */
31
+ declare function signal<T>(initialValue: T): Signal<T>;
32
+ /**
33
+ * Creates a computed signal (derived value)
34
+ * @internal Use `state(() => ...)` instead
35
+ */
36
+ declare function computed<T>(fn: () => T): Computed<T>;
37
+ /**
38
+ * Check if a value is a signal
39
+ * @internal Use state() which handles all reactive patterns
40
+ */
41
+ declare function isSignal(value: unknown): value is Signal<any> | Computed<any>;
42
+ /**
43
+ * Registers a cleanup function that runs before the current effect re-runs or is disposed
44
+ *
45
+ * @param fn - Cleanup function
46
+ */
47
+ declare function onCleanup(fn: () => void): void;
48
+ /**
49
+ * Resource interface for async data
50
+ */
51
+ interface Resource<T> extends Signal<T | undefined> {
52
+ loading: boolean;
53
+ error: any;
54
+ state: 'unresolved' | 'pending' | 'ready' | 'refreshing' | 'errored';
55
+ latest: T | undefined;
56
+ }
57
+ /**
58
+ * Creates a resource for handling async data
59
+ * @internal Use state(async () => ...) instead which returns [data, refetch, status, error]
60
+ */
61
+ declare function createResource<T, S = any>(source: S | Signal<S> | (() => S), fetcher: (source: S, { value, refetching }: {
62
+ value: T | undefined;
63
+ refetching: any;
64
+ }) => Promise<T>): [Resource<T>, {
65
+ mutate: (v: T | undefined) => void;
66
+ refetch: () => void;
67
+ }];
68
+
69
+ export { type Computed as C, type Signal as S, createResource as a, computed as c, isSignal as i, onCleanup as o, signal as s };
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Base interface for reactive signals
3
+ * @internal
4
+ */
5
+ interface Signal<T> {
6
+ value: T;
7
+ (): T;
8
+ set(value: T): void;
9
+ peek(): T;
10
+ }
11
+ /**
12
+ * Computed signal interface (read-only)
13
+ * @internal
14
+ */
15
+ interface Computed<T> {
16
+ readonly value: T;
17
+ (): T;
18
+ peek(): T;
19
+ }
20
+ /**
21
+ * Creates a reactive signal
22
+ *
23
+ * @param initialValue - The initial value of the signal
24
+ * @returns A signal object with value getter/setter
25
+ *
26
+ * @example
27
+ * const count = signal(0);
28
+ * count.value++; // triggers subscribers
29
+ * console.log(count()); // alternative getter syntax
30
+ */
31
+ declare function signal<T>(initialValue: T): Signal<T>;
32
+ /**
33
+ * Creates a computed signal (derived value)
34
+ * @internal Use `state(() => ...)` instead
35
+ */
36
+ declare function computed<T>(fn: () => T): Computed<T>;
37
+ /**
38
+ * Check if a value is a signal
39
+ * @internal Use state() which handles all reactive patterns
40
+ */
41
+ declare function isSignal(value: unknown): value is Signal<any> | Computed<any>;
42
+ /**
43
+ * Registers a cleanup function that runs before the current effect re-runs or is disposed
44
+ *
45
+ * @param fn - Cleanup function
46
+ */
47
+ declare function onCleanup(fn: () => void): void;
48
+ /**
49
+ * Resource interface for async data
50
+ */
51
+ interface Resource<T> extends Signal<T | undefined> {
52
+ loading: boolean;
53
+ error: any;
54
+ state: 'unresolved' | 'pending' | 'ready' | 'refreshing' | 'errored';
55
+ latest: T | undefined;
56
+ }
57
+ /**
58
+ * Creates a resource for handling async data
59
+ * @internal Use state(async () => ...) instead which returns [data, refetch, status, error]
60
+ */
61
+ declare function createResource<T, S = any>(source: S | Signal<S> | (() => S), fetcher: (source: S, { value, refetching }: {
62
+ value: T | undefined;
63
+ refetching: any;
64
+ }) => Promise<T>): [Resource<T>, {
65
+ mutate: (v: T | undefined) => void;
66
+ refetch: () => void;
67
+ }];
68
+
69
+ export { type Computed as C, type Signal as S, createResource as a, computed as c, isSignal as i, onCleanup as o, signal as s };
@@ -0,0 +1,2 @@
1
+ export{k as computed,n as createResource,h as effect,l as isSignal,m as onCleanup,f as root,i as setDevToolsHooks,j as signal,d as untrack}from'./chunk-J4CK5NRW.mjs';//# sourceMappingURL=signal-F2HEYB6F.mjs.map
2
+ //# sourceMappingURL=signal-F2HEYB6F.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"signal-PWBIM6JV.mjs"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"signal-F2HEYB6F.mjs"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Synchronizes state updates.
3
+ *
4
+ * - `sync()`: Force flushes any pending auto-batched effects.
5
+ * - `sync(fn)`: Batches updates within `fn`, then flushes them and any pending effects synchronously.
6
+ *
7
+ * @param fn - Optional function containing state updates
8
+ * @returns The return value of fn, if provided
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * // 1. Force flush pending effects
13
+ * count.value++
14
+ * sync() // DOM is now updated
15
+ *
16
+ * // 2. Batch updates and flush immediately
17
+ * sync(() => {
18
+ * count.value = 1
19
+ * name.value = 'Bob'
20
+ * }) // Effects run once here, DOM updated
21
+ * ```
22
+ */
23
+ declare function sync<T>(fn?: () => T): T | void;
24
+
25
+ export { sync as s };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Synchronizes state updates.
3
+ *
4
+ * - `sync()`: Force flushes any pending auto-batched effects.
5
+ * - `sync(fn)`: Batches updates within `fn`, then flushes them and any pending effects synchronously.
6
+ *
7
+ * @param fn - Optional function containing state updates
8
+ * @returns The return value of fn, if provided
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * // 1. Force flush pending effects
13
+ * count.value++
14
+ * sync() // DOM is now updated
15
+ *
16
+ * // 2. Batch updates and flush immediately
17
+ * sync(() => {
18
+ * count.value = 1
19
+ * name.value = 'Bob'
20
+ * }) // Effects run once here, DOM updated
21
+ * ```
22
+ */
23
+ declare function sync<T>(fn?: () => T): T | void;
24
+
25
+ export { sync as s };
@@ -1,11 +1,13 @@
1
- export { d as batch, c as computed, a as createResource, e as effect, i as isSignal, o as onCleanup, b as onMount, r as root, s as signal, u as untrack } from './signal-mNtlF8-v.cjs';
2
- export { _ as state } from './state-kK9sQh9s.cjs';
3
- export { context, createContext } from './core.cjs';
4
- export { Link, Outlet, Route, Router, createLocation, matchPath, router } from './router.cjs';
5
- import { L as ListComponent } from './portal-BpcIlK9y.cjs';
6
- export { P as Portal, a as createReactiveRoot, d as domRenderer, f, r as render } from './portal-BpcIlK9y.cjs';
1
+ export { c as computed, a as createResource, i as isSignal, o as onCleanup, s as signal } from './signal-Dxh9PsKr.cjs';
2
+ export { s as sync } from './sync-Z4QqUDjF.cjs';
3
+ export { state } from './core.cjs';
4
+ import { a as FNodeChild } from './renderer-DSLb-FGg.cjs';
5
+ export { h as Link, O as Outlet, g as Route, f as Router, e as createLocation, m as matchPath, r as router } from './components-DZy2r6m5.cjs';
6
+ import { L as ListComponent } from './portal-CAEbiMUZ.cjs';
7
+ export { P as Portal, a as createReactiveRoot, d as domRenderer, f, r as render } from './portal-CAEbiMUZ.cjs';
7
8
  export { c as cleanupMotionState } from './Motion-BrOAJzgH.cjs';
8
- import './renderer-DSLb-FGg.cjs';
9
+ export { e as effect } from './effect-BlnnM1t5.cjs';
10
+ export { r as root, u as untrack } from './owner-QS9tPwPr.cjs';
9
11
 
10
12
  /** Marker symbol for List components */
11
13
  declare const LIST_MARKER: unique symbol;
@@ -14,4 +16,23 @@ declare const LIST_MARKER: unique symbol;
14
16
  */
15
17
  declare function isListComponent<T>(value: unknown): value is ListComponent<T>;
16
18
 
17
- export { LIST_MARKER, isListComponent };
19
+ interface Context<T> {
20
+ id: symbol;
21
+ Provider: (props: {
22
+ value: T;
23
+ children: FNodeChild;
24
+ }) => FNodeChild;
25
+ defaultValue: T;
26
+ }
27
+ declare function createContext<T>(defaultValue: T): Context<T>;
28
+ /**
29
+ * Get the current value from a context.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * const theme = context(ThemeContext)
34
+ * ```
35
+ */
36
+ declare function context<T>(ctx: Context<T>): T;
37
+
38
+ export { LIST_MARKER, context, createContext, isListComponent };
@@ -1,11 +1,13 @@
1
- export { d as batch, c as computed, a as createResource, e as effect, i as isSignal, o as onCleanup, b as onMount, r as root, s as signal, u as untrack } from './signal-mNtlF8-v.js';
2
- export { _ as state } from './state-kK9sQh9s.js';
3
- export { context, createContext } from './core.js';
4
- export { Link, Outlet, Route, Router, createLocation, matchPath, router } from './router.js';
5
- import { L as ListComponent } from './portal-DBwz7gD0.js';
6
- export { P as Portal, a as createReactiveRoot, d as domRenderer, f, r as render } from './portal-DBwz7gD0.js';
1
+ export { c as computed, a as createResource, i as isSignal, o as onCleanup, s as signal } from './signal-Dxh9PsKr.js';
2
+ export { s as sync } from './sync-Z4QqUDjF.js';
3
+ export { state } from './core.js';
4
+ import { a as FNodeChild } from './renderer-DSLb-FGg.js';
5
+ export { h as Link, O as Outlet, g as Route, f as Router, e as createLocation, m as matchPath, r as router } from './components-D4WeooPi.js';
6
+ import { L as ListComponent } from './portal-C3ESJhlv.js';
7
+ export { P as Portal, a as createReactiveRoot, d as domRenderer, f, r as render } from './portal-C3ESJhlv.js';
7
8
  export { c as cleanupMotionState } from './Motion-BrOAJzgH.js';
8
- import './renderer-DSLb-FGg.js';
9
+ export { e as effect } from './effect-BlnnM1t5.js';
10
+ export { r as root, u as untrack } from './owner-QS9tPwPr.js';
9
11
 
10
12
  /** Marker symbol for List components */
11
13
  declare const LIST_MARKER: unique symbol;
@@ -14,4 +16,23 @@ declare const LIST_MARKER: unique symbol;
14
16
  */
15
17
  declare function isListComponent<T>(value: unknown): value is ListComponent<T>;
16
18
 
17
- export { LIST_MARKER, isListComponent };
19
+ interface Context<T> {
20
+ id: symbol;
21
+ Provider: (props: {
22
+ value: T;
23
+ children: FNodeChild;
24
+ }) => FNodeChild;
25
+ defaultValue: T;
26
+ }
27
+ declare function createContext<T>(defaultValue: T): Context<T>;
28
+ /**
29
+ * Get the current value from a context.
30
+ *
31
+ * @example
32
+ * ```tsx
33
+ * const theme = context(ThemeContext)
34
+ * ```
35
+ */
36
+ declare function context<T>(ctx: Context<T>): T;
37
+
38
+ export { LIST_MARKER, context, createContext, isListComponent };