@cosmicdrift/kumiko-types 0.211.0 → 0.213.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/handlers.ts +12 -0
- package/src/nav-icon.ts +2 -0
- package/src/screen.ts +24 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.213.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/handlers.ts
CHANGED
|
@@ -335,6 +335,11 @@ export type AppContext = SharedContextFields & {
|
|
|
335
335
|
* Sprint-8a Tier-Composition: `effectiveFeatures(ctx._tenantId)`-call
|
|
336
336
|
* in den hook-filter-Stellen. */
|
|
337
337
|
readonly _tenantId?: TenantId;
|
|
338
|
+
/** Boot-configured default locale (BCP-47). Last fallback in ctx.locale's
|
|
339
|
+
* Request-Locale → Boot-Default chain (dispatch-shared.ts) — used when
|
|
340
|
+
* the request carries no X-Locale header and no usable Accept-Language.
|
|
341
|
+
* Absent falls back to "en". */
|
|
342
|
+
readonly defaultLocale?: string;
|
|
338
343
|
};
|
|
339
344
|
|
|
340
345
|
// Handler execution: db (tenant-scoped) + registry guaranteed.
|
|
@@ -561,6 +566,13 @@ export type HandlerContext<TMap extends object = KumikoEventTypeMap> = SharedCon
|
|
|
561
566
|
// back to tenant).
|
|
562
567
|
readonly tz: TzContext;
|
|
563
568
|
|
|
569
|
+
// Resolved request locale (BCP-47): X-Locale header → Accept-Language →
|
|
570
|
+
// the app's boot-configured defaultLocale → "en" (dispatch-shared.ts).
|
|
571
|
+
// Always a concrete tag, never optional — mirrors ctx.tz's Request →
|
|
572
|
+
// Boot-Default fallback chain, so handlers never need to check for
|
|
573
|
+
// absence before using it.
|
|
574
|
+
readonly locale: string;
|
|
575
|
+
|
|
564
576
|
// Resolve every registered r.authClaims() hook against `user` and return
|
|
565
577
|
// the merged claim record (keys auto-prefixed with the feature name). Used
|
|
566
578
|
// by login + switch-tenant write-handlers to populate SessionUser.claims
|
package/src/nav-icon.ts
CHANGED
package/src/screen.ts
CHANGED
|
@@ -25,6 +25,14 @@ export type PlatformComponent = {
|
|
|
25
25
|
readonly native?: unknown;
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
+
// Closed set of unit identifiers for `{ format: "unit" }` (no bare `string`
|
|
29
|
+
// per house convention). "m2" has no ECMA-402 sanctioned unit — Intl throws
|
|
30
|
+
// RangeError for "square-meter" — so kumiko-headless's applyFormatSpec
|
|
31
|
+
// formats it as a locale-formatted number with a literal "m²" suffix. The
|
|
32
|
+
// rest map to a CLDR-sanctioned Intl.NumberFormat unit id and get
|
|
33
|
+
// locale-correct pluralization/spacing straight from Intl.
|
|
34
|
+
export type UnitKey = "m2" | "km" | "m" | "kg" | "percent";
|
|
35
|
+
|
|
28
36
|
// Built-in value formatters. Apps extend via module augmentation:
|
|
29
37
|
// declare module "@cosmicdrift/kumiko-framework/engine/types" {
|
|
30
38
|
// interface FieldFormatRegistry { myFormat: { myOption?: string } }
|
|
@@ -47,6 +55,11 @@ export interface FieldFormatRegistry {
|
|
|
47
55
|
number: { readonly locale?: string };
|
|
48
56
|
decimal: { readonly locale?: string };
|
|
49
57
|
bigInt: { readonly locale?: string };
|
|
58
|
+
unit: {
|
|
59
|
+
readonly unit: UnitKey;
|
|
60
|
+
readonly locale?: string;
|
|
61
|
+
readonly unitDisplay?: "long" | "short" | "narrow";
|
|
62
|
+
};
|
|
50
63
|
}
|
|
51
64
|
|
|
52
65
|
// Discriminated union derived from the registry — one variant per key.
|
|
@@ -209,12 +222,19 @@ export type RowActionNavigate = {
|
|
|
209
222
|
readonly id: string;
|
|
210
223
|
readonly label: string;
|
|
211
224
|
/** Screen-id (kurz, unqualified) zu dem navigiert wird. Boot-
|
|
212
|
-
* Validator prüft Existenz im selben Feature.
|
|
213
|
-
|
|
225
|
+
* Validator prüft Existenz im selben Feature. Genau eines von
|
|
226
|
+
* `screen`/`entity` muss gesetzt sein. */
|
|
227
|
+
readonly screen?: string;
|
|
228
|
+
/** Entity-Name statt Screen-Id (fw#2228) — löst zur Boot-Zeit auf den
|
|
229
|
+
* Screen auf, der `detailFor: "<entity>"` deklariert (siehe ObjectTarget/
|
|
230
|
+
* resolveTarget in @cosmicdrift/kumiko-renderer's nav.tsx), egal in
|
|
231
|
+
* welchem Feature dieser liegt. Genau eines von `screen`/`entity` muss
|
|
232
|
+
* gesetzt sein. */
|
|
233
|
+
readonly entity?: string;
|
|
214
234
|
/** Feldname dessen Wert als entityId in den URL-Pfad eingebettet wird
|
|
215
235
|
* (`/<workspace>/<screen>/<entityId>`). entityEdit liest die Id
|
|
216
|
-
* AUSSCHLIESSLICH aus dem Pfad. Default: "id" wenn der Ziel-Screen
|
|
217
|
-
*
|
|
236
|
+
* AUSSCHLIESSLICH aus dem Pfad. Default: "id" wenn der Ziel-Screen ein
|
|
237
|
+
* entityEdit ist ODER wenn `entity` (statt `screen`) gesetzt ist. */
|
|
218
238
|
readonly entityId?: string;
|
|
219
239
|
/** Declarative URL search params extracted from the clicked row.
|
|
220
240
|
* Both actionForm and entityEdit-create targets read `params` as
|