@ai-matrx/design-system 0.18.10 → 0.18.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/content-transfer/alchemy.svg +1 -1
  3. package/dist/content-transfer/icon.cjs +3 -1
  4. package/dist/content-transfer/icon.cjs.map +1 -1
  5. package/dist/content-transfer/icon.d.cts +3 -2
  6. package/dist/content-transfer/icon.d.ts +3 -2
  7. package/dist/content-transfer/icon.js +3 -1
  8. package/dist/content-transfer/icon.js.map +1 -1
  9. package/dist/content-transfer.cjs +323 -277
  10. package/dist/content-transfer.cjs.map +1 -1
  11. package/dist/content-transfer.css +93 -25
  12. package/dist/content-transfer.d.cts +1 -1
  13. package/dist/content-transfer.d.ts +1 -1
  14. package/dist/content-transfer.js +323 -277
  15. package/dist/content-transfer.js.map +1 -1
  16. package/dist/data-table/copy-helpers.d.cts +1 -1
  17. package/dist/data-table/copy-helpers.d.ts +1 -1
  18. package/dist/data-table/copy-types.cjs.map +1 -1
  19. package/dist/data-table/copy-types.d.cts +1 -1
  20. package/dist/data-table/copy-types.d.ts +1 -1
  21. package/dist/data-table/data-row-inspector.cjs +325 -276
  22. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  23. package/dist/data-table/data-row-inspector.js +325 -276
  24. package/dist/data-table/data-row-inspector.js.map +1 -1
  25. package/dist/data-table/data-row-window.cjs +325 -276
  26. package/dist/data-table/data-row-window.cjs.map +1 -1
  27. package/dist/data-table/data-row-window.js +325 -276
  28. package/dist/data-table/data-row-window.js.map +1 -1
  29. package/dist/data-table/filter-engine.d.cts +1 -1
  30. package/dist/data-table/filter-engine.d.ts +1 -1
  31. package/dist/data-table/host.cjs.map +1 -1
  32. package/dist/data-table/host.d.cts +16 -2
  33. package/dist/data-table/host.d.ts +16 -2
  34. package/dist/data-table/host.js.map +1 -1
  35. package/dist/data-table/index.cjs +463 -398
  36. package/dist/data-table/index.cjs.map +1 -1
  37. package/dist/data-table/index.d.cts +3 -3
  38. package/dist/data-table/index.d.ts +3 -3
  39. package/dist/data-table/index.js +464 -399
  40. package/dist/data-table/index.js.map +1 -1
  41. package/dist/data-table/infer-filter.d.cts +1 -1
  42. package/dist/data-table/infer-filter.d.ts +1 -1
  43. package/dist/data-table/layered-filters.d.cts +1 -1
  44. package/dist/data-table/layered-filters.d.ts +1 -1
  45. package/dist/data-table/pagination.cjs.map +1 -1
  46. package/dist/data-table/pagination.js.map +1 -1
  47. package/dist/data-table/query-control.d.cts +1 -1
  48. package/dist/data-table/query-control.d.ts +1 -1
  49. package/dist/data-table/types.cjs.map +1 -1
  50. package/dist/data-table/types.d.cts +1 -1
  51. package/dist/data-table/types.d.ts +1 -1
  52. package/dist/data-table/url-state.d.cts +1 -1
  53. package/dist/data-table/url-state.d.ts +1 -1
  54. package/dist/data-table/uuid-cell.cjs.map +1 -1
  55. package/dist/data-table/uuid-cell.js.map +1 -1
  56. package/dist/data-table/xlsx.d.cts +1 -1
  57. package/dist/data-table/xlsx.d.ts +1 -1
  58. package/dist/index.cjs.map +1 -1
  59. package/dist/index.js.map +1 -1
  60. package/dist/{types-C2xN6W_q.d.ts → types-BuDKVpeF.d.ts} +2 -1
  61. package/dist/{types-D_tpuk6m.d.cts → types-Dqcb7jXO.d.cts} +2 -1
  62. package/package.json +2 -2
