@ai-matrx/records-ui 0.101.7 → 0.101.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
@@ -720,6 +720,14 @@ interface RecordsUiHost {
720
720
  };
721
721
  /** Density for every table this package renders. */
722
722
  density?: "condensed" | "normal" | "spacious";
723
+ /**
724
+ * OPTIONAL. WHETHER A WITHHELD CONTROL SAYS WHAT LEVEL IT TAKES ("You are Viewer here, and it takes
725
+ * Editor to … Ask somebody who is Admin on it to move you up."). Default `true`. A host whose
726
+ * person has no level to be moved up to — a template preview, a public look at a table — sets
727
+ * `false`: the control stays absent exactly as before, without the sentence. It changes words
728
+ * only, never what is offered.
729
+ */
730
+ sayLevelNeeded?: boolean;
723
731
  /**
724
732
  * OPTIONAL. Where a file a person attached actually goes. A File is a record
725
733
  * in the kernel File Table (REC-31), but the BYTES are the host's file
@@ -1124,14 +1132,6 @@ declare function RecordsUiProvider({ value, children }: {
1124
1132
  children: ReactNode;
1125
1133
  }): react.JSX.Element;
1126
1134
  declare function useRecordsUi(): RecordsUiHost;
1127
- /**
1128
- * WHAT THIS PERSON MAY DO TO THIS TABLE — asked, once per table.
1129
- *
1130
- * A host that binds `rights` still wins: a portal, an embed or an app with its
1131
- * own authority is entitled to a narrower answer than the store's. An unbound
1132
- * host no longer gets a guess in either direction — while the door is
1133
- * answering, `known` is false and NOTHING is offered and nothing is claimed.
1134
- */
1135
1135
  declare function useTableRights(table: Table | null | undefined): TableRights;
1136
1136
  /**
1137
1137
  * WHAT THIS PERSON MAY DO TO ONE RECORD — which is a different question from
@@ -6759,10 +6759,16 @@ interface TemplatePreviewProps {
6759
6759
  host?: RecordsUiHost | undefined;
6760
6760
  /** Drawn above the table page, beside the table picker (e.g. "Use this template"). */
6761
6761
  aside?: ReactNode;
6762
+ /**
6763
+ * The host's booking page, drawn from what the store's `booking_public` door answers for one of the
6764
+ * template's booking pages. Unbound, booking pages are not drawn (this package has no stranger's
6765
+ * booking page of its own).
6766
+ */
6767
+ booking?: ((page: Record<string, unknown>) => ReactNode) | undefined;
6762
6768
  className?: string | undefined;
6763
6769
  }
6764
6770
  /** The in-memory store for a spec, built once per spec and day. */
6765
6771
  declare function useTemplatePreview(spec: TemplateSpec, today?: string): TemplatePreview$1;
6766
- declare function TemplatePreview({ spec, today, initialTable, host, aside, className }: TemplatePreviewProps): react.JSX.Element | null;
6772
+ declare function TemplatePreview({ spec, today, initialTable, host, aside, booking, className }: TemplatePreviewProps): react.JSX.Element | null;
6767
6773
 
