@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
@@ -476,14 +476,14 @@ var PopoverContent = React6.forwardRef(
476
476
  );
477
477
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
478
478
 
479
+ // src/content-transfer/icon.ts
480
+ 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"];
481
+ 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>`;
482
+
479
483
  // src/content-transfer/index.tsx
480
484
  var import_jsx_runtime7 = require("react/jsx-runtime");
481
485
  function AlchemyGlyph(props) {
482
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
483
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M4.5 5.5h8v11h-8z" }),
484
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M8.5 9.5h8v9h-8z" }),
485
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
486
- ] });
486
+ return /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)("path", { d }, d)) });
487
487
  }
488
488
  var CapabilityContext = React7.createContext({});
489
489
  var useContentTransferCapabilities = () => React7.useContext(CapabilityContext);
@@ -497,7 +497,16 @@ function MenuPresentation({ label, hint, icon: Icon2 }) {
497
497
  ] })
498
498
  ] });
499
499
  }
500
- function PaletteGlyph({ format, ai = false, file = false }) {
500
+ function PaletteGlyph({ format, ai = false, file = false, kind }) {
501
+ if (kind === "ai-copy") return /* @__PURE__ */ (0, import_jsx_runtime7.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: [
502
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("rect", { x: "5", y: "5", width: "11", height: "14", rx: "2" }),
503
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M9 3h6a2 2 0 0 1 2 2v10" }),
504
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "m18.5 3 .55 1.45L20.5 5l-1.45.55L18.5 7l-.55-1.45L16.5 5l1.45-.55z" })
505
+ ] });
506
+ if (kind === "sliders") return /* @__PURE__ */ (0, import_jsx_runtime7.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: [
507
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M4 6h16M4 12h16M4 18h16" }),
508
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M8 3v6M16 9v6M10 15v6" })
509
+ ] });
501
510
  if (ai) return /* @__PURE__ */ (0, import_jsx_runtime7.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: [
502
511
  /* @__PURE__ */ (0, import_jsx_runtime7.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" }),
503
512
  /* @__PURE__ */ (0, import_jsx_runtime7.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" }),
@@ -530,15 +539,15 @@ function PaletteGlyph({ format, ai = false, file = false }) {
530
539
  ] }) : format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M15 6h6M3 6h7M3 12h18M3 18h12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
531
540
  return /* @__PURE__ */ (0, import_jsx_runtime7.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 });
532
541
  }
533
- function PaletteRows({ title, items, onRun, extra, ai = false }) {
542
+ function PaletteRows({ title, items, onRun, extra, ai = false, glyphKind, fallbackHint }) {
534
543
  if (!items.length && !extra) return null;
535
544
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "matrx-alchemy-palette-section", children: [
536
545
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: title }),
537
546
  items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("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__ */ (0, import_jsx_runtime7.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteGlyph, { ai }),
547
+ item.icon ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteGlyph, { ai, ...glyphKind ? { kind: glyphKind } : {} }),
539
548
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
540
549
  item.copyLabel ?? item.label,
541
- item.hint ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint }) : null
550
+ item.hint ?? fallbackHint ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint ?? fallbackHint }) : null
542
551
  ] })
543
552
  ] }, item.id)),
544
553
  extra
@@ -935,45 +944,54 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
935
944
  }, children: [
936
945
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)(AlchemyGlyph, {}) }) }),
937
946
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(PopoverContent, { align: "end", className: "matrx-alchemy-menu matrx-alchemy-palette", "aria-label": "Alchemy output options", onCloseAutoFocus: () => triggerRef.current?.focus(), children: [
938
- copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
939
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
940
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
941
- ] }) : null,
942
947
  menuStatus === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "matrx-alchemy-palette-status", children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "matrx-alchemy-error", children: menuStatus }) : null,
943
- resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
944
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
945
- 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]}` })),
946
- visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
947
- ] }),
948
- quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
948
+ copyAvailable || downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "matrx-alchemy-output", children: [
949
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h3", { children: resolvedMode === "copy" ? "Copy as" : "Download as" }),
950
+ copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
951
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
952
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
953
+ ] }) : null,
954
+ resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
955
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
956
+ 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]}` })),
957
+ visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
958
+ ] }),
959
+ quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
960
+ closePalette();
961
+ void transfer("markdown", false, variant);
962
+ } }) : null
963
+ ] }) : null,
964
+ resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
965
+ 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]}` })),
966
+ visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
967
+ downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
968
+ ] }) }) : null
969
+ ] }) : null,
970
+ prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
971
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Copy for AI", ai: true, glyphKind: "ai-copy", fallbackHint: "Copies immediately", items: quickVariants("ai"), onRun: (variant) => {
949
972
  closePalette();
