@cosmicdrift/kumiko-renderer 0.167.1 → 0.170.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-renderer",
3
- "version": "0.167.1",
3
+ "version": "0.170.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.167.1",
19
- "@cosmicdrift/kumiko-headless": "0.167.1",
18
+ "@cosmicdrift/kumiko-framework": "0.170.0",
19
+ "@cosmicdrift/kumiko-headless": "0.170.0",
20
20
  "react": "^19.2.6",
21
21
  "temporal-polyfill": "^0.3.2"
22
22
  },
@@ -80,6 +80,7 @@ const field = (readOnly: boolean): EditFieldViewModel => ({
80
80
  const fieldsSection = (...readOnly: boolean[]): EditSectionViewModel => ({
81
81
  kind: "fields",
82
82
  columns: 1,
83
+ visible: true,
83
84
  fields: readOnly.map(field),
84
85
  });
85
86
  const extensionSection: EditSectionViewModel = {
@@ -111,4 +112,14 @@ describe("hasEditableSection", () => {
111
112
  test("no sections → false", () => {
112
113
  expect(hasEditableSection([])).toBe(false);
113
114
  });
115
+
116
+ test("hidden section with editable field → false (user cannot see the field)", () => {
117
+ const hiddenSectionWithEditableField: EditSectionViewModel = {
118
+ kind: "fields",
119
+ columns: 1,
120
+ visible: false,
121
+ fields: [field(false)],
122
+ };
123
+ expect(hasEditableSection([hiddenSectionWithEditableField])).toBe(false);
124
+ });
114
125
  });
@@ -7,7 +7,9 @@ import type { EditSectionViewModel, SubmitResult } from "@cosmicdrift/kumiko-hea
7
7
  // without anyone deciding that on purpose.
8
8
  export function hasEditableSection(sections: readonly EditSectionViewModel[]): boolean {
9
9
  return sections.some(
10
- (s) => s.kind === "extension" || (s.kind === "fields" && s.fields.some((f) => !f.readOnly)),
10
+ (s) =>
11
+ s.kind === "extension" ||
12
+ (s.kind === "fields" && s.visible && s.fields.some((f) => !f.readOnly)),
11
13
  );
12
14
  }
13
15
 
@@ -435,6 +435,7 @@ export function RenderEdit<TValues extends FormValues, TCtx = unknown>(
435
435
  />
436
436
  );
437
437
  }
438
+ if (!section.visible) return null;
438
439
  // Section-Header unterdrücken wenn er den Form-Titel der
439
440
  // Action-Bar 1:1 wiederholen würde (typisch bei Single-Section-
440
441
  // ActionForms, deren Section-Label = Screen-Titel ist).