@ai-matrx/design-system 0.18.4 → 0.18.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 (56) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/content-transfer.cjs +12 -5
  3. package/dist/content-transfer.cjs.map +1 -1
  4. package/dist/content-transfer.d.cts +4 -0
  5. package/dist/content-transfer.d.ts +4 -0
  6. package/dist/content-transfer.js +12 -5
  7. package/dist/content-transfer.js.map +1 -1
  8. package/dist/data-table/copy-helpers.cjs +53 -0
  9. package/dist/data-table/copy-helpers.cjs.map +1 -1
  10. package/dist/data-table/copy-helpers.d.cts +13 -2
  11. package/dist/data-table/copy-helpers.d.ts +13 -2
  12. package/dist/data-table/copy-helpers.js +55 -0
  13. package/dist/data-table/copy-helpers.js.map +1 -1
  14. package/dist/data-table/copy-types.cjs.map +1 -1
  15. package/dist/data-table/copy-types.d.cts +4 -0
  16. package/dist/data-table/copy-types.d.ts +4 -0
  17. package/dist/data-table/data-row-inspector.cjs +70 -50
  18. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  19. package/dist/data-table/data-row-inspector.js +70 -50
  20. package/dist/data-table/data-row-inspector.js.map +1 -1
  21. package/dist/data-table/data-row-window.cjs +70 -50
  22. package/dist/data-table/data-row-window.cjs.map +1 -1
  23. package/dist/data-table/data-row-window.js +70 -50
  24. package/dist/data-table/data-row-window.js.map +1 -1
  25. package/dist/data-table/filter-engine.d.cts +1 -1
  26. package/dist/data-table/filter-engine.d.ts +1 -1
  27. package/dist/data-table/index.cjs +621 -422
  28. package/dist/data-table/index.cjs.map +1 -1
  29. package/dist/data-table/index.d.cts +2 -2
  30. package/dist/data-table/index.d.ts +2 -2
  31. package/dist/data-table/index.js +623 -422
  32. package/dist/data-table/index.js.map +1 -1
  33. package/dist/data-table/infer-filter.d.cts +1 -1
  34. package/dist/data-table/infer-filter.d.ts +1 -1
  35. package/dist/data-table/layered-filters.d.cts +1 -1
  36. package/dist/data-table/layered-filters.d.ts +1 -1
  37. package/dist/data-table/pagination.cjs +148 -90
  38. package/dist/data-table/pagination.cjs.map +1 -1
  39. package/dist/data-table/pagination.js +143 -85
  40. package/dist/data-table/pagination.js.map +1 -1
  41. package/dist/data-table/query-control.d.cts +1 -1
  42. package/dist/data-table/query-control.d.ts +1 -1
  43. package/dist/data-table/types.cjs.map +1 -1
  44. package/dist/data-table/types.d.cts +1 -1
  45. package/dist/data-table/types.d.ts +1 -1
  46. package/dist/data-table/url-state.d.cts +1 -1
  47. package/dist/data-table/url-state.d.ts +1 -1
  48. package/dist/data-table/uuid-cell.cjs +58 -45
  49. package/dist/data-table/uuid-cell.cjs.map +1 -1
  50. package/dist/data-table/uuid-cell.js +58 -45
  51. package/dist/data-table/uuid-cell.js.map +1 -1
  52. package/dist/data-table/xlsx.d.cts +1 -1
  53. package/dist/data-table/xlsx.d.ts +1 -1
  54. package/dist/{types-Bx9SfdJM.d.cts → types-0CNCWvdK.d.cts} +2 -2
  55. package/dist/{types-DyByb6tW.d.ts → types-cH8oLqUx.d.ts} +2 -2
  56. package/package.json +1 -1
