@fluixi/core 1.0.0-alpha.83 → 1.0.0-alpha.84

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 (177) hide show
  1. package/dist/cdn/core.global.js +2 -1
  2. package/dist/cli/generate.cjs +4117 -292
  3. package/dist/cli/generate.mjs +4122 -292
  4. package/dist/cli/index.cjs +4117 -292
  5. package/dist/cli/index.mjs +4122 -292
  6. package/dist/cli/run.cjs +63 -1
  7. package/dist/cli/run.mjs +39 -1
  8. package/dist/src/cdn/chunk-VNLCQBFQ.mjs +747 -0
  9. package/dist/src/cdn/core.cjs +1279 -1
  10. package/dist/src/cdn/core.d.ts +3 -3
  11. package/dist/src/cdn/core.js +3 -3
  12. package/dist/src/cdn/core.mjs +642 -1
  13. package/dist/src/cdn/router-WMN2AA7E.mjs +66 -0
  14. package/dist/src/index.cjs +1201 -1
  15. package/dist/src/index.d.ts.map +1 -1
  16. package/dist/src/index.js +1 -11
  17. package/dist/src/index.mjs +1313 -1
  18. package/dist/src/jsx-dev-runtime.cjs +26 -1
  19. package/dist/src/jsx-dev-runtime.mjs +24 -1
  20. package/dist/src/jsx-runtime.cjs +26 -1
  21. package/dist/src/jsx-runtime.js +0 -9
  22. package/dist/src/jsx-runtime.mjs +24 -1
  23. package/dist/src/lib/client/chunk-2C2KDDQV.mjs +133 -0
  24. package/dist/src/lib/client/index.cjs +870 -1
  25. package/dist/src/lib/client/index.d.ts +17 -6
  26. package/dist/src/lib/client/index.d.ts.map +1 -1
  27. package/dist/src/lib/client/index.js +26 -19
  28. package/dist/src/lib/client/index.mjs +222 -1
  29. package/dist/src/lib/client/router-X526HSWQ.mjs +548 -0
  30. package/dist/src/lib/context/context.cjs +118 -1
  31. package/dist/src/lib/context/context.d.ts +19 -37
  32. package/dist/src/lib/context/context.d.ts.map +1 -1
  33. package/dist/src/lib/context/context.js +8 -45
  34. package/dist/src/lib/context/context.mjs +99 -1
  35. package/dist/src/lib/context/index.cjs +120 -1
  36. package/dist/src/lib/context/index.mjs +99 -1
  37. package/dist/src/lib/control-flow.cjs +35 -1
  38. package/dist/src/lib/control-flow.mjs +25 -1
  39. package/dist/src/lib/core.cjs +1200 -1
  40. package/dist/src/lib/core.d.ts +0 -2
  41. package/dist/src/lib/core.d.ts.map +1 -1
  42. package/dist/src/lib/core.js +14 -48
  43. package/dist/src/lib/core.mjs +1313 -1
  44. package/dist/src/lib/env/index.cjs +60 -1
  45. package/dist/src/lib/env/index.d.ts +5 -5
  46. package/dist/src/lib/env/index.js +5 -5
  47. package/dist/src/lib/env/index.mjs +39 -1
  48. package/dist/src/lib/i18n/index.cjs +108 -1
  49. package/dist/src/lib/i18n/index.d.ts +31 -10
  50. package/dist/src/lib/i18n/index.d.ts.map +1 -1
  51. package/dist/src/lib/i18n/index.js +31 -10
  52. package/dist/src/lib/i18n/index.mjs +88 -1
  53. package/dist/src/lib/index.cjs +633 -1
  54. package/dist/src/lib/index.d.ts +0 -2
  55. package/dist/src/lib/index.d.ts.map +1 -1
  56. package/dist/src/lib/index.js +5 -11
  57. package/dist/src/lib/index.mjs +721 -1
  58. package/dist/src/lib/isomorphic.cjs +85 -1
  59. package/dist/src/lib/isomorphic.d.ts +41 -8
  60. package/dist/src/lib/isomorphic.d.ts.map +1 -1
  61. package/dist/src/lib/isomorphic.js +38 -5
  62. package/dist/src/lib/isomorphic.mjs +64 -1
  63. package/dist/src/lib/jsx-runtime/index.cjs +21 -1
  64. package/dist/src/lib/jsx-runtime/index.d.ts +1 -1
  65. package/dist/src/lib/jsx-runtime/index.js +1 -11
  66. package/dist/src/lib/jsx-runtime/index.mjs +4 -1
  67. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +21 -1
  68. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +4 -1
  69. package/dist/src/lib/plugins/fluixi-routes-plugin.cjs +302 -8
  70. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts +15 -1
  71. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts.map +1 -1
  72. package/dist/src/lib/plugins/fluixi-routes-plugin.js +19 -5
  73. package/dist/src/lib/plugins/fluixi-routes-plugin.mjs +271 -8
  74. package/dist/src/lib/plugins/index.cjs +311 -8
  75. package/dist/src/lib/plugins/index.mjs +279 -8
  76. package/dist/src/lib/plugins/route-codegen.cjs +73 -8
  77. package/dist/src/lib/plugins/route-codegen.d.ts +0 -1
  78. package/dist/src/lib/plugins/route-codegen.d.ts.map +1 -1
  79. package/dist/src/lib/plugins/route-codegen.js +4 -5
  80. package/dist/src/lib/plugins/route-codegen.mjs +52 -8
  81. package/dist/src/lib/plugins/route-scanner.cjs +189 -1
  82. package/dist/src/lib/plugins/route-scanner.d.ts +1 -2
  83. package/dist/src/lib/plugins/route-scanner.d.ts.map +1 -1
  84. package/dist/src/lib/plugins/route-scanner.js +7 -8
  85. package/dist/src/lib/plugins/route-scanner.mjs +158 -1
  86. package/dist/src/lib/plugins/vite.cjs +27 -1
  87. package/dist/src/lib/plugins/vite.mjs +6 -1
  88. package/dist/src/lib/render/await.cjs +38 -1
  89. package/dist/src/lib/render/await.d.ts +18 -0
  90. package/dist/src/lib/render/await.d.ts.map +1 -1
  91. package/dist/src/lib/render/await.js +20 -2
  92. package/dist/src/lib/render/await.mjs +17 -1
  93. package/dist/src/lib/render/component.cjs +221 -1
  94. package/dist/src/lib/render/component.d.ts +3 -44
  95. package/dist/src/lib/render/component.d.ts.map +1 -1
  96. package/dist/src/lib/render/component.js +23 -55
  97. package/dist/src/lib/render/component.mjs +214 -1
  98. package/dist/src/lib/render/deferred.cjs +175 -1
  99. package/dist/src/lib/render/deferred.js +5 -5
  100. package/dist/src/lib/render/deferred.mjs +158 -1
  101. package/dist/src/lib/render/index.cjs +573 -1
  102. package/dist/src/lib/render/index.d.ts +3 -17
  103. package/dist/src/lib/render/index.d.ts.map +1 -1
  104. package/dist/src/lib/render/index.js +8 -22
  105. package/dist/src/lib/render/index.mjs +590 -1
  106. package/dist/src/lib/render/lazy.cjs +67 -1
  107. package/dist/src/lib/render/lazy.d.ts +22 -1
  108. package/dist/src/lib/render/lazy.d.ts.map +1 -1
  109. package/dist/src/lib/render/lazy.js +26 -5
  110. package/dist/src/lib/render/lazy.mjs +50 -1
  111. package/dist/src/lib/render/suspense.cjs +141 -1
  112. package/dist/src/lib/render/suspense.d.ts +40 -0
  113. package/dist/src/lib/render/suspense.d.ts.map +1 -1
  114. package/dist/src/lib/render/suspense.js +46 -6
  115. package/dist/src/lib/render/suspense.mjs +136 -1
  116. package/dist/src/lib/render/versions.cjs +35 -1
  117. package/dist/src/lib/render/versions.js +6 -6
  118. package/dist/src/lib/render/versions.mjs +14 -1
  119. package/dist/src/lib/router/data.cjs +230 -1
  120. package/dist/src/lib/router/data.d.ts +1 -13
  121. package/dist/src/lib/router/data.d.ts.map +1 -1
  122. package/dist/src/lib/router/data.js +0 -12
  123. package/dist/src/lib/router/data.mjs +214 -1
  124. package/dist/src/lib/router/index.cjs +627 -1
  125. package/dist/src/lib/router/index.d.ts +62 -10
  126. package/dist/src/lib/router/index.d.ts.map +1 -1
  127. package/dist/src/lib/router/index.js +85 -33
  128. package/dist/src/lib/router/index.mjs +639 -1
  129. package/dist/src/lib/server/hydration.cjs +169 -1
  130. package/dist/src/lib/server/hydration.d.ts +15 -55
  131. package/dist/src/lib/server/hydration.d.ts.map +1 -1
  132. package/dist/src/lib/server/hydration.js +23 -62
  133. package/dist/src/lib/server/hydration.mjs +148 -1
  134. package/dist/src/lib/server/index.cjs +401 -11
  135. package/dist/src/lib/server/index.d.ts +30 -6
  136. package/dist/src/lib/server/index.d.ts.map +1 -1
  137. package/dist/src/lib/server/index.js +34 -11
  138. package/dist/src/lib/server/index.mjs +379 -11
  139. package/dist/src/lib/server/reactive.cjs +197 -1
  140. package/dist/src/lib/server/reactive.d.ts +18 -77
  141. package/dist/src/lib/server/reactive.d.ts.map +1 -1
  142. package/dist/src/lib/server/reactive.js +19 -78
  143. package/dist/src/lib/server/reactive.mjs +176 -1
  144. package/dist/src/lib/theme/index.cjs +110 -1
  145. package/dist/src/lib/theme/index.d.ts +19 -4
  146. package/dist/src/lib/theme/index.d.ts.map +1 -1
  147. package/dist/src/lib/theme/index.js +17 -2
  148. package/dist/src/lib/theme/index.mjs +89 -1
  149. package/dist/src/lib/utils/index.cjs +209 -1
  150. package/dist/src/lib/utils/index.d.ts +0 -93
  151. package/dist/src/lib/utils/index.d.ts.map +1 -1
  152. package/dist/src/lib/utils/index.js +0 -93
  153. package/dist/src/lib/utils/index.mjs +188 -1
  154. package/dist/src/routes.cjs +37 -1
  155. package/dist/src/routes.d.ts +1 -1
  156. package/dist/src/routes.js +2 -2
  157. package/dist/src/routes.mjs +17 -1
  158. package/dist/src/server.cjs +400 -11
  159. package/dist/src/server.d.ts +0 -1
  160. package/dist/src/server.d.ts.map +1 -1
  161. package/dist/src/server.js +0 -1
  162. package/dist/src/server.mjs +377 -11
  163. package/dist/src/utils.cjs +21 -1
  164. package/dist/src/utils.d.ts +1 -1
  165. package/dist/src/utils.js +1 -1
  166. package/dist/src/utils.mjs +4 -1
  167. package/dist/src/version.generated.cjs +26 -1
  168. package/dist/src/version.generated.d.ts +1 -1
  169. package/dist/src/version.generated.js +2 -2
  170. package/dist/src/version.generated.mjs +5 -1
  171. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  172. package/package.json +17 -16
  173. package/src/index.ts +2 -14
  174. package/dist/src/cdn/chunk-55BT3H6E.mjs +0 -1
  175. package/dist/src/cdn/router-5JJZBK4E.mjs +0 -1
  176. package/dist/src/lib/client/chunk-SM4WHBOP.mjs +0 -1
  177. package/dist/src/lib/client/router-IBD4WPQT.mjs +0 -1
