@ai-matrx/design-system 0.18.9 → 0.18.12
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 +34 -0
- package/dist/content-transfer/alchemy.svg +1 -1
- package/dist/content-transfer/icon.cjs +3 -1
- package/dist/content-transfer/icon.cjs.map +1 -1
- package/dist/content-transfer/icon.d.cts +3 -2
- package/dist/content-transfer/icon.d.ts +3 -2
- package/dist/content-transfer/icon.js +3 -1
- package/dist/content-transfer/icon.js.map +1 -1
- package/dist/content-transfer.cjs +442 -447
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.css +130 -54
- package/dist/content-transfer.d.cts +5 -1
- package/dist/content-transfer.d.ts +5 -1
- package/dist/content-transfer.js +467 -472
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +1 -1
- package/dist/data-table/copy-helpers.d.ts +1 -1
- package/dist/data-table/copy-types.cjs.map +1 -1
- package/dist/data-table/copy-types.d.cts +1 -1
- package/dist/data-table/copy-types.d.ts +1 -1
- package/dist/data-table/data-row-inspector.cjs +444 -446
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +489 -491
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +444 -446
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +489 -491
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +1 -1
- package/dist/data-table/filter-engine.d.ts +1 -1
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +17 -1
- package/dist/data-table/host.d.ts +17 -1
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +1524 -1011
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +25 -4
- package/dist/data-table/index.d.ts +25 -4
- package/dist/data-table/index.js +1560 -1047
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +1 -1
- package/dist/data-table/infer-filter.d.ts +1 -1
- package/dist/data-table/layered-filters.d.cts +1 -1
- package/dist/data-table/layered-filters.d.ts +1 -1
- package/dist/data-table/pagination.cjs +5 -5
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +5 -5
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +1 -1
- package/dist/data-table/query-control.d.ts +1 -1
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +1 -1
- package/dist/data-table/types.d.ts +1 -1
- package/dist/data-table/url-state.d.cts +1 -1
- package/dist/data-table/url-state.d.ts +1 -1
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +1 -1
- package/dist/data-table/xlsx.d.ts +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -0
- package/dist/tokens.css +2 -0
- package/dist/{types-cH8oLqUx.d.ts → types-BuDKVpeF.d.ts} +47 -3
- package/dist/{types-0CNCWvdK.d.cts → types-Dqcb7jXO.d.cts} +47 -3
- package/package.json +2 -2
|
@@ -62,48 +62,6 @@ function XIcon(props) {
|
|
|
62
62
|
/* @__PURE__ */ jsx("path", { d: "m6 6 12 12" })
|
|
63
63
|
] });
|
|
64
64
|
}
|
|
65
|
-
function radixProps(props) {
|
|
66
|
-
return {
|
|
67
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
68
|
-
viewBox: "0 0 15 15",
|
|
69
|
-
width: 15,
|
|
70
|
-
height: 15,
|
|
71
|
-
fill: "none",
|
|
72
|
-
"aria-hidden": true,
|
|
73
|
-
...props
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
function CheckIcon(props) {
|
|
77
|
-
return /* @__PURE__ */ jsx("svg", { ...radixProps(props), children: /* @__PURE__ */ jsx(
|
|
78
|
-
"path",
|
|
79
|
-
{
|
|
80
|
-
d: "M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",
|
|
81
|
-
fill: "currentColor",
|
|
82
|
-
fillRule: "evenodd",
|
|
83
|
-
clipRule: "evenodd"
|
|
84
|
-
}
|
|
85
|
-
) });
|
|
86
|
-
}
|
|
87
|
-
function DotFilledIcon(props) {
|
|
88
|
-
return /* @__PURE__ */ jsx("svg", { ...radixProps(props), children: /* @__PURE__ */ jsx(
|
|
89
|
-
"path",
|
|
90
|
-
{
|
|
91
|
-
d: "M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",
|
|
92
|
-
fill: "currentColor"
|
|
93
|
-
}
|
|
94
|
-
) });
|
|
95
|
-
}
|
|
96
|
-
function RadixChevronRightIcon(props) {
|
|
97
|
-
return /* @__PURE__ */ jsx("svg", { ...radixProps(props), children: /* @__PURE__ */ jsx(
|
|
98
|
-
"path",
|
|
99
|
-
{
|
|
100
|
-
d: "M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",
|
|
101
|
-
fill: "currentColor",
|
|
102
|
-
fillRule: "evenodd",
|
|
103
|
-
clipRule: "evenodd"
|
|
104
|
-
}
|
|
105
|
-
) });
|
|
106
|
-
}
|
|
107
65
|
|
|
108
66
|
// src/portal-container.tsx
|
|
109
67
|
import * as React from "react";
|
|
@@ -522,154 +480,123 @@ var Button = React5.forwardRef(
|
|
|
522
480
|
);
|
|
523
481
|
Button.displayName = "Button";
|
|
524
482
|
|
|
525
|
-
// src/
|
|
526
|
-
import * as
|
|
483
|
+
// src/popover.tsx
|
|
484
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
527
485
|
import * as React6 from "react";
|
|
528
|
-
import { jsx as jsx9
|
|
529
|
-
var
|
|
530
|
-
var
|
|
531
|
-
var
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
539
|
-
className: cn(
|
|
540
|
-
"flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",
|
|
541
|
-
inset && "pl-8",
|
|
542
|
-
className
|
|
543
|
-
),
|
|
544
|
-
...props,
|
|
545
|
-
children: [
|
|
546
|
-
children,
|
|
547
|
-
/* @__PURE__ */ jsx9(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
548
|
-
]
|
|
549
|
-
}
|
|
550
|
-
));
|
|
551
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
552
|
-
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
553
|
-
DropdownMenuPrimitive.SubContent,
|
|
554
|
-
{
|
|
555
|
-
ref,
|
|
556
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
557
|
-
className: cn(MENU_SURFACE_CLASS, "shadow-lg", MOTION_POPPER, className),
|
|
558
|
-
...props
|
|
559
|
-
}
|
|
560
|
-
));
|
|
561
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
562
|
-
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
563
|
-
const portalContainer = usePortalContainer(container);
|
|
564
|
-
return /* @__PURE__ */ jsx9(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx9(
|
|
565
|
-
DropdownMenuPrimitive.Content,
|
|
566
|
-
{
|
|
567
|
-
ref,
|
|
568
|
-
"data-slot": "dropdown-menu-content",
|
|
569
|
-
sideOffset,
|
|
570
|
-
className: cn(
|
|
571
|
-
MENU_SURFACE_CLASS,
|
|
572
|
-
"shadow-md",
|
|
573
|
-
MOTION_POPPER,
|
|
574
|
-
className
|
|
575
|
-
),
|
|
576
|
-
...props
|
|
577
|
-
}
|
|
578
|
-
) });
|
|
579
|
-
});
|
|
580
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
581
|
-
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
582
|
-
DropdownMenuPrimitive.Item,
|
|
583
|
-
{
|
|
584
|
-
ref,
|
|
585
|
-
"data-slot": "dropdown-menu-item",
|
|
586
|
-
className: cn(MENU_ITEM_CLASS, inset && "pl-8", className),
|
|
587
|
-
...props
|
|
588
|
-
}
|
|
589
|
-
));
|
|
590
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
591
|
-
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
|
|
592
|
-
DropdownMenuPrimitive.CheckboxItem,
|
|
593
|
-
{
|
|
594
|
-
ref,
|
|
595
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
596
|
-
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
597
|
-
...props,
|
|
598
|
-
children: [
|
|
599
|
-
/* @__PURE__ */ jsx9("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx9(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx9(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
600
|
-
children
|
|
601
|
-
]
|
|
602
|
-
}
|
|
603
|
-
));
|
|
604
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
605
|
-
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(
|
|
606
|
-
DropdownMenuPrimitive.RadioItem,
|
|
607
|
-
{
|
|
608
|
-
ref,
|
|
609
|
-
"data-slot": "dropdown-menu-radio-item",
|
|
610
|
-
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
611
|
-
...props,
|
|
612
|
-
children: [
|
|
613
|
-
/* @__PURE__ */ jsx9("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx9(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx9(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
614
|
-
children
|
|
615
|
-
]
|
|
616
|
-
}
|
|
617
|
-
));
|
|
618
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
619
|
-
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
620
|
-
DropdownMenuPrimitive.Label,
|
|
621
|
-
{
|
|
622
|
-
ref,
|
|
623
|
-
"data-slot": "dropdown-menu-label",
|
|
624
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
625
|
-
...props
|
|
626
|
-
}
|
|
627
|
-
));
|
|
628
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
629
|
-
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx9(
|
|
630
|
-
DropdownMenuPrimitive.Separator,
|
|
631
|
-
{
|
|
632
|
-
ref,
|
|
633
|
-
"data-slot": "dropdown-menu-separator",
|
|
634
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
635
|
-
...props
|
|
636
|
-
}
|
|
637
|
-
));
|
|
638
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
639
|
-
var DropdownMenuShortcut = ({
|
|
640
|
-
className,
|
|
641
|
-
...props
|
|
642
|
-
}) => /* @__PURE__ */ jsx9(
|
|
643
|
-
"span",
|
|
644
|
-
{
|
|
645
|
-
"data-slot": "dropdown-menu-shortcut",
|
|
646
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
486
|
+
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
487
|
+
var Popover = PopoverPrimitive.Root;
|
|
488
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
489
|
+
var PopoverContent = React6.forwardRef(
|
|
490
|
+
({
|
|
491
|
+
className,
|
|
492
|
+
align = "center",
|
|
493
|
+
sideOffset = 4,
|
|
494
|
+
container,
|
|
495
|
+
animated = true,
|
|
647
496
|
...props
|
|
497
|
+
}, ref) => {
|
|
498
|
+
const portalContainer = usePortalContainer(container);
|
|
499
|
+
return /* @__PURE__ */ jsx9(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx9(
|
|
500
|
+
PopoverPrimitive.Content,
|
|
501
|
+
{
|
|
502
|
+
ref,
|
|
503
|
+
align,
|
|
504
|
+
sideOffset,
|
|
505
|
+
className: cn(
|
|
506
|
+
// Cap to the viewport space Radix measured and scroll — a popover taller
|
|
507
|
+
// than the screen must never trap the user with unreachable content.
|
|
508
|
+
// z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal
|
|
509
|
+
// z, DOM portal order decides, so a dialog opened FROM a popover stacks
|
|
510
|
+
// above it, and a popover opened from a dialog still stacks above the
|
|
511
|
+
// dialog. z-[10001] buried dialogs behind fullscreen popovers.
|
|
512
|
+
"z-[10000] w-72 max-h-[var(--radix-popover-content-available-height)] overflow-y-auto overscroll-contain rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none",
|
|
513
|
+
animated && MOTION_POPPER,
|
|
514
|
+
className
|
|
515
|
+
),
|
|
516
|
+
...props
|
|
517
|
+
}
|
|
518
|
+
) });
|
|
648
519
|
}
|
|
649
520
|
);
|
|
650
|
-
|
|
521
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
522
|
+
|
|
523
|
+
// src/content-transfer/icon.ts
|
|
524
|
+
var ALCHEMY_GLYPH_PATHS = ["M9 3h6", "M10 3v6l-5.2 8.7A2 2 0 0 0 6.5 21h11a2 2 0 0 0 1.7-3.3L14 9V3", "M8 15h8"];
|
|
525
|
+
var ALCHEMY_GLYPH_SVG = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round">${ALCHEMY_GLYPH_PATHS.map((d) => `<path d="${d}"/>`).join("")}</svg>`;
|
|
651
526
|
|
|
652
527
|
// src/content-transfer/index.tsx
|
|
653
|
-
import { Fragment, jsx as jsx10, jsxs as
|
|
528
|
+
import { Fragment, jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
654
529
|
function AlchemyGlyph(props) {
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
/* @__PURE__ */ jsx10("path", { d: "M4.5 5.5h8v11h-8z" }),
|
|
657
|
-
/* @__PURE__ */ jsx10("path", { d: "M8.5 9.5h8v9h-8z" }),
|
|
658
|
-
/* @__PURE__ */ jsx10("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
|
|
659
|
-
] });
|
|
530
|
+
return /* @__PURE__ */ jsx10("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: ALCHEMY_GLYPH_PATHS.map((d) => /* @__PURE__ */ jsx10("path", { d }, d)) });
|
|
660
531
|
}
|
|
661
532
|
var CapabilityContext = React7.createContext({});
|
|
662
533
|
var useContentTransferCapabilities = () => React7.useContext(CapabilityContext);
|
|
663
534
|
var SurfaceContext = React7.createContext(null);
|
|
664
535
|
function MenuPresentation({ label, hint, icon: Icon2 }) {
|
|
665
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
666
537
|
Icon2 ? /* @__PURE__ */ jsx10(Icon2, { className: "matrx-alchemy-menu-icon" }) : null,
|
|
667
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
668
539
|
label,
|
|
669
540
|
hint ? /* @__PURE__ */ jsx10("small", { className: "matrx-alchemy-menu-hint", children: hint }) : null
|
|
670
541
|
] })
|
|
671
542
|
] });
|
|
672
543
|
}
|
|
544
|
+
function PaletteGlyph({ format, ai = false, file = false, kind }) {
|
|
545
|
+
if (kind === "ai-copy") return /* @__PURE__ */ jsxs5("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
546
|
+
/* @__PURE__ */ jsx10("rect", { x: "5", y: "5", width: "11", height: "14", rx: "2" }),
|
|
547
|
+
/* @__PURE__ */ jsx10("path", { d: "M9 3h6a2 2 0 0 1 2 2v10" }),
|
|
548
|
+
/* @__PURE__ */ jsx10("path", { d: "m18.5 3 .55 1.45L20.5 5l-1.45.55L18.5 7l-.55-1.45L16.5 5l1.45-.55z" })
|
|
549
|
+
] });
|
|
550
|
+
if (kind === "sliders") return /* @__PURE__ */ jsxs5("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
551
|
+
/* @__PURE__ */ jsx10("path", { d: "M4 6h16M4 12h16M4 18h16" }),
|
|
552
|
+
/* @__PURE__ */ jsx10("path", { d: "M8 3v6M16 9v6M10 15v6" })
|
|
553
|
+
] });
|
|
554
|
+
if (ai) return /* @__PURE__ */ jsxs5("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
555
|
+
/* @__PURE__ */ jsx10("path", { d: "M12 5a3 3 0 1 0-5.997.125A4 4 0 0 0 3.5 10.9a4 4 0 0 0 .556 6.588A4 4 0 0 0 12 19" }),
|
|
556
|
+
/* @__PURE__ */ jsx10("path", { d: "M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.503 5.775 4 4 0 0 1-.556 6.588A4 4 0 0 1 12 19" }),
|
|
557
|
+
/* @__PURE__ */ jsx10("path", { d: "M12 5v14M8 9h1M15 9h1M8 15h1M15 15h1" })
|
|
558
|
+
] });
|
|
559
|
+
if (file) return /* @__PURE__ */ jsxs5("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [
|
|
560
|
+
/* @__PURE__ */ jsx10("path", { d: "M6 3h8l4 4v14H6z" }),
|
|
561
|
+
/* @__PURE__ */ jsx10("path", { d: "M14 3v5h5M9 13h6M9 17h6" })
|
|
562
|
+
] });
|
|
563
|
+
const path = format === "json" ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
564
|
+
/* @__PURE__ */ jsx10("path", { d: "M9 4C7 4 7 7 5 7v3c2 0 2 1 2 2s0 2-2 2v3c2 0 2 3 4 3" }),
|
|
565
|
+
/* @__PURE__ */ jsx10("path", { d: "M15 4c2 0 2 3 4 3v3c-2 0-2 1-2 2s0 2 2 2v3c-2 0-2 3-4 3" })
|
|
566
|
+
] }) : format === "compact-json" ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
567
|
+
/* @__PURE__ */ jsx10("path", { d: "m14 10 7-7" }),
|
|
568
|
+
/* @__PURE__ */ jsx10("path", { d: "M20 10h-6V4" }),
|
|
569
|
+
/* @__PURE__ */ jsx10("path", { d: "m3 21 7-7" }),
|
|
570
|
+
/* @__PURE__ */ jsx10("path", { d: "M4 14h6v6" })
|
|
571
|
+
] }) : format === "csv" ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
572
|
+
/* @__PURE__ */ jsx10("rect", { x: "4", y: "4", width: "16", height: "16", rx: "1" }),
|
|
573
|
+
/* @__PURE__ */ jsx10("path", { d: "M4 10h16M10 4v16" })
|
|
574
|
+
] }) : format === "tsv" ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
575
|
+
/* @__PURE__ */ jsx10("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
576
|
+
/* @__PURE__ */ jsx10("path", { d: "M14 2v6h6M8 13h2M14 13h2M8 17h2M14 17h2" })
|
|
577
|
+
] }) : format === "xlsx" ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
578
|
+
/* @__PURE__ */ jsx10("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
579
|
+
/* @__PURE__ */ jsx10("path", { d: "M14 2v6h6M8 13h8M8 17h8M12 11v8" })
|
|
580
|
+
] }) : format === "markdown" ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
581
|
+
/* @__PURE__ */ jsx10("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5z" }),
|
|
582
|
+
/* @__PURE__ */ jsx10("path", { d: "M14 2v6h6M10 13l-2 2 2 2M14 17l2-2-2-2" })
|
|
583
|
+
] }) : format === "html" ? /* @__PURE__ */ jsx10(Fragment, { children: /* @__PURE__ */ jsx10("path", { d: "M15 6h6M3 6h7M3 12h18M3 18h12" }) }) : /* @__PURE__ */ jsx10(Fragment, { children: /* @__PURE__ */ jsx10("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
|
|
584
|
+
return /* @__PURE__ */ jsx10("svg", { className: "matrx-alchemy-palette-glyph", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: path });
|
|
585
|
+
}
|
|
586
|
+
function PaletteRows({ title, items, onRun, extra, ai = false, glyphKind, fallbackHint }) {
|
|
587
|
+
if (!items.length && !extra) return null;
|
|
588
|
+
return /* @__PURE__ */ jsxs5("section", { className: "matrx-alchemy-palette-section", children: [
|
|
589
|
+
/* @__PURE__ */ jsx10("h3", { children: title }),
|
|
590
|
+
items.map((item) => /* @__PURE__ */ jsxs5("button", { type: "button", className: cn("matrx-alchemy-palette-row", ai && "matrx-alchemy-palette-row-ai"), "aria-label": item.ariaLabel, onClick: () => onRun?.(item), children: [
|
|
591
|
+
item.icon ? /* @__PURE__ */ jsx10(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ jsx10(PaletteGlyph, { ai, ...glyphKind ? { kind: glyphKind } : {} }),
|
|
592
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
593
|
+
item.copyLabel ?? item.label,
|
|
594
|
+
item.hint ?? fallbackHint ? /* @__PURE__ */ jsx10("small", { className: "matrx-alchemy-menu-hint", children: item.hint ?? fallbackHint }) : null
|
|
595
|
+
] })
|
|
596
|
+
] }, item.id)),
|
|
597
|
+
extra
|
|
598
|
+
] });
|
|
599
|
+
}
|
|
673
600
|
var LABEL = { plain: "Plain text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact JSON", csv: "CSV", tsv: "Google Sheets", xlsx: "Excel workbook" };
|
|
674
601
|
var BUILT_INS = Object.freeze(Object.keys(LABEL).map((id) => ({ id })));
|
|
675
602
|
var COPIES = ["plain", "markdown", "html", "json", "compact-json", "csv", "tsv"];
|
|
@@ -758,7 +685,7 @@ function ContentTransferMenu(props) {
|
|
|
758
685
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
759
686
|
return /* @__PURE__ */ jsx10(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
760
687
|
}
|
|
761
|
-
function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
|
|
688
|
+
function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, sourceFormats = true, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
|
|
762
689
|
const triggerRef = React7.useRef(null);
|
|
763
690
|
const inherited = React7.useContext(CapabilityContext);
|
|
764
691
|
const nearestSurface = React7.useContext(SurfaceContext);
|
|
@@ -771,6 +698,8 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
771
698
|
const workspaceCaptures = React7.useRef(/* @__PURE__ */ new Map());
|
|
772
699
|
const externalWorkspaceKeys = React7.useRef(/* @__PURE__ */ new Set());
|
|
773
700
|
const [notice, setNotice] = React7.useState(null);
|
|
701
|
+
const [paletteOpen, setPaletteOpen] = React7.useState(false);
|
|
702
|
+
const [mode, setMode] = React7.useState("copy");
|
|
774
703
|
const scopes = React7.useMemo(() => table?.availableScopes ?? ["target"], [table]);
|
|
775
704
|
const initialScope = table?.initialScope ?? "target";
|
|
776
705
|
if (!scopes.includes(initialScope)) throw new Error("Alchemy initialScope must be included in availableScopes.");
|
|
@@ -1022,48 +951,96 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
1022
951
|
}, [captureOne, capturePrimary, fence, initialScope, preferences, providerPreferences, report]);
|
|
1023
952
|
if (!enabled) return null;
|
|
1024
953
|
const payload = menuCapture?.snapshot.payload ?? (source && "kind" in source ? source : void 0);
|
|
1025
|
-
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section)
|
|
1026
|
-
const visibleCopies = COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows");
|
|
1027
|
-
const visibleDownloads = DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows");
|
|
1028
|
-
const visibleAdapters = menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
954
|
+
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section);
|
|
955
|
+
const visibleCopies = sourceFormats ? COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows") : [];
|
|
956
|
+
const visibleDownloads = sourceFormats ? DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows") : [];
|
|
957
|
+
const visibleAdapters = sourceFormats && menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
1029
958
|
const visibleActions = menuCapture ? registeredActions.filter((a) => a.supports(menuCapture.snapshot)) : [];
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
959
|
+
const downloadActions = visibleActions.filter((action) => action.placement === "download");
|
|
960
|
+
const ordinaryActions = visibleActions.filter((action) => action.placement !== "download");
|
|
961
|
+
const copyAvailable = !hide.includes("copy") && visibleCopies.length + visibleAdapters.length + quickVariants("copy").length > 0;
|
|
962
|
+
const downloadAvailable = !hide.includes("download") && visibleDownloads.length + visibleAdapters.length + downloadActions.length > 0;
|
|
963
|
+
const prepareAvailable = !hide.includes("prepare") && (quickVariants("ai").length > 0 || Boolean(primary) || Boolean(nearestWorkspaceKey) || variants.length > 0);
|
|
964
|
+
const resolvedMode = mode === "copy" && !copyAvailable ? "download" : mode === "download" && !downloadAvailable ? "copy" : mode;
|
|
965
|
+
const closePalette = () => setPaletteOpen(false);
|
|
966
|
+
const tile = (id, label2, onClick, options = {}) => {
|
|
967
|
+
const presentation = options.action;
|
|
968
|
+
const Icon2 = presentation?.icon;
|
|
969
|
+
const fallbackLabel = options.file && !/^download\b/i.test(label2) ? `Download ${label2}` : label2;
|
|
970
|
+
return /* @__PURE__ */ jsxs5("button", { type: "button", className: "matrx-alchemy-palette-tile", "aria-label": presentation?.ariaLabel ?? (presentation ? fallbackLabel : options.ariaLabel ?? `${resolvedMode === "copy" ? "Copy" : "Download"} ${label2}`), onClick: () => {
|
|
971
|
+
closePalette();
|
|
972
|
+
onClick();
|
|
1033
973
|
}, children: [
|
|
1034
|
-
/* @__PURE__ */ jsx10(
|
|
1035
|
-
/* @__PURE__ */
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
974
|
+
Icon2 ? /* @__PURE__ */ jsx10(Icon2, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ jsx10(PaletteGlyph, { ...!options.custom ? { format: id } : {}, ...options.ai ? { ai: true } : {}, ...options.file ? { file: true } : {} }),
|
|
975
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
976
|
+
label2,
|
|
977
|
+
presentation?.hint ? /* @__PURE__ */ jsx10("small", { className: "matrx-alchemy-menu-hint", children: presentation.hint }) : null
|
|
978
|
+
] })
|
|
979
|
+
] }, id);
|
|
980
|
+
};
|
|
981
|
+
return /* @__PURE__ */ jsxs5("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
982
|
+
/* @__PURE__ */ jsxs5(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
983
|
+
setPaletteOpen(open);
|
|
984
|
+
if (open) {
|
|
985
|
+
setMode("copy");
|
|
986
|
+
void preflight();
|
|
987
|
+
}
|
|
988
|
+
}, children: [
|
|
989
|
+
/* @__PURE__ */ jsx10(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx10("button", { ref: triggerRef, type: "button", className: "matrx-alchemy-trigger", disabled, "aria-label": `Copy, transform or export ${sourceLabel}`, title: "Alchemy \u2014 copy, transform, export", children: /* @__PURE__ */ jsx10(AlchemyGlyph, {}) }) }),
|
|
990
|
+
/* @__PURE__ */ jsxs5(PopoverContent, { align: "end", className: "matrx-alchemy-menu matrx-alchemy-palette", "aria-label": "Alchemy output options", onCloseAutoFocus: () => triggerRef.current?.focus(), children: [
|
|
991
|
+
menuStatus === "loading" ? /* @__PURE__ */ jsx10("p", { className: "matrx-alchemy-palette-status", children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ jsx10("p", { className: "matrx-alchemy-error", children: menuStatus }) : null,
|
|
992
|
+
copyAvailable || downloadAvailable ? /* @__PURE__ */ jsxs5("section", { className: "matrx-alchemy-output", children: [
|
|
993
|
+
/* @__PURE__ */ jsx10("h3", { children: resolvedMode === "copy" ? "Copy as" : "Download as" }),
|
|
994
|
+
copyAvailable && downloadAvailable ? /* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
|
|
995
|
+
/* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
|
|
996
|
+
/* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
|
|
997
|
+
] }) : null,
|
|
998
|
+
resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
999
|
+
/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-palette-grid", children: [
|
|
1000
|
+
visibleCopies.map((format) => tile(format, { plain: "Text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact", csv: "CSV", tsv: "Sheets" }[format], () => void transfer(format, false), { ariaLabel: `Copy ${LABEL[format]}` })),
|
|
1001
|
+
visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
|
|
1002
|
+
] }),
|
|
1003
|
+
quickVariants("copy").length ? /* @__PURE__ */ jsx10(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
|
|
1004
|
+
closePalette();
|
|
1005
|
+
void transfer("markdown", false, variant);
|
|
1006
|
+
} }) : null
|
|
1007
|
+
] }) : null,
|
|
1008
|
+
resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ jsx10(Fragment, { children: /* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-palette-grid", children: [
|
|
1009
|
+
visibleDownloads.map((format) => tile(format, { plain: "Text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact", csv: "CSV", tsv: "Sheets", xlsx: "Excel" }[format], () => void transfer(format, true), { ariaLabel: `Download ${LABEL[format]}` })),
|
|
1010
|
+
visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
|
|
1011
|
+
downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
|
|
1012
|
+
] }) }) : null
|
|
1052
1013
|
] }) : null,
|
|
1053
|
-
|
|
1054
|
-
/* @__PURE__ */ jsx10(
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1014
|
+
prepareAvailable ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1015
|
+
/* @__PURE__ */ jsx10(PaletteRows, { title: "Copy for AI", ai: true, glyphKind: "ai-copy", fallbackHint: "Copies immediately", items: quickVariants("ai"), onRun: (variant) => {
|
|
1016
|
+
closePalette();
|
|
1017
|
+
void transfer("markdown", false, variant);
|
|
1018
|
+
} }),
|
|
1019
|
+
/* @__PURE__ */ jsx10(PaletteRows, { title: "Edit and prepare", items: [], extra: /* @__PURE__ */ jsxs5("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": "Prepare for AI", onClick: () => {
|
|
1020
|
+
closePalette();
|
|
1021
|
+
void openWorkspace();
|
|
1022
|
+
}, children: [
|
|
1023
|
+
/* @__PURE__ */ jsx10(PaletteGlyph, { kind: "sliders" }),
|
|
1024
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1025
|
+
"Prepare for AI",
|
|
1026
|
+
/* @__PURE__ */ jsx10("small", { className: "matrx-alchemy-menu-hint", children: "Review and edit before copying" })
|
|
1027
|
+
] })
|
|
1028
|
+
] }) })
|
|
1064
1029
|
] }) : null,
|
|
1065
|
-
|
|
1066
|
-
|
|
1030
|
+
prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ jsx10(PaletteRows, { title: "Other sources", items: [], extra: /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1031
|
+
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ jsx10("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
|
|
1032
|
+
closePalette();
|
|
1033
|
+
void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
|
|
1034
|
+
}, children: /* @__PURE__ */ jsx10("span", { children: "Prepare this surface" }) }) : null,
|
|
1035
|
+
variants.map((variant) => /* @__PURE__ */ jsx10("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
|
|
1036
|
+
closePalette();
|
|
1037
|
+
void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
|
|
1038
|
+
}, children: /* @__PURE__ */ jsx10(MenuPresentation, { ...variant, label: `Prepare ${variant.label}` }) }, variant.id))
|
|
1039
|
+
] }) }) : null,
|
|
1040
|
+
ordinaryActions.length ? /* @__PURE__ */ jsx10(PaletteRows, { title: "Actions", items: [], extra: ordinaryActions.map((action) => /* @__PURE__ */ jsx10("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
|
|
1041
|
+
closePalette();
|
|
1042
|
+
void runAction(action);
|
|
1043
|
+
}, children: /* @__PURE__ */ jsx10(MenuPresentation, { ...action, label: action.label }) }, action.id)) }) : null
|
|
1067
1044
|
] })
|
|
1068
1045
|
] }),
|
|
1069
1046
|
notice ? /* @__PURE__ */ jsx10("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
|
|
@@ -1326,218 +1303,230 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
1326
1303
|
const limitText = Object.entries(state.preferences.limits).filter(([, value]) => value != null).map(([key, value]) => `${key.replace(/^max/, "max ")} ${Number(value).toLocaleString()}`).join(" \xB7 ");
|
|
1327
1304
|
return /* @__PURE__ */ jsx10(Dialog, { open, onOpenChange: (next) => {
|
|
1328
1305
|
if (!next) close();
|
|
1329
|
-
}, children: /* @__PURE__ */
|
|
1306
|
+
}, children: /* @__PURE__ */ jsxs5(DialogContent, { onCloseAutoFocus: (event) => {
|
|
1330
1307
|
event.preventDefault();
|
|
1331
1308
|
restoreFocus();
|
|
1332
1309
|
}, className: "matrx-alchemy-workspace max-w-5xl", "aria-busy": busy !== null, children: [
|
|
1333
|
-
/* @__PURE__ */
|
|
1334
|
-
/* @__PURE__ */
|
|
1310
|
+
/* @__PURE__ */ jsxs5(DialogHeader, { children: [
|
|
1311
|
+
/* @__PURE__ */ jsxs5(DialogTitle, { children: [
|
|
1335
1312
|
"Prepare ",
|
|
1336
1313
|
state.snapshot.label
|
|
1337
1314
|
] }),
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
"
|
|
1340
|
-
|
|
1341
|
-
". Your source is never edited."
|
|
1315
|
+
/* @__PURE__ */ jsxs5(DialogDescription, { children: [
|
|
1316
|
+
state.snapshot.unsavedChanges ? "Includes your unsaved changes. " : "",
|
|
1317
|
+
"Review and edit this copy. Your original stays unchanged."
|
|
1342
1318
|
] })
|
|
1343
1319
|
] }),
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
|
|
1348
|
-
"
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
"
|
|
1353
|
-
|
|
1354
|
-
/* @__PURE__ */
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1320
|
+
/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-workspace-body", children: [
|
|
1321
|
+
/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-workspace-grid", children: [
|
|
1322
|
+
/* @__PURE__ */ jsxs5("section", { className: "matrx-alchemy-main", children: [
|
|
1323
|
+
/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-toolbar", children: [
|
|
1324
|
+
scopes.length > 1 ? /* @__PURE__ */ jsxs5("label", { children: [
|
|
1325
|
+
"Scope",
|
|
1326
|
+
/* @__PURE__ */ jsx10("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ jsx10("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
|
|
1327
|
+
] }) : null,
|
|
1328
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1329
|
+
"Detail",
|
|
1330
|
+
/* @__PURE__ */ jsxs5("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
|
|
1331
|
+
/* @__PURE__ */ jsx10("option", { value: "full", children: "Full" }),
|
|
1332
|
+
/* @__PURE__ */ jsx10("option", { value: "compact", children: "Compact" }),
|
|
1333
|
+
/* @__PURE__ */ jsx10("option", { value: "brief", children: "Brief" }),
|
|
1334
|
+
/* @__PURE__ */ jsx10("option", { value: "custom", children: "Custom" })
|
|
1335
|
+
] })
|
|
1336
|
+
] }),
|
|
1337
|
+
/* @__PURE__ */ jsx10(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
|
|
1338
|
+
setBufferError(null);
|
|
1339
|
+
if (controlsHistory.length) {
|
|
1340
|
+
const next = controlsHistory[controlsHistory.length - 1];
|
|
1341
|
+
setControls(next);
|
|
1342
|
+
setControlsHistory((history) => history.slice(0, -1));
|
|
1343
|
+
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
1344
|
+
} else onChange({ ...state, draft: undoDraft(state.draft), error: void 0 });
|
|
1345
|
+
}, children: "Undo" }),
|
|
1346
|
+
/* @__PURE__ */ jsx10(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => {
|
|
1347
|
+
const next = initialControls(state);
|
|
1364
1348
|
setControls(next);
|
|
1365
|
-
setControlsHistory(
|
|
1349
|
+
setControlsHistory([]);
|
|
1350
|
+
setPendingControls(null);
|
|
1351
|
+
setBufferError(null);
|
|
1366
1352
|
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
1367
|
-
}
|
|
1368
|
-
|
|
1369
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
|
|
1370
|
-
const next = initialControls(state);
|
|
1371
|
-
setControls(next);
|
|
1372
|
-
setControlsHistory([]);
|
|
1373
|
-
setPendingControls(null);
|
|
1374
|
-
setBufferError(null);
|
|
1375
|
-
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
1376
|
-
}, children: "Reset" }),
|
|
1377
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
|
|
1378
|
-
] }),
|
|
1379
|
-
controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ jsxs6("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1380
|
-
/* @__PURE__ */ jsx10("legend", { children: "JSON limits" }),
|
|
1381
|
-
[["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ jsxs6("label", { children: [
|
|
1382
|
-
text,
|
|
1383
|
-
/* @__PURE__ */ jsx10("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
1384
|
-
] }, key))
|
|
1385
|
-
] }) : null,
|
|
1386
|
-
rows ? /* @__PURE__ */ jsx10(RowControls, { rows, controls, change: changeControls }) : null,
|
|
1387
|
-
state.snapshot.sections.length ? /* @__PURE__ */ jsxs6("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1388
|
-
/* @__PURE__ */ jsx10("legend", { children: "Sections" }),
|
|
1389
|
-
state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs6("label", { children: [
|
|
1390
|
-
/* @__PURE__ */ jsx10("input", { type: "checkbox", checked: controls.sections.includes(section.id), onChange: (e) => changeControls({ ...controls, sections: e.target.checked ? [...controls.sections, section.id] : controls.sections.filter((id) => id !== section.id) }) }),
|
|
1391
|
-
" ",
|
|
1392
|
-
section.label
|
|
1393
|
-
] }, section.id))
|
|
1394
|
-
] }) : null,
|
|
1395
|
-
/* @__PURE__ */ jsxs6("div", { className: "matrx-alchemy-coverage", children: [
|
|
1396
|
-
/* @__PURE__ */ jsxs6("span", { children: [
|
|
1397
|
-
state.snapshot.coverage.included.toLocaleString(),
|
|
1398
|
-
" included",
|
|
1399
|
-
state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
|
|
1400
|
-
" \xB7 ",
|
|
1401
|
-
state.snapshot.coverage.status
|
|
1353
|
+
}, children: "Reset" }),
|
|
1354
|
+
/* @__PURE__ */ jsx10(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
|
|
1402
1355
|
] }),
|
|
1403
|
-
state.
|
|
1404
|
-
|
|
1405
|
-
"
|
|
1406
|
-
|
|
1356
|
+
controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ jsxs5("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1357
|
+
/* @__PURE__ */ jsx10("legend", { children: "JSON limits" }),
|
|
1358
|
+
[["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ jsxs5("label", { children: [
|
|
1359
|
+
text,
|
|
1360
|
+
/* @__PURE__ */ jsx10("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
1361
|
+
] }, key))
|
|
1407
1362
|
] }) : null,
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1363
|
+
rows ? /* @__PURE__ */ jsx10(RowControls, { rows, controls, change: changeControls }) : null,
|
|
1364
|
+
state.snapshot.sections.length ? /* @__PURE__ */ jsxs5("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1365
|
+
/* @__PURE__ */ jsx10("legend", { children: "Sections" }),
|
|
1366
|
+
state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs5("label", { children: [
|
|
1367
|
+
/* @__PURE__ */ jsx10("input", { type: "checkbox", checked: controls.sections.includes(section.id), onChange: (e) => changeControls({ ...controls, sections: e.target.checked ? [...controls.sections, section.id] : controls.sections.filter((id) => id !== section.id) }) }),
|
|
1368
|
+
" ",
|
|
1369
|
+
section.label
|
|
1370
|
+
] }, section.id))
|
|
1371
|
+
] }) : null,
|
|
1372
|
+
/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-coverage", children: [
|
|
1373
|
+
/* @__PURE__ */ jsxs5("span", { children: [
|
|
1374
|
+
state.snapshot.coverage.included.toLocaleString(),
|
|
1375
|
+
" included",
|
|
1376
|
+
state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
|
|
1377
|
+
" \xB7 ",
|
|
1378
|
+
state.snapshot.coverage.status
|
|
1412
1379
|
] }),
|
|
1413
|
-
/* @__PURE__ */ jsx10("
|
|
1414
|
-
|
|
1415
|
-
": ",
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1380
|
+
state.snapshot.coverage.reason ? /* @__PURE__ */ jsx10("span", { children: state.snapshot.coverage.reason }) : null,
|
|
1381
|
+
limitText ? /* @__PURE__ */ jsxs5("span", { children: [
|
|
1382
|
+
"Limits: ",
|
|
1383
|
+
limitText
|
|
1384
|
+
] }) : null,
|
|
1385
|
+
displayedOmissions.length ? /* @__PURE__ */ jsxs5("details", { children: [
|
|
1386
|
+
/* @__PURE__ */ jsxs5("summary", { children: [
|
|
1387
|
+
displayedOmissions.length,
|
|
1388
|
+
" omissions or adjustments"
|
|
1389
|
+
] }),
|
|
1390
|
+
/* @__PURE__ */ jsx10("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ jsxs5("li", { children: [
|
|
1391
|
+
o.path || "/",
|
|
1392
|
+
": ",
|
|
1393
|
+
o.reason,
|
|
1394
|
+
o.count == null ? "" : ` (${o.count})`
|
|
1395
|
+
] }, `${o.path}-${o.reason}-${i}`)) })
|
|
1396
|
+
] }) : null
|
|
1397
|
+
] }),
|
|
1398
|
+
/* @__PURE__ */ jsxs5("label", { className: "matrx-alchemy-preview-label", children: [
|
|
1399
|
+
"Output format",
|
|
1400
|
+
/* @__PURE__ */ jsxs5("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
|
|
1401
|
+
formats.map((f) => /* @__PURE__ */ jsx10("option", { value: f, children: LABEL[f] }, f)),
|
|
1402
|
+
state.draft.payload.kind === "rows" ? /* @__PURE__ */ jsx10("option", { value: "xlsx", children: "Excel workbook" }) : null,
|
|
1403
|
+
workspaceAdapters.map((adapter) => /* @__PURE__ */ jsx10("option", { value: adapter.id, children: adapter.label }, adapter.id))
|
|
1404
|
+
] })
|
|
1405
|
+
] }),
|
|
1406
|
+
/* @__PURE__ */ jsx10("textarea", { className: "matrx-alchemy-preview", "aria-label": "Prepared output", "aria-invalid": bufferError ? true : void 0, "aria-describedby": bufferError ? "alchemy-buffer-error" : void 0, value: buffer, onChange: (e) => editBuffer(e.target.value) }),
|
|
1407
|
+
bufferError ? /* @__PURE__ */ jsx10("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
|
|
1408
|
+
formatError ? /* @__PURE__ */ jsx10("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
|
|
1409
|
+
bufferError ? /* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
|
|
1410
|
+
const fallback = editDraft(state.draft, { kind: "text", text: buffer });
|
|
1411
|
+
setBufferError(null);
|
|
1412
|
+
onChange({ ...state, draft: fallback, error: void 0 });
|
|
1413
|
+
setFormat("plain");
|
|
1414
|
+
}, children: "Use invalid JSON as plain text" }) : null
|
|
1428
1415
|
] }),
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1416
|
+
ai || busy === "capture" || state.error ? /* @__PURE__ */ jsxs5("aside", { children: [
|
|
1417
|
+
ai ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1418
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1419
|
+
"AI instruction",
|
|
1420
|
+
/* @__PURE__ */ jsx10("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
|
|
1421
|
+
] }),
|
|
1422
|
+
/* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: !aiSession.current || !instruction.trim() || busy !== null || !aiSession.current.supports(state.snapshot), onClick: () => void runAi(false), children: "Generate preview" }),
|
|
1423
|
+
busy === "ai" ? /* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
|
|
1424
|
+
] }) : null,
|
|
1425
|
+
busy === "capture" ? /* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
|
|
1426
|
+
activeCapture.current?.abort();
|
|
1427
|
+
activeCapture.current = null;
|
|
1428
|
+
setBusy(null);
|
|
1429
|
+
}, children: "Stop loading rows" }) : null,
|
|
1430
|
+
ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
|
|
1431
|
+
ai ? /* @__PURE__ */ jsx10("p", { className: "matrx-alchemy-meta", children: "AI updates the preview; copy it when you are ready. Closing this window lets the AI run continue." }) : null,
|
|
1432
|
+
state.error ? /* @__PURE__ */ jsx10("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
|
|
1433
|
+
] }) : null
|
|
1438
1434
|
] }),
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
setBusy(null);
|
|
1452
|
-
}, children: "Stop loading rows" }) : null,
|
|
1453
|
-
ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
|
|
1454
|
-
ai ? /* @__PURE__ */ jsx10("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
|
|
1455
|
-
state.error ? /* @__PURE__ */ jsx10("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
|
|
1456
|
-
] }) : null
|
|
1435
|
+
pendingControls ? /* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
1436
|
+
/* @__PURE__ */ jsx10("p", { children: "This control would replace your manual edit." }),
|
|
1437
|
+
/* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
|
|
1438
|
+
/* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
|
|
1439
|
+
] }) : null,
|
|
1440
|
+
state.sourceStale ? /* @__PURE__ */ jsx10("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
|
|
1441
|
+
state.pending ? /* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
1442
|
+
/* @__PURE__ */ jsx10("p", { children: "A fresh source snapshot is ready." }),
|
|
1443
|
+
/* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
|
|
1444
|
+
/* @__PURE__ */ jsx10(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
|
|
1445
|
+
] }) : null,
|
|
1446
|
+
deliveryNotice ? /* @__PURE__ */ jsx10("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
|
|
1457
1447
|
] }),
|
|
1458
|
-
|
|
1459
|
-
/* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
|
|
1461
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
|
|
1462
|
-
] }) : null,
|
|
1463
|
-
state.sourceStale ? /* @__PURE__ */ jsx10("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
|
|
1464
|
-
state.pending ? /* @__PURE__ */ jsxs6("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
1465
|
-
/* @__PURE__ */ jsx10("p", { children: "A fresh source snapshot is ready." }),
|
|
1466
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
|
|
1467
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
|
|
1468
|
-
] }) : null,
|
|
1469
|
-
deliveryNotice ? /* @__PURE__ */ jsx10("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
|
|
1470
|
-
/* @__PURE__ */ jsxs6(DialogFooter, { children: [
|
|
1471
|
-
/* @__PURE__ */ jsxs6("span", { className: "matrx-alchemy-meta", children: [
|
|
1448
|
+
/* @__PURE__ */ jsxs5(DialogFooter, { children: [
|
|
1449
|
+
/* @__PURE__ */ jsxs5("span", { className: "matrx-alchemy-meta", children: [
|
|
1472
1450
|
buffer.length.toLocaleString(),
|
|
1473
1451
|
" characters \xB7 ~",
|
|
1474
1452
|
estimateTokens(buffer).toLocaleString(),
|
|
1475
1453
|
" tokens"
|
|
1476
1454
|
] }),
|
|
1477
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
|
|
1478
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download
|
|
1479
|
-
/* @__PURE__ */ jsx10(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy
|
|
1455
|
+
/* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
|
|
1456
|
+
/* @__PURE__ */ jsx10(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", "aria-label": "Download prepared output", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download" }),
|
|
1457
|
+
/* @__PURE__ */ jsx10(Button, { type: "button", className: "matrx-alchemy-workspace-primary", "aria-label": "Copy prepared output", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy" })
|
|
1480
1458
|
] })
|
|
1481
1459
|
] }) });
|
|
1482
1460
|
}
|
|
1483
1461
|
function RowControls({ rows, controls, change }) {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1462
|
+
const filterCount = Object.values(controls.filters).filter(Boolean).length;
|
|
1463
|
+
const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
|
|
1464
|
+
const dataSummary = [controls.search ? "search active" : "", controls.sort ? `sorted by ${rows.columns.find((column) => column.id === controls.sort)?.label ?? controls.sort}` : "", filterCount ? `${filterCount} filter${filterCount === 1 ? "" : "s"}` : ""].filter(Boolean).join(" \xB7 ");
|
|
1465
|
+
return /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1466
|
+
/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-toolbar", children: [
|
|
1467
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1487
1468
|
"Search",
|
|
1488
1469
|
/* @__PURE__ */ jsx10("input", { value: controls.search, onChange: (e) => change({ ...controls, search: e.target.value }) })
|
|
1489
1470
|
] }),
|
|
1490
|
-
/* @__PURE__ */
|
|
1471
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1491
1472
|
"Sort",
|
|
1492
|
-
/* @__PURE__ */
|
|
1473
|
+
/* @__PURE__ */ jsxs5("select", { value: controls.sort, onChange: (e) => change({ ...controls, sort: e.target.value }), children: [
|
|
1493
1474
|
/* @__PURE__ */ jsx10("option", { value: "", children: "None" }),
|
|
1494
1475
|
rows.columns.map((column) => /* @__PURE__ */ jsx10("option", { value: column.id, children: column.label }, column.id))
|
|
1495
1476
|
] })
|
|
1496
1477
|
] }),
|
|
1497
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1498
1479
|
"Direction",
|
|
1499
|
-
/* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ jsxs5("select", { value: controls.direction, disabled: !controls.sort, onChange: (e) => change({ ...controls, direction: e.target.value }), children: [
|
|
1500
1481
|
/* @__PURE__ */ jsx10("option", { value: "asc", children: "Ascending" }),
|
|
1501
1482
|
/* @__PURE__ */ jsx10("option", { value: "desc", children: "Descending" })
|
|
1502
1483
|
] })
|
|
1503
1484
|
] }),
|
|
1504
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1505
1486
|
"Top rows",
|
|
1506
1487
|
/* @__PURE__ */ jsx10("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
1507
1488
|
] })
|
|
1508
1489
|
] }),
|
|
1509
|
-
/* @__PURE__ */
|
|
1510
|
-
/* @__PURE__ */
|
|
1511
|
-
|
|
1512
|
-
|
|
1490
|
+
/* @__PURE__ */ jsxs5("details", { className: "matrx-alchemy-options", children: [
|
|
1491
|
+
/* @__PURE__ */ jsxs5("summary", { children: [
|
|
1492
|
+
"Columns and filters",
|
|
1493
|
+
dataSummary ? ` \u2014 ${dataSummary}` : ""
|
|
1494
|
+
] }),
|
|
1495
|
+
/* @__PURE__ */ jsx10("fieldset", { "aria-label": "Columns and filters", children: rows.columns.map((column) => /* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-column", children: [
|
|
1496
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1513
1497
|
/* @__PURE__ */ jsx10("input", { type: "checkbox", checked: controls.visibleColumns.includes(column.id), onChange: (e) => change({ ...controls, visibleColumns: e.target.checked ? [...controls.visibleColumns, column.id] : controls.visibleColumns.filter((id) => id !== column.id) }) }),
|
|
1514
1498
|
" ",
|
|
1515
1499
|
column.label
|
|
1516
1500
|
] }),
|
|
1517
1501
|
/* @__PURE__ */ jsx10("input", { "aria-label": `Filter ${column.label}`, placeholder: "Filter", value: controls.filters[column.id] ?? "", onChange: (e) => change({ ...controls, filters: { ...controls.filters, [column.id]: e.target.value } }) })
|
|
1518
|
-
] }, column.id))
|
|
1502
|
+
] }, column.id)) })
|
|
1519
1503
|
] }),
|
|
1520
|
-
/* @__PURE__ */
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
" Only selected rows"
|
|
1504
|
+
/* @__PURE__ */ jsxs5("details", { className: "matrx-alchemy-options", children: [
|
|
1505
|
+
/* @__PURE__ */ jsxs5("summary", { children: [
|
|
1506
|
+
"Rows \u2014 ",
|
|
1507
|
+
selectionSummary
|
|
1525
1508
|
] }),
|
|
1526
|
-
/* @__PURE__ */
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
summary
|
|
1533
|
-
|
|
1534
|
-
|
|
1509
|
+
/* @__PURE__ */ jsxs5("fieldset", { "aria-label": "Row selection", children: [
|
|
1510
|
+
/* @__PURE__ */ jsxs5("label", { children: [
|
|
1511
|
+
/* @__PURE__ */ jsx10("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
|
|
1512
|
+
" Only selected rows"
|
|
1513
|
+
] }),
|
|
1514
|
+
/* @__PURE__ */ jsx10("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
|
|
1515
|
+
const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String(readTransferCell(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
|
|
1516
|
+
return /* @__PURE__ */ jsxs5("label", { children: [
|
|
1517
|
+
/* @__PURE__ */ jsx10("input", { type: "checkbox", checked: controls.selectedIndices.includes(index), onChange: (e) => change({ ...controls, selectedIndices: e.target.checked ? [...controls.selectedIndices, index] : controls.selectedIndices.filter((value) => value !== index) }) }),
|
|
1518
|
+
" Row ",
|
|
1519
|
+
index + 1,
|
|
1520
|
+
summary ? ` \u2014 ${summary}` : ""
|
|
1521
|
+
] }, index);
|
|
1522
|
+
}) })
|
|
1523
|
+
] })
|
|
1535
1524
|
] })
|
|
1536
1525
|
] });
|
|
1537
1526
|
}
|
|
1538
1527
|
|
|
1539
1528
|
// src/content-transfer/matrx-copy.tsx
|
|
1540
|
-
import { Fragment as Fragment2, jsx as jsx11, jsxs as
|
|
1529
|
+
import { Fragment as Fragment2, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1541
1530
|
var resolve = (value) => typeof value === "function" ? value() : value;
|
|
1542
1531
|
var asPayload = (value) => ({
|
|
1543
1532
|
kind: "markdown",
|
|
@@ -1683,7 +1672,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1683
1672
|
if (aiVisible && props.aiCustom)
|
|
1684
1673
|
actions.push({
|
|
1685
1674
|
id: "configure-source",
|
|
1686
|
-
label: props.aiCustom.label ?? "Customize source
|
|
1675
|
+
label: props.aiCustom.label ?? "Customize source",
|
|
1687
1676
|
...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
|
|
1688
1677
|
supports: () => true,
|
|
1689
1678
|
run: async () => {
|
|
@@ -1694,7 +1683,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1694
1683
|
if (aiVisible && props.groomer)
|
|
1695
1684
|
actions.push({
|
|
1696
1685
|
id: "groom-source",
|
|
1697
|
-
label: "Customize sections
|
|
1686
|
+
label: "Customize sections",
|
|
1698
1687
|
supports: () => true,
|
|
1699
1688
|
run: async () => {
|
|
1700
1689
|
setConfiguration({ groomer: props.groomer() });
|
|
@@ -1708,6 +1697,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1708
1697
|
label: item.label,
|
|
1709
1698
|
supports: () => true,
|
|
1710
1699
|
...item.build && !item.onSelect ? {
|
|
1700
|
+
placement: "download",
|
|
1711
1701
|
source: make(
|
|
1712
1702
|
`export:${item.id}`,
|
|
1713
1703
|
async () => {
|
|
@@ -1779,7 +1769,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1779
1769
|
const source = (props.primarySource === "table" ? table : void 0) ?? json ?? table ?? structuredAgent ?? human ?? builderVariants[0]?.source;
|
|
1780
1770
|
if (!source && !actions.length) return null;
|
|
1781
1771
|
const target = source ?? make("actions", () => ({ kind: "text", text: props.label }));
|
|
1782
|
-
return /* @__PURE__ */
|
|
1772
|
+
return /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1783
1773
|
/* @__PURE__ */ jsx11(
|
|
1784
1774
|
ContentTransferMenu,
|
|
1785
1775
|
{
|
|
@@ -1788,10 +1778,11 @@ function MatrxCopyMenuSession(props) {
|
|
|
1788
1778
|
label: props.label,
|
|
1789
1779
|
variants,
|
|
1790
1780
|
actions,
|
|
1781
|
+
sourceFormats: Boolean(source),
|
|
1791
1782
|
hide: [
|
|
1792
1783
|
...!copyVisible || !source ? ["copy"] : [],
|
|
1793
1784
|
...!aiVisible || !source ? ["prepare"] : [],
|
|
1794
|
-
...!exportVisible
|
|
1785
|
+
...!exportVisible ? ["download"] : []
|
|
1795
1786
|
],
|
|
1796
1787
|
formatSources: {
|
|
1797
1788
|
...human ? { plain: human, markdown: humanMarkdown, html: humanMarkdown } : {},
|
|
@@ -1802,7 +1793,8 @@ function MatrxCopyMenuSession(props) {
|
|
|
1802
1793
|
className: cn(
|
|
1803
1794
|
props.className,
|
|
1804
1795
|
props.size === "xs" && "matrx-alchemy-xs",
|
|
1805
|
-
props.size === "sm" && "matrx-alchemy-sm"
|
|
1796
|
+
props.size === "sm" && "matrx-alchemy-sm",
|
|
1797
|
+
props.size === "toolbar" && "matrx-alchemy-toolbar-target"
|
|
1806
1798
|
),
|
|
1807
1799
|
...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
|
|
1808
1800
|
}
|
|
@@ -1900,134 +1892,139 @@ function SourceConfiguration({
|
|
|
1900
1892
|
onOpenChange: (open) => {
|
|
1901
1893
|
if (!open && !busy) onClose();
|
|
1902
1894
|
},
|
|
1903
|
-
children: /* @__PURE__ */
|
|
1895
|
+
children: /* @__PURE__ */ jsxs6(
|
|
1904
1896
|
DialogContent,
|
|
1905
1897
|
{
|
|
1906
1898
|
onCloseAutoFocus: (event) => {
|
|
1907
1899
|
event.preventDefault();
|
|
1908
1900
|
if (!handingOff.current) restoreFocus();
|
|
1909
1901
|
},
|
|
1910
|
-
className: "matrx-alchemy-workspace",
|
|
1902
|
+
className: "matrx-alchemy-workspace matrx-alchemy-configuration",
|
|
1911
1903
|
children: [
|
|
1912
|
-
/* @__PURE__ */
|
|
1904
|
+
/* @__PURE__ */ jsxs6(DialogHeader, { children: [
|
|
1913
1905
|
/* @__PURE__ */ jsx11(DialogTitle, { children: title }),
|
|
1914
1906
|
/* @__PURE__ */ jsx11(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
|
|
1915
1907
|
] }),
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
|
|
1918
|
-
option
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
"
|
|
1922
|
-
{
|
|
1923
|
-
type: "checkbox",
|
|
1924
|
-
checked: Boolean(values[option.key]),
|
|
1925
|
-
onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
|
|
1926
|
-
}
|
|
1927
|
-
) : option.kind === "preset" ? /* @__PURE__ */ jsx11(
|
|
1928
|
-
"select",
|
|
1929
|
-
{
|
|
1930
|
-
value: Number(values[option.key]),
|
|
1931
|
-
onChange: (event) => setValues({
|
|
1932
|
-
...values,
|
|
1933
|
-
[option.key]: Number(event.target.value)
|
|
1934
|
-
}),
|
|
1935
|
-
children: option.options.map((choice) => /* @__PURE__ */ jsx11("option", { value: choice.value, children: choice.label }, choice.value))
|
|
1936
|
-
}
|
|
1937
|
-
) : option.kind === "slider" ? /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1938
|
-
/* @__PURE__ */ jsx11(
|
|
1908
|
+
/* @__PURE__ */ jsxs6("div", { className: "matrx-alchemy-workspace-body", children: [
|
|
1909
|
+
/* @__PURE__ */ jsxs6("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
|
|
1910
|
+
custom?.options.map((option) => /* @__PURE__ */ jsxs6("label", { children: [
|
|
1911
|
+
option.label,
|
|
1912
|
+
"hint" in option && option.hint ? /* @__PURE__ */ jsx11("small", { children: option.hint }) : null,
|
|
1913
|
+
option.kind === "toggle" ? /* @__PURE__ */ jsx11(
|
|
1939
1914
|
"input",
|
|
1940
1915
|
{
|
|
1941
|
-
type: "
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
step: 1,
|
|
1945
|
-
value: option.stops.indexOf(Number(values[option.key])),
|
|
1946
|
-
onChange: (event) => setValues({
|
|
1947
|
-
...values,
|
|
1948
|
-
[option.key]: option.stops[Number(event.target.value)]
|
|
1949
|
-
})
|
|
1916
|
+
type: "checkbox",
|
|
1917
|
+
checked: Boolean(values[option.key]),
|
|
1918
|
+
onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
|
|
1950
1919
|
}
|
|
1951
|
-
)
|
|
1952
|
-
|
|
1953
|
-
] }) : /* @__PURE__ */ jsxs7(Fragment2, { children: [
|
|
1954
|
-
/* @__PURE__ */ jsx11(
|
|
1955
|
-
"input",
|
|
1920
|
+
) : option.kind === "preset" ? /* @__PURE__ */ jsx11(
|
|
1921
|
+
"select",
|
|
1956
1922
|
{
|
|
1957
|
-
type: "number",
|
|
1958
|
-
min: option.min,
|
|
1959
|
-
step: option.step,
|
|
1960
1923
|
value: Number(values[option.key]),
|
|
1961
1924
|
onChange: (event) => setValues({
|
|
1962
1925
|
...values,
|
|
1963
1926
|
[option.key]: Number(event.target.value)
|
|
1964
|
-
})
|
|
1927
|
+
}),
|
|
1928
|
+
children: option.options.map((choice) => /* @__PURE__ */ jsx11("option", { value: choice.value, children: choice.label }, choice.value))
|
|
1965
1929
|
}
|
|
1966
|
-
),
|
|
1967
|
-
|
|
1930
|
+
) : option.kind === "slider" ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1931
|
+
/* @__PURE__ */ jsx11(
|
|
1932
|
+
"input",
|
|
1933
|
+
{
|
|
1934
|
+
type: "range",
|
|
1935
|
+
min: 0,
|
|
1936
|
+
max: Math.max(0, option.stops.length - 1),
|
|
1937
|
+
step: 1,
|
|
1938
|
+
value: option.stops.indexOf(Number(values[option.key])),
|
|
1939
|
+
onChange: (event) => setValues({
|
|
1940
|
+
...values,
|
|
1941
|
+
[option.key]: option.stops[Number(event.target.value)]
|
|
1942
|
+
})
|
|
1943
|
+
}
|
|
1944
|
+
),
|
|
1945
|
+
/* @__PURE__ */ jsx11("span", { children: option.formatValue(Number(values[option.key])) })
|
|
1946
|
+
] }) : /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1947
|
+
/* @__PURE__ */ jsx11(
|
|
1948
|
+
"input",
|
|
1949
|
+
{
|
|
1950
|
+
type: "number",
|
|
1951
|
+
min: option.min,
|
|
1952
|
+
step: option.step,
|
|
1953
|
+
value: Number(values[option.key]),
|
|
1954
|
+
onChange: (event) => setValues({
|
|
1955
|
+
...values,
|
|
1956
|
+
[option.key]: Number(event.target.value)
|
|
1957
|
+
})
|
|
1958
|
+
}
|
|
1959
|
+
),
|
|
1960
|
+
option.presets?.map((preset) => /* @__PURE__ */ jsx11(
|
|
1961
|
+
Button,
|
|
1962
|
+
{
|
|
1963
|
+
type: "button",
|
|
1964
|
+
variant: "ghost",
|
|
1965
|
+
className: "matrx-alchemy-workspace-secondary",
|
|
1966
|
+
onClick: () => setValues({ ...values, [option.key]: preset.value }),
|
|
1967
|
+
children: preset.label
|
|
1968
|
+
},
|
|
1969
|
+
preset.value
|
|
1970
|
+
))
|
|
1971
|
+
] })
|
|
1972
|
+
] }, option.key)),
|
|
1973
|
+
groomer ? /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1974
|
+
/* @__PURE__ */ jsx11("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx11(
|
|
1968
1975
|
Button,
|
|
1969
1976
|
{
|
|
1970
1977
|
type: "button",
|
|
1971
1978
|
variant: "ghost",
|
|
1972
|
-
|
|
1973
|
-
|
|
1979
|
+
className: "matrx-alchemy-workspace-secondary",
|
|
1980
|
+
onClick: () => setSections(
|
|
1981
|
+
Object.fromEntries(
|
|
1982
|
+
groomer.sections.map((section) => [
|
|
1983
|
+
section.id,
|
|
1984
|
+
level === "brief" && section.cuttable ? "off" : level
|
|
1985
|
+
])
|
|
1986
|
+
)
|
|
1987
|
+
),
|
|
1988
|
+
children: level
|
|
1974
1989
|
},
|
|
1975
|
-
|
|
1976
|
-
))
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
section.
|
|
1989
|
-
|
|
1990
|
-
]
|
|
1991
|
-
|
|
1990
|
+
level
|
|
1991
|
+
)) }),
|
|
1992
|
+
groomer.sections.map((section) => /* @__PURE__ */ jsxs6("label", { children: [
|
|
1993
|
+
section.title,
|
|
1994
|
+
/* @__PURE__ */ jsxs6(
|
|
1995
|
+
"select",
|
|
1996
|
+
{
|
|
1997
|
+
value: sections[section.id],
|
|
1998
|
+
onChange: (event) => setSections({
|
|
1999
|
+
...sections,
|
|
2000
|
+
[section.id]: event.target.value
|
|
2001
|
+
}),
|
|
2002
|
+
children: [
|
|
2003
|
+
["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx11("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
|
|
2004
|
+
section.cuttable ? /* @__PURE__ */ jsx11("option", { value: "off", children: "Exclude" }) : null
|
|
2005
|
+
]
|
|
2006
|
+
}
|
|
1992
2007
|
),
|
|
1993
|
-
children:
|
|
1994
|
-
},
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
[section.id]: event.target.value
|
|
2006
|
-
}),
|
|
2007
|
-
children: [
|
|
2008
|
-
["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx11("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
|
|
2009
|
-
section.cuttable ? /* @__PURE__ */ jsx11("option", { value: "off", children: "Exclude" }) : null
|
|
2010
|
-
]
|
|
2011
|
-
}
|
|
2012
|
-
),
|
|
2013
|
-
section.description ? /* @__PURE__ */ jsx11("span", { children: section.description }) : null
|
|
2014
|
-
] }, section.id))
|
|
2015
|
-
] }) : null
|
|
2008
|
+
section.description ? /* @__PURE__ */ jsx11("span", { children: section.description }) : null
|
|
2009
|
+
] }, section.id))
|
|
2010
|
+
] }) : null
|
|
2011
|
+
] }),
|
|
2012
|
+
/* @__PURE__ */ jsxs6("p", { children: [
|
|
2013
|
+
text.length.toLocaleString(),
|
|
2014
|
+
" characters \xB7 approximately",
|
|
2015
|
+
" ",
|
|
2016
|
+
Math.ceil(text.length / 4).toLocaleString(),
|
|
2017
|
+
" tokens"
|
|
2018
|
+
] }),
|
|
2019
|
+
error || buildError ? /* @__PURE__ */ jsx11("p", { role: "alert", children: error ?? buildError }) : null
|
|
2016
2020
|
] }),
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
text.length.toLocaleString(),
|
|
2019
|
-
" characters \xB7 approximately",
|
|
2020
|
-
" ",
|
|
2021
|
-
Math.ceil(text.length / 4).toLocaleString(),
|
|
2022
|
-
" tokens"
|
|
2023
|
-
] }),
|
|
2024
|
-
error || buildError ? /* @__PURE__ */ jsx11("p", { role: "alert", children: error ?? buildError }) : null,
|
|
2025
|
-
/* @__PURE__ */ jsxs7(DialogFooter, { children: [
|
|
2021
|
+
/* @__PURE__ */ jsxs6(DialogFooter, { children: [
|
|
2026
2022
|
/* @__PURE__ */ jsx11(
|
|
2027
2023
|
Button,
|
|
2028
2024
|
{
|
|
2029
2025
|
type: "button",
|
|
2030
2026
|
variant: "ghost",
|
|
2027
|
+
className: "matrx-alchemy-workspace-secondary",
|
|
2031
2028
|
disabled: busy,
|
|
2032
2029
|
onClick: onClose,
|
|
2033
2030
|
children: "Cancel"
|
|
@@ -2037,6 +2034,7 @@ function SourceConfiguration({
|
|
|
2037
2034
|
Button,
|
|
2038
2035
|
{
|
|
2039
2036
|
type: "button",
|
|
2037
|
+
className: "matrx-alchemy-workspace-primary",
|
|
2040
2038
|
disabled: busy || !prepared || Boolean(buildError),
|
|
2041
2039
|
onClick: async () => {
|
|
2042
2040
|
if (!prepared) return;
|
|
@@ -2083,7 +2081,7 @@ import {
|
|
|
2083
2081
|
|
|
2084
2082
|
// src/data-table/useTableNotice.tsx
|
|
2085
2083
|
import { useState as useState5 } from "react";
|
|
2086
|
-
import { jsx as jsx13, jsxs as
|
|
2084
|
+
import { jsx as jsx13, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2087
2085
|
function useTableNotice() {
|
|
2088
2086
|
const host = useMatrxDataTableHost();
|
|
2089
2087
|
const [message, setMessage] = useState5(null);
|
|
@@ -2097,7 +2095,7 @@ function useTableNotice() {
|
|
|
2097
2095
|
else setMessage({ text, error: true });
|
|
2098
2096
|
}
|
|
2099
2097
|
};
|
|
2100
|
-
const notice = message ? /* @__PURE__ */
|
|
2098
|
+
const notice = message ? /* @__PURE__ */ jsxs7("span", { role: message.error ? "alert" : "status", className: message.error ? "text-xs text-destructive" : "text-xs text-muted-foreground", children: [
|
|
2101
2099
|
message.text,
|
|
2102
2100
|
/* @__PURE__ */ jsx13("button", { type: "button", "aria-label": "Dismiss notification", className: "ml-2 underline", onClick: () => setMessage(null), children: "Dismiss" })
|
|
2103
2101
|
] }) : null;
|
|
@@ -2131,7 +2129,7 @@ var TooltipContent = React9.forwardRef(({ className, sideOffset = 4, container,
|
|
|
2131
2129
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2132
2130
|
|
|
2133
2131
|
// src/data-table/MatrxUuidCell.tsx
|
|
2134
|
-
import { jsx as jsx15, jsxs as
|
|
2132
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2135
2133
|
var SHORT_LEN = 8;
|
|
2136
2134
|
function shortUuid(id, len = SHORT_LEN) {
|
|
2137
2135
|
return id.slice(0, len);
|
|
@@ -2224,13 +2222,13 @@ function MatrxUuidCell({
|
|
|
2224
2222
|
};
|
|
2225
2223
|
const idNode = (() => {
|
|
2226
2224
|
if (forbidden) {
|
|
2227
|
-
return /* @__PURE__ */
|
|
2225
|
+
return /* @__PURE__ */ jsxs8("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
|
|
2228
2226
|
/* @__PURE__ */ jsx15("span", { className: "min-w-0 truncate", children: display }),
|
|
2229
2227
|
/* @__PURE__ */ jsx15(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
2230
2228
|
] });
|
|
2231
2229
|
}
|
|
2232
2230
|
if (onOpen) {
|
|
2233
|
-
return /* @__PURE__ */
|
|
2231
|
+
return /* @__PURE__ */ jsxs8(
|
|
2234
2232
|
"button",
|
|
2235
2233
|
{
|
|
2236
2234
|
type: "button",
|
|
@@ -2246,7 +2244,7 @@ function MatrxUuidCell({
|
|
|
2246
2244
|
);
|
|
2247
2245
|
}
|
|
2248
2246
|
if (resolvedHref) {
|
|
2249
|
-
return /* @__PURE__ */
|
|
2247
|
+
return /* @__PURE__ */ jsxs8(
|
|
2250
2248
|
"a",
|
|
2251
2249
|
{
|
|
2252
2250
|
href: resolvedHref,
|
|
@@ -2264,7 +2262,7 @@ function MatrxUuidCell({
|
|
|
2264
2262
|
}
|
|
2265
2263
|
return /* @__PURE__ */ jsx15("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
2266
2264
|
})();
|
|
2267
|
-
return /* @__PURE__ */ jsx15(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */
|
|
2265
|
+
return /* @__PURE__ */ jsx15(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs8(
|
|
2268
2266
|
"span",
|
|
2269
2267
|
{
|
|
2270
2268
|
"data-matrx-cell-control": true,
|
|
@@ -2274,11 +2272,11 @@ function MatrxUuidCell({
|
|
|
2274
2272
|
),
|
|
2275
2273
|
onClick: stop,
|
|
2276
2274
|
children: [
|
|
2277
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
2278
2276
|
/* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
2279
2277
|
/* @__PURE__ */ jsx15(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
2280
2278
|
] }),
|
|
2281
|
-
/* @__PURE__ */
|
|
2279
|
+
/* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
2282
2280
|
/* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(
|
|
2283
2281
|
"button",
|
|
2284
2282
|
{
|
|
@@ -2294,7 +2292,7 @@ function MatrxUuidCell({
|
|
|
2294
2292
|
) }),
|
|
2295
2293
|
/* @__PURE__ */ jsx15(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
|
|
2296
2294
|
] }),
|
|
2297
|
-
canPeek ? /* @__PURE__ */
|
|
2295
|
+
canPeek ? /* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
2298
2296
|
/* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(
|
|
2299
2297
|
"button",
|
|
2300
2298
|
{
|
|
@@ -2308,12 +2306,12 @@ function MatrxUuidCell({
|
|
|
2308
2306
|
children: /* @__PURE__ */ jsx15(Lightbulb, { className: "h-3 w-3" })
|
|
2309
2307
|
}
|
|
2310
2308
|
) }),
|
|
2311
|
-
/* @__PURE__ */
|
|
2309
|
+
/* @__PURE__ */ jsxs8(TooltipContent, { side: "top", children: [
|
|
2312
2310
|
"Quick look at ",
|
|
2313
2311
|
label ?? "record"
|
|
2314
2312
|
] })
|
|
2315
2313
|
] }) : null,
|
|
2316
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */
|
|
2314
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsxs8(Tooltip, { children: [
|
|
2317
2315
|
/* @__PURE__ */ jsx15(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx15(
|
|
2318
2316
|
"a",
|
|
2319
2317
|
{
|
|
@@ -2326,7 +2324,7 @@ function MatrxUuidCell({
|
|
|
2326
2324
|
children: /* @__PURE__ */ jsx15(ExternalLink, { className: "h-3 w-3" })
|
|
2327
2325
|
}
|
|
2328
2326
|
) }),
|
|
2329
|
-
/* @__PURE__ */
|
|
2327
|
+
/* @__PURE__ */ jsxs8(TooltipContent, { side: "top", children: [
|
|
2330
2328
|
"Open ",
|
|
2331
2329
|
label ?? "record",
|
|
2332
2330
|
" in a new tab"
|
|
@@ -2354,7 +2352,7 @@ function isUuidValue(value) {
|
|
|
2354
2352
|
}
|
|
2355
2353
|
|
|
2356
2354
|
// src/data-table/DataRowInspector.tsx
|
|
2357
|
-
import { jsx as jsx16, jsxs as
|
|
2355
|
+
import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2358
2356
|
var noFieldToken = () => null;
|
|
2359
2357
|
function formatValue(value) {
|
|
2360
2358
|
if (value == null) return "\u2014";
|
|
@@ -2398,7 +2396,7 @@ function DataRowInspector({
|
|
|
2398
2396
|
})
|
|
2399
2397
|
}
|
|
2400
2398
|
) }) : null;
|
|
2401
|
-
return /* @__PURE__ */
|
|
2399
|
+
return /* @__PURE__ */ jsxs9(
|
|
2402
2400
|
"div",
|
|
2403
2401
|
{
|
|
2404
2402
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
@@ -2406,7 +2404,7 @@ function DataRowInspector({
|
|
|
2406
2404
|
title ? /* @__PURE__ */ jsx16("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
2407
2405
|
/* @__PURE__ */ jsx16("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ jsx16("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
|
|
2408
2406
|
if (isUuidValue(value)) {
|
|
2409
|
-
return /* @__PURE__ */
|
|
2407
|
+
return /* @__PURE__ */ jsxs9(
|
|
2410
2408
|
"div",
|
|
2411
2409
|
{
|
|
2412
2410
|
className: "group/field relative grid grid-cols-[minmax(7rem,9rem)_1fr] gap-2 rounded-md border border-border/60 bg-muted/20 px-2.5 py-2",
|
|
@@ -2427,7 +2425,7 @@ function DataRowInspector({
|
|
|
2427
2425
|
}
|
|
2428
2426
|
const formatted = formatValue(value);
|
|
2429
2427
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
2430
|
-
return /* @__PURE__ */
|
|
2428
|
+
return /* @__PURE__ */ jsxs9(
|
|
2431
2429
|
"div",
|
|
2432
2430
|
{
|
|
2433
2431
|
className: "group/field relative grid grid-cols-[minmax(7rem,9rem)_1fr] gap-2 rounded-md border border-border/60 bg-muted/20 py-2 pl-2.5 pr-12",
|
|
@@ -2455,7 +2453,7 @@ function DataRowInspector({
|
|
|
2455
2453
|
}
|
|
2456
2454
|
|
|
2457
2455
|
// src/data-table/DataRowWindow.tsx
|
|
2458
|
-
import { jsx as jsx17, jsxs as
|
|
2456
|
+
import { jsx as jsx17, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2459
2457
|
function DataRowWindow({
|
|
2460
2458
|
isOpen,
|
|
2461
2459
|
onClose,
|
|
@@ -2497,7 +2495,7 @@ function DataRowWindow({
|
|
|
2497
2495
|
bodyClassName: "flex min-h-0 flex-1 flex-col overflow-hidden p-0",
|
|
2498
2496
|
sidebarDefaultSize: 140,
|
|
2499
2497
|
sidebarMinSize: 110,
|
|
2500
|
-
sidebar: hasTabs ? /* @__PURE__ */
|
|
2498
|
+
sidebar: hasTabs ? /* @__PURE__ */ jsxs10(
|
|
2501
2499
|
"nav",
|
|
2502
2500
|
{
|
|
2503
2501
|
"aria-label": "Row window tabs",
|
|
@@ -2534,7 +2532,7 @@ function TabButton({
|
|
|
2534
2532
|
label,
|
|
2535
2533
|
onClick
|
|
2536
2534
|
}) {
|
|
2537
|
-
return /* @__PURE__ */
|
|
2535
|
+
return /* @__PURE__ */ jsxs10(
|
|
2538
2536
|
"button",
|
|
2539
2537
|
{
|
|
2540
2538
|
type: "button",
|