@fluixi/core 1.0.0-alpha.53

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 (198) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +611 -0
  3. package/dist/cdn/core.global.js +3 -0
  4. package/dist/cli/generate.cjs +1814 -0
  5. package/dist/cli/generate.d.ts +7 -0
  6. package/dist/cli/generate.d.ts.map +1 -0
  7. package/dist/cli/generate.js +2580 -0
  8. package/dist/cli/generate.mjs +1814 -0
  9. package/dist/cli/index.cjs +1814 -0
  10. package/dist/cli/index.d.ts +7 -0
  11. package/dist/cli/index.d.ts.map +1 -0
  12. package/dist/cli/index.js +2580 -0
  13. package/dist/cli/index.mjs +1814 -0
  14. package/dist/cli/run.cjs +2 -0
  15. package/dist/cli/run.d.ts +3 -0
  16. package/dist/cli/run.d.ts.map +1 -0
  17. package/dist/cli/run.js +62 -0
  18. package/dist/cli/run.mjs +2 -0
  19. package/dist/fluixi.d.ts +5 -0
  20. package/dist/src/cdn/chunk-PFM5O5UE.mjs +1 -0
  21. package/dist/src/cdn/core.cjs +1 -0
  22. package/dist/src/cdn/core.d.ts +16 -0
  23. package/dist/src/cdn/core.d.ts.map +1 -0
  24. package/dist/src/cdn/core.js +15 -0
  25. package/dist/src/cdn/core.mjs +1 -0
  26. package/dist/src/cdn/router-next-WNWCFVC2.mjs +1 -0
  27. package/dist/src/index.cjs +1 -0
  28. package/dist/src/index.d.ts +7 -0
  29. package/dist/src/index.d.ts.map +1 -0
  30. package/dist/src/index.js +26 -0
  31. package/dist/src/index.mjs +1 -0
  32. package/dist/src/jsx-dev-runtime.cjs +1 -0
  33. package/dist/src/jsx-dev-runtime.d.ts +2 -0
  34. package/dist/src/jsx-dev-runtime.d.ts.map +1 -0
  35. package/dist/src/jsx-dev-runtime.js +1 -0
  36. package/dist/src/jsx-dev-runtime.mjs +1 -0
  37. package/dist/src/jsx-runtime.cjs +1 -0
  38. package/dist/src/jsx-runtime.d.ts +7 -0
  39. package/dist/src/jsx-runtime.d.ts.map +1 -0
  40. package/dist/src/jsx-runtime.js +17 -0
  41. package/dist/src/jsx-runtime.mjs +1 -0
  42. package/dist/src/lib/client/chunk-D3VTWVNJ.mjs +1 -0
  43. package/dist/src/lib/client/index.cjs +1 -0
  44. package/dist/src/lib/client/index.d.ts +54 -0
  45. package/dist/src/lib/client/index.d.ts.map +1 -0
  46. package/dist/src/lib/client/index.js +142 -0
  47. package/dist/src/lib/client/index.mjs +1 -0
  48. package/dist/src/lib/client/router-next-UYIYMRJL.mjs +1 -0
  49. package/dist/src/lib/context/context.cjs +1 -0
  50. package/dist/src/lib/context/context.d.ts +337 -0
  51. package/dist/src/lib/context/context.d.ts.map +1 -0
  52. package/dist/src/lib/context/context.js +462 -0
  53. package/dist/src/lib/context/context.mjs +1 -0
  54. package/dist/src/lib/context/index.cjs +1 -0
  55. package/dist/src/lib/context/index.d.ts +3 -0
  56. package/dist/src/lib/context/index.d.ts.map +1 -0
  57. package/dist/src/lib/context/index.js +5 -0
  58. package/dist/src/lib/context/index.mjs +1 -0
  59. package/dist/src/lib/control-flow.cjs +1 -0
  60. package/dist/src/lib/control-flow.d.ts +4 -0
  61. package/dist/src/lib/control-flow.d.ts.map +1 -0
  62. package/dist/src/lib/control-flow.js +1 -0
  63. package/dist/src/lib/control-flow.mjs +1 -0
  64. package/dist/src/lib/core.cjs +1 -0
  65. package/dist/src/lib/core.d.ts +90 -0
  66. package/dist/src/lib/core.d.ts.map +1 -0
  67. package/dist/src/lib/core.js +181 -0
  68. package/dist/src/lib/core.mjs +1 -0
  69. package/dist/src/lib/directives/lit.cjs +1 -0
  70. package/dist/src/lib/directives/lit.d.ts +2 -0
  71. package/dist/src/lib/directives/lit.d.ts.map +1 -0
  72. package/dist/src/lib/directives/lit.js +31 -0
  73. package/dist/src/lib/directives/lit.mjs +0 -0
  74. package/dist/src/lib/env/index.cjs +1 -0
  75. package/dist/src/lib/env/index.d.ts +39 -0
  76. package/dist/src/lib/env/index.d.ts.map +1 -0
  77. package/dist/src/lib/env/index.js +50 -0
  78. package/dist/src/lib/env/index.mjs +1 -0
  79. package/dist/src/lib/i18n/index.cjs +1 -0
  80. package/dist/src/lib/i18n/index.d.ts +79 -0
  81. package/dist/src/lib/i18n/index.d.ts.map +1 -0
  82. package/dist/src/lib/i18n/index.js +127 -0
  83. package/dist/src/lib/i18n/index.mjs +1 -0
  84. package/dist/src/lib/index.cjs +1 -0
  85. package/dist/src/lib/index.d.ts +83 -0
  86. package/dist/src/lib/index.d.ts.map +1 -0
  87. package/dist/src/lib/index.js +147 -0
  88. package/dist/src/lib/index.mjs +1 -0
  89. package/dist/src/lib/isomorphic.cjs +1 -0
  90. package/dist/src/lib/isomorphic.d.ts +69 -0
  91. package/dist/src/lib/isomorphic.d.ts.map +1 -0
  92. package/dist/src/lib/isomorphic.js +92 -0
  93. package/dist/src/lib/isomorphic.mjs +1 -0
  94. package/dist/src/lib/jsx-runtime/index.cjs +1 -0
  95. package/dist/src/lib/jsx-runtime/index.d.ts +13 -0
  96. package/dist/src/lib/jsx-runtime/index.d.ts.map +1 -0
  97. package/dist/src/lib/jsx-runtime/index.js +23 -0
  98. package/dist/src/lib/jsx-runtime/index.mjs +1 -0
  99. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +1 -0
  100. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.d.ts +2 -0
  101. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.d.ts.map +1 -0
  102. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.js +1 -0
  103. package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +1 -0
  104. package/dist/src/lib/plugins/fluixi-routes-plugin.cjs +13 -0
  105. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts +21 -0
  106. package/dist/src/lib/plugins/fluixi-routes-plugin.d.ts.map +1 -0
  107. package/dist/src/lib/plugins/fluixi-routes-plugin.js +102 -0
  108. package/dist/src/lib/plugins/fluixi-routes-plugin.mjs +13 -0
  109. package/dist/src/lib/plugins/index.cjs +13 -0
  110. package/dist/src/lib/plugins/index.d.ts +4 -0
  111. package/dist/src/lib/plugins/index.d.ts.map +1 -0
  112. package/dist/src/lib/plugins/index.js +3 -0
  113. package/dist/src/lib/plugins/index.mjs +13 -0
  114. package/dist/src/lib/plugins/route-codegen.cjs +8 -0
  115. package/dist/src/lib/plugins/route-codegen.d.ts +13 -0
  116. package/dist/src/lib/plugins/route-codegen.d.ts.map +1 -0
  117. package/dist/src/lib/plugins/route-codegen.js +81 -0
  118. package/dist/src/lib/plugins/route-codegen.mjs +8 -0
  119. package/dist/src/lib/plugins/route-scanner.cjs +1 -0
  120. package/dist/src/lib/plugins/route-scanner.d.ts +39 -0
  121. package/dist/src/lib/plugins/route-scanner.d.ts.map +1 -0
  122. package/dist/src/lib/plugins/route-scanner.js +216 -0
  123. package/dist/src/lib/plugins/route-scanner.mjs +1 -0
  124. package/dist/src/lib/plugins/vite.cjs +1 -0
  125. package/dist/src/lib/plugins/vite.d.ts +3 -0
  126. package/dist/src/lib/plugins/vite.d.ts.map +1 -0
  127. package/dist/src/lib/plugins/vite.js +1 -0
  128. package/dist/src/lib/plugins/vite.mjs +1 -0
  129. package/dist/src/lib/render/component.cjs +1 -0
  130. package/dist/src/lib/render/component.d.ts +328 -0
  131. package/dist/src/lib/render/component.d.ts.map +1 -0
  132. package/dist/src/lib/render/component.js +520 -0
  133. package/dist/src/lib/render/component.mjs +1 -0
  134. package/dist/src/lib/render/index.cjs +1 -0
  135. package/dist/src/lib/render/index.d.ts +113 -0
  136. package/dist/src/lib/render/index.d.ts.map +1 -0
  137. package/dist/src/lib/render/index.js +201 -0
  138. package/dist/src/lib/render/index.mjs +1 -0
  139. package/dist/src/lib/render/lazy.cjs +1 -0
  140. package/dist/src/lib/render/lazy.d.ts +28 -0
  141. package/dist/src/lib/render/lazy.d.ts.map +1 -0
  142. package/dist/src/lib/render/lazy.js +62 -0
  143. package/dist/src/lib/render/lazy.mjs +1 -0
  144. package/dist/src/lib/render/suspense.cjs +1 -0
  145. package/dist/src/lib/render/suspense.d.ts +25 -0
  146. package/dist/src/lib/render/suspense.d.ts.map +1 -0
  147. package/dist/src/lib/render/suspense.js +139 -0
  148. package/dist/src/lib/render/suspense.mjs +1 -0
  149. package/dist/src/lib/router-next/data.cjs +1 -0
  150. package/dist/src/lib/router-next/data.d.ts +101 -0
  151. package/dist/src/lib/router-next/data.d.ts.map +1 -0
  152. package/dist/src/lib/router-next/data.js +179 -0
  153. package/dist/src/lib/router-next/data.mjs +1 -0
  154. package/dist/src/lib/router-next/index.cjs +1 -0
  155. package/dist/src/lib/router-next/index.d.ts +156 -0
  156. package/dist/src/lib/router-next/index.d.ts.map +1 -0
  157. package/dist/src/lib/router-next/index.js +464 -0
  158. package/dist/src/lib/router-next/index.mjs +1 -0
  159. package/dist/src/lib/server/hydration.cjs +1 -0
  160. package/dist/src/lib/server/hydration.d.ts +238 -0
  161. package/dist/src/lib/server/hydration.d.ts.map +1 -0
  162. package/dist/src/lib/server/hydration.js +384 -0
  163. package/dist/src/lib/server/hydration.mjs +1 -0
  164. package/dist/src/lib/server/index.cjs +16 -0
  165. package/dist/src/lib/server/index.d.ts +91 -0
  166. package/dist/src/lib/server/index.d.ts.map +1 -0
  167. package/dist/src/lib/server/index.js +141 -0
  168. package/dist/src/lib/server/index.mjs +16 -0
  169. package/dist/src/lib/server/reactive.cjs +1 -0
  170. package/dist/src/lib/server/reactive.d.ts +298 -0
  171. package/dist/src/lib/server/reactive.d.ts.map +1 -0
  172. package/dist/src/lib/server/reactive.js +472 -0
  173. package/dist/src/lib/server/reactive.mjs +1 -0
  174. package/dist/src/lib/theme/index.cjs +1 -0
  175. package/dist/src/lib/theme/index.d.ts +51 -0
  176. package/dist/src/lib/theme/index.d.ts.map +1 -0
  177. package/dist/src/lib/theme/index.js +79 -0
  178. package/dist/src/lib/theme/index.mjs +1 -0
  179. package/dist/src/lib/utils/index.cjs +1 -0
  180. package/dist/src/lib/utils/index.d.ts +379 -0
  181. package/dist/src/lib/utils/index.d.ts.map +1 -0
  182. package/dist/src/lib/utils/index.js +527 -0
  183. package/dist/src/lib/utils/index.mjs +1 -0
  184. package/dist/src/rx.cjs +1 -0
  185. package/dist/src/rx.d.ts +2 -0
  186. package/dist/src/rx.d.ts.map +1 -0
  187. package/dist/src/rx.js +101 -0
  188. package/dist/src/rx.mjs +0 -0
  189. package/dist/src/server.cjs +16 -0
  190. package/dist/src/server.d.ts +64 -0
  191. package/dist/src/server.d.ts.map +1 -0
  192. package/dist/src/server.js +63 -0
  193. package/dist/src/server.mjs +16 -0
  194. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  195. package/package.json +128 -0
  196. package/src/index.ts +31 -0
  197. package/types/fluixi.d.ts +5 -0
  198. package/types/vinxi.d.ts +50 -0
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @fileoverview Fluixi - Solid-Compatible Fine-Grained UI Framework
3
+ * @module @fluixi/core
4
+ * @version 0.0.1
5
+ *
6
+ * A fine-grained reactive framework following SolidJS principles:
7
+ * - Components execute once
8
+ * - Fine-grained reactivity (no VDOM)
9
+ * - Server-side rendering with hydration
10
+ * - JSX and Lit-html support
11
+ */
12
+ export { createEffect, createMemo, createSignal, createResource, createRoot, createComputed, createRenderEffect, onCleanup, getOwner, runWithOwner, batch, untrack, createDeferred, setOwner, } from '@fluixi/reactive/signal';
13
+ export { createDebounce, createSelector } from '@fluixi/reactive/signal';
14
+ export { readSignal as read, reduceSignal as reduce, } from '@fluixi/reactive/operators';
15
+ export type { Signal, Accessor, Setter, SignalOptions, RootOwner as Owner, Context, Resource, } from '@fluixi/reactive/signal';
16
+ export type { ReadSignal } from '@fluixi/reactive/operators';
17
+ export { createStore, untrackStore, Store, type StoreSetter } from '@fluixi/reactive/store';
18
+ export { createComponent, onMount, onUnmount, lazy, useEffect, useMemo, useRef, useReducer, useEventListener, useCallback, render, portal, isRenderable, initDelegation, cleanupDelegation, Suspense, isDev, devOnly, DEV, getSharedConfig, $component, } from './render/index.js';
19
+ export * from './context/index.js';
20
+ export { createIsomorphicState, type IsomorphicState, type IsomorphicOptions, } from './isomorphic.js';
21
+ import { Component, ComponentProps, LifecycleCallback, LazyComponent, RefObject, SuspenseProps } from './render/index.js';
22
+ export type { Component, ComponentProps, LifecycleCallback, LazyComponent, RefObject, SuspenseProps, };
23
+ export { classMap, styleMap, type ClassMapInput, type ClassCondition, type StyleMapInput, type StyleValue, } from '@fluixi/dom';
24
+ export * from './control-flow.js';
25
+ export { insert, spread, setAttribute, setProperty, addClass, removeClass, toggleClass, delegateEvents, isDOMNode, isLitTemplateResult, hydrate, } from '@fluixi/dom';
26
+ export { jsx, jsxs, Fragment } from './jsx-runtime/index.js';
27
+ export type { JSXElement } from './jsx-runtime/index.js';
28
+ /**
29
+ * Framework version
30
+ */
31
+ export declare const VERSION = "0.0.1";
32
+ /**
33
+ * Framework name
34
+ */
35
+ export declare const FRAMEWORK_NAME = "Fluixi";
36
+ /**
37
+ * Get framework info
38
+ */
39
+ export declare function getFrameworkInfo(): {
40
+ name: string;
41
+ version: string;
42
+ features: {
43
+ ssr: boolean;
44
+ hydration: boolean;
45
+ jsx: boolean;
46
+ litHtml: boolean;
47
+ signals: boolean;
48
+ fineGrained: boolean;
49
+ lazy: boolean;
50
+ hooks: boolean;
51
+ devMode: boolean;
52
+ };
53
+ };
54
+ import { createSignal as _createSignal, createEffect as _createEffect, createMemo as _createMemo, createRoot as _createRoot, batch as _batch, untrack as _untrack, onCleanup as _onCleanup } from '@fluixi/reactive/signal';
55
+ import { createComponent as _createComponent, onMount as _onMount, onUnmount as _onUnmount, useEffect as _useEffect, useMemo as _useMemo, useRef as _useRef, useReducer as _useReducer, useEventListener as _useEventListener, useCallback as _useCallback } from './render/component.js';
56
+ import { createContext as _createContext, useContext as _useContext } from './context/index.js';
57
+ import { render as _render } from './render/index.js';
58
+ declare const _default: {
59
+ createSignal: typeof _createSignal;
60
+ createEffect: typeof _createEffect;
61
+ createMemo: typeof _createMemo;
62
+ createRoot: typeof _createRoot;
63
+ batch: typeof _batch;
64
+ untrack: typeof _untrack;
65
+ onCleanup: typeof _onCleanup;
66
+ createContext: typeof _createContext;
67
+ useContext: typeof _useContext;
68
+ createComponent: typeof _createComponent;
69
+ onMount: typeof _onMount;
70
+ onUnmount: typeof _onUnmount;
71
+ useEffect: typeof _useEffect;
72
+ useMemo: typeof _useMemo;
73
+ useRef: typeof _useRef;
74
+ useReducer: typeof _useReducer;
75
+ useEventListener: typeof _useEventListener;
76
+ useCallback: typeof _useCallback;
77
+ render: typeof _render;
78
+ VERSION: string;
79
+ FRAMEWORK_NAME: string;
80
+ getFrameworkInfo: typeof getFrameworkInfo;
81
+ };
82
+ export default _default;
83
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAMH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,YAAY,EACZ,cAAc,EACd,UAAU,EACV,cAAc,EACd,kBAAkB,EAClB,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,KAAK,EACL,OAAO,EACP,cAAc,EACd,QAAQ,GACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EACL,UAAU,IAAI,IAAI,EAClB,YAAY,IAAI,MAAM,GACvB,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EACV,MAAM,EACN,QAAQ,EACR,MAAM,EACN,aAAa,EACb,SAAS,IAAI,KAAK,EAClB,OAAO,EACP,QAAQ,GACT,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAI,KAAK,EAAE,KAAK,WAAW,EAAC,MAAM,wBAAwB,CAAC;AAM7F,OAAO,EACL,eAAe,EACf,OAAO,EACP,SAAS,EACT,IAAI,EAEJ,SAAS,EACT,OAAO,EACP,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,MAAM,EACN,MAAM,EACN,YAAY,EACZ,cAAc,EACd,iBAAiB,EAEjB,QAAQ,EAER,KAAK,EACL,OAAO,EACP,GAAG,EAEH,eAAe,EACf,UAAU,GACX,MAAM,mBAAmB,CAAC;AAE3B,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EACL,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,SAAS,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAC,MAAM,mBAAmB,CAAC;AACxH,YAAY,EACV,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,aAAa,GACd,CAAC;AA2BF,OAAO,EAEL,QAAQ,EACR,QAAQ,EACR,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,aAAa,CAAC;AACrB,cAAc,mBAAmB,CAAC;AAKlC,OAAO,EAEL,MAAM,EACN,MAAM,EACN,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EAGX,cAAc,EAGd,SAAS,EACT,mBAAmB,EACnB,OAAO,GACR,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAE7D,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMzD;;GAEG;AACH,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B;;GAEG;AACH,eAAO,MAAM,cAAc,WAAW,CAAC;AAEvC;;GAEG;AACH,wBAAgB,gBAAgB;;;;;;;;;;;;;;EAgB/B;AAMD,OAAO,EACL,YAAY,IAAI,aAAa,EAC7B,YAAY,IAAI,aAAa,EAC7B,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,KAAK,IAAI,MAAM,EACf,OAAO,IAAI,QAAQ,EACnB,SAAS,IAAI,UAAU,EACxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EACL,eAAe,IAAI,gBAAgB,EACnC,OAAO,IAAI,QAAQ,EACnB,SAAS,IAAI,UAAU,EAEvB,SAAS,IAAI,UAAU,EACvB,OAAO,IAAI,QAAQ,EACnB,MAAM,IAAI,OAAO,EACjB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,WAAW,IAAI,YAAY,EAE5B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,aAAa,IAAI,cAAc,EAC/B,UAAU,IAAI,WAAW,EAC1B,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,mBAAmB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;AAKtD,wBAoCE"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * @fileoverview Fluixi - Solid-Compatible Fine-Grained UI Framework
3
+ * @module @fluixi/core
4
+ * @version 0.0.1
5
+ *
6
+ * A fine-grained reactive framework following SolidJS principles:
7
+ * - Components execute once
8
+ * - Fine-grained reactivity (no VDOM)
9
+ * - Server-side rendering with hydration
10
+ * - JSX and Lit-html support
11
+ */
12
+ // ============================================================================
13
+ // REACTIVE PRIMITIVES (from @fluixi/reactive)
14
+ // ============================================================================
15
+ export { createEffect, createMemo, createSignal, createResource, createRoot, createComputed, createRenderEffect, onCleanup, getOwner, runWithOwner, batch, untrack, createDeferred, setOwner, } from '@fluixi/reactive/signal';
16
+ // } from '@fluixi/core/rx';
17
+ export { createDebounce, createSelector } from '@fluixi/reactive/signal';
18
+ export { readSignal as read, reduceSignal as reduce, } from '@fluixi/reactive/operators';
19
+ export { createStore, untrackStore, Store } from '@fluixi/reactive/store';
20
+ // ============================================================================
21
+ // SECTION 2 — createComponent & LIFECYCLE
22
+ // ============================================================================
23
+ export { createComponent, onMount, onUnmount, lazy,
24
+ // Hooks
25
+ useEffect, useMemo, useRef, useReducer, useEventListener, useCallback, render, portal, isRenderable, initDelegation, cleanupDelegation,
26
+ // Context API (Section 9) - from core for proper nesting
27
+ Suspense,
28
+ // Dev mode
29
+ isDev, devOnly, DEV,
30
+ // Internal
31
+ getSharedConfig, $component, } from './render/index.js';
32
+ export * from './context/index.js';
33
+ // Isomorphic request state (server-resolved → serialized → client-seeded).
34
+ export { createIsomorphicState, } from './isomorphic.js';
35
+ // ============================================================================
36
+ // SECTION 7 — RENDERING (CLIENT)
37
+ // ============================================================================
38
+ // export { render } from './core/index.js';
39
+ // export type { RenderOptions } from './render/index.js';
40
+ // ============================================================================
41
+ // LIT-HTML INTEGRATION
42
+ // ============================================================================
43
+ // Lit (html/svg/nothing/litRender/LitElement and the $-directives below) lives in
44
+ // @fluixi/lit — import it from there directly. It is NOT re-exported here: lit extends
45
+ // HTMLElement at module init, so re-exporting it dragged lit into SSR/prod server bundles
46
+ // (HTMLElement is not defined). Keeping this barrel lit-free keeps the core out of that.
47
+ // ============================================================================
48
+ // DOM UTILITIES (from @fluixi/dom)
49
+ // ============================================================================
50
+ // import {For as _For, ForProps, ForPropsKeyed, ForPropsUnkeyed} from "@fluixi/dom"
51
+ // export function For<T, U>(props: ForPropsKeyed<T, U>): Accessor<U[]>;
52
+ // export function For<T, U>(props: ForPropsUnkeyed<T, U>): Accessor<U[]>;
53
+ // export function For<T, U>(props: ForProps<T, U>): Accessor<U[]> { return _For(props as any); }
54
+ export {
55
+ // Framework-agnostic reactive attribute maps (return Accessor<string>)
56
+ classMap, styleMap, } from '@fluixi/dom';
57
+ export * from './control-flow.js';
58
+ // Lit-specific directives ($classMap/$styleMap/litrx) and lit control flow
59
+ // ($show/$for/$switch/$portal/$if/$each) live in @fluixi/lit — import from there.
60
+ // (Framework-agnostic classMap/styleMap above come from @fluixi/dom and stay here.)
61
+ export {
62
+ // DOM Manipulation
63
+ insert, spread, setAttribute, setProperty, addClass, removeClass, toggleClass,
64
+ // Event Handling
65
+ delegateEvents,
66
+ // Utilities
67
+ isDOMNode, isLitTemplateResult, hydrate, } from '@fluixi/dom';
68
+ // ============================================================================
69
+ // JSX RUNTIME
70
+ // ============================================================================
71
+ export { jsx, jsxs, Fragment } from './jsx-runtime/index.js';
72
+ // ============================================================================
73
+ // FRAMEWORK METADATA
74
+ // ============================================================================
75
+ /**
76
+ * Framework version
77
+ */
78
+ export const VERSION = '0.0.1';
79
+ /**
80
+ * Framework name
81
+ */
82
+ export const FRAMEWORK_NAME = 'Fluixi';
83
+ /**
84
+ * Get framework info
85
+ */
86
+ export function getFrameworkInfo() {
87
+ return {
88
+ name: FRAMEWORK_NAME,
89
+ version: VERSION,
90
+ features: {
91
+ ssr: true,
92
+ hydration: true,
93
+ jsx: true,
94
+ litHtml: true,
95
+ signals: true,
96
+ fineGrained: true,
97
+ lazy: true,
98
+ hooks: true,
99
+ devMode: true,
100
+ },
101
+ };
102
+ }
103
+ // ============================================================================
104
+ // DEFAULT EXPORT
105
+ // ============================================================================
106
+ import { createSignal as _createSignal, createEffect as _createEffect, createMemo as _createMemo, createRoot as _createRoot, batch as _batch, untrack as _untrack, onCleanup as _onCleanup, } from '@fluixi/reactive/signal';
107
+ import { createComponent as _createComponent, onMount as _onMount, onUnmount as _onUnmount,
108
+ // lazy as _lazy,
109
+ useEffect as _useEffect, useMemo as _useMemo, useRef as _useRef, useReducer as _useReducer, useEventListener as _useEventListener, useCallback as _useCallback, ensureIntegration, } from './render/component.js';
110
+ import { createContext as _createContext, useContext as _useContext, } from './context/index.js';
111
+ // } from './core/component.js';
112
+ import { render as _render } from './render/index.js';
113
+ // './core/index.js';
114
+ // Web Component support moved to @fluixi/element (wc-element repo) — import from there.
115
+ export default {
116
+ // Core
117
+ createSignal: _createSignal,
118
+ createEffect: _createEffect,
119
+ createMemo: _createMemo,
120
+ createRoot: _createRoot,
121
+ batch: _batch,
122
+ untrack: _untrack,
123
+ onCleanup: _onCleanup,
124
+ // Context (from component for proper support)
125
+ createContext: _createContext,
126
+ useContext: _useContext,
127
+ // Components
128
+ createComponent: _createComponent,
129
+ onMount: _onMount,
130
+ onUnmount: _onUnmount,
131
+ // lazy: _lazy,
132
+ // Hooks
133
+ useEffect: _useEffect,
134
+ useMemo: _useMemo,
135
+ useRef: _useRef,
136
+ useReducer: _useReducer,
137
+ useEventListener: _useEventListener,
138
+ useCallback: _useCallback,
139
+ // Rendering
140
+ render: _render,
141
+ // portal: _portal,
142
+ // Metadata
143
+ VERSION,
144
+ FRAMEWORK_NAME,
145
+ getFrameworkInfo,
146
+ };
147
+ ensureIntegration('index');
@@ -0,0 +1 @@
1
+ var te=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var re=Object.prototype.hasOwnProperty;var j=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of oe(t))!re.call(e,r)&&r!==n&&te(e,r,{get:()=>t[r],enumerable:!(o=ne(t,r))||o.enumerable});return e},D=(e,t,n)=>(j(e,t,"default"),n&&j(n,t,"default"));import{createEffect as pn,createMemo as ln,createSignal as yn,createResource as mn,createRoot as xn,createComputed as vn,createRenderEffect as Cn,onCleanup as hn,getOwner as Tn,runWithOwner as Sn,batch as bn,untrack as gn,createDeferred as Pn,setOwner as wn}from"@fluixi/reactive/signal";import{createDebounce as kn,createSelector as Rn}from"@fluixi/reactive/signal";import{readSignal as Ln,reduceSignal as _n}from"@fluixi/reactive/operators";import{createStore as Mn,untrackStore as In,Store as Fn}from"@fluixi/reactive/store";import{createRoot as we}from"@fluixi/reactive/signal";import{isDOMNode as Ee,delegateEvents as q,registerLitRender as ke,insert as Re}from"@fluixi/dom";import{registerCreateComponent as se,asComponent as ie}from"@fluixi/dom";import{untrack as U,onCleanup as d,getOwner as L,createEffect as x,createMemo as $,createSignal as ae,isSignal as ce,batch as ue,runWithOwner as z}from"@fluixi/reactive/signal";var de={context:null,owner:null};function N(){return de}var v=typeof process<"u"&&!1,O=Symbol.for("fluixi-lifecycle");function K(){let e=L();if(!e)return null;if(!e[O]){let t={mounts:[],effects:[],scheduled:!1};e[O]=t}return e[O]}function V(e){if(e.scheduled)return;e.scheduled=!0;let t=L();queueMicrotask(()=>{z(t,()=>{for(let n of e.mounts)try{let o=n();typeof o=="function"&&d(o)}catch(o){console.error("Error in onMount callback:",o)}for(let n of e.effects){let o;x(()=>{o&&o(),o=n()}),d(()=>{o&&o()})}e.mounts=[],e.effects=[]})})}function p(e){se(l)}function l(e,t){return _(e,t)}function _(e,t){let n=typeof e=="function"?U(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!ce(n)){try{n.$name=e.name}catch{}return ie(n)}return n}function C(e,t=!0){let n=K();if(n){if(!t){n.scheduled||e();return}n.mounts.push(e),V(n)}else{if(!t){e();return}x(()=>{let o=U(e);typeof o=="function"&&d(o)})}}function h(e){d(e)}function y(e){let t=K();if(t)t.effects.push(e),V(t);else{let n;x(()=>{n&&n(),n=e()}),d(()=>{n&&n()})}}function T(e){return $(e)}function S(e){let t={current:e};return d(()=>{t.current=null}),t}function b(e,t){let[n,o]=ae(t);return[n,s=>{o(e(n(),s))}]}function g(e,t,n,o){y(()=>{let r=e&&"current"in e?e.current:e;if(r)return r.addEventListener(t,n,o),()=>{r.removeEventListener(t,n,o)}})}function P(e){return e}function W(){return v}function J(e){v&&e()}import{createSignal as fe,createMemo as pe,createEffect as vt,createRenderEffect as le,isSignal as A,useContext as ye,createContext as me,createSuspenseBoundary as xe,provideSuspense as X}from"@fluixi/reactive/signal";import{asSuspense as ve,isComponent as Ce,createComponent as he,runWithoutHydration as Te}from"@fluixi/dom";function B(e){return!!(e&&typeof e=="object"&&typeof e.then=="function"||e instanceof Promise)}var Se=me();function w(e){return he(be,e)}function be(e){let t=xe(),n=ye(Se),o=n?n.register(t.inFallback):void 0;function r(i){return i==null||typeof i=="boolean"?null:typeof i=="function"&&Ce(i)&&!A(i)?i():i}let s=Te(()=>r(e.fallback??null)),c=X(t,()=>e.children);X(t,()=>{le(()=>{let i=c;if(Array.isArray(i))for(let R of i)typeof R=="function"&&A(R)&&R();else typeof i=="function"&&A(i)&&i()})});let[u,a]=fe(void 0),F=B(c);return F&&(t.increment(),c.then(i=>{a(()=>i),t.decrement()},()=>t.decrement())),pe(()=>(o?o.showFallback():t.inFallback())?s:F?u():c)}ve(w);Object.defineProperty(w,"__suspense",{value:!0,enumerable:!0});import{untrack as H,createMemo as ge,createResource as Pe}from"@fluixi/reactive/signal";function Y(e,t){let n,o,r;function s(){return o||(o=e().then(u=>n=u.default)),o}t?.preload&&s();let c=(u=>{if(n){let a=n;return H(()=>a(u))}if(!r){let[a]=Pe(()=>s());if(r=a,a.error)throw a.error}return ge(()=>{let a=r();return a?H(()=>a(u)):void 0},void 0,{name:"lazy"})});return c.preload=()=>s().then(()=>{}),c.$lazy=!0,c.loader=e,c}typeof window<"u"&&import("lit").then(e=>ke(e.render));var M=typeof window>"u";function E(e,t,n={}){if(p("render"),q(["click","input","change","submit"]),M)throw new Error("render() is for client-side only. Use renderToString() on server.");if(!t)throw new Error("Container element is required");let o;return we(r=>{o=r;let s=typeof e=="function"?e():e;t.textContent="",t.setAttribute("fluixi-js","v1"),Re(t,()=>s)}),()=>{o&&(o(),o=void 0)}}function Oe(e){return e&&typeof e=="object"&&(e._$litType$!==void 0||e._$litDirective$!==void 0)}function Le(e,t,n={}){let o=document.createElement("div");o.setAttribute("data-portal","true"),t.appendChild(o);let r=E(e,o,n);return()=>{r(),t.contains(o)&&t.removeChild(o)}}function _e(e){return!!(e==null||typeof e=="function"||Ee(e)||Oe(e)||Array.isArray(e)||typeof e=="string"||typeof e=="number"||typeof e=="boolean")}function Ae(){M||q(["click","input","change","submit"])}function Me(){}import{asProvider as Ie}from"@fluixi/dom";import{createContext as Fe,useContext as je}from"@fluixi/reactive/signal";import{readChildren as De}from"@fluixi/reactive/signal";p("index");var G=!1;function Ue(){G||(G=!0,!(typeof process<"u")&&console.warn("[fluixi] createProvider({ context, value, children }) reads `children` eagerly: the object literal materialises `children` BEFORE the context is stamped, so a routed <Outlet/> that has siblings inside the provider renders detached and its descendants see no context under SSR. Use the lazy form instead:\n createProvider(Context, value, props) // children stays a getter\n // or JSX: <Context.Provider value={…}>{props.children}</Context.Provider>"))}function I(e,t,n){let o=!!e?.Provider,r=o?e:e.context,s=o?t:e.value,c=o?!1:e.debug??!1;o||Ue();let u=typeof s=="function"?s():s,a=o?n:e;return r.Provider({value:u,get children(){return a?.children},debug:c})}function $e(e){let t=k(e);return[t,o=>I(t,o.value,o)]}function Q(e,t){if(e.length===0)return De(()=>t);let[n,o]=e[0],r=e.slice(1);return I(n,o,{get children(){return Q(r,t)}})}function ze(e){return t=>{let n=m(e);return t.children(n)}}function Ne(e,t){let n=m(e);return n===e.defaultValue?t():n}function k(e){let t=Fe(e),n=o=>(o.debug,t.Provider({value:o.value,get children(){return o.children},debug:o.debug}));return typeof Symbol<"u"&&Symbol.for&&(n.$$typeof=Symbol.for("react.provider")),n.$$typeof=Symbol.for("react.provider"),{id:t.id,Provider:Ie(n),defaultValue:e}}function m(e){let t=je(e);return t!==void 0?t:e.defaultValue}import{createSignal as Ke,createMemo as Wt}from"@fluixi/reactive/signal";import{getServerData as Ve}from"@fluixi/dom";var We="__fluixi_iso_states__",Je="__iso:";function Xe(){return globalThis[We]??=new Map}function Be(e){if(typeof window>"u")return;let t=Ve();return t?t[Je+e]:void 0}function He(e,t){let n=Be(e),o=n!==void 0?n:typeof window<"u"&&t.client?t.client():t.fallback,[r,s]=Ke(o);return Xe().set(e,{server:t.server,set:s}),{value:r,set:s,key:e}}import{classMap as zn,styleMap as Nn}from"@fluixi/dom";import{Show as Yt,For as qt,Index as Gt,Switch as Qt,Match as Zt,Dynamic as en,ErrorBoundary as tn,Portal as nn}from"@fluixi/dom";import{insert as Wn,spread as Jn,setAttribute as Xn,setProperty as Bn,addClass as Hn,removeClass as Yn,toggleClass as qn,delegateEvents as Gn,isDOMNode as Qn,isLitTemplateResult as Zn,hydrate as eo}from"@fluixi/dom";var f={};D(f,on);import*as on from"@fluixi/jsx/jsx-runtime";import{createSignal as qe,createEffect as Ge,createMemo as Qe,createRoot as Ze,batch as et,untrack as tt,onCleanup as nt}from"@fluixi/reactive/signal";var Z="0.0.1",ee="Fluixi";function Ye(){return{name:ee,version:Z,features:{ssr:!0,hydration:!0,jsx:!0,litHtml:!0,signals:!0,fineGrained:!0,lazy:!0,hooks:!0,devMode:!0}}}var un={createSignal:qe,createEffect:Ge,createMemo:Qe,createRoot:Ze,batch:et,untrack:tt,onCleanup:nt,createContext:k,useContext:m,createComponent:l,onMount:C,onUnmount:h,useEffect:y,useMemo:T,useRef:S,useReducer:b,useEventListener:g,useCallback:P,render:E,VERSION:Z,FRAMEWORK_NAME:ee,getFrameworkInfo:Ye};p("index");var export_Fragment=f.Fragment;var export_jsx=f.jsx;var export_jsxs=f.jsxs;export{_ as $component,v as DEV,en as Dynamic,tn as ErrorBoundary,ee as FRAMEWORK_NAME,qt as For,export_Fragment as Fragment,Gt as Index,Zt as Match,nn as Portal,Yt as Show,Fn as Store,w as Suspense,Qt as Switch,Z as VERSION,Hn as addClass,bn as batch,zn as classMap,Me as cleanupDelegation,Q as composeProviders,l as createComponent,vn as createComputed,ze as createConsumer,k as createContext,$e as createContextWithProvider,kn as createDebounce,Pn as createDeferred,pn as createEffect,He as createIsomorphicState,ln as createMemo,I as createProvider,Cn as createRenderEffect,mn as createResource,xn as createRoot,Rn as createSelector,yn as createSignal,Mn as createStore,un as default,Gn as delegateEvents,J as devOnly,Ye as getFrameworkInfo,Tn as getOwner,N as getSharedConfig,eo as hydrate,Ae as initDelegation,Wn as insert,Qn as isDOMNode,W as isDev,Zn as isLitTemplateResult,_e as isRenderable,export_jsx as jsx,export_jsxs as jsxs,Y as lazy,hn as onCleanup,C as onMount,h as onUnmount,Le as portal,Ln as read,_n as reduce,Yn as removeClass,E as render,Sn as runWithOwner,Xn as setAttribute,wn as setOwner,Bn as setProperty,Jn as spread,Nn as styleMap,qn as toggleClass,gn as untrack,In as untrackStore,P as useCallback,m as useContext,y as useEffect,g as useEventListener,T as useMemo,Ne as useProvide,b as useReducer,S as useRef};
@@ -0,0 +1 @@
1
+ "use strict";var f=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var I=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var S=(t,e)=>{for(var s in e)f(t,s,{get:e[s],enumerable:!0})},h=(t,e,s,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of I(e))!g.call(t,n)&&n!==s&&f(t,n,{get:()=>e[n],enumerable:!(i=p(e,n))||i.enumerable});return t};var k=t=>h(f({},"__esModule",{value:!0}),t);var _={};S(_,{createIsomorphicState:()=>v,createIsomorphicStore:()=>P});module.exports=k(_);var a=require("@fluixi/reactive/signal"),T=require("@fluixi/dom"),x="__fluixi_iso_states__",K="__iso:";function b(){return globalThis[x]??=new Map}function u(t){if(typeof window>"u")return;let e=(0,T.getServerData)();return e?e[K+t]:void 0}function v(t,e){let s=u(t),i=s!==void 0?s:typeof window<"u"&&e.client?e.client():e.fallback,[n,o]=(0,a.createSignal)(i);return b().set(t,{server:e.server,set:o}),{value:n,set:o,key:t}}function P(t,e){let s=u(t)!==void 0,i=v(t,{server:e.server,fallback:e.fallback}),n=()=>i.value()??e.fallback,o=r=>{if(!(!e.persist||typeof localStorage>"u"))try{localStorage.setItem(e.persist,JSON.stringify(r))}catch{}},d=r=>{i.set(r),o(r)},m=(r,y)=>{d({...n(),[r]:y})},l={};for(let r of Object.keys(e.fallback))l[r]=(0,a.createMemo)(()=>n()[r]);let c=null;return{value:n,fields:l,set:d,setField:m,ensureInit:()=>s||!e.client?Promise.resolve():(c||(c=Promise.resolve(e.client()).then(r=>{d(r)}).catch(r=>{throw c=null,r})),c),key:t}}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Isomorphic request state — the generic form of "ensureInit + transfer".
3
+ *
4
+ * A value that is resolved ONCE on the server (per request, before the app renders),
5
+ * serialized into the page, and seeded SYNCHRONOUSLY on the client so the first client
6
+ * render matches the server (no hydration mismatch) and nothing refetches.
7
+ *
8
+ * - Server: @fluixi/server's `preloadServerState(event)` walks the registry below,
9
+ * runs each `server(event)` resolver, sets the signal, and stashes the value for
10
+ * serialization (it lands in `window.__FX_DATA__['__iso:<key>']`).
11
+ * - Client: `createIsomorphicState` reads that seed at creation and starts there.
12
+ *
13
+ * This module is client-safe (no node imports) so app stores can call it on both sides.
14
+ * It talks to @fluixi/server only through a `globalThis` registry — no import edge.
15
+ *
16
+ * NOTE (prototype): the signal is module-scoped, so concurrent SSR requests share it.
17
+ * That is fine for a single default value; per-user, per-request isolation wants the
18
+ * request-scoped (AsyncLocalStorage) store — a follow-up.
19
+ */
20
+ import { type Accessor } from '@fluixi/reactive/signal';
21
+ export interface IsomorphicState<T> {
22
+ /** Reactive accessor for the current value (a real signal — safe in JSX/control flow). */
23
+ value: Accessor<T | undefined>;
24
+ /** Update the value (client-side preference changes, optimistic updates). */
25
+ set: (v: T | undefined) => void;
26
+ /** Stable serialization key. */
27
+ key: string;
28
+ }
29
+ export interface IsomorphicOptions<T> {
30
+ /** Resolve the value on the server for THIS request (receives the RequestEvent). */
31
+ server: (event: any) => T | Promise<T>;
32
+ /** Optional client-only initial value when there is no server seed (pure SPA load). */
33
+ client?: () => T | undefined;
34
+ /** Value before resolution. */
35
+ fallback?: T;
36
+ }
37
+ export declare function createIsomorphicState<T>(key: string, options: IsomorphicOptions<T>): IsomorphicState<T>;
38
+ export interface IsomorphicStore<T extends Record<string, any>> {
39
+ /** Reactive accessor for the whole record (always defined — falls back to `fallback`). */
40
+ value: Accessor<T>;
41
+ /** Per-field reactive accessors, one for every key of `fallback`. */
42
+ fields: {
43
+ [K in keyof T]: Accessor<T[K]>;
44
+ };
45
+ /** Replace the whole record. */
46
+ set: (v: T) => void;
47
+ /** Update ONE field, preserving the rest. */
48
+ setField: <K extends keyof T>(key: K, val: T[K]) => void;
49
+ /**
50
+ * Run the async `client` resolver exactly once (memoised; the promise is reset on
51
+ * failure so a later call can retry). A NO-OP when the value was server-seeded — the
52
+ * server already resolved and transferred it, so there is nothing to fetch.
53
+ */
54
+ ensureInit: () => Promise<void>;
55
+ /** Stable serialization key. */
56
+ key: string;
57
+ }
58
+ export interface IsomorphicStoreOptions<T> {
59
+ /** Resolve the record on the server for THIS request (receives the RequestEvent). */
60
+ server: (event: any) => T | Promise<T>;
61
+ /** Resolve the record on a pure-SPA cold load (no server seed). Run once by ensureInit(). */
62
+ client?: () => T | Promise<T>;
63
+ /** Value before resolution / the per-field accessor key set. Required for a store. */
64
+ fallback: T;
65
+ /** localStorage key to mirror the record into on every write (optional). */
66
+ persist?: string;
67
+ }
68
+ export declare function createIsomorphicStore<T extends Record<string, any>>(key: string, options: IsomorphicStoreOptions<T>): IsomorphicStore<T>;
69
+ //# sourceMappingURL=isomorphic.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isomorphic.d.ts","sourceRoot":"","sources":["../../../src/lib/isomorphic.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAA4B,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAelF,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,0FAA0F;IAC1F,KAAK,EAAE,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAC/B,6EAA6E;IAC7E,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;IAChC,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,oFAAoF;IACpF,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvC,uFAAuF;IACvF,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,CAAC,CAAC;CACd;AASD,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,eAAe,CAAC,CAAC,CAAC,CAapB;AAkBD,MAAM,WAAW,eAAe,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;IAC5D,0FAA0F;IAC1F,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IACnB,qEAAqE;IACrE,MAAM,EAAE;SAAG,CAAC,IAAI,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAAE,CAAC;IAC3C,gCAAgC;IAChC,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,EAAE,CAAC,CAAC,SAAS,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;IACzD;;;;OAIG;IACH,UAAU,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,gCAAgC;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,sBAAsB,CAAC,CAAC;IACvC,qFAAqF;IACrF,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvC,6FAA6F;IAC7F,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC9B,sFAAsF;IACtF,QAAQ,EAAE,CAAC,CAAC;IACZ,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACjE,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,GACjC,eAAe,CAAC,CAAC,CAAC,CAmDpB"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Isomorphic request state — the generic form of "ensureInit + transfer".
3
+ *
4
+ * A value that is resolved ONCE on the server (per request, before the app renders),
5
+ * serialized into the page, and seeded SYNCHRONOUSLY on the client so the first client
6
+ * render matches the server (no hydration mismatch) and nothing refetches.
7
+ *
8
+ * - Server: @fluixi/server's `preloadServerState(event)` walks the registry below,
9
+ * runs each `server(event)` resolver, sets the signal, and stashes the value for
10
+ * serialization (it lands in `window.__FX_DATA__['__iso:<key>']`).
11
+ * - Client: `createIsomorphicState` reads that seed at creation and starts there.
12
+ *
13
+ * This module is client-safe (no node imports) so app stores can call it on both sides.
14
+ * It talks to @fluixi/server only through a `globalThis` registry — no import edge.
15
+ *
16
+ * NOTE (prototype): the signal is module-scoped, so concurrent SSR requests share it.
17
+ * That is fine for a single default value; per-user, per-request isolation wants the
18
+ * request-scoped (AsyncLocalStorage) store — a follow-up.
19
+ */
20
+ import { createSignal, createMemo } from '@fluixi/reactive/signal';
21
+ import { getServerData } from '@fluixi/dom';
22
+ const REGISTRY_KEY = '__fluixi_iso_states__';
23
+ const SEED_PREFIX = '__iso:';
24
+ function registry() {
25
+ return (globalThis[REGISTRY_KEY] ??= new Map());
26
+ }
27
+ /** The server seed for `key`, if the page was server-rendered. */
28
+ function readSeed(key) {
29
+ if (typeof window === 'undefined')
30
+ return undefined;
31
+ const data = getServerData();
32
+ return data ? data[SEED_PREFIX + key] : undefined;
33
+ }
34
+ export function createIsomorphicState(key, options) {
35
+ const seed = readSeed(key);
36
+ const initial = seed !== undefined
37
+ ? seed
38
+ : typeof window !== 'undefined' && options.client
39
+ ? options.client()
40
+ : options.fallback;
41
+ const [value, set] = createSignal(initial);
42
+ registry().set(key, { server: options.server, set: set });
43
+ return { value, set: set, key };
44
+ }
45
+ export function createIsomorphicStore(key, options) {
46
+ // Whether the server transferred a value for this key (read BEFORE the base state
47
+ // consumes the seed). When true, ensureInit() must not refetch on the client.
48
+ const seeded = readSeed(key) !== undefined;
49
+ const base = createIsomorphicState(key, {
50
+ server: options.server,
51
+ fallback: options.fallback,
52
+ });
53
+ const value = () => base.value() ?? options.fallback;
54
+ const persistWrite = (v) => {
55
+ if (!options.persist || typeof localStorage === 'undefined')
56
+ return;
57
+ try {
58
+ localStorage.setItem(options.persist, JSON.stringify(v));
59
+ }
60
+ catch {
61
+ /* quota / private mode — persistence is best-effort */
62
+ }
63
+ };
64
+ const set = (v) => {
65
+ base.set(v);
66
+ persistWrite(v);
67
+ };
68
+ const setField = (k, val) => {
69
+ set({ ...value(), [k]: val });
70
+ };
71
+ const fields = {};
72
+ for (const k of Object.keys(options.fallback)) {
73
+ fields[k] = createMemo(() => value()[k]);
74
+ }
75
+ let initPromise = null;
76
+ const ensureInit = () => {
77
+ if (seeded || !options.client)
78
+ return Promise.resolve();
79
+ if (!initPromise) {
80
+ initPromise = Promise.resolve(options.client())
81
+ .then((v) => {
82
+ set(v);
83
+ })
84
+ .catch((e) => {
85
+ initPromise = null; // allow a retry on the next call
86
+ throw e;
87
+ });
88
+ }
89
+ return initPromise;
90
+ };
91
+ return { value, fields, set, setField, ensureInit, key };
92
+ }
@@ -0,0 +1 @@
1
+ import{createSignal as u,createMemo as v}from"@fluixi/reactive/signal";import{getServerData as m}from"@fluixi/dom";var y="__fluixi_iso_states__",p="__iso:";function I(){return globalThis[y]??=new Map}function f(r){if(typeof window>"u")return;let e=m();return e?e[p+r]:void 0}function g(r,e){let s=f(r),i=s!==void 0?s:typeof window<"u"&&e.client?e.client():e.fallback,[n,o]=u(i);return I().set(r,{server:e.server,set:o}),{value:n,set:o,key:r}}function x(r,e){let s=f(r)!==void 0,i=g(r,{server:e.server,fallback:e.fallback}),n=()=>i.value()??e.fallback,o=t=>{if(!(!e.persist||typeof localStorage>"u"))try{localStorage.setItem(e.persist,JSON.stringify(t))}catch{}},a=t=>{i.set(t),o(t)},l=(t,T)=>{a({...n(),[t]:T})},d={};for(let t of Object.keys(e.fallback))d[t]=v(()=>n()[t]);let c=null;return{value:n,fields:d,set:a,setField:l,ensureInit:()=>s||!e.client?Promise.resolve():(c||(c=Promise.resolve(e.client()).then(t=>{a(t)}).catch(t=>{throw c=null,t})),c),key:r}}export{g as createIsomorphicState,x as createIsomorphicStore};
@@ -0,0 +1 @@
1
+ "use strict";var m=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var p=(x,i,r,e)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of s(i))!u.call(x,o)&&o!==r&&m(x,o,{get:()=>i[o],enumerable:!(e=l(i,o))||e.enumerable});return x},t=(x,i,r)=>(p(x,i,"default"),r&&p(r,i,"default"));var J=x=>p(m({},"__esModule",{value:!0}),x);var f={};module.exports=J(f);t(f,require("@fluixi/jsx/jsx-runtime"),module.exports);
@@ -0,0 +1,13 @@
1
+ export * from '@fluixi/jsx/jsx-runtime';
2
+ export type { JSX } from '@fluixi/jsx';
3
+ /**
4
+ * Global JSX namespace augmentation for "jsx": "preserve" mode.
5
+ *
6
+ * TypeScript with "jsx": "preserve" uses the global JSX namespace for element type
7
+ * checking (not jsxImportSource). This augmentation is applied automatically whenever
8
+ * any file imports from @fluixi/core, because TypeScript processes declare global
9
+ * from all transitively-loaded modules.
10
+ *
11
+ * Pattern: same as SolidJS — the framework's main entry carries the global augmentation.
12
+ */
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/jsx-runtime/index.ts"],"names":[],"mappings":"AAEA,cAAc,yBAAyB,CAAC;AAExC,YAAY,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvC;;;;;;;;;GASG"}
@@ -0,0 +1,23 @@
1
+ export * from '@fluixi/jsx/jsx-runtime';
2
+ /**
3
+ * Global JSX namespace augmentation for "jsx": "preserve" mode.
4
+ *
5
+ * TypeScript with "jsx": "preserve" uses the global JSX namespace for element type
6
+ * checking (not jsxImportSource). This augmentation is applied automatically whenever
7
+ * any file imports from @fluixi/core, because TypeScript processes declare global
8
+ * from all transitively-loaded modules.
9
+ *
10
+ * Pattern: same as SolidJS — the framework's main entry carries the global augmentation.
11
+ */
12
+ // declare global {
13
+ // namespace JSX {
14
+ // type Element = FluixiJSX.Element;
15
+ // interface IntrinsicElements extends FluixiJSX.IntrinsicElements {}
16
+ // interface ElementChildrenAttribute {
17
+ // children: {};
18
+ // }
19
+ // interface IntrinsicAttributes {
20
+ // key?: string | number;
21
+ // }
22
+ // }
23
+ // }
@@ -0,0 +1 @@
1
+ export*from"@fluixi/jsx/jsx-runtime";
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var p=(r,o,f,x)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of c(o))!d.call(r,e)&&e!==f&&a(r,e,{get:()=>o[e],enumerable:!(x=b(o,e))||x.enumerable});return r},t=(r,o,f)=>(p(r,o,"default"),f&&p(f,o,"default"));var g=r=>p(a({},"__esModule",{value:!0}),r);var m={};module.exports=g(m);t(m,require("@fluixi/jsx/jsx-dev-runtime"),module.exports);
@@ -0,0 +1,2 @@
1
+ export * from '@fluixi/jsx/jsx-dev-runtime';
2
+ //# sourceMappingURL=jsx-dev-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../../../../src/lib/jsx-runtime/jsx-dev-runtime.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from '@fluixi/jsx/jsx-dev-runtime';
@@ -0,0 +1 @@
1
+ export*from"@fluixi/jsx/jsx-dev-runtime";
@@ -0,0 +1,13 @@
1
+ "use strict";var M=Object.create;var D=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty;var z=(t,n)=>{for(var e in n)D(t,e,{get:n[e],enumerable:!0})},I=(t,n,e,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of k(n))!U.call(t,o)&&o!==e&&D(t,o,{get:()=>n[o],enumerable:!(s=N(n,o))||s.enumerable});return t};var b=(t,n,e)=>(e=t!=null?M(J(t)):{},I(n||!t||!t.__esModule?D(e,"default",{value:t,enumerable:!0}):e,t)),B=t=>I(D({},"__esModule",{value:!0}),t);var st={};z(st,{fluixiRoutesPlugin:()=>et});module.exports=B(st);var m=b(require("fs"),1),R=b(require("path"),1),G=require("vite-plugin-node-polyfills");var y=b(require("fs"),1),h=b(require("path"),1),X=[".tsx",".ts",".jsx",".js"];function W(t,n={}){let e=n.extensions??X,s=h.resolve(t);return y.existsSync(s)?C(s,s,"",e):[]}function C(t,n,e,s){let o=y.readdirSync(t,{withFileTypes:!0}),r=[],g=null,i=[],f=[];for(let u of o)u.isDirectory()?f.push(u):u.isFile()&&Y(u.name,s)&&i.push(u);let a,c=[];for(let u of i)w(u.name)==="layout"?a=L(u.name,t,n,e,!0):c.push(u);let d=[];for(let u of c)d.push(L(u.name,t,n,e,!1));let l=[];for(let u of f){let p=u.name,_=q(p),A=_?"":H(p),P=A?F(e,A):e,$=C(h.join(t,p),n,P,s);if(_)l.push(...$);else{let S=$.find(x=>x.isLayout&&x.urlPath===P),O=$.filter(x=>!x.isLayout||x.urlPath!==P);S?(S.children=[...S.children,...O],l.push(S)):O.length>0&&l.push(...O)}}return a?(a.children=[...d,...l],r.push(a)):r.push(...d,...l),K(r)}function L(t,n,e,s,o){let r=w(t),g=h.relative(e,h.join(n,t)),i=r==="index",f=r.startsWith("[..."),a=!f&&r.startsWith("[")&&r.endsWith("]"),c;o?c="":i?c="/":f?c=`*${r.slice(4,-1)}`:a?c=`:${r.slice(1,-1)}`:c=r;let d=o||i?s||"/":F(s,c),l=h.join(n,t),u=!1;try{let p=y.readFileSync(l,"utf-8");u=/export\s+(const|function|async\s+function)\s+routeData\b/.test(p)}catch{}return{filePath:g.replace(/\\/g,"/"),urlSegment:c,urlPath:d,isLayout:o,isIndex:i,isDynamic:a,isCatchAll:f,isGroup:!1,children:[],parentUrlPath:s,hasRouteData:u,rootDir:e,dir:n}}function Y(t,n){return n.some(e=>t.endsWith(e))}function w(t){let n=t.lastIndexOf(".");return n>0?t.slice(0,n):t}function q(t){return t.startsWith("(")&&t.endsWith(")")}function H(t){return t.startsWith("[...")&&t.endsWith("]")?"*"+t.slice(4,-1):t.startsWith("[")&&t.endsWith("]")?":"+t.slice(1,-1):t}function F(t,n){return(t.endsWith("/")?t:t+"/")+n}function K(t){return t.sort((n,e)=>n.isLayout&&!e.isLayout?-1:!n.isLayout&&e.isLayout?1:n.isIndex&&!e.isIndex?-1:!n.isIndex&&e.isIndex?1:!n.isDynamic&&!n.isCatchAll&&(e.isDynamic||e.isCatchAll)?-1:(n.isDynamic||n.isCatchAll)&&!e.isDynamic&&!e.isCatchAll?1:n.isDynamic&&e.isCatchAll?-1:n.isCatchAll&&e.isDynamic?1:n.urlSegment.localeCompare(e.urlSegment))}function E(t,n){let e=[];return e.push("// Auto-generated by @fluixi/core route plugin"),e.push("// Do not edit manually"),e.push(""),e.push("import { lazy } from '@fluixi/core/router-next';"),e.push(""),e.push(`export const routes = ${T(t,n,0)};`),e.push(""),e.join(`
2
+ `)}function T(t,n,e){if(t.length===0)return"[]";let s=" ".repeat(e);return`[
3
+ ${t.map(r=>Q(r,n,e+1)).join(`,
4
+ `)}
5
+ ${s}]`}function Q(t,n,e){let s=" ".repeat(e),o=[],r=tt(t.filePath,n),g=Z(t);if(o.push(`${s} path: ${JSON.stringify(g)}`),o.push(`${s} component: lazy(() => import(${JSON.stringify(r)}))`),t.hasRouteData&&o.push(`${s} data: (args, __owner, __isCancelled) => import(${JSON.stringify(r)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; return __owner ? m.routeData(args) : m.routeData(args); })`),t.children.length>0){let i=T(t.children,n,e+1);o.push(`${s} children: ${i}`)}return`${s}{
6
+ ${o.join(`,
7
+ `)}
8
+ ${s}}`}function Z(t){return t.urlPath}function tt(t,n){return`${n.replace(/\\/g,"/").replace(/\/$/,"")}/${t}`}var V="virtual:fluixi-routes",j="\0"+V,v=`// Auto-generated by @fluixi/core fluixiRoutesPlugin — do not edit manually
9
+ declare module 'virtual:fluixi-routes' {
10
+ import type { RouteDefinition } from '@fluixi/core/router-next';
11
+ export const routes: RouteDefinition[];
12
+ }
13
+ `;function nt(t){let n=R.join(t,"src");if(!m.existsSync(n))return;let e=R.join(n,"fluixi-env.d.ts");(m.existsSync(e)?m.readFileSync(e,"utf8"):"")!==v&&m.writeFileSync(e,v,"utf8")}function et(t={}){let n=t.routesDir??"src/routes",e=t.extensions??[".tsx",".ts",".jsx",".js"],s="",r=t.polyfills!==!1?Object.assign({},(0,G.nodePolyfills)({include:["fs","path"]}),{apply:"serve"}):null,g={name:"fluixi-routes",enforce:"pre",configResolved(i){s=i.root||process.cwd(),nt(s)},resolveId(i){return i===V?j:null},load(i){if(i!==j)return null;let f=s||process.cwd(),a=R.resolve(f,n),d=W(a,{extensions:e}),l="./"+n;return E(d,l)},configureServer(i){let f=s||process.cwd(),a=R.resolve(f,n);i.watcher.add(a),i.watcher.on("all",(c,d)=>{if(!d.startsWith(a)||!["add","unlink","addDir","unlinkDir"].includes(c)||c!=="addDir"&&c!=="unlinkDir"&&!e.some(u=>d.endsWith(u)))return;let l=i.moduleGraph.getModuleById(j);l&&(i.moduleGraph.invalidateModule(l),i.ws.send({type:"full-reload"}))})}};return r?[r,g]:[g]}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @fileoverview Vite/Rollup plugin for file-system routing
3
+ * @module @fluixi/core/plugins/fluixi-routes-plugin
4
+ *
5
+ * Scans a routes directory at build time and generates a virtual module
6
+ * (virtual:fluixi-routes) containing the route tree. Replaces import.meta.glob.
7
+ */
8
+ export interface FluixiRoutesPluginOptions {
9
+ /** Path to routes directory, relative to project root. Default: 'src/routes' */
10
+ routesDir?: string;
11
+ /** File extensions to scan. Default: ['.tsx', '.ts', '.jsx', '.js'] */
12
+ extensions?: string[];
13
+ /**
14
+ * Inject browser polyfills for Node built-ins (Buffer/process/global/fs/path) via
15
+ * vite-plugin-node-polyfills. Default `true` (back-compat). Set `false` for SSR
16
+ * (the injected shims break server rendering); `@fluixi/start` passes `false`.
17
+ */
18
+ polyfills?: boolean;
19
+ }
20
+ export declare function fluixiRoutesPlugin(options?: FluixiRoutesPluginOptions): any[];
21
+ //# sourceMappingURL=fluixi-routes-plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluixi-routes-plugin.d.ts","sourceRoot":"","sources":["../../../../src/lib/plugins/fluixi-routes-plugin.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,MAAM,WAAW,yBAAyB;IACxC,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAuBD,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,yBAA8B,GACtC,GAAG,EAAE,CAwFP"}