@savvifi/meridian-aion-web 0.2.1 → 0.3.1
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/render-client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { RpcInvoker } from "@savvifi/meridian-schemas/uiview";
|
|
3
|
-
import { type MeridianActionHandler, type MeridianInitialData } from "@savvifi/meridian-web-react";
|
|
3
|
+
import { type MeridianActionHandler, type MeridianHrefResolver, type MeridianInitialData } from "@savvifi/meridian-web-react";
|
|
4
4
|
export interface MeridianEntityViewProps {
|
|
5
5
|
/** The dehydrated ViewDescriptor JSON value (from the server render). */
|
|
6
6
|
viewJson: unknown;
|
|
@@ -16,5 +16,12 @@ export interface MeridianEntityViewProps {
|
|
|
16
16
|
* Client-only (SSR renders the same markup; onClick handlers aren't serialized).
|
|
17
17
|
*/
|
|
18
18
|
onAction?: MeridianActionHandler;
|
|
19
|
+
/**
|
|
20
|
+
* Host resolver for a table cell's link destination (a TableColumn's
|
|
21
|
+
* ColumnLink). Given (target kind, cell value) it returns the host's route —
|
|
22
|
+
* so meridian draws real links while the host owns URLs. Absent ⇒ link cells
|
|
23
|
+
* render as plain text.
|
|
24
|
+
*/
|
|
25
|
+
resolveHref?: MeridianHrefResolver;
|
|
19
26
|
}
|
|
20
|
-
export declare function MeridianEntityView({ viewJson, initialData, invoker, mode, onAction, }: MeridianEntityViewProps): ReactNode;
|
|
27
|
+
export declare function MeridianEntityView({ viewJson, initialData, invoker, mode, onAction, resolveHref, }: MeridianEntityViewProps): ReactNode;
|
package/dist/render-client.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ViewDescriptorSchema } from "@savvifi/meridian-proto-ts/proto/view_pb.j
|
|
|
9
9
|
import { ViewRenderer, } from "@savvifi/meridian-web-react";
|
|
10
10
|
import { MeridianMuiProvider } from "@savvifi/meridian-mui-kit";
|
|
11
11
|
import { savviSkin } from "./savvi-skin.js";
|
|
12
|
-
export function MeridianEntityView({ viewJson, initialData, invoker, mode = "light", onAction, }) {
|
|
12
|
+
export function MeridianEntityView({ viewJson, initialData, invoker, mode = "light", onAction, resolveHref, }) {
|
|
13
13
|
const view = fromJson(ViewDescriptorSchema, viewJson);
|
|
14
|
-
return createElement(MeridianMuiProvider, { invoker, theme: savviSkin, mode, onAction }, createElement(ViewRenderer, { view, initialData }));
|
|
14
|
+
return createElement(MeridianMuiProvider, { invoker, theme: savviSkin, mode, onAction, resolveHref }, createElement(ViewRenderer, { view, initialData }));
|
|
15
15
|
}
|
package/dist/render-server.js
CHANGED
|
@@ -49,7 +49,12 @@ export async function renderMeridianEntityView(input) {
|
|
|
49
49
|
const composition = compositions[entityType];
|
|
50
50
|
if (!composition)
|
|
51
51
|
return miss();
|
|
52
|
-
|
|
52
|
+
// CLIENT pagination: the aion entity list ops return a bounded set and don't
|
|
53
|
+
// honor a client-supplied page size (the composition fixes it), so paginate the
|
|
54
|
+
// fetched rows in the renderer — the page-size selector then slices locally and
|
|
55
|
+
// the count is real. This matches the old studio DataTableView (fetch + local
|
|
56
|
+
// paginate); server-cursor paging would need the ops to accept a runtime size.
|
|
57
|
+
const view = projectEntityView(composition, { kind, pagination: "client", pageSize: 20 });
|
|
53
58
|
const invoker = createEntityOpsInvoker(caller.entities?.ops);
|
|
54
59
|
// Pre-fetch page-0 for the table so the SSR HTML carries real rows (and the
|
|
55
60
|
// client hydrates without an immediate refetch). Non-fatal: on failure we
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvifi/meridian-aion-web",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The aion/web <-> meridian-ux render seam: renderMeridianEntityView (server — parse route, load composition, project to a ViewDescriptor, pre-fetch page-0, render + dehydrate) + MeridianEntityView (client hydration) + savviSkin. Lets an SSR host (e.g. aion/web on Hono+Vite) render entity routes through meridian instead of the legacy React path.",
|
|
6
6
|
"publishConfig": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@savvifi/meridian-aion-projection": "^0.2.2",
|
|
40
|
-
"@savvifi/meridian-mui-kit": "^0.
|
|
41
|
-
"@savvifi/meridian-proto-ts": "^0.
|
|
42
|
-
"@savvifi/meridian-schemas": "^0.
|
|
43
|
-
"@savvifi/meridian-web-react": "^0.
|
|
40
|
+
"@savvifi/meridian-mui-kit": "^0.3.0",
|
|
41
|
+
"@savvifi/meridian-proto-ts": "^0.7.0",
|
|
42
|
+
"@savvifi/meridian-schemas": "^0.7.0",
|
|
43
|
+
"@savvifi/meridian-web-react": "^0.5.0",
|
|
44
44
|
"@bufbuild/protobuf": "2.12.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|