@ai-matrx/records-ui 0.62.0 → 0.63.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
@@ -610,6 +610,19 @@ declare function recordName(document: RecordDocument | undefined, titleKey?: str
610
610
  declare function looksLikeId(value: unknown): boolean;
611
611
  /** The same question for a row the read door returned. */
612
612
  declare function rowName(row: ReadRow | undefined, titleKey?: string | null, fallback?: string): string;
613
+ /** A Table as far as naming is concerned — its own declared title column (REC-2). */
614
+ type TitledTable = Pick<Table, "title_field"> | null | undefined;
615
+ /**
616
+ * THE NAME OF A RECORD WHOSE TABLE YOU ALREADY HOLD.
617
+ *
618
+ * `table` is the Table the record belongs to; its `title_field` is the store's answer to
619
+ * "what makes this record a chip" (REC-2) and is tried first, then the conventional keys,
620
+ * then the fallback. A Table that has not loaded yet is `null` and the conventional keys
621
+ * still answer — a name arriving a tick late is better than a screen that shows nothing.
622
+ */
623
+ declare function recordNameIn(table: TitledTable, document: RecordDocument | undefined, fallback?: string): string;
624
+ /** The same, for a row the read door returned. */
625
+ declare function rowNameIn(table: TitledTable, row: ReadRow | undefined, fallback?: string): string;
613
626
  /**
614
627
  * WHAT A RELATION CHIP SAYS WHEN THE RECORD IT POINTS AT IS NOT YOURS.
615
628
  *
@@ -3003,4 +3016,4 @@ interface PipelineBoardProps {
3003
3016
  }
3004
3017
  declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
3005
3018
 
3006
- export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, 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, type ConditionField, ConditionGroup, type ConditionGroupProps, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, 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, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NOT_DRAWN_HERE, NO_AGENT_PORT, 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_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PAGE_VIEWS, PAGE_VIEW_LABEL, PARITY_LABEL, PARITY_MADE_OF, type PageView, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, 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, ReferenceBuilder, type ReferenceBuilderProps, type ReferenceChoice, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, 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, WITHHELD_RECORD_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, 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, lastChangeSentence, looksLikeId, machineIdentityIn, memberName, nextInWords, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
3019
+ export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, 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, type ConditionField, ConditionGroup, type ConditionGroupProps, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, 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, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NOT_DRAWN_HERE, NO_AGENT_PORT, 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_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PAGE_VIEWS, PAGE_VIEW_LABEL, PARITY_LABEL, PARITY_MADE_OF, type PageView, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, 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, ReferenceBuilder, type ReferenceBuilderProps, type ReferenceChoice, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, 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, WITHHELD_RECORD_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, 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, lastChangeSentence, looksLikeId, machineIdentityIn, memberName, nextInWords, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, recordName, recordNameIn, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, rowNameIn, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
package/dist/index.d.ts CHANGED
@@ -610,6 +610,19 @@ declare function recordName(document: RecordDocument | undefined, titleKey?: str
610
610
  declare function looksLikeId(value: unknown): boolean;
611
611
  /** The same question for a row the read door returned. */
612
612
  declare function rowName(row: ReadRow | undefined, titleKey?: string | null, fallback?: string): string;
613
+ /** A Table as far as naming is concerned — its own declared title column (REC-2). */
614
+ type TitledTable = Pick<Table, "title_field"> | null | undefined;
615
+ /**
616
+ * THE NAME OF A RECORD WHOSE TABLE YOU ALREADY HOLD.
617
+ *
618
+ * `table` is the Table the record belongs to; its `title_field` is the store's answer to
619
+ * "what makes this record a chip" (REC-2) and is tried first, then the conventional keys,
620
+ * then the fallback. A Table that has not loaded yet is `null` and the conventional keys
621
+ * still answer — a name arriving a tick late is better than a screen that shows nothing.
622
+ */
623
+ declare function recordNameIn(table: TitledTable, document: RecordDocument | undefined, fallback?: string): string;
624
+ /** The same, for a row the read door returned. */
625
+ declare function rowNameIn(table: TitledTable, row: ReadRow | undefined, fallback?: string): string;
613
626
  /**
614
627
  * WHAT A RELATION CHIP SAYS WHEN THE RECORD IT POINTS AT IS NOT YOURS.
615
628
  *
@@ -3003,4 +3016,4 @@ interface PipelineBoardProps {
3003
3016
  }
3004
3017
  declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
3005
3018
 
3006
- export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, 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, type ConditionField, ConditionGroup, type ConditionGroupProps, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, 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, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NOT_DRAWN_HERE, NO_AGENT_PORT, 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_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PAGE_VIEWS, PAGE_VIEW_LABEL, PARITY_LABEL, PARITY_MADE_OF, type PageView, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, 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, ReferenceBuilder, type ReferenceBuilderProps, type ReferenceChoice, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, 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, WITHHELD_RECORD_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, 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, lastChangeSentence, looksLikeId, machineIdentityIn, memberName, nextInWords, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, recordName, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
3019
+ export { ACTION_KINDS, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, BookingBuilder, type BookingBuilderProps, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CONDITION_OPS, 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, type ConditionField, ConditionGroup, type ConditionGroupProps, ConditionRow, type ConditionRowProps, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FIELDS, DEFAULT_VIEW_NAME, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, 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, type MainView, MyChecklistSteps, NEEDS_A_SENTENCE, NOT_ANSWERED_YET, NOT_DRAWN_HERE, NO_AGENT_PORT, 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_RULES_YET, NO_SAVED_VIEWS_REASON, NO_SHARE_REASON, NO_UPLOAD_REASON, type NewFieldSpec, type NewTableSpec, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, type OpenRecordsAsk, type OrganizationMember, PAGE_VIEWS, PAGE_VIEW_LABEL, PARITY_LABEL, PARITY_MADE_OF, type PageView, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, type PickableFieldType, PipelineBoard, type PipelineBoardProps, type PlainFieldType, type PlainRefusal, type PortalAnswer, PortalBuilder, type PortalBuilderProps, 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, ReferenceBuilder, type ReferenceBuilderProps, type ReferenceChoice, RefusalLine, RefusalNotice, type RelationFieldType, RelationPicker, type RelationPickerProps, type ResolveName, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SERIES_COLORS, SOMEBODY, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NOT_REACHABLE, THE_SYSTEM, 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, WITHHELD_RECORD_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, 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, lastChangeSentence, looksLikeId, machineIdentityIn, memberName, nextInWords, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, recordName, recordNameIn, recordsDataSource, refusalForAPerson, refusalLineForAPerson, renderValue, revokeConsequence, rowName, rowNameIn, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
package/dist/index.js CHANGED
@@ -276,6 +276,12 @@ function looksLikeId(value) {
276
276
  function rowName(row, titleKey, fallback = "Untitled") {
277
277
  return recordName(row?.document, titleKey, fallback);
278
278
  }
279
+ function recordNameIn(table, document2, fallback = "Untitled") {
280
+ return recordName(document2, table?.title_field ?? null, fallback);
281
+ }
282
+ function rowNameIn(table, row, fallback = "Untitled") {
283
+ return recordName(row?.document, table?.title_field ?? null, fallback);
284
+ }
279
285
  var WITHHELD_RECORD_LABEL = "A record you have not been given access to";
280
286
 
281
287
  // src/ReferenceBuilder.tsx
@@ -661,8 +667,7 @@ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
661
667
  function RelationPicker({ field, value, onChange, disabled, id, className }) {
662
668
  const client = useRecordsClient();
663
669
  const [rows, setRows] = useState2(null);
664
- const [titleKey, setTitleKey] = useState2(null);
665
- const [elsewhere, setElsewhere] = useState2({});
670
+ const [words, setWords] = useState2({});
666
671
  const [refusal, setRefusal] = useState2(null);
667
672
  const [search, setSearch] = useState2("");
668
673
  const [open, setOpen] = useState2(false);
@@ -679,47 +684,37 @@ function RelationPicker({ field, value, onChange, disabled, id, className }) {
679
684
  if (result.ok) setRows(result.data.rows);
680
685
  else setRefusal(refusalLineForAPerson(result.error));
681
686
  });
682
- void client.tableList().then((result) => {
683
- if (cancelled || !result.ok) return;
684
- setTitleKey(result.data.find((table) => table.id === target)?.title_field ?? null);
685
- });
686
687
  return () => {
687
688
  cancelled = true;
688
689
  };
689
690
  }, [client, field.relation_target]);
690
691
  useEffect(() => {
691
692
  if (!rows) return;
692
- const known = new Set(rows.map((row) => row.id));
693
- const missing = picked.filter((id2) => !known.has(id2) && elsewhere[id2] === void 0);
694
- if (missing.length === 0) return;
693
+ const wanted = [.../* @__PURE__ */ new Set([...rows.map((row) => row.id), ...picked])].filter(
694
+ (id2) => words[id2] === void 0
695
+ );
696
+ if (wanted.length === 0) return;
695
697
  let cancelled = false;
