@cosmicdrift/kumiko-renderer 0.32.0 → 0.33.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 +1 -1
- package/src/app/kumiko-screen.tsx +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.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>",
|
|
@@ -659,12 +659,22 @@ function EntityListBody({
|
|
|
659
659
|
// navigate-Variante braucht keinen Dispatcher; nav ist
|
|
660
660
|
// immer da (Provider von createKumikoApp).
|
|
661
661
|
if (action.kind === "navigate") {
|
|
662
|
+
// Deklarativer entityId-Default: zielt die Action auf einen
|
|
663
|
+
// entityEdit-Screen, ist row.id die entityId. Nötig weil die
|
|
664
|
+
// Function-Form (action.entityId) JSON-injizierte Schemas
|
|
665
|
+
// (window.__KUMIKO_SCHEMA__) nicht überlebt — silent gedroppt,
|
|
666
|
+
// siehe RowAction-Type-Header.
|
|
667
|
+
const targetIsEntityEdit = schema.screens.some(
|
|
668
|
+
(s) => s.type === "entityEdit" && lastSegment(s.id) === action.screen,
|
|
669
|
+
);
|
|
662
670
|
return {
|
|
663
671
|
id: action.id,
|
|
664
672
|
label: effectiveTranslate(action.label),
|
|
665
673
|
...(action.style !== undefined && { style: action.style }),
|
|
666
674
|
onTrigger: (row: ListRowViewModel) => {
|
|
667
|
-
const
|
|
675
|
+
const explicit = action.entityId?.(row.values);
|
|
676
|
+
const fallback = targetIsEntityEdit ? String(row.values["id"] ?? "") : undefined;
|
|
677
|
+
const entityId = explicit ?? fallback;
|
|
668
678
|
nav.navigate({
|
|
669
679
|
screenId: action.screen,
|
|
670
680
|
...(entityId !== undefined && entityId !== "" && { entityId }),
|
|
@@ -725,7 +735,7 @@ function EntityListBody({
|
|
|
725
735
|
};
|
|
726
736
|
})
|
|
727
737
|
.filter((a: DataTableRowAction | null): a is DataTableRowAction => a !== null);
|
|
728
|
-
}, [screen.rowActions, effectiveTranslate, dispatcher, nav]);
|
|
738
|
+
}, [screen.rowActions, effectiveTranslate, dispatcher, nav, schema.screens]);
|
|
729
739
|
|
|
730
740
|
// ToolbarActions: Schema → Resolved-Form (analog rowActions).
|
|
731
741
|
// navigate-kind → useNav().navigate({ screenId }), writeHandler-kind
|