950
973
  void transfer("markdown", false, variant);
951
- } }) : null
974
+ } }),
975
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Edit and prepare", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": "Prepare for AI", onClick: () => {
976
+ closePalette();
977
+ void openWorkspace();
978
+ }, children: [
979
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteGlyph, { kind: "sliders" }),
980
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
981
+ "Prepare for AI",
982
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { className: "matrx-alchemy-menu-hint", children: "Review and edit before copying" })
983
+ ] })
984
+ ] }) })
952
985
  ] }) : null,
953
- resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_jsx_runtime7.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
954
- 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]}` })),
955
- visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
956
- downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
957
- ] }) }) : null,
958
- prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Prepare", ai: true, items: quickVariants("ai"), onRun: (variant) => {
959
- closePalette();
960
- void transfer("markdown", false, variant);
961
- }, extra: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
962
- closePalette();
963
- void openWorkspace();
964
- }, children: [
965
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteGlyph, { ai: true }),
966
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Prepare for AI\u2026" })
967
- ] }) }) : null,
968
- prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Context", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
986
+ prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Other sources", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
969
987
  nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
970
988
  closePalette();
971
989
  void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
972
- }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Prepare this surface\u2026" }) }) : null,
990
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: "Prepare this surface" }) }) : null,
973
991
  variants.map((variant) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
974
992
  closePalette();
975
993
  void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
976
- }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
994
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}` }) }, variant.id))
977
995
  ] }) }) : null,
978
996
  ordinaryActions.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(PaletteRows, { title: "Actions", items: [], extra: ordinaryActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
979
997
  closePalette();
@@ -1251,137 +1269,150 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1251
1269
  state.snapshot.label
1252
1270
  ] }),
1253
1271
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogDescription, { children: [
1254
- "Captured ",
1255
- state.snapshot.unsavedChanges ? "from your unsaved draft" : "as an immutable snapshot",
1256
- ". Your source is never edited."
1272
+ state.snapshot.unsavedChanges ? "Includes your unsaved changes. " : "",
1273
+ "Review and edit this copy. Your original stays unchanged."
1257
1274
  ] })
1258
1275
  ] }),
1259
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
1260
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "matrx-alchemy-main", children: [
1261
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1262
- scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1263
- "Scope",
1264
- /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
1265
- ] }) : null,
1266
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1267
- "Detail",
1268
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
1269
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "full", children: "Full" }),
1270
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "compact", children: "Compact" }),
1271
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "brief", children: "Brief" }),
1272
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "custom", children: "Custom" })
1273
- ] })
1274
- ] }),
1275
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
1276
- setBufferError(null);
1277
- if (controlsHistory.length) {
1278
- const next = controlsHistory[controlsHistory.length - 1];
1276
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1277
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
1278
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "matrx-alchemy-main", children: [
1279
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1280
+ scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1281
+ "Scope",
1282
+ /* @__PURE__ */ (0, import_jsx_runtime7.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_runtime7.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
1283
+ ] }) : null,
1284
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1285
+ "Detail",
1286
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
1287
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "full", children: "Full" }),
1288
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "compact", children: "Compact" }),
1289
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "brief", children: "Brief" }),
1290
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "custom", children: "Custom" })
1291
+ ] })
1292
+ ] }),
1293
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
1294
+ setBufferError(null);
1295
+ if (controlsHistory.length) {
1296
+ const next = controlsHistory[controlsHistory.length - 1];
1297
+ setControls(next);
1298
+ setControlsHistory((history) => history.slice(0, -1));
1299
+ onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1300
+ } else onChange({ ...state, draft: (0, import_content_transfer.undoDraft)(state.draft), error: void 0 });
1301
+ }, children: "Undo" }),
1302
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => {
1303
+ const next = initialControls(state);
1279
1304
  setControls(next);
1280
- setControlsHistory((history) => history.slice(0, -1));
1305
+ setControlsHistory([]);
1306
+ setPendingControls(null);
1307
+ setBufferError(null);
1281
1308
  onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1282
- } else onChange({ ...state, draft: (0, import_content_transfer.undoDraft)(state.draft), error: void 0 });
1283
- }, children: "Undo" }),
1284
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
1285
- const next = initialControls(state);
1286
- setControls(next);
1287
- setControlsHistory([]);
1288
- setPendingControls(null);
1289
- setBufferError(null);
1290
- onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1291
- }, children: "Reset" }),
1292
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
1293
- ] }),
1294
- controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1295
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: "JSON limits" }),
1296
- [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1297
- text,
1298
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1299
- ] }, key))
1300
- ] }) : null,
1301
- rows ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowControls, { rows, controls, change: changeControls }) : null,
1302
- state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1303
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: "Sections" }),
1304
- state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1305
- /* @__PURE__ */ (0, import_jsx_runtime7.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) }) }),
1306
- " ",
1307
- section.label
1308
- ] }, section.id))
1309
- ] }) : null,
1310
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1311
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1312
- state.snapshot.coverage.included.toLocaleString(),
1313
- " included",
1314
- state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1315
- " \xB7 ",
1316
- state.snapshot.coverage.status
1309
+ }, children: "Reset" }),
1310
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
1317
1311
  ] }),
