@ai-matrx/design-system 0.18.13 → 0.18.15

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.
@@ -1899,6 +1899,7 @@ import {
1899
1899
 
1900
1900
  // src/content-transfer/index.tsx
1901
1901
  import * as React13 from "react";
1902
+ import { createPortal } from "react-dom";
1902
1903
  import {
1903
1904
  applySectionSelection,
1904
1905
  applyTransferLimits,
@@ -2484,7 +2485,10 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2484
2485
  }, children: /* @__PURE__ */ jsx21(MenuPresentation, { ...action, label: action.label }) }, action.id)) }) : null
2485
2486
  ] })
2486
2487
  ] }),
2487
- notice ? /* @__PURE__ */ jsx21("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
2488
+ notice && triggerRef.current ? createPortal(/* @__PURE__ */ jsxs13("div", { className: "matrx-alchemy-feedback", children: [
2489
+ /* @__PURE__ */ jsx21("span", { role: "status", children: notice }),
2490
+ /* @__PURE__ */ jsx21("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
2491
+ ] }), triggerRef.current.ownerDocument.body) : null,
2488
2492
  Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx21(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key))
2489
2493
  ] });
2490
2494
  }
@@ -2992,15 +2996,18 @@ var structuredPayload = (value) => {
2992
2996
  );
2993
2997
  return {
2994
2998
  kind: "json",
2995
- value: normalizeTransferJson({
2996
- kind: value.kind,
2997
- location: value.location,
2998
- description: value.description,
2999
- data: value.data,
3000
- ...value.summary !== void 0 ? { summary: value.summary } : {},
3001
- attributes: clean(value.attributes),
3002
- context: clean(value.context)
3003
- })
2999
+ value: normalizeTransferJson(
3000
+ {
3001
+ kind: value.kind,
3002
+ location: value.location,
3003
+ description: value.description,
3004
+ data: value.data,
3005
+ ...value.summary !== void 0 ? { summary: value.summary } : {},
3006
+ attributes: clean(value.attributes),
3007
+ context: clean(value.context)
3008
+ },
3009
+ { omitUndefinedObjectProperties: true }
3010
+ )
3004
3011
  };
3005
3012
  };
3006
3013
  var actionDone = (message) => ({
@@ -3055,12 +3062,16 @@ function MatrxCopyMenuSession(props) {
3055
3062
  })) : void 0;
3056
3063
  const json = aiVisible && props.json !== void 0 ? make("json", () => ({
3057
3064
  kind: "json",
3058
- value: normalizeTransferJson(resolve(props.json))
3065
+ value: normalizeTransferJson(resolve(props.json), {
3066
+ omitUndefinedObjectProperties: true
3067
+ })
3059
3068
  })) : void 0;
3060
3069
  const agent = aiVisible && props.agent !== void 0 ? make("agent", () => asPayload(resolve(props.agent))) : void 0;
3061
3070
  const structuredAgent = aiVisible && props.agent !== void 0 ? make("structured-agent", () => structuredPayload(resolve(props.agent))) : void 0;
3062
3071
  const table = (exportVisible || props.primarySource === "table") && props.export?.sheetRows ? make("rows", () => {
3063
- const value = normalizeTransferJson(props.export.sheetRows());
3072
+ const value = normalizeTransferJson(props.export.sheetRows(), {
3073
+ omitUndefinedObjectProperties: true
3074
+ });
3064
3075
  if (!Array.isArray(value) || value.some(
3065
3076
  (row) => row === null || typeof row !== "object" || Array.isArray(row)
3066
3077
  ))
@@ -4060,24 +4071,26 @@ function CopySubsetDialog({ source, onClose }) {
4060
4071
  }
4061
4072
  return /* @__PURE__ */ jsx24(Dialog, { open: true, onOpenChange: (open) => {
4062
4073
  if (!open) onClose();
4063
- }, children: /* @__PURE__ */ jsxs15(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
4074
+ }, children: /* @__PURE__ */ jsxs15(DialogContent, { className: "matrx-alchemy-workspace matrx-alchemy-subset", children: [
4064
4075
  /* @__PURE__ */ jsx24(DialogHeader, { children: /* @__PURE__ */ jsx24(DialogTitle, { children: "Filter & sort before copying" }) }),
4065
- /* @__PURE__ */ jsxs15("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
4066
- /* @__PURE__ */ jsx24("legend", { children: "Visible columns" }),
4067
- source.columns.map((column) => /* @__PURE__ */ jsxs15("label", { className: "mr-3 inline-flex items-center gap-1", children: [
4068
- /* @__PURE__ */ jsx24("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
4069
- const next = new Set(current);
4070
- next.has(column.id) ? next.delete(column.id) : next.add(column.id);
4071
- return next;
4072
- }) }),
4073
- column.header
4074
- ] }, column.id))
4076
+ /* @__PURE__ */ jsxs15("div", { className: "matrx-alchemy-workspace-body matrx-alchemy-subset-body", children: [
4077
+ /* @__PURE__ */ jsxs15("fieldset", { className: "matrx-alchemy-subset-columns", children: [
4078
+ /* @__PURE__ */ jsx24("legend", { children: "Visible columns" }),
4079
+ source.columns.map((column) => /* @__PURE__ */ jsxs15("label", { className: "mr-3 inline-flex items-center gap-1", children: [
4080
+ /* @__PURE__ */ jsx24("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
4081
+ const next = new Set(current);
4082
+ next.has(column.id) ? next.delete(column.id) : next.add(column.id);
4083
+ return next;
4084
+ }) }),
4085
+ column.header
4086
+ ] }, column.id))
4087
+ ] }),
4088
+ columns.length ? /* @__PURE__ */ jsx24("div", { className: "matrx-alchemy-subset-table", children: /* @__PURE__ */ jsx24(MatrxDataTable, { copy: false, data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx24("p", { children: "Show at least one column to copy." }),
4089
+ buildError ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
4090
+ notice
4075
4091
  ] }),
4076
- columns.length ? /* @__PURE__ */ jsx24("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ jsx24(MatrxDataTable, { data: rows, columns, getRowId: source.getRowId, query: { mode: "controlled-local", state: query, onStateChange: setQuery }, selection: { selectedIds, onSelectedIdsChange: setSelectedIds }, detail: { enabled: false }, window: { enabled: false }, toolbar: { searchMatch: {} } }) }) : /* @__PURE__ */ jsx24("p", { children: "Show at least one column to copy." }),
4077
- buildError ? /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
4078
- notice,
4079
4092
  /* @__PURE__ */ jsxs15(DialogFooter, { children: [
4080
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-sm", children: [
4093
+ /* @__PURE__ */ jsxs15("label", { className: "matrx-alchemy-subset-format", children: [
4081
4094
  "Format",
4082
4095
  /* @__PURE__ */ jsxs15("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
4083
4096
  /* @__PURE__ */ jsx24("option", { value: "ai", children: "For AI" }),
@@ -4096,8 +4109,8 @@ function CopySubsetDialog({ source, onClose }) {
4096
4109
  text.length.toLocaleString(),
4097
4110
  " characters"
4098
4111
  ] }),
4099
- /* @__PURE__ */ jsx24(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
4100
- /* @__PURE__ */ jsx24(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
4112
+ /* @__PURE__ */ jsx24(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: onClose, children: "Close" }),
4113
+ /* @__PURE__ */ jsx24(Button, { type: "button", className: "matrx-alchemy-workspace-primary", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
4101
4114
  ] })
4102
4115
  ] }) });
4103
4116
  }