@cosmicdrift/kumiko-renderer 0.424.0 → 0.424.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.
|
@@ -151,7 +151,7 @@ export function ActionFormBody({ schema, screen, translate, entityId, initialOve
|
|
|
151
151
|
searchParams: nav.searchParams,
|
|
152
152
|
})
|
|
153
153
|
: undefined;
|
|
154
|
-
const loadState = useActionFormLoad(screen.load, loadRecordId, loadableFieldNames, screen.summary?.paramsFromLoad, initialOverrides);
|
|
154
|
+
const loadState = useActionFormLoad(screen.load, loadRecordId, loadableFieldNames, screen.summary?.paramsFromLoad, initialOverrides ?? handoffValues);
|
|
155
155
|
// What an aiAssist query gets besides its chip params: the same context the form loads with.
|
|
156
156
|
const aiAssistPayload = useMemo(() => screen.load === undefined
|
|
157
157
|
? (initialOverrides ?? {})
|
|
@@ -30,8 +30,8 @@ export type DefaultAppShellProps = {
|
|
|
30
30
|
/** Footer slot at the bottom of the sidebar — profile row, help link,
|
|
31
31
|
* or plan banner. */
|
|
32
32
|
readonly sidebarFooter?: ReactNode;
|
|
33
|
-
/**
|
|
34
|
-
* "More" tile that opens the full sidebar. Unset: every top-level entry. */
|
|
33
|
+
/** Nav QNs (any depth) the focus rail shows as tiles, in this order; unlisted
|
|
34
|
+
* top-level entries sit behind a "More" tile that opens the full sidebar. Unset: every top-level entry. */
|
|
35
35
|
readonly focusRailNavQns?: readonly string[];
|
|
36
36
|
/** Viewport-fit shell. true → fixed viewport height (`h-svh`); content
|
|
37
37
|
* scrolls inside instead of the whole page. Defaults to true — `fill={false}`
|
|
@@ -8,7 +8,7 @@ export type FocusRailProps = {
|
|
|
8
8
|
readonly roles: readonly string[];
|
|
9
9
|
};
|
|
10
10
|
readonly allowedNavQns?: ReadonlySet<string>;
|
|
11
|
-
/**
|
|
11
|
+
/** Nav QNs (any depth) that get a rail tile, in this order; unlisted top-level nodes sit behind "More". Unset: all top-level nodes. */
|
|
12
12
|
readonly railNavQns?: readonly string[];
|
|
13
13
|
/** The sidebar footer (e.g. the sidebar UserMenu), pinned to the bottom of the rail. */
|
|
14
14
|
readonly footer?: ReactNode;
|
|
@@ -13,6 +13,16 @@ import { resolveParentScreenId } from "./shell-breadcrumb.js";
|
|
|
13
13
|
import { useDispatchTarget } from "./target-resolver-stub.js";
|
|
14
14
|
const NAV_ICON_LOOKUP = NAV_ICONS;
|
|
15
15
|
const RAIL_TILE_CLASS = "flex size-10 shrink-0 items-center justify-center rounded-md border-0 bg-transparent p-0 text-sidebar-muted outline-hidden transition-colors hover:bg-sidebar-accent/60 hover:text-sidebar-accent-foreground focus-visible:ring-2 focus-visible:ring-sidebar-ring data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground";
|
|
16
|
+
function findNavNode(nodes, qualifiedName) {
|
|
17
|
+
for (const node of nodes) {
|
|
18
|
+
if (node.qualifiedName === qualifiedName)
|
|
19
|
+
return node;
|
|
20
|
+
const nested = findNavNode(node.children, qualifiedName);
|
|
21
|
+
if (nested !== undefined)
|
|
22
|
+
return nested;
|
|
23
|
+
}
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
16
26
|
function RailGlyph({ node, label }) {
|
|
17
27
|
const Icon = node.icon !== undefined && Object.hasOwn(NAV_ICONS, node.icon)
|
|
18
28
|
? NAV_ICON_LOOKUP[node.icon]
|
|
@@ -54,8 +64,20 @@ export function FocusRail({ brand, schema, user, allowedNavQns, railNavQns, foot
|
|
|
54
64
|
}, [schema, user, allowedNavQns]);
|
|
55
65
|
const activeScreenId = useActiveScreenId(tree, schema);
|
|
56
66
|
const isActive = (node) => activeScreenId !== undefined && treeContainsScreen([node], activeScreenId);
|
|
57
|
-
|
|
67
|
+
// Listed entries can sit inside a group (listed or not), so the lookup walks the whole
|
|
68
|
+
// tree; entries without a match (e.g. hidden by role) are skipped.
|
|
69
|
+
const shown = railNavQns === undefined
|
|
70
|
+
? tree
|
|
71
|
+
: [...new Set(railNavQns)].flatMap((qn) => {
|
|
72
|
+
const node = findNavNode(tree, qn);
|
|
73
|
+
return node === undefined ? [] : [node];
|
|
74
|
+
});
|
|
58
75
|
const hidden = tree.filter((node) => !shown.includes(node));
|
|
76
|
+
// A shown tile nested in another shown tile owns the highlight; the outer one stays plain.
|
|
77
|
+
const isTileActive = (node) => isActive(node) &&
|
|
78
|
+
!shown.some((other) => other !== node &&
|
|
79
|
+
isActive(other) &&
|
|
80
|
+
findNavNode(node.children, other.qualifiedName) !== undefined);
|
|
59
81
|
const moreLabel = t("kumiko.focusRail.more");
|
|
60
|
-
return (_jsxs("div", { "data-kumiko-layout": "focus-rail", "data-focus-rail": "", className: "group/focus-rail flex h-full flex-col items-center px-2 py-3", children: [brand, _jsx("nav", { className: "flex flex-col items-center gap-1", children: shown.map((node) => (_jsx(RailTile, { node: node, active:
|
|
82
|
+
return (_jsxs("div", { "data-kumiko-layout": "focus-rail", "data-focus-rail": "", className: "group/focus-rail flex h-full flex-col items-center px-2 py-3", children: [brand, _jsx("nav", { className: "flex flex-col items-center gap-1", children: shown.map((node) => (_jsx(RailTile, { node: node, active: isTileActive(node) }, node.qualifiedName))) }), _jsxs("div", { className: "mt-auto flex w-full flex-col items-center gap-1", children: [hidden.length > 0 && (_jsx("button", { type: "button", title: moreLabel, "aria-label": moreLabel, "data-active": hidden.some(isActive) && !shown.some(isActive), className: RAIL_TILE_CLASS, onClick: () => setOpen(true), children: _jsx(MoreHorizontal, { "aria-hidden": "true", className: "size-[18px]" }) })), footer !== undefined && (_jsx("div", { "data-kumiko-layout": "focus-rail-footer", className: "w-full", children: footer }))] })] }));
|
|
61
83
|
}
|
|
@@ -26,8 +26,8 @@ export type WorkspaceShellProps = {
|
|
|
26
26
|
* build information. It stays at the bottom via `mt-auto` (see
|
|
27
27
|
* Sidebar.footer). Symmetric with DefaultAppShell.sidebarFooter. */
|
|
28
28
|
readonly sidebarFooter?: ReactNode;
|
|
29
|
-
/**
|
|
30
|
-
* "More" tile that opens the full sidebar. Unset: every top-level entry. */
|
|
29
|
+
/** Nav QNs (any depth) the focus rail shows as tiles, in this order; unlisted
|
|
30
|
+
* top-level entries sit behind a "More" tile that opens the full sidebar. Unset: every top-level entry. */
|
|
31
31
|
readonly focusRailNavQns?: readonly string[];
|
|
32
32
|
/** Runtime badge slot per nav leaf (bare nav id), same as DefaultAppShell. */
|
|
33
33
|
readonly navBadges?: ReadonlyMap<string, ReactNode>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.424.
|
|
3
|
+
"version": "0.424.1",
|
|
4
4
|
"description": "React renderer for Kumiko screens. The root export holds the platform-agnostic logic (primitives contract, hooks, KumikoScreen, navigation and SSE abstractions); ./headless the DOM-free UI logic, ./live the HTTP dispatcher, ./web the browser bindings (HTML primitives, history navigation, EventSource live events, createKumikoApp).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@cosmicdrift/kumiko-framework": "0.424.
|
|
52
|
-
"@cosmicdrift/kumiko-types": "0.424.
|
|
51
|
+
"@cosmicdrift/kumiko-framework": "0.424.1",
|
|
52
|
+
"@cosmicdrift/kumiko-types": "0.424.1",
|
|
53
53
|
"@types/qrcode": "^1.5.6",
|
|
54
54
|
"class-variance-authority": "^0.7.1",
|
|
55
55
|
"clsx": "^2.1.1",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
"devDependencies": {
|
|
82
|
-
"@cosmicdrift/kumiko-locale-de": "0.424.
|
|
83
|
-
"@cosmicdrift/kumiko-testing": "0.424.
|
|
82
|
+
"@cosmicdrift/kumiko-locale-de": "0.424.1",
|
|
83
|
+
"@cosmicdrift/kumiko-testing": "0.424.1",
|
|
84
84
|
"@tailwindcss/cli": "^4.3.3",
|
|
85
85
|
"@testing-library/react": "^16.3.3",
|
|
86
86
|
"@testing-library/user-event": "^14.6.8",
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.424.1",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "focus rail shows listed entries that sit inside a group",
|
|
6
|
+
"detail": "`focusRailNavQns` only matched top-level nav nodes, so a listed entry below a group was missing from the rail. The rail now finds listed entries at any depth and shows them in list order. When a listed entry nests in another listed tile, only the inner one is marked active, and \"More\" stays plain when a shown nested tile holds the active screen."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.424.1",
|
|
10
|
+
"type": "fix",
|
|
11
|
+
"title": "actionForm load.passPrefill passes handoff values",
|
|
12
|
+
"detail": "An actionForm with `load` takes its values only from the load query. `passPrefill` sent the drawer's prefill values there but not the values of a navigation handoff (`useNavigateWithInitialValues`), so a form opened from an assistant step lost the step's values. The handoff values now travel in the load payload the same way; the query's schema must accept them."
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"version": "0.424.0",
|
|
4
16
|
"type": "fix",
|