1318
- state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1319
- limitText ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1320
- "Limits: ",
1321
- limitText
1312
+ controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1313
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: "JSON limits" }),
1314
+ [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1315
+ text,
1316
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1317
+ ] }, key))
1322
1318
  ] }) : null,
1323
- displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
1319
+ rows ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "matrx-alchemy-options matrx-alchemy-data-controls", children: [
1324
1320
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1325
- displayedOmissions.length,
1326
- " omissions or adjustments"
1321
+ "Data selection \xB7 ",
1322
+ controls.visibleColumns.length,
1323
+ " columns",
1324
+ controls.search || controls.sort || controls.top != null || controls.selectedOnly || Object.values(controls.filters).some(Boolean) ? " \xB7 customized" : " \xB7 all rows"
1327
1325
  ] }),
1328
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
1329
- o.path || "/",
1330
- ": ",
1331
- o.reason,
1332
- o.count == null ? "" : ` (${o.count})`
1333
- ] }, `${o.path}-${o.reason}-${i}`)) })
1334
- ] }) : null
1335
- ] }),
1336
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1337
- "Output format",
1338
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1339
- formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: f, children: LABEL[f] }, f)),
1340
- state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1341
- workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1342
- ] })
1326
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "matrx-alchemy-data-controls-body", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowControls, { rows, controls, change: changeControls }) })
1327
+ ] }) : null,
1328
+ state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "matrx-alchemy-options", children: [
1329
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1330
+ "Sections \xB7 ",
1331
+ controls.sections.length,
1332
+ " included"
1333
+ ] }),
1334
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { "aria-label": "Included sections", children: state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1335
+ /* @__PURE__ */ (0, import_jsx_runtime7.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) }) }),
1336
+ " ",
1337
+ section.label
1338
+ ] }, section.id)) })
1339
+ ] }) : null,
1340
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1341
+ "Output format",
1342
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1343
+ formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: f, children: LABEL[f] }, f)),
1344
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1345
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1346
+ ] })
1347
+ ] }),
1348
+ /* @__PURE__ */ (0, import_jsx_runtime7.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) }),
1349
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1350
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1351
+ state.snapshot.coverage.included.toLocaleString(),
1352
+ " included",
1353
+ state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1354
+ " \xB7 ",
1355
+ state.snapshot.coverage.status
1356
+ ] }),
1357
+ state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1358
+ limitText ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1359
+ "Limits: ",
1360
+ limitText
1361
+ ] }) : null,
1362
+ displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
1363
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1364
+ displayedOmissions.length,
1365
+ " omissions or adjustments"
1366
+ ] }),
1367
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
1368
+ o.path || "/",
1369
+ ": ",
1370
+ o.reason,
1371
+ o.count == null ? "" : ` (${o.count})`
1372
+ ] }, `${o.path}-${o.reason}-${i}`)) })
1373
+ ] }) : null
1374
+ ] }),
1375
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1376
+ formatError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1377
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1378
+ const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
1379
+ setBufferError(null);
1380
+ onChange({ ...state, draft: fallback, error: void 0 });
1381
+ setFormat("plain");
1382
+ }, children: "Use invalid JSON as plain text" }) : null
1343
1383
  ] }),