696
- void Promise.all(
697
- missing.map(async (id2) => {
698
- const result = await client.recordRead({ record_id: id2 });
699
- return [id2, result.ok ? rowName({ document: result.data.document }, titleKey) : WITHHELD_RECORD_LABEL];
700
- })
701
- ).then((pairs) => {
698
+ void client.relationWordsMany({ field_id: field.id, record_ids: wanted }).then((result) => {
702
699
  if (cancelled) return;
703
- setElsewhere((current) => ({ ...current, ...Object.fromEntries(pairs) }));
700
+ const learned = {};
701
+ for (const id2 of wanted) {
702
+ const said = result.ok ? result.data[id2] : void 0;
703
+ learned[id2] = typeof said === "string" && said !== "" ? said : WITHHELD_RECORD_LABEL;
704
+ }
705
+ setWords((current) => ({ ...current, ...learned }));
704
706
  });
705
707
  return () => {
706
708
  cancelled = true;
707
709
  };
708
- }, [client, rows, picked, elsewhere, titleKey]);
710
+ }, [client, field.id, rows, picked, words]);
709
711
  if (!field.relation_target) {
710
712
  return /* @__PURE__ */ jsxs2("p", { className: "text-xs text-muted-foreground", children: [
711
713
  fieldName(field),
712
714
  " points at records, but it does not say which Table yet, so there is nothing to pick from. A table admin sets its target in the field editor."
713
715
  ] });
714
716
  }
