@ai-matrx/records-ui 0.5.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/dist/index.cjs +2493 -1619
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +261 -29
- package/dist/index.d.ts +261 -29
- package/dist/index.js +2500 -1618
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { Uuid as Uuid$1, Table,
|
|
4
|
-
import { Uuid, Field, ReadRow } from '@ai-matrx/records/react';
|
|
5
|
-
import { MatrxColumnDef } from '@ai-matrx/design-system/data-table/types';
|
|
3
|
+
import { Uuid as Uuid$1, Table, Field, RecordDocument, ReadRow, RecordsError, WriteConflict, ValueEnvelope, ParityFieldType, RuleExpression, AggregateBucket, AggregateMeasure, DocTemplateRow, DocRenderRow, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource } from '@ai-matrx/records';
|
|
4
|
+
import { Uuid, Field as Field$1, ReadRow as ReadRow$1 } from '@ai-matrx/records/react';
|
|
6
5
|
import { RecordsClient } from '@ai-matrx/records/core';
|
|
6
|
+
import { MatrxColumnDef } from '@ai-matrx/design-system/data-table/types';
|
|
7
7
|
|
|
8
8
|
/** One named piece of grounding, shaped the way the platform's context slice takes them. */
|
|
9
9
|
interface RecordChatEntry {
|
|
@@ -136,6 +136,21 @@ interface RecordsUiHost {
|
|
|
136
136
|
id: Uuid$1;
|
|
137
137
|
name: string;
|
|
138
138
|
}>>;
|
|
139
|
+
/**
|
|
140
|
+
* OPTIONAL. WHO IS IN THIS ORGANIZATION (FLD-11 `member`).
|
|
141
|
+
*
|
|
142
|
+
* A person field must offer PEOPLE. Who the people are is the platform's
|
|
143
|
+
* answer — organization membership lives in `iam`, not in the record store —
|
|
144
|
+
* and the store has no door onto it, so this is a port rather than a read
|
|
145
|
+
* this package invents. `PersonPicker` resolves whoever is picked to their
|
|
146
|
+
* record in the kernel Person Table, which is what the Field actually stores.
|
|
147
|
+
*
|
|
148
|
+
* Unbound, a person question is ABSENT with `NO_MEMBERS_REASON`. It never
|
|
149
|
+
* falls back to listing the kernel Person Table's contents: that Table also
|
|
150
|
+
* holds the Homes this package writes, and offering "Comments Home" as a
|
|
151
|
+
* person is exactly what this port exists to stop.
|
|
152
|
+
*/
|
|
153
|
+
members?: () => Promise<OrganizationMember[]>;
|
|
139
154
|
/**
|
|
140
155
|
* OPTIONAL. THE HOST'S OWN CHAT SURFACE (SCR-26).
|
|
141
156
|
*
|
|
@@ -174,6 +189,15 @@ interface RecordsUiHost {
|
|
|
174
189
|
*/
|
|
175
190
|
captureQueue?: CaptureQueuePort;
|
|
176
191
|
}
|
|
192
|
+
/** One member of the organization, in the words a person reads. */
|
|
193
|
+
interface OrganizationMember {
|
|
194
|
+
/** The platform's user id. This is what a Person record carries as `user_id`. */
|
|
195
|
+
userId: string;
|
|
196
|
+
/** Their display name, when the platform has one. */
|
|
197
|
+
name?: string | null;
|
|
198
|
+
email?: string | null;
|
|
199
|
+
avatarUrl?: string | null;
|
|
200
|
+
}
|
|
177
201
|
/** The durable half of offline capture: read the queue, write it, that is all. */
|
|
178
202
|
interface CaptureQueuePort {
|
|
179
203
|
load: () => Promise<PendingCapture[]>;
|
|
@@ -197,6 +221,8 @@ interface PendingCapture {
|
|
|
197
221
|
}
|
|
198
222
|
/** The sentence the notify editor shows when no saved-view port is bound. */
|
|
199
223
|
declare const NO_SAVED_VIEWS_REASON: string;
|
|
224
|
+
/** The sentence a person question shows when no membership port is bound. */
|
|
225
|
+
declare const NO_MEMBERS_REASON: string;
|
|
200
226
|
/** The sentence an attachment question shows when no file store is bound. */
|
|
201
227
|
declare const NO_UPLOAD_REASON: string;
|
|
202
228
|
declare function RecordsUiProvider({ value, children }: {
|
|
@@ -207,6 +233,126 @@ declare function useRecordsUi(): RecordsUiHost;
|
|
|
207
233
|
/** The rights for one table — `NO_RIGHTS`, with its reason, when nothing is bound. */
|
|
208
234
|
declare function useTableRights(table: Table | null | undefined): TableRights;
|
|
209
235
|
|
|
236
|
+
/**
|
|
237
|
+
* A token (`records_ui_view`, `long_text`, `v78_widget2`) as a person would
|
|
238
|
+
* write it. Used ONLY as a last resort, when the thing carries no label at all
|
|
239
|
+
* — a raw token on a screen is the defect, and a humanised token is the least
|
|
240
|
+
* bad honest answer, because it still names the same thing.
|
|
241
|
+
*/
|
|
242
|
+
declare function humanize(token: string): string;
|
|
243
|
+
/** The name of one Field, as a header, a form label or a peek's term. */
|
|
244
|
+
declare function fieldName(field: Field): string;
|
|
245
|
+
/** The name of one Table, as a card, a heading or a breadcrumb. */
|
|
246
|
+
declare function tableName(table: Table): string;
|
|
247
|
+
/**
|
|
248
|
+
* The name of one RECORD, for a chip, a card, a relation cell or a peek title.
|
|
249
|
+
*
|
|
250
|
+
* `titleKey` is the Table's own `title_field` when the caller knows the Table —
|
|
251
|
+
* that is the store's answer to "what makes this record a chip" (REC-2) — and
|
|
252
|
+
* the conventional keys are tried after it. A record with nothing readable is
|
|
253
|
+
* NOT shown as a truncated uuid: it says it has no name yet, because "8f2c1b0a"
|
|
254
|
+
* tells a person nothing and looks like a bug.
|
|
255
|
+
*/
|
|
256
|
+
declare function recordName(document: RecordDocument | undefined, titleKey?: string | null, fallback?: string): string;
|
|
257
|
+
/** The same question for a row the read door returned. */
|
|
258
|
+
declare function rowName(row: ReadRow | undefined, titleKey?: string | null, fallback?: string): string;
|
|
259
|
+
|
|
260
|
+
interface PersonPickerProps {
|
|
261
|
+
field: Field;
|
|
262
|
+
value: unknown;
|
|
263
|
+
onChange: (value: unknown) => void;
|
|
264
|
+
disabled?: boolean | undefined;
|
|
265
|
+
id?: string | undefined;
|
|
266
|
+
className?: string | undefined;
|
|
267
|
+
}
|
|
268
|
+
/** A Person record in the kernel Table, as this picker needs to read it. */
|
|
269
|
+
interface PersonRecord {
|
|
270
|
+
id: Uuid$1;
|
|
271
|
+
userId: string | null;
|
|
272
|
+
name: string;
|
|
273
|
+
}
|
|
274
|
+
/** The member's own name, as a person reads it. Never a uuid. */
|
|
275
|
+
declare function memberName(member: OrganizationMember): string;
|
|
276
|
+
/**
|
|
277
|
+
* Find (or write) the kernel Person record for one member. Exported because
|
|
278
|
+
* an agent filling a person field server-side needs exactly the same answer,
|
|
279
|
+
* and two implementations of "which record is this person" is two answers.
|
|
280
|
+
*/
|
|
281
|
+
declare function personRecordForMember(client: RecordsClient, personTableId: Uuid$1, people: PersonRecord[], member: OrganizationMember): Promise<{
|
|
282
|
+
ok: true;
|
|
283
|
+
data: Uuid$1;
|
|
284
|
+
} | {
|
|
285
|
+
ok: false;
|
|
286
|
+
error: RecordsError;
|
|
287
|
+
}>;
|
|
288
|
+
declare function PersonPicker({ field, value, onChange, disabled, id, className }: PersonPickerProps): react.JSX.Element;
|
|
289
|
+
|
|
290
|
+
/** Which cell is open. A grid opens exactly one at a time, like every other grid. */
|
|
291
|
+
interface CellAddress {
|
|
292
|
+
rowId: Uuid$1;
|
|
293
|
+
key: string;
|
|
294
|
+
}
|
|
295
|
+
/** What one cell is doing right now, so nothing about it is guessed by a caller. */
|
|
296
|
+
type CellState = "clean" | "saving" | "refused";
|
|
297
|
+
interface CellRefusal {
|
|
298
|
+
error: RecordsError;
|
|
299
|
+
/** Present when the store said `PT409`: the other person's value, from the store. */
|
|
300
|
+
conflict: WriteConflict | null;
|
|
301
|
+
/** The value that was being written, so Retry can write it again. */
|
|
302
|
+
attempted: unknown;
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* FLD-9. A computed Field is not editable and never will be — the store works
|
|
306
|
+
* it out. Saying so here, once, keeps every caller from re-deciding it.
|
|
307
|
+
*/
|
|
308
|
+
declare function fieldIsEditable(field: Field): boolean;
|
|
309
|
+
interface GridEditing {
|
|
310
|
+
/** The value to DRAW for one cell — the optimistic one when there is one. */
|
|
311
|
+
valueFor: (row: ReadRow, field: Field) => unknown;
|
|
312
|
+
editing: CellAddress | null;
|
|
313
|
+
stateOf: (rowId: Uuid$1, key: string) => CellState;
|
|
314
|
+
refusalOf: (rowId: Uuid$1, key: string) => CellRefusal | null;
|
|
315
|
+
begin: (address: CellAddress) => void;
|
|
316
|
+
cancel: () => void;
|
|
317
|
+
/** Commit the open cell. `move` opens the next/previous editable cell after it. */
|
|
318
|
+
commit: (value: unknown, move?: "next" | "previous" | null) => void;
|
|
319
|
+
/** Write the attempted value again, after re-reading the version. */
|
|
320
|
+
retry: (rowId: Uuid$1, key: string) => void;
|
|
321
|
+
/** Drop the edit and show what the other person wrote. */
|
|
322
|
+
keepTheirs: (rowId: Uuid$1, key: string) => void;
|
|
323
|
+
/** Soft delete, through the store's own door. Answers the store's refusal, or null. */
|
|
324
|
+
remove: (rowId: Uuid$1) => Promise<RecordsError | null>;
|
|
325
|
+
/** Write an empty record and open its first editable cell. */
|
|
326
|
+
addRecord: () => Promise<RecordsError | null>;
|
|
327
|
+
/** The last refusal from a delete or an add, for the grid to print. */
|
|
328
|
+
rowError: RecordsError | null;
|
|
329
|
+
clearRowError: () => void;
|
|
330
|
+
busy: boolean;
|
|
331
|
+
}
|
|
332
|
+
interface Options {
|
|
333
|
+
tableId: Uuid$1;
|
|
334
|
+
fields: Field[];
|
|
335
|
+
rows: ReadRow[];
|
|
336
|
+
/** Re-read the page once the store has accepted something. */
|
|
337
|
+
reload: () => void;
|
|
338
|
+
/** May this person write records at all? A read-only grid opens no editor. */
|
|
339
|
+
canWrite: boolean;
|
|
340
|
+
}
|
|
341
|
+
declare function useGridEditing({ tableId, fields, rows, reload, canWrite }: Options): GridEditing;
|
|
342
|
+
/**
|
|
343
|
+
* ONE CELL. Read, until somebody asks to change it; then the Field's own
|
|
344
|
+
* editor, in place, with the keys a person expects from a grid.
|
|
345
|
+
*
|
|
346
|
+
* `data-matrx-cell-control` is the data table's own opt-out from whole-row
|
|
347
|
+
* click, so opening a cell never also opens the record panel behind it.
|
|
348
|
+
*/
|
|
349
|
+
declare function GridCell({ field, row, editing, canWrite, }: {
|
|
350
|
+
field: Field;
|
|
351
|
+
row: ReadRow;
|
|
352
|
+
editing: GridEditing;
|
|
353
|
+
canWrite: boolean;
|
|
354
|
+
}): react.JSX.Element;
|
|
355
|
+
|
|
210
356
|
declare function RefusalNotice({ error, className, actions, }: {
|
|
211
357
|
error: RecordsError;
|
|
212
358
|
className?: string | undefined;
|
|
@@ -226,18 +372,30 @@ interface GridProps {
|
|
|
226
372
|
onOpenRecord?: ((recordId: Uuid) => void) | undefined;
|
|
227
373
|
/** SCR-2. Called when an admin clicks the "+" at the end of the headers. */
|
|
228
374
|
onAddField?: (() => void) | undefined;
|
|
375
|
+
/**
|
|
376
|
+
* The host's whole-record form. Offered BY NAME when the store refuses an
|
|
377
|
+
* empty record — a Table with a required Field cannot be added to one cell at
|
|
378
|
+
* a time, and saying so beats a button that fails.
|
|
379
|
+
*/
|
|
380
|
+
onNewRecordForm?: (() => void) | undefined;
|
|
229
381
|
/** Extra toolbar content — the view switcher, the export menu, the view bar. */
|
|
230
382
|
toolbarActions?: ReactNode | undefined;
|
|
383
|
+
/** Editing in place is on by default; a read-only surface (a portal) turns it off. */
|
|
384
|
+
editable?: boolean | undefined;
|
|
231
385
|
className?: string | undefined;
|
|
232
386
|
}
|
|
233
|
-
declare function Grid({ tableId, pageSize, onOpenRecord, onAddField, toolbarActions, className, }: GridProps): react.JSX.Element;
|
|
234
|
-
/**
|
|
235
|
-
|
|
387
|
+
declare function Grid({ tableId, pageSize, onOpenRecord, onAddField, onNewRecordForm, toolbarActions, editable, className, }: GridProps): react.JSX.Element;
|
|
388
|
+
/**
|
|
389
|
+
* One Field becomes one column. The header is the Field's own NAME — never its
|
|
390
|
+
* key (`names.ts`) — and the cell is the value, rendered by its parity type and
|
|
391
|
+
* editable in place when an editing session is passed.
|
|
392
|
+
*/
|
|
393
|
+
declare function columnForField(field: Field$1, editing?: GridEditing | null): MatrxColumnDef<ReadRow$1>;
|
|
236
394
|
|
|
237
395
|
interface ExportMenuProps {
|
|
238
396
|
tableId: Uuid;
|
|
239
397
|
/** The rows on screen. Absent means "this table's first page", read the same way. */
|
|
240
|
-
rows?: ReadRow[] | undefined;
|
|
398
|
+
rows?: ReadRow$1[] | undefined;
|
|
241
399
|
/** What the file is called. The table's name by default. */
|
|
242
400
|
label?: string | undefined;
|
|
243
401
|
className?: string | undefined;
|
|
@@ -276,7 +434,7 @@ declare function CustomFieldsSection({ tableId, entityToken, recordId, title, cl
|
|
|
276
434
|
interface FieldEditorProps {
|
|
277
435
|
tableId: Uuid$1;
|
|
278
436
|
/** The Field being edited. Absent means a new one. */
|
|
279
|
-
field?: Field
|
|
437
|
+
field?: Field | undefined;
|
|
280
438
|
onSaved?: (() => void) | undefined;
|
|
281
439
|
onCancel?: (() => void) | undefined;
|
|
282
440
|
className?: string | undefined;
|
|
@@ -286,7 +444,7 @@ declare function FieldEditor({ tableId, field, onSaved, onCancel, className }: F
|
|
|
286
444
|
interface FieldProposalRow {
|
|
287
445
|
id: string;
|
|
288
446
|
/** What the agent proposed, in the Field shape the store would store. */
|
|
289
|
-
field: Partial<Field> & {
|
|
447
|
+
field: Partial<Field$1> & {
|
|
290
448
|
key: string;
|
|
291
449
|
label?: string;
|
|
292
450
|
};
|
|
@@ -330,7 +488,7 @@ interface RecordFormProps {
|
|
|
330
488
|
declare function RecordForm({ tableId, recordId, recordType, onSaved, onCancel, className, }: RecordFormProps): react.JSX.Element;
|
|
331
489
|
|
|
332
490
|
interface RelationPickerProps {
|
|
333
|
-
field: Field
|
|
491
|
+
field: Field;
|
|
334
492
|
value: unknown;
|
|
335
493
|
onChange: (value: unknown) => void;
|
|
336
494
|
disabled?: boolean | undefined;
|
|
@@ -340,7 +498,7 @@ interface RelationPickerProps {
|
|
|
340
498
|
declare function RelationPicker({ field, value, onChange, disabled, id, className }: RelationPickerProps): react.JSX.Element;
|
|
341
499
|
|
|
342
500
|
interface FieldEditorControlProps {
|
|
343
|
-
field: Field
|
|
501
|
+
field: Field;
|
|
344
502
|
value: unknown;
|
|
345
503
|
onChange: (value: unknown) => void;
|
|
346
504
|
disabled?: boolean | undefined;
|
|
@@ -348,7 +506,7 @@ interface FieldEditorControlProps {
|
|
|
348
506
|
}
|
|
349
507
|
/** The label row every editor shares: one line, the label, the unit, the required mark. */
|
|
350
508
|
declare function FieldLabel({ field, htmlFor, children }: {
|
|
351
|
-
field: Field
|
|
509
|
+
field: Field;
|
|
352
510
|
htmlFor: string;
|
|
353
511
|
children?: ReactNode;
|
|
354
512
|
}): react.JSX.Element;
|
|
@@ -362,9 +520,9 @@ declare function RecordChip({ title, onRemove, className, }: {
|
|
|
362
520
|
|
|
363
521
|
/** The envelope for one key, when the document carries one. */
|
|
364
522
|
declare function envelopeFor(document: RecordDocument | undefined, key: string): ValueEnvelope | undefined;
|
|
365
|
-
declare function renderValue(field: Field
|
|
523
|
+
declare function renderValue(field: Field, value: unknown, document?: RecordDocument): react.JSX.Element;
|
|
366
524
|
/** The text of one scalar, with the Field's UNIT and FORMAT applied — FLD-N-1 says both change the MEANING. */
|
|
367
|
-
declare function scalarText(field: Field
|
|
525
|
+
declare function scalarText(field: Field, value: unknown): string;
|
|
368
526
|
/** The provenance badge a value carries when the store interned a source for it (SCR-27). */
|
|
369
527
|
declare function ProvenanceBadge({ document, fieldKey }: {
|
|
370
528
|
document: RecordDocument | undefined;
|
|
@@ -375,16 +533,16 @@ declare const PARITY_LABEL: Record<ParityFieldType, string>;
|
|
|
375
533
|
/** The "made of" sentence the store itself publishes, for the field editor's help text. */
|
|
376
534
|
declare const PARITY_MADE_OF: Record<string, string>;
|
|
377
535
|
/** Plain text and plain number are behaviours with no parity type of their own. */
|
|
378
|
-
type EditorKind = ParityFieldType | "relation" | "text" | "number" | "boolean" | "date" | "long_text";
|
|
536
|
+
type EditorKind = ParityFieldType | "relation" | "text" | "number" | "boolean" | "date" | "json" | "long_text";
|
|
379
537
|
/**
|
|
380
538
|
* Which editor one Field wants. Reads the Field's own declaration only — the
|
|
381
539
|
* behaviour, the modifiers, the format, the relation target and the config —
|
|
382
540
|
* because those are what the store stores, and a screen that guessed from a
|
|
383
541
|
* value would draw a different editor for an empty record.
|
|
384
542
|
*/
|
|
385
|
-
declare function editorKindFor(field: Field
|
|
543
|
+
declare function editorKindFor(field: Field): EditorKind;
|
|
386
544
|
/** The type word a person sees in a header or a settings row. */
|
|
387
|
-
declare function fieldTypeLabel(field: Field
|
|
545
|
+
declare function fieldTypeLabel(field: Field): string;
|
|
388
546
|
|
|
389
547
|
/** One Field of a package-owned Table, in the store's own words. */
|
|
390
548
|
interface SystemFieldSpec {
|
|
@@ -473,10 +631,32 @@ interface SavedView extends SavedViewSpec {
|
|
|
473
631
|
}
|
|
474
632
|
/** The package-owned Table every saved view is a record of. */
|
|
475
633
|
declare const VIEW_TABLE: SystemTableSpec;
|
|
634
|
+
/**
|
|
635
|
+
* WHICH FIELD EACH LAYOUT CAN BE DRAWN FROM, decided from the FIELD'S OWN
|
|
636
|
+
* DECLARATION and never from the values it happens to hold.
|
|
637
|
+
*
|
|
638
|
+
* A kanban makes columns from a choice: the Field whose value is one of a
|
|
639
|
+
* closed set (FLD-5 / FLD-6 — a pick-list is a Table, and a select stores the
|
|
640
|
+
* id of one of its records). Grouping by a free-text Field produces one column
|
|
641
|
+
* per record, which is not a board. A calendar places a record in time, so it
|
|
642
|
+
* needs a Field that holds a date.
|
|
643
|
+
*
|
|
644
|
+
* These two answers are here, beside the layouts, because the picker on the
|
|
645
|
+
* screen and any agent writing a view spec must agree about what is offerable.
|
|
646
|
+
*/
|
|
647
|
+
declare const LAYOUT_FIELD_KIND: Record<ViewLayout, "choice" | "date" | null>;
|
|
648
|
+
/** The one sentence a layout says when the table holds no Field it could use. */
|
|
649
|
+
declare const LAYOUT_NO_FIELD: Record<ViewLayout, string>;
|
|
476
650
|
/** The spec as the one document the store holds. */
|
|
477
651
|
declare function viewDocument(spec: SavedViewSpec): Record<string, unknown>;
|
|
478
652
|
/** One stored record back into the spec a screen and an agent both read. */
|
|
479
|
-
declare function viewFromRecord(row: ReadRow
|
|
653
|
+
declare function viewFromRecord(row: ReadRow): SavedView;
|
|
654
|
+
/**
|
|
655
|
+
* A PARTIAL change to a saved view, as the patch the store takes. Only the keys
|
|
656
|
+
* the caller actually changed are written — a full document would re-write a
|
|
657
|
+
* name or a rule the person edited in another tab.
|
|
658
|
+
*/
|
|
659
|
+
declare function viewPatchDocument(patch: Partial<SavedViewSpec>): Record<string, unknown>;
|
|
480
660
|
|
|
481
661
|
interface ViewSwitcherProps {
|
|
482
662
|
/**
|
|
@@ -487,19 +667,29 @@ interface ViewSwitcherProps {
|
|
|
487
667
|
view: SavedViewSpec;
|
|
488
668
|
/** Called when the person picks another layout, so the host can save it. */
|
|
489
669
|
onLayoutChange?: ((layout: ViewLayout) => void) | undefined;
|
|
670
|
+
/**
|
|
671
|
+
* Called with whatever part of the view the person just changed — the layout,
|
|
672
|
+
* the Field the kanban groups by, the Field the calendar reads. The HOST
|
|
673
|
+
* saves it onto the view record, so the choice is remembered per saved view
|
|
674
|
+
* rather than per page load. Unbound, the pickers still work for this visit
|
|
675
|
+
* and the screen says the choice is not being kept.
|
|
676
|
+
*/
|
|
677
|
+
onViewChange?: ((patch: Partial<SavedViewSpec>) => void) | undefined;
|
|
490
678
|
onOpenRecord?: ((recordId: Uuid) => void) | undefined;
|
|
679
|
+
/** The host's whole-record form, offered by the grid when an empty record is refused. */
|
|
680
|
+
onNewRecordForm?: (() => void) | undefined;
|
|
491
681
|
pageSize?: number | undefined;
|
|
492
682
|
className?: string | undefined;
|
|
493
683
|
}
|
|
494
684
|
/** The records this view holds: its Rule's members when it names one, the table otherwise. */
|
|
495
685
|
declare function useViewRecords(view: SavedViewSpec, pageSize?: number): {
|
|
496
|
-
rows: ReadRow[];
|
|
686
|
+
rows: ReadRow$1[];
|
|
497
687
|
loading: boolean;
|
|
498
688
|
error: RecordsError | null;
|
|
499
689
|
/** Where membership came from, in a sentence. A screen that hides this is hiding the view's meaning. */
|
|
500
690
|
membership: string;
|
|
501
691
|
};
|
|
502
|
-
declare function ViewSwitcher({ view, onLayoutChange, onOpenRecord, pageSize, className }: ViewSwitcherProps): react.JSX.Element;
|
|
692
|
+
declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, onNewRecordForm, pageSize, className, }: ViewSwitcherProps): react.JSX.Element;
|
|
503
693
|
|
|
504
694
|
interface ViewBarProps {
|
|
505
695
|
/** The Table whose views these are. */
|
|
@@ -701,7 +891,7 @@ declare const FORM_TABLE: SystemTableSpec;
|
|
|
701
891
|
/** The spec as the one document the store holds. */
|
|
702
892
|
declare function formDocument(spec: FormSpec): Record<string, unknown>;
|
|
703
893
|
/** One stored record back into the spec a screen and an agent both read. */
|
|
704
|
-
declare function formFromRecord(row: ReadRow
|
|
894
|
+
declare function formFromRecord(row: ReadRow): SavedForm;
|
|
705
895
|
/**
|
|
706
896
|
* THE SOURCE STAMP every submission carries. A record that arrived through a
|
|
707
897
|
* form is not indistinguishable from one somebody typed into the grid: it says
|
|
@@ -779,7 +969,7 @@ interface SavedDashboard extends DashboardSpec {
|
|
|
779
969
|
/** The package-owned Table every dashboard is a record of. */
|
|
780
970
|
declare const DASHBOARD_TABLE: SystemTableSpec;
|
|
781
971
|
declare function dashboardDocument(spec: DashboardSpec): Record<string, unknown>;
|
|
782
|
-
declare function dashboardFromRecord(row: ReadRow
|
|
972
|
+
declare function dashboardFromRecord(row: ReadRow): SavedDashboard;
|
|
783
973
|
/**
|
|
784
974
|
* The series palette. Six SEMANTIC tokens the design system already flips for
|
|
785
975
|
* dark mode, so a chart is correct in both themes without a second palette and
|
|
@@ -807,11 +997,11 @@ interface DocTemplateSpec {
|
|
|
807
997
|
* `custom.doc_unresolved_tokens` names it and the screen shows the store's own
|
|
808
998
|
* reason — it is never quietly deleted from the body.
|
|
809
999
|
*/
|
|
810
|
-
declare function bodyFromKeys(body: string, fields: Field
|
|
1000
|
+
declare function bodyFromKeys(body: string, fields: Field[]): string;
|
|
811
1001
|
/** The reverse, for a person reading a stored body: ids shown as the Field's label. */
|
|
812
|
-
declare function bodyForReading(body: string, fields: Field
|
|
1002
|
+
declare function bodyForReading(body: string, fields: Field[]): string;
|
|
813
1003
|
/** VAL-10: a signature is a Value on a text Field whose format is `signature`. */
|
|
814
|
-
declare function isSignatureField(field: Field
|
|
1004
|
+
declare function isSignatureField(field: Field): boolean;
|
|
815
1005
|
|
|
816
1006
|
interface DocTemplateProps {
|
|
817
1007
|
/** The Table these templates render. */
|
|
@@ -1076,8 +1266,8 @@ declare function personActor(userId: Uuid$1 | null | undefined): RecordsActor;
|
|
|
1076
1266
|
*/
|
|
1077
1267
|
declare function recordsDataSource(client: object, fallbackSchema?: string): RecordsDataSource;
|
|
1078
1268
|
|
|
1079
|
-
type TableLane = "mine" | "organization" | "system" | "community";
|
|
1080
|
-
/** The
|
|
1269
|
+
type TableLane = "mine" | "organization" | "system" | "community" | "app";
|
|
1270
|
+
/** The five lanes, in the order a person reads them. Never a flat list. */
|
|
1081
1271
|
declare const TABLE_LANES: readonly TableLane[];
|
|
1082
1272
|
declare const LANE_TITLE: Record<TableLane, string>;
|
|
1083
1273
|
/** What fills an empty lane. A heading with nothing under it must still teach. */
|
|
@@ -1102,9 +1292,51 @@ interface TablePageProps {
|
|
|
1102
1292
|
* used — see why that default is not optional.
|
|
1103
1293
|
*/
|
|
1104
1294
|
seedViews?: SavedViewSpec[] | undefined;
|
|
1295
|
+
/**
|
|
1296
|
+
* What a person does when the table is not theirs to see — switch
|
|
1297
|
+
* organization, go back to the list. Absent, the screen still SAYS what
|
|
1298
|
+
* happened; it just has no button to offer, which is honest and is never a
|
|
1299
|
+
* blank frame.
|
|
1300
|
+
*/
|
|
1301
|
+
onLeave?: (() => void) | undefined;
|
|
1302
|
+
/** The word on that button. Defaults to "Back to your tables". */
|
|
1303
|
+
leaveLabel?: string | undefined;
|
|
1105
1304
|
className?: string | undefined;
|
|
1106
1305
|
}
|
|
1107
|
-
|
|
1306
|
+
/**
|
|
1307
|
+
* THE SENTENCE A TABLE YOU CANNOT SEE SAYS.
|
|
1308
|
+
*
|
|
1309
|
+
* Measured on the real screen (independent verdict, 19 September): opening a
|
|
1310
|
+
* table's page while another organization was active left the main area's text
|
|
1311
|
+
* "literally the empty string" after eighteen seconds — no sentence, no
|
|
1312
|
+
* spinner, no console error. A made-up id did the same. The cause is exactly
|
|
1313
|
+
* one line of this file: `custom.table_list` correctly answers the tables this
|
|
1314
|
+
* person can see in THIS organization, the table is not among them, so
|
|
1315
|
+
* `useTable` answers `{ data: null, error: null }` — not a refusal, just
|
|
1316
|
+
* absence — and the page rendered a skeleton for ever.
|
|
1317
|
+
*
|
|
1318
|
+
* Absence is an ANSWER and it gets a sentence. It deliberately does not say
|
|
1319
|
+
* whether the table exists: this person cannot see it, and which of the two it
|
|
1320
|
+
* is is not theirs to learn.
|
|
1321
|
+
*/
|
|
1322
|
+
declare const TABLE_NOT_REACHABLE: string;
|
|
1323
|
+
/**
|
|
1324
|
+
* THE VIEW EVERY TABLE HAS, AND WHY IT IS NOT OPTIONAL.
|
|
1325
|
+
*
|
|
1326
|
+
* A view is a record, so a table nobody has saved a view for has none — and
|
|
1327
|
+
* this page then renders its own honest sentence ("Waiting for this table's
|
|
1328
|
+
* views") and NO RECORDS AT ALL. Measured on 2026-09-19 by walking the real
|
|
1329
|
+
* product: declare a table, write a record, open the table — and the record is
|
|
1330
|
+
* not on the screen, with the only remedy being a control the person has no
|
|
1331
|
+
* reason to press. That is a dead end on the first table anybody makes.
|
|
1332
|
+
*
|
|
1333
|
+
* So the page seeds one: every record, newest work first, as a grid. It is an
|
|
1334
|
+
* ordinary saved view record like any other — renamable, re-sortable,
|
|
1335
|
+
* deletable — not a hidden built-in mode, because a "special" default view is a
|
|
1336
|
+
* second kind of view that every feature after it has to know about.
|
|
1337
|
+
*/
|
|
1338
|
+
declare const DEFAULT_VIEW_NAME = "All records";
|
|
1339
|
+
declare function TablePage({ tableId, pageSize, seedViews, onLeave, leaveLabel, className, }: TablePageProps): react.JSX.Element;
|
|
1108
1340
|
|
|
1109
1341
|
/** One Field a person asked for, in the store's own behaviour words (FLD-1). */
|
|
1110
1342
|
interface NewFieldSpec {
|
|
@@ -1148,4 +1380,4 @@ declare function addFields(client: RecordsClient, tableId: Uuid$1, fields: NewFi
|
|
|
1148
1380
|
error: RecordsError;
|
|
1149
1381
|
}>;
|
|
1150
1382
|
|
|
1151
|
-
export { ACTION_KINDS, ACTION_TABLE, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_TABLE, COMMENT_TABLE, type CaptureMode, type CaptureQueuePort, CaptureSheet, type CaptureSheetProps, ChartBlock, type ChartBlockProps, type ChartKind, type ChartSpec, ChecklistRunner, type ChecklistRunnerProps, type ChecklistSpec, type ChecklistStepSpec, CommentThread, type CommentThreadProps, CustomFieldsSection, type CustomFieldsSectionProps, DASHBOARD_TABLE, DEFAULT_FIELDS, DashboardCanvas, type DashboardCanvasProps, type DashboardSpec, type DeclareResult, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FORM_FLOWS, FORM_TABLE, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldLabel, type FieldProposalRow, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormTheme, Grid, type GridProps, HistoryPanel, type HistoryPanelProps, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_LABEL, LAYOUT_NEEDS, NO_CHAT_REASON, NO_ENRICH_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PortalShell, type PortalShellProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type QueuedAction, type QueuedActionSpec, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, SignBlock, type SignBlockProps, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, type TableLane, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type UseSystemTableState, VIEW_LAYOUTS, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, actionDocument, addFields, bodyForReading, bodyFromKeys, columnForField, dashboardDocument, dashboardFromRecord, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldToken, fieldTypeLabel, formDocument, formFromRecord, groupLabel, isSignatureField, laneFor, personActor, recordsDataSource, renderValue, scalarText, storeDecidesRights, submissionStamp, tokenFor, useEmbedHandshake, useRecordsUi, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord };
|
|
1383
|
+
export { ACTION_KINDS, ACTION_TABLE, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_TABLE, COMMENT_TABLE, type CaptureMode, type CaptureQueuePort, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartKind, type ChartSpec, ChecklistRunner, type ChecklistRunnerProps, type ChecklistSpec, type ChecklistStepSpec, CommentThread, type CommentThreadProps, CustomFieldsSection, type CustomFieldsSectionProps, DASHBOARD_TABLE, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DashboardSpec, type DeclareResult, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FORM_FLOWS, FORM_TABLE, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldLabel, type FieldProposalRow, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormTheme, Grid, GridCell, type GridEditing, type GridProps, HistoryPanel, type HistoryPanelProps, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, NO_CHAT_REASON, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, PortalShell, type PortalShellProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type QueuedAction, type QueuedActionSpec, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, SignBlock, type SignBlockProps, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, type TableLane, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type UseSystemTableState, VIEW_LAYOUTS, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, actionDocument, addFields, bodyForReading, bodyFromKeys, columnForField, dashboardDocument, dashboardFromRecord, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeLabel, formDocument, formFromRecord, groupLabel, humanize, isSignatureField, laneFor, memberName, personActor, personRecordForMember, recordName, recordsDataSource, renderValue, rowName, scalarText, storeDecidesRights, submissionStamp, tableName, tokenFor, useEmbedHandshake, useGridEditing, useRecordsUi, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord, viewPatchDocument };
|