@sybilion/uilib 1.0.20
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 +138 -0
- package/dist/esm/assets/doc-4d8d38268d07c83e.png +0 -0
- package/dist/esm/assets/xls-d1595343260dd096.png +0 -0
- package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.js +188 -0
- package/dist/esm/components/ui/AnalysesSelector/AnalysesSelector.styl.js +7 -0
- package/dist/esm/components/ui/AnalysisLineIcon/AnalysisLineIcon.js +11 -0
- package/dist/esm/components/ui/AnalysisLineIcon/AnalysisLineIcon.styl.js +7 -0
- package/dist/esm/components/ui/AppHeader/AppHeader.js +22 -0
- package/dist/esm/components/ui/AppHeader/AppHeader.styl.js +7 -0
- package/dist/esm/components/ui/AppHeader/appChromeAnchors.js +4 -0
- package/dist/esm/components/ui/Avatar/Avatar.js +16 -0
- package/dist/esm/components/ui/Avatar/Avatar.styl.js +7 -0
- package/dist/esm/components/ui/Badge/Badge.js +11 -0
- package/dist/esm/components/ui/Badge/Badge.styl.js +7 -0
- package/dist/esm/components/ui/Breadcrumb/Breadcrumb.js +30 -0
- package/dist/esm/components/ui/Breadcrumb/Breadcrumb.styl.js +7 -0
- package/dist/esm/components/ui/Button/Button.js +12 -0
- package/dist/esm/components/ui/Button/Button.styl.js +7 -0
- package/dist/esm/components/ui/Card/Card.js +57 -0
- package/dist/esm/components/ui/Card/Card.styl.js +7 -0
- package/dist/esm/components/ui/Chart/Chart.context.js +11 -0
- package/dist/esm/components/ui/Chart/Chart.helpers.js +9 -0
- package/dist/esm/components/ui/Chart/Chart.js +23 -0
- package/dist/esm/components/ui/Chart/Chart.styl.js +7 -0
- package/dist/esm/components/ui/Chart/Chart.types.js +3 -0
- package/dist/esm/components/ui/Chart/components/BaseChartWrapper.js +473 -0
- package/dist/esm/components/ui/Chart/components/BaseChartWrapper.styl.js +7 -0
- package/dist/esm/components/ui/Chart/components/ChartAxes.js +52 -0
- package/dist/esm/components/ui/Chart/components/ChartContainer.js +31 -0
- package/dist/esm/components/ui/Chart/components/ChartGrid.js +9 -0
- package/dist/esm/components/ui/Chart/components/ChartLegendContent.js +17 -0
- package/dist/esm/components/ui/Chart/components/ChartLegendItem.js +13 -0
- package/dist/esm/components/ui/Chart/components/ChartTooltipContent.js +74 -0
- package/dist/esm/components/ui/Chart/components/ChartTooltipItem.js +26 -0
- package/dist/esm/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.js +64 -0
- package/dist/esm/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.styl.js +7 -0
- package/dist/esm/components/ui/Chart/components/LegendSvg/LegendSvg.js +19 -0
- package/dist/esm/components/ui/Chart/components/QuantileBands.js +23 -0
- package/dist/esm/components/ui/Chart/tools/formatters.js +81 -0
- package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.js +15 -0
- package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.js +103 -0
- package/dist/esm/components/ui/ChartAreaInteractive/ChartAreaInteractive.styl.js +7 -0
- package/dist/esm/components/ui/ChartAreaInteractive/ChartLines.js +81 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.js +134 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.js +257 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.styl.js +7 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.js +165 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl.js +7 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.js +113 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.js +114 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.styl.js +7 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/useChartYRange.js +155 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/useForecastColor.js +33 -0
- package/dist/esm/components/ui/ChartAreaInteractive/overlays/useQuantileBands.js +170 -0
- package/dist/esm/components/ui/Chat/Chat.js +17 -0
- package/dist/esm/components/ui/Chat/Chat.styl.js +7 -0
- package/dist/esm/components/ui/Chat/Chat.types.js +10 -0
- package/dist/esm/components/ui/Chat/ChatChrome/ChatChrome.js +31 -0
- package/dist/esm/components/ui/Chat/ChatChrome/ChatChrome.styl.js +7 -0
- package/dist/esm/components/ui/Chat/ChatEmptyState/ChatEmptyState.js +8 -0
- package/dist/esm/components/ui/Chat/ChatEmptyState/ChatEmptyState.styl.js +7 -0
- package/dist/esm/components/ui/Chat/ChatMessage/AgentMessageContent.helpers.js +312 -0
- package/dist/esm/components/ui/Chat/ChatMessage/AgentMessageContent.js +133 -0
- package/dist/esm/components/ui/Chat/ChatMessage/ChatDatasetApplicationLink.js +23 -0
- package/dist/esm/components/ui/Chat/ChatMessage/ChatMessage.js +14 -0
- package/dist/esm/components/ui/Chat/ChatMessage/ChatMessage.styl.js +7 -0
- package/dist/esm/components/ui/Chat/ChatMessage/icons/DocIcon.js +8 -0
- package/dist/esm/components/ui/Chat/ChatMessage/icons/XlsIcon.js +8 -0
- package/dist/esm/components/ui/Chat/ChatMessage/icons/doc.png.js +3 -0
- package/dist/esm/components/ui/Chat/ChatMessage/icons/xls.png.js +3 -0
- package/dist/esm/components/ui/Chat/ChatMessage/presetScript.js +187 -0
- package/dist/esm/components/ui/Chat/ChatPresets/ChatPresets.js +23 -0
- package/dist/esm/components/ui/Chat/ChatPresets/ChatPresets.styl.js +7 -0
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.js +48 -0
- package/dist/esm/components/ui/Chat/ChatPrompt/ChatPrompt.styl.js +7 -0
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSelector.js +29 -0
- package/dist/esm/components/ui/Chat/ChatSheet/ChatSheet.js +34 -0
- package/dist/esm/components/ui/Chat/ChatSheet/useChatPanelChromeModel.js +800 -0
- package/dist/esm/components/ui/Chat/chat-preset-utils.js +22 -0
- package/dist/esm/components/ui/Checkbox/Checkbox.js +11 -0
- package/dist/esm/components/ui/Checkbox/Checkbox.styl.js +7 -0
- package/dist/esm/components/ui/Dialog/Dialog.js +126 -0
- package/dist/esm/components/ui/Dialog/Dialog.styl.js +7 -0
- package/dist/esm/components/ui/DraggingButton/DraggingButton.js +11 -0
- package/dist/esm/components/ui/DraggingButton/DraggingButton.styl.js +7 -0
- package/dist/esm/components/ui/Drawer/Drawer.js +37 -0
- package/dist/esm/components/ui/Drawer/Drawer.styl.js +7 -0
- package/dist/esm/components/ui/DropZone/DropZone.js +112 -0
- package/dist/esm/components/ui/DropZone/DropZone.styl.js +7 -0
- package/dist/esm/components/ui/DropdownMenu/DropdownMenu.js +53 -0
- package/dist/esm/components/ui/DropdownMenu/DropdownMenu.styl.js +7 -0
- package/dist/esm/components/ui/FlickeringGrid/FlickeringGrid.js +8 -0
- package/dist/esm/components/ui/FlickeringGrid/FlickeringGrid.styl.js +7 -0
- package/dist/esm/components/ui/Foldable/Foldable.js +15 -0
- package/dist/esm/components/ui/Foldable/Foldable.styl.js +7 -0
- package/dist/esm/components/ui/Gap/Gap.js +6 -0
- package/dist/esm/components/ui/Gap/Gap.styl.js +7 -0
- package/dist/esm/components/ui/Image/Image.js +17 -0
- package/dist/esm/components/ui/Image/Image.styl.js +7 -0
- package/dist/esm/components/ui/ImageWithFallback/ImageWithFallback.js +19 -0
- package/dist/esm/components/ui/Input/Input.js +14 -0
- package/dist/esm/components/ui/Input/Input.styl.js +7 -0
- package/dist/esm/components/ui/InteractionOverlay/InteractionOverlay.js +35 -0
- package/dist/esm/components/ui/InteractionOverlay/InteractionOverlay.styl.js +7 -0
- package/dist/esm/components/ui/InteractiveContent/InteractiveContent.js +10 -0
- package/dist/esm/components/ui/InteractiveContent/InteractiveContent.styl.js +7 -0
- package/dist/esm/components/ui/Label/Label.js +10 -0
- package/dist/esm/components/ui/Label/Label.styl.js +7 -0
- package/dist/esm/components/ui/LabelWithId/AltKeyProvider.js +22 -0
- package/dist/esm/components/ui/LabelWithId/LabelWithId.js +9 -0
- package/dist/esm/components/ui/LabelWithId/LabelWithId.styl.js +7 -0
- package/dist/esm/components/ui/LabeledInput/LabeledInput.js +12 -0
- package/dist/esm/components/ui/LabeledInput/LabeledInput.styl.js +7 -0
- package/dist/esm/components/ui/LegacyPlatformLink/LegacyPlatformLink.js +10 -0
- package/dist/esm/components/ui/LegacyPlatformLink/LegacyPlatformLink.styl.js +7 -0
- package/dist/esm/components/ui/Logo/Logo.js +9 -0
- package/dist/esm/components/ui/Logo/Logo.styl.js +7 -0
- package/dist/esm/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.js +23 -0
- package/dist/esm/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.styl.js +7 -0
- package/dist/esm/components/ui/NumberControl/NumberControl.js +26 -0
- package/dist/esm/components/ui/NumberControl/NumberControl.styl.js +7 -0
- package/dist/esm/components/ui/Page/AppShell/AppShell.js +14 -0
- package/dist/esm/components/ui/Page/AppShell/AppShell.styl.js +7 -0
- package/dist/esm/components/ui/Page/Breadcrumbs/Breadcrumbs.js +22 -0
- package/dist/esm/components/ui/Page/Breadcrumbs/Breadcrumbs.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageColumns/PageColumns.js +9 -0
- package/dist/esm/components/ui/Page/PageColumns/PageColumns.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageContent/PageContent.js +12 -0
- package/dist/esm/components/ui/Page/PageContent/PageContent.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.js +8 -0
- package/dist/esm/components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageFooter/PageFooter.js +10 -0
- package/dist/esm/components/ui/Page/PageFooter/PageFooter.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageHeader/PageHeader.js +14 -0
- package/dist/esm/components/ui/Page/PageHeader/PageHeader.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageScroll/PageScroll.js +37 -0
- package/dist/esm/components/ui/Page/PageScroll/PageScroll.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageTabs/PageTabs.js +22 -0
- package/dist/esm/components/ui/Page/PageTabs/PageTabs.styl.js +7 -0
- package/dist/esm/components/ui/Page/PageXScroll/PageXScroll.js +34 -0
- package/dist/esm/components/ui/Page/PageXScroll/PageXScroll.styl.js +7 -0
- package/dist/esm/components/ui/Page/SectionHeader/SectionHeader.js +9 -0
- package/dist/esm/components/ui/Page/SectionHeader/SectionHeader.styl.js +7 -0
- package/dist/esm/components/ui/Page/pageContext.js +8 -0
- package/dist/esm/components/ui/Progress/Progress.js +10 -0
- package/dist/esm/components/ui/Progress/Progress.styl.js +7 -0
- package/dist/esm/components/ui/RegionCoords/RegionSelector.js +22 -0
- package/dist/esm/components/ui/RegionCoords/RegionSelector.styl.js +7 -0
- package/dist/esm/components/ui/Renamer/Renamer.js +61 -0
- package/dist/esm/components/ui/Renamer/Renamer.styl.js +7 -0
- package/dist/esm/components/ui/Select/Select.js +35 -0
- package/dist/esm/components/ui/Select/Select.styl.js +7 -0
- package/dist/esm/components/ui/Separator/Separator.js +10 -0
- package/dist/esm/components/ui/Separator/Separator.styl.js +7 -0
- package/dist/esm/components/ui/Sheet/Sheet.js +41 -0
- package/dist/esm/components/ui/Sheet/Sheet.styl.js +7 -0
- package/dist/esm/components/ui/Sidebar/Sidebar.js +448 -0
- package/dist/esm/components/ui/Sidebar/Sidebar.styl.js +7 -0
- package/dist/esm/components/ui/Skeleton/Skeleton.js +9 -0
- package/dist/esm/components/ui/Skeleton/Skeleton.styl.js +7 -0
- package/dist/esm/components/ui/Slider/Slider.js +123 -0
- package/dist/esm/components/ui/Slider/Slider.styl.js +7 -0
- package/dist/esm/components/ui/SmartTextTruncate/SmartTextTruncate.js +98 -0
- package/dist/esm/components/ui/Sparkline/Sparkline.helpers.js +11 -0
- package/dist/esm/components/ui/Sparkline/Sparkline.js +27 -0
- package/dist/esm/components/ui/Sparkline/Sparkline.styl.js +7 -0
- package/dist/esm/components/ui/Switch/Switch.js +17 -0
- package/dist/esm/components/ui/Switch/Switch.styl.js +7 -0
- package/dist/esm/components/ui/Table/Table.js +30 -0
- package/dist/esm/components/ui/Table/Table.styl.js +7 -0
- package/dist/esm/components/ui/Tabs/Tabs.js +19 -0
- package/dist/esm/components/ui/Tabs/Tabs.styl.js +7 -0
- package/dist/esm/components/ui/TextShimmer/TextShimmer.js +31 -0
- package/dist/esm/components/ui/TextShimmer/TextShimmer.styl.js +7 -0
- package/dist/esm/components/ui/TextWithDeferTooltip/TextWithDeferTooltip.js +48 -0
- package/dist/esm/components/ui/TimeRangeControls/TimeRangeControls.constants.js +3 -0
- package/dist/esm/components/ui/TimeRangeControls/TimeRangeControls.js +13 -0
- package/dist/esm/components/ui/TimeRangeControls/TimeRangeControls.styl.js +7 -0
- package/dist/esm/components/ui/Toggle/Toggle.js +10 -0
- package/dist/esm/components/ui/Toggle/Toggle.styl.js +7 -0
- package/dist/esm/components/ui/ToggleGroup/ToggleGroup.helpers.js +12 -0
- package/dist/esm/components/ui/ToggleGroup/ToggleGroup.js +19 -0
- package/dist/esm/components/ui/ToggleGroup/ToggleGroup.styl.js +7 -0
- package/dist/esm/components/ui/Tooltip/Tooltip.js +22 -0
- package/dist/esm/components/ui/Tooltip/Tooltip.styl.js +7 -0
- package/dist/esm/components/ui/VimeoEmbed/VimeoEmbed.js +137 -0
- package/dist/esm/components/ui/VimeoEmbed/VimeoEmbed.styl.js +7 -0
- package/dist/esm/constants/dataset.js +4 -0
- package/dist/esm/contexts/chat-context.js +297 -0
- package/dist/esm/hooks/panelWidth.js +46 -0
- package/dist/esm/hooks/useDebounceCallback.js +14 -0
- package/dist/esm/hooks/useDragElem.js +115 -0
- package/dist/esm/hooks/useEvent.js +52 -0
- package/dist/esm/hooks/useIsMobile.js +18 -0
- package/dist/esm/hooks/useIsTouchDevice.js +43 -0
- package/dist/esm/hooks/useQueryParams.js +40 -0
- package/dist/esm/hooks/useShellWidthObserver.js +23 -0
- package/dist/esm/hooks/useThrottledCallback.js +28 -0
- package/dist/esm/index.js +83 -0
- package/dist/esm/lib/cookie-consent/cookie-consent.js +63 -0
- package/dist/esm/lib/cookie.js +22 -0
- package/dist/esm/lib/dashboard-spec/stripJsonDashboardFences.js +7 -0
- package/dist/esm/lib/logger.js +10 -0
- package/dist/esm/tools/debounce.js +41 -0
- package/dist/esm/tools/env.js +7 -0
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/node_modules/@reduxjs/toolkit/dist/uncheckedindexed.d.ts +5 -0
- package/dist/esm/types/node_modules/@vimeo/player/types/errors.d.ts +28 -0
- package/dist/esm/types/node_modules/@vimeo/player/types/events.d.ts +144 -0
- package/dist/esm/types/node_modules/@vimeo/player/types/formats.d.ts +406 -0
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.d.ts +2 -0
- package/dist/esm/types/src/components/ui/AnalysesSelector/AnalysesSelector.types.d.ts +38 -0
- package/dist/esm/types/src/components/ui/AnalysesSelector/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/AnalysisLineIcon/AnalysisLineIcon.d.ts +6 -0
- package/dist/esm/types/src/components/ui/AnalysisLineIcon/index.d.ts +1 -0
- package/dist/esm/types/src/components/ui/AppHeader/AppHeader.d.ts +11 -0
- package/dist/esm/types/src/components/ui/AppHeader/appChromeAnchors.d.ts +2 -0
- package/dist/esm/types/src/components/ui/AppHeader/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Avatar/Avatar.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Avatar/Avatar.types.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Avatar/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Badge/Badge.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Badge/Badge.types.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Badge/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Breadcrumb/Breadcrumb.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Breadcrumb/Breadcrumb.types.d.ts +15 -0
- package/dist/esm/types/src/components/ui/Breadcrumb/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Button/Button.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Button/Button.types.d.ts +8 -0
- package/dist/esm/types/src/components/ui/Button/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Card/Card.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Card/Card.types.d.ts +29 -0
- package/dist/esm/types/src/components/ui/Card/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chart/Chart.context.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Chart/Chart.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chart/Chart.helpers.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Chart/Chart.types.d.ts +34 -0
- package/dist/esm/types/src/components/ui/Chart/chartForecastVisualization.constants.d.ts +21 -0
- package/dist/esm/types/src/components/ui/Chart/chartForecastVisualization.types.d.ts +84 -0
- package/dist/esm/types/src/components/ui/Chart/components/ActiveDotsLayer/ActiveDotsLayer.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Chart/components/BaseChartWrapper.d.ts +79 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartAxes.d.ts +15 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartContainer.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartGrid.d.ts +1 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartLegendContent.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartLegendItem.d.ts +15 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartTooltipContent.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chart/components/ChartTooltipItem.d.ts +24 -0
- package/dist/esm/types/src/components/ui/Chart/components/ConfidenceBands.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.d.ts +31 -0
- package/dist/esm/types/src/components/ui/Chart/components/ForecastBoundaries.d.ts +8 -0
- package/dist/esm/types/src/components/ui/Chart/components/ForecastLine.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chart/components/HistoricalLine.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chart/components/LegendSvg/LegendSvg.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chart/components/QuantileBands.d.ts +18 -0
- package/dist/esm/types/src/components/ui/Chart/components/index.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chart/hooks/useChartAnimation.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Chart/hooks/useChartColors.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chart/hooks/useLegendState.d.ts +10 -0
- package/dist/esm/types/src/components/ui/Chart/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chart/tools/formatters.d.ts +21 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.d.ts +31 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.types.d.ts +63 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/ChartLines.d.ts +45 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.d.ts +17 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.d.ts +15 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.d.ts +10 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.d.ts +19 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.d.ts +15 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.d.ts +18 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/useForecastColor.d.ts +10 -0
- package/dist/esm/types/src/components/ui/ChartAreaInteractive/overlays/useQuantileBands.d.ts +22 -0
- package/dist/esm/types/src/components/ui/Chat/Chat.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Chat/Chat.types.d.ts +80 -0
- package/dist/esm/types/src/components/ui/Chat/ChatChrome/ChatChrome.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chat/ChatChrome/ChatChrome.types.d.ts +45 -0
- package/dist/esm/types/src/components/ui/Chat/ChatChrome/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.types.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/AgentMessageContent.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/AgentMessageContent.helpers.d.ts +31 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/ChatDatasetApplicationLink.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/ChatMessage.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/MessageChart.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/icons/DocIcon.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/icons/XlsIcon.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/index.d.ts +1 -0
- package/dist/esm/types/src/components/ui/Chat/ChatMessage/presetScript.d.ts +55 -0
- package/dist/esm/types/src/components/ui/Chat/ChatPresets/ChatPresets.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Chat/ChatPresets/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chat/ChatPrompt/ChatPrompt.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Chat/ChatPrompt/index.d.ts +1 -0
- package/dist/esm/types/src/components/ui/Chat/ChatSheet/ChatSelector.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Chat/ChatSheet/ChatSettings.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Chat/ChatSheet/ChatSheet.d.ts +22 -0
- package/dist/esm/types/src/components/ui/Chat/ChatSheet/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Chat/ChatSheet/useChatPanelChromeModel.d.ts +25 -0
- package/dist/esm/types/src/components/ui/Chat/chat-preset-utils.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Chat/index.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Checkbox/Checkbox.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Checkbox/Checkbox.types.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Checkbox/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Dialog/Dialog.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Dialog/Dialog.types.d.ts +26 -0
- package/dist/esm/types/src/components/ui/Dialog/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/DraggingButton/DraggingButton.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Drawer/Drawer.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Drawer/Drawer.types.d.ts +30 -0
- package/dist/esm/types/src/components/ui/Drawer/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/DropZone/DropZone.d.ts +20 -0
- package/dist/esm/types/src/components/ui/DropdownMenu/DropdownMenu.d.ts +17 -0
- package/dist/esm/types/src/components/ui/DropdownMenu/DropdownMenu.types.d.ts +36 -0
- package/dist/esm/types/src/components/ui/DropdownMenu/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/FlickeringGrid/FlickeringGrid.d.ts +3 -0
- package/dist/esm/types/src/components/ui/FlickeringGrid/FlickeringGrid.types.d.ts +10 -0
- package/dist/esm/types/src/components/ui/FlickeringGrid/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Foldable/Foldable.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Foldable/Foldable.types.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Foldable/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Gap/Gap.d.ts +1 -0
- package/dist/esm/types/src/components/ui/Image/Image.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Image/Image.types.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Image/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/ImageWithFallback/ImageWithFallback.d.ts +2 -0
- package/dist/esm/types/src/components/ui/ImageWithFallback/ImageWithFallback.types.d.ts +5 -0
- package/dist/esm/types/src/components/ui/ImageWithFallback/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/InfoIconTooltip/InfoIconTooltip.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Input/Input.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Input/Input.types.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Input/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/InteractionOverlay/InteractionOverlay.d.ts +6 -0
- package/dist/esm/types/src/components/ui/InteractiveContent/InteractiveContent.d.ts +6 -0
- package/dist/esm/types/src/components/ui/InteractiveContent/index.d.ts +1 -0
- package/dist/esm/types/src/components/ui/Label/Label.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Label/Label.types.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Label/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/LabelWithId/AltKeyProvider.d.ts +3 -0
- package/dist/esm/types/src/components/ui/LabelWithId/LabelWithId.d.ts +2 -0
- package/dist/esm/types/src/components/ui/LabelWithId/LabelWithId.types.d.ts +5 -0
- package/dist/esm/types/src/components/ui/LabelWithId/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/LabeledInput/LabeledInput.d.ts +12 -0
- package/dist/esm/types/src/components/ui/LabledCheckbox/LabledCheckbox.d.ts +6 -0
- package/dist/esm/types/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.d.ts +2 -0
- package/dist/esm/types/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/LegacyPlatformLink/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Logo/Logo.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Logo/Logo.types.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Logo/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.d.ts +2 -0
- package/dist/esm/types/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.types.d.ts +18 -0
- package/dist/esm/types/src/components/ui/MobileAdaptiveSelector/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/NumberControl/NumberControl.d.ts +2 -0
- package/dist/esm/types/src/components/ui/NumberControl/NumberControl.types.d.ts +7 -0
- package/dist/esm/types/src/components/ui/NumberControl/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/AppShell/AppShell.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Page/Breadcrumbs/Breadcrumbs.d.ts +15 -0
- package/dist/esm/types/src/components/ui/Page/Breadcrumbs/Breadcrumbs.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Page/PageColumns/PageColumns.d.ts +5 -0
- package/dist/esm/types/src/components/ui/Page/PageContent/PageContent.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Page/PageFooter/PageFooter.d.ts +16 -0
- package/dist/esm/types/src/components/ui/Page/PageHeader/PageHeader.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Page/PageScroll/PageScroll.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Page/PageTabs/PageTabs.d.ts +14 -0
- package/dist/esm/types/src/components/ui/Page/PageXScroll/PageXScroll.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Page/SectionHeader/SectionHeader.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/SectionHeader/SectionHeader.types.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Page/SectionHeader/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Page/index.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Page/pageContext.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Progress/Progress.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Progress/Progress.types.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Progress/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/RegionCoords/RegionSelector.d.ts +2 -0
- package/dist/esm/types/src/components/ui/RegionCoords/RegionSelector.types.d.ts +13 -0
- package/dist/esm/types/src/components/ui/RegionCoords/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Renamer/Renamer.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Renamer/Renamer.types.d.ts +11 -0
- package/dist/esm/types/src/components/ui/Renamer/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Select/Select.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Select/Select.types.d.ts +20 -0
- package/dist/esm/types/src/components/ui/Select/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Separator/Separator.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Separator/Separator.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Separator/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sheet/Sheet.d.ts +10 -0
- package/dist/esm/types/src/components/ui/Sheet/Sheet.types.d.ts +15 -0
- package/dist/esm/types/src/components/ui/Sheet/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sidebar/Sidebar.d.ts +93 -0
- package/dist/esm/types/src/components/ui/Skeleton/Skeleton.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Skeleton/Skeleton.helpers.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Skeleton/Skeleton.types.d.ts +8 -0
- package/dist/esm/types/src/components/ui/Skeleton/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Slider/Slider.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Slider/Slider.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Slider/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/SmartTextTruncate/SmartTextTruncate.d.ts +3 -0
- package/dist/esm/types/src/components/ui/SmartTextTruncate/SmartTextTruncate.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/SmartTextTruncate/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Sparkline/Sparkline.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Sparkline/Sparkline.helpers.d.ts +9 -0
- package/dist/esm/types/src/components/ui/Sparkline/Sparkline.types.d.ts +16 -0
- package/dist/esm/types/src/components/ui/Sparkline/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Switch/Switch.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Switch/Switch.types.d.ts +4 -0
- package/dist/esm/types/src/components/ui/Switch/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Table/Table.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Table/Table.types.d.ts +19 -0
- package/dist/esm/types/src/components/ui/Table/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Tabs/Tabs.d.ts +12 -0
- package/dist/esm/types/src/components/ui/Tabs/Tabs.types.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Tabs/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/TextShimmer/TextShimmer.d.ts +5 -0
- package/dist/esm/types/src/components/ui/TextShimmer/TextShimmer.types.d.ts +8 -0
- package/dist/esm/types/src/components/ui/TextShimmer/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/TextWithDeferTooltip/TextWithDeferTooltip.d.ts +3 -0
- package/dist/esm/types/src/components/ui/TextWithDeferTooltip/TextWithDeferTooltip.types.d.ts +7 -0
- package/dist/esm/types/src/components/ui/TextWithDeferTooltip/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/TimeRangeControls/TimeRangeControls.constants.d.ts +1 -0
- package/dist/esm/types/src/components/ui/TimeRangeControls/TimeRangeControls.d.ts +11 -0
- package/dist/esm/types/src/components/ui/TimeRangeControls/TimeRangeControls.types.d.ts +2 -0
- package/dist/esm/types/src/components/ui/TimeRangeControls/index.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Toggle/Toggle.d.ts +3 -0
- package/dist/esm/types/src/components/ui/Toggle/Toggle.types.d.ts +7 -0
- package/dist/esm/types/src/components/ui/Toggle/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/ToggleGroup/ToggleGroup.d.ts +4 -0
- package/dist/esm/types/src/components/ui/ToggleGroup/ToggleGroup.helpers.d.ts +6 -0
- package/dist/esm/types/src/components/ui/ToggleGroup/ToggleGroup.types.d.ts +32 -0
- package/dist/esm/types/src/components/ui/ToggleGroup/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/Tooltip/Tooltip.d.ts +6 -0
- package/dist/esm/types/src/components/ui/Tooltip/Tooltip.types.d.ts +13 -0
- package/dist/esm/types/src/components/ui/Tooltip/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/VimeoEmbed/VimeoEmbed.d.ts +3 -0
- package/dist/esm/types/src/components/ui/VimeoEmbed/VimeoEmbed.types.d.ts +9 -0
- package/dist/esm/types/src/components/ui/VimeoEmbed/index.d.ts +2 -0
- package/dist/esm/types/src/components/ui/icons/Github.d.ts +1 -0
- package/dist/esm/types/src/constants/dataset.d.ts +2 -0
- package/dist/esm/types/src/contexts/chat-context.d.ts +48 -0
- package/dist/esm/types/src/docs/App/App.d.ts +1 -0
- package/dist/esm/types/src/docs/App/ThemeToggle.d.ts +1 -0
- package/dist/esm/types/src/docs/DocPage.d.ts +1 -0
- package/dist/esm/types/src/docs/DocsShell.d.ts +1 -0
- package/dist/esm/types/src/docs/components/AppPageHeader/AppPageHeader.d.ts +8 -0
- package/dist/esm/types/src/docs/components/DocsSidebar/DocsSidebar.d.ts +1 -0
- package/dist/esm/types/src/docs/config/paths.d.ts +10 -0
- package/dist/esm/types/src/docs/contexts/theme-context.d.ts +8 -0
- package/dist/esm/types/src/docs/docsConstants.d.ts +4 -0
- package/dist/esm/types/src/docs/docsHeaderActions.d.ts +1 -0
- package/dist/esm/types/src/docs/index.d.ts +1 -0
- package/dist/esm/types/src/docs/lib/theme.d.ts +5 -0
- package/dist/esm/types/src/docs/pages/AnalysesSelectorPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/AnalysisLineIconPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/AvatarPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/BadgePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/BreadcrumbPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ButtonPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/CardPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ChartAreaInteractivePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ChartPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ChatPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/CheckboxPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/DialogPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/DrawerPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/DropZonePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/DropdownMenuPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/FlickeringGridPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/FoldablePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ImagePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ImageWithFallbackPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/InputPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/InteractiveContentPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/LabelPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/LabelWithIdPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/LabeledInputPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/LegacyPlatformLinkPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/LogoPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/MobileAdaptiveSelectorPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/NumberControlPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/PagePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ProgressPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/RegionCoordsPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/RenamerPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SelectPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SeparatorPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SheetPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SidebarPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SkeletonPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SliderPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SmartTextTruncatePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SparklinePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/SwitchPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TablePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TabsPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TextShimmerPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TextWithDeferTooltipPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TimeRangeControlsPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/ToggleGroupPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TogglePage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/TooltipPage.d.ts +1 -0
- package/dist/esm/types/src/docs/pages/VimeoEmbedPage.d.ts +1 -0
- package/dist/esm/types/src/docs/registry.d.ts +14 -0
- package/dist/esm/types/src/hooks/panelWidth.d.ts +20 -0
- package/dist/esm/types/src/hooks/useClickOutside.d.ts +10 -0
- package/dist/esm/types/src/hooks/useDebounceCallback.d.ts +3 -0
- package/dist/esm/types/src/hooks/useDragElem.d.ts +15 -0
- package/dist/esm/types/src/hooks/useEvent.d.ts +11 -0
- package/dist/esm/types/src/hooks/useIsMobile.d.ts +1 -0
- package/dist/esm/types/src/hooks/useIsTouchDevice.d.ts +6 -0
- package/dist/esm/types/src/hooks/useQueryParams.d.ts +6 -0
- package/dist/esm/types/src/hooks/useShellWidthObserver.d.ts +1 -0
- package/dist/esm/types/src/hooks/useThrottledCallback.d.ts +5 -0
- package/dist/esm/types/src/index.d.ts +54 -0
- package/dist/esm/types/src/lib/cookie-consent/cookie-consent.d.ts +20 -0
- package/dist/esm/types/src/lib/cookie.d.ts +2 -0
- package/dist/esm/types/src/lib/dashboard-spec/stripJsonDashboardFences.d.ts +2 -0
- package/dist/esm/types/src/lib/logger.d.ts +9 -0
- package/dist/esm/types/src/tools/debounce.d.ts +6 -0
- package/dist/esm/types/src/tools/env.d.ts +2 -0
- package/dist/esm/types/src/types/chat-api.types.d.ts +5 -0
- package/dist/esm/types/src/types/forecast-data.d.ts +8 -0
- package/dist/esm/types/src/utils/analysisDate.d.ts +7 -0
- package/dist/esm/types/src/utils/chartConnectionPoint.d.ts +61 -0
- package/dist/esm/types/src/utils/chartRenderQueue.d.ts +10 -0
- package/dist/esm/types/src/utils/chatPresetMerge.d.ts +2 -0
- package/dist/esm/types/src/utils/datasetApplicationLink.d.ts +7 -0
- package/dist/esm/types/src/utils/quantileFormat.d.ts +3 -0
- package/dist/esm/types/tests/chartConnectionPoint.test.d.ts +1 -0
- package/dist/esm/types/tests/smoke.test.d.ts +1 -0
- package/dist/esm/utils/analysisDate.js +16 -0
- package/dist/esm/utils/chartConnectionPoint.js +105 -0
- package/dist/esm/utils/chartRenderQueue.js +49 -0
- package/dist/esm/utils/chatPresetMerge.js +29 -0
- package/dist/esm/utils/datasetApplicationLink.js +21 -0
- package/dist/esm/utils/quantileFormat.js +32 -0
- package/package.json +172 -0
- package/src/components/ui/AnalysesSelector/AnalysesSelector.styl +68 -0
- package/src/components/ui/AnalysesSelector/AnalysesSelector.styl.d.ts +19 -0
- package/src/components/ui/AnalysesSelector/AnalysesSelector.tsx +369 -0
- package/src/components/ui/AnalysesSelector/AnalysesSelector.types.ts +41 -0
- package/src/components/ui/AnalysesSelector/index.ts +5 -0
- package/src/components/ui/AnalysisLineIcon/AnalysisLineIcon.styl +22 -0
- package/src/components/ui/AnalysisLineIcon/AnalysisLineIcon.styl.d.ts +9 -0
- package/src/components/ui/AnalysisLineIcon/AnalysisLineIcon.tsx +47 -0
- package/src/components/ui/AnalysisLineIcon/index.ts +5 -0
- package/src/components/ui/AppHeader/AppHeader.styl +73 -0
- package/src/components/ui/AppHeader/AppHeader.styl.d.ts +13 -0
- package/src/components/ui/AppHeader/AppHeader.tsx +37 -0
- package/src/components/ui/AppHeader/appChromeAnchors.ts +2 -0
- package/src/components/ui/AppHeader/index.ts +3 -0
- package/src/components/ui/Avatar/Avatar.styl +31 -0
- package/src/components/ui/Avatar/Avatar.styl.d.ts +12 -0
- package/src/components/ui/Avatar/Avatar.tsx +42 -0
- package/src/components/ui/Avatar/Avatar.types.ts +17 -0
- package/src/components/ui/Avatar/index.ts +6 -0
- package/src/components/ui/Badge/Badge.styl +95 -0
- package/src/components/ui/Badge/Badge.styl.d.ts +13 -0
- package/src/components/ui/Badge/Badge.tsx +31 -0
- package/src/components/ui/Badge/Badge.types.ts +7 -0
- package/src/components/ui/Badge/index.ts +2 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.styl +49 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.styl.d.ts +12 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.tsx +107 -0
- package/src/components/ui/Breadcrumb/Breadcrumb.types.ts +15 -0
- package/src/components/ui/Breadcrumb/index.ts +10 -0
- package/src/components/ui/Button/Button.styl +131 -0
- package/src/components/ui/Button/Button.styl.d.ts +17 -0
- package/src/components/ui/Button/Button.tsx +35 -0
- package/src/components/ui/Button/Button.types.ts +15 -0
- package/src/components/ui/Button/index.ts +2 -0
- package/src/components/ui/Card/Card.styl +108 -0
- package/src/components/ui/Card/Card.styl.d.ts +21 -0
- package/src/components/ui/Card/Card.tsx +199 -0
- package/src/components/ui/Card/Card.types.ts +35 -0
- package/src/components/ui/Card/index.ts +11 -0
- package/src/components/ui/Chart/Chart.context.ts +14 -0
- package/src/components/ui/Chart/Chart.helpers.ts +14 -0
- package/src/components/ui/Chart/Chart.styl +184 -0
- package/src/components/ui/Chart/Chart.styl.d.ts +22 -0
- package/src/components/ui/Chart/Chart.tsx +23 -0
- package/src/components/ui/Chart/Chart.types.ts +46 -0
- package/src/components/ui/Chart/chart-types.csv +33 -0
- package/src/components/ui/Chart/chartForecastVisualization.constants.ts +22 -0
- package/src/components/ui/Chart/chartForecastVisualization.types.ts +97 -0
- package/src/components/ui/Chart/components/ActiveDotsLayer/ActiveDotsLayer.styl +16 -0
- package/src/components/ui/Chart/components/ActiveDotsLayer/ActiveDotsLayer.styl.d.ts +8 -0
- package/src/components/ui/Chart/components/ActiveDotsLayer/ActiveDotsLayer.tsx +32 -0
- package/src/components/ui/Chart/components/BaseChartWrapper.styl +96 -0
- package/src/components/ui/Chart/components/BaseChartWrapper.styl.d.ts +20 -0
- package/src/components/ui/Chart/components/BaseChartWrapper.tsx +907 -0
- package/src/components/ui/Chart/components/ChartAxes.tsx +140 -0
- package/src/components/ui/Chart/components/ChartContainer.tsx +73 -0
- package/src/components/ui/Chart/components/ChartGrid.tsx +7 -0
- package/src/components/ui/Chart/components/ChartLegendContent.tsx +48 -0
- package/src/components/ui/Chart/components/ChartLegendItem.tsx +43 -0
- package/src/components/ui/Chart/components/ChartTooltipContent.tsx +140 -0
- package/src/components/ui/Chart/components/ChartTooltipItem.tsx +114 -0
- package/src/components/ui/Chart/components/ConfidenceBands.tsx +49 -0
- package/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.styl +102 -0
- package/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.styl.d.ts +18 -0
- package/src/components/ui/Chart/components/CustomChartLegend/CustomChartLegend.tsx +152 -0
- package/src/components/ui/Chart/components/ForecastBoundaries.tsx +71 -0
- package/src/components/ui/Chart/components/ForecastLine.tsx +68 -0
- package/src/components/ui/Chart/components/HistoricalLine.tsx +67 -0
- package/src/components/ui/Chart/components/LegendSvg/LegendSvg.tsx +61 -0
- package/src/components/ui/Chart/components/QuantileBands.tsx +73 -0
- package/src/components/ui/Chart/components/index.ts +12 -0
- package/src/components/ui/Chart/hooks/useChartAnimation.ts +17 -0
- package/src/components/ui/Chart/hooks/useChartColors.ts +24 -0
- package/src/components/ui/Chart/hooks/useLegendState.ts +31 -0
- package/src/components/ui/Chart/index.ts +2 -0
- package/src/components/ui/Chart/tools/formatters.ts +88 -0
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.helpers.ts +168 -0
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.styl +66 -0
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.styl.d.ts +14 -0
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.tsx +230 -0
- package/src/components/ui/ChartAreaInteractive/ChartAreaInteractive.types.ts +68 -0
- package/src/components/ui/ChartAreaInteractive/ChartLines.tsx +204 -0
- package/src/components/ui/ChartAreaInteractive/index.ts +3 -0
- package/src/components/ui/ChartAreaInteractive/overlays/DraggingButton.styl +29 -0
- package/src/components/ui/ChartAreaInteractive/overlays/DraggingButton.styl.d.ts +8 -0
- package/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.hooks.ts +211 -0
- package/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.styl +17 -0
- package/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.styl.d.ts +8 -0
- package/src/components/ui/ChartAreaInteractive/overlays/IntervalsOverlay/IntervalsOverlay.tsx +402 -0
- package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl +107 -0
- package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.styl.d.ts +15 -0
- package/src/components/ui/ChartAreaInteractive/overlays/PinOverlay/PinOverlay.tsx +256 -0
- package/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.hooks.ts +185 -0
- package/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.styl +21 -0
- package/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.styl.d.ts +8 -0
- package/src/components/ui/ChartAreaInteractive/overlays/ThresholdsOverlay/ThresholdsOverlay.tsx +206 -0
- package/src/components/ui/ChartAreaInteractive/overlays/index.ts +3 -0
- package/src/components/ui/ChartAreaInteractive/overlays/useChartYRange.ts +209 -0
- package/src/components/ui/ChartAreaInteractive/overlays/useForecastColor.ts +49 -0
- package/src/components/ui/ChartAreaInteractive/overlays/useQuantileBands.ts +248 -0
- package/src/components/ui/Chat/Chat.styl +7 -0
- package/src/components/ui/Chat/Chat.styl.d.ts +8 -0
- package/src/components/ui/Chat/Chat.tsx +22 -0
- package/src/components/ui/Chat/Chat.types.ts +88 -0
- package/src/components/ui/Chat/ChatChrome/ChatChrome.styl +125 -0
- package/src/components/ui/Chat/ChatChrome/ChatChrome.styl.d.ts +21 -0
- package/src/components/ui/Chat/ChatChrome/ChatChrome.tsx +188 -0
- package/src/components/ui/Chat/ChatChrome/ChatChrome.types.ts +50 -0
- package/src/components/ui/Chat/ChatChrome/index.ts +5 -0
- package/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.styl +20 -0
- package/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.styl.d.ts +8 -0
- package/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.tsx +16 -0
- package/src/components/ui/Chat/ChatEmptyState/ChatEmptyState.types.ts +5 -0
- package/src/components/ui/Chat/ChatEmptyState/sparkles.svg +22 -0
- package/src/components/ui/Chat/ChatMessage/AgentMessageContent.helpers.tsx +405 -0
- package/src/components/ui/Chat/ChatMessage/AgentMessageContent.tsx +234 -0
- package/src/components/ui/Chat/ChatMessage/ChatDatasetApplicationLink.tsx +38 -0
- package/src/components/ui/Chat/ChatMessage/ChatMessage.styl +184 -0
- package/src/components/ui/Chat/ChatMessage/ChatMessage.styl.d.ts +22 -0
- package/src/components/ui/Chat/ChatMessage/ChatMessage.tsx +52 -0
- package/src/components/ui/Chat/ChatMessage/MessageChart.tsx +32 -0
- package/src/components/ui/Chat/ChatMessage/icons/DocIcon.tsx +7 -0
- package/src/components/ui/Chat/ChatMessage/icons/XlsIcon.tsx +7 -0
- package/src/components/ui/Chat/ChatMessage/icons/doc.png +0 -0
- package/src/components/ui/Chat/ChatMessage/icons/doc.svg +1 -0
- package/src/components/ui/Chat/ChatMessage/icons/xls.png +0 -0
- package/src/components/ui/Chat/ChatMessage/icons/xls.svg +1 -0
- package/src/components/ui/Chat/ChatMessage/index.ts +1 -0
- package/src/components/ui/Chat/ChatMessage/presetScript.ts +282 -0
- package/src/components/ui/Chat/ChatPresets/ChatPresets.styl +41 -0
- package/src/components/ui/Chat/ChatPresets/ChatPresets.styl.d.ts +11 -0
- package/src/components/ui/Chat/ChatPresets/ChatPresets.tsx +59 -0
- package/src/components/ui/Chat/ChatPresets/index.ts +2 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl +84 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.styl.d.ts +13 -0
- package/src/components/ui/Chat/ChatPrompt/ChatPrompt.tsx +103 -0
- package/src/components/ui/Chat/ChatPrompt/index.ts +1 -0
- package/src/components/ui/Chat/ChatSheet/ChatSelector.tsx +65 -0
- package/src/components/ui/Chat/ChatSheet/ChatSettings.styl +35 -0
- package/src/components/ui/Chat/ChatSheet/ChatSettings.styl.d.ts +10 -0
- package/src/components/ui/Chat/ChatSheet/ChatSettings.tsx +61 -0
- package/src/components/ui/Chat/ChatSheet/ChatSheet.styl.d.ts +19 -0
- package/src/components/ui/Chat/ChatSheet/ChatSheet.tsx +91 -0
- package/src/components/ui/Chat/ChatSheet/ChatSidebar.styl.d.ts +17 -0
- package/src/components/ui/Chat/ChatSheet/index.ts +7 -0
- package/src/components/ui/Chat/ChatSheet/loader.svg +14 -0
- package/src/components/ui/Chat/ChatSheet/useChatPanelChromeModel.tsx +1024 -0
- package/src/components/ui/Chat/chat-preset-utils.ts +27 -0
- package/src/components/ui/Chat/index.ts +24 -0
- package/src/components/ui/Checkbox/Checkbox.styl +42 -0
- package/src/components/ui/Checkbox/Checkbox.styl.d.ts +9 -0
- package/src/components/ui/Checkbox/Checkbox.tsx +26 -0
- package/src/components/ui/Checkbox/Checkbox.types.ts +5 -0
- package/src/components/ui/Checkbox/index.ts +2 -0
- package/src/components/ui/Dialog/Dialog.styl +145 -0
- package/src/components/ui/Dialog/Dialog.styl.d.ts +21 -0
- package/src/components/ui/Dialog/Dialog.tsx +233 -0
- package/src/components/ui/Dialog/Dialog.types.ts +27 -0
- package/src/components/ui/Dialog/index.ts +3 -0
- package/src/components/ui/DraggingButton/DraggingButton.styl +74 -0
- package/src/components/ui/DraggingButton/DraggingButton.styl.d.ts +11 -0
- package/src/components/ui/DraggingButton/DraggingButton.tsx +55 -0
- package/src/components/ui/Drawer/Drawer.styl +123 -0
- package/src/components/ui/Drawer/Drawer.styl.d.ts +15 -0
- package/src/components/ui/Drawer/Drawer.tsx +112 -0
- package/src/components/ui/Drawer/Drawer.types.ts +35 -0
- package/src/components/ui/Drawer/index.ts +13 -0
- package/src/components/ui/DropZone/DropZone.styl +66 -0
- package/src/components/ui/DropZone/DropZone.styl.d.ts +13 -0
- package/src/components/ui/DropZone/DropZone.tsx +188 -0
- package/src/components/ui/DropdownMenu/DropdownMenu.styl +331 -0
- package/src/components/ui/DropdownMenu/DropdownMenu.styl.d.ts +27 -0
- package/src/components/ui/DropdownMenu/DropdownMenu.tsx +231 -0
- package/src/components/ui/DropdownMenu/DropdownMenu.types.ts +68 -0
- package/src/components/ui/DropdownMenu/index.ts +18 -0
- package/src/components/ui/FlickeringGrid/FlickeringGrid.styl +12 -0
- package/src/components/ui/FlickeringGrid/FlickeringGrid.styl.d.ts +7 -0
- package/src/components/ui/FlickeringGrid/FlickeringGrid.tsx +10 -0
- package/src/components/ui/FlickeringGrid/FlickeringGrid.types.ts +10 -0
- package/src/components/ui/FlickeringGrid/bg.svg +194 -0
- package/src/components/ui/FlickeringGrid/index.ts +2 -0
- package/src/components/ui/Foldable/Foldable.styl +48 -0
- package/src/components/ui/Foldable/Foldable.styl.d.ts +13 -0
- package/src/components/ui/Foldable/Foldable.tsx +38 -0
- package/src/components/ui/Foldable/Foldable.types.ts +6 -0
- package/src/components/ui/Foldable/index.ts +2 -0
- package/src/components/ui/Gap/Gap.styl +2 -0
- package/src/components/ui/Gap/Gap.styl.d.ts +7 -0
- package/src/components/ui/Gap/Gap.tsx +3 -0
- package/src/components/ui/Image/Image.styl +27 -0
- package/src/components/ui/Image/Image.styl.d.ts +10 -0
- package/src/components/ui/Image/Image.tsx +31 -0
- package/src/components/ui/Image/Image.types.ts +6 -0
- package/src/components/ui/Image/index.ts +2 -0
- package/src/components/ui/ImageWithFallback/ImageWithFallback.tsx +32 -0
- package/src/components/ui/ImageWithFallback/ImageWithFallback.types.ts +9 -0
- package/src/components/ui/ImageWithFallback/index.ts +2 -0
- package/src/components/ui/InfoIconTooltip/InfoIconTooltip.styl +5 -0
- package/src/components/ui/InfoIconTooltip/InfoIconTooltip.styl.d.ts +7 -0
- package/src/components/ui/InfoIconTooltip/InfoIconTooltip.tsx +21 -0
- package/src/components/ui/Input/Input.styl +67 -0
- package/src/components/ui/Input/Input.styl.d.ts +11 -0
- package/src/components/ui/Input/Input.tsx +42 -0
- package/src/components/ui/Input/Input.types.ts +11 -0
- package/src/components/ui/Input/index.ts +2 -0
- package/src/components/ui/InteractionOverlay/InteractionOverlay.styl +19 -0
- package/src/components/ui/InteractionOverlay/InteractionOverlay.styl.d.ts +8 -0
- package/src/components/ui/InteractionOverlay/InteractionOverlay.tsx +55 -0
- package/src/components/ui/InteractiveContent/InteractiveContent.styl +3 -0
- package/src/components/ui/InteractiveContent/InteractiveContent.styl.d.ts +7 -0
- package/src/components/ui/InteractiveContent/InteractiveContent.tsx +21 -0
- package/src/components/ui/InteractiveContent/index.ts +1 -0
- package/src/components/ui/Label/Label.styl +16 -0
- package/src/components/ui/Label/Label.styl.d.ts +7 -0
- package/src/components/ui/Label/Label.tsx +18 -0
- package/src/components/ui/Label/Label.types.ts +5 -0
- package/src/components/ui/Label/index.ts +2 -0
- package/src/components/ui/LabelWithId/AltKeyProvider.tsx +22 -0
- package/src/components/ui/LabelWithId/LabelWithId.styl +14 -0
- package/src/components/ui/LabelWithId/LabelWithId.styl.d.ts +8 -0
- package/src/components/ui/LabelWithId/LabelWithId.tsx +12 -0
- package/src/components/ui/LabelWithId/LabelWithId.types.ts +5 -0
- package/src/components/ui/LabelWithId/index.ts +3 -0
- package/src/components/ui/LabeledInput/LabeledInput.styl +32 -0
- package/src/components/ui/LabeledInput/LabeledInput.styl.d.ts +14 -0
- package/src/components/ui/LabeledInput/LabeledInput.tsx +53 -0
- package/src/components/ui/LabledCheckbox/LabledCheckbox.tsx +21 -0
- package/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.styl +10 -0
- package/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.styl.d.ts +7 -0
- package/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.tsx +18 -0
- package/src/components/ui/LegacyPlatformLink/LegacyPlatformLink.types.ts +5 -0
- package/src/components/ui/LegacyPlatformLink/index.ts +2 -0
- package/src/components/ui/Logo/Logo.styl +39 -0
- package/src/components/ui/Logo/Logo.styl.d.ts +12 -0
- package/src/components/ui/Logo/Logo.tsx +18 -0
- package/src/components/ui/Logo/Logo.types.ts +12 -0
- package/src/components/ui/Logo/index.ts +5 -0
- package/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.styl +32 -0
- package/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.styl.d.ts +13 -0
- package/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.tsx +117 -0
- package/src/components/ui/MobileAdaptiveSelector/MobileAdaptiveSelector.types.ts +31 -0
- package/src/components/ui/MobileAdaptiveSelector/index.ts +8 -0
- package/src/components/ui/NumberControl/NumberControl.styl +11 -0
- package/src/components/ui/NumberControl/NumberControl.styl.d.ts +8 -0
- package/src/components/ui/NumberControl/NumberControl.tsx +58 -0
- package/src/components/ui/NumberControl/NumberControl.types.ts +10 -0
- package/src/components/ui/NumberControl/index.ts +2 -0
- package/src/components/ui/Page/AppShell/AppShell.styl +36 -0
- package/src/components/ui/Page/AppShell/AppShell.styl.d.ts +9 -0
- package/src/components/ui/Page/AppShell/AppShell.tsx +38 -0
- package/src/components/ui/Page/Breadcrumbs/Breadcrumbs.styl +33 -0
- package/src/components/ui/Page/Breadcrumbs/Breadcrumbs.styl.d.ts +10 -0
- package/src/components/ui/Page/Breadcrumbs/Breadcrumbs.tsx +71 -0
- package/src/components/ui/Page/Breadcrumbs/Breadcrumbs.types.ts +6 -0
- package/src/components/ui/Page/PageColumns/PageColumns.styl +28 -0
- package/src/components/ui/Page/PageColumns/PageColumns.styl.d.ts +11 -0
- package/src/components/ui/Page/PageColumns/PageColumns.tsx +31 -0
- package/src/components/ui/Page/PageContent/PageContent.styl +17 -0
- package/src/components/ui/Page/PageContent/PageContent.styl.d.ts +8 -0
- package/src/components/ui/Page/PageContent/PageContent.tsx +34 -0
- package/src/components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.styl +28 -0
- package/src/components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.styl.d.ts +9 -0
- package/src/components/ui/Page/PageEmptyCanvas/PageEmptyCanvas.tsx +21 -0
- package/src/components/ui/Page/PageFooter/DebugPanel/DebugPanel.styl.d.ts +9 -0
- package/src/components/ui/Page/PageFooter/PageFooter.styl +69 -0
- package/src/components/ui/Page/PageFooter/PageFooter.styl.d.ts +12 -0
- package/src/components/ui/Page/PageFooter/PageFooter.tsx +68 -0
- package/src/components/ui/Page/PageFooter/treads.svg +3 -0
- package/src/components/ui/Page/PageHeader/PageHeader.styl +185 -0
- package/src/components/ui/Page/PageHeader/PageHeader.styl.d.ts +17 -0
- package/src/components/ui/Page/PageHeader/PageHeader.tsx +67 -0
- package/src/components/ui/Page/PageScroll/PageScroll.styl +32 -0
- package/src/components/ui/Page/PageScroll/PageScroll.styl.d.ts +9 -0
- package/src/components/ui/Page/PageScroll/PageScroll.tsx +69 -0
- package/src/components/ui/Page/PageTabs/PageTabs.styl +20 -0
- package/src/components/ui/Page/PageTabs/PageTabs.styl.d.ts +11 -0
- package/src/components/ui/Page/PageTabs/PageTabs.tsx +64 -0
- package/src/components/ui/Page/PageXScroll/PageXScroll.styl +16 -0
- package/src/components/ui/Page/PageXScroll/PageXScroll.styl.d.ts +9 -0
- package/src/components/ui/Page/PageXScroll/PageXScroll.tsx +70 -0
- package/src/components/ui/Page/SectionHeader/SectionHeader.styl +36 -0
- package/src/components/ui/Page/SectionHeader/SectionHeader.styl.d.ts +12 -0
- package/src/components/ui/Page/SectionHeader/SectionHeader.tsx +26 -0
- package/src/components/ui/Page/SectionHeader/SectionHeader.types.ts +8 -0
- package/src/components/ui/Page/SectionHeader/index.ts +2 -0
- package/src/components/ui/Page/index.ts +18 -0
- package/src/components/ui/Page/pageContext.ts +9 -0
- package/src/components/ui/Progress/Progress.styl +22 -0
- package/src/components/ui/Progress/Progress.styl.d.ts +8 -0
- package/src/components/ui/Progress/Progress.tsx +26 -0
- package/src/components/ui/Progress/Progress.types.ts +5 -0
- package/src/components/ui/Progress/index.ts +2 -0
- package/src/components/ui/RegionCoords/RegionSelector.styl +21 -0
- package/src/components/ui/RegionCoords/RegionSelector.styl.d.ts +9 -0
- package/src/components/ui/RegionCoords/RegionSelector.tsx +56 -0
- package/src/components/ui/RegionCoords/RegionSelector.types.ts +10 -0
- package/src/components/ui/RegionCoords/index.ts +2 -0
- package/src/components/ui/Renamer/Renamer.styl +22 -0
- package/src/components/ui/Renamer/Renamer.styl.d.ts +11 -0
- package/src/components/ui/Renamer/Renamer.tsx +127 -0
- package/src/components/ui/Renamer/Renamer.types.ts +11 -0
- package/src/components/ui/Renamer/index.ts +2 -0
- package/src/components/ui/Select/Select.styl +321 -0
- package/src/components/ui/Select/Select.styl.d.ts +31 -0
- package/src/components/ui/Select/Select.tsx +169 -0
- package/src/components/ui/Select/Select.types.ts +40 -0
- package/src/components/ui/Select/index.ts +2 -0
- package/src/components/ui/Separator/Separator.styl +11 -0
- package/src/components/ui/Separator/Separator.styl.d.ts +7 -0
- package/src/components/ui/Separator/Separator.tsx +25 -0
- package/src/components/ui/Separator/Separator.types.ts +7 -0
- package/src/components/ui/Separator/index.ts +2 -0
- package/src/components/ui/Sheet/Sheet.styl +238 -0
- package/src/components/ui/Sheet/Sheet.styl.d.ts +28 -0
- package/src/components/ui/Sheet/Sheet.tsx +129 -0
- package/src/components/ui/Sheet/Sheet.types.ts +22 -0
- package/src/components/ui/Sheet/index.ts +11 -0
- package/src/components/ui/Sidebar/Sidebar.styl +710 -0
- package/src/components/ui/Sidebar/Sidebar.styl.d.ts +48 -0
- package/src/components/ui/Sidebar/Sidebar.tsx +971 -0
- package/src/components/ui/Skeleton/Skeleton.helpers.ts +13 -0
- package/src/components/ui/Skeleton/Skeleton.styl +31 -0
- package/src/components/ui/Skeleton/Skeleton.styl.d.ts +14 -0
- package/src/components/ui/Skeleton/Skeleton.tsx +21 -0
- package/src/components/ui/Skeleton/Skeleton.types.ts +10 -0
- package/src/components/ui/Skeleton/index.ts +2 -0
- package/src/components/ui/Slider/Slider.styl +77 -0
- package/src/components/ui/Slider/Slider.styl.d.ts +11 -0
- package/src/components/ui/Slider/Slider.tsx +189 -0
- package/src/components/ui/Slider/Slider.types.ts +7 -0
- package/src/components/ui/Slider/index.ts +2 -0
- package/src/components/ui/SmartTextTruncate/SmartTextTruncate.tsx +141 -0
- package/src/components/ui/SmartTextTruncate/SmartTextTruncate.types.ts +5 -0
- package/src/components/ui/SmartTextTruncate/index.ts +2 -0
- package/src/components/ui/Sparkline/Sparkline.helpers.ts +26 -0
- package/src/components/ui/Sparkline/Sparkline.styl +18 -0
- package/src/components/ui/Sparkline/Sparkline.styl.d.ts +9 -0
- package/src/components/ui/Sparkline/Sparkline.tsx +80 -0
- package/src/components/ui/Sparkline/Sparkline.types.ts +18 -0
- package/src/components/ui/Sparkline/index.ts +2 -0
- package/src/components/ui/Switch/Switch.styl +63 -0
- package/src/components/ui/Switch/Switch.styl.d.ts +11 -0
- package/src/components/ui/Switch/Switch.tsx +40 -0
- package/src/components/ui/Switch/Switch.types.ts +7 -0
- package/src/components/ui/Switch/index.ts +2 -0
- package/src/components/ui/Table/Table.styl +119 -0
- package/src/components/ui/Table/Table.styl.d.ts +20 -0
- package/src/components/ui/Table/Table.tsx +114 -0
- package/src/components/ui/Table/Table.types.ts +14 -0
- package/src/components/ui/Table/index.ts +11 -0
- package/src/components/ui/Tabs/Tabs.styl +117 -0
- package/src/components/ui/Tabs/Tabs.styl.d.ts +14 -0
- package/src/components/ui/Tabs/Tabs.tsx +73 -0
- package/src/components/ui/Tabs/Tabs.types.ts +8 -0
- package/src/components/ui/Tabs/index.ts +2 -0
- package/src/components/ui/TextShimmer/TextShimmer.styl +16 -0
- package/src/components/ui/TextShimmer/TextShimmer.styl.d.ts +7 -0
- package/src/components/ui/TextShimmer/TextShimmer.tsx +56 -0
- package/src/components/ui/TextShimmer/TextShimmer.types.ts +9 -0
- package/src/components/ui/TextShimmer/index.ts +2 -0
- package/src/components/ui/TextWithDeferTooltip/TextWithDeferTooltip.tsx +98 -0
- package/src/components/ui/TextWithDeferTooltip/TextWithDeferTooltip.types.ts +11 -0
- package/src/components/ui/TextWithDeferTooltip/index.ts +2 -0
- package/src/components/ui/TimeRangeControls/TimeRangeControls.constants.ts +1 -0
- package/src/components/ui/TimeRangeControls/TimeRangeControls.styl +28 -0
- package/src/components/ui/TimeRangeControls/TimeRangeControls.styl.d.ts +12 -0
- package/src/components/ui/TimeRangeControls/TimeRangeControls.tsx +92 -0
- package/src/components/ui/TimeRangeControls/TimeRangeControls.types.ts +3 -0
- package/src/components/ui/TimeRangeControls/index.ts +3 -0
- package/src/components/ui/Toggle/Toggle.styl +79 -0
- package/src/components/ui/Toggle/Toggle.styl.d.ts +12 -0
- package/src/components/ui/Toggle/Toggle.tsx +28 -0
- package/src/components/ui/Toggle/Toggle.types.ts +11 -0
- package/src/components/ui/Toggle/index.ts +2 -0
- package/src/components/ui/ToggleGroup/ToggleGroup.helpers.ts +20 -0
- package/src/components/ui/ToggleGroup/ToggleGroup.styl +38 -0
- package/src/components/ui/ToggleGroup/ToggleGroup.styl.d.ts +8 -0
- package/src/components/ui/ToggleGroup/ToggleGroup.tsx +77 -0
- package/src/components/ui/ToggleGroup/ToggleGroup.types.ts +38 -0
- package/src/components/ui/ToggleGroup/index.ts +2 -0
- package/src/components/ui/Tooltip/Tooltip.styl +131 -0
- package/src/components/ui/Tooltip/Tooltip.styl.d.ts +16 -0
- package/src/components/ui/Tooltip/Tooltip.tsx +64 -0
- package/src/components/ui/Tooltip/Tooltip.types.ts +23 -0
- package/src/components/ui/Tooltip/index.ts +12 -0
- package/src/components/ui/VimeoEmbed/VimeoEmbed.styl +63 -0
- package/src/components/ui/VimeoEmbed/VimeoEmbed.styl.d.ts +11 -0
- package/src/components/ui/VimeoEmbed/VimeoEmbed.tsx +191 -0
- package/src/components/ui/VimeoEmbed/VimeoEmbed.types.ts +10 -0
- package/src/components/ui/VimeoEmbed/index.ts +2 -0
- package/src/components/ui/icons/Github.tsx +10 -0
- package/src/constants/dataset.ts +2 -0
- package/src/contexts/chat-context.tsx +444 -0
- package/src/declarations.d.ts +15 -0
- package/src/docs/App/App.styl +8 -0
- package/src/docs/App/App.styl.d.ts +8 -0
- package/src/docs/App/App.tsx +55 -0
- package/src/docs/App/ThemeToggle.tsx +30 -0
- package/src/docs/DocPage.tsx +21 -0
- package/src/docs/DocsShell.styl +28 -0
- package/src/docs/DocsShell.styl.d.ts +11 -0
- package/src/docs/DocsShell.tsx +39 -0
- package/src/docs/components/AppPageHeader/AppPageHeader.tsx +28 -0
- package/src/docs/components/DocsSidebar/DocsSidebar.styl +22 -0
- package/src/docs/components/DocsSidebar/DocsSidebar.styl.d.ts +7 -0
- package/src/docs/components/DocsSidebar/DocsSidebar.tsx +165 -0
- package/src/docs/config/paths.ts +18 -0
- package/src/docs/config/webpack.config.js +212 -0
- package/src/docs/contexts/theme-context.tsx +47 -0
- package/src/docs/docsConstants.ts +5 -0
- package/src/docs/docsHeaderActions.tsx +18 -0
- package/src/docs/index.tsx +16 -0
- package/src/docs/lib/theme.ts +55 -0
- package/src/docs/pages/AnalysesSelectorPage.tsx +57 -0
- package/src/docs/pages/AnalysisLineIconPage.tsx +24 -0
- package/src/docs/pages/AvatarPage.tsx +33 -0
- package/src/docs/pages/BadgePage.tsx +27 -0
- package/src/docs/pages/BreadcrumbPage.tsx +38 -0
- package/src/docs/pages/ButtonPage.tsx +142 -0
- package/src/docs/pages/CardPage.tsx +42 -0
- package/src/docs/pages/ChartAreaInteractivePage.tsx +161 -0
- package/src/docs/pages/ChartPage.tsx +50 -0
- package/src/docs/pages/ChatPage.tsx +61 -0
- package/src/docs/pages/CheckboxPage.tsx +25 -0
- package/src/docs/pages/DialogPage.tsx +38 -0
- package/src/docs/pages/DrawerPage.tsx +48 -0
- package/src/docs/pages/DropZonePage.tsx +32 -0
- package/src/docs/pages/DropdownMenuPage.tsx +41 -0
- package/src/docs/pages/FlickeringGridPage.tsx +23 -0
- package/src/docs/pages/FoldablePage.tsx +25 -0
- package/src/docs/pages/ImagePage.tsx +26 -0
- package/src/docs/pages/ImageWithFallbackPage.tsx +34 -0
- package/src/docs/pages/InputPage.tsx +39 -0
- package/src/docs/pages/InteractiveContentPage.tsx +23 -0
- package/src/docs/pages/LabelPage.tsx +21 -0
- package/src/docs/pages/LabelWithIdPage.tsx +21 -0
- package/src/docs/pages/LabeledInputPage.tsx +32 -0
- package/src/docs/pages/LegacyPlatformLinkPage.tsx +23 -0
- package/src/docs/pages/LogoPage.tsx +25 -0
- package/src/docs/pages/MobileAdaptiveSelectorPage.tsx +36 -0
- package/src/docs/pages/NumberControlPage.tsx +25 -0
- package/src/docs/pages/PagePage.tsx +25 -0
- package/src/docs/pages/ProgressPage.tsx +21 -0
- package/src/docs/pages/RegionCoordsPage.tsx +40 -0
- package/src/docs/pages/RenamerPage.tsx +27 -0
- package/src/docs/pages/SelectPage.tsx +40 -0
- package/src/docs/pages/SeparatorPage.tsx +23 -0
- package/src/docs/pages/SheetPage.tsx +40 -0
- package/src/docs/pages/SidebarPage.tsx +53 -0
- package/src/docs/pages/SkeletonPage.tsx +30 -0
- package/src/docs/pages/SliderPage.tsx +26 -0
- package/src/docs/pages/SmartTextTruncatePage.tsx +26 -0
- package/src/docs/pages/SparklinePage.tsx +23 -0
- package/src/docs/pages/SwitchPage.tsx +29 -0
- package/src/docs/pages/TablePage.tsx +45 -0
- package/src/docs/pages/TabsPage.tsx +33 -0
- package/src/docs/pages/TextShimmerPage.tsx +23 -0
- package/src/docs/pages/TextWithDeferTooltipPage.tsx +29 -0
- package/src/docs/pages/TimeRangeControlsPage.tsx +30 -0
- package/src/docs/pages/ToggleGroupPage.tsx +35 -0
- package/src/docs/pages/TogglePage.tsx +24 -0
- package/src/docs/pages/TooltipPage.tsx +35 -0
- package/src/docs/pages/VimeoEmbedPage.tsx +21 -0
- package/src/docs/registry.ts +338 -0
- package/src/hooks/panelWidth.ts +72 -0
- package/src/hooks/useClickOutside.ts +36 -0
- package/src/hooks/useDebounceCallback.ts +18 -0
- package/src/hooks/useDragElem.ts +153 -0
- package/src/hooks/useEvent.ts +73 -0
- package/src/hooks/useIsMobile.ts +21 -0
- package/src/hooks/useIsTouchDevice.ts +43 -0
- package/src/hooks/useQueryParams.ts +60 -0
- package/src/hooks/useShellWidthObserver.ts +25 -0
- package/src/hooks/useThrottledCallback.ts +41 -0
- package/src/index.ts +54 -0
- package/src/lib/cookie-consent/cookie-consent.ts +132 -0
- package/src/lib/cookie.ts +23 -0
- package/src/lib/dashboard-spec/stripJsonDashboardFences.ts +6 -0
- package/src/lib/logger.ts +9 -0
- package/src/lib/theme.styl +23 -0
- package/src/lib/theme.styl.d.ts +2 -0
- package/src/tools/debounce.ts +59 -0
- package/src/tools/env.ts +7 -0
- package/src/types/chat-api.types.ts +5 -0
- package/src/types/forecast-data.ts +8 -0
- package/src/utils/analysisDate.ts +17 -0
- package/src/utils/chartConnectionPoint.ts +292 -0
- package/src/utils/chartRenderQueue.ts +52 -0
- package/src/utils/chatPresetMerge.ts +36 -0
- package/src/utils/datasetApplicationLink.ts +25 -0
- package/src/utils/quantileFormat.ts +46 -0
|
@@ -0,0 +1,1024 @@
|
|
|
1
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ChatPreset,
|
|
5
|
+
GENERATING_DASHBOARD_SYSTEM_TEXT,
|
|
6
|
+
MessageRole,
|
|
7
|
+
type ScriptCompletePayload,
|
|
8
|
+
} from '#uilib/components/ui/Chat/Chat.types';
|
|
9
|
+
import {
|
|
10
|
+
branchKeysUsedByUserMessages,
|
|
11
|
+
branchKeysUsedFromChatHistory,
|
|
12
|
+
branchesFromPresetScriptGraph,
|
|
13
|
+
entryBranchKeyBeforeLastAssistant,
|
|
14
|
+
extractQuickReplyLabelKeyPairsFromText,
|
|
15
|
+
isGraphIntakeAssistantStepComplete,
|
|
16
|
+
isPresetScriptGraph,
|
|
17
|
+
matchUserTextToQuickReply,
|
|
18
|
+
parseScriptLine,
|
|
19
|
+
textHasQuickReplyMarkers,
|
|
20
|
+
} from '#uilib/components/ui/Chat/ChatMessage/presetScript';
|
|
21
|
+
import type { ChatPresetsLayout } from '#uilib/components/ui/Chat/ChatPresets';
|
|
22
|
+
import {
|
|
23
|
+
formatChatTranscript,
|
|
24
|
+
usedPresetIdsFromMessages,
|
|
25
|
+
} from '#uilib/components/ui/Chat/chat-preset-utils';
|
|
26
|
+
import { useChat, useChatsForScopeId } from '#uilib/contexts/chat-context';
|
|
27
|
+
import useEvent from '#uilib/hooks/useEvent';
|
|
28
|
+
import { useIsMobile } from '#uilib/hooks/useIsMobile';
|
|
29
|
+
import { useQueryParams } from '#uilib/hooks/useQueryParams';
|
|
30
|
+
import logger from '#uilib/lib/logger';
|
|
31
|
+
import { mergePresetFreeformDefaults } from '#uilib/utils/chatPresetMerge';
|
|
32
|
+
import { ScrollRef } from '@homecode/ui';
|
|
33
|
+
|
|
34
|
+
import { useSidebar } from '../../Sidebar/Sidebar';
|
|
35
|
+
import { Chat } from '../Chat';
|
|
36
|
+
import type { ChatChromeProps } from '../ChatChrome';
|
|
37
|
+
|
|
38
|
+
export type UseChatPanelChromeModelInput = {
|
|
39
|
+
/** When true, skip sidebar chat slot, URL `?chat=`, and portal behavior (e.g. page main content). */
|
|
40
|
+
embedAsPage: boolean;
|
|
41
|
+
presets?: ChatPreset[];
|
|
42
|
+
/** Composite chat scope (e.g. `${userId}-${datasetId}`, `${userId}-dashboard`, `${userId}-report-${reportId}`). */
|
|
43
|
+
scopeId?: string | null;
|
|
44
|
+
onMessage?: (message: string) => void;
|
|
45
|
+
/** Fires when a preset script has no further `[Label|branchKey]` steps (graph leaf or linear script end). */
|
|
46
|
+
onScriptComplete?: (payload: ScriptCompletePayload) => void;
|
|
47
|
+
/** After intake script completes, user can generate a dashboard from the full transcript (e.g. Decision board). */
|
|
48
|
+
onGenerateDashboard?: (transcript: string) => void | Promise<void>;
|
|
49
|
+
/** Renders `[CHART]` tokens in assistant messages. */
|
|
50
|
+
renderMessageChart?: () => React.ReactNode;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export type UseChatPanelChromeModelResult = {
|
|
54
|
+
chromeProps: ChatChromeProps;
|
|
55
|
+
isOpen: boolean;
|
|
56
|
+
onOpenChange: (open: boolean) => void;
|
|
57
|
+
toggleOpen: () => void;
|
|
58
|
+
newChat: () => void;
|
|
59
|
+
chatPanelContainer: HTMLElement | null;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
type IntakeScriptState = {
|
|
63
|
+
presetId: string;
|
|
64
|
+
freeformNext: Record<string, string>;
|
|
65
|
+
scriptStepId: string;
|
|
66
|
+
answers: Record<string, string>;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** Fallback when `scopeId` prop omitted; apps should pass an explicit composite scope (e.g. `${userId}-dashboard`). */
|
|
70
|
+
const NO_SCOPE_FALLBACK = '__uilib_chat_scope_unset__';
|
|
71
|
+
|
|
72
|
+
type PresetScriptState = {
|
|
73
|
+
lines: string[];
|
|
74
|
+
nextIndex: number;
|
|
75
|
+
presetId: string;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const SCRIPT_STEP_DELAY_MS = 1200;
|
|
79
|
+
const CHAT_NEW_SHORTCUT_KEY = 'o';
|
|
80
|
+
/** When chat panel is open, collapse left nav below this width so both don't crowd the viewport. */
|
|
81
|
+
const CHAT_NAV_COLLAPSE_BREAKPOINT_PX = 1400;
|
|
82
|
+
|
|
83
|
+
const CHAT_QUERY_PARAM = 'chat';
|
|
84
|
+
const CHAT_OPEN_VALUE = 'open';
|
|
85
|
+
const PROMPT_QUERY_PARAM = 'prompt';
|
|
86
|
+
|
|
87
|
+
export function useChatPanelChromeModel({
|
|
88
|
+
embedAsPage,
|
|
89
|
+
presets,
|
|
90
|
+
scopeId,
|
|
91
|
+
onMessage,
|
|
92
|
+
onScriptComplete,
|
|
93
|
+
onGenerateDashboard,
|
|
94
|
+
renderMessageChart,
|
|
95
|
+
}: UseChatPanelChromeModelInput): UseChatPanelChromeModelResult {
|
|
96
|
+
const effectiveScopeId = scopeId ?? NO_SCOPE_FALLBACK;
|
|
97
|
+
const isMobile = useIsMobile();
|
|
98
|
+
const {
|
|
99
|
+
chatPanelContainer,
|
|
100
|
+
isOpen: sidebarNavOpen,
|
|
101
|
+
setOpen: setSidebarNavOpen,
|
|
102
|
+
chatWidthPx,
|
|
103
|
+
setChatWidthPx,
|
|
104
|
+
getShellWidth,
|
|
105
|
+
setChatPanelOpen,
|
|
106
|
+
} = useSidebar();
|
|
107
|
+
const {
|
|
108
|
+
chats,
|
|
109
|
+
currentChatId,
|
|
110
|
+
setCurrentChatId,
|
|
111
|
+
newChat,
|
|
112
|
+
sendMessage,
|
|
113
|
+
addMessage,
|
|
114
|
+
removeMessageById,
|
|
115
|
+
} = useChatsForScopeId(effectiveScopeId);
|
|
116
|
+
const chat = useChat(effectiveScopeId, currentChatId);
|
|
117
|
+
|
|
118
|
+
const {
|
|
119
|
+
searchParams,
|
|
120
|
+
addSearchParams,
|
|
121
|
+
removeSearchParams,
|
|
122
|
+
mutateSearchParams,
|
|
123
|
+
} = useQueryParams();
|
|
124
|
+
const chatOpen = searchParams.has(CHAT_QUERY_PARAM);
|
|
125
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
126
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
127
|
+
/** `?prompt=` deep link text for one-shot composer pre-fill (see ChatPrompt). */
|
|
128
|
+
const [promptLinkPrefill, setPromptLinkPrefill] = useState<string | null>(
|
|
129
|
+
null,
|
|
130
|
+
);
|
|
131
|
+
/** Deduplicate Strict Mode double `useEffect` on the same mount. */
|
|
132
|
+
const promptParamHandledInEffectRef = useRef(false);
|
|
133
|
+
const panelActive = embedAsPage || isOpen;
|
|
134
|
+
|
|
135
|
+
// Ensure valid currentChatId when chat opens
|
|
136
|
+
useEffect(() => {
|
|
137
|
+
if (panelActive && (!currentChatId || currentChatId === '')) {
|
|
138
|
+
if (chats.length > 0) {
|
|
139
|
+
// Select the first available chat
|
|
140
|
+
setCurrentChatId(chats[0].session_id);
|
|
141
|
+
} else {
|
|
142
|
+
// Create a new chat if none exists
|
|
143
|
+
newChat();
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}, [panelActive, currentChatId, chats, setCurrentChatId, newChat]);
|
|
147
|
+
const [scriptByChatId, setScriptByChatId] = useState<
|
|
148
|
+
Record<string, PresetScriptState>
|
|
149
|
+
>({});
|
|
150
|
+
/** Local demo: `[Label]` in assistant text → next assistant body from map. */
|
|
151
|
+
const [quickReplyBranchesByChat, setQuickReplyBranchesByChat] = useState<
|
|
152
|
+
Record<string, Record<string, string>>
|
|
153
|
+
>({});
|
|
154
|
+
const [usedScriptBranchKeysByChat, setUsedScriptBranchKeysByChat] = useState<
|
|
155
|
+
Record<string, string[]>
|
|
156
|
+
>({});
|
|
157
|
+
const [intakeByChatId, setIntakeByChatId] = useState<
|
|
158
|
+
Record<string, IntakeScriptState | undefined>
|
|
159
|
+
>({});
|
|
160
|
+
/** Preset intake finished for this session; show [Generate Dashboard] when `onGenerateDashboard` is set. */
|
|
161
|
+
const [scriptCompleteByChatId, setScriptCompleteByChatId] = useState<
|
|
162
|
+
Record<string, boolean>
|
|
163
|
+
>({});
|
|
164
|
+
const [generatingDashboard, setGeneratingDashboard] = useState(false);
|
|
165
|
+
const scriptAdvanceLockRef = useRef(false);
|
|
166
|
+
const quickReplyLockRef = useRef(false);
|
|
167
|
+
const scrollRef = useRef<ScrollRef>(null);
|
|
168
|
+
|
|
169
|
+
/** Ensures `freeformNext` for known graph presets when parent omits it (Dashboard/Datasets vs DecisionBoard). */
|
|
170
|
+
const presetsWithFreeform = useMemo(
|
|
171
|
+
() => mergePresetFreeformDefaults(presets ?? []),
|
|
172
|
+
[presets],
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
const usedPresetIds = useMemo(
|
|
176
|
+
() => usedPresetIdsFromMessages(chat?.messages, presetsWithFreeform),
|
|
177
|
+
[chat?.messages, presetsWithFreeform],
|
|
178
|
+
);
|
|
179
|
+
|
|
180
|
+
const clearScriptForChat = useCallback((chatId: string) => {
|
|
181
|
+
setScriptByChatId(prev => {
|
|
182
|
+
if (!(chatId in prev)) return prev;
|
|
183
|
+
const next = { ...prev };
|
|
184
|
+
delete next[chatId];
|
|
185
|
+
return next;
|
|
186
|
+
});
|
|
187
|
+
}, []);
|
|
188
|
+
|
|
189
|
+
const clearQuickReplyBranches = useCallback((chatId: string) => {
|
|
190
|
+
setQuickReplyBranchesByChat(prev => {
|
|
191
|
+
if (!(chatId in prev)) return prev;
|
|
192
|
+
const next = { ...prev };
|
|
193
|
+
delete next[chatId];
|
|
194
|
+
return next;
|
|
195
|
+
});
|
|
196
|
+
}, []);
|
|
197
|
+
|
|
198
|
+
const clearUsedScriptBranchKeysForChat = useCallback((chatId: string) => {
|
|
199
|
+
setUsedScriptBranchKeysByChat(prev => {
|
|
200
|
+
if (!(chatId in prev)) return prev;
|
|
201
|
+
const next = { ...prev };
|
|
202
|
+
delete next[chatId];
|
|
203
|
+
return next;
|
|
204
|
+
});
|
|
205
|
+
}, []);
|
|
206
|
+
|
|
207
|
+
const clearIntakeForChat = useCallback((chatId: string) => {
|
|
208
|
+
setIntakeByChatId(prev => {
|
|
209
|
+
if (!(chatId in prev)) return prev;
|
|
210
|
+
const next = { ...prev };
|
|
211
|
+
delete next[chatId];
|
|
212
|
+
return next;
|
|
213
|
+
});
|
|
214
|
+
}, []);
|
|
215
|
+
|
|
216
|
+
const endLocalDemoFlow = useCallback(
|
|
217
|
+
(chatId: string) => {
|
|
218
|
+
clearScriptForChat(chatId);
|
|
219
|
+
clearQuickReplyBranches(chatId);
|
|
220
|
+
clearUsedScriptBranchKeysForChat(chatId);
|
|
221
|
+
clearIntakeForChat(chatId);
|
|
222
|
+
setScriptCompleteByChatId(prev => {
|
|
223
|
+
if (!(chatId in prev)) return prev;
|
|
224
|
+
const next = { ...prev };
|
|
225
|
+
delete next[chatId];
|
|
226
|
+
return next;
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
[
|
|
230
|
+
clearScriptForChat,
|
|
231
|
+
clearQuickReplyBranches,
|
|
232
|
+
clearUsedScriptBranchKeysForChat,
|
|
233
|
+
clearIntakeForChat,
|
|
234
|
+
],
|
|
235
|
+
);
|
|
236
|
+
|
|
237
|
+
const scrollToBottom = () => {
|
|
238
|
+
const inner = scrollRef.current?.innerElem as HTMLDivElement;
|
|
239
|
+
if (inner) {
|
|
240
|
+
inner.scrollTo({
|
|
241
|
+
top: inner.scrollHeight + 1000,
|
|
242
|
+
behavior: 'smooth',
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
useEffect(() => {
|
|
248
|
+
const inner = scrollRef.current?.innerElem as HTMLDivElement;
|
|
249
|
+
|
|
250
|
+
if (inner) setTimeout(scrollToBottom, 100);
|
|
251
|
+
}, [chat?.messages.length]);
|
|
252
|
+
|
|
253
|
+
const onOpenChange = (open: boolean) => {
|
|
254
|
+
if (embedAsPage) {
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
const run = () => {
|
|
258
|
+
setIsOpen(open);
|
|
259
|
+
setChatPanelOpen(open);
|
|
260
|
+
};
|
|
261
|
+
if (
|
|
262
|
+
!isMobile &&
|
|
263
|
+
'startViewTransition' in document &&
|
|
264
|
+
document.startViewTransition
|
|
265
|
+
) {
|
|
266
|
+
document.startViewTransition(run);
|
|
267
|
+
} else {
|
|
268
|
+
run();
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (open) {
|
|
272
|
+
// Avoid a second setSearchParams when `chat` is already set (e.g. Reports merges
|
|
273
|
+
// reportId + chat in one update). A redundant add can merge from a stale `prev`
|
|
274
|
+
// and drop other query keys.
|
|
275
|
+
if (!searchParams.has(CHAT_QUERY_PARAM)) {
|
|
276
|
+
addSearchParams({ [CHAT_QUERY_PARAM]: CHAT_OPEN_VALUE });
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
removeSearchParams(CHAT_QUERY_PARAM);
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* App link: `?prompt=…` — open panel, pre-fill composer, strip param (read once on mount
|
|
285
|
+
* from `location.search`). If the selected session already has messages, `newChat()` first.
|
|
286
|
+
*/
|
|
287
|
+
useEffect(() => {
|
|
288
|
+
if (embedAsPage) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const params = new URLSearchParams(window.location.search);
|
|
292
|
+
const raw = params.get(PROMPT_QUERY_PARAM);
|
|
293
|
+
if (raw == null) {
|
|
294
|
+
return;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (raw.trim() === '') {
|
|
298
|
+
mutateSearchParams(n => {
|
|
299
|
+
n.delete(PROMPT_QUERY_PARAM);
|
|
300
|
+
});
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (promptParamHandledInEffectRef.current) {
|
|
305
|
+
return;
|
|
306
|
+
}
|
|
307
|
+
promptParamHandledInEffectRef.current = true;
|
|
308
|
+
|
|
309
|
+
const selected = currentChatId
|
|
310
|
+
? chats.find(c => c.session_id === currentChatId)
|
|
311
|
+
: undefined;
|
|
312
|
+
const selectedHasMessages = (selected?.messages?.length ?? 0) > 0;
|
|
313
|
+
const needsFirstSession = chats.length === 0;
|
|
314
|
+
|
|
315
|
+
if (selectedHasMessages || needsFirstSession) {
|
|
316
|
+
const sessionId = newChat();
|
|
317
|
+
if (sessionId == null) {
|
|
318
|
+
logger.warn('Chat prompt link: sign in to use the assistant.');
|
|
319
|
+
mutateSearchParams(n => {
|
|
320
|
+
n.delete(PROMPT_QUERY_PARAM);
|
|
321
|
+
});
|
|
322
|
+
promptParamHandledInEffectRef.current = false;
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
setPromptLinkPrefill(raw.trim());
|
|
328
|
+
|
|
329
|
+
mutateSearchParams(n => {
|
|
330
|
+
n.set(CHAT_QUERY_PARAM, CHAT_OPEN_VALUE);
|
|
331
|
+
n.delete(PROMPT_QUERY_PARAM);
|
|
332
|
+
});
|
|
333
|
+
setIsOpen(true);
|
|
334
|
+
setChatPanelOpen(true);
|
|
335
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- mount-only; reads `window.location` and first-render `chats` / `currentChatId`
|
|
336
|
+
}, []);
|
|
337
|
+
|
|
338
|
+
useEvent({
|
|
339
|
+
event: 'keydown',
|
|
340
|
+
callback: (e: Event) => {
|
|
341
|
+
const ke = e as KeyboardEvent;
|
|
342
|
+
if (
|
|
343
|
+
ke.key.toLowerCase() !== CHAT_NEW_SHORTCUT_KEY ||
|
|
344
|
+
!(ke.metaKey || ke.ctrlKey) ||
|
|
345
|
+
!ke.shiftKey ||
|
|
346
|
+
ke.altKey
|
|
347
|
+
) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
ke.preventDefault();
|
|
351
|
+
newChat();
|
|
352
|
+
onOpenChange(true);
|
|
353
|
+
},
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
const onQuickReply = useCallback(
|
|
357
|
+
(branchKey: string, displayLabel: string) => {
|
|
358
|
+
const chatId = currentChatId;
|
|
359
|
+
if (!chatId) return;
|
|
360
|
+
|
|
361
|
+
const branches = quickReplyBranchesByChat[chatId];
|
|
362
|
+
if (
|
|
363
|
+
branches &&
|
|
364
|
+
Object.prototype.hasOwnProperty.call(branches, branchKey)
|
|
365
|
+
) {
|
|
366
|
+
if (quickReplyLockRef.current) return;
|
|
367
|
+
quickReplyLockRef.current = true;
|
|
368
|
+
setIsLoading(true);
|
|
369
|
+
setUsedScriptBranchKeysByChat(prev => ({
|
|
370
|
+
...prev,
|
|
371
|
+
[chatId]: [...new Set([...(prev[chatId] || []), branchKey])],
|
|
372
|
+
}));
|
|
373
|
+
addMessage(chatId, MessageRole.USER, displayLabel);
|
|
374
|
+
|
|
375
|
+
const intake = intakeByChatId[chatId];
|
|
376
|
+
const presetForBranch = presetsWithFreeform.find(
|
|
377
|
+
p => p.id === intake?.presetId,
|
|
378
|
+
);
|
|
379
|
+
const freeformResolvedForBranch = {
|
|
380
|
+
...(presetForBranch?.freeformNext ?? {}),
|
|
381
|
+
...intake?.freeformNext,
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
void (async () => {
|
|
385
|
+
try {
|
|
386
|
+
await new Promise(resolve =>
|
|
387
|
+
setTimeout(resolve, SCRIPT_STEP_DELAY_MS),
|
|
388
|
+
);
|
|
389
|
+
const assistantBody = branches[branchKey];
|
|
390
|
+
addMessage(chatId, MessageRole.ASSISTANT, assistantBody);
|
|
391
|
+
const terminal = isGraphIntakeAssistantStepComplete(
|
|
392
|
+
branchKey,
|
|
393
|
+
freeformResolvedForBranch,
|
|
394
|
+
assistantBody,
|
|
395
|
+
);
|
|
396
|
+
let scriptCompletePayload: ScriptCompletePayload | undefined;
|
|
397
|
+
setIntakeByChatId(prev => {
|
|
398
|
+
const s = prev[chatId];
|
|
399
|
+
if (!s) return prev;
|
|
400
|
+
const nextAnswers = { ...s.answers, [branchKey]: displayLabel };
|
|
401
|
+
if (terminal) {
|
|
402
|
+
scriptCompletePayload = {
|
|
403
|
+
presetId: s.presetId,
|
|
404
|
+
answers: nextAnswers,
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
return {
|
|
408
|
+
...prev,
|
|
409
|
+
[chatId]: {
|
|
410
|
+
...s,
|
|
411
|
+
scriptStepId: branchKey,
|
|
412
|
+
answers: nextAnswers,
|
|
413
|
+
},
|
|
414
|
+
};
|
|
415
|
+
});
|
|
416
|
+
if (scriptCompletePayload) {
|
|
417
|
+
setScriptCompleteByChatId(prev => ({
|
|
418
|
+
...prev,
|
|
419
|
+
[chatId]: true,
|
|
420
|
+
}));
|
|
421
|
+
onScriptComplete?.(scriptCompletePayload);
|
|
422
|
+
}
|
|
423
|
+
} catch (error) {
|
|
424
|
+
logger.error('Error resolving preset quick reply:', error);
|
|
425
|
+
} finally {
|
|
426
|
+
setIsLoading(false);
|
|
427
|
+
quickReplyLockRef.current = false;
|
|
428
|
+
}
|
|
429
|
+
})();
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
endLocalDemoFlow(chatId);
|
|
434
|
+
void (async () => {
|
|
435
|
+
setIsLoading(true);
|
|
436
|
+
try {
|
|
437
|
+
await sendMessage(displayLabel);
|
|
438
|
+
onMessage?.(displayLabel);
|
|
439
|
+
} catch (error) {
|
|
440
|
+
logger.error('Error sending chat message:', error);
|
|
441
|
+
} finally {
|
|
442
|
+
setIsLoading(false);
|
|
443
|
+
}
|
|
444
|
+
})();
|
|
445
|
+
},
|
|
446
|
+
[
|
|
447
|
+
currentChatId,
|
|
448
|
+
intakeByChatId,
|
|
449
|
+
presetsWithFreeform,
|
|
450
|
+
quickReplyBranchesByChat,
|
|
451
|
+
addMessage,
|
|
452
|
+
setUsedScriptBranchKeysByChat,
|
|
453
|
+
endLocalDemoFlow,
|
|
454
|
+
sendMessage,
|
|
455
|
+
onMessage,
|
|
456
|
+
onScriptComplete,
|
|
457
|
+
],
|
|
458
|
+
);
|
|
459
|
+
|
|
460
|
+
const handlePromptSubmit = useCallback(
|
|
461
|
+
async (message: string) => {
|
|
462
|
+
const chatId = currentChatId;
|
|
463
|
+
if (!chatId) return;
|
|
464
|
+
|
|
465
|
+
const quickBranches = quickReplyBranchesByChat[chatId];
|
|
466
|
+
const graphActive = Boolean(
|
|
467
|
+
quickBranches && Object.keys(quickBranches).length > 0,
|
|
468
|
+
);
|
|
469
|
+
const intake = intakeByChatId[chatId];
|
|
470
|
+
|
|
471
|
+
if (graphActive && intake) {
|
|
472
|
+
const presetForIntake = presetsWithFreeform.find(
|
|
473
|
+
p => p.id === intake.presetId,
|
|
474
|
+
);
|
|
475
|
+
const freeformResolved = {
|
|
476
|
+
...(presetForIntake?.freeformNext ?? {}),
|
|
477
|
+
...intake.freeformNext,
|
|
478
|
+
};
|
|
479
|
+
let nextKey = freeformResolved[intake.scriptStepId];
|
|
480
|
+
if (
|
|
481
|
+
(nextKey == null || nextKey === '') &&
|
|
482
|
+
intake.scriptStepId === 'initial' &&
|
|
483
|
+
quickBranches &&
|
|
484
|
+
Object.keys(quickBranches).length === 1
|
|
485
|
+
) {
|
|
486
|
+
nextKey = Object.keys(quickBranches)[0];
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const messages = chat?.messages ?? [];
|
|
490
|
+
const lastAssistant = [...messages]
|
|
491
|
+
.reverse()
|
|
492
|
+
.find(m => m.role === MessageRole.ASSISTANT);
|
|
493
|
+
if (lastAssistant) {
|
|
494
|
+
const matched = matchUserTextToQuickReply(
|
|
495
|
+
lastAssistant.text,
|
|
496
|
+
message,
|
|
497
|
+
);
|
|
498
|
+
if (matched) {
|
|
499
|
+
onQuickReply(matched.key, matched.label);
|
|
500
|
+
return;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
// Freeform: not nested under `lastAssistant` so we still advance when `freeformNext`
|
|
504
|
+
// applies even if the last assistant row is missing from `chat` for one frame.
|
|
505
|
+
if (
|
|
506
|
+
nextKey &&
|
|
507
|
+
quickBranches &&
|
|
508
|
+
Object.prototype.hasOwnProperty.call(quickBranches, nextKey)
|
|
509
|
+
) {
|
|
510
|
+
if (quickReplyLockRef.current) return;
|
|
511
|
+
quickReplyLockRef.current = true;
|
|
512
|
+
setIsLoading(true);
|
|
513
|
+
const newAnswers = {
|
|
514
|
+
...intake.answers,
|
|
515
|
+
[intake.scriptStepId]: message,
|
|
516
|
+
};
|
|
517
|
+
addMessage(chatId, MessageRole.USER, message);
|
|
518
|
+
void (async () => {
|
|
519
|
+
try {
|
|
520
|
+
await new Promise(r => setTimeout(r, SCRIPT_STEP_DELAY_MS));
|
|
521
|
+
const assistantBody = quickBranches[nextKey];
|
|
522
|
+
addMessage(chatId, MessageRole.ASSISTANT, assistantBody);
|
|
523
|
+
const terminal = isGraphIntakeAssistantStepComplete(
|
|
524
|
+
nextKey,
|
|
525
|
+
freeformResolved,
|
|
526
|
+
assistantBody,
|
|
527
|
+
);
|
|
528
|
+
let scriptCompletePayload: ScriptCompletePayload | undefined;
|
|
529
|
+
setIntakeByChatId(prev => {
|
|
530
|
+
const s = prev[chatId];
|
|
531
|
+
if (!s) return prev;
|
|
532
|
+
if (terminal) {
|
|
533
|
+
scriptCompletePayload = {
|
|
534
|
+
presetId: s.presetId,
|
|
535
|
+
answers: newAnswers,
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
return {
|
|
539
|
+
...prev,
|
|
540
|
+
[chatId]: {
|
|
541
|
+
...s,
|
|
542
|
+
scriptStepId: nextKey,
|
|
543
|
+
answers: newAnswers,
|
|
544
|
+
},
|
|
545
|
+
};
|
|
546
|
+
});
|
|
547
|
+
if (scriptCompletePayload) {
|
|
548
|
+
setScriptCompleteByChatId(prev => ({
|
|
549
|
+
...prev,
|
|
550
|
+
[chatId]: true,
|
|
551
|
+
}));
|
|
552
|
+
onScriptComplete?.(scriptCompletePayload);
|
|
553
|
+
}
|
|
554
|
+
} catch (e) {
|
|
555
|
+
logger.error('Error advancing freeform preset script:', e);
|
|
556
|
+
} finally {
|
|
557
|
+
setIsLoading(false);
|
|
558
|
+
quickReplyLockRef.current = false;
|
|
559
|
+
}
|
|
560
|
+
})();
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
if (graphActive && !intake) {
|
|
566
|
+
const messages = chat?.messages ?? [];
|
|
567
|
+
const lastAssistant = [...messages]
|
|
568
|
+
.reverse()
|
|
569
|
+
.find(m => m.role === MessageRole.ASSISTANT);
|
|
570
|
+
if (lastAssistant) {
|
|
571
|
+
const matched = matchUserTextToQuickReply(
|
|
572
|
+
lastAssistant.text,
|
|
573
|
+
message,
|
|
574
|
+
);
|
|
575
|
+
if (matched) {
|
|
576
|
+
onQuickReply(matched.key, matched.label);
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
setIsLoading(true);
|
|
583
|
+
try {
|
|
584
|
+
if (chatId) endLocalDemoFlow(chatId);
|
|
585
|
+
await sendMessage(message);
|
|
586
|
+
onMessage?.(message);
|
|
587
|
+
} catch (error) {
|
|
588
|
+
logger.error('Error sending chat message:', error);
|
|
589
|
+
} finally {
|
|
590
|
+
setIsLoading(false);
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
[
|
|
594
|
+
currentChatId,
|
|
595
|
+
chat?.messages,
|
|
596
|
+
intakeByChatId,
|
|
597
|
+
quickReplyBranchesByChat,
|
|
598
|
+
presetsWithFreeform,
|
|
599
|
+
onQuickReply,
|
|
600
|
+
addMessage,
|
|
601
|
+
endLocalDemoFlow,
|
|
602
|
+
sendMessage,
|
|
603
|
+
onMessage,
|
|
604
|
+
onScriptComplete,
|
|
605
|
+
],
|
|
606
|
+
);
|
|
607
|
+
|
|
608
|
+
const submitPreset = async (preset: ChatPreset) => {
|
|
609
|
+
const script = preset.script;
|
|
610
|
+
const scriptGraph = isPresetScriptGraph(script);
|
|
611
|
+
const hasLinearScript = Array.isArray(script) && script.length > 0;
|
|
612
|
+
const hasReplies = preset.replies && Object.keys(preset.replies).length > 0;
|
|
613
|
+
const isLocalDemo =
|
|
614
|
+
hasLinearScript ||
|
|
615
|
+
scriptGraph ||
|
|
616
|
+
Boolean(preset.answer?.trim()) ||
|
|
617
|
+
Boolean(hasReplies);
|
|
618
|
+
|
|
619
|
+
if (!isLocalDemo) {
|
|
620
|
+
if (!currentChatId) return;
|
|
621
|
+
endLocalDemoFlow(currentChatId);
|
|
622
|
+
await handlePromptSubmit(preset.text);
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
setIsLoading(true);
|
|
627
|
+
try {
|
|
628
|
+
if (!currentChatId) return;
|
|
629
|
+
setScriptCompleteByChatId(prev => {
|
|
630
|
+
const next = { ...prev };
|
|
631
|
+
delete next[currentChatId];
|
|
632
|
+
return next;
|
|
633
|
+
});
|
|
634
|
+
addMessage(currentChatId, MessageRole.USER, preset.text);
|
|
635
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
636
|
+
const firstAssistant = scriptGraph
|
|
637
|
+
? script.initialMessage
|
|
638
|
+
: (preset.answer ?? '');
|
|
639
|
+
addMessage(currentChatId, MessageRole.ASSISTANT, firstAssistant);
|
|
640
|
+
|
|
641
|
+
setScriptByChatId(prev => {
|
|
642
|
+
const next = { ...prev };
|
|
643
|
+
if (hasLinearScript) {
|
|
644
|
+
next[currentChatId] = {
|
|
645
|
+
lines: script,
|
|
646
|
+
nextIndex: 0,
|
|
647
|
+
presetId: preset.id,
|
|
648
|
+
};
|
|
649
|
+
} else {
|
|
650
|
+
delete next[currentChatId];
|
|
651
|
+
}
|
|
652
|
+
return next;
|
|
653
|
+
});
|
|
654
|
+
setQuickReplyBranchesByChat(prev => {
|
|
655
|
+
const next = { ...prev };
|
|
656
|
+
if (scriptGraph) {
|
|
657
|
+
next[currentChatId] = branchesFromPresetScriptGraph(script);
|
|
658
|
+
} else if (hasReplies && !hasLinearScript) {
|
|
659
|
+
next[currentChatId] = preset.replies!;
|
|
660
|
+
} else {
|
|
661
|
+
delete next[currentChatId];
|
|
662
|
+
}
|
|
663
|
+
return next;
|
|
664
|
+
});
|
|
665
|
+
if (scriptGraph || (hasReplies && !hasLinearScript)) {
|
|
666
|
+
setUsedScriptBranchKeysByChat(prev => ({
|
|
667
|
+
...prev,
|
|
668
|
+
[currentChatId]: [],
|
|
669
|
+
}));
|
|
670
|
+
}
|
|
671
|
+
if (scriptGraph) {
|
|
672
|
+
const fromMerged = presetsWithFreeform.find(p => p.id === preset.id);
|
|
673
|
+
let freeformNext = {
|
|
674
|
+
...(fromMerged?.freeformNext ?? {}),
|
|
675
|
+
...(preset.freeformNext ?? {}),
|
|
676
|
+
};
|
|
677
|
+
if (Object.keys(freeformNext).length === 0) {
|
|
678
|
+
const ks = Object.keys(branchesFromPresetScriptGraph(script));
|
|
679
|
+
if (ks.length === 1) {
|
|
680
|
+
freeformNext = { initial: ks[0] };
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
setIntakeByChatId(prev => ({
|
|
684
|
+
...prev,
|
|
685
|
+
[currentChatId!]: {
|
|
686
|
+
presetId: preset.id,
|
|
687
|
+
freeformNext,
|
|
688
|
+
scriptStepId: 'initial',
|
|
689
|
+
answers: {},
|
|
690
|
+
},
|
|
691
|
+
}));
|
|
692
|
+
}
|
|
693
|
+
} catch (error) {
|
|
694
|
+
logger.error('Error sending chat message:', error);
|
|
695
|
+
} finally {
|
|
696
|
+
setIsLoading(false);
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
|
|
700
|
+
const activeScript = currentChatId
|
|
701
|
+
? scriptByChatId[currentChatId]
|
|
702
|
+
: undefined;
|
|
703
|
+
|
|
704
|
+
const lastMsg = useMemo(() => {
|
|
705
|
+
const msgs = chat?.messages ?? [];
|
|
706
|
+
for (let i = msgs.length - 1; i >= 0; i--) {
|
|
707
|
+
if (msgs[i].role !== MessageRole.SYSTEM) {
|
|
708
|
+
return msgs[i];
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
return undefined;
|
|
712
|
+
}, [chat?.messages]);
|
|
713
|
+
const scriptContinueLabel =
|
|
714
|
+
activeScript &&
|
|
715
|
+
lastMsg?.role === MessageRole.ASSISTANT &&
|
|
716
|
+
activeScript.nextIndex < activeScript.lines.length
|
|
717
|
+
? parseScriptLine(activeScript.lines[activeScript.nextIndex]).buttonLabel
|
|
718
|
+
: undefined;
|
|
719
|
+
|
|
720
|
+
const onScriptContinue = useCallback(() => {
|
|
721
|
+
if (!currentChatId || scriptAdvanceLockRef.current) return;
|
|
722
|
+
const active = scriptByChatId[currentChatId];
|
|
723
|
+
if (!active || active.nextIndex >= active.lines.length) return;
|
|
724
|
+
const { lines, nextIndex } = active;
|
|
725
|
+
const step = parseScriptLine(lines[nextIndex]);
|
|
726
|
+
if (!step.buttonLabel) return;
|
|
727
|
+
|
|
728
|
+
const chatId = currentChatId;
|
|
729
|
+
scriptAdvanceLockRef.current = true;
|
|
730
|
+
setIsLoading(true);
|
|
731
|
+
addMessage(chatId, MessageRole.USER, step.buttonLabel);
|
|
732
|
+
|
|
733
|
+
void (async () => {
|
|
734
|
+
try {
|
|
735
|
+
await new Promise(resolve => setTimeout(resolve, SCRIPT_STEP_DELAY_MS));
|
|
736
|
+
addMessage(chatId, MessageRole.ASSISTANT, step.displayBody);
|
|
737
|
+
|
|
738
|
+
let newIndex = nextIndex + 1;
|
|
739
|
+
while (newIndex < lines.length) {
|
|
740
|
+
const nextLine = parseScriptLine(lines[newIndex]);
|
|
741
|
+
if (nextLine.buttonLabel) break;
|
|
742
|
+
addMessage(chatId, MessageRole.ASSISTANT, nextLine.displayBody);
|
|
743
|
+
newIndex++;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
const linearFinished = newIndex >= lines.length;
|
|
747
|
+
const linearPresetId = active.presetId;
|
|
748
|
+
|
|
749
|
+
setScriptByChatId(prev => {
|
|
750
|
+
if (newIndex >= lines.length) {
|
|
751
|
+
const n = { ...prev };
|
|
752
|
+
delete n[chatId];
|
|
753
|
+
return n;
|
|
754
|
+
}
|
|
755
|
+
return {
|
|
756
|
+
...prev,
|
|
757
|
+
[chatId]: {
|
|
758
|
+
lines,
|
|
759
|
+
nextIndex: newIndex,
|
|
760
|
+
presetId: linearPresetId,
|
|
761
|
+
},
|
|
762
|
+
};
|
|
763
|
+
});
|
|
764
|
+
if (linearFinished) {
|
|
765
|
+
setScriptCompleteByChatId(prev => ({
|
|
766
|
+
...prev,
|
|
767
|
+
[chatId]: true,
|
|
768
|
+
}));
|
|
769
|
+
onScriptComplete?.({ presetId: linearPresetId, answers: {} });
|
|
770
|
+
}
|
|
771
|
+
} catch (error) {
|
|
772
|
+
logger.error('Error advancing preset script:', error);
|
|
773
|
+
} finally {
|
|
774
|
+
setIsLoading(false);
|
|
775
|
+
scriptAdvanceLockRef.current = false;
|
|
776
|
+
}
|
|
777
|
+
})();
|
|
778
|
+
}, [currentChatId, scriptByChatId, addMessage, onScriptComplete]);
|
|
779
|
+
|
|
780
|
+
useEffect(() => {
|
|
781
|
+
if (embedAsPage) {
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
setIsOpen(chatOpen);
|
|
785
|
+
setChatPanelOpen(chatOpen);
|
|
786
|
+
}, [embedAsPage, chatOpen, setChatPanelOpen]);
|
|
787
|
+
|
|
788
|
+
/** When this instance unmounts (e.g. route hides ChatSheet), release shell layout — URL sync alone does not run. */
|
|
789
|
+
useEffect(() => {
|
|
790
|
+
return () => {
|
|
791
|
+
if (!embedAsPage) {
|
|
792
|
+
setChatPanelOpen(false);
|
|
793
|
+
}
|
|
794
|
+
};
|
|
795
|
+
}, [embedAsPage, setChatPanelOpen]);
|
|
796
|
+
|
|
797
|
+
useEffect(() => {
|
|
798
|
+
if (embedAsPage) {
|
|
799
|
+
return;
|
|
800
|
+
}
|
|
801
|
+
if (!isOpen || !sidebarNavOpen) return;
|
|
802
|
+
|
|
803
|
+
const collapseNavIfNarrow = () => {
|
|
804
|
+
if (window.innerWidth < CHAT_NAV_COLLAPSE_BREAKPOINT_PX) {
|
|
805
|
+
// Chat open uses `startViewTransition`; nested transition here aborts first → AbortError overlay.
|
|
806
|
+
setSidebarNavOpen(false, { viewTransition: false });
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
|
|
810
|
+
collapseNavIfNarrow();
|
|
811
|
+
window.addEventListener('resize', collapseNavIfNarrow);
|
|
812
|
+
return () => window.removeEventListener('resize', collapseNavIfNarrow);
|
|
813
|
+
}, [embedAsPage, isOpen, sidebarNavOpen, setSidebarNavOpen]);
|
|
814
|
+
|
|
815
|
+
const renderPresets = (layout: ChatPresetsLayout = 'fixed') => {
|
|
816
|
+
if (!presetsWithFreeform?.length) return null;
|
|
817
|
+
|
|
818
|
+
return (
|
|
819
|
+
<Chat.Presets
|
|
820
|
+
chatId={currentChatId ?? ''}
|
|
821
|
+
items={presetsWithFreeform}
|
|
822
|
+
layout={layout}
|
|
823
|
+
usedItemIds={usedPresetIds}
|
|
824
|
+
onSelect={preset => {
|
|
825
|
+
void submitPreset(preset);
|
|
826
|
+
}}
|
|
827
|
+
/>
|
|
828
|
+
);
|
|
829
|
+
};
|
|
830
|
+
|
|
831
|
+
const isLastMessageFromUser =
|
|
832
|
+
chat?.messages.length > 0 &&
|
|
833
|
+
chat.messages[chat.messages.length - 1]?.role === MessageRole.USER;
|
|
834
|
+
|
|
835
|
+
const isEmpty = !chat?.messages?.length && !isLoading;
|
|
836
|
+
|
|
837
|
+
const linearScriptActive = Boolean(
|
|
838
|
+
currentChatId && scriptByChatId[currentChatId],
|
|
839
|
+
);
|
|
840
|
+
const quickBranches = currentChatId
|
|
841
|
+
? quickReplyBranchesByChat[currentChatId]
|
|
842
|
+
: undefined;
|
|
843
|
+
const graphActive = Boolean(
|
|
844
|
+
quickBranches && Object.keys(quickBranches).length > 0,
|
|
845
|
+
);
|
|
846
|
+
const lastAssistantText =
|
|
847
|
+
lastMsg?.role === MessageRole.ASSISTANT ? lastMsg.text : '';
|
|
848
|
+
const lastHasQuickMarkers = Boolean(
|
|
849
|
+
lastAssistantText && textHasQuickReplyMarkers(lastAssistantText),
|
|
850
|
+
);
|
|
851
|
+
const allBranchKeys = useMemo(
|
|
852
|
+
() => (quickBranches ? Object.keys(quickBranches) : []),
|
|
853
|
+
[quickBranches],
|
|
854
|
+
);
|
|
855
|
+
const historyUsedBranchKeysArr = useMemo(
|
|
856
|
+
() => branchKeysUsedFromChatHistory(chat?.messages),
|
|
857
|
+
[chat?.messages],
|
|
858
|
+
);
|
|
859
|
+
const clickedBranchKeys = useMemo((): string[] => {
|
|
860
|
+
if (!currentChatId) return [];
|
|
861
|
+
return usedScriptBranchKeysByChat[currentChatId] ?? [];
|
|
862
|
+
}, [currentChatId, usedScriptBranchKeysByChat]);
|
|
863
|
+
const inferredUsedBranchKeys = useMemo(
|
|
864
|
+
() => branchKeysUsedByUserMessages(chat?.messages, allBranchKeys),
|
|
865
|
+
[chat?.messages, allBranchKeys],
|
|
866
|
+
);
|
|
867
|
+
const lastAssistantQuickPairs = useMemo(() => {
|
|
868
|
+
if (lastMsg?.role !== MessageRole.ASSISTANT) return [];
|
|
869
|
+
return extractQuickReplyLabelKeyPairsFromText(lastMsg.text);
|
|
870
|
+
}, [lastMsg?.role, lastMsg?.text]);
|
|
871
|
+
const entryBranchKeyBeforeLast = useMemo(
|
|
872
|
+
() => entryBranchKeyBeforeLastAssistant(chat?.messages),
|
|
873
|
+
[chat?.messages],
|
|
874
|
+
);
|
|
875
|
+
const usedBranchSet = useMemo(() => {
|
|
876
|
+
const s = new Set<string>([
|
|
877
|
+
...clickedBranchKeys,
|
|
878
|
+
...inferredUsedBranchKeys,
|
|
879
|
+
]);
|
|
880
|
+
for (const k of historyUsedBranchKeysArr) {
|
|
881
|
+
if (allBranchKeys.length === 0 || allBranchKeys.includes(k)) {
|
|
882
|
+
s.add(k);
|
|
883
|
+
}
|
|
884
|
+
}
|
|
885
|
+
return s;
|
|
886
|
+
}, [
|
|
887
|
+
clickedBranchKeys,
|
|
888
|
+
inferredUsedBranchKeys,
|
|
889
|
+
historyUsedBranchKeysArr,
|
|
890
|
+
allBranchKeys,
|
|
891
|
+
]);
|
|
892
|
+
/** Same keys as synthetic “used” branches, plus lone tell-more after forecast-confidence. */
|
|
893
|
+
const suppressedQuickReplyKeys = useMemo(() => {
|
|
894
|
+
const s = new Set(usedBranchSet);
|
|
895
|
+
if (
|
|
896
|
+
lastAssistantQuickPairs.length === 1 &&
|
|
897
|
+
lastAssistantQuickPairs[0].key === 'tell-more' &&
|
|
898
|
+
entryBranchKeyBeforeLast === 'forecast-confidence'
|
|
899
|
+
) {
|
|
900
|
+
s.delete('tell-more');
|
|
901
|
+
}
|
|
902
|
+
return s;
|
|
903
|
+
}, [usedBranchSet, lastAssistantQuickPairs, entryBranchKeyBeforeLast]);
|
|
904
|
+
const unusedBranchKeys = allBranchKeys.filter(k => !usedBranchSet.has(k));
|
|
905
|
+
const unsuppressedInlineKeysOnLast = useMemo(
|
|
906
|
+
() =>
|
|
907
|
+
lastAssistantQuickPairs.filter(p => !suppressedQuickReplyKeys.has(p.key)),
|
|
908
|
+
[lastAssistantQuickPairs, suppressedQuickReplyKeys],
|
|
909
|
+
);
|
|
910
|
+
|
|
911
|
+
const showSyntheticBranchButtons =
|
|
912
|
+
lastMsg?.role === MessageRole.ASSISTANT &&
|
|
913
|
+
!linearScriptActive &&
|
|
914
|
+
graphActive &&
|
|
915
|
+
(!lastHasQuickMarkers || unsuppressedInlineKeysOnLast.length === 0) &&
|
|
916
|
+
unusedBranchKeys.length > 0;
|
|
917
|
+
|
|
918
|
+
const showInlinePresets =
|
|
919
|
+
Boolean(presetsWithFreeform?.length) &&
|
|
920
|
+
lastMsg?.role === MessageRole.ASSISTANT &&
|
|
921
|
+
!linearScriptActive &&
|
|
922
|
+
(!graphActive || (!lastHasQuickMarkers && unusedBranchKeys.length === 0));
|
|
923
|
+
|
|
924
|
+
const isScriptComplete = Boolean(
|
|
925
|
+
currentChatId && scriptCompleteByChatId[currentChatId],
|
|
926
|
+
);
|
|
927
|
+
|
|
928
|
+
/** Branch row also when intake is done but all branches used (Generate Dashboard only). */
|
|
929
|
+
const showBranchActionsRow =
|
|
930
|
+
showSyntheticBranchButtons ||
|
|
931
|
+
(isScriptComplete && Boolean(onGenerateDashboard) && !generatingDashboard);
|
|
932
|
+
|
|
933
|
+
const handleGenerateDashboard = useCallback(async () => {
|
|
934
|
+
if (!currentChatId || !onGenerateDashboard) return;
|
|
935
|
+
const transcript = formatChatTranscript(
|
|
936
|
+
(chat?.messages ?? []).filter(m => m.role !== MessageRole.SYSTEM),
|
|
937
|
+
);
|
|
938
|
+
setGeneratingDashboard(true);
|
|
939
|
+
const systemPlaceholderId = addMessage(
|
|
940
|
+
currentChatId,
|
|
941
|
+
MessageRole.SYSTEM,
|
|
942
|
+
GENERATING_DASHBOARD_SYSTEM_TEXT,
|
|
943
|
+
);
|
|
944
|
+
try {
|
|
945
|
+
await Promise.resolve(onGenerateDashboard(transcript));
|
|
946
|
+
setScriptCompleteByChatId(prev => {
|
|
947
|
+
const next = { ...prev };
|
|
948
|
+
delete next[currentChatId];
|
|
949
|
+
return next;
|
|
950
|
+
});
|
|
951
|
+
} finally {
|
|
952
|
+
if (systemPlaceholderId) {
|
|
953
|
+
removeMessageById(currentChatId, systemPlaceholderId);
|
|
954
|
+
}
|
|
955
|
+
setGeneratingDashboard(false);
|
|
956
|
+
}
|
|
957
|
+
}, [
|
|
958
|
+
currentChatId,
|
|
959
|
+
onGenerateDashboard,
|
|
960
|
+
chat?.messages,
|
|
961
|
+
addMessage,
|
|
962
|
+
removeMessageById,
|
|
963
|
+
]);
|
|
964
|
+
|
|
965
|
+
const onDragChatWidth = useCallback(
|
|
966
|
+
(rawPx: number) => setChatWidthPx(rawPx, { persist: false }),
|
|
967
|
+
[setChatWidthPx],
|
|
968
|
+
);
|
|
969
|
+
const onDragChatComplete = useCallback(
|
|
970
|
+
(finalRawPx: number) => setChatWidthPx(finalRawPx, { persist: true }),
|
|
971
|
+
[setChatWidthPx],
|
|
972
|
+
);
|
|
973
|
+
|
|
974
|
+
const chromeProps: ChatChromeProps = {
|
|
975
|
+
showResizeHandle: !isMobile && !embedAsPage,
|
|
976
|
+
resizeHandle:
|
|
977
|
+
!isMobile && !embedAsPage
|
|
978
|
+
? {
|
|
979
|
+
isActive: isOpen && !isMobile,
|
|
980
|
+
startWidthPx: chatWidthPx,
|
|
981
|
+
getShellWidth,
|
|
982
|
+
onDragWidth: onDragChatWidth,
|
|
983
|
+
onDragComplete: onDragChatComplete,
|
|
984
|
+
}
|
|
985
|
+
: undefined,
|
|
986
|
+
onClose: embedAsPage ? undefined : () => onOpenChange(false),
|
|
987
|
+
isEmpty,
|
|
988
|
+
renderPresets,
|
|
989
|
+
messages: chat?.messages ?? [],
|
|
990
|
+
onQuickReply,
|
|
991
|
+
suppressedQuickReplyKeys,
|
|
992
|
+
isLoading,
|
|
993
|
+
scriptContinueLabel,
|
|
994
|
+
onScriptContinue,
|
|
995
|
+
renderMessageChart,
|
|
996
|
+
showBranchActionsRow,
|
|
997
|
+
showSyntheticBranchButtons,
|
|
998
|
+
unusedBranchKeys,
|
|
999
|
+
isScriptComplete,
|
|
1000
|
+
onGenerateDashboard,
|
|
1001
|
+
generatingDashboard,
|
|
1002
|
+
onGenerateDashboardClick: () => {
|
|
1003
|
+
void handleGenerateDashboard();
|
|
1004
|
+
},
|
|
1005
|
+
showInlinePresets,
|
|
1006
|
+
isLastMessageFromUser,
|
|
1007
|
+
scrollRef,
|
|
1008
|
+
effectiveScopeId,
|
|
1009
|
+
onPromptSubmit: handlePromptSubmit,
|
|
1010
|
+
onChatDeleted: endLocalDemoFlow,
|
|
1011
|
+
promptPrefill: promptLinkPrefill,
|
|
1012
|
+
};
|
|
1013
|
+
|
|
1014
|
+
const toggleOpen = () => onOpenChange(!isOpen);
|
|
1015
|
+
|
|
1016
|
+
return {
|
|
1017
|
+
chromeProps,
|
|
1018
|
+
isOpen,
|
|
1019
|
+
onOpenChange,
|
|
1020
|
+
toggleOpen,
|
|
1021
|
+
newChat,
|
|
1022
|
+
chatPanelContainer,
|
|
1023
|
+
};
|
|
1024
|
+
}
|