@ai-matrx/design-system 0.21.1 → 0.21.3

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 (61) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/content-transfer.cjs +20 -6
  3. package/dist/content-transfer.cjs.map +1 -1
  4. package/dist/content-transfer.d.cts +38 -4
  5. package/dist/content-transfer.d.ts +38 -4
  6. package/dist/content-transfer.js +20 -6
  7. package/dist/content-transfer.js.map +1 -1
  8. package/dist/data-table/copy-helpers.d.cts +4 -3
  9. package/dist/data-table/copy-helpers.d.ts +4 -3
  10. package/dist/data-table/copy-types.cjs.map +1 -1
  11. package/dist/data-table/copy-types.d.cts +7 -2
  12. package/dist/data-table/copy-types.d.ts +7 -2
  13. package/dist/data-table/data-row-inspector.cjs +23 -6
  14. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  15. package/dist/data-table/data-row-inspector.js +23 -6
  16. package/dist/data-table/data-row-inspector.js.map +1 -1
  17. package/dist/data-table/data-row-window.cjs +23 -6
  18. package/dist/data-table/data-row-window.cjs.map +1 -1
  19. package/dist/data-table/data-row-window.js +23 -6
  20. package/dist/data-table/data-row-window.js.map +1 -1
  21. package/dist/data-table/filter-engine.d.cts +4 -3
  22. package/dist/data-table/filter-engine.d.ts +4 -3
  23. package/dist/data-table/host.cjs +12 -1
  24. package/dist/data-table/host.cjs.map +1 -1
  25. package/dist/data-table/host.d.cts +16 -3
  26. package/dist/data-table/host.d.ts +16 -3
  27. package/dist/data-table/host.js +12 -1
  28. package/dist/data-table/host.js.map +1 -1
  29. package/dist/data-table/index.cjs +992 -843
  30. package/dist/data-table/index.cjs.map +1 -1
  31. package/dist/data-table/index.d.cts +15 -6
  32. package/dist/data-table/index.d.ts +15 -6
  33. package/dist/data-table/index.js +949 -800
  34. package/dist/data-table/index.js.map +1 -1
  35. package/dist/data-table/infer-filter.d.cts +4 -3
  36. package/dist/data-table/infer-filter.d.ts +4 -3
  37. package/dist/data-table/layered-filters.d.cts +4 -3
  38. package/dist/data-table/layered-filters.d.ts +4 -3
  39. package/dist/data-table/pagination.cjs +3 -0
  40. package/dist/data-table/pagination.cjs.map +1 -1
  41. package/dist/data-table/pagination.js +3 -0
  42. package/dist/data-table/pagination.js.map +1 -1
  43. package/dist/data-table/query-control.d.cts +4 -3
  44. package/dist/data-table/query-control.d.ts +4 -3
  45. package/dist/data-table/types.cjs.map +1 -1
  46. package/dist/data-table/types.d.cts +3 -2
  47. package/dist/data-table/types.d.ts +3 -2
  48. package/dist/data-table/url-state.d.cts +4 -3
  49. package/dist/data-table/url-state.d.ts +4 -3
  50. package/dist/data-table/uuid-cell.cjs +3 -0
  51. package/dist/data-table/uuid-cell.cjs.map +1 -1
  52. package/dist/data-table/uuid-cell.js +3 -0
  53. package/dist/data-table/uuid-cell.js.map +1 -1
  54. package/dist/data-table/xlsx.d.cts +4 -3
  55. package/dist/data-table/xlsx.d.ts +4 -3
  56. package/dist/styles.css +9 -0
  57. package/dist/{types-B99KFITZ.d.cts → types-BarjBFyG.d.cts} +9 -1
  58. package/dist/{types-CryQuMmz.d.ts → types-JFlsIv-0.d.ts} +9 -1
  59. package/package.json +1 -1
  60. package/dist/extensions-DCHtNwG3.d.cts +0 -32
  61. package/dist/extensions-DCHtNwG3.d.ts +0 -32