@@ -485,7 +485,8 @@ var PopoverContent = React6.forwardRef(
485
485
  PopoverContent.displayName = PopoverPrimitive.Content.displayName;
486
486
 
487
487
  // src/content-transfer/icon.ts
488
- 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"><path d="M4.5 5.5h8v11h-8z"/><path d="M8.5 9.5h8v9h-8z"/><path d="m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z"/></svg>';
488
+ 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"];
489
+ 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>`;
489
490
 
490
491
  // src/content-transfer/matrx-copy.tsx
491
492
  var React7 = __toESM(require("react"), 1);
@@ -636,7 +637,7 @@ function MatrxCopyMenuSession(props) {
636
637
  if (aiVisible && props.aiCustom)
637
638
  actions.push({
638
639
  id: "configure-source",
639
- label: props.aiCustom.label ?? "Customize source\u2026",
640
+ label: props.aiCustom.label ?? "Customize source",
640
641
  ...props.aiCustom.hint ? { hint: props.aiCustom.hint } : {},
641
642
  supports: () => true,
642
643
  run: async () => {
@@ -647,7 +648,7 @@ function MatrxCopyMenuSession(props) {
647
648
  if (aiVisible && props.groomer)
648
649
  actions.push({
649
650
  id: "groom-source",
650
- label: "Customize sections\u2026",
651
+ label: "Customize sections",
651
652
  supports: () => true,
652
653
  run: async () => {
653
654
  setConfiguration({ groomer: props.groomer() });
@@ -757,7 +758,8 @@ function MatrxCopyMenuSession(props) {
757
758
  className: cn(
758
759
  props.className,
759
760
  props.size === "xs" && "matrx-alchemy-xs",
760
- props.size === "sm" && "matrx-alchemy-sm"
761
+ props.size === "sm" && "matrx-alchemy-sm",
762
+ props.size === "toolbar" && "matrx-alchemy-toolbar-target"
761
763
  ),
762
764
  ...props.stopPropagation !== void 0 ? { stopPropagation: props.stopPropagation } : {}
763
765
  }
@@ -862,127 +864,132 @@ function SourceConfiguration({
862
864
  event.preventDefault();
863
865
  if (!handingOff.current) restoreFocus();
864
866
  },
865
- className: "matrx-alchemy-workspace",
867
+ className: "matrx-alchemy-workspace matrx-alchemy-configuration",
866
868
  children: [
867
869
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogHeader, { children: [
868
870
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogTitle, { children: title }),
869
871
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(DialogDescription, { children: custom?.dialogDescription ?? "Choose the source detail, then prepare, edit, summarize, copy or export it in Alchemy." })
870
872
  ] }),
871
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
872
- custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
873
- option.label,
874
- "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: option.hint }) : null,
875
- option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
876
- "input",
877
- {
878
- type: "checkbox",
879
- checked: Boolean(values[option.key]),
880
- onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
881
- }
882
- ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
883
- "select",
884
- {
885
- value: Number(values[option.key]),
886
- onChange: (event) => setValues({
887
- ...values,
888
- [option.key]: Number(event.target.value)
889
- }),
890
- children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
891
- }
892
- ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
893
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
873
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
874
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "matrx-alchemy-main matrx-alchemy-toolbar", children: [
875
+ custom?.options.map((option) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
876
+ option.label,
877
+ "hint" in option && option.hint ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("small", { children: option.hint }) : null,
878
+ option.kind === "toggle" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
894
879
  "input",
895
880
  {
896
- type: "range",
897
- min: 0,
898
- max: Math.max(0, option.stops.length - 1),
899
- step: 1,
900
- value: option.stops.indexOf(Number(values[option.key])),
901
- onChange: (event) => setValues({
902
- ...values,
903
- [option.key]: option.stops[Number(event.target.value)]
904
- })
881
+ type: "checkbox",
882
+ checked: Boolean(values[option.key]),
883
+ onChange: (event) => setValues({ ...values, [option.key]: event.target.checked })
905
884
  }
906
- ),
907
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
908
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
909
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
910
- "input",
885
+ ) : option.kind === "preset" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
886
+ "select",
911
887
  {
912
- type: "number",
913
- min: option.min,
914
- step: option.step,
915
888
  value: Number(values[option.key]),
916
889
  onChange: (event) => setValues({
917
890
  ...values,
918
891
  [option.key]: Number(event.target.value)
919
- })
892
+ }),
893
+ children: option.options.map((choice) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: choice.value, children: choice.label }, choice.value))
920
894
  }
921
- ),
922
- option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
895
+ ) : option.kind === "slider" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
896
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
897
+ "input",
898
+ {
899
+ type: "range",
900
+ min: 0,
901
+ max: Math.max(0, option.stops.length - 1),
902
+ step: 1,
903
+ value: option.stops.indexOf(Number(values[option.key])),
904
+ onChange: (event) => setValues({
905
+ ...values,
906
+ [option.key]: option.stops[Number(event.target.value)]
907
+ })
908
+ }
909
+ ),
910
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: option.formatValue(Number(values[option.key])) })
911
+ ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
912
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
913
+ "input",
914
+ {
915
+ type: "number",
916
+ min: option.min,
917
+ step: option.step,
918
+ value: Number(values[option.key]),
919
+ onChange: (event) => setValues({
920
+ ...values,
921
+ [option.key]: Number(event.target.value)
922
+ })
923
+ }
924
+ ),
925
+ option.presets?.map((preset) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
926
+ Button,
927
+ {
928
+ type: "button",
929
+ variant: "ghost",
930
+ className: "matrx-alchemy-workspace-secondary",
931
+ onClick: () => setValues({ ...values, [option.key]: preset.value }),
932
+ children: preset.label
933
+ },
934
+ preset.value
935
+ ))
936
+ ] })
937
+ ] }, option.key)),
938
+ groomer ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
939
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
923
940
  Button,
924
941
  {
925
942
  type: "button",
926
943
  variant: "ghost",
927
- onClick: () => setValues({ ...values, [option.key]: preset.value }),
928
- children: preset.label
944
+ className: "matrx-alchemy-workspace-secondary",
945
+ onClick: () => setSections(
946
+ Object.fromEntries(
947
+ groomer.sections.map((section) => [
948
+ section.id,
949
+ level === "brief" && section.cuttable ? "off" : level
950
+ ])
951
+ )
952
+ ),
953
+ children: level
929
954
  },
930
- preset.value
931
- ))
932
- ] })
933
- ] }, option.key)),
934
- groomer ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
935
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
936
- Button,
937
- {
938
- type: "button",
939
- variant: "ghost",
940
- onClick: () => setSections(
941
- Object.fromEntries(
942
- groomer.sections.map((section) => [
943
- section.id,
944
- level === "brief" && section.cuttable ? "off" : level
945
- ])
946
- )
955
+ level
956
+ )) }),
957
+ groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
958
+ section.title,
959
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
960
+ "select",
961
+ {
962
+ value: sections[section.id],
963
+ onChange: (event) => setSections({
964
+ ...sections,
965
+ [section.id]: event.target.value
966
+ }),
967
+ children: [
968
+ ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
969
+ section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "off", children: "Exclude" }) : null
970
+ ]
971
+ }
947
972
  ),
948
- children: level
949
- },
950
- level
951
- )) }),
952
- groomer.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("label", { children: [
953
- section.title,
954
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
955
- "select",
956
- {
957
- value: sections[section.id],
958
- onChange: (event) => setSections({
959
- ...sections,
960
- [section.id]: event.target.value
961
- }),
962
- children: [
963
- ["full", "compact", "brief"].map((level) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: level, children: section.levelLabels?.[level] ?? level }, level)),
964
- section.cuttable ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "off", children: "Exclude" }) : null
965
- ]
966
- }
967
- ),
968
- section.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: section.description }) : null
969
- ] }, section.id))
970
- ] }) : null
973
+ section.description ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: section.description }) : null
974
+ ] }, section.id))
975
+ ] }) : null
976
+ ] }),
977
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { children: [
978
+ text.length.toLocaleString(),
979
+ " characters \xB7 approximately",
980
+ " ",
981
+ Math.ceil(text.length / 4).toLocaleString(),
982
+ " tokens"
983
+ ] }),
984
+ error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", children: error ?? buildError }) : null
971
985
  ] }),
972
- /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("p", { children: [
973
- text.length.toLocaleString(),
974
- " characters \xB7 approximately",
975
- " ",
976
- Math.ceil(text.length / 4).toLocaleString(),
977
- " tokens"
978
- ] }),
979
- error || buildError ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "alert", children: error ?? buildError }) : null,
980
986
  /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(DialogFooter, { children: [
981
987
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
982
988
  Button,
983
989
  {
984
990
  type: "button",
985
991
  variant: "ghost",
992
+ className: "matrx-alchemy-workspace-secondary",
986
993
  disabled: busy,
987
994
  onClick: onClose,
988
995
  children: "Cancel"
@@ -992,6 +999,7 @@ function SourceConfiguration({
992
999
  Button,
993
1000
  {
994
1001
  type: "button",
1002
+ className: "matrx-alchemy-workspace-primary",
995
1003
  disabled: busy || !prepared || Boolean(buildError),
996
1004
  onClick: async () => {
997
1005
  if (!prepared) return;
@@ -1080,11 +1088,7 @@ function groomerPresetVariants(getConfig) {
1080
1088
  // src/content-transfer/index.tsx
1081
1089
  var import_jsx_runtime8 = require("react/jsx-runtime");
1082
1090
  function AlchemyGlyph(props) {
1083
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", ...props, children: [
1084
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M4.5 5.5h8v11h-8z" }),
1085
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M8.5 9.5h8v9h-8z" }),
1086
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "m18.5 3 .65 1.85L21 5.5l-1.85.65L18.5 8l-.65-1.85L16 5.5l1.85-.65z" })
1087
- ] });
1091
+ return /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)("path", { d }, d)) });
1088
1092
  }
1089
1093
  var CapabilityContext = React8.createContext({});
1090
1094
  function ContentTransferCapabilitiesProvider({ value, children }) {
@@ -1105,7 +1109,16 @@ function MenuPresentation({ label, hint, icon: Icon }) {
1105
1109
  ] })
1106
1110
  ] });
1107
1111
  }
1108
- function PaletteGlyph({ format, ai = false, file = false }) {
1112
+ function PaletteGlyph({ format, ai = false, file = false, kind }) {
1113
+ if (kind === "ai-copy") return /* @__PURE__ */ (0, import_jsx_runtime8.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: [
1114
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("rect", { x: "5", y: "5", width: "11", height: "14", rx: "2" }),
1115
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M9 3h6a2 2 0 0 1 2 2v10" }),
1116
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "m18.5 3 .55 1.45L20.5 5l-1.45.55L18.5 7l-.55-1.45L16.5 5l1.45-.55z" })
1117
+ ] });
1118
+ if (kind === "sliders") return /* @__PURE__ */ (0, import_jsx_runtime8.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: [
1119
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M4 6h16M4 12h16M4 18h16" }),
1120
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M8 3v6M16 9v6M10 15v6" })
1121
+ ] });
1109
1122
  if (ai) return /* @__PURE__ */ (0, import_jsx_runtime8.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: [
1110
1123
  /* @__PURE__ */ (0, import_jsx_runtime8.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" }),
1111
1124
  /* @__PURE__ */ (0, import_jsx_runtime8.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" }),
@@ -1138,15 +1151,15 @@ function PaletteGlyph({ format, ai = false, file = false }) {
1138
1151
  ] }) : format === "html" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M15 6h6M3 6h7M3 12h18M3 18h12" }) }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("path", { d: "M4 7V4h16v3M9 20h6M12 4v16" }) });
1139
1152
  return /* @__PURE__ */ (0, import_jsx_runtime8.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 });
1140
1153
  }
1141
- function PaletteRows({ title, items, onRun, extra, ai = false }) {
1154
+ function PaletteRows({ title, items, onRun, extra, ai = false, glyphKind, fallbackHint }) {
1142
1155
  if (!items.length && !extra) return null;
1143
1156
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { className: "matrx-alchemy-palette-section", children: [
1144
1157
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { children: title }),
1145
1158
  items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: cn("matrx-alchemy-palette-row", ai && "matrx-alchemy-palette-row-ai"), "aria-label": item.ariaLabel, onClick: () => onRun?.(item), children: [
1146
- item.icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteGlyph, { ai }),
1159
+ item.icon ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(item.icon, { className: "matrx-alchemy-menu-icon" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteGlyph, { ai, ...glyphKind ? { kind: glyphKind } : {} }),
1147
1160
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
1148
1161
  item.copyLabel ?? item.label,
1149
- item.hint ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint }) : null
1162
+ item.hint ?? fallbackHint ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: "matrx-alchemy-menu-hint", children: item.hint ?? fallbackHint }) : null
1150
1163
  ] })
1151
1164
  ] }, item.id)),
1152
1165
  extra
@@ -1543,45 +1556,54 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
1543
1556
  }, children: [
1544
1557
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)(AlchemyGlyph, {}) }) }),
1545
1558
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(PopoverContent, { align: "end", className: "matrx-alchemy-menu matrx-alchemy-palette", "aria-label": "Alchemy output options", onCloseAutoFocus: () => triggerRef.current?.focus(), children: [
1546
- copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
1547
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
1548
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
1549
- ] }) : null,
1550
1559
  menuStatus === "loading" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "matrx-alchemy-palette-status", children: "Inspecting content\u2026" }) : menuStatus !== "idle" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "matrx-alchemy-error", children: menuStatus }) : null,
1551
- resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1552
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1553
- 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]}` })),
1554
- visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
1555
- ] }),
1556
- quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
1560
+ copyAvailable || downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { className: "matrx-alchemy-output", children: [
1561
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("h3", { children: resolvedMode === "copy" ? "Copy as" : "Download as" }),
1562
+ copyAvailable && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-mode", "aria-label": "Output action", children: [
1563
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": "Copy mode", "aria-pressed": resolvedMode === "copy", onClick: () => setMode("copy"), children: "Copy" }),
1564
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", "aria-label": "Download mode", "aria-pressed": resolvedMode === "download", onClick: () => setMode("download"), children: "Download" })
1565
+ ] }) : null,
1566
+ resolvedMode === "copy" && copyAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1567
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1568
+ 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]}` })),
1569
+ visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, false), { custom: true }))
1570
+ ] }),
1571
+ quickVariants("copy").length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Quick copy", items: quickVariants("copy"), onRun: (variant) => {
1572
+ closePalette();
1573
+ void transfer("markdown", false, variant);
1574
+ } }) : null
1575
+ ] }) : null,
1576
+ resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1577
+ 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]}` })),
1578
+ visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
1579
+ downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
1580
+ ] }) }) : null
1581
+ ] }) : null,
1582
+ prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1583
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Copy for AI", ai: true, glyphKind: "ai-copy", fallbackHint: "Copies immediately", items: quickVariants("ai"), onRun: (variant) => {
1557
1584
  closePalette();
