@flytedan/flytebot-design-system 0.87.7 → 0.89.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/README.md +6 -1
- package/dist/index.cjs +90 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +32 -12
- package/dist/index.d.ts +32 -12
- package/dist/index.js +80 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -3334,6 +3334,14 @@ interface CodeEditorProps {
|
|
|
3334
3334
|
* a message list under the editor) and announced to screen readers via an
|
|
3335
3335
|
* `aria-live` region. */
|
|
3336
3336
|
diagnostics?: CodeEditorDiagnostic[];
|
|
3337
|
+
/** The source language: highlighting, bracket matching and indentation on
|
|
3338
|
+
* Enter. Default "sql". */
|
|
3339
|
+
language?: "sql" | "json";
|
|
3340
|
+
/** JSON mode only: text in, diagnostics out (for example a schema path such
|
|
3341
|
+
* as spec.model). Runs on every edit once the text parses; the parser's own
|
|
3342
|
+
* syntax error replaces it while the text does not. Shown beside any
|
|
3343
|
+
* `diagnostics` the caller passes. */
|
|
3344
|
+
validate?: (text: string) => CodeEditorDiagnostic[];
|
|
3337
3345
|
/** The documented key that moves focus out of the editor after Tab has
|
|
3338
3346
|
* started indenting. Shown as help text under the editor. Default true. */
|
|
3339
3347
|
showEscapeHint?: boolean;
|
|
@@ -3344,14 +3352,14 @@ interface CodeEditorProps {
|
|
|
3344
3352
|
autoFocus?: boolean;
|
|
3345
3353
|
}
|
|
3346
3354
|
/**
|
|
3347
|
-
* An editable, monospace SQL
|
|
3355
|
+
* An editable, monospace code editor (SQL, or JSON with `language="json"`): line numbers, syntax highlighting,
|
|
3348
3356
|
* a controlled value/onChange, disabled/read-only states, and diagnostics
|
|
3349
3357
|
* anchored to a line/column range — shown inline as an underline plus a
|
|
3350
3358
|
* message list, and announced to screen readers through an `aria-live`
|
|
3351
3359
|
* region. See the file header above for the engine choice and the
|
|
3352
3360
|
* keyboard-trap contract (Tab indents; Escape then Tab moves focus out).
|
|
3353
3361
|
*/
|
|
3354
|
-
declare function CodeEditor({ value, onChange, label, help, error, required, disabled, readOnly, placeholder: placeholderText, diagnostics, showEscapeHint, minHeight, id, className, style, autoFocus, }: CodeEditorProps): React.JSX.Element;
|
|
3362
|
+
declare function CodeEditor({ value, onChange, label, help, error, required, disabled, readOnly, placeholder: placeholderText, diagnostics: passedDiagnostics, language, validate, showEscapeHint, minHeight, id, className, style, autoFocus, }: CodeEditorProps): React.JSX.Element;
|
|
3355
3363
|
|
|
3356
3364
|
interface RadioGroupOption {
|
|
3357
3365
|
value: string;
|
|
@@ -4434,10 +4442,13 @@ interface ChatMessage {
|
|
|
4434
4442
|
[k: string]: unknown;
|
|
4435
4443
|
};
|
|
4436
4444
|
}
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
dispatched?:
|
|
4440
|
-
|
|
4445
|
+
/** A turn that finished in the call (answered, or streamed to its end). */
|
|
4446
|
+
interface CompletedTurn {
|
|
4447
|
+
dispatched?: false;
|
|
4448
|
+
/** The id the server stored the turn's user message under. */
|
|
4449
|
+
user_message_id: string;
|
|
4450
|
+
/** The id the server stored the turn's assistant message under. */
|
|
4451
|
+
assistant_message_id: string;
|
|
4441
4452
|
reply?: string | null;
|
|
4442
4453
|
packet?: Packet;
|
|
4443
4454
|
steps?: Step[];
|
|
@@ -4445,6 +4456,13 @@ interface SendMessageResult {
|
|
|
4445
4456
|
usage?: unknown;
|
|
4446
4457
|
model?: string;
|
|
4447
4458
|
}
|
|
4459
|
+
/** A turn escalated to a background job: the engine polls `job_id`, and the thread's own messages come back through the poll's merges. */
|
|
4460
|
+
interface DispatchedTurn {
|
|
4461
|
+
dispatched: true;
|
|
4462
|
+
job_id: string;
|
|
4463
|
+
reply?: string | null;
|
|
4464
|
+
}
|
|
4465
|
+
type SendMessageResult = CompletedTurn | DispatchedTurn;
|
|
4448
4466
|
interface StreamHandlers {
|
|
4449
4467
|
/** Chunks APPEND, never replace. */
|
|
4450
4468
|
onToken(chunk: string): void;
|
|
@@ -4987,10 +5005,11 @@ declare function isLiveExport(job: ExportJob): boolean;
|
|
|
4987
5005
|
declare function isExpiredExport(job: ExportJob, now: number): boolean;
|
|
4988
5006
|
|
|
4989
5007
|
declare const CSV_FAILED_FALLBACK = "The CSV could not be made.";
|
|
4990
|
-
declare const CSV_KEPT_NOTE = "Kept 24 hours";
|
|
4991
5008
|
interface CsvCardProps {
|
|
4992
5009
|
/** The export as the card should show it. */
|
|
4993
5010
|
job: ExportJob;
|
|
5011
|
+
/** How long the file is kept, in the calling app's words (e.g. "Kept 7 days"): shown while the export is ready. */
|
|
5012
|
+
keptNote: string;
|
|
4994
5013
|
/** Takes the file. Download is on only while the export is ready; the button shows busy until this settles. */
|
|
4995
5014
|
onDownload: (id: string) => Promise<void>;
|
|
4996
5015
|
}
|
|
@@ -4999,7 +5018,7 @@ interface CsvCardProps {
|
|
|
4999
5018
|
* with `apply: false`: a file is downloaded, never applied. Presentational: the export's state is the `job` it is given,
|
|
5000
5019
|
* and a ready file turns expired by itself at the moment it expires while the card is open.
|
|
5001
5020
|
*/
|
|
5002
|
-
declare function CsvCard({ job, onDownload }: CsvCardProps): React.JSX.Element;
|
|
5021
|
+
declare function CsvCard({ job, keptNote, onDownload }: CsvCardProps): React.JSX.Element;
|
|
5003
5022
|
|
|
5004
5023
|
/** Kept modest on purpose: this is a PREVIEW, not a document viewer. A file past this
|
|
5005
5024
|
* many characters still opens — it just shows its first slice, same as CodeBlock's own
|
|
@@ -6068,17 +6087,18 @@ interface UseExportJobsResult {
|
|
|
6068
6087
|
* control that starts an export and the tray that shows it, so they share one poll. */
|
|
6069
6088
|
declare function useExportJobs({ list, acknowledge }: UseExportJobsOptions): UseExportJobsResult;
|
|
6070
6089
|
|
|
6071
|
-
declare const EXPORT_KEPT_NOTE = "Kept for 24 hours";
|
|
6072
6090
|
declare const EXPORT_FAILED_FALLBACK = "Unknown error.";
|
|
6073
6091
|
/** An export as the tray's card shows it. `useExportJobs`' `list` returns only what should show, so a SUCCEEDED export is downloadable. */
|
|
6074
|
-
declare function exportToJob(job: ExportJob, onDownload: (id: string) => void): Job;
|
|
6092
|
+
declare function exportToJob(job: ExportJob, keptNote: string, onDownload: (id: string) => void): Job;
|
|
6075
6093
|
interface ExportTrayProps {
|
|
6094
|
+
/** How long a finished export is kept, in the calling app's words (e.g. "Kept for 7 days"). */
|
|
6095
|
+
keptNote: string;
|
|
6076
6096
|
exports: ExportJob[];
|
|
6077
6097
|
onDownload: (id: string) => void;
|
|
6078
6098
|
onDismiss: (id: string) => void;
|
|
6079
6099
|
}
|
|
6080
6100
|
/** The person's background exports as a `JobTray` in the shared bottom-right corner stack. With no exports it renders
|
|
6081
6101
|
* nothing: an empty card would hold the corner for no reason. */
|
|
6082
|
-
declare function ExportTray({ exports, onDownload, onDismiss }: ExportTrayProps): React.JSX.Element;
|
|
6102
|
+
declare function ExportTray({ exports, keptNote, onDownload, onDismiss }: ExportTrayProps): React.JSX.Element;
|
|
6083
6103
|
|
|
6084
|
-
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, CopyButton, type CopyButtonProps, 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 FilterFieldHelp, 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, HOVER_POPOVER_OPEN_DELAY_MS, type HoverPopoverApi, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, InfoButton, type InfoButtonProps, 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, PanelRow, type PanelRowProps, 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, type ReferenceEntry, ReferenceList, type ReferenceListProps, type ReferenceSection, 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, StatusIndicator, type StatusIndicatorProps, 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 UseHoverPopoverOptions, 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, useHoverPopover, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSessionContextValue, useSheetOpenMark, useShownExport, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, withDeadline, writeQueryToUrl };
|
|
6104
|
+
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, 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, CopyButton, type CopyButtonProps, 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_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 FilterFieldHelp, 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, HOVER_POPOVER_OPEN_DELAY_MS, type HoverPopoverApi, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, InfoButton, type InfoButtonProps, 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, PanelRow, type PanelRowProps, 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, type ReferenceEntry, ReferenceList, type ReferenceListProps, type ReferenceSection, 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, StatusIndicator, type StatusIndicatorProps, 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 UseHoverPopoverOptions, 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, useHoverPopover, 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
|
@@ -3334,6 +3334,14 @@ interface CodeEditorProps {
|
|
|
3334
3334
|
* a message list under the editor) and announced to screen readers via an
|
|
3335
3335
|
* `aria-live` region. */
|
|
3336
3336
|
diagnostics?: CodeEditorDiagnostic[];
|
|
3337
|
+
/** The source language: highlighting, bracket matching and indentation on
|
|
3338
|
+
* Enter. Default "sql". */
|
|
3339
|
+
language?: "sql" | "json";
|
|
3340
|
+
/** JSON mode only: text in, diagnostics out (for example a schema path such
|
|
3341
|
+
* as spec.model). Runs on every edit once the text parses; the parser's own
|
|
3342
|
+
* syntax error replaces it while the text does not. Shown beside any
|
|
3343
|
+
* `diagnostics` the caller passes. */
|
|
3344
|
+
validate?: (text: string) => CodeEditorDiagnostic[];
|
|
3337
3345
|
/** The documented key that moves focus out of the editor after Tab has
|
|
3338
3346
|
* started indenting. Shown as help text under the editor. Default true. */
|
|
3339
3347
|
showEscapeHint?: boolean;
|
|
@@ -3344,14 +3352,14 @@ interface CodeEditorProps {
|
|
|
3344
3352
|
autoFocus?: boolean;
|
|
3345
3353
|
}
|
|
3346
3354
|
/**
|
|
3347
|
-
* An editable, monospace SQL
|
|
3355
|
+
* An editable, monospace code editor (SQL, or JSON with `language="json"`): line numbers, syntax highlighting,
|
|
3348
3356
|
* a controlled value/onChange, disabled/read-only states, and diagnostics
|
|
3349
3357
|
* anchored to a line/column range — shown inline as an underline plus a
|
|
3350
3358
|
* message list, and announced to screen readers through an `aria-live`
|
|
3351
3359
|
* region. See the file header above for the engine choice and the
|
|
3352
3360
|
* keyboard-trap contract (Tab indents; Escape then Tab moves focus out).
|
|
3353
3361
|
*/
|
|
3354
|
-
declare function CodeEditor({ value, onChange, label, help, error, required, disabled, readOnly, placeholder: placeholderText, diagnostics, showEscapeHint, minHeight, id, className, style, autoFocus, }: CodeEditorProps): React.JSX.Element;
|
|
3362
|
+
declare function CodeEditor({ value, onChange, label, help, error, required, disabled, readOnly, placeholder: placeholderText, diagnostics: passedDiagnostics, language, validate, showEscapeHint, minHeight, id, className, style, autoFocus, }: CodeEditorProps): React.JSX.Element;
|
|
3355
3363
|
|
|
3356
3364
|
interface RadioGroupOption {
|
|
3357
3365
|
value: string;
|
|
@@ -4434,10 +4442,13 @@ interface ChatMessage {
|
|
|
4434
4442
|
[k: string]: unknown;
|
|
4435
4443
|
};
|
|
4436
4444
|
}
|
|
4437
|
-
|
|
4438
|
-
|
|
4439
|
-
dispatched?:
|
|
4440
|
-
|
|
4445
|
+
/** A turn that finished in the call (answered, or streamed to its end). */
|
|
4446
|
+
interface CompletedTurn {
|
|
4447
|
+
dispatched?: false;
|
|
4448
|
+
/** The id the server stored the turn's user message under. */
|
|
4449
|
+
user_message_id: string;
|
|
4450
|
+
/** The id the server stored the turn's assistant message under. */
|
|
4451
|
+
assistant_message_id: string;
|
|
4441
4452
|
reply?: string | null;
|
|
4442
4453
|
packet?: Packet;
|
|
4443
4454
|
steps?: Step[];
|
|
@@ -4445,6 +4456,13 @@ interface SendMessageResult {
|
|
|
4445
4456
|
usage?: unknown;
|
|
4446
4457
|
model?: string;
|
|
4447
4458
|
}
|
|
4459
|
+
/** A turn escalated to a background job: the engine polls `job_id`, and the thread's own messages come back through the poll's merges. */
|
|
4460
|
+
interface DispatchedTurn {
|
|
4461
|
+
dispatched: true;
|
|
4462
|
+
job_id: string;
|
|
4463
|
+
reply?: string | null;
|
|
4464
|
+
}
|
|
4465
|
+
type SendMessageResult = CompletedTurn | DispatchedTurn;
|
|
4448
4466
|
interface StreamHandlers {
|
|
4449
4467
|
/** Chunks APPEND, never replace. */
|
|
4450
4468
|
onToken(chunk: string): void;
|
|
@@ -4987,10 +5005,11 @@ declare function isLiveExport(job: ExportJob): boolean;
|
|
|
4987
5005
|
declare function isExpiredExport(job: ExportJob, now: number): boolean;
|
|
4988
5006
|
|
|
4989
5007
|
declare const CSV_FAILED_FALLBACK = "The CSV could not be made.";
|
|
4990
|
-
declare const CSV_KEPT_NOTE = "Kept 24 hours";
|
|
4991
5008
|
interface CsvCardProps {
|
|
4992
5009
|
/** The export as the card should show it. */
|
|
4993
5010
|
job: ExportJob;
|
|
5011
|
+
/** How long the file is kept, in the calling app's words (e.g. "Kept 7 days"): shown while the export is ready. */
|
|
5012
|
+
keptNote: string;
|
|
4994
5013
|
/** Takes the file. Download is on only while the export is ready; the button shows busy until this settles. */
|
|
4995
5014
|
onDownload: (id: string) => Promise<void>;
|
|
4996
5015
|
}
|
|
@@ -4999,7 +5018,7 @@ interface CsvCardProps {
|
|
|
4999
5018
|
* with `apply: false`: a file is downloaded, never applied. Presentational: the export's state is the `job` it is given,
|
|
5000
5019
|
* and a ready file turns expired by itself at the moment it expires while the card is open.
|
|
5001
5020
|
*/
|
|
5002
|
-
declare function CsvCard({ job, onDownload }: CsvCardProps): React.JSX.Element;
|
|
5021
|
+
declare function CsvCard({ job, keptNote, onDownload }: CsvCardProps): React.JSX.Element;
|
|
5003
5022
|
|
|
5004
5023
|
/** Kept modest on purpose: this is a PREVIEW, not a document viewer. A file past this
|
|
5005
5024
|
* many characters still opens — it just shows its first slice, same as CodeBlock's own
|
|
@@ -6068,17 +6087,18 @@ interface UseExportJobsResult {
|
|
|
6068
6087
|
* control that starts an export and the tray that shows it, so they share one poll. */
|
|
6069
6088
|
declare function useExportJobs({ list, acknowledge }: UseExportJobsOptions): UseExportJobsResult;
|
|
6070
6089
|
|
|
6071
|
-
declare const EXPORT_KEPT_NOTE = "Kept for 24 hours";
|
|
6072
6090
|
declare const EXPORT_FAILED_FALLBACK = "Unknown error.";
|
|
6073
6091
|
/** An export as the tray's card shows it. `useExportJobs`' `list` returns only what should show, so a SUCCEEDED export is downloadable. */
|
|
6074
|
-
declare function exportToJob(job: ExportJob, onDownload: (id: string) => void): Job;
|
|
6092
|
+
declare function exportToJob(job: ExportJob, keptNote: string, onDownload: (id: string) => void): Job;
|
|
6075
6093
|
interface ExportTrayProps {
|
|
6094
|
+
/** How long a finished export is kept, in the calling app's words (e.g. "Kept for 7 days"). */
|
|
6095
|
+
keptNote: string;
|
|
6076
6096
|
exports: ExportJob[];
|
|
6077
6097
|
onDownload: (id: string) => void;
|
|
6078
6098
|
onDismiss: (id: string) => void;
|
|
6079
6099
|
}
|
|
6080
6100
|
/** The person's background exports as a `JobTray` in the shared bottom-right corner stack. With no exports it renders
|
|
6081
6101
|
* nothing: an empty card would hold the corner for no reason. */
|
|
6082
|
-
declare function ExportTray({ exports, onDownload, onDismiss }: ExportTrayProps): React.JSX.Element;
|
|
6102
|
+
declare function ExportTray({ exports, keptNote, onDownload, onDismiss }: ExportTrayProps): React.JSX.Element;
|
|
6083
6103
|
|
|
6084
|
-
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, CopyButton, type CopyButtonProps, 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 FilterFieldHelp, 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, HOVER_POPOVER_OPEN_DELAY_MS, type HoverPopoverApi, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, InfoButton, type InfoButtonProps, 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, PanelRow, type PanelRowProps, 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, type ReferenceEntry, ReferenceList, type ReferenceListProps, type ReferenceSection, 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, StatusIndicator, type StatusIndicatorProps, 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 UseHoverPopoverOptions, 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, useHoverPopover, useLayerZIndex, useOverlayLayout, usePopoverPosition, usePublishCornerStackOffset, useResponsiveRail, useRuntimeMode, useServerTable, useSessionContext, useSessionContextValue, useSheetOpenMark, useShownExport, useStackedLayer, useStagedFiles, useToast, useTooltip, validateFilterValue, visibleMessages, watchAppearance, withDeadline, writeQueryToUrl };
|
|
6104
|
+
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, 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, CopyButton, type CopyButtonProps, 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_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 FilterFieldHelp, 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, HOVER_POPOVER_OPEN_DELAY_MS, type HoverPopoverApi, IMPORTANCE_LEVELS, IconButton, type IconButtonProps, type ImportanceLevel, type ImportanceLevelId, ImportanceTag, type ImportanceTagProps, type ImportanceTokens, InfoButton, type InfoButtonProps, 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, PanelRow, type PanelRowProps, 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, type ReferenceEntry, ReferenceList, type ReferenceListProps, type ReferenceSection, 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, StatusIndicator, type StatusIndicatorProps, 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 UseHoverPopoverOptions, 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, useHoverPopover, 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
|
@@ -8749,11 +8749,59 @@ var MarkdownEditor = React60.forwardRef(function MarkdownEditor2({
|
|
|
8749
8749
|
// src/components/forms/CodeEditor.tsx
|
|
8750
8750
|
import * as React61 from "react";
|
|
8751
8751
|
import { EditorView, keymap, lineNumbers, placeholder as cmPlaceholder, drawSelection, Decoration } from "@codemirror/view";
|
|
8752
|
-
import { EditorState, StateEffect, StateField, Compartment } from "@codemirror/state";
|
|
8752
|
+
import { EditorState as EditorState2, StateEffect, StateField, Compartment } from "@codemirror/state";
|
|
8753
8753
|
import { defaultKeymap, history, historyKeymap, indentMore, indentLess } from "@codemirror/commands";
|
|
8754
8754
|
import { sql as sqlLang } from "@codemirror/lang-sql";
|
|
8755
|
+
import { json as jsonLang } from "@codemirror/lang-json";
|
|
8755
8756
|
import { syntaxHighlighting, HighlightStyle, indentOnInput, bracketMatching } from "@codemirror/language";
|
|
8756
8757
|
import { tags } from "@lezer/highlight";
|
|
8758
|
+
|
|
8759
|
+
// src/components/forms/jsonDiagnostics.ts
|
|
8760
|
+
import { EditorState } from "@codemirror/state";
|
|
8761
|
+
import { json } from "@codemirror/lang-json";
|
|
8762
|
+
import { ensureSyntaxTree } from "@codemirror/language";
|
|
8763
|
+
var PARSE_BUDGET_MS = 1e3;
|
|
8764
|
+
function firstErrorOffset(state) {
|
|
8765
|
+
const tree = ensureSyntaxTree(state, state.doc.length, PARSE_BUDGET_MS);
|
|
8766
|
+
let at = -1;
|
|
8767
|
+
tree?.iterate({
|
|
8768
|
+
enter(node) {
|
|
8769
|
+
if (at >= 0) return false;
|
|
8770
|
+
if (node.type.isError) {
|
|
8771
|
+
at = node.from;
|
|
8772
|
+
return false;
|
|
8773
|
+
}
|
|
8774
|
+
return void 0;
|
|
8775
|
+
}
|
|
8776
|
+
});
|
|
8777
|
+
return at;
|
|
8778
|
+
}
|
|
8779
|
+
function jsonSyntaxDiagnostics(text) {
|
|
8780
|
+
if (!text.trim()) return [];
|
|
8781
|
+
try {
|
|
8782
|
+
JSON.parse(text);
|
|
8783
|
+
return [];
|
|
8784
|
+
} catch (e) {
|
|
8785
|
+
if (!(e instanceof SyntaxError)) throw e;
|
|
8786
|
+
const state = EditorState.create({ doc: text, extensions: [json()] });
|
|
8787
|
+
const offset = firstErrorOffset(state);
|
|
8788
|
+
const line = state.doc.lineAt(offset < 0 ? state.doc.length : offset);
|
|
8789
|
+
const at = offset < 0 ? state.doc.length : offset;
|
|
8790
|
+
return [{
|
|
8791
|
+
line: line.number,
|
|
8792
|
+
column: at - line.from + 1,
|
|
8793
|
+
message: e.message.replace(/, ".*" is not valid JSON$/s, ""),
|
|
8794
|
+
severity: "error"
|
|
8795
|
+
}];
|
|
8796
|
+
}
|
|
8797
|
+
}
|
|
8798
|
+
function jsonModeDiagnostics(text, validate) {
|
|
8799
|
+
const syntax = jsonSyntaxDiagnostics(text);
|
|
8800
|
+
if (syntax.length || !validate) return syntax;
|
|
8801
|
+
return validate(text);
|
|
8802
|
+
}
|
|
8803
|
+
|
|
8804
|
+
// src/components/forms/CodeEditor.tsx
|
|
8757
8805
|
import { jsx as jsx86, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
8758
8806
|
function clampOffset(state, line, column) {
|
|
8759
8807
|
const total = state.doc.lines;
|
|
@@ -8840,7 +8888,9 @@ function CodeEditor({
|
|
|
8840
8888
|
disabled = false,
|
|
8841
8889
|
readOnly = false,
|
|
8842
8890
|
placeholder: placeholderText = "",
|
|
8843
|
-
diagnostics
|
|
8891
|
+
diagnostics: passedDiagnostics,
|
|
8892
|
+
language = "sql",
|
|
8893
|
+
validate,
|
|
8844
8894
|
showEscapeHint = true,
|
|
8845
8895
|
minHeight = 160,
|
|
8846
8896
|
id,
|
|
@@ -8849,6 +8899,13 @@ function CodeEditor({
|
|
|
8849
8899
|
autoFocus = false
|
|
8850
8900
|
}) {
|
|
8851
8901
|
const fieldId = useFieldId(id);
|
|
8902
|
+
const diagnostics = React61.useMemo(
|
|
8903
|
+
() => [
|
|
8904
|
+
...passedDiagnostics ?? [],
|
|
8905
|
+
...language === "json" ? jsonModeDiagnostics(value, validate) : []
|
|
8906
|
+
],
|
|
8907
|
+
[passedDiagnostics, language, value, validate]
|
|
8908
|
+
);
|
|
8852
8909
|
const descId = fieldId + "-desc";
|
|
8853
8910
|
const liveId = fieldId + "-live";
|
|
8854
8911
|
const hostRef = React61.useRef(null);
|
|
@@ -8857,6 +8914,7 @@ function CodeEditor({
|
|
|
8857
8914
|
const onChangeRef = React61.useRef(onChange);
|
|
8858
8915
|
onChangeRef.current = onChange;
|
|
8859
8916
|
const editableCompartment = React61.useRef(new Compartment()).current;
|
|
8917
|
+
const languageCompartment = React61.useRef(new Compartment()).current;
|
|
8860
8918
|
const readOnlyCompartment = React61.useRef(new Compartment()).current;
|
|
8861
8919
|
const attributesCompartment = React61.useRef(new Compartment()).current;
|
|
8862
8920
|
const errorRef = React61.useRef(error);
|
|
@@ -8880,7 +8938,7 @@ function CodeEditor({
|
|
|
8880
8938
|
valueRef.current = next;
|
|
8881
8939
|
onChangeRef.current && onChangeRef.current(next);
|
|
8882
8940
|
});
|
|
8883
|
-
const state =
|
|
8941
|
+
const state = EditorState2.create({
|
|
8884
8942
|
doc: value,
|
|
8885
8943
|
extensions: [
|
|
8886
8944
|
lineNumbers(),
|
|
@@ -8888,7 +8946,7 @@ function CodeEditor({
|
|
|
8888
8946
|
drawSelection(),
|
|
8889
8947
|
indentOnInput(),
|
|
8890
8948
|
bracketMatching(),
|
|
8891
|
-
sqlLang(),
|
|
8949
|
+
languageCompartment.of(language === "json" ? jsonLang() : sqlLang()),
|
|
8892
8950
|
syntaxHighlighting(tokenHighlight),
|
|
8893
8951
|
diagnosticsField,
|
|
8894
8952
|
decorationsFromDiagnostics(),
|
|
@@ -8900,7 +8958,7 @@ function CodeEditor({
|
|
|
8900
8958
|
...historyKeymap
|
|
8901
8959
|
]),
|
|
8902
8960
|
editableCompartment.of(EditorView.editable.of(!disabled)),
|
|
8903
|
-
readOnlyCompartment.of(
|
|
8961
|
+
readOnlyCompartment.of(EditorState2.readOnly.of(readOnly)),
|
|
8904
8962
|
updateListener,
|
|
8905
8963
|
attributesCompartment.of(EditorView.contentAttributes.of(contentAttributes()))
|
|
8906
8964
|
]
|
|
@@ -8930,7 +8988,12 @@ function CodeEditor({
|
|
|
8930
8988
|
React61.useEffect(() => {
|
|
8931
8989
|
const view = viewRef.current;
|
|
8932
8990
|
if (!view) return;
|
|
8933
|
-
view.dispatch({ effects:
|
|
8991
|
+
view.dispatch({ effects: languageCompartment.reconfigure(language === "json" ? jsonLang() : sqlLang()) });
|
|
8992
|
+
}, [language, languageCompartment]);
|
|
8993
|
+
React61.useEffect(() => {
|
|
8994
|
+
const view = viewRef.current;
|
|
8995
|
+
if (!view) return;
|
|
8996
|
+
view.dispatch({ effects: readOnlyCompartment.reconfigure(EditorState2.readOnly.of(readOnly)) });
|
|
8934
8997
|
}, [readOnly, readOnlyCompartment]);
|
|
8935
8998
|
React61.useEffect(() => {
|
|
8936
8999
|
const view = viewRef.current;
|
|
@@ -13415,8 +13478,9 @@ function useChatEngine(opts) {
|
|
|
13415
13478
|
res = await apiAdapter.sendMessage(id, turn.text, ac.signal);
|
|
13416
13479
|
}
|
|
13417
13480
|
patch(userId, { pending: false });
|
|
13418
|
-
|
|
13419
|
-
|
|
13481
|
+
if (!res) throw new Error("send_failed");
|
|
13482
|
+
const r = res;
|
|
13483
|
+
if (r.dispatched) {
|
|
13420
13484
|
patch(holderId, { streaming: false, working: true, jobId: r.job_id, text: r.reply || "" });
|
|
13421
13485
|
await pollJob(r.job_id, holderId);
|
|
13422
13486
|
} else {
|
|
@@ -13431,6 +13495,7 @@ function useChatEngine(opts) {
|
|
|
13431
13495
|
model: r.model,
|
|
13432
13496
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
13433
13497
|
});
|
|
13498
|
+
commit(listRef.current.map((m) => m.id === userId ? { ...m, id: r.user_message_id } : m.id === holderId ? { ...m, id: r.assistant_message_id } : m));
|
|
13434
13499
|
serverCount.current += 2;
|
|
13435
13500
|
if (r.packet && onPacket) onPacket(r.packet);
|
|
13436
13501
|
}
|
|
@@ -14783,8 +14848,7 @@ var STATE = {
|
|
|
14783
14848
|
failed: { label: "Failed", tone: "danger" }
|
|
14784
14849
|
};
|
|
14785
14850
|
var CSV_FAILED_FALLBACK = "The CSV could not be made.";
|
|
14786
|
-
|
|
14787
|
-
function CsvCard({ job, onDownload }) {
|
|
14851
|
+
function CsvCard({ job, keptNote, onDownload }) {
|
|
14788
14852
|
const [downloading, setDownloading] = React88.useState(false);
|
|
14789
14853
|
const now = useExpiryClock(job);
|
|
14790
14854
|
const state = exportStateOf(job, now);
|
|
@@ -14801,7 +14865,7 @@ function CsvCard({ job, onDownload }) {
|
|
|
14801
14865
|
] }),
|
|
14802
14866
|
state === "failed" ? /* @__PURE__ */ jsx114("p", { className: "fd-body-sm fd-danger", children: job.failureMessage ?? CSV_FAILED_FALLBACK }) : null,
|
|
14803
14867
|
facts.length === 0 ? null : /* @__PURE__ */ jsx114(FactList, { facts }),
|
|
14804
|
-
state === "ready" ? /* @__PURE__ */ jsx114("p", { className: "fd-body-sm fd-muted", children:
|
|
14868
|
+
state === "ready" ? /* @__PURE__ */ jsx114("p", { className: "fd-body-sm fd-muted", children: keptNote }) : null,
|
|
14805
14869
|
/* @__PURE__ */ jsx114("div", { className: "fd-row fd-wrap fd-gap-sm", children: /* @__PURE__ */ jsx114(
|
|
14806
14870
|
Button,
|
|
14807
14871
|
{
|
|
@@ -16197,7 +16261,7 @@ function createChatAdapter(transport, { onTurnStarted, deadlineMs = CHAT_CALL_DE
|
|
|
16197
16261
|
if (err instanceof ChatUnreachableError) throw new Error(CHAT_UNAVAILABLE_MESSAGE);
|
|
16198
16262
|
throw err;
|
|
16199
16263
|
}
|
|
16200
|
-
if (result.
|
|
16264
|
+
if (result.dispatched) throw new Error("A streamed turn must end with its final result, not a job to poll.");
|
|
16201
16265
|
markStarted();
|
|
16202
16266
|
return result;
|
|
16203
16267
|
}
|
|
@@ -16322,16 +16386,15 @@ function useExportJobs({ list, acknowledge }) {
|
|
|
16322
16386
|
// src/kits/exports/ExportTray.tsx
|
|
16323
16387
|
import * as React96 from "react";
|
|
16324
16388
|
import { jsx as jsx117 } from "react/jsx-runtime";
|
|
16325
|
-
var EXPORT_KEPT_NOTE = "Kept for 24 hours";
|
|
16326
16389
|
var EXPORT_FAILED_FALLBACK = "Unknown error.";
|
|
16327
|
-
function exportToJob(job, onDownload) {
|
|
16390
|
+
function exportToJob(job, keptNote, onDownload) {
|
|
16328
16391
|
const base = { id: job.id, title: job.title, note: job.note };
|
|
16329
16392
|
if (job.status === "SUCCEEDED") {
|
|
16330
16393
|
return {
|
|
16331
16394
|
...base,
|
|
16332
16395
|
status: "done",
|
|
16333
16396
|
action: { label: "Download", icon: "download-simple", onClick: () => onDownload(job.id) },
|
|
16334
|
-
doneNote:
|
|
16397
|
+
doneNote: keptNote
|
|
16335
16398
|
};
|
|
16336
16399
|
}
|
|
16337
16400
|
if (job.status === "FAILED") {
|
|
@@ -16339,8 +16402,8 @@ function exportToJob(job, onDownload) {
|
|
|
16339
16402
|
}
|
|
16340
16403
|
return { ...base, status: "active" };
|
|
16341
16404
|
}
|
|
16342
|
-
function ExportTray({ exports, onDownload, onDismiss }) {
|
|
16343
|
-
const jobs2 = React96.useMemo(() => exports.map((job) => exportToJob(job, onDownload)), [exports, onDownload]);
|
|
16405
|
+
function ExportTray({ exports, keptNote, onDownload, onDismiss }) {
|
|
16406
|
+
const jobs2 = React96.useMemo(() => exports.map((job) => exportToJob(job, keptNote, onDownload)), [exports, keptNote, onDownload]);
|
|
16344
16407
|
return /* @__PURE__ */ jsx117(JobTray, { jobs: jobs2, onDismiss });
|
|
16345
16408
|
}
|
|
16346
16409
|
export {
|
|
@@ -16369,7 +16432,6 @@ export {
|
|
|
16369
16432
|
CORNER_STACK_INSET_PROPERTY,
|
|
16370
16433
|
CORNER_STACK_OFFSET_PROPERTY,
|
|
16371
16434
|
CSV_FAILED_FALLBACK,
|
|
16372
|
-
CSV_KEPT_NOTE,
|
|
16373
16435
|
Calendar,
|
|
16374
16436
|
CallDeadlineError,
|
|
16375
16437
|
Card,
|
|
@@ -16413,7 +16475,6 @@ export {
|
|
|
16413
16475
|
ENTITY_ROW_METRIC_WIDTH,
|
|
16414
16476
|
EXPORT_FAILED_FALLBACK,
|
|
16415
16477
|
EXPORT_IDLE_POLL_INTERVAL_MS,
|
|
16416
|
-
EXPORT_KEPT_NOTE,
|
|
16417
16478
|
EXPORT_POLL_INTERVAL_MS,
|
|
16418
16479
|
EditableTitle,
|
|
16419
16480
|
EmptyState,
|