@@ -1 +1,221 @@
1
- "use strict";var f=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var o in t)f(e,o,{get:t[o],enumerable:!0})},E=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let c of x(t))!C.call(e,c)&&c!==o&&f(e,c,{get:()=>t[c],enumerable:!(r=y(t,c))||r.enumerable});return e};var O=e=>E(f({},"__esModule",{value:!0}),e);var V={};T(V,{$component:()=>R,DEV:()=>p,batch:()=>n.batch,createComponent:()=>L,createEffect:()=>n.createEffect,createMemo:()=>n.createMemo,devOnly:()=>K,ensureIntegration:()=>g,getContextOwner:()=>b,getOwner:()=>n.getOwner,getSharedConfig:()=>w,hasLifecycleContext:()=>_,isDev:()=>W,onCleanup:()=>n.onCleanup,onMount:()=>S,onUnmount:()=>U,runWithOwner:()=>n.runWithOwner,setOwner:()=>h,useCallback:()=>D,useEffect:()=>v,useEventListener:()=>k,useMemo:()=>A,useReducer:()=>j,useRef:()=>M});module.exports=O(V);var a=require("@fluixi/dom"),u=require("@fluixi/dom"),n=require("@fluixi/reactive/signal"),i={context:null,owner:null};function w(){return i}function h(e){i.owner=e,i.context=e}function b(){return i.context||i.owner}var p=typeof process<"u"&&!1,s=Symbol.for("fluixi-lifecycle");function d(){let e=(0,n.getOwner)();if(!e)return null;if(!e[s]){let t={mounts:[],effects:[],scheduled:!1};e[s]=t}return e[s]}function l(e){if(e.scheduled)return;if((0,a.isServer)()){e.mounts=[],e.effects=[];return}e.scheduled=!0;let t=(0,n.getOwner)();queueMicrotask(()=>{if((0,n.isOwnerDisposed)(t)){e.mounts=[],e.effects=[];return}(0,n.runWithOwner)(t,()=>{for(let o of e.mounts)try{let r=o();typeof r=="function"&&(0,n.onCleanup)(r)}catch(r){console.error("Error in onMount callback:",r)}for(let o of e.effects){let r;(0,n.createEffect)(()=>{r&&r(),r=o()}),(0,n.onCleanup)(()=>{r&&r()})}e.mounts=[],e.effects=[]})})}function g(e){}function L(e,t){return(0,u.createComponent)(e,t)}function R(e,t){let o=typeof e=="function"?(0,n.untrack)(()=>e(t)):e,r=o!=null&&(typeof o=="function"||typeof o=="object");if(r)try{o.$name=e.name}catch{}return r&&!(0,n.isSignal)(o)?(0,u.asComponent)(o):o}function S(e,t=!0){if((0,a.isServer)())return;let o=d();if(o){if(!t){o.scheduled||e();return}o.mounts.push(e),l(o)}else{if(!t){e();return}(0,n.createEffect)(()=>{let r=(0,n.untrack)(e);typeof r=="function"&&(0,n.onCleanup)(r)})}}function U(e){(0,n.onCleanup)(e)}function v(e){let t=d();if(t)t.effects.push(e),l(t);else{let o;(0,n.createEffect)(()=>{o&&o(),o=e()}),(0,n.onCleanup)(()=>{o&&o()})}}function A(e){return(0,n.createMemo)(e)}function M(e){let t={current:e};return(0,n.onCleanup)(()=>{t.current=null}),t}function j(e,t){let[o,r]=(0,n.createSignal)(t);return[o,m=>{r(e(o(),m))}]}function k(e,t,o,r){v(()=>{let c=e&&"current"in e?e.current:e;if(c)return c.addEventListener(t,o,r),()=>{c.removeEventListener(t,o,r)}})}function D(e){return e}function _(){return(0,n.getOwner)()!==null}function W(){return p}function K(e){p&&e()}
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/lib/render/component.ts
21
+ var component_exports = {};
22
+ __export(component_exports, {
23
+ $component: () => $component,
24
+ DEV: () => DEV,
25
+ batch: () => import_signal.batch,
26
+ createComponent: () => createComponent,
27
+ createEffect: () => import_signal.createEffect,
28
+ createMemo: () => import_signal.createMemo,
29
+ devOnly: () => devOnly,
30
+ ensureIntegration: () => ensureIntegration,
31
+ getContextOwner: () => getContextOwner,
32
+ getOwner: () => import_signal.getOwner,
33
+ getSharedConfig: () => getSharedConfig,
34
+ hasLifecycleContext: () => hasLifecycleContext,
35
+ isDev: () => isDev,
36
+ onCleanup: () => import_signal.onCleanup,
37
+ onMount: () => onMount,
38
+ onUnmount: () => onUnmount,
39
+ runWithOwner: () => import_signal.runWithOwner,
40
+ setOwner: () => setOwner,
41
+ useCallback: () => useCallback,
42
+ useEffect: () => useEffect,
43
+ useEventListener: () => useEventListener,
44
+ useMemo: () => useMemo,
45
+ useReducer: () => useReducer,
46
+ useRef: () => useRef
47
+ });
48
+ module.exports = __toCommonJS(component_exports);
49
+ var import_dom = require("@fluixi/dom");
50
+ var import_dom2 = require("@fluixi/dom");
51
+ var import_signal = require("@fluixi/reactive/signal");
52
+ var sharedConfig = {
53
+ context: null,
54
+ owner: null
55
+ };
56
+ function getSharedConfig() {
57
+ return sharedConfig;
58
+ }
59
+ function setOwner(owner) {
60
+ sharedConfig.owner = owner;
61
+ sharedConfig.context = owner;
62
+ }
63
+ function getContextOwner() {
64
+ return sharedConfig.context || sharedConfig.owner;
65
+ }
66
+ var DEV = typeof process !== "undefined" && false;
67
+ var _LIFECYCLE = /* @__PURE__ */ Symbol.for("fluixi-lifecycle");
68
+ function getOwnerLifecycle() {
69
+ const owner = (0, import_signal.getOwner)();
70
+ if (!owner) return null;
71
+ if (!owner[_LIFECYCLE]) {
72
+ const lc = { mounts: [], effects: [], scheduled: false };
73
+ owner[_LIFECYCLE] = lc;
74
+ }
75
+ return owner[_LIFECYCLE];
76
+ }
77
+ function scheduleLifecycleFlush(lc) {
78
+ if (lc.scheduled) return;
79
+ if ((0, import_dom.isServer)()) {
80
+ lc.mounts = [];
81
+ lc.effects = [];
82
+ return;
83
+ }
84
+ lc.scheduled = true;
85
+ const owner = (0, import_signal.getOwner)();
86
+ queueMicrotask(() => {
87
+ if ((0, import_signal.isOwnerDisposed)(owner)) {
88
+ lc.mounts = [];
89
+ lc.effects = [];
90
+ return;
91
+ }
92
+ (0, import_signal.runWithOwner)(owner, () => {
93
+ for (const cb of lc.mounts) {
94
+ try {
95
+ const cleanup = cb();
96
+ if (typeof cleanup === "function") {
97
+ (0, import_signal.onCleanup)(cleanup);
98
+ }
99
+ } catch (e) {
100
+ console.error("Error in onMount callback:", e);
101
+ }
102
+ }
103
+ for (const cb of lc.effects) {
104
+ let cleanup;
105
+ (0, import_signal.createEffect)(() => {
106
+ if (cleanup) cleanup();
107
+ cleanup = cb();
108
+ });
109
+ (0, import_signal.onCleanup)(() => {
110
+ if (cleanup) cleanup();
111
+ });
112
+ }
113
+ lc.mounts = [];
114
+ lc.effects = [];
115
+ });
116
+ });
117
+ }
118
+ function ensureIntegration(_from) {
119
+ }
120
+ function createComponent(Comp, props) {
121
+ return (0, import_dom2.createComponent)(Comp, props);
122
+ }
123
+ function $component(value, props) {
124
+ const component = typeof value === "function" ? (0, import_signal.untrack)(() => value(props)) : value;
125
+ const nameable = component != null && (typeof component === "function" || typeof component === "object");
126
+ if (nameable) {
127
+ try {
128
+ component["$name"] = value.name;
129
+ } catch {
130
+ }
131
+ }
132
+ if (nameable && !(0, import_signal.isSignal)(component)) {
133
+ return (0, import_dom2.asComponent)(component);
134
+ }
135
+ return component;
136
+ }
137
+ function onMount(fn, reactive = true) {
138
+ if ((0, import_dom.isServer)()) return;
139
+ const lc = getOwnerLifecycle();
140
+ if (lc) {
141
+ if (!reactive) {
142
+ if (!lc.scheduled) {
143
+ fn();
144
+ }
145
+ return;
146
+ }
147
+ lc.mounts.push(fn);
148
+ scheduleLifecycleFlush(lc);
149
+ } else {
150
+ if (!reactive) {
151
+ fn();
152
+ return;
153
+ }
154
+ (0, import_signal.createEffect)(() => {
155
+ const cleanup = (0, import_signal.untrack)(fn);
156
+ if (typeof cleanup === "function") {
157
+ (0, import_signal.onCleanup)(cleanup);
158
+ }
159
+ });
160
+ }
161
+ }
162
+ function onUnmount(fn) {
163
+ (0, import_signal.onCleanup)(fn);
164
+ }
165
+ function useEffect(callback) {
166
+ const lc = getOwnerLifecycle();
167
+ if (lc) {
168
+ lc.effects.push(callback);
169
+ scheduleLifecycleFlush(lc);
170
+ } else {
171
+ let cleanup;
172
+ (0, import_signal.createEffect)(() => {
173
+ if (cleanup) cleanup();
174
+ cleanup = callback();
175
+ });
176
+ (0, import_signal.onCleanup)(() => {
177
+ if (cleanup) cleanup();
178
+ });
179
+ }
180
+ }
181
+ function useMemo(fn) {
182
+ return (0, import_signal.createMemo)(fn);
183
+ }
184
+ function useRef(initialValue) {
185
+ const ref = { current: initialValue };
186
+ (0, import_signal.onCleanup)(() => {
187
+ ref.current = null;
188
+ });
189
+ return ref;
190
+ }
191
+ function useReducer(reducer, initialState) {
192
+ const [state, setState] = (0, import_signal.createSignal)(initialState);
193
+ const dispatch = (action) => {
194
+ setState(reducer(state(), action));
195
+ };
196
+ return [state, dispatch];
197
+ }
198
+ function useEventListener(target, event, handler, options) {
199
+ useEffect(() => {
200
+ const element = target && "current" in target ? target.current : target;
201
+ if (!element) return;
202
+ element.addEventListener(event, handler, options);
203
+ return () => {
204
+ element.removeEventListener(event, handler, options);
205
+ };
206
+ });
207
+ }
208
+ function useCallback(callback) {
209
+ return callback;
210
+ }
211
+ function hasLifecycleContext() {
212
+ return (0, import_signal.getOwner)() !== null;
213
+ }
214
+ function isDev() {
215
+ return DEV;
216
+ }
217
+ function devOnly(fn) {
218
+ if (DEV) {
219
+ fn();
220
+ }
221
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Component creation for Fluixi. Component-creation logic only context lives in
2
+ * Component creation for Fluixi. Component-creation logic only: context lives in
3
3
  * the reactive system, rendering in render/index.ts, and SSR in server/.
4
4
  */
5
5
  import { CreateComponentReturnType } from '@fluixi/dom';
@@ -43,7 +43,7 @@ export interface RefObject<T> {
43
43
  * The runtime creates components itself now, so nothing has to be registered for
44
44
  * it to work and this does nothing. It stays because callers exist, and because
45
45
  * `registerCreateComponent` is still the way to install a different component
46
- * model pass your own implementation there and the runtime uses it instead.
46
+ * model: pass your own implementation there and the runtime uses it instead.
47
47
  *
48
48
  * Do not register a function that calls the runtime's own `createComponent`: it
49
49
  * consults the slot first, so that recurses.
@@ -54,11 +54,6 @@ export declare function ensureIntegration(_from?: string): void;
54
54
  * captures its output, keeps children lazy, propagates context (via sharedConfig), and
55
55
  * attaches cleanup. Components execute once and never re-execute.
56
56
  *
57
- * @template P - Props type
58
- * @param {Component<P>} Comp - Component function
59
- * @param {P} props - Component props
60
- * @returns {any} Component output
61
- *
62
57
  * @example
63
58
  * ```typescript
64
59
  * const MyComponent = (props: { name: string }) => {
@@ -77,8 +72,6 @@ export declare function $component<T extends (props?: any) => any, U = any>(valu
77
72
  * The effect runs once after the reactive graph is established,
78
73
  * tied to the current Owner for automatic cleanup.
79
74
  *
80
- * @param {LifecycleCallback} fn - Mount callback
81
- *
82
75
  * @example
83
76
  * ```typescript
84
77
  * const MyComponent = () => {
@@ -98,8 +91,6 @@ export declare function onMount(fn: LifecycleCallback, reactive?: boolean): void
98
91
  * SolidJS-aligned: directly delegates to onCleanup which registers
99
92
  * with the current reactive Owner for automatic disposal.
100
93
  *
101
- * @param {() => void} fn - Unmount callback
102
- *
103
94
  * @example
104
95
  * ```typescript
105
96
  * const MyComponent = () => {
@@ -115,9 +106,7 @@ export declare function onUnmount(fn: () => void): void;
115
106
  /**
116
107
  * Register a cleanup function
117
108
  *
118
- * Section 1: Component constructs reactive graph including cleanup
119
- *
120
- * @param {() => void} fn - Cleanup function
109
+ * Component constructs reactive graph including cleanup
121
110
  *
122
111
  * @example
123
112
  * ```typescript
@@ -137,8 +126,6 @@ export { onCleanup };
137
126
  * Effects run when their dependencies change
138
127
  * On server, effects run once
139
128
  *
140
- * @param {(v?: any) => any} fn - Effect function
141
- *
142
129
  * @example
143
130
  * ```typescript
144
131
  * const MyComponent = () => {
@@ -156,10 +143,6 @@ export declare function useEffect(callback: () => void | (() => void)): void;
156
143
  /**
157
144
  * Create a memoized computed value
158
145
  *
159
- * @template T
160
- * @param {() => T} fn - Computation function
161
- * @returns {() => T} Memoized accessor
162
- *
163
146
  * @example
164
147
  * ```typescript
165
148
  * const MyComponent = () => {
@@ -177,10 +160,6 @@ export declare function useMemo<T>(fn: () => T): () => T;
177
160
  * Refs persist across component re-renders (though components only run once)
178
161
  * Useful for storing DOM references and mutable values
179
162
  *
180
- * @template T
181
- * @param {T} initialValue - Initial value
182
- * @returns {RefObject<T>} Ref object
183
- *
184
163
  * @example
185
164
  * ```typescript
186
165
  * const MyComponent = () => {
@@ -198,12 +177,6 @@ export declare function useRef<T>(initialValue: T): RefObject<T>;
198
177
  /**
199
178
  * Create a reducer for state management
200
179
  *
201
- * @template S - State type
202
- * @template A - Action type
203
- * @param {(state: S, action: A) => S} reducer - Reducer function
204
- * @param {S} initialState - Initial state
205
- * @returns {[() => S, (action: A) => void]} State accessor and dispatch function
206
- *
207
180
  * @example
208
181
  * ```typescript
209
182
  * type Action = { type: 'increment' } | { type: 'decrement' };
@@ -231,12 +204,6 @@ export declare function useReducer<S, A>(reducer: (state: S, action: A) => S, in
231
204
  /**
232
205
  * Attach an event listener with automatic cleanup
233
206
  *
234
- * @template K - Event type key
235
- * @param {EventTarget | RefObject<EventTarget | null>} target - Event target or ref
236
- * @param {K} event - Event name
237
- * @param {(event: Event) => void} handler - Event handler
238
- * @param {AddEventListenerOptions} options - Event listener options
239
- *
240
207
  * @example
241
208
  * ```typescript
242
209
  * const MyComponent = () => {
@@ -261,10 +228,6 @@ export declare function useEventListener<K extends keyof WindowEventMap>(target:
261
228
  * In Fluixi, components only run once, so this is mostly for
262
229
  * API compatibility and explicit intent
263
230
  *
264
- * @template T
265
- * @param {T} callback - Callback function
266
- * @returns {T} Callback function
267
- *
268
231
  * @example
269
232
  * ```typescript
270
233
  * const MyComponent = () => {
@@ -310,8 +273,6 @@ export declare function hasLifecycleContext(): boolean;
310
273
  /**
311
274
  * Check if in development mode
312
275
  *
313
- * @returns {boolean} True if in development mode
314
- *
315
276
  * @example
316
277
  * ```typescript
317
278
  * if (isDev()) {
@@ -323,8 +284,6 @@ export declare function isDev(): boolean;
323
284
  /**
324
285
  * Development-only code execution
325
286
  *
326
- * @param {() => void} fn - Function to run in dev mode
327
- *
328
287
  * @example
329
288
  * ```typescript
330
289
  * devOnly(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/lib/render/component.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAIL,yBAAyB,EAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAEL,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,UAAU,EAGV,KAAK,EAEL,YAAY,EASb,MAAM,yBAAyB,CAAC;AAKjC,KAAK,KAAK,GAAG,GAAG,CAAC;AAMjB,UAAU,YAAY;IACpB,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAOD;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAE9C;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,CAGlD;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,KAAK,GAAG,IAAI,CAE9C;AAMD;;GAEG;AACH,eAAO,MAAM,GAAG,SAC2D,CAAC;AAM5E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;CACzB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,OAAO,EAAE,CAAC,CAAC;CACZ;AAoGD;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAG;AAE1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C,KAAK,IAAI,EAC3C,OAAO,CAAC,EAAE,uBAAuB,GAChC,IAAI,CAAC;AAwCR;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,CAI7E;AAED;;;GAGG;AACH,OAAO,EAAE,KAAK,EAAE,CAAC;AAEjB;;;GAGG;AACH,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;GAGG;AACH,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpB;;;GAGG;AACH,OAAO,EAAE,YAAY,EAAE,CAAC;AAOxB;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAE7C;AAOD;;;;;;;;;GASG;AACH,wBAAgB,KAAK,IAAI,OAAO,CAG/B;AAED;;;;;;;;;GASG;AACH,wBAAgB,OAAO,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI,CAI5C;AAED,YAAY,EAAE,SAAS,EACrB,cAAc,EAAC,MAAM,aAAa,CAAA"}
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Component creation for Fluixi. Component-creation logic only context lives in
2
+ * Component creation for Fluixi. Component-creation logic only: context lives in
3
3
  * the reactive system, rendering in render/index.ts, and SSR in server/.
4
4
  */
5
5
  import { isServer } from '@fluixi/dom';
@@ -48,7 +48,7 @@ export const DEV = typeof process !== 'undefined' && process.env?.NODE_ENV === '
48
48
  // 1. All onMount callbacks run first
49
49
  // 2. Then all useEffect callbacks are created as reactive effects
50
50
  // This works regardless of whether the component goes through $component,
51
- // the JSX runtime, or is called directly as long as there's an Owner.
51
+ // the JSX runtime, or is called directly, as long as there's an Owner.
52
52
  const _LIFECYCLE = Symbol.for('fluixi-lifecycle');
53
53
  /**
54
54
  * Get or create a lifecycle bucket on the current Owner.
@@ -66,7 +66,7 @@ function getOwnerLifecycle() {
66
66
  }
67
67
  /**
68
68
  * Schedule a microtask to flush the lifecycle for the current Owner.
69
- * Only schedules once per Owner subsequent calls are no-ops.
69
+ * Only schedules once per Owner: subsequent calls are no-ops.
70
70
  */
71
71
  function scheduleLifecycleFlush(lc) {
72
72
  if (lc.scheduled)
@@ -84,7 +84,7 @@ function scheduleLifecycleFlush(lc) {
84
84
  queueMicrotask(() => {
85
85
  // The scope may have been torn down before this microtask ran (e.g. a <Portal>
86
86
  // inside a <Show> that closed synchronously). Running mount/effect callbacks on a
87
- // dead owner would re-attach listeners/effects whose cleanup never fires a leak.
87
+ // dead owner would re-attach listeners/effects whose cleanup never fires, a leak.
88
88
  // Match Solid: an unmounted component's onMount simply does not run.
89
89
  if (isOwnerDisposed(owner)) {
90
90
  lc.mounts = [];
@@ -127,7 +127,7 @@ function scheduleLifecycleFlush(lc) {
127
127
  * The runtime creates components itself now, so nothing has to be registered for
128
128
  * it to work and this does nothing. It stays because callers exist, and because
129
129
  * `registerCreateComponent` is still the way to install a different component
130
- * model pass your own implementation there and the runtime uses it instead.
130
+ * model: pass your own implementation there and the runtime uses it instead.
131
131
  *
132
132
  * Do not register a function that calls the runtime's own `createComponent`: it
133
133
  * consults the slot first, so that recurses.
@@ -138,11 +138,6 @@ export function ensureIntegration(_from) { }
138
138
  * captures its output, keeps children lazy, propagates context (via sharedConfig), and
139
139
  * attaches cleanup. Components execute once and never re-execute.
140
140
  *
141
- * @template P - Props type
142
- * @param {Component<P>} Comp - Component function
143
- * @param {P} props - Component props
144
- * @returns {any} Component output
145
- *
146
141
  * @example
147
142
  * ```typescript
148
143
  * const MyComponent = (props: { name: string }) => {
@@ -152,17 +147,6 @@ export function ensureIntegration(_from) { }
152
147
  * const result = createComponent(MyComponent, { name: 'World' });
153
148
  * ```
154
149
  */
155
- // export function $component<T, U = any>(value: T, props?: U) {
156
- // const component = () => (typeof value === 'function' && props) ?(value as any)(props) : value;
157
- // Object.defineProperty(component, '__fluixi', {
158
- // enumerable: true,
159
- // configurable: true,
160
- // value: true,
161
- // });
162
- // // (component as any).$COMPONENT = true;
163
- // return asComponent(component) as C<T, U>;
164
- // }
165
- //
166
150
  export function createComponent(Comp, props) {
167
151
  return domCreateComponent(Comp, props);
168
152
  }
@@ -180,7 +164,7 @@ export function $component(value, props) {
180
164
  const component = (typeof value === 'function')
181
165
  ? untrack(() => value(props))
182
166
  : value;
183
- // Only stamp $name and $COMPONENT on functions/objects primitives (strings, numbers)
167
+ // Only stamp $name and $COMPONENT on functions/objects: primitives (strings, numbers)
184
168
  // cannot have properties added in strict mode and would throw TypeError.
185
169
  // Also skip stamping reactive values (signals/memos) with $COMPONENT so the DOM
186
170
  // runtime doesn't misidentify them as static component thunks and cache them.
@@ -210,8 +194,6 @@ export function $component(value, props) {
210
194
  * The effect runs once after the reactive graph is established,
211
195
  * tied to the current Owner for automatic cleanup.
212
196
  *
213
- * @param {LifecycleCallback} fn - Mount callback
214
- *
215
197
  * @example
216
198
  * ```typescript
217
199
  * const MyComponent = () => {
@@ -235,7 +217,7 @@ export function onMount(fn, reactive = true) {
235
217
  }
236
218
  return;
237
219
  }
238
- // Attach to Owner will run BEFORE useEffect callbacks in the flush.
220
+ // Attach to Owner: will run before useEffect callbacks in the flush.
239
221
  lc.mounts.push(fn);
240
222
  scheduleLifecycleFlush(lc);
241
223
  }
@@ -259,8 +241,6 @@ export function onMount(fn, reactive = true) {
259
241
  * SolidJS-aligned: directly delegates to onCleanup which registers
260
242
  * with the current reactive Owner for automatic disposal.
261
243
  *
262
- * @param {() => void} fn - Unmount callback
263
- *
264
244
  * @example
265
245
  * ```typescript
266
246
  * const MyComponent = () => {
@@ -278,9 +258,7 @@ export function onUnmount(fn) {
278
258
  /**
279
259
  * Register a cleanup function
280
260
  *
281
- * Section 1: Component constructs reactive graph including cleanup
282
- *
283
- * @param {() => void} fn - Cleanup function
261
+ * Component constructs reactive graph including cleanup
284
262
  *
285
263
  * @example
286
264
  * ```typescript
@@ -303,8 +281,6 @@ export { onCleanup };
303
281
  * Effects run when their dependencies change
304
282
  * On server, effects run once
305
283
  *
306
- * @param {(v?: any) => any} fn - Effect function
307
- *
308
284
  * @example
309
285
  * ```typescript
310
286
  * const MyComponent = () => {
@@ -321,7 +297,7 @@ export { onCleanup };
321
297
  export function useEffect(callback) {
322
298
  const lc = getOwnerLifecycle();
323
299
  if (lc) {
324
- // Attach to the Owner created as an effect after all onMount callbacks.
300
+ // Attach to the Owner: created as an effect after all onMount callbacks.
325
301
  lc.effects.push(callback);
326
302
  scheduleLifecycleFlush(lc);
327
303
  }
@@ -342,10 +318,6 @@ export function useEffect(callback) {
342
318
  /**
343
319
  * Create a memoized computed value
344
320
  *
345
- * @template T
346
- * @param {() => T} fn - Computation function
347
- * @returns {() => T} Memoized accessor
348
- *
349
321
  * @example
350
322
  * ```typescript
351
323
  * const MyComponent = () => {
@@ -367,10 +339,6 @@ export function useMemo(fn) {
367
339
  * Refs persist across component re-renders (though components only run once)
368
340
  * Useful for storing DOM references and mutable values
369
341
  *
370
- * @template T
371
- * @param {T} initialValue - Initial value
372
- * @returns {RefObject<T>} Ref object
373
- *
374
342
  * @example
375
343
  * ```typescript
376
344
  * const MyComponent = () => {
@@ -395,12 +363,6 @@ export function useRef(initialValue) {
395
363
  /**
396
364
  * Create a reducer for state management
397
365
  *
398
- * @template S - State type
399
- * @template A - Action type
400
- * @param {(state: S, action: A) => S} reducer - Reducer function
401
- * @param {S} initialState - Initial state
402
- * @returns {[() => S, (action: A) => void]} State accessor and dispatch function
403
- *
404
366
  * @example
405
367
  * ```typescript
406
368
  * type Action = { type: 'increment' } | { type: 'decrement' };
@@ -431,6 +393,20 @@ export function useReducer(reducer, initialState) {
431
393
  };
432
394
  return [state, dispatch];
433
395
  }
396
+ /**
397
+ * Attach a listener for as long as the current owner lives.
398
+ *
399
+ * Runs through `useEffect`, so the removal it returns is called on disposal and before
400
+ * any re-run. Nothing has to be undone by hand. `target` may be a ref, read when the
401
+ * listener is attached rather than when this is called, so it works for an element the
402
+ * template has not created yet.
403
+ *
404
+ * @example
405
+ * ```ts
406
+ * useEventListener(window, 'resize', () => setWidth(window.innerWidth));
407
+ * useEventListener(dialogRef, 'keydown', onKey, { capture: true });
408
+ * ```
409
+ */
434
410
  export function useEventListener(target, event, handler, options) {
435
411
  useEffect(() => {
436
412
  // Resolve target from ref or direct value
@@ -453,10 +429,6 @@ export function useEventListener(target, event, handler, options) {
453
429
  * In Fluixi, components only run once, so this is mostly for
454
430
  * API compatibility and explicit intent
455
431
  *
456
- * @template T
457
- * @param {T} callback - Callback function
458
- * @returns {T} Callback function
459
- *
460
432
  * @example
461
433
  * ```typescript
462
434
  * const MyComponent = () => {
@@ -514,8 +486,6 @@ export function hasLifecycleContext() {
514
486
  /**
515
487
  * Check if in development mode
516
488
  *
517
- * @returns {boolean} True if in development mode
518
- *
519
489
  * @example
520
490
  * ```typescript
521
491
  * if (isDev()) {
@@ -530,8 +500,6 @@ export function isDev() {
530
500
  /**
531
501
  * Development-only code execution
532
502
  *
533
- * @param {() => void} fn - Function to run in dev mode
534
- *
535
503
  * @example
536
504
  * ```typescript
537
505
  * devOnly(() => {