@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
|
@@ -164,48 +164,6 @@ function XIcon(props) {
|
|
|
164
164
|
/* @__PURE__ */ jsx2("path", { d: "m6 6 12 12" })
|
|
165
165
|
] });
|
|
166
166
|
}
|
|
167
|
-
function radixProps(props) {
|
|
168
|
-
return {
|
|
169
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
170
|
-
viewBox: "0 0 15 15",
|
|
171
|
-
width: 15,
|
|
172
|
-
height: 15,
|
|
173
|
-
fill: "none",
|
|
174
|
-
"aria-hidden": true,
|
|
175
|
-
...props
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function CheckIcon(props) {
|
|
179
|
-
return /* @__PURE__ */ jsx2("svg", { ...radixProps(props), children: /* @__PURE__ */ jsx2(
|
|
180
|
-
"path",
|
|
181
|
-
{
|
|
182
|
-
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",
|
|
183
|
-
fill: "currentColor",
|
|
184
|
-
fillRule: "evenodd",
|
|
185
|
-
clipRule: "evenodd"
|
|
186
|
-
}
|
|
187
|
-
) });
|
|
188
|
-
}
|
|
189
|
-
function DotFilledIcon(props) {
|
|
190
|
-
return /* @__PURE__ */ jsx2("svg", { ...radixProps(props), children: /* @__PURE__ */ jsx2(
|
|
191
|
-
"path",
|
|
192
|
-
{
|
|
193
|
-
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",
|
|
194
|
-
fill: "currentColor"
|
|
195
|
-
}
|
|
196
|
-
) });
|
|
197
|
-
}
|
|
198
|
-
function RadixChevronRightIcon(props) {
|
|
199
|
-
return /* @__PURE__ */ jsx2("svg", { ...radixProps(props), children: /* @__PURE__ */ jsx2(
|
|
200
|
-
"path",
|
|
201
|
-
{
|
|
202
|
-
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",
|
|
203
|
-
fill: "currentColor",
|
|
204
|
-
fillRule: "evenodd",
|
|
205
|
-
clipRule: "evenodd"
|
|
206
|
-
}
|
|
207
|
-
) });
|
|
208
|
-
}
|
|
209
167
|
|
|
210
168
|
// src/portal-container.tsx
|
|
211
169
|
import * as React2 from "react";
|
|
@@ -469,154 +427,123 @@ var DialogDescription = React5.forwardRef(({ className, ...props }, ref) => /* @
|
|
|
469
427
|
));
|
|
470
428
|
DialogDescription.displayName = DialogPrimitive.Description.displayName;
|
|
471
429
|
|
|
472
|
-
// src/
|
|
473
|
-
import * as
|
|
430
|
+
// src/popover.tsx
|
|
431
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
474
432
|
import * as React6 from "react";
|
|
475
|
-
import { jsx as jsx6
|
|
476
|
-
var
|
|
477
|
-
var
|
|
478
|
-
var
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
"data-slot": "dropdown-menu-sub-trigger",
|
|
486
|
-
className: cn(
|
|
487
|
-
"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",
|
|
488
|
-
inset && "pl-8",
|
|
489
|
-
className
|
|
490
|
-
),
|
|
491
|
-
...props,
|
|
492
|
-
children: [
|
|
493
|
-
children,
|
|
494
|
-
/* @__PURE__ */ jsx6(RadixChevronRightIcon, { className: "ml-auto h-4 w-4" })
|
|
495
|
-
]
|
|
496
|
-
}
|
|
497
|
-
));
|
|
498
|
-
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
499
|
-
var DropdownMenuSubContent = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
500
|
-
DropdownMenuPrimitive.SubContent,
|
|
501
|
-
{
|
|
502
|
-
ref,
|
|
503
|
-
"data-slot": "dropdown-menu-sub-content",
|
|
504
|
-
className: cn(MENU_SURFACE_CLASS, "shadow-lg", MOTION_POPPER, className),
|
|
505
|
-
...props
|
|
506
|
-
}
|
|
507
|
-
));
|
|
508
|
-
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
509
|
-
var DropdownMenuContent = React6.forwardRef(({ className, sideOffset = 4, container, ...props }, ref) => {
|
|
510
|
-
const portalContainer = usePortalContainer(container);
|
|
511
|
-
return /* @__PURE__ */ jsx6(DropdownMenuPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx6(
|
|
512
|
-
DropdownMenuPrimitive.Content,
|
|
513
|
-
{
|
|
514
|
-
ref,
|
|
515
|
-
"data-slot": "dropdown-menu-content",
|
|
516
|
-
sideOffset,
|
|
517
|
-
className: cn(
|
|
518
|
-
MENU_SURFACE_CLASS,
|
|
519
|
-
"shadow-md",
|
|
520
|
-
MOTION_POPPER,
|
|
521
|
-
className
|
|
522
|
-
),
|
|
523
|
-
...props
|
|
524
|
-
}
|
|
525
|
-
) });
|
|
526
|
-
});
|
|
527
|
-
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
528
|
-
var DropdownMenuItem = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
529
|
-
DropdownMenuPrimitive.Item,
|
|
530
|
-
{
|
|
531
|
-
ref,
|
|
532
|
-
"data-slot": "dropdown-menu-item",
|
|
533
|
-
className: cn(MENU_ITEM_CLASS, inset && "pl-8", className),
|
|
534
|
-
...props
|
|
535
|
-
}
|
|
536
|
-
));
|
|
537
|
-
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
538
|
-
var DropdownMenuCheckboxItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
539
|
-
DropdownMenuPrimitive.CheckboxItem,
|
|
540
|
-
{
|
|
541
|
-
ref,
|
|
542
|
-
"data-slot": "dropdown-menu-checkbox-item",
|
|
543
|
-
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
544
|
-
...props,
|
|
545
|
-
children: [
|
|
546
|
-
/* @__PURE__ */ jsx6("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx6(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx6(CheckIcon, { className: "h-4 w-4" }) }) }),
|
|
547
|
-
children
|
|
548
|
-
]
|
|
549
|
-
}
|
|
550
|
-
));
|
|
551
|
-
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
552
|
-
var DropdownMenuRadioItem = React6.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs3(
|
|
553
|
-
DropdownMenuPrimitive.RadioItem,
|
|
554
|
-
{
|
|
555
|
-
ref,
|
|
556
|
-
"data-slot": "dropdown-menu-radio-item",
|
|
557
|
-
className: cn(MENU_INDICATOR_ITEM_CLASS, className),
|
|
558
|
-
...props,
|
|
559
|
-
children: [
|
|
560
|
-
/* @__PURE__ */ jsx6("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ jsx6(DropdownMenuPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx6(DotFilledIcon, { className: "h-4 w-4 fill-current" }) }) }),
|
|
561
|
-
children
|
|
562
|
-
]
|
|
563
|
-
}
|
|
564
|
-
));
|
|
565
|
-
DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName;
|
|
566
|
-
var DropdownMenuLabel = React6.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
567
|
-
DropdownMenuPrimitive.Label,
|
|
568
|
-
{
|
|
569
|
-
ref,
|
|
570
|
-
"data-slot": "dropdown-menu-label",
|
|
571
|
-
className: cn("px-2 py-1.5 text-sm font-semibold", inset && "pl-8", className),
|
|
572
|
-
...props
|
|
573
|
-
}
|
|
574
|
-
));
|
|
575
|
-
DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName;
|
|
576
|
-
var DropdownMenuSeparator = React6.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx6(
|
|
577
|
-
DropdownMenuPrimitive.Separator,
|
|
578
|
-
{
|
|
579
|
-
ref,
|
|
580
|
-
"data-slot": "dropdown-menu-separator",
|
|
581
|
-
className: cn("-mx-1 my-1 h-px bg-muted", className),
|
|
582
|
-
...props
|
|
583
|
-
}
|
|
584
|
-
));
|
|
585
|
-
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName;
|
|
586
|
-
var DropdownMenuShortcut = ({
|
|
587
|
-
className,
|
|
588
|
-
...props
|
|
589
|
-
}) => /* @__PURE__ */ jsx6(
|
|
590
|
-
"span",
|
|
591
|
-
{
|
|
592
|
-
"data-slot": "dropdown-menu-shortcut",
|
|
593
|
-
className: cn("ml-auto text-xs tracking-widest opacity-60", className),
|
|
433
|
+
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
434
|
+
var Popover = PopoverPrimitive.Root;
|
|
435
|
+
var PopoverTrigger = PopoverPrimitive.Trigger;
|
|
436
|
+
var PopoverContent = React6.forwardRef(
|
|
437
|
+
({
|
|
438
|
+
className,
|
|
439
|
+
align = "center",
|
|
440
|
+
sideOffset = 4,
|
|
441
|
+
container,
|
|
442
|
+
animated = true,
|
|
594
443
|
...props
|
|
444
|
+
}, ref) => {
|
|
445
|
+
const portalContainer = usePortalContainer(container);
|
|
446
|
+
return /* @__PURE__ */ jsx6(PopoverPrimitive.Portal, { container: portalContainer, children: /* @__PURE__ */ jsx6(
|
|
447
|
+
PopoverPrimitive.Content,
|
|
448
|
+
{
|
|
449
|
+
ref,
|
|
450
|
+
align,
|
|
451
|
+
sideOffset,
|
|
452
|
+
className: cn(
|
|
453
|
+
// Cap to the viewport space Radix measured and scroll — a popover taller
|
|
454
|
+
// than the screen must never trap the user with unreachable content.
|
|
455
|
+
// z must EQUAL the dialog layer (z-[10000]), never exceed it: with equal
|
|
456
|
+
// z, DOM portal order decides, so a dialog opened FROM a popover stacks
|
|
457
|
+
// above it, and a popover opened from a dialog still stacks above the
|
|
458
|
+
// dialog. z-[10001] buried dialogs behind fullscreen popovers.
|
|
459
|
+
"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",
|
|
460
|
+
animated && MOTION_POPPER,
|
|
461
|
+
className
|
|
462
|
+
),
|
|
463
|
+
...props
|
|
464
|
+
}
|
|
465
|
+
) });
|
|
595
466
|
}
|
|
596
467
|
);
|
|
597
|
-
|
|
468
|
+
PopoverContent.displayName = PopoverPrimitive.Content.displayName;
|
|
469
|
+
|
|
470
|
+
// src/content-transfer/icon.ts
|
|
471
|
+
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"];
|
|
472
|
+
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>`;
|
|
598
473
|
|
|
599
474
|
// src/content-transfer/index.tsx
|
|
600
|
-
import { Fragment, jsx as jsx7, jsxs as
|
|
475
|
+
import { Fragment, jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
601
476
|
function AlchemyGlyph(props) {
|
|
602
|
-
return /* @__PURE__ */
|
|
603
|
-
/* @__PURE__ */ jsx7("path", { d: "M4.5 5.5h8v11h-8z" }),
|
|
604
|
-
/* @__PURE__ */ jsx7("path", { d: "M8.5 9.5h8v9h-8z" }),
|
|
605
|
-
/* @__PURE__ */ jsx7("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
|
|
606
|
-
] });
|
|
477
|
+
return /* @__PURE__ */ jsx7("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__ */ jsx7("path", { d }, d)) });
|
|
607
478
|
}
|
|
608
479
|
var CapabilityContext = React7.createContext({});
|
|
609
480
|
var useContentTransferCapabilities = () => React7.useContext(CapabilityContext);
|
|
610
481
|
var SurfaceContext = React7.createContext(null);
|
|
611
482
|
function MenuPresentation({ label, hint, icon: Icon2 }) {
|
|
612
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
613
484
|
Icon2 ? /* @__PURE__ */ jsx7(Icon2, { className: "matrx-alchemy-menu-icon" }) : null,
|
|
614
|
-
/* @__PURE__ */
|
|
485
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
615
486
|
label,
|
|
616
487
|
hint ? /* @__PURE__ */ jsx7("small", { className: "matrx-alchemy-menu-hint", children: hint }) : null
|
|
617
488
|
] })
|
|
618
489
|
] });
|
|
619
490
|
}
|
|
491
|
+
function PaletteGlyph({ format, ai = false, file = false, kind }) {
|
|
492
|
+
if (kind === "ai-copy") return /* @__PURE__ */ jsxs3("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: [
|
|
493
|
+
/* @__PURE__ */ jsx7("rect", { x: "5", y: "5", width: "11", height: "14", rx: "2" }),
|
|
494
|
+
/* @__PURE__ */ jsx7("path", { d: "M9 3h6a2 2 0 0 1 2 2v10" }),
|
|
495
|
+
/* @__PURE__ */ jsx7("path", { d: "m18.5 3 .55 1.45L20.5 5l-1.45.55L18.5 7l-.55-1.45L16.5 5l1.45-.55z" })
|
|
496
|
+
] });
|
|
497
|
+
if (kind === "sliders") return /* @__PURE__ */ jsxs3("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: [
|
|
498
|
+
/* @__PURE__ */ jsx7("path", { d: "M4 6h16M4 12h16M4 18h16" }),
|
|
499
|
+
/* @__PURE__ */ jsx7("path", { d: "M8 3v6M16 9v6M10 15v6" })
|
|
500
|
+
] });
|
|
501
|
+
if (ai) return /* @__PURE__ */ jsxs3("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: [
|
|
502
|
+
/* @__PURE__ */ jsx7("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" }),
|
|
503
|
+
/* @__PURE__ */ jsx7("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" }),
|
|
504
|
+
/* @__PURE__ */ jsx7("path", { d: "M12 5v14M8 9h1M15 9h1M8 15h1M15 15h1" })
|
|
505
|
+
] });
|
|
506
|
+
if (file) return /* @__PURE__ */ jsxs3("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: [
|
|
507
|
+
/* @__PURE__ */ jsx7("path", { d: "M6 3h8l4 4v14H6z" }),
|
|
508
|
+
/* @__PURE__ */ jsx7("path", { d: "M14 3v5h5M9 13h6M9 17h6" })
|
|
509
|
+
] });
|
|
510
|
+
const path = format === "json" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
511
|
+
/* @__PURE__ */ jsx7("path", { d: "M9 4C7 4 7 7 5 7v3c2 0 2 1 2 2s0 2-2 2v3c2 0 2 3 4 3" }),
|
|
512
|
+
/* @__PURE__ */ jsx7("path", { d: "M15 4c2 0 2 3 4 3v3c-2 0-2 1-2 2s0 2 2 2v3c-2 0-2 3-4 3" })
|
|
513
|
+
] }) : format === "compact-json" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
514
|
+
/* @__PURE__ */ jsx7("path", { d: "m14 10 7-7" }),
|
|
515
|
+
/* @__PURE__ */ jsx7("path", { d: "M20 10h-6V4" }),
|
|
516
|
+
/* @__PURE__ */ jsx7("path", { d: "m3 21 7-7" }),
|
|
517
|
+
/* @__PURE__ */ jsx7("path", { d: "M4 14h6v6" })
|
|
518
|
+
] }) : format === "csv" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
519
|
+
/* @__PURE__ */ jsx7("rect", { x: "4", y: "4", width: "16", height: "16", rx: "1" }),
|
|
520
|
+
/* @__PURE__ */ jsx7("path", { d: "M4 10h16M10 4v16" })
|
|
521
|
+
] }) : format === "tsv" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
522
|
+
/* @__PURE__ */ jsx7("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
523
|
+
/* @__PURE__ */ jsx7("path", { d: "M14 2v6h6M8 13h2M14 13h2M8 17h2M14 17h2" })
|
|
524
|
+
] }) : format === "xlsx" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
525
|
+
/* @__PURE__ */ jsx7("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
|
|
526
|
+
/* @__PURE__ */ jsx7("path", { d: "M14 2v6h6M8 13h8M8 17h8M12 11v8" })
|
|
527
|
+
] }) : format === "markdown" ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
528
|
+
/* @__PURE__ */ jsx7("path", { d: "M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5z" }),
|
|
529
|
+
/* @__PURE__ */ jsx7("path", { d: "M14 2v6h6M10 13l-2 2 2 2M14 17l2-2-2-2" })
|
|
530
|
+
] }) : format === "html" ? /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M15 6h6M3 6h7M3 12h18M3 18h12" }) }) : /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
|
|
531
|
+
return /* @__PURE__ */ jsx7("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 });
|
|
532
|
+
}
|
|
533
|
+
function PaletteRows({ title, items, onRun, extra, ai = false, glyphKind, fallbackHint }) {
|
|
534
|
+
if (!items.length && !extra) return null;
|
|
535
|
+
return /* @__PURE__ */ jsxs3("section", { className: "matrx-alchemy-palette-section", children: [
|
|
536
|
+
/* @__PURE__ */ jsx7("h3", { children: title }),
|
|
537
|
+
items.map((item) => /* @__PURE__ */ jsxs3("button", { type: "button", className: cn("matrx-alchemy-palette-row", ai && "matrx-alchemy-palette-row-ai"), "aria-label": item.ariaLabel, onClick: () => onRun?.(item), children: [
|
|
538
|
+
item.icon ? /* @__PURE__ */ jsx7(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ jsx7(PaletteGlyph, { ai, ...glyphKind ? { kind: glyphKind } : {} }),
|
|
539
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
540
|
+
item.copyLabel ?? item.label,
|
|
541
|
+
item.hint ?? fallbackHint ? /* @__PURE__ */ jsx7("small", { className: "matrx-alchemy-menu-hint", children: item.hint ?? fallbackHint }) : null
|
|
542
|
+
] })
|
|
543
|
+
] }, item.id)),
|
|
544
|
+
extra
|
|
545
|
+
] });
|
|
546
|
+
}
|
|
620
547
|
var LABEL = { plain: "Plain text", markdown: "Markdown", html: "Formatted", json: "JSON", "compact-json": "Compact JSON", csv: "CSV", tsv: "Google Sheets", xlsx: "Excel workbook" };
|
|
621
548
|
var BUILT_INS = Object.freeze(Object.keys(LABEL).map((id) => ({ id })));
|
|
622
549
|
var COPIES = ["plain", "markdown", "html", "json", "compact-json", "csv", "tsv"];
|
|
@@ -705,7 +632,7 @@ function ContentTransferMenu(props) {
|
|
|
705
632
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
706
633
|
return /* @__PURE__ */ jsx7(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
707
634
|
}
|
|
708
|
-
function ContentTransferMenuSession({ source, surface, label, projection, sections, preferences, table, formatSources, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef }) {
|
|
635
|
+
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 }) {
|
|
709
636
|
const triggerRef = React7.useRef(null);
|
|
710
637
|
const inherited = React7.useContext(CapabilityContext);
|
|
711
638
|
const nearestSurface = React7.useContext(SurfaceContext);
|
|
@@ -718,6 +645,8 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
718
645
|
const workspaceCaptures = React7.useRef(/* @__PURE__ */ new Map());
|
|
719
646
|
const externalWorkspaceKeys = React7.useRef(/* @__PURE__ */ new Set());
|
|
720
647
|
const [notice, setNotice] = React7.useState(null);
|
|
648
|
+
const [paletteOpen, setPaletteOpen] = React7.useState(false);
|
|
649
|
+
const [mode, setMode] = React7.useState("copy");
|
|
721
650
|
const scopes = React7.useMemo(() => table?.availableScopes ?? ["target"], [table]);
|
|
722
651
|
const initialScope = table?.initialScope ?? "target";
|
|
723
652
|
if (!scopes.includes(initialScope)) throw new Error("Alchemy initialScope must be included in availableScopes.");
|
|
@@ -969,48 +898,96 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
|
|
|
969
898
|
}, [captureOne, capturePrimary, fence, initialScope, preferences, providerPreferences, report]);
|
|
970
899
|
if (!enabled) return null;
|
|
971
900
|
const payload = menuCapture?.snapshot.payload ?? (source && "kind" in source ? source : void 0);
|
|
972
|
-
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section)
|
|
973
|
-
const visibleCopies = COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows");
|
|
974
|
-
const visibleDownloads = DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows");
|
|
975
|
-
const visibleAdapters = menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
901
|
+
const quickVariants = (section) => variants.filter((v) => v.copyLabel && (v.section ?? "ai") === section);
|
|
902
|
+
const visibleCopies = sourceFormats ? COPIES.filter((f) => Boolean(formatSources?.[f]) || !["csv", "tsv"].includes(f) || payload?.kind === "rows") : [];
|
|
903
|
+
const visibleDownloads = sourceFormats ? DOWNLOADS.filter((f) => f !== "xlsx" && Boolean(formatSources?.[f]) || !["csv", "tsv", "xlsx"].includes(f) || payload?.kind === "rows") : [];
|
|
904
|
+
const visibleAdapters = sourceFormats && menuCapture ? adapters.filter((a) => a.supports(menuCapture.snapshot.payload)) : [];
|
|
976
905
|
const visibleActions = menuCapture ? registeredActions.filter((a) => a.supports(menuCapture.snapshot)) : [];
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
906
|
+
const downloadActions = visibleActions.filter((action) => action.placement === "download");
|
|
907
|
+
const ordinaryActions = visibleActions.filter((action) => action.placement !== "download");
|
|
908
|
+
const copyAvailable = !hide.includes("copy") && visibleCopies.length + visibleAdapters.length + quickVariants("copy").length > 0;
|
|
909
|
+
const downloadAvailable = !hide.includes("download") && visibleDownloads.length + visibleAdapters.length + downloadActions.length > 0;
|
|
910
|
+
const prepareAvailable = !hide.includes("prepare") && (quickVariants("ai").length > 0 || Boolean(primary) || Boolean(nearestWorkspaceKey) || variants.length > 0);
|
|
911
|
+
const resolvedMode = mode === "copy" && !copyAvailable ? "download" : mode === "download" && !downloadAvailable ? "copy" : mode;
|
|
912
|
+
const closePalette = () => setPaletteOpen(false);
|
|
913
|
+
const tile = (id, label2, onClick, options = {}) => {
|
|
914
|
+
const presentation = options.action;
|
|
915
|
+
const Icon2 = presentation?.icon;
|
|
916
|
+
const fallbackLabel = options.file && !/^download\b/i.test(label2) ? `Download ${label2}` : label2;
|
|
917
|
+
return /* @__PURE__ */ jsxs3("button", { type: "button", className: "matrx-alchemy-palette-tile", "aria-label": presentation?.ariaLabel ?? (presentation ? fallbackLabel : options.ariaLabel ?? `${resolvedMode === "copy" ? "Copy" : "Download"} ${label2}`), onClick: () => {
|
|
918
|
+
closePalette();
|
|
919
|
+
onClick();
|
|
980
920
|
}, children: [
|
|
981
|
-
/* @__PURE__ */ jsx7(
|
|
982
|
-
/* @__PURE__ */
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
921
|
+
Icon2 ? /* @__PURE__ */ jsx7(Icon2, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ jsx7(PaletteGlyph, { ...!options.custom ? { format: id } : {}, ...options.ai ? { ai: true } : {}, ...options.file ? { file: true } : {} }),
|
|
922
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
923
|
+
label2,
|
|
924
|
+
presentation?.hint ? /* @__PURE__ */ jsx7("small", { className: "matrx-alchemy-menu-hint", children: presentation.hint }) : null
|
|
925
|
+
] })
|
|
926
|
+
] }, id);
|
|
927
|
+
};
|
|
928
|
+
return /* @__PURE__ */ jsxs3("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
929
|
+
/* @__PURE__ */ jsxs3(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
930
|
+
setPaletteOpen(open);
|
|
931
|
+
if (open) {
|
|
932
|
+
setMode("copy");
|
|
933
|
+
void preflight();
|
|
934
|
+
}
|
|
935
|
+
}, children: [
|
|
936
|
+
/* @__PURE__ */ jsx7(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx7("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__ */ jsx7(AlchemyGlyph, {}) }) }),
|
|
937
|
+
/* @__PURE__ */ jsxs3(PopoverContent, { align: "end", className: "matrx-alchemy-menu matrx-alchemy-palette", "aria-label": "Alchemy output options", onCloseAutoFocus: () => triggerRef.current?.focus(), children: [
|
|
938
|
+
menuStatus === "loading" ? /* @__PURE__ */ jsx7("p", { className: "matrx-alchemy-palette-status", children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ jsx7("p", { className: "matrx-alchemy-error", children: menuStatus }) : null,
|
|
939
|
+
copyAvailable || downloadAvailable ? /* @__PURE__ */ jsxs3("section", { className: "matrx-alchemy-output", children: [
|
|
940
|
+
/* @__PURE__ */ jsx7("h3", { children: resolvedMode === "copy" ? "Copy as" : "Download as" }),
|
|
941
|
+
copyAvailable && downloadAvailable ? /* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
|
|
942
|
+
/* @__PURE__ */ jsx7("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
|
|
943
|
+
/* @__PURE__ */ jsx7("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
|
|
944
|
+
] }) : null,
|
|
945
|
+
resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
946
|
+
/* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-palette-grid", children: [
|
|
947
|
+
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]}` })),
|
|
948
|
+
visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
|
|
949
|
+
] }),
|
|
950
|
+
quickVariants("copy").length ? /* @__PURE__ */ jsx7(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
|
|
951
|
+
closePalette();
|
|
952
|
+
void transfer("markdown", false, variant);
|
|
953
|
+
} }) : null
|
|
954
|
+
] }) : null,
|
|
955
|
+
resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-palette-grid", children: [
|
|
956
|
+
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]}` })),
|
|
957
|
+
visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
|
|
958
|
+
downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
|
|
959
|
+
] }) }) : null
|
|
999
960
|
] }) : null,
|
|
1000
|
-
|
|
1001
|
-
/* @__PURE__ */ jsx7(
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
961
|
+
prepareAvailable ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
962
|
+
/* @__PURE__ */ jsx7(PaletteRows, { title: "Copy for AI", ai: true, glyphKind: "ai-copy", fallbackHint: "Copies immediately", items: quickVariants("ai"), onRun: (variant) => {
|
|
963
|
+
closePalette();
|
|
964
|
+
void transfer("markdown", false, variant);
|
|
965
|
+
} }),
|
|
966
|
+
/* @__PURE__ */ jsx7(PaletteRows, { title: "Edit and prepare", items: [], extra: /* @__PURE__ */ jsxs3("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": "Prepare for AI", onClick: () => {
|
|
967
|
+
closePalette();
|
|
968
|
+
void openWorkspace();
|
|
969
|
+
}, children: [
|
|
970
|
+
/* @__PURE__ */ jsx7(PaletteGlyph, { kind: "sliders" }),
|
|
971
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
972
|
+
"Prepare for AI",
|
|
973
|
+
/* @__PURE__ */ jsx7("small", { className: "matrx-alchemy-menu-hint", children: "Review and edit before copying" })
|
|
974
|
+
] })
|
|
975
|
+
] }) })
|
|
1011
976
|
] }) : null,
|
|
1012
|
-
|
|
1013
|
-
|
|
977
|
+
prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ jsx7(PaletteRows, { title: "Other sources", items: [], extra: /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
978
|
+
nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ jsx7("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
|
|
979
|
+
closePalette();
|
|
980
|
+
void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
|
|
981
|
+
}, children: /* @__PURE__ */ jsx7("span", { children: "Prepare this surface" }) }) : null,
|
|
982
|
+
variants.map((variant) => /* @__PURE__ */ jsx7("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
|
|
983
|
+
closePalette();
|
|
984
|
+
void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
|
|
985
|
+
}, children: /* @__PURE__ */ jsx7(MenuPresentation, { ...variant, label: `Prepare ${variant.label}` }) }, variant.id))
|
|
986
|
+
] }) }) : null,
|
|
987
|
+
ordinaryActions.length ? /* @__PURE__ */ jsx7(PaletteRows, { title: "Actions", items: [], extra: ordinaryActions.map((action) => /* @__PURE__ */ jsx7("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
|
|
988
|
+
closePalette();
|
|
989
|
+
void runAction(action);
|
|
990
|
+
}, children: /* @__PURE__ */ jsx7(MenuPresentation, { ...action, label: action.label }) }, action.id)) }) : null
|
|
1014
991
|
] })
|
|
1015
992
|
] }),
|
|
1016
993
|
notice ? /* @__PURE__ */ jsx7("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
|
|
@@ -1273,218 +1250,230 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
|
|
|
1273
1250
|
const limitText = Object.entries(state.preferences.limits).filter(([, value]) => value != null).map(([key, value]) => `${key.replace(/^max/, "max ")} ${Number(value).toLocaleString()}`).join(" \xB7 ");
|
|
1274
1251
|
return /* @__PURE__ */ jsx7(Dialog, { open, onOpenChange: (next) => {
|
|
1275
1252
|
if (!next) close();
|
|
1276
|
-
}, children: /* @__PURE__ */
|
|
1253
|
+
}, children: /* @__PURE__ */ jsxs3(DialogContent, { onCloseAutoFocus: (event) => {
|
|
1277
1254
|
event.preventDefault();
|
|
1278
1255
|
restoreFocus();
|
|
1279
1256
|
}, className: "matrx-alchemy-workspace max-w-5xl", "aria-busy": busy !== null, children: [
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1257
|
+
/* @__PURE__ */ jsxs3(DialogHeader, { children: [
|
|
1258
|
+
/* @__PURE__ */ jsxs3(DialogTitle, { children: [
|
|
1282
1259
|
"Prepare ",
|
|
1283
1260
|
state.snapshot.label
|
|
1284
1261
|
] }),
|
|
1285
|
-
/* @__PURE__ */
|
|
1286
|
-
"
|
|
1287
|
-
|
|
1288
|
-
". Your source is never edited."
|
|
1262
|
+
/* @__PURE__ */ jsxs3(DialogDescription, { children: [
|
|
1263
|
+
state.snapshot.unsavedChanges ? "Includes your unsaved changes. " : "",
|
|
1264
|
+
"Review and edit this copy. Your original stays unchanged."
|
|
1289
1265
|
] })
|
|
1290
1266
|
] }),
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
/* @__PURE__ */
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
|
|
1295
|
-
"
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
"
|
|
1300
|
-
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1267
|
+
/* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-workspace-body", children: [
|
|
1268
|
+
/* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-workspace-grid", children: [
|
|
1269
|
+
/* @__PURE__ */ jsxs3("section", { className: "matrx-alchemy-main", children: [
|
|
1270
|
+
/* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-toolbar", children: [
|
|
1271
|
+
scopes.length > 1 ? /* @__PURE__ */ jsxs3("label", { children: [
|
|
1272
|
+
"Scope",
|
|
1273
|
+
/* @__PURE__ */ jsx7("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ jsx7("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
|
|
1274
|
+
] }) : null,
|
|
1275
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1276
|
+
"Detail",
|
|
1277
|
+
/* @__PURE__ */ jsxs3("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
|
|
1278
|
+
/* @__PURE__ */ jsx7("option", { value: "full", children: "Full" }),
|
|
1279
|
+
/* @__PURE__ */ jsx7("option", { value: "compact", children: "Compact" }),
|
|
1280
|
+
/* @__PURE__ */ jsx7("option", { value: "brief", children: "Brief" }),
|
|
1281
|
+
/* @__PURE__ */ jsx7("option", { value: "custom", children: "Custom" })
|
|
1282
|
+
] })
|
|
1283
|
+
] }),
|
|
1284
|
+
/* @__PURE__ */ jsx7(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
|
|
1285
|
+
setBufferError(null);
|
|
1286
|
+
if (controlsHistory.length) {
|
|
1287
|
+
const next = controlsHistory[controlsHistory.length - 1];
|
|
1288
|
+
setControls(next);
|
|
1289
|
+
setControlsHistory((history) => history.slice(0, -1));
|
|
1290
|
+
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
1291
|
+
} else onChange({ ...state, draft: undoDraft(state.draft), error: void 0 });
|
|
1292
|
+
}, children: "Undo" }),
|
|
1293
|
+
/* @__PURE__ */ jsx7(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => {
|
|
1294
|
+
const next = initialControls(state);
|
|
1311
1295
|
setControls(next);
|
|
1312
|
-
setControlsHistory(
|
|
1296
|
+
setControlsHistory([]);
|
|
1297
|
+
setPendingControls(null);
|
|
1298
|
+
setBufferError(null);
|
|
1313
1299
|
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
1314
|
-
}
|
|
1315
|
-
|
|
1316
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
|
|
1317
|
-
const next = initialControls(state);
|
|
1318
|
-
setControls(next);
|
|
1319
|
-
setControlsHistory([]);
|
|
1320
|
-
setPendingControls(null);
|
|
1321
|
-
setBufferError(null);
|
|
1322
|
-
onChange({ ...state, draft: rebuild(state, next), error: void 0 });
|
|
1323
|
-
}, children: "Reset" }),
|
|
1324
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
|
|
1325
|
-
] }),
|
|
1326
|
-
controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ jsxs4("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1327
|
-
/* @__PURE__ */ jsx7("legend", { children: "JSON limits" }),
|
|
1328
|
-
[["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ jsxs4("label", { children: [
|
|
1329
|
-
text,
|
|
1330
|
-
/* @__PURE__ */ jsx7("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
1331
|
-
] }, key))
|
|
1332
|
-
] }) : null,
|
|
1333
|
-
rows ? /* @__PURE__ */ jsx7(RowControls, { rows, controls, change: changeControls }) : null,
|
|
1334
|
-
state.snapshot.sections.length ? /* @__PURE__ */ jsxs4("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1335
|
-
/* @__PURE__ */ jsx7("legend", { children: "Sections" }),
|
|
1336
|
-
state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs4("label", { children: [
|
|
1337
|
-
/* @__PURE__ */ jsx7("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) }) }),
|
|
1338
|
-
" ",
|
|
1339
|
-
section.label
|
|
1340
|
-
] }, section.id))
|
|
1341
|
-
] }) : null,
|
|
1342
|
-
/* @__PURE__ */ jsxs4("div", { className: "matrx-alchemy-coverage", children: [
|
|
1343
|
-
/* @__PURE__ */ jsxs4("span", { children: [
|
|
1344
|
-
state.snapshot.coverage.included.toLocaleString(),
|
|
1345
|
-
" included",
|
|
1346
|
-
state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
|
|
1347
|
-
" \xB7 ",
|
|
1348
|
-
state.snapshot.coverage.status
|
|
1300
|
+
}, children: "Reset" }),
|
|
1301
|
+
/* @__PURE__ */ jsx7(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
|
|
1349
1302
|
] }),
|
|
1350
|
-
state.
|
|
1351
|
-
|
|
1352
|
-
"
|
|
1353
|
-
|
|
1303
|
+
controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ jsxs3("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1304
|
+
/* @__PURE__ */ jsx7("legend", { children: "JSON limits" }),
|
|
1305
|
+
[["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ jsxs3("label", { children: [
|
|
1306
|
+
text,
|
|
1307
|
+
/* @__PURE__ */ jsx7("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
1308
|
+
] }, key))
|
|
1309
|
+
] }) : null,
|
|
1310
|
+
rows ? /* @__PURE__ */ jsx7(RowControls, { rows, controls, change: changeControls }) : null,
|
|
1311
|
+
state.snapshot.sections.length ? /* @__PURE__ */ jsxs3("fieldset", { className: "matrx-alchemy-options", children: [
|
|
1312
|
+
/* @__PURE__ */ jsx7("legend", { children: "Sections" }),
|
|
1313
|
+
state.snapshot.sections.map((section) => /* @__PURE__ */ jsxs3("label", { children: [
|
|
1314
|
+
/* @__PURE__ */ jsx7("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) }) }),
|
|
1315
|
+
" ",
|
|
1316
|
+
section.label
|
|
1317
|
+
] }, section.id))
|
|
1354
1318
|
] }) : null,
|
|
1355
|
-
|
|
1356
|
-
/* @__PURE__ */
|
|
1357
|
-
|
|
1358
|
-
"
|
|
1319
|
+
/* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-coverage", children: [
|
|
1320
|
+
/* @__PURE__ */ jsxs3("span", { children: [
|
|
1321
|
+
state.snapshot.coverage.included.toLocaleString(),
|
|
1322
|
+
" included",
|
|
1323
|
+
state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
|
|
1324
|
+
" \xB7 ",
|
|
1325
|
+
state.snapshot.coverage.status
|
|
1359
1326
|
] }),
|
|
1360
|
-
/* @__PURE__ */ jsx7("
|
|
1361
|
-
|
|
1362
|
-
": ",
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1327
|
+
state.snapshot.coverage.reason ? /* @__PURE__ */ jsx7("span", { children: state.snapshot.coverage.reason }) : null,
|
|
1328
|
+
limitText ? /* @__PURE__ */ jsxs3("span", { children: [
|
|
1329
|
+
"Limits: ",
|
|
1330
|
+
limitText
|
|
1331
|
+
] }) : null,
|
|
1332
|
+
displayedOmissions.length ? /* @__PURE__ */ jsxs3("details", { children: [
|
|
1333
|
+
/* @__PURE__ */ jsxs3("summary", { children: [
|
|
1334
|
+
displayedOmissions.length,
|
|
1335
|
+
" omissions or adjustments"
|
|
1336
|
+
] }),
|
|
1337
|
+
/* @__PURE__ */ jsx7("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ jsxs3("li", { children: [
|
|
1338
|
+
o.path || "/",
|
|
1339
|
+
": ",
|
|
1340
|
+
o.reason,
|
|
1341
|
+
o.count == null ? "" : ` (${o.count})`
|
|
1342
|
+
] }, `${o.path}-${o.reason}-${i}`)) })
|
|
1343
|
+
] }) : null
|
|
1344
|
+
] }),
|
|
1345
|
+
/* @__PURE__ */ jsxs3("label", { className: "matrx-alchemy-preview-label", children: [
|
|
1346
|
+
"Output format",
|
|
1347
|
+
/* @__PURE__ */ jsxs3("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
|
|
1348
|
+
formats.map((f) => /* @__PURE__ */ jsx7("option", { value: f, children: LABEL[f] }, f)),
|
|
1349
|
+
state.draft.payload.kind === "rows" ? /* @__PURE__ */ jsx7("option", { value: "xlsx", children: "Excel workbook" }) : null,
|
|
1350
|
+
workspaceAdapters.map((adapter) => /* @__PURE__ */ jsx7("option", { value: adapter.id, children: adapter.label }, adapter.id))
|
|
1351
|
+
] })
|
|
1352
|
+
] }),
|
|
1353
|
+
/* @__PURE__ */ jsx7("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) }),
|
|
1354
|
+
bufferError ? /* @__PURE__ */ jsx7("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
|
|
1355
|
+
formatError ? /* @__PURE__ */ jsx7("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
|
|
1356
|
+
bufferError ? /* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
|
|
1357
|
+
const fallback = editDraft(state.draft, { kind: "text", text: buffer });
|
|
1358
|
+
setBufferError(null);
|
|
1359
|
+
onChange({ ...state, draft: fallback, error: void 0 });
|
|
1360
|
+
setFormat("plain");
|
|
1361
|
+
}, children: "Use invalid JSON as plain text" }) : null
|
|
1375
1362
|
] }),
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1363
|
+
ai || busy === "capture" || state.error ? /* @__PURE__ */ jsxs3("aside", { children: [
|
|
1364
|
+
ai ? /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1365
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1366
|
+
"AI instruction",
|
|
1367
|
+
/* @__PURE__ */ jsx7("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
|
|
1368
|
+
] }),
|
|
1369
|
+
/* @__PURE__ */ jsx7(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" }),
|
|
1370
|
+
busy === "ai" ? /* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
|
|
1371
|
+
] }) : null,
|
|
1372
|
+
busy === "capture" ? /* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
|
|
1373
|
+
activeCapture.current?.abort();
|
|
1374
|
+
activeCapture.current = null;
|
|
1375
|
+
setBusy(null);
|
|
1376
|
+
}, children: "Stop loading rows" }) : null,
|
|
1377
|
+
ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ jsx7(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,
|
|
1378
|
+
ai ? /* @__PURE__ */ jsx7("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,
|
|
1379
|
+
state.error ? /* @__PURE__ */ jsx7("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
|
|
1380
|
+
] }) : null
|
|
1385
1381
|
] }),
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
setBusy(null);
|
|
1399
|
-
}, children: "Stop loading rows" }) : null,
|
|
1400
|
-
ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
|
|
1401
|
-
ai ? /* @__PURE__ */ jsx7("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
|
|
1402
|
-
state.error ? /* @__PURE__ */ jsx7("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
|
|
1403
|
-
] }) : null
|
|
1382
|
+
pendingControls ? /* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
1383
|
+
/* @__PURE__ */ jsx7("p", { children: "This control would replace your manual edit." }),
|
|
1384
|
+
/* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
|
|
1385
|
+
/* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
|
|
1386
|
+
] }) : null,
|
|
1387
|
+
state.sourceStale ? /* @__PURE__ */ jsx7("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
|
|
1388
|
+
state.pending ? /* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
1389
|
+
/* @__PURE__ */ jsx7("p", { children: "A fresh source snapshot is ready." }),
|
|
1390
|
+
/* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
|
|
1391
|
+
/* @__PURE__ */ jsx7(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
|
|
1392
|
+
] }) : null,
|
|
1393
|
+
deliveryNotice ? /* @__PURE__ */ jsx7("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
|
|
1404
1394
|
] }),
|
|
1405
|
-
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
|
|
1408
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
|
|
1409
|
-
] }) : null,
|
|
1410
|
-
state.sourceStale ? /* @__PURE__ */ jsx7("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
|
|
1411
|
-
state.pending ? /* @__PURE__ */ jsxs4("div", { className: "matrx-alchemy-decision", role: "alert", children: [
|
|
1412
|
-
/* @__PURE__ */ jsx7("p", { children: "A fresh source snapshot is ready." }),
|
|
1413
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
|
|
1414
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
|
|
1415
|
-
] }) : null,
|
|
1416
|
-
deliveryNotice ? /* @__PURE__ */ jsx7("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
|
|
1417
|
-
/* @__PURE__ */ jsxs4(DialogFooter, { children: [
|
|
1418
|
-
/* @__PURE__ */ jsxs4("span", { className: "matrx-alchemy-meta", children: [
|
|
1395
|
+
/* @__PURE__ */ jsxs3(DialogFooter, { children: [
|
|
1396
|
+
/* @__PURE__ */ jsxs3("span", { className: "matrx-alchemy-meta", children: [
|
|
1419
1397
|
buffer.length.toLocaleString(),
|
|
1420
1398
|
" characters \xB7 ~",
|
|
1421
1399
|
estimateTokens(buffer).toLocaleString(),
|
|
1422
1400
|
" tokens"
|
|
1423
1401
|
] }),
|
|
1424
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
|
|
1425
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download
|
|
1426
|
-
/* @__PURE__ */ jsx7(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy
|
|
1402
|
+
/* @__PURE__ */ jsx7(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
|
|
1403
|
+
/* @__PURE__ */ jsx7(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" }),
|
|
1404
|
+
/* @__PURE__ */ jsx7(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" })
|
|
1427
1405
|
] })
|
|
1428
1406
|
] }) });
|
|
1429
1407
|
}
|
|
1430
1408
|
function RowControls({ rows, controls, change }) {
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1409
|
+
const filterCount = Object.values(controls.filters).filter(Boolean).length;
|
|
1410
|
+
const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
|
|
1411
|
+
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 ");
|
|
1412
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
1413
|
+
/* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-toolbar", children: [
|
|
1414
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1434
1415
|
"Search",
|
|
1435
1416
|
/* @__PURE__ */ jsx7("input", { value: controls.search, onChange: (e) => change({ ...controls, search: e.target.value }) })
|
|
1436
1417
|
] }),
|
|
1437
|
-
/* @__PURE__ */
|
|
1418
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1438
1419
|
"Sort",
|
|
1439
|
-
/* @__PURE__ */
|
|
1420
|
+
/* @__PURE__ */ jsxs3("select", { value: controls.sort, onChange: (e) => change({ ...controls, sort: e.target.value }), children: [
|
|
1440
1421
|
/* @__PURE__ */ jsx7("option", { value: "", children: "None" }),
|
|
1441
1422
|
rows.columns.map((column) => /* @__PURE__ */ jsx7("option", { value: column.id, children: column.label }, column.id))
|
|
1442
1423
|
] })
|
|
1443
1424
|
] }),
|
|
1444
|
-
/* @__PURE__ */
|
|
1425
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1445
1426
|
"Direction",
|
|
1446
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ jsxs3("select", { value: controls.direction, disabled: !controls.sort, onChange: (e) => change({ ...controls, direction: e.target.value }), children: [
|
|
1447
1428
|
/* @__PURE__ */ jsx7("option", { value: "asc", children: "Ascending" }),
|
|
1448
1429
|
/* @__PURE__ */ jsx7("option", { value: "desc", children: "Descending" })
|
|
1449
1430
|
] })
|
|
1450
1431
|
] }),
|
|
1451
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1452
1433
|
"Top rows",
|
|
1453
1434
|
/* @__PURE__ */ jsx7("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
|
|
1454
1435
|
] })
|
|
1455
1436
|
] }),
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
|
|
1459
|
-
|
|
1437
|
+
/* @__PURE__ */ jsxs3("details", { className: "matrx-alchemy-options", children: [
|
|
1438
|
+
/* @__PURE__ */ jsxs3("summary", { children: [
|
|
1439
|
+
"Columns and filters",
|
|
1440
|
+
dataSummary ? ` \u2014 ${dataSummary}` : ""
|
|
1441
|
+
] }),
|
|
1442
|
+
/* @__PURE__ */ jsx7("fieldset", { "aria-label": "Columns and filters", children: rows.columns.map((column) => /* @__PURE__ */ jsxs3("div", { className: "matrx-alchemy-column", children: [
|
|
1443
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1460
1444
|
/* @__PURE__ */ jsx7("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) }) }),
|
|
1461
1445
|
" ",
|
|
1462
1446
|
column.label
|
|
1463
1447
|
] }),
|
|
1464
1448
|
/* @__PURE__ */ jsx7("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 } }) })
|
|
1465
|
-
] }, column.id))
|
|
1449
|
+
] }, column.id)) })
|
|
1466
1450
|
] }),
|
|
1467
|
-
/* @__PURE__ */
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
" Only selected rows"
|
|
1451
|
+
/* @__PURE__ */ jsxs3("details", { className: "matrx-alchemy-options", children: [
|
|
1452
|
+
/* @__PURE__ */ jsxs3("summary", { children: [
|
|
1453
|
+
"Rows \u2014 ",
|
|
1454
|
+
selectionSummary
|
|
1472
1455
|
] }),
|
|
1473
|
-
/* @__PURE__ */
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
summary
|
|
1480
|
-
|
|
1481
|
-
|
|
1456
|
+
/* @__PURE__ */ jsxs3("fieldset", { "aria-label": "Row selection", children: [
|
|
1457
|
+
/* @__PURE__ */ jsxs3("label", { children: [
|
|
1458
|
+
/* @__PURE__ */ jsx7("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
|
|
1459
|
+
" Only selected rows"
|
|
1460
|
+
] }),
|
|
1461
|
+
/* @__PURE__ */ jsx7("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
|
|
1462
|
+
const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String(readTransferCell(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
|
|
1463
|
+
return /* @__PURE__ */ jsxs3("label", { children: [
|
|
1464
|
+
/* @__PURE__ */ jsx7("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) }) }),
|
|
1465
|
+
" Row ",
|
|
1466
|
+
index + 1,
|
|
1467
|
+
summary ? ` \u2014 ${summary}` : ""
|
|
1468
|
+
] }, index);
|
|
1469
|
+
}) })
|
|
1470
|
+
] })
|
|
1482
1471
|
] })
|
|
1483
1472
|
] });
|
|
1484
1473
|
}
|
|
1485
1474
|
|
|
1486
1475
|
// src/content-transfer/matrx-copy.tsx
|
|
1487
|
-
import { Fragment as Fragment2, jsx as jsx8, jsxs as
|
|
1476
|
+
import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1488
1477
|
var resolve = (value) => typeof value === "function" ? value() : value;
|
|
1489
1478
|
var asPayload = (value) => ({
|
|
1490
1479
|
kind: "markdown",
|
|
@@ -1630,7 +1619,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1630
1619
|
if (aiVisible && props.aiCustom)
|
|
1631
1620
|
actions.push({
|
|
1632
1621
|
id: "configure-source",
|
|
1633
|
-
label: props.aiCustom.label ?? "Customize source
|
|
1622
|
+
label: props.aiCustom.label ?? "Customize source",
|
|
1634
1623
|
...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
|
|
1635
1624
|
supports: () => true,
|
|
1636
1625
|
run: async () => {
|
|
@@ -1641,7 +1630,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1641
1630
|
if (aiVisible && props.groomer)
|
|
1642
1631
|
actions.push({
|
|
1643
1632
|
id: "groom-source",
|
|
1644
|
-
label: "Customize sections
|
|
1633
|
+
label: "Customize sections",
|
|
1645
1634
|
supports: () => true,
|
|
1646
1635
|
run: async () => {
|
|
1647
1636
|
setConfiguration({ groomer: props.groomer() });
|
|
@@ -1655,6 +1644,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1655
1644
|
label: item.label,
|
|
1656
1645
|
supports: () => true,
|
|
1657
1646
|
...item.build && !item.onSelect ? {
|
|
1647
|
+
placement: "download",
|
|
1658
1648
|
source: make(
|
|
1659
1649
|
`export:${item.id}`,
|
|
1660
1650
|
async () => {
|
|
@@ -1726,7 +1716,7 @@ function MatrxCopyMenuSession(props) {
|
|
|
1726
1716
|
const source = (props.primarySource === "table" ? table : void 0) ?? json ?? table ?? structuredAgent ?? human ?? builderVariants[0]?.source;
|
|
1727
1717
|
if (!source && !actions.length) return null;
|
|
1728
1718
|
const target = source ?? make("actions", () => ({ kind: "text", text: props.label }));
|
|
1729
|
-
return /* @__PURE__ */
|
|
1719
|
+
return /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1730
1720
|
/* @__PURE__ */ jsx8(
|
|
1731
1721
|
ContentTransferMenu,
|
|
1732
1722
|
{
|
|
@@ -1735,10 +1725,11 @@ function MatrxCopyMenuSession(props) {
|
|
|
1735
1725
|
label: props.label,
|
|
1736
1726
|
variants,
|
|
1737
1727
|
actions,
|
|
1728
|
+
sourceFormats: Boolean(source),
|
|
1738
1729
|
hide: [
|
|
1739
1730
|
...!copyVisible || !source ? ["copy"] : [],
|
|
1740
1731
|
...!aiVisible || !source ? ["prepare"] : [],
|
|
1741
|
-
...!exportVisible
|
|
1732
|
+
...!exportVisible ? ["download"] : []
|
|
1742
1733
|
],
|
|
1743
1734
|
formatSources: {
|
|
1744
1735
|
...human ? { plain: human, markdown: humanMarkdown, html: humanMarkdown } : {},
|
|
@@ -1749,7 +1740,8 @@ function MatrxCopyMenuSession(props) {
|
|
|
1749
1740
|
className: cn(
|
|
1750
1741
|
props.className,
|
|
1751
1742
|
props.size === "xs" && "matrx-alchemy-xs",
|
|
1752
|
-
props.size === "sm" && "matrx-alchemy-sm"
|
|
1743
|
+
props.size === "sm" && "matrx-alchemy-sm",
|
|
1744
|
+
props.size === "toolbar" && "matrx-alchemy-toolbar-target"
|
|
1753
1745
|
),
|
|
1754
1746
|
...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
|
|
1755
1747
|
}
|
|
@@ -1847,134 +1839,139 @@ function SourceConfiguration({
|
|
|
1847
1839
|
onOpenChange: (open) => {
|
|
1848
1840
|
if (!open && !busy) onClose();
|
|
1849
1841
|
},
|
|
1850
|
-
children: /* @__PURE__ */
|
|
1842
|
+
children: /* @__PURE__ */ jsxs4(
|
|
1851
1843
|
DialogContent,
|
|
1852
1844
|
{
|
|
1853
1845
|
onCloseAutoFocus: (event) => {
|
|
1854
1846
|
event.preventDefault();
|
|
1855
1847
|
if (!handingOff.current) restoreFocus();
|
|
1856
1848
|
},
|
|
1857
|
-
className: "matrx-alchemy-workspace",
|
|
1849
|
+
className: "matrx-alchemy-workspace matrx-alchemy-configuration",
|
|
1858
1850
|
children: [
|
|
1859
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ jsxs4(DialogHeader, { children: [
|
|
1860
1852
|
/* @__PURE__ */ jsx8(DialogTitle, { children: title }),
|
|
1861
1853
|
/* @__PURE__ */ jsx8(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
|
|
1862
1854
|
] }),
|
|
1863
|
-
/* @__PURE__ */
|
|
1864
|
-
|
|
1865
|
-
option
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
"
|
|
1869
|
-
{
|
|
1870
|
-
type: "checkbox",
|
|
1871
|
-
checked: Boolean(values[option.key]),
|
|
1872
|
-
onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
|
|
1873
|
-
}
|
|
1874
|
-
) : option.kind === "preset" ? /* @__PURE__ */ jsx8(
|
|
1875
|
-
"select",
|
|
1876
|
-
{
|
|
1877
|
-
value: Number(values[option.key]),
|
|
1878
|
-
onChange: (event) => setValues({
|
|
1879
|
-
...values,
|
|
1880
|
-
[option.key]: Number(event.target.value)
|
|
1881
|
-
}),
|
|
1882
|
-
children: option.options.map((choice) => /* @__PURE__ */ jsx8("option", { value: choice.value, children: choice.label }, choice.value))
|
|
1883
|
-
}
|
|
1884
|
-
) : option.kind === "slider" ? /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1885
|
-
/* @__PURE__ */ jsx8(
|
|
1855
|
+
/* @__PURE__ */ jsxs4("div", { className: "matrx-alchemy-workspace-body", children: [
|
|
1856
|
+
/* @__PURE__ */ jsxs4("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
|
|
1857
|
+
custom?.options.map((option) => /* @__PURE__ */ jsxs4("label", { children: [
|
|
1858
|
+
option.label,
|
|
1859
|
+
"hint" in option && option.hint ? /* @__PURE__ */ jsx8("small", { children: option.hint }) : null,
|
|
1860
|
+
option.kind === "toggle" ? /* @__PURE__ */ jsx8(
|
|
1886
1861
|
"input",
|
|
1887
1862
|
{
|
|
1888
|
-
type: "
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
step: 1,
|
|
1892
|
-
value: option.stops.indexOf(Number(values[option.key])),
|
|
1893
|
-
onChange: (event) => setValues({
|
|
1894
|
-
...values,
|
|
1895
|
-
[option.key]: option.stops[Number(event.target.value)]
|
|
1896
|
-
})
|
|
1863
|
+
type: "checkbox",
|
|
1864
|
+
checked: Boolean(values[option.key]),
|
|
1865
|
+
onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
|
|
1897
1866
|
}
|
|
1898
|
-
)
|
|
1899
|
-
|
|
1900
|
-
] }) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
|
|
1901
|
-
/* @__PURE__ */ jsx8(
|
|
1902
|
-
"input",
|
|
1867
|
+
) : option.kind === "preset" ? /* @__PURE__ */ jsx8(
|
|
1868
|
+
"select",
|
|
1903
1869
|
{
|
|
1904
|
-
type: "number",
|
|
1905
|
-
min: option.min,
|
|
1906
|
-
step: option.step,
|
|
1907
1870
|
value: Number(values[option.key]),
|
|
1908
1871
|
onChange: (event) => setValues({
|
|
1909
1872
|
...values,
|
|
1910
1873
|
[option.key]: Number(event.target.value)
|
|
1911
|
-
})
|
|
1874
|
+
}),
|
|
1875
|
+
children: option.options.map((choice) => /* @__PURE__ */ jsx8("option", { value: choice.value, children: choice.label }, choice.value))
|
|
1912
1876
|
}
|
|
1913
|
-
),
|
|
1914
|
-
|
|
1877
|
+
) : option.kind === "slider" ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1878
|
+
/* @__PURE__ */ jsx8(
|
|
1879
|
+
"input",
|
|
1880
|
+
{
|
|
1881
|
+
type: "range",
|
|
1882
|
+
min: 0,
|
|
1883
|
+
max: Math.max(0, option.stops.length - 1),
|
|
1884
|
+
step: 1,
|
|
1885
|
+
value: option.stops.indexOf(Number(values[option.key])),
|
|
1886
|
+
onChange: (event) => setValues({
|
|
1887
|
+
...values,
|
|
1888
|
+
[option.key]: option.stops[Number(event.target.value)]
|
|
1889
|
+
})
|
|
1890
|
+
}
|
|
1891
|
+
),
|
|
1892
|
+
/* @__PURE__ */ jsx8("span", { children: option.formatValue(Number(values[option.key])) })
|
|
1893
|
+
] }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1894
|
+
/* @__PURE__ */ jsx8(
|
|
1895
|
+
"input",
|
|
1896
|
+
{
|
|
1897
|
+
type: "number",
|
|
1898
|
+
min: option.min,
|
|
1899
|
+
step: option.step,
|
|
1900
|
+
value: Number(values[option.key]),
|
|
1901
|
+
onChange: (event) => setValues({
|
|
1902
|
+
...values,
|
|
1903
|
+
[option.key]: Number(event.target.value)
|
|
1904
|
+
})
|
|
1905
|
+
}
|
|
1906
|
+
),
|
|
1907
|
+
option.presets?.map((preset) => /* @__PURE__ */ jsx8(
|
|
1908
|
+
Button,
|
|
1909
|
+
{
|
|
1910
|
+
type: "button",
|
|
1911
|
+
variant: "ghost",
|
|
1912
|
+
className: "matrx-alchemy-workspace-secondary",
|
|
1913
|
+
onClick: () => setValues({ ...values, [option.key]: preset.value }),
|
|
1914
|
+
children: preset.label
|
|
1915
|
+
},
|
|
1916
|
+
preset.value
|
|
1917
|
+
))
|
|
1918
|
+
] })
|
|
1919
|
+
] }, option.key)),
|
|
1920
|
+
groomer ? /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
1921
|
+
/* @__PURE__ */ jsx8("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx8(
|
|
1915
1922
|
Button,
|
|
1916
1923
|
{
|
|
1917
1924
|
type: "button",
|
|
1918
1925
|
variant: "ghost",
|
|
1919
|
-
|
|
1920
|
-
|
|
1926
|
+
className: "matrx-alchemy-workspace-secondary",
|
|
1927
|
+
onClick: () => setSections(
|
|
1928
|
+
Object.fromEntries(
|
|
1929
|
+
groomer.sections.map((section) => [
|
|
1930
|
+
section.id,
|
|
1931
|
+
level === "brief" && section.cuttable ? "off" : level
|
|
1932
|
+
])
|
|
1933
|
+
)
|
|
1934
|
+
),
|
|
1935
|
+
children: level
|
|
1921
1936
|
},
|
|
1922
|
-
|
|
1923
|
-
))
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
section.
|
|
1936
|
-
|
|
1937
|
-
]
|
|
1938
|
-
|
|
1937
|
+
level
|
|
1938
|
+
)) }),
|
|
1939
|
+
groomer.sections.map((section) => /* @__PURE__ */ jsxs4("label", { children: [
|
|
1940
|
+
section.title,
|
|
1941
|
+
/* @__PURE__ */ jsxs4(
|
|
1942
|
+
"select",
|
|
1943
|
+
{
|
|
1944
|
+
value: sections[section.id],
|
|
1945
|
+
onChange: (event) => setSections({
|
|
1946
|
+
...sections,
|
|
1947
|
+
[section.id]: event.target.value
|
|
1948
|
+
}),
|
|
1949
|
+
children: [
|
|
1950
|
+
["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx8("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
|
|
1951
|
+
section.cuttable ? /* @__PURE__ */ jsx8("option", { value: "off", children: "Exclude" }) : null
|
|
1952
|
+
]
|
|
1953
|
+
}
|
|
1939
1954
|
),
|
|
1940
|
-
children:
|
|
1941
|
-
},
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
[section.id]: event.target.value
|
|
1953
|
-
}),
|
|
1954
|
-
children: [
|
|
1955
|
-
["full", "compact", "brief"].map((level) => /* @__PURE__ */ jsx8("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
|
|
1956
|
-
section.cuttable ? /* @__PURE__ */ jsx8("option", { value: "off", children: "Exclude" }) : null
|
|
1957
|
-
]
|
|
1958
|
-
}
|
|
1959
|
-
),
|
|
1960
|
-
section.description ? /* @__PURE__ */ jsx8("span", { children: section.description }) : null
|
|
1961
|
-
] }, section.id))
|
|
1962
|
-
] }) : null
|
|
1963
|
-
] }),
|
|
1964
|
-
/* @__PURE__ */ jsxs5("p", { children: [
|
|
1965
|
-
text.length.toLocaleString(),
|
|
1966
|
-
" characters \xB7 approximately",
|
|
1967
|
-
" ",
|
|
1968
|
-
Math.ceil(text.length / 4).toLocaleString(),
|
|
1969
|
-
" tokens"
|
|
1955
|
+
section.description ? /* @__PURE__ */ jsx8("span", { children: section.description }) : null
|
|
1956
|
+
] }, section.id))
|
|
1957
|
+
] }) : null
|
|
1958
|
+
] }),
|
|
1959
|
+
/* @__PURE__ */ jsxs4("p", { children: [
|
|
1960
|
+
text.length.toLocaleString(),
|
|
1961
|
+
" characters \xB7 approximately",
|
|
1962
|
+
" ",
|
|
1963
|
+
Math.ceil(text.length / 4).toLocaleString(),
|
|
1964
|
+
" tokens"
|
|
1965
|
+
] }),
|
|
1966
|
+
error || buildError ? /* @__PURE__ */ jsx8("p", { role: "alert", children: error ?? buildError }) : null
|
|
1970
1967
|
] }),
|
|
1971
|
-
|
|
1972
|
-
/* @__PURE__ */ jsxs5(DialogFooter, { children: [
|
|
1968
|
+
/* @__PURE__ */ jsxs4(DialogFooter, { children: [
|
|
1973
1969
|
/* @__PURE__ */ jsx8(
|
|
1974
1970
|
Button,
|
|
1975
1971
|
{
|
|
1976
1972
|
type: "button",
|
|
1977
1973
|
variant: "ghost",
|
|
1974
|
+
className: "matrx-alchemy-workspace-secondary",
|
|
1978
1975
|
disabled: busy,
|
|
1979
1976
|
onClick: onClose,
|
|
1980
1977
|
children: "Cancel"
|
|
@@ -1984,6 +1981,7 @@ function SourceConfiguration({
|
|
|
1984
1981
|
Button,
|
|
1985
1982
|
{
|
|
1986
1983
|
type: "button",
|
|
1984
|
+
className: "matrx-alchemy-workspace-primary",
|
|
1987
1985
|
disabled: busy || !prepared || Boolean(buildError),
|
|
1988
1986
|
onClick: async () => {
|
|
1989
1987
|
if (!prepared) return;
|
|
@@ -2039,17 +2037,17 @@ import {
|
|
|
2039
2037
|
} from "react";
|
|
2040
2038
|
|
|
2041
2039
|
// src/data-table/icons.tsx
|
|
2042
|
-
import { jsx as jsx11, jsxs as
|
|
2040
|
+
import { jsx as jsx11, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
2043
2041
|
function Icon({ children, ...props }) {
|
|
2044
2042
|
return /* @__PURE__ */ jsx11("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", "aria-hidden": "true", ...props, children });
|
|
2045
2043
|
}
|
|
2046
2044
|
var Check = (p) => /* @__PURE__ */ jsx11(Icon, { ...p, children: /* @__PURE__ */ jsx11("path", { d: "m5 12 4 4L19 6" }) });
|
|
2047
|
-
var PanelRight = (p) => /* @__PURE__ */
|
|
2045
|
+
var PanelRight = (p) => /* @__PURE__ */ jsxs5(Icon, { ...p, children: [
|
|
2048
2046
|
/* @__PURE__ */ jsx11("rect", { x: "3", y: "4", width: "18", height: "16", rx: "2" }),
|
|
2049
2047
|
/* @__PURE__ */ jsx11("path", { d: "M15 4v16" })
|
|
2050
2048
|
] });
|
|
2051
2049
|
var ExternalLink = (p) => /* @__PURE__ */ jsx11(Icon, { ...p, children: /* @__PURE__ */ jsx11("path", { d: "M14 4h6v6M20 4l-9 9M19 13v6H5V5h6" }) });
|
|
2052
|
-
var Copy = (p) => /* @__PURE__ */
|
|
2050
|
+
var Copy = (p) => /* @__PURE__ */ jsxs5(Icon, { ...p, children: [
|
|
2053
2051
|
/* @__PURE__ */ jsx11("rect", { x: "9", y: "9", width: "11", height: "11", rx: "2" }),
|
|
2054
2052
|
/* @__PURE__ */ jsx11("path", { d: "M15 9V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h3" })
|
|
2055
2053
|
] });
|
|
@@ -2058,7 +2056,7 @@ var ShieldOff = (p) => /* @__PURE__ */ jsx11(Icon, { ...p, children: /* @__PURE_
|
|
|
2058
2056
|
|
|
2059
2057
|
// src/data-table/useTableNotice.tsx
|
|
2060
2058
|
import { useState as useState5 } from "react";
|
|
2061
|
-
import { jsx as jsx12, jsxs as
|
|
2059
|
+
import { jsx as jsx12, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
2062
2060
|
function useTableNotice() {
|
|
2063
2061
|
const host = useMatrxDataTableHost();
|
|
2064
2062
|
const [message, setMessage] = useState5(null);
|
|
@@ -2072,7 +2070,7 @@ function useTableNotice() {
|
|
|
2072
2070
|
else setMessage({ text, error: true });
|
|
2073
2071
|
}
|
|
2074
2072
|
};
|
|
2075
|
-
const notice = message ? /* @__PURE__ */
|
|
2073
|
+
const notice = message ? /* @__PURE__ */ jsxs6("span", { role: message.error ? "alert" : "status", className: message.error ? "text-xs text-destructive" : "text-xs text-muted-foreground", children: [
|
|
2076
2074
|
message.text,
|
|
2077
2075
|
/* @__PURE__ */ jsx12("button", { type: "button", "aria-label": "Dismiss notification", className: "ml-2 underline", onClick: () => setMessage(null), children: "Dismiss" })
|
|
2078
2076
|
] }) : null;
|
|
@@ -2106,7 +2104,7 @@ var TooltipContent = React9.forwardRef(({ className, sideOffset = 4, container,
|
|
|
2106
2104
|
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
2107
2105
|
|
|
2108
2106
|
// src/data-table/MatrxUuidCell.tsx
|
|
2109
|
-
import { jsx as jsx14, jsxs as
|
|
2107
|
+
import { jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2110
2108
|
var SHORT_LEN = 8;
|
|
2111
2109
|
function shortUuid(id, len = SHORT_LEN) {
|
|
2112
2110
|
return id.slice(0, len);
|
|
@@ -2199,13 +2197,13 @@ function MatrxUuidCell({
|
|
|
2199
2197
|
};
|
|
2200
2198
|
const idNode = (() => {
|
|
2201
2199
|
if (forbidden) {
|
|
2202
|
-
return /* @__PURE__ */
|
|
2200
|
+
return /* @__PURE__ */ jsxs7("span", { className: "inline-flex min-w-0 items-center gap-1 font-mono text-xs text-muted-foreground/70 tabular-nums", children: [
|
|
2203
2201
|
/* @__PURE__ */ jsx14("span", { className: "min-w-0 truncate", children: display }),
|
|
2204
2202
|
/* @__PURE__ */ jsx14(ShieldOff, { className: "h-3 w-3 shrink-0 opacity-60", "aria-hidden": true })
|
|
2205
2203
|
] });
|
|
2206
2204
|
}
|
|
2207
2205
|
if (onOpen) {
|
|
2208
|
-
return /* @__PURE__ */
|
|
2206
|
+
return /* @__PURE__ */ jsxs7(
|
|
2209
2207
|
"button",
|
|
2210
2208
|
{
|
|
2211
2209
|
type: "button",
|
|
@@ -2221,7 +2219,7 @@ function MatrxUuidCell({
|
|
|
2221
2219
|
);
|
|
2222
2220
|
}
|
|
2223
2221
|
if (resolvedHref) {
|
|
2224
|
-
return /* @__PURE__ */
|
|
2222
|
+
return /* @__PURE__ */ jsxs7(
|
|
2225
2223
|
"a",
|
|
2226
2224
|
{
|
|
2227
2225
|
href: resolvedHref,
|
|
@@ -2239,7 +2237,7 @@ function MatrxUuidCell({
|
|
|
2239
2237
|
}
|
|
2240
2238
|
return /* @__PURE__ */ jsx14("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
|
|
2241
2239
|
})();
|
|
2242
|
-
return /* @__PURE__ */ jsx14(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */
|
|
2240
|
+
return /* @__PURE__ */ jsx14(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs7(
|
|
2243
2241
|
"span",
|
|
2244
2242
|
{
|
|
2245
2243
|
"data-matrx-cell-control": true,
|
|
@@ -2249,11 +2247,11 @@ function MatrxUuidCell({
|
|
|
2249
2247
|
),
|
|
2250
2248
|
onClick: stop,
|
|
2251
2249
|
children: [
|
|
2252
|
-
/* @__PURE__ */
|
|
2250
|
+
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
2253
2251
|
/* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx14("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
|
|
2254
2252
|
/* @__PURE__ */ jsx14(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
|
|
2255
2253
|
] }),
|
|
2256
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
2257
2255
|
/* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx14(
|
|
2258
2256
|
"button",
|
|
2259
2257
|
{
|
|
@@ -2269,7 +2267,7 @@ function MatrxUuidCell({
|
|
|
2269
2267
|
) }),
|
|
2270
2268
|
/* @__PURE__ */ jsx14(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
|
|
2271
2269
|
] }),
|
|
2272
|
-
canPeek ? /* @__PURE__ */
|
|
2270
|
+
canPeek ? /* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
2273
2271
|
/* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx14(
|
|
2274
2272
|
"button",
|
|
2275
2273
|
{
|
|
@@ -2283,12 +2281,12 @@ function MatrxUuidCell({
|
|
|
2283
2281
|
children: /* @__PURE__ */ jsx14(Lightbulb, { className: "h-3 w-3" })
|
|
2284
2282
|
}
|
|
2285
2283
|
) }),
|
|
2286
|
-
/* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ jsxs7(TooltipContent, { side: "top", children: [
|
|
2287
2285
|
"Quick look at ",
|
|
2288
2286
|
label ?? "record"
|
|
2289
2287
|
] })
|
|
2290
2288
|
] }) : null,
|
|
2291
|
-
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */
|
|
2289
|
+
onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsxs7(Tooltip, { children: [
|
|
2292
2290
|
/* @__PURE__ */ jsx14(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx14(
|
|
2293
2291
|
"a",
|
|
2294
2292
|
{
|
|
@@ -2301,7 +2299,7 @@ function MatrxUuidCell({
|
|
|
2301
2299
|
children: /* @__PURE__ */ jsx14(ExternalLink, { className: "h-3 w-3" })
|
|
2302
2300
|
}
|
|
2303
2301
|
) }),
|
|
2304
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ jsxs7(TooltipContent, { side: "top", children: [
|
|
2305
2303
|
"Open ",
|
|
2306
2304
|
label ?? "record",
|
|
2307
2305
|
" in a new tab"
|
|
@@ -2329,7 +2327,7 @@ function isUuidValue(value) {
|
|
|
2329
2327
|
}
|
|
2330
2328
|
|
|
2331
2329
|
// src/data-table/DataRowInspector.tsx
|
|
2332
|
-
import { jsx as jsx15, jsxs as
|
|
2330
|
+
import { jsx as jsx15, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2333
2331
|
var noFieldToken = () => null;
|
|
2334
2332
|
function formatValue(value) {
|
|
2335
2333
|
if (value == null) return "\u2014";
|
|
@@ -2373,7 +2371,7 @@ function DataRowInspector({
|
|
|
2373
2371
|
})
|
|
2374
2372
|
}
|
|
2375
2373
|
) }) : null;
|
|
2376
|
-
return /* @__PURE__ */
|
|
2374
|
+
return /* @__PURE__ */ jsxs8(
|
|
2377
2375
|
"div",
|
|
2378
2376
|
{
|
|
2379
2377
|
className: cn("flex h-full min-h-0 flex-col overflow-hidden", className),
|
|
@@ -2381,7 +2379,7 @@ function DataRowInspector({
|
|
|
2381
2379
|
title ? /* @__PURE__ */ jsx15("div", { className: "shrink-0 border-b border-border px-3 py-2 text-sm font-medium", children: title }) : null,
|
|
2382
2380
|
/* @__PURE__ */ jsx15("div", { className: "min-h-0 flex-1 overflow-auto p-3", children: /* @__PURE__ */ jsx15("dl", { className: "space-y-2", children: entries.map(([key, value]) => {
|
|
2383
2381
|
if (isUuidValue(value)) {
|
|
2384
|
-
return /* @__PURE__ */
|
|
2382
|
+
return /* @__PURE__ */ jsxs8(
|
|
2385
2383
|
"div",
|
|
2386
2384
|
{
|
|
2387
2385
|
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",
|
|
@@ -2402,7 +2400,7 @@ function DataRowInspector({
|
|
|
2402
2400
|
}
|
|
2403
2401
|
const formatted = formatValue(value);
|
|
2404
2402
|
const multiline = formatted.includes("\n") || formatted.length > 80;
|
|
2405
|
-
return /* @__PURE__ */
|
|
2403
|
+
return /* @__PURE__ */ jsxs8(
|
|
2406
2404
|
"div",
|
|
2407
2405
|
{
|
|
2408
2406
|
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",
|