@flytedan/flytebot-design-system 0.81.0 → 0.82.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -4940,6 +4940,50 @@ interface FileBrowserProps {
4940
4940
  */
4941
4941
  declare function FileBrowser({ folders, files, currentFolderId, onNavigate, onCreateFolder, onRenameFolder, onMoveFolder, onMoveFile, onOpenFile, onRemoveFile, onDeleteFolder, onUpload, loading, permissions, className, }: FileBrowserProps): React.JSX.Element;
4942
4942
 
4943
+ /** One row of the apps feed. `url`/`icon` are nullable because the identity provider is not
4944
+ * seeded with both for every app. */
4945
+ interface SessionAppFeedEntry {
4946
+ key: string;
4947
+ name: string;
4948
+ url: string | null;
4949
+ icon: string | null;
4950
+ }
4951
+ /** The signed-in person as the identity provider reports them. */
4952
+ interface SessionAdapterUser {
4953
+ id: string;
4954
+ name: string;
4955
+ email: string;
4956
+ roles: {
4957
+ key: string;
4958
+ name: string;
4959
+ }[];
4960
+ permissions: string[];
4961
+ }
4962
+ /** A usable session: live (`authenticated`) or an identity-provider/auth-store outage that
4963
+ * still has a last-known user (`unavailable`). */
4964
+ interface AdaptableSession {
4965
+ status: "authenticated" | "unavailable";
4966
+ user: SessionAdapterUser;
4967
+ apps: SessionAppFeedEntry[];
4968
+ signOut: () => void | Promise<void>;
4969
+ }
4970
+ /**
4971
+ * Adapts the apps feed into `AppSwitcher` entries and marks the one whose key is
4972
+ * `currentAppKey`. An app with no `url` is dropped rather than rendered as a dead `#` link.
4973
+ */
4974
+ declare function toSwitcherEntries(apps: SessionAppFeedEntry[], currentAppKey: string): AppEntry[];
4975
+ /**
4976
+ * Adapts a session into `SessionContextValue`, memoized on the session's own fields.
4977
+ * `roles[].id` and `hasRole` both key on the role's `key`, its stable slug.
4978
+ *
4979
+ * During an outage (`status === "unavailable"`) the last-known user is still shown but the
4980
+ * cached permissions are display-only: `can`, `canAny` and `hasRole` refuse everything, and
4981
+ * `pending` is true so `Gate` renders its neutral pending state instead of "access denied".
4982
+ */
4983
+ declare function useSessionContextValue(session: AdaptableSession, { currentAppKey }: {
4984
+ currentAppKey: string;
4985
+ }): SessionContextValue;
4986
+
4943
4987
  interface PermissionItem {
4944
4988
  key: string;
4945
4989
  label: string;
@@ -5842,4 +5886,4 @@ interface ExportTrayProps {
5842
5886
  * nothing: an empty card would hold the corner for no reason. */
5843
5887
  declare function ExportTray({ exports, onDownload, onDismiss }: ExportTrayProps): React.JSX.Element;
5844
5888
 
5845
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_CALL_DEADLINE_MS, CHAT_UNAVAILABLE, CHAT_UNAVAILABLE_MESSAGE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, CSV_FAILED_FALLBACK, CSV_KEPT_NOTE, Calendar, type CalendarProps, CallDeadlineError, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, type ChatAdapterOptions, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, type ChatThreadContext, type ChatThreadRef, type ChatThreads, ChatTranscript, type ChatTranscriptProps, type ChatTransport, ChatTurn, type ChatTurnProps, ChatUnreachableError, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, CsvCard, type CsvCardProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, EXPORT_FAILED_FALLBACK, EXPORT_IDLE_POLL_INTERVAL_MS, EXPORT_KEPT_NOTE, EXPORT_POLL_INTERVAL_MS, EditableTitle, type EditableTitleProps, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, type ExportDownloaderOptions, type ExportJob, type ExportJobStatus, type ExportState, ExportTray, type ExportTrayProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NEW_THREAD_FAILED, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketDecision, type PacketDecisionAction, type PacketDecisionState, type PacketDecisionTone, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, type PollingTurns, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QUERY_EMPTY_MESSAGE, QueryKit, type QueryPaging, QueryResultCard, type QueryResultCardProps, type QueryResultStatus, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type StreamingTurns, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, THREADS_LOAD_FAILED, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, type UseChatThreadsOptions, type UseExportJobsOptions, type UseExportJobsResult, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createChatAdapter, createExportDownloader, createLocalStorageAppearanceStore, createVersionStore, eqFilter, exportStateOf, exportToJob, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isExpiredExport, isImage, isLiveExport, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useChatThreads, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useExpiryClock, useExportJobs, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSheetOpenMark, useShownExport, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, withDeadline, writeQueryToUrl };
5889
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, type AdaptableSession, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_CALL_DEADLINE_MS, CHAT_UNAVAILABLE, CHAT_UNAVAILABLE_MESSAGE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, CSV_FAILED_FALLBACK, CSV_KEPT_NOTE, Calendar, type CalendarProps, CallDeadlineError, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, type ChatAdapterOptions, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, type ChatThreadContext, type ChatThreadRef, type ChatThreads, ChatTranscript, type ChatTranscriptProps, type ChatTransport, ChatTurn, type ChatTurnProps, ChatUnreachableError, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, CsvCard, type CsvCardProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, EXPORT_FAILED_FALLBACK, EXPORT_IDLE_POLL_INTERVAL_MS, EXPORT_KEPT_NOTE, EXPORT_POLL_INTERVAL_MS, EditableTitle, type EditableTitleProps, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, type ExportDownloaderOptions, type ExportJob, type ExportJobStatus, type ExportState, ExportTray, type ExportTrayProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NEW_THREAD_FAILED, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketDecision, type PacketDecisionAction, type PacketDecisionState, type PacketDecisionTone, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, type PollingTurns, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QUERY_EMPTY_MESSAGE, QueryKit, type QueryPaging, QueryResultCard, type QueryResultCardProps, type QueryResultStatus, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionAdapterUser, type SessionAppFeedEntry, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type StreamingTurns, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, THREADS_LOAD_FAILED, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, type UseChatThreadsOptions, type UseExportJobsOptions, type UseExportJobsResult, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createChatAdapter, createExportDownloader, createLocalStorageAppearanceStore, createVersionStore, eqFilter, exportStateOf, exportToJob, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isExpiredExport, isImage, isLiveExport, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, toSwitcherEntries, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useChatThreads, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useExpiryClock, useExportJobs, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSessionContextValue, useSheetOpenMark, useShownExport, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, withDeadline, writeQueryToUrl };
package/dist/index.d.ts CHANGED
@@ -4940,6 +4940,50 @@ interface FileBrowserProps {
4940
4940
  */
4941
4941
  declare function FileBrowser({ folders, files, currentFolderId, onNavigate, onCreateFolder, onRenameFolder, onMoveFolder, onMoveFile, onOpenFile, onRemoveFile, onDeleteFolder, onUpload, loading, permissions, className, }: FileBrowserProps): React.JSX.Element;
4942
4942
 
4943
+ /** One row of the apps feed. `url`/`icon` are nullable because the identity provider is not
4944
+ * seeded with both for every app. */
4945
+ interface SessionAppFeedEntry {
4946
+ key: string;
4947
+ name: string;
4948
+ url: string | null;
4949
+ icon: string | null;
4950
+ }
4951
+ /** The signed-in person as the identity provider reports them. */
4952
+ interface SessionAdapterUser {
4953
+ id: string;
4954
+ name: string;
4955
+ email: string;
4956
+ roles: {
4957
+ key: string;
4958
+ name: string;
4959
+ }[];
4960
+ permissions: string[];
4961
+ }
4962
+ /** A usable session: live (`authenticated`) or an identity-provider/auth-store outage that
4963
+ * still has a last-known user (`unavailable`). */
4964
+ interface AdaptableSession {
4965
+ status: "authenticated" | "unavailable";
4966
+ user: SessionAdapterUser;
4967
+ apps: SessionAppFeedEntry[];
4968
+ signOut: () => void | Promise<void>;
4969
+ }
4970
+ /**
4971
+ * Adapts the apps feed into `AppSwitcher` entries and marks the one whose key is
4972
+ * `currentAppKey`. An app with no `url` is dropped rather than rendered as a dead `#` link.
4973
+ */
4974
+ declare function toSwitcherEntries(apps: SessionAppFeedEntry[], currentAppKey: string): AppEntry[];
4975
+ /**
4976
+ * Adapts a session into `SessionContextValue`, memoized on the session's own fields.
4977
+ * `roles[].id` and `hasRole` both key on the role's `key`, its stable slug.
4978
+ *
4979
+ * During an outage (`status === "unavailable"`) the last-known user is still shown but the
4980
+ * cached permissions are display-only: `can`, `canAny` and `hasRole` refuse everything, and
4981
+ * `pending` is true so `Gate` renders its neutral pending state instead of "access denied".
4982
+ */
4983
+ declare function useSessionContextValue(session: AdaptableSession, { currentAppKey }: {
4984
+ currentAppKey: string;
4985
+ }): SessionContextValue;
4986
+
4943
4987
  interface PermissionItem {
4944
4988
  key: string;
4945
4989
  label: string;
@@ -5842,4 +5886,4 @@ interface ExportTrayProps {
5842
5886
  * nothing: an empty card would hold the corner for no reason. */
5843
5887
  declare function ExportTray({ exports, onDownload, onDismiss }: ExportTrayProps): React.JSX.Element;
5844
5888
 
5845
- export { AccountMenu, type AccountMenuLink, type AccountMenuProps, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_CALL_DEADLINE_MS, CHAT_UNAVAILABLE, CHAT_UNAVAILABLE_MESSAGE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, CSV_FAILED_FALLBACK, CSV_KEPT_NOTE, Calendar, type CalendarProps, CallDeadlineError, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, type ChatAdapterOptions, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, type ChatThreadContext, type ChatThreadRef, type ChatThreads, ChatTranscript, type ChatTranscriptProps, type ChatTransport, ChatTurn, type ChatTurnProps, ChatUnreachableError, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, CsvCard, type CsvCardProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, EXPORT_FAILED_FALLBACK, EXPORT_IDLE_POLL_INTERVAL_MS, EXPORT_KEPT_NOTE, EXPORT_POLL_INTERVAL_MS, EditableTitle, type EditableTitleProps, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, type ExportDownloaderOptions, type ExportJob, type ExportJobStatus, type ExportState, ExportTray, type ExportTrayProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NEW_THREAD_FAILED, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketDecision, type PacketDecisionAction, type PacketDecisionState, type PacketDecisionTone, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, type PollingTurns, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QUERY_EMPTY_MESSAGE, QueryKit, type QueryPaging, QueryResultCard, type QueryResultCardProps, type QueryResultStatus, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type StreamingTurns, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, THREADS_LOAD_FAILED, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, type UseChatThreadsOptions, type UseExportJobsOptions, type UseExportJobsResult, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createChatAdapter, createExportDownloader, createLocalStorageAppearanceStore, createVersionStore, eqFilter, exportStateOf, exportToJob, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isExpiredExport, isImage, isLiveExport, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useChatThreads, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useExpiryClock, useExportJobs, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSheetOpenMark, useShownExport, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, withDeadline, writeQueryToUrl };
5889
+ export { AccountMenu, type AccountMenuLink, type AccountMenuProps, type AdaptableSession, AgentChatPanel, type AgentChatPanelProps, AnchoredPopover, type AnchoredPopoverProps, AnimNum, type AnimNumProps, ApiSpecBrowser, type ApiSpecBrowserProps, type AppEntry, AppShell, type AppShellProps, type AppShellSidePanel, AppSwitcher, type AppSwitcherProps, AppearanceMenu, type AppearanceMenuProps, type AppearancePrefs, AppearanceProvider, type AppearanceProviderProps, type AppearanceStore, type AppearanceStoreOptions, type Attachment, Avatar, type AvatarProps, AvatarStack, type AvatarStackProps, Badge, type BadgeProps, Banner, type BannerProps, type BannerTone, BarList, type BarListProps, type BarListRow, BudgetReallocator, type BudgetReallocatorProps, Button, type ButtonProps, CHANNELS, CHANNEL_WEIGHTS, CHAT_CALL_DEADLINE_MS, CHAT_UNAVAILABLE, CHAT_UNAVAILABLE_MESSAGE, COPIED_FEEDBACK_MS, CORNER_STACK_INSET_PROPERTY, CORNER_STACK_OFFSET_PROPERTY, CSV_FAILED_FALLBACK, CSV_KEPT_NOTE, Calendar, type CalendarProps, CallDeadlineError, Card, CardGrid, type CardGridProps, type CardProps, CardRow, type CardRowProps, ChannelContribution, type ChannelContributionChannel, type ChannelContributionProps, ChannelMeta, type ChannelMetaRecord, ChannelTag, type ChannelTagProps, ChannelWeightOf, type ChatAdapter, type ChatAdapterOptions, ChatComposer, type ChatComposerProps, type ChatEngine, type ChatEngineOptions, ChatKit, type ChatMessage, type ChatRenderContext, ChatSessionBar, type ChatSessionBarProps, type ChatThreadContext, type ChatThreadRef, type ChatThreads, ChatTranscript, type ChatTranscriptProps, type ChatTransport, ChatTurn, type ChatTurnProps, ChatUnreachableError, Checkbox, type CheckboxProps, type Citation, Citations, type CitationsProps, Clamp, type ClampProps, ClockFace, type ClockFaceProps, CodeBlock, type CodeBlockProps, CodeEditor, type CodeEditorDiagnostic, type CodeEditorProps, Collapsible, type CollapsibleProps, ComingSoon, type ComingSoonProps, type ContextUsage, CornerStackPortal, type CornerStackSlot, type CreateVersionStoreOptions, CsiBadge, type CsiBadgeProps, CsiHero, type CsiHeroProps, CsiMeter, type CsiMeterProps, CsvCard, type CsvCardProps, DEFAULT_PREFS, DEFAULT_STORAGE_KEY, DEFAULT_TOAST_DURATION_MS, DataTable, type DataTableColumn, type DataTableColumnLabel, type DataTablePhoneRole, type DataTableProps, type DataTableRowAction, DatePicker, type DatePickerProps, type DemoSessionControls, DemoSessionProvider, type DeviceSession, DiffBlock, type DiffBlockProps, DonutChart, type DonutChartProps, type DonutSegment, Drawer, type DrawerProps, Dropzone, DropzoneKit, type DropzoneProps, ENTITY_ROW_METRIC_WIDTH, EXPORT_FAILED_FALLBACK, EXPORT_IDLE_POLL_INTERVAL_MS, EXPORT_KEPT_NOTE, EXPORT_POLL_INTERVAL_MS, EditableTitle, type EditableTitleProps, type EditorTrigger, EmptyState, type EmptyStateProps, type EndpointSpec, EntityRow, type EntityRowAction, type EntityRowContent, type EntityRowMetric, EntityRowMetrics, type EntityRowMetricsProps, type EntityRowProps, type ExportDownloaderOptions, type ExportJob, type ExportJobStatus, type ExportState, ExportTray, type ExportTrayProps, FILE_VIEWER_CSV_ROW_LIMIT, FILE_VIEWER_TEXT_LIMIT, type Fact, FactList, type FactListProps, FeatureGate, type FeatureGateProps, type FeatureStatus, Fieldset, type FieldsetProps, FileBrowser, type FileBrowserFile, type FileBrowserFolder, type FileBrowserPermissions, type FileBrowserProps, FileChip, type FileChipProps, FileGrid, type FileGridProps, FileKit, FilePickButton, type FilePickButtonProps, type FileRejection, FileStrip, type FileStripProps, FileTile, type FileTileProps, type FileUploadHandler, FileViewer, type FileViewerProps, FilterBar, type FilterBarProps, type FilterDateValue, type FilterField, type FilterFieldDate, type FilterFieldFixed, type FilterFieldMultiSelect, type FilterFieldOption, type FilterFieldRange, type FilterFieldSelect, type FilterFieldText, type FilterMultiSelectValue, type FilterOperator, type FilterRangeValue, type FilterResolveMatch, type FilterResolveResult, type FilterValidation, type FilterValue, Flag$1 as Flag, type FlagExplanation, type FlagProps, FlytedeskBrand, type FlytedeskBrandProps, FlytedeskMark, type FlytedeskMarkProps, FormatEta, FunnelChart, type FunnelChartProps, type FunnelStep, Gate, GatePending, type GatePendingProps, type GateProps, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, Input, type InputProps, type Job, type JobAction, type JobCardStatus, type JobStatus, JobTray, type JobTrayProps, Json, KeyHint, type KeyHintProps, type KeysetEnvelope, type KeysetServerTable, LAYER_STEP, type ListEnvelope, LoadingRegion, type LoadingRegionProps, Markdown, MarkdownEditor, type MarkdownEditorHandle, type MarkdownEditorProps, MarkdownInline, type MarkdownProps, type MarkdownSize, type MarkdownTone, type MentionSource, Menu, MenuButton, type MenuButtonProps, type MenuItem, type MenuProps, MessageBody, type MessageBodyProps, type MessageGroup, Meter, type MeterProps, type MeterSegment, type MeterSegmentInput, MixGap, type MixGapProps, type MixGapRow, MockJobKit, type MockJobStatus, Modal, type ModalProps, ModeSwitch, type ModeSwitchProps, type Model, ModelControls, type ModelControlsProps, NEW_THREAD_FAILED, NumberInput, type NumberInputProps, OVERLAY_BREAKPOINT, OVERLAY_CEILING, POPOVER_BODY_MIN, type Packet, PacketCard, type PacketCardProps, type PacketDecision, type PacketDecisionAction, type PacketDecisionState, type PacketDecisionTone, type PacketSchema, type Pager, Pagination, type PaginationProps, PermissionDenied, type PermissionDeniedProps, type PermissionGroup, PermissionHint, type PermissionItem, type Phase, type PhaseStatus, PhasedProgress, type PhasedProgressProps, type Placement, type PollOptions, type PollingTurns, Popover, type PopoverProps, type PreferenceCriterion, PreferenceMeter, type PreferenceMeterProps, type ProfileFieldDef, type ProfileFieldType, type ProfileNotificationDef, ProfilePage, type ProfilePageProps, ProgressBar, type ProgressBarProps, QUERY_EMPTY_MESSAGE, QueryKit, type QueryPaging, QueryResultCard, type QueryResultCardProps, type QueryResultStatus, type QueryUrlAdapter, type QueryUrlOptions, type QueuedTurn, QuotaRow, type QuotaRowProps, ROOT_STEP, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, RangeSlider, type RangeSliderProps, RelativeTime, type RelativeTimeProps, ReservedSkeleton, type ReservedSkeletonProps, type RoadmapItem, type RoadmapResult, RoadmapTimeline, type RoadmapTimelineProps, type Role, RunActions, type RunActionsProps, type RunConfig, RuntimeKit, type RuntimeSummary, SHEET_OPEN_ATTRIBUTE, SaturationDistribution, type SaturationDistributionCampus, type SaturationDistributionProps, ScoreMeter, type ScoreMeterProps, ScreenHead, type ScreenHeadProps, SearchField, type SearchFieldProps, SegmentedControl, type SegmentedControlProps, SegmentedMeter, type SegmentedMeterProps, Select, type SelectOption, type SelectProps, type SendMessageResult, type ServerTable, type ServerTableBase, type Session, type SessionAdapterUser, type SessionAppFeedEntry, type SessionContextValue, type Flag as SessionFlag, SessionKit, SessionProvider, type SessionProviderProps, type SessionRole, SessionScreen, type SessionScreenKind, type SessionScreenProps, type SessionStats, type SessionUser, SidebarNav, type SidebarNavItem, type SidebarNavProps, Skeleton, type SkeletonProps, SkeletonText, type SkeletonTextProps, type SlashCommand, Slider, type SliderProps, type SortDirection, type SortEntry, SortMenu, type SortMenuField, type SortMenuProps, type SpecModule, Spinner, type SpinnerProps, type StackedLayer, type StackedLayerOptions, StackedLayerProvider, StatGrid, type StatGridProps, StatTile, type StatTileProps, type Step, StepList, type StepListProps, type StreamHandlers, type StreamingTurns, type Suggestion, SurroundSound, type SurroundSoundProps, Switch, type SwitchProps, THREADS_LOAD_FAILED, type TabItem, type TableQuery, Tabs, type TabsProps, Tag, type TagProps, TestModeBar, type TestModeBarProps, type TextScale, Textarea, type TextareaProps, type ThemeMode, ThinkingBlock, type ThinkingBlockProps, type ThreadSummary, TimePicker, type TimePickerProps, Toast, type ToastApi, type ToastOptions, type ToastProps, ToastProvider, Tooltip, type TooltipApi, type TooltipBinding, type TooltipPlacement, type TooltipProps, Topbar, type TopbarProps, TranscriptKit, TransferList, type TransferListProps, type TransferListSide, type TransferListSideProps, TrendChart, type TrendChartProps, type TrendSeries, USChoropleth, type USChoroplethProps, type StateFigure as USChoroplethState, type ChoroplethValue as USChoroplethValue, US_STATE_CODES, type UsageLimit, type UseChatThreadsOptions, type UseExportJobsOptions, type UseExportJobsResult, UseFeatureStatus, type UseKeysetTableOptions, type UseResponsiveRailOptions, type UseResponsiveRailResult, UseRuntimeMode, type UseServerTableOptions, type UseTooltipOptions, type User, VIRTUAL_LIST_BUFFER_ROWS, VIRTUAL_LIST_ROW_GAP, type VersionRecord, type VersionStore, VirtualList, type VirtualListProps, type VirtualLoadedBand, type VirtualWindow, type VoiceHandler, __resetLayerStackForTests, acceptMatches, anyOfFilter, applyAppearance, applyPrefs, channelWeightOf, computeNeedMore, computeVirtualWindow, copyToClipboard, createChatAdapter, createExportDownloader, createLocalStorageAppearanceStore, createVersionStore, eqFilter, exportStateOf, exportToJob, extensionOf, extractClipboardFiles, filterFiles, formatAbsolute, formatBytes, formatClock, formatDocumentTitle, formatDuration, formatEta, formatRelative, formatShare, groupMessages, hasModifier, historyUrlAdapter, iconForMime, importanceLevel, importanceTokens, installFlytedeskFavicon, isExpiredExport, isImage, isLiveExport, isSystemMessage, isUsStateCode, isWithinLayerTree, jobBucket, languageLabel, loadPrefs, meterFormats, modifierLabel, parseDelimited, pastedTextName, pluralizeUnit, preferenceScore, preferenceSegments, rangeFilter, readQueryFromUrl, resolveTheme, revokeAttachment, savePrefs, toAttachment, toSwitcherEntries, tokenize, useAppearancePrefs, useAppearanceStore, useChatEngine, useChatThreads, useCopyToClipboard, useCornerStackSlot, useDocumentTitle, useExpiryClock, useExportJobs, useFeatureStatus, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSessionContextValue, useSheetOpenMark, useShownExport, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, withDeadline, writeQueryToUrl };
package/dist/index.js CHANGED
@@ -4244,7 +4244,6 @@ function MiddleEllipsis({ text, middle = true }) {
4244
4244
  // src/components/data/FilterBar.tsx
4245
4245
  import { jsx as jsx53, jsxs as jsxs44 } from "react/jsx-runtime";
4246
4246
  var PANEL_WIDTH = { multiSelect: 280, range: 240, date: 300 };
4247
- var MULTISELECT_MAX_WIDTH = 640;
4248
4247
  var OPTION_CHROME = 88;
4249
4248
  var measureCtx;
4250
4249
  function textWidth(text, el) {
@@ -4504,7 +4503,7 @@ function MultiSelectPanel({
4504
4503
  const label = document.getElementById(listId)?.querySelector(".fd-opt-label");
4505
4504
  if (!label) return;
4506
4505
  const widest = optionsRef.current.reduce((m, o) => Math.max(m, textWidth(o.label, label)), 0);
4507
- const wanted = Math.min(MULTISELECT_MAX_WIDTH, Math.max(PANEL_WIDTH.multiSelect, Math.ceil(widest + OPTION_CHROME)));
4506
+ const wanted = Math.max(PANEL_WIDTH.multiSelect, Math.ceil(widest + OPTION_CHROME));
4508
4507
  setPanelWidth((w) => Math.max(w, wanted));
4509
4508
  };
4510
4509
  measure();
@@ -15240,8 +15239,43 @@ function BreadcrumbCrumb({
15240
15239
  return /* @__PURE__ */ jsx111("span", { className: ["fd-fb-crumb", over ? "is-drop-target" : ""].filter(Boolean).join(" "), ...dropHandlers, children: isCurrent ? /* @__PURE__ */ jsx111("span", { className: "fd-fb-crumb-current", "aria-current": "page", children: label }) : /* @__PURE__ */ jsx111("button", { type: "button", className: "fd-fb-crumb-link", onClick, children: label }) });
15241
15240
  }
15242
15241
 
15243
- // src/kits/query.ts
15242
+ // src/kits/sessionAdapter.ts
15244
15243
  import * as React87 from "react";
15244
+ function toSwitcherEntries(apps, currentAppKey) {
15245
+ return apps.filter((app) => app.url != null).map((app) => ({
15246
+ key: app.key,
15247
+ name: app.name,
15248
+ url: app.url,
15249
+ icon: app.icon ?? void 0,
15250
+ current: app.key === currentAppKey
15251
+ }));
15252
+ }
15253
+ function useSessionContextValue(session, { currentAppKey }) {
15254
+ const { user, apps, signOut, status } = session;
15255
+ const authorized = status === "authenticated";
15256
+ const pending = status === "unavailable";
15257
+ return React87.useMemo(
15258
+ () => ({
15259
+ user: { id: user.id, name: user.name, email: user.email, sso: true },
15260
+ roles: user.roles.map((r) => ({ id: r.key, name: r.name })),
15261
+ permissions: user.permissions,
15262
+ can: (permission) => {
15263
+ if (!authorized) return false;
15264
+ const need = Array.isArray(permission) ? permission : [permission];
15265
+ return need.every((p) => user.permissions.includes(p));
15266
+ },
15267
+ canAny: (permissions) => authorized && permissions.some((p) => user.permissions.includes(p)),
15268
+ hasRole: (roleId) => authorized && user.roles.some((r) => r.key === roleId),
15269
+ signOut,
15270
+ apps: toSwitcherEntries(apps, currentAppKey),
15271
+ pending
15272
+ }),
15273
+ [user, apps, signOut, authorized, pending, currentAppKey]
15274
+ );
15275
+ }
15276
+
15277
+ // src/kits/query.ts
15278
+ import * as React88 from "react";
15245
15279
 
15246
15280
  // src/kits/queryUrl.ts
15247
15281
  var historyUrlAdapter = {
@@ -15379,38 +15413,38 @@ function requestFor(params, query, paging, after) {
15379
15413
  }
15380
15414
  var toError = (e) => e instanceof Error ? e : new Error(String(e));
15381
15415
  function useServerTable({ endpoint, params, defaults, deps, prefsKey, paging = "page", url }) {
15382
- const [base] = React87.useState(() => {
15416
+ const [base] = React88.useState(() => {
15383
15417
  const store = PREFS || window.PlannerPrefs;
15384
15418
  const saved = prefsKey && store ? store.getTable(prefsKey) : {};
15385
15419
  return { ...DEFAULTS, ...defaults || {}, ...saved.pageSize ? { pageSize: saved.pageSize } : {}, ...saved.sort ? { sort: saved.sort, dir: saved.dir || "desc" } : {} };
15386
15420
  });
15387
- const [mountParams] = React87.useState(() => url ? (url.adapter ?? historyUrlAdapter).read() : null);
15388
- const address = React87.useRef(mountParams);
15389
- const [query, setQuery] = React87.useState(() => url && mountParams ? readQueryFromUrl(mountParams, url.scope, base, paging) : base);
15390
- const savePref = React87.useCallback((patch2) => {
15421
+ const [mountParams] = React88.useState(() => url ? (url.adapter ?? historyUrlAdapter).read() : null);
15422
+ const address = React88.useRef(mountParams);
15423
+ const [query, setQuery] = React88.useState(() => url && mountParams ? readQueryFromUrl(mountParams, url.scope, base, paging) : base);
15424
+ const savePref = React88.useCallback((patch2) => {
15391
15425
  const store = PREFS || window.PlannerPrefs;
15392
15426
  if (prefsKey && store) store.setTable(prefsKey, patch2);
15393
15427
  }, [prefsKey]);
15394
- const [res, setRes] = React87.useState(null);
15395
- const [loading, setLoading] = React87.useState(true);
15396
- const [loadingMore, setLoadingMore] = React87.useState(false);
15397
- const [failure, setFailure] = React87.useState(null);
15398
- const [reloadToken, setReloadToken] = React87.useState(0);
15399
- const moreController = React87.useRef(null);
15428
+ const [res, setRes] = React88.useState(null);
15429
+ const [loading, setLoading] = React88.useState(true);
15430
+ const [loadingMore, setLoadingMore] = React88.useState(false);
15431
+ const [failure, setFailure] = React88.useState(null);
15432
+ const [reloadToken, setReloadToken] = React88.useState(0);
15433
+ const moreController = React88.useRef(null);
15400
15434
  const depKey = (deps || []).join("|");
15401
15435
  const paramKey = JSON.stringify(params || {});
15402
15436
  const queryKey = JSON.stringify(query);
15403
- const lifetime = React87.useRef(null);
15404
- React87.useEffect(() => {
15437
+ const lifetime = React88.useRef(null);
15438
+ React88.useEffect(() => {
15405
15439
  const controller = new AbortController();
15406
15440
  lifetime.current = controller;
15407
15441
  return () => controller.abort();
15408
15442
  }, []);
15409
- const latest = React87.useRef({ res, loading, query, params, endpoint, url, base });
15410
- React87.useLayoutEffect(() => {
15443
+ const latest = React88.useRef({ res, loading, query, params, endpoint, url, base });
15444
+ React88.useLayoutEffect(() => {
15411
15445
  latest.current = { res, loading, query, params, endpoint, url, base };
15412
15446
  });
15413
- React87.useEffect(() => {
15447
+ React88.useEffect(() => {
15414
15448
  const controller = new AbortController();
15415
15449
  const { signal } = controller;
15416
15450
  setLoading(true);
@@ -15446,7 +15480,7 @@ function useServerTable({ endpoint, params, defaults, deps, prefsKey, paging = "
15446
15480
  };
15447
15481
  }, [endpoint, queryKey, paramKey, depKey, paging, reloadToken]);
15448
15482
  const adapter = url ? url.adapter ?? historyUrlAdapter : null;
15449
- React87.useEffect(() => {
15483
+ React88.useEffect(() => {
15450
15484
  if (!adapter) return;
15451
15485
  return adapter.subscribe((params2) => {
15452
15486
  const { url: u, base: b } = latest.current;
@@ -15796,12 +15830,12 @@ function createVersionStore(initialState, options) {
15796
15830
  }
15797
15831
 
15798
15832
  // src/kits/documentTitle.ts
15799
- import * as React88 from "react";
15833
+ import * as React89 from "react";
15800
15834
  function formatDocumentTitle(routeTitle, appName) {
15801
15835
  return [routeTitle, appName, "Flytedesk"].filter((part2) => !!part2 && part2.length > 0).join(" \xB7 ");
15802
15836
  }
15803
15837
  function useDocumentTitle(routeTitle, appName) {
15804
- React88.useEffect(() => {
15838
+ React89.useEffect(() => {
15805
15839
  if (typeof document === "undefined") return;
15806
15840
  document.title = formatDocumentTitle(routeTitle, appName);
15807
15841
  }, [routeTitle, appName]);
@@ -15903,17 +15937,17 @@ function createChatAdapter(transport, { onTurnStarted, deadlineMs = CHAT_CALL_DE
15903
15937
  }
15904
15938
 
15905
15939
  // src/kits/chatTransport/useChatThreads.ts
15906
- import * as React89 from "react";
15940
+ import * as React90 from "react";
15907
15941
  var THREADS_LOAD_FAILED = "Your earlier conversations could not be loaded.";
15908
15942
  var NEW_THREAD_FAILED = "A new conversation could not be started.";
15909
15943
  function useChatThreads(transport, { deadlineMs = CHAT_CALL_DEADLINE_MS } = {}) {
15910
15944
  const toast = useToast();
15911
- const [threads, setThreads] = React89.useState([]);
15912
- const [reads, setReads] = React89.useState(0);
15945
+ const [threads, setThreads] = React90.useState([]);
15946
+ const [reads, setReads] = React90.useState(0);
15913
15947
  const transportRef = useLatest(transport);
15914
15948
  const deadlineRef = useLatest(deadlineMs);
15915
- const refresh2 = React89.useCallback(() => setReads((n) => n + 1), []);
15916
- React89.useEffect(() => {
15949
+ const refresh2 = React90.useCallback(() => setReads((n) => n + 1), []);
15950
+ React90.useEffect(() => {
15917
15951
  const controller = new AbortController();
15918
15952
  const { signal } = controller;
15919
15953
  withDeadline("listThreads", deadlineRef.current, transportRef.current.listThreads(signal)).then(
@@ -15926,7 +15960,7 @@ function useChatThreads(transport, { deadlineMs = CHAT_CALL_DEADLINE_MS } = {})
15926
15960
  );
15927
15961
  return () => controller.abort();
15928
15962
  }, [reads, toast, transportRef, deadlineRef]);
15929
- const startNewThread = React89.useCallback(
15963
+ const startNewThread = React90.useCallback(
15930
15964
  (onCreated) => withDeadline("createThread", deadlineRef.current, transportRef.current.createThread()).then(
15931
15965
  ({ thread_id }) => {
15932
15966
  onCreated(thread_id);
@@ -15954,14 +15988,14 @@ function createExportDownloader({
15954
15988
  }
15955
15989
 
15956
15990
  // src/kits/exports/useExportJobs.ts
15957
- import * as React90 from "react";
15991
+ import * as React91 from "react";
15958
15992
  var EXPORT_POLL_INTERVAL_MS = 3e3;
15959
15993
  var EXPORT_IDLE_POLL_INTERVAL_MS = 3e4;
15960
15994
  function useExportJobs({ list, acknowledge }) {
15961
- const [rows, setRows] = React90.useState([]);
15995
+ const [rows, setRows] = React91.useState([]);
15962
15996
  const listRef = useLatest(list);
15963
15997
  const acknowledgeRef = useLatest(acknowledge);
15964
- const reload = React90.useCallback(
15998
+ const reload = React91.useCallback(
15965
15999
  () => listRef.current().then(
15966
16000
  (fresh) => setRows(fresh),
15967
16001
  () => {
@@ -15969,16 +16003,16 @@ function useExportJobs({ list, acknowledge }) {
15969
16003
  ),
15970
16004
  [listRef]
15971
16005
  );
15972
- React90.useEffect(() => {
16006
+ React91.useEffect(() => {
15973
16007
  void reload();
15974
16008
  }, [reload]);
15975
16009
  const anyLive = rows.some(isLiveExport);
15976
- React90.useEffect(() => {
16010
+ React91.useEffect(() => {
15977
16011
  const timer = setInterval(() => void reload(), anyLive ? EXPORT_POLL_INTERVAL_MS : EXPORT_IDLE_POLL_INTERVAL_MS);
15978
16012
  return () => clearInterval(timer);
15979
16013
  }, [anyLive, reload]);
15980
- const refresh2 = React90.useCallback(() => void reload(), [reload]);
15981
- const ackExport = React90.useCallback(
16014
+ const refresh2 = React91.useCallback(() => void reload(), [reload]);
16015
+ const ackExport = React91.useCallback(
15982
16016
  (id) => void acknowledgeRef.current(id).then(reload),
15983
16017
  [acknowledgeRef, reload]
15984
16018
  );
@@ -15986,7 +16020,7 @@ function useExportJobs({ list, acknowledge }) {
15986
16020
  }
15987
16021
 
15988
16022
  // src/kits/exports/ExportTray.tsx
15989
- import * as React91 from "react";
16023
+ import * as React92 from "react";
15990
16024
  import { jsx as jsx112 } from "react/jsx-runtime";
15991
16025
  var EXPORT_KEPT_NOTE = "Kept for 24 hours";
15992
16026
  var EXPORT_FAILED_FALLBACK = "Unknown error.";
@@ -16006,7 +16040,7 @@ function exportToJob(job, onDownload) {
16006
16040
  return { ...base, status: "active" };
16007
16041
  }
16008
16042
  function ExportTray({ exports, onDownload, onDismiss }) {
16009
- const jobs2 = React91.useMemo(() => exports.map((job) => exportToJob(job, onDownload)), [exports, onDownload]);
16043
+ const jobs2 = React92.useMemo(() => exports.map((job) => exportToJob(job, onDownload)), [exports, onDownload]);
16010
16044
  return /* @__PURE__ */ jsx112(JobTray, { jobs: jobs2, onDismiss });
16011
16045
  }
16012
16046
  export {
@@ -16255,6 +16289,7 @@ export {
16255
16289
  revokeAttachment,
16256
16290
  savePrefs,
16257
16291
  toAttachment,
16292
+ toSwitcherEntries,
16258
16293
  tokenize,
16259
16294
  useAppearancePrefs,
16260
16295
  useAppearanceStore,
@@ -16274,6 +16309,7 @@ export {
16274
16309
  useRuntimeMode,
16275
16310
  useServerTable,
16276
16311
  useSessionContext,
16312
+ useSessionContextValue,
16277
16313
  useSheetOpenMark,
16278
16314
  useShownExport,
16279
16315
  useStackedLayer,