715
- const byId = new Map((rows ?? []).map((row) => [row.id, row]));
716
- const titleOf = (recordId) => {
717
- const row = byId.get(recordId);
718
- if (row) return rowName(row, titleKey, "Untitled");
719
- const away = elsewhere[recordId];
720
- if (away !== void 0) return away;
721
- return "Loading\u2026";
722
- };
717
+ const titleOf = (recordId) => words[recordId] ?? "Loading\u2026";
723
718
  const full = field.multi && field.relation_max !== null && picked.length >= field.relation_max;
724
719
  const toggle = (recordId) => {
725
720
  if (!field.multi) {
@@ -1466,28 +1461,12 @@ function RecordLabelProvider({ children }) {
1466
1461
  stopWaitClock(field.id);
1467
1462
  return;
1468
1463
  }
1469
- const target = field.relation_target;
1470
- if (!target) {
1464
+ if (!field.relation_target) {
1471
1465
  setSettled((current) => ({ ...current, [field.id]: true }));
1472
1466
  stopWaitClock(field.id);
1473
1467
  return;
1474
1468
  }
1475
- const [rows, tables] = await Promise.all([
1476
- client.list({ table_id: target, limit: 200 }),
1477
- client.tableList()
1478
- ]);
1479
- const titleKey = tables.ok ? tables.data.find((table) => table.id === target)?.title_field ?? null : null;
1480
- if (rows.ok) {
1481
- setNames((current) => {
1482
- const next = { ...current };
1483
- for (const row of rows.data.rows) {
1484
- next[row.id] = recordName(row.document, titleKey, "Untitled");
1485
- }
1486
- return next;
1487
- });
1488
- }
1489
1469
  setSettled((current) => ({ ...current, [field.id]: true }));
1490
- stopWaitClock(field.id);
1491
1470
  })();
1492
1471
  },
1493
1472
  [client, startWaitClock, stopWaitClock]