1558
1585
  void transfer("markdown", false, variant);
1559
- } }) : null
1586
+ } }),
1587
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Edit and prepare", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": "Prepare for AI", onClick: () => {
1588
+ closePalette();
1589
+ void openWorkspace();
1590
+ }, children: [
1591
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteGlyph, { kind: "sliders" }),
1592
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
1593
+ "Prepare for AI",
1594
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("small", { className: "matrx-alchemy-menu-hint", children: "Review and edit before copying" })
1595
+ ] })
1596
+ ] }) })
1560
1597
  ] }) : null,
1561
- resolvedMode === "download" && downloadAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_jsx_runtime8.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-palette-grid", children: [
1562
- 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]}` })),
1563
- visibleAdapters.map((adapter) => tile(adapter.id, adapter.label, () => void transfer(adapter, true), { custom: true })),
1564
- downloadActions.map((action) => tile(action.id, action.label, () => void runAction(action), { custom: true, action, file: true }))
1565
- ] }) }) : null,
1566
- prepareAvailable ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Prepare", ai: true, items: quickVariants("ai"), onRun: (variant) => {
1567
- closePalette();
1568
- void transfer("markdown", false, variant);
1569
- }, extra: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
1570
- closePalette();
1571
- void openWorkspace();
1572
- }, children: [
1573
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteGlyph, { ai: true }),
1574
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "Prepare for AI\u2026" })
1575
- ] }) }) : null,
1576
- prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Context", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1598
+ prepareAvailable && (nearestWorkspaceKey || variants.length) ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Other sources", items: [], extra: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1577
1599
  nearestWorkspaceKey && nearestSurface ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", onClick: () => {
1578
1600
  closePalette();
1579
1601
  void openWorkspace(nearestWorkspaceKey, { source: nearestSurface, label: nearestSurface.surfaceName });
1580
- }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "Prepare this surface\u2026" }) }) : null,
1602
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: "Prepare this surface" }) }) : null,
1581
1603
  variants.map((variant) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": variant.ariaLabel, onClick: () => {
1582
1604
  closePalette();
1583
1605
  void openWorkspace(variantWorkspaceKeys.get(variant.id), variant);
1584
- }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}\u2026` }) }, variant.id))
1606
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(MenuPresentation, { ...variant, label: `Prepare ${variant.label}` }) }, variant.id))
1585
1607
  ] }) }) : null,
