@lincyaw/aegis-ui 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.d.ts +5 -0
- package/dist/agent/ask/AskPanel.js +105 -98
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/commands/commandContext.cjs.map +1 -1
- package/dist/commands/commandContext.d.ts +4 -1
- package/dist/commands/commandContext.js.map +1 -1
- package/dist/components/ui/AgentPanel.cjs +1 -1
- package/dist/components/ui/AgentPanel.cjs.map +1 -1
- package/dist/components/ui/AgentPanel.js +15 -14
- package/dist/components/ui/AgentPanel.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +1 -1
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +21 -19
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +16 -4
- package/dist/components/ui/BlastRadiusBar.js +27 -23
- package/dist/components/ui/BlastRadiusBar.js.map +1 -1
- package/dist/components/ui/Button.cjs.map +1 -1
- package/dist/components/ui/Button.d.ts +4 -2
- package/dist/components/ui/Button.js.map +1 -1
- package/dist/components/ui/ChatComposer.cjs +1 -1
- package/dist/components/ui/ChatComposer.cjs.map +1 -1
- package/dist/components/ui/ChatComposer.js +32 -31
- package/dist/components/ui/ChatComposer.js.map +1 -1
- package/dist/components/ui/ChatSessionList.cjs +1 -1
- package/dist/components/ui/ChatSessionList.cjs.map +1 -1
- package/dist/components/ui/ChatSessionList.js +68 -66
- package/dist/components/ui/ChatSessionList.js.map +1 -1
- package/dist/components/ui/CheckGrid.cjs +1 -1
- package/dist/components/ui/CheckGrid.cjs.map +1 -1
- package/dist/components/ui/CheckGrid.js +18 -17
- package/dist/components/ui/CheckGrid.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.d.ts +6 -2
- package/dist/components/ui/Checkbox.js +21 -17
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.d.ts +13 -4
- package/dist/components/ui/ChoiceCardGroup.js +47 -35
- package/dist/components/ui/ChoiceCardGroup.js.map +1 -1
- package/dist/components/ui/CodeEditor.cjs +1 -1
- package/dist/components/ui/CodeEditor.cjs.map +1 -1
- package/dist/components/ui/CodeEditor.d.ts +11 -1
- package/dist/components/ui/CodeEditor.js +108 -74
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
- package/dist/components/ui/CommandInvocationCard.js +23 -26
- package/dist/components/ui/CommandInvocationCard.js.map +1 -1
- package/dist/components/ui/CommandPalette.cjs +1 -1
- package/dist/components/ui/CommandPalette.cjs.map +1 -1
- package/dist/components/ui/CommandPalette.d.ts +3 -3
- package/dist/components/ui/CommandPalette.js +75 -75
- package/dist/components/ui/CommandPalette.js.map +1 -1
- package/dist/components/ui/CommitGraph.cjs +1 -1
- package/dist/components/ui/CommitGraph.cjs.map +1 -1
- package/dist/components/ui/CommitGraph.d.ts +3 -1
- package/dist/components/ui/CommitGraph.js +77 -74
- package/dist/components/ui/CommitGraph.js.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.js +25 -31
- package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
- package/dist/components/ui/ContentPreview.cjs +2 -2
- package/dist/components/ui/ContentPreview.cjs.map +1 -1
- package/dist/components/ui/ContentPreview.js +55 -56
- package/dist/components/ui/ContentPreview.js.map +1 -1
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +9 -8
- package/dist/components/ui/DangerZone.js.map +1 -1
- package/dist/components/ui/DataList.cjs +1 -1
- package/dist/components/ui/DataList.cjs.map +1 -1
- package/dist/components/ui/DataList.js +27 -25
- package/dist/components/ui/DataList.js.map +1 -1
- package/dist/components/ui/DataTable.cjs +1 -1
- package/dist/components/ui/DataTable.cjs.map +1 -1
- package/dist/components/ui/DataTable.d.ts +2 -1
- package/dist/components/ui/DataTable.js +141 -124
- package/dist/components/ui/DataTable.js.map +1 -1
- package/dist/components/ui/DiffViewer.cjs +1 -1
- package/dist/components/ui/DiffViewer.cjs.map +1 -1
- package/dist/components/ui/DiffViewer.js +29 -25
- package/dist/components/ui/DiffViewer.js.map +1 -1
- package/dist/components/ui/DropdownMenu.cjs +1 -1
- package/dist/components/ui/DropdownMenu.cjs.map +1 -1
- package/dist/components/ui/DropdownMenu.d.ts +1 -0
- package/dist/components/ui/DropdownMenu.js +41 -40
- package/dist/components/ui/DropdownMenu.js.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.js +26 -24
- package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
- package/dist/components/ui/EventTable.cjs +1 -1
- package/dist/components/ui/EventTable.cjs.map +1 -1
- package/dist/components/ui/EventTable.js +60 -53
- package/dist/components/ui/EventTable.js.map +1 -1
- package/dist/components/ui/FileDropzone.cjs +1 -1
- package/dist/components/ui/FileDropzone.cjs.map +1 -1
- package/dist/components/ui/FileDropzone.js +40 -42
- package/dist/components/ui/FileDropzone.js.map +1 -1
- package/dist/components/ui/FilePreview.cjs +1 -1
- package/dist/components/ui/FilePreview.cjs.map +1 -1
- package/dist/components/ui/FilePreview.js +63 -61
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/FolderDropzone.cjs +1 -1
- package/dist/components/ui/FolderDropzone.cjs.map +1 -1
- package/dist/components/ui/FolderDropzone.js +114 -84
- package/dist/components/ui/FolderDropzone.js.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.js +22 -21
- package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
- package/dist/components/ui/FormRow.cjs +1 -1
- package/dist/components/ui/FormRow.cjs.map +1 -1
- package/dist/components/ui/FormRow.d.ts +32 -11
- package/dist/components/ui/FormRow.js +24 -15
- package/dist/components/ui/FormRow.js.map +1 -1
- package/dist/components/ui/InboxPage.cjs +1 -1
- package/dist/components/ui/InboxPage.cjs.map +1 -1
- package/dist/components/ui/InboxPage.d.ts +12 -3
- package/dist/components/ui/InboxPage.js +91 -77
- package/dist/components/ui/InboxPage.js.map +1 -1
- package/dist/components/ui/LoginForm.cjs +1 -1
- package/dist/components/ui/LoginForm.cjs.map +1 -1
- package/dist/components/ui/LoginForm.js +43 -43
- package/dist/components/ui/LoginForm.js.map +1 -1
- package/dist/components/ui/MonoValue.cjs +1 -1
- package/dist/components/ui/MonoValue.cjs.map +1 -1
- package/dist/components/ui/MonoValue.d.ts +5 -1
- package/dist/components/ui/MonoValue.js +17 -17
- package/dist/components/ui/MonoValue.js.map +1 -1
- package/dist/components/ui/NotificationBell.cjs +1 -1
- package/dist/components/ui/NotificationBell.cjs.map +1 -1
- package/dist/components/ui/NotificationBell.d.ts +17 -1
- package/dist/components/ui/NotificationBell.js +129 -75
- package/dist/components/ui/NotificationBell.js.map +1 -1
- package/dist/components/ui/NumberField.cjs +1 -1
- package/dist/components/ui/NumberField.cjs.map +1 -1
- package/dist/components/ui/NumberField.d.ts +3 -1
- package/dist/components/ui/NumberField.js +52 -49
- package/dist/components/ui/NumberField.js.map +1 -1
- package/dist/components/ui/ObjectBrowser.cjs +1 -1
- package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
- package/dist/components/ui/ObjectBrowser.js +83 -78
- package/dist/components/ui/ObjectBrowser.js.map +1 -1
- package/dist/components/ui/PageSizeSelect.cjs +1 -1
- package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
- package/dist/components/ui/PageSizeSelect.js +30 -29
- package/dist/components/ui/PageSizeSelect.js.map +1 -1
- package/dist/components/ui/Panel.cjs.map +1 -1
- package/dist/components/ui/Panel.d.ts +5 -2
- package/dist/components/ui/Panel.js.map +1 -1
- package/dist/components/ui/ParetoChart.cjs +1 -1
- package/dist/components/ui/ParetoChart.cjs.map +1 -1
- package/dist/components/ui/ParetoChart.js +247 -212
- package/dist/components/ui/ParetoChart.js.map +1 -1
- package/dist/components/ui/ParquetViewer.cjs +1 -1
- package/dist/components/ui/ParquetViewer.cjs.map +1 -1
- package/dist/components/ui/ParquetViewer.js +69 -74
- package/dist/components/ui/ParquetViewer.js.map +1 -1
- package/dist/components/ui/PasswordField.cjs +1 -1
- package/dist/components/ui/PasswordField.cjs.map +1 -1
- package/dist/components/ui/PasswordField.js +28 -27
- package/dist/components/ui/PasswordField.js.map +1 -1
- package/dist/components/ui/PickerField.cjs +1 -1
- package/dist/components/ui/PickerField.cjs.map +1 -1
- package/dist/components/ui/PickerField.d.ts +25 -6
- package/dist/components/ui/PickerField.js +20 -17
- package/dist/components/ui/PickerField.js.map +1 -1
- package/dist/components/ui/ProjectSelector.cjs +1 -1
- package/dist/components/ui/ProjectSelector.cjs.map +1 -1
- package/dist/components/ui/ProjectSelector.js +40 -37
- package/dist/components/ui/ProjectSelector.js.map +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
- package/dist/components/ui/QueryAutocomplete.d.ts +11 -2
- package/dist/components/ui/QueryAutocomplete.js +146 -126
- package/dist/components/ui/QueryAutocomplete.js.map +1 -1
- package/dist/components/ui/RankBar.cjs +1 -1
- package/dist/components/ui/RankBar.cjs.map +1 -1
- package/dist/components/ui/RankBar.js +9 -9
- package/dist/components/ui/RankBar.js.map +1 -1
- package/dist/components/ui/RegisterForm.cjs +1 -1
- package/dist/components/ui/RegisterForm.cjs.map +1 -1
- package/dist/components/ui/RegisterForm.js +41 -40
- package/dist/components/ui/RegisterForm.js.map +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs +1 -1
- package/dist/components/ui/ReplayStepStrip.cjs.map +1 -1
- package/dist/components/ui/ReplayStepStrip.d.ts +6 -3
- package/dist/components/ui/ReplayStepStrip.js +71 -61
- package/dist/components/ui/ReplayStepStrip.js.map +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
- package/dist/components/ui/ResizableSidePanel.js +41 -40
- package/dist/components/ui/ResizableSidePanel.js.map +1 -1
- package/dist/components/ui/SavedQueryBar.cjs +1 -1
- package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
- package/dist/components/ui/SavedQueryBar.d.ts +1 -1
- package/dist/components/ui/SavedQueryBar.js +375 -277
- package/dist/components/ui/SavedQueryBar.js.map +1 -1
- package/dist/components/ui/SearchInput.cjs +1 -1
- package/dist/components/ui/SearchInput.cjs.map +1 -1
- package/dist/components/ui/SearchInput.d.ts +5 -1
- package/dist/components/ui/SearchInput.js +28 -24
- package/dist/components/ui/SearchInput.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +3 -1
- package/dist/components/ui/Select.js +21 -19
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/ServiceMap.cjs +1 -1
- package/dist/components/ui/ServiceMap.cjs.map +1 -1
- package/dist/components/ui/ServiceMap.d.ts +18 -4
- package/dist/components/ui/ServiceMap.js +353 -228
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/Slider.cjs +1 -1
- package/dist/components/ui/Slider.cjs.map +1 -1
- package/dist/components/ui/Slider.d.ts +3 -1
- package/dist/components/ui/Slider.js +11 -9
- package/dist/components/ui/Slider.js.map +1 -1
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.d.ts +5 -2
- package/dist/components/ui/SparkLine.js +36 -31
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/Steps.cjs +1 -1
- package/dist/components/ui/Steps.cjs.map +1 -1
- package/dist/components/ui/Steps.js +25 -29
- package/dist/components/ui/Steps.js.map +1 -1
- package/dist/components/ui/TableOfContents.cjs +1 -1
- package/dist/components/ui/TableOfContents.cjs.map +1 -1
- package/dist/components/ui/TableOfContents.js +16 -19
- package/dist/components/ui/TableOfContents.js.map +1 -1
- package/dist/components/ui/Tabs.cjs +2 -2
- package/dist/components/ui/Tabs.cjs.map +1 -1
- package/dist/components/ui/Tabs.js +107 -87
- package/dist/components/ui/Tabs.js.map +1 -1
- package/dist/components/ui/Terminal.cjs +1 -1
- package/dist/components/ui/Terminal.cjs.map +1 -1
- package/dist/components/ui/Terminal.js +18 -17
- package/dist/components/ui/Terminal.js.map +1 -1
- package/dist/components/ui/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +6 -6
- package/dist/components/ui/TextField.js.map +1 -1
- package/dist/components/ui/ThemeToggle.cjs +1 -1
- package/dist/components/ui/ThemeToggle.cjs.map +1 -1
- package/dist/components/ui/ThemeToggle.js +15 -18
- package/dist/components/ui/ThemeToggle.js.map +1 -1
- package/dist/components/ui/TimeDisplay.cjs +1 -1
- package/dist/components/ui/TimeDisplay.cjs.map +1 -1
- package/dist/components/ui/TimeDisplay.js +12 -12
- package/dist/components/ui/TimeDisplay.js.map +1 -1
- package/dist/components/ui/TimeRangePicker.cjs +1 -1
- package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
- package/dist/components/ui/TimeRangePicker.d.ts +12 -1
- package/dist/components/ui/TimeRangePicker.js +136 -113
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/Timeline.cjs.map +1 -1
- package/dist/components/ui/Timeline.d.ts +4 -4
- package/dist/components/ui/Timeline.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +2 -2
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +1 -0
- package/dist/components/ui/TimelineChart.js +131 -137
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
- package/dist/components/ui/TraceSpanInspector.js +43 -46
- package/dist/components/ui/TraceSpanInspector.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +5 -1
- package/dist/components/ui/TraceTree.js +98 -97
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/TrajectoryStep.cjs +2 -1
- package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
- package/dist/components/ui/TrajectoryStep.js +64 -43
- package/dist/components/ui/TrajectoryStep.js.map +1 -1
- package/dist/components/ui/UploadQueue.cjs +1 -1
- package/dist/components/ui/UploadQueue.cjs.map +1 -1
- package/dist/components/ui/UploadQueue.js +59 -70
- package/dist/components/ui/UploadQueue.js.map +1 -1
- package/dist/components/ui/authValidation.cjs +1 -1
- package/dist/components/ui/authValidation.cjs.map +1 -1
- package/dist/components/ui/authValidation.d.ts +2 -2
- package/dist/components/ui/authValidation.js +4 -5
- package/dist/components/ui/authValidation.js.map +1 -1
- package/dist/components/ui/classifyContent.cjs +3 -3
- package/dist/components/ui/classifyContent.cjs.map +1 -1
- package/dist/components/ui/classifyContent.d.ts +2 -1
- package/dist/components/ui/classifyContent.js +52 -54
- package/dist/components/ui/classifyContent.js.map +1 -1
- package/dist/components/ui/relativeTime.cjs +1 -1
- package/dist/components/ui/relativeTime.cjs.map +1 -1
- package/dist/components/ui/relativeTime.d.ts +5 -3
- package/dist/components/ui/relativeTime.js +15 -6
- package/dist/components/ui/relativeTime.js.map +1 -1
- package/dist/components/ui/useColumnWidths.cjs +1 -1
- package/dist/components/ui/useColumnWidths.cjs.map +1 -1
- package/dist/components/ui/useColumnWidths.d.ts +6 -1
- package/dist/components/ui/useColumnWidths.js +139 -123
- package/dist/components/ui/useColumnWidths.js.map +1 -1
- package/dist/hooks/popoverOverflow.cjs +2 -0
- package/dist/hooks/popoverOverflow.cjs.map +1 -0
- package/dist/hooks/popoverOverflow.d.ts +8 -0
- package/dist/hooks/popoverOverflow.js +9 -0
- package/dist/hooks/popoverOverflow.js.map +1 -0
- package/dist/hooks/useDialogPopover.cjs +2 -0
- package/dist/hooks/useDialogPopover.cjs.map +1 -0
- package/dist/hooks/useDialogPopover.d.ts +23 -0
- package/dist/hooks/useDialogPopover.js +48 -0
- package/dist/hooks/useDialogPopover.js.map +1 -0
- package/dist/hooks/useMenuPopover.cjs +1 -1
- package/dist/hooks/useMenuPopover.cjs.map +1 -1
- package/dist/hooks/useMenuPopover.d.ts +0 -8
- package/dist/hooks/useMenuPopover.js +17 -22
- package/dist/hooks/useMenuPopover.js.map +1 -1
- package/dist/hooks/useSavedQueries.cjs +1 -1
- package/dist/hooks/useSavedQueries.cjs.map +1 -1
- package/dist/hooks/useSavedQueries.js +29 -28
- package/dist/hooks/useSavedQueries.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +58 -59
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
- package/dist/layouts/shell/AppSwitcher.js +53 -36
- package/dist/layouts/shell/AppSwitcher.js.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.js +24 -22
- package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.d.ts +4 -1
- package/dist/layouts/shell/RouteErrorBoundary.js +15 -10
- package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.js +17 -16
- package/dist/layouts/shell/ShellInboxPage.js.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.js +20 -14
- package/dist/layouts/shell/ShellNotificationBell.js.map +1 -1
- package/dist/layouts/shell/TopHeader.cjs +1 -1
- package/dist/layouts/shell/TopHeader.cjs.map +1 -1
- package/dist/layouts/shell/TopHeader.js +74 -74
- package/dist/layouts/shell/TopHeader.js.map +1 -1
- package/dist/layouts/shell/useShellUser.cjs +1 -1
- package/dist/layouts/shell/useShellUser.cjs.map +1 -1
- package/dist/layouts/shell/useShellUser.js +15 -13
- package/dist/layouts/shell/useShellUser.js.map +1 -1
- package/dist/lib/breakAtSeparators.cjs +2 -0
- package/dist/lib/breakAtSeparators.cjs.map +1 -0
- package/dist/lib/breakAtSeparators.d.ts +6 -0
- package/dist/lib/breakAtSeparators.js +10 -0
- package/dist/lib/breakAtSeparators.js.map +1 -0
- package/dist/lib/chart.cjs +1 -1
- package/dist/lib/chart.cjs.map +1 -1
- package/dist/lib/chart.d.ts +5 -7
- package/dist/lib/chart.js +49 -34
- package/dist/lib/chart.js.map +1 -1
- package/dist/lib/timeRange.cjs +1 -1
- package/dist/lib/timeRange.cjs.map +1 -1
- package/dist/lib/timeRange.d.ts +14 -4
- package/dist/lib/timeRange.js +41 -40
- package/dist/lib/timeRange.js.map +1 -1
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +247 -2
- package/dist/locale/strings.js +562 -37
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +12 -2
- package/dist/notifications/notificationContext.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.js +52 -29
- package/dist/theme/antdTheme.js.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.cjs.map +1 -1
- package/dist/transports/agentm/AgentmChannelProvider.js +66 -61
- package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, Fragment as p, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import { useId as _ } from "react";
|
|
3
3
|
import { Popover as w } from "antd";
|
|
4
4
|
import { useAegisAction as v } from "../../agent/core/hooks.js";
|
|
5
|
-
import {
|
|
5
|
+
import { POPOVER_OVERFLOW as h } from "../../hooks/popoverOverflow.js";
|
|
6
|
+
import { useMenuPopover as b } from "../../hooks/useMenuPopover.js";
|
|
6
7
|
import { Button as y } from "./Button.js";
|
|
7
8
|
/* empty css */
|
|
8
|
-
function
|
|
9
|
-
trigger:
|
|
10
|
-
triggerTone:
|
|
9
|
+
function j({
|
|
10
|
+
trigger: e,
|
|
11
|
+
triggerTone: t,
|
|
11
12
|
items: r,
|
|
12
13
|
header: i,
|
|
13
14
|
footerItems: a = [],
|
|
14
15
|
className: l,
|
|
15
|
-
align:
|
|
16
|
+
align: g = "right"
|
|
16
17
|
}) {
|
|
17
|
-
const
|
|
18
|
+
const o = b(), c = _(), u = ["aegis-dropdown", l ?? ""].filter(Boolean).join(" "), f = /* @__PURE__ */ s(
|
|
18
19
|
"div",
|
|
19
20
|
{
|
|
20
|
-
ref:
|
|
21
|
+
ref: o.panelRef,
|
|
21
22
|
id: c,
|
|
22
23
|
className: "aegis-dropdown__panel",
|
|
23
24
|
role: "menu",
|
|
24
25
|
tabIndex: -1,
|
|
25
|
-
onKeyDown:
|
|
26
|
+
onKeyDown: o.onPanelKeyDown,
|
|
26
27
|
children: [
|
|
27
|
-
i && /* @__PURE__ */
|
|
28
|
+
i && /* @__PURE__ */ s(p, { children: [
|
|
28
29
|
/* @__PURE__ */ n("div", { className: "aegis-dropdown__header", children: i }),
|
|
29
30
|
/* @__PURE__ */ n("div", { className: "aegis-dropdown__divider", role: "separator" })
|
|
30
31
|
] }),
|
|
31
32
|
r.map((d) => /* @__PURE__ */ n(
|
|
32
|
-
|
|
33
|
+
m,
|
|
33
34
|
{
|
|
34
35
|
item: d,
|
|
35
|
-
onAfterClick:
|
|
36
|
+
onAfterClick: o.close
|
|
36
37
|
},
|
|
37
38
|
d.key
|
|
38
39
|
)),
|
|
39
|
-
a.length > 0 && /* @__PURE__ */
|
|
40
|
+
a.length > 0 && /* @__PURE__ */ s(p, { children: [
|
|
40
41
|
/* @__PURE__ */ n("div", { className: "aegis-dropdown__divider", role: "separator" }),
|
|
41
42
|
a.map((d) => /* @__PURE__ */ n(
|
|
42
|
-
|
|
43
|
+
m,
|
|
43
44
|
{
|
|
44
45
|
item: d,
|
|
45
|
-
onAfterClick:
|
|
46
|
+
onAfterClick: o.close
|
|
46
47
|
},
|
|
47
48
|
d.key
|
|
48
49
|
))
|
|
@@ -55,66 +56,66 @@ function R({
|
|
|
55
56
|
{
|
|
56
57
|
content: f,
|
|
57
58
|
trigger: "click",
|
|
58
|
-
open:
|
|
59
|
-
onOpenChange:
|
|
60
|
-
placement:
|
|
61
|
-
autoAdjustOverflow:
|
|
59
|
+
open: o.open,
|
|
60
|
+
onOpenChange: o.setOpen,
|
|
61
|
+
placement: g === "left" ? "bottomLeft" : "bottomRight",
|
|
62
|
+
autoAdjustOverflow: h,
|
|
62
63
|
arrow: !1,
|
|
63
64
|
classNames: { root: "aegis-dropdown__overlay" },
|
|
64
65
|
destroyOnHidden: !0,
|
|
65
|
-
children:
|
|
66
|
+
children: t ? /* @__PURE__ */ n(
|
|
66
67
|
y,
|
|
67
68
|
{
|
|
68
|
-
ref:
|
|
69
|
-
tone:
|
|
69
|
+
ref: o.triggerRef,
|
|
70
|
+
tone: t,
|
|
70
71
|
"aria-haspopup": "menu",
|
|
71
|
-
"aria-expanded":
|
|
72
|
-
"aria-controls":
|
|
73
|
-
onKeyDown:
|
|
74
|
-
children:
|
|
72
|
+
"aria-expanded": o.open,
|
|
73
|
+
"aria-controls": o.open ? c : void 0,
|
|
74
|
+
onKeyDown: o.onTriggerKeyDown,
|
|
75
|
+
children: e
|
|
75
76
|
}
|
|
76
77
|
) : /* @__PURE__ */ n(
|
|
77
78
|
"button",
|
|
78
79
|
{
|
|
79
|
-
ref:
|
|
80
|
+
ref: o.triggerRef,
|
|
80
81
|
type: "button",
|
|
81
82
|
className: "aegis-dropdown__trigger",
|
|
82
83
|
"aria-haspopup": "menu",
|
|
83
|
-
"aria-expanded":
|
|
84
|
-
"aria-controls":
|
|
85
|
-
onKeyDown:
|
|
86
|
-
children:
|
|
84
|
+
"aria-expanded": o.open,
|
|
85
|
+
"aria-controls": o.open ? c : void 0,
|
|
86
|
+
onKeyDown: o.onTriggerKeyDown,
|
|
87
|
+
children: e
|
|
87
88
|
}
|
|
88
89
|
)
|
|
89
90
|
}
|
|
90
91
|
) });
|
|
91
92
|
}
|
|
92
|
-
function
|
|
93
|
-
const r = v(
|
|
94
|
-
a || (
|
|
93
|
+
function m({ item: e, onAfterClick: t }) {
|
|
94
|
+
const r = v(e.action), i = e.action ? !r.available : !1, a = e.disabled ?? i, l = () => {
|
|
95
|
+
a || (e.onClick?.(), e.action && r.invoke(), t());
|
|
95
96
|
};
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
+
return /* @__PURE__ */ s(
|
|
97
98
|
"button",
|
|
98
99
|
{
|
|
99
100
|
type: "button",
|
|
100
101
|
role: "menuitem",
|
|
101
102
|
className: [
|
|
102
103
|
"aegis-dropdown__item",
|
|
103
|
-
|
|
104
|
+
e.danger ? "aegis-dropdown__item--danger" : "",
|
|
104
105
|
a ? "aegis-dropdown__item--disabled" : ""
|
|
105
106
|
].filter(Boolean).join(" "),
|
|
106
107
|
onClick: l,
|
|
107
108
|
disabled: a,
|
|
108
109
|
title: i ? r.unavailableReason : void 0,
|
|
109
|
-
"data-agent-action-id":
|
|
110
|
+
"data-agent-action-id": e.action?.id,
|
|
110
111
|
children: [
|
|
111
|
-
|
|
112
|
-
/* @__PURE__ */ n("span", { className: "aegis-dropdown__item-label", children:
|
|
112
|
+
e.icon && /* @__PURE__ */ n("span", { className: "aegis-dropdown__item-icon", children: e.icon }),
|
|
113
|
+
/* @__PURE__ */ n("span", { className: "aegis-dropdown__item-label", children: e.label })
|
|
113
114
|
]
|
|
114
115
|
}
|
|
115
116
|
);
|
|
116
117
|
}
|
|
117
118
|
export {
|
|
118
|
-
|
|
119
|
+
j as DropdownMenu
|
|
119
120
|
};
|
|
120
121
|
//# sourceMappingURL=DropdownMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","sources":["../../../src/components/ui/DropdownMenu.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport {
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","sources":["../../../src/components/ui/DropdownMenu.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport { POPOVER_OVERFLOW } from '../../hooks/popoverOverflow';\nimport { useMenuPopover } from '../../hooks/useMenuPopover';\nimport { Button, type ButtonTone } from './Button';\nimport './DropdownMenu.css';\n\nexport interface DropdownItem {\n key: string;\n label: ReactNode;\n onClick?: () => void;\n icon?: ReactNode;\n /** A destructive item, e.g. delete: the caution ink and wash, never the anomaly red. */\n danger?: boolean;\n disabled?: boolean;\n /** Optional aegis-ui agent action — fired after onClick if not disabled. */\n action?: AegisAction<void, unknown>;\n}\n\ninterface DropdownMenuProps {\n /**\n * Content of the button that opens the menu: text, an icon, a Chip, an\n * Avatar. DropdownMenu renders that button itself, so never pass a button.\n */\n trigger: ReactNode;\n /** Draws the trigger as a `Button` of this tone; without it the trigger is bare. */\n triggerTone?: ButtonTone;\n items: DropdownItem[];\n /** Non-clickable content above `items`, before a divider — e.g. a search field. */\n header?: ReactNode;\n /** Rendered below `items`, after a divider — e.g. \"View all\" / \"Create\". */\n footerItems?: DropdownItem[];\n className?: string;\n align?: 'left' | 'right';\n}\n\nexport function DropdownMenu({\n trigger,\n triggerTone,\n items,\n header,\n footerItems = [],\n className,\n align = 'right',\n}: DropdownMenuProps) {\n const menu = useMenuPopover<HTMLDivElement>();\n const panelId = useId();\n\n const cls = ['aegis-dropdown', className ?? ''].filter(Boolean).join(' ');\n\n const panel = (\n <div\n ref={menu.panelRef}\n id={panelId}\n className=\"aegis-dropdown__panel\"\n role=\"menu\"\n tabIndex={-1}\n onKeyDown={menu.onPanelKeyDown}\n >\n {header && (\n <>\n <div className=\"aegis-dropdown__header\">{header}</div>\n <div className=\"aegis-dropdown__divider\" role=\"separator\" />\n </>\n )}\n {items.map((item) => (\n <DropdownMenuItem\n key={item.key}\n item={item}\n onAfterClick={menu.close}\n />\n ))}\n {footerItems.length > 0 && (\n <>\n <div className=\"aegis-dropdown__divider\" role=\"separator\" />\n {footerItems.map((item) => (\n <DropdownMenuItem\n key={item.key}\n item={item}\n onAfterClick={menu.close}\n />\n ))}\n </>\n )}\n </div>\n );\n\n return (\n <div className={cls}>\n <Popover\n content={panel}\n trigger=\"click\"\n open={menu.open}\n onOpenChange={menu.setOpen}\n placement={align === 'left' ? 'bottomLeft' : 'bottomRight'}\n autoAdjustOverflow={POPOVER_OVERFLOW}\n arrow={false}\n classNames={{ root: 'aegis-dropdown__overlay' }}\n destroyOnHidden\n >\n {triggerTone ? (\n <Button\n ref={menu.triggerRef}\n tone={triggerTone}\n aria-haspopup=\"menu\"\n aria-expanded={menu.open}\n aria-controls={menu.open ? panelId : undefined}\n onKeyDown={menu.onTriggerKeyDown}\n >\n {trigger}\n </Button>\n ) : (\n <button\n ref={menu.triggerRef}\n type=\"button\"\n className=\"aegis-dropdown__trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={menu.open}\n aria-controls={menu.open ? panelId : undefined}\n onKeyDown={menu.onTriggerKeyDown}\n >\n {trigger}\n </button>\n )}\n </Popover>\n </div>\n );\n}\n\ninterface DropdownMenuItemProps {\n item: DropdownItem;\n onAfterClick: () => void;\n}\n\nfunction DropdownMenuItem({ item, onAfterClick }: DropdownMenuItemProps) {\n const bound = useAegisAction<void, unknown>(item.action);\n const isUnavailable = item.action ? !bound.available : false;\n const disabled = item.disabled ?? isUnavailable;\n\n const handleClick = (): void => {\n if (disabled) {\n return;\n }\n item.onClick?.();\n if (item.action) {\n void bound.invoke();\n }\n onAfterClick();\n };\n\n return (\n <button\n type=\"button\"\n role=\"menuitem\"\n className={[\n 'aegis-dropdown__item',\n item.danger ? 'aegis-dropdown__item--danger' : '',\n disabled ? 'aegis-dropdown__item--disabled' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={handleClick}\n disabled={disabled}\n title={isUnavailable ? bound.unavailableReason : undefined}\n data-agent-action-id={item.action?.id}\n >\n {item.icon && (\n <span className=\"aegis-dropdown__item-icon\">{item.icon}</span>\n )}\n <span className=\"aegis-dropdown__item-label\">{item.label}</span>\n </button>\n );\n}\n"],"names":["DropdownMenu","trigger","triggerTone","items","header","footerItems","className","align","menu","useMenuPopover","panelId","useId","cls","panel","jsxs","Fragment","jsx","item","DropdownMenuItem","Popover","POPOVER_OVERFLOW","Button","onAfterClick","bound","useAegisAction","isUnavailable","disabled","handleClick"],"mappings":";;;;;;;;AAwCO,SAASA,EAAa;AAAA,EAC3B,SAAAC;AAAA,EACA,aAAAC;AAAA,EACA,OAAAC;AAAA,EACA,QAAAC;AAAA,EACA,aAAAC,IAAc,CAAA;AAAA,EACd,WAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,GAAsB;AACpB,QAAMC,IAAOC,EAAA,GACPC,IAAUC,EAAA,GAEVC,IAAM,CAAC,kBAAkBN,KAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAElEO,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKN,EAAK;AAAA,MACV,IAAIE;AAAA,MACJ,WAAU;AAAA,MACV,MAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAWF,EAAK;AAAA,MAEf,UAAA;AAAA,QAAAJ,KACC,gBAAAU,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,0BAA0B,UAAAZ,GAAO;AAAA,UAChD,gBAAAY,EAAC,OAAA,EAAI,WAAU,2BAA0B,MAAK,YAAA,CAAY;AAAA,QAAA,GAC5D;AAAA,QAEDb,EAAM,IAAI,CAACc,MACV,gBAAAD;AAAA,UAACE;AAAA,UAAA;AAAA,YAEC,MAAAD;AAAA,YACA,cAAcT,EAAK;AAAA,UAAA;AAAA,UAFdS,EAAK;AAAA,QAAA,CAIb;AAAA,QACAZ,EAAY,SAAS,KACpB,gBAAAS,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAC,EAAC,OAAA,EAAI,WAAU,2BAA0B,MAAK,aAAY;AAAA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BE,IAAc,MAAY;AAC9B,IAAID,MAGJT,EAAK,UAAA,GACDA,EAAK,UACFM,EAAM,OAAA,GAEbD,EAAA;AAAA,EACF;AAEA,SACE,gBAAAR;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL,WAAW;AAAA,QACT;AAAA,QACAG,EAAK,SAAS,iCAAiC;AAAA,QAC/CS,IAAW,mCAAmC;AAAA,MAAA,EAE7C,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACX,SAASC;AAAA,MACT,UAAAD;AAAA,MACA,OAAOD,IAAgBF,EAAM,oBAAoB;AAAA,MACjD,wBAAsBN,EAAK,QAAQ;AAAA,MAElC,UAAA;AAAA,QAAAA,EAAK,QACJ,gBAAAD,EAAC,QAAA,EAAK,WAAU,6BAA6B,YAAK,MAAK;AAAA,QAEzD,gBAAAA,EAAC,QAAA,EAAK,WAAU,8BAA8B,YAAK,MAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAG/D;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("antd"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("antd"),v=require("../../agent/core/hooks.cjs"),_=require("../../hooks/popoverOverflow.cjs"),m=require("../../hooks/useMenuPopover.cjs");;/* empty css */const w=require("../../locale/useStrings.cjs");function x({options:n,currentId:t,onChange:r,hideWhenSingle:a=!0,className:c,ariaLabel:o}){const d=w.useStrings(),s=m.useMenuPopover();if(n.length===0||a&&n.length<=1)return null;const l=n.find(i=>i.id===t)??n[0],h=["aegis-env-switcher",c??""].filter(Boolean).join(" "),u=e.jsx("ul",{ref:s.panelRef,className:"aegis-env-switcher__panel",role:"listbox",tabIndex:-1,onKeyDown:s.onPanelKeyDown,children:n.map(i=>e.jsx(f,{option:i,selected:i.id===t,onPick:()=>{s.close(),i.id!==t&&r(i.id)}},i.id))});return e.jsx("div",{className:h,children:e.jsx(g.Popover,{content:u,trigger:"click",open:s.open,onOpenChange:s.setOpen,placement:"bottomRight",autoAdjustOverflow:_.POPOVER_OVERFLOW,arrow:!1,classNames:{root:"aegis-env-switcher__overlay"},destroyOnHidden:!0,children:e.jsxs("button",{ref:s.triggerRef,type:"button",className:"aegis-env-switcher__trigger","aria-haspopup":"listbox","aria-expanded":s.open,"aria-label":o??d.switchEnvironment,onKeyDown:s.onTriggerKeyDown,children:[e.jsx("span",{className:`aegis-env-switcher__dot aegis-env-switcher__dot--${l.badge??"default"}`,"aria-hidden":"true"}),e.jsx("span",{className:"aegis-env-switcher__label",children:l.label}),e.jsx("span",{className:"aegis-env-switcher__caret","aria-hidden":"true",children:"▾"})]})})})}function f({option:n,selected:t,onPick:r}){const a=v.useAegisAction(n.action),c=()=>{r(),n.action&&a.invoke()};return e.jsx("li",{role:"presentation",children:e.jsxs("button",{type:"button",role:"option","aria-selected":t,className:["aegis-env-switcher__item",t?"aegis-env-switcher__item--selected":""].filter(Boolean).join(" "),onClick:c,"data-agent-action-id":n.action?.id,children:[e.jsx("span",{className:`aegis-env-switcher__dot aegis-env-switcher__dot--${n.badge??"default"}`,"aria-hidden":"true"}),e.jsxs("span",{className:"aegis-env-switcher__item-text",children:[e.jsx("span",{className:"aegis-env-switcher__item-label",children:n.label}),n.hint&&e.jsx("span",{className:"aegis-env-switcher__item-hint",children:n.hint})]})]})})}exports.EnvironmentSwitcher=x;
|
|
2
2
|
//# sourceMappingURL=EnvironmentSwitcher.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentSwitcher.cjs","sources":["../../../src/components/ui/EnvironmentSwitcher.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport {
|
|
1
|
+
{"version":3,"file":"EnvironmentSwitcher.cjs","sources":["../../../src/components/ui/EnvironmentSwitcher.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport { POPOVER_OVERFLOW } from '../../hooks/popoverOverflow';\nimport { useMenuPopover } from '../../hooks/useMenuPopover';\nimport { useStrings } from '../../locale';\nimport './EnvironmentSwitcher.css';\n\nexport type EnvironmentSwitcherBadge =\n | 'default'\n | 'info'\n | 'warning'\n | 'danger';\n\nexport interface EnvironmentSwitcherOption {\n id: string;\n label: string;\n badge?: EnvironmentSwitcherBadge;\n /** Optional secondary line (e.g. baseUrl) shown in the dropdown. */\n hint?: string;\n /** Optional aegis-ui agent action — fired when the env is selected. */\n action?: AegisAction<void, unknown>;\n}\n\nexport interface EnvironmentSwitcherProps {\n options: EnvironmentSwitcherOption[];\n currentId: string;\n onChange: (id: string) => void;\n /** Hidden when there is ≤1 option. Default true. */\n hideWhenSingle?: boolean;\n className?: string;\n /** Accessible label for the trigger button. */\n ariaLabel?: string;\n}\n\n/**\n * Compact environment dropdown shipped for the AegisShell top header.\n * Presentational + controlled — the shell wires it to the active app's\n * manifest state. Hidden when there is only one environment.\n */\nexport function EnvironmentSwitcher({\n options,\n currentId,\n onChange,\n hideWhenSingle = true,\n className,\n ariaLabel,\n}: EnvironmentSwitcherProps): ReactElement | null {\n const strings = useStrings();\n const menu = useMenuPopover<HTMLUListElement>();\n\n if (options.length === 0) {\n return null;\n }\n if (hideWhenSingle && options.length <= 1) {\n return null;\n }\n const current = options.find((o) => o.id === currentId) ?? options[0];\n\n const cls = ['aegis-env-switcher', className ?? ''].filter(Boolean).join(' ');\n\n const panel = (\n <ul\n ref={menu.panelRef}\n className=\"aegis-env-switcher__panel\"\n role=\"listbox\"\n tabIndex={-1}\n onKeyDown={menu.onPanelKeyDown}\n >\n {options.map((opt) => (\n <EnvironmentSwitcherItem\n key={opt.id}\n option={opt}\n selected={opt.id === currentId}\n onPick={() => {\n menu.close();\n if (opt.id !== currentId) {\n onChange(opt.id);\n }\n }}\n />\n ))}\n </ul>\n );\n\n return (\n <div className={cls}>\n <Popover\n content={panel}\n trigger=\"click\"\n open={menu.open}\n onOpenChange={menu.setOpen}\n placement=\"bottomRight\"\n autoAdjustOverflow={POPOVER_OVERFLOW}\n arrow={false}\n classNames={{ root: 'aegis-env-switcher__overlay' }}\n destroyOnHidden\n >\n <button\n ref={menu.triggerRef}\n type=\"button\"\n className=\"aegis-env-switcher__trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={menu.open}\n aria-label={ariaLabel ?? strings.switchEnvironment}\n onKeyDown={menu.onTriggerKeyDown}\n >\n <span\n className={`aegis-env-switcher__dot aegis-env-switcher__dot--${current.badge ?? 'default'}`}\n aria-hidden=\"true\"\n />\n <span className=\"aegis-env-switcher__label\">{current.label}</span>\n <span className=\"aegis-env-switcher__caret\" aria-hidden=\"true\">\n ▾\n </span>\n </button>\n </Popover>\n </div>\n );\n}\n\ninterface EnvironmentSwitcherItemProps {\n option: EnvironmentSwitcherOption;\n selected: boolean;\n onPick: () => void;\n}\n\nfunction EnvironmentSwitcherItem({\n option,\n selected,\n onPick,\n}: EnvironmentSwitcherItemProps) {\n const bound = useAegisAction<void, unknown>(option.action);\n const handleClick = (): void => {\n onPick();\n if (option.action) {\n void bound.invoke();\n }\n };\n return (\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n aria-selected={selected}\n className={[\n 'aegis-env-switcher__item',\n selected ? 'aegis-env-switcher__item--selected' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={handleClick}\n data-agent-action-id={option.action?.id}\n >\n <span\n className={`aegis-env-switcher__dot aegis-env-switcher__dot--${option.badge ?? 'default'}`}\n aria-hidden=\"true\"\n />\n <span className=\"aegis-env-switcher__item-text\">\n <span className=\"aegis-env-switcher__item-label\">{option.label}</span>\n {option.hint && (\n <span className=\"aegis-env-switcher__item-hint\">{option.hint}</span>\n )}\n </span>\n </button>\n </li>\n );\n}\n"],"names":["EnvironmentSwitcher","options","currentId","onChange","hideWhenSingle","className","ariaLabel","strings","useStrings","menu","useMenuPopover","current","o","cls","panel","jsx","opt","EnvironmentSwitcherItem","Popover","POPOVER_OVERFLOW","jsxs","option","selected","onPick","bound","useAegisAction","handleClick"],"mappings":"gWA2CO,SAASA,EAAoB,CAClC,QAAAC,EACA,UAAAC,EACA,SAAAC,EACA,eAAAC,EAAiB,GACjB,UAAAC,EACA,UAAAC,CACF,EAAkD,CAChD,MAAMC,EAAUC,EAAAA,WAAA,EACVC,EAAOC,EAAAA,eAAA,EAKb,GAHIT,EAAQ,SAAW,GAGnBG,GAAkBH,EAAQ,QAAU,EACtC,OAAO,KAET,MAAMU,EAAUV,EAAQ,KAAMW,GAAMA,EAAE,KAAOV,CAAS,GAAKD,EAAQ,CAAC,EAE9DY,EAAM,CAAC,qBAAsBR,GAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAEtES,EACJC,EAAAA,IAAC,KAAA,CACC,IAAKN,EAAK,SACV,UAAU,4BACV,KAAK,UACL,SAAU,GACV,UAAWA,EAAK,eAEf,SAAAR,EAAQ,IAAKe,GACZD,EAAAA,IAACE,EAAA,CAEC,OAAQD,EACR,SAAUA,EAAI,KAAOd,EACrB,OAAQ,IAAM,CACZO,EAAK,MAAA,EACDO,EAAI,KAAOd,GACbC,EAASa,EAAI,EAAE,CAEnB,CAAA,EARKA,EAAI,EAAA,CAUZ,CAAA,CAAA,EAIL,OACED,EAAAA,IAAC,MAAA,CAAI,UAAWF,EACd,SAAAE,EAAAA,IAACG,EAAAA,QAAA,CACC,QAASJ,EACT,QAAQ,QACR,KAAML,EAAK,KACX,aAAcA,EAAK,QACnB,UAAU,cACV,mBAAoBU,EAAAA,iBACpB,MAAO,GACP,WAAY,CAAE,KAAM,6BAAA,EACpB,gBAAe,GAEf,SAAAC,EAAAA,KAAC,S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
|
2
|
-
import { Popover as
|
|
3
|
-
import { useAegisAction as
|
|
4
|
-
import {
|
|
2
|
+
import { Popover as _ } from "antd";
|
|
3
|
+
import { useAegisAction as u } from "../../agent/core/hooks.js";
|
|
4
|
+
import { POPOVER_OVERFLOW as v } from "../../hooks/popoverOverflow.js";
|
|
5
|
+
import { useMenuPopover as w } from "../../hooks/useMenuPopover.js";
|
|
5
6
|
/* empty css */
|
|
6
|
-
|
|
7
|
+
import { useStrings as f } from "../../locale/useStrings.js";
|
|
8
|
+
function k({
|
|
7
9
|
options: e,
|
|
8
|
-
currentId:
|
|
10
|
+
currentId: a,
|
|
9
11
|
onChange: r,
|
|
10
12
|
hideWhenSingle: s = !0,
|
|
11
13
|
className: l,
|
|
12
|
-
ariaLabel: d
|
|
14
|
+
ariaLabel: d
|
|
13
15
|
}) {
|
|
14
|
-
const i =
|
|
16
|
+
const h = f(), i = w();
|
|
15
17
|
if (e.length === 0 || s && e.length <= 1)
|
|
16
18
|
return null;
|
|
17
|
-
const o = e.find((
|
|
19
|
+
const o = e.find((t) => t.id === a) ?? e[0], m = ["aegis-env-switcher", l ?? ""].filter(Boolean).join(" "), g = /* @__PURE__ */ n(
|
|
18
20
|
"ul",
|
|
19
21
|
{
|
|
20
22
|
ref: i.panelRef,
|
|
@@ -22,23 +24,23 @@ function y({
|
|
|
22
24
|
role: "listbox",
|
|
23
25
|
tabIndex: -1,
|
|
24
26
|
onKeyDown: i.onPanelKeyDown,
|
|
25
|
-
children: e.map((
|
|
26
|
-
|
|
27
|
+
children: e.map((t) => /* @__PURE__ */ n(
|
|
28
|
+
p,
|
|
27
29
|
{
|
|
28
|
-
option:
|
|
29
|
-
selected:
|
|
30
|
+
option: t,
|
|
31
|
+
selected: t.id === a,
|
|
30
32
|
onPick: () => {
|
|
31
|
-
i.close(),
|
|
33
|
+
i.close(), t.id !== a && r(t.id);
|
|
32
34
|
}
|
|
33
35
|
},
|
|
34
|
-
|
|
36
|
+
t.id
|
|
35
37
|
))
|
|
36
38
|
}
|
|
37
39
|
);
|
|
38
|
-
return /* @__PURE__ */ n("div", { className:
|
|
39
|
-
|
|
40
|
+
return /* @__PURE__ */ n("div", { className: m, children: /* @__PURE__ */ n(
|
|
41
|
+
_,
|
|
40
42
|
{
|
|
41
|
-
content:
|
|
43
|
+
content: g,
|
|
42
44
|
trigger: "click",
|
|
43
45
|
open: i.open,
|
|
44
46
|
onOpenChange: i.setOpen,
|
|
@@ -55,7 +57,7 @@ function y({
|
|
|
55
57
|
className: "aegis-env-switcher__trigger",
|
|
56
58
|
"aria-haspopup": "listbox",
|
|
57
59
|
"aria-expanded": i.open,
|
|
58
|
-
"aria-label": d,
|
|
60
|
+
"aria-label": d ?? h.switchEnvironment,
|
|
59
61
|
onKeyDown: i.onTriggerKeyDown,
|
|
60
62
|
children: [
|
|
61
63
|
/* @__PURE__ */ n(
|
|
@@ -73,12 +75,12 @@ function y({
|
|
|
73
75
|
}
|
|
74
76
|
) });
|
|
75
77
|
}
|
|
76
|
-
function
|
|
78
|
+
function p({
|
|
77
79
|
option: e,
|
|
78
|
-
selected:
|
|
80
|
+
selected: a,
|
|
79
81
|
onPick: r
|
|
80
82
|
}) {
|
|
81
|
-
const s =
|
|
83
|
+
const s = u(e.action), l = () => {
|
|
82
84
|
r(), e.action && s.invoke();
|
|
83
85
|
};
|
|
84
86
|
return /* @__PURE__ */ n("li", { role: "presentation", children: /* @__PURE__ */ c(
|
|
@@ -86,10 +88,10 @@ function w({
|
|
|
86
88
|
{
|
|
87
89
|
type: "button",
|
|
88
90
|
role: "option",
|
|
89
|
-
"aria-selected":
|
|
91
|
+
"aria-selected": a,
|
|
90
92
|
className: [
|
|
91
93
|
"aegis-env-switcher__item",
|
|
92
|
-
|
|
94
|
+
a ? "aegis-env-switcher__item--selected" : ""
|
|
93
95
|
].filter(Boolean).join(" "),
|
|
94
96
|
onClick: l,
|
|
95
97
|
"data-agent-action-id": e.action?.id,
|
|
@@ -110,6 +112,6 @@ function w({
|
|
|
110
112
|
) });
|
|
111
113
|
}
|
|
112
114
|
export {
|
|
113
|
-
|
|
115
|
+
k as EnvironmentSwitcher
|
|
114
116
|
};
|
|
115
117
|
//# sourceMappingURL=EnvironmentSwitcher.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentSwitcher.js","sources":["../../../src/components/ui/EnvironmentSwitcher.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport {
|
|
1
|
+
{"version":3,"file":"EnvironmentSwitcher.js","sources":["../../../src/components/ui/EnvironmentSwitcher.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\n\nimport { Popover } from 'antd';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport type { AegisAction } from '../../agent/core/types';\nimport { POPOVER_OVERFLOW } from '../../hooks/popoverOverflow';\nimport { useMenuPopover } from '../../hooks/useMenuPopover';\nimport { useStrings } from '../../locale';\nimport './EnvironmentSwitcher.css';\n\nexport type EnvironmentSwitcherBadge =\n | 'default'\n | 'info'\n | 'warning'\n | 'danger';\n\nexport interface EnvironmentSwitcherOption {\n id: string;\n label: string;\n badge?: EnvironmentSwitcherBadge;\n /** Optional secondary line (e.g. baseUrl) shown in the dropdown. */\n hint?: string;\n /** Optional aegis-ui agent action — fired when the env is selected. */\n action?: AegisAction<void, unknown>;\n}\n\nexport interface EnvironmentSwitcherProps {\n options: EnvironmentSwitcherOption[];\n currentId: string;\n onChange: (id: string) => void;\n /** Hidden when there is ≤1 option. Default true. */\n hideWhenSingle?: boolean;\n className?: string;\n /** Accessible label for the trigger button. */\n ariaLabel?: string;\n}\n\n/**\n * Compact environment dropdown shipped for the AegisShell top header.\n * Presentational + controlled — the shell wires it to the active app's\n * manifest state. Hidden when there is only one environment.\n */\nexport function EnvironmentSwitcher({\n options,\n currentId,\n onChange,\n hideWhenSingle = true,\n className,\n ariaLabel,\n}: EnvironmentSwitcherProps): ReactElement | null {\n const strings = useStrings();\n const menu = useMenuPopover<HTMLUListElement>();\n\n if (options.length === 0) {\n return null;\n }\n if (hideWhenSingle && options.length <= 1) {\n return null;\n }\n const current = options.find((o) => o.id === currentId) ?? options[0];\n\n const cls = ['aegis-env-switcher', className ?? ''].filter(Boolean).join(' ');\n\n const panel = (\n <ul\n ref={menu.panelRef}\n className=\"aegis-env-switcher__panel\"\n role=\"listbox\"\n tabIndex={-1}\n onKeyDown={menu.onPanelKeyDown}\n >\n {options.map((opt) => (\n <EnvironmentSwitcherItem\n key={opt.id}\n option={opt}\n selected={opt.id === currentId}\n onPick={() => {\n menu.close();\n if (opt.id !== currentId) {\n onChange(opt.id);\n }\n }}\n />\n ))}\n </ul>\n );\n\n return (\n <div className={cls}>\n <Popover\n content={panel}\n trigger=\"click\"\n open={menu.open}\n onOpenChange={menu.setOpen}\n placement=\"bottomRight\"\n autoAdjustOverflow={POPOVER_OVERFLOW}\n arrow={false}\n classNames={{ root: 'aegis-env-switcher__overlay' }}\n destroyOnHidden\n >\n <button\n ref={menu.triggerRef}\n type=\"button\"\n className=\"aegis-env-switcher__trigger\"\n aria-haspopup=\"listbox\"\n aria-expanded={menu.open}\n aria-label={ariaLabel ?? strings.switchEnvironment}\n onKeyDown={menu.onTriggerKeyDown}\n >\n <span\n className={`aegis-env-switcher__dot aegis-env-switcher__dot--${current.badge ?? 'default'}`}\n aria-hidden=\"true\"\n />\n <span className=\"aegis-env-switcher__label\">{current.label}</span>\n <span className=\"aegis-env-switcher__caret\" aria-hidden=\"true\">\n ▾\n </span>\n </button>\n </Popover>\n </div>\n );\n}\n\ninterface EnvironmentSwitcherItemProps {\n option: EnvironmentSwitcherOption;\n selected: boolean;\n onPick: () => void;\n}\n\nfunction EnvironmentSwitcherItem({\n option,\n selected,\n onPick,\n}: EnvironmentSwitcherItemProps) {\n const bound = useAegisAction<void, unknown>(option.action);\n const handleClick = (): void => {\n onPick();\n if (option.action) {\n void bound.invoke();\n }\n };\n return (\n <li role=\"presentation\">\n <button\n type=\"button\"\n role=\"option\"\n aria-selected={selected}\n className={[\n 'aegis-env-switcher__item',\n selected ? 'aegis-env-switcher__item--selected' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n onClick={handleClick}\n data-agent-action-id={option.action?.id}\n >\n <span\n className={`aegis-env-switcher__dot aegis-env-switcher__dot--${option.badge ?? 'default'}`}\n aria-hidden=\"true\"\n />\n <span className=\"aegis-env-switcher__item-text\">\n <span className=\"aegis-env-switcher__item-label\">{option.label}</span>\n {option.hint && (\n <span className=\"aegis-env-switcher__item-hint\">{option.hint}</span>\n )}\n </span>\n </button>\n </li>\n );\n}\n"],"names":["EnvironmentSwitcher","options","currentId","onChange","hideWhenSingle","className","ariaLabel","strings","useStrings","menu","useMenuPopover","current","o","cls","panel","jsx","opt","EnvironmentSwitcherItem","Popover","POPOVER_OVERFLOW","jsxs","option","selected","onPick","bound","useAegisAction","handleClick"],"mappings":";;;;;;;AA2CO,SAASA,EAAoB;AAAA,EAClC,SAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,WAAAC;AAAA,EACA,WAAAC;AACF,GAAkD;AAChD,QAAMC,IAAUC,EAAA,GACVC,IAAOC,EAAA;AAKb,MAHIT,EAAQ,WAAW,KAGnBG,KAAkBH,EAAQ,UAAU;AACtC,WAAO;AAET,QAAMU,IAAUV,EAAQ,KAAK,CAACW,MAAMA,EAAE,OAAOV,CAAS,KAAKD,EAAQ,CAAC,GAE9DY,IAAM,CAAC,sBAAsBR,KAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,GAEtES,IACJ,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKN,EAAK;AAAA,MACV,WAAU;AAAA,MACV,MAAK;AAAA,MACL,UAAU;AAAA,MACV,WAAWA,EAAK;AAAA,MAEf,UAAAR,EAAQ,IAAI,CAACe,MACZ,gBA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A8BJ,EAAO,MAAM,GACnDK,IAAc,MAAY;AAC9B,IAAAH,EAAA,GACIF,EAAO,UACJG,EAAM,OAAA;AAAA,EAEf;AACA,SACE,gBAAAT,EAAC,MAAA,EAAG,MAAK,gBACP,UAAA,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,MAAK;AAAA,MACL,MAAK;AAAA,MACL,iBAAeE;AAAA,MACf,WAAW;AAAA,QACT;AAAA,QACAA,IAAW,uCAAuC;AAAA,MAAA,EAEjD,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,MACX,SAASI;AAAA,MACT,wBAAsBL,EAAO,QAAQ;AAAA,MAErC,UAAA;AAAA,QAAA,gBAAAN;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW,oDAAoDM,EAAO,SAAS,SAAS;AAAA,YACxF,eAAY;AAAA,UAAA;AAAA,QAAA;AAAA,QAEd,gBAAAD,EAAC,QAAA,EAAK,WAAU,iCACd,UAAA;AAAA,UAAA,gBAAAL,EAAC,QAAA,EAAK,WAAU,kCAAkC,UAAAM,EAAO,OAAM;AAAA,UAC9DA,EAAO,QACN,gBAAAN,EAAC,UAAK,WAAU,iCAAiC,YAAO,KAAA,CAAK;AAAA,QAAA,EAAA,CAEjE;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("react"),F=require("@tanstack/react-virtual"),V=require("../../hooks/useDevelopAfterLoad.cjs"),W=require("../../hooks/useIsomorphicLayoutEffect.cjs"),X=require("./EmptyState.cjs");;/* empty css */const G=require("./Skeleton.cjs"),K=require("../../locale/useStrings.cjs"),P=32,Y=20,J=200,j=80,Q=6,Z=8,ee=120;function N(n){return n.numeric?"right":n.align??"left"}function te({columns:n,data:u,rowKey:D,onRowClick:c,selectedKey:v,loading:d=!1,emptyTitle:O,emptyDescription:R,estimatedRowHeight:_=P,maxVisibleRows:k=Y,onLoadMore:h,loadMoreThresholdPx:x=J,className:A}){const L=K.useStrings(),b=i.useRef(null),S=i.useRef(null),m=i.useRef(new Map),[g,H]=i.useState(0),a=c!==void 0;W.useIsomorphicLayoutEffect(()=>{const e=S.current;if(!e)return;const t=()=>{H(e.offsetHeight)};t();const s=new ResizeObserver(t);return s.observe(e),()=>{s.disconnect()}},[]);const y=F.useVirtualizer({count:u.length,getScrollElement:()=>b.current,estimateSize:()=>_,overscan:Z,scrollMargin:g}),f=i.useRef(!1),o=i.useRef(null),M=i.useCallback(e=>{if(!h)return;const t=e.currentTarget;if(t.scrollHeight-t.scrollTop-t.clientHeight<=x){if(f.current)return;f.current=!0,o.current!==null&&clearTimeout(o.current),o.current=setTimeout(()=>{h(),o.current=setTimeout(()=>{f.current=!1},j)},j)}else f.current=!1},[h,x]);i.useEffect(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);const p=i.useMemo(()=>n.map(e=>e.width==="flex"||e.width===void 0?"minmax(0, 1fr)":`${e.width.toString()}px`).join(" "),[n]),w=i.useMemo(()=>({minWidth:`${n.reduce((e,t)=>e+(typeof t.width=="number"?t.width:ee),0).toString()}px`}),[n]),$=i.useCallback((e,t,s)=>{e.target===e.currentTarget&&(e.key==="Enter"||e.key===" "?(e.preventDefault(),c?.(s)):(e.key==="ArrowDown"||e.key==="ArrowUp")&&(e.preventDefault(),m.current.get(t+(e.key==="ArrowDown"?1:-1))?.focus()))},[c]),q=["aegis-event-table",A??""].filter(Boolean).join(" "),C={maxHeight:`${(_*k+g).toString()}px`,scrollPaddingTop:`${g.toString()}px`},E=!d&&u.length===0,I=V.useDevelopAfterLoad(d),T=a?"gridcell":"cell";return r.jsx("div",{className:q,role:a?"grid":"table","aria-rowcount":u.length+(E?2:1),"aria-busy":d||void 0,children:r.jsxs("div",{ref:b,className:"aegis-event-table__scroll",style:C,onScroll:M,children:[r.jsx("div",{ref:S,className:"aegis-event-table__header",style:{...w,gridTemplateColumns:p},role:"row","aria-rowindex":1,children:n.map(e=>r.jsx("div",{role:"columnheader",className:`aegis-event-table__th aegis-event-table__th--${N(e)}`,children:e.header},e.key))}),r.jsx("div",{"data-aegis-develop":I||void 0,style:w,children:d?r.jsx("div",{className:"aegis-event-table__skeleton-list","aria-hidden":"true",children:Array.from({length:Q}).map((e,t)=>r.jsx("div",{className:"aegis-event-table__row aegis-event-table__row--skeleton",style:{height:`${_.toString()}px`,gridTemplateColumns:p},children:n.map(s=>r.jsx("div",{className:"aegis-event-table__td",children:r.jsx(G.Skeleton,{width:"80%",height:"var(--space-3)"})},s.key))},t))}):E?r.jsx("div",{className:"aegis-event-table__empty",role:"row","aria-rowindex":2,children:r.jsx("div",{role:T,"aria-colspan":n.length,children:r.jsx(X.EmptyState,{title:O??L.noEvents,description:R})})}):r.jsx("div",{className:"aegis-event-table__virtual",style:{height:`${y.getTotalSize().toString()}px`},children:y.getVirtualItems().map(e=>{const t=u[e.index],s=D(t),U=["aegis-event-table__row",a?"aegis-event-table__row--clickable":"",v===s?"aegis-event-table__row--selected":""].filter(Boolean).join(" ");return r.jsx("div",{ref:l=>{l?m.current.set(e.index,l):m.current.delete(e.index)},role:"row","aria-rowindex":e.index+2,"aria-selected":a&&v!==void 0?v===s:void 0,tabIndex:a?0:void 0,className:U,style:{transform:`translateY(${(e.start-g).toString()}px)`,height:`${e.size.toString()}px`,gridTemplateColumns:p},onClick:c?()=>{c(t)}:void 0,onKeyDown:a?l=>{$(l,e.index,t)}:void 0,children:n.map(l=>{const z=l.truncate!==!1,B=["aegis-event-table__td",`aegis-event-table__td--${N(l)}`,l.numeric?"aegis-event-table__td--numeric":"",z?"aegis-event-table__td--truncate":""].filter(Boolean).join(" ");return r.jsx("div",{role:T,className:B,children:l.render(t)},l.key)})},s)})})})]})})}exports.EventTable=te;
|
|
2
2
|
//# sourceMappingURL=EventTable.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventTable.cjs","sources":["../../../src/components/ui/EventTable.tsx"],"sourcesContent":["// Virtualized table mechanics adapted from HyperDX (MIT, DeploySentinel Inc. 2023):\n// https://github.com/hyperdxio/hyperdx/blob/main/packages/app/src/components/DBRowTable.tsx\nimport {\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type UIEvent as ReactUIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useVirtualizer } from '@tanstack/react-virtual';\n\nimport { useDevelopAfterLoad } from '../../hooks/useDevelopAfterLoad';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { EmptyState } from './EmptyState';\nimport './EventTable.css';\nimport { Skeleton } from './Skeleton';\n\nexport interface EventTableColumn<T> {\n key: string;\n header: ReactNode;\n /**\n * Column width in px, or 'flex' (the default) to share the remaining\n * space, never below 120 px. When the columns don't fit, the table\n * scrolls sideways, header and rows together.\n */\n width?: number | 'flex';\n /** Align cell content. Default 'left'. */\n align?: 'left' | 'right' | 'center';\n /**\n * Number column: header and cells right-aligned, figures in\n * `--font-numeric` with tabular widths so digits and decimal points line\n * up. Overrides `align`.\n */\n numeric?: boolean;\n /** Cell renderer. */\n render: (row: T) => ReactNode;\n /** When true, do not ellipsize overflowing text. */\n truncate?: boolean;\n}\n\nexport interface EventTableProps<T> {\n columns: Array<EventTableColumn<T>>;\n data: T[];\n /** Stable row key. */\n rowKey: (row: T) => string;\n /**\n * Makes rows clickable: focusable, a muted hover background, Enter or\n * Space on a focused row and the arrow keys between rows. Without it\n * rows are plain, and links inside cells keep their own behaviour.\n */\n onRowClick?: (row: T) => void;\n /** Visually mark a row as selected/highlighted. */\n selectedKey?: string;\n /** Loading skeleton above the (possibly empty) body. */\n loading?: boolean;\n emptyTitle?: string;\n emptyDescription?: string;\n /** Approximate row height in px — used by the virtualizer. Default 32. */\n estimatedRowHeight?: number;\n /** Max visible rows before vertical scroll kicks in. Default 20. */\n maxVisibleRows?: number;\n /** When provided, append-on-bottom: invoked when the user scrolls within `loadMoreThresholdPx` of the bottom. */\n onLoadMore?: () => void;\n /** Distance from bottom that triggers onLoadMore. Default 200. */\n loadMoreThresholdPx?: number;\n /** ClassName appended to the root. */\n className?: string;\n}\n\nconst DEFAULT_ROW_HEIGHT = 32;\nconst DEFAULT_MAX_VISIBLE_ROWS = 20;\nconst DEFAULT_LOAD_MORE_THRESHOLD = 200;\nconst LOAD_MORE_DEBOUNCE_MS = 80;\nconst SKELETON_ROW_COUNT = 6;\nconst OVERSCAN = 8;\nconst FLEX_COLUMN_MIN_WIDTH = 120;\n\nfunction columnAlign<T>(col: EventTableColumn<T>): 'left' | 'right' | 'center' {\n return col.numeric ? 'right' : (col.align ?? 'left');\n}\n\nexport function EventTable<T>({\n columns,\n data,\n rowKey,\n onRowClick,\n selectedKey,\n loading = false,\n emptyTitle = 'No events',\n emptyDescription,\n estimatedRowHeight = DEFAULT_ROW_HEIGHT,\n maxVisibleRows = DEFAULT_MAX_VISIBLE_ROWS,\n onLoadMore,\n loadMoreThresholdPx = DEFAULT_LOAD_MORE_THRESHOLD,\n className,\n}: EventTableProps<T>) {\n const scrollRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const rowRefs = useRef(new Map<number, HTMLDivElement>());\n const [headerHeight, setHeaderHeight] = useState(0);\n const clickable = onRowClick !== undefined;\n\n // The header scrolls with the rows, so both share the scrollbar's gutter\n // and their columns line up; the rows start below it.\n useIsomorphicLayoutEffect(() => {\n const header = headerRef.current;\n if (!header) {\n return undefined;\n }\n const measure = (): void => {\n setHeaderHeight(header.offsetHeight);\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(header);\n return () => {\n observer.disconnect();\n };\n }, []);\n\n const virtualizer = useVirtualizer({\n count: data.length,\n getScrollElement: () => scrollRef.current,\n estimateSize: () => estimatedRowHeight,\n overscan: OVERSCAN,\n scrollMargin: headerHeight,\n });\n\n const loadMoreFiredRef = useRef(false);\n const loadMoreTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const handleScroll = useCallback(\n (e: ReactUIEvent<HTMLDivElement>) => {\n if (!onLoadMore) {\n return;\n }\n const el = e.currentTarget;\n const distance = el.scrollHeight - el.scrollTop - el.clientHeight;\n if (distance <= loadMoreThresholdPx) {\n if (loadMoreFiredRef.current) {\n return;\n }\n loadMoreFiredRef.current = true;\n if (loadMoreTimerRef.current !== null) {\n clearTimeout(loadMoreTimerRef.current);\n }\n loadMoreTimerRef.current = setTimeout(() => {\n onLoadMore();\n loadMoreTimerRef.current = setTimeout(() => {\n loadMoreFiredRef.current = false;\n }, LOAD_MORE_DEBOUNCE_MS);\n }, LOAD_MORE_DEBOUNCE_MS);\n } else {\n loadMoreFiredRef.current = false;\n }\n },\n [onLoadMore, loadMoreThresholdPx],\n );\n\n useEffect(() => {\n return () => {\n if (loadMoreTimerRef.current !== null) {\n clearTimeout(loadMoreTimerRef.current);\n }\n };\n }, []);\n\n const gridTemplate = useMemo(\n () =>\n columns\n .map((c) =>\n c.width === 'flex' || c.width === undefined\n ? 'minmax(0, 1fr)'\n : `${c.width.toString()}px`,\n )\n .join(' '),\n [columns],\n );\n\n const contentStyle = useMemo(\n (): CSSProperties => ({\n minWidth: `${columns\n .reduce(\n (sum, c) =>\n sum +\n (typeof c.width === 'number' ? c.width : FLEX_COLUMN_MIN_WIDTH),\n 0,\n )\n .toString()}px`,\n }),\n [columns],\n );\n\n const handleRowKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLDivElement>, index: number, row: T) => {\n if (e.target !== e.currentTarget) {\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onRowClick?.(row);\n } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n // Overscan keeps the neighbouring rows mounted.\n rowRefs.current.get(index + (e.key === 'ArrowDown' ? 1 : -1))?.focus();\n }\n },\n [onRowClick],\n );\n\n const rootCls = ['aegis-event-table', className ?? '']\n .filter(Boolean)\n .join(' ');\n\n const scrollStyle: CSSProperties = {\n maxHeight: `${(estimatedRowHeight * maxVisibleRows + headerHeight).toString()}px`,\n scrollPaddingTop: `${headerHeight.toString()}px`,\n };\n\n const showEmpty = !loading && data.length === 0;\n const develop = useDevelopAfterLoad(loading);\n const cellRole = clickable ? 'gridcell' : 'cell';\n\n return (\n <div\n className={rootCls}\n role={clickable ? 'grid' : 'table'}\n aria-rowcount={data.length + (showEmpty ? 2 : 1)}\n aria-busy={loading || undefined}\n >\n <div\n ref={scrollRef}\n className=\"aegis-event-table__scroll\"\n style={scrollStyle}\n onScroll={handleScroll}\n >\n <div\n ref={headerRef}\n className=\"aegis-event-table__header\"\n style={{ ...contentStyle, gridTemplateColumns: gridTemplate }}\n role=\"row\"\n aria-rowindex={1}\n >\n {columns.map((col) => (\n <div\n key={col.key}\n role=\"columnheader\"\n className={`aegis-event-table__th aegis-event-table__th--${columnAlign(col)}`}\n >\n {col.header}\n </div>\n ))}\n </div>\n\n <div data-aegis-develop={develop || undefined} style={contentStyle}>\n {loading ? (\n <div\n className=\"aegis-event-table__skeleton-list\"\n aria-hidden=\"true\"\n >\n {Array.from({ length: SKELETON_ROW_COUNT }).map((_, i) => (\n <div\n key={i}\n className=\"aegis-event-table__row aegis-event-table__row--skeleton\"\n style={{\n height: `${estimatedRowHeight.toString()}px`,\n gridTemplateColumns: gridTemplate,\n }}\n >\n {columns.map((c) => (\n <div key={c.key} className=\"aegis-event-table__td\">\n <Skeleton width=\"80%\" height=\"var(--space-3)\" />\n </div>\n ))}\n </div>\n ))}\n </div>\n ) : showEmpty ? (\n <div\n className=\"aegis-event-table__empty\"\n role=\"row\"\n aria-rowindex={2}\n >\n <div role={cellRole} aria-colspan={columns.length}>\n <EmptyState title={emptyTitle} description={emptyDescription} />\n </div>\n </div>\n ) : (\n <div\n className=\"aegis-event-table__virtual\"\n style={{\n height: `${virtualizer.getTotalSize().toString()}px`,\n }}\n >\n {virtualizer.getVirtualItems().map((vi) => {\n const row = data[vi.index];\n const key = rowKey(row);\n const rowCls = [\n 'aegis-event-table__row',\n clickable ? 'aegis-event-table__row--clickable' : '',\n selectedKey === key ? 'aegis-event-table__row--selected' : '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div\n key={key}\n ref={(el) => {\n if (el) {\n rowRefs.current.set(vi.index, el);\n } else {\n rowRefs.current.delete(vi.index);\n }\n }}\n role=\"row\"\n aria-rowindex={vi.index + 2}\n aria-selected={\n clickable && selectedKey !== undefined\n ? selectedKey === key\n : undefined\n }\n tabIndex={clickable ? 0 : undefined}\n className={rowCls}\n style={{\n transform: `translateY(${(vi.start - headerHeight).toString()}px)`,\n height: `${vi.size.toString()}px`,\n gridTemplateColumns: gridTemplate,\n }}\n onClick={\n onRowClick\n ? () => {\n onRowClick(row);\n }\n : undefined\n }\n onKeyDown={\n clickable\n ? (e) => {\n handleRowKeyDown(e, vi.index, row);\n }\n : undefined\n }\n >\n {columns.map((col) => {\n const truncate = col.truncate !== false;\n const cellCls = [\n 'aegis-event-table__td',\n `aegis-event-table__td--${columnAlign(col)}`,\n col.numeric ? 'aegis-event-table__td--numeric' : '',\n truncate ? 'aegis-event-table__td--truncate' : '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div key={col.key} role={cellRole} className={cellCls}>\n {col.render(row)}\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["DEFAULT_ROW_HEIGHT","DEFAULT_MAX_VISIBLE_ROWS","DEFAULT_LOAD_MORE_THRESHOLD","LOAD_MORE_DEBOUNCE_MS","SKELETON_ROW_COUNT","OVERSCAN","FLEX_COLUMN_MIN_WIDTH","columnAlign","col","EventTable","columns","data","rowKey","onRowClick","selectedKey","loading","emptyTitle","emptyDescription","estimatedRowHeight","maxVisibleRows","onLoadMore","loadMoreThresholdPx","className","scrollRef","useRef","headerRef","rowRefs","headerHeight","setHeaderHeight","useState","clickable","useIsomorphicLayoutEffect","header","measure","observer","virtualizer","useVirtualizer","loadMoreFiredRef","loadMoreTimerRef","handleScroll","useCallback","el","useEffect","gridTemplate","useMemo","c","contentStyle","sum","handleRowKeyDown","index","row","rootCls","scrollStyle","showEmpty","develop","useDevelopAfterLoad","cellRole","jsx","jsxs","_","i","Skeleton","EmptyState","vi","key","rowCls","e","truncate","cellCls"],"mappings":"qXA0EMA,EAAqB,GACrBC,EAA2B,GAC3BC,EAA8B,IAC9BC,EAAwB,GACxBC,EAAqB,EACrBC,EAAW,EACXC,EAAwB,IAE9B,SAASC,EAAeC,EAAuD,CAC7E,OAAOA,EAAI,QAAU,QAAWA,EAAI,OAAS,MAC/C,CAEO,SAASC,EAAc,CAC5B,QAAAC,EACA,KAAAC,EACA,OAAAC,EACA,WAAAC,EACA,YAAAC,EACA,QAAAC,EAAU,GACV,WAAAC,EAAa,YACb,iBAAAC,EACA,mBAAAC,EAAqBlB,EACrB,eAAAmB,EAAiBlB,EACjB,WAAAmB,EACA,oBAAAC,EAAsBnB,EACtB,UAAAoB,CACF,EAAuB,CACrB,MAAMC,EAAYC,EAAAA,OAAuB,IAAI,EACvCC,EAAYD,EAAAA,OAAuB,IAAI,EACvCE,EAAUF,EAAAA,OAAO,IAAI,GAA6B,EAClD,CAACG,EAAcC,CAAe,EAAIC,EAAAA,SAAS,CAAC,EAC5CC,EAAYjB,IAAe,OAIjCkB,EAAAA,0BAA0B,IAAM,CAC9B,MAAMC,EAASP,EAAU,QACzB,GAAI,CAACO,EACH,OAEF,MAAMC,EAAU,IAAY,CAC1BL,EAAgBI,EAAO,YAAY,CACrC,EACAC,EAAA,EACA,MAAMC,EAAW,IAAI,eAAeD,CAAO,EAC3C,OAAAC,EAAS,QAAQF,CAAM,EAChB,IAAM,CACXE,EAAS,WAAA,CACX,CACF,EAAG,CAAA,CAAE,EAEL,MAAMC,EAAcC,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C7D,OAAQ,GAAGoC,EAAG,KAAK,UAAU,KAC7B,oBAAqBpB,CAAA,EAEvB,QACE9B,EACI,IAAM,CACJA,EAAWqC,CAAG,CAChB,EACA,OAEN,UACEpB,EACKoC,GAAM,CACLlB,EAAiBkB,EAAGH,EAAG,MAAOb,CAAG,CACnC,EACA,OAGL,SAAAxC,EAAQ,IAAKF,GAAQ,CACpB,MAAM2D,EAAW3D,EAAI,WAAa,GAC5B4D,EAAU,CACd,wBACA,0BAA0B7D,EAAYC,CAAG,CAAC,GAC1CA,EAAI,QAAU,iCAAmC,GACjD2D,EAAW,kCAAoC,EAAA,EAE9C,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OACEV,EAAAA,IAAC,MAAA,CAAkB,KAAMD,EAAU,UAAWY,EAC3C,SAAA5D,EAAI,OAAO0C,CAAG,CAAA,EADP1C,EAAI,GAEd,CAEJ,CAAC,CAAA,EApDIwD,CAAA,CAuDX,CAAC,CAAA,CAAA,CACH,CAEJ,CAAA,CAAA,CAAA,CACF,CAAA,CAGN"}
|
|
1
|
+
{"version":3,"file":"EventTable.cjs","sources":["../../../src/components/ui/EventTable.tsx"],"sourcesContent":["// Virtualized table mechanics adapted from HyperDX (MIT, DeploySentinel Inc. 2023):\n// https://github.com/hyperdxio/hyperdx/blob/main/packages/app/src/components/DBRowTable.tsx\nimport {\n type CSSProperties,\n type KeyboardEvent as ReactKeyboardEvent,\n type ReactNode,\n type UIEvent as ReactUIEvent,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useVirtualizer } from '@tanstack/react-virtual';\n\nimport { useDevelopAfterLoad } from '../../hooks/useDevelopAfterLoad';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { useStrings } from '../../locale';\nimport { EmptyState } from './EmptyState';\nimport './EventTable.css';\nimport { Skeleton } from './Skeleton';\n\nexport interface EventTableColumn<T> {\n key: string;\n header: ReactNode;\n /**\n * Column width in px, or 'flex' (the default) to share the remaining\n * space, never below 120 px. When the columns don't fit, the table\n * scrolls sideways, header and rows together.\n */\n width?: number | 'flex';\n /** Align cell content. Default 'left'. */\n align?: 'left' | 'right' | 'center';\n /**\n * Number column: header and cells right-aligned, figures in\n * `--font-numeric` with tabular widths so digits and decimal points line\n * up. Overrides `align`.\n */\n numeric?: boolean;\n /** Cell renderer. */\n render: (row: T) => ReactNode;\n /** When true, do not ellipsize overflowing text. */\n truncate?: boolean;\n}\n\nexport interface EventTableProps<T> {\n columns: Array<EventTableColumn<T>>;\n data: T[];\n /** Stable row key. */\n rowKey: (row: T) => string;\n /**\n * Makes rows clickable: focusable, a muted hover background, Enter or\n * Space on a focused row and the arrow keys between rows. Without it\n * rows are plain, and links inside cells keep their own behaviour.\n */\n onRowClick?: (row: T) => void;\n /** Visually mark a row as selected/highlighted. */\n selectedKey?: string;\n /** Loading skeleton above the (possibly empty) body. */\n loading?: boolean;\n emptyTitle?: string;\n emptyDescription?: string;\n /** Approximate row height in px — used by the virtualizer. Default 32. */\n estimatedRowHeight?: number;\n /** Max visible rows before vertical scroll kicks in. Default 20. */\n maxVisibleRows?: number;\n /** When provided, append-on-bottom: invoked when the user scrolls within `loadMoreThresholdPx` of the bottom. */\n onLoadMore?: () => void;\n /** Distance from bottom that triggers onLoadMore. Default 200. */\n loadMoreThresholdPx?: number;\n /** ClassName appended to the root. */\n className?: string;\n}\n\nconst DEFAULT_ROW_HEIGHT = 32;\nconst DEFAULT_MAX_VISIBLE_ROWS = 20;\nconst DEFAULT_LOAD_MORE_THRESHOLD = 200;\nconst LOAD_MORE_DEBOUNCE_MS = 80;\nconst SKELETON_ROW_COUNT = 6;\nconst OVERSCAN = 8;\nconst FLEX_COLUMN_MIN_WIDTH = 120;\n\nfunction columnAlign<T>(col: EventTableColumn<T>): 'left' | 'right' | 'center' {\n return col.numeric ? 'right' : (col.align ?? 'left');\n}\n\nexport function EventTable<T>({\n columns,\n data,\n rowKey,\n onRowClick,\n selectedKey,\n loading = false,\n emptyTitle,\n emptyDescription,\n estimatedRowHeight = DEFAULT_ROW_HEIGHT,\n maxVisibleRows = DEFAULT_MAX_VISIBLE_ROWS,\n onLoadMore,\n loadMoreThresholdPx = DEFAULT_LOAD_MORE_THRESHOLD,\n className,\n}: EventTableProps<T>) {\n const strings = useStrings();\n const scrollRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLDivElement>(null);\n const rowRefs = useRef(new Map<number, HTMLDivElement>());\n const [headerHeight, setHeaderHeight] = useState(0);\n const clickable = onRowClick !== undefined;\n\n // The header scrolls with the rows, so both share the scrollbar's gutter\n // and their columns line up; the rows start below it.\n useIsomorphicLayoutEffect(() => {\n const header = headerRef.current;\n if (!header) {\n return undefined;\n }\n const measure = (): void => {\n setHeaderHeight(header.offsetHeight);\n };\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(header);\n return () => {\n observer.disconnect();\n };\n }, []);\n\n const virtualizer = useVirtualizer({\n count: data.length,\n getScrollElement: () => scrollRef.current,\n estimateSize: () => estimatedRowHeight,\n overscan: OVERSCAN,\n scrollMargin: headerHeight,\n });\n\n const loadMoreFiredRef = useRef(false);\n const loadMoreTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n\n const handleScroll = useCallback(\n (e: ReactUIEvent<HTMLDivElement>) => {\n if (!onLoadMore) {\n return;\n }\n const el = e.currentTarget;\n const distance = el.scrollHeight - el.scrollTop - el.clientHeight;\n if (distance <= loadMoreThresholdPx) {\n if (loadMoreFiredRef.current) {\n return;\n }\n loadMoreFiredRef.current = true;\n if (loadMoreTimerRef.current !== null) {\n clearTimeout(loadMoreTimerRef.current);\n }\n loadMoreTimerRef.current = setTimeout(() => {\n onLoadMore();\n loadMoreTimerRef.current = setTimeout(() => {\n loadMoreFiredRef.current = false;\n }, LOAD_MORE_DEBOUNCE_MS);\n }, LOAD_MORE_DEBOUNCE_MS);\n } else {\n loadMoreFiredRef.current = false;\n }\n },\n [onLoadMore, loadMoreThresholdPx],\n );\n\n useEffect(() => {\n return () => {\n if (loadMoreTimerRef.current !== null) {\n clearTimeout(loadMoreTimerRef.current);\n }\n };\n }, []);\n\n const gridTemplate = useMemo(\n () =>\n columns\n .map((c) =>\n c.width === 'flex' || c.width === undefined\n ? 'minmax(0, 1fr)'\n : `${c.width.toString()}px`,\n )\n .join(' '),\n [columns],\n );\n\n const contentStyle = useMemo(\n (): CSSProperties => ({\n minWidth: `${columns\n .reduce(\n (sum, c) =>\n sum +\n (typeof c.width === 'number' ? c.width : FLEX_COLUMN_MIN_WIDTH),\n 0,\n )\n .toString()}px`,\n }),\n [columns],\n );\n\n const handleRowKeyDown = useCallback(\n (e: ReactKeyboardEvent<HTMLDivElement>, index: number, row: T) => {\n if (e.target !== e.currentTarget) {\n return;\n }\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onRowClick?.(row);\n } else if (e.key === 'ArrowDown' || e.key === 'ArrowUp') {\n e.preventDefault();\n // Overscan keeps the neighbouring rows mounted.\n rowRefs.current.get(index + (e.key === 'ArrowDown' ? 1 : -1))?.focus();\n }\n },\n [onRowClick],\n );\n\n const rootCls = ['aegis-event-table', className ?? '']\n .filter(Boolean)\n .join(' ');\n\n const scrollStyle: CSSProperties = {\n maxHeight: `${(estimatedRowHeight * maxVisibleRows + headerHeight).toString()}px`,\n scrollPaddingTop: `${headerHeight.toString()}px`,\n };\n\n const showEmpty = !loading && data.length === 0;\n const develop = useDevelopAfterLoad(loading);\n const cellRole = clickable ? 'gridcell' : 'cell';\n\n return (\n <div\n className={rootCls}\n role={clickable ? 'grid' : 'table'}\n aria-rowcount={data.length + (showEmpty ? 2 : 1)}\n aria-busy={loading || undefined}\n >\n <div\n ref={scrollRef}\n className=\"aegis-event-table__scroll\"\n style={scrollStyle}\n onScroll={handleScroll}\n >\n <div\n ref={headerRef}\n className=\"aegis-event-table__header\"\n style={{ ...contentStyle, gridTemplateColumns: gridTemplate }}\n role=\"row\"\n aria-rowindex={1}\n >\n {columns.map((col) => (\n <div\n key={col.key}\n role=\"columnheader\"\n className={`aegis-event-table__th aegis-event-table__th--${columnAlign(col)}`}\n >\n {col.header}\n </div>\n ))}\n </div>\n\n <div data-aegis-develop={develop || undefined} style={contentStyle}>\n {loading ? (\n <div\n className=\"aegis-event-table__skeleton-list\"\n aria-hidden=\"true\"\n >\n {Array.from({ length: SKELETON_ROW_COUNT }).map((_, i) => (\n <div\n key={i}\n className=\"aegis-event-table__row aegis-event-table__row--skeleton\"\n style={{\n height: `${estimatedRowHeight.toString()}px`,\n gridTemplateColumns: gridTemplate,\n }}\n >\n {columns.map((c) => (\n <div key={c.key} className=\"aegis-event-table__td\">\n <Skeleton width=\"80%\" height=\"var(--space-3)\" />\n </div>\n ))}\n </div>\n ))}\n </div>\n ) : showEmpty ? (\n <div\n className=\"aegis-event-table__empty\"\n role=\"row\"\n aria-rowindex={2}\n >\n <div role={cellRole} aria-colspan={columns.length}>\n <EmptyState\n title={emptyTitle ?? strings.noEvents}\n description={emptyDescription}\n />\n </div>\n </div>\n ) : (\n <div\n className=\"aegis-event-table__virtual\"\n style={{\n height: `${virtualizer.getTotalSize().toString()}px`,\n }}\n >\n {virtualizer.getVirtualItems().map((vi) => {\n const row = data[vi.index];\n const key = rowKey(row);\n const rowCls = [\n 'aegis-event-table__row',\n clickable ? 'aegis-event-table__row--clickable' : '',\n selectedKey === key ? 'aegis-event-table__row--selected' : '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div\n key={key}\n ref={(el) => {\n if (el) {\n rowRefs.current.set(vi.index, el);\n } else {\n rowRefs.current.delete(vi.index);\n }\n }}\n role=\"row\"\n aria-rowindex={vi.index + 2}\n aria-selected={\n clickable && selectedKey !== undefined\n ? selectedKey === key\n : undefined\n }\n tabIndex={clickable ? 0 : undefined}\n className={rowCls}\n style={{\n transform: `translateY(${(vi.start - headerHeight).toString()}px)`,\n height: `${vi.size.toString()}px`,\n gridTemplateColumns: gridTemplate,\n }}\n onClick={\n onRowClick\n ? () => {\n onRowClick(row);\n }\n : undefined\n }\n onKeyDown={\n clickable\n ? (e) => {\n handleRowKeyDown(e, vi.index, row);\n }\n : undefined\n }\n >\n {columns.map((col) => {\n const truncate = col.truncate !== false;\n const cellCls = [\n 'aegis-event-table__td',\n `aegis-event-table__td--${columnAlign(col)}`,\n col.numeric ? 'aegis-event-table__td--numeric' : '',\n truncate ? 'aegis-event-table__td--truncate' : '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div key={col.key} role={cellRole} className={cellCls}>\n {col.render(row)}\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n )}\n </div>\n </div>\n </div>\n );\n}\n"],"names":["DEFAULT_ROW_HEIGHT","DEFAULT_MAX_VISIBLE_ROWS","DEFAULT_LOAD_MORE_THRESHOLD","LOAD_MORE_DEBOUNCE_MS","SKELETON_ROW_COUNT","OVERSCAN","FLEX_COLUMN_MIN_WIDTH","columnAlign","col","EventTable","columns","data","rowKey","onRowClick","selectedKey","loading","emptyTitle","emptyDescription","estimatedRowHeight","maxVisibleRows","onLoadMore","loadMoreThresholdPx","className","strings","useStrings","scrollRef","useRef","headerRef","rowRefs","headerHeight","setHeaderHeight","useState","clickable","useIsomorphicLayoutEffect","header","measure","observer","virtualizer","useVirtualizer","loadMoreFiredRef","loadMoreTimerRef","handleScroll","useCallback","el","useEffect","gridTemplate","useMemo","c","contentStyle","sum","handleRowKeyDown","index","row","rootCls","scrollStyle","showEmpty","develop","useDevelopAfterLoad","cellRole","jsx","jsxs","_","i","Skeleton","EmptyState","vi","key","rowCls","e","truncate","cellCls"],"mappings":"8ZA2EMA,EAAqB,GACrBC,EAA2B,GAC3BC,EAA8B,IAC9BC,EAAwB,GACxBC,EAAqB,EACrBC,EAAW,EACXC,GAAwB,IAE9B,SAASC,EAAeC,EAAuD,CAC7E,OAAOA,EAAI,QAAU,QAAWA,EAAI,OAAS,MAC/C,CAEO,SAASC,GAAc,CAC5B,QAAAC,EACA,KAAAC,EACA,OAAAC,EACA,WAAAC,EACA,YAAAC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