@cosmicdrift/kumiko-types 0.232.0 → 0.234.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-types",
3
- "version": "0.232.0",
3
+ "version": "0.234.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/fields.ts CHANGED
@@ -371,6 +371,9 @@ export type NumberFieldDef = {
371
371
  /** `true` → `integer` column + `.int()` Zod validation. Omitted/`false` →
372
372
  * `double precision` column, fractional values allowed. */
373
373
  readonly integer?: boolean;
374
+ /** Display-only suffix: a static string, or a sibling field name whose
375
+ * value supplies it. Never converts the stored number. */
376
+ readonly unit?: string | { readonly field: string };
374
377
  } & ResolvedPiiFlags;
375
378
 
376
379
  /**
package/src/nav-icon.ts CHANGED
@@ -1,12 +1,13 @@
1
- // Closed vocabulary of nav icon keys. NavDefinition.icon, ScreenNavSugar.icon
2
- // and ConfigMask.icon are all typed against this union, so an unregistered
3
- // key is a compile error at the r.nav()/r.screen()/config-mask call site
4
- // instead of a silent missing-icon at runtime.
1
+ // Closed vocabulary of nav and button icon keys. NavDefinition.icon,
2
+ // ScreenNavSugar.icon, ConfigMask.icon and ButtonProps.icon/iconEnd are all
3
+ // typed against this union, so an unregistered key is a compile error at the
4
+ // r.nav()/r.screen()/config-mask/button call site instead of a silent
5
+ // missing-icon at runtime.
5
6
  //
6
- // The renderer-web NAV_ICONS map (packages/renderer-web/src/layout/
7
- // nav-tree.tsx) is checked against this same union via `satisfies`, so the
8
- // two can't drift — add a key here only together with its lucide-react entry
9
- // there, and vice versa.
7
+ // The renderer-web NAV_ICONS map (packages/renderer-web/src/icons.tsx) is
8
+ // checked against this same union via `satisfies`, so the two can't drift —
9
+ // add a key here only together with its lucide-react entry there, and vice
10
+ // versa.
10
11
  export type NavIconKey =
11
12
  | "dashboard"
12
13
  | "layout-grid"
@@ -55,4 +56,38 @@ export type NavIconKey =
55
56
  | "upload"
56
57
  | "rocket"
57
58
  | "plus"
58
- | "languages";
59
+ | "languages"
60
+ | "trash"
61
+ | "x"
62
+ | "check"
63
+ | "arrow-left"
64
+ | "arrow-right"
65
+ | "copy"
66
+ | "pencil"
67
+ | "eye"
68
+ | "eye-off"
69
+ | "filter"
70
+ | "refresh"
71
+ | "more-horizontal"
72
+ | "more-vertical"
73
+ | "external-link"
74
+ | "chevron-down"
75
+ | "chevron-right"
76
+ | "save"
77
+ | "undo"
78
+ | "archive"
79
+ | "star"
80
+ | "flag"
81
+ | "clock"
82
+ | "map-pin"
83
+ | "phone"
84
+ | "printer"
85
+ | "alert-triangle"
86
+ | "info"
87
+ | "check-circle"
88
+ | "x-circle"
89
+ | "loader";
90
+
91
+ // Alias kept because the union stopped being nav-only — actions and fields
92
+ // (added on this branch) also key their icons against it.
93
+ export type IconKey = NavIconKey;
package/src/nav.ts CHANGED
@@ -3,7 +3,7 @@ import type { NavIconKey } from "./nav-icon";
3
3
  import type { TargetRef } from "./target-ref";
4
4
  import type { TreeAction } from "./tree-node";
5
5
 
6
- export type { NavIconKey } from "./nav-icon";
6
+ export type { IconKey, NavIconKey } from "./nav-icon";
7
7
 
8
8
  // Nav entry declaration. Every feature that wants to appear in the app's
9
9
  // navigation tree registers one or more entries via r.nav(). The engine
package/src/screen.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { FieldIconKey } from "./field-icon";
2
2
  import type { FieldDefinition } from "./fields";
3
3
  import type { AccessRule } from "./handlers";
4
- import type { NavIconKey } from "./nav-icon";
4
+ import type { IconKey, NavIconKey } from "./nav-icon";
5
5
 
6
6
  export type { FieldIconKey } from "./field-icon";
7
7
 
@@ -34,7 +34,7 @@ export type PlatformComponent = {
34
34
  // formats it as a locale-formatted number with a literal "m²" suffix. The
35
35
  // rest map to a CLDR-sanctioned Intl.NumberFormat unit id and get
36
36
  // locale-correct pluralization/spacing straight from Intl.
37
- export type UnitKey = "m2" | "km" | "m" | "kg" | "percent";
37
+ export type UnitKey = "m2" | "km" | "m" | "kg" | "percent" | "mi";
38
38
 
39
39
  // Built-in value formatters. Apps extend via module augmentation:
40
40
  // declare module "@cosmicdrift/kumiko-framework/engine/types" {
@@ -227,6 +227,10 @@ export type RowActionWriteHandler = {
227
227
  /** Visual-Style. "danger" rendert rot + erzwingt einen Confirm-
228
228
  * Dialog (auch ohne expliziten `confirm`-Key). */
