@arbidocs/blocks 0.4.78 → 0.4.80

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 (83) hide show
  1. package/dist/agents/index.cjs +281 -281
  2. package/dist/agents/index.js +6 -6
  3. package/dist/agents/workflows/StepBarFrame.d.ts +8 -2
  4. package/dist/agents/workflows/stepWindow.d.ts +7 -0
  5. package/dist/chat/index.cjs +125 -125
  6. package/dist/chat/index.js +3 -3
  7. package/dist/{chunk-VFIZYSZB.cjs → chunk-2FEQGDW2.cjs} +28 -12
  8. package/dist/chunk-2FEQGDW2.cjs.map +1 -0
  9. package/dist/{chunk-5OC5CGYX.js → chunk-A5WCK6ZG.js} +8 -8
  10. package/dist/chunk-A5WCK6ZG.js.map +1 -0
  11. package/dist/{chunk-IF6VAYIA.cjs → chunk-C3DRLFU7.cjs} +5 -5
  12. package/dist/{chunk-IF6VAYIA.cjs.map → chunk-C3DRLFU7.cjs.map} +1 -1
  13. package/dist/{chunk-GJV2G4FC.js → chunk-E367ZUHE.js} +3 -3
  14. package/dist/{chunk-GJV2G4FC.js.map → chunk-E367ZUHE.js.map} +1 -1
  15. package/dist/{chunk-XMBYDLZQ.cjs → chunk-HUJLKDWX.cjs} +4 -4
  16. package/dist/{chunk-XMBYDLZQ.cjs.map → chunk-HUJLKDWX.cjs.map} +1 -1
  17. package/dist/{chunk-ICBAFX5B.js → chunk-LBE36YNZ.js} +3 -3
  18. package/dist/{chunk-ICBAFX5B.js.map → chunk-LBE36YNZ.js.map} +1 -1
  19. package/dist/{chunk-SSDISIDW.cjs → chunk-LGDX34UR.cjs} +45 -45
  20. package/dist/chunk-LGDX34UR.cjs.map +1 -0
  21. package/dist/{chunk-B3WCKBJ7.cjs → chunk-MFDGNUKX.cjs} +3 -3
  22. package/dist/{chunk-B3WCKBJ7.cjs.map → chunk-MFDGNUKX.cjs.map} +1 -1
  23. package/dist/{chunk-MP6FK43E.cjs → chunk-O5NDG4EA.cjs} +3 -3
  24. package/dist/{chunk-MP6FK43E.cjs.map → chunk-O5NDG4EA.cjs.map} +1 -1
  25. package/dist/{chunk-DDF5GPIJ.js → chunk-P5ST47VY.js} +3 -3
  26. package/dist/{chunk-DDF5GPIJ.js.map → chunk-P5ST47VY.js.map} +1 -1
  27. package/dist/{chunk-EWSEQEPL.js → chunk-PFA43QNX.js} +3 -3
  28. package/dist/{chunk-EWSEQEPL.js.map → chunk-PFA43QNX.js.map} +1 -1
  29. package/dist/{chunk-WXRCMIAE.js → chunk-QFA3NCWL.js} +27 -13
  30. package/dist/chunk-QFA3NCWL.js.map +1 -0
  31. package/dist/{chunk-CWAZNXC5.js → chunk-SWSVPQNB.js} +30 -8
  32. package/dist/chunk-SWSVPQNB.js.map +1 -0
  33. package/dist/{chunk-MLAHDAN5.cjs → chunk-UA2AMDR6.cjs} +30 -8
  34. package/dist/chunk-UA2AMDR6.cjs.map +1 -0
  35. package/dist/{chunk-XQDM6T6C.js → chunk-WDD255XQ.js} +3 -3
  36. package/dist/{chunk-XQDM6T6C.js.map → chunk-WDD255XQ.js.map} +1 -1
  37. package/dist/{chunk-Z5VUZ6YD.cjs → chunk-ZV3BKLFY.cjs} +3 -3
  38. package/dist/{chunk-Z5VUZ6YD.cjs.map → chunk-ZV3BKLFY.cjs.map} +1 -1
  39. package/dist/connect/index.cjs +68 -64
  40. package/dist/connect/index.cjs.map +1 -1
  41. package/dist/connect/index.d.ts +1 -1
  42. package/dist/connect/index.js +18 -14
  43. package/dist/connect/index.js.map +1 -1
  44. package/dist/connection/ConnectedWorkflowRunner.d.ts +16 -1
  45. package/dist/databases/ColumnConfigFields.d.ts +68 -0
  46. package/dist/databases/DatabaseColumnDialog.d.ts +27 -2
  47. package/dist/databases/DatabaseTable.d.ts +8 -1
  48. package/dist/databases/PickCellEditor.d.ts +21 -0
  49. package/dist/databases/column-types.d.ts +73 -9
  50. package/dist/databases/databaseColumns.d.ts +4 -0
  51. package/dist/databases/index.cjs +758 -27
  52. package/dist/databases/index.cjs.map +1 -1
  53. package/dist/databases/index.d.ts +4 -1
  54. package/dist/databases/index.js +745 -31
  55. package/dist/databases/index.js.map +1 -1
  56. package/dist/databases/linkCells.d.ts +48 -0
  57. package/dist/facts/index.cjs +1 -1
  58. package/dist/facts/index.js +1 -1
  59. package/dist/files/index.cjs +2 -2
  60. package/dist/files/index.js +2 -2
  61. package/dist/home/index.cjs +17 -17
  62. package/dist/home/index.js +3 -3
  63. package/dist/index.cjs +513 -513
  64. package/dist/index.js +11 -11
  65. package/dist/retrieval/index.cjs +1 -1
  66. package/dist/retrieval/index.js +1 -1
  67. package/dist/settings/index.cjs +35 -35
  68. package/dist/settings/index.js +2 -2
  69. package/dist/shell/index.cjs +1 -1
  70. package/dist/shell/index.js +1 -1
  71. package/dist/studio/index.cjs +4 -4
  72. package/dist/studio/index.js +3 -3
  73. package/dist/workflow-canvas/index.cjs +49 -49
  74. package/dist/workflow-canvas/index.js +6 -6
  75. package/dist/workspaces/index.cjs +2 -2
  76. package/dist/workspaces/index.js +2 -2
  77. package/package.json +4 -4
  78. package/dist/chunk-5OC5CGYX.js.map +0 -1
  79. package/dist/chunk-CWAZNXC5.js.map +0 -1
  80. package/dist/chunk-MLAHDAN5.cjs.map +0 -1
  81. package/dist/chunk-SSDISIDW.cjs.map +0 -1
  82. package/dist/chunk-VFIZYSZB.cjs.map +0 -1
  83. package/dist/chunk-WXRCMIAE.js.map +0 -1
