@ai-matrx/records-ui 0.85.15 → 0.85.17

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
@@ -2418,6 +2418,44 @@ declare function viewSettingsFor(settings: ViewSettings, layout: ViewKeyLayout):
2418
2418
  */
2419
2419
  declare function viewSettingsPatch(patch: ViewSettingsPatch): Record<string, unknown>;
2420
2420
 
2421
+ /**
2422
+ * WHAT A LOOK MAY HOLD — how a person looks, never what the view is: not its name, not whether it
2423
+ * is the default (`view_designate`), not its Rule, not the flat filters the digests read, not the
2424
+ * order the store writes. The store refuses anything else by name.
2425
+ */
2426
+ type ViewLook = Partial<Pick<SavedViewSpec, "layout" | "groupField" | "swimlaneField" | "collapsedColumns" | "measure" | "dateField" | "imageField" | "sorts" | "where" | "presentation">>;
2427
+ /** Only the look's own keys of a press — a name, a default, a Rule or an order is never a look. */
2428
+ declare function lookPart(patch: Partial<SavedViewSpec>): ViewLook;
2429
+ /** The look as the definition keys the store keeps (`view_look_set`); a cleared key is null. */
2430
+ declare function lookDocument(look: ViewLook): Record<string, unknown>;
2431
+ /** A kept look back into the spec's words. Only the keys it holds; a null key is "none, for me". */
2432
+ declare function lookFromDocument(doc: Record<string, unknown> | null | undefined): ViewLook;
2433
+ /** THE VIEW AS THIS PERSON SEES IT: the saved view, with her look laid over it. */
2434
+ declare function applyLook(view: SavedView, look: ViewLook | null | undefined): SavedView;
2435
+ /** Whether the look shows anything the view does not — which is when "Save to view" means something. */
2436
+ declare function lookDiffers(view: SavedView, look: ViewLook | null | undefined): boolean;
2437
+ /**
2438
+ * WHAT "SAVE TO VIEW" SENDS, and what stays the person's own afterwards. The default view's layout
2439
+ * is the table's designation (`viewPatchFor`): it is never saved here — "Make … the default" is —
2440
+ * so a look's layout on the default view stays her look.
2441
+ */
2442
+ declare function saveToViewPlan(view: SavedView, look: ViewLook): {
2443
+ patch: Partial<SavedViewSpec>;
2444
+ left: ViewLook | null;
2445
+ };
2446
+ /** The caller's own looks at every view of a table, by view id. */
2447
+ declare function readLooks(client: Pick<RecordsClient, "viewLookRead">, tableId: Uuid$1): Promise<RecordsResult<Record<string, ViewLook>>>;
2448
+ /** Keep the whole look (null: "Reset to view"). The shared view is never written. */
2449
+ declare function keepLook(client: Pick<RecordsClient, "viewLookSet">, tableId: Uuid$1, viewId: Uuid$1, look: ViewLook | null): Promise<RecordsResult<Record<string, unknown> | null>>;
2450
+ /** The words of the look bar. One sentence, then the doors. */
2451
+ declare const LOOK_WORDS: {
2452
+ readonly yours: "You changed how this view looks. Only you see it.";
2453
+ readonly saveToView: "Save to view";
2454
+ readonly saveAsNew: "Save as new view";
2455
+ readonly reset: "Reset to view";
2456
+ readonly newName: "Name for the new view";
2457
+ };
2458
+
2421
2459
  interface ViewSwitcherProps {
2422
2460
  /**
2423
2461
  * THE DECLARATIVE SPEC — an agent writes the whole thing, a person tweaks it.
@@ -4352,4 +4390,4 @@ interface PipelineBoardProps {
4352
4390
  }
4353
4391
  declare function PipelineBoard({ tableId, rows, titleKey, measure, filter, onMeasureChange, onOpenRecord, onMoved, style, dateFields, className, }: PipelineBoardProps): react.JSX.Element;
4354
4392
 
4355
- 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_VIEW_NAME, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, ENTITY_REFERENCE_KINDS_MISSING, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, EntityReferenceKindPicker, type EntityReferenceKindPickerProps, 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, type FormAsked, 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, INBOX_GROUPINGS, INBOX_VIEWS, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, type InboxGroup, type InboxGrouping, 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, 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, PortalLookEditor, type PortalLookEditorProps, 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 RenderTextSlot, 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, type SnoozeChoice, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_MENU, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, type TableOpening, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewKeyDeclaration, type ViewKeyLayout, type ViewKeyWriter, type ViewLayout, type ViewSettings, type ViewSettingsPatch, type ViewSort, type ViewSortKey, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WITHHELD_WORD, WORK_APPROVAL_STATES, WORK_APPROVAL_STATE_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_GROUP_LABEL, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, WhereItLives, type WhereItLivesProps, type WhoChanged, WhoChangedSource, WithheldValue, actorBadge, actorWords, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, calendarDayLabel, calendarDayOf, cameFromLine, cardTitleField, cardWords, carriesTimeOfDay, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, dateFormatFor, dateText, declareView, defaultViewOf, designatedLayoutOf, editorKindFor, ensureSystemTable, entityReferenceSpec, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupInbox, groupLabel, hasTimePart, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isDateField, 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, resolveTableStyle, revokeConsequence, rowName, rowNameIn, saveViewPatch, scalarText, seedIsSatisfied, shareUnavailableReason, snoozeChoices, specFromBlock, storeDecidesRights, styleFromDecorations, submissionStamp, surfaceChosen, tableName, tableOpening, tableRightsAt, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRow, viewKeysFor, viewPatchDocument, viewSettings, viewSettingsFor, viewSettingsPatch, visibilityLaneFor, whatIsMissing, whatIsMissingForEntityReference, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable, withheldNoticeOf, withheldSentence };
4393
+ 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_VIEW_NAME, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, ENTITY_REFERENCE_KINDS_MISSING, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, EntityReferenceKindPicker, type EntityReferenceKindPickerProps, 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, type FormAsked, 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, INBOX_GROUPINGS, INBOX_VIEWS, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, type InboxGroup, type InboxGrouping, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, LEVEL_WORD, LOOK_WORDS, 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, 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, PortalLookEditor, type PortalLookEditorProps, 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 RenderTextSlot, 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, type SnoozeChoice, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_MENU, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, type TableOpening, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewKeyDeclaration, type ViewKeyLayout, type ViewKeyWriter, type ViewLayout, type ViewLook, type ViewSettings, type ViewSettingsPatch, type ViewSort, type ViewSortKey, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WITHHELD_WORD, WORK_APPROVAL_STATES, WORK_APPROVAL_STATE_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_GROUP_LABEL, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, WhereItLives, type WhereItLivesProps, type WhoChanged, WhoChangedSource, WithheldValue, actorBadge, actorWords, applyLook, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, calendarDayLabel, calendarDayOf, cameFromLine, cardTitleField, cardWords, carriesTimeOfDay, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, dateFormatFor, dateText, declareView, defaultViewOf, designatedLayoutOf, editorKindFor, ensureSystemTable, entityReferenceSpec, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupInbox, groupLabel, hasTimePart, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isDateField, isEngineerText, isId, isMachineIdentity, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, keepLook, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, lookDiffers, lookDocument, lookFromDocument, lookPart, looksLikeId, machineIdentityIn, mayNotRestoreLine, memberName, nextInWords, nextSummaryAt, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, railFromParam, readLooks, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, renderValue, resolveTableStyle, revokeConsequence, rowName, rowNameIn, saveToViewPlan, saveViewPatch, scalarText, seedIsSatisfied, shareUnavailableReason, snoozeChoices, specFromBlock, storeDecidesRights, styleFromDecorations, submissionStamp, surfaceChosen, tableName, tableOpening, tableRightsAt, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRow, viewKeysFor, viewPatchDocument, viewSettings, viewSettingsFor, viewSettingsPatch, visibilityLaneFor, whatIsMissing, whatIsMissingForEntityReference, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable, withheldNoticeOf, withheldSentence };
package/dist/index.d.ts CHANGED
@@ -2418,6 +2418,44 @@ declare function viewSettingsFor(settings: ViewSettings, layout: ViewKeyLayout):
2418
2418
  */
2419
2419
  declare function viewSettingsPatch(patch: ViewSettingsPatch): Record<string, unknown>;
2420
2420
 
2421
+ /**
2422
+ * WHAT A LOOK MAY HOLD — how a person looks, never what the view is: not its name, not whether it
2423
+ * is the default (`view_designate`), not its Rule, not the flat filters the digests read, not the
2424
+ * order the store writes. The store refuses anything else by name.
2425
+ */
2426
+ type ViewLook = Partial<Pick<SavedViewSpec, "layout" | "groupField" | "swimlaneField" | "collapsedColumns" | "measure" | "dateField" | "imageField" | "sorts" | "where" | "presentation">>;
2427
+ /** Only the look's own keys of a press — a name, a default, a Rule or an order is never a look. */
2428
+ declare function lookPart(patch: Partial<SavedViewSpec>): ViewLook;
2429
+ /** The look as the definition keys the store keeps (`view_look_set`); a cleared key is null. */
2430
+ declare function lookDocument(look: ViewLook): Record<string, unknown>;
2431
+ /** A kept look back into the spec's words. Only the keys it holds; a null key is "none, for me". */
2432
+ declare function lookFromDocument(doc: Record<string, unknown> | null | undefined): ViewLook;
2433
+ /** THE VIEW AS THIS PERSON SEES IT: the saved view, with her look laid over it. */
2434
+ declare function applyLook(view: SavedView, look: ViewLook | null | undefined): SavedView;
2435
+ /** Whether the look shows anything the view does not — which is when "Save to view" means something. */
2436
+ declare function lookDiffers(view: SavedView, look: ViewLook | null | undefined): boolean;
2437
+ /**
2438
+ * WHAT "SAVE TO VIEW" SENDS, and what stays the person's own afterwards. The default view's layout
2439
+ * is the table's designation (`viewPatchFor`): it is never saved here — "Make … the default" is —
2440
+ * so a look's layout on the default view stays her look.
2441
+ */
2442
+ declare function saveToViewPlan(view: SavedView, look: ViewLook): {
2443
+ patch: Partial<SavedViewSpec>;
2444
+ left: ViewLook | null;
2445
+ };
2446
+ /** The caller's own looks at every view of a table, by view id. */
2447
+ declare function readLooks(client: Pick<RecordsClient, "viewLookRead">, tableId: Uuid$1): Promise<RecordsResult<Record<string, ViewLook>>>;
2448
+ /** Keep the whole look (null: "Reset to view"). The shared view is never written. */
2449
+ declare function keepLook(client: Pick<RecordsClient, "viewLookSet">, tableId: Uuid$1, viewId: Uuid$1, look: ViewLook | null): Promise<RecordsResult<Record<string, unknown> | null>>;
2450
+ /** The words of the look bar. One sentence, then the doors. */
2451
+ declare const LOOK_WORDS: {
2452
+ readonly yours: "You changed how this view looks. Only you see it.";
2453
+ readonly saveToView: "Save to view";
2454
+ readonly saveAsNew: "Save as new view";
2455
+ readonly reset: "Reset to view";
2456
+ readonly newName: "Name for the new view";
2457
+ };
2458
+
2421
2459
  interface ViewSwitcherProps {
2422
2460
  /**
2423
2461
  * THE DECLARATIVE SPEC — an agent writes the whole thing, a person tweaks it.
@@ -4352,4 +4390,4 @@ interface PipelineBoardProps {
4352
4390
  }
4353
4391
  declare function PipelineBoard({ tableId, rows, titleKey, measure, filter, onMeasureChange, onOpenRecord, onMoved, style, dateFields, className, }: PipelineBoardProps): react.JSX.Element;
4354
4392
 
4355
- 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_VIEW_NAME, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, ENTITY_REFERENCE_KINDS_MISSING, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, EntityReferenceKindPicker, type EntityReferenceKindPickerProps, 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, type FormAsked, 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, INBOX_GROUPINGS, INBOX_VIEWS, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, type InboxGroup, type InboxGrouping, 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, 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, PortalLookEditor, type PortalLookEditorProps, 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 RenderTextSlot, 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, type SnoozeChoice, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_MENU, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, type TableOpening, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewKeyDeclaration, type ViewKeyLayout, type ViewKeyWriter, type ViewLayout, type ViewSettings, type ViewSettingsPatch, type ViewSort, type ViewSortKey, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WITHHELD_WORD, WORK_APPROVAL_STATES, WORK_APPROVAL_STATE_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_GROUP_LABEL, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, WhereItLives, type WhereItLivesProps, type WhoChanged, WhoChangedSource, WithheldValue, actorBadge, actorWords, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, calendarDayLabel, calendarDayOf, cameFromLine, cardTitleField, cardWords, carriesTimeOfDay, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, dateFormatFor, dateText, declareView, defaultViewOf, designatedLayoutOf, editorKindFor, ensureSystemTable, entityReferenceSpec, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupInbox, groupLabel, hasTimePart, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isDateField, 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, resolveTableStyle, revokeConsequence, rowName, rowNameIn, saveViewPatch, scalarText, seedIsSatisfied, shareUnavailableReason, snoozeChoices, specFromBlock, storeDecidesRights, styleFromDecorations, submissionStamp, surfaceChosen, tableName, tableOpening, tableRightsAt, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRow, viewKeysFor, viewPatchDocument, viewSettings, viewSettingsFor, viewSettingsPatch, visibilityLaneFor, whatIsMissing, whatIsMissingForEntityReference, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable, withheldNoticeOf, withheldSentence };
4393
+ 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_VIEW_NAME, DUE_STATE_LABEL, DashboardCanvas, type DashboardCanvasProps, DigestScheduler, type DigestSchedulerProps, DocRender, type DocRenderProps, DocTemplate, type DocTemplateProps, type DocTemplateSpec, EMPTY_PRESENTATION, ENGINEER_TEXT, ENTITY_REFERENCE_KINDS_MISSING, type EditorKind, EmbedFrame, type EmbedFrameProps, type EnrichAsk, EnrichBadge, type EnrichBadgeProps, type EnrichOutcome, EnrichPanel, type EnrichPanelProps, EntityReferenceKindPicker, type EntityReferenceKindPickerProps, 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, type FormAsked, 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, INBOX_GROUPINGS, INBOX_VIEWS, IN_MEMORY_QUEUE_REASON, ImportWizard, type ImportWizardProps, type InboxGroup, type InboxGrouping, KERNEL_REASON, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LAYOUT_NEEDS, LAYOUT_NO_FIELD, LEVEL_WORD, LOOK_WORDS, 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, 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, PortalLookEditor, type PortalLookEditorProps, 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 RenderTextSlot, 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, type SnoozeChoice, StageRulesSection, type StageRulesSectionProps, StepRow, type SubscriptionChannel, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_MENU, TABLE_NOT_REACHABLE, THE_SYSTEM, type TableLane, type TableOpening, TablePage, type TablePageProps, type TableRights, TableSettings, type TableSettingsProps, TablesHome, type TablesHomeProps, type TrackedVersion, type UseSystemTableState, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NOT_SAVED_YET, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, ViewBar, type ViewBarProps, type ViewKeyDeclaration, type ViewKeyLayout, type ViewKeyWriter, type ViewLayout, type ViewLook, type ViewSettings, type ViewSettingsPatch, type ViewSort, type ViewSortKey, ViewSwitcher, type ViewSwitcherProps, type VisibilityLane, WITHHELD_RECORD_LABEL, WITHHELD_WORD, WORK_APPROVAL_STATES, WORK_APPROVAL_STATE_LABEL, WORK_DUE_STATES, WORK_INBOX_KINDS, WORK_INBOX_KIND_GROUP_LABEL, WORK_INBOX_KIND_LABEL, type WhatYouMayDo, WhereItLives, type WhereItLivesProps, type WhoChanged, WhoChangedSource, WithheldValue, actorBadge, actorWords, applyLook, archivedRowLine, asRefusal, askableFields, blockFromSpec, bodyForReading, bodyFromKeys, calendarDayLabel, calendarDayOf, cameFromLine, cardTitleField, cardWords, carriesTimeOfDay, cellState, chooseSurface, colorFromTheValue, columnForField, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, controlFor, currencyCodeFor, dashboardDeclareArgs, dashboardFromSummary, dateFormatFor, dateText, declareView, defaultViewOf, designatedLayoutOf, editorKindFor, ensureSystemTable, entityReferenceSpec, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, formDeclareArgs, formFromSummary, formPresentation, formatForField, groupInbox, groupLabel, hasTimePart, hintForAPerson, hintIsMachineIdentity, humanize, idsOf, isDateField, isEngineerText, isId, isMachineIdentity, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, keepLook, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, lookDiffers, lookDocument, lookFromDocument, lookPart, looksLikeId, machineIdentityIn, mayNotRestoreLine, memberName, nextInWords, nextSummaryAt, openingRail, openingView, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, railFromParam, readLooks, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, renderValue, resolveTableStyle, revokeConsequence, rowName, rowNameIn, saveToViewPlan, saveViewPatch, scalarText, seedIsSatisfied, shareUnavailableReason, snoozeChoices, specFromBlock, storeDecidesRights, styleFromDecorations, submissionStamp, surfaceChosen, tableName, tableOpening, tableRightsAt, unknownRailLine, unknownViewLine, useCanShare, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, useRecordLabels, useRecordRights, useRecordsUi, useRowRights, useSystemTable, useTableRights, useViewRecords, useWhoChanged, viewDocument, viewFromRow, viewKeysFor, viewPatchDocument, viewSettings, viewSettingsFor, viewSettingsPatch, visibilityLaneFor, whatIsMissing, whatIsMissingForEntityReference, whatYouMayDo, whatYouMayDoWithTable, whenWords, whyNotAskable, withheldNoticeOf, withheldSentence };
package/dist/index.js CHANGED
@@ -10607,6 +10607,86 @@ function computedInPlainWords(row, field) {
10607
10607
  return `${name} was worked out as ${shown3}${at}.`;
10608
10608
  }
10609
10609
 
10610
+ // src/viewLook.ts
10611
+ var LOOK_KEYS = [
10612
+ "layout",
10613
+ "groupField",
10614
+ "swimlaneField",
10615
+ "collapsedColumns",
10616
+ "measure",
10617
+ "dateField",
10618
+ "imageField",
10619
+ "sorts",
10620
+ "where",
10621
+ "presentation"
10622
+ ];
10623
+ function lookPart(patch) {
10624
+ const out = {};
10625
+ for (const key of LOOK_KEYS) {
10626
+ if (patch[key] !== void 0) out[key] = patch[key];
10627
+ }
10628
+ return out;
10629
+ }
10630
+ function lookDocument(look) {
10631
+ return viewSettingsPatch(look);
10632
+ }
10633
+ function lookFromDocument(doc) {
10634
+ const data = doc ?? {};
10635
+ const read = viewSettings(data);
10636
+ const out = {};
10637
+ const has = (key) => Object.prototype.hasOwnProperty.call(data, key);
10638
+ if (has("layout") && VIEW_LAYOUTS.includes(String(data["layout"]))) {
10639
+ out.layout = data["layout"];
10640
+ }
10641
+ if (has("group_field")) out.groupField = read.groupField;
10642
+ if (has("swimlane_field")) out.swimlaneField = read.swimlaneField;
10643
+ if (has("collapsed_columns")) out.collapsedColumns = read.collapsedColumns;
10644
+ if (has("measure")) out.measure = read.measure;
10645
+ if (has("date_field")) out.dateField = read.dateField;
10646
+ if (has("image_field")) out.imageField = read.imageField;
10647
+ if (has("sorts")) out.sorts = read.sorts;
10648
+ if (has("where")) out.where = read.where;
10649
+ if (has("presentation")) out.presentation = parseGridPresentation(data["presentation"]);
10650
+ return out;
10651
+ }
10652
+ function applyLook(view, look) {
10653
+ if (!look) return view;
10654
+ return { ...view, ...look };
10655
+ }
10656
+ function lookDiffers(view, look) {
10657
+ if (!look) return false;
10658
+ const shown3 = applyLook(view, look);
10659
+ return LOOK_KEYS.some(
10660
+ (key) => look[key] !== void 0 && JSON.stringify(shown3[key] ?? null) !== JSON.stringify(view[key] ?? null)
10661
+ );
10662
+ }
10663
+ function saveToViewPlan(view, look) {
10664
+ const patch = viewPatchFor(view, look);
10665
+ const left = {};
10666
+ if (look.layout !== void 0 && patch.layout === void 0 && look.layout !== view.layout) left.layout = look.layout;
10667
+ return { patch, left: Object.keys(left).length > 0 ? left : null };
10668
+ }
10669
+ async function readLooks(client, tableId) {
10670
+ const answered = await client.viewLookRead({ table_id: tableId });
10671
+ if (!answered.ok) return answered;
10672
+ const out = {};
10673
+ for (const [viewId, row] of Object.entries(answered.data ?? {})) {
10674
+ out[viewId] = lookFromDocument(row?.look ?? null);
10675
+ }
10676
+ return { ok: true, data: out };
10677
+ }
10678
+ async function keepLook(client, tableId, viewId, look) {
10679
+ const doc = look ? lookDocument(look) : null;
10680
+ return client.viewLookSet({ table_id: tableId, view_id: viewId, look: doc && Object.keys(doc).length > 0 ? doc : null });
10681
+ }
10682
+ var LOOK_WORDS = {
10683
+ yours: "You changed how this view looks. Only you see it.",
10684
+ saveToView: "Save to view",
10685
+ saveAsNew: "Save as new view",
10686
+ reset: "Reset to view",
10687
+ newName: "Name for the new view"
10688
+ };
10689
+
10610
10690
  // src/ViewSwitcher.tsx
10611
10691
  import { useEffect as useEffect23, useMemo as useMemo25, useState as useState33 } from "react";
10612
10692
  import { useFields as useFields13, useRecords as useRecords6, useRecordsClient as useRecordsClient22 } from "@ai-matrx/records/react";
@@ -11521,10 +11601,14 @@ function ViewSwitcher({
11521
11601
  viewId,
11522
11602
  order: local.order !== void 0 ? local.order : view.order ?? null,
11523
11603
  sorts: local.sorts ?? view.sorts ?? [],
11524
- onPlaced: () => {
11525
- setLocal((held) => ({ ...held, order: "manual", sorts: [] }));
11526
- onOrderPlaced?.();
11527
- },
11604
+ /* Placing the rows saves the VIEW's order, so Reorder is offered only when the
11605
+ host bound it (TablePage: to someone who may edit the table). */
11606
+ ...onOrderPlaced ? {
11607
+ onPlaced: () => {
11608
+ setLocal((held) => ({ ...held, order: "manual", sorts: [] }));
11609
+ onOrderPlaced();
11610
+ }
11611
+ } : {},
11528
11612
  ...onViewChange ? {
11529
11613
  onUseSort: (sort) => change({ sorts: [sort], order: "sorted" })
11530
11614
  } : {}
@@ -22171,6 +22255,7 @@ import {
22171
22255
  DropdownMenuRadioItem as DropdownMenuRadioItem2,
22172
22256
  DropdownMenuSeparator as DropdownMenuSeparator3,
22173
22257
  DropdownMenuTrigger as DropdownMenuTrigger4,
22258
+ Input as Input6,
22174
22259
  Separator as Separator12,
22175
22260
  Skeleton as Skeleton38,
22176
22261
  cn as cn66,
@@ -22537,6 +22622,21 @@ function TablePage({
22537
22622
  const askedInWords = filter ? filterInWords(filter, pageFields.data ?? []) : null;
22538
22623
  const organizationId = useRecordsClient56().config.organizationId;
22539
22624
  const [view, setView] = useState70(null);
22625
+ const [looks, setLooks] = useState70(void 0);
22626
+ useEffect59(() => {
22627
+ let live = true;
22628
+ setLooks(void 0);
22629
+ void readLooks(client, tableId).then((answered) => {
22630
+ if (!live) return;
22631
+ setLooks(answered.ok ? answered.data : {});
22632
+ });
22633
+ return () => {
22634
+ live = false;
22635
+ };
22636
+ }, [client, tableId]);
22637
+ const look = view && looks ? looks[view.id] : void 0;
22638
+ const shown3 = view ? applyLook(view, look) : null;
22639
+ const [viewsEpoch, setViewsEpoch] = useState70(0);
22540
22640
  const opening = openingRail(activeRecordId, activeRail);
22541
22641
  const hostLayouts = useRecordsUi().layouts ?? [];
22542
22642
  const hostLayoutFor = (asked) => openingHostLayout(asked, hostLayouts);
@@ -22571,9 +22671,9 @@ function TablePage({
22571
22671
  if (hostFromLink || opened.layout || layoutChosen) return;
22572
22672
  setHostLayout(face.hostLayout);
22573
22673
  }, [face.kind, face.kind === "designated" ? face.hostLayout : null, layoutChosen]);
22574
- const faceUnknown = !hostFromLink && !opened.layout && (views === void 0 || Array.isArray(views) && views.length > 0 && view === null);
22575
- const shownLayout = layoutFromLink ?? view?.layout ?? "grid";
22576
- const shownFilter = filter ?? (view?.where ? view.where : null) ?? (view?.filters && Object.keys(view.filters).length > 0 ? view.filters : null);
22674
+ const faceUnknown = !hostFromLink && !opened.layout && (views === void 0 || Array.isArray(views) && views.length > 0 && (view === null || looks === void 0));
22675
+ const shownLayout = layoutFromLink ?? shown3?.layout ?? "grid";
22676
+ const shownFilter = filter ?? (shown3?.where ? shown3.where : null) ?? (shown3?.filters && Object.keys(shown3.filters).length > 0 ? shown3.filters : null);
22577
22677
  const press = (pressed) => {
22578
22678
  const next = chooseSurface(surface, pressed);
22579
22679
  setSurface(next);
@@ -22628,16 +22728,79 @@ function TablePage({
22628
22728
  async (asked) => {
22629
22729
  const current = view;
22630
22730
  if (!current) return;
22631
- const patch = viewPatchFor(current, asked);
22632
- setView({ ...current, ...patch });
22633
- if (Object.keys(viewPatchDocument(patch)).length === 0 && patch.name === void 0 && patch.filters === void 0) return;
22731
+ const part = lookPart(asked);
22732
+ if (Object.keys(part).length === 0) return;
22733
+ const before = looks?.[current.id];
22734
+ const next = { ...before ?? {}, ...part };
22735
+ setLooks((all) => ({ ...all ?? {}, [current.id]: next }));
22634
22736
  setViewSaveRefused(null);
22635
- const written = await saveViewPatch(client, tableId, current.id, patch);
22636
- if (written.ok) return;
22637
- setViewSaveRefused({ error: written.error, patch, before: current });
22737
+ const kept = await keepLook(client, tableId, current.id, next);
22738
+ if (kept.ok) return;
22739
+ setViewSaveRefused({ error: kept.error, patch: asked, lookBefore: before });
22638
22740
  },
22639
- [client, tableId, view]
22741
+ [client, tableId, view, looks]
22640
22742
  );
22743
+ const lookShowing = Boolean(view && looks && lookDiffers(view, looks[view.id]));
22744
+ const [lookRefused, setLookRefused] = useState70(null);
22745
+ const [namingLook, setNamingLook] = useState70(false);
22746
+ const [lookName, setLookName] = useState70("");
22747
+ const resetLook = async () => {
22748
+ const current = view;
22749
+ if (!current) return;
22750
+ setLookRefused(null);
22751
+ setViewSaveRefused(null);
22752
+ const before = looks?.[current.id];
22753
+ setLooks((all) => {
22754
+ const { [current.id]: _gone, ...rest } = all ?? {};
22755
+ return rest;
22756
+ });
22757
+ const kept = await keepLook(client, tableId, current.id, null);
22758
+ if (!kept.ok) {
22759
+ setLooks((all) => ({ ...all ?? {}, [current.id]: before ?? {} }));
22760
+ setLookRefused(kept.error);
22761
+ }
22762
+ };
22763
+ const saveLookToView = async () => {
22764
+ const current = view;
22765
+ const mine = current && looks ? looks[current.id] : void 0;
22766
+ if (!current || !mine) return;
22767
+ setLookRefused(null);
22768
+ const { patch, left } = saveToViewPlan(current, mine);
22769
+ if (Object.keys(viewPatchDocument(patch)).length > 0) {
22770
+ const written = await saveViewPatch(client, tableId, current.id, patch);
22771
+ if (!written.ok) {
22772
+ setLookRefused(written.error);
22773
+ return;
22774
+ }
22775
+ setView({ ...current, ...patch });
22776
+ }
22777
+ setLooks((all) => {
22778
+ const { [current.id]: _saved, ...rest } = all ?? {};
22779
+ return left ? { ...rest, [current.id]: left } : rest;
22780
+ });
22781
+ const kept = await keepLook(client, tableId, current.id, left);
22782
+ if (!kept.ok) setLookRefused(kept.error);
22783
+ };
22784
+ const saveLookAsNewView = async (name) => {
22785
+ const current = view;
22786
+ const seen = shown3;
22787
+ if (!current || !seen || name.trim() === "") return;
22788
+ setLookRefused(null);
22789
+ const written = await declareView(client, { ...seen, name: name.trim(), subject: tableId, isDefault: false });
22790
+ if (!written.ok) {
22791
+ setLookRefused(written.error);
22792
+ return;
22793
+ }
22794
+ setNamingLook(false);
22795
+ setLookName("");
22796
+ setLooks((all) => {
22797
+ const { [current.id]: _moved, ...rest } = all ?? {};
22798
+ return rest;
22799
+ });
22800
+ void keepLook(client, tableId, current.id, null);
22801
+ setPickedViewId(written.data);
22802
+ setViewsEpoch((n) => n + 1);
22803
+ };
22641
22804
  const [designateRefused, setDesignateRefused] = useState70(null);
22642
22805
  const opensAs = view?.isDefault ? openingLayoutOf(view) : null;
22643
22806
  const canDesignate = Boolean(rights.write && view && layoutShowing && layoutShowing !== opensAs);
@@ -22680,7 +22843,8 @@ function TablePage({
22680
22843
  quietWhenAlone: !showViews,
22681
22844
  seed: seedViews ?? [defaultView(tableId)],
22682
22845
  className: "min-w-0 flex-1"
22683
- }
22846
+ },
22847
+ viewsEpoch
22684
22848
  ),
22685
22849
  /* @__PURE__ */ jsxs73("div", { className: "ml-auto flex shrink-0 items-center gap-1", "data-table-cluster": "", children: [
22686
22850
  chooserInline ? /* @__PURE__ */ jsxs73("div", { className: "flex items-center gap-0.5", role: "group", "aria-label": "Layout", children: [
@@ -22707,7 +22871,7 @@ function TablePage({
22707
22871
  `host:${option.id}`
22708
22872
  ))
22709
22873
  ] }) : null,
22710
- main === "records" && !hostLayout ? /* @__PURE__ */ jsx79(ViewFilter, { tableId, view, onApply: (where) => void patchView({ where }) }) : null,
22874
+ main === "records" && !hostLayout ? /* @__PURE__ */ jsx79(ViewFilter, { tableId, view: shown3, onApply: (where) => void patchView({ where }) }) : null,
22711
22875
  rights.write && view && main === "records" && !hostLayout && shownLayout !== "grid" ? /* @__PURE__ */ jsx79(Button64, { size: "sm", onClick: () => show("new-record"), children: "New record" }) : null,
22712
22876
  openedFromMenu ? /* @__PURE__ */ jsx79(
22713
22877
  Button64,
@@ -22807,7 +22971,13 @@ function TablePage({
22807
22971
  size: "sm",
22808
22972
  variant: "ghost",
22809
22973
  onClick: () => {
22810
- setView(viewSaveRefused.before);
22974
+ const current = view;
22975
+ if (current) {
22976
+ setLooks((all) => {
22977
+ const { [current.id]: _dropped, ...rest } = all ?? {};
22978
+ return viewSaveRefused.lookBefore ? { ...rest, [current.id]: viewSaveRefused.lookBefore } : rest;
22979
+ });
22980
+ }
22811
22981
  setViewSaveRefused(null);
22812
22982
  },
22813
22983
  children: "Discard"
@@ -22816,6 +22986,36 @@ function TablePage({
22816
22986
  ] })
22817
22987
  }
22818
22988
  ) : null,
22989
+ lookShowing && main === "records" ? /* @__PURE__ */ jsxs73("div", { className: "flex min-w-0 flex-wrap items-center gap-1.5 text-xs text-muted-foreground", "data-view-look": "", children: [
22990
+ /* @__PURE__ */ jsx79("span", { className: "truncate", children: LOOK_WORDS.yours }),
22991
+ rights.write && view && Object.keys(viewPatchDocument(saveToViewPlan(view, look ?? {}).patch)).length > 0 ? /* @__PURE__ */ jsx79(Button64, { size: "sm", variant: "outline", className: "h-7", onClick: () => void saveLookToView(), "data-view-look-save": "", children: LOOK_WORDS.saveToView }) : null,
22992
+ rights.write ? namingLook ? /* @__PURE__ */ jsxs73(
22993
+ "form",
22994
+ {
22995
+ className: "flex items-center gap-1",
22996
+ onSubmit: (e) => {
22997
+ e.preventDefault();
22998
+ void saveLookAsNewView(lookName);
22999
+ },
23000
+ children: [
23001
+ /* @__PURE__ */ jsx79(
23002
+ Input6,
23003
+ {
23004
+ autoFocus: true,
23005
+ "aria-label": LOOK_WORDS.newName,
23006
+ value: lookName,
23007
+ onChange: (e) => setLookName(e.target.value),
23008
+ className: "h-7 w-44 text-xs",
23009
+ placeholder: "View name"
23010
+ }
23011
+ ),
23012
+ /* @__PURE__ */ jsx79(Button64, { size: "sm", type: "submit", className: "h-7", disabled: lookName.trim() === "", children: "Save" })
23013
+ ]
23014
+ }
23015
+ ) : /* @__PURE__ */ jsx79(Button64, { size: "sm", variant: "ghost", className: "h-7", onClick: () => setNamingLook(true), "data-view-look-save-new": "", children: LOOK_WORDS.saveAsNew }) : null,
23016
+ /* @__PURE__ */ jsx79(Button64, { size: "sm", variant: "ghost", className: "h-7", onClick: () => void resetLook(), "data-view-look-reset": "", children: LOOK_WORDS.reset })
23017
+ ] }) : null,
23018
+ lookRefused ? /* @__PURE__ */ jsx79(RefusalNotice, { error: lookRefused }) : null,
22819
23019
  main === "dashboards" ? /* @__PURE__ */ jsx79(DashboardCanvas, { tableId, activeDashboardId: activeDashboardId ?? null }) : main === "archived" ? (
22820
23020
  /* THE ROWS THAT LEFT. Restoring one puts it back in the grid, so the
22821
23021
  page returns to the records rather than leaving the person looking
@@ -22851,7 +23051,7 @@ function TablePage({
22851
23051
  chooser: false,
22852
23052
  openExport: () => setRail("export"),
22853
23053
  view: {
22854
- ...view ?? defaultView(tableId),
23054
+ ...shown3 ?? defaultView(tableId),
22855
23055
  layout: shownLayout,
22856
23056
  // The address's field wins for this visit; silence keeps the
22857
23057
  // saved view's own choice, exactly as it always did.
@@ -22872,7 +23072,12 @@ function TablePage({
22872
23072
  ...view ? { onViewChange: (patch) => void patchView(patch) } : {},
22873
23073
  ...view ? {
22874
23074
  viewId: view.id,
22875
- onOrderPlaced: () => setView((current) => current ? { ...current, order: "manual", sorts: [] } : current)
23075
+ /* A hand-set order is the VIEW's sort for everybody (VIEW-STATE-PERSONAL): placing
23076
+ the rows is saving to the view, so it is offered to someone who may edit the
23077
+ table and is absent otherwise (the store refuses it too). */
23078
+ ...rights.write ? {
23079
+ onOrderPlaced: () => setView((current) => current ? { ...current, order: "manual", sorts: [] } : current)
23080
+ } : {}
22876
23081
  } : {},
22877
23082
  ...rights.write ? { onNewRecordForm: () => setRail("new-record") } : {},
22878
23083
  onOpenRecord: (recordId) => {
@@ -23055,6 +23260,7 @@ export {
23055
23260
  LAYOUT_NEEDS,
23056
23261
  LAYOUT_NO_FIELD,
23057
23262
  LEVEL_WORD,
23263
+ LOOK_WORDS,
23058
23264
  MACHINE_IDENTITY,
23059
23265
  MAX_ROW_HEIGHT,
23060
23266
  MIN_ROW_HEIGHT,
@@ -23154,6 +23360,7 @@ export {
23154
23360
  actorBadge,
23155
23361
  actorWords,
23156
23362
  addFields,
23363
+ applyLook,
23157
23364
  archivedRowLine,
23158
23365
  asRefusal,
23159
23366
  askableFields,
@@ -23213,11 +23420,16 @@ export {
23213
23420
  isPlainFieldType,
23214
23421
  isRelationFieldType,
23215
23422
  isSignatureField,
23423
+ keepLook,
23216
23424
  keptByTheApp,
23217
23425
  keyFor,
23218
23426
  kindsWithNoChoice,
23219
23427
  laneFor,
23220
23428
  lastChangeSentence,
23429
+ lookDiffers,
23430
+ lookDocument,
23431
+ lookFromDocument,
23432
+ lookPart,
23221
23433
  looksLikeId,
23222
23434
  machineIdentityIn,
23223
23435
  mayNotRestoreLine,
@@ -23238,6 +23450,7 @@ export {
23238
23450
  previewWords,
23239
23451
  publiclyAnswerable,
23240
23452
  railFromParam,
23453
+ readLooks,
23241
23454
  recordName,
23242
23455
  recordNameIn,
23243
23456
  recordsDataSource,
@@ -23251,6 +23464,7 @@ export {
23251
23464
  revokeConsequence,
23252
23465
  rowName,
23253
23466
  rowNameIn,
23467
+ saveToViewPlan,
23254
23468
  saveViewPatch,
23255
23469
  scalarText,
23256
23470
  seedIsSatisfied,