1586
1608
  ordinaryActions.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PaletteRows, { title: "Actions", items: [], extra: ordinaryActions.map((action) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "matrx-alchemy-palette-row", "aria-label": action.ariaLabel, onClick: () => {
1587
1609
  closePalette();
@@ -1859,137 +1881,150 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1859
1881
  state.snapshot.label
1860
1882
  ] }),
1861
1883
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogDescription, { children: [
1862
- "Captured ",
1863
- state.snapshot.unsavedChanges ? "from your unsaved draft" : "as an immutable snapshot",
1864
- ". Your source is never edited."
1884
+ state.snapshot.unsavedChanges ? "Includes your unsaved changes. " : "",
1885
+ "Review and edit this copy. Your original stays unchanged."
1865
1886
  ] })
1866
1887
  ] }),
1867
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
1868
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { className: "matrx-alchemy-main", children: [
1869
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1870
- scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1871
- "Scope",
1872
- /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
1873
- ] }) : null,
1874
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1875
- "Detail",
1876
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
1877
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "full", children: "Full" }),
1878
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "compact", children: "Compact" }),
1879
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "brief", children: "Brief" }),
1880
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "custom", children: "Custom" })
1881
- ] })
1882
- ] }),
1883
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
1884
- setBufferError(null);
1885
- if (controlsHistory.length) {
1886
- const next = controlsHistory[controlsHistory.length - 1];
1888
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-workspace-body", children: [
1889
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-workspace-grid", children: [
1890
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("section", { className: "matrx-alchemy-main", children: [
1891
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
1892
+ scopes.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1893
+ "Scope",
1894
+ /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)("option", { value: scope, children: SCOPE_LABEL[scope] }, scope)) })
1895
+ ] }) : null,
1896
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1897
+ "Detail",
1898
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("select", { "aria-label": "Detail preset", value: controls.preset, onChange: (e) => changeControls({ ...controls, preset: e.target.value }), children: [
1899
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "full", children: "Full" }),
1900
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "compact", children: "Compact" }),
1901
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "brief", children: "Brief" }),
1902
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "custom", children: "Custom" })
1903
+ ] })
1904
+ ] }),
1905
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: !state.draft.history?.length && !controlsHistory.length || busy !== null, onClick: () => {
1906
+ setBufferError(null);
1907
+ if (controlsHistory.length) {
1908
+ const next = controlsHistory[controlsHistory.length - 1];
1909
+ setControls(next);
1910
+ setControlsHistory((history) => history.slice(0, -1));
1911
+ onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1912
+ } else onChange({ ...state, draft: (0, import_content_transfer2.undoDraft)(state.draft), error: void 0 });
1913
+ }, children: "Undo" }),
1914
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => {
1915
+ const next = initialControls(state);
1887
1916
  setControls(next);
1888
- setControlsHistory((history) => history.slice(0, -1));
1917
+ setControlsHistory([]);
1918
+ setPendingControls(null);
1919
+ setBufferError(null);
1889
1920
  onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1890
- } else onChange({ ...state, draft: (0, import_content_transfer2.undoDraft)(state.draft), error: void 0 });
1891
- }, children: "Undo" }),
1892
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => {
1893
- const next = initialControls(state);
1894
- setControls(next);
1895
- setControlsHistory([]);
1896
- setPendingControls(null);
1897
- setBufferError(null);
1898
- onChange({ ...state, draft: rebuild(state, next), error: void 0 });
1899
- }, children: "Reset" }),
1900
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", size: "sm", variant: "outline", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
1901
- ] }),
1902
- controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1903
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("legend", { children: "JSON limits" }),
1904
- [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1905
- text,
1906
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1907
- ] }, key))
1908
- ] }) : null,
1909
- rows ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RowControls, { rows, controls, change: changeControls }) : null,
1910
- state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1911
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("legend", { children: "Sections" }),
1912
- state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1913
- /* @__PURE__ */ (0, import_jsx_runtime8.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) }) }),
1914
- " ",
1915
- section.label
1916
- ] }, section.id))
1917
- ] }) : null,
1918
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1919
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
1920
- state.snapshot.coverage.included.toLocaleString(),
1921
- " included",
1922
- state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1923
- " \xB7 ",
1924
- state.snapshot.coverage.status
1921
+ }, children: "Reset" }),
1922
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", size: "sm", variant: "outline", className: "matrx-alchemy-workspace-secondary", disabled: busy !== null, onClick: () => void requestCapture(state.scope), children: "Refresh source" })
1925
1923
  ] }),