1344
- /* @__PURE__ */ (0, import_jsx_runtime7.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) }),
1345
- bufferError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1346
- formatError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1347
- bufferError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1348
- const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
1349
- setBufferError(null);
1350
- onChange({ ...state, draft: fallback, error: void 0 });
1351
- setFormat("plain");
1352
- }, children: "Use invalid JSON as plain text" }) : null
1384
+ ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("aside", { children: [
1385
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1386
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1387
+ "AI instruction",
1388
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1389
+ ] }),
1390
+ /* @__PURE__ */ (0, import_jsx_runtime7.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" }),
1391
+ busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
1392
+ ] }) : null,
1393
+ busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
1394
+ activeCapture.current?.abort();
1395
+ activeCapture.current = null;
1396
+ setBusy(null);
1397
+ }, children: "Stop loading rows" }) : null,
1398
+ ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime7.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,
1399
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime7.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,
1400
+ state.error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1401
+ ] }) : null
1353
1402
  ] }),
1354
- ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("aside", { children: [
1355
- ai ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1356
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1357
- "AI instruction",
1358
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1359
- ] }),
1360
- /* @__PURE__ */ (0, import_jsx_runtime7.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" }),
1361
- busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
1362
- ] }) : null,
1363
- busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", onClick: () => {
1364
- activeCapture.current?.abort();
1365
- activeCapture.current = null;
1366
- setBusy(null);
1367
- }, children: "Stop loading rows" }) : null,
1368
- ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
1369
- ai ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
1370
- state.error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1371
- ] }) : null
1403
+ pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1404
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "This control would replace your manual edit." }),
1405
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1406
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1407
+ ] }) : null,
1408
+ state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
1409
+ state.pending ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1410
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "A fresh source snapshot is ready." }),
1411
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
1412
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1413
+ ] }) : null,
1414
+ deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
1372
1415
  ] }),
1373
- pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1374
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "This control would replace your manual edit." }),
1375
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1376
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1377
- ] }) : null,
1378
- state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
1379
- state.pending ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1380
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "A fresh source snapshot is ready." }),
1381
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
1382
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1383
- ] }) : null,
1384
- deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
1385
1416
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogFooter, { children: [
1386
1417
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "matrx-alchemy-meta", children: [
1387
1418
  buffer.length.toLocaleString(),
@@ -1389,13 +1420,16 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1389
1420
  estimateTokens(buffer).toLocaleString(),
1390
1421
  " tokens"
1391
1422
  ] }),
1392
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
1393
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download prepared output" }),
1394
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy prepared output" })
1423
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
1424
+ /* @__PURE__ */ (0, import_jsx_runtime7.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" }),
1425
+ /* @__PURE__ */ (0, import_jsx_runtime7.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" })
1395
1426
  ] })
1396
1427
  ] }) });
1397
1428
  }
1398
1429
  function RowControls({ rows, controls, change }) {
1430
+ const filterCount = Object.values(controls.filters).filter(Boolean).length;
1431
+ const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
1432
+ 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 ");
1399
1433
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1400
1434
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1401
1435
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
@@ -1421,32 +1455,40 @@ function RowControls({ rows, controls, change }) {
1421
1455
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1422
1456
  ] })
1423
1457
  ] }),
1424
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1425
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: "Columns and filters" }),
1426
- rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-column", children: [
1458
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "matrx-alchemy-options", children: [
1459
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1460
+ "Columns and filters",
1461
+ dataSummary ? ` \u2014 ${dataSummary}` : ""
1462
+ ] }),
1463
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("fieldset", { "aria-label": "Columns and filters", children: rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-column", children: [
1427
1464
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1428
1465
  /* @__PURE__ */ (0, import_jsx_runtime7.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) }) }),
1429
1466
  " ",
1430
1467
  column.label
1431
1468
  ] }),
1432
1469
  /* @__PURE__ */ (0, import_jsx_runtime7.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 } }) })
1433
- ] }, column.id))
1470
+ ] }, column.id)) })
1434
1471
  ] }),
1435
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1436
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: "Rows" }),
1437
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1438
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
1439
- " Only selected rows"
1472
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "matrx-alchemy-options", children: [
1473
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1474
+ "Rows \u2014 ",
1475
+ selectionSummary
1440
1476
  ] }),
1441
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
1442
- 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 ");
1443
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1444
- /* @__PURE__ */ (0, import_jsx_runtime7.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) }) }),
1445
- " Row ",
1446
- index + 1,
1447
- summary ? ` \u2014 ${summary}` : ""
1448
- ] }, index);
1449
- }) })
1477
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { "aria-label": "Row selection", children: [
1478
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1479
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
1480
+ " Only selected rows"
1481
+ ] }),
1482
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
1483
+ 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 ");
1484
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1485
+ /* @__PURE__ */ (0, import_jsx_runtime7.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) }) }),
1486
+ " Row ",
1487
+ index + 1,
1488
+ summary ? ` \u2014 ${summary}` : ""
1489
+ ] }, index);
1490
+ }) })
1491
+ ] })
1450
1492
  ] })
