@ai-matrx/records-ui 0.84.7 → 0.84.8

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,8 +1,8 @@
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, RelationDisplay, WriteConflict, RecordsErrorCode, DeclarableFieldKind, ParityFieldType, NewFieldDeclaration, RuleExpression, ValueEnvelope, ChecklistRequirementKind, ContextPolicy, WorkDueState, FieldSensitivity, StageRuleOnFail, SubscriptionCadence, WorkInboxKind, FieldKind, RecordsResult, RecordFilter as RecordFilter$1, ArchiveLane, ArchivedRow, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, MySubscription, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, HistoryActor, FieldHistoryEntry, FieldTypeWord } from '@ai-matrx/records';
5
- import { Uuid, RecordFilter, Field as Field$1, ReadRow as ReadRow$1 } from '@ai-matrx/records/react';
4
+ import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Uuid as Uuid$1, RecordFilter, AggregateFilter, Field, RecordDocument, ReadRow, RelationDisplay, WriteConflict, RecordsErrorCode, DeclarableFieldKind, ParityFieldType, NewFieldDeclaration, RuleExpression, ValueEnvelope, ChecklistRequirementKind, ContextPolicy, WorkDueState, FieldSensitivity, StageRuleOnFail, SubscriptionCadence, WorkInboxKind, FieldKind, RecordsResult, ArchiveLane, ArchivedRow, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, MySubscription, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, HistoryActor, FieldHistoryEntry, FieldTypeWord } from '@ai-matrx/records';
5
+ import { Uuid, RecordFilter as RecordFilter$1, 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';
8
8
  import { MatrxColumnDef } from '@ai-matrx/design-system/data-table/types';
@@ -227,7 +227,31 @@ declare const NO_RIGHTS: TableRights;
227
227
  * ladder cannot produce (write without read, share without edit).
228
228
  */
229
229
  declare function tableRightsAt(level: PermissionLevel | null): TableRights;
230
+ /**
231
+ * A LAYOUT THE HOST DRAWS, beside the package's own four (Grid, Kanban, Calendar,
232
+ * Gallery) in the SAME layout row of every table page. The host owns what it
233
+ * draws; the package owns where it sits, its button, and its address (`?view=<id>`).
234
+ *
235
+ * WHY A PORT: an app with a richer surface for one kind of looking at a table —
236
+ * AI Matrx's spreadsheet-feel Sheet, the older /data grid ported onto the record
237
+ * store — must be a layout of the one table page, never a second page for the
238
+ * same table. It is page-level, not saved onto the view record: the store's
239
+ * layout words are the four the package draws.
240
+ */
241
+ interface HostLayout {
242
+ /** The address word (`?view=sheet`). Lowercase; must not be one of the package's own. */
243
+ id: string;
244
+ /** The button's words. */
245
+ label: string;
246
+ /** Draw it for this table, with the question the address asked when there is one. */
247
+ render: (args: {
248
+ tableId: Uuid$1;
249
+ filter?: RecordFilter | undefined;
250
+ }) => ReactNode;
251
+ }
230
252
  interface RecordsUiHost {
253
+ /** Layouts the host draws beside the package's own. See `HostLayout`. */
254
+ layouts?: HostLayout[];
231
255
  /** Answer the rights question for one table. Synchronous: a screen renders now. */
232
256
  rights?: (table: Table) => TableRights;
233
257
  /** Where a record's own page lives, when the host has one. A peek is used when it does not. */
@@ -1099,7 +1123,7 @@ interface GridProps {
1099
1123
  * so filtering in the browser would drop every matching record on page two
1100
1124
  * and call the result the answer.
1101
1125
  */
1102
- filter?: RecordFilter | undefined;
1126
+ filter?: RecordFilter$1 | undefined;
1103
1127
  /** Opened when a row is clicked. A host that has a record page passes its own. */
1104
1128
  onOpenRecord?: ((recordId: Uuid) => void) | undefined;
1105
1129
  /** SCR-2. Called when an admin clicks the "+" at the end of the headers. */
@@ -2006,11 +2030,18 @@ interface ViewSwitcherProps {
2006
2030
  * the store, so switching layout after a drill-through keeps the same rows
2007
2031
  * instead of quietly widening back to the whole table.
2008
2032
  */
2009
- filter?: RecordFilter$1 | undefined;
2033
+ filter?: RecordFilter | undefined;
2034
+ /**
2035
+ * The HOST layout showing now (`RecordsUiHost.layouts`, by id), or null for the
2036
+ * package's own. Controlled by the page, because the address names it.
2037
+ */
2038
+ hostLayout?: string | null | undefined;
2039
+ /** The person picked a host layout (its id), or went back to one of the four (null). */
2040
+ onHostLayoutChange?: ((id: string | null) => void) | undefined;
2010
2041
  className?: string | undefined;
2011
2042
  }
2012
2043
  /** The records this view holds: its Rule's members when it names one, the table otherwise. */
2013
- declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?: RecordFilter$1): {
2044
+ declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?: RecordFilter): {
2014
2045
  rows: ReadRow$1[];
2015
2046
  loading: boolean;
2016
2047
  error: RecordsError | null;
@@ -2028,7 +2059,7 @@ declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?:
2028
2059
  */
2029
2060
  membership: string;
2030
2061
  };
2031
- declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, filter, className, }: ViewSwitcherProps): react.JSX.Element;
2062
+ declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, filter, hostLayout, onHostLayoutChange, className, }: ViewSwitcherProps): react.JSX.Element;
2032
2063
 
