@ai-matrx/design-system 0.18.10 → 0.18.13

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/content-transfer/alchemy.svg +1 -1
  3. package/dist/content-transfer/icon.cjs +3 -1
  4. package/dist/content-transfer/icon.cjs.map +1 -1
  5. package/dist/content-transfer/icon.d.cts +3 -2
  6. package/dist/content-transfer/icon.d.ts +3 -2
  7. package/dist/content-transfer/icon.js +3 -1
  8. package/dist/content-transfer/icon.js.map +1 -1
  9. package/dist/content-transfer.cjs +323 -277
  10. package/dist/content-transfer.cjs.map +1 -1
  11. package/dist/content-transfer.css +93 -25
  12. package/dist/content-transfer.d.cts +1 -1
  13. package/dist/content-transfer.d.ts +1 -1
  14. package/dist/content-transfer.js +323 -277
  15. package/dist/content-transfer.js.map +1 -1
  16. package/dist/data-table/copy-helpers.d.cts +1 -1
  17. package/dist/data-table/copy-helpers.d.ts +1 -1
  18. package/dist/data-table/copy-types.cjs.map +1 -1
  19. package/dist/data-table/copy-types.d.cts +1 -1
  20. package/dist/data-table/copy-types.d.ts +1 -1
  21. package/dist/data-table/data-row-inspector.cjs +325 -276
  22. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  23. package/dist/data-table/data-row-inspector.js +325 -276
  24. package/dist/data-table/data-row-inspector.js.map +1 -1
  25. package/dist/data-table/data-row-window.cjs +325 -276
  26. package/dist/data-table/data-row-window.cjs.map +1 -1
  27. package/dist/data-table/data-row-window.js +325 -276
  28. package/dist/data-table/data-row-window.js.map +1 -1
  29. package/dist/data-table/filter-engine.d.cts +1 -1
  30. package/dist/data-table/filter-engine.d.ts +1 -1
  31. package/dist/data-table/host.cjs.map +1 -1
  32. package/dist/data-table/host.d.cts +16 -2
  33. package/dist/data-table/host.d.ts +16 -2
  34. package/dist/data-table/host.js.map +1 -1
  35. package/dist/data-table/index.cjs +463 -398
  36. package/dist/data-table/index.cjs.map +1 -1
  37. package/dist/data-table/index.d.cts +3 -3
  38. package/dist/data-table/index.d.ts +3 -3
  39. package/dist/data-table/index.js +464 -399
  40. package/dist/data-table/index.js.map +1 -1
  41. package/dist/data-table/infer-filter.d.cts +1 -1
  42. package/dist/data-table/infer-filter.d.ts +1 -1
  43. package/dist/data-table/layered-filters.d.cts +1 -1
  44. package/dist/data-table/layered-filters.d.ts +1 -1
  45. package/dist/data-table/pagination.cjs.map +1 -1
  46. package/dist/data-table/pagination.js.map +1 -1
  47. package/dist/data-table/query-control.d.cts +1 -1
  48. package/dist/data-table/query-control.d.ts +1 -1
  49. package/dist/data-table/types.cjs.map +1 -1
  50. package/dist/data-table/types.d.cts +1 -1
  51. package/dist/data-table/types.d.ts +1 -1
  52. package/dist/data-table/url-state.d.cts +1 -1
  53. package/dist/data-table/url-state.d.ts +1 -1
  54. package/dist/data-table/uuid-cell.cjs.map +1 -1
  55. package/dist/data-table/uuid-cell.js.map +1 -1
  56. package/dist/data-table/xlsx.d.cts +1 -1
  57. package/dist/data-table/xlsx.d.ts +1 -1
  58. package/dist/index.cjs.map +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/{types-C2xN6W_q.d.ts → types-BuDKVpeF.d.ts} +2 -1
  61. package/dist/{types-D_tpuk6m.d.cts → types-Dqcb7jXO.d.cts} +2 -1
  62. package/package.json +2 -2
@@ -527,14 +527,14 @@ var PopoverContent = React6.forwardRef(
527
527
  );
528
528
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
529
529
 