@@ -415,6 +415,7 @@ import {
415
415
  isValidElement,
416
416
  useCallback as useCallback4,
417
417
  useEffect as useEffect10,
418
+ useId as useId2,
418
419
  useLayoutEffect,
419
420
  useMemo as useMemo5,
420
421
  useRef as useRef6,
@@ -2009,6 +2010,36 @@ function useTableNotice() {
2009
2010
 
2010
2011
  // src/data-table/pagination.tsx
2011
2012
  import { Fragment, jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
2013
+ function PageNavigationControl({
2014
+ label,
2015
+ disabledHint,
2016
+ visibilityClassName = "inline-flex",
2017
+ disabled,
2018
+ className,
2019
+ ...props
2020
+ }) {
2021
+ const button = /* @__PURE__ */ jsx19(
2022
+ Button,
2023
+ {
2024
+ ...props,
2025
+ disabled,
2026
+ "aria-label": label,
2027
+ className: cn(visibilityClassName, className)
2028
+ }
2029
+ );
2030
+ return /* @__PURE__ */ jsxs12(Tooltip, { children: [
2031
+ /* @__PURE__ */ jsx19(TooltipTrigger, { asChild: true, children: disabled ? /* @__PURE__ */ jsx19(
2032
+ "span",
2033
+ {
2034
+ className: cn(visibilityClassName, "rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring"),
2035
+ tabIndex: 0,
2036
+ "aria-label": `${label} \u2014 ${disabledHint.toLowerCase()}`,
2037
+ children: button
2038
+ }
2039
+ ) : button }),
2040
+ /* @__PURE__ */ jsx19(TooltipContent, { children: disabled ? disabledHint : label })
2041
+ ] });
2042
+ }
2012
2043
  function GenericTablePagination({
2013
2044
  totalItems,
2014
2045
  itemsPerPage,
@@ -2067,7 +2098,7 @@ function GenericTablePagination({
2067
2098
  className,
2068
2099
  containerClassName
2069
2100
  );
2070
- return /* @__PURE__ */ jsxs12("div", { "data-matrx-table-footer": true, className: containerClass, children: [
2101
+ return /* @__PURE__ */ jsx19(TooltipProvider, { children: /* @__PURE__ */ jsxs12("div", { "data-matrx-table-footer": true, className: containerClass, children: [
2071
2102
  showItemsPerPageSelect && /* @__PURE__ */ jsx19(
2072
2103
  "div",
2073
2104
  {
@@ -2134,16 +2165,16 @@ function GenericTablePagination({
2134
2165
  ),
2135
2166
  children: [
2136
2167
  /* @__PURE__ */ jsx19(
2137
- Button,
2168
+ PageNavigationControl,
2138
2169
  {
2139
2170
  variant: "outline",
2140
2171
  size: buttonSize,
2141
- "aria-label": "First page",
2142
- title: "First page",
2172
+ visibilityClassName: "hidden sm:inline-flex",
2173
+ label: "First page",
2174
+ disabledHint: "Already on the first page",
2143
2175
  onClick: () => onPageChange(1),
2144
2176
  disabled: isFirstPageDisabled,
2145
2177
  className: cn(
2146
- "hidden sm:inline-flex",
2147
2178
  compact ? compactButtonClass : "h-8 w-8 p-0",
2148
2179
  navButtonClassName
2149
2180
  ),
@@ -2151,12 +2182,12 @@ function GenericTablePagination({
2151
2182
  }
2152
2183
  ),
2153
2184
  /* @__PURE__ */ jsx19(
2154
- Button,
2185
+ PageNavigationControl,
2155
2186
  {
2156
2187
  variant: "outline",
2157
2188
  size: buttonSize,
2158
- "aria-label": "Previous page",
2159
- title: "Previous page",
2189
+ label: "Previous page",
2190
+ disabledHint: "Already on the first page",
2160
2191
  onClick: () => onPageChange(currentPage - 1),
2161
2192
  disabled: isFirstPageDisabled,
2162
2193
  className: cn(
@@ -2204,12 +2235,12 @@ function GenericTablePagination({
2204
2235
  `desktop-${page}`
2205
2236
  )),
2206
2237
  /* @__PURE__ */ jsx19(
2207
- Button,
2238
+ PageNavigationControl,
2208
2239
  {
2209
2240
  variant: "outline",
2210
2241
  size: buttonSize,
2211
- "aria-label": "Next page",
2212
- title: "Next page",
2242
+ label: "Next page",
2243
+ disabledHint: "Already on the last page",
2213
2244
  onClick: () => onPageChange(currentPage + 1),
2214
2245
  disabled: isLastPageDisabled,
2215
2246
  className: cn(
@@ -2220,16 +2251,16 @@ function GenericTablePagination({
2220
2251
  }
2221
2252
  ),
2222
2253
  /* @__PURE__ */ jsx19(
2223
- Button,
2254
+ PageNavigationControl,
2224
2255
  {
2225
2256
  variant: "outline",
2226
2257
  size: buttonSize,
2227
- "aria-label": "Last page",
2228
- title: "Last page",
2258
+ visibilityClassName: "hidden sm:inline-flex",
2259
+ label: "Last page",
2260
+ disabledHint: "Already on the last page",
2229
2261
  onClick: () => onPageChange(totalPages),
2230
2262
  disabled: isLastPageDisabled,
2231
2263
  className: cn(
2232
- "hidden sm:inline-flex",
2233
2264
  compact ? compactButtonClass : "h-8 w-8 p-0",
2234
2265
  navButtonClassName
2235
2266
  ),
@@ -2239,7 +2270,7 @@ function GenericTablePagination({
2239
2270
  ]
2240
2271
  }
2241
2272
  )
2242
- ] });
2273
+ ] }) });
2243
2274
  }
2244
2275
 
2245
2276
  // src/content-transfer/matrx-copy.tsx
@@ -3378,14 +3409,21 @@ function MatrxCopyMenuSession(props) {
3378
3409
  ))
3379
3410
  throw new Error("Sheet rows must be JSON objects.");
3380
3411
  const rows = value;
3381
- const keys = [...new Set(rows.flatMap((row) => Object.keys(row)))];
3412
+ const suppliedColumns = props.export.sheetColumns?.();
3413
+ const columns = suppliedColumns ?? [...new Set(rows.flatMap((row) => Object.keys(row)))].map((id) => ({ id, label: id }));
3414
+ const ids = /* @__PURE__ */ new Set();
3415
+ for (const column of columns) {
3416
+ if (!column.id || !column.label || ids.has(column.id)) throw new Error("Sheet columns require unique nonempty ids and labels.");
3417
+ ids.add(column.id);
3418
+ }
3419
+ for (const row of rows) for (const key of Object.keys(row)) if (!ids.has(key)) throw new Error(`Sheet row key "${key}" is not declared in sheetColumns.`);
3382
3420
  return {
3383
3421
  kind: "rows",
3384
3422
  rows,
3385
- columns: keys.map((key) => ({
3386
- id: key,
3387
- label: key,
3388
- path: `/${key.replace(/~/g, "~0").replace(/\//g, "~1")}`,
3423
+ columns: columns.map((column) => ({
3424
+ id: column.id,
3425
+ label: column.label,
3426
+ path: `/${column.id.replace(/~/g, "~0").replace(/\//g, "~1")}`,
3389
3427
  visible: true
3390
3428
  }))
3391
3429
  };
@@ -3858,6 +3896,55 @@ init_filter_engine();
3858
3896
 
3859
3897
  // src/data-table/tableCopy.ts
3860
3898
  init_filter_engine();
3899
+ import { normalizeTransferJson as normalizeTransferJson2 } from "@ai-matrx/kit/content-transfer";
3900
+ function projectDefaultTableCopyRow(row, columns) {
3901
+ const record = /* @__PURE__ */ Object.create(null);
3902
+ for (const column of columns) {
3903
+ const value = getCellValue(row, column);
3904
+ if (value !== void 0) record[columnId(column)] = value;
3905
+ }
3906
+ return normalizeTransferJson2(record, { omitUndefinedObjectProperties: true });
3907
+ }
3908
+ function buildDefaultTableViewAgentInput(config, rows, all, columns, meta) {
3909
+ const projected = rows.map((row) => projectDefaultTableCopyRow(row, columns));
3910
+ return {
3911
+ kind: config.listKind,
3912
+ location: config.location,
3913
+ description: meta?.scope === "selected" ? `${projected.length} selected ${projected.length === 1 ? config.label : config.listLabel ?? `${config.label} rows`}.` : config.listDescription ?? `${config.listLabel ?? config.label} \u2014 current filtered/sorted view.`,
3914
+ data: projected,
3915
+ summary: projected.map((record) => formatDefaultTableCopyRecord(record, columns)).join("\n---\n"),
3916
+ attributes: {
3917
+ visible_count: projected.length,
3918
+ total_count: all.length,
3919
+ search: meta?.search || void 0,
3920
+ search_match: meta?.search ? meta.searchMatchMode : void 0,
3921
+ any_of: meta?.anyOf || void 0,
3922
+ active_filters: meta?.filterCount ?? 0,
3923
+ sort: meta?.sort || void 0,
3924
+ scope: meta?.scope ?? "view",
3925
+ ...config.listAttributes?.(rows, all)
3926
+ },
3927
+ ...config.listContext ? { context: config.listContext(rows, all) } : {}
3928
+ };
3929
+ }
3930
+ function buildDefaultTableRowAgentInput(config, row, columns) {
3931
+ const projected = projectDefaultTableCopyRow(row, columns);
3932
+ return {
3933
+ kind: config.rowKind,
3934
+ location: config.location,
3935
+ description: config.rowDescription ?? `One ${config.label} row.`,
3936
+ data: projected,
3937
+ summary: formatDefaultTableCopyRecord(projected, columns),
3938
+ ...config.rowAttributes ? { attributes: config.rowAttributes(row) } : {}
3939
+ };
3940
+ }
3941
+ function formatDefaultTableCopyRecord(record, columns) {
3942
+ return columns.map((column) => {
3943
+ const id = columnId(column);
3944
+ const label = column.label ?? (typeof column.header === "string" ? column.header : id);
3945
+ return `${label}: ${stringifyCellValue(record[id])}`;
3946
+ }).join("\n");
3947
+ }
3861
3948
  function rowsToMarkdownTable(rows, columns) {
3862
3949
  const cols = columns.filter((c) => c.filter !== false || c.accessorKey);
3863
3950
  if (cols.length === 0) return "";
@@ -4219,6 +4306,7 @@ import {
4219
4306
 
4220
4307
  // src/data-table/ColumnHeaderCell.tsx
4221
4308
  import {
4309
+ forwardRef as forwardRef12,
4222
4310
  useEffect as useEffect6,
4223
4311
  useMemo as useMemo3,
4224
4312
  useState as useState9
@@ -4411,6 +4499,18 @@ CommandShortcut.displayName = "CommandShortcut";
4411
4499
  // src/data-table/ColumnHeaderCell.tsx
4412
4500
  init_filter_engine();
4413
4501
  import { Fragment as Fragment4, jsx as jsx27, jsxs as jsxs18 } from "react/jsx-runtime";
4502
+ var HeaderButton = forwardRef12(({ dragDescription, "aria-describedby": tooltipDescription, ...props }, ref) => {
4503
+ const descriptions = [tooltipDescription, dragDescription].filter((value) => Boolean(value)).join(" ");
4504
+ return /* @__PURE__ */ jsx27(
4505
+ "button",
4506
+ {
4507
+ ref,
4508
+ ...props,
4509
+ ...descriptions ? { "aria-describedby": descriptions } : {}
4510
+ }
4511
+ );
4512
+ });
4513
+ HeaderButton.displayName = "HeaderButton";
4414
4514
  function ColumnHeaderCell({
4415
4515
  label,
4416
4516
  labelText,
@@ -4448,11 +4548,12 @@ function ColumnHeaderCell({
4448
4548
  }
4449
4549
  );
4450
4550
  const reorderLabel = reorderColumn?.label ?? labelText ?? "column";
4551
+ const { "aria-describedby": dragDescription, ...reorderAttributesWithoutDescription } = reorderAttributes;
4451
4552
  const reorderActivator = reorderEnabled ? {
4452
- ...reorderAttributes,
4553
+ ...reorderAttributesWithoutDescription,
4453
4554
  ...reorderListeners,
4454
4555
  ref: setNodeRef,
4455
- title: `Drag to reorder ${reorderLabel}.`,
4556
+ dragDescription,
4456
4557
  "aria-description": "Drag this column label to reorder it."
4457
4558
  } : void 0;
4458
4559
  const reorderClass = reorderEnabled ? "touch-none cursor-grab active:cursor-grabbing" : void 0;
@@ -4602,18 +4703,25 @@ function ColumnHeaderCell({
4602
4703
  if (!reorderEnabled) {
4603
4704
  return /* @__PURE__ */ jsx27("div", { className: cn("flex items-center justify-center", className), children: label });
4604
4705
  }
4605
- return /* @__PURE__ */ jsx27("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsx27(
4606
- "button",
4607
- {
4608
- type: "button",
4609
- ...reorderActivator,
4610
- className: cn(
4611
- "inline-flex items-center justify-center rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",
4612
- reorderClass
4613
- ),
4614
- children: label
4615
- }
4616
- ) });
4706
+ return /* @__PURE__ */ jsx27("div", { className: cn("flex items-center justify-center", className), children: /* @__PURE__ */ jsxs18(Tooltip, { children: [
4707
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
4708
+ HeaderButton,
4709
+ {
4710
+ type: "button",
4711
+ ...reorderActivator,
4712
+ className: cn(
4713
+ "inline-flex items-center justify-center rounded p-0.5 text-muted-foreground transition-colors hover:text-foreground",
4714
+ reorderClass
4715
+ ),
4716
+ children: label
4717
+ }
4718
+ ) }),
4719
+ /* @__PURE__ */ jsxs18(TooltipContent, { children: [
4720
+ "Drag to reorder ",
4721
+ reorderLabel,
4722
+ "."
4723
+ ] })
4724
+ ] }) });
4617
4725
  }
4618
4726
  return /* @__PURE__ */ jsx27(
4619
4727
  "div",
@@ -4624,34 +4732,36 @@ function ColumnHeaderCell({
4624
4732
  className
4625
4733
  ),
4626
4734
  children: /* @__PURE__ */ jsxs18(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
4627
- /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
4628
- "button",
4629
- {
4630
- type: "button",
4631
- "aria-label": menuLabel,
4632
- title: menuLabel,
4633
- onClick: (event) => {
4634
- event.stopPropagation();
4635
- },
4636
- ...reorderActivator,
4637
- className: cn(
4638
- "relative inline-flex items-center justify-center rounded p-0.5 transition-colors",
4639
- reorderClass,
4640
- isSorted || filterActive ? "text-foreground" : "text-muted-foreground hover:text-foreground"
4641
- ),
4642
- children: [
4643
- label,
4644
- isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx27(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ jsx27(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
4645
- filterActive ? /* @__PURE__ */ jsx27(
4646
- "span",
4647
- {
4648
- "aria-hidden": true,
4649
- className: "absolute -bottom-0.5 right-0 h-1.5 w-1.5 rounded-full bg-primary"
4650
- }
4651
- ) : null
4652
- ]
4653
- }
4654
- ) }),
4735
+ /* @__PURE__ */ jsxs18(Tooltip, { children: [
4736
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
4737
+ HeaderButton,
4738
+ {
4739
+ type: "button",
4740
+ "aria-label": menuLabel,
4741
+ onClick: (event) => {
4742
+ event.stopPropagation();
4743
+ },
4744
+ ...reorderActivator,
4745
+ className: cn(
4746
+ "relative inline-flex items-center justify-center rounded p-0.5 transition-colors",
4747
+ reorderClass,
4748
+ isSorted || filterActive ? "text-foreground" : "text-muted-foreground hover:text-foreground"
4749
+ ),
4750
+ children: [
4751
+ label,
4752
+ isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx27(ArrowUp, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : /* @__PURE__ */ jsx27(ArrowDown, { className: "absolute -top-1 right-0 h-2 w-2 text-primary" }) : null,
4753
+ filterActive ? /* @__PURE__ */ jsx27(
4754
+ "span",
4755
+ {
4756
+ "aria-hidden": true,
4757
+ className: "absolute -bottom-0.5 right-0 h-1.5 w-1.5 rounded-full bg-primary"
4758
+ }
4759
+ ) : null
4760
+ ]
4761
+ }
4762
+ ) }) }),
4763
+ /* @__PURE__ */ jsx27(TooltipContent, { children: menuLabel })
4764
+ ] }),
4655
4765
  menuContent
4656
4766
  ] })
4657
4767
  }
@@ -4667,71 +4777,85 @@ function ColumnHeaderCell({
4667
4777
  className
4668
4778
  ),
4669
4779
  children: [
4670
- sortable ? /* @__PURE__ */ jsxs18(
4671
- "button",
4672
- {
4673
- type: "button",
4674
- onClick: onHeaderSortClick,
4675
- ...reorderActivator,
4676
- className: cn(
4677
- "inline-flex min-w-0 items-center gap-1 rounded px-0.5 py-0.5 text-left text-xs font-semibold uppercase tracking-wide transition-colors",
4678
- reorderClass,
4679
- isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
4680
- ),
4681
- children: [
4682
- /* @__PURE__ */ jsx27("span", { className: "truncate", children: label }),
4683
- isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx27(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx27(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx27(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
4684
- ]
4685
- }
4686
- ) : reorderEnabled ? /* @__PURE__ */ jsx27(
4687
- "button",
4688
- {
4689
- type: "button",
4690
- ...reorderActivator,
4691
- className: cn(
4692
- "min-w-0 truncate rounded px-0.5 py-0.5 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",
4693
- reorderClass
4694
- ),
4695
- children: label
4696
- }
4697
- ) : /* @__PURE__ */ jsx27("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
4780
+ sortable ? /* @__PURE__ */ jsxs18(Tooltip, { children: [
4781
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs18(
4782
+ HeaderButton,
4783
+ {
4784
+ type: "button",
4785
+ onClick: onHeaderSortClick,
4786
+ ...reorderActivator,
4787
+ className: cn(
4788
+ "inline-flex min-w-0 items-center gap-1 rounded px-0.5 py-0.5 text-left text-xs font-semibold uppercase tracking-wide transition-colors",
4789
+ reorderClass,
4790
+ isSorted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
4791
+ ),
4792
+ children: [
4793
+ /* @__PURE__ */ jsx27("span", { className: "truncate", children: label }),
4794
+ isSorted ? sortDirection === "asc" ? /* @__PURE__ */ jsx27(ArrowUp, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx27(ArrowDown, { className: "h-3 w-3 shrink-0 text-primary" }) : /* @__PURE__ */ jsx27(ArrowUpDown, { className: "h-3 w-3 shrink-0 opacity-40" })
4795
+ ]
4796
+ }
4797
+ ) }),
4798
+ /* @__PURE__ */ jsx27(TooltipContent, { children: reorderEnabled ? `Drag to reorder ${reorderLabel}.` : labelText ?? "Sort column" })
4799
+ ] }) : reorderEnabled ? /* @__PURE__ */ jsxs18(Tooltip, { children: [
4800
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
4801
+ HeaderButton,
4802
+ {
4803
+ type: "button",
4804
+ ...reorderActivator,
4805
+ className: cn(
4806
+ "min-w-0 truncate rounded px-0.5 py-0.5 text-left text-xs font-semibold uppercase tracking-wide text-muted-foreground hover:text-foreground",
4807
+ reorderClass
4808
+ ),
4809
+ children: label
4810
+ }
4811
+ ) }),
4812
+ /* @__PURE__ */ jsxs18(TooltipContent, { children: [
4813
+ "Drag to reorder ",
4814
+ reorderLabel,
4815
+ "."
4816
+ ] })
4817
+ ] }) : /* @__PURE__ */ jsx27("span", { className: "truncate text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: label }),
4698
4818
  filterKind ? /* @__PURE__ */ jsxs18("div", { className: "inline-flex items-center", children: [
4699
4819
  /* @__PURE__ */ jsxs18(Popover, { open: filterOpen, onOpenChange: setFilterOpen, children: [
4700
- /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
4820
+ /* @__PURE__ */ jsxs18(Tooltip, { children: [
4821
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
4822
+ "button",
4823
+ {
4824
+ type: "button",
4825
+ "aria-label": menuLabel,
4826
+ onClick: (e) => e.stopPropagation(),
4827
+ className: cn(
4828
+ "rounded p-0.5 transition-colors",
4829
+ filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
4830
+ ),
4831
+ children: /* @__PURE__ */ jsx27(
4832
+ ListFilter,
4833
+ {
4834
+ className: cn("h-3 w-3", filterActive && "fill-primary/20")
4835
+ }
4836
+ )
4837
+ }
4838
+ ) }) }),
4839
+ /* @__PURE__ */ jsx27(TooltipContent, { children: menuLabel })
4840
+ ] }),
4841
+ menuContent
4842
+ ] }),
4843
+ filterActive ? /* @__PURE__ */ jsxs18(Tooltip, { children: [
4844
+ /* @__PURE__ */ jsx27(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx27(
4701
4845
  "button",
4702
4846
  {
4703
4847
  type: "button",
4704
- "aria-label": menuLabel,
4705
- title: "Sort or filter column",
4706
- onClick: (e) => e.stopPropagation(),
4707
- className: cn(
4708
- "rounded p-0.5 transition-colors",
4709
- filterActive ? "text-primary hover:text-primary/80" : "text-muted-foreground/40 hover:text-muted-foreground"
4710
- ),
4711
- children: /* @__PURE__ */ jsx27(
4712
- ListFilter,
4713
- {
4714
- className: cn("h-3 w-3", filterActive && "fill-primary/20")
4715
- }
4716
- )
4848
+ "aria-label": labelText ? `Clear ${labelText} filter` : "Clear this filter",
4849
+ onClick: (e) => {
4850
+ e.stopPropagation();
4851
+ onFilterChange(void 0);
4852
+ },
4853
+ className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
4854
+ children: /* @__PURE__ */ jsx27(X, { className: "h-3 w-3" })
4717
4855
  }
4718
4856
  ) }),
4719
- menuContent
4720
- ] }),
4721
- filterActive ? /* @__PURE__ */ jsx27(
4722
- "button",
4723
- {
4724
- type: "button",
4725
- "aria-label": labelText ? `Clear ${labelText} filter` : "Clear this filter",
4726
- title: "Clear this filter",
4727
- onClick: (e) => {
4728
- e.stopPropagation();
4729
- onFilterChange(void 0);
4730
- },
4731
- className: "rounded p-0.5 text-primary hover:bg-muted hover:text-foreground",
4732
- children: /* @__PURE__ */ jsx27(X, { className: "h-3 w-3" })
4733
- }
4734
- ) : null
4857
+ /* @__PURE__ */ jsx27(TooltipContent, { children: labelText ? `Clear ${labelText} filter` : "Clear this filter" })
4858
+ ] }) : null
4735
4859
  ] }) : null
4736
4860
  ]
4737
4861
  }
@@ -5349,7 +5473,7 @@ function MatrxUuidCell({
5349
5473
  }
5350
5474
  return /* @__PURE__ */ jsx29("span", { className: "min-w-0 truncate font-mono text-xs text-muted-foreground tabular-nums select-all", children: display });
5351
5475
  })();
5352
- return /* @__PURE__ */ jsxs20(
5476
+ return /* @__PURE__ */ jsx29(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs20(
5353
5477
  "span",
5354
5478
  {
5355
5479
  "data-matrx-cell-control": true,
@@ -5359,51 +5483,64 @@ function MatrxUuidCell({
5359
5483
  ),
5360
5484
  onClick: stop,
5361
5485
  children: [
5362
- /* @__PURE__ */ jsx29(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs20(Tooltip, { children: [
5486
+ /* @__PURE__ */ jsxs20(Tooltip, { children: [
5363
5487
  /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29("span", { className: "inline-flex min-w-0 max-w-full items-center", children: idNode }) }),
5364
5488
  /* @__PURE__ */ jsx29(TooltipContent, { side: "top", className: "max-w-sm break-all font-mono", children: forbidden ? `No access \xB7 ${tip}` : tip })
5365
- ] }) }),
5366
- /* @__PURE__ */ jsx29(
5367
- "button",
5368
- {
5369
- type: "button",
5370
- onClick: onCopy,
5371
- "aria-label": copied ? "Copied" : `Copy ${label ?? "id"}`,
5372
- title: `Copy ${label ?? "id"}: ${value}`,
5373
- className: cn(
5374
- "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5375
- copied && "text-primary"
5376
- ),
5377
- children: copied ? /* @__PURE__ */ jsx29(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx29(Copy, { className: "h-3 w-3" })
5378
- }
5379
- ),
5380
- canPeek ? /* @__PURE__ */ jsx29(
5381
- "button",
5382
- {
5383
- type: "button",
5384
- onClick: (e) => {
5385
- stop(e);
5386
- setPeekOpen(true);
5387
- },
5388
- "aria-label": `Quick look at ${label ?? "record"}`,
5389
- title: `Quick look at ${label ?? "record"}`,
5390
- className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5391
- children: /* @__PURE__ */ jsx29(Lightbulb, { className: "h-3 w-3" })
5392
- }
5393
- ) : null,
5394
- onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsx29(
5395
- "a",
5396
- {
5397
- href: resolvedHref,
5398
- target: "_blank",
5399
- rel: "noopener noreferrer",
5400
- onClick: stop,
5401
- "aria-label": `Open ${label ?? "record"} in a new tab`,
5402
- title: `Open ${label ?? "record"} in a new tab`,
5403
- className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5404
- children: /* @__PURE__ */ jsx29(ExternalLink, { className: "h-3 w-3" })
5405
- }
5406
- ) : null,
5489
+ ] }),
5490
+ /* @__PURE__ */ jsxs20(Tooltip, { children: [
5491
+ /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
5492
+ "button",
5493
+ {
5494
+ type: "button",
5495
+ onClick: onCopy,
5496
+ "aria-label": copied ? "Copied" : `Copy ${label ?? "id"}`,
5497
+ className: cn(
5498
+ "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5499
+ copied && "text-primary"
5500
+ ),
5501
+ children: copied ? /* @__PURE__ */ jsx29(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx29(Copy, { className: "h-3 w-3" })
5502
+ }
5503
+ ) }),
5504
+ /* @__PURE__ */ jsx29(TooltipContent, { side: "top", children: copied ? "Copied" : `Copy ${label ?? "id"}: ${value}` })
5505
+ ] }),
5506
+ canPeek ? /* @__PURE__ */ jsxs20(Tooltip, { children: [
5507
+ /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
5508
+ "button",
5509
+ {
5510
+ type: "button",
5511
+ onClick: (e) => {
5512
+ stop(e);
5513
+ setPeekOpen(true);
5514
+ },
5515
+ "aria-label": `Quick look at ${label ?? "record"}`,
5516
+ className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5517
+ children: /* @__PURE__ */ jsx29(Lightbulb, { className: "h-3 w-3" })
5518
+ }
5519
+ ) }),
5520
+ /* @__PURE__ */ jsxs20(TooltipContent, { side: "top", children: [
5521
+ "Quick look at ",
5522
+ label ?? "record"
5523
+ ] })
5524
+ ] }) : null,
5525
+ onOpen && resolvedHref && !forbidden ? /* @__PURE__ */ jsxs20(Tooltip, { children: [
5526
+ /* @__PURE__ */ jsx29(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx29(
5527
+ "a",
5528
+ {
5529
+ href: resolvedHref,
5530
+ target: "_blank",
5531
+ rel: "noopener noreferrer",
5532
+ onClick: stop,
5533
+ "aria-label": `Open ${label ?? "record"} in a new tab`,
5534
+ className: "inline-flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground focus:outline-none",
5535
+ children: /* @__PURE__ */ jsx29(ExternalLink, { className: "h-3 w-3" })
5536
+ }
5537
+ ) }),
5538
+ /* @__PURE__ */ jsxs20(TooltipContent, { side: "top", children: [
5539
+ "Open ",
5540
+ label ?? "record",
5541
+ " in a new tab"
5542
+ ] })
5543
+ ] }) : null,
5407
5544
  trailing,
5408
5545
  notice,
5409
5546
  canPeek && peekOpen && ResourcePeek ? /* @__PURE__ */ jsx29(
@@ -5417,7 +5554,7 @@ function MatrxUuidCell({
5417
5554
  ) : null
5418
5555
  ]
5419
5556
  }
5420
- );
5557
+ ) });
5421
5558
  }
