@ai-matrx/records-ui 0.40.0 → 0.41.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, ComponentType, RefObject } from 'react';
3
3
  import * as _ai_matrx_records from '@ai-matrx/records';
4
- import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Uuid as Uuid$1, AggregateFilter, Field, RecordDocument, ReadRow, WriteConflict, ParityFieldType, NewFieldDeclaration, ValueEnvelope, WorkInboxKind, RuleExpression, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, FieldTypeWord } from '@ai-matrx/records';
4
+ import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Uuid as Uuid$1, AggregateFilter, Field, RecordDocument, ReadRow, WriteConflict, ParityFieldType, NewFieldDeclaration, ValueEnvelope, WorkInboxKind, RuleExpression, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, FieldTypeWord } from '@ai-matrx/records';
5
5
  import { Uuid, Field as Field$1, ReadRow as ReadRow$1 } from '@ai-matrx/records/react';
6
6
  import { RecordsClient } from '@ai-matrx/records/core';
7
7
  import { FieldFormatConfig } from '@ai-matrx/design-system/field-formats';
@@ -2023,59 +2023,98 @@ interface FormRunnerProps {
2023
2023
  */
2024
2024
  declare function FormRunner(props: FormRunnerProps): react.JSX.Element;
2025
2025
 
2026
- /** THE COMPLETE DECLARATIVE SPEC — one object, one `record_write`, a whole checklist. */
2027
- interface ChecklistSpec {
2028
- name: string;
2029
- /** The Table the steps become records in. */
2030
- subject: Uuid;
2031
- steps: ChecklistStepSpec[];
2032
- }
2033
- interface ChecklistStepSpec {
2034
- /** The document this step's record starts life with. `title` is what a person reads. */
2035
- title: string;
2036
- /** Anything else the subject Table's Fields take. */
2037
- data?: Record<string, unknown>;
2026
+ interface ChecklistRunnerProps {
2027
+ /** The Table runs are ABOUT. On a record page, the record's own table. */
2028
+ tableId?: Uuid | null | undefined;
2029
+ /** Runs about THIS record a new hire, a matter, a job. */
2030
+ recordId?: Uuid | null | undefined;
2031
+ /** One run, named outright. Overrides the two above. */
2032
+ runId?: Uuid | null | undefined;
2033
+ /** Show runs that have been closed too. The default is what is still open. */
2034
+ includeClosed?: boolean | undefined;
2035
+ /** Offer the templates that could be started here. On by default with a record. */
2036
+ offerToStart?: boolean | undefined;
2037
+ className?: string | undefined;
2038
2038
  }
2039
+ declare function ChecklistRunner({ tableId, recordId, runId, includeClosed, offerToStart, className, }: ChecklistRunnerProps): react.JSX.Element;
2039
2040
  /**
2040
- * The package-owned Table a checklist RUN is recorded in. The steps are records
2041
- * in the subject Table — this holds only which template was instantiated and
2042
- * when, so re-opening a checklist finds the same steps rather than making new
2043
- * ones. (Running the same checklist twice on purpose is two rows here, which is
2044
- * the correct answer: they are two runs.)
2041
+ * ONE STEP, AND WHAT IT ASKS FOR.
2042
+ *
2043
+ * `may_complete` and `refusal` come from the store. A step that cannot be
2044
+ * finished carries the store's own sentence and NO button never a button that
2045
+ * fails when clicked, and never a button that quietly does nothing.
2045
2046
  */
2046
- declare const CHECKLIST_TABLE: SystemTableSpec;
2047
- interface ChecklistRunnerProps {
2048
- /** The Table the steps live in — normally the same Table the checklist is about. */
2047
+ declare function StepRow({ step, busy, onComplete, className, }: {
2048
+ step: ChecklistRunStep;
2049
+ busy: boolean;
2050
+ onComplete: (evidence: Record<string, unknown>) => void;
2051
+ className?: string | undefined;
2052
+ }): react.JSX.Element;
2053
+ /**
2054
+ * THE STEPS THAT ARE MINE, across every checklist running in this organization.
2055
+ *
2056
+ * A checklist step is a work item in the ONE work layer, so it is already in
2057
+ * `custom.work_inbox` — this is that same work, asked through the door that also
2058
+ * knows what the step ASKS FOR and whether it may be finished. The inbox renders
2059
+ * it as a group so a person finishes a step where it reached them, instead of
2060
+ * being sent to find the checklist it came from.
2061
+ */
2062
+ declare function useMyChecklistSteps(limit?: number): {
2063
+ steps: Array<ChecklistRunStep & {
2064
+ run_id: Uuid;
2065
+ run_name: string;
2066
+ }>;
2067
+ loading: boolean;
2068
+ error: RecordsError | null;
2069
+ refresh: () => Promise<void>;
2070
+ };
2071
+ /** The inbox's checklist group. Absent entirely when this person has no steps. */
2072
+ declare function MyChecklistSteps({ className }: {
2073
+ className?: string | undefined;
2074
+ }): react.JSX.Element | null;
2075
+ interface ChecklistsPanelProps {
2049
2076
  tableId: Uuid;
2050
- /** The agent's half. Each spec not already run is instantiated once. */
2051
- seed?: ChecklistSpec[] | undefined;
2077
+ /** Open the record a run is about. */
2078
+ onOpenRecord?: ((recordId: Uuid) => void) | undefined;
2052
2079
  className?: string | undefined;
2053
2080
  }
2054
- declare function ChecklistRunner({ tableId, seed, className }: ChecklistRunnerProps): react.JSX.Element;
2081
+ /**
2082
+ * ONE TABLE'S CHECKLISTS — the templates written for it, the runs of them, and
2083
+ * how far each has got. It is a rail on the table's own page beside its forms
2084
+ * and its inbox, never a Checklists area of the app somebody has to find.
2085
+ */
2086
+ declare function ChecklistsPanel({ tableId, onOpenRecord, className }: ChecklistsPanelProps): react.JSX.Element;
2087
+ /**
2088
+ * A CHECKLIST, AS PLAIN ROWS. One row per step: what it is called, whose it is,
2089
+ * how many days in, what it waits for, and what it asks for.
2090
+ *
2091
+ * THE STORE JUDGES IT, NOT THIS SCREEN. `custom.checklist_refusal` is pure — it
2092
+ * reads no row and writes nothing — so it is asked on every change and the
2093
+ * sentence arrives BEFORE the save rather than after it. There is no second
2094
+ * validator here: a rule written twice is a rule that will disagree with itself.
2095
+ */
2096
+ declare function ChecklistTemplateEditor({ aboutTableId, templateId, onDone, className, }: {
2097
+ aboutTableId: Uuid;
2098
+ templateId?: Uuid | null | undefined;
2099
+ onDone?: (() => void) | undefined;
2100
+ className?: string | undefined;
2101
+ }): react.JSX.Element;
2055
2102
 
2056
2103
  interface BookingSlotsProps {
2057
- /** The Table holds are taken against, and the Table a booking lands in. */
2058
- tableId: Uuid;
2059
- /** The form a person fills in once they hold a slot. Its `subject` is the Table. */
2060
- form: FormSpec;
2061
- /** Availability — the organization's opinion, with a default rather than a question. */
2062
- availability?: {
2063
- /** First hour offered, 24h. Default 9. */
2064
- fromHour?: number;
2065
- /** Last hour offered, exclusive. Default 17. */
2066
- toHour?: number;
2067
- /** Minutes per slot. Default 60. */
2068
- everyMinutes?: number;
2069
- /** How many days ahead to offer. Default 5. */
2070
- days?: number;
2071
- };
2072
- /** How long a hold lasts before the store lets the slot go. Default 15 minutes. */
2073
- holdFor?: string;
2074
- /** `null` when the answer was HELD rather than written — see the runner's own note. */
2075
- onBooked?: ((recordId: Uuid | null) => void) | undefined;
2104
+ /**
2105
+ * One Table's booking pages. Omitted — on the Records home — it is every
2106
+ * booking page in this organization, which is the same door asked the wider
2107
+ * question, never a second list.
2108
+ */
2109
+ tableId?: Uuid | null | undefined;
2076
2110
  className?: string | undefined;
2077
2111
  }
2078
- declare function BookingSlots({ tableId, form, availability, holdFor, onBooked, className, }: BookingSlotsProps): react.JSX.Element;
2112
+ declare function BookingSlots({ tableId, className }: BookingSlotsProps): react.JSX.Element | null;
2113
+ /**
2114
+ * The next appointment, as a sentence. `next_at` is the store's answer over
2115
+ * every appointment this person may see — not over the page this screen loaded.
2116
+ */
2117
+ declare function nextInWords(page: Pick<BookingSummary, "next_at" | "timezone" | "state">): string;
2079
2118
 
2080
2119
  /** The three things a phone captures. Each one writes the SAME kind of record. */
2081
2120
  declare const CAPTURE_MODES: readonly ["reading", "photo", "voice"];
@@ -2461,4 +2500,4 @@ interface PipelineBoardProps {
2461
2500
  }
2462
2501
  declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
2463
2502
 
2464
- export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_TABLE, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, type ChecklistSpec, type ChecklistStepSpec, CommentThread, type CommentThreadProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, 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, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, NOT_ANSWERED_YET, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, SubscriptionsPanel, type SubscriptionsPanelProps, 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_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, colorFromTheValue, columnForField, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, machineIdentityIn, memberName, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable };
2503
+ export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, CommentThread, type CommentThreadProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, 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, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, MyChecklistSteps, NOT_ANSWERED_YET, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, 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_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, colorFromTheValue, columnForField, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, machineIdentityIn, memberName, nextInWords, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, ComponentType, RefObject } from 'react';
3
3
  import * as _ai_matrx_records from '@ai-matrx/records';
4
- import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Uuid as Uuid$1, AggregateFilter, Field, RecordDocument, ReadRow, WriteConflict, ParityFieldType, NewFieldDeclaration, ValueEnvelope, WorkInboxKind, RuleExpression, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, FieldTypeWord } from '@ai-matrx/records';
4
+ import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Uuid as Uuid$1, AggregateFilter, Field, RecordDocument, ReadRow, WriteConflict, ParityFieldType, NewFieldDeclaration, ValueEnvelope, WorkInboxKind, RuleExpression, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, FieldTypeWord } from '@ai-matrx/records';
5
5
  import { Uuid, Field as Field$1, ReadRow as ReadRow$1 } from '@ai-matrx/records/react';