530
+ // src/content-transfer/icon.ts
531
+ 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"];
532
+ 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>`;
533
+
530
534
  // src/content-transfer/index.tsx
531
535
  var import_jsx_runtime10 = require("react/jsx-runtime");
532
536
  function AlchemyGlyph(props) {
533
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
534
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M4.5 5.5h8v11h-8z" }),
535
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M8.5 9.5h8v9h-8z" }),
536
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
537
- ] });
537
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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__ */ (0, import_jsx_runtime10.jsx)("path", { d }, d)) });
538
538
  }
539
539
  var CapabilityContext = React7.createContext({});
540
540
  var useContentTransferCapabilities = () => React7.useContext(CapabilityContext);
@@ -548,7 +548,16 @@ function MenuPresentation({ label, hint, icon: Icon2 }) {
548
548
  ] })
549
549
  ] });
550
550
  }
551
- function PaletteGlyph({ format, ai = false, file = false }) {
551
+ function PaletteGlyph({ format, ai = false, file = false, kind }) {
552
+ if (kind === "ai-copy") return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("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: [
553
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("rect", { x: "5", y: "5", width: "11", height: "14", rx: "2" }),
554
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M9 3h6a2 2 0 0 1 2 2v10" }),
555
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "m18.5 3 .55 1.45L20.5 5l-1.45.55L18.5 7l-.55-1.45L16.5 5l1.45-.55z" })
556
+ ] });
557
+ if (kind === "sliders") return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("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: [
558
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M4 6h16M4 12h16M4 18h16" }),
559
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M8 3v6M16 9v6M10 15v6" })
560
+ ] });
552
561
  if (ai) return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("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: [
553
562
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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" }),
554
563
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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" }),
@@ -581,15 +590,15 @@ function PaletteGlyph({ format, ai = false, file = false }) {
581
590
  ] }) : format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M15 6h6M3 6h7M3 12h18M3 18h12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
582
591
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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 });
583
592
  }
584
- function PaletteRows({ title, items, onRun, extra, ai = false }) {
593
+ function PaletteRows({ title, items, onRun, extra, ai = false, glyphKind, fallbackHint }) {
585
594
  if (!items.length && !extra) return null;
586
595
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "matrx-alchemy-palette-section", children: [
587
596
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: title }),
588
597
  items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: cn("matrx-alchemy-palette-row", ai && "matrx-alchemy-palette-row-ai"), "aria-label": item.ariaLabel, onClick: () => onRun?.(item), children: [
589
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteGlyph, { ai }),
598
+ item.icon ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteGlyph, { ai, ...glyphKind ? { kind: glyphKind } : {} }),
590
599
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
591
600
  item.copyLabel ?? item.label,
592
- item.hint ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint }) : null
601
+ item.hint ?? fallbackHint ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint ?? fallbackHint }) : null
593
602
  ] })
594
603
  ] }, item.id)),
595
604
  extra
@@ -986,45 +995,54 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
986
995
  }, children: [
987
996
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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__ */ (0, import_jsx_runtime10.jsx)(AlchemyGlyph, {}) }) }),
988
997
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(PopoverContent, { align: "end", className: "matrx-alchemy-menu matrx-alchemy-palette", "aria-label": "Alchemy output options", onCloseAutoFocus: () => triggerRef.current?.focus(), children: [
989
- copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
990
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
991
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
992
- ] }) : null,
993
998
  menuStatus === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "matrx-alchemy-palette-status", children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "matrx-alchemy-error", children: menuStatus }) : null,
994
- resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
995
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
996
- 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]}` })),
997
- visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
998
- ] }),
999
- quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
999
+ copyAvailable || downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "matrx-alchemy-output", children: [
1000
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: resolvedMode === "copy" ? "Copy as" : "Download as" }),
1001
+ copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
1002
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
1003
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
1004
+ ] }) : null,
1005
+ resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1006
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1007
+ 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]}` })),
1008
+ visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
1009
+ ] }),
1010
+ quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
1011
+ closePalette();
1012
+ void transfer("markdown", false, variant);
1013
+ } }) : null
1014
+ ] }) : null,
1015
+ resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1016
+ 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]}` })),
1017
+ visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
1018
+ downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
1019
+ ] }) }) : null
1020
+ ] }) : null,
1021
+ prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1022
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Copy for AI", ai: true, glyphKind: "ai-copy", fallbackHint: "Copies immediately", items: quickVariants("ai"), onRun: (variant) => {
1000
1023
  closePalette();
1001
1024
  void transfer("markdown", false, variant);
