@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.
Files changed (60) hide show
  1. package/CHANGELOG.md +6 -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 +26 -6
  14. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  15. package/dist/data-table/data-row-inspector.js +26 -6
  16. package/dist/data-table/data-row-inspector.js.map +1 -1
  17. package/dist/data-table/data-row-window.cjs +26 -6
  18. package/dist/data-table/data-row-window.cjs.map +1 -1
  19. package/dist/data-table/data-row-window.js +26 -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 +23 -1
  24. package/dist/data-table/host.cjs.map +1 -1
  25. package/dist/data-table/host.d.cts +33 -4
  26. package/dist/data-table/host.d.ts +33 -4
  27. package/dist/data-table/host.js +23 -1
  28. package/dist/data-table/host.js.map +1 -1
  29. package/dist/data-table/index.cjs +890 -751
  30. package/dist/data-table/index.cjs.map +1 -1
  31. package/dist/data-table/index.d.cts +16 -6
  32. package/dist/data-table/index.d.ts +16 -6
  33. package/dist/data-table/index.js +846 -707
  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 +6 -0
  40. package/dist/data-table/pagination.cjs.map +1 -1
  41. package/dist/data-table/pagination.js +6 -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 +6 -0
  51. package/dist/data-table/uuid-cell.cjs.map +1 -1
  52. package/dist/data-table/uuid-cell.js +6 -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/{types-DnnvjGV4.d.ts → types-CbGNfo7r.d.ts} +13 -2
  57. package/dist/{types-Bt-0UhEw.d.cts → types-DRusLYrU.d.cts} +13 -2
  58. package/package.json +1 -1
  59. package/dist/extensions-DCHtNwG3.d.cts +0 -32
  60. package/dist/extensions-DCHtNwG3.d.ts +0 -32
@@ -1,7 +1,8 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-Bt-0UhEw.cjs';
2
- import '../extensions-DCHtNwG3.cjs';
3
- import '@ai-matrx/kit/content-transfer';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-DRusLYrU.cjs';
2
+ import '../content-transfer.cjs';
4
3
  import 'react';
4
+ import '@ai-matrx/kit/content-transfer';
5
+ import '../content-transfer/icon.cjs';
5
6
  import './copy-types.cjs';
6
7
 