1451
1493
  ] });
1452
1494
  }
@@ -1598,7 +1640,7 @@ function MatrxCopyMenuSession(props) {
1598
1640
  if (aiVisible && props.aiCustom)
1599
1641
  actions.push({
1600
1642
  id: "configure-source",
1601
- label: props.aiCustom.label ?? "Customize source\u2026",
1643
+ label: props.aiCustom.label ?? "Customize source",
1602
1644
  ...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
1603
1645
  supports: () => true,
1604
1646
  run: async () => {
@@ -1609,7 +1651,7 @@ function MatrxCopyMenuSession(props) {
1609
1651
  if (aiVisible && props.groomer)
1610
1652
  actions.push({
1611
1653
  id: "groom-source",
1612
- label: "Customize sections\u2026",
1654
+ label: "Customize sections",
1613
1655
  supports: () => true,
1614
1656
  run: async () => {
1615
1657
  setConfiguration({ groomer: props.groomer() });
@@ -1719,7 +1761,8 @@ function MatrxCopyMenuSession(props) {
1719
1761
  className: cn(
1720
1762
  props.className,
1721
1763
  props.size === "xs" && "matrx-alchemy-xs",
1722
- props.size === "sm" && "matrx-alchemy-sm"
1764
+ props.size === "sm" && "matrx-alchemy-sm",
1765
+ props.size === "toolbar" && "matrx-alchemy-toolbar-target"
1723
1766
  ),
1724
1767
  ...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
1725
1768
  }
@@ -1824,127 +1867,132 @@ function SourceConfiguration({
1824
1867
  event.preventDefault();
1825
1868
  if (!handingOff.current) restoreFocus();
1826
1869
  },
1827
- className: "matrx-alchemy-workspace",
1870
+ className: "matrx-alchemy-workspace matrx-alchemy-configuration",
1828
1871
  children: [
1829
1872
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogHeader, { children: [
1830
1873
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogTitle, { children: title }),
1831
1874
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
1832
1875
  ] }),
1833
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
1834
- custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1835
- option.label,
1836
- "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: option.hint }) : null,
1837
- option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1838
- "input",
1839
- {
1840
- type: "checkbox",
1841
- checked: Boolean(values[option.key]),
1842
- onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
1843
- }
1844
- ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1845
- "select",
1846
- {
1847
- value: Number(values[option.key]),
1848
- onChange: (event) => setValues({
1849
- ...values,
1850
- [option.key]: Number(event.target.value)
1851
- }),
1852
- children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
1853
- }
1854
- ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1855
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1876
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1877
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
1878
+ custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1879
+ option.label,
1880
+ "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: option.hint }) : null,
1881
+ option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1856
1882
  "input",
1857
1883
  {
1858
- type: "range",
1859
- min: 0,
1860
- max: Math.max(0, option.stops.length - 1),
1861
- step: 1,
1862
- value: option.stops.indexOf(Number(values[option.key])),
1863
- onChange: (event) => setValues({
1864
- ...values,
1865
- [option.key]: option.stops[Number(event.target.value)]
1866
- })
1884
+ type: "checkbox",
1885
+ checked: Boolean(values[option.key]),
1886
+ onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
1867
1887
  }
1868
- ),
1869
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
1870
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1871
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1872
- "input",
1888
+ ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1889
+ "select",
1873
1890
  {
1874
- type: "number",
1875
- min: option.min,
1876
- step: option.step,
1877
1891
  value: Number(values[option.key]),
1878
1892
  onChange: (event) => setValues({
1879
1893
  ...values,
1880
1894
  [option.key]: Number(event.target.value)
1881
- })
1895
+ }),
1896
+ children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
1882
1897
  }
1883
- ),
1884
- option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1898
+ ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1899
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1900
+ "input",
1901
+ {
1902
+ type: "range",
1903
+ min: 0,
1904
+ max: Math.max(0, option.stops.length - 1),
1905
+ step: 1,
1906
+ value: option.stops.indexOf(Number(values[option.key])),
1907
+ onChange: (event) => setValues({
1908
+ ...values,
1909
+ [option.key]: option.stops[Number(event.target.value)]
1910
+ })
1911
+ }
1912
+ ),
1913
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
1914
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1915
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1916
+ "input",
1917
+ {
1918
+ type: "number",
1919
+ min: option.min,
1920
+ step: option.step,
1921
+ value: Number(values[option.key]),
1922
+ onChange: (event) => setValues({
1923
+ ...values,
1924
+ [option.key]: Number(event.target.value)
1925
+ })
1926
+ }
1927
+ ),
1928
+ option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1929
+ Button,
1930
+ {
1931
+ type: "button",
1932
+ variant: "ghost",
1933
+ className: "matrx-alchemy-workspace-secondary",
1934
+ onClick: () => setValues({ ...values, [option.key]: preset.value }),
1935
+ children: preset.label
1936
+ },
1937
+ preset.value
1938
+ ))
1939
+ ] })
1940
+ ] }, option.key)),
1941
+ groomer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1942
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1885
1943
  Button,