1002
- } }) : null
1025
+ } }),
1026
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Edit and prepare", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": "Prepare for AI", onClick: () => {
1027
+ closePalette();
1028
+ void openWorkspace();
1029
+ }, children: [
1030
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteGlyph, { kind: "sliders" }),
1031
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1032
+ "Prepare for AI",
1033
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("small", { className: "matrx-alchemy-menu-hint", children: "Review and edit before copying" })
1034
+ ] })
1035
+ ] }) })
1003
1036
  ] }) : null,
1004
- resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1005
- 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]}` })),
1006
- visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
1007
- downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
1008
- ] }) }) : null,
1009
- prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Prepare", ai: true, items: quickVariants("ai"), onRun: (variant) => {
1010
- closePalette();
1011
- void transfer("markdown", false, variant);
1012
- }, extra: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
1013
- closePalette();
1014
- void openWorkspace();
1015
- }, children: [
1016
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteGlyph, { ai: true }),
1017
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Prepare for AI\u2026" })
1018
- ] }) }) : null,
1019
- prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Context", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1037
+ prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Other sources", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1020
1038
  nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
1021
1039
  closePalette();
1022
1040
  void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
1023
- }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Prepare this surface\u2026" }) }) : null,
1041
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: "Prepare this surface" }) }) : null,
1024
1042
  variants.map((variant) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
1025
1043
  closePalette();
1026
1044
  void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
1027
- }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
1045
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}` }) }, variant.id))
1028
1046
  ] }) }) : null,
1029
1047
  ordinaryActions.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PaletteRows, { title: "Actions", items: [], extra: ordinaryActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
1030
1048
  closePalette();
@@ -1302,137 +1320,150 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1302
1320
  state.snapshot.label
1303
1321
  ] }),
1304
1322
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogDescription, { children: [
1305
- "Captured ",
1306
- state.snapshot.unsavedChanges ? "from your unsaved draft" : "as an immutable snapshot",
1307
- ". Your source is never edited."
1323
+ state.snapshot.unsavedChanges ? "Includes your unsaved changes. " : "",
1324
+ "Review and edit this copy. Your original stays unchanged."
1308
1325
  ] })
1309
1326
  ] }),
1310
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
1311
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "matrx-alchemy-main", children: [
1312
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1313
- scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1314
- "Scope",
1315
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
1316
- ] }) : null,
1317
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1318
- "Detail",
1319
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
1320
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "full", children: "Full" }),
1321
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "compact", children: "Compact" }),
1322
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "brief", children: "Brief" }),
1323
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "custom", children: "Custom" })
1324
- ] })
1325
- ] }),
1326
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
1327
- setBufferError(null);
1328
- if (controlsHistory.length) {
1329
- const next = controlsHistory[controlsHistory.length - 1];
1327
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1328
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
1329
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "matrx-alchemy-main", children: [
1330
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1331
+ scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1332
+ "Scope",
1333
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { "aria-label": "Transfer scope", value: state.scope, disabled: busy !== null, onChange: (e) => void requestCapture(e.target.value), children: scopes.map((scope) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
1334
+ ] }) : null,
1335
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1336
+ "Detail",
1337
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
1338
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "full", children: "Full" }),
1339
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "compact", children: "Compact" }),
1340
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "brief", children: "Brief" }),
1341
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "custom", children: "Custom" })
1342
+ ] })
1343
+ ] }),
1344
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
1345
+ setBufferError(null);
1346
+ if (controlsHistory.length) {
1347
+ const next = controlsHistory[controlsHistory.length - 1];
1348
+ setControls(next);
1349
+ setControlsHistory((history) => history.slice(0, -1));
1350
+ onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1351
+ } else onChange({ ...state, draft: (0, import_content_transfer.undoDraft)(state.draft), error: void 0 });
1352
+ }, children: "Undo" }),
1353
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => {
1354
+ const next = initialControls(state);
1330
1355
  setControls(next);
1331
- setControlsHistory((history) => history.slice(0, -1));
1356
+ setControlsHistory([]);
1357
+ setPendingControls(null);
1358
+ setBufferError(null);
1332
1359
  onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1333
- } else onChange({ ...state, draft: (0, import_content_transfer.undoDraft)(state.draft), error: void 0 });
1334
- }, children: "Undo" }),
1335
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
1336
- const next = initialControls(state);
1337
- setControls(next);
1338
- setControlsHistory([]);
1339
- setPendingControls(null);
1340
- setBufferError(null);
1341
- onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1342
- }, children: "Reset" }),
1343
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
1344
- ] }),
1345
- controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1346
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: "JSON limits" }),
1347
- [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1348
- text,
1349
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1350
- ] }, key))
1351
- ] }) : null,
1352
- rows ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RowControls, { rows, controls, change: changeControls }) : null,
1353
- state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1354
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: "Sections" }),
1355
- state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1356
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }) }),
1357
- " ",
1358
- section.label
1359
- ] }, section.id))
1360
- ] }) : null,
1361
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1362
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1363
- state.snapshot.coverage.included.toLocaleString(),
1364
- " included",
1365
- state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1366
- " \xB7 ",
1367
- state.snapshot.coverage.status
1360
+ }, children: "Reset" }),
1361
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
1368
1362
  ] }),
