@cosmicdrift/kumiko-headless 0.195.0 → 0.196.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 +2 -2
- package/src/apex/index.ts +1 -1
- package/src/form/form-controller.ts +3 -2
- package/src/form/types.ts +4 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-headless",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.196.0",
|
|
4
4
|
"description": "Headless UI logic for Kumiko — Dispatcher contract, Form-Controller, View-Model, Nav-Resolver. Plattform- und React-frei; jeder Renderer (renderer, renderer-web, renderer-native, …) komponiert darauf.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
}
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
39
|
+
"@cosmicdrift/kumiko-framework": "0.196.0",
|
|
40
40
|
"temporal-polyfill": "^0.3.2",
|
|
41
41
|
"zod": "^4.4.3"
|
|
42
42
|
},
|
package/src/apex/index.ts
CHANGED
|
@@ -532,7 +532,7 @@ export function renderApexPage(page: ApexPage): string {
|
|
|
532
532
|
<html lang="${escapeHtml(head.lang)}">
|
|
533
533
|
<head>
|
|
534
534
|
<meta charset="utf-8" />
|
|
535
|
-
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
|
535
|
+
<meta name="viewport" content="width=device-width,initial-scale=1,interactive-widget=resizes-content" />
|
|
536
536
|
${renderApexHeadTags(head)}
|
|
537
537
|
<style>${cssHtml}</style>
|
|
538
538
|
</head>
|
|
@@ -347,6 +347,7 @@ export function createFormController<TValues extends FormValues, TCtx = unknown>
|
|
|
347
347
|
return {
|
|
348
348
|
validationBlocked: false,
|
|
349
349
|
isSuccess: true,
|
|
350
|
+
isNoOp: true,
|
|
350
351
|
data: submittedValues as unknown as TData,
|
|
351
352
|
};
|
|
352
353
|
}
|
|
@@ -364,7 +365,7 @@ export function createFormController<TValues extends FormValues, TCtx = unknown>
|
|
|
364
365
|
// Rebase to the SNAPSHOT, not to the current values — see
|
|
365
366
|
// runRebaseToSnapshot comment for why.
|
|
366
367
|
runRebaseToSnapshot(submittedValues);
|
|
367
|
-
return { validationBlocked: false, isSuccess: true, data: result.data };
|
|
368
|
+
return { validationBlocked: false, isSuccess: true, isNoOp: false, data: result.data };
|
|
368
369
|
}
|
|
369
370
|
|
|
370
371
|
const serverFields = result.error.details?.fields;
|
|
@@ -372,7 +373,7 @@ export function createFormController<TValues extends FormValues, TCtx = unknown>
|
|
|
372
373
|
errors = Object.freeze(groupIssuesByPath(serverFields));
|
|
373
374
|
invalidate();
|
|
374
375
|
}
|
|
375
|
-
return { validationBlocked: false, isSuccess: false, error: result.error };
|
|
376
|
+
return { validationBlocked: false, isSuccess: false, isNoOp: false, error: result.error };
|
|
376
377
|
};
|
|
377
378
|
|
|
378
379
|
submitInFlight = runWrite();
|
package/src/form/types.ts
CHANGED
|
@@ -281,6 +281,9 @@ export type SubmitConfig<TValues extends FormValues = FormValues> = {
|
|
|
281
281
|
// `validationBlocked: true` signals a LOCAL (pre-dispatch) validate()
|
|
282
282
|
// failure — no network call happened; caller doesn't need to retry the
|
|
283
283
|
// network, the user needs to fix fields.
|
|
284
|
+
// `isNoOp: true` signals a successful submit that skipped dispatcher.write
|
|
285
|
+
// entirely because payloadMode "changes" found nothing changed — callers
|
|
286
|
+
// must not treat this like a normal write (e.g. don't discard a draft).
|
|
284
287
|
export type SubmitResult<TData = unknown> =
|
|
285
|
-
| ({ readonly validationBlocked: false } & WriteResult<TData>)
|
|
288
|
+
| ({ readonly validationBlocked: false; readonly isNoOp?: boolean } & WriteResult<TData>)
|
|
286
289
|
| { readonly validationBlocked: true; readonly isSuccess: false };
|