@nifrajs/web-solid 5.9.0 → 5.11.0
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/CHANGELOG.md +58 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +2 -0
- package/dist/client.js.map +1 -1
- package/dist/compose.d.ts.map +1 -1
- package/dist/compose.js +4 -2
- package/dist/compose.js.map +1 -1
- package/dist/image.d.ts +4 -3
- package/dist/image.d.ts.map +1 -1
- package/dist/image.js +16 -6
- package/dist/image.js.map +1 -1
- package/dist/keep-alive-view.js +1 -1
- package/dist/keep-alive-view.js.map +1 -1
- package/dist/ppr.d.ts +1 -1
- package/dist/ppr.js +1 -1
- package/dist/query.d.ts +43 -4
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +73 -5
- package/dist/query.js.map +1 -1
- package/dist/route-slot.d.ts +29 -0
- package/dist/route-slot.d.ts.map +1 -0
- package/dist/route-slot.jsx +75 -0
- package/dist/route-slot.jsx.map +1 -0
- package/dist/router-context.d.ts +5 -0
- package/dist/router-context.d.ts.map +1 -0
- package/dist/router-context.js +14 -0
- package/dist/router-context.js.map +1 -0
- package/dist/router.d.ts +8 -5
- package/dist/router.d.ts.map +1 -1
- package/dist/router.js +6 -12
- package/dist/router.js.map +1 -1
- package/package.json +5 -5
- package/src/client.ts +2 -0
- package/src/compose.ts +4 -2
- package/src/image.ts +28 -7
- package/src/keep-alive-view.ts +1 -1
- package/src/ppr.ts +1 -1
- package/src/query.ts +145 -6
- package/src/route-slot.tsx +137 -0
- package/src/router-context.ts +20 -0
- package/src/router.ts +8 -28
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# @nifrajs/web-solid
|
|
2
2
|
|
|
3
|
+
## 5.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3c8024d: Add independently addressable route slots with typed targets, server allowlists, and framework bindings.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [3c8024d]
|
|
12
|
+
- Updated dependencies [d76f9d7]
|
|
13
|
+
- Updated dependencies [9a0f0a0]
|
|
14
|
+
- Updated dependencies [bc40a1d]
|
|
15
|
+
- Updated dependencies [97a55bf]
|
|
16
|
+
- Updated dependencies [abf5a0b]
|
|
17
|
+
- @nifrajs/web@5.11.0
|
|
18
|
+
- @nifrajs/core@5.11.0
|
|
19
|
+
|
|
20
|
+
## 5.10.0
|
|
21
|
+
|
|
22
|
+
### Minor Changes
|
|
23
|
+
|
|
24
|
+
- 611a3be: Expose mutation and infinite-query bindings across the framework adapters, with request-scoped query-client providers and SSR cache hydration. Mutation functions and callbacks receive a cooperative abort signal, and identity changes cancel pending work across tabs. `dehydrate` can filter regular and infinite query values before they are serialized to the browser.
|
|
25
|
+
- d2066e0: Add opt-in local `?image` metadata imports and content-hashed build-time responsive variants using the existing injectable image backends. Emit images with client, SSR and static builds, and infer imported dimensions in all five UI adapters. String image URLs retain their existing dimension requirements.
|
|
26
|
+
|
|
27
|
+
Add explicit static translated-path mappings to i18n routing, with reciprocal URL/SEO helpers, availability-aware redirects and static-path enumeration. These mappings do not implicitly create filesystem route aliases.
|
|
28
|
+
|
|
29
|
+
Add `vercelRuntime: "node"` for ordinary SSR Vercel builds through both bundlers, using a shared streaming Node request bridge. Vercel Edge remains the default.
|
|
30
|
+
- 824a75e: Partial prerendering is no longer experimental. `createWebApp` takes it as `ppr`, where it was `experimental.ppr`, and the `experimental` option is gone: passing it throws a `TypeError` that names `ppr`, and the startup errors name `ppr.origin`, `ppr.deployment` and `ppr.store`. `nifra upgrade` moves `experimental: { ppr }` to `ppr` in a `createWebApp` options literal and lists any other `experimental` shape it finds there by line (options spread in, or built in another file, are yours to check). `nifra scaffold` is stable.
|
|
31
|
+
- 1faf86c: `href({ to, params, search, hash })` builds an in-app URL from a route pattern and returns an `Href`; `rawHref(path)` returns one for a same-origin path built elsewhere (a CMS link, `/llms.txt`). `to` is a key of the generated `RouteTable`, so a misspelt route, a missing, misspelt or extra param, and a `search` that breaks the route's schema are compile errors. A route without a `searchSchema` takes any `search`. Each param is encoded as one path segment, so a value such as `a/b` or `//evil.com` cannot change where the URL goes; a param that is missing, empty, `.`, `..` or an unpaired surrogate throws a `TypeError` naming it and the pattern. `rawHref` throws a `TypeError` unless `isSameOriginPath` accepts the path. Both are exported by `@nifrajs/web` and by the `/router` entry of every adapter.
|
|
32
|
+
|
|
33
|
+
`navigate` takes an `Href` or a history delta. A string, a template literal and the `{ to, search }` object form are compile errors, and a value forged past the types is still held to the same-origin check the browser navigate makes. `<Navigate to>` and the `useSearchParams` setter in `@nifrajs/web-react` pass their path through `rawHref`, so an off-origin `to` throws instead of doing nothing. `isSameOriginPath` is exported from `@nifrajs/core/pattern` as well as `@nifrajs/core/server`.
|
|
34
|
+
|
|
35
|
+
Upgrade: `navigate("/users/7")` becomes `navigate(href({ to: "/users/:id", params: { id: "7" } }))`, `navigate({ to, search, replace: true })` becomes `navigate(href({ to, search }), { replace: true })`, and a path built elsewhere is `navigate(rawHref(path))`. `resolveNavigate`, `NavigateTargetInput` and `NavigateSearchOf` are removed from `@nifrajs/web`.
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 2c361be: Opening a modal route on a Solid page no longer rebuilds the page. A layout was handed the `boundaries` value rather than a getter over it, so an intercept boundary taking its target re-ran the whole chain: a typed input lost its text and every component remounted. The page now stays mounted underneath, as the other adapters keep it.
|
|
40
|
+
- Updated dependencies [535c4e5]
|
|
41
|
+
- Updated dependencies [87e7fd9]
|
|
42
|
+
- Updated dependencies [611a3be]
|
|
43
|
+
- Updated dependencies [7f32bb2]
|
|
44
|
+
- Updated dependencies [0aa10d0]
|
|
45
|
+
- Updated dependencies [ab69ee6]
|
|
46
|
+
- Updated dependencies [548bade]
|
|
47
|
+
- Updated dependencies [d2066e0]
|
|
48
|
+
- Updated dependencies [7e292dd]
|
|
49
|
+
- Updated dependencies [a6af4c9]
|
|
50
|
+
- Updated dependencies [e465ed5]
|
|
51
|
+
- Updated dependencies [683c3d6]
|
|
52
|
+
- Updated dependencies [824a75e]
|
|
53
|
+
- Updated dependencies [d2066e0]
|
|
54
|
+
- Updated dependencies [5845e1c]
|
|
55
|
+
- Updated dependencies [5d1be78]
|
|
56
|
+
- Updated dependencies [1faf86c]
|
|
57
|
+
- Updated dependencies [950996b]
|
|
58
|
+
- @nifrajs/web@5.10.0
|
|
59
|
+
- @nifrajs/core@5.10.0
|
|
60
|
+
|
|
3
61
|
## 5.9.0
|
|
4
62
|
|
|
5
63
|
### Patch Changes
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAkBnE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,mGAAmG;AACnG,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI,CAE/F;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CA2C7D"}
|
package/dist/client.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { setRouteSlotRuntime } from "@nifrajs/web/client";
|
|
1
2
|
/**
|
|
2
3
|
* @nifrajs/web-solid/client - Solid client runtime. `hydrate` hydrates a single SSR'd route;
|
|
3
4
|
* `mountRouter` hydrates the initial route then drives navigation through a Solid signal - so a
|
|
@@ -32,6 +33,7 @@ export function hydrate(chain, props, container) {
|
|
|
32
33
|
*/
|
|
33
34
|
export function mountRouter(options) {
|
|
34
35
|
const { router, routes, searchSchemas, matchChains, container } = options;
|
|
36
|
+
setRouteSlotRuntime({ router, routes, searchSchemas, matchChains });
|
|
35
37
|
setMountedRouter(router); // expose it to createFetcher/useFetchers (same page, client-only)
|
|
36
38
|
const el = container;
|
|
37
39
|
let dispose;
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,cAAc,CAAA;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,sGAAsG;AACtG,gFAAgF;AAChF,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAE1C,mGAAmG;AACnG,MAAM,UAAU,OAAO,CAAC,KAAyB,EAAE,KAAkB,EAAE,SAAkB;IACvF,YAAY,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,SAAoB,CAAC,CAAA;AAC3D,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,WAAW,CAAC,OAA2B;IACrD,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,OAAO,CAAA;IACzE,gBAAgB,CAAC,MAAM,CAAC,CAAA,CAAC,kEAAkE;IAC3F,MAAM,EAAE,GAAG,SAAoB,CAAA;IAE/B,IAAI,OAAiC,CAAA;IACrC,IA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ED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAmC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAMpE;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAmC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAA;AAMpE;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,SAAS,OAAO,EAAE,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,GAAG,CAAC,OAAO,CAqCxF"}
|
package/dist/compose.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createComponent } from "solid-js";
|
|
2
|
-
import { RenderPropsContext, SearchContext } from "./router.js";
|
|
2
|
+
import { RenderPropsContext, SearchContext } from "./router-context.js";
|
|
3
3
|
// Frozen empty search so a render with no search context has a stable provider value.
|
|
4
4
|
const EMPTY_SEARCH = Object.freeze({});
|
|
5
5
|
/**
|
|
@@ -25,7 +25,9 @@ export function compose(chain, props) {
|
|
|
25
25
|
get data() {
|
|
26
26
|
return props.layoutData?.[i] ?? null;
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
get boundaries() {
|
|
29
|
+
return props.boundaries;
|
|
30
|
+
},
|
|
29
31
|
children: child(),
|
|
30
32
|
});
|
|
31
33
|
}
|
package/dist/compose.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,eAAe,EAAY,MAAM,UAAU,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"compose.js","sourceRoot":"","sources":["../src/compose.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,eAAe,EAAY,MAAM,UAAU,CAAA;AACpE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEvE,sFAAsF;AACtF,MAAM,YAAY,GAAsC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;AAEzE;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,KAAyB,EAAE,KAAkB;IACnE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;IAC7B,IAAI,IAAI,GAAsB,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,IAAI,CAA2B,EAAE,KAAK,CAAC,CAAA;IACjG,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACnC,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAyC,CAAA;QAC/D,MAAM,KAAK,GAAG,IAAI,CAAA;QAClB,6FAA6F;QAC7F,mGAAmG;QACnG,kEAAkE;QAClE,0FAA0F;QAC1F,6EAA6E;QAC7E,IAAI,GAAG,GAAG,EAAE,CACV,eAAe,CAAC,MAAM,EAAE;YACtB,IAAI,IAAI;gBACN,OAAO,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAA;YACtC,CAAC;YACD,IAAI,UAAU;gBACZ,OAAO,KAAK,CAAC,UAAU,CAAA;YACzB,CAAC;YACD,QAAQ,EAAE,KAAK,EAAE;SAClB,CAAC,CAAA;IACN,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAA;IAClB,qGAAqG;IACrG,sFAAsF;IACtF,OAAO,GAAG,EAAE,CACV,eAAe,CAAC,aAAa,CAAC,QAAQ,EAAE;QACtC,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,IAAI,YAAY,CAA4B;QACtE,IAAI,QAAQ;YACV,OAAO,eAAe,CAAC,kBAAkB,CAAC,QAAQ,EAAE;gBAClD,KAAK,EAAE,KAAK;gBACZ,IAAI,QAAQ;oBACV,OAAO,KAAK,EAAE,CAAA;gBAChB,CAAC;aACF,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;AACN,CAAC"}
|
package/dist/image.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* reactively (`splitProps`/`mergeProps`). Resizing is delegated to the `loader`; nifra bundles no codec.
|
|
7
7
|
* No JSX (`createComponent`/`Dynamic`), so the package builds with plain `tsc`.
|
|
8
8
|
*/
|
|
9
|
-
import { type ImageLoader, type ImageProps } from "@nifrajs/image";
|
|
9
|
+
import { type ImageLoader, type ImageProps, type StaticImageProps } from "@nifrajs/image";
|
|
10
10
|
import { type JSX } from "solid-js";
|
|
11
11
|
/** Attributes `resolveImage` computes - callers can't override them via DOM passthrough. */
|
|
12
12
|
type ComputedAttrs = "src" | "srcset" | "sizes" | "width" | "height" | "alt" | "loading" | "decoding" | "fetchpriority";
|
|
@@ -14,10 +14,11 @@ export interface ImageComponentProps extends ImageProps, Omit<JSX.ImgHTMLAttribu
|
|
|
14
14
|
/** CDN URL builder. Defaults to the identity loader (no transform - still CLS-safe + lazy). */
|
|
15
15
|
readonly loader?: ImageLoader;
|
|
16
16
|
}
|
|
17
|
+
export type StaticImageComponentProps = StaticImageProps & Omit<ImageComponentProps, "src" | "width" | "height">;
|
|
17
18
|
/**
|
|
18
|
-
* Render a responsive, CLS-safe `<img>`.
|
|
19
|
+
* Render a responsive, CLS-safe `<img>`. String URLs require dimensions; asset imports infer them;
|
|
19
20
|
* `priority` marks the LCP image (`eager` + `fetchpriority="high"`). Extra DOM props pass through.
|
|
20
21
|
*/
|
|
21
|
-
export declare function Image(props: ImageComponentProps): JSX.Element;
|
|
22
|
+
export declare function Image(props: ImageComponentProps | StaticImageComponentProps): JSX.Element;
|
|
22
23
|
export {};
|
|
23
24
|
//# sourceMappingURL=image.d.ts.map
|
package/dist/image.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,UAAU,EAEf,KAAK,gBAAgB,EAEtB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAmB,KAAK,GAAG,EAA0B,MAAM,UAAU,CAAA;AAG5E,4FAA4F;AAC5F,KAAK,aAAa,GACd,KAAK,GACL,QAAQ,GACR,OAAO,GACP,OAAO,GACP,QAAQ,GACR,KAAK,GACL,SAAS,GACT,UAAU,GACV,eAAe,CAAA;AAEnB,MAAM,WAAW,mBACf,SAAQ,UAAU,EAChB,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,EAAE,aAAa,GAAG,MAAM,UAAU,CAAC;IACjF,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAA;CAC9B;AAED,MAAM,MAAM,yBAAyB,GAAG,gBAAgB,GACtD,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAA;AAEvD;;;GAGG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,mBAAmB,GAAG,yBAAyB,GAAG,GAAG,CAAC,OAAO,CA2CzF"}
|
package/dist/image.js
CHANGED
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
* reactively (`splitProps`/`mergeProps`). Resizing is delegated to the `loader`; nifra bundles no codec.
|
|
7
7
|
* No JSX (`createComponent`/`Dynamic`), so the package builds with plain `tsc`.
|
|
8
8
|
*/
|
|
9
|
-
import { resolveImage, toHtmlAttrs } from "@nifrajs/image";
|
|
9
|
+
import { resolveImage, toHtmlAttrs, } from "@nifrajs/image";
|
|
10
10
|
import { createComponent, mergeProps, splitProps } from "solid-js";
|
|
11
11
|
import { Dynamic } from "solid-js/web";
|
|
12
12
|
/**
|
|
13
|
-
* Render a responsive, CLS-safe `<img>`.
|
|
13
|
+
* Render a responsive, CLS-safe `<img>`. String URLs require dimensions; asset imports infer them;
|
|
14
14
|
* `priority` marks the LCP image (`eager` + `fetchpriority="high"`). Extra DOM props pass through.
|
|
15
15
|
*/
|
|
16
16
|
export function Image(props) {
|
|
@@ -31,10 +31,7 @@ export function Image(props) {
|
|
|
31
31
|
const attrs = () => {
|
|
32
32
|
// Build ImageProps via conditional spreads (exactOptionalPropertyTypes: an unset optional is
|
|
33
33
|
// absent, not `undefined`). resolveImage validates width/height > 0 (CLS contract).
|
|
34
|
-
const
|
|
35
|
-
src: props.src,
|
|
36
|
-
width: props.width,
|
|
37
|
-
height: props.height,
|
|
34
|
+
const common = {
|
|
38
35
|
alt: props.alt,
|
|
39
36
|
...(props.sizes !== undefined ? { sizes: props.sizes } : {}),
|
|
40
37
|
...(props.widths !== undefined ? { widths: props.widths } : {}),
|
|
@@ -42,6 +39,19 @@ export function Image(props) {
|
|
|
42
39
|
...(props.loading !== undefined ? { loading: props.loading } : {}),
|
|
43
40
|
...(props.priority !== undefined ? { priority: props.priority } : {}),
|
|
44
41
|
};
|
|
42
|
+
const input = typeof props.src === "string"
|
|
43
|
+
? {
|
|
44
|
+
...common,
|
|
45
|
+
src: props.src,
|
|
46
|
+
width: props.width ?? Number.NaN,
|
|
47
|
+
height: props.height ?? Number.NaN,
|
|
48
|
+
}
|
|
49
|
+
: {
|
|
50
|
+
...common,
|
|
51
|
+
src: props.src,
|
|
52
|
+
...(props.width !== undefined ? { width: props.width } : {}),
|
|
53
|
+
...(props.height !== undefined ? { height: props.height } : {}),
|
|
54
|
+
};
|
|
45
55
|
return toHtmlAttrs(resolveImage(input, props.loader));
|
|
46
56
|
};
|
|
47
57
|
return createComponent(Dynamic, mergeProps(rest, attrs, { component: "img" }));
|
package/dist/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAIL,YAAY,EAEZ,WAAW,GACZ,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAY,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAC5E,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAwBtC;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,KAAsD;IAC1E,sGAAsG;IACtG,iGAAiG;IACjG,MAAM,CAAC,EAAE,IAAI,CAAC,GAAG,UAAU,CAAC,KAAK,EAAE;QACjC,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,UAAU;QACV,KAAK;QACL,OAAO;QACP,QAAQ;QACR,KAAK;QACL,OAAO;QACP,SAAS;KACV,CAAC,CAAA;IACF,MAAM,KAAK,GAAG,GAAmC,EAAE;QACjD,6FAA6F;QAC7F,oFAAoF;QACpF,MAAM,MAAM,GAAG;YACb,GAAG,EAAE,KAAK,CAAC,GAAG;YACd,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5D,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE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,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,CAAA;AAChF,CAAC"}
|
package/dist/keep-alive-view.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createComponent, createComputed, createMemo, For, on, untrack, } from "solid-js";
|
|
2
2
|
import { Dynamic } from "solid-js/web";
|
|
3
3
|
import { PageContext } from "./page-visibility.js";
|
|
4
|
-
import { RenderPropsContext, SearchContext } from "./router.js";
|
|
4
|
+
import { RenderPropsContext, SearchContext } from "./router-context.js";
|
|
5
5
|
const EMPTY_SEARCH = Object.freeze({});
|
|
6
6
|
// The providers `compose` puts around a chain, for one slot's props.
|
|
7
7
|
const withRouteContext = (props, children) => createComponent(SearchContext.Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keep-alive-view.js","sourceRoot":"","sources":["../src/keep-alive-view.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,eAAe,EACf,cAAc,EACd,UAAU,EACV,GAAG,EAEH,EAAE,EACF,OAAO,GACR,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"keep-alive-view.js","sourceRoot":"","sources":["../src/keep-alive-view.ts"],"names":[],"mappings":"AAYA,OAAO,EAGL,eAAe,EACf,cAAc,EACd,UAAU,EACV,GAAG,EAEH,EAAE,EACF,OAAO,GACR,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,WAAW,EAAiB,MAAM,sBAAsB,CAAA;AACjE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAwBvE,MAA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,QAAQ;QACb,KAAK,EAAE,IAAI;QACX,KAAK;QACL,MAAM,EAAE,KAAK;QACb,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;KAC9B,CAAA;IACD,KAAK,IAAI,KAAK,GAAG,IAAI,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC;QAC/C,IAAI,GAAG;YACL,GAAG,EAAE,WAAW,KAAK,EAAE;YACvB,KAAK;YACL,KAAK;YACL,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;YAC9B,QAAQ,EAAE,CAAC,IAAI,CAAC;SACjB,CAAA;IACH,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAA;AACf,CAAC"}
|
package/dist/ppr.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface HoleProps<Data> {
|
|
|
17
17
|
readonly error?: JSX.Element;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* One `dynamic` or `shared` boundary of a partially prerendered page.
|
|
21
21
|
*
|
|
22
22
|
* In a shared shell the hole is an empty host Solid never fills: the PPR runtime puts the server's
|
|
23
23
|
* HTML into it, and an interactive hole then hydrates as its own root from the frame's props. When the
|
package/dist/ppr.js
CHANGED
|
@@ -18,7 +18,7 @@ function openHost(hole, fill) {
|
|
|
18
18
|
return clientHost(hole.name, hole.render, hole.interactive === true, attributes, fill);
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* One `dynamic` or `shared` boundary of a partially prerendered page.
|
|
22
22
|
*
|
|
23
23
|
* In a shared shell the hole is an empty host Solid never fills: the PPR runtime puts the server's
|
|
24
24
|
* HTML into it, and an interactive hole then hydrates as its own root from the frame's props. When the
|
package/dist/query.d.ts
CHANGED
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import type { QueryClient, QueryOptions, QueryState } from "@nifrajs/web";
|
|
1
|
+
import type { DehydratedState, InfiniteData, InfiniteQueryOptions, MutationCallbacks, MutationContext, MutationState, QueryClient, QueryOptions, QueryState } from "@nifrajs/web";
|
|
2
2
|
/**
|
|
3
3
|
* `@nifrajs/web-solid/query` - Solid bindings for the keyed query-cache. `createQuery(key, fn)` bridges a
|
|
4
4
|
* query's `subscribe`/`snapshot` store into a Solid signal and fetches on mount; `useQueryClient`
|
|
5
5
|
* exposes `invalidateQueries` for after a mutation. Imports only `solid-js` + `@nifrajs/web` (never
|
|
6
6
|
* `solid-js/web`), so route components use it on the server *and* client. No JSX.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
* accessor returns
|
|
8
|
+
* Without a provider, the query client is created lazily **client-side only** (`typeof window`) - on
|
|
9
|
+
* the server the accessor returns idle state and route loaders remain the data source. A
|
|
10
|
+
* `QueryClientProvider` can supply a request-scoped hydrated client.
|
|
10
11
|
* The `key` is captured once (Solid setup runs once); a reactive key is a documented future enhancement.
|
|
11
12
|
*/
|
|
12
|
-
import { type Accessor } from "solid-js";
|
|
13
|
+
import { type Accessor, type JSX } from "solid-js";
|
|
14
|
+
/** Provide a request-scoped client and optionally seed it before descendants run. */
|
|
15
|
+
export declare function QueryClientProvider(props: {
|
|
16
|
+
readonly client: QueryClient;
|
|
17
|
+
readonly state?: DehydratedState;
|
|
18
|
+
readonly children?: JSX.Element;
|
|
19
|
+
}): JSX.Element;
|
|
13
20
|
/** Access the query client to imperatively `invalidateQueries(keyOrPrefix)` (e.g. after a mutation). */
|
|
14
21
|
export declare function useQueryClient(): Pick<QueryClient, "invalidateQueries">;
|
|
15
22
|
/** A query's reactive state accessor plus `refetch`. */
|
|
@@ -26,4 +33,36 @@ export interface CreateQueryResult<T> {
|
|
|
26
33
|
* the live keys that refetch it.
|
|
27
34
|
*/
|
|
28
35
|
export declare function createQuery<T>(key: unknown, fn: () => Promise<T>, options?: QueryOptions): CreateQueryResult<T>;
|
|
36
|
+
/** A mutation result expressed as Solid accessors and imperative controls. */
|
|
37
|
+
export interface CreateMutationResult<TData, TVariables> {
|
|
38
|
+
readonly state: Accessor<MutationState<TData, TVariables>>;
|
|
39
|
+
readonly isIdle: Accessor<boolean>;
|
|
40
|
+
readonly isPending: Accessor<boolean>;
|
|
41
|
+
readonly isError: Accessor<boolean>;
|
|
42
|
+
readonly isSuccess: Accessor<boolean>;
|
|
43
|
+
readonly mutate: (variables: TVariables) => void;
|
|
44
|
+
readonly mutateAsync: (variables: TVariables) => Promise<TData>;
|
|
45
|
+
readonly reset: () => void;
|
|
46
|
+
readonly cancel: () => void;
|
|
47
|
+
}
|
|
48
|
+
/** Bind a mutation to a Solid owner. Identity changes discard late results and callbacks. */
|
|
49
|
+
export declare function createMutation<TData, TVariables = void>(fn: (variables: TVariables, context: MutationContext) => Promise<TData>, callbacks?: MutationCallbacks<TData, TVariables>): CreateMutationResult<TData, TVariables>;
|
|
50
|
+
/** Options for a Solid infinite query. */
|
|
51
|
+
export interface CreateInfiniteQueryOptions<T, P> extends InfiniteQueryOptions<T, P> {
|
|
52
|
+
readonly enabled?: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** Infinite-query state and page controls expressed as Solid accessors. */
|
|
55
|
+
export interface CreateInfiniteQueryResult<T, P> {
|
|
56
|
+
readonly state: Accessor<QueryState<InfiniteData<T, P>>>;
|
|
57
|
+
readonly isPending: Accessor<boolean>;
|
|
58
|
+
readonly isError: Accessor<boolean>;
|
|
59
|
+
readonly isSuccess: Accessor<boolean>;
|
|
60
|
+
readonly hasNextPage: Accessor<boolean>;
|
|
61
|
+
readonly hasPreviousPage: Accessor<boolean>;
|
|
62
|
+
readonly fetchNextPage: () => Promise<InfiniteData<T, P>>;
|
|
63
|
+
readonly fetchPreviousPage: () => Promise<InfiniteData<T, P>>;
|
|
64
|
+
readonly refetch: () => Promise<InfiniteData<T, P>>;
|
|
65
|
+
}
|
|
66
|
+
/** Bind a paged query to a Solid owner and fetch its first page on mount. */
|
|
67
|
+
export declare function createInfiniteQuery<T, P>(key: unknown, fn: (pageParam: P) => Promise<T>, options: CreateInfiniteQueryOptions<T, P>): CreateInfiniteQueryResult<T, P>;
|
|
29
68
|
//# sourceMappingURL=query.d.ts.map
|
package/dist/query.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EAEf,aAAa,EACb,WAAW,EACX,YAAY,EACZ,UAAU,EACX,MAAM,cAAc,CAAA;AASrB;;;;;;;;;;GAUG;AACH,OAAO,EACL,KAAK,QAAQ,EAIb,KAAK,GAAG,EAIT,MAAM,UAAU,CAAA;AAQjB,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE;IACzC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,eAAe,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CAChC,GAAG,GAAG,CAAC,OAAO,CAQd;AAED,wGAAwG;AACxG,wBAAgB,cAAc,IAAI,IAAI,CAAC,WAAW,EAAE,mBAAmB,CAAC,CAEvE;AAED,wDAAwD;AACxD,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,uGAAuG;IACvG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAA;IACvC,6CAA6C;IAC7C,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,CAAA;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAC3B,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,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ED,2EAA2E;AAC3E,MAAM,WAAW,yBAAyB,CAAC,CAAC,EAAE,CAAC;IAC7C,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAA;IACxD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACrC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACnC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACrC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IACvC,QAAQ,CAAC,eAAe,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAA;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACzD,QAAQ,CAAC,iBAAiB,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC7D,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;CACpD;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,CAAC,EACtC,GAAG,EAAE,OAAO,EACZ,EAAE,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,EAChC,OAAO,EAAE,0BAA0B,CAAC,CAAC,EAAE,CAAC,CAAC,GACxC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC,CAmCjC"}
|
package/dist/query.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createMutation as createMutationHandle } from "@nifrajs/web/client";
|
|
1
2
|
import { createNoClientRefetch, fetchOnMount, getQueryClientSingleton, IDLE_QUERY_STATE, noop, } from "@nifrajs/web/internal/query-runtime";
|
|
2
3
|
/**
|
|
3
4
|
* `@nifrajs/web-solid/query` - Solid bindings for the keyed query-cache. `createQuery(key, fn)` bridges a
|
|
@@ -5,14 +6,30 @@ import { createNoClientRefetch, fetchOnMount, getQueryClientSingleton, IDLE_QUER
|
|
|
5
6
|
* exposes `invalidateQueries` for after a mutation. Imports only `solid-js` + `@nifrajs/web` (never
|
|
6
7
|
* `solid-js/web`), so route components use it on the server *and* client. No JSX.
|
|
7
8
|
*
|
|
8
|
-
*
|
|
9
|
-
* accessor returns
|
|
9
|
+
* Without a provider, the query client is created lazily **client-side only** (`typeof window`) - on
|
|
10
|
+
* the server the accessor returns idle state and route loaders remain the data source. A
|
|
11
|
+
* `QueryClientProvider` can supply a request-scoped hydrated client.
|
|
10
12
|
* The `key` is captured once (Solid setup runs once); a reactive key is a documented future enhancement.
|
|
11
13
|
*/
|
|
12
|
-
import { createSignal, onCleanup, onMount } from "solid-js";
|
|
14
|
+
import { createComponent, createContext, createSignal, onCleanup, onMount, useContext, } from "solid-js";
|
|
15
|
+
const QueryClientContext = createContext();
|
|
16
|
+
function queryClientForCurrentTree() {
|
|
17
|
+
return useContext(QueryClientContext) ?? getQueryClientSingleton();
|
|
18
|
+
}
|
|
19
|
+
/** Provide a request-scoped client and optionally seed it before descendants run. */
|
|
20
|
+
export function QueryClientProvider(props) {
|
|
21
|
+
if (props.state !== undefined)
|
|
22
|
+
props.client.hydrate(props.state);
|
|
23
|
+
return createComponent(QueryClientContext.Provider, {
|
|
24
|
+
value: props.client,
|
|
25
|
+
get children() {
|
|
26
|
+
return props.children;
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
13
30
|
/** Access the query client to imperatively `invalidateQueries(keyOrPrefix)` (e.g. after a mutation). */
|
|
14
31
|
export function useQueryClient() {
|
|
15
|
-
return
|
|
32
|
+
return queryClientForCurrentTree() ?? { invalidateQueries: noop };
|
|
16
33
|
}
|
|
17
34
|
/**
|
|
18
35
|
* Bind the keyed query for `key`, fetched via `fn`. Returns a reactive `state()` accessor + `refetch`.
|
|
@@ -21,7 +38,7 @@ export function useQueryClient() {
|
|
|
21
38
|
* the live keys that refetch it.
|
|
22
39
|
*/
|
|
23
40
|
export function createQuery(key, fn, options) {
|
|
24
|
-
const handle =
|
|
41
|
+
const handle = queryClientForCurrentTree()?.query(key, fn, options);
|
|
25
42
|
const [state, setState] = createSignal(handle ? handle.snapshot() : IDLE_QUERY_STATE);
|
|
26
43
|
if (handle !== undefined) {
|
|
27
44
|
onCleanup(handle.subscribe(() => setState(() => handle.snapshot())));
|
|
@@ -33,4 +50,55 @@ export function createQuery(key, fn, options) {
|
|
|
33
50
|
refetch: createNoClientRefetch("[nifra/web-solid]", "createQuery.refetch"),
|
|
34
51
|
};
|
|
35
52
|
}
|
|
53
|
+
/** Bind a mutation to a Solid owner. Identity changes discard late results and callbacks. */
|
|
54
|
+
export function createMutation(fn, callbacks = {}) {
|
|
55
|
+
const handle = createMutationHandle(fn, callbacks);
|
|
56
|
+
const [state, setState] = createSignal(handle.snapshot());
|
|
57
|
+
onCleanup(handle.subscribe(() => setState(() => handle.snapshot())));
|
|
58
|
+
return {
|
|
59
|
+
state,
|
|
60
|
+
isIdle: () => state().status === "idle",
|
|
61
|
+
isPending: () => state().status === "pending",
|
|
62
|
+
isError: () => state().status === "error",
|
|
63
|
+
isSuccess: () => state().status === "success",
|
|
64
|
+
mutate: (variables) => {
|
|
65
|
+
handle.mutate(variables).catch(noop);
|
|
66
|
+
},
|
|
67
|
+
mutateAsync: handle.mutate,
|
|
68
|
+
reset: handle.reset,
|
|
69
|
+
cancel: handle.cancel,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/** Bind a paged query to a Solid owner and fetch its first page on mount. */
|
|
73
|
+
export function createInfiniteQuery(key, fn, options) {
|
|
74
|
+
const client = queryClientForCurrentTree();
|
|
75
|
+
const enabled = options.enabled !== false;
|
|
76
|
+
const handle = client?.infiniteQuery(key, fn, options);
|
|
77
|
+
const [state, setState] = createSignal(handle
|
|
78
|
+
? handle.snapshot()
|
|
79
|
+
: // biome-ignore lint/plugin/requireSafetyCommentForTypeAssertion: An idle query has no generic page data; the provider supplies the typed state before use.
|
|
80
|
+
IDLE_QUERY_STATE);
|
|
81
|
+
if (handle) {
|
|
82
|
+
onCleanup(handle.subscribe(() => setState(() => handle.snapshot())));
|
|
83
|
+
onMount(fetchOnMount(enabled ? handle : undefined));
|
|
84
|
+
}
|
|
85
|
+
const noClientAction = createNoClientRefetch("[nifra/web-solid]", "infinite query action");
|
|
86
|
+
return {
|
|
87
|
+
state,
|
|
88
|
+
isPending: () => state().status === "pending",
|
|
89
|
+
isError: () => state().status === "error",
|
|
90
|
+
isSuccess: () => state().status === "success",
|
|
91
|
+
hasNextPage: () => {
|
|
92
|
+
state();
|
|
93
|
+
return handle?.hasNextPage() ?? false;
|
|
94
|
+
},
|
|
95
|
+
hasPreviousPage: () => {
|
|
96
|
+
state();
|
|
97
|
+
return handle?.hasPreviousPage() ?? false;
|
|
98
|
+
},
|
|
99
|
+
fetchNextPage: handle?.fetchNextPage ?? noClientAction,
|
|
100
|
+
fetchPreviousPage: handle?.fetchPreviousPage ?? noClientAction,
|
|
101
|
+
refetch: handle?.refetch ?? noClientAction,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
36
104
|
//# sourceMappingURL=query.js.map
|
package/dist/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.js","sourceRoot":"","sources":["../src/query.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,IAAI,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EACL,qBAAqB,EACrB,YAAY,EACZ,uBAAuB,EACvB,gBAAgB,EAChB,IAAI,GACL,MAAM,qCAAqC,CAAA;AAC5C;;;;;;;;;;GAUG;AACH,OAAO,EA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AC;QACD,aAAa,EAAE,MAAM,EAAE,aAAa,IAAI,cAAc;QACtD,iBAAiB,EAAE,MAAM,EAAE,iBAAiB,IAAI,cAAc;QAC9D,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,cAAc;KAC3C,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { RenderProps, RouteSlotName, RouteSlotTarget } from "@nifrajs/web";
|
|
2
|
+
import { type LoadedRouteSlot, type RouteSlotStatus, rawHref } from "@nifrajs/web/client";
|
|
3
|
+
import { type JSX } from "solid-js";
|
|
4
|
+
export interface RouteSlotController {
|
|
5
|
+
readonly target: () => string | undefined;
|
|
6
|
+
readonly status: () => RouteSlotStatus;
|
|
7
|
+
readonly content: () => LoadedRouteSlot | undefined;
|
|
8
|
+
readonly error: () => string | undefined;
|
|
9
|
+
open(target: RouteSlotTarget): void;
|
|
10
|
+
close(): void;
|
|
11
|
+
}
|
|
12
|
+
export interface RouteSlotHooks {
|
|
13
|
+
createEffect(effect: () => void): void;
|
|
14
|
+
createMemo<T>(read: () => T): () => T;
|
|
15
|
+
createSignal<T>(initial: T): readonly [() => T, (next: T | ((previous: T) => T)) => void];
|
|
16
|
+
onCleanup(cleanup: () => void): void;
|
|
17
|
+
}
|
|
18
|
+
export interface RouteSlotProps {
|
|
19
|
+
readonly name: RouteSlotName;
|
|
20
|
+
readonly fallback?: JSX.Element;
|
|
21
|
+
readonly error?: JSX.Element | ((code: string) => JSX.Element);
|
|
22
|
+
}
|
|
23
|
+
/** Build the hook with its small reactive surface; the test seam avoids global module mocks. */
|
|
24
|
+
export declare function createRouteSlotBinding(readProps: () => RenderProps | undefined, navigate: (href: ReturnType<typeof rawHref>) => void, hooks: RouteSlotHooks): (name: RouteSlotName) => RouteSlotController;
|
|
25
|
+
/** Read or navigate one route slot without changing any sibling slot's URL state or component tree. */
|
|
26
|
+
export declare const useRouteSlot: (name: RouteSlotName) => RouteSlotController;
|
|
27
|
+
/** Render the registered route's complete layout and page chain in this independently navigable region. */
|
|
28
|
+
export declare function RouteSlot(props: RouteSlotProps): JSX.Element;
|
|
29
|
+
//# sourceMappingURL=route-slot.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-slot.d.ts","sourceRoot":"","sources":["../src/route-slot.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAC/E,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,eAAe,EACpB,OAAO,EAMR,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EAKL,KAAK,GAAG,EAIT,MAAM,UAAU,CAAA;AAKjB,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,eAAe,CAAA;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,eAAe,GAAG,SAAS,CAAA;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IACxC,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAA;IACnC,KAAK,IAAI,IAAI,CAAA;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;IACtC,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,CAAA;IACrC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAA;IACzF,SAAS,CAAC,OAAO,EAAE,MAAM,IAAI,GAAG,IAAI,CAAA;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IAC/B,QAAQ,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,CAAA;CAC/D;AAED,gGAAgG;AAChG,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,MAAM,WAAW,GAAG,SAAS,EACxC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,OAAO,CAAC,KAAK,IAAI,EACpD,KAAK,EAAE,cAAc,GACpB,CAAC,IAAI,EAAE,aAAa,KAAK,mBAAmB,CA+C9C;AAED,uGAAuG;AACvG,eAAO,MAAM,YAAY,SAlDf,aAAa,KAAK,mBAsD3B,CAAA;AAED,2GAA2G;AAE3G,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,GAAG,CAAC,OAAO,CAuB5D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { getRouteSlotStore, rawHref, routeSlotSyncKey, routeSlotTargetFromPath, setRouteSlot, stripRouteSlots, syncRouteSlotStore, } from "@nifrajs/web/client";
|
|
2
|
+
import { navigateNow } from "@nifrajs/web/internal/navigate-runtime";
|
|
3
|
+
import { createComponent, createEffect, createMemo, createSignal, onCleanup, untrack, useContext, } from "solid-js";
|
|
4
|
+
import { Dynamic } from "solid-js/web";
|
|
5
|
+
import { compose } from "./compose.js";
|
|
6
|
+
import { RenderPropsContext } from "./router-context.js";
|
|
7
|
+
/** Build the hook with its small reactive surface; the test seam avoids global module mocks. */
|
|
8
|
+
export function createRouteSlotBinding(readProps, navigate, hooks) {
|
|
9
|
+
return function useRouteSlot(name) {
|
|
10
|
+
const props = readProps();
|
|
11
|
+
const path = () => props?.path ?? "/";
|
|
12
|
+
const pending = () => props?.pending === true;
|
|
13
|
+
const parsed = hooks.createMemo(() => routeSlotTargetFromPath(path(), name));
|
|
14
|
+
const basePath = hooks.createMemo(() => stripRouteSlots(path()));
|
|
15
|
+
const store = hooks.createMemo(() => getRouteSlotStore(basePath(), name));
|
|
16
|
+
const [snapshot, setSnapshot] = hooks.createSignal(store().getServerSnapshot());
|
|
17
|
+
const requestKey = hooks.createMemo(() => routeSlotSyncKey(basePath(), name, parsed().target, parsed().error, pending()));
|
|
18
|
+
hooks.createEffect(() => {
|
|
19
|
+
const currentStore = store();
|
|
20
|
+
setSnapshot(currentStore.getSnapshot());
|
|
21
|
+
const unsubscribe = currentStore.subscribe(() => setSnapshot(currentStore.getSnapshot()));
|
|
22
|
+
hooks.onCleanup(unsubscribe);
|
|
23
|
+
});
|
|
24
|
+
hooks.createEffect(() => {
|
|
25
|
+
const current = parsed();
|
|
26
|
+
syncRouteSlotStore(store(), basePath(), name, current.target, current.error, pending());
|
|
27
|
+
});
|
|
28
|
+
const current = hooks.createMemo(() => {
|
|
29
|
+
const value = snapshot();
|
|
30
|
+
return value.key === requestKey() ? value : undefined;
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
target: () => parsed().target,
|
|
34
|
+
status: () => current()?.status ??
|
|
35
|
+
(parsed().error !== undefined
|
|
36
|
+
? "error"
|
|
37
|
+
: pending() || parsed().target === undefined
|
|
38
|
+
? "idle"
|
|
39
|
+
: "loading"),
|
|
40
|
+
content: () => current()?.content,
|
|
41
|
+
error: () => current()?.error ?? parsed().error,
|
|
42
|
+
open: (target) => navigate(rawHref(setRouteSlot(path(), name, String(target)))),
|
|
43
|
+
close: () => navigate(rawHref(setRouteSlot(path(), name, null))),
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/** Read or navigate one route slot without changing any sibling slot's URL state or component tree. */
|
|
48
|
+
export const useRouteSlot = createRouteSlotBinding(() => useContext(RenderPropsContext), navigateNow, { createEffect, createMemo, createSignal, onCleanup });
|
|
49
|
+
/** Render the registered route's complete layout and page chain in this independently navigable region. */
|
|
50
|
+
export function RouteSlot(props) {
|
|
51
|
+
const slot = useRouteSlot(props.name);
|
|
52
|
+
const view = createMemo(() => {
|
|
53
|
+
const content = slot.content();
|
|
54
|
+
if (content !== undefined)
|
|
55
|
+
return untrack(() => compose(content.chain, content)());
|
|
56
|
+
if (slot.status() === "error") {
|
|
57
|
+
const code = slot.error() ?? "unavailable";
|
|
58
|
+
const error = props.error;
|
|
59
|
+
if (typeof error === "function")
|
|
60
|
+
return untrack(() => error(code));
|
|
61
|
+
if (error !== undefined)
|
|
62
|
+
return error;
|
|
63
|
+
return untrack(() => createComponent(Dynamic, {
|
|
64
|
+
component: "div",
|
|
65
|
+
role: "alert",
|
|
66
|
+
"data-route-slot-error": code,
|
|
67
|
+
children: "This panel is unavailable.",
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
return slot.target() !== undefined ? (props.fallback ?? null) : null;
|
|
71
|
+
});
|
|
72
|
+
// biome-ignore lint/plugin/requireSafetyCommentForTypeAssertion lint/plugin/noChainedTypeAssertions: Solid inserts an accessor reactively as its child, while its JSX.Element type excludes functions.
|
|
73
|
+
return view;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=route-slot.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-slot.jsx","sourceRoot":"","sources":["../src/route-slot.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,EAIjB,OAAO,EACP,gBAAgB,EAChB,uBAAuB,EACvB,YAAY,EACZ,eAAe,EACf,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,UAAU,EACV,YAAY,EAEZ,SAAS,EACT,OAAO,EACP,UAAU,GACX,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,M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AAI,EAAE,OAAO;gBACb,uBAAuB,EAAE,IAAI;gBAC7B,QAAQ,EAAE,4BAA4B;aACvC,CAAC,CACH,CAAA;QACH,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACtE,CAAC,CAAC,CAAA;IACF,uMAAuM;IACvM,OAAO,IAA8B,CAAA;AACvC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { RenderProps } from "@nifrajs/web";
|
|
2
|
+
import { type Accessor, type Context } from "solid-js";
|
|
3
|
+
export declare const SearchContext: Context<Accessor<Record<string, unknown>> | undefined>;
|
|
4
|
+
export declare const RenderPropsContext: Context<RenderProps | undefined>;
|
|
5
|
+
//# sourceMappingURL=router-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../src/router-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAAiB,MAAM,UAAU,CAAA;AAQrE,eAAO,MAAM,aAAa,wDACoE,CAAA;AAO9F,eAAO,MAAM,kBAAkB,kCACuC,CAAA"}
|