1926
- state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1927
- limitText ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
1928
- "Limits: ",
1929
- limitText
1924
+ controls.preset === "custom" && (state.draft.payload.kind === "json" || state.draft.payload.kind === "registered") ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
1925
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("legend", { children: "JSON limits" }),
1926
+ [["maxDepth", "Maximum depth"], ["maxStringChars", "Maximum string characters"], ["maxArrayItems", "Maximum array items"]].map(([key, text]) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1927
+ text,
1928
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "number", min: "0", value: controls[key] ?? "", onChange: (e) => changeControls({ ...controls, [key]: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
1929
+ ] }, key))
1930
1930
  ] }) : null,
1931
- displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { children: [
1931
+ rows ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "matrx-alchemy-options matrx-alchemy-data-controls", children: [
1932
1932
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
1933
- displayedOmissions.length,
1934
- " omissions or adjustments"
1933
+ "Data selection \xB7 ",
1934
+ controls.visibleColumns.length,
1935
+ " columns",
1936
+ controls.search || controls.sort || controls.top != null || controls.selectedOnly || Object.values(controls.filters).some(Boolean) ? " \xB7 customized" : " \xB7 all rows"
1935
1937
  ] }),
1936
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("li", { children: [
1937
- o.path || "/",
1938
- ": ",
1939
- o.reason,
1940
- o.count == null ? "" : ` (${o.count})`
1941
- ] }, `${o.path}-${o.reason}-${i}`)) })
1942
- ] }) : null
1943
- ] }),
1944
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1945
- "Output format",
1946
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1947
- formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: f, children: LABEL[f] }, f)),
1948
- state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1949
- workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1950
- ] })
1938
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "matrx-alchemy-data-controls-body", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RowControls, { rows, controls, change: changeControls }) })
1939
+ ] }) : null,
1940
+ state.snapshot.sections.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "matrx-alchemy-options", children: [
1941
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
1942
+ "Sections \xB7 ",
1943
+ controls.sections.length,
1944
+ " included"
1945
+ ] }),
1946
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("fieldset", { "aria-label": "Included sections", children: state.snapshot.sections.map((section) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1947
+ /* @__PURE__ */ (0, import_jsx_runtime8.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) }) }),
1948
+ " ",
1949
+ section.label
1950
+ ] }, section.id)) })
1951
+ ] }) : null,
1952
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { className: "matrx-alchemy-preview-label", children: [
1953
+ "Output format",
1954
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("select", { "aria-label": "Output format", value: format, onChange: (e) => setFormat(e.target.value), children: [
1955
+ formats.map((f) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: f, children: LABEL[f] }, f)),
1956
+ state.draft.payload.kind === "rows" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "xlsx", children: "Excel workbook" }) : null,
1957
+ workspaceAdapters.map((adapter) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: adapter.id, children: adapter.label }, adapter.id))
1958
+ ] })
1959
+ ] }),
1960
+ /* @__PURE__ */ (0, import_jsx_runtime8.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) }),
1961
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-coverage", children: [
1962
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
1963
+ state.snapshot.coverage.included.toLocaleString(),
1964
+ " included",
1965
+ state.snapshot.coverage.total == null ? "" : ` of ${state.snapshot.coverage.total.toLocaleString()}`,
1966
+ " \xB7 ",
1967
+ state.snapshot.coverage.status
1968
+ ] }),
1969
+ state.snapshot.coverage.reason ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { children: state.snapshot.coverage.reason }) : null,
1970
+ limitText ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { children: [
1971
+ "Limits: ",
1972
+ limitText
1973
+ ] }) : null,
1974
+ displayedOmissions.length ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { children: [
1975
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
1976
+ displayedOmissions.length,
1977
+ " omissions or adjustments"
1978
+ ] }),
1979
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { children: displayedOmissions.map((o, i) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("li", { children: [
1980
+ o.path || "/",
1981
+ ": ",
1982
+ o.reason,
1983
+ o.count == null ? "" : ` (${o.count})`
1984
+ ] }, `${o.path}-${o.reason}-${i}`)) })
1985
+ ] }) : null
1986
+ ] }),
1987
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1988
+ formatError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1989
+ bufferError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1990
+ const fallback = (0, import_content_transfer2.editDraft)(state.draft, { kind: "text", text: buffer });
1991
+ setBufferError(null);
1992
+ onChange({ ...state, draft: fallback, error: void 0 });
1993
+ setFormat("plain");
1994
+ }, children: "Use invalid JSON as plain text" }) : null
1951
1995
  ] }),