6768
6774
  export { ABSENCE_WORD_LABEL, ABSENCE_WORD_VALUES, ACTION_KINDS, ARCHIVED_NEVER_DESTROYED, ARCHIVE_MEANS, ASK_EXAMPLE, type AbsenceWord, AccentSwatches, type AccentSwatchesProps, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, type AnnounceTableArchived, type AppletPageBlock, ArchiveDeliberatelyDialog, type ArchiveDeliberatelyDialogProps, ArchivedDisclosure, type ArchivedDisclosureProps, ArchivedPortals, type ArchivedPortalsProps, ArchivedView, type ArchivedViewProps, type AskRead, BODY_COLUMN_NAME, BODY_SAVE_PAUSE_MS, 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, type ButtonPageBlock, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_REQUIREMENT_KINDS, CHECKLIST_REQUIREMENT_LABEL, CONDITION_OPS, CONTEXT_POLICY_LABEL, ADDABLE_TYPES as CUSTOM_FIELD_ADDABLE_TYPES, type CalendarMode, CalendarView, type CalendarViewProps, 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 ChartPageBlock, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, type ChoiceAddition, type ChoiceAsk, ChoiceAskButtons, ChoiceListEditor, type ChoiceListRow, type CombinedRows, CommentThread, type CommentThreadProps, type ConditionField, ConditionGroup, type ConditionGroupProps, ConditionRow, type ConditionRowProps, type CustomFieldAddRequest, type CustomFieldAddResult, type CustomFieldSetResult, type CustomFieldValuesRequest, type CustomFieldsAgentDoor, type CustomFieldsAgentState, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FOOTER, 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_CATALOGUE, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FOOTER_WORDS, 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 FilterPageBlock, type FooterPlacement, type FormAsked, FormBuilder, type FormBuilderProps, type FormFlow, type FormLook, FormLookFrame, type FormLookFrameProps, FormLookLogo, type FormLookView, type FormPageBlock, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, type FormulaOp, Grid, GridCell, type GridContextRecord, type GridContextSnapshot, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, GuessedFieldType, type HeadingPageBlock, HistoryPanel, type HistoryPanelProps, type HostLayout, INBOX_GROUPINGS, INBOX_VIEWS, IN_MEMORY_QUEUE_REASON, ImportNotice, type ImportNoticeProps, type ImportSource, ImportWizard, type ImportWizardProps, InTableToolbar, type InboxGroup, type InboxGrouping, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LOOK_WORDS, type LabelLookup, type LinkRail, type ListPageBlock, MACHINE_IDENTITY, MANUAL_SORT, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, MOST_NEW_COLUMNS, type MainView, type MoveWritten, MyChecklistSteps, NEEDS_A_SENTENCE, NEW_COLUMN_TYPES, 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 NewColumn, type NewColumnType, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, ObjectAction, ObjectActionContextMenuItems, ObjectActionGlyph, ObjectActionIcon, ObjectActionMenuItems, type ObjectActionMenuItemsProps, type OpenRecordsAsk, type OrganizationMember, PAGE_BLOCK_KINDS, PAGE_BLOCK_LABEL, PAGE_KIND, PAGE_VIEWS, PAGE_VIEW_LABEL, PARITY_LABEL, PARITY_MADE_OF, PORTAL_NOT_HERE_LINE, PROPOSED_CHANGE_ACT_LABEL, PROPOSED_CHANGE_ACT_VALUES, type PageBlock, type PageBlockKind, PageScreen, type PageScreenProps, type PageView, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, PickOrAdd, type PickOrAddItem, type PickOrAddProps, type PickableFieldType, type PickerTable, 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, PublicPicturePicker, type PublicPicturePickerProps, PublicViewPage, type PublicViewPageProps, QUESTION_OPS, QUESTION_SURFACE, type QuestionAnswer, QuestionAnswerView, type QuestionGroup, type QuestionMeasure, type QuestionOp, QuestionPanel, type QuestionPanelProps, type QuestionRow, type QuestionShow, type QuestionSpec, ROLLUP_AGG_LABEL, ROLLUP_AGG_VALUES, RULE_NOT_HERE_LINE, type ReaskContext, type ReasonGroup, type RecordActionHost, RecordActionMenu, type RecordActionMenuProps, type RecordActionSubject, type RecordActionsInput, RecordBody, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, type RecordMoves, type RecordPageBlock, RecordPanel, type RecordPanelProps, RecordValue, RecordsMount, type RecordsMountProps, RecordsTableCard, type RecordsTableCardProps, type RecordsUiHost, RecordsUiProvider, ReferenceBuilder, type ReferenceBuilderProps, type ReferenceChoice, RefusalLine, RefusalNotice, type RefusedRow, type RelationFieldType, RelationPicker, type RelationPickerProps, type RenderTextSlot, type ResolveName, type RichTextEditProps, type RollupAgg, SAVED_VIEWS_UNAVAILABLE, SAVE_TO_TABLE_TYPES, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SECTIONS_UNKNOWN, SERIES_COLORS, SHARE_NOT_YOURS_LINE, SIGNED_WORD, SOMEBODY, STAGE_RULE_ON_FAIL_LABEL, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, STORE_KEEPS_TIMELINE, STORE_KEPT_LAYOUTS, SUBSCRIPTION_CADENCES, SUBSCRIPTION_CADENCE_LABEL, SUBSCRIPTION_CHANNEL_LABEL, SUBSCRIPTION_CHANNEL_VALUES, SaveToTable, type SaveToTableProps, type SaveToTableSource, type SavedDashboard, type SavedForm, type SavedQuestion, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, ShowListsToggle, type ShownViewReport, SignBlock, type SignBlockProps, SignaturePad, SignatureValue, type SnoozeChoice, type SortStateAction, SortStateControl, type SortStateControlProps, StageRulesSection, type StageRulesSectionProps, type StandardColumn, StandardRecordForm, type StandardRecordFormProps, StepRow, type SubscriptionChannel, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NAME_MAX, TABLE_NOT_REACHABLE, THE_SYSTEM, TIMELINE_ZOOMS, TableActionHost, TableAsk, type TableAskProps, TableDetails, TableDuplicateDialog, type TableDuplicateDialogProps, TableFoundationSwitch, type TableLane, type TableOpening, TablePage, type TablePageActionHost, type TablePageHeaderChrome, type TablePageProps, type TablePickerEntries, type TablePickerEntry, TableReferenceDialog, TableRenameDialog, TableRestoreRefused, type TableRights, TableSettings, type TableSettingsProps, TableShape, TableToolbarSlotContext, TablesHome, type TablesHomeProps, TemplatePreview, type TemplatePreviewProps, type TextPageBlock, type ThroughCondition, type TimelineSettings, TimelineView, type TimelineViewProps, type TimelineZoom, type TitleRepeats, type TrackedVersion, UNREAD_RECORD_LABEL, type UseSystemTableState, VIEW_ADDRESS_KEYS, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NEEDS, VIEW_NOT_SAVED_YET, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, type ViewAddressSort, type ViewAddressState, ViewBar, type ViewBarProps, type ViewKeyDeclaration, type ViewKeyLayout, type ViewKeyWriter, type ViewLayout, type ViewLook, type ViewNeed, type ViewNeedKind, ViewNeeds, type ViewNeedsProps, 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, WhatYouMayDo, WhereItLives, type WhereItLivesProps, type WhoChanged, WhoChangedSource, WithheldValue, actorBadge, actorWords, addDays, announceTableArchived, applyLook, archiveConfirmSentence, archivedRowLine, asRefusal, askExampleFor, askQuestion, askableFields, blockFromSpec, bodyFieldOf, bodyForReading, bodyFromKeys, calendarDayLabel, calendarDayOf, cameFromLine, cardTitleField, cardWords, carriesTimeOfDay, cellState, choiceAddition, choiceAskSentence, choiceListPatch, choiceNudgeOf, choiceRowsFrom, chooseSurface, codeDependsRefusal, colorFromTheValue, columnDeclarationFor, columnForField, columnFromName, columnNamesFrom, columnsFrom, combineFilter, combineRows, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, controlFor, copyNameFor, currencyCodeFor, customFieldRequestProblems, dashboardDeclareArgs, dashboardFromSummary, dateFormatFor, dateText, dayAt, dayKeyOf, daysBetween, declareView, defaultViewOf, descriptionPatch, designatedLayoutOf, drawnBelowOnPage, drawnSignatureOf, drillDimensionsOf, drillMeasuresOf, drillPathsOf, drillWhere, duplicateProgressWords, editorKindFor, ensureSystemTable, entityReferenceSpec, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, fieldsForNewColumns, filterTargets, flatWhere, footerOf, formDeclareArgs, formFromSummary, formLookDocument, formLookFromDocument, formLookView, formPresentation, formatForField, freeColumnName, freshFormName, gridContextKey, gridContextSnapshot, groupInbox, groupLabel, groupReasons, groupableFields, handOrderLine, handOrderSortState, hasTimePart, hintForAPerson, hintIsMachineIdentity, idsOf, isChoiceAddition, isDateField, isEngineerText, isFoundationTable, isId, isKeptTable, isMachineIdentity, isPage, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, isValueSet, isViewAddressEmpty, keepLook, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, lookDiffers, lookDocument, lookFromDocument, lookPart, looksLikeId, machineIdentityIn, mayNotRestoreLine, measurableFields, memberName, moveRecordValue, newQuestion, nextInWords, nextSummaryAt, notAChoiceSentence, onlyCandidate, openingRail, openingView, packOverlaps, pageBlocksOf, pagePresentation, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pickableTypeOf, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, questionArchive, questionFromDefinition, questionFromWords, questionSave, questionsOf, railFromParam, readLooks, recordActions, recordLink, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, refusedFileName, refusedRowsCsv, renderValue, rescheduledValue, resolveTableStyle, revokeConsequence, rowLabelChoices, rowName, rowNameIn, runToNotice, sameRecordLikely, sameViewAddress, saveToViewPlan, saveViewPatch, scalarText, seedIsSatisfied, shapesOfSource, shareUnavailableReason, signatureFileIn, signatureFileOf, signatureWords, singularNoun, snoozeChoices, specFromBlock, standardTokenOf, starterPageBlocks, storeDecidesRights, storeKeepsLayout, storePublishesKind, styleFromDecorations, submissionStamp, surfaceChosen, tableName, tableNameProblem, tableOpening, tablePickerEntries, tableReferenceChoices, tableRightsAt, titleRepeats, unknownRailLine, unknownViewLine, unreadableKeys, useCanShare, useChoiceNudge, useDrill, useDrillAnswers, useDrillDefinition, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, usePickerTables, useRecordActionHost, useRecordLabels, useRecordMoves, useRecordRights, useRecordsUi, useRowColorBy, useRowRights, useSystemTable, useTableRights, useTableToolbarSlot, useTemplatePreview, useViewRecords, useWhoChanged, viewActions, viewAddressFromParams, viewAddressToParams, viewDocument, viewFromRow, viewKeysFor, viewNeedFor, viewPatchDocument, viewSettings, viewSettingsFor, viewSettingsPatch, visibilityLaneFor, whatIsMissing, whatIsMissingForEntityReference, whatTheChoiceListIsMissing, whenWords, whyNotAskable, withheldNoticeOf, withheldSentence, withoutAddition, wordsList };
