@ai-matrx/design-system 0.21.2 → 0.21.4
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.
- package/CHANGELOG.md +6 -0
- package/dist/content-transfer.cjs +20 -6
- package/dist/content-transfer.cjs.map +1 -1
- package/dist/content-transfer.d.cts +38 -4
- package/dist/content-transfer.d.ts +38 -4
- package/dist/content-transfer.js +20 -6
- package/dist/content-transfer.js.map +1 -1
- package/dist/data-table/copy-helpers.d.cts +4 -3
- package/dist/data-table/copy-helpers.d.ts +4 -3
- package/dist/data-table/copy-types.cjs.map +1 -1
- package/dist/data-table/copy-types.d.cts +7 -2
- package/dist/data-table/copy-types.d.ts +7 -2
- package/dist/data-table/data-row-inspector.cjs +26 -6
- package/dist/data-table/data-row-inspector.cjs.map +1 -1
- package/dist/data-table/data-row-inspector.js +26 -6
- package/dist/data-table/data-row-inspector.js.map +1 -1
- package/dist/data-table/data-row-window.cjs +26 -6
- package/dist/data-table/data-row-window.cjs.map +1 -1
- package/dist/data-table/data-row-window.js +26 -6
- package/dist/data-table/data-row-window.js.map +1 -1
- package/dist/data-table/filter-engine.d.cts +4 -3
- package/dist/data-table/filter-engine.d.ts +4 -3
- package/dist/data-table/host.cjs +23 -1
- package/dist/data-table/host.cjs.map +1 -1
- package/dist/data-table/host.d.cts +33 -4
- package/dist/data-table/host.d.ts +33 -4
- package/dist/data-table/host.js +23 -1
- package/dist/data-table/host.js.map +1 -1
- package/dist/data-table/index.cjs +890 -751
- package/dist/data-table/index.cjs.map +1 -1
- package/dist/data-table/index.d.cts +16 -6
- package/dist/data-table/index.d.ts +16 -6
- package/dist/data-table/index.js +846 -707
- package/dist/data-table/index.js.map +1 -1
- package/dist/data-table/infer-filter.d.cts +4 -3
- package/dist/data-table/infer-filter.d.ts +4 -3
- package/dist/data-table/layered-filters.d.cts +4 -3
- package/dist/data-table/layered-filters.d.ts +4 -3
- package/dist/data-table/pagination.cjs +6 -0
- package/dist/data-table/pagination.cjs.map +1 -1
- package/dist/data-table/pagination.js +6 -0
- package/dist/data-table/pagination.js.map +1 -1
- package/dist/data-table/query-control.d.cts +4 -3
- package/dist/data-table/query-control.d.ts +4 -3
- package/dist/data-table/types.cjs.map +1 -1
- package/dist/data-table/types.d.cts +3 -2
- package/dist/data-table/types.d.ts +3 -2
- package/dist/data-table/url-state.d.cts +4 -3
- package/dist/data-table/url-state.d.ts +4 -3
- package/dist/data-table/uuid-cell.cjs +6 -0
- package/dist/data-table/uuid-cell.cjs.map +1 -1
- package/dist/data-table/uuid-cell.js +6 -0
- package/dist/data-table/uuid-cell.js.map +1 -1
- package/dist/data-table/xlsx.d.cts +4 -3
- package/dist/data-table/xlsx.d.ts +4 -3
- package/dist/{types-DnnvjGV4.d.ts → types-CbGNfo7r.d.ts} +13 -2
- package/dist/{types-Bt-0UhEw.d.cts → types-DRusLYrU.d.cts} +13 -2
- package/package.json +1 -1
- package/dist/extensions-DCHtNwG3.d.cts +0 -32
- package/dist/extensions-DCHtNwG3.d.ts +0 -32
|
@@ -374,6 +374,12 @@ var HostContext = hostRegistry[HOST_SLOT] ??= createContext4({});
|
|
|
374
374
|
function useMatrxDataTableHost() {
|
|
375
375
|
return useContext4(HostContext);
|
|
376
376
|
}
|
|
377
|
+
var ROW_ALCHEMY_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-alchemy-context");
|
|
378
|
+
var rowAlchemyRegistry = globalThis;
|
|
379
|
+
var RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext4(null);
|
|
380
|
+
var ROW_CONTROLS_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-controls-context");
|
|
381
|
+
var rowControlsRegistry = globalThis;
|
|
382
|
+
var RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext4(null);
|
|
377
383
|
|
|
378
384
|
// src/content-transfer/matrx-copy.tsx
|
|
379
385
|
import * as React10 from "react";
|
|
@@ -1407,8 +1413,9 @@ function ContentTransferMenu(props) {
|
|
|
1407
1413
|
const identityKey = props.capabilities?.identityKey ?? inherited.identityKey;
|
|
1408
1414
|
return /* @__PURE__ */ jsx13(ContentTransferMenuSession, { ...props }, identityKey ?? "anonymous");
|
|
1409
1415
|
}
|
|
1410
|
-
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" }) {
|
|
1416
|
+
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 }) {
|
|
1411
1417
|
const triggerRef = React9.useRef(null);
|
|
1418
|
+
const restoreFocusRef = React9.useRef(null);
|
|
1412
1419
|
const inherited = React9.useContext(CapabilityContext);
|
|
1413
1420
|
const nearestSurface = React9.useContext(SurfaceContext);
|
|
1414
1421
|
const fence = useFence();
|
|
@@ -1658,13 +1665,21 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
1658
1665
|
);
|
|
1659
1666
|
React9.useImperativeHandle(controllerRef, () => ({
|
|
1660
1667
|
focusTrigger: () => triggerRef.current?.focus(),
|
|
1668
|
+
preparePrimary: async (options) => {
|
|
1669
|
+
if (!enabled) throw new Error("Alchemy is not enabled for this record.");
|
|
1670
|
+
if (disabled) throw new Error("Alchemy is disabled for this record.");
|
|
1671
|
+
if (hide.includes("prepare")) throw new Error("Alchemy preparation is unavailable for this record.");
|
|
1672
|
+
if (!primary) throw new Error("Alchemy has no source to prepare.");
|
|
1673
|
+
restoreFocusRef.current = options?.restoreFocus ?? null;
|
|
1674
|
+
await openWorkspace(primaryWorkspaceKey, { source: primary, label: sourceLabel });
|
|
1675
|
+
},
|
|
1661
1676
|
prepare: async (requestedSource, options) => {
|
|
1662
1677
|
const requestedLabel = options?.label ?? ("label" in requestedSource ? requestedSource.label : "content");
|
|
1663
1678
|
const requestedKey = `controller:${options?.id ?? "source"}:${materialIdentity(requestedSource)}`;
|
|
1664
1679
|
externalWorkspaceKeys.current.add(requestedKey);
|
|
1665
1680
|
await openWorkspace(requestedKey, { source: requestedSource, label: requestedLabel });
|
|
1666
1681
|
}
|
|
1667
|
-
}), [openWorkspace]);
|
|
1682
|
+
}), [disabled, enabled, hide, openWorkspace, primary, primaryWorkspaceKey, sourceLabel]);
|
|
1668
1683
|
const runAction = React9.useCallback(async (action) => {
|
|
1669
1684
|
const { controller, id } = fence.begin();
|
|
1670
1685
|
try {
|
|
@@ -1747,7 +1762,7 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
1747
1762
|
] }, id);
|
|
1748
1763
|
};
|
|
1749
1764
|
return /* @__PURE__ */ jsxs7("span", { className: cn("matrx-alchemy", className), onClick: stopPropagation ? (event) => event.stopPropagation() : void 0, children: [
|
|
1750
|
-
/* @__PURE__ */ jsxs7(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
1765
|
+
!triggerHidden ? /* @__PURE__ */ jsxs7(Popover, { open: paletteOpen, onOpenChange: (open) => {
|
|
1751
1766
|
setPaletteOpen(open);
|
|
1752
1767
|
if (open) {
|
|
1753
1768
|
setMode("copy");
|
|
@@ -1856,13 +1871,13 @@ function ContentTransferMenuSession({ references = [], referenceActions = [], so
|
|
|
1856
1871
|
] }, group) : null;
|
|
1857
1872
|
})
|
|
1858
1873
|
] })
|
|
1859
|
-
] }),
|
|
1874
|
+
] }) : null,
|
|
1860
1875
|
notice && triggerRef.current ? createPortal(/* @__PURE__ */ jsxs7("div", { className: "matrx-alchemy-feedback", children: [
|
|
1861
1876
|
/* @__PURE__ */ jsx13("span", { role: "status", children: notice }),
|
|
1862
1877
|
/* @__PURE__ */ jsx13(ReceiptLink, { target: receiptTarget }),
|
|
1863
1878
|
/* @__PURE__ */ jsx13("button", { type: "button", "aria-label": "Dismiss Alchemy feedback", onClick: () => setNotice(null), children: "\xD7" })
|
|
1864
1879
|
] }), triggerRef.current.ownerDocument.body) : null,
|
|
1865
|
-
Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx13(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)),
|
|
1880
|
+
Object.values(workspaces).map((saved) => /* @__PURE__ */ jsx13(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)),
|
|
1866
1881
|
emailReview
|
|
1867
1882
|
] });
|
|
1868
1883
|
}
|
|
@@ -2669,7 +2684,12 @@ function MatrxCopyMenuSession(props) {
|
|
|
2669
2684
|
...props.referenceActions ? { referenceActions: props.referenceActions } : {},
|
|
2670
2685
|
...props.icon !== void 0 ? { icon: props.icon } : {},
|
|
2671
2686
|
...props.triggerVariant !== void 0 ? { triggerVariant: props.triggerVariant } : {},
|
|
2672
|
-
controllerRef:
|
|
2687
|
+
controllerRef: (value) => {
|
|
2688
|
+
controller.current = value;
|
|
2689
|
+
if (typeof props.controllerRef === "function") props.controllerRef(value);
|
|
2690
|
+
else if (props.controllerRef) props.controllerRef.current = value;
|
|
2691
|
+
},
|
|
2692
|
+
...props.triggerHidden ? { triggerHidden: true } : {},
|
|
2673
2693
|
label: props.label,
|
|
2674
2694
|
variants,
|
|
2675
2695
|
actions,
|