@lincyaw/aegis-ui 0.9.4 → 0.11.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/AskOverlay.cjs +3 -1
- package/dist/agent/ask/AskOverlay.cjs.map +1 -1
- package/dist/agent/ask/AskOverlay.d.ts +17 -1
- package/dist/agent/ask/AskOverlay.js +115 -58
- package/dist/agent/ask/AskOverlay.js.map +1 -1
- package/dist/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.d.ts +18 -3
- package/dist/agent/ask/AskPanel.js +147 -119
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/agent/chat/chat.cjs +1 -1
- package/dist/agent/chat/chat.cjs.map +1 -1
- package/dist/agent/chat/chat.d.ts +1 -1
- package/dist/agent/chat/chat.js +3 -5
- package/dist/agent/chat/chat.js.map +1 -1
- package/dist/agent/chat/useAgentChat.cjs +1 -1
- package/dist/agent/chat/useAgentChat.cjs.map +1 -1
- package/dist/agent/chat/useAgentChat.d.ts +2 -0
- package/dist/agent/chat/useAgentChat.js +8 -4
- package/dist/agent/chat/useAgentChat.js.map +1 -1
- package/dist/agent/core/AegisRuntimeProvider.cjs.map +1 -1
- package/dist/agent/core/AegisRuntimeProvider.d.ts +2 -2
- package/dist/agent/core/AegisRuntimeProvider.js.map +1 -1
- package/dist/agent/core/hooks.cjs +1 -1
- package/dist/agent/core/hooks.cjs.map +1 -1
- package/dist/agent/core/hooks.js +21 -20
- package/dist/agent/core/hooks.js.map +1 -1
- package/dist/agent/core/runtime.cjs +1 -1
- package/dist/agent/core/runtime.cjs.map +1 -1
- package/dist/agent/core/runtime.d.ts +28 -9
- package/dist/agent/core/runtime.js +435 -268
- package/dist/agent/core/runtime.js.map +1 -1
- package/dist/agent/core/types.d.ts +65 -10
- package/dist/agent/index.d.ts +4 -3
- package/dist/commands/CommandProvider.cjs +1 -1
- package/dist/commands/CommandProvider.cjs.map +1 -1
- package/dist/commands/CommandProvider.js +33 -37
- package/dist/commands/CommandProvider.js.map +1 -1
- package/dist/commands/commandContext.cjs +1 -1
- package/dist/commands/commandContext.cjs.map +1 -1
- package/dist/commands/commandContext.d.ts +6 -6
- package/dist/commands/commandContext.js +3 -17
- package/dist/commands/commandContext.js.map +1 -1
- package/dist/commands/index.d.ts +1 -1
- package/dist/commands/useCommands.cjs +1 -1
- package/dist/commands/useCommands.cjs.map +1 -1
- package/dist/commands/useCommands.d.ts +4 -2
- package/dist/commands/useCommands.js +21 -5
- package/dist/commands/useCommands.js.map +1 -1
- package/dist/commands/useRegisterCommands.cjs +2 -1
- package/dist/commands/useRegisterCommands.cjs.map +1 -1
- package/dist/commands/useRegisterCommands.d.ts +3 -2
- package/dist/commands/useRegisterCommands.js +35 -8
- package/dist/commands/useRegisterCommands.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/Alert.cjs +1 -1
- package/dist/components/ui/Alert.cjs.map +1 -1
- package/dist/components/ui/Alert.js +11 -11
- package/dist/components/ui/Alert.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 -2
- package/dist/components/ui/BlastRadiusBar.js +27 -20
- 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 +1 -1
- 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 +30 -29
- 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 +136 -157
- package/dist/components/ui/ChatSessionList.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 +7 -1
- package/dist/components/ui/Checkbox.js +26 -20
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/Chip.cjs +1 -1
- package/dist/components/ui/Chip.cjs.map +1 -1
- package/dist/components/ui/Chip.d.ts +6 -1
- package/dist/components/ui/Chip.js +20 -18
- package/dist/components/ui/Chip.js.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs +2 -0
- package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -0
- package/dist/components/ui/ChoiceCardGroup.d.ts +34 -0
- package/dist/components/ui/ChoiceCardGroup.js +56 -0
- package/dist/components/ui/ChoiceCardGroup.js.map +1 -0
- package/dist/components/ui/CodeBlock.cjs +2 -2
- package/dist/components/ui/CodeBlock.cjs.map +1 -1
- package/dist/components/ui/CodeBlock.js +31 -27
- package/dist/components/ui/CodeBlock.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 +15 -4
- package/dist/components/ui/CodeEditor.js +243 -70
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/Collapse.cjs +1 -1
- package/dist/components/ui/Collapse.cjs.map +1 -1
- package/dist/components/ui/Collapse.js +23 -23
- package/dist/components/ui/Collapse.js.map +1 -1
- package/dist/components/ui/ColumnChart.cjs +1 -1
- package/dist/components/ui/ColumnChart.cjs.map +1 -1
- package/dist/components/ui/ColumnChart.js +21 -20
- package/dist/components/ui/ColumnChart.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 +28 -31
- 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 +23 -1
- package/dist/components/ui/CommandPalette.js +146 -121
- package/dist/components/ui/CommandPalette.js.map +1 -1
- package/dist/components/ui/CommitGraph.cjs +2 -0
- package/dist/components/ui/CommitGraph.cjs.map +1 -0
- package/dist/components/ui/CommitGraph.d.ts +79 -0
- package/dist/components/ui/CommitGraph.js +383 -0
- package/dist/components/ui/CommitGraph.js.map +1 -0
- package/dist/components/ui/ContentInspectorDialog.cjs +1 -3
- package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.d.ts +4 -10
- package/dist/components/ui/ContentInspectorDialog.js +42 -201
- package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
- package/dist/components/ui/ContentPreview.cjs +3 -0
- package/dist/components/ui/ContentPreview.cjs.map +1 -0
- package/dist/components/ui/ContentPreview.d.ts +13 -0
- package/dist/components/ui/ContentPreview.js +133 -0
- package/dist/components/ui/ContentPreview.js.map +1 -0
- package/dist/components/ui/CopyGlyph.cjs +2 -0
- package/dist/components/ui/CopyGlyph.cjs.map +1 -0
- package/dist/components/ui/CopyGlyph.d.ts +7 -0
- package/dist/components/ui/CopyGlyph.js +48 -0
- package/dist/components/ui/CopyGlyph.js.map +1 -0
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +13 -12
- 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.d.ts +7 -1
- package/dist/components/ui/DataList.js +89 -33
- 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 +22 -18
- package/dist/components/ui/DataTable.js +279 -341
- package/dist/components/ui/DataTable.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 +8 -1
- package/dist/components/ui/DropdownMenu.js +63 -46
- 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/ErrorState.cjs +1 -1
- package/dist/components/ui/ErrorState.cjs.map +1 -1
- package/dist/components/ui/ErrorState.d.ts +1 -0
- package/dist/components/ui/ErrorState.js +1 -1
- package/dist/components/ui/ErrorState.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.d.ts +16 -2
- package/dist/components/ui/EventTable.js +198 -165
- 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.d.ts +3 -21
- package/dist/components/ui/FileDropzone.js +42 -67
- 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.d.ts +4 -1
- package/dist/components/ui/FilePreview.js +62 -60
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/FileTree.cjs +1 -1
- package/dist/components/ui/FileTree.cjs.map +1 -1
- package/dist/components/ui/FileTree.d.ts +18 -2
- package/dist/components/ui/FileTree.js +141 -110
- package/dist/components/ui/FileTree.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.d.ts +10 -1
- package/dist/components/ui/FolderDropzone.js +140 -130
- 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.d.ts +1 -0
- package/dist/components/ui/ForgotPasswordForm.js +23 -20
- 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 -2
- package/dist/components/ui/FormRow.js +33 -13
- package/dist/components/ui/FormRow.js.map +1 -1
- package/dist/components/ui/HeadlineStat.cjs +1 -1
- package/dist/components/ui/HeadlineStat.cjs.map +1 -1
- package/dist/components/ui/HeadlineStat.js +6 -5
- package/dist/components/ui/HeadlineStat.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 +25 -2
- package/dist/components/ui/InboxPage.js +93 -77
- package/dist/components/ui/InboxPage.js.map +1 -1
- package/dist/components/ui/KeyValueList.cjs +1 -1
- package/dist/components/ui/KeyValueList.cjs.map +1 -1
- package/dist/components/ui/KeyValueList.d.ts +6 -5
- package/dist/components/ui/KeyValueList.js +14 -17
- package/dist/components/ui/KeyValueList.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.d.ts +1 -0
- package/dist/components/ui/LoginForm.js +63 -55
- package/dist/components/ui/LoginForm.js.map +1 -1
- package/dist/components/ui/Markdown.cjs +1 -1
- package/dist/components/ui/Markdown.cjs.map +1 -1
- package/dist/components/ui/Markdown.d.ts +3 -2
- package/dist/components/ui/Markdown.js +57 -49
- package/dist/components/ui/Markdown.js.map +1 -1
- package/dist/components/ui/MdxDocument.cjs +1 -1
- package/dist/components/ui/MdxDocument.cjs.map +1 -1
- package/dist/components/ui/MdxDocument.d.ts +7 -2
- package/dist/components/ui/MdxDocument.js +34 -49
- package/dist/components/ui/MdxDocument.js.map +1 -1
- package/dist/components/ui/MetadataList.cjs +1 -1
- package/dist/components/ui/MetadataList.cjs.map +1 -1
- package/dist/components/ui/MetadataList.d.ts +7 -1
- package/dist/components/ui/MetadataList.js +29 -20
- package/dist/components/ui/MetadataList.js.map +1 -1
- package/dist/components/ui/MetricCard.cjs +1 -1
- package/dist/components/ui/MetricCard.cjs.map +1 -1
- package/dist/components/ui/MetricCard.js +16 -16
- package/dist/components/ui/MetricCard.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 +12 -1
- package/dist/components/ui/MonoValue.js +19 -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 +31 -3
- package/dist/components/ui/NotificationBell.js +127 -71
- package/dist/components/ui/NotificationBell.js.map +1 -1
- package/dist/components/ui/NumberField.cjs +2 -0
- package/dist/components/ui/NumberField.cjs.map +1 -0
- package/dist/components/ui/NumberField.d.ts +34 -0
- package/dist/components/ui/NumberField.js +80 -0
- package/dist/components/ui/NumberField.js.map +1 -0
- package/dist/components/ui/ObjectBrowser.cjs +1 -1
- package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
- package/dist/components/ui/ObjectBrowser.js +107 -94
- package/dist/components/ui/ObjectBrowser.js.map +1 -1
- package/dist/components/ui/ObjectInspector.cjs +1 -1
- package/dist/components/ui/ObjectInspector.cjs.map +1 -1
- package/dist/components/ui/ObjectInspector.d.ts +5 -0
- package/dist/components/ui/ObjectInspector.js +61 -69
- package/dist/components/ui/ObjectInspector.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.d.ts +3 -4
- package/dist/components/ui/PageSizeSelect.js +30 -29
- package/dist/components/ui/PageSizeSelect.js.map +1 -1
- package/dist/components/ui/Pagination.cjs +1 -1
- package/dist/components/ui/Pagination.cjs.map +1 -1
- package/dist/components/ui/Pagination.d.ts +16 -6
- package/dist/components/ui/Pagination.js +58 -45
- package/dist/components/ui/Pagination.js.map +1 -1
- package/dist/components/ui/Panel.cjs +1 -1
- package/dist/components/ui/Panel.cjs.map +1 -1
- package/dist/components/ui/Panel.d.ts +17 -4
- package/dist/components/ui/Panel.js +53 -40
- package/dist/components/ui/Panel.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.d.ts +1 -1
- package/dist/components/ui/ParquetViewer.js +121 -120
- 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 +39 -36
- 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 +7 -1
- package/dist/components/ui/QueryAutocomplete.js +150 -127
- package/dist/components/ui/QueryAutocomplete.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.d.ts +1 -0
- package/dist/components/ui/RegisterForm.js +52 -43
- package/dist/components/ui/RegisterForm.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/RollingValue.cjs +2 -0
- package/dist/components/ui/RollingValue.cjs.map +1 -0
- package/dist/components/ui/RollingValue.d.ts +14 -0
- package/dist/components/ui/RollingValue.js +39 -0
- package/dist/components/ui/RollingValue.js.map +1 -0
- package/dist/components/ui/SavedQueryBar.cjs +1 -1
- package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
- package/dist/components/ui/SavedQueryBar.d.ts +9 -3
- package/dist/components/ui/SavedQueryBar.js +390 -291
- package/dist/components/ui/SavedQueryBar.js.map +1 -1
- package/dist/components/ui/ScrollStory.cjs +1 -2
- package/dist/components/ui/ScrollStory.cjs.map +1 -1
- package/dist/components/ui/ScrollStory.js +57 -75
- package/dist/components/ui/ScrollStory.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 +4 -2
- package/dist/components/ui/Select.js +34 -31
- 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 +57 -2
- package/dist/components/ui/ServiceMap.js +374 -117
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/ShareLinkDialog.cjs +1 -1
- package/dist/components/ui/ShareLinkDialog.cjs.map +1 -1
- package/dist/components/ui/ShareLinkDialog.d.ts +5 -3
- package/dist/components/ui/ShareLinkDialog.js +107 -98
- package/dist/components/ui/ShareLinkDialog.js.map +1 -1
- package/dist/components/ui/Slider.cjs +2 -0
- package/dist/components/ui/Slider.cjs.map +1 -0
- package/dist/components/ui/Slider.d.ts +24 -0
- package/dist/components/ui/Slider.js +55 -0
- package/dist/components/ui/Slider.js.map +1 -0
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.d.ts +4 -1
- package/dist/components/ui/SparkLine.js +29 -23
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/StatBlock.cjs +1 -1
- package/dist/components/ui/StatBlock.cjs.map +1 -1
- package/dist/components/ui/StatBlock.js +17 -16
- package/dist/components/ui/StatBlock.js.map +1 -1
- package/dist/components/ui/StatusDot.cjs.map +1 -1
- package/dist/components/ui/StatusDot.d.ts +5 -1
- package/dist/components/ui/StatusDot.js.map +1 -1
- package/dist/components/ui/Steps.cjs +2 -0
- package/dist/components/ui/Steps.cjs.map +1 -0
- package/dist/components/ui/Steps.d.ts +19 -0
- package/dist/components/ui/Steps.js +53 -0
- package/dist/components/ui/Steps.js.map +1 -0
- package/dist/components/ui/TableOfContents.cjs +1 -1
- package/dist/components/ui/TableOfContents.cjs.map +1 -1
- package/dist/components/ui/TableOfContents.d.ts +3 -3
- package/dist/components/ui/TableOfContents.js +47 -28
- 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.d.ts +37 -3
- package/dist/components/ui/Tabs.js +169 -109
- 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 +19 -18
- 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.d.ts +14 -4
- package/dist/components/ui/TimeDisplay.js +43 -44
- 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.js +128 -111
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/TimelineChart.cjs +2 -1
- package/dist/components/ui/TimelineChart.cjs.map +1 -1
- package/dist/components/ui/TimelineChart.d.ts +1 -0
- package/dist/components/ui/TimelineChart.js +221 -169
- package/dist/components/ui/TimelineChart.js.map +1 -1
- package/dist/components/ui/ToolCallCard.cjs +1 -1
- package/dist/components/ui/ToolCallCard.cjs.map +1 -1
- package/dist/components/ui/ToolCallCard.js +22 -22
- package/dist/components/ui/ToolCallCard.js.map +1 -1
- package/dist/components/ui/Toolbar.cjs +1 -1
- package/dist/components/ui/Toolbar.cjs.map +1 -1
- package/dist/components/ui/Toolbar.d.ts +4 -16
- package/dist/components/ui/Toolbar.js +8 -62
- package/dist/components/ui/Toolbar.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 +94 -76
- 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 +36 -2
- package/dist/components/ui/TraceTree.js +278 -170
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/TrajectoryStep.cjs +1 -1
- package/dist/components/ui/TrajectoryStep.cjs.map +1 -1
- package/dist/components/ui/TrajectoryStep.js +39 -43
- package/dist/components/ui/TrajectoryStep.js.map +1 -1
- package/dist/components/ui/TrajectoryTimeline.cjs +1 -1
- package/dist/components/ui/TrajectoryTimeline.cjs.map +1 -1
- package/dist/components/ui/TrajectoryTimeline.js +31 -28
- package/dist/components/ui/TrajectoryTimeline.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.d.ts +18 -2
- package/dist/components/ui/UploadQueue.js +53 -71
- package/dist/components/ui/UploadQueue.js.map +1 -1
- package/dist/components/ui/authValidation.cjs +2 -0
- package/dist/components/ui/authValidation.cjs.map +1 -0
- package/dist/components/ui/authValidation.d.ts +3 -0
- package/dist/components/ui/authValidation.js +8 -0
- package/dist/components/ui/authValidation.js.map +1 -0
- package/dist/components/ui/classifyContent.cjs +6 -0
- package/dist/components/ui/classifyContent.cjs.map +1 -0
- package/dist/components/ui/classifyContent.d.ts +40 -0
- package/dist/components/ui/classifyContent.js +167 -0
- package/dist/components/ui/classifyContent.js.map +1 -0
- package/dist/components/ui/dropFiles.cjs +2 -0
- package/dist/components/ui/dropFiles.cjs.map +1 -0
- package/dist/components/ui/dropFiles.d.ts +7 -0
- package/dist/components/ui/dropFiles.js +16 -0
- package/dist/components/ui/dropFiles.js.map +1 -0
- package/dist/components/ui/index.d.ts +23 -10
- package/dist/components/ui/linkComponent.cjs +1 -1
- package/dist/components/ui/linkComponent.cjs.map +1 -1
- package/dist/components/ui/linkComponent.d.ts +4 -2
- package/dist/components/ui/linkComponent.js +15 -5
- package/dist/components/ui/linkComponent.js.map +1 -1
- package/dist/components/ui/markdownDocument.cjs +2 -0
- package/dist/components/ui/markdownDocument.cjs.map +1 -0
- package/dist/components/ui/markdownDocument.d.ts +40 -0
- package/dist/components/ui/markdownDocument.js +39 -0
- package/dist/components/ui/markdownDocument.js.map +1 -0
- 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/traceStatus.cjs +2 -0
- package/dist/components/ui/traceStatus.cjs.map +1 -0
- package/dist/components/ui/{traceFormat.d.ts → traceStatus.d.ts} +0 -1
- package/dist/components/ui/traceStatus.js +7 -0
- package/dist/components/ui/traceStatus.js.map +1 -0
- package/dist/components/ui/useColumnWidths.cjs +2 -0
- package/dist/components/ui/useColumnWidths.cjs.map +1 -0
- package/dist/components/ui/useColumnWidths.d.ts +60 -0
- package/dist/components/ui/useColumnWidths.js +196 -0
- package/dist/components/ui/useColumnWidths.js.map +1 -0
- 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/useDevelopAfterLoad.cjs +2 -0
- package/dist/hooks/useDevelopAfterLoad.cjs.map +1 -0
- package/dist/hooks/useDevelopAfterLoad.d.ts +8 -0
- package/dist/hooks/useDevelopAfterLoad.js +9 -0
- package/dist/hooks/useDevelopAfterLoad.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/useResizable.cjs +1 -1
- package/dist/hooks/useResizable.cjs.map +1 -1
- package/dist/hooks/useResizable.js +87 -78
- package/dist/hooks/useResizable.js.map +1 -1
- package/dist/hooks/useSavedQueries.cjs +1 -1
- package/dist/hooks/useSavedQueries.cjs.map +1 -1
- package/dist/hooks/useSavedQueries.d.ts +6 -0
- package/dist/hooks/useSavedQueries.js +52 -60
- package/dist/hooks/useSavedQueries.js.map +1 -1
- package/dist/hooks/useSectionSpy.cjs +1 -1
- package/dist/hooks/useSectionSpy.cjs.map +1 -1
- package/dist/hooks/useSectionSpy.d.ts +6 -1
- package/dist/hooks/useSectionSpy.js +87 -57
- package/dist/hooks/useSectionSpy.js.map +1 -1
- package/dist/hooks/useStorageItem.cjs +2 -0
- package/dist/hooks/useStorageItem.cjs.map +1 -0
- package/dist/hooks/useStorageItem.d.ts +6 -0
- package/dist/hooks/useStorageItem.js +36 -0
- package/dist/hooks/useStorageItem.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.js +321 -313
- package/dist/index.js.map +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.d.ts +4 -2
- package/dist/layouts/shell/AegisShell.js +150 -243
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/AppRoutes.cjs +2 -0
- package/dist/layouts/shell/AppRoutes.cjs.map +1 -0
- package/dist/layouts/shell/AppRoutes.d.ts +5 -0
- package/dist/layouts/shell/AppRoutes.js +8 -0
- package/dist/layouts/shell/AppRoutes.js.map +1 -0
- 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/BreadcrumbBar.cjs +1 -1
- package/dist/layouts/shell/BreadcrumbBar.cjs.map +1 -1
- package/dist/layouts/shell/BreadcrumbBar.d.ts +1 -2
- package/dist/layouts/shell/BreadcrumbBar.js +19 -26
- package/dist/layouts/shell/BreadcrumbBar.js.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs +2 -0
- package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -0
- package/dist/layouts/shell/RouteErrorBoundary.d.ts +26 -0
- package/dist/layouts/shell/RouteErrorBoundary.js +40 -0
- package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -0
- package/dist/layouts/shell/RouterLink.cjs +2 -0
- package/dist/layouts/shell/RouterLink.cjs.map +1 -0
- package/dist/layouts/shell/RouterLink.d.ts +3 -0
- package/dist/layouts/shell/RouterLink.js +22 -0
- package/dist/layouts/shell/RouterLink.js.map +1 -0
- package/dist/layouts/shell/ShellCommandPalette.cjs +2 -0
- package/dist/layouts/shell/ShellCommandPalette.cjs.map +1 -0
- package/dist/layouts/shell/ShellCommandPalette.d.ts +7 -0
- package/dist/layouts/shell/ShellCommandPalette.js +32 -0
- package/dist/layouts/shell/ShellCommandPalette.js.map +1 -0
- package/dist/layouts/shell/ShellInboxPage.cjs +2 -0
- package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -0
- package/dist/layouts/shell/ShellInboxPage.d.ts +12 -0
- package/dist/layouts/shell/ShellInboxPage.js +33 -0
- package/dist/layouts/shell/ShellInboxPage.js.map +1 -0
- package/dist/layouts/shell/ShellNotificationBell.cjs +2 -0
- package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -0
- package/dist/layouts/shell/ShellNotificationBell.d.ts +5 -0
- package/dist/layouts/shell/ShellNotificationBell.js +30 -0
- package/dist/layouts/shell/ShellNotificationBell.js.map +1 -0
- package/dist/layouts/shell/Sidebar.cjs +1 -1
- package/dist/layouts/shell/Sidebar.cjs.map +1 -1
- package/dist/layouts/shell/Sidebar.d.ts +4 -2
- package/dist/layouts/shell/Sidebar.js +14 -11
- package/dist/layouts/shell/Sidebar.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.d.ts +6 -2
- package/dist/layouts/shell/TopHeader.js +87 -75
- package/dist/layouts/shell/TopHeader.js.map +1 -1
- package/dist/layouts/shell/apps.cjs +2 -0
- package/dist/layouts/shell/apps.cjs.map +1 -0
- package/dist/layouts/shell/apps.d.ts +12 -0
- package/dist/layouts/shell/apps.js +34 -0
- package/dist/layouts/shell/apps.js.map +1 -0
- package/dist/layouts/shell/buildRouteTree.cjs +2 -0
- package/dist/layouts/shell/buildRouteTree.cjs.map +1 -0
- package/dist/layouts/shell/buildRouteTree.d.ts +22 -0
- package/dist/layouts/shell/buildRouteTree.js +49 -0
- package/dist/layouts/shell/buildRouteTree.js.map +1 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.cjs +2 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.cjs.map +1 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.d.ts +13 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.js +90 -0
- package/dist/layouts/shell/environments/EnvironmentProvider.js.map +1 -0
- package/dist/layouts/shell/environments/{context.cjs → environmentContext.cjs} +2 -2
- package/dist/layouts/shell/environments/environmentContext.cjs.map +1 -0
- package/dist/layouts/shell/environments/environmentContext.d.ts +6 -0
- package/dist/layouts/shell/environments/environmentContext.js +8 -0
- package/dist/layouts/shell/environments/environmentContext.js.map +1 -0
- package/dist/layouts/shell/environments/index.d.ts +2 -3
- package/dist/layouts/shell/environments/types.cjs.map +1 -1
- package/dist/layouts/shell/environments/types.d.ts +23 -15
- package/dist/layouts/shell/environments/types.js.map +1 -1
- package/dist/layouts/shell/environments/useEnvironment.cjs +2 -0
- package/dist/layouts/shell/environments/useEnvironment.cjs.map +1 -0
- package/dist/layouts/shell/environments/{hooks.d.ts → useEnvironment.d.ts} +3 -2
- package/dist/layouts/shell/environments/useEnvironment.js +25 -0
- package/dist/layouts/shell/environments/useEnvironment.js.map +1 -0
- package/dist/layouts/shell/index.d.ts +3 -1
- package/dist/layouts/shell/types.d.ts +14 -14
- package/dist/layouts/shell/useAgentPanel.cjs +2 -0
- package/dist/layouts/shell/useAgentPanel.cjs.map +1 -0
- package/dist/layouts/shell/useAgentPanel.d.ts +13 -0
- package/dist/layouts/shell/useAgentPanel.js +21 -0
- package/dist/layouts/shell/useAgentPanel.js.map +1 -0
- package/dist/layouts/shell/useAppCommands.cjs +2 -0
- package/dist/layouts/shell/useAppCommands.cjs.map +1 -0
- package/dist/layouts/shell/useAppCommands.d.ts +6 -0
- package/dist/layouts/shell/useAppCommands.js +19 -0
- package/dist/layouts/shell/useAppCommands.js.map +1 -0
- package/dist/layouts/shell/useMobileNav.cjs +2 -0
- package/dist/layouts/shell/useMobileNav.cjs.map +1 -0
- package/dist/layouts/shell/useMobileNav.d.ts +20 -0
- package/dist/layouts/shell/useMobileNav.js +54 -0
- package/dist/layouts/shell/useMobileNav.js.map +1 -0
- package/dist/layouts/shell/useOpenNotification.cjs +2 -0
- package/dist/layouts/shell/useOpenNotification.cjs.map +1 -0
- package/dist/layouts/shell/useOpenNotification.d.ts +3 -0
- package/dist/layouts/shell/useOpenNotification.js +16 -0
- package/dist/layouts/shell/useOpenNotification.js.map +1 -0
- package/dist/layouts/shell/useShellUser.cjs +2 -0
- package/dist/layouts/shell/useShellUser.cjs.map +1 -0
- package/dist/layouts/shell/useShellUser.d.ts +7 -0
- package/dist/layouts/shell/useShellUser.js +23 -0
- package/dist/layouts/shell/useShellUser.js.map +1 -0
- package/dist/layouts/shell/useWarnOnce.cjs +2 -0
- package/dist/layouts/shell/useWarnOnce.cjs.map +1 -0
- package/dist/layouts/shell/useWarnOnce.d.ts +1 -0
- package/dist/layouts/shell/useWarnOnce.js +11 -0
- package/dist/layouts/shell/useWarnOnce.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/format.cjs +1 -1
- package/dist/lib/format.cjs.map +1 -1
- package/dist/lib/format.d.ts +34 -0
- package/dist/lib/format.js +98 -9
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/luceneQuery/tokenizeAtCursor.cjs +1 -1
- package/dist/lib/luceneQuery/tokenizeAtCursor.cjs.map +1 -1
- package/dist/lib/luceneQuery/tokenizeAtCursor.js +29 -29
- package/dist/lib/luceneQuery/tokenizeAtCursor.js.map +1 -1
- package/dist/lib/storage.cjs +1 -1
- package/dist/lib/storage.cjs.map +1 -1
- package/dist/lib/storage.js +19 -12
- package/dist/lib/storage.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 +43 -39
- 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 +243 -2
- package/dist/locale/strings.js +545 -26
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +15 -0
- package/dist/notifications/notificationContext.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/ThemeProvider.cjs +1 -1
- package/dist/theme/ThemeProvider.cjs.map +1 -1
- package/dist/theme/ThemeProvider.d.ts +2 -1
- package/dist/theme/ThemeProvider.js +47 -33
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.d.ts +0 -2
- package/dist/theme/antdTheme.js +28 -20
- 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.d.ts +1 -0
- package/dist/transports/agentm/AgentmChannelProvider.js +119 -131
- package/dist/transports/agentm/AgentmChannelProvider.js.map +1 -1
- package/dist/transports/agentm/agentmChannelClient.cjs +1 -1
- package/dist/transports/agentm/agentmChannelClient.cjs.map +1 -1
- package/dist/transports/agentm/agentmChannelClient.d.ts +8 -3
- package/dist/transports/agentm/agentmChannelClient.js +133 -89
- package/dist/transports/agentm/agentmChannelClient.js.map +1 -1
- package/dist/transports/index.d.ts +2 -2
- package/dist/transports/mcpBridge.cjs +2 -0
- package/dist/transports/mcpBridge.cjs.map +1 -0
- package/dist/transports/{bridge.d.ts → mcpBridge.d.ts} +2 -1
- package/dist/transports/mcpBridge.js +144 -0
- package/dist/transports/mcpBridge.js.map +1 -0
- package/dist/transports/mcpTools.cjs +2 -0
- package/dist/transports/mcpTools.cjs.map +1 -0
- package/dist/transports/mcpTools.d.ts +15 -0
- package/dist/transports/mcpTools.js +283 -0
- package/dist/transports/mcpTools.js.map +1 -0
- package/dist/transports.cjs +1 -1
- package/dist/transports.js +1 -1
- package/package.json +5 -4
- package/dist/agent/core/mcpToolCatalogue.cjs +0 -2
- package/dist/agent/core/mcpToolCatalogue.cjs.map +0 -1
- package/dist/agent/core/mcpToolCatalogue.d.ts +0 -2
- package/dist/agent/core/mcpToolCatalogue.js +0 -101
- package/dist/agent/core/mcpToolCatalogue.js.map +0 -1
- package/dist/components/ui/BucketCard.cjs +0 -2
- package/dist/components/ui/BucketCard.cjs.map +0 -1
- package/dist/components/ui/BucketCard.d.ts +0 -24
- package/dist/components/ui/BucketCard.js +0 -73
- package/dist/components/ui/BucketCard.js.map +0 -1
- package/dist/components/ui/ContentInspectorContent.cjs +0 -5
- package/dist/components/ui/ContentInspectorContent.cjs.map +0 -1
- package/dist/components/ui/ContentInspectorContent.d.ts +0 -14
- package/dist/components/ui/ContentInspectorContent.js +0 -101
- package/dist/components/ui/ContentInspectorContent.js.map +0 -1
- package/dist/components/ui/traceFormat.cjs +0 -2
- package/dist/components/ui/traceFormat.cjs.map +0 -1
- package/dist/components/ui/traceFormat.js +0 -11
- package/dist/components/ui/traceFormat.js.map +0 -1
- package/dist/layouts/shell/environments/EnvironmentContext.cjs +0 -2
- package/dist/layouts/shell/environments/EnvironmentContext.cjs.map +0 -1
- package/dist/layouts/shell/environments/EnvironmentContext.d.ts +0 -12
- package/dist/layouts/shell/environments/EnvironmentContext.js +0 -94
- package/dist/layouts/shell/environments/EnvironmentContext.js.map +0 -1
- package/dist/layouts/shell/environments/context.cjs.map +0 -1
- package/dist/layouts/shell/environments/context.d.ts +0 -6
- package/dist/layouts/shell/environments/context.js +0 -6
- package/dist/layouts/shell/environments/context.js.map +0 -1
- package/dist/layouts/shell/environments/hooks.cjs +0 -2
- package/dist/layouts/shell/environments/hooks.cjs.map +0 -1
- package/dist/layouts/shell/environments/hooks.js +0 -24
- package/dist/layouts/shell/environments/hooks.js.map +0 -1
- package/dist/layouts/shell/environments/manifest.cjs +0 -2
- package/dist/layouts/shell/environments/manifest.cjs.map +0 -1
- package/dist/layouts/shell/environments/manifest.d.ts +0 -26
- package/dist/layouts/shell/environments/manifest.js +0 -82
- package/dist/layouts/shell/environments/manifest.js.map +0 -1
- package/dist/transports/bridge.cjs +0 -2
- package/dist/transports/bridge.cjs.map +0 -1
- package/dist/transports/bridge.js +0 -143
- package/dist/transports/bridge.js.map +0 -1
|
@@ -1,147 +1,172 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import {
|
|
1
|
+
import { jsxs as p, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as x, useRef as R, useId as W, useEffect as O, useMemo as S } from "react";
|
|
3
|
+
import { SearchOutlined as B } from "@ant-design/icons";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
function
|
|
9
|
-
if (!
|
|
5
|
+
import { Dialog as F } from "./Dialog.js";
|
|
6
|
+
import { useStrings as K } from "../../locale/useStrings.js";
|
|
7
|
+
import { formatShortcut as Q } from "../../commands/shortcut.js";
|
|
8
|
+
function V(s, c) {
|
|
9
|
+
if (!c)
|
|
10
10
|
return 1;
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
const i = c.toLowerCase(), r = s.label.toLowerCase();
|
|
12
|
+
return r.startsWith(i) ? 4 : r.includes(i) ? 3 : s.keywords?.some((l) => l.toLowerCase().includes(i)) ? 2 : s.description?.toLowerCase().includes(i) ? 1 : 0;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
const
|
|
16
|
-
|
|
14
|
+
function X(s, c, i, r) {
|
|
15
|
+
const l = s.map((e) => ({ cmd: e, score: V(e, c.trim()) })).filter((e) => e.score > 0).sort(
|
|
16
|
+
(e, o) => o.score - e.score || e.cmd.label.localeCompare(o.cmd.label)
|
|
17
|
+
), f = /* @__PURE__ */ new Map();
|
|
18
|
+
for (const { cmd: e } of l) {
|
|
19
|
+
const o = e.group ?? r, h = f.get(o) ?? [];
|
|
20
|
+
h.push(e), f.set(o, h);
|
|
21
|
+
}
|
|
22
|
+
const _ = (e) => {
|
|
23
|
+
const o = i.indexOf(e);
|
|
24
|
+
return o !== -1 ? o : e === r ? Number.MAX_SAFE_INTEGER : i.length;
|
|
25
|
+
};
|
|
26
|
+
return Array.from(f.entries()).sort(([e], [o]) => _(e) - _(o) || e.localeCompare(o)).map(([e, o]) => ({ label: e, commands: o }));
|
|
17
27
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}, D = (e) => i.findIndex((n) => n.id === e.id);
|
|
60
|
-
return /* @__PURE__ */ u(
|
|
61
|
-
"div",
|
|
28
|
+
const z = [];
|
|
29
|
+
function se({
|
|
30
|
+
open: s,
|
|
31
|
+
commands: c,
|
|
32
|
+
onSelect: i,
|
|
33
|
+
onClose: r,
|
|
34
|
+
groupOrder: l = z,
|
|
35
|
+
title: f,
|
|
36
|
+
placeholder: _
|
|
37
|
+
}) {
|
|
38
|
+
const e = K(), o = f ?? e.commandPaletteTitle, h = _ ?? e.commandPalettePlaceholder, [b, C] = x(""), [$, g] = x(0), [G, L] = x(s);
|
|
39
|
+
s !== G && (L(s), s && (C(""), g(0)));
|
|
40
|
+
const I = R(null), D = R(null), N = W(), M = `${N}-list`, A = (t) => `${N}-option-${t}`;
|
|
41
|
+
O(() => {
|
|
42
|
+
s && I.current?.focus();
|
|
43
|
+
}, [s]);
|
|
44
|
+
const E = e.commandGroupOther, w = S(
|
|
45
|
+
() => X(c, b, l, E),
|
|
46
|
+
[c, b, l, E]
|
|
47
|
+
), d = S(() => w.flatMap((t) => t.commands), [w]), j = d.some((t) => !!t.icon), m = d.length === 0 ? -1 : Math.min($, d.length - 1);
|
|
48
|
+
O(() => {
|
|
49
|
+
D.current?.querySelector('[aria-selected="true"]')?.scrollIntoView({ block: "nearest" });
|
|
50
|
+
}, [m]);
|
|
51
|
+
const P = (t) => {
|
|
52
|
+
r(), i(t);
|
|
53
|
+
}, q = (t) => {
|
|
54
|
+
if (!t.nativeEvent.isComposing)
|
|
55
|
+
if (t.key === "ArrowDown" || t.key === "ArrowUp") {
|
|
56
|
+
t.preventDefault();
|
|
57
|
+
const u = d.length;
|
|
58
|
+
if (u > 0) {
|
|
59
|
+
const k = t.key === "ArrowDown" ? 1 : -1;
|
|
60
|
+
g(
|
|
61
|
+
(a) => (Math.min(a, u - 1) + k + u) % u
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
} else t.key === "Enter" && m >= 0 && (t.preventDefault(), P(d[m]));
|
|
65
|
+
};
|
|
66
|
+
let T = 0;
|
|
67
|
+
return /* @__PURE__ */ p(
|
|
68
|
+
F,
|
|
62
69
|
{
|
|
70
|
+
open: s,
|
|
71
|
+
title: o,
|
|
72
|
+
onClose: r,
|
|
73
|
+
width: "lg",
|
|
63
74
|
className: "aegis-cmdk",
|
|
64
|
-
role: "dialog",
|
|
65
|
-
"aria-modal": "true",
|
|
66
|
-
"aria-label": "Command palette",
|
|
67
75
|
children: [
|
|
68
|
-
/* @__PURE__ */
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
type: "button",
|
|
72
|
-
className: "aegis-cmdk__backdrop",
|
|
73
|
-
"aria-label": "Close command palette",
|
|
74
|
-
onClick: y
|
|
75
|
-
}
|
|
76
|
-
),
|
|
77
|
-
/* @__PURE__ */ u("div", { className: "aegis-cmdk__card", children: [
|
|
78
|
-
/* @__PURE__ */ s("div", { className: "aegis-cmdk__input-row", children: /* @__PURE__ */ s(
|
|
76
|
+
/* @__PURE__ */ p("div", { className: "aegis-cmdk__field", children: [
|
|
77
|
+
/* @__PURE__ */ n(B, { className: "aegis-cmdk__field-icon", "aria-hidden": !0 }),
|
|
78
|
+
/* @__PURE__ */ n(
|
|
79
79
|
"input",
|
|
80
80
|
{
|
|
81
|
-
ref:
|
|
81
|
+
ref: I,
|
|
82
82
|
className: "aegis-cmdk__input",
|
|
83
83
|
type: "text",
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
"aria-
|
|
84
|
+
role: "combobox",
|
|
85
|
+
"aria-expanded": !0,
|
|
86
|
+
"aria-controls": M,
|
|
87
|
+
"aria-autocomplete": "list",
|
|
88
|
+
"aria-activedescendant": m >= 0 ? A(m) : void 0,
|
|
89
|
+
"aria-label": h,
|
|
90
|
+
placeholder: h,
|
|
91
|
+
value: b,
|
|
92
|
+
onChange: (t) => {
|
|
93
|
+
C(t.target.value), g(0);
|
|
94
|
+
},
|
|
95
|
+
onKeyDown: q,
|
|
89
96
|
autoComplete: "off",
|
|
90
97
|
spellCheck: !1
|
|
91
98
|
}
|
|
92
|
-
)
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ p("div", { className: "aegis-cmdk__results", children: [
|
|
102
|
+
/* @__PURE__ */ n(
|
|
103
|
+
"div",
|
|
104
|
+
{
|
|
105
|
+
ref: D,
|
|
106
|
+
id: M,
|
|
107
|
+
className: "aegis-cmdk__list",
|
|
108
|
+
role: "listbox",
|
|
109
|
+
"aria-label": o,
|
|
110
|
+
children: w.map((t, u) => {
|
|
111
|
+
const k = `${N}-group-${u}`;
|
|
112
|
+
return /* @__PURE__ */ p(
|
|
113
|
+
"div",
|
|
103
114
|
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
115
|
+
className: "aegis-cmdk__group",
|
|
116
|
+
role: "group",
|
|
117
|
+
"aria-labelledby": k,
|
|
118
|
+
children: [
|
|
119
|
+
/* @__PURE__ */ n(
|
|
120
|
+
"div",
|
|
121
|
+
{
|
|
122
|
+
id: k,
|
|
123
|
+
className: "aegis-cmdk__group-label",
|
|
124
|
+
role: "presentation",
|
|
125
|
+
children: t.label
|
|
126
|
+
}
|
|
127
|
+
),
|
|
128
|
+
t.commands.map((a) => {
|
|
129
|
+
const v = T++, y = v === m;
|
|
130
|
+
return /* @__PURE__ */ p(
|
|
131
|
+
"div",
|
|
132
|
+
{
|
|
133
|
+
id: A(v),
|
|
134
|
+
className: y ? "aegis-cmdk__option aegis-cmdk__option--active" : "aegis-cmdk__option",
|
|
135
|
+
role: "option",
|
|
136
|
+
"aria-selected": y,
|
|
137
|
+
tabIndex: -1,
|
|
138
|
+
onMouseDown: (U) => {
|
|
139
|
+
U.preventDefault(), P(a);
|
|
140
|
+
},
|
|
141
|
+
onMouseMove: () => {
|
|
142
|
+
y || g(v);
|
|
143
|
+
},
|
|
144
|
+
children: [
|
|
145
|
+
j && /* @__PURE__ */ n("span", { className: "aegis-cmdk__option-icon", "aria-hidden": !0, children: a.icon }),
|
|
146
|
+
/* @__PURE__ */ p("span", { className: "aegis-cmdk__option-body", children: [
|
|
147
|
+
/* @__PURE__ */ n("span", { className: "aegis-cmdk__option-label", children: a.label }),
|
|
148
|
+
a.description && /* @__PURE__ */ n("span", { className: "aegis-cmdk__option-desc", children: a.description })
|
|
149
|
+
] }),
|
|
150
|
+
a.shortcut && /* @__PURE__ */ n("kbd", { className: "aegis-cmdk__option-shortcut", children: Q(a.shortcut) })
|
|
151
|
+
]
|
|
152
|
+
},
|
|
153
|
+
a.id
|
|
154
|
+
);
|
|
155
|
+
})
|
|
156
|
+
]
|
|
108
157
|
},
|
|
109
|
-
|
|
158
|
+
t.label
|
|
110
159
|
);
|
|
111
160
|
})
|
|
112
|
-
|
|
113
|
-
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
d.length === 0 && /* @__PURE__ */ n("p", { className: "aegis-cmdk__empty", role: "status", children: e.commandPaletteEmpty })
|
|
114
164
|
] })
|
|
115
165
|
]
|
|
116
166
|
}
|
|
117
167
|
);
|
|
118
168
|
}
|
|
119
|
-
function I({
|
|
120
|
-
cmd: t,
|
|
121
|
-
active: o,
|
|
122
|
-
onSelect: a,
|
|
123
|
-
onHover: l
|
|
124
|
-
}) {
|
|
125
|
-
return L(t.action), /* @__PURE__ */ u(
|
|
126
|
-
"button",
|
|
127
|
-
{
|
|
128
|
-
type: "button",
|
|
129
|
-
className: ["aegis-cmdk__row", o ? "aegis-cmdk__row--active" : ""].filter(Boolean).join(" "),
|
|
130
|
-
onClick: a,
|
|
131
|
-
onMouseEnter: l,
|
|
132
|
-
"data-agent-action-id": t.action?.id,
|
|
133
|
-
children: [
|
|
134
|
-
t.icon && /* @__PURE__ */ s("span", { className: "aegis-cmdk__row-icon", children: t.icon }),
|
|
135
|
-
/* @__PURE__ */ u("span", { className: "aegis-cmdk__row-body", children: [
|
|
136
|
-
/* @__PURE__ */ s("span", { className: "aegis-cmdk__row-label", children: t.label }),
|
|
137
|
-
t.description && /* @__PURE__ */ s("span", { className: "aegis-cmdk__row-desc", children: t.description })
|
|
138
|
-
] }),
|
|
139
|
-
t.shortcut && /* @__PURE__ */ s("span", { className: "aegis-cmdk__row-shortcut", children: E(t.shortcut) })
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
169
|
export {
|
|
145
|
-
|
|
170
|
+
se as CommandPalette
|
|
146
171
|
};
|
|
147
172
|
//# sourceMappingURL=CommandPalette.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CommandPalette.js","sources":["../../../src/components/ui/CommandPalette.tsx"],"sourcesContent":["import {\n type ReactElement,\n type KeyboardEvent as ReactKeyboardEvent,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { useAegisAction } from '../../agent/core/hooks';\nimport { type Command, formatShortcut, useCommands } from '../../commands';\nimport './CommandPalette.css';\n\ninterface ScoredCommand {\n cmd: Command;\n score: number;\n}\n\nconst OTHER_GROUP = 'Other';\n\nfunction scoreCommand(cmd: Command, query: string): number {\n if (!query) {\n return 1;\n }\n const q = query.toLowerCase();\n const label = cmd.label.toLowerCase();\n if (label.startsWith(q)) {\n return 4;\n }\n if (label.includes(q)) {\n return 3;\n }\n if (cmd.keywords?.some((k) => k.toLowerCase().includes(q))) {\n return 2;\n }\n if (cmd.description?.toLowerCase().includes(q)) {\n return 1;\n }\n return 0;\n}\n\nfunction groupOrder(a: string, b: string): number {\n const aQuick = a.toLowerCase().includes('quick');\n const bQuick = b.toLowerCase().includes('quick');\n if (aQuick && !bQuick) {\n return -1;\n }\n if (bQuick && !aQuick) {\n return 1;\n }\n if (a === OTHER_GROUP && b !== OTHER_GROUP) {\n return 1;\n }\n if (b === OTHER_GROUP && a !== OTHER_GROUP) {\n return -1;\n }\n return a.localeCompare(b);\n}\n\nexport function CommandPalette(): ReactElement | null {\n const { commands, paletteOpen, setPaletteOpen, execute } = useCommands();\n const [query, setQuery] = useState('');\n const [selectedIndex, setSelectedIndex] = useState(0);\n const inputRef = useRef<HTMLInputElement>(null);\n\n useEffect(() => {\n if (paletteOpen) {\n setQuery('');\n setSelectedIndex(0);\n // Focus after the modal mounts.\n requestAnimationFrame(() => {\n inputRef.current?.focus();\n });\n }\n }, [paletteOpen]);\n\n const mode: 'command' | 'content' | 'ai' = useMemo(() => {\n if (query.startsWith('>')) {\n return 'content';\n }\n if (query.startsWith('?')) {\n return 'ai';\n }\n return 'command';\n }, [query]);\n\n const effectiveQuery = useMemo(() => {\n if (mode === 'command') {\n return query;\n }\n return query.slice(1).trim();\n }, [mode, query]);\n\n const groups = useMemo(() => {\n if (mode !== 'command') {\n return [];\n }\n const scored: ScoredCommand[] = commands\n .map((cmd) => ({ cmd, score: scoreCommand(cmd, effectiveQuery) }))\n .filter((s) => s.score > 0)\n .sort((a, b) => {\n if (a.score !== b.score) {\n return b.score - a.score;\n }\n return a.cmd.label.localeCompare(b.cmd.label);\n });\n\n const byGroup = new Map<string, Command[]>();\n for (const { cmd } of scored) {\n const g = cmd.group ?? OTHER_GROUP;\n const list = byGroup.get(g) ?? [];\n list.push(cmd);\n byGroup.set(g, list);\n }\n return Array.from(byGroup.entries())\n .sort(([a], [b]) => groupOrder(a, b))\n .map(([label, items]) => ({ label, items }));\n }, [commands, effectiveQuery, mode]);\n\n const flatResults = useMemo(() => groups.flatMap((g) => g.items), [groups]);\n\n useEffect(() => {\n if (selectedIndex >= flatResults.length) {\n setSelectedIndex(0);\n }\n }, [flatResults.length, selectedIndex]);\n\n if (!paletteOpen) {\n return null;\n }\n\n const handleClose = (): void => {\n setPaletteOpen(false);\n };\n\n const handleSelect = (cmd: Command): void => {\n setPaletteOpen(false);\n void execute(cmd.id).catch((err: unknown) => {\n console.error('[command]', cmd.id, err);\n });\n };\n\n const handleKeyDown = (event: ReactKeyboardEvent<HTMLInputElement>): void => {\n if (event.key === 'ArrowDown') {\n event.preventDefault();\n if (flatResults.length > 0) {\n setSelectedIndex((i) => (i + 1) % flatResults.length);\n }\n return;\n }\n if (event.key === 'ArrowUp') {\n event.preventDefault();\n if (flatResults.length > 0) {\n setSelectedIndex((i) => (i === 0 ? flatResults.length - 1 : i - 1));\n }\n return;\n }\n if (event.key === 'Enter') {\n event.preventDefault();\n if (selectedIndex < flatResults.length) {\n handleSelect(flatResults[selectedIndex]);\n }\n return;\n }\n if (event.key === 'Escape') {\n event.preventDefault();\n handleClose();\n }\n };\n\n const indexOf = (cmd: Command): number =>\n flatResults.findIndex((c) => c.id === cmd.id);\n\n return (\n <div\n className=\"aegis-cmdk\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Command palette\"\n >\n <button\n type=\"button\"\n className=\"aegis-cmdk__backdrop\"\n aria-label=\"Close command palette\"\n onClick={handleClose}\n />\n <div className=\"aegis-cmdk__card\">\n <div className=\"aegis-cmdk__input-row\">\n <input\n ref={inputRef}\n className=\"aegis-cmdk__input\"\n type=\"text\"\n value={query}\n onChange={(e) => setQuery(e.target.value)}\n onKeyDown={handleKeyDown}\n placeholder=\"Type a command or '>' to search…\"\n aria-label=\"Command search\"\n autoComplete=\"off\"\n spellCheck={false}\n />\n </div>\n\n <div className=\"aegis-cmdk__results\">\n {mode === 'content' && (\n <div className=\"aegis-cmdk__hint\">\n Content search is not yet wired.\n </div>\n )}\n {mode === 'ai' && (\n <div className=\"aegis-cmdk__hint\">\n Ask AI — agent integration not yet wired.\n </div>\n )}\n\n {mode === 'command' && flatResults.length === 0 && (\n <div className=\"aegis-cmdk__hint\">No commands match.</div>\n )}\n\n {mode === 'command' &&\n groups.map((group) => (\n <div key={group.label} className=\"aegis-cmdk__group\">\n <div className=\"aegis-cmdk__group-label\">{group.label}</div>\n {group.items.map((cmd) => {\n const idx = indexOf(cmd);\n return (\n <CommandPaletteRow\n key={cmd.id}\n cmd={cmd}\n active={idx === selectedIndex}\n onSelect={() => handleSelect(cmd)}\n onHover={() => setSelectedIndex(idx)}\n />\n );\n })}\n </div>\n ))}\n </div>\n </div>\n </div>\n );\n}\n\ninterface CommandPaletteRowProps {\n cmd: Command;\n active: boolean;\n onSelect: () => void;\n onHover: () => void;\n}\n\nfunction CommandPaletteRow({\n cmd,\n active,\n onSelect,\n onHover,\n}: CommandPaletteRowProps): ReactElement {\n useAegisAction<void, unknown>(cmd.action);\n return (\n <button\n type=\"button\"\n className={['aegis-cmdk__row', active ? 'aegis-cmdk__row--active' : '']\n .filter(Boolean)\n .join(' ')}\n onClick={onSelect}\n onMouseEnter={onHover}\n data-agent-action-id={cmd.action?.id}\n >\n {cmd.icon && <span className=\"aegis-cmdk__row-icon\">{cmd.icon}</span>}\n <span className=\"aegis-cmdk__row-body\">\n <span className=\"aegis-cmdk__row-label\">{cmd.label}</span>\n {cmd.description && (\n <span className=\"aegis-cmdk__row-desc\">{cmd.description}</span>\n )}\n </span>\n {cmd.shortcut && (\n <span className=\"aegis-cmdk__row-shortcut\">\n {formatShortcut(cmd.shortcut)}\n </span>\n )}\n </button>\n );\n}\n"],"names":["OTHER_GROUP","scoreCommand","cmd","query","q","label","k","groupOrder","a","b","aQuick","bQuick","CommandPalette","commands","paletteOpen","setPaletteOpen","execute","useCommands","setQuery","useState","selectedIndex","setSelectedIndex","inputRef","useRef","useEffect","mode","useMemo","effectiveQuery","groups","scored","s","byGroup","g","list","items","flatResults","handleClose","handleSelect","err","handleKeyDown","event","i","indexOf","c","jsxs","jsx","group","idx","CommandPaletteRow","active","onSelect","onHover","useAegisAction","formatShortcut"],"mappings":";;;;;;AAkBA,MAAMA,IAAc;AAEpB,SAASC,EAAaC,GAAcC,GAAuB;AACzD,MAAI,CAACA;AACH,WAAO;AAET,QAAMC,IAAID,EAAM,YAAA,GACVE,IAAQH,EAAI,MAAM,YAAA;AACxB,SAAIG,EAAM,WAAWD,CAAC,IACb,IAELC,EAAM,SAASD,CAAC,IACX,IAELF,EAAI,UAAU,KAAK,CAACI,MAAMA,EAAE,cAAc,SAASF,CAAC,CAAC,IAChD,IAELF,EAAI,aAAa,YAAA,EAAc,SAASE,CAAC,IACpC,IAEF;AACT;AAEA,SAASG,EAAWC,GAAWC,GAAmB;AAChD,QAAMC,IAASF,EAAE,YAAA,EAAc,SAAS,OAAO,GACzCG,IAASF,EAAE,YAAA,EAAc,SAAS,OAAO;AAC/C,SAAIC,KAAU,CAACC,IACN,KAELA,KAAU,CAACD,KAGXF,MAAMR,KAAeS,MAAMT,IACtB,IAELS,MAAMT,KAAeQ,MAAMR,IACtB,KAEFQ,EAAE,cAAcC,CAAC;AAC1B;AAEO,SAASG,IAAsC;AACpD,QAAM,EAAE,UAAAC,GAAU,aAAAC,GAAa,gBAAAC,GAAgB,SAAAC,EAAA,IAAYC,EAAA,GACrD,CAACd,GAAOe,CAAQ,IAAIC,EAAS,EAAE,GAC/B,CAACC,GAAeC,CAAgB,IAAI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","sources":["../../../src/components/ui/CommandPalette.tsx"],"sourcesContent":["import {\n type KeyboardEvent,\n type ReactElement,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { SearchOutlined } from '@ant-design/icons';\n\nimport { type Command, formatShortcut } from '../../commands';\nimport { useStrings } from '../../locale';\nimport './CommandPalette.css';\nimport { Dialog } from './Dialog';\n\nexport interface CommandPaletteProps {\n open: boolean;\n /** The commands to search, already filtered to what the user may run. */\n commands: Command[];\n /** Runs the picked command; the palette closes itself first. */\n onSelect: (command: Command) => void;\n onClose: () => void;\n /**\n * Group labels in display order. Groups it doesn't list follow in\n * alphabetical order; commands without a group join the locale's\n * `commandGroupOther` (\"Other\"), which comes last unless listed here.\n */\n groupOrder?: string[];\n title?: string;\n placeholder?: string;\n}\n\ninterface CommandGroup {\n label: string;\n commands: Command[];\n}\n\nfunction scoreCommand(cmd: Command, query: string): number {\n if (!query) {\n return 1;\n }\n const q = query.toLowerCase();\n const label = cmd.label.toLowerCase();\n if (label.startsWith(q)) {\n return 4;\n }\n if (label.includes(q)) {\n return 3;\n }\n if (cmd.keywords?.some((k) => k.toLowerCase().includes(q))) {\n return 2;\n }\n if (cmd.description?.toLowerCase().includes(q)) {\n return 1;\n }\n return 0;\n}\n\nfunction groupCommands(\n commands: Command[],\n query: string,\n groupOrder: string[],\n ungrouped: string,\n): CommandGroup[] {\n const matches = commands\n .map((cmd) => ({ cmd, score: scoreCommand(cmd, query.trim()) }))\n .filter((m) => m.score > 0)\n .sort(\n (a, b) => b.score - a.score || a.cmd.label.localeCompare(b.cmd.label),\n );\n\n const byGroup = new Map<string, Command[]>();\n for (const { cmd } of matches) {\n const group = cmd.group ?? ungrouped;\n const list = byGroup.get(group) ?? [];\n list.push(cmd);\n byGroup.set(group, list);\n }\n\n const rank = (group: string): number => {\n const listed = groupOrder.indexOf(group);\n if (listed !== -1) {\n return listed;\n }\n return group === ungrouped ? Number.MAX_SAFE_INTEGER : groupOrder.length;\n };\n return Array.from(byGroup.entries())\n .sort(([a], [b]) => rank(a) - rank(b) || a.localeCompare(b))\n .map(([label, list]) => ({ label, commands: list }));\n}\n\nconst NO_GROUP_ORDER: string[] = [];\n\n/**\n * A dialog that searches `commands` and runs the picked one through\n * `onSelect`. The field is a combobox over a listbox of the matches:\n * focus stays in the field while the arrow keys move the active option.\n */\nexport function CommandPalette({\n open,\n commands,\n onSelect,\n onClose,\n groupOrder = NO_GROUP_ORDER,\n title: titleProp,\n placeholder: placeholderProp,\n}: CommandPaletteProps): ReactElement {\n const strings = useStrings();\n const title = titleProp ?? strings.commandPaletteTitle;\n const placeholder = placeholderProp ?? strings.commandPalettePlaceholder;\n const [query, setQuery] = useState('');\n const [activeIndex, setActiveIndex] = useState(0);\n const [wasOpen, setWasOpen] = useState(open);\n if (open !== wasOpen) {\n setWasOpen(open);\n if (open) {\n setQuery('');\n setActiveIndex(0);\n }\n }\n const inputRef = useRef<HTMLInputElement>(null);\n const listRef = useRef<HTMLDivElement>(null);\n const idPrefix = useId();\n const listId = `${idPrefix}-list`;\n const optionId = (index: number): string => `${idPrefix}-option-${index}`;\n\n // Runs after the Dialog's own effect has focused its panel.\n useEffect(() => {\n if (open) {\n inputRef.current?.focus();\n }\n }, [open]);\n\n const ungrouped = strings.commandGroupOther;\n const groups = useMemo(\n () => groupCommands(commands, query, groupOrder, ungrouped),\n [commands, query, groupOrder, ungrouped],\n );\n const flat = useMemo(() => groups.flatMap((g) => g.commands), [groups]);\n const hasIcons = flat.some((cmd) => Boolean(cmd.icon));\n const active =\n flat.length === 0 ? -1 : Math.min(activeIndex, flat.length - 1);\n\n useEffect(() => {\n listRef.current\n ?.querySelector('[aria-selected=\"true\"]')\n ?.scrollIntoView({ block: 'nearest' });\n }, [active]);\n\n const select = (cmd: Command): void => {\n onClose();\n onSelect(cmd);\n };\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>): void => {\n if (event.nativeEvent.isComposing) {\n return;\n }\n if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n event.preventDefault();\n const count = flat.length;\n if (count > 0) {\n const step = event.key === 'ArrowDown' ? 1 : -1;\n setActiveIndex(\n (current) => (Math.min(current, count - 1) + step + count) % count,\n );\n }\n } else if (event.key === 'Enter' && active >= 0) {\n event.preventDefault();\n select(flat[active]);\n }\n };\n\n let index = 0;\n return (\n <Dialog\n open={open}\n title={title}\n onClose={onClose}\n width=\"lg\"\n className=\"aegis-cmdk\"\n >\n <div className=\"aegis-cmdk__field\">\n <SearchOutlined className=\"aegis-cmdk__field-icon\" aria-hidden />\n <input\n ref={inputRef}\n className=\"aegis-cmdk__input\"\n type=\"text\"\n role=\"combobox\"\n aria-expanded\n aria-controls={listId}\n aria-autocomplete=\"list\"\n aria-activedescendant={active >= 0 ? optionId(active) : undefined}\n aria-label={placeholder}\n placeholder={placeholder}\n value={query}\n onChange={(event) => {\n setQuery(event.target.value);\n setActiveIndex(0);\n }}\n onKeyDown={onKeyDown}\n autoComplete=\"off\"\n spellCheck={false}\n />\n </div>\n <div className=\"aegis-cmdk__results\">\n <div\n ref={listRef}\n id={listId}\n className=\"aegis-cmdk__list\"\n role=\"listbox\"\n aria-label={title}\n >\n {groups.map((group, groupIndex) => {\n const labelId = `${idPrefix}-group-${groupIndex}`;\n return (\n <div\n key={group.label}\n className=\"aegis-cmdk__group\"\n role=\"group\"\n aria-labelledby={labelId}\n >\n <div\n id={labelId}\n className=\"aegis-cmdk__group-label\"\n role=\"presentation\"\n >\n {group.label}\n </div>\n {group.commands.map((cmd) => {\n const optionIndex = index++;\n const isActive = optionIndex === active;\n return (\n <div\n key={cmd.id}\n id={optionId(optionIndex)}\n className={\n isActive\n ? 'aegis-cmdk__option aegis-cmdk__option--active'\n : 'aegis-cmdk__option'\n }\n role=\"option\"\n aria-selected={isActive}\n tabIndex={-1}\n onMouseDown={(event) => {\n // Keeps focus in the field until the dialog closes.\n event.preventDefault();\n select(cmd);\n }}\n onMouseMove={() => {\n if (!isActive) {\n setActiveIndex(optionIndex);\n }\n }}\n >\n {hasIcons && (\n <span className=\"aegis-cmdk__option-icon\" aria-hidden>\n {cmd.icon}\n </span>\n )}\n <span className=\"aegis-cmdk__option-body\">\n <span className=\"aegis-cmdk__option-label\">\n {cmd.label}\n </span>\n {cmd.description && (\n <span className=\"aegis-cmdk__option-desc\">\n {cmd.description}\n </span>\n )}\n </span>\n {cmd.shortcut && (\n <kbd className=\"aegis-cmdk__option-shortcut\">\n {formatShortcut(cmd.shortcut)}\n </kbd>\n )}\n </div>\n );\n })}\n </div>\n );\n })}\n </div>\n {flat.length === 0 && (\n <p className=\"aegis-cmdk__empty\" role=\"status\">\n {strings.commandPaletteEmpty}\n </p>\n )}\n </div>\n </Dialog>\n );\n}\n"],"names":["scoreCommand","cmd","query","q","label","k","groupCommands","commands","groupOrder","ungrouped","matches","m","a","b","byGroup","group","list","rank","listed","NO_GROUP_ORDER","CommandPalette","open","onSelect","onClose","titleProp","placeholderProp","strings","useStrings","title","placeholder","setQuery","useState","activeIndex","setActiveIndex","wasOpen","setWasOpen","inputRef","useRef","listRef","idPrefix","useId","listId","optionId","index","useEffect","groups","useMemo","flat","g","hasIcons","active","select","onKeyDown","event","count","step","current","jsxs","Dialog","jsx","SearchOutlined","groupIndex","labelId","optionIndex","isActive","formatShortcut"],"mappings":";;;;;;;AAuCA,SAASA,EAAaC,GAAcC,GAAuB;AACzD,MAAI,CAACA;AACH,WAAO;AAET,QAAMC,IAAID,EAAM,YAAA,GACVE,IAAQH,EAAI,MAAM,YAAA;AACxB,SAAIG,EAAM,WAAWD,CAAC,IACb,IAELC,EAAM,SAASD,CAAC,IACX,IAELF,EAAI,UAAU,KAAK,CAACI,MAAMA,EAAE,cAAc,SAASF,CAAC,CAAC,IAChD,IAELF,EAAI,aAAa,YAAA,EAAc,SAASE,CAAC,IACpC,IAEF;AACT;AAEA,SAASG,EACPC,GACAL,GACAM,GACAC,GACgB;AAChB,QAAMC,IAAUH,EACb,IAAI,CAACN,OAAS,EAAE,KAAAA,G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;AAAA,0BAvCGA,EAAI;AAAA,wBAAA;AAAA,sBA2Cf,CAAC;AAAA,oBAAA;AAAA,kBAAA;AAAA,kBA5DIc,EAAM;AAAA,gBAAA;AAAA,cA+DjB,CAAC;AAAA,YAAA;AAAA,UAAA;AAAA,UAEFgC,EAAK,WAAW,KACf,gBAAAY,EAAC,KAAA,EAAE,WAAU,qBAAoB,MAAK,UACnC,UAAAjC,EAAQ,oBAAA,CACX;AAAA,QAAA,EAAA,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),M=require("react"),R=require("antd"),q=require("../../hooks/useMediaQuery.cjs"),E=require("./Checkbox.cjs"),D=require("./Chip.cjs");;/* empty css */const O=require("../../locale/useStrings.cjs"),I=36,T=16,A=104,G=56,H=4,P="(max-width: 640px)";function F(a,s,r){const i=[],e=new Map,o=[],x=()=>{const n=i.indexOf(null);return n===-1?i.length:n};let g=0;for(const{commit:n,row:l}of a){const p=i.flatMap((d,_)=>d===n.id?[_]:[]);p.forEach(d=>{i[d]=null});const m=p.length>0?p[0]:x();i[m]=null,e.set(l,m),n.parents.filter(d=>!s.has(d)||r(d)).forEach((d,_)=>{const j=i.indexOf(d),c=_===0?m:j===-1?x():j;i[c]=d,o.push({from:l,to:s.get(d)??-1,via:c,parent:d})}),g=Math.max(g,i.length,m+1)}return{trackOf:e,edges:o,tracks:g}}function Q(a,s,r){const i=new Map(a.map((c,f)=>[c.id,f])),e=s?.map(c=>c.id)??[void 0],o=new Set(e),x=c=>o.has(c.lane)?c.lane:e[0],g=a.map(()=>0),n=a.map(()=>{}),l=[],p=[];let m=0;for(const[c,f]of e.entries()){const S=a.flatMap((h,$)=>x(h)===f?[{commit:h,row:$}]:[]);S.forEach(({row:h})=>{n[h]=s?.[c].label});const N=new Set(S.map(({commit:h})=>h.id)),b=F(S,i,h=>N.has(h)),C=Math.max(b.tracks,1)*T,k=s===void 0?C:Math.max(C,r),v=h=>m+(k-C)/2+(h+.5)*T;b.trackOf.forEach((h,$)=>{g[$]=v(h)}),b.edges.forEach(h=>{const $=h.to===-1?a.length:h.to;l.push({from:h.from,to:$,fromX:g[h.from],toX:h.to===-1?v(h.via):v(b.trackOf.get($)??0),viaX:v(h.via)})}),p.push({x:m,width:k}),m+=k}const d=a.flatMap((c,f)=>(c.links??[]).flatMap(S=>{const N=i.get(S);return N===void 0?[]:[{from:f,to:N,fromX:g[f],toX:g[N]}]})),_=new Map;l.forEach(c=>{_.set(c.from,(_.get(c.from)??0)+1)});const j=a.map((c,f)=>(_.get(f)??0)>1);return{dotX:g,merge:j,laneLabel:n,edges:l,links:d,lanes:p,width:m}}const u=a=>(a+.5)*I;function w(a,s,r,i){const e=(s+i)/2;return`C ${String(a)} ${String(e)} ${String(r)} ${String(e)} ${String(r)} ${String(i)}`}function U({from:a,to:s,fromX:r,toX:i,viaX:e}){const o=`M ${String(r)} ${String(u(a))}`;if(s-a<=1)return`${o} ${w(r,u(a),i,u(s))}`;const x=e===r?"":w(r,u(a),e,u(a+1)),g=`L ${String(e)} ${String(u(s-1))}`,n=e===i?`L ${String(i)} ${String(u(s))}`:w(e,u(s-1),i,u(s));return[o,x,g,n].filter(Boolean).join(" ")}function y({id:a,className:s,children:r}){const[i,e]=M.useState(!1);return t.jsx(R.Tooltip,{placement:"topLeft",mouseEnterDelay:.3,styles:{root:{maxWidth:"var(--tooltip-max-width)"}},title:i?r:void 0,children:t.jsx("span",{id:a,className:s,onMouseEnter:o=>{e(o.currentTarget.scrollWidth>o.currentTarget.clientWidth)},children:r})})}function L(a,s,r,i){const e=r.laneLabel[s],o=r.merge[s],x=`${a}-lane-${String(s)}`,g=`${a}-merge-${String(s)}`,n=[e===void 0?"":x,o?g:""].filter(Boolean);return{describedBy:n.length===0?void 0:n.join(" "),spans:t.jsxs(t.Fragment,{children:[e!==void 0&&t.jsx("span",{id:x,hidden:!0,children:e}),o&&t.jsx("span",{id:g,hidden:!0,children:i})]})}}function W({commits:a,layout:s,selected:r}){const i=a.length*I;return t.jsxs("svg",{className:"aegis-commit-graph__svg",width:s.width,height:i,viewBox:`0 0 ${String(s.width)} ${String(i)}`,"aria-hidden":"true",children:[s.lanes.slice(1).map(e=>t.jsx("line",{className:"aegis-commit-graph__lane-rule",x1:e.x,x2:e.x,y1:0,y2:i},e.x)),s.links.map(e=>t.jsx("path",{className:"aegis-commit-graph__link",d:`M ${String(e.fromX)} ${String(u(e.from))} ${w(e.fromX,u(e.from),e.toX,u(e.to))}`},`${String(e.from)}-${String(e.to)}`)),s.edges.map(e=>t.jsx("path",{className:"aegis-commit-graph__edge",d:U(e)},`${String(e.from)}-${String(e.to)}-${String(e.viaX)}`)),a.map((e,o)=>t.jsx("circle",{className:["aegis-commit-graph__dot",s.merge[o]?"aegis-commit-graph__dot--merge":"",r.has(e.id)?"aegis-commit-graph__dot--selected":""].filter(Boolean).join(" "),cx:s.dotX[o],cy:u(o),r:H},e.id))]})}function B({lanes:a,layout:s}){return t.jsx("span",{className:"aegis-commit-graph__lane-labels",children:a.map((r,i)=>t.jsx("span",{className:"aegis-commit-graph__lane-label",style:{width:`${String(s.lanes[i].width)}px`},children:r.label},r.id))})}function X({commits:a,lanes:s,layout:r,selected:i,toggle:e,ariaLabel:o}){const x=O.useStrings(),g=M.useId();return t.jsxs(t.Fragment,{children:[s!==void 0&&t.jsxs("div",{className:"aegis-commit-graph__lanes","aria-hidden":"true",children:[t.jsx("span",{className:"aegis-commit-graph__lane-spacer"}),t.jsx(B,{lanes:s,layout:r})]}),t.jsxs("div",{className:"aegis-commit-graph__body",children:[t.jsx(W,{commits:a,layout:r,selected:i}),t.jsx("ol",{className:"aegis-commit-graph__rows","aria-label":o,children:a.map((n,l)=>{const p=i.has(n.id),m=`${g}-title-${String(l)}`,d=L(g,l,r,x.mergeCommit);return t.jsxs("li",{className:p?"aegis-commit-graph__row aegis-commit-graph__row--selected":"aegis-commit-graph__row","aria-describedby":d.describedBy,children:[t.jsx("span",{className:"aegis-commit-graph__select",children:e!==void 0&&t.jsx(E.Checkbox,{checked:p,onChange:_=>{e(n.id,_)},"aria-labelledby":m})}),t.jsxs("span",{className:"aegis-commit-graph__text",children:[d.spans,n.refs?.map(_=>t.jsx(D.Chip,{className:"aegis-commit-graph__ref",children:_},_)),t.jsx(y,{id:m,className:"aegis-commit-graph__title",children:n.title})]}),n.meta!==void 0&&t.jsx("span",{className:"aegis-commit-graph__meta",children:n.meta})]},n.id)})})]})]})}function Y({commits:a,lanes:s,layout:r,selected:i,toggle:e,ariaLabel:o,columns:x}){const g=O.useStrings(),n=M.useId();return t.jsx("div",{className:"aegis-commit-graph__scroll",children:t.jsxs("table",{className:"aegis-commit-graph__table","aria-label":o,children:[t.jsx("thead",{children:t.jsxs("tr",{children:[t.jsx("th",{scope:"col",className:"aegis-commit-graph__th aegis-commit-graph__th--graph","aria-hidden":"true",children:s!==void 0&&t.jsx(B,{lanes:s,layout:r})}),x.map(l=>t.jsx("th",{scope:"col",className:"aegis-commit-graph__th",children:l.label},l.id))]})}),t.jsx("tbody",{children:a.map((l,p)=>{const m=i.has(l.id),d=`${n}-first-${String(p)}`,_=L(n,p,r,g.mergeCommit);return t.jsxs("tr",{className:m?"aegis-commit-graph__tr aegis-commit-graph__tr--selected":"aegis-commit-graph__tr","aria-selected":e===void 0?void 0:m,"aria-describedby":_.describedBy,children:[t.jsxs("td",{className:p===0?"aegis-commit-graph__td aegis-commit-graph__td--graph aegis-commit-graph__td--drawing":"aegis-commit-graph__td aegis-commit-graph__td--graph","aria-hidden":"true",children:[_.spans,p===0&&t.jsx(W,{commits:a,layout:r,selected:i})]}),x.map((j,c)=>{const f=c===0?t.jsxs(t.Fragment,{children:[e!==void 0&&t.jsx("span",{className:"aegis-commit-graph__cell-select",children:t.jsx(E.Checkbox,{checked:m,onChange:S=>{e(l.id,S)},"aria-labelledby":d})}),t.jsx("span",{id:d,children:l.cells?.[j.id]})]}):l.cells?.[j.id];return j.grow===!0?t.jsx("td",{className:"aegis-commit-graph__td aegis-commit-graph__td--grow",children:t.jsx(y,{className:"aegis-commit-graph__cell",children:f})},j.id):t.jsx("td",{className:"aegis-commit-graph__td",children:t.jsx("span",{className:"aegis-commit-graph__cell",children:f})},j.id)})]},l.id)})})]})})}function K({commits:a,lanes:s,columns:r,selectedIds:i=[],onSelectedIdsChange:e,maxSelected:o,ariaLabel:x,className:g}){const l=q.useMediaQuery(P)?G:A,p=M.useMemo(()=>Q(a,s,l),[a,s,l]),m=e===void 0?void 0:(c,f)=>{const S=f?[...i.filter(N=>N!==c),c]:i.filter(N=>N!==c);e(o===void 0?S:S.slice(-o))},d={commits:a,lanes:s,layout:p,selected:new Set(i),toggle:m,ariaLabel:x},_=["aegis-commit-graph",m!==void 0&&r===void 0?"aegis-commit-graph--selectable":"",g??""].filter(Boolean).join(" "),j={"--aegis-commit-graph-row-h":`${String(I)}px`,"--aegis-commit-graph-graph-w":`${String(p.width)}px`,"--aegis-commit-graph-grow-count":String(r?.filter(c=>c.grow===!0).length??0)};return t.jsx("div",{className:_,style:j,children:r===void 0?t.jsx(X,{...d}):t.jsx(Y,{...d,columns:r})})}exports.CommitGraph=K;
|
|
2
|
+
//# sourceMappingURL=CommitGraph.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommitGraph.cjs","sources":["../../../src/components/ui/CommitGraph.tsx"],"sourcesContent":["import {\n type CSSProperties,\n type MouseEvent,\n type ReactNode,\n useId,\n useMemo,\n useState,\n} from 'react';\n\nimport { Tooltip } from 'antd';\n\nimport { useMediaQuery } from '../../hooks/useMediaQuery';\nimport { useStrings } from '../../locale';\nimport { Checkbox } from './Checkbox';\nimport { Chip } from './Chip';\nimport './CommitGraph.css';\n\nexport interface CommitGraphCommit {\n id: string;\n /**\n * The commit's parents. An edge to a parent missing from `commits` runs to\n * the bottom of the graph. With lanes, a parent in another lane is not\n * drawn; relate commits across lanes with `links`. A commit with two or\n * more parents drawn is a merge.\n */\n parents: string[];\n /**\n * Without `columns`: one line, cut off with an ellipsis when it is too\n * long; hovering shows it whole. It names the row's checkbox.\n */\n title?: ReactNode;\n /** Without `columns`: shown at the end of the row, e.g. a short id or a time. */\n meta?: ReactNode;\n /** Without `columns`: names that point at the commit, e.g. branch heads, as chips before the title. */\n refs?: string[];\n /**\n * With `columns`: the row's cells, by column id. A cell is one line: its\n * content is cut to the row's height, so every row lines up with the\n * drawing.\n */\n cells?: Record<string, ReactNode>;\n /** The `lanes` id of the column the commit is drawn in. Default, and for an unknown id: the first lane. */\n lane?: string;\n /**\n * Commits in other lanes this one relates to, e.g. the requirement commit a\n * run was built from. Each is drawn as a dashed edge.\n */\n links?: string[];\n}\n\nexport interface CommitGraphLane {\n id: string;\n label: string;\n}\n\nexport interface CommitGraphColumn {\n id: string;\n /** The column's name, in its header. */\n label: string;\n /**\n * Takes the width the other columns leave, which are as wide as their\n * content, and cuts its cells off with an ellipsis, e.g. a message;\n * hovering a cut cell shows it whole. Several growing columns share that\n * width evenly. A growing column is never narrower than about 20\n * characters: where the other columns leave less, the table scrolls.\n */\n grow?: boolean;\n}\n\nexport interface CommitGraphProps {\n /** The commits, newest first: each comes before its parents. */\n commits: CommitGraphCommit[];\n /**\n * Columns of the graph, each a separate history with its own branches,\n * e.g. requirements, runs and a code trunk. A commit is drawn in the lane\n * its `lane` names. Without lanes the graph is one history.\n */\n lanes?: CommitGraphLane[];\n /**\n * Draws the commits as a table: the graph in the first column, then these\n * columns, one row per commit with its `cells`. A table scrolls sideways\n * when its columns do not fit. Without `columns` the commits are a list.\n */\n columns?: CommitGraphColumn[];\n /**\n * Ids of the selected commits. With `onSelectedIdsChange`, each row has a\n * checkbox, at the start of the first column in a table, named by that\n * cell; a selected table row is `aria-selected`.\n */\n selectedIds?: string[];\n onSelectedIdsChange?: (ids: string[]) => void;\n /** The most commits selected at once: selecting one more drops the one selected first. */\n maxSelected?: number;\n /** The accessible name of the list or table of commits. */\n ariaLabel: string;\n className?: string;\n}\n\n// The SVG is drawn in px from these, and the CSS reads them from the root.\nconst ROW_HEIGHT = 36;\nconst TRACK_WIDTH = 16;\nconst LANE_MIN_WIDTH = 104;\n/** At 640 px and below, so three lanes leave the titles room. */\nconst LANE_MIN_WIDTH_NARROW = 56;\nconst DOT_RADIUS = 4;\n\nconst NARROW_QUERY = '(max-width: 640px)';\n\ninterface Edge {\n /** Rows of the commit and its parent; a missing parent is one row past the end. */\n from: number;\n to: number;\n fromX: number;\n toX: number;\n /** The x of the track the edge runs down. */\n viaX: number;\n}\n\ninterface Link {\n from: number;\n to: number;\n fromX: number;\n toX: number;\n}\n\ninterface GraphLayout {\n /** The x of each commit's dot, by row. */\n dotX: number[];\n /** Whether each commit, by row, is drawn as a merge. */\n merge: boolean[];\n /** The label of each commit's lane, by row. */\n laneLabel: Array<string | undefined>;\n edges: Edge[];\n links: Link[];\n /** Each lane's left edge and width. */\n lanes: Array<{ x: number; width: number }>;\n width: number;\n}\n\n/**\n * Places each lane's commits on tracks, git-log style: a commit takes the\n * track that expects it, its first parent continues that track, and each\n * further parent takes a free track until the parent's row.\n */\nfunction trackLane(\n laneCommits: Array<{ commit: CommitGraphCommit; row: number }>,\n rowOf: Map<string, number>,\n inLane: (id: string) => boolean,\n): {\n trackOf: Map<number, number>;\n edges: Array<{ from: number; to: number; via: number; parent: string }>;\n tracks: number;\n} {\n const expected: Array<string | null> = [];\n const trackOf = new Map<number, number>();\n const edges: Array<{\n from: number;\n to: number;\n via: number;\n parent: string;\n }> = [];\n const free = (): number => {\n const index = expected.indexOf(null);\n return index === -1 ? expected.length : index;\n };\n let tracks = 0;\n for (const { commit, row } of laneCommits) {\n const waiting = expected.flatMap((id, index) =>\n id === commit.id ? [index] : [],\n );\n waiting.forEach((index) => {\n expected[index] = null;\n });\n const track = waiting.length > 0 ? waiting[0] : free();\n expected[track] = null;\n trackOf.set(row, track);\n commit.parents\n .filter((parent) => !rowOf.has(parent) || inLane(parent))\n .forEach((parent, index) => {\n const waitingTrack = expected.indexOf(parent);\n const via =\n index === 0 ? track : waitingTrack === -1 ? free() : waitingTrack;\n expected[via] = parent;\n edges.push({ from: row, to: rowOf.get(parent) ?? -1, via, parent });\n });\n tracks = Math.max(tracks, expected.length, track + 1);\n }\n return { trackOf, edges, tracks };\n}\n\nfunction layoutGraph(\n commits: CommitGraphCommit[],\n lanes: CommitGraphLane[] | undefined,\n laneMinWidth: number,\n): GraphLayout {\n const rowOf = new Map(commits.map((commit, row) => [commit.id, row]));\n const laneIds = lanes?.map((lane) => lane.id) ?? [undefined];\n const known = new Set(laneIds);\n const laneOf = (commit: CommitGraphCommit): string | undefined =>\n known.has(commit.lane) ? commit.lane : laneIds[0];\n const dotX = commits.map(() => 0);\n const laneLabel = commits.map((): string | undefined => undefined);\n const edges: Edge[] = [];\n const laneBoxes: GraphLayout['lanes'] = [];\n let x = 0;\n for (const [index, laneId] of laneIds.entries()) {\n const laneCommits = commits.flatMap((commit, row) =>\n laneOf(commit) === laneId ? [{ commit, row }] : [],\n );\n laneCommits.forEach(({ row }) => {\n laneLabel[row] = lanes?.[index].label;\n });\n const laneIdsOf = new Set(laneCommits.map(({ commit }) => commit.id));\n const placed = trackLane(laneCommits, rowOf, (id) => laneIdsOf.has(id));\n const tracksWidth = Math.max(placed.tracks, 1) * TRACK_WIDTH;\n const width =\n lanes === undefined ? tracksWidth : Math.max(tracksWidth, laneMinWidth);\n const trackX = (track: number): number =>\n x + (width - tracksWidth) / 2 + (track + 0.5) * TRACK_WIDTH;\n placed.trackOf.forEach((track, row) => {\n dotX[row] = trackX(track);\n });\n placed.edges.forEach((edge) => {\n const to = edge.to === -1 ? commits.length : edge.to;\n edges.push({\n from: edge.from,\n to,\n fromX: dotX[edge.from],\n toX:\n edge.to === -1\n ? trackX(edge.via)\n : trackX(placed.trackOf.get(to) ?? 0),\n viaX: trackX(edge.via),\n });\n });\n laneBoxes.push({ x, width });\n x += width;\n }\n const links = commits.flatMap((commit, row) =>\n (commit.links ?? []).flatMap((target) => {\n const to = rowOf.get(target);\n return to === undefined\n ? []\n : [{ from: row, to, fromX: dotX[row], toX: dotX[to] }];\n }),\n );\n const drawnParents = new Map<number, number>();\n edges.forEach((edge) => {\n drawnParents.set(edge.from, (drawnParents.get(edge.from) ?? 0) + 1);\n });\n const merge = commits.map((_, row) => (drawnParents.get(row) ?? 0) > 1);\n return { dotX, merge, laneLabel, edges, links, lanes: laneBoxes, width: x };\n}\n\nconst rowY = (row: number): number => (row + 0.5) * ROW_HEIGHT;\n\n/** A curve that leaves and enters vertically. */\nfunction bend(x1: number, y1: number, x2: number, y2: number): string {\n const middle = (y1 + y2) / 2;\n return `C ${String(x1)} ${String(middle)} ${String(x2)} ${String(middle)} ${String(x2)} ${String(y2)}`;\n}\n\n/**\n * An edge leaves its commit for its track within one row, runs down the\n * track, and enters its parent within the last row.\n */\nfunction edgePath({ from, to, fromX, toX, viaX }: Edge): string {\n const start = `M ${String(fromX)} ${String(rowY(from))}`;\n if (to - from <= 1) {\n return `${start} ${bend(fromX, rowY(from), toX, rowY(to))}`;\n }\n const out =\n viaX === fromX ? '' : bend(fromX, rowY(from), viaX, rowY(from + 1));\n const down = `L ${String(viaX)} ${String(rowY(to - 1))}`;\n const into =\n viaX === toX\n ? `L ${String(toX)} ${String(rowY(to))}`\n : bend(viaX, rowY(to - 1), toX, rowY(to));\n return [start, out, down, into].filter(Boolean).join(' ');\n}\n\n/** Text cut off with an ellipsis, shown whole on hover only when it is cut. */\nfunction CutText({\n id,\n className,\n children,\n}: {\n id?: string;\n className: string;\n children: ReactNode;\n}): JSX.Element {\n const [cut, setCut] = useState(false);\n return (\n <Tooltip\n placement=\"topLeft\"\n mouseEnterDelay={0.3}\n styles={{ root: { maxWidth: 'var(--tooltip-max-width)' } }}\n title={cut ? children : undefined}\n >\n <span\n id={id}\n className={className}\n onMouseEnter={(event: MouseEvent<HTMLSpanElement>) => {\n setCut(\n event.currentTarget.scrollWidth > event.currentTarget.clientWidth,\n );\n }}\n >\n {children}\n </span>\n </Tooltip>\n );\n}\n\n/**\n * What a row's drawing shows and assistive technology does not read: the\n * commit's lane and whether it is a merge. The row names these hidden spans\n * as its description.\n */\nfunction rowDescription(\n idPrefix: string,\n row: number,\n layout: GraphLayout,\n mergeText: string,\n): { describedBy: string | undefined; spans: ReactNode } {\n const lane = layout.laneLabel[row];\n const merge = layout.merge[row];\n const laneId = `${idPrefix}-lane-${String(row)}`;\n const mergeId = `${idPrefix}-merge-${String(row)}`;\n const ids = [lane === undefined ? '' : laneId, merge ? mergeId : ''].filter(\n Boolean,\n );\n return {\n describedBy: ids.length === 0 ? undefined : ids.join(' '),\n spans: (\n <>\n {lane !== undefined && (\n <span id={laneId} hidden>\n {lane}\n </span>\n )}\n {merge && (\n <span id={mergeId} hidden>\n {mergeText}\n </span>\n )}\n </>\n ),\n };\n}\n\n/** The edges, links and dots, drawn over the rows; assistive technology reads the rows. */\nfunction GraphDrawing({\n commits,\n layout,\n selected,\n}: {\n commits: CommitGraphCommit[];\n layout: GraphLayout;\n selected: ReadonlySet<string>;\n}): JSX.Element {\n const height = commits.length * ROW_HEIGHT;\n return (\n <svg\n className=\"aegis-commit-graph__svg\"\n width={layout.width}\n height={height}\n viewBox={`0 0 ${String(layout.width)} ${String(height)}`}\n aria-hidden=\"true\"\n >\n {layout.lanes.slice(1).map((lane) => (\n <line\n key={lane.x}\n className=\"aegis-commit-graph__lane-rule\"\n x1={lane.x}\n x2={lane.x}\n y1={0}\n y2={height}\n />\n ))}\n {layout.links.map((link) => (\n <path\n key={`${String(link.from)}-${String(link.to)}`}\n className=\"aegis-commit-graph__link\"\n d={`M ${String(link.fromX)} ${String(rowY(link.from))} ${bend(link.fromX, rowY(link.from), link.toX, rowY(link.to))}`}\n />\n ))}\n {layout.edges.map((edge) => (\n <path\n key={`${String(edge.from)}-${String(edge.to)}-${String(edge.viaX)}`}\n className=\"aegis-commit-graph__edge\"\n d={edgePath(edge)}\n />\n ))}\n {commits.map((commit, row) => (\n <circle\n key={commit.id}\n className={[\n 'aegis-commit-graph__dot',\n layout.merge[row] ? 'aegis-commit-graph__dot--merge' : '',\n selected.has(commit.id) ? 'aegis-commit-graph__dot--selected' : '',\n ]\n .filter(Boolean)\n .join(' ')}\n cx={layout.dotX[row]}\n cy={rowY(row)}\n r={DOT_RADIUS}\n />\n ))}\n </svg>\n );\n}\n\nfunction LaneLabels({\n lanes,\n layout,\n}: {\n lanes: CommitGraphLane[];\n layout: GraphLayout;\n}): JSX.Element {\n return (\n <span className=\"aegis-commit-graph__lane-labels\">\n {lanes.map((lane, index) => (\n <span\n key={lane.id}\n className=\"aegis-commit-graph__lane-label\"\n style={{ width: `${String(layout.lanes[index].width)}px` }}\n >\n {lane.label}\n </span>\n ))}\n </span>\n );\n}\n\n/** What the list and the table both draw from. */\ninterface RowsProps {\n commits: CommitGraphCommit[];\n lanes: CommitGraphLane[] | undefined;\n layout: GraphLayout;\n selected: ReadonlySet<string>;\n /** Set when the rows have checkboxes. */\n toggle: ((id: string, checked: boolean) => void) | undefined;\n ariaLabel: string;\n}\n\nfunction CommitList({\n commits,\n lanes,\n layout,\n selected,\n toggle,\n ariaLabel,\n}: RowsProps): JSX.Element {\n const strings = useStrings();\n const idPrefix = useId();\n return (\n <>\n {lanes !== undefined && (\n <div className=\"aegis-commit-graph__lanes\" aria-hidden=\"true\">\n <span className=\"aegis-commit-graph__lane-spacer\" />\n <LaneLabels lanes={lanes} layout={layout} />\n </div>\n )}\n <div className=\"aegis-commit-graph__body\">\n <GraphDrawing commits={commits} layout={layout} selected={selected} />\n <ol className=\"aegis-commit-graph__rows\" aria-label={ariaLabel}>\n {commits.map((commit, row) => {\n const isSelected = selected.has(commit.id);\n const titleId = `${idPrefix}-title-${String(row)}`;\n const description = rowDescription(\n idPrefix,\n row,\n layout,\n strings.mergeCommit,\n );\n return (\n <li\n key={commit.id}\n className={\n isSelected\n ? 'aegis-commit-graph__row aegis-commit-graph__row--selected'\n : 'aegis-commit-graph__row'\n }\n aria-describedby={description.describedBy}\n >\n <span className=\"aegis-commit-graph__select\">\n {toggle !== undefined && (\n <Checkbox\n checked={isSelected}\n onChange={(checked) => {\n toggle(commit.id, checked);\n }}\n aria-labelledby={titleId}\n />\n )}\n </span>\n <span className=\"aegis-commit-graph__text\">\n {description.spans}\n {commit.refs?.map((ref) => (\n <Chip key={ref} className=\"aegis-commit-graph__ref\">\n {ref}\n </Chip>\n ))}\n <CutText id={titleId} className=\"aegis-commit-graph__title\">\n {commit.title}\n </CutText>\n </span>\n {commit.meta !== undefined && (\n <span className=\"aegis-commit-graph__meta\">\n {commit.meta}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n </div>\n </>\n );\n}\n\nfunction CommitTable({\n commits,\n lanes,\n layout,\n selected,\n toggle,\n ariaLabel,\n columns,\n}: RowsProps & { columns: CommitGraphColumn[] }): JSX.Element {\n const strings = useStrings();\n const idPrefix = useId();\n return (\n <div className=\"aegis-commit-graph__scroll\">\n <table className=\"aegis-commit-graph__table\" aria-label={ariaLabel}>\n <thead>\n <tr>\n <th\n scope=\"col\"\n className=\"aegis-commit-graph__th aegis-commit-graph__th--graph\"\n aria-hidden=\"true\"\n >\n {lanes !== undefined && (\n <LaneLabels lanes={lanes} layout={layout} />\n )}\n </th>\n {columns.map((column) => (\n <th\n key={column.id}\n scope=\"col\"\n className=\"aegis-commit-graph__th\"\n >\n {column.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {commits.map((commit, row) => {\n const isSelected = selected.has(commit.id);\n const firstId = `${idPrefix}-first-${String(row)}`;\n const description = rowDescription(\n idPrefix,\n row,\n layout,\n strings.mergeCommit,\n );\n return (\n <tr\n key={commit.id}\n className={\n isSelected\n ? 'aegis-commit-graph__tr aegis-commit-graph__tr--selected'\n : 'aegis-commit-graph__tr'\n }\n aria-selected={toggle === undefined ? undefined : isSelected}\n aria-describedby={description.describedBy}\n >\n <td\n className={\n row === 0\n ? 'aegis-commit-graph__td aegis-commit-graph__td--graph aegis-commit-graph__td--drawing'\n : 'aegis-commit-graph__td aegis-commit-graph__td--graph'\n }\n aria-hidden=\"true\"\n >\n {description.spans}\n {row === 0 && (\n <GraphDrawing\n commits={commits}\n layout={layout}\n selected={selected}\n />\n )}\n </td>\n {columns.map((column, index) => {\n const content =\n index === 0 ? (\n <>\n {toggle !== undefined && (\n <span className=\"aegis-commit-graph__cell-select\">\n <Checkbox\n checked={isSelected}\n onChange={(checked) => {\n toggle(commit.id, checked);\n }}\n aria-labelledby={firstId}\n />\n </span>\n )}\n <span id={firstId}>{commit.cells?.[column.id]}</span>\n </>\n ) : (\n commit.cells?.[column.id]\n );\n return column.grow === true ? (\n <td\n key={column.id}\n className=\"aegis-commit-graph__td aegis-commit-graph__td--grow\"\n >\n <CutText className=\"aegis-commit-graph__cell\">\n {content}\n </CutText>\n </td>\n ) : (\n <td key={column.id} className=\"aegis-commit-graph__td\">\n <span className=\"aegis-commit-graph__cell\">\n {content}\n </span>\n </td>\n );\n })}\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n );\n}\n\nexport function CommitGraph({\n commits,\n lanes,\n columns,\n selectedIds = [],\n onSelectedIdsChange,\n maxSelected,\n ariaLabel,\n className,\n}: CommitGraphProps) {\n const narrow = useMediaQuery(NARROW_QUERY);\n const laneMinWidth = narrow ? LANE_MIN_WIDTH_NARROW : LANE_MIN_WIDTH;\n const layout = useMemo(\n () => layoutGraph(commits, lanes, laneMinWidth),\n [commits, lanes, laneMinWidth],\n );\n const toggle =\n onSelectedIdsChange === undefined\n ? undefined\n : (id: string, checked: boolean): void => {\n const next = checked\n ? [...selectedIds.filter((each) => each !== id), id]\n : selectedIds.filter((each) => each !== id);\n onSelectedIdsChange(\n maxSelected === undefined ? next : next.slice(-maxSelected),\n );\n };\n const rows: RowsProps = {\n commits,\n lanes,\n layout,\n selected: new Set(selectedIds),\n toggle,\n ariaLabel,\n };\n\n const cls = [\n 'aegis-commit-graph',\n // The list's checkboxes take a column of their own; the table's sit in its first column.\n toggle !== undefined && columns === undefined\n ? 'aegis-commit-graph--selectable'\n : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n const rootStyle = {\n '--aegis-commit-graph-row-h': `${String(ROW_HEIGHT)}px`,\n '--aegis-commit-graph-graph-w': `${String(layout.width)}px`,\n '--aegis-commit-graph-grow-count': String(\n columns?.filter((column) => column.grow === true).length ?? 0,\n ),\n } as CSSProperties;\n\n return (\n <div className={cls} style={rootStyle}>\n {columns === undefined ? (\n <CommitList {...rows} />\n ) : (\n <CommitTable {...rows} columns={columns} />\n )}\n </div>\n );\n}\n"],"names":["ROW_HEIGHT","TRACK_WIDTH","LANE_MIN_WIDTH","LANE_MIN_WIDTH_NARROW","DOT_RADIUS","NARROW_QUERY","trackLane","laneCommits","rowOf","inLane","expected","trackOf","edges","free","index","tracks","commit","row","waiting","id","track","parent","waitingTrack","via","layoutGraph","commits","lanes","laneMinWidth","laneIds","lane","known","laneOf","dotX","laneLabel","laneBoxes","x","laneId","laneIdsOf","placed","tracksWidth","width","trackX","edge","to","links","target","drawnParents","merge","_","rowY","bend","x1","y1","x2","y2","middle","edgePath","from","fromX","toX","viaX","start","out","down","into","CutText","className","children","cut","setCut","useState","jsx","Tooltip","event","rowDescription","idPrefix","layout","mergeText","mergeId","ids","jsxs","Fragment","GraphDrawing","selected","height","link","LaneLabels","CommitList","toggle","ariaLabel","strings","useStrings","useId","isSelected","titleId","description","Checkbox","checked","ref","Chip","CommitTable","columns","column","firstId","content","CommitGraph","selectedIds","onSelectedIdsChange","maxSelected","useMediaQuery","useMemo","next","each","rows","cls","rootStyle"],"mappings":"yUAmGMA,EAAa,GACbC,EAAc,GACdC,EAAiB,IAEjBC,EAAwB,GACxBC,EAAa,EAEbC,EAAe,qBAsCrB,SAASC,EACPC,EACAC,EACAC,EAKA,CACA,MAAMC,EAAiC,CAAA,EACjCC,MAAc,IACdC,EAKD,CAAA,EACCC,EAAO,IAAc,CACzB,MAAMC,EAAQJ,EAAS,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wF,EACEC,IAAgB,OAAYG,EAAOA,EAAK,MAAM,CAACH,CAAW,CAAA,CAE9D,EACAK,EAAkB,CACtB,QAAAxF,EACA,MAAAC,EACA,OAAAkD,EACA,SAAU,IAAI,IAAI8B,CAAW,EAC7B,OAAAlB,EACA,UAAAC,CAAA,EAGIyB,EAAM,CACV,qBAEA1B,IAAW,QAAaa,IAAY,OAChC,iCACA,GACJnC,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACLiD,EAAY,CAChB,6BAA8B,GAAG,OAAOnH,CAAU,CAAC,KACnD,+BAAgC,GAAG,OAAO4E,EAAO,KAAK,CAAC,KACvD,kCAAmC,OACjCyB,GAAS,OAAQC,GAAWA,EAAO,OAAS,EAAI,EAAE,QAAU,CAAA,CAC9D,EAGF,aACG,MAAA,CAAI,UAAWY,EAAK,MAAOC,EACzB,aAAY,OACX5C,EAAAA,IAACgB,EAAA,CAAY,GAAG0B,EAAM,EAEtB1C,EAAAA,IAAC6B,GAAa,GAAGa,EAAM,QAAAZ,EAAkB,EAE7C,CAEJ"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface CommitGraphCommit {
|
|
3
|
+
id: string;
|
|
4
|
+
/**
|
|
5
|
+
* The commit's parents. An edge to a parent missing from `commits` runs to
|
|
6
|
+
* the bottom of the graph. With lanes, a parent in another lane is not
|
|
7
|
+
* drawn; relate commits across lanes with `links`. A commit with two or
|
|
8
|
+
* more parents drawn is a merge.
|
|
9
|
+
*/
|
|
10
|
+
parents: string[];
|
|
11
|
+
/**
|
|
12
|
+
* Without `columns`: one line, cut off with an ellipsis when it is too
|
|
13
|
+
* long; hovering shows it whole. It names the row's checkbox.
|
|
14
|
+
*/
|
|
15
|
+
title?: ReactNode;
|
|
16
|
+
/** Without `columns`: shown at the end of the row, e.g. a short id or a time. */
|
|
17
|
+
meta?: ReactNode;
|
|
18
|
+
/** Without `columns`: names that point at the commit, e.g. branch heads, as chips before the title. */
|
|
19
|
+
refs?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* With `columns`: the row's cells, by column id. A cell is one line: its
|
|
22
|
+
* content is cut to the row's height, so every row lines up with the
|
|
23
|
+
* drawing.
|
|
24
|
+
*/
|
|
25
|
+
cells?: Record<string, ReactNode>;
|
|
26
|
+
/** The `lanes` id of the column the commit is drawn in. Default, and for an unknown id: the first lane. */
|
|
27
|
+
lane?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Commits in other lanes this one relates to, e.g. the requirement commit a
|
|
30
|
+
* run was built from. Each is drawn as a dashed edge.
|
|
31
|
+
*/
|
|
32
|
+
links?: string[];
|
|
33
|
+
}
|
|
34
|
+
export interface CommitGraphLane {
|
|
35
|
+
id: string;
|
|
36
|
+
label: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CommitGraphColumn {
|
|
39
|
+
id: string;
|
|
40
|
+
/** The column's name, in its header. */
|
|
41
|
+
label: string;
|
|
42
|
+
/**
|
|
43
|
+
* Takes the width the other columns leave, which are as wide as their
|
|
44
|
+
* content, and cuts its cells off with an ellipsis, e.g. a message;
|
|
45
|
+
* hovering a cut cell shows it whole. Several growing columns share that
|
|
46
|
+
* width evenly. A growing column is never narrower than about 20
|
|
47
|
+
* characters: where the other columns leave less, the table scrolls.
|
|
48
|
+
*/
|
|
49
|
+
grow?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface CommitGraphProps {
|
|
52
|
+
/** The commits, newest first: each comes before its parents. */
|
|
53
|
+
commits: CommitGraphCommit[];
|
|
54
|
+
/**
|
|
55
|
+
* Columns of the graph, each a separate history with its own branches,
|
|
56
|
+
* e.g. requirements, runs and a code trunk. A commit is drawn in the lane
|
|
57
|
+
* its `lane` names. Without lanes the graph is one history.
|
|
58
|
+
*/
|
|
59
|
+
lanes?: CommitGraphLane[];
|
|
60
|
+
/**
|
|
61
|
+
* Draws the commits as a table: the graph in the first column, then these
|
|
62
|
+
* columns, one row per commit with its `cells`. A table scrolls sideways
|
|
63
|
+
* when its columns do not fit. Without `columns` the commits are a list.
|
|
64
|
+
*/
|
|
65
|
+
columns?: CommitGraphColumn[];
|
|
66
|
+
/**
|
|
67
|
+
* Ids of the selected commits. With `onSelectedIdsChange`, each row has a
|
|
68
|
+
* checkbox, at the start of the first column in a table, named by that
|
|
69
|
+
* cell; a selected table row is `aria-selected`.
|
|
70
|
+
*/
|
|
71
|
+
selectedIds?: string[];
|
|
72
|
+
onSelectedIdsChange?: (ids: string[]) => void;
|
|
73
|
+
/** The most commits selected at once: selecting one more drops the one selected first. */
|
|
74
|
+
maxSelected?: number;
|
|
75
|
+
/** The accessible name of the list or table of commits. */
|
|
76
|
+
ariaLabel: string;
|
|
77
|
+
className?: string;
|
|
78
|
+
}
|
|
79
|
+
export declare function CommitGraph({ commits, lanes, columns, selectedIds, onSelectedIdsChange, maxSelected, ariaLabel, className, }: CommitGraphProps): import("react/jsx-runtime").JSX.Element;
|