1369
- state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1370
- limitText ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1371
- "Limits: ",
1372
- limitText
1363
+ controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1364
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: "JSON limits" }),
1365
+ [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1366
+ text,
1367
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1368
+ ] }, key))
1373
1369
  ] }) : null,
1374
- displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { children: [
1370
+ rows ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "matrx-alchemy-options matrx-alchemy-data-controls", children: [
1375
1371
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1376
- displayedOmissions.length,
1377
- " omissions or adjustments"
1372
+ "Data selection \xB7 ",
1373
+ controls.visibleColumns.length,
1374
+ " columns",
1375
+ controls.search || controls.sort || controls.top != null || controls.selectedOnly || Object.values(controls.filters).some(Boolean) ? " \xB7 customized" : " \xB7 all rows"
1378
1376
  ] }),
1379
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { children: [
1380
- o.path || "/",
1381
- ": ",
1382
- o.reason,
1383
- o.count == null ? "" : ` (${o.count})`
1384
- ] }, `${o.path}-${o.reason}-${i}`)) })
1385
- ] }) : null
1386
- ] }),
1387
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1388
- "Output format",
1389
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1390
- formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: f, children: LABEL[f] }, f)),
1391
- state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1392
- workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1393
- ] })
1377
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "matrx-alchemy-data-controls-body", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RowControls, { rows, controls, change: changeControls }) })
1378
+ ] }) : null,
1379
+ state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "matrx-alchemy-options", children: [
1380
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1381
+ "Sections \xB7 ",
1382
+ controls.sections.length,
1383
+ " included"
1384
+ ] }),
1385
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("fieldset", { "aria-label": "Included sections", children: state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1386
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }) }),
1387
+ " ",
1388
+ section.label
1389
+ ] }, section.id)) })
1390
+ ] }) : null,
1391
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1392
+ "Output format",
1393
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1394
+ formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: f, children: LABEL[f] }, f)),
1395
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1396
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1397
+ ] })
1398
+ ] }),
1399
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }),
1400
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1401
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1402
+ state.snapshot.coverage.included.toLocaleString(),
1403
+ " included",
1404
+ state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1405
+ " \xB7 ",
1406
+ state.snapshot.coverage.status
1407
+ ] }),
1408
+ state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1409
+ limitText ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1410
+ "Limits: ",
1411
+ limitText
1412
+ ] }) : null,
1413
+ displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { children: [
1414
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1415
+ displayedOmissions.length,
1416
+ " omissions or adjustments"
1417
+ ] }),
1418
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { children: [
1419
+ o.path || "/",
1420
+ ": ",
1421
+ o.reason,
1422
+ o.count == null ? "" : ` (${o.count})`
1423
+ ] }, `${o.path}-${o.reason}-${i}`)) })
1424
+ ] }) : null
1425
+ ] }),
1426
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1427
+ formatError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1428
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1429
+ const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
1430
+ setBufferError(null);
1431
+ onChange({ ...state, draft: fallback, error: void 0 });
1432
+ setFormat("plain");
1433
+ }, children: "Use invalid JSON as plain text" }) : null
1394
1434
  ] }),