1952
- /* @__PURE__ */ (0, import_jsx_runtime8.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) }),
1953
- bufferError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { id: "alchemy-buffer-error", role: "alert", className: "matrx-alchemy-error", children: bufferError }) : null,
1954
- formatError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: formatError }) : null,
1955
- bufferError ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null, onClick: () => {
1956
- const fallback = (0, import_content_transfer2.editDraft)(state.draft, { kind: "text", text: buffer });
1957
- setBufferError(null);
1958
- onChange({ ...state, draft: fallback, error: void 0 });
1959
- setFormat("plain");
1960
- }, children: "Use invalid JSON as plain text" }) : null
1996
+ ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("aside", { children: [
1997
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1998
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1999
+ "AI instruction",
2000
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
2001
+ ] }),
2002
+ /* @__PURE__ */ (0, import_jsx_runtime8.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" }),
2003
+ busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
2004
+ ] }) : null,
2005
+ busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => {
2006
+ activeCapture.current?.abort();
2007
+ activeCapture.current = null;
2008
+ setBusy(null);
2009
+ }, children: "Stop loading rows" }) : null,
2010
+ ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime8.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,
2011
+ ai ? /* @__PURE__ */ (0, import_jsx_runtime8.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,
2012
+ state.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
2013
+ ] }) : null
1961
2014
  ] }),