package/dist/index.d.ts CHANGED
@@ -720,6 +720,14 @@ interface RecordsUiHost {
720
720
  };
721
721
  /** Density for every table this package renders. */
722
722
  density?: "condensed" | "normal" | "spacious";
723
+ /**
724
+ * OPTIONAL. WHETHER A WITHHELD CONTROL SAYS WHAT LEVEL IT TAKES ("You are Viewer here, and it takes
725
+ * Editor to … Ask somebody who is Admin on it to move you up."). Default `true`. A host whose
726
+ * person has no level to be moved up to — a template preview, a public look at a table — sets
727
+ * `false`: the control stays absent exactly as before, without the sentence. It changes words
728
+ * only, never what is offered.
729
+ */
730
+ sayLevelNeeded?: boolean;
723
731
  /**
724
732
  * OPTIONAL. Where a file a person attached actually goes. A File is a record
725
733
  * in the kernel File Table (REC-31), but the BYTES are the host's file
@@ -1124,14 +1132,6 @@ declare function RecordsUiProvider({ value, children }: {
1124
1132
  children: ReactNode;
1125
1133
  }): react.JSX.Element;
1126
1134
  declare function useRecordsUi(): RecordsUiHost;
1127
- /**
1128
- * WHAT THIS PERSON MAY DO TO THIS TABLE — asked, once per table.
1129
- *
1130
- * A host that binds `rights` still wins: a portal, an embed or an app with its
1131
- * own authority is entitled to a narrower answer than the store's. An unbound
1132
- * host no longer gets a guess in either direction — while the door is
1133
- * answering, `known` is false and NOTHING is offered and nothing is claimed.
1134
- */
1135
1135
  declare function useTableRights(table: Table | null | undefined): TableRights;
1136
1136
  /**
1137
1137
  * WHAT THIS PERSON MAY DO TO ONE RECORD — which is a different question from
@@ -6759,10 +6759,16 @@ interface TemplatePreviewProps {
6759
6759
  host?: RecordsUiHost | undefined;
6760
6760
  /** Drawn above the table page, beside the table picker (e.g. "Use this template"). */
6761
6761
  aside?: ReactNode;
6762
+ /**
6763
+ * The host's booking page, drawn from what the store's `booking_public` door answers for one of the
6764
+ * template's booking pages. Unbound, booking pages are not drawn (this package has no stranger's
6765
+ * booking page of its own).
6766
+ */
6767
+ booking?: ((page: Record<string, unknown>) => ReactNode) | undefined;
6762
6768
  className?: string | undefined;
6763
6769
  }
6764
6770
  /** The in-memory store for a spec, built once per spec and day. */
6765
6771
  declare function useTemplatePreview(spec: TemplateSpec, today?: string): TemplatePreview$1;