2033
2064
  /** What the screen says above the list, so nobody has to be told twice that nothing was destroyed. */
2034
2065
  declare const ARCHIVE_MEANS = "Archiving never destroys anything. A record you remove from the grid waits here until somebody brings it back.";
@@ -2456,7 +2487,7 @@ interface DigestSchedulerProps {
2456
2487
  * shape: an unknown here is a subscription that silently notifies about the
2457
2488
  * wrong records.
2458
2489
  */
2459
- filters?: RecordFilter$1 | null | undefined;
2490
+ filters?: RecordFilter | null | undefined;
2460
2491
  onScheduled?: (() => void) | undefined;
2461
2492
  onClose?: (() => void) | undefined;
2462
2493
  className?: string | undefined;
@@ -3271,7 +3302,11 @@ interface TablePageProps {
3271
3302
  * Half a deep link is a link that works when you arrive and lies when you
3272
3303
  * copy it out of the address bar afterwards.
3273
3304
  */
3274
- onViewChanged?: ((view: PageView) => void) | undefined;
3305
+ /**
3306
+ * Called with the view the person moved to — one of `PAGE_VIEWS`, or the id of a
3307
+ * layout the HOST draws (`RecordsUiHost.layouts`), which the address carries too.
3308
+ */
3309
+ onViewChanged?: ((view: PageView | string) => void) | undefined;
3275
3310
  /**
3276
3311
  * WHICH FIELD THE ADDRESS WANTS THE BOARD'S COLUMNS TO BE, for this visit.
3277
3312
  *
@@ -3310,7 +3345,7 @@ interface TablePageProps {
3310
3345
  * It is a QUESTION for this visit, exactly like `activeView` and
3311
3346
  * `activeGroupField`, and is never written onto the saved view.
3312
3347
  */
3313
- filter?: RecordFilter$1 | null | undefined;
3348
+ filter?: RecordFilter | null | undefined;
3314
3349
  /**
3315
3350
  * WHICH RAIL THE ADDRESS OPENS — `forms`, `bookings`, `checklists`,
3316
3351
  * `notifications` (also `digests`), `portals`, `settings`, `import`, `inbox`
@@ -3666,4 +3701,4 @@ interface PipelineBoardProps {
3666
3701
  }
3667
3702
  declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
3668
3703
 
3669
- export { ABSENCE_WORD_LABEL, ABSENCE_WORD_VALUES, ACTION_KINDS, ARCHIVED_NEVER_DESTROYED, ARCHIVE_MEANS, type AbsenceWord, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, ArchivedDisclosure, type ArchivedDisclosureProps, ArchivedPortals, type ArchivedPortalsProps, ArchivedView, type ArchivedViewProps, BOOKING_NOT_HERE_LINE, BOOKING_PAGE_STATE_LABEL, BOOKING_PAGE_STATE_VALUES, BookingBuilder, type BookingBuilderProps, type BookingPageState, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_REQUIREMENT_KINDS, CHECKLIST_REQUIREMENT_LABEL, CONDITION_OPS, CONTEXT_POLICY_LABEL, 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, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_RULE_KIND_LABEL, FIELD_RULE_KIND_VALUES, FIELD_SENSITIVITY_LABEL, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORMULA_OP_JOINS, FORMULA_OP_LABEL, FORMULA_OP_VALUES, FORM_FLOWS, FORM_NOT_HERE_LINE, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldRuleKindValue, type FieldTypeChoice, FilePicker, type FilePickerProps, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, type FormulaOp, 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, type LinkRail, 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, PORTAL_NOT_HERE_LINE, PROPOSED_CHANGE_ACT_LABEL, PROPOSED_CHANGE_ACT_VALUES, 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, type ProposedChangeAct, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, ROLLUP_AGG_LABEL, ROLLUP_AGG_VALUES, RULE_NOT_HERE_LINE, 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, type RollupAgg, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SECTIONS_UNKNOWN, SERIES_COLORS, SHARE_NOT_YOURS_LINE, SOMEBODY, STAGE_RULE_ON_FAIL_LABEL, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, SUBSCRIPTION_CADENCES, SUBSCRIPTION_CADENCE_LABEL, SUBSCRIPTION_CHANNEL_LABEL, SUBSCRIPTION_CHANNEL_VALUES, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, 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, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cameFromLine, 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, isEngineerText, isId, isMachineIdentity, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, looksLikeId, machineIdentityIn, mayNotRestoreLine, memberName, nextInWords, nextSummaryAt, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, railFromParam, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, renderValue, revokeConsequence, rowName, rowNameIn, saveViewPatch, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, visibilityLaneFor, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
3704
+ export { ABSENCE_WORD_LABEL, ABSENCE_WORD_VALUES, ACTION_KINDS, ARCHIVED_NEVER_DESTROYED, ARCHIVE_MEANS, type AbsenceWord, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, ArchivedDisclosure, type ArchivedDisclosureProps, ArchivedPortals, type ArchivedPortalsProps, ArchivedView, type ArchivedViewProps, BOOKING_NOT_HERE_LINE, BOOKING_PAGE_STATE_LABEL, BOOKING_PAGE_STATE_VALUES, BookingBuilder, type BookingBuilderProps, type BookingPageState, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_REQUIREMENT_KINDS, CHECKLIST_REQUIREMENT_LABEL, CONDITION_OPS, CONTEXT_POLICY_LABEL, 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, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_RULE_KIND_LABEL, FIELD_RULE_KIND_VALUES, FIELD_SENSITIVITY_LABEL, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORMULA_OP_JOINS, FORMULA_OP_LABEL, FORMULA_OP_VALUES, FORM_FLOWS, FORM_NOT_HERE_LINE, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldRuleKindValue, type FieldTypeChoice, FilePicker, type FilePickerProps, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, type FormulaOp, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, HistoryPanel, type HistoryPanelProps, type HostLayout, 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, type LinkRail, 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, PORTAL_NOT_HERE_LINE, PROPOSED_CHANGE_ACT_LABEL, PROPOSED_CHANGE_ACT_VALUES, 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, type ProposedChangeAct, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, ROLLUP_AGG_LABEL, ROLLUP_AGG_VALUES, RULE_NOT_HERE_LINE, 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, type RollupAgg, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SECTIONS_UNKNOWN, SERIES_COLORS, SHARE_NOT_YOURS_LINE, SOMEBODY, STAGE_RULE_ON_FAIL_LABEL, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, SUBSCRIPTION_CADENCES, SUBSCRIPTION_CADENCE_LABEL, SUBSCRIPTION_CHANNEL_LABEL, SUBSCRIPTION_CHANNEL_VALUES, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, 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, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cameFromLine, 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, isEngineerText, isId, isMachineIdentity, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, looksLikeId, machineIdentityIn, mayNotRestoreLine, memberName, nextInWords, nextSummaryAt, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, railFromParam, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, renderValue, revokeConsequence, rowName, rowNameIn, saveViewPatch, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, visibilityLaneFor, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
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, RelationDisplay, WriteConflict, RecordsErrorCode, DeclarableFieldKind, ParityFieldType, NewFieldDeclaration, RuleExpression, ValueEnvelope, ChecklistRequirementKind, ContextPolicy, WorkDueState, FieldSensitivity, StageRuleOnFail, SubscriptionCadence, WorkInboxKind, FieldKind, RecordsResult, RecordFilter as RecordFilter$1, ArchiveLane, ArchivedRow, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, MySubscription, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, HistoryActor, FieldHistoryEntry, FieldTypeWord } from '@ai-matrx/records';
5
- import { Uuid, RecordFilter, Field as Field$1, ReadRow as ReadRow$1 } from '@ai-matrx/records/react';
4
+ import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Uuid as Uuid$1, RecordFilter, AggregateFilter, Field, RecordDocument, ReadRow, RelationDisplay, WriteConflict, RecordsErrorCode, DeclarableFieldKind, ParityFieldType, NewFieldDeclaration, RuleExpression, ValueEnvelope, ChecklistRequirementKind, ContextPolicy, WorkDueState, FieldSensitivity, StageRuleOnFail, SubscriptionCadence, WorkInboxKind, FieldKind, RecordsResult, ArchiveLane, ArchivedRow, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, MySubscription, DashboardBlockKind, AggregateBucket, AggregateMeasure, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, HistoryActor, FieldHistoryEntry, FieldTypeWord } from '@ai-matrx/records';
5
+ import { Uuid, RecordFilter as RecordFilter$1, 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';
8
8
  import { MatrxColumnDef } from '@ai-matrx/design-system/data-table/types';
@@ -227,7 +227,31 @@ declare const NO_RIGHTS: TableRights;
227
227
  * ladder cannot produce (write without read, share without edit).
228
228
  */
229
229
  declare function tableRightsAt(level: PermissionLevel | null): TableRights;
230
+ /**
231
+ * A LAYOUT THE HOST DRAWS, beside the package's own four (Grid, Kanban, Calendar,
232
+ * Gallery) in the SAME layout row of every table page. The host owns what it
233
+ * draws; the package owns where it sits, its button, and its address (`?view=<id>`).
234
+ *
235
+ * WHY A PORT: an app with a richer surface for one kind of looking at a table —
236
+ * AI Matrx's spreadsheet-feel Sheet, the older /data grid ported onto the record
237
+ * store — must be a layout of the one table page, never a second page for the
238
+ * same table. It is page-level, not saved onto the view record: the store's
239
+ * layout words are the four the package draws.
240
+ */
241
+ interface HostLayout {
242
+ /** The address word (`?view=sheet`). Lowercase; must not be one of the package's own. */
243
+ id: string;
244
+ /** The button's words. */
245
+ label: string;
246
+ /** Draw it for this table, with the question the address asked when there is one. */
247
+ render: (args: {
248
+ tableId: Uuid$1;
249
+ filter?: RecordFilter | undefined;
250
+ }) => ReactNode;
251
+ }
230
252
  interface RecordsUiHost {
253
+ /** Layouts the host draws beside the package's own. See `HostLayout`. */
254
+ layouts?: HostLayout[];
231
255
  /** Answer the rights question for one table. Synchronous: a screen renders now. */
232
256
  rights?: (table: Table) => TableRights;
233
257
  /** Where a record's own page lives, when the host has one. A peek is used when it does not. */
@@ -1099,7 +1123,7 @@ interface GridProps {
1099
1123
  * so filtering in the browser would drop every matching record on page two
1100
1124
  * and call the result the answer.
1101
1125
  */
1102
- filter?: RecordFilter | undefined;
1126
+ filter?: RecordFilter$1 | undefined;
1103
1127
  /** Opened when a row is clicked. A host that has a record page passes its own. */
1104
1128
  onOpenRecord?: ((recordId: Uuid) => void) | undefined;
1105
1129
  /** SCR-2. Called when an admin clicks the "+" at the end of the headers. */
@@ -2006,11 +2030,18 @@ interface ViewSwitcherProps {
2006
2030
  * the store, so switching layout after a drill-through keeps the same rows
2007
2031
  * instead of quietly widening back to the whole table.
2008
2032
  */
2009
- filter?: RecordFilter$1 | undefined;
2033
+ filter?: RecordFilter | undefined;
2034
+ /**
2035
+ * The HOST layout showing now (`RecordsUiHost.layouts`, by id), or null for the
2036
+ * package's own. Controlled by the page, because the address names it.
2037
+ */
2038
+ hostLayout?: string | null | undefined;
2039
+ /** The person picked a host layout (its id), or went back to one of the four (null). */
2040
+ onHostLayoutChange?: ((id: string | null) => void) | undefined;
2010
2041
  className?: string | undefined;
2011
2042
  }
2012
2043
  /** The records this view holds: its Rule's members when it names one, the table otherwise. */
2013
- declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?: RecordFilter$1): {
2044
+ declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?: RecordFilter): {
2014
2045
  rows: ReadRow$1[];
2015
2046
  loading: boolean;
2016
2047
  error: RecordsError | null;
@@ -2028,7 +2059,7 @@ declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?:
2028
2059
  */
2029
2060
  membership: string;
2030
2061
  };
2031
- declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, filter, className, }: ViewSwitcherProps): react.JSX.Element;
2062
+ declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, filter, hostLayout, onHostLayoutChange, className, }: ViewSwitcherProps): react.JSX.Element;
2032
2063
 
