@cosmicdrift/kumiko-headless 0.247.0 → 0.249.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-headless",
3
- "version": "0.247.0",
3
+ "version": "0.249.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.247.0",
39
+ "@cosmicdrift/kumiko-framework": "0.249.0",
40
40
  "temporal-polyfill": "^0.3.2",
41
41
  "zod": "^4.4.3"
42
42
  },
@@ -232,8 +232,38 @@ describe("resolveNavigation", () => {
232
232
  expect(hero?.actions).toHaveLength(1);
233
233
  });
234
234
 
235
- // Knoten ohne die neuen Felder dürfen sie NICHT als undefined-Keys tragen
236
- // (conditional-spread): hält die resolved Node sauber + Snapshot-stabil.
235
+ // fw#2750: a TreeAction can also carry `screen` (route link) instead of
236
+ // `target` (dispatch) — same polymorphism as the node itself.
237
+ test("action `screen` (route-link variant) passes through alongside target-based actions", () => {
238
+ const editTarget = { featureId: "text-content", action: "edit", args: { slug: "hero" } };
239
+ const source = buildSource([
240
+ {
241
+ id: "tc:nav:content",
242
+ label: "Content",
243
+ provider: true,
244
+ createAction: { icon: "plus", label: "New page", screen: "tc:screen:new-page" },
245
+ },
246
+ {
247
+ id: "tc:nav:hero",
248
+ label: "Hero",
249
+ parent: "tc:nav:content",
250
+ target: editTarget,
251
+ actions: [{ icon: "edit", label: "Edit in editor", screen: "tc:screen:hero" }],
252
+ },
253
+ ]);
254
+
255
+ const tree = resolveNavigation({ source });
256
+ const content = tree[0];
257
+ expect(content?.createAction?.screen).toBe("tc:screen:new-page");
258
+ expect(content?.createAction?.target).toBeUndefined();
259
+ const hero = content?.children[0];
260
+ expect(hero?.actions?.[0]?.screen).toBe("tc:screen:hero");
261
+ expect(hero?.actions?.[0]?.target).toBeUndefined();
262
+ });
263
+
264
+ // A node without the polymorphic fields must NOT carry them as
265
+ // undefined-valued keys (conditional-spread): keeps the resolved node
266
+ // clean and snapshot-stable.
237
267
  test("absent polymorphic fields are omitted, not set to undefined", () => {
238
268
  const source = buildSource([{ id: "a:nav:plain", label: "Plain", screen: "a:screen:x" }]);
239
269
  const node = resolveNavigation({ source })[0];