@cosmicdrift/kumiko-renderer 0.156.2 → 0.157.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 +3 -3
- package/src/app/kumiko-screen.tsx +11 -5
- package/src/format-when.ts +11 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.157.0",
|
|
4
4
|
"description": "Platform-agnostic React renderer for Kumiko screens. Contains the shared logic — primitives-contract, hooks, KumikoScreen, navigation & SSE abstractions — that any platform-specific renderer (web, native) composes. No DOM, no EventSource, no react-dom.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@cosmicdrift/kumiko-framework": "0.
|
|
19
|
-
"@cosmicdrift/kumiko-headless": "0.
|
|
18
|
+
"@cosmicdrift/kumiko-framework": "0.157.0",
|
|
19
|
+
"@cosmicdrift/kumiko-headless": "0.157.0",
|
|
20
20
|
"react": "^19.2.6",
|
|
21
21
|
"temporal-polyfill": "^0.3.2"
|
|
22
22
|
},
|
|
@@ -423,6 +423,8 @@ function EntityEditUpdateBody({
|
|
|
423
423
|
readonly onCopyLink?: () => Promise<void> | void;
|
|
424
424
|
}): ReactNode {
|
|
425
425
|
const { Banner, Text } = usePrimitives();
|
|
426
|
+
const t = useTranslation();
|
|
427
|
+
const effectiveTranslate = translate ?? t;
|
|
426
428
|
const detailQn = `${toKebab(schema.featureName)}:query:${toKebab(screen.entity)}:detail`;
|
|
427
429
|
const detailQuery = useQuery<Readonly<Record<string, unknown>>>(detailQn, { id: entityId });
|
|
428
430
|
|
|
@@ -436,7 +438,7 @@ function EntityEditUpdateBody({
|
|
|
436
438
|
if (detailQuery.error) {
|
|
437
439
|
return (
|
|
438
440
|
<Banner padded variant="error" testId="kumiko-screen-error">
|
|
439
|
-
{detailQuery.error
|
|
441
|
+
{dispatcherErrorText(detailQuery.error, effectiveTranslate)}
|
|
440
442
|
</Banner>
|
|
441
443
|
);
|
|
442
444
|
}
|
|
@@ -1008,7 +1010,7 @@ function EntityListBody({
|
|
|
1008
1010
|
if (rowsQuery.error) {
|
|
1009
1011
|
return (
|
|
1010
1012
|
<Banner padded variant="error" testId="kumiko-screen-error">
|
|
1011
|
-
{rowsQuery.error
|
|
1013
|
+
{dispatcherErrorText(rowsQuery.error, effectiveTranslate)}
|
|
1012
1014
|
</Banner>
|
|
1013
1015
|
);
|
|
1014
1016
|
}
|
|
@@ -1241,7 +1243,7 @@ function ProjectionListBody({
|
|
|
1241
1243
|
if (rowsQuery.error) {
|
|
1242
1244
|
return (
|
|
1243
1245
|
<Banner padded variant="error" testId="kumiko-screen-error">
|
|
1244
|
-
{rowsQuery.error
|
|
1246
|
+
{dispatcherErrorText(rowsQuery.error, effectiveTranslate)}
|
|
1245
1247
|
</Banner>
|
|
1246
1248
|
);
|
|
1247
1249
|
}
|
|
@@ -1293,6 +1295,8 @@ function ProjectionDetailBody({
|
|
|
1293
1295
|
readonly entityId?: string;
|
|
1294
1296
|
}): ReactNode {
|
|
1295
1297
|
const { Banner, Text } = usePrimitives();
|
|
1298
|
+
const t = useTranslation();
|
|
1299
|
+
const effectiveTranslate = translate ?? t;
|
|
1296
1300
|
const nav = useNav();
|
|
1297
1301
|
const idParam = screen.idParam ?? "id";
|
|
1298
1302
|
const entity = useMemo(() => synthesizeProjectionDetailEntity(screen.layout), [screen.layout]);
|
|
@@ -1325,7 +1329,7 @@ function ProjectionDetailBody({
|
|
|
1325
1329
|
if (detailQuery.error) {
|
|
1326
1330
|
return (
|
|
1327
1331
|
<Banner padded variant="error" testId="kumiko-screen-error">
|
|
1328
|
-
{detailQuery.error
|
|
1332
|
+
{dispatcherErrorText(detailQuery.error, effectiveTranslate)}
|
|
1329
1333
|
</Banner>
|
|
1330
1334
|
);
|
|
1331
1335
|
}
|
|
@@ -1470,6 +1474,8 @@ function ConfigEditBody({
|
|
|
1470
1474
|
readonly translate?: Translate;
|
|
1471
1475
|
}): ReactNode {
|
|
1472
1476
|
const { Banner, ConfigCascadeView } = usePrimitives();
|
|
1477
|
+
const t = useTranslation();
|
|
1478
|
+
const effectiveTranslate = translate ?? t;
|
|
1473
1479
|
const dispatcher = useDispatcher();
|
|
1474
1480
|
|
|
1475
1481
|
// Detail-Load: config:query:values returnt ALLE Keys des Tenants.
|
|
@@ -1594,7 +1600,7 @@ function ConfigEditBody({
|
|
|
1594
1600
|
if (valuesQuery.error) {
|
|
1595
1601
|
return (
|
|
1596
1602
|
<Banner padded variant="error" testId="kumiko-screen-error">
|
|
1597
|
-
{valuesQuery.error
|
|
1603
|
+
{dispatcherErrorText(valuesQuery.error, effectiveTranslate)}
|
|
1598
1604
|
</Banner>
|
|
1599
1605
|
);
|
|
1600
1606
|
}
|
package/src/format-when.ts
CHANGED
|
@@ -6,6 +6,16 @@ export function formatWhen(value: string): string {
|
|
|
6
6
|
try {
|
|
7
7
|
return Temporal.Instant.from(value).toLocaleString();
|
|
8
8
|
} catch {
|
|
9
|
-
|
|
9
|
+
// Temporal.Instant.from requires a UTC designator/offset — offset-less
|
|
10
|
+
// timestamps (still valid `new Date` input) throw here. Retry as a
|
|
11
|
+
// local wall-clock time before giving up and returning the raw string.
|
|
12
|
+
try {
|
|
13
|
+
return Temporal.PlainDateTime.from(value)
|
|
14
|
+
.toZonedDateTime(Temporal.Now.timeZoneId())
|
|
15
|
+
.toInstant()
|
|
16
|
+
.toLocaleString();
|
|
17
|
+
} catch {
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
10
20
|
}
|
|
11
21
|
}
|