@@ -1496,27 +1475,26 @@ function RecordLabelProvider({ children }) {
1496
1475
  const flushing = useRef2(null);
1497
1476
  const flush = useCallback3(() => {
1498
1477
  flushing.current = null;
1499
- const batch = [...queued.current.entries()];
1478
+ const batch = [...queued.current.values()];
1500
1479
  queued.current.clear();
1501
1480
  if (batch.length === 0) return;
1502
1481
  void (async () => {
1503
1482
  const learned = {};
1504
- const LANES = 6;
1505
- let at = 0;
1506
1483
  await Promise.all(
1507
- Array.from({ length: Math.min(LANES, batch.length) }, async () => {
1508
- for (; ; ) {
1509
- const next = batch[at];
1510
- at += 1;
1511
- if (!next) return;
1512
- const [id] = next;
1513
- const result = await client.recordRead({ record_id: id });
1514
- learned[id] = result.ok ? recordName(result.data.document, null, "Untitled") : WITHHELD_RECORD_LABEL;
1484
+ batch.map(async ({ field, ids }) => {
1485
+ const wanted = [...ids];
1486
+ const result = await client.relationWordsMany({
1487
+ field_id: field.id,
1488
+ record_ids: wanted
1489
+ });
1490
+ for (const id of wanted) {
1491
+ const words = result.ok ? result.data[id] : void 0;
1492
+ learned[id] = typeof words === "string" && words !== "" ? words : WITHHELD_RECORD_LABEL;
1515
1493
  }
1516
1494
  })
1517
1495
  );
1518
1496
  setNames((current) => ({ ...current, ...learned }));
1519
- for (const [, field] of batch) stopWaitClock(field.id);
1497
+ for (const { field } of batch) stopWaitClock(field.id);
1520
1498
  })();
1521
1499
  }, [client, stopWaitClock]);
1522
1500
  const chase = useCallback3(
@@ -1524,7 +1502,9 @@ function RecordLabelProvider({ children }) {
1524
1502
  const key = `${field.id}:${id}`;
1525
1503
  if (chased.current.has(key)) return;
1526
1504
  chased.current.add(key);
1527
- queued.current.set(id, field);
1505
+ const pending = queued.current.get(field.id);
1506
+ if (pending) pending.ids.add(id);
1507
+ else queued.current.set(field.id, { field, ids: /* @__PURE__ */ new Set([id]) });
1528
1508
  startWaitClock(field, null);
1529
1509
  if (flushing.current === null) flushing.current = setTimeout(flush, 0);
1530
1510
  },
@@ -3670,9 +3650,11 @@ function Grid({
3670
3650
  onClick: () => host.talkToRecord?.({
3671
3651
  tableId,
3672
3652
  recordId: row.id,
3673
- title: recordName(
3674
- row.document ?? {},
3675
- table.data?.title_field
3653
+ // ONE NAMING CALL (`names.ts`), not this file's own join
3654
+ // of a Table's title column to a document.
3655
+ title: recordNameIn(
3656
+ table.data,
3657
+ row.document ?? {}
3676
3658
  )
3677
3659
  }),
3678
3660
  children: "Talk"
@@ -6361,7 +6343,7 @@ function Peek({ tableId, recordId, onClose, className }) {
6361
6343
  if (record.error) return /* @__PURE__ */ jsx24(RefusalNotice, { error: record.error, className });
6362
6344
  if (fields.error) return /* @__PURE__ */ jsx24(RefusalNotice, { error: fields.error, className });
6363
6345
  const document2 = record.data?.document;
6364
- const title = document2 ? recordName(document2, table.data?.title_field) : "";
6346
+ const title = document2 ? recordNameIn(table.data, document2) : "";
6365
6347
  const href = host.hrefForRecord && table.data ? host.hrefForRecord({ table: table.data, recordId }) : void 0;
6366
6348
  return /* @__PURE__ */ jsxs20("div", { className: cn18("flex min-w-0 flex-col gap-2 text-xs", className), children: [
6367
6349
  /* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2", children: [
@@ -10049,7 +10031,7 @@ function Preview({
10049
10031
  function Invite({ card, onInvited }) {
10050
10032
  const client = useRecordsClient25();
10051
10033
  const [rows, setRows] = useState33(null);
10052
- const [titleKey, setTitleKey] = useState33(null);
10034
+ const [clientTable, setClientTable] = useState33(null);
10053
10035
  const [search, setSearch] = useState33("");
10054
10036
  const [picked, setPicked] = useState33(null);
10055
10037
  const [email, setEmail] = useState33("");
@@ -10068,17 +10050,17 @@ function Invite({ card, onInvited }) {
10068
10050
  });
10069
10051
  void client.tableList().then((answered) => {
10070
10052
  if (cancelled || !answered.ok) return;
10071
- setTitleKey(answered.data.find((t) => t.id === card.client_table_id)?.title_field ?? null);
10053
+ setClientTable(answered.data.find((t) => t.id === card.client_table_id) ?? null);
10072
10054
  });
10073
10055
  return () => {
10074
10056
  cancelled = true;
10075
10057
  };
10076
10058
  }, [client, card.client_table_id]);
10077
10059
  const options = useMemo23(() => {
10078
- const all = (rows ?? []).map((row) => ({ id: row.id, name: rowName(row, titleKey) }));
10060
+ const all = (rows ?? []).map((row) => ({ id: row.id, name: rowNameIn(clientTable, row) }));
10079
10061
  const needle = search.trim().toLowerCase();
10080
10062
  return needle === "" ? all.slice(0, 25) : all.filter((o) => o.name.toLowerCase().includes(needle)).slice(0, 25);
10081
- }, [rows, titleKey, search]);
10063
+ }, [rows, clientTable, search]);
10082
10064
  const send = useCallback18(async () => {
10083
10065
  if (!picked) return;
10084
10066
  setBusy(true);
@@ -15226,12 +15208,14 @@ export {
15226
15208
  previewWords,
15227
15209
  publiclyAnswerable,
15228
15210
  recordName,
15211
+ recordNameIn,
15229
15212
  recordsDataSource,
15230
15213
  refusalForAPerson,
15231
15214
  refusalLineForAPerson,
15232
15215
  renderValue,
15233
15216
  revokeConsequence,
15234
15217
  rowName,
15218
+ rowNameIn,
15235
15219
  scalarText,
15236
15220
  shareUnavailableReason,
15237
15221
  specFromBlock,