1886
1944
  {
1887
1945
  type: "button",
1888
1946
  variant: "ghost",
1889
- onClick: () => setValues({ ...values, [option.key]: preset.value }),
1890
- children: preset.label
1947
+ className: "matrx-alchemy-workspace-secondary",
1948
+ onClick: () => setSections(
1949
+ Object.fromEntries(
1950
+ groomer.sections.map((section) => [
1951
+ section.id,
1952
+ level === "brief" && section.cuttable ? "off" : level
1953
+ ])
1954
+ )
1955
+ ),
1956
+ children: level
1891
1957
  },
1892
- preset.value
1893
- ))
1894
- ] })
1895
- ] }, option.key)),
1896
- groomer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1897
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1898
- Button,
1899
- {
1900
- type: "button",
1901
- variant: "ghost",
1902
- onClick: () => setSections(
1903
- Object.fromEntries(
1904
- groomer.sections.map((section) => [
1905
- section.id,
1906
- level === "brief" && section.cuttable ? "off" : level
1907
- ])
1908
- )
1958
+ level
1959
+ )) }),
1960
+ groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1961
+ section.title,
1962
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1963
+ "select",
1964
+ {
1965
+ value: sections[section.id],
1966
+ onChange: (event) => setSections({
1967
+ ...sections,
1968
+ [section.id]: event.target.value
1969
+ }),
1970
+ children: [
1971
+ ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
1972
+ section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "off", children: "Exclude" }) : null
1973
+ ]
1974
+ }
1909
1975
  ),
1910
- children: level
1911
- },
1912
- level
1913
- )) }),
1914
- groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1915
- section.title,
1916
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1917
- "select",
1918
- {
1919
- value: sections[section.id],
1920
- onChange: (event) => setSections({
1921
- ...sections,
1922
- [section.id]: event.target.value
1923
- }),
1924
- children: [
1925
- ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
1926
- section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "off", children: "Exclude" }) : null
1927
- ]
1928
- }
1929
- ),
1930
- section.description ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: section.description }) : null
1931
- ] }, section.id))
1932
- ] }) : null
1933
- ] }),
1934
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { children: [
1935
- text.length.toLocaleString(),
1936
- " characters \xB7 approximately",
1937
- " ",
1938
- Math.ceil(text.length / 4).toLocaleString(),
1939
- " tokens"
1976
+ section.description ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: section.description }) : null
1977
+ ] }, section.id))
1978
+ ] }) : null
1979
+ ] }),
1980
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { children: [
1981
+ text.length.toLocaleString(),
1982
+ " characters \xB7 approximately",
1983
+ " ",
1984
+ Math.ceil(text.length / 4).toLocaleString(),
1985
+ " tokens"
1986
+ ] }),
1987
+ error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", children: error ?? buildError }) : null
1940
1988
  ] }),
1941
- error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", children: error ?? buildError }) : null,
1942
1989
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogFooter, { children: [
1943
1990
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1944
1991
  Button,
1945
1992
  {
1946
1993
  type: "button",
1947
1994
  variant: "ghost",
1995
+ className: "matrx-alchemy-workspace-secondary",
1948
1996
  disabled: busy,
1949
1997
  onClick: onClose,
1950
1998
  children: "Cancel"
@@ -1954,6 +2002,7 @@ function SourceConfiguration({
1954
2002
  Button,
1955
2003
  {
1956
2004
  type: "button",
2005
+ className: "matrx-alchemy-workspace-primary",
1957
2006
  disabled: busy || !prepared || Boolean(buildError),
1958
2007
  onClick: async () => {
1959
2008
  if (!prepared) return;