1962
- ai || busy === "capture" || state.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("aside", { children: [
1963
- ai ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
1964
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
1965
- "AI instruction",
1966
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("textarea", { value: instruction, onChange: (e) => setInstruction(e.target.value), placeholder: "Tell AI how to prepare this content" })
1967
- ] }),
1968
- /* @__PURE__ */ (0, import_jsx_runtime8.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" }),
1969
- busy === "ai" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", onClick: () => void cancelAi(), children: aiSession.current?.cancel ? "Cancel AI" : "Stop waiting" }) : null
1970
- ] }) : null,
1971
- busy === "capture" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", onClick: () => {
1972
- activeCapture.current?.abort();
1973
- activeCapture.current = null;
1974
- setBusy(null);
1975
- }, children: "Stop loading rows" }) : null,
1976
- ai && aiFailed && aiSession.current?.recover && busy !== "ai" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", onClick: () => void runAi(true), children: aiFailed ? "Retry or rejoin AI run" : "Rejoin AI run" }) : null,
1977
- ai ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "matrx-alchemy-meta", children: "AI creates a preview. It never copies automatically. Closing detaches this view without cancelling server work." }) : null,
1978
- state.error ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "matrx-alchemy-error", children: state.error }) : null
1979
- ] }) : null
2015
+ pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
2016
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: "This control would replace your manual edit." }),
2017
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
2018
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
2019
+ ] }) : null,
2020
+ state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
2021
+ state.pending ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
2022
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: "A fresh source snapshot is ready." }),
2023
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-secondary", type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
2024
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { className: "matrx-alchemy-workspace-primary", type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
2025
+ ] }) : null,
2026
+ deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null
1980
2027
  ] }),
