@cosmicdrift/kumiko-renderer 0.40.1 → 0.42.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 +3 -3
- package/src/app/kumiko-screen.tsx +24 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.42.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.
|
|
19
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
18
|
+
"@cosmicdrift/kumiko-framework": "0.40.1",
|
|
19
|
+
"@cosmicdrift/kumiko-headless": "0.40.1",
|
|
20
20
|
"react": "^19.2.6"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
@@ -206,8 +206,11 @@ function useNavigateToCreateFor(
|
|
|
206
206
|
): (() => void) | undefined {
|
|
207
207
|
const nav = useNav();
|
|
208
208
|
const editScreenId = useMemo(() => {
|
|
209
|
+
// allowCreate:false = update-only Edit-Screen (Create läuft über einen
|
|
210
|
+
// Lifecycle-Write) — der zählt nicht als „+ Neu"-Ziel.
|
|
209
211
|
const edit = schema.screens.find(
|
|
210
|
-
(s: ScreenDefinition) =>
|
|
212
|
+
(s: ScreenDefinition) =>
|
|
213
|
+
s.type === "entityEdit" && s.entity === entityName && s.allowCreate !== false,
|
|
211
214
|
);
|
|
212
215
|
return edit !== undefined ? lastSegment(edit.id) : undefined;
|
|
213
216
|
}, [schema.screens, entityName]);
|
|
@@ -274,6 +277,17 @@ function EntityEditScreen({
|
|
|
274
277
|
/>
|
|
275
278
|
);
|
|
276
279
|
}
|
|
280
|
+
if (screen.allowCreate === false) {
|
|
281
|
+
// Update-only Screen ohne entityId (Direkt-URL / verirrte Navigation):
|
|
282
|
+
// ein Create-Form würde gegen den nicht registrierten
|
|
283
|
+
// `<entity>:create`-Handler submitten — Fehler statt Falle.
|
|
284
|
+
return (
|
|
285
|
+
<Banner padded variant="error" testId="kumiko-screen-create-disabled">
|
|
286
|
+
Screen <Text variant="code">{screen.id}</Text> is update-only (allowCreate: false) — open it
|
|
287
|
+
from a row action with an entity id.
|
|
288
|
+
</Banner>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
277
291
|
return (
|
|
278
292
|
<EntityEditCreateBody
|
|
279
293
|
schema={schema}
|
|
@@ -465,7 +479,10 @@ function EntityEditUpdateForm({
|
|
|
465
479
|
payloadMode="changes"
|
|
466
480
|
buildPayload={buildPayload}
|
|
467
481
|
onSubmit={handleSubmitted}
|
|
468
|
-
|
|
482
|
+
// allowDelete:false = Entity ohne CRUD-delete (History-Erhalt) —
|
|
483
|
+
// ohne das Gate dispatchte der Button gegen einen nicht
|
|
484
|
+
// registrierten `<entity>:delete`-Handler.
|
|
485
|
+
{...(screen.allowDelete !== false && { onDelete: handleDelete })}
|
|
469
486
|
onCancel={navigateToList}
|
|
470
487
|
onReload={() => void onReload()}
|
|
471
488
|
{...(translate !== undefined && { translate })}
|
|
@@ -969,6 +986,11 @@ function ActionFormBody({
|
|
|
969
986
|
entity={synthEntity}
|
|
970
987
|
featureName={schema.featureName}
|
|
971
988
|
initial={initial}
|
|
989
|
+
// Extension-Sections im actionForm sehen die initialen Form-Values
|
|
990
|
+
// (inkl. searchParams-Prefill, z.B. ?incidentId=…) als initialValues
|
|
991
|
+
// — anders als im entityEdit gibt es hier keinen record, aus dem
|
|
992
|
+
// sie Kontext ziehen könnten.
|
|
993
|
+
extensionInitialValues={initial}
|
|
972
994
|
writeCommand={screen.handler}
|
|
973
995
|
payloadMode="values"
|
|
974
996
|
onSubmit={handleSubmitted}
|