6766
- declare function TemplatePreview({ spec, today, initialTable, host, aside, className }: TemplatePreviewProps): react.JSX.Element | null;
6772
+ declare function TemplatePreview({ spec, today, initialTable, host, aside, booking, className }: TemplatePreviewProps): react.JSX.Element | null;
6767
6773
 
6768
6774
  export { ABSENCE_WORD_LABEL, ABSENCE_WORD_VALUES, ACTION_KINDS, ARCHIVED_NEVER_DESTROYED, ARCHIVE_MEANS, ASK_EXAMPLE, type AbsenceWord, AccentSwatches, type AccentSwatchesProps, ActionInbox, type ActionInboxProps, type ActionKind, type AgentBuildAsk, type AnnounceTableArchived, type AppletPageBlock, ArchiveDeliberatelyDialog, type ArchiveDeliberatelyDialogProps, ArchivedDisclosure, type ArchivedDisclosureProps, ArchivedPortals, type ArchivedPortalsProps, ArchivedView, type ArchivedViewProps, type AskRead, BODY_COLUMN_NAME, BODY_SAVE_PAUSE_MS, 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, type ButtonPageBlock, CAPTURE_MODES, CHART_KINDS, CHART_KIND_LABEL, CHART_NEEDS, CHECKLIST_REQUIREMENT_KINDS, CHECKLIST_REQUIREMENT_LABEL, CONDITION_OPS, CONTEXT_POLICY_LABEL, ADDABLE_TYPES as CUSTOM_FIELD_ADDABLE_TYPES, type CalendarMode, CalendarView, type CalendarViewProps, 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 ChartPageBlock, type ChartSpec, ChartTooltipContent, ChecklistRunner, type ChecklistRunnerProps, ChecklistTemplateEditor, ChecklistsPanel, type ChecklistsPanelProps, type ChoiceAddition, type ChoiceAsk, ChoiceAskButtons, ChoiceListEditor, type ChoiceListRow, type CombinedRows, CommentThread, type CommentThreadProps, type ConditionField, ConditionGroup, type ConditionGroupProps, ConditionRow, type ConditionRowProps, type CustomFieldAddRequest, type CustomFieldAddResult, type CustomFieldSetResult, type CustomFieldValuesRequest, type CustomFieldsAgentDoor, type CustomFieldsAgentState, CustomFieldsSection, type CustomFieldsSectionProps, DEFAULT_FOOTER, 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_CATALOGUE, FIELD_TYPE_CHOICES, FIELD_TYPE_GROUPS, FOOTER_WORDS, 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 FilterPageBlock, type FooterPlacement, type FormAsked, FormBuilder, type FormBuilderProps, type FormFlow, type FormLook, FormLookFrame, type FormLookFrameProps, FormLookLogo, type FormLookView, type FormPageBlock, type FormQuestionSpec, FormRunner, type FormRunnerProps, type FormSpec, type FormSubmitOutcome, type FormTheme, FormsPanel, type FormsPanelProps, type FormulaOp, Grid, GridCell, type GridContextRecord, type GridContextSnapshot, type GridEditing, type GridGrouping, type GridPresentation, type GridProps, GuessedFieldType, type HeadingPageBlock, HistoryPanel, type HistoryPanelProps, type HostLayout, INBOX_GROUPINGS, INBOX_VIEWS, IN_MEMORY_QUEUE_REASON, ImportNotice, type ImportNoticeProps, type ImportSource, ImportWizard, type ImportWizardProps, InTableToolbar, type InboxGroup, type InboxGrouping, LANE_EMPTY, LANE_TITLE, LAYOUT_FIELD_KIND, LAYOUT_LABEL, LOOK_WORDS, type LabelLookup, type LinkRail, type ListPageBlock, MACHINE_IDENTITY, MANUAL_SORT, MAX_ROW_HEIGHT, MIN_ROW_HEIGHT, MOST_NEW_COLUMNS, type MainView, type MoveWritten, MyChecklistSteps, NEEDS_A_SENTENCE, NEW_COLUMN_TYPES, 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 NewColumn, type NewColumnType, NotifyRuleEditor, type NotifyRuleEditorProps, type NotifyRuleSpec, ObjectAction, ObjectActionContextMenuItems, ObjectActionGlyph, ObjectActionIcon, ObjectActionMenuItems, type ObjectActionMenuItemsProps, type OpenRecordsAsk, type OrganizationMember, PAGE_BLOCK_KINDS, PAGE_BLOCK_LABEL, PAGE_KIND, PAGE_VIEWS, PAGE_VIEW_LABEL, PARITY_LABEL, PARITY_MADE_OF, PORTAL_NOT_HERE_LINE, PROPOSED_CHANGE_ACT_LABEL, PROPOSED_CHANGE_ACT_VALUES, type PageBlock, type PageBlockKind, PageScreen, type PageScreenProps, type PageView, Peek, type PeekProps, type PendingCapture, PersonPicker, type PersonPickerProps, PickOrAdd, type PickOrAddItem, type PickOrAddProps, type PickableFieldType, type PickerTable, 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, PublicPicturePicker, type PublicPicturePickerProps, PublicViewPage, type PublicViewPageProps, QUESTION_OPS, QUESTION_SURFACE, type QuestionAnswer, QuestionAnswerView, type QuestionGroup, type QuestionMeasure, type QuestionOp, QuestionPanel, type QuestionPanelProps, type QuestionRow, type QuestionShow, type QuestionSpec, ROLLUP_AGG_LABEL, ROLLUP_AGG_VALUES, RULE_NOT_HERE_LINE, type ReaskContext, type ReasonGroup, type RecordActionHost, RecordActionMenu, type RecordActionMenuProps, type RecordActionSubject, type RecordActionsInput, RecordBody, RecordChat, type RecordChatContext, type RecordChatEntry, type RecordChatProps, type RecordChatWithheld, RecordChip, RecordForm, type RecordFormProps, RecordLabelProvider, type RecordMoves, type RecordPageBlock, RecordPanel, type RecordPanelProps, RecordValue, RecordsMount, type RecordsMountProps, RecordsTableCard, type RecordsTableCardProps, type RecordsUiHost, RecordsUiProvider, ReferenceBuilder, type ReferenceBuilderProps, type ReferenceChoice, RefusalLine, RefusalNotice, type RefusedRow, type RelationFieldType, RelationPicker, type RelationPickerProps, type RenderTextSlot, type ResolveName, type RichTextEditProps, type RollupAgg, SAVED_VIEWS_UNAVAILABLE, SAVE_TO_TABLE_TYPES, SAY_WHAT_YOU_ARE_WAITING_FOR_AFTER_MS, SECTIONS_UNKNOWN, SERIES_COLORS, SHARE_NOT_YOURS_LINE, SIGNED_WORD, SOMEBODY, STAGE_RULE_ON_FAIL_LABEL, STORE_ANSWERS_THESE, STORE_DECIDES_REASON, STORE_KEEPS_TIMELINE, STORE_KEPT_LAYOUTS, SUBSCRIPTION_CADENCES, SUBSCRIPTION_CADENCE_LABEL, SUBSCRIPTION_CHANNEL_LABEL, SUBSCRIPTION_CHANNEL_VALUES, SaveToTable, type SaveToTableProps, type SaveToTableSource, type SavedDashboard, type SavedForm, type SavedQuestion, type SavedView, type SavedViewSpec, ShareControl, type ShareControlProps, type ShareSubject, ShowListsToggle, type ShownViewReport, SignBlock, type SignBlockProps, SignaturePad, SignatureValue, type SnoozeChoice, type SortStateAction, SortStateControl, type SortStateControlProps, StageRulesSection, type StageRulesSectionProps, type StandardColumn, StandardRecordForm, type StandardRecordFormProps, StepRow, type SubscriptionChannel, SubscriptionsPanel, type SubscriptionsPanelProps, type Surface, type SurfacePress, type SystemFieldSpec, type SystemTableSpec, TABLE_LANES, TABLE_NAME_MAX, TABLE_NOT_REACHABLE, THE_SYSTEM, TIMELINE_ZOOMS, TableActionHost, TableAsk, type TableAskProps, TableDetails, TableDuplicateDialog, type TableDuplicateDialogProps, TableFoundationSwitch, type TableLane, type TableOpening, TablePage, type TablePageActionHost, type TablePageHeaderChrome, type TablePageProps, type TablePickerEntries, type TablePickerEntry, TableReferenceDialog, TableRenameDialog, TableRestoreRefused, type TableRights, TableSettings, type TableSettingsProps, TableShape, TableToolbarSlotContext, TablesHome, type TablesHomeProps, TemplatePreview, type TemplatePreviewProps, type TextPageBlock, type ThroughCondition, type TimelineSettings, TimelineView, type TimelineViewProps, type TimelineZoom, type TitleRepeats, type TrackedVersion, UNREAD_RECORD_LABEL, type UseSystemTableState, VIEW_ADDRESS_KEYS, VIEW_KEYS, VIEW_LAYOUTS, VIEW_NEEDS, VIEW_NOT_SAVED_YET, VISIBILITY_LANES, VISIBILITY_LANE_TITLE, type ViewAddressSort, type ViewAddressState, ViewBar, type ViewBarProps, type ViewKeyDeclaration, type ViewKeyLayout, type ViewKeyWriter, type ViewLayout, type ViewLook, type ViewNeed, type ViewNeedKind, ViewNeeds, type ViewNeedsProps, 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, WhatYouMayDo, WhereItLives, type WhereItLivesProps, type WhoChanged, WhoChangedSource, WithheldValue, actorBadge, actorWords, addDays, announceTableArchived, applyLook, archiveConfirmSentence, archivedRowLine, asRefusal, askExampleFor, askQuestion, askableFields, blockFromSpec, bodyFieldOf, bodyForReading, bodyFromKeys, calendarDayLabel, calendarDayOf, cameFromLine, cardTitleField, cardWords, carriesTimeOfDay, cellState, choiceAddition, choiceAskSentence, choiceListPatch, choiceNudgeOf, choiceRowsFrom, chooseSurface, codeDependsRefusal, colorFromTheValue, columnDeclarationFor, columnForField, columnFromName, columnNamesFrom, columnsFrom, combineFilter, combineRows, conditionInWords, conditionIsDrawable, conditionIsSimple, conditionValue, controlFor, copyNameFor, currencyCodeFor, customFieldRequestProblems, dashboardDeclareArgs, dashboardFromSummary, dateFormatFor, dateText, dayAt, dayKeyOf, daysBetween, declareView, defaultViewOf, descriptionPatch, designatedLayoutOf, drawnBelowOnPage, drawnSignatureOf, drillDimensionsOf, drillMeasuresOf, drillPathsOf, drillWhere, duplicateProgressWords, editorKindFor, ensureSystemTable, entityReferenceSpec, envelopeFor, fieldIsEditable, fieldName, fieldToken, fieldTypeChoice, fieldTypeLabel, fieldsForNewColumns, filterTargets, flatWhere, footerOf, formDeclareArgs, formFromSummary, formLookDocument, formLookFromDocument, formLookView, formPresentation, formatForField, freeColumnName, freshFormName, gridContextKey, gridContextSnapshot, groupInbox, groupLabel, groupReasons, groupableFields, handOrderLine, handOrderSortState, hasTimePart, hintForAPerson, hintIsMachineIdentity, idsOf, isChoiceAddition, isDateField, isEngineerText, isFoundationTable, isId, isKeptTable, isMachineIdentity, isPage, isParityFieldType, isPlainFieldType, isRelationFieldType, isSignatureField, isValueSet, isViewAddressEmpty, keepLook, keptByTheApp, keyFor, kindsWithNoChoice, laneFor, lastChangeSentence, lookDiffers, lookDocument, lookFromDocument, lookPart, looksLikeId, machineIdentityIn, mayNotRestoreLine, measurableFields, memberName, moveRecordValue, newQuestion, nextInWords, nextSummaryAt, notAChoiceSentence, onlyCandidate, openingRail, openingView, packOverlaps, pageBlocksOf, pagePresentation, pageViewFromParam, parityTypesWithNoExplanation, parseGridPresentation, personActor, personRecordForMember, pickableTypeOf, pointsAtRecords, presentationDocument, presentationIsEmpty, previewLine, previewWords, publiclyAnswerable, questionArchive, questionFromDefinition, questionFromWords, questionSave, questionsOf, railFromParam, readLooks, recordActions, recordLink, recordName, recordNameIn, recordsDataSource, refusal, refusalForAPerson, refusalFromThrown, refusalLineForAPerson, refusalOr, refusedFileName, refusedRowsCsv, renderValue, rescheduledValue, resolveTableStyle, revokeConsequence, rowLabelChoices, rowName, rowNameIn, runToNotice, sameRecordLikely, sameViewAddress, saveToViewPlan, saveViewPatch, scalarText, seedIsSatisfied, shapesOfSource, shareUnavailableReason, signatureFileIn, signatureFileOf, signatureWords, singularNoun, snoozeChoices, specFromBlock, standardTokenOf, starterPageBlocks, storeDecidesRights, storeKeepsLayout, storePublishesKind, styleFromDecorations, submissionStamp, surfaceChosen, tableName, tableNameProblem, tableOpening, tablePickerEntries, tableReferenceChoices, tableRightsAt, titleRepeats, unknownRailLine, unknownViewLine, unreadableKeys, useCanShare, useChoiceNudge, useDrill, useDrillAnswers, useDrillDefinition, useEmbedHandshake, useEnrichCells, useGridEditing, useLabelWait, useMeasuredWidth, useMyChecklistSteps, usePickerTables, useRecordActionHost, useRecordLabels, useRecordMoves, useRecordRights, useRecordsUi, useRowColorBy, useRowRights, useSystemTable, useTableRights, useTableToolbarSlot, useTemplatePreview, useViewRecords, useWhoChanged, viewActions, viewAddressFromParams, viewAddressToParams, viewDocument, viewFromRow, viewKeysFor, viewNeedFor, viewPatchDocument, viewSettings, viewSettingsFor, viewSettingsPatch, visibilityLaneFor, whatIsMissing, whatIsMissingForEntityReference, whatTheChoiceListIsMissing, whenWords, whyNotAskable, withheldNoticeOf, withheldSentence, withoutAddition, wordsList };
