@ai-matrx/records-ui 0.9.0 → 0.16.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 +270 -0
- package/dist/index.cjs +2531 -1748
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +303 -104
- package/dist/index.d.ts +303 -104
- package/dist/index.js +2292 -1505
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,48 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { Uuid as Uuid$1,
|
|
3
|
+
import { PermissionLevel, Table, Uuid as Uuid$1, RecordsError, Field, RecordDocument, ReadRow, WriteConflict, ParityFieldType, NewFieldDeclaration, ValueEnvelope, WorkInboxKind, RuleExpression, AggregateBucket, AggregateMeasure, DocTemplateRow, DocRenderRow, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource } from '@ai-matrx/records';
|
|
4
4
|
import { Uuid, Field as Field$1, ReadRow as ReadRow$1 } from '@ai-matrx/records/react';
|
|
5
5
|
import { RecordsClient } from '@ai-matrx/records/core';
|
|
6
6
|
import { MatrxColumnDef } from '@ai-matrx/design-system/data-table/types';
|
|
7
7
|
|
|
8
|
+
/** The six things a person does to a record or a table, as the screens offer them. */
|
|
9
|
+
type Capability = "read" | "comment" | "write" | "remove" | "share" | "structure";
|
|
10
|
+
interface WhatYouMayDo {
|
|
11
|
+
/** The word the store answered, or null when it answered nothing. */
|
|
12
|
+
level: PermissionLevel | null;
|
|
13
|
+
/**
|
|
14
|
+
* Whether the store has ANSWERED yet. `false` is a third state and not a
|
|
15
|
+
* refusal: a screen that drew "you may not" while the answer was in flight
|
|
16
|
+
* would blink every control off on every reload, which is its own lie.
|
|
17
|
+
*/
|
|
18
|
+
known: boolean;
|
|
19
|
+
read: boolean;
|
|
20
|
+
comment: boolean;
|
|
21
|
+
write: boolean;
|
|
22
|
+
remove: boolean;
|
|
23
|
+
share: boolean;
|
|
24
|
+
structure: boolean;
|
|
25
|
+
/** Why this person may not do that, in one sentence naming the way in. */
|
|
26
|
+
why: (what: Capability) => string;
|
|
27
|
+
}
|
|
28
|
+
/** What each rung of the ladder is called where a person reads it. */
|
|
29
|
+
declare const LEVEL_WORD: Record<PermissionLevel, string>;
|
|
30
|
+
/**
|
|
31
|
+
* WHAT ONE LEVEL LETS A PERSON DO. `level` null and `known` true means the
|
|
32
|
+
* store said "nothing" — a real answer. `known` false means it has not said.
|
|
33
|
+
*/
|
|
34
|
+
declare function whatYouMayDo(level: PermissionLevel | null, known?: boolean): WhatYouMayDo;
|
|
35
|
+
/** Nothing offered, because nothing is known yet. */
|
|
36
|
+
declare const NOT_ANSWERED_YET: WhatYouMayDo;
|
|
37
|
+
/**
|
|
38
|
+
* REC-27. The nine Tables the platform ships are not administered from a
|
|
39
|
+
* person's screen whatever level they hold on them — so the structure controls
|
|
40
|
+
* are absent for a kernel Table and say why, and everything else follows the
|
|
41
|
+
* level as usual.
|
|
42
|
+
*/
|
|
43
|
+
declare const KERNEL_REASON: string;
|
|
44
|
+
declare function whatYouMayDoWithTable(table: Table | null | undefined, level: PermissionLevel | null, known: boolean): WhatYouMayDo;
|
|
45
|
+
|
|
8
46
|
/** One named piece of grounding, shaped the way the platform's context slice takes them. */
|
|
9
47
|
interface RecordChatEntry {
|
|
10
48
|
key: string;
|
|
@@ -70,21 +108,37 @@ interface EnrichPanelProps {
|
|
|
70
108
|
}
|
|
71
109
|
declare function EnrichPanel({ tableId, recordId, className }: EnrichPanelProps): react.JSX.Element;
|
|
72
110
|
|
|
73
|
-
/**
|
|
74
|
-
|
|
111
|
+
/**
|
|
112
|
+
* What a person may do to one table. The four words and the ladder are the
|
|
113
|
+
* store's (`rights.ts`), not ours.
|
|
114
|
+
*
|
|
115
|
+
* `admin`, `comment` and `write` are kept with the names they have always had,
|
|
116
|
+
* because every screen in this package and in the host apps reads them; they
|
|
117
|
+
* are now the store's ANSWER rather than a host's guess.
|
|
118
|
+
*/
|
|
119
|
+
interface TableRights extends WhatYouMayDo {
|
|
75
120
|
/** SCR-2: holders of `admin` on the table see the "+" and the settings panel. */
|
|
76
121
|
admin: boolean;
|
|
77
|
-
/** SCR-18: `commenter` and no higher right. */
|
|
78
|
-
comment: boolean;
|
|
79
|
-
/** May write records at all. */
|
|
80
|
-
write: boolean;
|
|
81
122
|
/**
|
|
82
|
-
* Why this answer, in
|
|
83
|
-
* is
|
|
123
|
+
* Why this answer, in one sentence. Kept for callers that show a single
|
|
124
|
+
* reason; `why(what)` is the per-control sentence and is what the screens use.
|
|
84
125
|
*/
|
|
85
126
|
reason: string;
|
|
86
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* Kept so a host that imported it still compiles. It is no longer any screen's
|
|
130
|
+
* default: the store answers this question now, and a package that said "I
|
|
131
|
+
* assume nothing" while holding the answer would be hiding controls from the
|
|
132
|
+
* people who hold them.
|
|
133
|
+
*/
|
|
87
134
|
declare const NO_RIGHTS: TableRights;
|
|
135
|
+
/**
|
|
136
|
+
* THE ONE WAY TO BUILD A `TableRights` BY HAND — for a host with its own
|
|
137
|
+
* authority, and for a suite that wants to mount one seat's screen. It takes
|
|
138
|
+
* the LEVEL, never six booleans, so nobody can hand a screen a combination the
|
|
139
|
+
* ladder cannot produce (write without read, share without edit).
|
|
140
|
+
*/
|
|
141
|
+
declare function tableRightsAt(level: PermissionLevel | null): TableRights;
|
|
88
142
|
interface RecordsUiHost {
|
|
89
143
|
/** Answer the rights question for one table. Synchronous: a screen renders now. */
|
|
90
144
|
rights?: (table: Table) => TableRights;
|
|
@@ -122,6 +176,14 @@ interface RecordsUiHost {
|
|
|
122
176
|
ok: false;
|
|
123
177
|
reason: string;
|
|
124
178
|
}>;
|
|
179
|
+
/**
|
|
180
|
+
* Where this app serves its PUBLIC pages from, when that is not the origin
|
|
181
|
+
* the screen is running on. A form's link is built here, so an owner copying
|
|
182
|
+
* it from an admin host, a preview deployment or a desktop shell gets the
|
|
183
|
+
* address a stranger can actually open — never `http://localhost:3000/f/…`
|
|
184
|
+
* pasted into an email. Unbound, the browser's own origin is used.
|
|
185
|
+
*/
|
|
186
|
+
publicOrigin?: string;
|
|
125
187
|
/**
|
|
126
188
|
* OPTIONAL. The organization's saved views as `platform.saved_view` holds
|
|
127
189
|
* them — which is what a subscription points at (DOOR-18). The record store
|
|
@@ -267,8 +329,81 @@ declare function RecordsUiProvider({ value, children }: {
|
|
|
267
329
|
children: ReactNode;
|
|
268
330
|
}): react.JSX.Element;
|
|
269
331
|
declare function useRecordsUi(): RecordsUiHost;
|
|
270
|
-
/**
|
|
332
|
+
/**
|
|
333
|
+
* WHAT THIS PERSON MAY DO TO THIS TABLE — asked, once per table.
|
|
334
|
+
*
|
|
335
|
+
* A host that binds `rights` still wins: a portal, an embed or an app with its
|
|
336
|
+
* own authority is entitled to a narrower answer than the store's. An unbound
|
|
337
|
+
* host no longer gets a guess in either direction — while the door is
|
|
338
|
+
* answering, `known` is false and NOTHING is offered and nothing is claimed.
|
|
339
|
+
*/
|
|
271
340
|
declare function useTableRights(table: Table | null | undefined): TableRights;
|
|
341
|
+
/**
|
|
342
|
+
* WHAT THIS PERSON MAY DO TO ONE RECORD — which is a different question from
|
|
343
|
+
* the table's, and the sixth-pass verdict is the proof: a record shared with a
|
|
344
|
+
* colleague at Editor inside a table she holds at Viewer. The grid used to
|
|
345
|
+
* label that row "viewer" while the store let her write to it.
|
|
346
|
+
*/
|
|
347
|
+
declare function useRecordRights(recordId: Uuid$1 | null): WhatYouMayDo;
|
|
348
|
+
/**
|
|
349
|
+
* The same question for a whole page of records, in ONE call — the door takes a
|
|
350
|
+
* list precisely so a grid never makes one call per row.
|
|
351
|
+
*
|
|
352
|
+
* `enabled` is how a grid avoids asking at all in the ordinary case: when the
|
|
353
|
+
* table level already admits editing, every row it returned is editable and
|
|
354
|
+
* there is nothing a per-record answer could add.
|
|
355
|
+
*/
|
|
356
|
+
declare function useRowRights(rowIds: Uuid$1[], enabled: boolean): (rowId: Uuid$1) => WhatYouMayDo | null;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* MACHINE IDENTITY, BY SHAPE — never by a list of the sentences we happen to
|
|
360
|
+
* have seen, because the next refusal is one nobody has read yet.
|
|
361
|
+
*
|
|
362
|
+
* `FLD-11:` / `REC-29:` / `AGT-7:` a contract row id
|
|
363
|
+
* `custom.field_declare` a schema-qualified database object
|
|
364
|
+
* `config.via` / `data.fields` a path inside a stored document
|
|
365
|
+
* `retention_days` a document key, snake_case
|
|
366
|
+
* `8f2c1b0a-…` a uuid
|
|
367
|
+
* `23514` / `PT409` a SQLSTATE
|
|
368
|
+
*/
|
|
369
|
+
declare const MACHINE_IDENTITY: RegExp[];
|
|
370
|
+
/** Whether any shape above appears in this text. */
|
|
371
|
+
declare function isMachineIdentity(text: string): boolean;
|
|
372
|
+
/**
|
|
373
|
+
* Every fragment of `text` that a person should never have been shown. Used by
|
|
374
|
+
* the suite to say WHAT it found rather than only that it found something.
|
|
375
|
+
*/
|
|
376
|
+
declare function machineIdentityIn(text: string): string[];
|
|
377
|
+
/** The one shape every screen in this package renders a refusal from. */
|
|
378
|
+
interface PlainRefusal {
|
|
379
|
+
/** The heading. Never the store's code. */
|
|
380
|
+
title: string;
|
|
381
|
+
/**
|
|
382
|
+
* What happened, in the store's own words where they are a person's words
|
|
383
|
+
* and in ours where they are not. Never empty.
|
|
384
|
+
*/
|
|
385
|
+
sentence: string;
|
|
386
|
+
/** What to do now. Never empty. */
|
|
387
|
+
remedy: string;
|
|
388
|
+
/**
|
|
389
|
+
* Everything a person should not read, kept for whoever has to debug it: the
|
|
390
|
+
* SQLSTATE, the hint written for a caller, and any clause dropped above.
|
|
391
|
+
* Rendered out of sight (the notice's `title` attribute and a screen-reader-
|
|
392
|
+
* only line), never deleted.
|
|
393
|
+
*/
|
|
394
|
+
forEngineers: string;
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* THE FORMATTER. Every refusal a screen in this package shows goes through
|
|
398
|
+
* here, and nothing in this package renders `error.message` directly.
|
|
399
|
+
*/
|
|
400
|
+
declare function refusalForAPerson(error: RecordsError): PlainRefusal;
|
|
401
|
+
/**
|
|
402
|
+
* The same answer as one line, for a cell or a field where a block would break
|
|
403
|
+
* the layout. Still one sentence and one remedy — never the sentence alone,
|
|
404
|
+
* because half of this formatter's job is the thing to do next.
|
|
405
|
+
*/
|
|
406
|
+
declare function refusalLineForAPerson(error: RecordsError): string;
|
|
272
407
|
|
|
273
408
|
/**
|
|
274
409
|
* A token (`records_ui_view`, `long_text`, `v78_widget2`) as a person would
|
|
@@ -347,12 +482,21 @@ interface GridEditing {
|
|
|
347
482
|
/** The value to DRAW for one cell — the optimistic one when there is one. */
|
|
348
483
|
valueFor: (row: ReadRow, field: Field) => unknown;
|
|
349
484
|
editing: CellAddress | null;
|
|
485
|
+
/** What has been typed into the open cell. Owned here, never by the cell. */
|
|
486
|
+
draft: unknown;
|
|
487
|
+
/** The open cell's editor reports every keystroke to the session. */
|
|
488
|
+
type: (value: unknown) => void;
|
|
350
489
|
stateOf: (rowId: Uuid$1, key: string) => CellState;
|
|
351
490
|
refusalOf: (rowId: Uuid$1, key: string) => CellRefusal | null;
|
|
352
491
|
begin: (address: CellAddress) => void;
|
|
353
492
|
cancel: () => void;
|
|
354
|
-
/**
|
|
355
|
-
|
|
493
|
+
/**
|
|
494
|
+
* Commit the open cell — whatever is in `draft`. `move` opens the
|
|
495
|
+
* next/previous editable cell after it. It takes NO value: a caller that
|
|
496
|
+
* passed one would be a second copy of the typed value, which is the defect
|
|
497
|
+
* this file's header describes.
|
|
498
|
+
*/
|
|
499
|
+
commit: (move?: "next" | "previous" | null) => void;
|
|
356
500
|
/** Write the attempted value again, after re-reading the version. */
|
|
357
501
|
retry: (rowId: Uuid$1, key: string) => void;
|
|
358
502
|
/** Drop the edit and show what the other person wrote. */
|
|
@@ -374,8 +518,19 @@ interface Options {
|
|
|
374
518
|
reload: () => void;
|
|
375
519
|
/** May this person write records at all? A read-only grid opens no editor. */
|
|
376
520
|
canWrite: boolean;
|
|
521
|
+
/**
|
|
522
|
+
* MAY THIS PERSON WRITE *THIS* ROW — asked before an editor is opened, never
|
|
523
|
+
* after it has been typed into.
|
|
524
|
+
*
|
|
525
|
+
* A level on the TABLE is not the answer for a row: the sixth-pass verdict
|
|
526
|
+
* found a record shared with a colleague at Editor inside a table she held at
|
|
527
|
+
* Viewer, and the grid labelled the row "viewer" while the store let her
|
|
528
|
+
* write to it. Unbound, every row follows the table, which is what the
|
|
529
|
+
* ordinary case is.
|
|
530
|
+
*/
|
|
531
|
+
mayWriteRow?: ((rowId: Uuid$1) => boolean) | undefined;
|
|
377
532
|
}
|
|
378
|
-
declare function useGridEditing({ tableId, fields, rows, reload, canWrite }: Options): GridEditing;
|
|
533
|
+
declare function useGridEditing({ tableId, fields, rows, reload, canWrite, mayWriteRow }: Options): GridEditing;
|
|
379
534
|
/**
|
|
380
535
|
* ONE CELL. Read, until somebody asks to change it; then the Field's own
|
|
381
536
|
* editor, in place, with the keys a person expects from a grid.
|
|
@@ -383,13 +538,27 @@ declare function useGridEditing({ tableId, fields, rows, reload, canWrite }: Opt
|
|
|
383
538
|
* `data-matrx-cell-control` is the data table's own opt-out from whole-row
|
|
384
539
|
* click, so opening a cell never also opens the record panel behind it.
|
|
385
540
|
*/
|
|
386
|
-
declare function GridCell({ field, row, editing, canWrite, }: {
|
|
541
|
+
declare function GridCell({ field, row, editing, canWrite, whyNot, }: {
|
|
387
542
|
field: Field;
|
|
388
543
|
row: ReadRow;
|
|
389
544
|
editing: GridEditing;
|
|
545
|
+
/** Whether this person may write THIS row. Asked before the cell is drawn. */
|
|
390
546
|
canWrite: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Why not, when not — one sentence naming the level it would take and who can
|
|
549
|
+
* give it. A cell that is simply not a control, with nothing to say about it,
|
|
550
|
+
* is the silent half of the same defect this file closes.
|
|
551
|
+
*/
|
|
552
|
+
whyNot?: string | undefined;
|
|
391
553
|
}): react.JSX.Element;
|
|
392
554
|
|
|
555
|
+
/**
|
|
556
|
+
* Kept for callers outside this package that already ask the question. The
|
|
557
|
+
* answer is `plainWords.ts`'s, so there is one shape list and not two.
|
|
558
|
+
*/
|
|
559
|
+
declare function hintIsMachineIdentity(hint: string): boolean;
|
|
560
|
+
/** The hint a PERSON should read, or null when it is written for an engineer. */
|
|
561
|
+
declare function hintForAPerson(hint: string | null | undefined): string | null;
|
|
393
562
|
declare function RefusalNotice({ error, className, actions, }: {
|
|
394
563
|
error: RecordsError;
|
|
395
564
|
className?: string | undefined;
|
|
@@ -427,7 +596,7 @@ declare function Grid({ tableId, pageSize, onOpenRecord, onAddField, onNewRecord
|
|
|
427
596
|
* key (`names.ts`) — and the cell is the value, rendered by its parity type and
|
|
428
597
|
* editable in place when an editing session is passed.
|
|
429
598
|
*/
|
|
430
|
-
declare function columnForField(field: Field$1, editing?: GridEditing | null): MatrxColumnDef<ReadRow$1>;
|
|
599
|
+
declare function columnForField(field: Field$1, editing?: GridEditing | null, mayWriteRow?: (rowId: Uuid) => boolean, whyNotRow?: (rowId: Uuid) => string): MatrxColumnDef<ReadRow$1>;
|
|
431
600
|
|
|
432
601
|
interface ExportMenuProps {
|
|
433
602
|
tableId: Uuid;
|
|
@@ -449,24 +618,42 @@ interface ImportWizardProps {
|
|
|
449
618
|
declare function ImportWizard({ tableId, onProposeField, onDone, className }: ImportWizardProps): react.JSX.Element;
|
|
450
619
|
|
|
451
620
|
interface CustomFieldsSectionProps {
|
|
452
|
-
/**
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
* page is showing is the page's own fact.
|
|
456
|
-
*
|
|
457
|
-
* A page that knows the entity's TOKEN rather than its id passes `entityToken`
|
|
458
|
-
* instead, and this section resolves it: an entity page must not have to run
|
|
459
|
-
* a lookup of its own to add one line.
|
|
460
|
-
*/
|
|
461
|
-
tableId?: Uuid | undefined;
|
|
462
|
-
/** The entity's registered token (REC-33), e.g. `party`. Resolved to its Table. */
|
|
463
|
-
entityToken?: string | undefined;
|
|
621
|
+
/** The standard table's registered token (REC-33), e.g. `party`, `crm_deal`. */
|
|
622
|
+
entityToken: string;
|
|
623
|
+
/** The id of the row this page is showing. */
|
|
464
624
|
recordId: Uuid;
|
|
465
625
|
/** The heading. One row, no subtitle restating it. */
|
|
466
626
|
title?: string | undefined;
|
|
467
627
|
className?: string | undefined;
|
|
468
628
|
}
|
|
469
|
-
declare function CustomFieldsSection({
|
|
629
|
+
declare function CustomFieldsSection({ entityToken, recordId, title, className, }: CustomFieldsSectionProps): react.JSX.Element | null;
|
|
630
|
+
|
|
631
|
+
/** The three behaviours that carry no parity type of their own. */
|
|
632
|
+
type PlainFieldType = "text" | "long_text" | "number";
|
|
633
|
+
/** What a person picks in the panel: one of the thirteen, or one of the three. */
|
|
634
|
+
type PickableFieldType = ParityFieldType | PlainFieldType;
|
|
635
|
+
interface FieldTypeChoice {
|
|
636
|
+
id: PickableFieldType;
|
|
637
|
+
/** The word on the menu. */
|
|
638
|
+
label: string;
|
|
639
|
+
/** One line, under the word, saying what it is FOR. Never what it is made of. */
|
|
640
|
+
explanation: string;
|
|
641
|
+
/** The heading it sits under, so sixteen choices read as four short lists. */
|
|
642
|
+
group: "Words" | "Numbers and dates" | "Choices and people" | "Worked out";
|
|
643
|
+
}
|
|
644
|
+
declare const FIELD_TYPE_CHOICES: FieldTypeChoice[];
|
|
645
|
+
declare const FIELD_TYPE_GROUPS: FieldTypeChoice["group"][];
|
|
646
|
+
declare function fieldTypeChoice(id: string): FieldTypeChoice | undefined;
|
|
647
|
+
/** The three that are a plain behaviour rather than one of the thirteen. */
|
|
648
|
+
declare function isPlainFieldType(id: string): id is PlainFieldType;
|
|
649
|
+
/**
|
|
650
|
+
* THE GUARD THIS FILE NEEDS, because the list it explains is generated.
|
|
651
|
+
*
|
|
652
|
+
* Returns the parity types the store ships that nothing here explains. The
|
|
653
|
+
* suite asserts it is empty; a fourteenth type would otherwise reach the menu
|
|
654
|
+
* with a blank line under it and nobody would notice until a person did.
|
|
655
|
+
*/
|
|
656
|
+
declare function parityTypesWithNoExplanation(): string[];
|
|
470
657
|
|
|
471
658
|
/** `Day rate` → `day_rate`. Shown, so nothing about it is a surprise. */
|
|
472
659
|
declare function keyFor(label: string): string;
|
|
@@ -481,6 +668,29 @@ interface FieldEditorProps {
|
|
|
481
668
|
className?: string | undefined;
|
|
482
669
|
}
|
|
483
670
|
declare function FieldEditor({ tableId, field, onSaved, onCancel, onRemoved, className }: FieldEditorProps): react.JSX.Element;
|
|
671
|
+
/**
|
|
672
|
+
* WHAT THE PANEL STILL NEEDS BEFORE THE STORE WOULD TAKE THIS, in plain words.
|
|
673
|
+
*
|
|
674
|
+
* It answers exactly the questions this panel asked, so every sentence names a
|
|
675
|
+
* control the person is looking at. It is NOT a second copy of the store's
|
|
676
|
+
* rules and it is not allowed to become one: the store decides, and every one
|
|
677
|
+
* of these is something the panel can see is unanswered without asking it.
|
|
678
|
+
*
|
|
679
|
+
* Exported so the suite can assert the sentences without driving the whole
|
|
680
|
+
* panel, and so the red twin can assert that removing it puts the contract row
|
|
681
|
+
* id back in front of a person.
|
|
682
|
+
*/
|
|
683
|
+
declare function whatIsMissing(state: {
|
|
684
|
+
type: PickableFieldType;
|
|
685
|
+
label: string;
|
|
686
|
+
options: string[];
|
|
687
|
+
via: string;
|
|
688
|
+
pick: string;
|
|
689
|
+
agg: NonNullable<NewFieldDeclaration["agg"]>;
|
|
690
|
+
of: string;
|
|
691
|
+
relations: Field[];
|
|
692
|
+
formulaFields: string[];
|
|
693
|
+
}): string | null;
|
|
484
694
|
|
|
485
695
|
interface FieldProposalRow {
|
|
486
696
|
id: string;
|
|
@@ -635,33 +845,6 @@ declare function editorKindFor(field: Field): EditorKind;
|
|
|
635
845
|
*/
|
|
636
846
|
declare function fieldTypeLabel(field: Field): string;
|
|
637
847
|
|
|
638
|
-
/** The three behaviours that carry no parity type of their own. */
|
|
639
|
-
type PlainFieldType = "text" | "long_text" | "number";
|
|
640
|
-
/** What a person picks in the panel: one of the thirteen, or one of the three. */
|
|
641
|
-
type PickableFieldType = ParityFieldType | PlainFieldType;
|
|
642
|
-
interface FieldTypeChoice {
|
|
643
|
-
id: PickableFieldType;
|
|
644
|
-
/** The word on the menu. */
|
|
645
|
-
label: string;
|
|
646
|
-
/** One line, under the word, saying what it is FOR. Never what it is made of. */
|
|
647
|
-
explanation: string;
|
|
648
|
-
/** The heading it sits under, so sixteen choices read as four short lists. */
|
|
649
|
-
group: "Words" | "Numbers and dates" | "Choices and people" | "Worked out";
|
|
650
|
-
}
|
|
651
|
-
declare const FIELD_TYPE_CHOICES: FieldTypeChoice[];
|
|
652
|
-
declare const FIELD_TYPE_GROUPS: FieldTypeChoice["group"][];
|
|
653
|
-
declare function fieldTypeChoice(id: string): FieldTypeChoice | undefined;
|
|
654
|
-
/** The three that are a plain behaviour rather than one of the thirteen. */
|
|
655
|
-
declare function isPlainFieldType(id: string): id is PlainFieldType;
|
|
656
|
-
/**
|
|
657
|
-
* THE GUARD THIS FILE NEEDS, because the list it explains is generated.
|
|
658
|
-
*
|
|
659
|
-
* Returns the parity types the store ships that nothing here explains. The
|
|
660
|
-
* suite asserts it is empty; a fourteenth type would otherwise reach the menu
|
|
661
|
-
* with a blank line under it and nobody would notice until a person did.
|
|
662
|
-
*/
|
|
663
|
-
declare function parityTypesWithNoExplanation(): string[];
|
|
664
|
-
|
|
665
848
|
/** One Field of a package-owned Table, in the store's own words. */
|
|
666
849
|
interface SystemFieldSpec {
|
|
667
850
|
key: string;
|
|
@@ -902,54 +1085,22 @@ interface ProposalRowProps {
|
|
|
902
1085
|
}
|
|
903
1086
|
declare function ProposalRow({ change, outcome, onApply, onReject, readOnlyReason, onSettled, className, }: ProposalRowProps): react.JSX.Element;
|
|
904
1087
|
|
|
905
|
-
/** The three things that land in the queue
|
|
1088
|
+
/** The three things that land in the queue, exactly as the door names them. */
|
|
906
1089
|
declare const ACTION_KINDS: readonly ["approval", "assignment", "proposal"];
|
|
907
|
-
type ActionKind =
|
|
908
|
-
|
|
909
|
-
declare const ACTION_TABLE: SystemTableSpec;
|
|
910
|
-
/**
|
|
911
|
-
* THE DECLARATIVE SPEC an agent writes. One `record_write` of this document puts
|
|
912
|
-
* a decision in front of a person — there is no per-feature approval plumbing
|
|
913
|
-
* anywhere in the platform.
|
|
914
|
-
*/
|
|
915
|
-
interface QueuedActionSpec {
|
|
916
|
-
kind: ActionKind;
|
|
917
|
-
title: string;
|
|
918
|
-
why?: string | undefined;
|
|
919
|
-
assignee?: Uuid | null | undefined;
|
|
920
|
-
subjectTable?: Uuid | null | undefined;
|
|
921
|
-
subject?: Uuid | null | undefined;
|
|
922
|
-
/** For a proposal: the exact acts being asked for. */
|
|
923
|
-
changes?: ProposedChange[] | undefined;
|
|
924
|
-
}
|
|
925
|
-
interface QueuedAction extends QueuedActionSpec {
|
|
926
|
-
id: Uuid;
|
|
1090
|
+
type ActionKind = WorkInboxKind;
|
|
1091
|
+
interface ActionInboxProps {
|
|
927
1092
|
/**
|
|
928
|
-
*
|
|
929
|
-
*
|
|
930
|
-
*
|
|
931
|
-
* settler then sees.
|
|
1093
|
+
* Narrow to one table's work. The door answers the organization; this filters
|
|
1094
|
+
* the assignments to the table a person is looking at, and leaves approvals
|
|
1095
|
+
* and proposals alone because those are about a change, not about a table.
|
|
932
1096
|
*/
|
|
933
|
-
version: number | null;
|
|
934
|
-
status: "open" | "accepted" | "rejected" | "refused";
|
|
935
|
-
answer: string | null;
|
|
936
|
-
at: string;
|
|
937
|
-
}
|
|
938
|
-
declare function actionDocument(spec: QueuedActionSpec): Record<string, unknown>;
|
|
939
|
-
interface ActionInboxProps {
|
|
940
|
-
/** Narrow the queue to one table's actions. Left out, it is everything waiting. */
|
|
941
1097
|
tableId?: Uuid | null | undefined;
|
|
942
|
-
/** Show
|
|
1098
|
+
/** Show decided rows too. The default is what is still waiting. */
|
|
943
1099
|
includeSettled?: boolean | undefined;
|
|
944
|
-
/**
|
|
945
|
-
* COMPLETE DECLARATIVE SPECS an agent wrote. Any of these the queue does not
|
|
946
|
-
* already hold (by title) is filed as a record on first load.
|
|
947
|
-
*/
|
|
948
|
-
seed?: QueuedActionSpec[] | undefined;
|
|
949
1100
|
onOpenRecord?: ((recordId: Uuid, tableId: Uuid) => void) | undefined;
|
|
950
1101
|
className?: string | undefined;
|
|
951
1102
|
}
|
|
952
|
-
declare function ActionInbox({ tableId, includeSettled,
|
|
1103
|
+
declare function ActionInbox({ tableId, includeSettled, onOpenRecord, className }: ActionInboxProps): react.JSX.Element;
|
|
953
1104
|
|
|
954
1105
|
interface HistoryPanelProps {
|
|
955
1106
|
tableId: Uuid;
|
|
@@ -1214,15 +1365,48 @@ interface DashboardCanvasProps {
|
|
|
1214
1365
|
}
|
|
1215
1366
|
declare function DashboardCanvas({ tableId, seed, activeDashboardId, className }: DashboardCanvasProps): react.JSX.Element;
|
|
1216
1367
|
|
|
1368
|
+
interface FormsPanelProps {
|
|
1369
|
+
tableId: Uuid;
|
|
1370
|
+
className?: string | undefined;
|
|
1371
|
+
}
|
|
1372
|
+
declare function FormsPanel({ tableId, className }: FormsPanelProps): react.JSX.Element;
|
|
1373
|
+
|
|
1374
|
+
/** What the public arm's `onSubmit` answers. A refusal carries the door's words. */
|
|
1375
|
+
type FormSubmitOutcome = {
|
|
1376
|
+
ok: true;
|
|
1377
|
+
message?: string | null;
|
|
1378
|
+
recordId?: Uuid | null;
|
|
1379
|
+
} | {
|
|
1380
|
+
ok: false;
|
|
1381
|
+
message: string;
|
|
1382
|
+
};
|
|
1217
1383
|
interface FormRunnerProps {
|
|
1218
1384
|
/** The complete spec. An agent wrote it; `FormBuilder` saved it; this runs it. */
|
|
1219
1385
|
form: FormSpec | SavedForm;
|
|
1386
|
+
/**
|
|
1387
|
+
* PUBLIC ARM — the subject Table's Fields, already resolved by the server
|
|
1388
|
+
* through `custom.form_public`. Given together with `onSubmit`, this component
|
|
1389
|
+
* mounts no store client at all and the browser never touches the store.
|
|
1390
|
+
*/
|
|
1391
|
+
fields?: readonly Field[] | undefined;
|
|
1392
|
+
/** PUBLIC ARM — where an answer goes. Server action or route handler. */
|
|
1393
|
+
onSubmit?: ((values: Record<string, unknown>) => Promise<FormSubmitOutcome>) | undefined;
|
|
1394
|
+
/**
|
|
1395
|
+
* PUBLIC ARM — the name of a decoy input. A person never fills it; a script
|
|
1396
|
+
* fills everything. The door decides what a filled one means, not this screen.
|
|
1397
|
+
*/
|
|
1398
|
+
honeypotKey?: string | null | undefined;
|
|
1220
1399
|
/** Preview mode answers the questions but writes nothing, and says so. */
|
|
1221
1400
|
preview?: boolean | undefined;
|
|
1222
|
-
onSubmitted?: ((recordId: Uuid) => void) | undefined;
|
|
1401
|
+
onSubmitted?: ((recordId: Uuid | null) => void) | undefined;
|
|
1223
1402
|
className?: string | undefined;
|
|
1224
1403
|
}
|
|
1225
|
-
|
|
1404
|
+
/**
|
|
1405
|
+
* THE ONE ENTRY POINT. It picks the arm and nothing else: a caller that brought
|
|
1406
|
+
* the Fields and a place to send the answers gets the stage on its own, and
|
|
1407
|
+
* everybody else gets the connected half, which reads both from the store.
|
|
1408
|
+
*/
|
|
1409
|
+
declare function FormRunner(props: FormRunnerProps): react.JSX.Element;
|
|
1226
1410
|
|
|
1227
1411
|
/** THE COMPLETE DECLARATIVE SPEC — one object, one `record_write`, a whole checklist. */
|
|
1228
1412
|
interface ChecklistSpec {
|
|
@@ -1272,7 +1456,8 @@ interface BookingSlotsProps {
|
|
|
1272
1456
|
};
|
|
1273
1457
|
/** How long a hold lasts before the store lets the slot go. Default 15 minutes. */
|
|
1274
1458
|
holdFor?: string;
|
|
1275
|
-
|
|
1459
|
+
/** `null` when the answer was HELD rather than written — see the runner's own note. */
|
|
1460
|
+
onBooked?: ((recordId: Uuid | null) => void) | undefined;
|
|
1276
1461
|
className?: string | undefined;
|
|
1277
1462
|
}
|
|
1278
1463
|
declare function BookingSlots({ tableId, form, availability, holdFor, onBooked, className, }: BookingSlotsProps): react.JSX.Element;
|
|
@@ -1347,12 +1532,18 @@ declare function useEmbedHandshake(args: {
|
|
|
1347
1532
|
};
|
|
1348
1533
|
|
|
1349
1534
|
declare const STORE_DECIDES_REASON: string;
|
|
1350
|
-
|
|
1535
|
+
|
|
1351
1536
|
/**
|
|
1352
|
-
*
|
|
1353
|
-
*
|
|
1537
|
+
* DEPRECATED, and kept only so a host that imported it still compiles.
|
|
1538
|
+
*
|
|
1539
|
+
* It used to answer yes to everything for every non-kernel table. It cannot
|
|
1540
|
+
* answer honestly at all, because the honest answer needs a door call and this
|
|
1541
|
+
* signature is synchronous — which is exactly why the guess was here. Binding
|
|
1542
|
+
* it now would be binding a port that OVERRIDES the store's real answer, so it
|
|
1543
|
+
* returns the not-yet-answered set and every caller should simply stop passing
|
|
1544
|
+
* a `rights` port: unbound is the honest path (`useTableRights`).
|
|
1354
1545
|
*/
|
|
1355
|
-
declare function storeDecidesRights(
|
|
1546
|
+
declare function storeDecidesRights(_table: Table): TableRights;
|
|
1356
1547
|
interface RecordsMountProps {
|
|
1357
1548
|
/** The store config: the host's session-carrying client, the actor, the organization. */
|
|
1358
1549
|
config: RecordsConfig;
|
|
@@ -1541,6 +1732,14 @@ interface ShareControlProps {
|
|
|
1541
1732
|
subjectId: Uuid$1;
|
|
1542
1733
|
/** What to call it in the dialog's title. */
|
|
1543
1734
|
name?: string | undefined;
|
|
1735
|
+
/**
|
|
1736
|
+
* Whether this person may pass this on — `custom.share_grant` asks for Admin
|
|
1737
|
+
* ON THE THING. A caller that already holds the answer (a table screen has
|
|
1738
|
+
* the table's rights in its hand) passes it; left out, this asks the store
|
|
1739
|
+
* itself for the subject named above. Either way it is an ANSWER and never an
|
|
1740
|
+
* assumption, which is the whole of this lane.
|
|
1741
|
+
*/
|
|
1742
|
+
may?: boolean | undefined;
|
|
1544
1743
|
size?: "sm" | "default" | undefined;
|
|
1545
1744
|
variant?: "ghost" | "outline" | "default" | undefined;
|
|
1546
1745
|
className?: string | undefined;
|
|
@@ -1549,6 +1748,6 @@ interface ShareControlProps {
|
|
|
1549
1748
|
declare function useCanShare(): boolean;
|
|
1550
1749
|
/** Why there is no Share button here, for anything that asks. */
|
|
1551
1750
|
declare function shareUnavailableReason(): string;
|
|
1552
|
-
declare function ShareControl({ kind, organizationId, subjectId, name, size, variant, className, }: ShareControlProps): ReactNode;
|
|
1751
|
+
declare function ShareControl({ kind, organizationId, subjectId, name, may, size, variant, className, }: ShareControlProps): ReactNode;
|
|
1553
1752
|
|
|
1554
|
-
export { ACTION_KINDS,
|
|
1753
|
+
export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_TABLE, COMMENT_TABLE, type Capability, 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, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FORM_TABLE, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormTheme, FormsPanel, type FormsPanelProps, 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, LEVEL_WORD, type LabelLookup, MACHINE_IDENTITY, NOT_ANSWERED_YET, NO_CHAT_REASON, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_SHARE_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, type PickableFieldType, type PlainFieldType, type PlainRefusal, PortalShell, type PortalShellProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, 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 TrackedVersion, type UseSystemTableState, VIEW_LAYOUTS, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, addFields, bodyForReading, bodyFromKeys, columnForField, dashboardDocument, dashboardFromRecord, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDocument, formFromRecord, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isSignatureField, keyFor, laneFor, machineIdentityIn, memberName, parityTypesWithNoExplanation, personActor, personRecordForMember, pointsAtRecords, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, rowName, scalarText, shareUnavailableReason, storeDecidesRights, submissionStamp, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useGridEditing, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable };
|