5422
5559
 
5423
5560
  // src/data-table/entity.ts
@@ -5761,35 +5898,39 @@ function EditableTableCell({
5761
5898
  display,
5762
5899
  ...dirty === void 0 ? {} : { dirty },
5763
5900
  ...className === void 0 ? {} : { className },
5764
- editButton: /* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(
5765
- "button",
5766
- {
5767
- type: "button",
5768
- "aria-label": "Edit",
5769
- title: "Edit",
5770
- onClick: (e) => e.stopPropagation(),
5771
- className: CELL_PENCIL_CLASS,
5772
- children: /* @__PURE__ */ jsx33(Pencil, { className: "h-3 w-3" })
5773
- }
5774
- ) })
5775
- }
5776
- ) : /* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
5777
- "button",
5778
- {
5779
- type: "button",
5780
- onClick: (e) => e.stopPropagation(),
5781
- className: cn(
5782
- "group/cell-select flex w-full items-center gap-1 rounded px-0.5 text-left hover:bg-muted/60",
5783
- dirty && "ring-1 ring-primary/40 bg-primary/5",
5784
- className
5785
- ),
5786
- title: "Edit",
5787
- children: [
5788
- /* @__PURE__ */ jsx33("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
5789
- editType === "select" ? /* @__PURE__ */ jsx33(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
5790
- ]
5901
+ editButton: /* @__PURE__ */ jsxs24(Tooltip, { children: [
5902
+ /* @__PURE__ */ jsx33(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(
5903
+ "button",
5904
+ {
5905
+ type: "button",
5906
+ "aria-label": "Edit",
5907
+ onClick: (e) => e.stopPropagation(),
5908
+ className: CELL_PENCIL_CLASS,
5909
+ children: /* @__PURE__ */ jsx33(Pencil, { className: "h-3 w-3" })
5910
+ }
5911
+ ) }) }),
5912
+ /* @__PURE__ */ jsx33(TooltipContent, { children: "Edit" })
5913
+ ] })
5791
5914
  }
