@cosmicdrift/kumiko-types 0.229.0 → 0.230.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/screen.ts +31 -10
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-types",
3
- "version": "0.229.0",
3
+ "version": "0.230.0",
4
4
  "description": "Framework-Type-Definitions für Kumiko — FeatureDefinition, BootCheck-Types und die reinen Engine-Types. Erlaubt Downstream-Konsumenten, gegen die Type-Contracts zu bauen, ohne das ganze Framework-Package zu importieren. Enthaelt keine identitaets-sensitiven Runtime-Werte mehr (Error-Klassen leben seit #1629 in kumiko-framework, Brand-Symbole nutzen Symbol.for) und ist deshalb eine plain dependency, keine peerDependency.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
package/src/screen.ts CHANGED
@@ -316,6 +316,8 @@ export type ToolbarAction =
316
316
  export type EntityListScreenDefinition = {
317
317
  readonly id: string;
318
318
  readonly type: "entityList";
319
+ readonly nav?: ScreenNavSugar;
320
+ readonly detailFor?: string;
319
321
  readonly entity: string;
320
322
  readonly columns: readonly ListColumnSpec[];
321
323
  // Row renderer (Desktop) — when omitted, renderer draws the default table
@@ -392,6 +394,8 @@ export type ListFacetSpec =
392
394
  export type ProjectionListScreenDefinition = {
393
395
  readonly id: string;
394
396
  readonly type: "projectionList";
397
+ readonly nav?: ScreenNavSugar;
398
+ readonly detailFor?: string;
395
399
  readonly query: string;
396
400
  readonly columns: readonly ListColumnSpec[];
397
401
  readonly rowRenderer?: PlatformComponent;
@@ -450,6 +454,8 @@ export type RecordHeaderSpec = {
450
454
  export type ProjectionDetailScreenDefinition = {
451
455
  readonly id: string;
452
456
  readonly type: "projectionDetail";
457
+ readonly nav?: ScreenNavSugar;
458
+ readonly detailFor?: string;
453
459
  readonly query: string;
454
460
  /** Query-payload key for the row-id. Default "id". */
455
461
  readonly idParam?: string;
@@ -616,6 +622,8 @@ export type DashboardFilterDefinition = {
616
622
  export type DashboardScreenDefinition = {
617
623
  readonly id: string;
618
624
  readonly type: "dashboard";
625
+ readonly nav?: ScreenNavSugar;
626
+ readonly detailFor?: string;
619
627
  readonly panels: readonly DashboardPanelDefinition[];
620
628
  readonly filter?: DashboardFilterDefinition;
621
629
  readonly slots?: ScreenSlots;
@@ -744,6 +752,8 @@ export type EditLayout = {
744
752
  export type EntityEditScreenDefinition = {
745
753
  readonly id: string;
746
754
  readonly type: "entityEdit";
755
+ readonly nav?: ScreenNavSugar;
756
+ readonly detailFor?: string;
747
757
  readonly entity: string;
748
758
  readonly layout: EditLayout;
749
759
  /** Optionaler i18n-Key (oder Roh-String) für den Submit-Button. Default
@@ -814,6 +824,8 @@ export type EntityEditScreenDefinition = {
814
824
  export type ActionFormScreenDefinition = {
815
825
  readonly id: string;
816
826
  readonly type: "actionForm";
827
+ readonly nav?: ScreenNavSugar;
828
+ readonly detailFor?: string;
817
829
  /** Write-Handler-QN der bei Submit gerufen wird. Form-Object landet
818
830
  * 1:1 als payload — Handler-Schema (Zod) validiert weiter. */
819
831
  readonly handler: string;
@@ -867,6 +879,8 @@ export type CustomScreenRoute = {
867
879
  export type CustomScreenDefinition = {
868
880
  readonly id: string;
869
881
  readonly type: "custom";
882
+ readonly nav?: ScreenNavSugar;
883
+ readonly detailFor?: string;
870
884
  readonly renderer: PlatformComponent;
871
885
  readonly routes?: readonly CustomScreenRoute[];
872
886
  /** Parent list screen for breadcrumb when this detail is not in nav. */
@@ -920,6 +934,8 @@ export type CustomScreenDefinition = {
920
934
  export type ConfigEditScreenDefinition = {
921
935
  readonly id: string;
922
936
  readonly type: "configEdit";
937
+ readonly nav?: ScreenNavSugar;
938
+ readonly detailFor?: string;
923
939
  /** scope für config:write:set Calls. Muss zur Scope-Deklaration der
924
940
  * in `configKeys` referenzierten Keys passen — Boot-Validator
925
941
  * prüft das gegen die Registry. */
@@ -973,14 +989,20 @@ export type ScreenNavSugar = {
973
989
  readonly order?: number;
974
990
  };
975
991
 
976
- // `detailFor` sits on the intersection, not on one variant, because any
977
- // screen kind can be the detail view for an entityincluding `custom`:
978
- // in app repos, detail screens are overwhelmingly custom screens today
979
- // (projectionDetail doesn't carry entity semantics). Value is an entity
980
- // name in the same (unqualified, globally-unique) form as `entity` on
981
- // `EntityListScreenDefinition` (screen.ts:259-262) — entities are never
982
- // feature-prefixed, so there's no separate qualification step.
983
- export type ScreenDefinition = (
992
+ // `nav`/`detailFor` live directly on every variant (not only via this
993
+ // union) so a screen typed as its own concrete kinde.g. `const screen:
994
+ // CustomScreenDefinition = {...}` in a module split out of `feature.ts` —
995
+ // still accepts both fields; a union-only intersection drops them the
996
+ // moment a caller narrows to one member.
997
+ //
998
+ // `detailFor` applies to any screen kind because any kind can be the
999
+ // detail view for an entity — including `custom`: in app repos, detail
1000
+ // screens are overwhelmingly custom screens today (projectionDetail
1001
+ // doesn't carry entity semantics). Value is an entity name in the same
1002
+ // (unqualified, globally-unique) form as `entity` on
1003
+ // `EntityListScreenDefinition` — entities are never feature-prefixed, so
1004
+ // there's no separate qualification step.
1005
+ export type ScreenDefinition =
984
1006
  | EntityListScreenDefinition
985
1007
  | ProjectionListScreenDefinition
986
1008
  | ProjectionDetailScreenDefinition
@@ -988,5 +1010,4 @@ export type ScreenDefinition = (
988
1010
  | EntityEditScreenDefinition
989
1011
  | ActionFormScreenDefinition
990
1012
  | ConfigEditScreenDefinition
991
- | CustomScreenDefinition
992
- ) & { readonly nav?: ScreenNavSugar; readonly detailFor?: string };
1013
+ | CustomScreenDefinition;