@@ -5,6 +5,7 @@
5
5
  * who should approve it, in the run's thread. The host keeps its wording, its commits
6
6
  * (`options.commit`) and its finish screen.
7
7
  */
8
+ import { useDocuments } from '@arbidocs/react';
8
9
  import { type WorkflowRunnerFile, type WorkflowRunnerProps } from '../agents/workflows/WorkflowRunner';
9
10
  import type { WorkflowRunnerActions } from '../agents/workflows/StepParts';
10
11
  import type { WorkflowAgentStep, WorkflowDefinition } from '../agents/workflows/types';
@@ -51,7 +52,21 @@ export interface ConnectedWorkflowRunnerProps extends Omit<WorkflowRunnerProps,
51
52
  * a time, each answer shown in full.
52
53
  */
53
54
  layout?: 'thread' | 'guided';
55
+ /**
56
+ * Which of the workspace's documents an upload step lists (the files "in this matter"): the
57
+ * host hides what is not the matter's own, e.g. skill files kept as workspace documents —
58
+ * `(doc) => !(doc.folder ?? '').startsWith('skills')`. Files added on the run's upload steps are
59
+ * always listed. Absent: every document.
60
+ */
61
+ fileFilter?: (doc: WorkflowRunnerDocument) => boolean;
54
62
  }