229
229
  readonly style?: "primary" | "secondary" | "danger";
230
+ /** Overrides the id-based default icon (see ACTION_ICON_BY_ID in
231
+ * kumiko-renderer) — closed IconKey vocabulary into the ICONS registry
232
+ * (renderer-web), analogous to EditFieldSpec.icon. */
233
+ readonly icon?: IconKey;
230
234
  };
231
235
 
232
236
  export type RowActionNavigateBase = {
@@ -252,6 +256,10 @@ export type RowActionNavigateBase = {
252
256
  * auf navigate — ein Row-Klick darf keinen (evtl. destruktiven, unbestätigten)
253
257
  * Write auslösen, daher nicht auf writeHandler-Actions. */
254
258
  readonly rowClick?: boolean;
259
+ /** Overrides the id-based default icon (see ACTION_ICON_BY_ID in
260
+ * kumiko-renderer) — closed IconKey vocabulary into the ICONS registry
261
+ * (renderer-web), analogous to EditFieldSpec.icon. */
262
+ readonly icon?: IconKey;
255
263
  };
256
264
 
257
265
  /** Exactly one of `screen` / `entity` — mutual exclusivity is type-enforced
@@ -682,6 +690,11 @@ export type EditFieldsSection = {
682
690
  readonly description?: string;
683
691
  readonly columns?: number;
684
692
  readonly fields: readonly EditFieldSpec[];
693
+ /** Rendered left of the section title, `text-muted-foreground` — closed
694
+ * IconKey vocabulary into the ICONS registry (renderer-web), analogous
695
+ * to EditFieldSpec.icon. No title → no icon, and no heuristic derives
696
+ * one from the title (titles are free i18n strings). */
697
+ readonly icon?: IconKey;
685
698
  };
686
699
 
687
700
  export type EditExtensionSection = {
@@ -798,6 +811,13 @@ export type EntityEditScreenDefinition = {
798
811
  * das `mask.title`-Label des Config-Keys. Fehlt ein Eintrag, gilt die
799
812
  * Konvention. */
800
813
  readonly fieldLabels?: Readonly<Record<string, string>>;
814
+ /** Header action buttons. Reuses `RowAction` — analogous to
815
+ * `ProjectionDetailScreenDefinition.actions` (the loaded record stands
816
+ * in for the "row"). `rowClick` has no target here and is rejected by
817
+ * the boot-validator, same as on projectionDetail. Not rendered in
818
+ * create mode — every action targets an existing record, which the
819
+ * create branch doesn't have yet. */
820
+ readonly actions?: readonly RowAction[];
801
821
  readonly slots?: ScreenSlots;
802
822
  readonly access?: AccessRule;
803
823
  };