1395
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }),
1396
- bufferError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1397
- formatError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1398
- bufferError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1399
- const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
1400
- setBufferError(null);
1401
- onChange({ ...state, draft: fallback, error: void 0 });
1402
- setFormat("plain");
1403
- }, children: "Use invalid JSON as plain text" }) : null
1435
+ ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("aside", { children: [
1436
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1437
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1438
+ "AI instruction",
1439
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1440
+ ] }),
1441
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(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" }),
1442
+ busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
1443
+ ] }) : null,
1444
+ busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
1445
+ activeCapture.current?.abort();
1446
+ activeCapture.current = null;
1447
+ setBusy(null);
1448
+ }, children: "Stop loading rows" }) : null,
1449
+ ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(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,
1450
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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,
1451
+ state.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1452
+ ] }) : null
1404
1453
  ] }),
1405
- ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("aside", { children: [
1406
- ai ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1407
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1408
- "AI instruction",
1409
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1410
- ] }),
1411
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", disabled: !aiSession.current || !instruction.trim() || busy !== null || !aiSession.current.supports(state.snapshot), onClick: () => void runAi(false), children: "Generate preview" }),
1412
- busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
1413
- ] }) : null,
1414
- busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", onClick: () => {
1415
- activeCapture.current?.abort();
1416
- activeCapture.current = null;
1417
- setBusy(null);
1418
- }, children: "Stop loading rows" }) : null,
1419
- ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
1420
- ai ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
1421
- state.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1422
- ] }) : null
1454
+ pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1455
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "This control would replace your manual edit." }),
1456
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1457
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1458
+ ] }) : null,
1459
+ state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
1460
+ state.pending ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1461
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "A fresh source snapshot is ready." }),
1462
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
1463
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1464
+ ] }) : null,
1465
+ deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
1423
1466
  ] }),
1424
- pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1425
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "This control would replace your manual edit." }),
1426
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1427
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1428
- ] }) : null,
1429
- state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
1430
- state.pending ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1431
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "A fresh source snapshot is ready." }),
1432
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
1433
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1434
- ] }) : null,
1435
- deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
1436
1467
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogFooter, { children: [
1437
1468
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "matrx-alchemy-meta", children: [
1438
1469
  buffer.length.toLocaleString(),
@@ -1440,13 +1471,16 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1440
1471
  estimateTokens(buffer).toLocaleString(),
1441
1472
  " tokens"
1442
1473
  ] }),
1443
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
1444
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download prepared output" }),
1445
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy prepared output" })
1474
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
1475
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(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" }),
1476
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(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" })
1446
1477
  ] })
1447
1478
  ] }) });
1448
1479
  }
1449
1480
  function RowControls({ rows, controls, change }) {
1481
+ const filterCount = Object.values(controls.filters).filter(Boolean).length;
1482
+ const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
1483
+ 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 ");
1450
1484
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1451
1485
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1452
1486
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
@@ -1472,32 +1506,40 @@ function RowControls({ rows, controls, change }) {
1472
1506
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1473
1507
  ] })
1474
1508
  ] }),
1475
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1476
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: "Columns and filters" }),
1477
- rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-column", children: [
1509
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "matrx-alchemy-options", children: [
1510
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1511
+ "Columns and filters",
1512
+ dataSummary ? ` \u2014 ${dataSummary}` : ""
1513
+ ] }),
1514
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("fieldset", { "aria-label": "Columns and filters", children: rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-column", children: [
1478
1515
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1479
1516
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }) }),
1480
1517
  " ",
1481
1518
  column.label
1482
1519
  ] }),
1483
1520
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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 } }) })
1484
- ] }, column.id))
1521
+ ] }, column.id)) })
1485
1522
  ] }),
1486
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1487
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: "Rows" }),
1488
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1489
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
1490
- " Only selected rows"
1523
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "matrx-alchemy-options", children: [
1524
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1525
+ "Rows \u2014 ",
1526
+ selectionSummary
1491
1527
  ] }),
1492
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
1493
- const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String((0, import_content_transfer.readTransferCell)(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
1494
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1495
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }) }),
1496
- " Row ",
1497
- index + 1,
1498
- summary ? ` \u2014 ${summary}` : ""
1499
- ] }, index);
1500
- }) })
1528
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { "aria-label": "Row selection", children: [
1529
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1530
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
1531
+ " Only selected rows"
1532
+ ] }),
1533
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
1534
+ const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String((0, import_content_transfer.readTransferCell)(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
1535
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1536
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("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) }) }),
1537
+ " Row ",
1538
+ index + 1,
1539
+ summary ? ` \u2014 ${summary}` : ""
1540
+ ] }, index);
1541
+ }) })
1542
+ ] })
1501
1543
  ] })