5792
- ) }),
5915
+ ) : /* @__PURE__ */ jsxs24(Tooltip, { children: [
5916
+ /* @__PURE__ */ jsx33(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
5917
+ "button",
5918
+ {
5919
+ type: "button",
5920
+ onClick: (e) => e.stopPropagation(),
5921
+ className: cn(
5922
+ "group/cell-select flex w-full items-center gap-1 rounded px-0.5 text-left hover:bg-muted/60",
5923
+ dirty && "ring-1 ring-primary/40 bg-primary/5",
5924
+ className
5925
+ ),
5926
+ children: [
5927
+ /* @__PURE__ */ jsx33("span", { className: "min-w-0 flex-1 overflow-hidden", children: display }),
5928
+ editType === "select" ? /* @__PURE__ */ jsx33(ChevronDown, { className: "h-3 w-3 shrink-0 text-muted-foreground/70 transition-colors group-hover/cell-select:text-foreground" }) : null
5929
+ ]
5930
+ }
5931
+ ) }) }),
5932
+ /* @__PURE__ */ jsx33(TooltipContent, { children: "Edit value" })
5933
+ ] }),
5793
5934
  /* @__PURE__ */ jsx33(
5794
5935
  PopoverContent,
5795
5936
  {
@@ -5833,42 +5974,46 @@ function InlineStringEditor({
5833
5974
  display,
5834
5975
  ...dirty === void 0 ? {} : { dirty },
5835
5976
  ...className === void 0 ? {} : { className },
5836
- editButton: /* @__PURE__ */ jsx33(
5837
- "button",
5838
- {
5839
- type: "button",
5840
- "aria-label": "Edit",
5841
- title: "Edit",
5842
- onClick: (e) => {
5843
- e.stopPropagation();
5844
- setDraft(value);
5845
- setEditing(true);
5846
- },
5847
- className: CELL_PENCIL_CLASS,
5848
- children: /* @__PURE__ */ jsx33(Pencil, { className: "h-3 w-3" })
5849
- }
5850
- )
5977
+ editButton: /* @__PURE__ */ jsxs24(Tooltip, { children: [
5978
+ /* @__PURE__ */ jsx33(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(
5979
+ "button",
5980
+ {
5981
+ type: "button",
5982
+ "aria-label": "Edit",
5983
+ onClick: (e) => {
5984
+ e.stopPropagation();
5985
+ setDraft(value);
5986
+ setEditing(true);
5987
+ },
5988
+ className: CELL_PENCIL_CLASS,
5989
+ children: /* @__PURE__ */ jsx33(Pencil, { className: "h-3 w-3" })
5990
+ }
5991
+ ) }),
5992
+ /* @__PURE__ */ jsx33(TooltipContent, { children: "Edit" })
5993
+ ] })
5851
5994
  }
5852
5995
  );
5853
5996
  }
5854
- return /* @__PURE__ */ jsx33(
5855
- "button",
5856
- {
5857
- type: "button",
5858
- onClick: (e) => {
5859
- e.stopPropagation();
5860
- setDraft(value);
5861
- setEditing(true);
5862
- },
5863
- className: cn(
5864
- "w-full rounded px-0.5 text-left hover:bg-muted/60",
5865
- dirty && "ring-1 ring-primary/40 bg-primary/5",
5866
- className
5867
- ),
5868
- title: "Click to edit",
5869
- children: display
5870
- }
5871
- );
5997
+ return /* @__PURE__ */ jsxs24(Tooltip, { children: [
5998
+ /* @__PURE__ */ jsx33(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx33(
5999
+ "button",
6000
+ {
6001
+ type: "button",
6002
+ onClick: (e) => {
6003
+ e.stopPropagation();
6004
+ setDraft(value);
6005
+ setEditing(true);
6006
+ },
6007
+ className: cn(
6008
+ "w-full rounded px-0.5 text-left hover:bg-muted/60",
6009
+ dirty && "ring-1 ring-primary/40 bg-primary/5",
6010
+ className
6011
+ ),
6012
+ children: display
6013
+ }
6014
+ ) }),
6015
+ /* @__PURE__ */ jsx33(TooltipContent, { children: "Click to edit" })
6016
+ ] });
5872
6017
  }