package/dist/index.js CHANGED
@@ -97,8 +97,16 @@ function RecordsUiProvider({ value, children }) {
97
97
  function useRecordsUi() {
98
98
  return useContext(HostContext) ?? {};
99
99
  }
100
+ function quiet(may, say2) {
101
+ if (say2 !== false) return may;
102
+ return { ...may, why: () => "", ..."reason" in may ? { reason: "" } : {} };
103
+ }
100
104
  function useTableRights(table) {
101
105
  const host = useRecordsUi();
106
+ const asked3 = useTableRightsAsked(table, host);
107
+ return useMemo(() => quiet(asked3, host.sayLevelNeeded), [asked3, host.sayLevelNeeded]);
108
+ }
109
+ function useTableRightsAsked(table, host) {
102
110
  const bound = Boolean(host.rights);
103
111
  const asked3 = useMyLevel(bound || !table ? null : table.id);
104
112
  return useMemo(() => {
@@ -111,22 +119,24 @@ function useTableRights(table) {
111
119
  }
112
120
  function useRecordRights(recordId) {
113
121
  const asked3 = useMyLevel(recordId);
122
+ const say2 = useRecordsUi().sayLevelNeeded;
114
123
  return useMemo(() => {
115
124
  if (!recordId) return NOT_ANSWERED_YET;
116
125
  if (asked3.loading) return NOT_ANSWERED_YET;
117
- if (asked3.error) return whatYouMayDo(null, true);
118
- return whatYouMayDo(asked3.data, true);
119
- }, [recordId, asked3.loading, asked3.error, asked3.data]);
126
+ if (asked3.error) return quiet(whatYouMayDo(null, true), say2);
127
+ return quiet(whatYouMayDo(asked3.data, true), say2);
128
+ }, [recordId, asked3.loading, asked3.error, asked3.data, say2]);
120
129
  }
121
130
  function useRowRights(rowIds, enabled) {
122
131
  const asked3 = useMyLevels(enabled ? rowIds : []);
132
+ const say2 = useRecordsUi().sayLevelNeeded;
123
133
  return useMemo(() => {
124
134
  if (!enabled) return () => null;
125
135
  if (asked3.loading) return () => NOT_ANSWERED_YET;
126
- if (asked3.error) return () => whatYouMayDo(null, true);
136
+ if (asked3.error) return () => quiet(whatYouMayDo(null, true), say2);
127
137
  const held = asked3.data ?? {};
128
- return (rowId) => whatYouMayDo(held[rowId] ?? null, true);
129
- }, [enabled, asked3.loading, asked3.error, asked3.data]);
138
+ return (rowId) => quiet(whatYouMayDo(held[rowId] ?? null, true), say2);
139
+ }, [enabled, asked3.loading, asked3.error, asked3.data, say2]);
130
140
  }