55
- export declare function ConnectedWorkflowRunner({ workflow, options, onOpenConversation, emptyHint, connectedLabels, onOpenDocument, onOpenDraft, onOpenMessage, actions: hostActions, dialogLabels, layout, testIdPrefix, ...runnerProps }: ConnectedWorkflowRunnerProps): import("react").JSX.Element;
63
+ /** A workspace document, as `fileFilter` sees it. */
64
+ export type WorkflowRunnerDocument = NonNullable<ReturnType<typeof useDocuments>['data']>[number];
65
+ export declare function ConnectedWorkflowRunner({ workflow, options, onOpenConversation, emptyHint, connectedLabels, onOpenDocument, onOpenDraft, onOpenMessage, actions: hostActions, dialogLabels, layout, fileFilter, testIdPrefix, ...runnerProps }: ConnectedWorkflowRunnerProps): import("react").JSX.Element;
66
+ /**
67
+ * The upload step's files: the workspace's documents the host's `fileFilter` keeps, plus every
68
+ * file added on one of the run's upload steps (`added`: doc id -> step id), which the step waits on.
69
+ */
70
+ export declare function runnerFiles(docs: WorkflowRunnerDocument[], added: Record<string, string>, fileFilter?: (doc: WorkflowRunnerDocument) => boolean): WorkflowRunnerFile[];
56
71
  /** A document's processing status as the upload step shows it; unknown stays unknown. */
57
72
  export declare function fileStatus(status: string | null | undefined): WorkflowRunnerFile['status'];
