@ai-matrx/detail 0.1.170 → 0.1.172
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 +24 -3
- package/dist/index.cjs +6 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +165 -240
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +170 -235
- package/dist/react.js.map +1 -1
- package/package.json +2 -2
package/dist/react.js
CHANGED
|
@@ -448,99 +448,31 @@ function useOpenDetail(warmType) {
|
|
|
448
448
|
import { useEffect as useEffect5, useRef as useRef4, useState as useState3 } from "react";
|
|
449
449
|
|
|
450
450
|
// src/react/icons.tsx
|
|
451
|
-
import {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
);
|
|
472
|
-
}
|
|
473
|
-
Icon.displayName = `DetailIcon(${name})`;
|
|
474
|
-
return Icon;
|
|
475
|
-
}
|
|
476
|
-
var AlertCircleIcon = glyph(
|
|
477
|
-
"alert-circle",
|
|
478
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
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" })
|
|
482
|
-
] })
|
|
483
|
-
);
|
|
484
|
-
var HistoryIcon = glyph(
|
|
485
|
-
"history",
|
|
486
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
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" })
|
|
490
|
-
] })
|
|
491
|
-
);
|
|
492
|
-
var Link2Icon = glyph(
|
|
493
|
-
"link-2",
|
|
494
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
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" })
|
|
498
|
-
] })
|
|
499
|
-
);
|
|
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";
|
|
501
|
-
var ShieldAlertIcon = glyph(
|
|
502
|
-
"shield-alert",
|
|
503
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
504
|
-
/* @__PURE__ */ jsx("path", { d: SHIELD }),
|
|
505
|
-
/* @__PURE__ */ jsx("path", { d: "M12 8v4" }),
|
|
506
|
-
/* @__PURE__ */ jsx("path", { d: "M12 16h.01" })
|
|
507
|
-
] })
|
|
508
|
-
);
|
|
509
|
-
var ShieldCheckIcon = glyph(
|
|
510
|
-
"shield-check",
|
|
511
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
512
|
-
/* @__PURE__ */ jsx("path", { d: SHIELD }),
|
|
513
|
-
/* @__PURE__ */ jsx("path", { d: "m9 12 2 2 4-4" })
|
|
514
|
-
] })
|
|
515
|
-
);
|
|
516
|
-
var ExpandIcon = glyph(
|
|
517
|
-
"expand",
|
|
518
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
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" })
|
|
527
|
-
] })
|
|
528
|
-
);
|
|
529
|
-
var LoaderIcon = glyph("loader", /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }));
|
|
530
|
-
var Settings2Icon = glyph(
|
|
531
|
-
"settings-2",
|
|
532
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
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" })
|
|
537
|
-
] })
|
|
538
|
-
);
|
|
451
|
+
import {
|
|
452
|
+
CircleAlertIcon as GCircleAlertIcon,
|
|
453
|
+
ExpandIcon as GExpandIcon,
|
|
454
|
+
HistoryIcon as GHistoryIcon,
|
|
455
|
+
Link2Icon as GLink2Icon,
|
|
456
|
+
Loader2Icon as GLoader2Icon,
|
|
457
|
+
Settings2Icon as GSettings2Icon,
|
|
458
|
+
ShieldAlertIcon as GShieldAlertIcon,
|
|
459
|
+
ShieldCheckIcon as GShieldCheckIcon,
|
|
460
|
+
withGlyphDefaults
|
|
461
|
+
} from "@ai-matrx/design-system/icons";
|
|
462
|
+
var sized = (Glyph) => withGlyphDefaults(Glyph, { width: 24, height: 24 });
|
|
463
|
+
var AlertCircleIcon = sized(GCircleAlertIcon);
|
|
464
|
+
var HistoryIcon = sized(GHistoryIcon);
|
|
465
|
+
var Link2Icon = sized(GLink2Icon);
|
|
466
|
+
var ShieldAlertIcon = sized(GShieldAlertIcon);
|
|
467
|
+
var ShieldCheckIcon = sized(GShieldCheckIcon);
|
|
468
|
+
var ExpandIcon = sized(GExpandIcon);
|
|
469
|
+
var LoaderIcon = sized(GLoader2Icon);
|
|
470
|
+
var Settings2Icon = sized(GSettings2Icon);
|
|
539
471
|
|
|
540
472
|
// src/react/DetailHeader.tsx
|
|
541
473
|
import { AppWindowIcon, CheckIcon, ChevronLeftIcon, ChevronRightIcon, CopyIcon, MoreHorizontalIcon, PanelRightIcon } from "@ai-matrx/design-system/icons";
|
|
542
474
|
import { cn, RecordId } from "@ai-matrx/design-system";
|
|
543
|
-
import { Fragment
|
|
475
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
544
476
|
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";
|
|
545
477
|
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";
|
|
546
478
|
var TYPE_CHIP = "shrink-0 rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wide ring-1 ring-inset";
|
|
@@ -552,7 +484,7 @@ var PRESENTATIONS = [
|
|
|
552
484
|
function TypeChip({ core, className }) {
|
|
553
485
|
const color = identityColor(core.recordType?.color);
|
|
554
486
|
const accent = color ? null : core.recordType?.accent ?? null;
|
|
555
|
-
return /* @__PURE__ */
|
|
487
|
+
return /* @__PURE__ */ jsx(
|
|
556
488
|
"span",
|
|
557
489
|
{
|
|
558
490
|
className: cn(
|
|
@@ -579,9 +511,9 @@ function DetailTitle({ core }) {
|
|
|
579
511
|
const color = identityColor(core.recordType?.color);
|
|
580
512
|
const accent = core.recordType?.accent ?? null;
|
|
581
513
|
const RecordDoors = host.doors.RecordDoors;
|
|
582
|
-
return /* @__PURE__ */
|
|
583
|
-
Icon ? color ? /* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
|
|
515
|
+
Icon ? color ? /* @__PURE__ */ jsx("span", { className: "inline-flex shrink-0", style: { color }, "data-detail-identity-color": color, children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4 shrink-0" }) }) : /* @__PURE__ */ jsx(Icon, { className: cn("h-4 w-4 shrink-0", accent?.text) }) : null,
|
|
516
|
+
/* @__PURE__ */ jsx(
|
|
585
517
|
"span",
|
|
586
518
|
{
|
|
587
519
|
className: cn(
|
|
@@ -593,24 +525,24 @@ function DetailTitle({ core }) {
|
|
|
593
525
|
children: core.title
|
|
594
526
|
}
|
|
595
527
|
),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
-
core.entityToken && core.doorsAvailable ? /* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ jsx(TypeChip, { core, className: "hidden sm:inline-block" }),
|
|
529
|
+
core.entityToken && core.doorsAvailable ? /* @__PURE__ */ jsx("span", { className: "hidden shrink-0 sm:inline-flex", children: /* @__PURE__ */ jsx(RecordDoors, { token: core.entityToken, id: core.ref.id, name: core.title }) }) : null
|
|
598
530
|
] });
|
|
599
531
|
}
|
|
600
532
|
function DetailRecordMeta({ core }) {
|
|
601
533
|
const host = useDetailHost();
|
|
602
534
|
const RecordDoors = host.doors.RecordDoors;
|
|
603
535
|
const trimmedFrom = core.list.context?.trimmedFrom;
|
|
604
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ jsxs(
|
|
605
537
|
"div",
|
|
606
538
|
{
|
|
607
539
|
className: "flex flex-wrap items-center gap-2 border-b border-border/60 px-4 py-2",
|
|
608
540
|
"data-detail-record-meta": true,
|
|
609
541
|
children: [
|
|
610
|
-
/* @__PURE__ */
|
|
611
|
-
core.entityToken && core.doorsAvailable ? /* @__PURE__ */
|
|
612
|
-
/* @__PURE__ */
|
|
613
|
-
trimmedFrom ? /* @__PURE__ */
|
|
542
|
+
/* @__PURE__ */ jsx(TypeChip, { core, className: "sm:hidden" }),
|
|
543
|
+
core.entityToken && core.doorsAvailable ? /* @__PURE__ */ jsx("span", { className: "inline-flex sm:hidden", children: /* @__PURE__ */ jsx(RecordDoors, { token: core.entityToken, id: core.ref.id, name: core.title }) }) : null,
|
|
544
|
+
/* @__PURE__ */ jsx("span", { className: "inline-flex min-w-0", "data-detail-id": true, children: /* @__PURE__ */ jsx(RecordId, { value: core.ref.id, label: "Record", show: "full" }) }),
|
|
545
|
+
trimmedFrom ? /* @__PURE__ */ jsx("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
|
|
614
546
|
]
|
|
615
547
|
}
|
|
616
548
|
);
|
|
@@ -667,9 +599,9 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
667
599
|
}, [menuOpen]);
|
|
668
600
|
const list = core.list;
|
|
669
601
|
const others = PRESENTATIONS.filter((p) => p.value !== core.presentation);
|
|
670
|
-
return /* @__PURE__ */
|
|
671
|
-
list.context ? /* @__PURE__ */
|
|
672
|
-
/* @__PURE__ */
|
|
602
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-0.5", "data-detail-actions": true, children: [
|
|
603
|
+
list.context ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
604
|
+
/* @__PURE__ */ jsx(
|
|
673
605
|
"button",
|
|
674
606
|
{
|
|
675
607
|
type: "button",
|
|
@@ -678,15 +610,15 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
678
610
|
disabled: !list.hasPrev,
|
|
679
611
|
"aria-label": "Previous record (Up arrow, or left bracket)",
|
|
680
612
|
title: "Previous record \u2191 or [",
|
|
681
|
-
children: /* @__PURE__ */
|
|
613
|
+
children: /* @__PURE__ */ jsx(ChevronLeftIcon, { className: "h-4 w-4" })
|
|
682
614
|
}
|
|
683
615
|
),
|
|
684
|
-
/* @__PURE__ */
|
|
616
|
+
/* @__PURE__ */ jsxs("span", { className: "px-1 text-[11px] tabular-nums text-muted-foreground", children: [
|
|
685
617
|
list.context.index + 1,
|
|
686
618
|
"/",
|
|
687
619
|
list.context.items.length
|
|
688
620
|
] }),
|
|
689
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ jsx(
|
|
690
622
|
"button",
|
|
691
623
|
{
|
|
692
624
|
type: "button",
|
|
@@ -695,19 +627,19 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
695
627
|
disabled: !list.hasNext,
|
|
696
628
|
"aria-label": "Next record (Down arrow, or right bracket)",
|
|
697
629
|
title: "Next record \u2193 or ]",
|
|
698
|
-
children: /* @__PURE__ */
|
|
630
|
+
children: /* @__PURE__ */ jsx(ChevronRightIcon, { className: "h-4 w-4" })
|
|
699
631
|
}
|
|
700
632
|
),
|
|
701
|
-
/* @__PURE__ */
|
|
633
|
+
/* @__PURE__ */ jsx("span", { className: "mx-1 h-4 w-px bg-border", "aria-hidden": true })
|
|
702
634
|
] }) : null,
|
|
703
|
-
optional === "none" ? null : /* @__PURE__ */
|
|
704
|
-
/* @__PURE__ */
|
|
635
|
+
optional === "none" ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
636
|
+
/* @__PURE__ */ jsxs(
|
|
705
637
|
"span",
|
|
706
638
|
{
|
|
707
639
|
className: "flex items-center gap-0.5 @max-[26rem]/window-header:hidden",
|
|
708
640
|
"data-detail-actions-collapsible": true,
|
|
709
641
|
children: [
|
|
710
|
-
others.map(({ value, label, Icon }) => /* @__PURE__ */
|
|
642
|
+
others.map(({ value, label, Icon }) => /* @__PURE__ */ jsx(
|
|
711
643
|
"button",
|
|
712
644
|
{
|
|
713
645
|
type: "button",
|
|
@@ -715,11 +647,11 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
715
647
|
onClick: () => core.switchTo(value),
|
|
716
648
|
"aria-label": label,
|
|
717
649
|
title: label,
|
|
718
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" })
|
|
719
651
|
},
|
|
720
652
|
value
|
|
721
653
|
)),
|
|
722
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ jsx(
|
|
723
655
|
"button",
|
|
724
656
|
{
|
|
725
657
|
type: "button",
|
|
@@ -728,14 +660,14 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
728
660
|
"aria-label": "Copy record id",
|
|
729
661
|
title: "Copy record id",
|
|
730
662
|
"data-detail-copy-id": true,
|
|
731
|
-
children: copied ? /* @__PURE__ */
|
|
663
|
+
children: copied ? /* @__PURE__ */ jsx(CheckIcon, { className: "h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx(CopyIcon, { className: "h-3.5 w-3.5" })
|
|
732
664
|
}
|
|
733
665
|
)
|
|
734
666
|
]
|
|
735
667
|
}
|
|
736
668
|
),
|
|
737
|
-
/* @__PURE__ */
|
|
738
|
-
/* @__PURE__ */
|
|
669
|
+
/* @__PURE__ */ jsxs("span", { className: "relative hidden @max-[26rem]/window-header:inline-flex", ref: menuRef, children: [
|
|
670
|
+
/* @__PURE__ */ jsx(
|
|
739
671
|
"button",
|
|
740
672
|
{
|
|
741
673
|
type: "button",
|
|
@@ -746,10 +678,10 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
746
678
|
"aria-haspopup": "menu",
|
|
747
679
|
"aria-expanded": menuOpen,
|
|
748
680
|
"data-detail-actions-overflow": true,
|
|
749
|
-
children: /* @__PURE__ */
|
|
681
|
+
children: /* @__PURE__ */ jsx(MoreHorizontalIcon, { className: "h-4 w-4" })
|
|
750
682
|
}
|
|
751
683
|
),
|
|
752
|
-
menuOpen ? /* @__PURE__ */
|
|
684
|
+
menuOpen ? /* @__PURE__ */ jsxs(
|
|
753
685
|
"div",
|
|
754
686
|
{
|
|
755
687
|
role: "menu",
|
|
@@ -757,7 +689,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
757
689
|
className: "absolute right-0 top-full z-50 mt-1 min-w-44 rounded-md border border-border bg-card p-1 shadow-md",
|
|
758
690
|
"data-detail-actions-menu": true,
|
|
759
691
|
children: [
|
|
760
|
-
others.map(({ value, label, Icon }) => /* @__PURE__ */
|
|
692
|
+
others.map(({ value, label, Icon }) => /* @__PURE__ */ jsxs(
|
|
761
693
|
"button",
|
|
762
694
|
{
|
|
763
695
|
type: "button",
|
|
@@ -768,13 +700,13 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
768
700
|
core.switchTo(value);
|
|
769
701
|
},
|
|
770
702
|
children: [
|
|
771
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
772
704
|
label
|
|
773
705
|
]
|
|
774
706
|
},
|
|
775
707
|
value
|
|
776
708
|
)),
|
|
777
|
-
/* @__PURE__ */
|
|
709
|
+
/* @__PURE__ */ jsxs(
|
|
778
710
|
"button",
|
|
779
711
|
{
|
|
780
712
|
type: "button",
|
|
@@ -785,7 +717,7 @@ function DetailActions({ core, optional = "inline" }) {
|
|
|
785
717
|
void copyId();
|
|
786
718
|
},
|
|
787
719
|
children: [
|
|
788
|
-
/* @__PURE__ */
|
|
720
|
+
/* @__PURE__ */ jsx(CopyIcon, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
789
721
|
"Copy record id"
|
|
790
722
|
]
|
|
791
723
|
}
|
|
@@ -820,7 +752,7 @@ function formatWhen(iso) {
|
|
|
820
752
|
import { useEffect as useEffect6, useRef as useRef5, useState as useState4 } from "react";
|
|
821
753
|
import { cn as cn2, ErrorActions } from "@ai-matrx/design-system";
|
|
822
754
|
import { CheckIcon as CheckIcon2 } from "@ai-matrx/design-system/icons";
|
|
823
|
-
import { jsx as
|
|
755
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
824
756
|
var WORD = {
|
|
825
757
|
window: "a window",
|
|
826
758
|
docked: "a docked panel",
|
|
@@ -897,12 +829,12 @@ function DetailPresentationPane({ core }) {
|
|
|
897
829
|
}, [open, save, registerSave]);
|
|
898
830
|
if (!save) return null;
|
|
899
831
|
if (!open) {
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
-
setting.error ? /* @__PURE__ */
|
|
832
|
+
return /* @__PURE__ */ jsxs2("div", { className: "w-full", children: [
|
|
833
|
+
setting.error ? /* @__PURE__ */ jsxs2("p", { className: "px-1 pt-1 text-[11px] text-muted-foreground", children: [
|
|
902
834
|
`Your "open details as" setting could not be read (${setting.error}) \u2014 details are opening as ${WORD[core.presentation]}.`,
|
|
903
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ jsx2(ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Read the open-details-as setting", error: setting.error })
|
|
904
836
|
] }) : null,
|
|
905
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ jsxs2(
|
|
906
838
|
"button",
|
|
907
839
|
{
|
|
908
840
|
type: "button",
|
|
@@ -910,25 +842,25 @@ function DetailPresentationPane({ core }) {
|
|
|
910
842
|
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",
|
|
911
843
|
"data-detail-presentation-pane": "collapsed",
|
|
912
844
|
children: [
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
setting.error ? null : /* @__PURE__ */
|
|
915
|
-
/* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ jsx2(Settings2Icon, { className: "h-3 w-3 shrink-0" }),
|
|
846
|
+
setting.error ? null : /* @__PURE__ */ jsx2("span", { children: `Details open as ${WORD[effective]}.` }),
|
|
847
|
+
/* @__PURE__ */ jsx2("span", { className: "underline underline-offset-2", children: "Change" })
|
|
916
848
|
]
|
|
917
849
|
}
|
|
918
850
|
)
|
|
919
851
|
] });
|
|
920
852
|
}
|
|
921
|
-
return /* @__PURE__ */
|
|
853
|
+
return /* @__PURE__ */ jsxs2(
|
|
922
854
|
"section",
|
|
923
855
|
{
|
|
924
856
|
className: "space-y-2 rounded-md border border-border bg-muted/30 p-3",
|
|
925
857
|
"data-detail-presentation-pane": "open",
|
|
926
858
|
children: [
|
|
927
|
-
/* @__PURE__ */
|
|
928
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ jsxs2("h3", { className: "flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: [
|
|
860
|
+
/* @__PURE__ */ jsx2(Settings2Icon, { className: "h-3 w-3" }),
|
|
929
861
|
"How record details open"
|
|
930
862
|
] }),
|
|
931
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ jsx2("div", { className: "flex flex-wrap gap-1", role: "group", "aria-label": "Open record details as", children: DETAIL_PRESENTATIONS.map((value) => /* @__PURE__ */ jsx2(
|
|
932
864
|
"button",
|
|
933
865
|
{
|
|
934
866
|
type: "button",
|
|
@@ -945,7 +877,7 @@ function DetailPresentationPane({ core }) {
|
|
|
945
877
|
},
|
|
946
878
|
value
|
|
947
879
|
)) }),
|
|
948
|
-
hasTypeException ? /* @__PURE__ */
|
|
880
|
+
hasTypeException ? /* @__PURE__ */ jsx2(
|
|
949
881
|
"button",
|
|
950
882
|
{
|
|
951
883
|
type: "button",
|
|
@@ -956,8 +888,8 @@ function DetailPresentationPane({ core }) {
|
|
|
956
888
|
children: `Use the default for ${core.typeLabel.toLowerCase()} records`
|
|
957
889
|
}
|
|
958
890
|
) : null,
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
/* @__PURE__ */
|
|
891
|
+
/* @__PURE__ */ jsxs2("label", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
|
|
892
|
+
/* @__PURE__ */ jsx2(
|
|
961
893
|
"input",
|
|
962
894
|
{
|
|
963
895
|
type: "checkbox",
|
|
@@ -973,8 +905,8 @@ function DetailPresentationPane({ core }) {
|
|
|
973
905
|
core.typeLabel.toLowerCase(),
|
|
974
906
|
" records"
|
|
975
907
|
] }),
|
|
976
|
-
/* @__PURE__ */
|
|
977
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ jsxs2("div", { className: "flex items-center gap-2", children: [
|
|
909
|
+
/* @__PURE__ */ jsxs2(
|
|
978
910
|
"button",
|
|
979
911
|
{
|
|
980
912
|
type: "button",
|
|
@@ -982,13 +914,13 @@ function DetailPresentationPane({ core }) {
|
|
|
982
914
|
disabled: state.status === "saving",
|
|
983
915
|
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",
|
|
984
916
|
children: [
|
|
985
|
-
state.status === "saving" ? /* @__PURE__ */
|
|
917
|
+
state.status === "saving" ? /* @__PURE__ */ jsx2(LoaderIcon, { className: "h-3 w-3 animate-spin" }) : state.status === "saved" ? /* @__PURE__ */ jsx2(CheckIcon2, { className: "h-3 w-3" }) : null,
|
|
986
918
|
"Save"
|
|
987
919
|
]
|
|
988
920
|
}
|
|
989
921
|
),
|
|
990
|
-
/* @__PURE__ */
|
|
991
|
-
/* @__PURE__ */
|
|
922
|
+
/* @__PURE__ */ jsx2("span", { className: "text-[11px] text-muted-foreground", children: state.status === "saved" ? "Saved. It applies to the next record you open." : "\u2318/Ctrl + Enter" }),
|
|
923
|
+
/* @__PURE__ */ jsx2(
|
|
992
924
|
"button",
|
|
993
925
|
{
|
|
994
926
|
type: "button",
|
|
@@ -998,15 +930,15 @@ function DetailPresentationPane({ core }) {
|
|
|
998
930
|
}
|
|
999
931
|
)
|
|
1000
932
|
] }),
|
|
1001
|
-
state.status === "refused" ? /* @__PURE__ */
|
|
933
|
+
state.status === "refused" ? /* @__PURE__ */ jsxs2("p", { className: "text-xs text-destructive", "data-detail-presentation-refusal": true, children: [
|
|
1002
934
|
state.reason,
|
|
1003
|
-
/* @__PURE__ */
|
|
935
|
+
/* @__PURE__ */ jsx2(ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Change how details open", message: state.reason })
|
|
1004
936
|
] }) : null,
|
|
1005
|
-
setting.error ? /* @__PURE__ */
|
|
937
|
+
setting.error ? /* @__PURE__ */ jsxs2("p", { className: "text-xs text-muted-foreground", children: [
|
|
1006
938
|
"The saved setting could not be read here (",
|
|
1007
939
|
setting.error,
|
|
1008
940
|
"), so this shows what this detail is actually doing.",
|
|
1009
|
-
/* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ jsx2(ErrorActions, { origin: "detail/DetailPresentationPane", operation: "Read the open-details-as setting", error: setting.error })
|
|
1010
942
|
] }) : null
|
|
1011
943
|
]
|
|
1012
944
|
}
|
|
@@ -1016,7 +948,7 @@ function DetailPresentationPane({ core }) {
|
|
|
1016
948
|
// src/react/DetailBody.tsx
|
|
1017
949
|
import { ExternalLinkIcon, RefreshCwIcon } from "@ai-matrx/design-system/icons";
|
|
1018
950
|
import { OutboundLink } from "@ai-matrx/kit/outbound-react";
|
|
1019
|
-
import { Fragment as
|
|
951
|
+
import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
1020
952
|
var SLOW_LOAD_NOTICE_MS = 6e3;
|
|
1021
953
|
function useSlowLoadNotice(active, key) {
|
|
1022
954
|
const [slow, setSlow] = useState5(false);
|
|
@@ -1032,7 +964,7 @@ function useSlowLoadNotice(active, key) {
|
|
|
1032
964
|
return slow;
|
|
1033
965
|
}
|
|
1034
966
|
function SectionHeading({ icon, children }) {
|
|
1035
|
-
return /* @__PURE__ */
|
|
967
|
+
return /* @__PURE__ */ jsxs3("h3", { className: "flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: [
|
|
1036
968
|
icon,
|
|
1037
969
|
children
|
|
1038
970
|
] });
|
|
@@ -1041,8 +973,8 @@ function Notice({
|
|
|
1041
973
|
tone,
|
|
1042
974
|
children
|
|
1043
975
|
}) {
|
|
1044
|
-
return /* @__PURE__ */
|
|
1045
|
-
/* @__PURE__ */
|
|
976
|
+
return /* @__PURE__ */ jsxs3("div", { className: "flex flex-col items-center gap-2 py-8 text-center", children: [
|
|
977
|
+
/* @__PURE__ */ jsx3(
|
|
1046
978
|
AlertCircleIcon,
|
|
1047
979
|
{
|
|
1048
980
|
className: cn3(
|
|
@@ -1053,7 +985,7 @@ function Notice({
|
|
|
1053
985
|
)
|
|
1054
986
|
}
|
|
1055
987
|
),
|
|
1056
|
-
/* @__PURE__ */
|
|
988
|
+
/* @__PURE__ */ jsx3("p", { className: "max-w-prose text-sm text-muted-foreground", children })
|
|
1057
989
|
] });
|
|
1058
990
|
}
|
|
1059
991
|
var GRANT_WORD = {
|
|
@@ -1089,7 +1021,7 @@ function HealthStrip({ health }) {
|
|
|
1089
1021
|
setRefreshing(false);
|
|
1090
1022
|
}
|
|
1091
1023
|
};
|
|
1092
|
-
return /* @__PURE__ */
|
|
1024
|
+
return /* @__PURE__ */ jsxs3(
|
|
1093
1025
|
"div",
|
|
1094
1026
|
{
|
|
1095
1027
|
className: cn3(
|
|
@@ -1098,9 +1030,9 @@ function HealthStrip({ health }) {
|
|
|
1098
1030
|
),
|
|
1099
1031
|
"data-detail-health": true,
|
|
1100
1032
|
children: [
|
|
1101
|
-
ok ? /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */
|
|
1103
|
-
ok ? null : /* @__PURE__ */
|
|
1033
|
+
ok ? /* @__PURE__ */ jsx3(ShieldCheckIcon, { className: "h-3.5 w-3.5 text-primary" }) : /* @__PURE__ */ jsx3(ShieldAlertIcon, { className: "h-3.5 w-3.5 text-destructive" }),
|
|
1034
|
+
/* @__PURE__ */ jsx3("span", { className: "font-medium", children: health.source }),
|
|
1035
|
+
ok ? null : /* @__PURE__ */ jsx3(
|
|
1104
1036
|
"span",
|
|
1105
1037
|
{
|
|
1106
1038
|
className: "rounded bg-destructive/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-destructive",
|
|
@@ -1108,13 +1040,13 @@ function HealthStrip({ health }) {
|
|
|
1108
1040
|
children: GRANT_WORD[health.grant]
|
|
1109
1041
|
}
|
|
1110
1042
|
),
|
|
1111
|
-
health.lastRefreshedAt ? /* @__PURE__ */
|
|
1043
|
+
health.lastRefreshedAt ? /* @__PURE__ */ jsxs3("span", { children: [
|
|
1112
1044
|
"Refreshed ",
|
|
1113
1045
|
formatWhen(health.lastRefreshedAt)
|
|
1114
|
-
] }) : /* @__PURE__ */
|
|
1115
|
-
health.grantDetail ? /* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1117
|
-
health.onRefresh ? /* @__PURE__ */
|
|
1046
|
+
] }) : /* @__PURE__ */ jsx3("span", { children: "Never refreshed" }),
|
|
1047
|
+
health.grantDetail ? /* @__PURE__ */ jsx3("span", { children: health.grantDetail }) : null,
|
|
1048
|
+
/* @__PURE__ */ jsxs3("span", { className: "ml-auto flex items-center gap-1", children: [
|
|
1049
|
+
health.onRefresh ? /* @__PURE__ */ jsxs3(
|
|
1118
1050
|
"button",
|
|
1119
1051
|
{
|
|
1120
1052
|
type: "button",
|
|
@@ -1122,12 +1054,12 @@ function HealthStrip({ health }) {
|
|
|
1122
1054
|
disabled: refreshing,
|
|
1123
1055
|
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",
|
|
1124
1056
|
children: [
|
|
1125
|
-
/* @__PURE__ */
|
|
1057
|
+
/* @__PURE__ */ jsx3(RefreshCwIcon, { className: cn3("h-3 w-3", refreshing && "animate-spin") }),
|
|
1126
1058
|
"Refresh"
|
|
1127
1059
|
]
|
|
1128
1060
|
}
|
|
1129
1061
|
) : null,
|
|
1130
|
-
!ok && health.onReconnect ? /* @__PURE__ */
|
|
1062
|
+
!ok && health.onReconnect ? /* @__PURE__ */ jsx3(
|
|
1131
1063
|
"button",
|
|
1132
1064
|
{
|
|
1133
1065
|
type: "button",
|
|
@@ -1136,13 +1068,13 @@ function HealthStrip({ health }) {
|
|
|
1136
1068
|
children: "Reconnect"
|
|
1137
1069
|
}
|
|
1138
1070
|
) : null,
|
|
1139
|
-
health.openAtSourceHref ? /* @__PURE__ */
|
|
1071
|
+
health.openAtSourceHref ? /* @__PURE__ */ jsxs3(
|
|
1140
1072
|
OutboundLink,
|
|
1141
1073
|
{
|
|
1142
1074
|
href: health.openAtSourceHref,
|
|
1143
1075
|
className: "inline-flex h-6 items-center gap-1 rounded px-1.5 hover:bg-accent hover:text-foreground pointer-coarse:h-10",
|
|
1144
1076
|
children: [
|
|
1145
|
-
/* @__PURE__ */
|
|
1077
|
+
/* @__PURE__ */ jsx3(ExternalLinkIcon, { className: "h-3 w-3" }),
|
|
1146
1078
|
health.openAtSourceLabel ?? deriveOpenAtSourceLabel(health.source)
|
|
1147
1079
|
]
|
|
1148
1080
|
}
|
|
@@ -1160,16 +1092,16 @@ function FieldsSection({ core }) {
|
|
|
1160
1092
|
const RefCell = host.doors.RefCell;
|
|
1161
1093
|
const label = core.recordType?.label.toLowerCase() ?? "record";
|
|
1162
1094
|
if (!core.recordType) {
|
|
1163
|
-
return /* @__PURE__ */
|
|
1095
|
+
return /* @__PURE__ */ jsx3(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)}` });
|
|
1164
1096
|
}
|
|
1165
1097
|
if (core.status === "loading") {
|
|
1166
|
-
return /* @__PURE__ */
|
|
1098
|
+
return /* @__PURE__ */ jsx3(LoadingFields, { core, label });
|
|
1167
1099
|
}
|
|
1168
1100
|
if (core.status === "not-found") {
|
|
1169
1101
|
const sentence = `This ${label} couldn't be found \u2014 it may have been moved, deleted, or isn't shared with you.`;
|
|
1170
|
-
return /* @__PURE__ */
|
|
1102
|
+
return /* @__PURE__ */ jsxs3(Notice, { tone: "warn", children: [
|
|
1171
1103
|
sentence,
|
|
1172
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ jsx3(
|
|
1173
1105
|
ErrorActions2,
|
|
1174
1106
|
{
|
|
1175
1107
|
origin: "detail/DetailBody",
|
|
@@ -1181,24 +1113,24 @@ function FieldsSection({ core }) {
|
|
|
1181
1113
|
] });
|
|
1182
1114
|
}
|
|
1183
1115
|
if (core.status === "error") {
|
|
1184
|
-
return /* @__PURE__ */
|
|
1116
|
+
return /* @__PURE__ */ jsxs3(Notice, { tone: "error", children: [
|
|
1185
1117
|
`Couldn't load the details for this ${label}. ${core.errorMessage ?? ""}`.trim(),
|
|
1186
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ jsx3(ErrorActions2, { origin: "detail/DetailBody", operation: `Load this ${label}`, error: core.errorMessage })
|
|
1187
1119
|
] });
|
|
1188
1120
|
}
|
|
1189
1121
|
if (core.status === "none") {
|
|
1190
|
-
return /* @__PURE__ */
|
|
1122
|
+
return /* @__PURE__ */ jsx3(Notice, { tone: "muted", children: `Nothing more about this ${label} is stored here, so there is nothing else to show. ` + whatTheControlsDo(core) });
|
|
1191
1123
|
}
|
|
1192
1124
|
if (core.fields.length === 0) {
|
|
1193
|
-
return /* @__PURE__ */
|
|
1125
|
+
return /* @__PURE__ */ jsx3("p", { className: "text-sm text-muted-foreground", children: "No additional fields to show." });
|
|
1194
1126
|
}
|
|
1195
|
-
return /* @__PURE__ */
|
|
1127
|
+
return /* @__PURE__ */ jsx3("dl", { className: "grid grid-cols-1 gap-x-4 gap-y-2.5", children: core.fields.map((field) => /* @__PURE__ */ jsxs3(
|
|
1196
1128
|
"div",
|
|
1197
1129
|
{
|
|
1198
1130
|
className: "flex flex-col gap-0.5 border-b border-border/40 pb-2 last:border-b-0",
|
|
1199
1131
|
children: [
|
|
1200
|
-
/* @__PURE__ */
|
|
1201
|
-
/* @__PURE__ */
|
|
1132
|
+
/* @__PURE__ */ jsx3("dt", { className: "text-[11px] font-medium uppercase tracking-wide text-muted-foreground", children: field.label }),
|
|
1133
|
+
/* @__PURE__ */ jsx3(
|
|
1202
1134
|
"dd",
|
|
1203
1135
|
{
|
|
1204
1136
|
className: cn3(
|
|
@@ -1210,7 +1142,7 @@ function FieldsSection({ core }) {
|
|
|
1210
1142
|
// `field.ref.id` alone, so a field whose text was "Brightwater Robotics"
|
|
1211
1143
|
// printed a truncated uuid. The ref's own `name` wins; otherwise the
|
|
1212
1144
|
// field's text, unless that text IS the id and says nothing more.
|
|
1213
|
-
/* @__PURE__ */
|
|
1145
|
+
/* @__PURE__ */ jsx3(
|
|
1214
1146
|
RefCell,
|
|
1215
1147
|
{
|
|
1216
1148
|
value: field.ref.id,
|
|
@@ -1229,8 +1161,8 @@ function FieldsSection({ core }) {
|
|
|
1229
1161
|
}
|
|
1230
1162
|
function LoadingFields({ core, label }) {
|
|
1231
1163
|
const slow = useSlowLoadNotice(true, `${core.ref.type}:${core.ref.id}`);
|
|
1232
|
-
return /* @__PURE__ */
|
|
1233
|
-
slow ? /* @__PURE__ */
|
|
1164
|
+
return /* @__PURE__ */ jsxs3("div", { className: "space-y-3", "aria-busy": "true", "aria-label": `Loading ${label} details`, children: [
|
|
1165
|
+
slow ? /* @__PURE__ */ jsxs3("p", { className: "text-xs text-muted-foreground", "data-detail-slow-load": true, children: [
|
|
1234
1166
|
"Still loading this ",
|
|
1235
1167
|
label,
|
|
1236
1168
|
" \u2014 the read has been running for more than",
|
|
@@ -1238,9 +1170,9 @@ function LoadingFields({ core, label }) {
|
|
|
1238
1170
|
formatDurationMs(SLOW_LOAD_NOTICE_MS, { style: "long" }),
|
|
1239
1171
|
". If nothing appears, the record may be unreachable from here; closing and reopening it starts a fresh read."
|
|
1240
1172
|
] }) : null,
|
|
1241
|
-
Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1173
|
+
Array.from({ length: 5 }).map((_, i) => /* @__PURE__ */ jsxs3("div", { className: "space-y-1.5", children: [
|
|
1174
|
+
/* @__PURE__ */ jsx3(Skeleton, { className: "h-2.5 w-20" }),
|
|
1175
|
+
/* @__PURE__ */ jsx3(Skeleton, { className: cn3("h-4", i % 2 ? "w-3/4" : "w-1/2") })
|
|
1244
1176
|
] }, i))
|
|
1245
1177
|
] });
|
|
1246
1178
|
}
|
|
@@ -1255,9 +1187,9 @@ function AssociationsSection({ core }) {
|
|
|
1255
1187
|
const wanted = core.recordType?.associationTokens ?? host.associations.defaultTokens;
|
|
1256
1188
|
const tokens = wanted.filter((t) => t !== token).filter(isEntityTypeToken);
|
|
1257
1189
|
if (tokens.length === 0) return null;
|
|
1258
|
-
return /* @__PURE__ */
|
|
1259
|
-
/* @__PURE__ */
|
|
1260
|
-
/* @__PURE__ */
|
|
1190
|
+
return /* @__PURE__ */ jsxs3("section", { className: "space-y-2", "data-detail-section": "associations", children: [
|
|
1191
|
+
/* @__PURE__ */ jsx3(SectionHeading, { icon: /* @__PURE__ */ jsx3(Link2Icon, { className: "h-3 w-3" }), children: "Linked" }),
|
|
1192
|
+
/* @__PURE__ */ jsx3(PrimaryEntityProvider, { value: { type: token, id: core.ref.id, label: core.title }, children: /* @__PURE__ */ jsx3(AssociationCardGrid, { tokens }) })
|
|
1261
1193
|
] });
|
|
1262
1194
|
}
|
|
1263
1195
|
var ACTOR_COLUMNS = ["actor_id", "user_id", "person_id", "created_by_id"];
|
|
@@ -1294,33 +1226,33 @@ function HistorySection({ core }) {
|
|
|
1294
1226
|
(candidate) => Boolean(candidate)
|
|
1295
1227
|
);
|
|
1296
1228
|
const ActorName = host.history.ActorName ?? null;
|
|
1297
|
-
return /* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
state.status === "loading" ? /* @__PURE__ */
|
|
1300
|
-
/* @__PURE__ */
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
] }) : state.status === "error" ? /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ jsxs3("section", { className: "space-y-2", "data-detail-section": "history", children: [
|
|
1230
|
+
/* @__PURE__ */ jsx3(SectionHeading, { icon: /* @__PURE__ */ jsx3(HistoryIcon, { className: "h-3 w-3" }), children: "History" }),
|
|
1231
|
+
state.status === "loading" ? /* @__PURE__ */ jsxs3("div", { className: "space-y-1.5", "aria-busy": "true", "aria-label": "Loading history", children: [
|
|
1232
|
+
/* @__PURE__ */ jsx3(Skeleton, { className: "h-3.5 w-2/3" }),
|
|
1233
|
+
/* @__PURE__ */ jsx3(Skeleton, { className: "h-3.5 w-1/2" })
|
|
1234
|
+
] }) : state.status === "error" ? /* @__PURE__ */ jsxs3("p", { className: "text-xs text-muted-foreground", children: [
|
|
1303
1235
|
state.message.toLowerCase().includes("access denied") ? "History is only shown to people who can view this record." : `History could not be read: ${state.message}`,
|
|
1304
|
-
/* @__PURE__ */
|
|
1305
|
-
] }) : state.entries.length === 0 ? /* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ jsx3(ErrorActions2, { origin: "detail/DetailBody", operation: "Read the history", error: state.message })
|
|
1237
|
+
] }) : state.entries.length === 0 ? /* @__PURE__ */ jsx3("p", { className: "text-xs text-muted-foreground", children: "No recorded changes yet." }) : /* @__PURE__ */ jsx3("ol", { className: "space-y-1", children: state.entries.map((entry) => /* @__PURE__ */ jsxs3(
|
|
1306
1238
|
"li",
|
|
1307
1239
|
{
|
|
1308
1240
|
className: "flex flex-wrap items-center gap-x-2 gap-y-0.5 text-xs",
|
|
1309
1241
|
children: [
|
|
1310
|
-
/* @__PURE__ */
|
|
1242
|
+
/* @__PURE__ */ jsxs3("span", { className: "rounded bg-muted px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground", children: [
|
|
1311
1243
|
"v",
|
|
1312
1244
|
entry.version
|
|
1313
1245
|
] }),
|
|
1314
|
-
/* @__PURE__ */
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
entry.isCurrent ? /* @__PURE__ */
|
|
1317
|
-
entry.actorId ? ActorName ? /* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ jsx3("span", { className: "capitalize text-foreground", children: entry.operation.toLowerCase() }),
|
|
1247
|
+
/* @__PURE__ */ jsx3("span", { className: "text-muted-foreground", children: formatWhen(entry.occurredAt) }),
|
|
1248
|
+
entry.isCurrent ? /* @__PURE__ */ jsx3("span", { className: "text-[10px] uppercase tracking-wide text-primary", children: "current" }) : null,
|
|
1249
|
+
entry.actorId ? ActorName ? /* @__PURE__ */ jsxs3("span", { className: "text-muted-foreground", "data-detail-history-actor-person": true, children: [
|
|
1318
1250
|
"Changed by ",
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
] }) : actorToken ? /* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ jsx3(ActorName, { actorId: entry.actorId, row: core.row })
|
|
1252
|
+
] }) : actorToken ? /* @__PURE__ */ jsx3("span", { className: "inline-flex items-center", "data-detail-history-actor": true, children: /* @__PURE__ */ jsx3(ActorCell, { value: entry.actorId, label: "Changed by", token: actorToken }) }) : /* @__PURE__ */ jsxs3("span", { className: "text-muted-foreground", "data-detail-history-actor-raw": true, children: [
|
|
1321
1253
|
"Changed by",
|
|
1322
1254
|
" ",
|
|
1323
|
-
/* @__PURE__ */
|
|
1255
|
+
/* @__PURE__ */ jsx3(
|
|
1324
1256
|
"span",
|
|
1325
1257
|
{
|
|
1326
1258
|
className: "font-mono text-[10px]",
|
|
@@ -1328,7 +1260,7 @@ function HistorySection({ core }) {
|
|
|
1328
1260
|
children: entry.actorId
|
|
1329
1261
|
}
|
|
1330
1262
|
)
|
|
1331
|
-
] }) : /* @__PURE__ */
|
|
1263
|
+
] }) : /* @__PURE__ */ jsx3("span", { className: "text-muted-foreground", "data-detail-history-actor-absent": true, children: "No person recorded for this change" })
|
|
1332
1264
|
]
|
|
1333
1265
|
},
|
|
1334
1266
|
`${entry.version}-${entry.occurredAt}`
|
|
@@ -1340,7 +1272,7 @@ function CustomFieldsPort({ core }) {
|
|
|
1340
1272
|
const Section = host.customFields?.Section;
|
|
1341
1273
|
const token = core.entityToken;
|
|
1342
1274
|
if (!Section || !token) return null;
|
|
1343
|
-
return /* @__PURE__ */
|
|
1275
|
+
return /* @__PURE__ */ jsx3(Section, { token, id: core.ref.id });
|
|
1344
1276
|
}
|
|
1345
1277
|
function DetailBody({ core }) {
|
|
1346
1278
|
const extra = core.recordType?.extraSections && core.frameCtx ? core.recordType.extraSections(core.row, core.frameCtx) : [];
|
|
@@ -1348,32 +1280,35 @@ function DetailBody({ core }) {
|
|
|
1348
1280
|
const body = (
|
|
1349
1281
|
// `min-h-full` so a Frame's right-click menu answers anywhere in the body,
|
|
1350
1282
|
// not only on the rows — a short dossier otherwise leaves a dead band.
|
|
1351
|
-
/* @__PURE__ */
|
|
1352
|
-
/* @__PURE__ */
|
|
1353
|
-
core.health ? /* @__PURE__ */
|
|
1354
|
-
core.about ? /* @__PURE__ */
|
|
1355
|
-
/* @__PURE__ */
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
core.status === "ready" || core.status === "none" ? /* @__PURE__ */
|
|
1358
|
-
/* @__PURE__ */
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
extra.map((section) => /* @__PURE__ */
|
|
1362
|
-
/* @__PURE__ */
|
|
1283
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex min-h-full flex-col", children: [
|
|
1284
|
+
/* @__PURE__ */ jsx3(DetailRecordMeta, { core }),
|
|
1285
|
+
core.health ? /* @__PURE__ */ jsx3(HealthStrip, { health: core.health }) : null,
|
|
1286
|
+
core.about ? /* @__PURE__ */ jsx3("p", { className: "line-clamp-3 border-b border-border/60 p-4 text-xs leading-snug text-muted-foreground", children: core.about }) : null,
|
|
1287
|
+
/* @__PURE__ */ jsxs3("div", { className: "space-y-6 p-4", children: [
|
|
1288
|
+
/* @__PURE__ */ jsx3(FieldsSection, { core }),
|
|
1289
|
+
core.status === "ready" || core.status === "none" ? /* @__PURE__ */ jsxs3(Fragment2, { children: [
|
|
1290
|
+
/* @__PURE__ */ jsx3(CustomFieldsPort, { core }),
|
|
1291
|
+
/* @__PURE__ */ jsx3(AssociationsSection, { core }),
|
|
1292
|
+
/* @__PURE__ */ jsx3(HistorySection, { core }),
|
|
1293
|
+
extra.map((section) => /* @__PURE__ */ jsxs3("section", { className: "space-y-2", "data-detail-section": section.id, children: [
|
|
1294
|
+
/* @__PURE__ */ jsx3(SectionHeading, { children: section.label }),
|
|
1363
1295
|
section.content
|
|
1364
1296
|
] }, section.id))
|
|
1365
1297
|
] }) : null,
|
|
1366
|
-
/* @__PURE__ */
|
|
1298
|
+
/* @__PURE__ */ jsx3(DetailPresentationPane, { core })
|
|
1367
1299
|
] })
|
|
1368
1300
|
] })
|
|
1369
1301
|
);
|
|
1370
|
-
if (Frame && core.frameCtx) return /* @__PURE__ */
|
|
1302
|
+
if (Frame && core.frameCtx) return /* @__PURE__ */ jsx3(Frame, { ctx: core.frameCtx, children: body });
|
|
1371
1303
|
return body;
|
|
1372
1304
|
}
|
|
1373
1305
|
|
|
1374
1306
|
// src/react/presentations.tsx
|
|
1375
1307
|
import { useEffect as useEffect8, useRef as useRef7 } from "react";
|
|
1376
1308
|
|
|
1309
|
+
// src/presentation.ts
|
|
1310
|
+
import { encodeLinkArg } from "@ai-matrx/kit/link-grammar";
|
|
1311
|
+
|
|
1377
1312
|
// src/listContext.ts
|
|
1378
1313
|
var PERCENT_ESCAPE_TOO = /[.!~*'()]/g;
|
|
1379
1314
|
function encodeRefPart(value) {
|
|
@@ -1387,9 +1322,9 @@ function detailInstanceKey(ref) {
|
|
|
1387
1322
|
var DEFAULT_PANEL_URL_RESERVE_BYTES = Math.floor(DETAIL_URL_BUDGET_BYTES / 2);
|
|
1388
1323
|
|
|
1389
1324
|
// src/react/presentations.tsx
|
|
1390
|
-
import { jsx as
|
|
1325
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
1391
1326
|
function KeyboardSlot({ core, children }) {
|
|
1392
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ jsx4(
|
|
1393
1328
|
"div",
|
|
1394
1329
|
{
|
|
1395
1330
|
onKeyDownCapture: core.keyboard.rootProps.onKeyDownCapture,
|
|
@@ -1400,7 +1335,7 @@ function KeyboardSlot({ core, children }) {
|
|
|
1400
1335
|
);
|
|
1401
1336
|
}
|
|
1402
1337
|
function KeyboardActionsSlot({ core, children }) {
|
|
1403
|
-
return /* @__PURE__ */
|
|
1338
|
+
return /* @__PURE__ */ jsx4(
|
|
1404
1339
|
"div",
|
|
1405
1340
|
{
|
|
1406
1341
|
onKeyDownCapture: core.keyboard.rootProps.onKeyDownCapture,
|
|
@@ -1419,7 +1354,7 @@ function KeyboardRoot({ core, children }) {
|
|
|
1419
1354
|
if (active instanceof HTMLElement && active !== document.body && root.contains(active)) return;
|
|
1420
1355
|
root.focus({ preventScroll: true });
|
|
1421
1356
|
}, [core.ref.id, core.ref.type]);
|
|
1422
|
-
return /* @__PURE__ */
|
|
1357
|
+
return /* @__PURE__ */ jsx4(
|
|
1423
1358
|
"div",
|
|
1424
1359
|
{
|
|
1425
1360
|
ref: rootRef,
|
|
@@ -1437,19 +1372,19 @@ function DetailWindowPresentation({ data, onClose }) {
|
|
|
1437
1372
|
const core = useDetailCore(data, "window", { onClose });
|
|
1438
1373
|
const menuActions = useDetailMenuActions(core);
|
|
1439
1374
|
const Shell = requireShell(host.shells, "Window");
|
|
1440
|
-
return /* @__PURE__ */
|
|
1375
|
+
return /* @__PURE__ */ jsx4(
|
|
1441
1376
|
Shell,
|
|
1442
1377
|
{
|
|
1443
1378
|
instanceKey: detailInstanceKey(core.ref),
|
|
1444
1379
|
target: core.ref,
|
|
1445
1380
|
list: core.list.context,
|
|
1446
1381
|
title: core.title,
|
|
1447
|
-
titleNode: /* @__PURE__ */
|
|
1448
|
-
actions: /* @__PURE__ */
|
|
1449
|
-
navActions: /* @__PURE__ */
|
|
1382
|
+
titleNode: /* @__PURE__ */ jsx4(KeyboardSlot, { core, children: /* @__PURE__ */ jsx4(DetailTitle, { core }) }),
|
|
1383
|
+
actions: /* @__PURE__ */ jsx4(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx4(DetailActions, { core }) }),
|
|
1384
|
+
navActions: /* @__PURE__ */ jsx4(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx4(DetailActions, { core, optional: "none" }) }),
|
|
1450
1385
|
menuActions,
|
|
1451
1386
|
onClose: core.close,
|
|
1452
|
-
children: /* @__PURE__ */
|
|
1387
|
+
children: /* @__PURE__ */ jsx4(KeyboardRoot, { core, children: /* @__PURE__ */ jsx4(DetailBody, { core }) })
|
|
1453
1388
|
}
|
|
1454
1389
|
);
|
|
1455
1390
|
}
|
|
@@ -1458,18 +1393,18 @@ function DetailDockedPresentation({ data, onClose }) {
|
|
|
1458
1393
|
const core = useDetailCore(data, "docked", { onClose });
|
|
1459
1394
|
const menuActions = useDetailMenuActions(core);
|
|
1460
1395
|
const Shell = requireShell(host.shells, "Docked");
|
|
1461
|
-
return /* @__PURE__ */
|
|
1396
|
+
return /* @__PURE__ */ jsx4(
|
|
1462
1397
|
Shell,
|
|
1463
1398
|
{
|
|
1464
1399
|
instanceKey: detailInstanceKey(core.ref),
|
|
1465
1400
|
target: core.ref,
|
|
1466
1401
|
title: core.title,
|
|
1467
|
-
titleNode: /* @__PURE__ */
|
|
1468
|
-
actions: /* @__PURE__ */
|
|
1469
|
-
navActions: /* @__PURE__ */
|
|
1402
|
+
titleNode: /* @__PURE__ */ jsx4(KeyboardSlot, { core, children: /* @__PURE__ */ jsx4(DetailTitle, { core }) }),
|
|
1403
|
+
actions: /* @__PURE__ */ jsx4(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx4(DetailActions, { core }) }),
|
|
1404
|
+
navActions: /* @__PURE__ */ jsx4(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx4(DetailActions, { core, optional: "none" }) }),
|
|
1470
1405
|
menuActions,
|
|
1471
1406
|
onClose: core.close,
|
|
1472
|
-
children: /* @__PURE__ */
|
|
1407
|
+
children: /* @__PURE__ */ jsx4(KeyboardRoot, { core, children: /* @__PURE__ */ jsx4(DetailBody, { core }) })
|
|
1473
1408
|
}
|
|
1474
1409
|
);
|
|
1475
1410
|
}
|
|
@@ -1478,18 +1413,18 @@ function DetailPagePresentation({ data }) {
|
|
|
1478
1413
|
const core = useDetailCore(data, "page", {});
|
|
1479
1414
|
const menuActions = useDetailMenuActions(core);
|
|
1480
1415
|
const Shell = requireShell(host.shells, "Page");
|
|
1481
|
-
return /* @__PURE__ */
|
|
1416
|
+
return /* @__PURE__ */ jsx4(
|
|
1482
1417
|
Shell,
|
|
1483
1418
|
{
|
|
1484
1419
|
target: core.ref,
|
|
1485
1420
|
title: core.title,
|
|
1486
|
-
titleNode: /* @__PURE__ */
|
|
1487
|
-
actions: /* @__PURE__ */
|
|
1488
|
-
navActions: /* @__PURE__ */
|
|
1421
|
+
titleNode: /* @__PURE__ */ jsx4(KeyboardSlot, { core, children: /* @__PURE__ */ jsx4(DetailTitle, { core }) }),
|
|
1422
|
+
actions: /* @__PURE__ */ jsx4(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx4(DetailActions, { core }) }),
|
|
1423
|
+
navActions: /* @__PURE__ */ jsx4(KeyboardActionsSlot, { core, children: /* @__PURE__ */ jsx4(DetailActions, { core, optional: "none" }) }),
|
|
1489
1424
|
menuActions,
|
|
1490
1425
|
onClose: core.close,
|
|
1491
1426
|
onBack: core.leave,
|
|
1492
|
-
children: /* @__PURE__ */
|
|
1427
|
+
children: /* @__PURE__ */ jsx4(KeyboardRoot, { core, children: /* @__PURE__ */ jsx4(DetailBody, { core }) })
|
|
1493
1428
|
}
|
|
1494
1429
|
);
|
|
1495
1430
|
}
|