@@ -1354,8 +1354,9 @@ function ContentTransferMenu(props) {
1354
1354
  const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
1355
1355
  return /* @__PURE__ */ jsx10(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
1356
1356
  }
1357
- function ContentTransferMenuSession({ references = [], referenceActions = [], source, surface, label, projection, sections, preferences, table, formatSources, sourceFormats = true, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef, icon = "portal", triggerVariant = "transparent", triggerSize = "default" }) {
1357
+ function ContentTransferMenuSession({ references = [], referenceActions = [], source, surface, label, projection, sections, preferences, table, formatSources, sourceFormats = true, variants = EMPTY_VARIANTS, actions = [], capabilities: local, disabled, enabled = true, className, stopPropagation = true, hide = [], controllerRef, icon = "portal", triggerVariant = "transparent", triggerSize = "default", triggerHidden = false }) {
1358
1358
  const triggerRef = React9.useRef(null);
1359
+ const restoreFocusRef = React9.useRef(null);
1359
1360
  const inherited = React9.useContext(CapabilityContext);
1360
1361
  const nearestSurface = React9.useContext(SurfaceContext);
1361
1362
  const fence = useFence();
@@ -1605,13 +1606,21 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
1605
1606
  );
1606
1607
  React9.useImperativeHandle(controllerRef, () => ({
1607
1608
  focusTrigger: () => triggerRef.current?.focus(),
1609
+ preparePrimary: async (options) => {
1610
+ if (!enabled) throw new Error("Alchemy is not enabled for this record.");
1611
+ if (disabled) throw new Error("Alchemy is disabled for this record.");
1612
+ if (hide.includes("prepare")) throw new Error("Alchemy preparation is unavailable for this record.");
1613
+ if (!primary) throw new Error("Alchemy has no source to prepare.");
1614
+ restoreFocusRef.current = options?.restoreFocus ?? null;
1615
+ await openWorkspace(primaryWorkspaceKey, { source: primary, label: sourceLabel });
1616
+ },
1608
1617
  prepare: async (requestedSource, options) => {
1609
1618
  const requestedLabel = options?.label ?? ("label" in requestedSource ? requestedSource.label : "content");
1610
1619
  const requestedKey = `controller:${options?.id ?? "source"}:${materialIdentity(requestedSource)}`;
1611
1620
  externalWorkspaceKeys.current.add(requestedKey);
1612
1621
  await openWorkspace(requestedKey, { source: requestedSource, label: requestedLabel });
1613
1622
  }
1614
- }), [openWorkspace]);
1623
+ }), [disabled, enabled, hide, openWorkspace, primary, primaryWorkspaceKey, sourceLabel]);
1615
1624
  const runAction = React9.useCallback(async (action) => {
1616
1625
  const { controller, id } = fence.begin();
1617
1626
  try {
@@ -1694,7 +1703,7 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
1694
1703
  ] }, id);
1695
1704
  };
1696
1705
  return /* @__PURE__ */ jsxs5("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
1697
- /* @__PURE__ */ jsxs5(Popover, { open: paletteOpen, onOpenChange: (open) => {
1706
+ !triggerHidden ? /* @__PURE__ */ jsxs5(Popover, { open: paletteOpen, onOpenChange: (open) => {
1698
1707
  setPaletteOpen(open);
1699
1708
  if (open) {
1700
1709
  setMode("copy");
@@ -1803,13 +1812,13 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
1803
1812
  ] }, group) : null;
1804
1813
  })
1805
1814
  ] })
1806
- ] }),
1815
+ ] }) : null,
1807
1816
  notice && triggerRef.current ? createPortal(/* @__PURE__ */ jsxs5("div", { className: "matrx-alchemy-feedback", children: [
1808
1817
  /* @__PURE__ */ jsx10("span", { role: "status", children: notice }),
1809
1818
  /* @__PURE__ */ jsx10(ReceiptLink, { target: receiptTarget }),
1810
1819
  /* @__PURE__ */ jsx10("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
1811
1820
  ] }), triggerRef.current.ownerDocument.body) : null,
1812
- Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx10(PreparationWorkspace, { restoreFocus: () => triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, scopeLabels: table?.scopeLabels, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, actions: preparedActions, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key)),
1821
+ Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx10(PreparationWorkspace, { restoreFocus: () => restoreFocusRef.current?.() ?? triggerRef.current?.focus(), open: workspaceOpen && workspaceKey === saved.key, state: saved, scopes, scopeLabels: table?.scopeLabels, onClose: () => setWorkspaceOpen(false), onChange: (next) => setWorkspaces((current) => ({ ...current, [saved.key]: next })), transport, adapters, actions: preparedActions, captureScope: workspaceCaptures.current.get(saved.key) ?? capturePrimary, ...ai ? { ai } : {}, onOutcome: report }, saved.key)),
1813
1822
  emailReview
1814
1823
  ] });
1815
1824
  }
@@ -2616,7 +2625,12 @@ function MatrxCopyMenuSession(props) {
2616
2625
  ...props.referenceActions ? { referenceActions: props.referenceActions } : {},
2617
2626
  ...props.icon !== void 0 ? { icon: props.icon } : {},
2618
2627
  ...props.triggerVariant !== void 0 ? { triggerVariant: props.triggerVariant } : {},
2619
- controllerRef: controller,
2628
+ controllerRef: (value) => {
2629
+ controller.current = value;
2630
+ if (typeof props.controllerRef === "function") props.controllerRef(value);
2631
+ else if (props.controllerRef) props.controllerRef.current = value;
2632
+ },
2633
+ ...props.triggerHidden ? { triggerHidden: true } : {},
2620
2634
  label: props.label,
2621
2635
  variants,
2622
2636
  actions,
@@ -2914,6 +2928,9 @@ var HostContext = hostRegistry[HOST_SLOT] ??= createContext5({});
2914
2928
  function useMatrxDataTableHost() {
2915
2929
  return useContext5(HostContext);
2916
2930
  }
2931
+ var ROW_ALCHEMY_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-alchemy-context");
2932
+ var rowAlchemyRegistry = globalThis;
2933
+ var RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext5(null);
2917
2934
 
2918
2935
  // src/data-table/copy.tsx
2919
2936
  import { jsx as jsx13 } from "react/jsx-runtime";