@fluixi/core 1.0.0-alpha.91 → 1.0.0-alpha.93
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/core.global.js +2 -2
- package/dist/src/cdn/{chunk-MDJLC3PE.mjs → chunk-7XM7Q5VR.mjs} +271 -229
- package/dist/src/cdn/core.cjs +360 -253
- package/dist/src/cdn/core.mjs +92 -20
- package/dist/src/cdn/{router-JYFZP3EZ.mjs → router-VOY43YNM.mjs} +7 -3
- package/dist/src/index.cjs +547 -232
- package/dist/src/index.mjs +547 -223
- package/dist/src/lib/client/chunk-QT3RFKH6.mjs +53 -0
- package/dist/src/lib/client/index.cjs +310 -176
- package/dist/src/lib/client/index.d.ts.map +1 -1
- package/dist/src/lib/client/index.js +33 -18
- package/dist/src/lib/client/index.mjs +86 -15
- package/dist/src/lib/client/{router-I66EJO2Y.mjs → router-ADTS55OP.mjs} +244 -99
- package/dist/src/lib/context/context.cjs +35 -72
- package/dist/src/lib/context/context.d.ts +45 -291
- package/dist/src/lib/context/context.d.ts.map +1 -1
- package/dist/src/lib/context/context.js +65 -397
- package/dist/src/lib/context/context.mjs +38 -73
- package/dist/src/lib/context/index.cjs +35 -72
- package/dist/src/lib/context/index.d.ts +2 -2
- package/dist/src/lib/context/index.d.ts.map +1 -1
- package/dist/src/lib/context/index.js +1 -5
- package/dist/src/lib/context/index.mjs +38 -73
- package/dist/src/lib/core.cjs +546 -231
- package/dist/src/lib/core.d.ts +3 -1
- package/dist/src/lib/core.d.ts.map +1 -1
- package/dist/src/lib/core.js +5 -3
- package/dist/src/lib/core.mjs +546 -222
- package/dist/src/lib/env/index.cjs +1 -17
- package/dist/src/lib/env/index.d.ts +2 -14
- package/dist/src/lib/env/index.d.ts.map +1 -1
- package/dist/src/lib/env/index.js +2 -26
- package/dist/src/lib/env/index.mjs +1 -17
- package/dist/src/lib/i18n/index.cjs +17 -2
- package/dist/src/lib/i18n/index.d.ts +10 -0
- package/dist/src/lib/i18n/index.d.ts.map +1 -1
- package/dist/src/lib/i18n/index.js +17 -1
- package/dist/src/lib/i18n/index.mjs +17 -2
- package/dist/src/lib/index.cjs +64 -99
- package/dist/src/lib/index.mjs +43 -76
- package/dist/src/lib/isomorphic.cjs +9 -4
- package/dist/src/lib/isomorphic.d.ts +9 -2
- package/dist/src/lib/isomorphic.d.ts.map +1 -1
- package/dist/src/lib/isomorphic.js +11 -4
- package/dist/src/lib/isomorphic.mjs +9 -4
- package/dist/src/lib/jsx-runtime/index.cjs +1 -1
- package/dist/src/lib/jsx-runtime/index.mjs +1 -1
- package/dist/src/lib/jsx-runtime/jsx-dev-runtime.cjs +1 -1
- package/dist/src/lib/jsx-runtime/jsx-dev-runtime.mjs +1 -1
- package/dist/src/lib/plugins/fluixi-routes-plugin.cjs +2 -2
- package/dist/src/lib/plugins/fluixi-routes-plugin.mjs +2 -2
- package/dist/src/lib/plugins/index.cjs +3 -3
- package/dist/src/lib/plugins/index.mjs +3 -3
- package/dist/src/lib/plugins/route-codegen.cjs +2 -2
- package/dist/src/lib/plugins/route-codegen.js +1 -1
- package/dist/src/lib/plugins/route-codegen.mjs +2 -2
- package/dist/src/lib/render/index.cjs +1 -1
- package/dist/src/lib/render/index.mjs +1 -1
- package/dist/src/lib/render/versions.cjs +1 -1
- package/dist/src/lib/render/versions.mjs +1 -1
- package/dist/src/lib/router/data.cjs +113 -115
- package/dist/src/lib/router/data.d.ts +63 -10
- package/dist/src/lib/router/data.d.ts.map +1 -1
- package/dist/src/lib/router/data.js +158 -68
- package/dist/src/lib/router/data.mjs +112 -112
- package/dist/src/lib/router/index.cjs +260 -163
- package/dist/src/lib/router/index.d.ts +22 -2
- package/dist/src/lib/router/index.d.ts.map +1 -1
- package/dist/src/lib/router/index.js +165 -22
- package/dist/src/lib/router/index.mjs +244 -143
- package/dist/src/lib/server/index.cjs +1 -1
- package/dist/src/lib/server/index.mjs +1 -1
- package/dist/src/lib/storage/cache.cjs +51 -0
- package/dist/src/lib/storage/cache.d.ts +18 -0
- package/dist/src/lib/storage/cache.d.ts.map +1 -0
- package/dist/src/lib/storage/cache.js +42 -0
- package/dist/src/lib/storage/cache.mjs +30 -0
- package/dist/src/lib/storage/index.cjs +246 -0
- package/dist/src/lib/storage/index.d.ts +83 -0
- package/dist/src/lib/storage/index.d.ts.map +1 -0
- package/dist/src/lib/storage/index.js +179 -0
- package/dist/src/lib/storage/index.mjs +231 -0
- package/dist/src/lib/storage/persisted.cjs +91 -0
- package/dist/src/lib/storage/persisted.d.ts +53 -0
- package/dist/src/lib/storage/persisted.d.ts.map +1 -0
- package/dist/src/lib/storage/persisted.js +75 -0
- package/dist/src/lib/storage/persisted.mjs +70 -0
- package/dist/src/lib/theme/color-scheme.cjs +281 -0
- package/dist/src/lib/theme/color-scheme.d.ts +61 -0
- package/dist/src/lib/theme/color-scheme.d.ts.map +1 -0
- package/dist/src/lib/theme/color-scheme.js +120 -0
- package/dist/src/lib/theme/color-scheme.mjs +265 -0
- package/dist/src/lib/theme/index.cjs +194 -37
- package/dist/src/lib/theme/index.d.ts +23 -11
- package/dist/src/lib/theme/index.d.ts.map +1 -1
- package/dist/src/lib/theme/index.js +73 -32
- package/dist/src/lib/theme/index.mjs +197 -35
- package/dist/src/lib/theme/provider.cjs +346 -0
- package/dist/src/lib/theme/provider.d.ts +34 -0
- package/dist/src/lib/theme/provider.d.ts.map +1 -0
- package/dist/src/lib/theme/provider.js +60 -0
- package/dist/src/lib/theme/provider.mjs +332 -0
- package/dist/src/routes.cjs +1 -1
- package/dist/src/routes.mjs +1 -1
- package/dist/src/utils.cjs +1 -1
- package/dist/src/utils.mjs +1 -1
- package/dist/src/version.generated.cjs +1 -1
- package/dist/src/version.generated.d.ts +1 -1
- package/dist/src/version.generated.js +1 -1
- package/dist/src/version.generated.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +18 -11
- package/dist/src/lib/client/chunk-SKXDXBGV.mjs +0 -133
package/dist/src/lib/index.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
createComputed as createComputed2,
|
|
23
23
|
createRenderEffect as createRenderEffect3,
|
|
24
24
|
onCleanup as onCleanup2,
|
|
25
|
-
getOwner as
|
|
25
|
+
getOwner as getOwner3,
|
|
26
26
|
runWithOwner as runWithOwner2,
|
|
27
27
|
batch as batch2,
|
|
28
28
|
untrack as untrack3,
|
|
@@ -44,7 +44,7 @@ import { createRoot as createRoot2 } from "@fluixi/reactive/signal";
|
|
|
44
44
|
import { registerCoreVersion } from "@fluixi/dom";
|
|
45
45
|
|
|
46
46
|
// src/version.generated.ts
|
|
47
|
-
var VERSION = "1.0.0-alpha.
|
|
47
|
+
var VERSION = "1.0.0-alpha.93";
|
|
48
48
|
|
|
49
49
|
// src/lib/render/versions.ts
|
|
50
50
|
import { stampVersions, warnOnVersionSkew, versions } from "@fluixi/dom";
|
|
@@ -423,84 +423,25 @@ function cleanupDelegation() {
|
|
|
423
423
|
|
|
424
424
|
// src/lib/context/context.ts
|
|
425
425
|
import { asProvider } from "@fluixi/dom";
|
|
426
|
-
import { createContext as createReactiveContext, useContext as useReactiveContext } from "@fluixi/reactive/signal";
|
|
427
426
|
import {
|
|
428
|
-
|
|
427
|
+
createContext as createReactiveContext,
|
|
428
|
+
getOwner as getOwner2,
|
|
429
|
+
useContext as useReactiveContext
|
|
429
430
|
} from "@fluixi/reactive/signal";
|
|
430
|
-
var _warnedEagerProvider = false;
|
|
431
|
-
function warnEagerProvider() {
|
|
432
|
-
if (_warnedEagerProvider) return;
|
|
433
|
-
_warnedEagerProvider = true;
|
|
434
|
-
if (typeof process !== "undefined" && true) return;
|
|
435
|
-
console.warn(
|
|
436
|
-
"[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>"
|
|
437
|
-
);
|
|
438
|
-
}
|
|
439
|
-
function createProvider(a, value, childProps) {
|
|
440
|
-
const isLazyForm = !!a?.Provider;
|
|
441
|
-
const context = isLazyForm ? a : a.context;
|
|
442
|
-
const rawValue = isLazyForm ? value : a.value;
|
|
443
|
-
const debug = isLazyForm ? false : a.debug ?? false;
|
|
444
|
-
if (!isLazyForm) warnEagerProvider();
|
|
445
|
-
const resolvedValue = typeof rawValue === "function" ? rawValue() : rawValue;
|
|
446
|
-
const sourceProps = isLazyForm ? childProps : a;
|
|
447
|
-
return context.Provider({
|
|
448
|
-
value: resolvedValue,
|
|
449
|
-
get children() {
|
|
450
|
-
return sourceProps?.children;
|
|
451
|
-
},
|
|
452
|
-
debug
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
function createContextWithProvider(defaultValue) {
|
|
456
|
-
const context = createContext3(defaultValue);
|
|
457
|
-
const provider = (props) => {
|
|
458
|
-
return createProvider(context, props.value, props);
|
|
459
|
-
};
|
|
460
|
-
return [context, provider];
|
|
461
|
-
}
|
|
462
|
-
function composeProviders(contexts, children) {
|
|
463
|
-
if (contexts.length === 0) {
|
|
464
|
-
return readChildren2(() => children);
|
|
465
|
-
}
|
|
466
|
-
const [context, value] = contexts[0];
|
|
467
|
-
const remaining = contexts.slice(1);
|
|
468
|
-
return createProvider(context, value, {
|
|
469
|
-
get children() {
|
|
470
|
-
return composeProviders(remaining, children);
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
function createConsumer(context) {
|
|
475
|
-
return (props) => {
|
|
476
|
-
const value = useContext3(context);
|
|
477
|
-
return props.children(value);
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
function useProvide(context, factory) {
|
|
481
|
-
const existing = useContext3(context);
|
|
482
|
-
if (existing === context.defaultValue) {
|
|
483
|
-
return factory();
|
|
484
|
-
}
|
|
485
|
-
return existing;
|
|
486
|
-
}
|
|
487
431
|
function createContext3(defaultValue, name) {
|
|
488
432
|
const context = createReactiveContext(defaultValue, name);
|
|
489
|
-
const Provider = (props) =>
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
433
|
+
const Provider = (props) => (
|
|
434
|
+
// Children stay a getter: the reactive Provider reads them after stamping the value on
|
|
435
|
+
// its owner. Reading `props.children` here would render them, and any <Outlet/> in them,
|
|
436
|
+
// before the context exists.
|
|
437
|
+
context.Provider({
|
|
493
438
|
value: props.value,
|
|
494
439
|
get children() {
|
|
495
440
|
return props.children;
|
|
496
441
|
},
|
|
497
442
|
debug: props.debug
|
|
498
|
-
})
|
|
499
|
-
|
|
500
|
-
if (typeof Symbol !== "undefined" && Symbol.for) {
|
|
501
|
-
Provider.$$typeof = /* @__PURE__ */ Symbol.for("react.provider");
|
|
502
|
-
}
|
|
503
|
-
Provider.$$typeof = /* @__PURE__ */ Symbol.for("react.provider");
|
|
443
|
+
})
|
|
444
|
+
);
|
|
504
445
|
return {
|
|
505
446
|
id: context.id,
|
|
506
447
|
Provider: asProvider(Provider),
|
|
@@ -511,10 +452,38 @@ function useContext3(context) {
|
|
|
511
452
|
const value = useReactiveContext(context);
|
|
512
453
|
return value !== void 0 ? value : context.defaultValue;
|
|
513
454
|
}
|
|
455
|
+
function createProvider(context, value, props) {
|
|
456
|
+
const resolved = typeof value === "function" ? value() : value;
|
|
457
|
+
return context.Provider({
|
|
458
|
+
value: resolved,
|
|
459
|
+
get children() {
|
|
460
|
+
return props.children;
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
464
|
+
function composeProviders(providers, props) {
|
|
465
|
+
const outermost = providers.reduceRight(
|
|
466
|
+
(inner, [context, value]) => ({
|
|
467
|
+
get children() {
|
|
468
|
+
return createProvider(context, value, inner);
|
|
469
|
+
}
|
|
470
|
+
}),
|
|
471
|
+
props
|
|
472
|
+
);
|
|
473
|
+
return outermost.children;
|
|
474
|
+
}
|
|
475
|
+
function requireContext(context, message) {
|
|
476
|
+
for (let owner = getOwner2(); owner; owner = owner.parent) {
|
|
477
|
+
if (owner.contexts?.has(context.id)) return useContext3(context);
|
|
478
|
+
}
|
|
479
|
+
throw new Error(message ?? `[fluixi] No Provider for ${context.id.description ?? "this context"} above this component.`);
|
|
480
|
+
}
|
|
514
481
|
|
|
515
482
|
// src/lib/isomorphic.ts
|
|
516
483
|
import { createSignal as createSignal4, createMemo as createMemo5 } from "@fluixi/reactive/signal";
|
|
517
484
|
import { getServerData } from "@fluixi/dom";
|
|
485
|
+
import { createSyncStorage } from "@fluixi/storage";
|
|
486
|
+
import { localStorageAdapter } from "@fluixi/storage/browser";
|
|
518
487
|
var REGISTRY_KEY = "__fluixi_iso_states__";
|
|
519
488
|
var SEED_PREFIX = "__iso:";
|
|
520
489
|
function registry() {
|
|
@@ -528,7 +497,7 @@ function readSeed(key) {
|
|
|
528
497
|
function createIsomorphicState(key, options) {
|
|
529
498
|
const seed = readSeed(key);
|
|
530
499
|
const initial = seed !== void 0 ? seed : typeof window !== "undefined" && options.client ? options.client() : options.fallback;
|
|
531
|
-
const [value, set] = createSignal4(initial);
|
|
500
|
+
const [value, set] = createSignal4(initial, { name: key });
|
|
532
501
|
registry().set(key, { server: options.server, set });
|
|
533
502
|
return { value, set, key };
|
|
534
503
|
}
|
|
@@ -662,9 +631,7 @@ export {
|
|
|
662
631
|
composeProviders,
|
|
663
632
|
createComponent,
|
|
664
633
|
createComputed2 as createComputed,
|
|
665
|
-
createConsumer,
|
|
666
634
|
createContext3 as createContext,
|
|
667
|
-
createContextWithProvider,
|
|
668
635
|
createDebounce,
|
|
669
636
|
createDeferred2 as createDeferred,
|
|
670
637
|
createEffect3 as createEffect,
|
|
@@ -681,7 +648,7 @@ export {
|
|
|
681
648
|
delegateEvents2 as delegateEvents,
|
|
682
649
|
devOnly,
|
|
683
650
|
getFrameworkInfo,
|
|
684
|
-
|
|
651
|
+
getOwner3 as getOwner,
|
|
685
652
|
getSharedConfig,
|
|
686
653
|
hydrate,
|
|
687
654
|
initDelegation,
|
|
@@ -701,6 +668,7 @@ export {
|
|
|
701
668
|
reduceSignal as reduce,
|
|
702
669
|
removeClass,
|
|
703
670
|
render,
|
|
671
|
+
requireContext,
|
|
704
672
|
runWithOwner2 as runWithOwner,
|
|
705
673
|
setAttribute,
|
|
706
674
|
setOwner,
|
|
@@ -715,7 +683,6 @@ export {
|
|
|
715
683
|
useEffect,
|
|
716
684
|
useEventListener,
|
|
717
685
|
useMemo,
|
|
718
|
-
useProvide,
|
|
719
686
|
useReducer,
|
|
720
687
|
useRef
|
|
721
688
|
};
|
|
@@ -26,6 +26,8 @@ __export(isomorphic_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(isomorphic_exports);
|
|
27
27
|
var import_signal = require("@fluixi/reactive/signal");
|
|
28
28
|
var import_dom = require("@fluixi/dom");
|
|
29
|
+
var import_storage = require("@fluixi/storage");
|
|
30
|
+
var import_browser = require("@fluixi/storage/browser");
|
|
29
31
|
var REGISTRY_KEY = "__fluixi_iso_states__";
|
|
30
32
|
var SEED_PREFIX = "__iso:";
|
|
31
33
|
function registry() {
|
|
@@ -39,7 +41,7 @@ function readSeed(key) {
|
|
|
39
41
|
function createIsomorphicState(key, options) {
|
|
40
42
|
const seed = readSeed(key);
|
|
41
43
|
const initial = seed !== void 0 ? seed : typeof window !== "undefined" && options.client ? options.client() : options.fallback;
|
|
42
|
-
const [value, set] = (0, import_signal.createSignal)(initial);
|
|
44
|
+
const [value, set] = (0, import_signal.createSignal)(initial, { name: key });
|
|
43
45
|
registry().set(key, { server: options.server, set });
|
|
44
46
|
return { value, set, key };
|
|
45
47
|
}
|
|
@@ -51,9 +53,12 @@ function createIsomorphicStore(key, options) {
|
|
|
51
53
|
});
|
|
52
54
|
const value = () => base.value() ?? options.fallback;
|
|
53
55
|
const persistWrite = (v) => {
|
|
54
|
-
|
|
56
|
+
const target = options.persist;
|
|
57
|
+
if (!target) return;
|
|
58
|
+
if (typeof target === "string" && typeof window === "undefined") return;
|
|
55
59
|
try {
|
|
56
|
-
|
|
60
|
+
const { storage, key: key2 } = typeof target === "string" ? { storage: (0, import_storage.createSyncStorage)({ adapter: (0, import_browser.localStorageAdapter)() }), key: target } : target;
|
|
61
|
+
storage.set(key2, v);
|
|
57
62
|
} catch {
|
|
58
63
|
}
|
|
59
64
|
};
|
|
@@ -66,7 +71,7 @@ function createIsomorphicStore(key, options) {
|
|
|
66
71
|
};
|
|
67
72
|
const fields = {};
|
|
68
73
|
for (const k of Object.keys(options.fallback)) {
|
|
69
|
-
fields[k] = (0, import_signal.createMemo)(() => value()[k]);
|
|
74
|
+
fields[k] = (0, import_signal.createMemo)(() => value()[k], void 0, { name: `${key}.${String(k)}` });
|
|
70
75
|
}
|
|
71
76
|
let initPromise = null;
|
|
72
77
|
const ensureInit = () => {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* request-scoped (AsyncLocalStorage) store, a follow-up.
|
|
19
19
|
*/
|
|
20
20
|
import { type Accessor } from '@fluixi/reactive/signal';
|
|
21
|
+
import { type TypedStorage } from '@fluixi/storage';
|
|
21
22
|
export interface IsomorphicState<T> {
|
|
22
23
|
/** Reactive accessor for the current value (a real signal: safe in JSX/control flow). */
|
|
23
24
|
value: Accessor<T | undefined>;
|
|
@@ -79,8 +80,14 @@ export interface IsomorphicStoreOptions<T> {
|
|
|
79
80
|
client?: () => T | Promise<T>;
|
|
80
81
|
/** Value before resolution / the per-field accessor key set. Required for a store. */
|
|
81
82
|
fallback: T;
|
|
82
|
-
/**
|
|
83
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Mirror the record into storage on every write: a key in localStorage, or a key in a
|
|
85
|
+
* storage of your own (`useStorage({ scope: 'cookie' })` to have the server see it too).
|
|
86
|
+
*/
|
|
87
|
+
persist?: string | {
|
|
88
|
+
storage: TypedStorage<any>;
|
|
89
|
+
key: string;
|
|
90
|
+
};
|
|
84
91
|
}
|
|
85
92
|
/**
|
|
86
93
|
* `createIsomorphicState` for a record, exposed as a store rather than a single value.
|
|
@@ -1 +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;
|
|
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,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAevE,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,yFAAyF;IACzF,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;;;;;;;;;;;;;;;;GAgBG;AACH,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,yFAAyF;IACzF,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;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;CAChE;AAED;;;;;;;;;;;;;;;GAeG;AACH,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,CAuDpB"}
|
|
@@ -19,6 +19,8 @@
|
|
|
19
19
|
*/
|
|
20
20
|
import { createSignal, createMemo } from '@fluixi/reactive/signal';
|
|
21
21
|
import { getServerData } from '@fluixi/dom';
|
|
22
|
+
import { createSyncStorage } from '@fluixi/storage';
|
|
23
|
+
import { localStorageAdapter } from '@fluixi/storage/browser';
|
|
22
24
|
const REGISTRY_KEY = '__fluixi_iso_states__';
|
|
23
25
|
const SEED_PREFIX = '__iso:';
|
|
24
26
|
function registry() {
|
|
@@ -55,7 +57,7 @@ export function createIsomorphicState(key, options) {
|
|
|
55
57
|
: typeof window !== 'undefined' && options.client
|
|
56
58
|
? options.client()
|
|
57
59
|
: options.fallback;
|
|
58
|
-
const [value, set] = createSignal(initial);
|
|
60
|
+
const [value, set] = createSignal(initial, { name: key });
|
|
59
61
|
registry().set(key, { server: options.server, set: set });
|
|
60
62
|
return { value, set: set, key };
|
|
61
63
|
}
|
|
@@ -85,10 +87,14 @@ export function createIsomorphicStore(key, options) {
|
|
|
85
87
|
});
|
|
86
88
|
const value = () => base.value() ?? options.fallback;
|
|
87
89
|
const persistWrite = (v) => {
|
|
88
|
-
|
|
90
|
+
const target = options.persist;
|
|
91
|
+
if (!target)
|
|
92
|
+
return;
|
|
93
|
+
if (typeof target === 'string' && typeof window === 'undefined')
|
|
89
94
|
return;
|
|
90
95
|
try {
|
|
91
|
-
|
|
96
|
+
const { storage, key } = typeof target === 'string' ? { storage: createSyncStorage({ adapter: localStorageAdapter() }), key: target } : target;
|
|
97
|
+
storage.set(key, v);
|
|
92
98
|
}
|
|
93
99
|
catch {
|
|
94
100
|
/* quota / private mode: persistence is best-effort */
|
|
@@ -103,7 +109,8 @@ export function createIsomorphicStore(key, options) {
|
|
|
103
109
|
};
|
|
104
110
|
const fields = {};
|
|
105
111
|
for (const k of Object.keys(options.fallback)) {
|
|
106
|
-
|
|
112
|
+
// Named for the devtools graph: `auth.user` rather than an anonymous memo.
|
|
113
|
+
fields[k] = createMemo(() => value()[k], undefined, { name: `${key}.${String(k)}` });
|
|
107
114
|
}
|
|
108
115
|
let initPromise = null;
|
|
109
116
|
const ensureInit = () => {
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// src/lib/isomorphic.ts
|
|
2
2
|
import { createSignal, createMemo } from "@fluixi/reactive/signal";
|
|
3
3
|
import { getServerData } from "@fluixi/dom";
|
|
4
|
+
import { createSyncStorage } from "@fluixi/storage";
|
|
5
|
+
import { localStorageAdapter } from "@fluixi/storage/browser";
|
|
4
6
|
var REGISTRY_KEY = "__fluixi_iso_states__";
|
|
5
7
|
var SEED_PREFIX = "__iso:";
|
|
6
8
|
function registry() {
|
|
@@ -14,7 +16,7 @@ function readSeed(key) {
|
|
|
14
16
|
function createIsomorphicState(key, options) {
|
|
15
17
|
const seed = readSeed(key);
|
|
16
18
|
const initial = seed !== void 0 ? seed : typeof window !== "undefined" && options.client ? options.client() : options.fallback;
|
|
17
|
-
const [value, set] = createSignal(initial);
|
|
19
|
+
const [value, set] = createSignal(initial, { name: key });
|
|
18
20
|
registry().set(key, { server: options.server, set });
|
|
19
21
|
return { value, set, key };
|
|
20
22
|
}
|
|
@@ -26,9 +28,12 @@ function createIsomorphicStore(key, options) {
|
|
|
26
28
|
});
|
|
27
29
|
const value = () => base.value() ?? options.fallback;
|
|
28
30
|
const persistWrite = (v) => {
|
|
29
|
-
|
|
31
|
+
const target = options.persist;
|
|
32
|
+
if (!target) return;
|
|
33
|
+
if (typeof target === "string" && typeof window === "undefined") return;
|
|
30
34
|
try {
|
|
31
|
-
|
|
35
|
+
const { storage, key: key2 } = typeof target === "string" ? { storage: createSyncStorage({ adapter: localStorageAdapter() }), key: target } : target;
|
|
36
|
+
storage.set(key2, v);
|
|
32
37
|
} catch {
|
|
33
38
|
}
|
|
34
39
|
};
|
|
@@ -41,7 +46,7 @@ function createIsomorphicStore(key, options) {
|
|
|
41
46
|
};
|
|
42
47
|
const fields = {};
|
|
43
48
|
for (const k of Object.keys(options.fallback)) {
|
|
44
|
-
fields[k] = createMemo(() => value()[k]);
|
|
49
|
+
fields[k] = createMemo(() => value()[k], void 0, { name: `${key}.${String(k)}` });
|
|
45
50
|
}
|
|
46
51
|
let initPromise = null;
|
|
47
52
|
const ensureInit = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.93 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.93 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.93 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/lib/jsx-runtime/jsx-dev-runtime.ts
|
|
4
4
|
export * from "@fluixi/jsx/jsx-dev-runtime";
|
|
@@ -221,9 +221,9 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
221
221
|
props.push(`${indent} component: lazy(() => import(${JSON.stringify(importPath)}))`);
|
|
222
222
|
if (route.hasRouteData) {
|
|
223
223
|
props.push(
|
|
224
|
-
`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(
|
|
224
|
+
`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(
|
|
225
225
|
importPath
|
|
226
|
-
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
226
|
+
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`
|
|
227
227
|
);
|
|
228
228
|
}
|
|
229
229
|
if (route.children.length > 0) {
|
|
@@ -187,9 +187,9 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
187
187
|
props.push(`${indent} component: lazy(() => import(${JSON.stringify(importPath)}))`);
|
|
188
188
|
if (route.hasRouteData) {
|
|
189
189
|
props.push(
|
|
190
|
-
`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(
|
|
190
|
+
`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(
|
|
191
191
|
importPath
|
|
192
|
-
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
192
|
+
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`
|
|
193
193
|
);
|
|
194
194
|
}
|
|
195
195
|
if (route.children.length > 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.93 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -230,9 +230,9 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
230
230
|
props.push(`${indent} component: lazy(() => import(${JSON.stringify(importPath)}))`);
|
|
231
231
|
if (route.hasRouteData) {
|
|
232
232
|
props.push(
|
|
233
|
-
`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(
|
|
233
|
+
`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(
|
|
234
234
|
importPath
|
|
235
|
-
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
235
|
+
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
if (route.children.length > 0) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.93 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/lib/plugins/vite.ts
|
|
4
4
|
import { fluixi, createVitePlugin } from "@fluixi/vite-plugin";
|
|
@@ -192,9 +192,9 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
192
192
|
props.push(`${indent} component: lazy(() => import(${JSON.stringify(importPath)}))`);
|
|
193
193
|
if (route.hasRouteData) {
|
|
194
194
|
props.push(
|
|
195
|
-
`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(
|
|
195
|
+
`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(
|
|
196
196
|
importPath
|
|
197
|
-
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
197
|
+
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`
|
|
198
198
|
);
|
|
199
199
|
}
|
|
200
200
|
if (route.children.length > 0) {
|
|
@@ -51,9 +51,9 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
51
51
|
props.push(`${indent} component: lazy(() => import(${JSON.stringify(importPath)}))`);
|
|
52
52
|
if (route.hasRouteData) {
|
|
53
53
|
props.push(
|
|
54
|
-
`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(
|
|
54
|
+
`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(
|
|
55
55
|
importPath
|
|
56
|
-
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
56
|
+
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`
|
|
57
57
|
);
|
|
58
58
|
}
|
|
59
59
|
if (route.children.length > 0) {
|
|
@@ -53,7 +53,7 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
53
53
|
// This prevents unnecessary async imports and avoids calling d.data() for
|
|
54
54
|
// levels that have no data, which kept the router's if (d.data) check clean.
|
|
55
55
|
if (route.hasRouteData) {
|
|
56
|
-
props.push(`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(importPath)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
56
|
+
props.push(`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(importPath)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`);
|
|
57
57
|
// props.push(`${indent} data: (args) => import(${JSON.stringify(importPath)}).then(m => m.routeData ? m.routeData(args) : undefined)`);
|
|
58
58
|
}
|
|
59
59
|
// Children
|
|
@@ -27,9 +27,9 @@ function generateRouteObject(route, routesDir, depth) {
|
|
|
27
27
|
props.push(`${indent} component: lazy(() => import(${JSON.stringify(importPath)}))`);
|
|
28
28
|
if (route.hasRouteData) {
|
|
29
29
|
props.push(
|
|
30
|
-
`${indent} data: (args, __owner, __isCancelled) => import(${JSON.stringify(
|
|
30
|
+
`${indent} data: (args, __owner, __isCancelled, __deps) => import(${JSON.stringify(
|
|
31
31
|
importPath
|
|
32
|
-
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined;
|
|
32
|
+
)}).then(m => { if (typeof __isCancelled === 'function' && __isCancelled()) return undefined; if (!m.routeData) return undefined; if (typeof m.routeDeps === 'function') { if (typeof __deps === 'function') __deps(m.routeDeps); args = { ...args, deps: m.routeDeps() }; } return m.routeData(args); })`
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
if (route.children.length > 0) {
|
|
@@ -63,7 +63,7 @@ var import_signal6 = require("@fluixi/reactive/signal");
|
|
|
63
63
|
var import_dom = require("@fluixi/dom");
|
|
64
64
|
|
|
65
65
|
// src/version.generated.ts
|
|
66
|
-
var VERSION = "1.0.0-alpha.
|
|
66
|
+
var VERSION = "1.0.0-alpha.93";
|
|
67
67
|
|
|
68
68
|
// src/lib/render/versions.ts
|
|
69
69
|
var import_dom2 = require("@fluixi/dom");
|
|
@@ -6,7 +6,7 @@ import { createRoot as createRoot2 } from "@fluixi/reactive/signal";
|
|
|
6
6
|
import { registerCoreVersion } from "@fluixi/dom";
|
|
7
7
|
|
|
8
8
|
// src/version.generated.ts
|
|
9
|
-
var VERSION = "1.0.0-alpha.
|
|
9
|
+
var VERSION = "1.0.0-alpha.93";
|
|
10
10
|
|
|
11
11
|
// src/lib/render/versions.ts
|
|
12
12
|
import { stampVersions, warnOnVersionSkew, versions } from "@fluixi/dom";
|
|
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(versions_exports);
|
|
|
28
28
|
var import_dom = require("@fluixi/dom");
|
|
29
29
|
|
|
30
30
|
// src/version.generated.ts
|
|
31
|
-
var VERSION = "1.0.0-alpha.
|
|
31
|
+
var VERSION = "1.0.0-alpha.93";
|
|
32
32
|
|
|
33
33
|
// src/lib/render/versions.ts
|
|
34
34
|
var import_dom2 = require("@fluixi/dom");
|