@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
@@ -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,138 @@ 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))
1318
+ ] }) : null,
1319
+ rows ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(RowControls, { rows, controls, change: changeControls }) : null,
1320
+ state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1321
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("legend", { children: "Sections" }),
1322
+ state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1323
+ /* @__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) }) }),
1324
+ " ",
1325
+ section.label
1326
+ ] }, section.id))
1322
1327
  ] }) : null,
1323
- displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
1324
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1325
- displayedOmissions.length,
1326
- " omissions or adjustments"
1328
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1329
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1330
+ state.snapshot.coverage.included.toLocaleString(),
1331
+ " included",
1332
+ state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1333
+ " \xB7 ",
1334
+ state.snapshot.coverage.status
1327
1335
  ] }),
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
- ] })
1336
+ state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1337
+ limitText ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { children: [
1338
+ "Limits: ",
1339
+ limitText
1340
+ ] }) : null,
1341
+ displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
1342
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1343
+ displayedOmissions.length,
1344
+ " omissions or adjustments"
1345
+ ] }),
1346
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
1347
+ o.path || "/",
1348
+ ": ",
1349
+ o.reason,
1350
+ o.count == null ? "" : ` (${o.count})`
1351
+ ] }, `${o.path}-${o.reason}-${i}`)) })
1352
+ ] }) : null
1353
+ ] }),
1354
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1355
+ "Output format",
1356
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1357
+ formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: f, children: LABEL[f] }, f)),
1358
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1359
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1360
+ ] })
1361
+ ] }),
1362
+ /* @__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) }),
1363
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1364
+ formatError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1365
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1366
+ const fallback = (0, import_content_transfer.editDraft)(state.draft, { kind: "text", text: buffer });
1367
+ setBufferError(null);
1368
+ onChange({ ...state, draft: fallback, error: void 0 });
1369
+ setFormat("plain");
1370
+ }, children: "Use invalid JSON as plain text" }) : null
1343
1371
  ] }),
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
1372
+ ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("aside", { children: [
1373
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1375
+ "AI instruction",
1376
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1377
+ ] }),
1378
+ /* @__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" }),
1379
+ 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
1380
+ ] }) : null,
1381
+ busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
1382
+ activeCapture.current?.abort();
1383
+ activeCapture.current = null;
1384
+ setBusy(null);
1385
+ }, children: "Stop loading rows" }) : null,
1386
+ 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,
1387
+ 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,
1388
+ state.error ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1389
+ ] }) : null
1353
1390
  ] }),
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
1391
+ pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1392
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "This control would replace your manual edit." }),
1393
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1394
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1395
+ ] }) : null,
1396
+ 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,
1397
+ state.pending ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1398
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: "A fresh source snapshot is ready." }),
1399
+ /* @__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" }),
1400
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1401
+ ] }) : null,
1402
+ deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
1372
1403
  ] }),
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
1404
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogFooter, { children: [
1386
1405
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("span", { className: "matrx-alchemy-meta", children: [
1387
1406
  buffer.length.toLocaleString(),
@@ -1389,13 +1408,16 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1389
1408
  estimateTokens(buffer).toLocaleString(),
1390
1409
  " tokens"
1391
1410
  ] }),
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" })
1411
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
1412
+ /* @__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" }),
1413
+ /* @__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
1414
  ] })
1396
1415
  ] }) });
1397
1416
  }
1398
1417
  function RowControls({ rows, controls, change }) {
1418
+ const filterCount = Object.values(controls.filters).filter(Boolean).length;
1419
+ const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
1420
+ 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
1421
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1400
1422
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1401
1423
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
@@ -1421,32 +1443,40 @@ function RowControls({ rows, controls, change }) {
1421
1443
  /* @__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
1444
  ] })
1423
1445
  ] }),
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: [
1446
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "matrx-alchemy-options", children: [
1447
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1448
+ "Columns and filters",
1449
+ dataSummary ? ` \u2014 ${dataSummary}` : ""
1450
+ ] }),
1451
+ /* @__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
1452
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1428
1453
  /* @__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
1454
  " ",
1430
1455
  column.label
1431
1456
  ] }),
1432
1457
  /* @__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))
1458
+ ] }, column.id)) })
1434
1459
  ] }),
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"
1460
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "matrx-alchemy-options", children: [
1461
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
1462
+ "Rows \u2014 ",
1463
+ selectionSummary
1440
1464
  ] }),
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
- }) })
1465
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { "aria-label": "Row selection", children: [
1466
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1467
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
1468
+ " Only selected rows"
1469
+ ] }),
1470
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
1471
+ 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 ");
1472
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
1473
+ /* @__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) }) }),
1474
+ " Row ",
1475
+ index + 1,
1476
+ summary ? ` \u2014 ${summary}` : ""
1477
+ ] }, index);
1478
+ }) })
1479
+ ] })
1450
1480
  ] })
1451
1481
  ] });
1452
1482
  }
@@ -1598,7 +1628,7 @@ function MatrxCopyMenuSession(props) {
1598
1628
  if (aiVisible && props.aiCustom)
1599
1629
  actions.push({
1600
1630
  id: "configure-source",
1601
- label: props.aiCustom.label ?? "Customize source\u2026",
1631
+ label: props.aiCustom.label ?? "Customize source",
1602
1632
  ...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
1603
1633
  supports: () => true,
1604
1634
  run: async () => {
@@ -1609,7 +1639,7 @@ function MatrxCopyMenuSession(props) {
1609
1639
  if (aiVisible && props.groomer)
1610
1640
  actions.push({
1611
1641
  id: "groom-source",
1612
- label: "Customize sections\u2026",
1642
+ label: "Customize sections",
1613
1643
  supports: () => true,
1614
1644
  run: async () => {
1615
1645
  setConfiguration({ groomer: props.groomer() });
@@ -1719,7 +1749,8 @@ function MatrxCopyMenuSession(props) {
1719
1749
  className: cn(
1720
1750
  props.className,
1721
1751
  props.size === "xs" && "matrx-alchemy-xs",
1722
- props.size === "sm" && "matrx-alchemy-sm"
1752
+ props.size === "sm" && "matrx-alchemy-sm",
1753
+ props.size === "toolbar" && "matrx-alchemy-toolbar-target"
1723
1754
  ),
1724
1755
  ...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
1725
1756
  }
@@ -1824,127 +1855,132 @@ function SourceConfiguration({
1824
1855
  event.preventDefault();
1825
1856
  if (!handingOff.current) restoreFocus();
1826
1857
  },
1827
- className: "matrx-alchemy-workspace",
1858
+ className: "matrx-alchemy-workspace matrx-alchemy-configuration",
1828
1859
  children: [
1829
1860
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogHeader, { children: [
1830
1861
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DialogTitle, { children: title }),
1831
1862
  /* @__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
1863
  ] }),
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)(
1864
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1865
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
1866
+ custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1867
+ option.label,
1868
+ "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { children: option.hint }) : null,
1869
+ option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1856
1870
  "input",
1857
1871
  {
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
- })
1872
+ type: "checkbox",
1873
+ checked: Boolean(values[option.key]),
1874
+ onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
1867
1875
  }
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",
1876
+ ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1877
+ "select",
1873
1878
  {
1874
- type: "number",
1875
- min: option.min,
1876
- step: option.step,
1877
1879
  value: Number(values[option.key]),
1878
1880
  onChange: (event) => setValues({
1879
1881
  ...values,
1880
1882
  [option.key]: Number(event.target.value)
1881
- })
1883
+ }),
1884
+ children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
1882
1885
  }
1883
- ),
1884
- option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1886
+ ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1887
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1888
+ "input",
1889
+ {
1890
+ type: "range",
1891
+ min: 0,
1892
+ max: Math.max(0, option.stops.length - 1),
1893
+ step: 1,
1894
+ value: option.stops.indexOf(Number(values[option.key])),
1895
+ onChange: (event) => setValues({
1896
+ ...values,
1897
+ [option.key]: option.stops[Number(event.target.value)]
1898
+ })
1899
+ }
1900
+ ),
1901
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
1902
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1903
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1904
+ "input",
1905
+ {
1906
+ type: "number",
1907
+ min: option.min,
1908
+ step: option.step,
1909
+ value: Number(values[option.key]),
1910
+ onChange: (event) => setValues({
1911
+ ...values,
1912
+ [option.key]: Number(event.target.value)
1913
+ })
1914
+ }
1915
+ ),
1916
+ option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1917
+ Button,
1918
+ {
1919
+ type: "button",
1920
+ variant: "ghost",
1921
+ className: "matrx-alchemy-workspace-secondary",
1922
+ onClick: () => setValues({ ...values, [option.key]: preset.value }),
1923
+ children: preset.label
1924
+ },
1925
+ preset.value
1926
+ ))
1927
+ ] })
1928
+ ] }, option.key)),
1929
+ groomer ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1930
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1885
1931
  Button,
1886
1932
  {
1887
1933
  type: "button",
1888
1934
  variant: "ghost",
1889
- onClick: () => setValues({ ...values, [option.key]: preset.value }),
1890
- children: preset.label
1935
+ className: "matrx-alchemy-workspace-secondary",
1936
+ onClick: () => setSections(
1937
+ Object.fromEntries(
1938
+ groomer.sections.map((section) => [
1939
+ section.id,
1940
+ level === "brief" && section.cuttable ? "off" : level
1941
+ ])
1942
+ )
1943
+ ),
1944
+ children: level
1891
1945
  },
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
- )
1946
+ level
1947
+ )) }),
1948
+ groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1949
+ section.title,
1950
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1951
+ "select",
1952
+ {
1953
+ value: sections[section.id],
1954
+ onChange: (event) => setSections({
1955
+ ...sections,
1956
+ [section.id]: event.target.value
1957
+ }),
1958
+ children: [
1959
+ ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
1960
+ section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "off", children: "Exclude" }) : null
1961
+ ]
1962
+ }
1909
1963
  ),
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"
1964
+ section.description ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: section.description }) : null
1965
+ ] }, section.id))
1966
+ ] }) : null
1967
+ ] }),
1968
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { children: [
1969
+ text.length.toLocaleString(),
1970
+ " characters \xB7 approximately",
1971
+ " ",
1972
+ Math.ceil(text.length / 4).toLocaleString(),
1973
+ " tokens"
1974
+ ] }),
1975
+ error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", children: error ?? buildError }) : null
1940
1976
  ] }),
1941
- error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", children: error ?? buildError }) : null,
1942
1977
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogFooter, { children: [
1943
1978
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
1944
1979
  Button,
1945
1980
  {
1946
1981
  type: "button",
1947
1982
  variant: "ghost",
1983
+ className: "matrx-alchemy-workspace-secondary",
1948
1984
  disabled: busy,
1949
1985
  onClick: onClose,
1950
1986
  children: "Cancel"
@@ -1954,6 +1990,7 @@ function SourceConfiguration({
1954
1990
  Button,
1955
1991
  {
1956
1992
  type: "button",
1993
+ className: "matrx-alchemy-workspace-primary",
1957
1994
  disabled: busy || !prepared || Boolean(buildError),
1958
1995
  onClick: async () => {
1959
1996
  if (!prepared) return;