@@ -0,0 +1,68 @@
1
+ import { type DatabaseColumnView, type DatabaseRollupOp, type DatabaseSummaryView } from './column-types';
2
+ export interface ColumnConfigLabels {
3
+ relatedDatabase: string;
4
+ pickDatabase: string;
5
+ noDatabases: string;
6
+ targetFixed: string;
7
+ thisDatabase: string;
8
+ showOnTarget: (target: string) => string;
9
+ showOnTargetHint: string;
10
+ pairName: string;
11
+ pairNamePlaceholder: (name: string) => string;
12
+ pairedWith: (target: string) => string;
13
+ oneWay: string;
14
+ relation: string;
15
+ pickRelation: string;
16
+ noRelations: string;
17
+ lookupColumn: string;
18
+ pickColumn: string;
19
+ noColumns: string;
20
+ rollupOp: string;
21
+ rollupColumn: string;
22
+ noNumberColumns: string;
23
+ ops: Record<DatabaseRollupOp, string>;
24
+ }
25
+ export declare const DEFAULT_COLUMN_CONFIG_LABELS: ColumnConfigLabels;
26
+ export interface RelationDraft {
27
+ database_id: string;
28
+ two_way: boolean;
29
+ pair_name: string;
30
+ }
31
+ export interface LookupDraft {
32
+ relation: string;
33
+ column: string;
34
+ }
35
+ export interface RollupDraft {
36
+ relation: string;
37
+ column: string;
38
+ op: DatabaseRollupOp;
39
+ }
40
+ export declare function RelationFields({ draft, onChange, databases, databaseId, databaseName, editing, column, labels, }: {
41
+ draft: RelationDraft;
42
+ onChange: (draft: RelationDraft) => void;
43
+ databases: DatabaseSummaryView[];
44
+ databaseId?: string;
45
+ databaseName?: string;
46
+ editing: boolean;
47
+ column?: DatabaseColumnView | null;
48
+ labels: ColumnConfigLabels;
49
+ }): import("react").JSX.Element;
50
+ /** The relation columns of this database, and the columns of a relation's target. */
51
+ export declare function relationColumnsOf(columns: DatabaseColumnView[]): DatabaseColumnView[];
52
+ export declare function targetColumnsOf(relationId: string, columns: DatabaseColumnView[], databases: DatabaseSummaryView[], databaseId?: string): DatabaseColumnView[];
53
+ export declare function LookupFields({ draft, onChange, columns, databases, databaseId, labels, }: {
54
+ draft: LookupDraft;
55
+ onChange: (draft: LookupDraft) => void;
56
+ columns: DatabaseColumnView[];
57
+ databases: DatabaseSummaryView[];
58
+ databaseId?: string;
59
+ labels: ColumnConfigLabels;
60
+ }): import("react").JSX.Element;
61
+ export declare function RollupFields({ draft, onChange, columns, databases, databaseId, labels, }: {
62
+ draft: RollupDraft;
63
+ onChange: (draft: RollupDraft) => void;
64
+ columns: DatabaseColumnView[];
65
+ databases: DatabaseSummaryView[];
66
+ databaseId?: string;
67
+ labels: ColumnConfigLabels;
68
+ }): import("react").JSX.Element;
@@ -1,4 +1,5 @@
1
- import { type DatabaseColumnType, type DatabaseColumnTypeLabels, type DatabaseColumnView } from './column-types';
1
+ import { type DatabaseColumnType, type DatabaseColumnTypeLabels, type DatabaseColumnView, type DatabaseRollupOp, type DatabaseSummaryView } from './column-types';
2
+ import { type ColumnConfigLabels } from './ColumnConfigFields';
2
3
  export interface DatabaseColumnDialogLabels {
3
4
  addTitle: string;
4
5
  editTitle: string;
@@ -25,12 +26,35 @@ export interface DatabaseColumnDraft {
25
26
  name: string;
26
27
  type: DatabaseColumnType;
27
28
  options: string[] | null;
29
+ /** A new relation column's target (and paired column). Absent when editing: it cannot change. */
30
+ relation?: {
31
+ database_id: string;
32
+ two_way: boolean;
33
+ pair_name?: string | null;
34
+ } | null;
35
+ lookup?: {
36
+ relation: string;
37
+ column: string;
38
+ } | null;
39
+ rollup?: {
40
+ relation: string;
41
+ column?: string | null;
42
+ op: DatabaseRollupOp;
43
+ } | null;
28
44
  }
29
45
  export interface DatabaseColumnDialogProps {
30
46
  open: boolean;
31
47
  onOpenChange: (open: boolean) => void;
32
48
  /** The column being edited; omit to add one. */
33
49
  column?: DatabaseColumnView | null;
50
+ /** The database the column belongs to (relations to it are marked "this database"). */
51
+ databaseId?: string;
52
+ /** Its name: the default name of a two-way relation's paired column. */
53
+ databaseName?: string;
54
+ /** Its columns: lookups and rollups read through one of its relation columns. */
55
+ columns?: DatabaseColumnView[];
56
+ /** The databases a relation can link to (this workspace's), with their columns. */
57
+ databases?: DatabaseSummaryView[];
34
58
  onSave: (draft: DatabaseColumnDraft) => void;
35
59
  /** Delete the column (editing only). */
36
60
  onDelete?: () => void;
@@ -39,5 +63,6 @@ export interface DatabaseColumnDialogProps {
39
63
  error?: string | null;
40
64
  labels?: Partial<DatabaseColumnDialogLabels>;
41
65
  typeLabels?: Partial<DatabaseColumnTypeLabels>;
66
+ configLabels?: Partial<ColumnConfigLabels>;
42
67
  }
43
- export declare function DatabaseColumnDialog({ open, onOpenChange, column, onSave, onDelete, isSaving, error, labels, typeLabels, }: DatabaseColumnDialogProps): import("react").JSX.Element;
68
+ export declare function DatabaseColumnDialog({ open, onOpenChange, column, databaseId, databaseName, columns, databases, onSave, onDelete, isSaving, error, labels, typeLabels, configLabels, }: DatabaseColumnDialogProps): import("react").JSX.Element;
@@ -1,6 +1,7 @@
1
1
  import { type GridViewProps } from '../files/GridView';
2
2
  import { type DatabaseColumnLabels } from './databaseColumns';
3
3
  import type { DatabaseColumnView, DatabaseRowView } from './column-types';
4
+ import type { DatabaseCellSources } from './linkCells';
4
5
  export interface DatabaseTableLabels {
5
6
  newRow: string;
6
7
  emptyTitle: string;
@@ -18,6 +19,12 @@ export interface DatabaseTableProps {
18
19
  onAddRow?: () => void;
19
20
  onAddColumn?: () => void;
20
21
  onEditColumn?: (column: DatabaseColumnView) => void;
22
+ /**
23
+ * Choices for person, document and relation cells (workspace members, documents, a search of
24
+ * the related database's rows) and what a document chip opens. Keep it stable (memoise it): the
25
+ * columns are rebuilt when it changes.
26
+ */
27
+ sources?: DatabaseCellSources;
21
28
  /** Ticked rows (for a bulk delete). With it, rows show a checkbox. */
22
29
  onSelectionChange?: (rows: DatabaseRowView[]) => void;
23
30
  selected?: DatabaseRowView[];
@@ -35,4 +42,4 @@ export interface DatabaseTableProps {
35
42
  gridProps?: Partial<Omit<GridViewProps<DatabaseRowView>, 'items' | 'columnDefs' | 'getItemId'>>;
36
43
  testId?: string;
37
44
  }
38
- export declare function DatabaseTable({ columns, rows, onCellChange, onAddRow, onAddColumn, onEditColumn, onSelectionChange, selected, readOnly, isFiltered, isLoading, locale, gridId, height, labels, columnLabels, gridProps, testId, }: DatabaseTableProps): import("react").JSX.Element;
45
+ export declare function DatabaseTable({ columns, rows, onCellChange, onAddRow, onAddColumn, onEditColumn, sources, onSelectionChange, selected, readOnly, isFiltered, isLoading, locale, gridId, height, labels, columnLabels, gridProps, testId, }: DatabaseTableProps): import("react").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import type { CustomCellEditorProps } from 'ag-grid-react';
2
+ import { type DatabaseRowView } from './column-types';
3
+ import { type DatabasePickOption } from './linkCells';
4
+ export interface PickCellEditorLabels {
5
+ searchPlaceholder: string;
6
+ noMatches: string;
7
+ searching: string;
8
+ clear: string;
9
+ done: string;
10
+ remove: (label: string) => string;
11
+ }
12
+ export declare const DEFAULT_PICK_CELL_EDITOR_LABELS: PickCellEditorLabels;
13
+ export interface PickCellEditorParams {
14
+ kind: 'person' | 'document' | 'relation';
15
+ /** A fixed list of choices, filtered as the user types. */
16
+ options?: DatabasePickOption[];
17
+ /** Choices from the server for a search (instead of `options`). */
18
+ search?: (q: string) => Promise<DatabasePickOption[]>;
19
+ labels?: Partial<PickCellEditorLabels>;
20
+ }
21
+ export declare function PickCellEditor(props: CustomCellEditorProps<DatabaseRowView> & PickCellEditorParams): import("react").JSX.Element;
@@ -2,24 +2,63 @@
2
2
  * Databases: the shapes the blocks read, and the per-type rules for showing and editing a cell.
3
3
  *
4
4
  * A database is a user-defined table (a client database, billing records). Its columns are typed:
5
- * `text`, `number`, `date`, `checkbox` or `select`. The server checks and normalises every cell
6
- * (dates arrive as ISO `YYYY-MM-DD` or a full timestamp, numbers as numbers, a select as one of its
7
- * options), so the blocks only format for display and turn an editor's value into what the API takes.
5
+ * `text`, `number`, `date`, `checkbox` and `select` hold a value; `person` holds a workspace member's
6
+ * id (`usr-…`); `document` and `relation` hold lists of ids (documents of the workspace, rows of the
7
+ * target database); `lookup` (the values of a column of the related rows) and `rollup` (a number
8
+ * measured over them) are computed by the server and never written. The server checks and
9
+ * normalises every cell (dates arrive as ISO `YYYY-MM-DD` or a full timestamp, numbers as numbers, a
10
+ * select as one of its options) and names every id a row refers to in the row's `titles`, so the
11
+ * blocks only format for display and turn an editor's value into what the API takes.
8
12
  */
9
- export type DatabaseColumnType = 'text' | 'number' | 'date' | 'checkbox' | 'select';
13
+ export type DatabaseColumnType = 'text' | 'number' | 'date' | 'checkbox' | 'select' | 'person' | 'document' | 'relation' | 'lookup' | 'rollup';
10
14
  /** Every type, in the order a type picker lists them. */
11
15
  export declare const DATABASE_COLUMN_TYPES: DatabaseColumnType[];
16
+ /** Types whose cells the server computes from a relation: shown, never edited. */
17
+ export declare const COMPUTED_COLUMN_TYPES: ReadonlySet<DatabaseColumnType>;
18
+ /** Types whose cells are lists of ids (written as a list that replaces the cell's links). */
19
+ export declare const LINK_COLUMN_TYPES: ReadonlySet<DatabaseColumnType>;
20
+ export declare const isComputedColumn: (column: Pick<DatabaseColumnView, "type">) => boolean;
21
+ export type DatabaseRollupOp = 'count' | 'sum' | 'avg' | 'min' | 'max';
22
+ export declare const DATABASE_ROLLUP_OPS: DatabaseRollupOp[];
23
+ /**
24
+ * A relation column's target. A `two_way` column has a paired column on the target database
25
+ * (`pair_column_id`) showing the same links from the other side; `reverse` marks the paired side.
26
+ */
27
+ export interface DatabaseRelationView {
28
+ database_id: string;
29
+ two_way?: boolean;
30
+ pair_column_id?: string | null;
31
+ reverse?: boolean;
32
+ }
33
+ /** A lookup: `column` of the target database, read through this database's `relation` column. */
34
+ export interface DatabaseLookupView {
35
+ relation: string;
36
+ column: string;
37
+ }
38
+ /** A rollup: `op` over the rows linked through `relation` (`column`: a number column, not for count). */
39
+ export interface DatabaseRollupView {
40
+ relation: string;
41
+ column?: string | null;
42
+ op?: DatabaseRollupOp;
43
+ }
12
44
  /** A column as the blocks read it (the API's `DatabaseColumn`). */
13
45
  export interface DatabaseColumnView {
14
46
  id: string;
15
47
  name: string;
16
48
  type: DatabaseColumnType;
17
49
  options?: string[] | null;
50
+ relation?: DatabaseRelationView | null;
51
+ lookup?: DatabaseLookupView | null;
52
+ rollup?: DatabaseRollupView | null;
18
53
  }
19
- /** A row as the blocks read it: cell values keyed by column id; an empty cell is absent. */
54
+ /**
55
+ * A row as the blocks read it: cell values keyed by column id; an empty cell is absent. `titles`
56
+ * names every person, document and related row the cells refer to (id → display name).
57
+ */
20
58
  export interface DatabaseRowView {
21
59
  id: string;
22
60
  values: Record<string, unknown>;
61
+ titles?: Record<string, string>;
23
62
  }
24
63
  /** A database as a list shows it (the API's `DatabaseRead`). */
25
64
  export interface DatabaseSummaryView {
@@ -38,21 +77,46 @@ export interface DatabaseColumnTypeLabels {
38
77
  date: string;
39
78
  checkbox: string;
40
79
  select: string;
80
+ person: string;
81
+ document: string;
82
+ relation: string;
83
+ lookup: string;
84
+ rollup: string;
41
85
  }
42
86
  export declare const DEFAULT_DATABASE_COLUMN_TYPE_LABELS: DatabaseColumnTypeLabels;
43
87
  export declare function optionTone(option: string): string;
88
+ /** A cell as a list: a list cell as is, a single value as a list of one, an empty cell as none. */
89
+ export declare function cellList(value: unknown): unknown[];
90
+ /** The ids a person, document or relation cell holds. */
91
+ export declare function cellIds(value: unknown): string[];
92
+ /** An id's display name from the row's titles (the id itself when the server could not name it). */
93
+ export declare function titleOf(id: string, titles?: Record<string, string>): string;
94
+ /** Two cell values, as the API stores them, are the same (lists compare item by item). */
95
+ export declare function sameCellValue(a: unknown, b: unknown): boolean;
44
96
  /**
45
97
  * A stored date for display. A bare `YYYY-MM-DD` is a calendar day: it is shown from its own
46
98
  * components, never through a time zone (which would move it a day for viewers west of UTC).
47
99
  */
48
100
  export declare function formatDateValue(value: string, locale?: string): string;
49
101
  export declare function formatNumberValue(value: number, locale?: string): string;
50
- /** A cell as text: what a cell shows, what search and copy see. Checkboxes read as Yes/No. */
51
- export declare function formatCell(value: unknown, type: DatabaseColumnType, locale?: string): string;
102
+ /**
103
+ * One value of a lookup cell, whose type is the looked-up column's: an id reads as its title, a
104
+ * number and an ISO date as their own column would show them.
105
+ */
106
+ export declare function formatLookupValue(value: unknown, titles?: Record<string, string>, locale?: string): string;
107
+ /**
108
+ * A cell as text: what a cell shows, what search and copy see. Checkboxes read as Yes/No; people,
109
+ * documents and related rows by their titles (the row's `titles`), lists joined with commas.
110
+ */
111
+ export declare function formatCell(value: unknown, type: DatabaseColumnType, locale?: string, titles?: Record<string, string>): string;
52
112
  /**
53
113
  * An editor's value as the API takes it. Empty becomes `null` (which empties the cell); everything
54
114
  * else goes as typed and the server checks it, so a bad value comes back as a 422 naming the column.
115
+ * A document or relation cell goes as its list of ids (which replaces the cell's links).
55
116
  */
56
117
  export declare function toApiValue(value: unknown, type: DatabaseColumnType): unknown;
57
- /** Sort comparator for a column's stored values: empty cells last, then by type. */
58
- export declare function compareCells(a: unknown, b: unknown, type: DatabaseColumnType): number;
118
+ /**
119
+ * Sort comparator for a column's stored values: empty cells last, then by type. People, documents,
120
+ * related rows and lookups sort by what they show, so pass each row's titles.
121
+ */
122
+ export declare function compareCells(a: unknown, b: unknown, type: DatabaseColumnType, titlesA?: Record<string, string>, titlesB?: Record<string, string>): number;
@@ -2,10 +2,12 @@ import type { ColDef } from 'ag-grid-community';
2
2
  import { Type } from 'lucide-react';
3
3
  import { type DatabaseColumnType, type DatabaseColumnView, type DatabaseRowView } from './column-types';
4
4
  import { SelectChip } from './SelectChip';
5
+ import { type DatabaseCellSources } from './linkCells';
5
6
  export { SelectChip };
6
7
  export interface DatabaseColumnLabels {
7
8
  addColumn: string;
8
9
  columnSettings: (name: string) => string;
10
+ computed: string;
9
11
  }
10
12
  export declare const DEFAULT_DATABASE_COLUMN_LABELS: DatabaseColumnLabels;
11
13
  /** colId of the trailing "add a column" column (never a database column id). */
@@ -18,6 +20,8 @@ export interface DatabaseColumnOptions {
18
20
  onEditColumn?: (column: DatabaseColumnView) => void;
19
21
  /** Add a column (the trailing "+" header). */
20
22
  onAddColumn?: () => void;
23
+ /** Choices for person, document and relation cells, and what a document chip opens. */
24
+ sources?: DatabaseCellSources;
21
25
  /** Locale for numbers and dates. */
22
26
  locale?: string;
23
27
  labels?: Partial<DatabaseColumnLabels>;