7
8
  /**
@@ -1,7 +1,8 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-DnnvjGV4.js';
2
- import '../extensions-DCHtNwG3.js';
3
- import '@ai-matrx/kit/content-transfer';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-CbGNfo7r.js';
2
+ import '../content-transfer.js';
4
3
  import 'react';
4
+ import '@ai-matrx/kit/content-transfer';
5
+ import '../content-transfer/icon.js';
5
6
  import './copy-types.js';
6
7
 
7
8
  /**
@@ -23,7 +23,11 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
23
23
  var host_exports = {};
24
24
  __export(host_exports, {
25
25
  MatrxDataTableProvider: () => MatrxDataTableProvider,
26
- useMatrxDataTableHost: () => useMatrxDataTableHost
26
+ MatrxTableRowAlchemyScope: () => MatrxTableRowAlchemyScope,
27
+ MatrxTableRowControlsScope: () => MatrxTableRowControlsScope,
28
+ useMatrxDataTableHost: () => useMatrxDataTableHost,
29
+ useMatrxTableRowAlchemy: () => useMatrxTableRowAlchemy,
30
+ useMatrxTableRowControls: () => useMatrxTableRowControls
27
31
  });
28
32
  module.exports = __toCommonJS(host_exports);
29
33
  var import_react = require("react");
@@ -37,4 +41,22 @@ function MatrxDataTableProvider({ value, children }) {
37
41
  function useMatrxDataTableHost() {
38
42
  return (0, import_react.useContext)(HostContext);
39
43
  }
44
+ var ROW_ALCHEMY_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-alchemy-context");
45
+ var rowAlchemyRegistry = globalThis;
46
+ var RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= (0, import_react.createContext)(null);
47
+ function MatrxTableRowAlchemyScope({ value, children }) {
48
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowAlchemyContext.Provider, { value, children });
49
+ }
50
+ function useMatrxTableRowAlchemy() {
51
+ return (0, import_react.useContext)(RowAlchemyContext);
52
+ }
53
+ var ROW_CONTROLS_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-controls-context");
54
+ var rowControlsRegistry = globalThis;
55
+ var RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= (0, import_react.createContext)(null);
56
+ function MatrxTableRowControlsScope({ value, children }) {
57
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RowControlsContext.Provider, { value, children });
58
+ }
59
+ function useMatrxTableRowControls() {
60
+ return (0, import_react.useContext)(RowControlsContext);
61
+ }
40
62
  //# sourceMappingURL=host.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/data-table/host.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type Context, type ComponentType, type ReactNode, type MouseEventHandler } from \"react\";\nimport type { CopyControlProps } from \"./copy-types\";\nimport type { MatrxDataTableDensity, TableSavedViewsProps } from \"./types\";\n\nexport type {\n AgentPayloadInput,\n AiCustomSource,\n AiVariant,\n CopyControlProps,\n CopyExportConfig,\n} from \"./copy-types\";\n\nexport interface TableLinkProps { href: string; children: ReactNode; className?: string; onClick?: MouseEventHandler<HTMLAnchorElement>; }\n/**\n * Host-owned toolbar affordance. The table package keeps operation state and\n * labels; an application can supply its canonical icon-button primitive\n * without making the shared package depend on an application UI package.\n */\nexport interface TableToolbarActionProps { ariaLabel: string; tooltip?: string | undefined; disabled?: boolean | undefined; busy?: boolean | undefined; /** Indicates a selected mutually-exclusive action such as the current page. */ active?: boolean | undefined; onClick: () => void; children: ReactNode; }\nexport interface TableSidePanelProps { title: string; titleNode?: ReactNode; description?: ReactNode; onClose: () => void; defaultWidth?: number; headerActions?: ReactNode; children: ReactNode; }\nexport interface TableWindowPanelProps { id: string; title: string; onClose: () => void; width?: number; height?: number; minWidth?: number; minHeight?: number; actionsRight?: ReactNode; bodyClassName?: string; sidebarDefaultSize?: number; sidebarMinSize?: number; sidebar?: ReactNode; children: ReactNode; }\nexport interface TableEntityRefProps { token: string; id: string; href?: string; children: ReactNode; className?: string; }\nexport interface TablePeekProps { kind: string; id: string; href?: string; onClose: () => void; }\nexport interface TableDoors { href?: string; peekKind?: string; canPeek?: boolean; }\nexport interface MatrxDataTableHost { JsonViewer?: ComponentType<{ data: object | string }>; Link?: ComponentType<TableLinkProps>; CopyControls?: ComponentType<CopyControlProps>; ToolbarAction?: ComponentType<TableToolbarActionProps>; SidePanelSurface?: ComponentType<TableSidePanelProps>; WindowPanel?: ComponentType<TableWindowPanelProps>; EntityRef?: ComponentType<TableEntityRefProps>; resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null; ResourcePeek?: ComponentType<TablePeekProps>; SavedViews?: ComponentType<TableSavedViewsProps>; /** Host default; a table's explicit density takes precedence. */ defaultDensity?: MatrxDataTableDensity; notify?: { success(message: string): void; error(message: string): void }; }\n// Public entrypoints are independently bundled in ESM and CJS. The context\n// identity must survive those bundle boundaries; values stay provider-scoped.\nconst HOST_SLOT = Symbol.for(\"ai-matrx.design-system.table-host-context\");\nconst hostRegistry = globalThis as typeof globalThis & { [HOST_SLOT]?: Context<MatrxDataTableHost> };\nconst HostContext = hostRegistry[HOST_SLOT] ??= createContext<MatrxDataTableHost>({});\nexport function MatrxDataTableProvider({ value, children }: { value: MatrxDataTableHost; children: ReactNode }) { return <HostContext.Provider value={value}>{children}</HostContext.Provider>; }\nexport function useMatrxDataTableHost(): MatrxDataTableHost { return useContext(HostContext); }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAoH;AA8BK;AAHzH,IAAM,YAAY,uBAAO,IAAI,2CAA2C;AACxE,IAAM,eAAe;AACrB,IAAM,cAAc,aAAa,SAAS,UAAM,4BAAkC,CAAC,CAAC;AAC7E,SAAS,uBAAuB,EAAE,OAAO,SAAS,GAAuD;AAAE,SAAO,4CAAC,YAAY,UAAZ,EAAqB,OAAe,UAAS;AAAyB;AACzL,SAAS,wBAA4C;AAAE,aAAO,yBAAW,WAAW;AAAG;","names":[]}
