@cosmicdrift/kumiko-renderer 0.193.1 → 0.195.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/__tests__/error-i18n-defaults.test.ts +9 -0
- package/src/app/__tests__/content-editors.test.tsx +24 -5
- package/src/app/__tests__/content-preview.test.tsx +23 -1
- package/src/app/__tests__/form-schema.test.ts +8 -12
- package/src/app/content-editors.tsx +13 -6
- package/src/app/content-preview.tsx +3 -1
- package/src/app/extension-sections.tsx +5 -2
- package/src/app/form-schema.ts +13 -3
- package/src/app/kumiko-screen.tsx +8 -2
- package/src/components/__tests__/embedded-list-field.test.tsx +68 -1
- package/src/components/__tests__/render-field-money-embedded-list-consistency.test.tsx +212 -0
- package/src/components/__tests__/render-field-money-roundtrip.test.tsx +14 -0
- package/src/components/__tests__/render-field-unsupported-types.test.tsx +22 -1
- package/src/components/embedded-list-field.tsx +59 -7
- package/src/components/reference-create-dialog.tsx +1 -1
- package/src/components/render-edit-logic.ts +3 -8
- package/src/components/render-edit.tsx +152 -75
- package/src/components/render-field.tsx +15 -3
- package/src/i18n-defaults.ts +23 -5
- package/src/index.ts +1 -0
- package/src/primitives.tsx +28 -7
package/src/primitives.tsx
CHANGED
|
@@ -127,8 +127,11 @@ export type BannerProps = {
|
|
|
127
127
|
readonly padded?: boolean;
|
|
128
128
|
readonly testId?: string;
|
|
129
129
|
/** Set when a `<Field>` wraps this Banner as its control (no actual
|
|
130
|
-
* input exists
|
|
131
|
-
*
|
|
130
|
+
* input exists for the label to target — see render-field.tsx's
|
|
131
|
+
* unsupported-field-type fallback, #1834). The web implementation uses
|
|
132
|
+
* it to derive `role="group"` + `aria-labelledby`, not `htmlFor`: a
|
|
133
|
+
* `<label for>` on a non-labelable element like a `<div>` is inert for
|
|
134
|
+
* screen readers. */
|
|
132
135
|
readonly id?: string;
|
|
133
136
|
};
|
|
134
137
|
|
|
@@ -270,6 +273,9 @@ export type InputProps =
|
|
|
270
273
|
/** Only for kind:"image" — variant name for the preview
|
|
271
274
|
* (`/api/files/:id/variant/:name`). Absent → the original. */
|
|
272
275
|
readonly imageVariant?: string;
|
|
276
|
+
/** Only for kind:"image" — forwarded to the file input's `capture`
|
|
277
|
+
* attribute so a phone opens the camera instead of the file picker. */
|
|
278
|
+
readonly capture?: "environment" | "user";
|
|
273
279
|
}
|
|
274
280
|
| {
|
|
275
281
|
readonly kind: "date";
|
|
@@ -437,6 +443,9 @@ export type InputProps =
|
|
|
437
443
|
readonly disabled?: boolean;
|
|
438
444
|
readonly required?: boolean;
|
|
439
445
|
readonly hasError?: boolean;
|
|
446
|
+
/** Read-only Textarea. Nicht `disabled` — bleibt fokussier-/
|
|
447
|
+
* kopierbar (analog zu kind:"text"). */
|
|
448
|
+
readonly readOnly?: boolean;
|
|
440
449
|
};
|
|
441
450
|
|
|
442
451
|
// Sort-Wire-Format. `null`-State unterscheidet "User hat noch nichts
|
|
@@ -723,11 +732,6 @@ export type SectionProps = {
|
|
|
723
732
|
* Default "default" (normal card border). */
|
|
724
733
|
readonly variant?: "default" | "destructive";
|
|
725
734
|
readonly testId?: string;
|
|
726
|
-
/** Keeps the section mounted while visually hiding it (native `hidden`
|
|
727
|
-
* attribute where supported) — used by wizard mode to keep off-screen
|
|
728
|
-
* steps mounted so their state (e.g. an extension section's submit
|
|
729
|
-
* registration) survives step navigation instead of unmounting. */
|
|
730
|
-
readonly hidden?: boolean;
|
|
731
735
|
};
|
|
732
736
|
|
|
733
737
|
/** Columns-basiertes Layout. Web: CSS grid, Native: Flex-Wrap mit
|
|
@@ -909,6 +913,19 @@ export type StepBarProps = {
|
|
|
909
913
|
readonly compactTestId?: string;
|
|
910
914
|
};
|
|
911
915
|
|
|
916
|
+
/** Wraps a single wizard step so it stays mounted but inert while off-
|
|
917
|
+
* screen — `hidden` visually hides it, and implementations that have a
|
|
918
|
+
* native constraint-validation concept (web: `<fieldset disabled>`, spec-
|
|
919
|
+
* guaranteed to also bar descendants from participating) must bar it too,
|
|
920
|
+
* or a `type="submit"` step-advance button triggers the browser's
|
|
921
|
+
* full-form check against fields on unvisited, unfocusable steps
|
|
922
|
+
* (kumiko-framework#1976). Implementations without that concept can gate
|
|
923
|
+
* on `hidden` alone. */
|
|
924
|
+
export type WizardStepGroupProps = {
|
|
925
|
+
readonly hidden: boolean;
|
|
926
|
+
readonly children: ReactNode;
|
|
927
|
+
};
|
|
928
|
+
|
|
912
929
|
// ---- Core-Registry (Kumiko-eigene Primitives) ----
|
|
913
930
|
|
|
914
931
|
export type CorePrimitives = {
|
|
@@ -942,6 +959,10 @@ export type CorePrimitives = {
|
|
|
942
959
|
* CorePrimitives mocks in tests keep compiling — additive rollout of
|
|
943
960
|
* a new primitive shouldn't force every test double to grow a stub. */
|
|
944
961
|
readonly StepBar?: ComponentType<StepBarProps>;
|
|
962
|
+
/** Optional (unlike the other Core-Primitives) so existing partial
|
|
963
|
+
* CorePrimitives mocks in tests keep compiling — additive rollout of
|
|
964
|
+
* a new primitive shouldn't force every test double to grow a stub. */
|
|
965
|
+
readonly WizardStepGroup?: ComponentType<WizardStepGroupProps>;
|
|
945
966
|
};
|
|
946
967
|
|
|
947
968
|
/** Offene Extension-Zone für App-eigene Primitives. Devs erweitern
|