2033
2064
  /** What the screen says above the list, so nobody has to be told twice that nothing was destroyed. */
2034
2065
  declare const ARCHIVE_MEANS = "Archiving never destroys anything. A record you remove from the grid waits here until somebody brings it back.";
@@ -2456,7 +2487,7 @@ interface DigestSchedulerProps {
2456
2487
  * shape: an unknown here is a subscription that silently notifies about the
2457
2488
  * wrong records.
2458
2489
  */
2459
- filters?: RecordFilter$1 | null | undefined;
2490
+ filters?: RecordFilter | null | undefined;
2460
2491
  onScheduled?: (() => void) | undefined;
2461
2492
  onClose?: (() => void) | undefined;
2462
2493
  className?: string | undefined;
@@ -3271,7 +3302,11 @@ interface TablePageProps {
3271
3302
  * Half a deep link is a link that works when you arrive and lies when you
3272
3303
  * copy it out of the address bar afterwards.
3273
3304
  */
3274
- onViewChanged?: ((view: PageView) => void) | undefined;
3305
+ /**
3306
+ * Called with the view the person moved to — one of `PAGE_VIEWS`, or the id of a
3307
+ * layout the HOST draws (`RecordsUiHost.layouts`), which the address carries too.
3308
+ */
3309
+ onViewChanged?: ((view: PageView | string) => void) | undefined;
3275
3310
  /**
3276
3311
  * WHICH FIELD THE ADDRESS WANTS THE BOARD'S COLUMNS TO BE, for this visit.
3277
3312
  *
@@ -3310,7 +3345,7 @@ interface TablePageProps {
3310
3345
  * It is a QUESTION for this visit, exactly like `activeView` and
3311
3346
  * `activeGroupField`, and is never written onto the saved view.
3312
3347
  */
3313
- filter?: RecordFilter$1 | null | undefined;
3348
+ filter?: RecordFilter | null | undefined;
3314
3349
  /**
3315
3350
  * WHICH RAIL THE ADDRESS OPENS — `forms`, `bookings`, `checklists`,
3316
3351
  * `notifications` (also `digests`), `portals`, `settings`, `import`, `inbox`
@@ -3666,4 +3701,4 @@ interface PipelineBoardProps {
3666
3701
  }
3667
3702
  declare function PipelineBoard({ tableId, rows, measure, onMeasureChange, onOpenRecord, onMoved, className, }: PipelineBoardProps): react.JSX.Element;
3668
3703
 
3669
- export { ABSENCE_WORD_LABEL, ABSENCE_WORD_VALUES, ACTION_KINDS, ARCHIVED_NEVER_DESTROYED, ARCHIVE_MEANS, type AbsenceWord, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, ArchivedDisclosure, type ArchivedDisclosureProps, ArchivedPortals, type ArchivedPortalsProps, ArchivedView, type ArchivedViewProps, BOOKING_NOT_HERE_LINE, BOOKING_PAGE_STATE_LABEL, BOOKING_PAGE_STATE_VALUES, BookingBuilder, type BookingBuilderProps, type BookingPageState, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_REQUIREMENT_KINDS, CHECKLIST_REQUIREMENT_LABEL, CONDITION_OPS, CONTEXT_POLICY_LABEL, 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, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_RULE_KIND_LABEL, FIELD_RULE_KIND_VALUES, FIELD_SENSITIVITY_LABEL, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORMULA_OP_JOINS, FORMULA_OP_LABEL, FORMULA_OP_VALUES, FORM_FLOWS, FORM_NOT_HERE_LINE, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldRuleKindValue, type FieldTypeChoice, FilePicker, type FilePickerProps, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, type FormulaOp, 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, type LinkRail, 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, PORTAL_NOT_HERE_LINE, PROPOSED_CHANGE_ACT_LABEL, PROPOSED_CHANGE_ACT_VALUES, 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, type ProposedChangeAct, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, ROLLUP_AGG_LABEL, ROLLUP_AGG_VALUES, RULE_NOT_HERE_LINE, 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, type RollupAgg, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SECTIONS_UNKNOWN, SERIES_COLORS, SHARE_NOT_YOURS_LINE, SOMEBODY, STAGE_RULE_ON_FAIL_LABEL, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, SUBSCRIPTION_CADENCES, SUBSCRIPTION_CADENCE_LABEL, SUBSCRIPTION_CHANNEL_LABEL, SUBSCRIPTION_CHANNEL_VALUES, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, 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, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cameFromLine, 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, isEngineerText, isId, isMachineIdentity, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, looksLikeId, machineIdentityIn, mayNotRestoreLine, memberName, nextInWords, nextSummaryAt, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, railFromParam, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, renderValue, revokeConsequence, rowName, rowNameIn, saveViewPatch, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, visibilityLaneFor, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
3704
+ export { ABSENCE_WORD_LABEL, ABSENCE_WORD_VALUES, ACTION_KINDS, ARCHIVED_NEVER_DESTROYED, ARCHIVE_MEANS, type AbsenceWord, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, ArchivedDisclosure, type ArchivedDisclosureProps, ArchivedPortals, type ArchivedPortalsProps, ArchivedView, type ArchivedViewProps, BOOKING_NOT_HERE_LINE, BOOKING_PAGE_STATE_LABEL, BOOKING_PAGE_STATE_VALUES, BookingBuilder, type BookingBuilderProps, type BookingPageState, BookingSlots, type BookingSlotsProps, BuildOrAsk, type BuildOrAskProps, type BuildableKind, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_REQUIREMENT_KINDS, CHECKLIST_REQUIREMENT_LABEL, CONDITION_OPS, CONTEXT_POLICY_LABEL, 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, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, type DeclareResult, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, ExportMenu, type ExportMenuProps, FIELD_RULE_KIND_LABEL, FIELD_RULE_KIND_VALUES, FIELD_SENSITIVITY_LABEL, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FORMULA_OP_JOINS, FORMULA_OP_LABEL, FORMULA_OP_VALUES, FORM_FLOWS, FORM_NOT_HERE_LINE, FROZEN_COLUMN_WIDTH, FieldControl, FieldEditor, type FieldEditorControlProps, type FieldEditorProps, FieldHistoryPanel, type FieldHistoryPanelProps, FieldLabel, type FieldProposalRow, type FieldRuleKindValue, type FieldTypeChoice, FilePicker, type FilePickerProps, FormBuilder, type FormBuilderProps, type FormFlow, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, type FormulaOp, Grid, GridCell, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, HistoryPanel, type HistoryPanelProps, type HostLayout, 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, type LinkRail, 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, PORTAL_NOT_HERE_LINE, PROPOSED_CHANGE_ACT_LABEL, PROPOSED_CHANGE_ACT_VALUES, 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, type ProposedChangeAct, ProvenanceBadge, PublicViewPage, type PublicViewPageProps, ROLLUP_AGG_LABEL, ROLLUP_AGG_VALUES, RULE_NOT_HERE_LINE, 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, type RollupAgg, SAVED_VIEWS_UNAVAILABLE, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SECTIONS_UNKNOWN, SERIES_COLORS, SHARE_NOT_YOURS_LINE, SOMEBODY, STAGE_RULE_ON_FAIL_LABEL, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, SUBSCRIPTION_CADENCES, SUBSCRIPTION_CADENCE_LABEL, SUBSCRIPTION_CHANNEL_LABEL, SUBSCRIPTION_CHANNEL_VALUES, type SavedDashboard, type SavedForm, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, SignBlock, type SignBlockProps, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, 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, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewLayout, type ViewSort, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, type WhoChanged, WhoChangedSource, actorBadge, actorWords, addFields, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, cameFromLine, 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, isEngineerText, isId, isMachineIdentity, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, looksLikeId, machineIdentityIn, mayNotRestoreLine, memberName, nextInWords, nextSummaryAt, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, railFromParam, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, renderValue, revokeConsequence, rowName, rowNameIn, saveViewPatch, scalarText, shareUnavailableReason, specFromBlock, storeDecidesRights, submissionStamp, surfaceChosen, tableName, tableRightsAt, tokenFor, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRecord, viewPatchDocument, visibilityLaneFor, whatIsMissing, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable };
package/dist/index.js CHANGED
@@ -8438,15 +8438,20 @@ function ViewSwitcher({
8438
8438
  onAskWhoChanged,
8439
8439
  pageSize = 200,
8440
8440
  filter,
8441
+ hostLayout,
8442
+ onHostLayoutChange,
8441
8443
  className
8442
8444
  }) {
8443
8445
  const [layout, setLayout] = useState25(view.layout);
8446
+ const hostLayouts = useRecordsUi().layouts ?? [];
8447
+ const drawnByHost = hostLayout ? hostLayouts.find((h) => h.id === hostLayout) ?? null : null;
8444
8448
  const [local, setLocal] = useState25({});
8445
8449
  useEffect15(() => {
8446
8450
  setLayout(view.layout);
8447
8451
  setLocal({});
8448
8452
  }, [view.layout, view.name, view.subject]);
8449
8453
  const pick = (next) => {
8454
+ onHostLayoutChange?.(null);
8450
8455
  setLayout(next);
8451
8456
  onLayoutChange?.(next);
8452
8457
  onViewChange?.({ layout: next });
@@ -8458,19 +8463,32 @@ function ViewSwitcher({
8458
8463
  return /* @__PURE__ */ jsxs24("div", { className: cn22("flex min-h-0 flex-col gap-2", className), children: [
8459
8464
  /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2", children: [
8460
8465
  /* @__PURE__ */ jsx28("span", { className: "truncate text-sm font-medium", children: view.name }),
8461
- /* @__PURE__ */ jsx28("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Layout", children: VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx28(
8462
- Button22,
8463
- {
8464
- size: "sm",
8465
- variant: option === layout ? "secondary" : "ghost",
8466
- "aria-pressed": option === layout,
8467
- onClick: () => pick(option),
8468
- children: LAYOUT_LABEL[option]
8469
- },
8470
- option
8471
- )) })
8466
+ /* @__PURE__ */ jsxs24("div", { className: "ml-auto flex items-center gap-0.5", role: "group", "aria-label": "Layout", children: [
8467
+ VIEW_LAYOUTS.map((option) => /* @__PURE__ */ jsx28(
8468
+ Button22,
8469
+ {
8470
+ size: "sm",
8471
+ variant: !drawnByHost && option === layout ? "secondary" : "ghost",
8472
+ "aria-pressed": !drawnByHost && option === layout,
8473
+ onClick: () => pick(option),
8474
+ children: LAYOUT_LABEL[option]
8475
+ },
8476
+ option
8477
+ )),
8478
+ hostLayouts.map((option) => /* @__PURE__ */ jsx28(
8479
+ Button22,
8480
+ {
8481
+ size: "sm",
8482
+ variant: drawnByHost?.id === option.id ? "secondary" : "ghost",
8483
+ "aria-pressed": drawnByHost?.id === option.id,
8484
+ onClick: () => onHostLayoutChange?.(option.id),
8485
+ children: option.label
8486
+ },
8487
+ `host:${option.id}`
8488
+ ))
8489
+ ] })
8472
8490
  ] }),