1
+ {"version":3,"sources":["../../src/data-table/host.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type Context, type ComponentType, type ReactNode, type MouseEventHandler } from \"react\";\nimport type { CopyControlProps } from \"./copy-types\";\nimport type { MatrxDataTableDensity, MatrxDataTableRecordControls, TableSavedViewsProps } from \"./types\";\n\nexport type {\n AgentPayloadInput,\n AiCustomSource,\n AiVariant,\n CopyControlProps,\n CopyExportConfig,\n} from \"./copy-types\";\n\nexport interface TableLinkProps { href: string; children: ReactNode; className?: string; onClick?: MouseEventHandler<HTMLAnchorElement>; }\n/**\n * Host-owned toolbar affordance. The table package keeps operation state and\n * labels; an application can supply its canonical icon-button primitive\n * without making the shared package depend on an application UI package.\n */\nexport interface TableToolbarActionProps { ariaLabel: string; tooltip?: string | undefined; disabled?: boolean | undefined; busy?: boolean | undefined; /** Indicates a selected mutually-exclusive action such as the current page. */ active?: boolean | undefined; onClick: () => void; children: ReactNode; }\nexport interface TableSidePanelProps { title: string; titleNode?: ReactNode; description?: ReactNode; onClose: () => void; defaultWidth?: number; headerActions?: ReactNode; children: ReactNode; }\nexport interface TableWindowPanelProps { id: string; title: string; onClose: () => void; width?: number; height?: number; minWidth?: number; minHeight?: number; actionsRight?: ReactNode; bodyClassName?: string; sidebarDefaultSize?: number; sidebarMinSize?: number; sidebar?: ReactNode; children: ReactNode; }\nexport interface TableEntityRefProps { token: string; id: string; href?: string; children: ReactNode; className?: string; }\nexport interface TablePeekProps { kind: string; id: string; href?: string; onClose: () => void; }\nexport interface TableDoors { href?: string; peekKind?: string; canPeek?: boolean; }\nexport interface TableRowContextRegistry { register(tableId: string, resolve: (rowId: string) => unknown): () => void; }\nexport interface TableContextMenuBoundaryProps { label: string; children: ReactNode; }\nexport interface MatrxDataTableHost { JsonViewer?: ComponentType<{ data: object | string }>; Link?: ComponentType<TableLinkProps>; CopyControls?: ComponentType<CopyControlProps>; ToolbarAction?: ComponentType<TableToolbarActionProps>; SidePanelSurface?: ComponentType<TableSidePanelProps>; WindowPanel?: ComponentType<TableWindowPanelProps>; EntityRef?: ComponentType<TableEntityRefProps>; resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null; ResourcePeek?: ComponentType<TablePeekProps>; SavedViews?: ComponentType<TableSavedViewsProps>; rowContextRegistry?: TableRowContextRegistry; createDefaultRowContext?: (row: unknown, controls: import(\"./types\").MatrxDataTableRecordControls) => unknown; ContextMenuBoundary?: ComponentType<TableContextMenuBoundaryProps>; /** Host default; a table's explicit density takes precedence. */ defaultDensity?: MatrxDataTableDensity; notify?: { success(message: string): void; error(message: string): void }; }\n// Public entrypoints are independently bundled in ESM and CJS. The context\n// identity must survive those bundle boundaries; values stay provider-scoped.\nconst HOST_SLOT = Symbol.for(\"ai-matrx.design-system.table-host-context\");\nconst hostRegistry = globalThis as typeof globalThis & { [HOST_SLOT]?: Context<MatrxDataTableHost> };\nconst HostContext = hostRegistry[HOST_SLOT] ??= createContext<MatrxDataTableHost>({});\nexport function MatrxDataTableProvider({ value, children }: { value: MatrxDataTableHost; children: ReactNode }) { return <HostContext.Provider value={value}>{children}</HostContext.Provider>; }\nexport function useMatrxDataTableHost(): MatrxDataTableHost { return useContext(HostContext); }\n\nexport interface MatrxTableRowAlchemy {\n copy: CopyControlProps;\n controls?: MatrxDataTableRecordControls;\n placement: \"inline\" | \"menu\";\n ready: boolean;\n activate(): void;\n prepare(restoreFocus?: () => void): Promise<void>;\n}\n\nconst ROW_ALCHEMY_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-alchemy-context\");\nconst rowAlchemyRegistry = globalThis as typeof globalThis & { [ROW_ALCHEMY_SLOT]?: Context<MatrxTableRowAlchemy | null> };\nconst RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext<MatrxTableRowAlchemy | null>(null);\n\nexport function MatrxTableRowAlchemyScope({ value, children }: { value: MatrxTableRowAlchemy; children: ReactNode }) { return <RowAlchemyContext.Provider value={value}>{children}</RowAlchemyContext.Provider>; }\n\nexport function useMatrxTableRowAlchemy(): MatrxTableRowAlchemy | null { return useContext(RowAlchemyContext); }\n\nconst ROW_CONTROLS_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-controls-context\");\nconst rowControlsRegistry = globalThis as typeof globalThis & { [ROW_CONTROLS_SLOT]?: Context<MatrxDataTableRecordControls | null> };\nconst RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext<MatrxDataTableRecordControls | null>(null);\nexport function MatrxTableRowControlsScope({ value, children }: { value: MatrxDataTableRecordControls; children: ReactNode }) { return <RowControlsContext.Provider value={value}>{children}</RowControlsContext.Provider>; }\nexport function useMatrxTableRowControls(): MatrxDataTableRecordControls | null { return useContext(RowControlsContext); }\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,mBAAoH;AAgCK;AAHzH,IAAM,YAAY,uBAAO,IAAI,2CAA2C;AACxE,IAAM,eAAe;AACrB,IAAM,cAAc,aAAa,SAAS,UAAM,4BAAkC,CAAC,CAAC;AAC7E,SAAS,uBAAuB,EAAE,OAAO,SAAS,GAAuD;AAAE,SAAO,4CAAC,YAAY,UAAZ,EAAqB,OAAe,UAAS;AAAyB;AACzL,SAAS,wBAA4C;AAAE,aAAO,yBAAW,WAAW;AAAG;AAW9F,IAAM,mBAAmB,uBAAO,IAAI,kDAAkD;AACtF,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB,mBAAmB,gBAAgB,UAAM,4BAA2C,IAAI;AAE3G,SAAS,0BAA0B,EAAE,OAAO,SAAS,GAAyD;AAAE,SAAO,4CAAC,kBAAkB,UAAlB,EAA2B,OAAe,UAAS;AAA+B;AAE1M,SAAS,0BAAuD;AAAE,aAAO,yBAAW,iBAAiB;AAAG;AAE/G,IAAM,oBAAoB,uBAAO,IAAI,mDAAmD;AACxF,IAAM,sBAAsB;AAC5B,IAAM,qBAAqB,oBAAoB,iBAAiB,UAAM,4BAAmD,IAAI;AACtH,SAAS,2BAA2B,EAAE,OAAO,SAAS,GAAiE;AAAE,SAAO,4CAAC,mBAAmB,UAAnB,EAA4B,OAAe,UAAS;AAAgC;AACrN,SAAS,2BAAgE;AAAE,aAAO,yBAAW,kBAAkB;AAAG;","names":[]}
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
+ import { b as TableSavedViewsProps, c as MatrxDataTableRecordControls, d as MatrxDataTableDensity } from '../types-DRusLYrU.cjs';
3
4
  import { CopyControlProps } from './copy-types.cjs';
4
5
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.cjs';
5
- import { b as TableSavedViewsProps, c as MatrxDataTableDensity } from '../types-Bt-0UhEw.cjs';
6
- import '../extensions-DCHtNwG3.cjs';
6
+ import '../content-transfer.cjs';
7
7
  import '@ai-matrx/kit/content-transfer';
8
+ import '../content-transfer/icon.cjs';
8
9
 
9
10
  interface TableLinkProps {
10
11
  href: string;
@@ -68,6 +69,13 @@ interface TableDoors {
68
69
  peekKind?: string;
69
70
  canPeek?: boolean;
70
71
  }
72
+ interface TableRowContextRegistry {
73
+ register(tableId: string, resolve: (rowId: string) => unknown): () => void;
74
+ }
75
+ interface TableContextMenuBoundaryProps {
76
+ label: string;
77
+ children: ReactNode;
78
+ }
71
79
  interface MatrxDataTableHost {
72
80
  JsonViewer?: ComponentType<{
73
81
  data: object | string;
@@ -80,7 +88,10 @@ interface MatrxDataTableHost {
80
88
  EntityRef?: ComponentType<TableEntityRefProps>;
81
89
  resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null;
82
90
  ResourcePeek?: ComponentType<TablePeekProps>;
83
- SavedViews?: ComponentType<TableSavedViewsProps>; /** Host default; a table's explicit density takes precedence. */
91
+ SavedViews?: ComponentType<TableSavedViewsProps>;
92
+ rowContextRegistry?: TableRowContextRegistry;
93
+ createDefaultRowContext?: (row: unknown, controls: MatrxDataTableRecordControls) => unknown;
94
+ ContextMenuBoundary?: ComponentType<TableContextMenuBoundaryProps>; /** Host default; a table's explicit density takes precedence. */
84
95
  defaultDensity?: MatrxDataTableDensity;
85
96
  notify?: {
86
97
  success(message: string): void;
@@ -92,5 +103,23 @@ declare function MatrxDataTableProvider({ value, children }: {
92
103
  children: ReactNode;
93
104
  }): React.JSX.Element;
94
105
  declare function useMatrxDataTableHost(): MatrxDataTableHost;
106
+ interface MatrxTableRowAlchemy {
107
+ copy: CopyControlProps;
108
+ controls?: MatrxDataTableRecordControls;
109
+ placement: "inline" | "menu";
110
+ ready: boolean;
111
+ activate(): void;
112
+ prepare(restoreFocus?: () => void): Promise<void>;
113
+ }
114
+ declare function MatrxTableRowAlchemyScope({ value, children }: {
115
+ value: MatrxTableRowAlchemy;
116
+ children: ReactNode;
117
+ }): React.JSX.Element;
118
+ declare function useMatrxTableRowAlchemy(): MatrxTableRowAlchemy | null;
119
+ declare function MatrxTableRowControlsScope({ value, children }: {
120
+ value: MatrxDataTableRecordControls;
121
+ children: ReactNode;
122
+ }): React.JSX.Element;
123
+ declare function useMatrxTableRowControls(): MatrxDataTableRecordControls | null;
95
124
 
96
- export { CopyControlProps, type MatrxDataTableHost, MatrxDataTableProvider, type TableDoors, type TableEntityRefProps, type TableLinkProps, type TablePeekProps, type TableSidePanelProps, type TableToolbarActionProps, type TableWindowPanelProps, useMatrxDataTableHost };
125
+ export { CopyControlProps, type MatrxDataTableHost, MatrxDataTableProvider, type MatrxTableRowAlchemy, MatrxTableRowAlchemyScope, MatrxTableRowControlsScope, type TableContextMenuBoundaryProps, type TableDoors, type TableEntityRefProps, type TableLinkProps, type TablePeekProps, type TableRowContextRegistry, type TableSidePanelProps, type TableToolbarActionProps, type TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy, useMatrxTableRowControls };
@@ -1,10 +1,11 @@
1
1
  import * as React from 'react';
2
2
  import { ComponentType, ReactNode, MouseEventHandler } from 'react';
3
+ import { b as TableSavedViewsProps, c as MatrxDataTableRecordControls, d as MatrxDataTableDensity } from '../types-CbGNfo7r.js';
3
4
  import { CopyControlProps } from './copy-types.js';
4
5
  export { AgentPayloadInput, AiCustomSource, AiVariant, CopyExportConfig } from './copy-types.js';
5
- import { b as TableSavedViewsProps, c as MatrxDataTableDensity } from '../types-DnnvjGV4.js';
6
- import '../extensions-DCHtNwG3.js';
6
+ import '../content-transfer.js';
7
7
  import '@ai-matrx/kit/content-transfer';
8
+ import '../content-transfer/icon.js';
8
9
 
9
10
  interface TableLinkProps {
10
11
  href: string;
@@ -68,6 +69,13 @@ interface TableDoors {
68
69
  peekKind?: string;
69
70
  canPeek?: boolean;
70
71
  }
72
+ interface TableRowContextRegistry {
73
+ register(tableId: string, resolve: (rowId: string) => unknown): () => void;
74
+ }
75
+ interface TableContextMenuBoundaryProps {
76
+ label: string;
77
+ children: ReactNode;
78
+ }
71
79
  interface MatrxDataTableHost {
72
80
  JsonViewer?: ComponentType<{
73
81
  data: object | string;
@@ -80,7 +88,10 @@ interface MatrxDataTableHost {
80
88
  EntityRef?: ComponentType<TableEntityRefProps>;
81
89
  resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null;
82
90
  ResourcePeek?: ComponentType<TablePeekProps>;
83
- SavedViews?: ComponentType<TableSavedViewsProps>; /** Host default; a table's explicit density takes precedence. */
91
+ SavedViews?: ComponentType<TableSavedViewsProps>;
92
+ rowContextRegistry?: TableRowContextRegistry;
93
+ createDefaultRowContext?: (row: unknown, controls: MatrxDataTableRecordControls) => unknown;
94
+ ContextMenuBoundary?: ComponentType<TableContextMenuBoundaryProps>; /** Host default; a table's explicit density takes precedence. */
84
95
  defaultDensity?: MatrxDataTableDensity;
85
96
  notify?: {
86
97
  success(message: string): void;
@@ -92,5 +103,23 @@ declare function MatrxDataTableProvider({ value, children }: {
92
103
  children: ReactNode;
93
104
  }): React.JSX.Element;
94
105
  declare function useMatrxDataTableHost(): MatrxDataTableHost;
106
+ interface MatrxTableRowAlchemy {
107
+ copy: CopyControlProps;
108
+ controls?: MatrxDataTableRecordControls;
109
+ placement: "inline" | "menu";
110
+ ready: boolean;
111
+ activate(): void;
112
+ prepare(restoreFocus?: () => void): Promise<void>;
113
+ }
114
+ declare function MatrxTableRowAlchemyScope({ value, children }: {
115
+ value: MatrxTableRowAlchemy;
116
+ children: ReactNode;
117
+ }): React.JSX.Element;
118
+ declare function useMatrxTableRowAlchemy(): MatrxTableRowAlchemy | null;
119
+ declare function MatrxTableRowControlsScope({ value, children }: {
120
+ value: MatrxDataTableRecordControls;
121
+ children: ReactNode;
122
+ }): React.JSX.Element;
123
+ declare function useMatrxTableRowControls(): MatrxDataTableRecordControls | null;
95
124
 
96
- export { CopyControlProps, type MatrxDataTableHost, MatrxDataTableProvider, type TableDoors, type TableEntityRefProps, type TableLinkProps, type TablePeekProps, type TableSidePanelProps, type TableToolbarActionProps, type TableWindowPanelProps, useMatrxDataTableHost };
125
+ export { CopyControlProps, type MatrxDataTableHost, MatrxDataTableProvider, type MatrxTableRowAlchemy, MatrxTableRowAlchemyScope, MatrxTableRowControlsScope, type TableContextMenuBoundaryProps, type TableDoors, type TableEntityRefProps, type TableLinkProps, type TablePeekProps, type TableRowContextRegistry, type TableSidePanelProps, type TableToolbarActionProps, type TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy, useMatrxTableRowControls };
@@ -13,8 +13,30 @@ function MatrxDataTableProvider({ value, children }) {
13
13
  function useMatrxDataTableHost() {
14
14
  return useContext(HostContext);
15
15
  }
16
+ var ROW_ALCHEMY_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-alchemy-context");
17
+ var rowAlchemyRegistry = globalThis;
18
+ var RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext(null);
19
+ function MatrxTableRowAlchemyScope({ value, children }) {
20
+ return /* @__PURE__ */ jsx(RowAlchemyContext.Provider, { value, children });
21
+ }
22
+ function useMatrxTableRowAlchemy() {
23
+ return useContext(RowAlchemyContext);
24
+ }
25
+ var ROW_CONTROLS_SLOT = /* @__PURE__ */ Symbol.for("ai-matrx.design-system.table-row-controls-context");
26
+ var rowControlsRegistry = globalThis;
27
+ var RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext(null);
28
+ function MatrxTableRowControlsScope({ value, children }) {
29
+ return /* @__PURE__ */ jsx(RowControlsContext.Provider, { value, children });
30
+ }
31
+ function useMatrxTableRowControls() {
32
+ return useContext(RowControlsContext);
33
+ }
16
34
  export {
17
35
  MatrxDataTableProvider,
18
- useMatrxDataTableHost
36
+ MatrxTableRowAlchemyScope,
37
+ MatrxTableRowControlsScope,
38
+ useMatrxDataTableHost,
39
+ useMatrxTableRowAlchemy,
40
+ useMatrxTableRowControls
19
41
  };
20
42
  //# sourceMappingURL=host.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/data-table/host.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type Context, type ComponentType, type ReactNode, type MouseEventHandler } from \"react\";\nimport type { CopyControlProps } from \"./copy-types\";\nimport type { MatrxDataTableDensity, TableSavedViewsProps } from \"./types\";\n\nexport type {\n AgentPayloadInput,\n AiCustomSource,\n AiVariant,\n CopyControlProps,\n CopyExportConfig,\n} from \"./copy-types\";\n\nexport interface TableLinkProps { href: string; children: ReactNode; className?: string; onClick?: MouseEventHandler<HTMLAnchorElement>; }\n/**\n * Host-owned toolbar affordance. The table package keeps operation state and\n * labels; an application can supply its canonical icon-button primitive\n * without making the shared package depend on an application UI package.\n */\nexport interface TableToolbarActionProps { ariaLabel: string; tooltip?: string | undefined; disabled?: boolean | undefined; busy?: boolean | undefined; /** Indicates a selected mutually-exclusive action such as the current page. */ active?: boolean | undefined; onClick: () => void; children: ReactNode; }\nexport interface TableSidePanelProps { title: string; titleNode?: ReactNode; description?: ReactNode; onClose: () => void; defaultWidth?: number; headerActions?: ReactNode; children: ReactNode; }\nexport interface TableWindowPanelProps { id: string; title: string; onClose: () => void; width?: number; height?: number; minWidth?: number; minHeight?: number; actionsRight?: ReactNode; bodyClassName?: string; sidebarDefaultSize?: number; sidebarMinSize?: number; sidebar?: ReactNode; children: ReactNode; }\nexport interface TableEntityRefProps { token: string; id: string; href?: string; children: ReactNode; className?: string; }\nexport interface TablePeekProps { kind: string; id: string; href?: string; onClose: () => void; }\nexport interface TableDoors { href?: string; peekKind?: string; canPeek?: boolean; }\nexport interface MatrxDataTableHost { JsonViewer?: ComponentType<{ data: object | string }>; Link?: ComponentType<TableLinkProps>; CopyControls?: ComponentType<CopyControlProps>; ToolbarAction?: ComponentType<TableToolbarActionProps>; SidePanelSurface?: ComponentType<TableSidePanelProps>; WindowPanel?: ComponentType<TableWindowPanelProps>; EntityRef?: ComponentType<TableEntityRefProps>; resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null; ResourcePeek?: ComponentType<TablePeekProps>; SavedViews?: ComponentType<TableSavedViewsProps>; /** Host default; a table's explicit density takes precedence. */ defaultDensity?: MatrxDataTableDensity; notify?: { success(message: string): void; error(message: string): void }; }\n// Public entrypoints are independently bundled in ESM and CJS. The context\n// identity must survive those bundle boundaries; values stay provider-scoped.\nconst HOST_SLOT = Symbol.for(\"ai-matrx.design-system.table-host-context\");\nconst hostRegistry = globalThis as typeof globalThis & { [HOST_SLOT]?: Context<MatrxDataTableHost> };\nconst HostContext = hostRegistry[HOST_SLOT] ??= createContext<MatrxDataTableHost>({});\nexport function MatrxDataTableProvider({ value, children }: { value: MatrxDataTableHost; children: ReactNode }) { return <HostContext.Provider value={value}>{children}</HostContext.Provider>; }\nexport function useMatrxDataTableHost(): MatrxDataTableHost { return useContext(HostContext); }\n"],"mappings":";;;;AACA,SAAS,eAAe,kBAA4F;AA8BK;AAHzH,IAAM,YAAY,uBAAO,IAAI,2CAA2C;AACxE,IAAM,eAAe;AACrB,IAAM,cAAc,aAAa,SAAS,MAAM,cAAkC,CAAC,CAAC;AAC7E,SAAS,uBAAuB,EAAE,OAAO,SAAS,GAAuD;AAAE,SAAO,oBAAC,YAAY,UAAZ,EAAqB,OAAe,UAAS;AAAyB;AACzL,SAAS,wBAA4C;AAAE,SAAO,WAAW,WAAW;AAAG;","names":[]}
1
+ {"version":3,"sources":["../../src/data-table/host.tsx"],"sourcesContent":["\"use client\";\nimport { createContext, useContext, type Context, type ComponentType, type ReactNode, type MouseEventHandler } from \"react\";\nimport type { CopyControlProps } from \"./copy-types\";\nimport type { MatrxDataTableDensity, MatrxDataTableRecordControls, TableSavedViewsProps } from \"./types\";\n\nexport type {\n AgentPayloadInput,\n AiCustomSource,\n AiVariant,\n CopyControlProps,\n CopyExportConfig,\n} from \"./copy-types\";\n\nexport interface TableLinkProps { href: string; children: ReactNode; className?: string; onClick?: MouseEventHandler<HTMLAnchorElement>; }\n/**\n * Host-owned toolbar affordance. The table package keeps operation state and\n * labels; an application can supply its canonical icon-button primitive\n * without making the shared package depend on an application UI package.\n */\nexport interface TableToolbarActionProps { ariaLabel: string; tooltip?: string | undefined; disabled?: boolean | undefined; busy?: boolean | undefined; /** Indicates a selected mutually-exclusive action such as the current page. */ active?: boolean | undefined; onClick: () => void; children: ReactNode; }\nexport interface TableSidePanelProps { title: string; titleNode?: ReactNode; description?: ReactNode; onClose: () => void; defaultWidth?: number; headerActions?: ReactNode; children: ReactNode; }\nexport interface TableWindowPanelProps { id: string; title: string; onClose: () => void; width?: number; height?: number; minWidth?: number; minHeight?: number; actionsRight?: ReactNode; bodyClassName?: string; sidebarDefaultSize?: number; sidebarMinSize?: number; sidebar?: ReactNode; children: ReactNode; }\nexport interface TableEntityRefProps { token: string; id: string; href?: string; children: ReactNode; className?: string; }\nexport interface TablePeekProps { kind: string; id: string; href?: string; onClose: () => void; }\nexport interface TableDoors { href?: string; peekKind?: string; canPeek?: boolean; }\nexport interface TableRowContextRegistry { register(tableId: string, resolve: (rowId: string) => unknown): () => void; }\nexport interface TableContextMenuBoundaryProps { label: string; children: ReactNode; }\nexport interface MatrxDataTableHost { JsonViewer?: ComponentType<{ data: object | string }>; Link?: ComponentType<TableLinkProps>; CopyControls?: ComponentType<CopyControlProps>; ToolbarAction?: ComponentType<TableToolbarActionProps>; SidePanelSurface?: ComponentType<TableSidePanelProps>; WindowPanel?: ComponentType<TableWindowPanelProps>; EntityRef?: ComponentType<TableEntityRefProps>; resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null; ResourcePeek?: ComponentType<TablePeekProps>; SavedViews?: ComponentType<TableSavedViewsProps>; rowContextRegistry?: TableRowContextRegistry; createDefaultRowContext?: (row: unknown, controls: import(\"./types\").MatrxDataTableRecordControls) => unknown; ContextMenuBoundary?: ComponentType<TableContextMenuBoundaryProps>; /** Host default; a table's explicit density takes precedence. */ defaultDensity?: MatrxDataTableDensity; notify?: { success(message: string): void; error(message: string): void }; }\n// Public entrypoints are independently bundled in ESM and CJS. The context\n// identity must survive those bundle boundaries; values stay provider-scoped.\nconst HOST_SLOT = Symbol.for(\"ai-matrx.design-system.table-host-context\");\nconst hostRegistry = globalThis as typeof globalThis & { [HOST_SLOT]?: Context<MatrxDataTableHost> };\nconst HostContext = hostRegistry[HOST_SLOT] ??= createContext<MatrxDataTableHost>({});\nexport function MatrxDataTableProvider({ value, children }: { value: MatrxDataTableHost; children: ReactNode }) { return <HostContext.Provider value={value}>{children}</HostContext.Provider>; }\nexport function useMatrxDataTableHost(): MatrxDataTableHost { return useContext(HostContext); }\n\nexport interface MatrxTableRowAlchemy {\n copy: CopyControlProps;\n controls?: MatrxDataTableRecordControls;\n placement: \"inline\" | \"menu\";\n ready: boolean;\n activate(): void;\n prepare(restoreFocus?: () => void): Promise<void>;\n}\n\nconst ROW_ALCHEMY_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-alchemy-context\");\nconst rowAlchemyRegistry = globalThis as typeof globalThis & { [ROW_ALCHEMY_SLOT]?: Context<MatrxTableRowAlchemy | null> };\nconst RowAlchemyContext = rowAlchemyRegistry[ROW_ALCHEMY_SLOT] ??= createContext<MatrxTableRowAlchemy | null>(null);\n\nexport function MatrxTableRowAlchemyScope({ value, children }: { value: MatrxTableRowAlchemy; children: ReactNode }) { return <RowAlchemyContext.Provider value={value}>{children}</RowAlchemyContext.Provider>; }\n\nexport function useMatrxTableRowAlchemy(): MatrxTableRowAlchemy | null { return useContext(RowAlchemyContext); }\n\nconst ROW_CONTROLS_SLOT = Symbol.for(\"ai-matrx.design-system.table-row-controls-context\");\nconst rowControlsRegistry = globalThis as typeof globalThis & { [ROW_CONTROLS_SLOT]?: Context<MatrxDataTableRecordControls | null> };\nconst RowControlsContext = rowControlsRegistry[ROW_CONTROLS_SLOT] ??= createContext<MatrxDataTableRecordControls | null>(null);\nexport function MatrxTableRowControlsScope({ value, children }: { value: MatrxDataTableRecordControls; children: ReactNode }) { return <RowControlsContext.Provider value={value}>{children}</RowControlsContext.Provider>; }\nexport function useMatrxTableRowControls(): MatrxDataTableRecordControls | null { return useContext(RowControlsContext); }\n"],"mappings":";;;;AACA,SAAS,eAAe,kBAA4F;AAgCK;AAHzH,IAAM,YAAY,uBAAO,IAAI,2CAA2C;AACxE,IAAM,eAAe;AACrB,IAAM,cAAc,aAAa,SAAS,MAAM,cAAkC,CAAC,CAAC;AAC7E,SAAS,uBAAuB,EAAE,OAAO,SAAS,GAAuD;AAAE,SAAO,oBAAC,YAAY,UAAZ,EAAqB,OAAe,UAAS;AAAyB;AACzL,SAAS,wBAA4C;AAAE,SAAO,WAAW,WAAW;AAAG;AAW9F,IAAM,mBAAmB,uBAAO,IAAI,kDAAkD;AACtF,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB,mBAAmB,gBAAgB,MAAM,cAA2C,IAAI;AAE3G,SAAS,0BAA0B,EAAE,OAAO,SAAS,GAAyD;AAAE,SAAO,oBAAC,kBAAkB,UAAlB,EAA2B,OAAe,UAAS;AAA+B;AAE1M,SAAS,0BAAuD;AAAE,SAAO,WAAW,iBAAiB;AAAG;AAE/G,IAAM,oBAAoB,uBAAO,IAAI,mDAAmD;AACxF,IAAM,sBAAsB;AAC5B,IAAM,qBAAqB,oBAAoB,iBAAiB,MAAM,cAAmD,IAAI;AACtH,SAAS,2BAA2B,EAAE,OAAO,SAAS,GAAiE;AAAE,SAAO,oBAAC,mBAAmB,UAAnB,EAA4B,OAAe,UAAS;AAAgC;AACrN,SAAS,2BAAgE;AAAE,SAAO,WAAW,kBAAkB;AAAG;","names":[]}