131
141
 
132
142
  // src/plainWords.ts
@@ -26345,7 +26355,7 @@ function Peek({ tableId, recordId, onClose, className, onPage = false }) {
26345
26355
  ) : host.chat && !askOpenBelow ? /* @__PURE__ */ jsx90(Button60, { size: "sm", variant: talking ? "ghost" : "outline", onClick: () => setTalking((t) => !t), children: talking ? "Close chat" : "Talk to this record" }) : null,
26346
26356
  organizationId ? /* @__PURE__ */ jsx90(ShareControl, { kind: "record", organizationId, subjectId: recordId, name: title, may: may.share }) : null,
26347
26357
  /* @__PURE__ */ jsx90(RowShownTo, { recordId }),
26348
- may.write ? /* @__PURE__ */ jsx90(Button60, { size: "sm", variant: editing ? "ghost" : "outline", onClick: () => setEditing((e) => !e), children: editing ? "Stop editing" : "Edit" }) : may.known ? (
26358
+ may.write ? /* @__PURE__ */ jsx90(Button60, { size: "sm", variant: editing ? "ghost" : "outline", onClick: () => setEditing((e) => !e), children: editing ? "Stop editing" : "Edit" }) : may.known && may.why("write") ? (
26349
26359
  // Absent AND explained: no Edit button, and one sentence saying what
26350
26360
  // it would take and who can give it.
26351
26361
  /* @__PURE__ */ jsx90("span", { className: "max-w-[18rem] text-[11px] text-muted-foreground", children: may.why("write") })
@@ -35803,7 +35813,7 @@ function DigestScheduler({
35803
35813
  const [channel, setChannel] = useState98(
35804
35814
  existing?.channel === "email" || existing?.channel === "sms" ? existing.channel : "in_app"
35805
35815
  );
35806
- const [quiet, setQuiet] = useState98(hasQuietHours(existing?.quiet_hours));
35816
+ const [quiet2, setQuiet] = useState98(hasQuietHours(existing?.quiet_hours));
35807
35817
  const [quietFrom, setQuietFrom] = useState98(existing?.quiet_hours?.start ?? "22:00");
35808
35818
  const [quietTo, setQuietTo] = useState98(existing?.quiet_hours?.end ?? "07:00");
35809
35819
  const [recipients, setRecipients] = useState98(
@@ -35841,8 +35851,8 @@ function DigestScheduler({
35841
35851
  return null;
35842
35852
  }, [cadence, weekday, time]);
35843
35853
  const quietHours = useMemo57(
35844
- () => quiet ? { start: quietFrom, end: quietTo, tz: timezone } : { tz: timezone },
35845
- [quiet, quietFrom, quietTo, timezone]
35854
+ () => quiet2 ? { start: quietFrom, end: quietTo, tz: timezone } : { tz: timezone },
35855
+ [quiet2, quietFrom, quietTo, timezone]
35846
35856
  );
35847
35857
  const fallbackName = `${CADENCE_TITLE[cadence] ?? "Weekly"} ${tableName2 ?? "records"} summary`;
35848
35858
  async function scheduleIt() {
@@ -36010,10 +36020,10 @@ function DigestScheduler({
36010
36020
  ] })
36011
36021
  ] }),
36012
36022
  /* @__PURE__ */ jsxs108("label", { className: "flex items-center gap-1.5 text-xs", children: [
36013
- /* @__PURE__ */ jsx117(Checkbox12, { checked: quiet, onCheckedChange: (on) => setQuiet(Boolean(on)) }),
36023
+ /* @__PURE__ */ jsx117(Checkbox12, { checked: quiet2, onCheckedChange: (on) => setQuiet(Boolean(on)) }),
36014
36024
  "Not between certain hours"
36015
36025
  ] }),
36016
- quiet ? /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2", children: [
36026
+ quiet2 ? /* @__PURE__ */ jsxs108("div", { className: "flex items-center gap-2", children: [
36017
36027
  /* @__PURE__ */ jsx117(
36018
36028
  BasicInput25,
36019
36029
  {
@@ -37055,7 +37065,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
37055
37065
  await load();
37056
37066
  })();
37057
37067
  }, [subscriptions, seed, write, load]);
37058
- async function subscribe(viewId, viewName, cadence, channel, schedule, quiet) {
37068
+ async function subscribe(viewId, viewName, cadence, channel, schedule, quiet2) {
37059
37069
  setBusy(true);
37060
37070
  const ok = await write({
37061
37071
  name: `${viewName} \u2014 ${CADENCE_WORDS2[cadence] ?? cadence}`,
@@ -37063,7 +37073,7 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
37063
37073
  cadence,
37064
37074
  channel,
37065
37075
  schedule: schedule.trim() === "" ? null : schedule.trim(),
37066
- quietHours: quiet
37076
+ quietHours: quiet2
37067
37077
  });
37068
37078
  setBusy(false);
37069
37079
  if (!ok) return;
@@ -37180,8 +37190,8 @@ function NotifyRuleEditor({ tableId, seed, chosenRuleId, onChoose, className })
37180
37190
  const start = form.elements.namedItem("quiet_start").value;
37181
37191
  const end = form.elements.namedItem("quiet_end").value;
37182
37192
  const name = views.find((v) => v.id === view)?.name ?? "View";
37183
- const quiet = start && end ? { start, end, tz: Intl.DateTimeFormat().resolvedOptions().timeZone } : null;
37184
- if (view) void subscribe(view, name, cadence, channel, schedule, quiet);
37193
+ const quiet2 = start && end ? { start, end, tz: Intl.DateTimeFormat().resolvedOptions().timeZone } : null;
37194
+ if (view) void subscribe(view, name, cadence, channel, schedule, quiet2);
37185
37195
  },
37186
37196
  children: [
37187
37197
  /* @__PURE__ */ jsx121("select", { name: "view", "aria-label": "View to be told about", className: "h-7 rounded border bg-background px-1 text-xs", children: views.map((view) => /* @__PURE__ */ jsx121("option", { value: view.id, children: view.name }, view.id)) }),
@@ -45988,14 +45998,16 @@ function Decision({ approvalId, onDecided }) {
45988
45998
  }
45989
45999
 
45990
46000
  // src/TemplatePreview.tsx
45991
- import { useMemo as useMemo73, useState as useState129 } from "react";
46001
+ import { useEffect as useEffect109, useMemo as useMemo73, useState as useState129 } from "react";
45992
46002
  import { templatePreview } from "@ai-matrx/records/memory";
46003
+ import { useRecordsClient as useRecordsClient95 } from "@ai-matrx/records/react";
45993
46004
  import { jsx as jsx152, jsxs as jsxs142 } from "react/jsx-runtime";
45994
46005
  function useTemplatePreview(spec, today) {
45995
46006
  return useMemo73(() => templatePreview(spec, today ? { today } : {}), [spec, today]);
45996
46007
  }
45997
- function TemplatePreview({ spec, today, initialTable, host, aside, className }) {
46008
+ function TemplatePreview({ spec, today, initialTable, host, aside, booking, className }) {
45998
46009
  const preview = useTemplatePreview(spec, today);
46010
+ const bound = useMemo73(() => ({ ...host, sayLevelNeeded: false }), [host]);
45999
46011
  const first = preview.tables.find((t) => t.token === initialTable) ?? preview.tables[0];
46000
46012
  const [active, setActive] = useState129(first?.id ?? null);
46001
46013
  const table = preview.tables.find((t) => t.id === active) ?? first;
@@ -46023,7 +46035,49 @@ function TemplatePreview({ spec, today, initialTable, host, aside, className })
46023
46035
  )),
46024
46036
  aside ? /* @__PURE__ */ jsx152("div", { className: "ml-auto", children: aside }) : null
46025
46037
  ] }) : null,
46026
- /* @__PURE__ */ jsx152(RecordsMount, { config: preview.config, host, children: /* @__PURE__ */ jsx152("div", { className: "min-h-[32rem] min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: /* @__PURE__ */ jsx152(TablePage, { tableId: table.id }, table.id) }) })
46038
+ /* @__PURE__ */ jsxs142(RecordsMount, { config: preview.config, host: bound, children: [
46039
+ /* @__PURE__ */ jsx152("div", { className: "min-h-[32rem] min-w-0 overflow-hidden rounded-xl border border-border bg-card", children: /* @__PURE__ */ jsx152(TablePage, { tableId: table.id }, table.id) }),
46040
+ /* @__PURE__ */ jsx152(PreviewForms, { preview, booking }),
46041
+ preview.dashboards.length ? /* @__PURE__ */ jsxs142("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Dashboards", "data-template-preview-dashboards": preview.dashboards.length, children: [
46042
+ /* @__PURE__ */ jsx152("h2", { className: "text-lg font-semibold tracking-tight", children: "Dashboards" }),
46043
+ preview.dashboards.map((d) => /* @__PURE__ */ jsx152("div", { className: "min-w-0 overflow-hidden rounded-xl border border-border bg-card p-3", "data-template-preview-dashboard": d.token, children: /* @__PURE__ */ jsx152(DashboardCanvas, { tableId: d.tableId, activeDashboardId: d.id }) }, d.id))
46044
+ ] }) : null
46045
+ ] })
46046
+ ] });
46047
+ }
46048
+ function PreviewForms({ preview, booking }) {
46049
+ const client = useRecordsClient95();
46050
+ const [forms, setForms] = useState129(null);
46051
+ const [pages, setPages] = useState129([]);
46052
+ useEffect109(() => {
46053
+ let gone = false;
46054
+ void client.forms().then((answered) => {
46055
+ if (!gone) setForms(answered.ok ? answered.data.map(formFromSummary) : []);
46056
+ });
46057
+ const wanted = booking ? preview.forms.filter((f) => f.booking) : [];
46058
+ void Promise.all(
46059
+ wanted.map(async (f) => {
46060
+ const answered = await preview.config.dataSource.rpc("booking_public", { p_form_id: f.id });
46061
+ return answered.error ? null : { id: f.id, page: answered.data };
46062
+ })
46063
+ ).then((got) => {
46064
+ if (!gone) setPages(got.filter((g) => g !== null));
46065
+ });
46066
+ return () => {
46067
+ gone = true;
46068
+ };
46069
+ }, [client, preview, booking]);
46070
+ if (!forms?.length && !pages.length) return null;
46071
+ return /* @__PURE__ */ jsxs142("section", { className: "flex min-w-0 flex-col gap-3", "aria-label": "Forms and booking", "data-template-preview-forms": forms?.length ?? 0, children: [
46072
+ /* @__PURE__ */ jsx152("h2", { className: "text-lg font-semibold tracking-tight", children: "Forms and booking" }),
46073
+ /* @__PURE__ */ jsx152("div", { className: "grid min-w-0 gap-4 md:grid-cols-2", children: (forms ?? []).map((f) => /* @__PURE__ */ jsxs142("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-form": f.slug ?? f.id, children: [
46074
+ /* @__PURE__ */ jsx152("h3", { className: "mb-3 text-sm font-semibold", children: f.name }),
46075
+ /* @__PURE__ */ jsx152(FormRunner, { form: f })
46076
+ ] }, f.id)) }),
46077
+ booking ? pages.map((p) => /* @__PURE__ */ jsxs142("div", { className: "min-w-0 rounded-xl border border-border bg-card p-4", "data-template-preview-booking": p.id, children: [
46078
+ /* @__PURE__ */ jsx152("h3", { className: "mb-3 text-sm font-semibold", children: String(p.page["title"] ?? "") }),
46079
+ booking(p.page)
46080
+ ] }, p.id)) : null
46027
46081
  ] });
46028
46082
  }
46029
46083
  export {