@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.
@@ -1929,6 +1929,7 @@ var import_content_transfer2 = require("@ai-matrx/kit/content-transfer");
1929
1929
 
1930
1930
  // src/content-transfer/index.tsx
1931
1931
  var React13 = __toESM(require("react"), 1);
1932
+ var import_react_dom = require("react-dom");
1932
1933
  var import_content_transfer = require("@ai-matrx/kit/content-transfer");
1933
1934
 
1934
1935
  // src/popover.tsx
@@ -2494,7 +2495,10 @@ function ContentTransferMenuSession({ source, surface, label, projection, sectio
2494
2495
  }, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(MenuPresentation, { ...action, label: action.label }) }, action.id)) }) : null
2495
2496
  ] })
2496
2497
  ] }),
2497
- notice ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "matrx-alchemy-notice", role: "status", children: notice }) : null,
2498
+ notice && triggerRef.current ? (0, import_react_dom.createPortal)(/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "matrx-alchemy-feedback", children: [
2499
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { role: "status", children: notice }),
2500
+ /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
2501
+ ] }), triggerRef.current.ownerDocument.body) : null,
2498
2502
  Object.values(workspaces).map((saved) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(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))
2499
2503
  ] });
2500
2504
  }
@@ -3002,15 +3006,18 @@ var structuredPayload = (value) => {
3002
3006
  );
3003
3007
  return {
3004
3008
  kind: "json",
3005
- value: (0, import_content_transfer2.normalizeTransferJson)({
3006
- kind: value.kind,
3007
- location: value.location,
3008
- description: value.description,
3009
- data: value.data,
3010
- ...value.summary !== void 0 ? { summary: value.summary } : {},
3011
- attributes: clean(value.attributes),
3012
- context: clean(value.context)
3013
- })
3009
+ value: (0, import_content_transfer2.normalizeTransferJson)(
3010
+ {
3011
+ kind: value.kind,
3012
+ location: value.location,
3013
+ description: value.description,
3014
+ data: value.data,
3015
+ ...value.summary !== void 0 ? { summary: value.summary } : {},
3016
+ attributes: clean(value.attributes),
3017
+ context: clean(value.context)
3018
+ },
3019
+ { omitUndefinedObjectProperties: true }
3020
+ )
3014
3021
  };
3015
3022
  };
3016
3023
  var actionDone = (message) => ({
@@ -3065,12 +3072,16 @@ function MatrxCopyMenuSession(props) {
3065
3072
  })) : void 0;
3066
3073
  const json = aiVisible && props.json !== void 0 ? make("json", () => ({
3067
3074
  kind: "json",
3068
- value: (0, import_content_transfer2.normalizeTransferJson)(resolve(props.json))
3075
+ value: (0, import_content_transfer2.normalizeTransferJson)(resolve(props.json), {
3076
+ omitUndefinedObjectProperties: true
3077
+ })
3069
3078
  })) : void 0;
3070
3079
  const agent = aiVisible && props.agent !== void 0 ? make("agent", () => asPayload(resolve(props.agent))) : void 0;
3071
3080
  const structuredAgent = aiVisible && props.agent !== void 0 ? make("structured-agent", () => structuredPayload(resolve(props.agent))) : void 0;
3072
3081
  const table = (exportVisible || props.primarySource === "table") && props.export?.sheetRows ? make("rows", () => {
3073
- const value = (0, import_content_transfer2.normalizeTransferJson)(props.export.sheetRows());
3082
+ const value = (0, import_content_transfer2.normalizeTransferJson)(props.export.sheetRows(), {
3083
+ omitUndefinedObjectProperties: true
3084
+ });
3074
3085
  if (!Array.isArray(value) || value.some(
3075
3086
  (row) => row === null || typeof row !== "object" || Array.isArray(row)
3076
3087
  ))
@@ -4070,24 +4081,26 @@ function CopySubsetDialog({ source, onClose }) {
4070
4081
  }
4071
4082
  return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Dialog, { open: true, onOpenChange: (open) => {
4072
4083
  if (!open) onClose();
4073
- }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: "flex h-[80dvh] max-w-5xl flex-col overflow-hidden", children: [
4084
+ }, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogContent, { className: "matrx-alchemy-workspace matrx-alchemy-subset", children: [
4074
4085
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogHeader, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(DialogTitle, { children: "Filter & sort before copying" }) }),
4075
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("fieldset", { className: "max-h-24 shrink-0 overflow-auto text-xs", children: [
4076
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("legend", { children: "Visible columns" }),
4077
- source.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "mr-3 inline-flex items-center gap-1", children: [
4078
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
4079
- const next = new Set(current);
4080
- next.has(column.id) ? next.delete(column.id) : next.add(column.id);
4081
- return next;
4082
- }) }),
4083
- column.header
4084
- ] }, column.id))
4086
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "matrx-alchemy-workspace-body matrx-alchemy-subset-body", children: [
4087
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("fieldset", { className: "matrx-alchemy-subset-columns", children: [
4088
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("legend", { children: "Visible columns" }),
4089
+ source.columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "mr-3 inline-flex items-center gap-1", children: [
4090
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("input", { type: "checkbox", checked: !hidden.has(column.id), onChange: () => setHidden((current) => {
4091
+ const next = new Set(current);
4092
+ next.has(column.id) ? next.delete(column.id) : next.add(column.id);
4093
+ return next;
4094
+ }) }),
4095
+ column.header
4096
+ ] }, column.id))
4097
+ ] }),
4098
+ columns.length ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "matrx-alchemy-subset-table", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(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__ */ (0, import_jsx_runtime24.jsx)("p", { children: "Show at least one column to copy." }),
4099
+ buildError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
4100
+ notice
4085
4101
  ] }),
4086
- columns.length ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "min-h-0 flex-1", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(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__ */ (0, import_jsx_runtime24.jsx)("p", { children: "Show at least one column to copy." }),
4087
- buildError ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { role: "alert", className: "text-destructive", children: buildError }) : null,
4088
- notice,
4089
4102
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(DialogFooter, { children: [
4090
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "flex items-center gap-2 text-sm", children: [
4103
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("label", { className: "matrx-alchemy-subset-format", children: [
4091
4104
  "Format",
4092
4105
  /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("select", { "aria-label": "Copy format", value: format, onChange: (event) => setFormat(event.target.value), children: [
4093
4106
  /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("option", { value: "ai", children: "For AI" }),
@@ -4106,8 +4119,8 @@ function CopySubsetDialog({ source, onClose }) {
4106
4119
  text.length.toLocaleString(),
4107
4120
  " characters"
4108
4121
  ] }),
4109
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { type: "button", variant: "outline", onClick: onClose, children: "Close" }),
4110
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { type: "button", disabled: buildError !== null || !columns.length || !shaped.length, onClick: () => void clipboard.copyText(text, `${source.label} copied`), children: "Copy subset" })
4122
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Button, { type: "button", variant: "outline", className: "matrx-alchemy-workspace-secondary", onClick: onClose, children: "Close" }),
4123
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(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" })
4111
4124
  ] })
4112
4125
  ] }) });
4113
4126
  }