@cosmicdrift/kumiko-renderer 0.325.0 → 0.325.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.325.
|
|
3
|
+
"version": "0.325.1",
|
|
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,9 +15,9 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cosmicdrift/kumiko-framework": "0.325.
|
|
19
|
-
"@cosmicdrift/kumiko-headless": "0.325.
|
|
20
|
-
"@cosmicdrift/kumiko-types": "0.325.
|
|
18
|
+
"@cosmicdrift/kumiko-framework": "0.325.1",
|
|
19
|
+
"@cosmicdrift/kumiko-headless": "0.325.1",
|
|
20
|
+
"@cosmicdrift/kumiko-types": "0.325.1",
|
|
21
21
|
"react": "^19.2.6",
|
|
22
22
|
"temporal-polyfill": "^0.3.2",
|
|
23
23
|
"zod": "^4.4.3"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@types/react-dom": "^19.2.3",
|
|
29
29
|
"jsdom": "^29.1.1",
|
|
30
30
|
"react-dom": "^19.2.6",
|
|
31
|
-
"@cosmicdrift/kumiko-locale-de": "0.325.
|
|
31
|
+
"@cosmicdrift/kumiko-locale-de": "0.325.1"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|
|
@@ -500,6 +500,9 @@ function resolveTenantCurrency(
|
|
|
500
500
|
// lands here — same last resort as the entityEdit path's `?? "EUR"`.
|
|
501
501
|
const ACTION_FORM_CURRENCY_FALLBACK = "EUR";
|
|
502
502
|
|
|
503
|
+
// Shared by the update payload shape and the server-error path prefix so both can't drift.
|
|
504
|
+
const UPDATE_CHANGES_KEY = "changes";
|
|
505
|
+
|
|
503
506
|
// A money field naming a fixed ISO code (`currency: { kind: "literal", code }`,
|
|
504
507
|
// fw#2839) resolves with no query at all. Read structurally, same idiom as
|
|
505
508
|
// tenantCurrencyMoneyFieldNames above.
|
|
@@ -1196,7 +1199,7 @@ function EntityEditUpdateForm({
|
|
|
1196
1199
|
(snap: { readonly changes: Readonly<Record<string, unknown>> }): unknown => ({
|
|
1197
1200
|
id: entityId,
|
|
1198
1201
|
version: recordVersion,
|
|
1199
|
-
|
|
1202
|
+
[UPDATE_CHANGES_KEY]: snap.changes,
|
|
1200
1203
|
}),
|
|
1201
1204
|
[entityId, recordVersion],
|
|
1202
1205
|
);
|
|
@@ -1317,6 +1320,7 @@ function EntityEditUpdateForm({
|
|
|
1317
1320
|
writeCommand={writeCommand}
|
|
1318
1321
|
payloadMode="changes"
|
|
1319
1322
|
buildPayload={buildPayload}
|
|
1323
|
+
serverFieldPathPrefix={`${UPDATE_CHANGES_KEY}.`}
|
|
1320
1324
|
onSubmit={handleSubmitted}
|
|
1321
1325
|
// allowDelete:false marks an entity without a CRUD delete (history is
|
|
1322
1326
|
// kept) — without this gate the button dispatched against an
|
package/src/changes.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.325.1",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Server validation errors on entityEdit update forms reach their fields again",
|
|
6
|
+
"detail": "The update form sends `{ id, version, changes }`, so server validation issues arrive as\n`changes.<field>`. The form controller stored them under that key, so no field showed the\nerror, tabs/wizard layouts never jumped to the erroring tab (only the generic banner), and\nsingle-section forms failed silently. A new submit option `serverFieldPathPrefix` strips the\nnesting key; KumikoScreen's update form sets it to `changes.`. Paths without the prefix are unchanged."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.320.0",
|
|
4
10
|
"type": "improvement",
|
|
@@ -46,6 +46,10 @@ export type RenderEditProps<TValues extends FormValues, TCtx = unknown> = {
|
|
|
46
46
|
readonly onSubmit?: (result: SubmitResult<unknown>) => void;
|
|
47
47
|
readonly payloadMode?: "values" | "changes";
|
|
48
48
|
readonly buildPayload?: (snapshot: FormSnapshot<TValues>) => unknown;
|
|
49
|
+
/** Prefix to strip from server validation issue paths before mapping them
|
|
50
|
+
* onto form fields — see SubmitConfig.serverFieldPathPrefix. Only needed
|
|
51
|
+
* when buildPayload nests the form values under a key. */
|
|
52
|
+
readonly serverFieldPathPrefix?: string;
|
|
49
53
|
readonly onDelete?: () => Promise<void> | void;
|
|
50
54
|
readonly onCancel?: () => void;
|
|
51
55
|
readonly onReload?: () => void;
|
|
@@ -296,6 +296,7 @@ export function RenderEdit<TValues extends FormValues, TCtx = unknown>(
|
|
|
296
296
|
onSubmit,
|
|
297
297
|
payloadMode = "values",
|
|
298
298
|
buildPayload,
|
|
299
|
+
serverFieldPathPrefix,
|
|
299
300
|
onDelete,
|
|
300
301
|
onCancel,
|
|
301
302
|
onReload,
|
|
@@ -434,6 +435,7 @@ export function RenderEdit<TValues extends FormValues, TCtx = unknown>(
|
|
|
434
435
|
type: writeCommand,
|
|
435
436
|
payloadMode,
|
|
436
437
|
...(buildPayload !== undefined && { buildPayload }),
|
|
438
|
+
...(serverFieldPathPrefix !== undefined && { serverFieldPathPrefix }),
|
|
437
439
|
...(scopeFieldNames !== undefined && { validateScope: scopeFieldNames }),
|
|
438
440
|
}
|
|
439
441
|
: undefined;
|