1981
- pendingControls ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1982
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: "This control would replace your manual edit." }),
1983
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", onClick: () => setPendingControls(null), children: "Keep edited draft" }),
1984
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", onClick: applyPendingControls, children: "Rebuild from source" })
1985
- ] }) : null,
1986
- state.sourceStale ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "alert", className: "matrx-alchemy-decision", children: "The source changed since this draft. Use Refresh source to review the latest data." }) : null,
1987
- state.pending ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-decision", role: "alert", children: [
1988
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: "A fresh source snapshot is ready." }),
1989
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", onClick: () => resolveCapture("keep"), children: "Keep current snapshot and draft" }),
1990
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", onClick: () => resolveCapture("regenerate"), children: "Regenerate from fresh source" })
1991
- ] }) : null,
1992
- deliveryNotice ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { role: "status", className: "matrx-alchemy-meta", children: deliveryNotice }) : null,
1993
2028
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(DialogFooter, { children: [
1994
2029
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "matrx-alchemy-meta", children: [
1995
2030
  buffer.length.toLocaleString(),
@@ -1997,13 +2032,16 @@ function PreparationWorkspace({ restoreFocus, open, state, scopes, onClose, onCh
1997
2032
  estimateTokens(buffer).toLocaleString(),
1998
2033
  " tokens"
1999
2034
  ] }),
2000
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", onClick: close, children: "Close" }),
2001
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(true), children: "Download prepared output" }),
2002
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", disabled: busy !== null || Boolean(bufferError || formatError) || !preparedArtifact, onClick: () => void deliver(false), children: "Copy prepared output" })
2035
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: close, children: "Close" }),
2036
+ /* @__PURE__ */ (0, import_jsx_runtime8.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" }),
2037
+ /* @__PURE__ */ (0, import_jsx_runtime8.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" })
2003
2038
  ] })
2004
2039
  ] }) });
2005
2040
  }
2006
2041
  function RowControls({ rows, controls, change }) {
2042
+ const filterCount = Object.values(controls.filters).filter(Boolean).length;
2043
+ const selectionSummary = controls.selectedOnly ? `${controls.selectedIndices.length} selected row${controls.selectedIndices.length === 1 ? "" : "s"}` : "All rows";
2044
+ 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 ");
2007
2045
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
2008
2046
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-toolbar", children: [
2009
2047
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
@@ -2029,32 +2067,40 @@ function RowControls({ rows, controls, change }) {
2029
2067
  /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "number", min: "0", value: controls.top ?? "", onChange: (e) => change({ ...controls, top: Number.isNaN(e.target.valueAsNumber) ? null : e.target.valueAsNumber }) })
2030
2068
  ] })
2031
2069
  ] }),
2032
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
2033
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("legend", { children: "Columns and filters" }),
2034
- rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-column", children: [
2070
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "matrx-alchemy-options", children: [
2071
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
2072
+ "Columns and filters",
2073
+ dataSummary ? ` \u2014 ${dataSummary}` : ""
2074
+ ] }),
2075
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("fieldset", { "aria-label": "Columns and filters", children: rows.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "matrx-alchemy-column", children: [
2035
2076
  /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
2036
2077
  /* @__PURE__ */ (0, import_jsx_runtime8.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) }) }),
2037
2078
  " ",
2038
2079
  column.label
2039
2080
  ] }),
2040
2081
  /* @__PURE__ */ (0, import_jsx_runtime8.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 } }) })
2041
- ] }, column.id))
2082
+ ] }, column.id)) })
2042
2083
  ] }),
2043
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { className: "matrx-alchemy-options", children: [
2044
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("legend", { children: "Rows" }),
2045
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
2046
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
2047
- " Only selected rows"
2084
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "matrx-alchemy-options", children: [
2085
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
2086
+ "Rows \u2014 ",
2087
+ selectionSummary
2048
2088
  ] }),
2049
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
2050
- const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String((0, import_content_transfer2.readTransferCell)(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
2051
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
2052
- /* @__PURE__ */ (0, import_jsx_runtime8.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) }) }),
2053
- " Row ",
2054
- index + 1,
2055
- summary ? ` \u2014 ${summary}` : ""
2056
- ] }, index);
2057
- }) })
2089
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { "aria-label": "Row selection", children: [
2090
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
2091
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("input", { type: "checkbox", checked: controls.selectedOnly, onChange: (e) => change({ ...controls, selectedOnly: e.target.checked }) }),
2092
+ " Only selected rows"
2093
+ ] }),
2094
+ /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "matrx-alchemy-row-list", children: rows.rows.map((row, index) => {
2095
+ const summary = rows.columns.filter((column) => column.visible).slice(0, 2).map((column) => String((0, import_content_transfer2.readTransferCell)(row, column) ?? "")).filter(Boolean).join(" \xB7 ");
2096
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("label", { children: [
2097
+ /* @__PURE__ */ (0, import_jsx_runtime8.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) }) }),
2098
+ " Row ",
2099
+ index + 1,
2100
+ summary ? ` \u2014 ${summary}` : ""
2101
+ ] }, index);
2102
+ }) })
2103
+ ] })
2058
2104
  ] })
2059
2105
  ] });
2060
2106
  }