@fluixi/core 1.0.0-alpha.95 → 1.0.0-alpha.97
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-IFONZJWJ.mjs → chunk-RKBFEFZP.mjs} +34 -10
- package/dist/src/cdn/core.cjs +36 -12
- package/dist/src/cdn/core.mjs +4 -4
- package/dist/src/cdn/{router-TU5CPI54.mjs → router-V2THK27H.mjs} +3 -3
- package/dist/src/index.cjs +31 -7
- package/dist/src/index.mjs +31 -7
- package/dist/src/lib/client/{chunk-AHNP3IWU.mjs → chunk-KYWKPX6I.mjs} +1 -1
- package/dist/src/lib/client/index.cjs +37 -13
- package/dist/src/lib/client/index.d.ts.map +1 -1
- package/dist/src/lib/client/index.js +4 -1
- package/dist/src/lib/client/index.mjs +5 -5
- package/dist/src/lib/client/{router-5C6FQJQ4.mjs → router-EHDYEGDF.mjs} +36 -12
- package/dist/src/lib/core.cjs +30 -6
- package/dist/src/lib/core.mjs +30 -6
- package/dist/src/lib/i18n/index.cjs +1 -1
- package/dist/src/lib/i18n/index.mjs +1 -1
- package/dist/src/lib/index.cjs +1 -1
- package/dist/src/lib/index.mjs +1 -1
- package/dist/src/lib/isomorphic.cjs +1 -1
- package/dist/src/lib/isomorphic.d.ts +5 -0
- package/dist/src/lib/isomorphic.d.ts.map +1 -1
- package/dist/src/lib/isomorphic.js +1 -1
- package/dist/src/lib/isomorphic.mjs +1 -1
- 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/index.cjs +1 -1
- package/dist/src/lib/plugins/index.mjs +1 -1
- 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 +4 -4
- package/dist/src/lib/router/data.d.ts.map +1 -1
- package/dist/src/lib/router/data.js +9 -8
- package/dist/src/lib/router/data.mjs +4 -4
- package/dist/src/lib/router/index.cjs +35 -11
- package/dist/src/lib/router/index.d.ts +8 -5
- package/dist/src/lib/router/index.d.ts.map +1 -1
- package/dist/src/lib/router/index.js +44 -12
- package/dist/src/lib/router/index.mjs +35 -11
- package/dist/src/lib/server/index.cjs +1 -1
- package/dist/src/lib/server/index.mjs +1 -1
- package/dist/src/lib/storage/index.cjs +1 -1
- package/dist/src/lib/storage/index.mjs +1 -1
- 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 +12 -12
|
@@ -232,7 +232,7 @@ export declare function Link(props: LinkProps): any;
|
|
|
232
232
|
/** Alias for {@link Link}. */
|
|
233
233
|
export declare const A: typeof Link;
|
|
234
234
|
import type { Action } from './data.js';
|
|
235
|
-
export interface
|
|
235
|
+
export interface ActionFormProps {
|
|
236
236
|
/** The action to run on submit (typically wrapping a `"use server"` function). */
|
|
237
237
|
action: Action<any, any>;
|
|
238
238
|
/** Extra class on the <form>. */
|
|
@@ -241,17 +241,20 @@ export interface FormProps {
|
|
|
241
241
|
[key: string]: any;
|
|
242
242
|
}
|
|
243
243
|
/**
|
|
244
|
-
* A `<form>` wired to
|
|
244
|
+
* A `<form>` wired to a router action: on submit it builds `FormData` from the form and calls
|
|
245
245
|
* `action(formData)` (which tracks submission state via `useSubmission`), without a full
|
|
246
246
|
* page navigation. The markup carries `method="post"` + `action={action.url}` so it's
|
|
247
247
|
* progressive-enhancement-ready.
|
|
248
248
|
*
|
|
249
|
-
* <
|
|
249
|
+
* <ActionForm action={save}>
|
|
250
250
|
* <input name="title" />
|
|
251
251
|
* <button>Save</button>
|
|
252
|
-
* </
|
|
252
|
+
* </ActionForm>
|
|
253
|
+
*
|
|
254
|
+
* It sends what the fields hold and checks nothing. For a form whose fields are validated
|
|
255
|
+
* first, use `@fluixi-ui/form`'s `Form` with an `action`.
|
|
253
256
|
*/
|
|
254
|
-
export declare function
|
|
257
|
+
export declare function ActionForm(props: ActionFormProps): any;
|
|
255
258
|
/**
|
|
256
259
|
* Download the lazy component chunks for the route(s) matching `pathname` and resolve when
|
|
257
260
|
* they're all loaded. Await this before hydrating: once each matched lazy file-route is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/router/index.ts"],"names":[],"mappings":"AAyBA,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAUzB,OAAO,EAAO,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAKL,KAAK,eAAe,EAEpB,KAAK,MAAM,IAAI,UAAU,EACzB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,eAAe,EACrB,MAAM,gBAAgB,CAAC;AAIxB,UAAU,cAAc;IACtB,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC;IACxB,QAAQ,EAAE,MAAM,cAAc,CAAC;IAC/B,MAAM,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,2FAA2F;IAC3F,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,+EAA+E;IAC/E,SAAS,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;CAChC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"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ACX,aAAa,EACb,cAAc,EACd,SAAS,GACV,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,aAAa,EACb,aAAa,EACb,MAAM,EACN,aAAa,EACb,YAAY,EACZ,UAAU,EACV,OAAO,GACR,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAGzC,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,KAAK,cAAc,GACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -56,26 +56,55 @@ function renderLayer(m, depth, base) {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
};
|
|
59
|
+
// Whether the loader looked at the location: only then does a change of query string,
|
|
60
|
+
// which keeps this layer, concern it. Unknown until it has run here: a page hydrated from
|
|
61
|
+
// the server got its data without running it.
|
|
62
|
+
let readsLocation;
|
|
59
63
|
const [resource, { refetch }] = createResource(() => {
|
|
60
|
-
|
|
64
|
+
// The params and location this load is for, fixed now. Accessors read later would see
|
|
65
|
+
// the next navigation's: a lazy route reads them after its module resolves, and a
|
|
66
|
+
// reload a revalidation started just before a navigation then ran with the next page's
|
|
67
|
+
// params (an empty id).
|
|
68
|
+
const params = untrack(base.params);
|
|
69
|
+
const location = untrack(base.location);
|
|
70
|
+
readsLocation = false;
|
|
71
|
+
const result = loader({
|
|
72
|
+
params: () => params,
|
|
73
|
+
location: () => {
|
|
74
|
+
readsLocation = true;
|
|
75
|
+
return location;
|
|
76
|
+
},
|
|
77
|
+
}, owner, () => cancelled, trackDeps);
|
|
61
78
|
return router ? router.trackLoad(result) : result;
|
|
62
79
|
});
|
|
63
80
|
// A revalidated cache entry: load again. The page stays on screen with its current data.
|
|
64
|
-
|
|
65
|
-
//
|
|
66
|
-
|
|
81
|
+
// Not a page on its way out (another route matched at this depth, kept until the next one
|
|
82
|
+
// has its data): its loader would run with the params of the page replacing it.
|
|
83
|
+
onCleanup(onRevalidate(() => {
|
|
84
|
+
if (untrack(() => base.matched()[depth]?.route) !== m.route)
|
|
85
|
+
return;
|
|
86
|
+
void refetch();
|
|
87
|
+
}));
|
|
88
|
+
// A navigation that changes only this layer's params, or only the query string, keeps the
|
|
89
|
+
// layer, so nothing else would load its data for them. Params compared by value: `matched`
|
|
90
|
+
// is rebuilt on every navigation. The query counts only for a loader that read the
|
|
91
|
+
// location; the hash never does.
|
|
67
92
|
let loadedFor = untrack(() => JSON.stringify(base.matched()[depth]?.params ?? {}));
|
|
93
|
+
let searchedFor = untrack(() => base.location().search);
|
|
68
94
|
createEffect(() => {
|
|
69
95
|
const now = base.matched()[depth];
|
|
96
|
+
const search = base.location().search;
|
|
70
97
|
// Another route at this depth: this page is on its way out, kept only until the next
|
|
71
98
|
// one has its data, and the new params are not for it.
|
|
72
99
|
if (now?.route !== m.route)
|
|
73
100
|
return;
|
|
74
101
|
const params = JSON.stringify(now.params ?? {});
|
|
75
|
-
|
|
76
|
-
|
|
102
|
+
const paramsMoved = params !== loadedFor;
|
|
103
|
+
const searchMoved = readsLocation !== false && search !== searchedFor;
|
|
77
104
|
loadedFor = params;
|
|
78
|
-
|
|
105
|
+
searchedFor = search;
|
|
106
|
+
if (paramsMoved || searchMoved)
|
|
107
|
+
untrack(() => void refetch());
|
|
79
108
|
});
|
|
80
109
|
// A failed load throws where the page reads it, so the nearest ErrorBoundary shows it.
|
|
81
110
|
// A resource reads as undefined once it has failed, which left the page empty and gave
|
|
@@ -705,7 +734,7 @@ export function Link(props) {
|
|
|
705
734
|
if (props.slot)
|
|
706
735
|
setAttribute(a, 'slot', read(props.slot));
|
|
707
736
|
// Forward any other author attributes (data-*, aria-*, style, id, title, role, ...)
|
|
708
|
-
// onto the <a>, the way <
|
|
737
|
+
// onto the <a>, the way <ActionForm> does. Without this a component composed via
|
|
709
738
|
// `as={Link}` (polymorphic) silently loses its styling hooks: e.g. @fluixi-ui
|
|
710
739
|
// parts carry `data-*` slots + inline styles that would otherwise be dropped, so
|
|
711
740
|
// the element renders unstyled. Own-props handled elsewhere are skipped:
|
|
@@ -783,17 +812,20 @@ export function Link(props) {
|
|
|
783
812
|
export const A = Link;
|
|
784
813
|
import { onRevalidate } from './data.js';
|
|
785
814
|
/**
|
|
786
|
-
* A `<form>` wired to
|
|
815
|
+
* A `<form>` wired to a router action: on submit it builds `FormData` from the form and calls
|
|
787
816
|
* `action(formData)` (which tracks submission state via `useSubmission`), without a full
|
|
788
817
|
* page navigation. The markup carries `method="post"` + `action={action.url}` so it's
|
|
789
818
|
* progressive-enhancement-ready.
|
|
790
819
|
*
|
|
791
|
-
* <
|
|
820
|
+
* <ActionForm action={save}>
|
|
792
821
|
* <input name="title" />
|
|
793
822
|
* <button>Save</button>
|
|
794
|
-
* </
|
|
823
|
+
* </ActionForm>
|
|
824
|
+
*
|
|
825
|
+
* It sends what the fields hold and checks nothing. For a form whose fields are validated
|
|
826
|
+
* first, use `@fluixi-ui/form`'s `Form` with an `action`.
|
|
795
827
|
*/
|
|
796
|
-
export function
|
|
828
|
+
export function ActionForm(props) {
|
|
797
829
|
const action = props.action;
|
|
798
830
|
const cls = (props.className ?? props.class); // compiler passes class -> className
|
|
799
831
|
const url = action.url ?? '';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.97 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/lib/router/index.ts
|
|
4
4
|
import {
|
|
@@ -261,7 +261,8 @@ function getSubmissionsSignal(url) {
|
|
|
261
261
|
}
|
|
262
262
|
function action(fn, name, options = {}) {
|
|
263
263
|
const actionUrl = name || fn.name || "action";
|
|
264
|
-
const submit = async (
|
|
264
|
+
const submit = async (...args) => {
|
|
265
|
+
const input = args.length > 1 ? args : args[0];
|
|
265
266
|
const [, setSubmission] = getSubmissionSignal(actionUrl);
|
|
266
267
|
const [, setSubmissions] = getSubmissionsSignal(actionUrl);
|
|
267
268
|
let entry;
|
|
@@ -276,11 +277,10 @@ function action(fn, name, options = {}) {
|
|
|
276
277
|
};
|
|
277
278
|
const retry = () => {
|
|
278
279
|
drop2();
|
|
279
|
-
return submit(
|
|
280
|
+
return submit(...args);
|
|
280
281
|
};
|
|
281
282
|
entry = {
|
|
282
283
|
input,
|
|
283
|
-
// Approximate type for tracking
|
|
284
284
|
pending: true,
|
|
285
285
|
clear,
|
|
286
286
|
retry
|
|
@@ -288,7 +288,7 @@ function action(fn, name, options = {}) {
|
|
|
288
288
|
setSubmission(entry);
|
|
289
289
|
setSubmissions((list) => [...list, entry]);
|
|
290
290
|
try {
|
|
291
|
-
const result = await fn(
|
|
291
|
+
const result = await fn(...args);
|
|
292
292
|
setSubmission({
|
|
293
293
|
input,
|
|
294
294
|
result,
|
|
@@ -416,19 +416,43 @@ function renderLayer(m, depth, base) {
|
|
|
416
416
|
});
|
|
417
417
|
});
|
|
418
418
|
};
|
|
419
|
+
let readsLocation;
|
|
419
420
|
const [resource, { refetch }] = createResource3(() => {
|
|
420
|
-
const
|
|
421
|
+
const params = untrack2(base.params);
|
|
422
|
+
const location = untrack2(base.location);
|
|
423
|
+
readsLocation = false;
|
|
424
|
+
const result = loader(
|
|
425
|
+
{
|
|
426
|
+
params: () => params,
|
|
427
|
+
location: () => {
|
|
428
|
+
readsLocation = true;
|
|
429
|
+
return location;
|
|
430
|
+
}
|
|
431
|
+
},
|
|
432
|
+
owner,
|
|
433
|
+
() => cancelled,
|
|
434
|
+
trackDeps
|
|
435
|
+
);
|
|
421
436
|
return router ? router.trackLoad(result) : result;
|
|
422
437
|
});
|
|
423
|
-
onCleanup(
|
|
438
|
+
onCleanup(
|
|
439
|
+
onRevalidate(() => {
|
|
440
|
+
if (untrack2(() => base.matched()[depth]?.route) !== m.route) return;
|
|
441
|
+
void refetch();
|
|
442
|
+
})
|
|
443
|
+
);
|
|
424
444
|
let loadedFor = untrack2(() => JSON.stringify(base.matched()[depth]?.params ?? {}));
|
|
445
|
+
let searchedFor = untrack2(() => base.location().search);
|
|
425
446
|
createEffect(() => {
|
|
426
447
|
const now = base.matched()[depth];
|
|
448
|
+
const search = base.location().search;
|
|
427
449
|
if (now?.route !== m.route) return;
|
|
428
450
|
const params = JSON.stringify(now.params ?? {});
|
|
429
|
-
|
|
451
|
+
const paramsMoved = params !== loadedFor;
|
|
452
|
+
const searchMoved = readsLocation !== false && search !== searchedFor;
|
|
430
453
|
loadedFor = params;
|
|
431
|
-
|
|
454
|
+
searchedFor = search;
|
|
455
|
+
if (paramsMoved || searchMoved) untrack2(() => void refetch());
|
|
432
456
|
});
|
|
433
457
|
data = () => {
|
|
434
458
|
const error = resource.error;
|
|
@@ -837,7 +861,7 @@ function Link(props) {
|
|
|
837
861
|
return a;
|
|
838
862
|
}
|
|
839
863
|
var A = Link;
|
|
840
|
-
function
|
|
864
|
+
function ActionForm(props) {
|
|
841
865
|
const action2 = props.action;
|
|
842
866
|
const cls = props.className ?? props.class;
|
|
843
867
|
const url = action2.url ?? "";
|
|
@@ -877,7 +901,7 @@ async function preloadRoutes(routes, pathname) {
|
|
|
877
901
|
}
|
|
878
902
|
export {
|
|
879
903
|
A,
|
|
880
|
-
|
|
904
|
+
ActionForm,
|
|
881
905
|
Link,
|
|
882
906
|
Outlet,
|
|
883
907
|
Redirect,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.97 | (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.97 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/lib/server/hydration.ts
|
|
4
4
|
import { isServer as domIsServer } from "@fluixi/dom";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.97 | (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.97 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
|
|
3
3
|
// src/lib/storage/index.ts
|
|
4
4
|
import { appendResponseHeader, getRequestContext, getServerData } from "@fluixi/dom";
|
package/dist/src/routes.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.97 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/src/routes.mjs
CHANGED
package/dist/src/utils.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @fluixi/core v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/core v1.0.0-alpha.97 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
"use strict";
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
package/dist/src/utils.mjs
CHANGED