@ai-matrx/design-system 0.21.3 → 0.21.5

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 (57) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/data-table/copy-helpers.d.cts +1 -1
  3. package/dist/data-table/copy-helpers.d.ts +1 -1
  4. package/dist/data-table/data-row-inspector.cjs +3 -0
  5. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  6. package/dist/data-table/data-row-inspector.js +3 -0
  7. package/dist/data-table/data-row-inspector.js.map +1 -1
  8. package/dist/data-table/data-row-window.cjs +3 -0
  9. package/dist/data-table/data-row-window.cjs.map +1 -1
  10. package/dist/data-table/data-row-window.js +3 -0
  11. package/dist/data-table/data-row-window.js.map +1 -1
  12. package/dist/data-table/filter-engine.d.cts +1 -1
  13. package/dist/data-table/filter-engine.d.ts +1 -1
  14. package/dist/data-table/host.cjs +12 -1
  15. package/dist/data-table/host.cjs.map +1 -1
  16. package/dist/data-table/host.d.cts +19 -3
  17. package/dist/data-table/host.d.ts +19 -3
  18. package/dist/data-table/host.js +12 -1
  19. package/dist/data-table/host.js.map +1 -1
  20. package/dist/data-table/index.cjs +173 -56
  21. package/dist/data-table/index.cjs.map +1 -1
  22. package/dist/data-table/index.d.cts +12 -4
  23. package/dist/data-table/index.d.ts +12 -4
  24. package/dist/data-table/index.js +202 -85
  25. package/dist/data-table/index.js.map +1 -1
  26. package/dist/data-table/infer-filter.cjs +16 -0
  27. package/dist/data-table/infer-filter.cjs.map +1 -1
  28. package/dist/data-table/infer-filter.d.cts +1 -1
  29. package/dist/data-table/infer-filter.d.ts +1 -1
  30. package/dist/data-table/infer-filter.js +16 -0
  31. package/dist/data-table/infer-filter.js.map +1 -1
  32. package/dist/data-table/layered-filters.d.cts +1 -1
  33. package/dist/data-table/layered-filters.d.ts +1 -1
  34. package/dist/data-table/pagination.cjs +3 -0
  35. package/dist/data-table/pagination.cjs.map +1 -1
  36. package/dist/data-table/pagination.js +3 -0
  37. package/dist/data-table/pagination.js.map +1 -1
  38. package/dist/data-table/query-control.cjs +19 -0
  39. package/dist/data-table/query-control.cjs.map +1 -1
  40. package/dist/data-table/query-control.d.cts +1 -1
  41. package/dist/data-table/query-control.d.ts +1 -1
  42. package/dist/data-table/query-control.js +19 -0
  43. package/dist/data-table/query-control.js.map +1 -1
  44. package/dist/data-table/types.cjs.map +1 -1
  45. package/dist/data-table/types.d.cts +1 -1
  46. package/dist/data-table/types.d.ts +1 -1
  47. package/dist/data-table/url-state.d.cts +1 -1
  48. package/dist/data-table/url-state.d.ts +1 -1
  49. package/dist/data-table/uuid-cell.cjs +3 -0
  50. package/dist/data-table/uuid-cell.cjs.map +1 -1
  51. package/dist/data-table/uuid-cell.js +3 -0
  52. package/dist/data-table/uuid-cell.js.map +1 -1
  53. package/dist/data-table/xlsx.d.cts +1 -1
  54. package/dist/data-table/xlsx.d.ts +1 -1
  55. package/dist/{types-JFlsIv-0.d.ts → types-Dpl8OW_m.d.ts} +26 -1
  56. package/dist/{types-BarjBFyG.d.cts → types-DsmrqJHN.d.cts} +26 -1
  57. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-BarjBFyG.cjs';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-DsmrqJHN.cjs';
2
2
  import '../content-transfer.cjs';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -1,4 +1,4 @@
1
- import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-JFlsIv-0.js';
1
+ import { M as MatrxColumnDef, C as ColumnFiltersState, S as SortState, L as LayeredFilterRule, T as TableSearchMatchMode, a as ColumnFilterValue } from '../types-Dpl8OW_m.js';
2
2
  import '../content-transfer.js';
3
3
  import 'react';
4
4
  import '@ai-matrx/kit/content-transfer';
@@ -24,8 +24,10 @@ var host_exports = {};
24
24
  __export(host_exports, {
25
25
  MatrxDataTableProvider: () => MatrxDataTableProvider,
26
26
  MatrxTableRowAlchemyScope: () => MatrxTableRowAlchemyScope,
27
+ MatrxTableRowControlsScope: () => MatrxTableRowControlsScope,
27
28
  useMatrxDataTableHost: () => useMatrxDataTableHost,
28
- useMatrxTableRowAlchemy: () => useMatrxTableRowAlchemy
29
+ useMatrxTableRowAlchemy: () => useMatrxTableRowAlchemy,
30
+ useMatrxTableRowControls: () => useMatrxTableRowControls
29
31
  });
30
32
  module.exports = __toCommonJS(host_exports);
31
33
  var import_react = require("react");