1502
1544
  ] });
1503
1545
  }
@@ -1649,7 +1691,7 @@ function MatrxCopyMenuSession(props) {
1649
1691
  if (aiVisible && props.aiCustom)
1650
1692
  actions.push({
1651
1693
  id: "configure-source",
1652
- label: props.aiCustom.label ?? "Customize source\u2026",
1694
+ label: props.aiCustom.label ?? "Customize source",
1653
1695
  ...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
1654
1696
  supports: () => true,
1655
1697
  run: async () => {
@@ -1660,7 +1702,7 @@ function MatrxCopyMenuSession(props) {
1660
1702
  if (aiVisible && props.groomer)
1661
1703
  actions.push({
1662
1704
  id: "groom-source",
1663
- label: "Customize sections\u2026",
1705
+ label: "Customize sections",
1664
1706
  supports: () => true,
1665
1707
  run: async () => {
1666
1708
  setConfiguration({ groomer: props.groomer() });
@@ -1770,7 +1812,8 @@ function MatrxCopyMenuSession(props) {
1770
1812
  className: cn(
1771
1813
  props.className,
1772
1814
  props.size === "xs" && "matrx-alchemy-xs",
1773
- props.size === "sm" && "matrx-alchemy-sm"
1815
+ props.size === "sm" && "matrx-alchemy-sm",
1816
+ props.size === "toolbar" && "matrx-alchemy-toolbar-target"
1774
1817
  ),
1775
1818
  ...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
1776
1819
  }
@@ -1875,127 +1918,132 @@ function SourceConfiguration({
1875
1918
  event.preventDefault();
1876
1919
  if (!handingOff.current) restoreFocus();
1877
1920
  },
1878
- className: "matrx-alchemy-workspace",
1921
+ className: "matrx-alchemy-workspace matrx-alchemy-configuration",
1879
1922
  children: [
1880
1923
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogHeader, { children: [
1881
1924
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogTitle, { children: title }),
1882
1925
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
1883
1926
  ] }),
1884
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
1885
- custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
1886
- option.label,
1887
- "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: option.hint }) : null,
1888
- option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1889
- "input",
1890
- {
1891
- type: "checkbox",
1892
- checked: Boolean(values[option.key]),
1893
- onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
1894
- }
1895
- ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1896
- "select",
1897
- {
1898
- value: Number(values[option.key]),
1899
- onChange: (event) => setValues({
1900
- ...values,
1901
- [option.key]: Number(event.target.value)
1902
- }),
1903
- children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
1904
- }
1905
- ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1906
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1927
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1928
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
1929
+ custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
1930
+ option.label,
1931
+ "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: option.hint }) : null,
1932
+ option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1907
1933
  "input",
1908
1934
  {
1909
- type: "range",
1910
- min: 0,
1911
- max: Math.max(0, option.stops.length - 1),
1912
- step: 1,
1913
- value: option.stops.indexOf(Number(values[option.key])),
1914
- onChange: (event) => setValues({
1915
- ...values,
1916
- [option.key]: option.stops[Number(event.target.value)]
1917
- })
1935
+ type: "checkbox",
1936
+ checked: Boolean(values[option.key]),
1937
+ onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
1918
1938
  }
1919
- ),
1920
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
1921
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1922
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1923
- "input",
1939
+ ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1940
+ "select",
1924
1941
  {
1925
- type: "number",
1926
- min: option.min,
1927
- step: option.step,
1928
1942
  value: Number(values[option.key]),
1929
1943
  onChange: (event) => setValues({
1930
1944
  ...values,
1931
1945
  [option.key]: Number(event.target.value)
1932
- })
1946
+ }),
1947
+ children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
1933
1948
  }
1934
- ),
1935
- option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1949
+ ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1950
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1951
+ "input",
1952
+ {
1953
+ type: "range",
1954
+ min: 0,
1955
+ max: Math.max(0, option.stops.length - 1),
1956
+ step: 1,
1957
+ value: option.stops.indexOf(Number(values[option.key])),
1958
+ onChange: (event) => setValues({
1959
+ ...values,
1960
+ [option.key]: option.stops[Number(event.target.value)]
1961
+ })
1962
+ }
1963
+ ),
1964
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
1965
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1966
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1967
+ "input",
1968
+ {
1969
+ type: "number",
1970
+ min: option.min,
1971
+ step: option.step,
1972
+ value: Number(values[option.key]),
1973
+ onChange: (event) => setValues({
1974
+ ...values,
1975
+ [option.key]: Number(event.target.value)
1976
+ })
1977
+ }
1978
+ ),
1979
+ option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1980
+ Button,
1981
+ {
1982
+ type: "button",
1983
+ variant: "ghost",
1984
+ className: "matrx-alchemy-workspace-secondary",
1985
+ onClick: () => setValues({ ...values, [option.key]: preset.value }),
1986
+ children: preset.label
1987
+ },
1988
+ preset.value
1989
+ ))
1990
+ ] })
1991
+ ] }, option.key)),
1992
+ groomer ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1993
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1936
1994
  Button,