8473
- layout === "grid" ? /* @__PURE__ */ jsx28(
8491
+ drawnByHost ? /* @__PURE__ */ jsx28("div", { className: "flex min-h-0 flex-1 flex-col", "data-host-layout": drawnByHost.id, children: drawnByHost.render({ tableId: view.subject, ...filter ? { filter } : {} }) }) : layout === "grid" ? /* @__PURE__ */ jsx28(
8474
8492
  Grid,
8475
8493
  {
8476
8494
  tableId: view.subject,
@@ -17083,6 +17101,11 @@ function openingView(activeView, activeDashboardId) {
17083
17101
  if (named === "archived") return { main: "archived", layout: null, unknown: null };
17084
17102
  return { main: "records", layout: named, unknown: null };
17085
17103
  }
17104
+ function openingHostLayout(activeView, hostLayouts) {
17105
+ const word = typeof activeView === "string" ? activeView.trim().toLowerCase() : "";
17106
+ if (word === "" || pageViewFromParam(word) !== null) return null;
17107
+ return hostLayouts.some((h) => h.id === word) ? word : null;
17108
+ }
17086
17109
  function TablePage({
17087
17110
  tableId,
17088
17111
  pageSize = 100,
@@ -17108,7 +17131,12 @@ function TablePage({
17108
17131
  const organizationId = useRecordsClient44().config.organizationId;
17109
17132
  const [view, setView] = useState57(null);
17110
17133
  const opening = openingRail(activeRecordId, activeRail);
17111
- const opened = openingView(activeView, activeDashboardId);
17134
+ const hostLayouts = useRecordsUi().layouts ?? [];
17135
+ const hostLayoutFor = (asked) => openingHostLayout(asked, hostLayouts);
17136
+ const hostFromLink = hostLayoutFor(activeView);
17137
+ const openedByPackage = openingView(hostFromLink ? null : activeView, activeDashboardId);
17138
+ const opened = hostFromLink ? { ...openedByPackage, main: "records" } : openedByPackage;
17139
+ const [hostLayout, setHostLayout] = useState57(hostFromLink);
17112
17140
  const railAsked = typeof activeRail === "string" ? activeRail.trim() : "";
17113
17141
  const railUnknown = railAsked !== "" && railFromParam(railAsked) === null ? railAsked : null;
17114
17142
  const shareFromLink = railFromParam(activeRail) === "share";
@@ -17146,8 +17174,15 @@ function TablePage({
17146
17174
  setSurface((now) => ({ ...now, rail: named }));
17147
17175
  }, [activeRail, activeRecordId]);
17148
17176
  useEffect46(() => {
17177
+ const host = hostLayoutFor(activeView);
17178
+ if (host) {
17179
+ setHostLayout(host);
17180
+ setSurface((now) => ({ ...now, main: "records" }));
17181
+ return;
17182
+ }
17149
17183
  const named = pageViewFromParam(activeView);
17150
17184
  if (named === null) return;
17185
+ setHostLayout(null);
17151
17186
  const isLayout = named !== "dashboards" && named !== "archived";
17152
17187
  setLayoutFromLink(isLayout ? named : null);
17153
17188
  setSurface((now) => ({ ...now, main: isLayout ? "records" : named }));
@@ -17379,6 +17414,11 @@ function TablePage({
17379
17414
  setLayoutFromLink(layout);
17380
17415
  onViewChanged?.(layout);
17381
17416
  },
17417
+ hostLayout,
17418
+ onHostLayoutChange: (id) => {
17419
+ setHostLayout(id);
17420
+ if (id) onViewChanged?.(id);
17421
+ },
17382
17422
  ...view ? { onViewChange: (patch) => void patchView(patch) } : {},
17383
17423
  ...rights.write ? { onNewRecordForm: () => setRail("new-record") } : {},
17384
17424
  onOpenRecord: (recordId) => {