@ai-matrx/detail 0.1.166 → 0.1.168
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/CHANGELOG.md +27 -1
- package/dist/chunk-QKTMHP4O.js +72 -0
- package/dist/chunk-QKTMHP4O.js.map +1 -0
- package/dist/{host-DrnEXBfp.d.cts → host-Doo4S3OG.d.cts} +6 -0
- package/dist/{host-DrnEXBfp.d.ts → host-Doo4S3OG.d.ts} +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +13 -5
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +151 -200
- package/dist/react.js.map +1 -1
- package/dist/testing.d.cts +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +9 -26
- package/dist/testing.js.map +1 -1
- package/package.json +4 -4
package/dist/react.js
CHANGED
|
@@ -1,67 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function DetailHostProvider({
|
|
9
|
-
ports,
|
|
10
|
-
children
|
|
11
|
-
}) {
|
|
12
|
-
const parent = useContext(DetailHostContext);
|
|
13
|
-
const merged = {
|
|
14
|
-
...parent ?? {},
|
|
15
|
-
...ports,
|
|
16
|
-
shells: { ...parent?.shells ?? {}, ...ports.shells ?? {} }
|
|
17
|
-
};
|
|
18
|
-
return /* @__PURE__ */ jsx(DetailHostContext.Provider, { value: merged, children });
|
|
19
|
-
}
|
|
20
|
-
var REQUIRED_PORTS = [
|
|
21
|
-
"usePresentationSetting",
|
|
22
|
-
"resolvePresentation",
|
|
23
|
-
"warmPresentation",
|
|
24
|
-
"open",
|
|
25
|
-
"close",
|
|
26
|
-
"navigate",
|
|
27
|
-
"doors",
|
|
28
|
-
"associations",
|
|
29
|
-
"history",
|
|
30
|
-
"notify",
|
|
31
|
-
"copyText"
|
|
32
|
-
];
|
|
33
|
-
function useDetailHost() {
|
|
34
|
-
const ports = useContext(DetailHostContext);
|
|
35
|
-
if (!ports) {
|
|
36
|
-
throw new Error(
|
|
37
|
-
"[detail] No DetailHostProvider above this component. Mount the host binding \u2014 a <DetailHostProvider ports={\u2026}> carrying every required port (README \u2192 'Binding the ports') \u2014 around the tree that opens or renders record details."
|
|
38
|
-
);
|
|
39
|
-
}
|
|
40
|
-
const missing = REQUIRED_PORTS.filter((key) => ports[key] === void 0);
|
|
41
|
-
if (missing.length > 0) {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`[detail] DetailHostProvider is missing the port(s): ${missing.join(", ")}. Bind them in the host binding (README \u2192 'Binding the ports').`
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
return ports;
|
|
47
|
-
}
|
|
48
|
-
function requireResolveType(host) {
|
|
49
|
-
if (!host.resolveType) {
|
|
50
|
-
throw new Error(
|
|
51
|
-
"[detail] No resolveType port is bound. A presentation's entry must pass `resolveType` (the host's ONE record-type map) beside its shell."
|
|
52
|
-
);
|
|
53
|
-
}
|
|
54
|
-
return host.resolveType;
|
|
55
|
-
}
|
|
56
|
-
function requireShell(shells, which) {
|
|
57
|
-
const shell = shells[which];
|
|
58
|
-
if (!shell) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
`[detail] No ${which} shell is bound. The ${which} presentation's entry must wrap itself in <DetailHostProvider ports={{ shells: { ${which} } }}> (README \u2192 'The three shells').`
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return shell;
|
|
64
|
-
}
|
|
2
|
+
import {
|
|
3
|
+
DetailHostProvider,
|
|
4
|
+
requireResolveType,
|
|
5
|
+
requireShell,
|
|
6
|
+
useDetailHost
|
|
7
|
+
} from "./chunk-QKTMHP4O.js";
|
|
65
8
|
|
|
66
9
|
// src/react/useDetailCore.ts
|
|
67
10
|
import { useEffect as useEffect3 } from "react";
|
|
@@ -505,10 +448,10 @@ function useOpenDetail(warmType) {
|
|
|
505
448
|
import { useEffect as useEffect5, useRef as useRef4, useState as useState3 } from "react";
|
|
506
449
|
|
|
507
450
|
// src/react/icons.tsx
|
|
508
|
-
import { Fragment, jsx
|
|
451
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
509
452
|
function glyph(name, children) {
|
|
510
453
|
function Icon(props) {
|
|
511
|
-
return /* @__PURE__ */
|
|
454
|
+
return /* @__PURE__ */ jsx(
|
|
512
455
|
"svg",
|
|
513
456
|
{
|
|
514
457
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -533,71 +476,71 @@ function glyph(name, children) {
|
|
|
533
476
|
var AlertCircleIcon = glyph(
|
|
534
477
|
"alert-circle",
|
|
535
478
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
536
|
-
/* @__PURE__ */
|
|
537
|
-
/* @__PURE__ */
|
|
538
|
-
/* @__PURE__ */
|
|
479
|
+
/* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
|
|
480
|
+
/* @__PURE__ */ jsx("line", { x1: "12", x2: "12", y1: "8", y2: "12" }),
|
|
481
|
+
/* @__PURE__ */ jsx("line", { x1: "12", x2: "12.01", y1: "16", y2: "16" })
|
|
539
482
|
] })
|
|
540
483
|
);
|
|
541
484
|
var HistoryIcon = glyph(
|
|
542
485
|
"history",
|
|
543
486
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
544
|
-
/* @__PURE__ */
|
|
545
|
-
/* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */
|
|
487
|
+
/* @__PURE__ */ jsx("path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }),
|
|
488
|
+
/* @__PURE__ */ jsx("path", { d: "M3 3v5h5" }),
|
|
489
|
+
/* @__PURE__ */ jsx("path", { d: "M12 7v5l4 2" })
|
|
547
490
|
] })
|
|
548
491
|
);
|
|
549
492
|
var Link2Icon = glyph(
|
|
550
493
|
"link-2",
|
|
551
494
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
552
|
-
/* @__PURE__ */
|
|
553
|
-
/* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
495
|
+
/* @__PURE__ */ jsx("path", { d: "M9 17H7A5 5 0 0 1 7 7h2" }),
|
|
496
|
+
/* @__PURE__ */ jsx("path", { d: "M15 7h2a5 5 0 1 1 0 10h-2" }),
|
|
497
|
+
/* @__PURE__ */ jsx("line", { x1: "8", x2: "16", y1: "12", y2: "12" })
|
|
555
498
|
] })
|
|
556
499
|
);
|
|
557
500
|
var SHIELD = "M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z";
|
|
558
501
|
var ShieldAlertIcon = glyph(
|
|
559
502
|
"shield-alert",
|
|
560
503
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
561
|
-
/* @__PURE__ */
|
|
562
|
-
/* @__PURE__ */
|
|
563
|
-
/* @__PURE__ */
|
|
504
|
+
/* @__PURE__ */ jsx("path", { d: SHIELD }),
|
|
505
|
+
/* @__PURE__ */ jsx("path", { d: "M12 8v4" }),
|
|
506
|
+
/* @__PURE__ */ jsx("path", { d: "M12 16h.01" })
|
|
564
507
|
] })
|
|
565
508
|
);
|
|
566
509
|
var ShieldCheckIcon = glyph(
|
|
567
510
|
"shield-check",
|
|
568
511
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
569
|
-
/* @__PURE__ */
|
|
570
|
-
/* @__PURE__ */
|
|
512
|
+
/* @__PURE__ */ jsx("path", { d: SHIELD }),
|
|
513
|
+
/* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })
|
|
571
514
|
] })
|
|
572
515
|
);
|
|
573
516
|
var ExpandIcon = glyph(
|
|
574
517
|
"expand",
|
|
575
518
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
576
|
-
/* @__PURE__ */
|
|
577
|
-
/* @__PURE__ */
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
519
|
+
/* @__PURE__ */ jsx("path", { d: "m15 15 6 6" }),
|
|
520
|
+
/* @__PURE__ */ jsx("path", { d: "m15 9 6-6" }),
|
|
521
|
+
/* @__PURE__ */ jsx("path", { d: "M21 16v5h-5" }),
|
|
522
|
+
/* @__PURE__ */ jsx("path", { d: "M21 8V3h-5" }),
|
|
523
|
+
/* @__PURE__ */ jsx("path", { d: "M3 16v5h5" }),
|
|
524
|
+
/* @__PURE__ */ jsx("path", { d: "m3 21 6-6" }),
|
|
525
|
+
/* @__PURE__ */ jsx("path", { d: "M3 8V3h5" }),
|
|
526
|
+
/* @__PURE__ */ jsx("path", { d: "M9 9 3 3" })
|
|
584
527
|
] })
|
|
585
528
|
);
|
|
586
|
-
var LoaderIcon = glyph("loader", /* @__PURE__ */
|
|
529
|
+
var LoaderIcon = glyph("loader", /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }));
|
|
587
530
|
var Settings2Icon = glyph(
|
|
588
531
|
"settings-2",
|
|
589
532
|
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
590
|
-
/* @__PURE__ */
|
|
591
|
-
/* @__PURE__ */
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
533
|
+
/* @__PURE__ */ jsx("path", { d: "M14 17H5" }),
|
|
534
|
+
/* @__PURE__ */ jsx("path", { d: "M19 7h-9" }),
|
|
535
|
+
/* @__PURE__ */ jsx("circle", { cx: "17", cy: "17", r: "3" }),
|
|
536
|
+
/* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "3" })
|
|
594
537
|
] })
|
|
595
538
|
);
|
|
596
539
|
|
|
597
540
|
// src/react/DetailHeader.tsx
|
|
598
541
|
import { AppWindowIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, CopyIcon, MoreHorizontalIcon, PanelRightIcon } from "@ai-matrx/design-system/icons";
|
|
599
542
|
import { cn } from "@ai-matrx/design-system";
|
|
600
|
-
import { Fragment as Fragment2, jsx as
|
|
543
|
+
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
601
544
|
var ICON_BUTTON = "inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-40 disabled:hover:bg-transparent pointer-coarse:h-10 pointer-coarse:w-10";
|
|
602
545
|
var MENU_ITEM = "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:py-2.5";
|
|
603
546
|
var TYPE_CHIP = "shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ring-1 ring-inset";
|
|
@@ -607,30 +550,38 @@ var PRESENTATIONS = [
|
|
|
607
550
|
{ value: "page", label: "Open as page", Icon: ExpandIcon }
|
|
608
551
|
];
|
|
609
552
|
function TypeChip({ core, className }) {
|
|
610
|
-
const
|
|
611
|
-
|
|
553
|
+
const color = identityColor(core.recordType?.color);
|
|
554
|
+
const accent = color ? null : core.recordType?.accent ?? null;
|
|
555
|
+
return /* @__PURE__ */ jsx2(
|
|
612
556
|
"span",
|
|
613
557
|
{
|
|
614
558
|
className: cn(
|
|
615
559
|
TYPE_CHIP,
|
|
616
|
-
accent?.bg ?? "bg-muted",
|
|
617
|
-
accent?.text ?? "text-muted-foreground",
|
|
618
|
-
accent?.ring ?? "ring-border",
|
|
560
|
+
color ? "text-foreground" : [accent?.bg ?? "bg-muted", accent?.text ?? "text-muted-foreground", accent?.ring ?? "ring-border"],
|
|
619
561
|
className
|
|
620
562
|
),
|
|
563
|
+
style: color ? {
|
|
564
|
+
backgroundColor: `color-mix(in oklab, ${color} 14%, transparent)`,
|
|
565
|
+
["--tw-ring-color"]: `color-mix(in oklab, ${color} 30%, transparent)`
|
|
566
|
+
} : void 0,
|
|
621
567
|
"data-detail-type-chip": true,
|
|
622
568
|
children: core.recordLabel
|
|
623
569
|
}
|
|
624
570
|
);
|
|
625
571
|
}
|
|
572
|
+
var IDENTITY_HEX = /^#[0-9a-f]{6}$/i;
|
|
573
|
+
function identityColor(c) {
|
|
574
|
+
return c && IDENTITY_HEX.test(c) ? c : null;
|
|
575
|
+
}
|
|
626
576
|
function DetailTitle({ core }) {
|
|
627
577
|
const host = useDetailHost();
|
|
628
578
|
const Icon = core.recordType?.icon ?? null;
|
|
579
|
+
const color = identityColor(core.recordType?.color);
|
|
629
580
|
const accent = core.recordType?.accent ?? null;
|
|
630
581
|
const RecordDoors = host.doors.RecordDoors;
|
|
631
582
|
return /* @__PURE__ */ jsxs2("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
632
|
-
Icon ? /* @__PURE__ */
|
|
633
|
-
/* @__PURE__ */
|
|
583
|
+
Icon ? color ? /* @__PURE__ */ jsx2("span", { className: "inline-flex shrink-0", style: { color }, "data-detail-identity-color": color, children: /* @__PURE__ */ jsx2(Icon, { className: "h-4 w-4 shrink-0" }) }) : /* @__PURE__ */ jsx2(Icon, { className: cn("h-4 w-4 shrink-0", accent?.text) }) : null,
|
|
584
|
+
/* @__PURE__ */ jsx2(
|
|
634
585
|
"span",
|
|
635
586
|
{
|
|
636
587
|
className: cn(
|
|
@@ -642,8 +593,8 @@ function DetailTitle({ core }) {
|
|
|
642
593
|
children: core.title
|
|
643
594
|
}
|
|
644
595
|
),
|
|
645
|
-
/* @__PURE__ */
|
|
646
|
-
core.entityToken && core.doorsAvailable ? /* @__PURE__ */
|
|
596
|
+
/* @__PURE__ */ jsx2(TypeChip, { core, className: "hidden sm:inline-block" }),
|
|
597
|
+
core.entityToken && core.doorsAvailable ? /* @__PURE__ */ jsx2("span", { className: "hidden shrink-0 sm:inline-flex", children: /* @__PURE__ */ jsx2(RecordDoors, { token: core.entityToken, id: core.ref.id, name: core.title }) }) : null
|
|
647
598
|
] });
|
|
648
599
|
}
|
|
649
600
|
function DetailRecordMeta({ core }) {
|
|
@@ -656,10 +607,10 @@ function DetailRecordMeta({ core }) {
|
|
|
656
607
|
className: "flex flex-wrap items-center gap-2 border-b border-border/60 px-4 py-2",
|
|
657
608
|
"data-detail-record-meta": true,
|
|
658
609
|
children: [
|
|
659
|
-
/* @__PURE__ */
|
|
660
|
-
core.entityToken && core.doorsAvailable ? /* @__PURE__ */
|
|
661
|
-
/* @__PURE__ */
|
|
662
|
-
trimmedFrom ? /* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ jsx2(TypeChip, { core, className: "sm:hidden" }),
|
|
611
|
+
core.entityToken && core.doorsAvailable ? /* @__PURE__ */ jsx2("span", { className: "inline-flex sm:hidden", children: /* @__PURE__ */ jsx2(RecordDoors, { token: core.entityToken, id: core.ref.id, name: core.title }) }) : null,
|
|
612
|
+
/* @__PURE__ */ jsx2("span", { className: "truncate font-mono text-[10px] text-muted-foreground", "data-detail-id": true, children: core.ref.id }),
|
|
613
|
+
trimmedFrom ? /* @__PURE__ */ jsx2("span", { className: "w-full text-[10px] text-muted-foreground", "data-detail-list-trimmed": true, children: `Stepping through ${core.list.context?.items.length} of the ${trimmedFrom} records in the list this was opened from \u2014 a link can only carry that many, so the rest are not reachable from here. Open the list again to reach them.` }) : null
|
|
663
614
|
]
|
|
664
615
|
}
|
|
665
616
|
);
|
|
@@ -718,7 +669,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
718
669
|
const others = PRESENTATIONS.filter((p) => p.value !== core.presentation);
|
|
719
670
|
return /* @__PURE__ */ jsxs2("div", { className: "flex shrink-0 items-center gap-0.5", "data-detail-actions": true, children: [
|
|
720
671
|
list.context ? /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
721
|
-
/* @__PURE__ */
|
|
672
|
+
/* @__PURE__ */ jsx2(
|
|
722
673
|
"button",
|
|
723
674
|
{
|
|
724
675
|
type: "button",
|
|
@@ -727,7 +678,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
727
678
|
disabled: !list.hasPrev,
|
|
728
679
|
"aria-label": "Previous record (Up arrow, or left bracket)",
|
|
729
680
|
title: "Previous record \u2191 or [",
|
|
730
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ jsx2(ChevronLeftIcon, { className: "h-4 w-4" })
|
|
731
682
|
}
|
|
732
683
|
),
|
|
733
684
|
/* @__PURE__ */ jsxs2("span", { className: "px-1 text-[11px] tabular-nums text-muted-foreground", children: [
|
|
@@ -735,7 +686,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
735
686
|
"/",
|
|
736
687
|
list.context.items.length
|
|
737
688
|
] }),
|
|
738
|
-
/* @__PURE__ */
|
|
689
|
+
/* @__PURE__ */ jsx2(
|
|
739
690
|
"button",
|
|
740
691
|
{
|
|
741
692
|
type: "button",
|
|
@@ -744,10 +695,10 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
744
695
|
disabled: !list.hasNext,
|
|
745
696
|
"aria-label": "Next record (Down arrow, or right bracket)",
|
|
746
697
|
title: "Next record \u2193 or ]",
|
|
747
|
-
children: /* @__PURE__ */
|
|
698
|
+
children: /* @__PURE__ */ jsx2(ChevronRightIcon, { className: "h-4 w-4" })
|
|
748
699
|
}
|
|
749
700
|
),
|
|
750
|
-
/* @__PURE__ */
|
|
701
|
+
/* @__PURE__ */ jsx2("span", { className: "mx-1 h-4 w-px bg-border", "aria-hidden": true })
|
|
751
702
|
] }) : null,
|
|
752
703
|
optional === "none" ? null : /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
753
704
|
/* @__PURE__ */ jsxs2(
|
|
@@ -756,7 +707,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
756
707
|
className: "flex items-center gap-0.5 @max-[26rem]/window-header:hidden",
|
|
757
708
|
"data-detail-actions-collapsible": true,
|
|
758
709
|
children: [
|
|
759
|
-
others.map(({ value, label, Icon }) => /* @__PURE__ */
|
|
710
|
+
others.map(({ value, label, Icon }) => /* @__PURE__ */ jsx2(
|
|
760
711
|
"button",
|
|
761
712
|
{
|
|
762
713
|
type: "button",
|
|
@@ -764,11 +715,11 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
764
715
|
onClick: () => core.switchTo(value),
|
|
765
716
|
"aria-label": label,
|
|
766
717
|
title: label,
|
|
767
|
-
children: /* @__PURE__ */
|
|
718
|
+
children: /* @__PURE__ */ jsx2(Icon, { className: "h-4 w-4" })
|
|
768
719
|
},
|
|
769
720
|
value
|
|
770
721
|
)),
|
|
771
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ jsx2(
|
|
772
723
|
"button",
|
|
773
724
|
{
|
|
774
725
|
type: "button",
|
|
@@ -777,14 +728,14 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
777
728
|
"aria-label": "Copy record id",
|
|
778
729
|
title: "Copy record id",
|
|
779
730
|
"data-detail-copy-id": true,
|
|
780
|
-
children: copied ? /* @__PURE__ */
|
|
731
|
+
children: copied ? /* @__PURE__ */ jsx2(CheckIcon, { className: "h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx2(CopyIcon, { className: "h-3.5 w-3.5" })
|
|
781
732
|
}
|
|
782
733
|
)
|
|
783
734
|
]
|
|
784
735
|
}
|
|
785
736
|
),
|
|
786
737
|
/* @__PURE__ */ jsxs2("span", { className: "relative hidden @max-[26rem]/window-header:inline-flex", ref: menuRef, children: [
|
|
787
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ jsx2(
|
|
788
739
|
"button",
|
|
789
740
|
{
|
|
790
741
|
type: "button",
|
|
@@ -795,7 +746,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
795
746
|
"aria-haspopup": "menu",
|
|
796
747
|
"aria-expanded": menuOpen,
|
|
797
748
|
"data-detail-actions-overflow": true,
|
|
798
|
-
children: /* @__PURE__ */
|
|
749
|
+
children: /* @__PURE__ */ jsx2(MoreHorizontalIcon, { className: "h-4 w-4" })
|
|
799
750
|
}
|
|
800
751
|
),
|
|
801
752
|
menuOpen ? /* @__PURE__ */ jsxs2(
|
|
@@ -817,7 +768,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
817
768
|
core.switchTo(value);
|
|
818
769
|
},
|
|
819
770
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
771
|
+
/* @__PURE__ */ jsx2(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
821
772
|
label
|
|
822
773
|
]
|
|
823
774
|
},
|
|
@@ -834,7 +785,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
834
785
|
void copyId();
|
|
835
786
|
},
|
|
836
787
|
children: [
|
|
837
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ jsx2(CopyIcon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
838
789
|
"Copy record id"
|
|
839
790
|
]
|
|
840
791
|
}
|
|
@@ -869,7 +820,7 @@ function formatWhen(iso) {
|
|
|
869
820
|
import { useEffect as useEffect6, useRef as useRef5, useState as useState4 } from "react";
|
|
870
821
|
import { cn as cn2, ErrorActions } from "@ai-matrx/design-system";
|
|
871
822
|
import { CheckIcon as CheckIcon2 } from "@ai-matrx/design-system/icons";
|
|
872
|
-
import { jsx as
|
|
823
|
+
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
873
824
|
var WORD = {
|
|
874
825
|
window: "a window",
|
|
875
826
|
docked: "a docked panel",
|
|
@@ -949,7 +900,7 @@ function DetailPresentationPane({ core }) {
|
|
|
949
900
|
return /* @__PURE__ */ jsxs3("div", { className: "w-full", children: [
|
|
950
901
|
setting.error ? /* @__PURE__ */ jsxs3("p", { className: "px-1 pt-1 text-[11px] text-muted-foreground", children: [
|
|
951
902
|
`Your "open details as" setting could not be read (${setting.error}) \u2014 details are opening as ${WORD[core.presentation]}.`,
|
|
952
|
-
/* @__PURE__ */
|
|
903
|
+
/* @__PURE__ */ jsx3(ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Read the open-details-as setting", error: setting.error })
|
|
953
904
|
] }) : null,
|
|
954
905
|
/* @__PURE__ */ jsxs3(
|
|
955
906
|
"button",
|
|
@@ -959,9 +910,9 @@ function DetailPresentationPane({ core }) {
|
|
|
959
910
|
className: "flex w-full items-center gap-1.5 rounded-md px-1 py-1 text-left text-[11px] text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
960
911
|
"data-detail-presentation-pane": "collapsed",
|
|
961
912
|
children: [
|
|
962
|
-
/* @__PURE__ */
|
|
963
|
-
setting.error ? null : /* @__PURE__ */
|
|
964
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ jsx3(Settings2Icon, { className: "h-3 w-3 shrink-0" }),
|
|
914
|
+
setting.error ? null : /* @__PURE__ */ jsx3("span", { children: `Details open as ${WORD[effective]}.` }),
|
|
915
|
+
/* @__PURE__ */ jsx3("span", { className: "underline underline-offset-2", children: "Change" })
|
|
965
916
|
]
|
|
966
917
|
}
|
|
967
918
|
)
|
|
@@ -974,10 +925,10 @@ function DetailPresentationPane({ core }) {
|
|
|
974
925
|
"data-detail-presentation-pane": "open",
|
|
975
926
|
children: [
|
|
976
927
|
/* @__PURE__ */ jsxs3("h3", { className: "flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: [
|
|
977
|
-
/* @__PURE__ */
|
|
928
|
+
/* @__PURE__ */ jsx3(Settings2Icon, { className: "h-3 w-3" }),
|
|
978
929
|
"How record details open"
|
|
979
930
|
] }),
|
|
980
|
-
/* @__PURE__ */
|
|
931
|
+
/* @__PURE__ */ jsx3("div", { className: "flex flex-wrap gap-1", role: "group", "aria-label": "Open record details as", children: DETAIL_PRESENTATIONS.map((value) => /* @__PURE__ */ jsx3(
|
|
981
932
|
"button",
|
|
982
933
|
{
|
|
983
934
|
type: "button",
|
|
@@ -994,7 +945,7 @@ function DetailPresentationPane({ core }) {
|
|
|
994
945
|
},
|
|
995
946
|
value
|
|
996
947
|
)) }),
|
|
997
|
-
hasTypeException ? /* @__PURE__ */
|
|
948
|
+
hasTypeException ? /* @__PURE__ */ jsx3(
|
|
998
949
|
"button",
|
|
999
950
|
{
|
|
1000
951
|
type: "button",
|
|
@@ -1006,7 +957,7 @@ function DetailPresentationPane({ core }) {
|
|
|
1006
957
|
}
|
|
1007
958
|
) : null,
|
|
1008
959
|
/* @__PURE__ */ jsxs3("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
1009
|
-
/* @__PURE__ */
|
|
960
|
+
/* @__PURE__ */ jsx3(
|
|
1010
961
|
"input",
|
|
1011
962
|
{
|
|
1012
963
|
type: "checkbox",
|
|
@@ -1031,13 +982,13 @@ function DetailPresentationPane({ core }) {
|
|
|
1031
982
|
disabled: state.status === "saving",
|
|
1032
983
|
className: "inline-flex items-center gap-1 rounded-md bg-primary px-2.5 py-1 text-xs text-primary-foreground transition-colors hover:bg-primary/90 disabled:opacity-60 pointer-coarse:py-2",
|
|
1033
984
|
children: [
|
|
1034
|
-
state.status === "saving" ? /* @__PURE__ */
|
|
985
|
+
state.status === "saving" ? /* @__PURE__ */ jsx3(LoaderIcon, { className: "h-3 w-3 animate-spin" }) : state.status === "saved" ? /* @__PURE__ */ jsx3(CheckIcon2, { className: "h-3 w-3" }) : null,
|
|
1035
986
|
"Save"
|
|
1036
987
|
]
|
|
1037
988
|
}
|
|
1038
989
|
),
|
|
1039
|
-
/* @__PURE__ */
|
|
1040
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ jsx3("span", { className: "text-[11px] text-muted-foreground", children: state.status === "saved" ? "Saved. It applies to the next record you open." : "\u2318/Ctrl + Enter" }),
|
|
991
|
+
/* @__PURE__ */ jsx3(
|
|
1041
992
|
"button",
|
|
1042
993
|
{
|
|
1043
994
|
type: "button",
|
|
@@ -1049,13 +1000,13 @@ function DetailPresentationPane({ core }) {
|
|
|
1049
1000
|
] }),
|
|
1050
1001
|
state.status === "refused" ? /* @__PURE__ */ jsxs3("p", { className: "text-xs text-destructive", "data-detail-presentation-refusal": true, children: [
|
|
1051
1002
|
state.reason,
|
|
1052
|
-
/* @__PURE__ */
|
|
1003
|
+
/* @__PURE__ */ jsx3(ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Change how details open", message: state.reason })
|
|
1053
1004
|
] }) : null,
|
|
1054
1005
|
setting.error ? /* @__PURE__ */ jsxs3("p", { className: "text-xs text-muted-foreground", children: [
|
|
1055
1006
|
"The saved setting could not be read here (",
|
|
1056
1007
|
setting.error,
|
|
1057
1008
|
"), so this shows what this detail is actually doing.",
|
|
1058
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ jsx3(ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Read the open-details-as setting", error: setting.error })
|
|
1059
1010
|
] }) : null
|
|
1060
1011
|
]
|
|
1061
1012
|
}
|
|
@@ -1065,7 +1016,7 @@ function DetailPresentationPane({ core }) {
|
|
|
1065
1016
|
// src/react/DetailBody.tsx
|
|
1066
1017
|
import { ExternalLinkIcon, RefreshCwIcon } from "@ai-matrx/design-system/icons";
|
|
1067
1018
|
import { OutboundLink } from "@ai-matrx/kit/outbound-react";
|
|
1068
|
-
import { Fragment as Fragment3, jsx as
|
|
1019
|
+
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1069
1020
|
var SLOW_LOAD_NOTICE_MS = 6e3;
|
|
1070
1021
|
function useSlowLoadNotice(active, key) {
|
|
1071
1022
|
const [slow, setSlow] = useState5(false);
|
|
@@ -1091,7 +1042,7 @@ function Notice({
|
|
|
1091
1042
|
children
|
|
1092
1043
|
}) {
|
|
1093
1044
|
return /* @__PURE__ */ jsxs4("div", { className: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
1094
|
-
/* @__PURE__ */
|
|
1045
|
+
/* @__PURE__ */ jsx4(
|
|
1095
1046
|
AlertCircleIcon,
|
|
1096
1047
|
{
|
|
1097
1048
|
className: cn3(
|
|
@@ -1102,7 +1053,7 @@ function Notice({
|
|
|
1102
1053
|
)
|
|
1103
1054
|
}
|
|
1104
1055
|
),
|
|
1105
|
-
/* @__PURE__ */
|
|
1056
|
+
/* @__PURE__ */ jsx4("p", { className: "max-w-prose text-sm text-muted-foreground", children })
|
|
1106
1057
|
] });
|
|
1107
1058
|
}
|
|
1108
1059
|
var GRANT_WORD = {
|
|
@@ -1147,9 +1098,9 @@ function HealthStrip({ health }) {
|
|
|
1147
1098
|
),
|
|
1148
1099
|
"data-detail-health": true,
|
|
1149
1100
|
children: [
|
|
1150
|
-
ok ? /* @__PURE__ */
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
ok ? null : /* @__PURE__ */
|
|
1101
|
+
ok ? /* @__PURE__ */ jsx4(ShieldCheckIcon, { className: "h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx4(ShieldAlertIcon, { className: "h-3.5 w-3.5 text-destructive" }),
|
|
1102
|
+
/* @__PURE__ */ jsx4("span", { className: "font-medium", children: health.source }),
|
|
1103
|
+
ok ? null : /* @__PURE__ */ jsx4(
|
|
1153
1104
|
"span",
|
|
1154
1105
|
{
|
|
1155
1106
|
className: "rounded bg-destructive/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-destructive",
|
|
@@ -1160,8 +1111,8 @@ function HealthStrip({ health }) {
|
|
|
1160
1111
|
health.lastRefreshedAt ? /* @__PURE__ */ jsxs4("span", { children: [
|
|
1161
1112
|
"Refreshed ",
|
|
1162
1113
|
formatWhen(health.lastRefreshedAt)
|
|
1163
|
-
] }) : /* @__PURE__ */
|
|
1164
|
-
health.grantDetail ? /* @__PURE__ */
|
|
1114
|
+
] }) : /* @__PURE__ */ jsx4("span", { children: "Never refreshed" }),
|
|
1115
|
+
health.grantDetail ? /* @__PURE__ */ jsx4("span", { children: health.grantDetail }) : null,
|
|
1165
1116
|
/* @__PURE__ */ jsxs4("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
1166
1117
|
health.onRefresh ? /* @__PURE__ */ jsxs4(
|
|
1167
1118
|
"button",
|
|
@@ -1171,12 +1122,12 @@ function HealthStrip({ health }) {
|
|
|
1171
1122
|
disabled: refreshing,
|
|
1172
1123
|
className: "inline-flex h-6 items-center gap-1 rounded px-1.5 hover:bg-accent hover:text-foreground disabled:opacity-50 pointer-coarse:h-10",
|
|
1173
1124
|
children: [
|
|
1174
|
-
/* @__PURE__ */
|
|
1125
|
+
/* @__PURE__ */ jsx4(RefreshCwIcon, { className: cn3("h-3 w-3", refreshing && "animate-spin") }),
|
|
1175
1126
|
"Refresh"
|
|
1176
1127
|
]
|
|
1177
1128
|
}
|
|
1178
1129
|
) : null,
|
|
1179
|
-
!ok && health.onReconnect ? /* @__PURE__ */
|
|
1130
|
+
!ok && health.onReconnect ? /* @__PURE__ */ jsx4(
|
|
1180
1131
|
"button",
|
|
1181
1132
|
{
|
|
1182
1133
|
type: "button",
|
|
@@ -1191,7 +1142,7 @@ function HealthStrip({ health }) {
|
|
|
1191
1142
|
href: health.openAtSourceHref,
|
|
1192
1143
|
className: "inline-flex h-6 items-center gap-1 rounded px-1.5 hover:bg-accent hover:text-foreground pointer-coarse:h-10",
|
|
1193
1144
|
children: [
|
|
1194
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsx4(ExternalLinkIcon, { className: "h-3 w-3" }),
|
|
1195
1146
|
health.openAtSourceLabel ?? deriveOpenAtSourceLabel(health.source)
|
|
1196
1147
|
]
|
|
1197
1148
|
}
|
|
@@ -1209,16 +1160,16 @@ function FieldsSection({ core }) {
|
|
|
1209
1160
|
const RefCell = host.doors.RefCell;
|
|
1210
1161
|
const label = core.recordType?.label.toLowerCase() ?? "record";
|
|
1211
1162
|
if (!core.recordType) {
|
|
1212
|
-
return /* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ jsx4(Notice, { tone: "warn", children: `This is a ${core.ref.type} record. Nothing more about it is stored here yet, so there is nothing else to show. ${whatTheControlsDo(core)}` });
|
|
1213
1164
|
}
|
|
1214
1165
|
if (core.status === "loading") {
|
|
1215
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ jsx4(LoadingFields, { core, label });
|
|
1216
1167
|
}
|
|
1217
1168
|
if (core.status === "not-found") {
|
|
1218
1169
|
const sentence = `This ${label} couldn't be found \u2014 it may have been moved, deleted, or isn't shared with you.`;
|
|
1219
1170
|
return /* @__PURE__ */ jsxs4(Notice, { tone: "warn", children: [
|
|
1220
1171
|
sentence,
|
|
1221
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ jsx4(
|
|
1222
1173
|
ErrorActions2,
|
|
1223
1174
|
{
|
|
1224
1175
|
origin: "detail/DetailBody",
|
|
@@ -1232,22 +1183,22 @@ function FieldsSection({ core }) {
|
|
|
1232
1183
|
if (core.status === "error") {
|
|
1233
1184
|
return /* @__PURE__ */ jsxs4(Notice, { tone: "error", children: [
|
|
1234
1185
|
`Couldn't load the details for this ${label}. ${core.errorMessage ?? ""}`.trim(),
|
|
1235
|
-
/* @__PURE__ */
|
|
1186
|
+
/* @__PURE__ */ jsx4(ErrorActions2, { origin: "detail/DetailBody", operation: `Load this ${label}`, error: core.errorMessage })
|
|
1236
1187
|
] });
|
|
1237
1188
|
}
|
|
1238
1189
|
if (core.status === "none") {
|
|
1239
|
-
return /* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ jsx4(Notice, { tone: "muted", children: `Nothing more about this ${label} is stored here, so there is nothing else to show. ` + whatTheControlsDo(core) });
|
|
1240
1191
|
}
|
|
1241
1192
|
if (core.fields.length === 0) {
|
|
1242
|
-
return /* @__PURE__ */
|
|
1193
|
+
return /* @__PURE__ */ jsx4("p", { className: "text-sm text-muted-foreground", children: "No additional fields to show." });
|
|
1243
1194
|
}
|
|
1244
|
-
return /* @__PURE__ */
|
|
1195
|
+
return /* @__PURE__ */ jsx4("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-2.5", children: core.fields.map((field) => /* @__PURE__ */ jsxs4(
|
|
1245
1196
|
"div",
|
|
1246
1197
|
{
|
|
1247
1198
|
className: "flex flex-col gap-0.5 border-b border-border/40 pb-2 last:border-b-0",
|
|
1248
1199
|
children: [
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
/* @__PURE__ */
|
|
1200
|
+
/* @__PURE__ */ jsx4("dt", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: field.label }),
|
|
1201
|
+
/* @__PURE__ */ jsx4(
|
|
1251
1202
|
"dd",
|
|
1252
1203
|
{
|
|
1253
1204
|
className: cn3(
|
|
@@ -1259,7 +1210,7 @@ function FieldsSection({ core }) {
|
|
|
1259
1210
|
// `field.ref.id` alone, so a field whose text was "Brightwater Robotics"
|
|
1260
1211
|
// printed a truncated uuid. The ref's own `name` wins; otherwise the
|
|
1261
1212
|
// field's text, unless that text IS the id and says nothing more.
|
|
1262
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ jsx4(
|
|
1263
1214
|
RefCell,
|
|
1264
1215
|
{
|
|
1265
1216
|
value: field.ref.id,
|
|
@@ -1288,8 +1239,8 @@ function LoadingFields({ core, label }) {
|
|
|
1288
1239
|
". If nothing appears, the record may be unreachable from here; closing and reopening it starts a fresh read."
|
|
1289
1240
|
] }) : null,
|
|
1290
1241
|
Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxs4("div", { className: "space-y-1.5", children: [
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ jsx4(Skeleton, { className: "h-2.5 w-20" }),
|
|
1243
|
+
/* @__PURE__ */ jsx4(Skeleton, { className: cn3("h-4", i % 2 ? "w-3/4" : "w-1/2") })
|
|
1293
1244
|
] }, i))
|
|
1294
1245
|
] });
|
|
1295
1246
|
}
|
|
@@ -1305,8 +1256,8 @@ function AssociationsSection({ core }) {
|
|
|
1305
1256
|
const tokens = wanted.filter((t) => t !== token).filter(isEntityTypeToken);
|
|
1306
1257
|
if (tokens.length === 0) return null;
|
|
1307
1258
|
return /* @__PURE__ */ jsxs4("section", { className: "space-y-2", "data-detail-section": "associations", children: [
|
|
1308
|
-
/* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1259
|
+
/* @__PURE__ */ jsx4(SectionHeading, { icon: /* @__PURE__ */ jsx4(Link2Icon, { className: "h-3 w-3" }), children: "Linked" }),
|
|
1260
|
+
/* @__PURE__ */ jsx4(PrimaryEntityProvider, { value: { type: token, id: core.ref.id, label: core.title }, children: /* @__PURE__ */ jsx4(AssociationCardGrid, { tokens }) })
|
|
1310
1261
|
] });
|
|
1311
1262
|
}
|
|
1312
1263
|
var ACTOR_COLUMNS = ["actor_id", "user_id", "person_id", "created_by_id"];
|
|
@@ -1344,14 +1295,14 @@ function HistorySection({ core }) {
|
|
|
1344
1295
|
);
|
|
1345
1296
|
const ActorName = host.history.ActorName ?? null;
|
|
1346
1297
|
return /* @__PURE__ */ jsxs4("section", { className: "space-y-2", "data-detail-section": "history", children: [
|
|
1347
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ jsx4(SectionHeading, { icon: /* @__PURE__ */ jsx4(HistoryIcon, { className: "h-3 w-3" }), children: "History" }),
|
|
1348
1299
|
state.status === "loading" ? /* @__PURE__ */ jsxs4("div", { className: "space-y-1.5", "aria-busy": "true", "aria-label": "Loading history", children: [
|
|
1349
|
-
/* @__PURE__ */
|
|
1350
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ jsx4(Skeleton, { className: "h-3.5 w-2/3" }),
|
|
1301
|
+
/* @__PURE__ */ jsx4(Skeleton, { className: "h-3.5 w-1/2" })
|
|
1351
1302
|
] }) : state.status === "error" ? /* @__PURE__ */ jsxs4("p", { className: "text-xs text-muted-foreground", children: [
|
|
1352
1303
|
state.message.toLowerCase().includes("access denied") ? "History is only shown to people who can view this record." : `History could not be read: ${state.message}`,
|
|
1353
|
-
/* @__PURE__ */
|
|
1354
|
-
] }) : state.entries.length === 0 ? /* @__PURE__ */
|
|
1304
|
+
/* @__PURE__ */ jsx4(ErrorActions2, { origin: "detail/DetailBody", operation: "Read the history", error: state.message })
|
|
1305
|
+
] }) : state.entries.length === 0 ? /* @__PURE__ */ jsx4("p", { className: "text-xs text-muted-foreground", children: "No recorded changes yet." }) : /* @__PURE__ */ jsx4("ol", { className: "space-y-1", children: state.entries.map((entry) => /* @__PURE__ */ jsxs4(
|
|
1355
1306
|
"li",
|
|
1356
1307
|
{
|
|
1357
1308
|
className: "flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs",
|
|
@@ -1360,16 +1311,16 @@ function HistorySection({ core }) {
|
|
|
1360
1311
|
"v",
|
|
1361
1312
|
entry.version
|
|
1362
1313
|
] }),
|
|
1363
|
-
/* @__PURE__ */
|
|
1364
|
-
/* @__PURE__ */
|
|
1365
|
-
entry.isCurrent ? /* @__PURE__ */
|
|
1314
|
+
/* @__PURE__ */ jsx4("span", { className: "capitalize text-foreground", children: entry.operation.toLowerCase() }),
|
|
1315
|
+
/* @__PURE__ */ jsx4("span", { className: "text-muted-foreground", children: formatWhen(entry.occurredAt) }),
|
|
1316
|
+
entry.isCurrent ? /* @__PURE__ */ jsx4("span", { className: "text-[10px] uppercase tracking-wide text-primary", children: "current" }) : null,
|
|
1366
1317
|
entry.actorId ? ActorName ? /* @__PURE__ */ jsxs4("span", { className: "text-muted-foreground", "data-detail-history-actor-person": true, children: [
|
|
1367
1318
|
"Changed by ",
|
|
1368
|
-
/* @__PURE__ */
|
|
1369
|
-
] }) : actorToken ? /* @__PURE__ */
|
|
1319
|
+
/* @__PURE__ */ jsx4(ActorName, { actorId: entry.actorId, row: core.row })
|
|
1320
|
+
] }) : actorToken ? /* @__PURE__ */ jsx4("span", { className: "inline-flex items-center", "data-detail-history-actor": true, children: /* @__PURE__ */ jsx4(ActorCell, { value: entry.actorId, label: "Changed by", token: actorToken }) }) : /* @__PURE__ */ jsxs4("span", { className: "text-muted-foreground", "data-detail-history-actor-raw": true, children: [
|
|
1370
1321
|
"Changed by",
|
|
1371
1322
|
" ",
|
|
1372
|
-
/* @__PURE__ */
|
|
1323
|
+
/* @__PURE__ */ jsx4(
|
|
1373
1324
|
"span",
|
|
1374
1325
|
{
|
|
1375
1326
|
className: "font-mono text-[10px]",
|
|
@@ -1377,7 +1328,7 @@ function HistorySection({ core }) {
|
|
|
1377
1328
|
children: entry.actorId
|
|
1378
1329
|
}
|
|
1379
1330
|
)
|
|
1380
|
-
] }) : /* @__PURE__ */
|
|
1331
|
+
] }) : /* @__PURE__ */ jsx4("span", { className: "text-muted-foreground", "data-detail-history-actor-absent": true, children: "No person recorded for this change" })
|
|
1381
1332
|
]
|
|
1382
1333
|
},
|
|
1383
1334
|
`${entry.version}-${entry.occurredAt}`
|
|
@@ -1389,7 +1340,7 @@ function CustomFieldsPort({ core }) {
|
|
|
1389
1340
|
const Section = host.customFields?.Section;
|
|
1390
1341
|
const token = core.entityToken;
|
|
1391
1342
|
if (!Section || !token) return null;
|
|
1392
|
-
return /* @__PURE__ */
|
|
1343
|
+
return /* @__PURE__ */ jsx4(Section, { token, id: core.ref.id });
|
|
1393
1344
|
}
|
|
1394
1345
|
function DetailBody({ core }) {
|
|
1395
1346
|
const extra = core.recordType?.extraSections && core.frameCtx ? core.recordType.extraSections(core.row, core.frameCtx) : [];
|
|
@@ -1398,25 +1349,25 @@ function DetailBody({ core }) {
|
|
|
1398
1349
|
// `min-h-full` so a Frame's right-click menu answers anywhere in the body,
|
|
1399
1350
|
// not only on the rows — a short dossier otherwise leaves a dead band.
|
|
1400
1351
|
/* @__PURE__ */ jsxs4("div", { className: "flex min-h-full flex-col", children: [
|
|
1401
|
-
/* @__PURE__ */
|
|
1402
|
-
core.health ? /* @__PURE__ */
|
|
1403
|
-
core.about ? /* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ jsx4(DetailRecordMeta, { core }),
|
|
1353
|
+
core.health ? /* @__PURE__ */ jsx4(HealthStrip, { health: core.health }) : null,
|
|
1354
|
+
core.about ? /* @__PURE__ */ jsx4("p", { className: "line-clamp-3 border-b border-border/60 p-4 text-xs leading-snug text-muted-foreground", children: core.about }) : null,
|
|
1404
1355
|
/* @__PURE__ */ jsxs4("div", { className: "space-y-6 p-4", children: [
|
|
1405
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ jsx4(FieldsSection, { core }),
|
|
1406
1357
|
core.status === "ready" || core.status === "none" ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
/* @__PURE__ */
|
|
1358
|
+
/* @__PURE__ */ jsx4(CustomFieldsPort, { core }),
|
|
1359
|
+
/* @__PURE__ */ jsx4(AssociationsSection, { core }),
|
|
1360
|
+
/* @__PURE__ */ jsx4(HistorySection, { core }),
|
|
1410
1361
|
extra.map((section) => /* @__PURE__ */ jsxs4("section", { className: "space-y-2", "data-detail-section": section.id, children: [
|
|
1411
|
-
/* @__PURE__ */
|
|
1362
|
+
/* @__PURE__ */ jsx4(SectionHeading, { children: section.label }),
|
|
1412
1363
|
section.content
|
|
1413
1364
|
] }, section.id))
|
|
1414
1365
|
] }) : null,
|
|
1415
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ jsx4(DetailPresentationPane, { core })
|
|
1416
1367
|
] })
|
|
1417
1368
|
] })
|
|
1418
1369
|
);
|
|
1419
|
-
if (Frame && core.frameCtx) return /* @__PURE__ */
|
|
1370
|
+
if (Frame && core.frameCtx) return /* @__PURE__ */ jsx4(Frame, { ctx: core.frameCtx, children: body });
|
|
1420
1371
|
return body;
|
|
1421
1372
|
}
|
|
1422
1373
|
|
|
@@ -1436,9 +1387,9 @@ function detailInstanceKey(ref) {
|
|
|
1436
1387
|
var DEFAULT_PANEL_URL_RESERVE_BYTES = Math.floor(DETAIL_URL_BUDGET_BYTES / 2);
|
|
1437
1388
|
|
|
1438
1389
|
// src/react/presentations.tsx
|
|
1439
|
-
import { jsx as
|
|
1390
|
+
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
1440
1391
|
function KeyboardSlot({ core, children }) {
|
|
1441
|
-
return /* @__PURE__ */
|
|
1392
|
+
return /* @__PURE__ */ jsx5(
|
|
1442
1393
|
"div",
|
|
1443
1394
|
{
|
|
1444
1395
|
onKeyDownCapture: core.keyboard.rootProps.onKeyDownCapture,
|
|
@@ -1449,7 +1400,7 @@ function KeyboardSlot({ core, children }) {
|
|
|
1449
1400
|
);
|
|
1450
1401
|
}
|
|
1451
1402
|
function KeyboardActionsSlot({ core, children }) {
|
|
1452
|
-
return /* @__PURE__ */
|
|
1403
|
+
return /* @__PURE__ */ jsx5(
|
|
1453
1404
|
"div",
|
|
1454
1405
|
{
|
|
1455
1406
|
onKeyDownCapture: core.keyboard.rootProps.onKeyDownCapture,
|
|
@@ -1468,7 +1419,7 @@ function KeyboardRoot({ core, children }) {
|
|
|
1468
1419
|
if (active instanceof HTMLElement && active !== document.body && root.contains(active)) return;
|
|
1469
1420
|
root.focus({ preventScroll: true });
|
|
1470
1421
|
}, [core.ref.id, core.ref.type]);
|
|
1471
|
-
return /* @__PURE__ */
|
|
1422
|
+
return /* @__PURE__ */ jsx5(
|
|
1472
1423
|
"div",
|
|
1473
1424
|
{
|
|
1474
1425
|
ref: rootRef,
|
|
@@ -1486,19 +1437,19 @@ function DetailWindowPresentation({ data, onClose }) {
|
|
|
1486
1437
|
const core = useDetailCore(data, "window", { onClose });
|
|
1487
1438
|
const menuActions = useDetailMenuActions(core);
|
|
1488
1439
|
const Shell = requireShell(host.shells, "Window");
|
|
1489
|
-
return /* @__PURE__ */
|
|
1440
|
+
return /* @__PURE__ */ jsx5(
|
|
1490
1441
|
Shell,
|
|
1491
1442
|
{
|
|
1492
1443
|
instanceKey: detailInstanceKey(core.ref),
|
|
1493
1444
|
target: core.ref,
|
|
1494
1445
|
list: core.list.context,
|
|
1495
1446
|
title: core.title,
|
|
1496
|
-
titleNode: /* @__PURE__ */
|
|
1497
|
-
actions: /* @__PURE__ */
|
|
1498
|
-
navActions: /* @__PURE__ */
|
|
1447
|
+
titleNode: /* @__PURE__ */ jsx5(KeyboardSlot, { core, children: /* @__PURE__ */ jsx5(DetailTitle, { core }) }),
|
|
1448
|
+
actions: /* @__PURE__ */ jsx5(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx5(DetailActions, { core }) }),
|
|
1449
|
+
navActions: /* @__PURE__ */ jsx5(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx5(DetailActions, { core, optional: "none" }) }),
|
|
1499
1450
|
menuActions,
|
|
1500
1451
|
onClose: core.close,
|
|
1501
|
-
children: /* @__PURE__ */
|
|
1452
|
+
children: /* @__PURE__ */ jsx5(KeyboardRoot, { core, children: /* @__PURE__ */ jsx5(DetailBody, { core }) })
|
|
1502
1453
|
}
|
|
1503
1454
|
);
|
|
1504
1455
|
}
|
|
@@ -1507,18 +1458,18 @@ function DetailDockedPresentation({ data, onClose }) {
|
|
|
1507
1458
|
const core = useDetailCore(data, "docked", { onClose });
|
|
1508
1459
|
const menuActions = useDetailMenuActions(core);
|
|
1509
1460
|
const Shell = requireShell(host.shells, "Docked");
|
|
1510
|
-
return /* @__PURE__ */
|
|
1461
|
+
return /* @__PURE__ */ jsx5(
|
|
1511
1462
|
Shell,
|
|
1512
1463
|
{
|
|
1513
1464
|
instanceKey: detailInstanceKey(core.ref),
|
|
1514
1465
|
target: core.ref,
|
|
1515
1466
|
title: core.title,
|
|
1516
|
-
titleNode: /* @__PURE__ */
|
|
1517
|
-
actions: /* @__PURE__ */
|
|
1518
|
-
navActions: /* @__PURE__ */
|
|
1467
|
+
titleNode: /* @__PURE__ */ jsx5(KeyboardSlot, { core, children: /* @__PURE__ */ jsx5(DetailTitle, { core }) }),
|
|
1468
|
+
actions: /* @__PURE__ */ jsx5(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx5(DetailActions, { core }) }),
|
|
1469
|
+
navActions: /* @__PURE__ */ jsx5(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx5(DetailActions, { core, optional: "none" }) }),
|
|
1519
1470
|
menuActions,
|
|
1520
1471
|
onClose: core.close,
|
|
1521
|
-
children: /* @__PURE__ */
|
|
1472
|
+
children: /* @__PURE__ */ jsx5(KeyboardRoot, { core, children: /* @__PURE__ */ jsx5(DetailBody, { core }) })
|
|
1522
1473
|
}
|
|
1523
1474
|
);
|
|
1524
1475
|
}
|
|
@@ -1527,18 +1478,18 @@ function DetailPagePresentation({ data }) {
|
|
|
1527
1478
|
const core = useDetailCore(data, "page", {});
|
|
1528
1479
|
const menuActions = useDetailMenuActions(core);
|
|
1529
1480
|
const Shell = requireShell(host.shells, "Page");
|
|
1530
|
-
return /* @__PURE__ */
|
|
1481
|
+
return /* @__PURE__ */ jsx5(
|
|
1531
1482
|
Shell,
|
|
1532
1483
|
{
|
|
1533
1484
|
target: core.ref,
|
|
1534
1485
|
title: core.title,
|
|
1535
|
-
titleNode: /* @__PURE__ */
|
|
1536
|
-
actions: /* @__PURE__ */
|
|
1537
|
-
navActions: /* @__PURE__ */
|
|
1486
|
+
titleNode: /* @__PURE__ */ jsx5(KeyboardSlot, { core, children: /* @__PURE__ */ jsx5(DetailTitle, { core }) }),
|
|
1487
|
+
actions: /* @__PURE__ */ jsx5(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx5(DetailActions, { core }) }),
|
|
1488
|
+
navActions: /* @__PURE__ */ jsx5(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx5(DetailActions, { core, optional: "none" }) }),
|
|
1538
1489
|
menuActions,
|
|
1539
1490
|
onClose: core.close,
|
|
1540
1491
|
onBack: core.leave,
|
|
1541
|
-
children: /* @__PURE__ */
|
|
1492
|
+
children: /* @__PURE__ */ jsx5(KeyboardRoot, { core, children: /* @__PURE__ */ jsx5(DetailBody, { core }) })
|
|
1542
1493
|
}
|
|
1543
1494
|
);
|
|
1544
1495
|
}
|