@ai-matrx/design-system 0.18.10 → 0.18.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +23 -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 +312 -278
  10. package/dist/content-transfer.cjs.map +1 -1
  11. package/dist/content-transfer.css +87 -24
  12. package/dist/content-transfer.d.cts +1 -1
  13. package/dist/content-transfer.d.ts +1 -1
  14. package/dist/content-transfer.js +312 -278
  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 +314 -277
  22. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  23. package/dist/data-table/data-row-inspector.js +314 -277
  24. package/dist/data-table/data-row-inspector.js.map +1 -1
  25. package/dist/data-table/data-row-window.cjs +314 -277
  26. package/dist/data-table/data-row-window.cjs.map +1 -1
  27. package/dist/data-table/data-row-window.js +314 -277
  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 +452 -399
  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 +453 -400
  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,138 @@ 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))
1369
+ ] }) : null,
1370
+ rows ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RowControls, { rows, controls, change: changeControls }) : null,
1371
+ state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1372
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: "Sections" }),
1373
+ state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1374
+ /* @__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) }) }),
1375
+ " ",
1376
+ section.label
1377
+ ] }, section.id))
1373
1378
  ] }) : null,
1374
- displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { children: [
1375
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1376
- displayedOmissions.length,
1377
- " omissions or adjustments"
1379
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1380
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1381
+ state.snapshot.coverage.included.toLocaleString(),
1382
+ " included",
1383
+ state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1384
+ " \xB7 ",
1385
+ state.snapshot.coverage.status
1378
1386
  ] }),
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
- ] })
1387
+ state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1388
+ limitText ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { children: [
1389
+ "Limits: ",
1390
+ limitText
1391
+ ] }) : null,
1392
+ displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { children: [
1393
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1394
+ displayedOmissions.length,
1395
+ " omissions or adjustments"
1396
+ ] }),
1397
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("li", { children: [
1398
+ o.path || "/",
1399
+ ": ",
1400
+ o.reason,
1401
+ o.count == null ? "" : ` (${o.count})`
1402
+ ] }, `${o.path}-${o.reason}-${i}`)) })
1403
+ ] }) : null
1404
+ ] }),
1405
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1406
+ "Output format",
1407
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1408
+ formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: f, children: LABEL[f] }, f)),
1409
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1410
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1411
+ ] })
1412
+ ] }),
1413
+ /* @__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) }),
1414
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1415
+ formatError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1416
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1417
+ const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
1418
+ setBufferError(null);
1419
+ onChange({ ...state, draft: fallback, error: void 0 });
1420
+ setFormat("plain");
1421
+ }, children: "Use invalid JSON as plain text" }) : null
1394
1422
  ] }),
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
1423
+ ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("aside", { children: [
1424
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1425
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1426
+ "AI instruction",
1427
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1428
+ ] }),
1429
+ /* @__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" }),
1430
+ 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
1431
+ ] }) : null,
1432
+ busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
1433
+ activeCapture.current?.abort();
1434
+ activeCapture.current = null;
1435
+ setBusy(null);
1436
+ }, children: "Stop loading rows" }) : null,
1437
+ 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,
1438
+ 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,
1439
+ state.error ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1440
+ ] }) : null
1404
1441
  ] }),
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
1442
+ pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1443
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "This control would replace your manual edit." }),
1444
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1445
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1446
+ ] }) : null,
1447
+ 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,
1448
+ state.pending ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1449
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: "A fresh source snapshot is ready." }),
1450
+ /* @__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" }),
1451
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1452
+ ] }) : null,
1453
+ deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
1423
1454
  ] }),
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
1455
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(DialogFooter, { children: [
1437
1456
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "matrx-alchemy-meta", children: [
1438
1457
  buffer.length.toLocaleString(),
@@ -1440,13 +1459,16 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1440
1459
  estimateTokens(buffer).toLocaleString(),
1441
1460
  " tokens"
1442
1461
  ] }),
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" })
1462
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
1463
+ /* @__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" }),
1464
+ /* @__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
1465
  ] })
1447
1466
  ] }) });
1448
1467
  }
1449
1468
  function RowControls({ rows, controls, change }) {
1469
+ const filterCount = Object.values(controls.filters).filter(Boolean).length;
1470
+ const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
1471
+ 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
1472
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1451
1473
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1452
1474
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
@@ -1472,32 +1494,40 @@ function RowControls({ rows, controls, change }) {
1472
1494
  /* @__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
1495
  ] })
1474
1496
  ] }),
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: [
1497
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "matrx-alchemy-options", children: [
1498
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1499
+ "Columns and filters",
1500
+ dataSummary ? ` \u2014 ${dataSummary}` : ""
1501
+ ] }),
1502
+ /* @__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
1503
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1479
1504
  /* @__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
1505
  " ",
1481
1506
  column.label
1482
1507
  ] }),
1483
1508
  /* @__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))
1509
+ ] }, column.id)) })
1485
1510
  ] }),
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"
1511
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "matrx-alchemy-options", children: [
1512
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { children: [
1513
+ "Rows \u2014 ",
1514
+ selectionSummary
1491
1515
  ] }),
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
- }) })
1516
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { "aria-label": "Row selection", children: [
1517
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1518
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
1519
+ " Only selected rows"
1520
+ ] }),
1521
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
1522
+ 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 ");
1523
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { children: [
1524
+ /* @__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) }) }),
1525
+ " Row ",
1526
+ index + 1,
1527
+ summary ? ` \u2014 ${summary}` : ""
1528
+ ] }, index);
1529
+ }) })
1530
+ ] })
1501
1531
  ] })
1502
1532
  ] });
1503
1533
  }
@@ -1649,7 +1679,7 @@ function MatrxCopyMenuSession(props) {
1649
1679
  if (aiVisible && props.aiCustom)
1650
1680
  actions.push({
1651
1681
  id: "configure-source",
1652
- label: props.aiCustom.label ?? "Customize source\u2026",
1682
+ label: props.aiCustom.label ?? "Customize source",
1653
1683
  ...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
1654
1684
  supports: () => true,
1655
1685
  run: async () => {
@@ -1660,7 +1690,7 @@ function MatrxCopyMenuSession(props) {
1660
1690
  if (aiVisible && props.groomer)
1661
1691
  actions.push({
1662
1692
  id: "groom-source",
1663
- label: "Customize sections\u2026",
1693
+ label: "Customize sections",
1664
1694
  supports: () => true,
1665
1695
  run: async () => {
1666
1696
  setConfiguration({ groomer: props.groomer() });
@@ -1770,7 +1800,8 @@ function MatrxCopyMenuSession(props) {
1770
1800
  className: cn(
1771
1801
  props.className,
1772
1802
  props.size === "xs" && "matrx-alchemy-xs",
1773
- props.size === "sm" && "matrx-alchemy-sm"
1803
+ props.size === "sm" && "matrx-alchemy-sm",
1804
+ props.size === "toolbar" && "matrx-alchemy-toolbar-target"
1774
1805
  ),
1775
1806
  ...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
1776
1807
  }
@@ -1875,127 +1906,132 @@ function SourceConfiguration({
1875
1906
  event.preventDefault();
1876
1907
  if (!handingOff.current) restoreFocus();
1877
1908
  },
1878
- className: "matrx-alchemy-workspace",
1909
+ className: "matrx-alchemy-workspace matrx-alchemy-configuration",
1879
1910
  children: [
1880
1911
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogHeader, { children: [
1881
1912
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(DialogTitle, { children: title }),
1882
1913
  /* @__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
1914
  ] }),
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)(
1915
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1916
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
1917
+ custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
1918
+ option.label,
1919
+ "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("small", { children: option.hint }) : null,
1920
+ option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1907
1921
  "input",
1908
1922
  {
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
- })
1923
+ type: "checkbox",
1924
+ checked: Boolean(values[option.key]),
1925
+ onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
1918
1926
  }
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",
1927
+ ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1928
+ "select",
1924
1929
  {
1925
- type: "number",
1926
- min: option.min,
1927
- step: option.step,
1928
1930
  value: Number(values[option.key]),
1929
1931
  onChange: (event) => setValues({
1930
1932
  ...values,
1931
1933
  [option.key]: Number(event.target.value)
1932
- })
1934
+ }),
1935
+ children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
1933
1936
  }
1934
- ),
1935
- option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1937
+ ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1938
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1939
+ "input",
1940
+ {
1941
+ type: "range",
1942
+ min: 0,
1943
+ max: Math.max(0, option.stops.length - 1),
1944
+ step: 1,
1945
+ value: option.stops.indexOf(Number(values[option.key])),
1946
+ onChange: (event) => setValues({
1947
+ ...values,
1948
+ [option.key]: option.stops[Number(event.target.value)]
1949
+ })
1950
+ }
1951
+ ),
1952
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
1953
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1954
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1955
+ "input",
1956
+ {
1957
+ type: "number",
1958
+ min: option.min,
1959
+ step: option.step,
1960
+ value: Number(values[option.key]),
1961
+ onChange: (event) => setValues({
1962
+ ...values,
1963
+ [option.key]: Number(event.target.value)
1964
+ })
1965
+ }
1966
+ ),
1967
+ option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1968
+ Button,
1969
+ {
1970
+ type: "button",
1971
+ variant: "ghost",
1972
+ className: "matrx-alchemy-workspace-secondary",
1973
+ onClick: () => setValues({ ...values, [option.key]: preset.value }),
1974
+ children: preset.label
1975
+ },
1976
+ preset.value
1977
+ ))
1978
+ ] })
1979
+ ] }, option.key)),
1980
+ groomer ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
1981
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1936
1982
  Button,
1937
1983
  {
1938
1984
  type: "button",
1939
1985
  variant: "ghost",
1940
- onClick: () => setValues({ ...values, [option.key]: preset.value }),
1941
- children: preset.label
1986
+ className: "matrx-alchemy-workspace-secondary",
1987
+ onClick: () => setSections(
1988
+ Object.fromEntries(
1989
+ groomer.sections.map((section) => [
1990
+ section.id,
1991
+ level === "brief" && section.cuttable ? "off" : level
1992
+ ])
1993
+ )
1994
+ ),
1995
+ children: level
1942
1996
  },
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
- )
1997
+ level
1998
+ )) }),
1999
+ groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { children: [
2000
+ section.title,
2001
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
2002
+ "select",
2003
+ {
2004
+ value: sections[section.id],
2005
+ onChange: (event) => setSections({
2006
+ ...sections,
2007
+ [section.id]: event.target.value
2008
+ }),
2009
+ children: [
2010
+ ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
2011
+ section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "off", children: "Exclude" }) : null
2012
+ ]
2013
+ }
1960
2014
  ),
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"
2015
+ section.description ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: section.description }) : null
2016
+ ] }, section.id))
2017
+ ] }) : null
2018
+ ] }),
2019
+ /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
2020
+ text.length.toLocaleString(),
2021
+ " characters \xB7 approximately",
2022
+ " ",
2023
+ Math.ceil(text.length / 4).toLocaleString(),
2024
+ " tokens"
2025
+ ] }),
2026
+ error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { role: "alert", children: error ?? buildError }) : null
1991
2027
  ] }),
1992
- error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { role: "alert", children: error ?? buildError }) : null,
1993
2028
  /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(DialogFooter, { children: [
1994
2029
  /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
1995
2030
  Button,
1996
2031
  {
1997
2032
  type: "button",
1998
2033
  variant: "ghost",
2034
+ className: "matrx-alchemy-workspace-secondary",
1999
2035
  disabled: busy,
2000
2036
  onClick: onClose,
2001
2037
  children: "Cancel"
@@ -2005,6 +2041,7 @@ function SourceConfiguration({
2005
2041
  Button,
2006
2042
  {
2007
2043
  type: "button",
2044
+ className: "matrx-alchemy-workspace-primary",
2008
2045
  disabled: busy || !prepared || Boolean(buildError),
2009
2046
  onClick: async () => {
2010
2047
  if (!prepared) return;