@cosmicdrift/kumiko-renderer 0.113.0 → 0.114.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-renderer",
3
- "version": "0.113.0",
3
+ "version": "0.114.0",
4
4
  "description": "Platform-agnostic React renderer for Kumiko screens. Contains the shared logic — primitives-contract, hooks, KumikoScreen, navigation & SSE abstractions — that any platform-specific renderer (web, native) composes. No DOM, no EventSource, no react-dom.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -15,8 +15,8 @@
15
15
  }
16
16
  },
17
17
  "dependencies": {
18
- "@cosmicdrift/kumiko-framework": "0.113.0",
19
- "@cosmicdrift/kumiko-headless": "0.113.0",
18
+ "@cosmicdrift/kumiko-framework": "0.114.0",
19
+ "@cosmicdrift/kumiko-headless": "0.114.0",
20
20
  "react": "^19.2.6"
21
21
  },
22
22
  "devDependencies": {
@@ -1074,6 +1074,23 @@ function ProjectionListBody({
1074
1074
  return out.length > 0 ? out : undefined;
1075
1075
  }, [screen.rowActions, effectiveTranslate, runNavigate]);
1076
1076
 
1077
+ const toolbarActions = useMemo((): readonly ToolbarActionButton[] | undefined => {
1078
+ if (screen.toolbarActions === undefined) return undefined;
1079
+ const out: ToolbarActionButton[] = [];
1080
+ for (const action of screen.toolbarActions) {
1081
+ // v1: nur navigate (writeHandler-Toolbar bräuchte den Dispatcher-Pfad).
1082
+ if (action.kind !== "navigate") continue;
1083
+ const target = action.screen;
1084
+ out.push({
1085
+ id: action.id,
1086
+ label: effectiveTranslate(action.label),
1087
+ ...(action.style !== undefined && { style: action.style }),
1088
+ onTrigger: () => nav.navigate({ screenId: target }),
1089
+ });
1090
+ }
1091
+ return out.length > 0 ? out : undefined;
1092
+ }, [screen.toolbarActions, effectiveTranslate, nav]);
1093
+
1077
1094
  if (rowsQuery.loading && rowsQuery.data === null) {
1078
1095
  return (
1079
1096
  <Banner padded variant="loading" testId="kumiko-screen-loading">
@@ -1107,6 +1124,7 @@ function ProjectionListBody({
1107
1124
  searchable={screen.searchable ?? false}
1108
1125
  sort={screen.defaultSort ?? null}
1109
1126
  {...(rowActions !== undefined && { rowActions })}
1127
+ {...(toolbarActions !== undefined && { toolbarActions })}
1110
1128
  {...(translate !== undefined && { translate })}
1111
1129
  {...(wrappedOnRowClick !== undefined && { onRowClick: wrappedOnRowClick })}
1112
1130
  />