1937
1995
  {
1938
1996
  type: "button",
1939
1997
  variant: "ghost",
1940
- onClick: () => setValues({ ...values, [option.key]: preset.value }),
1941
- children: preset.label
1998
+ className: "matrx-alchemy-workspace-secondary",
1999
+ onClick: () => setSections(
2000
+ Object.fromEntries(
2001
+ groomer.sections.map((section) => [
2002
+ section.id,
2003
+ level === "brief" && section.cuttable ? "off" : level
2004
+ ])
2005
+ )
2006
+ ),
2007
+ children: level
1942
2008
  },
1943
- preset.value
1944
- ))
1945
- ] })
1946
- ] }, option.key)),
1947
- groomer ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1948
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1949
- Button,
1950
- {
1951
- type: "button",
1952
- variant: "ghost",
1953
- onClick: () => setSections(
1954
- Object.fromEntries(
1955
- groomer.sections.map((section) => [
1956
- section.id,
1957
- level === "brief" && section.cuttable ? "off" : level
1958
- ])
1959
- )
2009
+ level
2010
+ )) }),
2011
+ groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
2012
+ section.title,
2013
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2014
+ "select",
2015
+ {
2016
+ value: sections[section.id],
2017
+ onChange: (event) => setSections({
2018
+ ...sections,
2019
+ [section.id]: event.target.value
2020
+ }),
2021
+ children: [
2022
+ ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
2023
+ section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "off", children: "Exclude" }) : null
2024
+ ]
2025
+ }
1960
2026
  ),
1961
- children: level
1962
- },
1963
- level
1964
- )) }),
1965
- groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
1966
- section.title,
1967
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
1968
- "select",
1969
- {
1970
- value: sections[section.id],
1971
- onChange: (event) => setSections({
1972
- ...sections,
1973
- [section.id]: event.target.value
1974
- }),
1975
- children: [
1976
- ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
1977
- section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "off", children: "Exclude" }) : null
1978
- ]
1979
- }
1980
- ),
1981
- section.description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: section.description }) : null
1982
- ] }, section.id))
1983
- ] }) : null
1984
- ] }),
1985
- /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
1986
- text.length.toLocaleString(),
1987
- " characters \xB7 approximately",
1988
- " ",
1989
- Math.ceil(text.length / 4).toLocaleString(),
1990
- " tokens"
2027
+ section.description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: section.description }) : null
2028
+ ] }, section.id))
2029
+ ] }) : null
2030
+ ] }),
2031
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
2032
+ text.length.toLocaleString(),
2033
+ " characters \xB7 approximately",
2034
+ " ",
2035
+ Math.ceil(text.length / 4).toLocaleString(),
2036
+ " tokens"
2037
+ ] }),
2038
+ error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { role: "alert", children: error ?? buildError }) : null
1991
2039
  ] }),
1992
- error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { role: "alert", children: error ?? buildError }) : null,
1993
2040
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogFooter, { children: [
1994
2041
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1995
2042
  Button,
1996
2043
  {
1997
2044
  type: "button",
1998
2045
  variant: "ghost",
2046
+ className: "matrx-alchemy-workspace-secondary",
1999
2047
  disabled: busy,
2000
2048
  onClick: onClose,
2001
2049
  children: "Cancel"
@@ -2005,6 +2053,7 @@ function SourceConfiguration({
2005
2053
  Button,
2006
2054
  {
2007
2055
  type: "button",
2056
+ className: "matrx-alchemy-workspace-primary",
2008
2057
  disabled: busy || !prepared || Boolean(buildError),
2009
2058
  onClick: async () => {
2010
2059
  if (!prepared) return;