6
6
  import { RecordsClient } from '@ai-matrx/records/core';
7
7
  import { FieldFormatConfig } from '@ai-matrx/design-system/field-formats';
@@ -2023,59 +2023,98 @@ interface FormRunnerProps {
2023
2023
  */
2024
2024
  declare function FormRunner(props: FormRunnerProps): react.JSX.Element;
2025
2025
 
2026
- /** THE COMPLETE DECLARATIVE SPEC — one object, one `record_write`, a whole checklist. */
2027
- interface ChecklistSpec {
2028
- name: string;
2029
- /** The Table the steps become records in. */
2030
- subject: Uuid;
2031
- steps: ChecklistStepSpec[];
2032
- }
2033
- interface ChecklistStepSpec {
2034
- /** The document this step's record starts life with. `title` is what a person reads. */
2035
- title: string;
2036
- /** Anything else the subject Table's Fields take. */
2037
- data?: Record<string, unknown>;
2026
+ interface ChecklistRunnerProps {
2027
+ /** The Table runs are ABOUT. On a record page, the record's own table. */
2028
+ tableId?: Uuid | null | undefined;
2029
+ /** Runs about THIS record a new hire, a matter, a job. */
2030
+ recordId?: Uuid | null | undefined;
2031
+ /** One run, named outright. Overrides the two above. */
2032
+ runId?: Uuid | null | undefined;
2033
+ /** Show runs that have been closed too. The default is what is still open. */
2034
+ includeClosed?: boolean | undefined;
2035
+ /** Offer the templates that could be started here. On by default with a record. */
2036
+ offerToStart?: boolean | undefined;
2037
+ className?: string | undefined;
2038
2038
  }
2039
+ declare function ChecklistRunner({ tableId, recordId, runId, includeClosed, offerToStart, className, }: ChecklistRunnerProps): react.JSX.Element;
2039
2040
  /**
2040
- * The package-owned Table a checklist RUN is recorded in. The steps are records
2041
- * in the subject Table — this holds only which template was instantiated and
2042
- * when, so re-opening a checklist finds the same steps rather than making new
2043
- * ones. (Running the same checklist twice on purpose is two rows here, which is
2044
- * the correct answer: they are two runs.)
2041
+ * ONE STEP, AND WHAT IT ASKS FOR.
2042
+ *
2043
+ * `may_complete` and `refusal` come from the store. A step that cannot be
2044
+ * finished carries the store's own sentence and NO button never a button that
2045
+ * fails when clicked, and never a button that quietly does nothing.
2045
2046
  */
2046
- declare const CHECKLIST_TABLE: SystemTableSpec;
2047
- interface ChecklistRunnerProps {
2048
- /** The Table the steps live in — normally the same Table the checklist is about. */
2047
+ declare function StepRow({ step, busy, onComplete, className, }: {
2048
+ step: ChecklistRunStep;
2049
+ busy: boolean;
2050
+ onComplete: (evidence: Record<string, unknown>) => void;
2051
+ className?: string | undefined;
2052
+ }): react.JSX.Element;
2053
+ /**
2054
+ * THE STEPS THAT ARE MINE, across every checklist running in this organization.
2055
+ *
2056
+ * A checklist step is a work item in the ONE work layer, so it is already in
2057
+ * `custom.work_inbox` — this is that same work, asked through the door that also
2058
+ * knows what the step ASKS FOR and whether it may be finished. The inbox renders
2059
+ * it as a group so a person finishes a step where it reached them, instead of
2060
+ * being sent to find the checklist it came from.
2061
+ */
2062
+ declare function useMyChecklistSteps(limit?: number): {
2063
+ steps: Array<ChecklistRunStep & {
2064
+ run_id: Uuid;
2065
+ run_name: string;
2066
+ }>;
2067
+ loading: boolean;
2068
+ error: RecordsError | null;
2069
+ refresh: () => Promise<void>;
2070
+ };
2071
+ /** The inbox's checklist group. Absent entirely when this person has no steps. */
2072
+ declare function MyChecklistSteps({ className }: {
2073
+ className?: string | undefined;
2074
+ }): react.JSX.Element | null;
2075
+ interface ChecklistsPanelProps {
2049
2076
  tableId: Uuid;
2050
- /** The agent's half. Each spec not already run is instantiated once. */
2051
- seed?: ChecklistSpec[] | undefined;
2077
+ /** Open the record a run is about. */
2078
+ onOpenRecord?: ((recordId: Uuid) => void) | undefined;
2052
2079
  className?: string | undefined;
2053
2080
  }
2054
- declare function ChecklistRunner({ tableId, seed, className }: ChecklistRunnerProps): react.JSX.Element;
2081
+ /**
2082
+ * ONE TABLE'S CHECKLISTS — the templates written for it, the runs of them, and
2083
+ * how far each has got. It is a rail on the table's own page beside its forms
2084
+ * and its inbox, never a Checklists area of the app somebody has to find.
2085
+ */
2086
+ declare function ChecklistsPanel({ tableId, onOpenRecord, className }: ChecklistsPanelProps): react.JSX.Element;
2087
+ /**
2088
+ * A CHECKLIST, AS PLAIN ROWS. One row per step: what it is called, whose it is,
2089
+ * how many days in, what it waits for, and what it asks for.
2090
+ *
2091
+ * THE STORE JUDGES IT, NOT THIS SCREEN. `custom.checklist_refusal` is pure — it
2092
+ * reads no row and writes nothing — so it is asked on every change and the
2093
+ * sentence arrives BEFORE the save rather than after it. There is no second
2094
+ * validator here: a rule written twice is a rule that will disagree with itself.
2095
+ */
2096
+ declare function ChecklistTemplateEditor({ aboutTableId, templateId, onDone, className, }: {
2097
+ aboutTableId: Uuid;
2098
+ templateId?: Uuid | null | undefined;
2099
+ onDone?: (() => void) | undefined;
2100
+ className?: string | undefined;
2101
+ }): react.JSX.Element;
2055
2102
 
2056
2103
  interface BookingSlotsProps {
2057
- /** The Table holds are taken against, and the Table a booking lands in. */
2058
- tableId: Uuid;
2059
- /** The form a person fills in once they hold a slot. Its `subject` is the Table. */
2060
- form: FormSpec;
2061
- /** Availability — the organization's opinion, with a default rather than a question. */
2062
- availability?: {
2063
- /** First hour offered, 24h. Default 9. */
2064
- fromHour?: number;
2065
- /** Last hour offered, exclusive. Default 17. */
2066
- toHour?: number;
2067
- /** Minutes per slot. Default 60. */
2068
- everyMinutes?: number;
2069
- /** How many days ahead to offer. Default 5. */
2070
- days?: number;
2071
- };
2072
- /** How long a hold lasts before the store lets the slot go. Default 15 minutes. */
2073
- holdFor?: string;
2074
- /** `null` when the answer was HELD rather than written — see the runner's own note. */
2075
- onBooked?: ((recordId: Uuid | null) => void) | undefined;
2104
+ /**
2105
+ * One Table's booking pages. Omitted — on the Records home — it is every
2106
+ * booking page in this organization, which is the same door asked the wider
2107
+ * question, never a second list.
2108
+ */
2109
+ tableId?: Uuid | null | undefined;
2076
2110
  className?: string | undefined;
2077
2111
  }
2078
- declare function BookingSlots({ tableId, form, availability, holdFor, onBooked, className, }: BookingSlotsProps): react.JSX.Element;
2112
+ declare function BookingSlots({ tableId, className }: BookingSlotsProps): react.JSX.Element | null;
2113
+ /**
2114
+ * The next appointment, as a sentence. `next_at` is the store's answer over
2115
+ * every appointment this person may see — not over the page this screen loaded.
2116
+ */
2117
+ declare function nextInWords(page: Pick<BookingSummary, "next_at" | "timezone" | "state">): string;
2079
2118
 
2080
2119
  /** The three things a phone captures. Each one writes the SAME kind of record. */
2081
2120
  declare const CAPTURE_MODES: readonly ["reading", "photo", "voice"];
@@ -2461,4 +2500,4 @@ interface PipelineBoardProps {
2461
2500
  }
2462
2501
  declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
2463
2502
 
2464
- export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_TABLE, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, type ChecklistSpec, type ChecklistStepSpec, CommentThread, type CommentThreadProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, 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, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, NOT_ANSWERED_YET, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, SubscriptionsPanel, type SubscriptionsPanelProps, 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_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, colorFromTheValue, columnForField, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, machineIdentityIn, memberName, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable };
2503
+ export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, BookingSlots, type BookingSlotsProps, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, type Capability, type CaptureMode, type CaptureQueuePort, CaptureRun, type CaptureRunProps, CaptureSheet, type CaptureSheetProps, type CellAddress, type CellRefusal, type CellState, ChartBlock, type ChartBlockProps, type ChartConfig, ChartFrame, type ChartKind, ChartLegendContent, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, CommentThread, type CommentThreadProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORM_FLOWS, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldTypeChoice, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, 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, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, MyChecklistSteps, NOT_ANSWERED_YET, NO_CHAT_REASON, NO_COLUMNS_WHY, NO_COLUMNS_YET, NO_ENRICH_REASON, NO_MEMBERS_REASON, NO_OPEN_RECORDS_REASON, NO_REASK_REASON, NO_RIGHTS, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PARITY_LABEL, PARITY_MADE_OF, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalCardView, type PortalCardViewProps, PortalShell, type PortalShellProps, PortalsPanel, type PortalsPanelProps, type ProposalOutcome, ProposalRow, type ProposalRowProps, type ProposedChange, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, type ReaskContext, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, RecordValue, RecordsMount, type RecordsMountProps, type RecordsUiHost, RecordsUiProvider, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, SERIES_COLORS, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, 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_NOT_SAVED_YET, VIEW_TABLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type WhatYouMayDo, addFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, colorFromTheValue, columnForField, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, declareTable, editorKindFor, ensureSystemTable, envelopeFor, fieldDeclarationFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupLabel, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isId, isMachineIdentity, isPlainFieldType, isRelationFieldType, isSignatureField, keyFor, laneFor, machineIdentityIn, memberName, nextInWords, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, tableName, tableRightsAt, tokenFor, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable };