@cosmicdrift/kumiko-framework 0.34.2 → 0.35.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 +1 -1
- package/src/engine/types/index.ts +2 -0
- package/src/engine/types/screen.ts +23 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-framework",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.0",
|
|
4
4
|
"description": "Framework core — engine, pipeline, API, DB, and every other bit that makes Kumiko go.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -24,18 +24,31 @@ export type PlatformComponent = {
|
|
|
24
24
|
readonly native?: unknown;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
// Built-in value formatters. Apps extend via module augmentation:
|
|
28
|
+
// declare module "@cosmicdrift/kumiko-framework" {
|
|
29
|
+
// interface FieldFormatRegistry { myFormat: { myOption?: string } }
|
|
30
|
+
// }
|
|
31
|
+
// renderer-web handles all built-in keys; unknown app-specific keys fall back
|
|
32
|
+
// to String(value).
|
|
33
|
+
export interface FieldFormatRegistry {
|
|
34
|
+
timestamp: Record<never, never>;
|
|
35
|
+
date: Record<never, never>;
|
|
36
|
+
boolean: { readonly trueLabel?: string; readonly falseLabel?: string };
|
|
37
|
+
currency: { readonly symbol?: string };
|
|
38
|
+
priority: { readonly emptyLabel?: string; readonly prefix?: string };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Discriminated union derived from the registry — one variant per key.
|
|
42
|
+
// JSON-safe: no function members, survives buildAppSchema → window.__KUMIKO_SCHEMA__.
|
|
43
|
+
export type FormatSpec = {
|
|
44
|
+
[K in keyof FieldFormatRegistry]: { readonly format: K } & FieldFormatRegistry[K];
|
|
45
|
+
}[keyof FieldFormatRegistry];
|
|
46
|
+
|
|
27
47
|
// Level-2 field renderer (ui-architecture.md §Renderer Customization):
|
|
28
48
|
// - PlatformComponent → platform-specific component from the same feature
|
|
29
|
-
// - string → cross-feature QN reference (resolved
|
|
30
|
-
// -
|
|
31
|
-
|
|
32
|
-
// nützlich für context-aware Renderer (Tier 2.7e-Eagerload nutzt das
|
|
33
|
-
// um aus row._refs den resolved Display-Wert zu lesen). Renderer die
|
|
34
|
-
// nur den value brauchen ignorieren das Argument einfach.
|
|
35
|
-
export type FieldRenderer =
|
|
36
|
-
| PlatformComponent
|
|
37
|
-
| string
|
|
38
|
-
| ((value: unknown, row?: Readonly<Record<string, unknown>>) => string);
|
|
49
|
+
// - string → cross-feature QN reference (resolved at mount-time)
|
|
50
|
+
// - FormatSpec → declarative value formatter, JSON-safe ({ format: "timestamp" } etc.)
|
|
51
|
+
export type FieldRenderer = PlatformComponent | string | FormatSpec;
|
|
39
52
|
|
|
40
53
|
// Declarative field-state condition. Evaluated by the renderer against the
|
|
41
54
|
// current row/form values. Three forms:
|