5873
6018
  return /* @__PURE__ */ jsx33(
5874
6019
  Input,
@@ -5984,20 +6129,25 @@ function TagsEditor({
5984
6129
  return /* @__PURE__ */ jsxs24("div", { className: "space-y-2", onClick: (e) => e.stopPropagation(), children: [
5985
6130
  /* @__PURE__ */ jsxs24("div", { className: "flex flex-wrap gap-1", children: [
5986
6131
  tags.length === 0 && /* @__PURE__ */ jsx33("span", { className: "text-xs text-muted-foreground", children: "No tags" }),
5987
- tags.map((tag) => /* @__PURE__ */ jsxs24(
5988
- "button",
5989
- {
5990
- type: "button",
5991
- onClick: () => setTags(tags.filter((t) => t !== tag)),
5992
- className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-[11px] hover:border-destructive hover:text-destructive",
5993
- title: `Remove ${tag}`,
5994
- children: [
5995
- tag,
5996
- /* @__PURE__ */ jsx33(X, { className: "h-2.5 w-2.5" })
5997
- ]
5998
- },
5999
- tag
6000
- ))
6132
+ tags.map((tag) => /* @__PURE__ */ jsxs24(Tooltip, { children: [
6133
+ /* @__PURE__ */ jsx33(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs24(
6134
+ "button",
6135
+ {
6136
+ type: "button",
6137
+ onClick: () => setTags(tags.filter((t) => t !== tag)),
6138
+ "aria-label": `Remove ${tag}`,
6139
+ className: "inline-flex items-center gap-1 rounded-full border border-border px-2 py-0.5 text-[11px] hover:border-destructive hover:text-destructive",
6140
+ children: [
6141
+ tag,
6142
+ /* @__PURE__ */ jsx33(X, { className: "h-2.5 w-2.5" })
6143
+ ]
6144
+ }
6145
+ ) }),
6146
+ /* @__PURE__ */ jsxs24(TooltipContent, { children: [
6147
+ "Remove ",
6148
+ tag
6149
+ ] })
6150
+ ] }, tag))
6001
6151
  ] }),
6002
6152
  /* @__PURE__ */ jsx33(
6003
6153
  Input,
@@ -6145,28 +6295,30 @@ function ToolbarFacets({ facets }) {
6145
6295
  children: [
6146
6296
  opt.icon,
6147
6297
  opt.label,
6148
- active && isNonDefault ? /* @__PURE__ */ jsx34(
6149
- "span",
6150
- {
6151
- role: "button",
6152
- tabIndex: 0,
6153
- "aria-label": `Clear ${facet.label ?? opt.label} filter`,
6154
- title: "Clear this filter",
6155
- className: "ml-0.5 inline-flex rounded-sm p-0.5 hover:bg-primary-foreground/20",
6156
- onClick: (e) => {
6157
- e.stopPropagation();
6158
- facet.onChange(defaultValue);
6159
- },
6160
- onKeyDown: (e) => {
6161
- if (e.key === "Enter" || e.key === " ") {
6162
- e.preventDefault();
6298
+ active && isNonDefault ? /* @__PURE__ */ jsx34(TooltipProvider, { delayDuration: 200, children: /* @__PURE__ */ jsxs25(Tooltip, { children: [
6299
+ /* @__PURE__ */ jsx34(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx34(
6300
+ "span",
6301
+ {
6302
+ role: "button",
6303
+ tabIndex: 0,
6304
+ "aria-label": `Clear ${facet.label ?? opt.label} filter`,
6305
+ className: "ml-0.5 inline-flex rounded-sm p-0.5 hover:bg-primary-foreground/20",
6306
+ onClick: (e) => {
6163
6307
  e.stopPropagation();
6164
6308
  facet.onChange(defaultValue);
6165
- }
6166
- },
6167
- children: /* @__PURE__ */ jsx34(X, { className: "h-3 w-3" })
6168
- }
6169
- ) : null
6309
+ },
6310
+ onKeyDown: (e) => {
6311
+ if (e.key === "Enter" || e.key === " ") {
6312
+ e.preventDefault();
6313
+ e.stopPropagation();
6314
+ facet.onChange(defaultValue);
6315
+ }
6316
+ },
6317
+ children: /* @__PURE__ */ jsx34(X, { className: "h-3 w-3" })
6318
+ }
6319
+ ) }),
6320
+ /* @__PURE__ */ jsx34(TooltipContent, { side: "top", children: "Clear this filter" })
6321
+ ] }) }) : null
6170
6322
  ]
6171
6323
  },
6172
6324
  opt.value
@@ -6679,7 +6831,8 @@ function TableRowCopyControl({
6679
6831
  copy,
6680
6832
  row,
6681
6833
  size,
6682
- sourceId
6834
+ sourceId,
6835
+ defaultColumns
6683
6836
  }) {
6684
6837
  return /* @__PURE__ */ jsx36(
6685
6838
  CopyButtons,
@@ -6689,7 +6842,7 @@ function TableRowCopyControl({
6689
6842
  label: copy.label,
6690
6843
  human: () => copy.humanRow(row),
6691
6844
  json: () => copy.agentRow ? copy.agentRow(row) : row,
6692
- agent: () => buildRowAgentInput(copy, row),
6845
+ agent: () => defaultColumns ? buildDefaultTableRowAgentInput(copy, row, defaultColumns) : buildRowAgentInput(copy, row),
6693
6846
  ...copy.rowAiVariants?.(row) === void 0 ? {} : { aiVariants: copy.rowAiVariants?.(row) }
6694
6847
  }
6695
6848
  );
@@ -7080,7 +7233,7 @@ function MatrxDataTableCore({
7080
7233
  });
7081
7234
  const rootRef = useRef6(null);
7082
7235
  useClippedContentGuard(rootRef, {
7083
- label: copy?.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
7236
+ label: typeof copy === "object" && copy.listLabel ? `Table: ${copy.listLabel}` : "MatrxDataTable"
7084
7237
  });
7085
7238
  const [scrollHintRight, setScrollHintRight] = useState15(false);
7086
7239
  const [scrollHintLeft, setScrollHintLeft] = useState15(false);
@@ -7192,23 +7345,45 @@ function MatrxDataTableCore({
7192
7345
  (column) => column !== void 0 && !effectiveHiddenColumnIds.has(columnId(column))
7193
7346
  );
7194
7347
  }, [columns, effectiveColumnOrder, effectiveHiddenColumnIds]);
7348
+ const declaredVisibleCopyColumns = useMemo5(
7349
+ () => visibleColumns.filter((column) => column.accessorFn !== void 0 || column.accessorKey !== void 0),
7350
+ [visibleColumns]
7351
+ );
7352
+ const tableCopySourceNamespace = useId2();
7353
+ const defaultCopyTitle = toolbar?.title || "Table";
7354
+ const defaultCopy = useMemo5(() => ({
7355
+ label: defaultCopyTitle,
7356
+ listLabel: defaultCopyTitle,
7357
+ location: defaultCopyTitle,
7358
+ rowKind: "table-row",
7359
+ listKind: "table-view",
7360
+ listDescription: `${defaultCopyTitle} \u2014 ${remoteQuery ? "current filtered/sorted loaded view" : "current filtered/sorted view"}.`,
7361
+ listAttributes: (_visible, loaded) => remoteQuery ? { coverage: "loaded-current-view", loaded_count: loaded.length } : { coverage: "current-view" },
7362
+ humanRow: (row) => formatDefaultTableCopyRecord(
7363
+ projectDefaultTableCopyRow(row, declaredVisibleCopyColumns),
7364
+ declaredVisibleCopyColumns
7365
+ ),
7366
+ agentRow: (row) => projectDefaultTableCopyRow(row, declaredVisibleCopyColumns)
7367
+ }), [defaultCopyTitle, declaredVisibleCopyColumns, remoteQuery]);
7368
+ const effectiveCopy = copy === false ? void 0 : copy ?? defaultCopy;
7369
+ const effectiveCopyColumns = copy === void 0 ? declaredVisibleCopyColumns : visibleColumns;
7195
7370
  const copySubsetVariant = useCopySubsetVariant();
7196
- const copySubsetColumns = () => visibleColumns.filter((c) => c.filter !== false || c.accessorKey || c.accessorFn).map((c) => ({
7371
+ const copySubsetColumns = () => effectiveCopyColumns.filter((c) => c.filter !== false || c.accessorKey || c.accessorFn).map((c) => ({
7197
7372
  id: columnId(c),
7198
7373
  header: typeof c.header === "string" ? c.header : columnId(c),
7199
7374
  ...c.accessorKey === void 0 ? {} : { accessorKey: c.accessorKey },
7200
7375
  ...c.accessorFn === void 0 ? {} : { accessorFn: c.accessorFn },
7201
7376
  ...c.filter === void 0 ? {} : { filter: c.filter }
7202
7377
  }));
7203
- const copySubsetVariantFor = (rows, scope) => copy && !remoteQuery ? [
7378
+ const copySubsetVariantFor = (rows, scope) => effectiveCopy && !remoteQuery ? [
7204
7379
  copySubsetVariant(() => ({
7205
- label: scope === "selected" ? `${rows().length} selected ${selectionNoun}${rows().length === 1 ? "" : "s"}` : copy.listLabel ?? `${copy.label} view`,
7206
- location: copy.location,
7207
- kind: copy.listKind,
7380
+ label: scope === "selected" ? `${rows().length} selected ${selectionNoun}${rows().length === 1 ? "" : "s"}` : effectiveCopy.listLabel ?? `${effectiveCopy.label} view`,
7381
+ location: effectiveCopy.location,
7382
+ kind: effectiveCopy.listKind,
7208
7383
  rows: rows(),
7209
7384
  columns: copySubsetColumns(),
7210
7385
  getRowId,
7211
- serializer: (shaped) => buildViewAgentInput(copy, shaped, data, { scope: "custom" })
7386
+ serializer: (shaped) => buildViewAgentInput(effectiveCopy, shaped, data, { scope: "custom" })
7212
7387
  }))
7213
7388
  ] : [];
7214
7389
  const filterMeta = useMemo5(() => {
@@ -7322,9 +7497,8 @@ function MatrxDataTableCore({
7322
7497
  windowEnabled && windowConfig?.openOnRowClick
7323
7498
  );
7324
7499
  const editEnabled = Boolean(edit?.enabled && edit.onSave);
7325
- const copyEnabled = Boolean(copy);
7326
- const showRowCopy = copyEnabled && copy?.showRow !== false;
7327
- const showToolbarCopy = copyEnabled && copy?.showToolbar !== false;
7500
+ const showRowCopy = effectiveCopy !== void 0 && effectiveCopy.showRow !== false;
7501
+ const showToolbarCopy = effectiveCopy !== void 0 && effectiveCopy.showToolbar !== false;
7328
7502
  const activeFilterCount = countActiveColumnFilters(columnFilters);
7329
7503
  const facetActive = (toolbar?.facets ?? []).some((f) => {
7330
7504
  if (f.type !== "button-group") return false;
@@ -7706,7 +7880,7 @@ function MatrxDataTableCore({
7706
7880
  }
7707
7881
  } : facet
7708
7882
  ) : toolbar?.facets;
7709
- return /* @__PURE__ */ jsxs27(
7883
+ return /* @__PURE__ */ jsx36(TooltipProvider, { children: /* @__PURE__ */ jsxs27(
7710
7884
  DndContext,
7711
7885
  {
7712
7886
  sensors: hierarchySensors,
@@ -7797,7 +7971,7 @@ function MatrxDataTableCore({
7797
7971
  ),
7798
7972
  children: [
7799
7973
  notice,
7800
- !hideToolbar && (toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsx36(TooltipProvider, { children: /* @__PURE__ */ jsxs27(
7974
+ !hideToolbar && (toolbar?.title || showSearch || toolbar?.anyOf || toolbar?.layeredFilters || toolbar?.facets && toolbar.facets.length > 0 || toolbar?.leading || toolbar?.actions || hasActiveFilters || showToolbarCopy || columns.length > 0) && /* @__PURE__ */ jsxs27(
7801
7975
  TableTitleRow,
7802
7976
  {
7803
7977
  ...toolbar?.title === void 0 ? {} : { title: toolbar.title },
@@ -7839,25 +8013,27 @@ function MatrxDataTableCore({
7839
8013
  /* @__PURE__ */ jsx36(TooltipContent, { children: "Clear search" })
7840
8014
  ] }) : null
7841
8015
  ] }),
7842
- toolbar?.searchMatch ? /* @__PURE__ */ jsxs27(
7843
- Button,
7844
- {
7845
- type: "button",
7846
- variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
7847
- size: "sm",
7848
- className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
7849
- "aria-pressed": searchMatchMode === "whole_words",
7850
- "aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
7851
- title: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words",
7852
- onClick: () => setSearchMatchMode(
7853
- searchMatchMode === "whole_words" ? "contains" : "whole_words"
7854
- ),
7855
- children: [
7856
- /* @__PURE__ */ jsx36(WholeWord, { className: "h-3.5 w-3.5" }),
7857
- searchMatchMode === "whole_words" ? "Whole words" : "Contains"
7858
- ]
7859
- }
7860
- ) : null
8016
+ toolbar?.searchMatch ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
8017
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs27(
8018
+ Button,
8019
+ {
8020
+ type: "button",
8021
+ variant: searchMatchMode === "whole_words" ? "secondary" : "outline",
8022
+ size: "sm",
8023
+ className: "h-8 shrink-0 gap-1 rounded-l-none border-l-0 px-2 text-xs",
8024
+ "aria-pressed": searchMatchMode === "whole_words",
8025
+ "aria-label": `Search match: ${searchMatchMode === "whole_words" ? "whole words" : "contains text"}`,
8026
+ onClick: () => setSearchMatchMode(
8027
+ searchMatchMode === "whole_words" ? "contains" : "whole_words"
8028
+ ),
8029
+ children: [
8030
+ /* @__PURE__ */ jsx36(WholeWord, { className: "h-3.5 w-3.5" }),
8031
+ searchMatchMode === "whole_words" ? "Whole words" : "Contains"
8032
+ ]
8033
+ }
8034
+ ) }),
8035
+ /* @__PURE__ */ jsx36(TooltipContent, { children: searchMatchMode === "whole_words" ? "Whole words \u2014 click to match text anywhere" : "Contains text \u2014 click to require whole words" })
8036
+ ] }) : null
7861
8037
  ]
7862
8038
  }
7863
8039
  ) : null,
@@ -7941,14 +8117,23 @@ function MatrxDataTableCore({
7941
8117
  ) }),
7942
8118
  /* @__PURE__ */ jsx36(TooltipContent, { children: "Clear search and filters; keep columns and sort" })
7943
8119
  ] }) : null,
7944
- showToolbarCopy && copy ? /* @__PURE__ */ jsx36(
8120
+ showToolbarCopy && effectiveCopy ? /* @__PURE__ */ jsx36(
7945
8121
  CopyButtons,
7946
8122
  {
7947
8123
  size: "icon",
7948
- label: copy.listLabel ?? `${copy.label} view`,
7949
- human: () => buildViewHuman(copy, processed, visibleColumns),
7950
- json: () => processed.map((r) => copy.agentRow ? copy.agentRow(r) : r),
7951
- agent: () => buildViewAgentInput(copy, processed, data, {
8124
+ sourceId: `${tableCopySourceNamespace}:view`,
8125
+ label: effectiveCopy.listLabel ?? `${effectiveCopy.label} view`,
8126
+ ...copy === void 0 ? {} : {
8127
+ human: () => buildViewHuman(effectiveCopy, processed, effectiveCopyColumns),
8128
+ json: () => processed.map((r) => effectiveCopy.agentRow ? effectiveCopy.agentRow(r) : r)
8129
+ },
8130
+ agent: () => copy === void 0 ? buildDefaultTableViewAgentInput(effectiveCopy, processed, data, declaredVisibleCopyColumns, {
8131
+ search: searchValue,
8132
+ searchMatchMode,
8133
+ anyOf: anyOfValue,
8134
+ filterCount: activeFilterCount + completeLayeredFilterRules(layeredFilters).length,
8135
+ sort: sort ? `${sort.id}:${sort.direction}` : null
8136
+ }) : buildViewAgentInput(effectiveCopy, processed, data, {
7952
8137
  search: searchValue,
7953
8138
  searchMatchMode,
7954
8139
  anyOf: anyOfValue,
@@ -7956,15 +8141,15 @@ function MatrxDataTableCore({
7956
8141
  sort: sort ? `${sort.id}:${sort.direction}` : null
7957
8142
  }),
7958
8143
  aiVariants: [
7959
- ...copy.aiVariants?.(processed, data) ?? [],
8144
+ ...effectiveCopy.aiVariants?.(processed, data) ?? [],
7960
8145
  ...copySubsetVariantFor(() => processed, "view")
7961
8146
  ],
7962
- ...copy.aiCustom ? { aiCustom: copy.aiCustom(processed, data) } : {},
8147
+ ...effectiveCopy.aiCustom ? { aiCustom: effectiveCopy.aiCustom(processed, data) } : {},
7963
8148
  export: {
7964
- items: [
8149
+ items: copy === void 0 ? [] : [
7965
8150
  jsonExportItem(
7966
8151
  () => processed.map(
7967
- (r) => copy.agentRow ? copy.agentRow(r) : r
8152
+ (r) => effectiveCopy.agentRow ? effectiveCopy.agentRow(r) : r
7968
8153
  ),
7969
8154
  "JSON (rows, raw)"
7970
8155
  ),
@@ -7972,7 +8157,7 @@ function MatrxDataTableCore({
7972
8157
  id: "csv",
7973
8158
  label: "CSV (current view)",
7974
8159
  build: () => ({
7975
- content: rowsToCsvFromColumns(processed, visibleColumns),
8160
+ content: rowsToCsvFromColumns(processed, effectiveCopyColumns),
7976
8161
  extension: "csv",
7977
8162
  mime: "text/csv"
7978
8163
  })
@@ -7984,13 +8169,14 @@ function MatrxDataTableCore({
7984
8169
  const { downloadTableAsXlsx: downloadTableAsXlsx2 } = await Promise.resolve().then(() => (init_tableXlsx(), tableXlsx_exports));
7985
8170
  downloadTableAsXlsx2({
7986
8171
  rows: processed,
7987
- columns: visibleColumns,
7988
- label: copy.listLabel ?? copy.label
8172
+ columns: effectiveCopyColumns,
8173
+ label: effectiveCopy.listLabel ?? effectiveCopy.label
7989
8174
  });
7990
8175
  }
7991
8176
  }
7992
8177
  ],
7993
- sheetRows: () => rowsToRecordsFromColumns(processed, visibleColumns)
8178
+ sheetRows: () => copy === void 0 ? processed.map((row) => projectDefaultTableCopyRow(row, declaredVisibleCopyColumns)) : rowsToRecordsFromColumns(processed, effectiveCopyColumns),
8179
+ ...copy === void 0 ? { sheetColumns: () => declaredVisibleCopyColumns.map((column) => ({ id: columnId(column), label: column.label ?? (typeof column.header === "string" ? column.header : columnId(column)) })) } : {}
7994
8180
  }
7995
8181
  }
7996
8182
  ) : null,
@@ -8021,7 +8207,7 @@ function MatrxDataTableCore({
8021
8207
  )
8022
8208
  ]
8023
8209
  }
8024
- ) }),
8210
+ ),
8025
8211
  selection && selectionCount > 0 ? /* @__PURE__ */ jsxs27("div", { className: "flex shrink-0 flex-wrap items-center gap-2 rounded-md border border-primary/30 bg-primary/5 px-2 py-1.5", children: [
8026
8212
  /* @__PURE__ */ jsxs27("span", { className: "text-xs font-medium text-foreground", children: [
8027
8213
  selectionCount.toLocaleString(),
@@ -8048,27 +8234,26 @@ function MatrxDataTableCore({
8048
8234
  }
8049
8235
  ),
8050
8236
  /* @__PURE__ */ jsxs27("div", { className: "ml-auto flex flex-wrap items-center gap-1.5", children: [
8051
- copy && selectedRows.length > 0 ? /* @__PURE__ */ jsx36(
8237
+ effectiveCopy && selectedRows.length > 0 ? /* @__PURE__ */ jsx36(
8052
8238
  CopyButtons,
8053
8239
  {
8054
8240
  size: "icon",
8241
+ sourceId: `${tableCopySourceNamespace}:selection`,
8055
8242
  label: `${selectedRows.length} selected ${selectionNoun}${selectedRows.length === 1 ? "" : "s"}`,
8056
- human: () => buildViewHuman(copy, selectedRows, visibleColumns),
8057
- json: () => selectedRows.map(
8058
- (row) => copy.agentRow ? copy.agentRow(row) : row
8059
- ),
8060
- agent: () => buildViewAgentInput(copy, selectedRows, data, {
8061
- scope: "selected"
8062
- }),
8243
+ ...copy === void 0 ? {} : {
8244
+ human: () => buildViewHuman(effectiveCopy, selectedRows, effectiveCopyColumns),
8245
+ json: () => selectedRows.map((row) => effectiveCopy.agentRow ? effectiveCopy.agentRow(row) : row)
8246
+ },
8247
+ agent: () => copy === void 0 ? buildDefaultTableViewAgentInput(effectiveCopy, selectedRows, data, declaredVisibleCopyColumns, { scope: "selected" }) : buildViewAgentInput(effectiveCopy, selectedRows, data, { scope: "selected" }),
8063
8248
  aiVariants: copySubsetVariantFor(
8064
8249
  () => selectedRows,
8065
8250
  "selected"
8066
8251
  ),
8067
8252
  export: {
8068
- items: [
8253
+ items: copy === void 0 ? [] : [
8069
8254
  jsonExportItem(
8070
8255
  () => selectedRows.map(
8071
- (row) => copy.agentRow ? copy.agentRow(row) : row
8256
+ (row) => effectiveCopy.agentRow ? effectiveCopy.agentRow(row) : row
8072
8257
  ),
8073
8258
  "JSON (selected rows)"
8074
8259
  ),
@@ -8078,7 +8263,7 @@ function MatrxDataTableCore({
8078
8263
  build: () => ({
8079
8264
  content: rowsToCsvFromColumns(
8080
8265
  selectedRows,
8081
- visibleColumns
8266
+ effectiveCopyColumns
8082
8267
  ),
8083
8268
  extension: "csv",
8084
8269
  mime: "text/csv"
@@ -8091,13 +8276,14 @@ function MatrxDataTableCore({
8091
8276
  const { downloadTableAsXlsx: downloadTableAsXlsx2 } = await Promise.resolve().then(() => (init_tableXlsx(), tableXlsx_exports));
8092
8277
  downloadTableAsXlsx2({
8093
8278
  rows: selectedRows,
8094
- columns: visibleColumns,
8095
- label: `${copy.listLabel ?? copy.label} selected`
8279
+ columns: effectiveCopyColumns,
8280
+ label: `${effectiveCopy.listLabel ?? effectiveCopy.label} selected`
8096
8281
  });
8097
8282
  }
8098
8283
  }
8099
8284
  ],
8100
- sheetRows: () => rowsToRecordsFromColumns(selectedRows, visibleColumns)
8285
+ sheetRows: () => copy === void 0 ? selectedRows.map((row) => projectDefaultTableCopyRow(row, declaredVisibleCopyColumns)) : rowsToRecordsFromColumns(selectedRows, effectiveCopyColumns),
8286
+ ...copy === void 0 ? { sheetColumns: () => declaredVisibleCopyColumns.map((column) => ({ id: columnId(column), label: column.label ?? (typeof column.header === "string" ? column.header : columnId(column)) })) } : {}
8101
8287
  }
8102
8288
  }
8103
8289
  ) : null,
@@ -8162,13 +8348,14 @@ function MatrxDataTableCore({
8162
8348
  className: "inline-flex items-center gap-1",
8163
8349
  onClick: (event) => event.stopPropagation(),
8164
8350
  children: [
8165
- showRowCopy && copy ? /* @__PURE__ */ jsx36(
8351
+ showRowCopy && effectiveCopy ? /* @__PURE__ */ jsx36(
8166
8352
  TableRowCopyControl,
8167
8353
  {
8168
8354
  size: "xs",
8169
- copy,
8355
+ copy: effectiveCopy,
8170
8356
  row: displayRow,
8171
- sourceId: getRowId(displayRow)
8357
+ sourceId: `${tableCopySourceNamespace}:row:${getRowId(displayRow)}`,
8358
+ ...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
8172
8359
  }
8173
8360
  ) : null,
8174
8361
  rowActions?.(displayRow, {
@@ -8489,13 +8676,14 @@ function MatrxDataTableCore({
8489
8676
  className: "inline-flex items-center justify-end gap-0.5",
8490
8677
  onClick: (e) => e.stopPropagation(),
8491
8678
  children: [
8492
- showRowCopy && copy ? /* @__PURE__ */ jsx36(
8679
+ showRowCopy && effectiveCopy ? /* @__PURE__ */ jsx36(
8493
8680
  TableRowCopyControl,
8494
8681
  {
8495
8682
  size: "xs",
8496
- copy,
8683
+ copy: effectiveCopy,
8497
8684
  row: displayRow,
8498
- sourceId: getRowId(displayRow)
8685
+ sourceId: `${tableCopySourceNamespace}:row:${getRowId(displayRow)}`,
8686
+ ...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
8499
8687
  }
8500
8688
  ) : null,
8501
8689
  rowActions?.(displayRow, {
@@ -8506,26 +8694,28 @@ function MatrxDataTableCore({
8506
8694
  hasPendingEdits: Boolean(rowEdits),
8507
8695
  discardPendingEdits: () => discardRowEdits(id)
8508
8696
  }),
8509
- windowEnabled ? /* @__PURE__ */ jsx36(
8510
- Button,
8511
- {
8512
- type: "button",
8513
- variant: "ghost",
8514
- size: "icon",
8515
- className: "h-11 w-11 text-muted-foreground hover:text-foreground lg:h-5 lg:w-5 [&_svg]:size-3",
8516
- "aria-label": opensWindowOnRowClick ? "Open in side panel" : "Open in window",
8517
- title: opensWindowOnRowClick ? "Open in side panel" : "Open in window",
8518
- onClick: (e) => {
8519
- e.stopPropagation();
8520
- if (opensWindowOnRowClick) {
8521
- openDetail(row);
8522
- } else {
8523
- openWindow(row);
8524
- }
8525
- },
8526
- children: opensWindowOnRowClick ? /* @__PURE__ */ jsx36(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx36(PanelRight, { className: "h-3.5 w-3.5" })
8527
- }
8528
- ) : null
8697
+ windowEnabled ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
8698
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
8699
+ Button,
8700
+ {
8701
+ type: "button",
8702
+ variant: "ghost",
8703
+ size: "icon",
8704
+ className: "h-11 w-11 text-muted-foreground hover:text-foreground lg:h-5 lg:w-5 [&_svg]:size-3",
8705
+ "aria-label": opensWindowOnRowClick ? "Open in side panel" : "Open in window",
8706
+ onClick: (e) => {
8707
+ e.stopPropagation();
8708
+ if (opensWindowOnRowClick) {
8709
+ openDetail(row);
8710
+ } else {
8711
+ openWindow(row);
8712
+ }
8713
+ },
8714
+ children: opensWindowOnRowClick ? /* @__PURE__ */ jsx36(PanelRightOpen, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsx36(PanelRight, { className: "h-3.5 w-3.5" })
8715
+ }
8716
+ ) }),
8717
+ /* @__PURE__ */ jsx36(TooltipContent, { children: opensWindowOnRowClick ? "Open in side panel" : "Open in window" })
8718
+ ] }) : null
8529
8719
  ]
8530
8720
  }
8531
8721
  ) })
@@ -8593,34 +8783,38 @@ function MatrxDataTableCore({
8593
8783
  ]
8594
8784
  }
8595
8785
  ),
8596
- scrollHintLeft ? /* @__PURE__ */ jsx36(
8597
- Button,
8598
- {
8599
- type: "button",
8600
- variant: "ghost",
8601
- size: "icon",
8602
- "aria-label": "Scroll table left",
8603
- title: "More columns to the left",
8604
- "data-matrx-table-scroll-control": "left",
8605
- className: "absolute left-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
8606
- onClick: () => scrollTableHorizontally("left"),
8607
- children: /* @__PURE__ */ jsx36(ChevronLeft, { className: "h-5 w-5" })
8608
- }
8609
- ) : null,
8610
- scrollHintRight ? /* @__PURE__ */ jsx36(
8611
- Button,
8612
- {
8613
- type: "button",
8614
- variant: "ghost",
8615
- size: "icon",
8616
- "aria-label": "Scroll table right",
8617
- title: "More columns to the right",
8618
- "data-matrx-table-scroll-control": "right",
8619
- className: "absolute right-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
8620
- onClick: () => scrollTableHorizontally("right"),
8621
- children: /* @__PURE__ */ jsx36(ChevronRight, { className: "h-5 w-5" })
8622
- }
8623
- ) : null
8786
+ scrollHintLeft ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
8787
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
8788
+ Button,
8789
+ {
8790
+ type: "button",
8791
+ variant: "ghost",
8792
+ size: "icon",
8793
+ "aria-label": "Scroll table left",
8794
+ "data-matrx-table-scroll-control": "left",
8795
+ className: "absolute left-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
8796
+ onClick: () => scrollTableHorizontally("left"),
8797
+ children: /* @__PURE__ */ jsx36(ChevronLeft, { className: "h-5 w-5" })
8798
+ }
8799
+ ) }),
8800
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "More columns to the left" })
8801
+ ] }) : null,
8802
+ scrollHintRight ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
8803
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
8804
+ Button,
8805
+ {
8806
+ type: "button",
8807
+ variant: "ghost",
8808
+ size: "icon",
8809
+ "aria-label": "Scroll table right",
8810
+ "data-matrx-table-scroll-control": "right",
8811
+ className: "absolute right-1.5 top-1/2 z-30 hidden h-11 w-11 -translate-y-1/2 rounded-full border border-glass-edge bg-glass p-0 text-foreground shadow-glass backdrop-blur-glass backdrop-saturate-glass hover:bg-glass-hover active:bg-glass-active sm:inline-flex",
8812
+ onClick: () => scrollTableHorizontally("right"),
8813
+ children: /* @__PURE__ */ jsx36(ChevronRight, { className: "h-5 w-5" })
8814
+ }
8815
+ ) }),
8816
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "More columns to the right" })
8817
+ ] }) : null
8624
8818
  ] }),
8625
8819
  appendQuery ? /* @__PURE__ */ jsxs27(
8626
8820
  "div",
@@ -8761,29 +8955,32 @@ function MatrxDataTableCore({
8761
8955
  onClose: () => setSelectedId(null),
8762
8956
  defaultWidth: detail?.defaultWidth ?? 480,
8763
8957
  headerActions: /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-1", children: [
8764
- copy && showRowCopy ? /* @__PURE__ */ jsx36(
8958
+ effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx36(
8765
8959
  TableRowCopyControl,
8766
8960
  {
8767
8961
  size: "icon",
8768
- copy,
8769
- sourceId: getRowId(selectedRow),
8770
- row: selectedRow
8962
+ copy: effectiveCopy,
8963
+ sourceId: `${tableCopySourceNamespace}:row:${getRowId(selectedRow)}`,
8964
+ row: selectedRow,
8965
+ ...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
8771
8966
  }
8772
8967
  ) : null,
8773
8968
  detail?.headerActions?.(selectedRow),
8774
- windowEnabled ? /* @__PURE__ */ jsx36(
8775
- Button,
8776
- {
8777
- type: "button",
8778
- variant: "ghost",
8779
- size: "icon",
8780
- className: "h-7 w-7",
8781
- "aria-label": "Open in window",
8782
- title: "Open in window",
8783
- onClick: () => openWindow(selectedRow),
8784
- children: /* @__PURE__ */ jsx36(PanelRight, { className: "h-3.5 w-3.5" })
8785
- }
8786
- ) : null
8969
+ windowEnabled ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
8970
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
8971
+ Button,
8972
+ {
8973
+ type: "button",
8974
+ variant: "ghost",
8975
+ size: "icon",
8976
+ className: "h-7 w-7",
8977
+ "aria-label": "Open in window",
8978
+ onClick: () => openWindow(selectedRow),
8979
+ children: /* @__PURE__ */ jsx36(PanelRight, { className: "h-3.5 w-3.5" })
8980
+ }
8981
+ ) }),
8982
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "Open in window" })
8983
+ ] }) : null
8787
8984
  ] }),
8788
8985
  children: detail?.render ? (
8789
8986
  // The panel hands children a `min-h-0 flex-1 overflow-hidden` cell
@@ -8805,9 +9002,9 @@ function MatrxDataTableCore({
8805
9002
  DataRowInspector,
8806
9003
  {
8807
9004
  row: selectedRow,
8808
- ...copy?.rowKind === void 0 ? {} : { recordKind: copy?.rowKind },
8809
- ...copy?.label === void 0 ? {} : { recordLabel: copy?.label },
8810
- ...copy?.location === void 0 ? {} : { location: copy?.location },
9005
+ ...effectiveCopy?.rowKind === void 0 ? {} : { recordKind: effectiveCopy?.rowKind },
9006
+ ...effectiveCopy?.label === void 0 ? {} : { recordLabel: effectiveCopy?.label },
9007
+ ...effectiveCopy?.location === void 0 ? {} : { location: effectiveCopy?.location },
8811
9008
  ...detail?.tokenForField === void 0 ? {} : { tokenForField: detail?.tokenForField }
8812
9009
  }
8813
9010
  )
@@ -8825,29 +9022,32 @@ function MatrxDataTableCore({
8825
9022
  windowId: `matrx-data-row-${urlState?.id ?? "local"}-${getRowId(windowRow)}`,
8826
9023
  defaultTab: windowConfig?.defaultTab,
8827
9024
  headerActions: /* @__PURE__ */ jsxs27("div", { className: "flex items-center gap-1", children: [
8828
- opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ jsx36(
8829
- Button,
8830
- {
8831
- type: "button",
8832
- variant: "ghost",
8833
- size: "icon",
8834
- className: "h-7 w-7",
8835
- "aria-label": "Open in side panel",
8836
- title: "Open in side panel",
8837
- onClick: () => {
8838
- closeWindow();
8839
- openDetail(windowRow);
8840
- },
8841
- children: /* @__PURE__ */ jsx36(PanelRightOpen, { className: "h-3.5 w-3.5" })
8842
- }
8843
- ) : null,
8844
- copy ? /* @__PURE__ */ jsx36(
9025
+ opensWindowOnRowClick && detailEnabled ? /* @__PURE__ */ jsxs27(Tooltip, { children: [
9026
+ /* @__PURE__ */ jsx36(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx36(
9027
+ Button,
9028
+ {
9029
+ type: "button",
9030
+ variant: "ghost",
9031
+ size: "icon",
9032
+ className: "h-7 w-7",
9033
+ "aria-label": "Open in side panel",
9034
+ onClick: () => {
9035
+ closeWindow();
9036
+ openDetail(windowRow);
9037
+ },
9038
+ children: /* @__PURE__ */ jsx36(PanelRightOpen, { className: "h-3.5 w-3.5" })
9039
+ }
9040
+ ) }),
9041
+ /* @__PURE__ */ jsx36(TooltipContent, { children: "Open in side panel" })
9042
+ ] }) : null,
9043
+ effectiveCopy && showRowCopy ? /* @__PURE__ */ jsx36(
8845
9044
  TableRowCopyControl,
8846
9045
  {
8847
9046
  size: "icon",
8848
- copy,
8849
- sourceId: getRowId(windowRow),
8850
- row: windowRow
9047
+ copy: effectiveCopy,
9048
+ sourceId: `${tableCopySourceNamespace}:row:${getRowId(windowRow)}`,
9049
+ row: windowRow,
9050
+ ...copy === void 0 ? { defaultColumns: declaredVisibleCopyColumns } : {}
8851
9051
  }
8852
9052
  ) : null
8853
9053
  ] }),
@@ -8858,16 +9058,17 @@ function MatrxDataTableCore({
8858
9058
  closeWindow,
8859
9059
  hasPendingEdits: Boolean(edits[getRowId(windowRow)]),
8860
9060
  discardPendingEdits: () => discardRowEdits(getRowId(windowRow))
8861
- }) ?? (copy ? /* @__PURE__ */ jsx36(
9061
+ }) ?? /* @__PURE__ */ jsx36(
8862
9062
  DataRowInspector,
8863
9063
  {
8864
9064
  row: windowRow,
8865
- recordKind: copy.rowKind,
8866
- recordLabel: copy.label,
8867
- location: copy.location,
9065
+ recordKind: effectiveCopy?.rowKind ?? "record",
9066
+ recordLabel: effectiveCopy?.label ?? "Record",
9067
+ location: effectiveCopy?.location ?? "Table",
9068
+ fieldCopy: copy !== false,
8868
9069
  ...detail?.tokenForField === void 0 ? {} : { tokenForField: detail?.tokenForField }
8869
9070
  }
8870
- ) : void 0),
9071
+ ),
8871
9072
  editContent: windowConfig?.renderEdit === false ? void 0 : windowConfig?.renderEdit ? windowConfig.renderEdit(windowRow, {
8872
9073
  closeDetail: () => setSelectedId(null),
8873
9074
  openDetail: () => openDetail(windowRow),
@@ -8955,7 +9156,7 @@ function MatrxDataTableCore({
8955
9156
  ) : null })
8956
9157
  ]
8957
9158
  }
8958
- );
9159
+ ) });
8959
9160
  }
8960
9161
  function HierarchyDragHandle({
8961
9162
  id,