@@ -48,4 +50,13 @@ function MatrxTableRowAlchemyScope({ value, children }) {
48
50
  function useMatrxTableRowAlchemy() {
49
51
  return (0, import_react.useContext)(RowAlchemyContext);
50
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
+ }
51
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\nexport interface MatrxTableRowAlchemy {\n copy: CopyControlProps;\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;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;AAU9F,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;","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,8 +1,8 @@
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-DsmrqJHN.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-BarjBFyG.cjs';
6
6
  import '../content-transfer.cjs';
7
7
  import '@ai-matrx/kit/content-transfer';
8
8
  import '../content-transfer/icon.cjs';
@@ -69,6 +69,13 @@ interface TableDoors {
69
69
  peekKind?: string;
70
70
  canPeek?: boolean;
71
71
  }
72
+ interface TableRowContextRegistry {
73
+ register(tableId: string, resolve: (rowId: string) => unknown): () => void;
74
+ }
75
+ interface TableContextMenuBoundaryProps {
76
+ label: string;
77
+ children: ReactNode;
78
+ }
72
79
  interface MatrxDataTableHost {
73
80
  JsonViewer?: ComponentType<{
74
81
  data: object | string;
@@ -81,7 +88,10 @@ interface MatrxDataTableHost {
81
88
  EntityRef?: ComponentType<TableEntityRefProps>;
82
89
  resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null;
83
90
  ResourcePeek?: ComponentType<TablePeekProps>;
84
- 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. */
85
95
  defaultDensity?: MatrxDataTableDensity;
86
96
  notify?: {
87
97
  success(message: string): void;
@@ -95,6 +105,7 @@ declare function MatrxDataTableProvider({ value, children }: {
95
105
  declare function useMatrxDataTableHost(): MatrxDataTableHost;
96
106
  interface MatrxTableRowAlchemy {
97
107
  copy: CopyControlProps;
108
+ controls?: MatrxDataTableRecordControls;
98
109
  placement: "inline" | "menu";
99
110
  ready: boolean;
100
111
  activate(): void;
@@ -105,5 +116,10 @@ declare function MatrxTableRowAlchemyScope({ value, children }: {
105
116
  children: ReactNode;
106
117
  }): React.JSX.Element;
107
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;
108
124
 
109
- export { CopyControlProps, type MatrxDataTableHost, MatrxDataTableProvider, type MatrxTableRowAlchemy, MatrxTableRowAlchemyScope, type TableDoors, type TableEntityRefProps, type TableLinkProps, type TablePeekProps, type TableSidePanelProps, type TableToolbarActionProps, type TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy };
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,8 +1,8 @@
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-Dpl8OW_m.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-JFlsIv-0.js';
6
6
  import '../content-transfer.js';
7
7
  import '@ai-matrx/kit/content-transfer';
8
8
  import '../content-transfer/icon.js';
@@ -69,6 +69,13 @@ interface TableDoors {
69
69
  peekKind?: string;
70
70
  canPeek?: boolean;
71
71
  }
72
+ interface TableRowContextRegistry {
73
+ register(tableId: string, resolve: (rowId: string) => unknown): () => void;
74
+ }
75
+ interface TableContextMenuBoundaryProps {
76
+ label: string;
77
+ children: ReactNode;
78
+ }
72
79
  interface MatrxDataTableHost {
73
80
  JsonViewer?: ComponentType<{
74
81
  data: object | string;
@@ -81,7 +88,10 @@ interface MatrxDataTableHost {
81
88
  EntityRef?: ComponentType<TableEntityRefProps>;
82
89
  resolveEntityDoors?: (token: string, id: string, href?: string | null) => TableDoors | null;
83
90
  ResourcePeek?: ComponentType<TablePeekProps>;
84
- 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. */
85
95
  defaultDensity?: MatrxDataTableDensity;
86
96
  notify?: {
87
97
  success(message: string): void;
@@ -95,6 +105,7 @@ declare function MatrxDataTableProvider({ value, children }: {
95
105
  declare function useMatrxDataTableHost(): MatrxDataTableHost;
96
106
  interface MatrxTableRowAlchemy {
97
107
  copy: CopyControlProps;
108
+ controls?: MatrxDataTableRecordControls;
98
109
  placement: "inline" | "menu";
99
110
  ready: boolean;
100
111
  activate(): void;
@@ -105,5 +116,10 @@ declare function MatrxTableRowAlchemyScope({ value, children }: {
105
116
  children: ReactNode;
106
117
  }): React.JSX.Element;
107
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;
108
124
 
109
- export { CopyControlProps, type MatrxDataTableHost, MatrxDataTableProvider, type MatrxTableRowAlchemy, MatrxTableRowAlchemyScope, type TableDoors, type TableEntityRefProps, type TableLinkProps, type TablePeekProps, type TableSidePanelProps, type TableToolbarActionProps, type TableWindowPanelProps, useMatrxDataTableHost, useMatrxTableRowAlchemy };
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 };
@@ -22,10 +22,21 @@ function MatrxTableRowAlchemyScope({ value, children }) {
22
22
  function useMatrxTableRowAlchemy() {
23
23
  return useContext(RowAlchemyContext);
24
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
+ }
25
34
  export {
26
35
  MatrxDataTableProvider,
27
36
  MatrxTableRowAlchemyScope,
37
+ MatrxTableRowControlsScope,
28
38
  useMatrxDataTableHost,
29
- useMatrxTableRowAlchemy
39
+ useMatrxTableRowAlchemy,
40
+ useMatrxTableRowControls
30
41
  };
31
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\nexport interface MatrxTableRowAlchemy {\n copy: CopyControlProps;\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"],"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;AAU9F,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;","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":[]}