@lincyaw/aegis-ui 0.9.3 → 0.10.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 +13 -3
- package/dist/agent/ask/AskPanel.js +130 -109
- 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 +2 -5
- 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/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/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +3 -1
- package/dist/components/ui/BlastRadiusBar.js +20 -17
- 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 +3 -3
- 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 +127 -150
- 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 +3 -1
- package/dist/components/ui/Checkbox.js +19 -17
- 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 +25 -0
- package/dist/components/ui/ChoiceCardGroup.js +44 -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 +5 -4
- package/dist/components/ui/CodeEditor.js +210 -63
- 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 +29 -26
- 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/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 +145 -120
- 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 +77 -0
- package/dist/components/ui/CommitGraph.js +380 -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 +40 -193
- 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 +134 -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/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 +87 -32
- 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 +66 -50
- package/dist/components/ui/DropdownMenu.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 +190 -164
- 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 +41 -64
- 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 +45 -42
- 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 +108 -128
- 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 +21 -19
- 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 +10 -1
- package/dist/components/ui/FormRow.js +22 -11
- 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 +16 -2
- package/dist/components/ui/InboxPage.js +54 -52
- 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 +56 -48
- 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 +8 -1
- package/dist/components/ui/MonoValue.js +15 -13
- 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 +15 -3
- package/dist/components/ui/NotificationBell.js +41 -39
- 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 +32 -0
- package/dist/components/ui/NumberField.js +77 -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 +38 -30
- 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.map +1 -1
- package/dist/components/ui/PageSizeSelect.d.ts +3 -4
- 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 +12 -2
- 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 +124 -118
- package/dist/components/ui/ParquetViewer.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 +9 -9
- 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.js +123 -107
- 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 +46 -38
- package/dist/components/ui/RegisterForm.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 +8 -2
- package/dist/components/ui/SavedQueryBar.js +162 -161
- 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/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +1 -1
- package/dist/components/ui/Select.js +33 -32
- 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 +51 -2
- package/dist/components/ui/ServiceMap.js +314 -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 +22 -0
- package/dist/components/ui/Slider.js +53 -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 +30 -25
- 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 +57 -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/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +16 -15
- package/dist/components/ui/TextField.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/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 +93 -72
- 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 +56 -63
- 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 +9 -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 +39 -0
- package/dist/components/ui/classifyContent.js +169 -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/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/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/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 +49 -58
- 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 +4 -4
- 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 +149 -242
- 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/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 +23 -0
- package/dist/layouts/shell/RouteErrorBoundary.js +35 -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 +32 -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 +24 -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 +77 -65
- 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 +21 -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/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.js +4 -1
- 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 +2 -0
- package/dist/locale/strings.js +2 -0
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +5 -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 +26 -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,53 +1,58 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { usePrimitiveSurface as
|
|
2
|
+
import { useRef as g } from "react";
|
|
3
|
+
import { usePrimitiveSurface as d } from "../../agent/core/usePrimitiveSurface.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
function
|
|
5
|
+
function x(e, n, a) {
|
|
6
6
|
if (e.length === 0)
|
|
7
7
|
return "";
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
return
|
|
8
|
+
const t = Math.min(...e), s = Math.max(...e) - t, i = (r) => s === 0 ? a / 2 : a - (r - t) / s * a;
|
|
9
|
+
if (e.length === 1) {
|
|
10
|
+
const r = i(e[0]).toFixed(2);
|
|
11
|
+
return `M0,${r} L${n.toFixed(2)},${r}`;
|
|
12
|
+
}
|
|
13
|
+
const c = n / (e.length - 1);
|
|
14
|
+
return e.map((r, o) => {
|
|
15
|
+
const l = o * c;
|
|
16
|
+
return `${o === 0 ? "M" : "L"}${l.toFixed(2)},${i(r).toFixed(2)}`;
|
|
12
17
|
}).join(" ");
|
|
13
18
|
}
|
|
14
|
-
function
|
|
19
|
+
function F({
|
|
15
20
|
points: e,
|
|
16
|
-
width:
|
|
21
|
+
width: n = 100,
|
|
17
22
|
height: a = 40,
|
|
18
|
-
strokeWidth:
|
|
19
|
-
withBackdrop:
|
|
23
|
+
strokeWidth: t = 1.5,
|
|
24
|
+
withBackdrop: s = !0,
|
|
20
25
|
inverted: i = !1,
|
|
21
|
-
className:
|
|
22
|
-
ariaLabel:
|
|
23
|
-
surface:
|
|
26
|
+
className: c,
|
|
27
|
+
ariaLabel: r = "sparkline",
|
|
28
|
+
surface: o
|
|
24
29
|
}) {
|
|
25
|
-
const
|
|
30
|
+
const l = g(null), f = d(o, e, "chart", l), p = x(e, n, a), u = [
|
|
26
31
|
"aegis-sparkline",
|
|
27
32
|
i ? "aegis-sparkline--inverted" : "",
|
|
28
|
-
|
|
29
|
-
|
|
33
|
+
s ? "aegis-sparkline--backdrop" : "",
|
|
34
|
+
c ?? ""
|
|
30
35
|
].filter(Boolean).join(" ");
|
|
31
36
|
return /* @__PURE__ */ m(
|
|
32
37
|
"span",
|
|
33
38
|
{
|
|
34
|
-
ref:
|
|
35
|
-
className:
|
|
36
|
-
"aria-label":
|
|
39
|
+
ref: l,
|
|
40
|
+
className: u,
|
|
41
|
+
"aria-label": r,
|
|
37
42
|
role: "img",
|
|
38
|
-
...
|
|
43
|
+
...f,
|
|
39
44
|
children: /* @__PURE__ */ m(
|
|
40
45
|
"svg",
|
|
41
46
|
{
|
|
42
|
-
viewBox: `0 0 ${
|
|
47
|
+
viewBox: `0 0 ${n} ${a}`,
|
|
43
48
|
preserveAspectRatio: "none",
|
|
44
49
|
className: "aegis-sparkline__svg",
|
|
45
50
|
children: /* @__PURE__ */ m(
|
|
46
51
|
"path",
|
|
47
52
|
{
|
|
48
|
-
d:
|
|
53
|
+
d: p,
|
|
49
54
|
className: "aegis-sparkline__line",
|
|
50
|
-
strokeWidth:
|
|
55
|
+
strokeWidth: t
|
|
51
56
|
}
|
|
52
57
|
)
|
|
53
58
|
}
|
|
@@ -56,6 +61,6 @@ function _({
|
|
|
56
61
|
);
|
|
57
62
|
}
|
|
58
63
|
export {
|
|
59
|
-
|
|
64
|
+
F as SparkLine
|
|
60
65
|
};
|
|
61
66
|
//# sourceMappingURL=SparkLine.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SparkLine.js","sources":["../../../src/components/ui/SparkLine.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './SparkLine.css';\n\nexport type SparkLineSurface = PrimitiveSurface<number[]>;\n\ninterface SparkLineProps {\n
|
|
1
|
+
{"version":3,"file":"SparkLine.js","sources":["../../../src/components/ui/SparkLine.tsx"],"sourcesContent":["import { useRef } from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport './SparkLine.css';\n\nexport type SparkLineSurface = PrimitiveSurface<number[]>;\n\ninterface SparkLineProps {\n /**\n * Sample values, spread evenly across the width. A series that does not\n * vary, a single value included, draws a level line through the middle.\n */\n points: number[];\n /** Display dimensions (defaults give a strip-style sparkline). */\n width?: number;\n height?: number;\n /** Stroke thickness. */\n strokeWidth?: number;\n /** Gradient backdrop (panel → page). */\n withBackdrop?: boolean;\n /** Use white stroke for inverted panels. */\n inverted?: boolean;\n className?: string;\n ariaLabel?: string;\n surface?: SparkLineSurface;\n}\n\nfunction buildPath(points: number[], w: number, h: number): string {\n if (points.length === 0) {\n return '';\n }\n const min = Math.min(...points);\n const range = Math.max(...points) - min;\n const yOf = (p: number): number =>\n range === 0 ? h / 2 : h - ((p - min) / range) * h;\n if (points.length === 1) {\n const y = yOf(points[0]).toFixed(2);\n return `M0,${y} L${w.toFixed(2)},${y}`;\n }\n const step = w / (points.length - 1);\n return points\n .map((p, i) => {\n const x = i * step;\n return `${i === 0 ? 'M' : 'L'}${x.toFixed(2)},${yOf(p).toFixed(2)}`;\n })\n .join(' ');\n}\n\nexport function SparkLine({\n points,\n width = 100,\n height = 40,\n strokeWidth = 1.5,\n withBackdrop = true,\n inverted = false,\n className,\n ariaLabel = 'sparkline',\n surface,\n}: SparkLineProps) {\n const wrapRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(surface, points, 'chart', wrapRef);\n const path = buildPath(points, width, height);\n const cls = [\n 'aegis-sparkline',\n inverted ? 'aegis-sparkline--inverted' : '',\n withBackdrop ? 'aegis-sparkline--backdrop' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <span\n ref={wrapRef}\n className={cls}\n aria-label={ariaLabel}\n role=\"img\"\n {...agentAttrs}\n >\n <svg\n viewBox={`0 0 ${width} ${height}`}\n preserveAspectRatio=\"none\"\n className=\"aegis-sparkline__svg\"\n >\n <path\n d={path}\n className=\"aegis-sparkline__line\"\n strokeWidth={strokeWidth}\n />\n </svg>\n </span>\n );\n}\n"],"names":["buildPath","points","w","h","min","range","yOf","p","y","step","i","x","SparkLine","width","height","strokeWidth","withBackdrop","inverted","className","ariaLabel","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","path","cls","jsx"],"mappings":";;;;AA8BA,SAASA,EAAUC,GAAkBC,GAAWC,GAAmB;AACjE,MAAIF,EAAO,WAAW;AACpB,WAAO;AAET,QAAMG,IAAM,KAAK,IAAI,GAAGH,CAAM,GACxBI,IAAQ,KAAK,IAAI,GAAGJ,CAAM,IAAIG,GAC9BE,IAAM,CAACC,MACXF,MAAU,IAAIF,IAAI,IAAIA,KAAMI,IAAIH,KAAOC,IAASF;AAClD,MAAIF,EAAO,WAAW,GAAG;AACvB,UAAMO,IAAIF,EAAIL,EAAO,CAAC,CAAC,EAAE,QAAQ,CAAC;AAClC,WAAO,MAAMO,CAAC,KAAKN,EAAE,QAAQ,CAAC,CAAC,IAAIM,CAAC;AAAA,EACtC;AACA,QAAMC,IAAOP,KAAKD,EAAO,SAAS;AAClC,SAAOA,EACJ,IAAI,CAACM,GAAGG,MAAM;AACb,UAAMC,IAAID,IAAID;AACd,WAAO,GAAGC,MAAM,IAAI,MAAM,GAAG,GAAGC,EAAE,QAAQ,CAAC,CAAC,IAAIL,EAAIC,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACnE,CAAC,EACA,KAAK,GAAG;AACb;AAEO,SAASK,EAAU;AAAA,EACxB,QAAAX;AAAA,EACA,OAAAY,IAAQ;AAAA,EACR,QAAAC,IAAS;AAAA,EACT,aAAAC,IAAc;AAAA,EACd,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC;AACF,GAAmB;AACjB,QAAMC,IAAUC,EAAwB,IAAI,GACtCC,IAAaC,EAAoBJ,GAASnB,GAAQ,SAASoB,CAAO,GAClEI,IAAOzB,EAAUC,GAAQY,GAAOC,CAAM,GACtCY,IAAM;AAAA,IACV;AAAA,IACAT,IAAW,8BAA8B;AAAA,IACzCD,IAAe,8BAA8B;AAAA,IAC7CE,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,SACE,gBAAAS;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAKN;AAAA,MACL,WAAWK;AAAA,MACX,cAAYP;AAAA,MACZ,MAAK;AAAA,MACJ,GAAGI;AAAA,MAEJ,UAAA,gBAAAI;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,SAAS,OAAOd,CAAK,IAAIC,CAAM;AAAA,UAC/B,qBAAoB;AAAA,UACpB,WAAU;AAAA,UAEV,UAAA,gBAAAa;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,GAAGF;AAAA,cACH,WAAU;AAAA,cACV,aAAAV;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),j=require("../../agent/core/usePrimitiveSurface.cjs"),q=require("../../hooks/useIsomorphicLayoutEffect.cjs"),d=require("./MetricLabel.cjs"),x=require("./RollingValue.cjs");;/* empty css */const R="--aegis-stat-count-progress",N="(prefers-reduced-motion: reduce)";function y(n,e,t){const[s,l]=u.useState(!1),[m,a]=u.useState(0);return q.useIsomorphicLayoutEffect(()=>{e&&!window.matchMedia(N).matches&&l(!0)},[e]),u.useEffect(()=>{const f=t.current;if(!s||f===null)return;let i=0;const c=()=>{const o=Number.parseFloat(getComputedStyle(f).getPropertyValue(R));o<1?(a(o),i=requestAnimationFrame(c)):l(!1)};return i=requestAnimationFrame(c),()=>{cancelAnimationFrame(i)}},[s,t]),{counting:s,current:s?n*m:n}}function b({label:n,value:e,unit:t,direction:s="horizontal",emphasized:l=!1,animateValue:m=!1,inverted:a=!1,className:f,surface:i}){const c=u.useRef(null),o=u.useRef(null),S=j.usePrimitiveSurface(i,{label:n,value:e,unit:t},"metric",c),g=typeof e=="number",{counting:p,current:h}=y(g?e:0,m&&g,o),_=["aegis-stat",`aegis-stat--${s}`,l?"aegis-stat--emphasized":"",p?"aegis-stat--counting":"",a?"aegis-stat--inverted":"",f??""].filter(Boolean).join(" ");return r.jsxs("div",{ref:c,className:_,...S,children:[r.jsx(d.MetricLabel,{inverted:a,className:"aegis-stat__label",children:n}),r.jsxs("span",{className:"aegis-stat__measure",children:[r.jsx("span",{ref:o,className:"aegis-stat__value",children:p?h.toFixed((String(e).split(".")[1]??"").length):r.jsx(x.RollingValue,{value:e})}),t&&r.jsx(d.MetricLabel,{inverted:a,className:"aegis-stat__unit",children:t})]})]})}exports.StatBlock=b;
|
|
2
2
|
//# sourceMappingURL=StatBlock.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatBlock.cjs","sources":["../../../src/components/ui/StatBlock.tsx"],"sourcesContent":["import {\n type ReactNode,\n type RefObject,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { MetricLabel } from './MetricLabel';\nimport './StatBlock.css';\n\nexport type StatBlockSurface = PrimitiveSurface<{\n label: ReactNode;\n value: ReactNode;\n unit?: ReactNode;\n}>;\n\ninterface StatBlockProps {\n label: ReactNode;\n value: ReactNode;\n /** Optional unit displayed after the value. */\n unit?: ReactNode;\n /** Layout direction. Default: horizontal (label · value, baseline). */\n direction?: 'horizontal' | 'vertical';\n /** Value in the number type role instead of the numeric role. */\n emphasized?: boolean;\n /**\n * When `value` is a number, counts it up from 0 once on mount over\n * `--motion-chart`, keeping its decimal places. Shows the final value at\n * once under prefers-reduced-motion.\n */\n animateValue?: boolean;\n inverted?: boolean;\n className?: string;\n surface?: StatBlockSurface;\n}\n\nconst COUNT_PROGRESS = '--aegis-stat-count-progress';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * Counts from 0 to `target` once, on mount. The pace comes from the CSS\n * animation of COUNT_PROGRESS on `valueRef` (timed by `--motion-chart`\n * while `counting` is true); the count ends when that progress reads 1.\n * The first render shows `target`, so a prerendered page carries the real\n * number; the count starts before the browser paints.\n */\nfunction useStatCountUp(\n target: number,\n enabled: boolean,\n valueRef: RefObject<HTMLSpanElement | null>,\n): { counting: boolean; current: number } {\n const [counting, setCounting] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useIsomorphicLayoutEffect(() => {\n if (enabled && !window.matchMedia(REDUCED_MOTION).matches) {\n setCounting(true);\n }\n }, [enabled]);\n\n useEffect(() => {\n const node = valueRef.current;\n if (!counting || node === null) {\n return undefined;\n }\n let frame = 0;\n const step = (): void => {\n const next = Number.parseFloat(\n getComputedStyle(node).getPropertyValue(COUNT_PROGRESS),\n );\n if (next < 1) {\n setProgress(next);\n frame = requestAnimationFrame(step);\n } else {\n setCounting(false);\n }\n };\n frame = requestAnimationFrame(step);\n return () => {\n cancelAnimationFrame(frame);\n };\n }, [counting, valueRef]);\n\n return { counting, current: counting ? target * progress : target };\n}\n\nexport function StatBlock({\n label,\n value,\n unit,\n direction = 'horizontal',\n emphasized = false,\n animateValue = false,\n inverted = false,\n className,\n surface,\n}: StatBlockProps) {\n const wrapRef = useRef<HTMLDivElement>(null);\n const valueRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { label, value, unit },\n 'metric',\n wrapRef,\n );\n const numeric = typeof value === 'number';\n const { counting, current } = useStatCountUp(\n numeric ? value : 0,\n animateValue && numeric,\n valueRef,\n );\n const
|
|
1
|
+
{"version":3,"file":"StatBlock.cjs","sources":["../../../src/components/ui/StatBlock.tsx"],"sourcesContent":["import {\n type ReactNode,\n type RefObject,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { MetricLabel } from './MetricLabel';\nimport { RollingValue } from './RollingValue';\nimport './StatBlock.css';\n\nexport type StatBlockSurface = PrimitiveSurface<{\n label: ReactNode;\n value: ReactNode;\n unit?: ReactNode;\n}>;\n\ninterface StatBlockProps {\n label: ReactNode;\n value: ReactNode;\n /** Optional unit displayed after the value. */\n unit?: ReactNode;\n /** Layout direction. Default: horizontal (label · value, baseline). */\n direction?: 'horizontal' | 'vertical';\n /** Value in the number type role instead of the numeric role. */\n emphasized?: boolean;\n /**\n * When `value` is a number, counts it up from 0 once on mount over\n * `--motion-chart`, keeping its decimal places. Shows the final value at\n * once under prefers-reduced-motion.\n */\n animateValue?: boolean;\n inverted?: boolean;\n className?: string;\n surface?: StatBlockSurface;\n}\n\nconst COUNT_PROGRESS = '--aegis-stat-count-progress';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * Counts from 0 to `target` once, on mount. The pace comes from the CSS\n * animation of COUNT_PROGRESS on `valueRef` (timed by `--motion-chart`\n * while `counting` is true); the count ends when that progress reads 1.\n * The first render shows `target`, so a prerendered page carries the real\n * number; the count starts before the browser paints.\n */\nfunction useStatCountUp(\n target: number,\n enabled: boolean,\n valueRef: RefObject<HTMLSpanElement | null>,\n): { counting: boolean; current: number } {\n const [counting, setCounting] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useIsomorphicLayoutEffect(() => {\n if (enabled && !window.matchMedia(REDUCED_MOTION).matches) {\n setCounting(true);\n }\n }, [enabled]);\n\n useEffect(() => {\n const node = valueRef.current;\n if (!counting || node === null) {\n return undefined;\n }\n let frame = 0;\n const step = (): void => {\n const next = Number.parseFloat(\n getComputedStyle(node).getPropertyValue(COUNT_PROGRESS),\n );\n if (next < 1) {\n setProgress(next);\n frame = requestAnimationFrame(step);\n } else {\n setCounting(false);\n }\n };\n frame = requestAnimationFrame(step);\n return () => {\n cancelAnimationFrame(frame);\n };\n }, [counting, valueRef]);\n\n return { counting, current: counting ? target * progress : target };\n}\n\nexport function StatBlock({\n label,\n value,\n unit,\n direction = 'horizontal',\n emphasized = false,\n animateValue = false,\n inverted = false,\n className,\n surface,\n}: StatBlockProps) {\n const wrapRef = useRef<HTMLDivElement>(null);\n const valueRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { label, value, unit },\n 'metric',\n wrapRef,\n );\n const numeric = typeof value === 'number';\n const { counting, current } = useStatCountUp(\n numeric ? value : 0,\n animateValue && numeric,\n valueRef,\n );\n const cls = [\n 'aegis-stat',\n `aegis-stat--${direction}`,\n emphasized ? 'aegis-stat--emphasized' : '',\n counting ? 'aegis-stat--counting' : '',\n inverted ? 'aegis-stat--inverted' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div ref={wrapRef} className={cls} {...agentAttrs}>\n <MetricLabel inverted={inverted} className=\"aegis-stat__label\">\n {label}\n </MetricLabel>\n <span className=\"aegis-stat__measure\">\n <span ref={valueRef} className=\"aegis-stat__value\">\n {counting ? (\n current.toFixed((String(value).split('.')[1] ?? '').length)\n ) : (\n <RollingValue value={value} />\n )}\n </span>\n {unit && (\n <MetricLabel inverted={inverted} className=\"aegis-stat__unit\">\n {unit}\n </MetricLabel>\n )}\n </span>\n </div>\n );\n}\n"],"names":["COUNT_PROGRESS","REDUCED_MOTION","useStatCountUp","target","enabled","valueRef","counting","setCounting","useState","progress","setProgress","useIsomorphicLayoutEffect","useEffect","node","frame","step","next","StatBlock","label","value","unit","direction","emphasized","animateValue","inverted","className","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","numeric","current","cls","jsx","MetricLabel","jsxs","RollingValue"],"mappings":"mVA2CA,MAAMA,EAAiB,8BACjBC,EAAiB,mCASvB,SAASC,EACPC,EACAC,EACAC,EACwC,CACxC,KAAM,CAACC,EAAUC,CAAW,EAAIC,EAAAA,SAAS,EAAK,EACxC,CAACC,EAAUC,CAAW,EAAIF,EAAAA,SAAS,CAAC,EAE1CG,OAAAA,EAAAA,0BAA0B,IAAM,CAC1BP,GAAW,CAAC,OAAO,WAAWH,CAAc,EAAE,SAChDM,EAAY,EAAI,CAEpB,EAAG,CAACH,CAAO,CAAC,EAEZQ,EAAAA,UAAU,IAAM,CACd,MAAMC,EAAOR,EAAS,QACtB,GAAI,CAACC,GAAYO,IAAS,KACxB,OAEF,IAAIC,EAAQ,EACZ,MAAMC,EAAO,IAAY,CACvB,MAAMC,EAAO,OAAO,WAClB,iBAAiBH,CAAI,EAAE,iBAAiBb,CAAc,CAAA,EAEpDgB,EAAO,GACTN,EAAYM,CAAI,EAChBF,EAAQ,sBAAsBC,CAAI,GAElCR,EAAY,EAAK,CAErB,EACA,OAAAO,EAAQ,sBAAsBC,CAAI,EAC3B,IAAM,CACX,qBAAqBD,CAAK,CAC5B,CACF,EAAG,CAACR,EAAUD,CAAQ,CAAC,EAEhB,CAAE,SAAAC,EAAU,QAASA,EAAWH,EAASM,EAAWN,CAAA,CAC7D,CAEO,SAASc,EAAU,CACxB,MAAAC,EACA,MAAAC,EACA,KAAAC,EACA,UAAAC,EAAY,aACZ,WAAAC,EAAa,GACb,aAAAC,EAAe,GACf,SAAAC,EAAW,GACX,UAAAC,EACA,QAAAC,CACF,EAAmB,CACjB,MAAMC,EAAUC,EAAAA,OAAuB,IAAI,EACrCvB,EAAWuB,EAAAA,OAAwB,IAAI,EACvCC,EAAaC,EAAAA,oBACjBJ,EACA,CAAE,MAAAR,EAAO,MAAAC,EAAO,KAAAC,CAAA,EAChB,SACAO,CAAA,EAEII,EAAU,OAAOZ,GAAU,SAC3B,CAAE,SAAAb,EAAU,QAAA0B,CAAA,EAAY9B,EAC5B6B,EAAUZ,EAAQ,EAClBI,GAAgBQ,EAChB1B,CAAA,EAEI4B,EAAM,CACV,aACA,eAAeZ,CAAS,GACxBC,EAAa,yBAA2B,GACxChB,EAAW,uBAAyB,GACpCkB,EAAW,uBAAyB,GACpCC,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,cACG,MAAA,CAAI,IAAKE,EAAS,UAAWM,EAAM,GAAGJ,EACrC,SAAA,CAAAK,EAAAA,IAACC,EAAAA,YAAA,CAAY,SAAAX,EAAoB,UAAU,oBACxC,SAAAN,EACH,EACAkB,EAAAA,KAAC,OAAA,CAAK,UAAU,sBACd,SAAA,CAAAF,EAAAA,IAAC,OAAA,CAAK,IAAK7B,EAAU,UAAU,oBAC5B,SAAAC,EACC0B,EAAQ,SAAS,OAAOb,CAAK,EAAE,MAAM,GAAG,EAAE,CAAC,GAAK,IAAI,MAAM,EAE1De,EAAAA,IAACG,EAAAA,aAAA,CAAa,MAAAlB,CAAA,CAAc,CAAA,CAEhC,EACCC,GACCc,EAAAA,IAACC,EAAAA,YAAA,CAAY,SAAAX,EAAoB,UAAU,mBACxC,SAAAJ,CAAA,CACH,CAAA,CAAA,CAEJ,CAAA,EACF,CAEJ"}
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsxs as g, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as d, useState as h, useEffect as
|
|
3
|
-
import { usePrimitiveSurface as
|
|
4
|
-
import { useIsomorphicLayoutEffect as
|
|
2
|
+
import { useRef as d, useState as h, useEffect as x } from "react";
|
|
3
|
+
import { usePrimitiveSurface as C } from "../../agent/core/usePrimitiveSurface.js";
|
|
4
|
+
import { useIsomorphicLayoutEffect as E } from "../../hooks/useIsomorphicLayoutEffect.js";
|
|
5
5
|
import { MetricLabel as _ } from "./MetricLabel.js";
|
|
6
|
+
import { RollingValue as F } from "./RollingValue.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
const
|
|
8
|
-
function
|
|
8
|
+
const y = "--aegis-stat-count-progress", A = "(prefers-reduced-motion: reduce)";
|
|
9
|
+
function O(r, t, e) {
|
|
9
10
|
const [s, c] = h(!1), [u, n] = h(0);
|
|
10
|
-
return
|
|
11
|
-
t && !window.matchMedia(
|
|
12
|
-
}, [t]),
|
|
11
|
+
return E(() => {
|
|
12
|
+
t && !window.matchMedia(A).matches && c(!0);
|
|
13
|
+
}, [t]), x(() => {
|
|
13
14
|
const m = e.current;
|
|
14
15
|
if (!s || m === null)
|
|
15
16
|
return;
|
|
16
17
|
let o = 0;
|
|
17
18
|
const a = () => {
|
|
18
19
|
const i = Number.parseFloat(
|
|
19
|
-
getComputedStyle(m).getPropertyValue(
|
|
20
|
+
getComputedStyle(m).getPropertyValue(y)
|
|
20
21
|
);
|
|
21
22
|
i < 1 ? (n(i), o = requestAnimationFrame(a)) : c(!1);
|
|
22
23
|
};
|
|
@@ -25,7 +26,7 @@ function A(r, t, e) {
|
|
|
25
26
|
};
|
|
26
27
|
}, [s, e]), { counting: s, current: s ? r * u : r };
|
|
27
28
|
}
|
|
28
|
-
function
|
|
29
|
+
function z({
|
|
29
30
|
label: r,
|
|
30
31
|
value: t,
|
|
31
32
|
unit: e,
|
|
@@ -36,16 +37,16 @@ function q({
|
|
|
36
37
|
className: m,
|
|
37
38
|
surface: o
|
|
38
39
|
}) {
|
|
39
|
-
const a = d(null), i = d(null), N =
|
|
40
|
+
const a = d(null), i = d(null), N = C(
|
|
40
41
|
o,
|
|
41
42
|
{ label: r, value: t, unit: e },
|
|
42
43
|
"metric",
|
|
43
44
|
a
|
|
44
|
-
), f = typeof t == "number", { counting: p, current: S } =
|
|
45
|
+
), f = typeof t == "number", { counting: p, current: S } = O(
|
|
45
46
|
f ? t : 0,
|
|
46
47
|
u && f,
|
|
47
48
|
i
|
|
48
|
-
),
|
|
49
|
+
), R = [
|
|
49
50
|
"aegis-stat",
|
|
50
51
|
`aegis-stat--${s}`,
|
|
51
52
|
c ? "aegis-stat--emphasized" : "",
|
|
@@ -53,15 +54,15 @@ function q({
|
|
|
53
54
|
n ? "aegis-stat--inverted" : "",
|
|
54
55
|
m ?? ""
|
|
55
56
|
].filter(Boolean).join(" ");
|
|
56
|
-
return /* @__PURE__ */ g("div", { ref: a, className:
|
|
57
|
+
return /* @__PURE__ */ g("div", { ref: a, className: R, ...N, children: [
|
|
57
58
|
/* @__PURE__ */ l(_, { inverted: n, className: "aegis-stat__label", children: r }),
|
|
58
59
|
/* @__PURE__ */ g("span", { className: "aegis-stat__measure", children: [
|
|
59
|
-
/* @__PURE__ */ l("span", { ref: i, className: "aegis-stat__value", children:
|
|
60
|
+
/* @__PURE__ */ l("span", { ref: i, className: "aegis-stat__value", children: p ? S.toFixed((String(t).split(".")[1] ?? "").length) : /* @__PURE__ */ l(F, { value: t }) }),
|
|
60
61
|
e && /* @__PURE__ */ l(_, { inverted: n, className: "aegis-stat__unit", children: e })
|
|
61
62
|
] })
|
|
62
63
|
] });
|
|
63
64
|
}
|
|
64
65
|
export {
|
|
65
|
-
|
|
66
|
+
z as StatBlock
|
|
66
67
|
};
|
|
67
68
|
//# sourceMappingURL=StatBlock.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatBlock.js","sources":["../../../src/components/ui/StatBlock.tsx"],"sourcesContent":["import {\n type ReactNode,\n type RefObject,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { MetricLabel } from './MetricLabel';\nimport './StatBlock.css';\n\nexport type StatBlockSurface = PrimitiveSurface<{\n label: ReactNode;\n value: ReactNode;\n unit?: ReactNode;\n}>;\n\ninterface StatBlockProps {\n label: ReactNode;\n value: ReactNode;\n /** Optional unit displayed after the value. */\n unit?: ReactNode;\n /** Layout direction. Default: horizontal (label · value, baseline). */\n direction?: 'horizontal' | 'vertical';\n /** Value in the number type role instead of the numeric role. */\n emphasized?: boolean;\n /**\n * When `value` is a number, counts it up from 0 once on mount over\n * `--motion-chart`, keeping its decimal places. Shows the final value at\n * once under prefers-reduced-motion.\n */\n animateValue?: boolean;\n inverted?: boolean;\n className?: string;\n surface?: StatBlockSurface;\n}\n\nconst COUNT_PROGRESS = '--aegis-stat-count-progress';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * Counts from 0 to `target` once, on mount. The pace comes from the CSS\n * animation of COUNT_PROGRESS on `valueRef` (timed by `--motion-chart`\n * while `counting` is true); the count ends when that progress reads 1.\n * The first render shows `target`, so a prerendered page carries the real\n * number; the count starts before the browser paints.\n */\nfunction useStatCountUp(\n target: number,\n enabled: boolean,\n valueRef: RefObject<HTMLSpanElement | null>,\n): { counting: boolean; current: number } {\n const [counting, setCounting] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useIsomorphicLayoutEffect(() => {\n if (enabled && !window.matchMedia(REDUCED_MOTION).matches) {\n setCounting(true);\n }\n }, [enabled]);\n\n useEffect(() => {\n const node = valueRef.current;\n if (!counting || node === null) {\n return undefined;\n }\n let frame = 0;\n const step = (): void => {\n const next = Number.parseFloat(\n getComputedStyle(node).getPropertyValue(COUNT_PROGRESS),\n );\n if (next < 1) {\n setProgress(next);\n frame = requestAnimationFrame(step);\n } else {\n setCounting(false);\n }\n };\n frame = requestAnimationFrame(step);\n return () => {\n cancelAnimationFrame(frame);\n };\n }, [counting, valueRef]);\n\n return { counting, current: counting ? target * progress : target };\n}\n\nexport function StatBlock({\n label,\n value,\n unit,\n direction = 'horizontal',\n emphasized = false,\n animateValue = false,\n inverted = false,\n className,\n surface,\n}: StatBlockProps) {\n const wrapRef = useRef<HTMLDivElement>(null);\n const valueRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { label, value, unit },\n 'metric',\n wrapRef,\n );\n const numeric = typeof value === 'number';\n const { counting, current } = useStatCountUp(\n numeric ? value : 0,\n animateValue && numeric,\n valueRef,\n );\n const
|
|
1
|
+
{"version":3,"file":"StatBlock.js","sources":["../../../src/components/ui/StatBlock.tsx"],"sourcesContent":["import {\n type ReactNode,\n type RefObject,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\nimport {\n type PrimitiveSurface,\n usePrimitiveSurface,\n} from '../../agent/core/usePrimitiveSurface';\nimport { useIsomorphicLayoutEffect } from '../../hooks/useIsomorphicLayoutEffect';\nimport { MetricLabel } from './MetricLabel';\nimport { RollingValue } from './RollingValue';\nimport './StatBlock.css';\n\nexport type StatBlockSurface = PrimitiveSurface<{\n label: ReactNode;\n value: ReactNode;\n unit?: ReactNode;\n}>;\n\ninterface StatBlockProps {\n label: ReactNode;\n value: ReactNode;\n /** Optional unit displayed after the value. */\n unit?: ReactNode;\n /** Layout direction. Default: horizontal (label · value, baseline). */\n direction?: 'horizontal' | 'vertical';\n /** Value in the number type role instead of the numeric role. */\n emphasized?: boolean;\n /**\n * When `value` is a number, counts it up from 0 once on mount over\n * `--motion-chart`, keeping its decimal places. Shows the final value at\n * once under prefers-reduced-motion.\n */\n animateValue?: boolean;\n inverted?: boolean;\n className?: string;\n surface?: StatBlockSurface;\n}\n\nconst COUNT_PROGRESS = '--aegis-stat-count-progress';\nconst REDUCED_MOTION = '(prefers-reduced-motion: reduce)';\n\n/**\n * Counts from 0 to `target` once, on mount. The pace comes from the CSS\n * animation of COUNT_PROGRESS on `valueRef` (timed by `--motion-chart`\n * while `counting` is true); the count ends when that progress reads 1.\n * The first render shows `target`, so a prerendered page carries the real\n * number; the count starts before the browser paints.\n */\nfunction useStatCountUp(\n target: number,\n enabled: boolean,\n valueRef: RefObject<HTMLSpanElement | null>,\n): { counting: boolean; current: number } {\n const [counting, setCounting] = useState(false);\n const [progress, setProgress] = useState(0);\n\n useIsomorphicLayoutEffect(() => {\n if (enabled && !window.matchMedia(REDUCED_MOTION).matches) {\n setCounting(true);\n }\n }, [enabled]);\n\n useEffect(() => {\n const node = valueRef.current;\n if (!counting || node === null) {\n return undefined;\n }\n let frame = 0;\n const step = (): void => {\n const next = Number.parseFloat(\n getComputedStyle(node).getPropertyValue(COUNT_PROGRESS),\n );\n if (next < 1) {\n setProgress(next);\n frame = requestAnimationFrame(step);\n } else {\n setCounting(false);\n }\n };\n frame = requestAnimationFrame(step);\n return () => {\n cancelAnimationFrame(frame);\n };\n }, [counting, valueRef]);\n\n return { counting, current: counting ? target * progress : target };\n}\n\nexport function StatBlock({\n label,\n value,\n unit,\n direction = 'horizontal',\n emphasized = false,\n animateValue = false,\n inverted = false,\n className,\n surface,\n}: StatBlockProps) {\n const wrapRef = useRef<HTMLDivElement>(null);\n const valueRef = useRef<HTMLSpanElement>(null);\n const agentAttrs = usePrimitiveSurface(\n surface,\n { label, value, unit },\n 'metric',\n wrapRef,\n );\n const numeric = typeof value === 'number';\n const { counting, current } = useStatCountUp(\n numeric ? value : 0,\n animateValue && numeric,\n valueRef,\n );\n const cls = [\n 'aegis-stat',\n `aegis-stat--${direction}`,\n emphasized ? 'aegis-stat--emphasized' : '',\n counting ? 'aegis-stat--counting' : '',\n inverted ? 'aegis-stat--inverted' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <div ref={wrapRef} className={cls} {...agentAttrs}>\n <MetricLabel inverted={inverted} className=\"aegis-stat__label\">\n {label}\n </MetricLabel>\n <span className=\"aegis-stat__measure\">\n <span ref={valueRef} className=\"aegis-stat__value\">\n {counting ? (\n current.toFixed((String(value).split('.')[1] ?? '').length)\n ) : (\n <RollingValue value={value} />\n )}\n </span>\n {unit && (\n <MetricLabel inverted={inverted} className=\"aegis-stat__unit\">\n {unit}\n </MetricLabel>\n )}\n </span>\n </div>\n );\n}\n"],"names":["COUNT_PROGRESS","REDUCED_MOTION","useStatCountUp","target","enabled","valueRef","counting","setCounting","useState","progress","setProgress","useIsomorphicLayoutEffect","useEffect","node","frame","step","next","StatBlock","label","value","unit","direction","emphasized","animateValue","inverted","className","surface","wrapRef","useRef","agentAttrs","usePrimitiveSurface","numeric","current","cls","jsx","MetricLabel","jsxs","RollingValue"],"mappings":";;;;;;;AA2CA,MAAMA,IAAiB,+BACjBC,IAAiB;AASvB,SAASC,EACPC,GACAC,GACAC,GACwC;AACxC,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAK,GACxC,CAACC,GAAUC,CAAW,IAAIF,EAAS,CAAC;AAE1C,SAAAG,EAA0B,MAAM;AAC9B,IAAIP,KAAW,CAAC,OAAO,WAAWH,CAAc,EAAE,WAChDM,EAAY,EAAI;AAAA,EAEpB,GAAG,CAACH,CAAO,CAAC,GAEZQ,EAAU,MAAM;AACd,UAAMC,IAAOR,EAAS;AACtB,QAAI,CAACC,KAAYO,MAAS;AACxB;AAEF,QAAIC,IAAQ;AACZ,UAAMC,IAAO,MAAY;AACvB,YAAMC,IAAO,OAAO;AAAA,QAClB,iBAAiBH,CAAI,EAAE,iBAAiBb,CAAc;AAAA,MAAA;AAExD,MAAIgB,IAAO,KACTN,EAAYM,CAAI,GAChBF,IAAQ,sBAAsBC,CAAI,KAElCR,EAAY,EAAK;AAAA,IAErB;AACA,WAAAO,IAAQ,sBAAsBC,CAAI,GAC3B,MAAM;AACX,2BAAqBD,CAAK;AAAA,IAC5B;AAAA,EACF,GAAG,CAACR,GAAUD,CAAQ,CAAC,GAEhB,EAAE,UAAAC,GAAU,SAASA,IAAWH,IAASM,IAAWN,EAAA;AAC7D;AAEO,SAASc,EAAU;AAAA,EACxB,OAAAC;AAAA,EACA,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,YAAAC,IAAa;AAAA,EACb,cAAAC,IAAe;AAAA,EACf,UAAAC,IAAW;AAAA,EACX,WAAAC;AAAA,EACA,SAAAC;AACF,GAAmB;AACjB,QAAMC,IAAUC,EAAuB,IAAI,GACrCvB,IAAWuB,EAAwB,IAAI,GACvCC,IAAaC;AAAA,IACjBJ;AAAA,IACA,EAAE,OAAAR,GAAO,OAAAC,GAAO,MAAAC,EAAA;AAAA,IAChB;AAAA,IACAO;AAAA,EAAA,GAEII,IAAU,OAAOZ,KAAU,UAC3B,EAAE,UAAAb,GAAU,SAAA0B,EAAA,IAAY9B;AAAA,IAC5B6B,IAAUZ,IAAQ;AAAA,IAClBI,KAAgBQ;AAAA,IAChB1B;AAAA,EAAA,GAEI4B,IAAM;AAAA,IACV;AAAA,IACA,eAAeZ,CAAS;AAAA,IACxBC,IAAa,2BAA2B;AAAA,IACxChB,IAAW,yBAAyB;AAAA,IACpCkB,IAAW,yBAAyB;AAAA,IACpCC,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,2BACG,OAAA,EAAI,KAAKE,GAAS,WAAWM,GAAM,GAAGJ,GACrC,UAAA;AAAA,IAAA,gBAAAK,EAACC,GAAA,EAAY,UAAAX,GAAoB,WAAU,qBACxC,UAAAN,GACH;AAAA,IACA,gBAAAkB,EAAC,QAAA,EAAK,WAAU,uBACd,UAAA;AAAA,MAAA,gBAAAF,EAAC,QAAA,EAAK,KAAK7B,GAAU,WAAU,qBAC5B,UAAAC,IACC0B,EAAQ,SAAS,OAAOb,CAAK,EAAE,MAAM,GAAG,EAAE,CAAC,KAAK,IAAI,MAAM,IAE1D,gBAAAe,EAACG,GAAA,EAAa,OAAAlB,EAAA,CAAc,EAAA,CAEhC;AAAA,MACCC,KACC,gBAAAc,EAACC,GAAA,EAAY,UAAAX,GAAoB,WAAU,oBACxC,UAAAJ,EAAA,CACH;AAAA,IAAA,EAAA,CAEJ;AAAA,EAAA,GACF;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDot.cjs","sources":["../../../src/components/ui/StatusDot.tsx"],"sourcesContent":["import './StatusDot.css';\n\ninterface StatusDotProps {\n pulse?: boolean;\n tone?: 'ink' | 'inverted' | 'warning' | 'muted' | 'success';\n size?: number;\n className?: string;\n}\n\nexport function StatusDot({\n pulse = false,\n tone = 'ink',\n size = 6,\n className,\n}: StatusDotProps) {\n const cls = [\n 'aegis-status-dot',\n `aegis-status-dot--${tone}`,\n pulse ? 'aegis-status-dot--pulse' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <span\n className={cls}\n style={{ width: size, height: size }}\n aria-hidden=\"true\"\n />\n );\n}\n"],"names":["StatusDot","pulse","tone","size","className","cls","jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"StatusDot.cjs","sources":["../../../src/components/ui/StatusDot.tsx"],"sourcesContent":["import './StatusDot.css';\n\ninterface StatusDotProps {\n pulse?: boolean;\n /**\n * Fill colour. `warning` is the anomaly red, for failures only; `caution`\n * is `--ink-warn`, for what needs attention but has not failed.\n */\n tone?: 'ink' | 'inverted' | 'warning' | 'caution' | 'muted' | 'success';\n size?: number;\n className?: string;\n}\n\nexport function StatusDot({\n pulse = false,\n tone = 'ink',\n size = 6,\n className,\n}: StatusDotProps) {\n const cls = [\n 'aegis-status-dot',\n `aegis-status-dot--${tone}`,\n pulse ? 'aegis-status-dot--pulse' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <span\n className={cls}\n style={{ width: size, height: size }}\n aria-hidden=\"true\"\n />\n );\n}\n"],"names":["StatusDot","pulse","tone","size","className","cls","jsx"],"mappings":"oJAaO,SAASA,EAAU,CACxB,MAAAC,EAAQ,GACR,KAAAC,EAAO,MACP,KAAAC,EAAO,EACP,UAAAC,CACF,EAAmB,CACjB,MAAMC,EAAM,CACV,mBACA,qBAAqBH,CAAI,GACzBD,EAAQ,0BAA4B,GACpCG,GAAa,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG,EACX,OACEE,EAAAA,IAAC,OAAA,CACC,UAAWD,EACX,MAAO,CAAE,MAAOF,EAAM,OAAQA,CAAA,EAC9B,cAAY,MAAA,CAAA,CAGlB"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
interface StatusDotProps {
|
|
2
2
|
pulse?: boolean;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fill colour. `warning` is the anomaly red, for failures only; `caution`
|
|
5
|
+
* is `--ink-warn`, for what needs attention but has not failed.
|
|
6
|
+
*/
|
|
7
|
+
tone?: 'ink' | 'inverted' | 'warning' | 'caution' | 'muted' | 'success';
|
|
4
8
|
size?: number;
|
|
5
9
|
className?: string;
|
|
6
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusDot.js","sources":["../../../src/components/ui/StatusDot.tsx"],"sourcesContent":["import './StatusDot.css';\n\ninterface StatusDotProps {\n pulse?: boolean;\n tone?: 'ink' | 'inverted' | 'warning' | 'muted' | 'success';\n size?: number;\n className?: string;\n}\n\nexport function StatusDot({\n pulse = false,\n tone = 'ink',\n size = 6,\n className,\n}: StatusDotProps) {\n const cls = [\n 'aegis-status-dot',\n `aegis-status-dot--${tone}`,\n pulse ? 'aegis-status-dot--pulse' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <span\n className={cls}\n style={{ width: size, height: size }}\n aria-hidden=\"true\"\n />\n );\n}\n"],"names":["StatusDot","pulse","tone","size","className","cls","jsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"StatusDot.js","sources":["../../../src/components/ui/StatusDot.tsx"],"sourcesContent":["import './StatusDot.css';\n\ninterface StatusDotProps {\n pulse?: boolean;\n /**\n * Fill colour. `warning` is the anomaly red, for failures only; `caution`\n * is `--ink-warn`, for what needs attention but has not failed.\n */\n tone?: 'ink' | 'inverted' | 'warning' | 'caution' | 'muted' | 'success';\n size?: number;\n className?: string;\n}\n\nexport function StatusDot({\n pulse = false,\n tone = 'ink',\n size = 6,\n className,\n}: StatusDotProps) {\n const cls = [\n 'aegis-status-dot',\n `aegis-status-dot--${tone}`,\n pulse ? 'aegis-status-dot--pulse' : '',\n className ?? '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <span\n className={cls}\n style={{ width: size, height: size }}\n aria-hidden=\"true\"\n />\n );\n}\n"],"names":["StatusDot","pulse","tone","size","className","cls","jsx"],"mappings":";;AAaO,SAASA,EAAU;AAAA,EACxB,OAAAC,IAAQ;AAAA,EACR,MAAAC,IAAO;AAAA,EACP,MAAAC,IAAO;AAAA,EACP,WAAAC;AACF,GAAmB;AACjB,QAAMC,IAAM;AAAA,IACV;AAAA,IACA,qBAAqBH,CAAI;AAAA,IACzBD,IAAQ,4BAA4B;AAAA,IACpCG,KAAa;AAAA,EAAA,EAEZ,OAAO,OAAO,EACd,KAAK,GAAG;AACX,SACE,gBAAAE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWD;AAAA,MACX,OAAO,EAAE,OAAOF,GAAM,QAAQA,EAAA;AAAA,MAC9B,eAAY;AAAA,IAAA;AAAA,EAAA;AAGlB;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("@ant-design/icons");;/* empty css */const _={complete:"completed",current:"current step",upcoming:void 0};function g(t,a){return t<a?"complete":t===a?"current":"upcoming"}function h({items:t,current:a,onStepClick:c,ariaLabel:o,className:p}){const u=["aegis-steps",p??""].filter(Boolean).join(" ");return e.jsx("ol",{className:u,"aria-label":o,children:t.map((n,r)=>{const s=g(r,a),i=n.disabled===!0&&s==="upcoming"?"not yet available":_[s],l=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"aegis-steps__marker","aria-hidden":"true",children:s==="complete"?e.jsx(m.CheckOutlined,{}):r+1}),e.jsx("span",{className:"aegis-steps__hidden",children:`${String(r+1)}. `}),e.jsx("span",{className:"aegis-steps__label",children:n.label}),i!==void 0&&e.jsx("span",{className:"aegis-steps__hidden",children:` (${i})`})]}),d=c!==void 0&&s!=="current"&&n.disabled!==!0;return e.jsx("li",{className:`aegis-steps__item aegis-steps__item--${s}`,children:d?e.jsx("button",{type:"button",className:"aegis-steps__step",onClick:()=>{c(r)},children:l}):e.jsx("span",{className:"aegis-steps__step","aria-current":s==="current"?"step":void 0,children:l})},n.key)})})}exports.Steps=h;
|
|
2
|
+
//# sourceMappingURL=Steps.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.cjs","sources":["../../../src/components/ui/Steps.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { CheckOutlined } from '@ant-design/icons';\n\nimport './Steps.css';\n\nexport interface StepsItem {\n key: string;\n label: ReactNode;\n /** Keeps the step from being clicked, e.g. a later step whose earlier steps are incomplete. */\n disabled?: boolean;\n}\n\ninterface StepsProps {\n items: StepsItem[];\n /** Index of the current step; the steps before it show as complete. */\n current: number;\n /** Makes every step but the current one a button that reports its index. */\n onStepClick?: (index: number) => void;\n /** Accessible name of the list, e.g. `Install steps`. */\n ariaLabel: string;\n className?: string;\n}\n\ntype StepState = 'complete' | 'current' | 'upcoming';\n\n/** The state the marker shows, put into words for assistive tech. */\nconst STATE_TEXT: Record<StepState, string | undefined> = {\n complete: 'completed',\n current: 'current step',\n upcoming: undefined,\n};\n\nfunction stepState(index: number, current: number): StepState {\n if (index < current) {\n return 'complete';\n }\n return index === current ? 'current' : 'upcoming';\n}\n\nexport function Steps({\n items,\n current,\n onStepClick,\n ariaLabel,\n className,\n}: StepsProps) {\n const cls = ['aegis-steps', className ?? ''].filter(Boolean).join(' ');\n return (\n <ol className={cls} aria-label={ariaLabel}>\n {items.map((item, index) => {\n const state = stepState(index, current);\n const spoken =\n item.disabled === true && state === 'upcoming'\n ? 'not yet available'\n : STATE_TEXT[state];\n const content = (\n <>\n <span className=\"aegis-steps__marker\" aria-hidden=\"true\">\n {state === 'complete' ? <CheckOutlined /> : index + 1}\n </span>\n <span className=\"aegis-steps__hidden\">{`${String(index + 1)}. `}</span>\n <span className=\"aegis-steps__label\">{item.label}</span>\n {spoken !== undefined && (\n <span className=\"aegis-steps__hidden\">{` (${spoken})`}</span>\n )}\n </>\n );\n const clickable =\n onStepClick !== undefined &&\n state !== 'current' &&\n item.disabled !== true;\n return (\n <li\n key={item.key}\n className={`aegis-steps__item aegis-steps__item--${state}`}\n >\n {clickable ? (\n <button\n type=\"button\"\n className=\"aegis-steps__step\"\n onClick={() => {\n onStepClick(index);\n }}\n >\n {content}\n </button>\n ) : (\n <span\n className=\"aegis-steps__step\"\n aria-current={state === 'current' ? 'step' : undefined}\n >\n {content}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n );\n}\n"],"names":["STATE_TEXT","stepState","index","current","Steps","items","onStepClick","ariaLabel","className","cls","jsx","item","state","spoken","content","jsxs","Fragment","CheckOutlined","clickable"],"mappings":"+KA2BA,MAAMA,EAAoD,CACxD,SAAU,YACV,QAAS,eACT,SAAU,MACZ,EAEA,SAASC,EAAUC,EAAeC,EAA4B,CAC5D,OAAID,EAAQC,EACH,WAEFD,IAAUC,EAAU,UAAY,UACzC,CAEO,SAASC,EAAM,CACpB,MAAAC,EACA,QAAAF,EACA,YAAAG,EACA,UAAAC,EACA,UAAAC,CACF,EAAe,CACb,MAAMC,EAAM,CAAC,cAAeD,GAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EACrE,OACEE,EAAAA,IAAC,KAAA,CAAG,UAAWD,EAAK,aAAYF,EAC7B,SAAAF,EAAM,IAAI,CAACM,EAAMT,IAAU,CAC1B,MAAMU,EAAQX,EAAUC,EAAOC,CAAO,EAChCU,EACJF,EAAK,WAAa,IAAQC,IAAU,WAChC,oBACAZ,EAAWY,CAAK,EAChBE,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACE,SAAA,CAAAN,EAAAA,IAAC,OAAA,CAAK,UAAU,sBAAsB,cAAY,OAC/C,SAAAE,IAAU,WAAaF,EAAAA,IAACO,EAAAA,cAAA,CAAA,CAAc,EAAKf,EAAQ,EACtD,EACAQ,EAAAA,IAAC,QAAK,UAAU,sBAAuB,YAAG,OAAOR,EAAQ,CAAC,CAAC,IAAA,CAAK,EAChEQ,EAAAA,IAAC,OAAA,CAAK,UAAU,qBAAsB,WAAK,MAAM,EAChDG,IAAW,QACVH,MAAC,OAAA,CAAK,UAAU,sBAAuB,SAAA,KAAKG,CAAM,GAAA,CAAI,CAAA,EAE1D,EAEIK,EACJZ,IAAgB,QAChBM,IAAU,WACVD,EAAK,WAAa,GACpB,OACED,EAAAA,IAAC,KAAA,CAEC,UAAW,wCAAwCE,CAAK,GAEvD,SAAAM,EACCR,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,oBACV,QAAS,IAAM,CACbJ,EAAYJ,CAAK,CACnB,EAEC,SAAAY,CAAA,CAAA,EAGHJ,EAAAA,IAAC,OAAA,CACC,UAAU,oBACV,eAAcE,IAAU,UAAY,OAAS,OAE5C,SAAAE,CAAA,CAAA,CACH,EAnBGH,EAAK,GAAA,CAuBhB,CAAC,CAAA,CACH,CAEJ"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface StepsItem {
|
|
3
|
+
key: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Keeps the step from being clicked, e.g. a later step whose earlier steps are incomplete. */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
interface StepsProps {
|
|
9
|
+
items: StepsItem[];
|
|
10
|
+
/** Index of the current step; the steps before it show as complete. */
|
|
11
|
+
current: number;
|
|
12
|
+
/** Makes every step but the current one a button that reports its index. */
|
|
13
|
+
onStepClick?: (index: number) => void;
|
|
14
|
+
/** Accessible name of the list, e.g. `Install steps`. */
|
|
15
|
+
ariaLabel: string;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function Steps({ items, current, onStepClick, ariaLabel, className, }: StepsProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsx as e, jsxs as u, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import { CheckOutlined as g } from "@ant-design/icons";
|
|
3
|
+
/* empty css */
|
|
4
|
+
const h = {
|
|
5
|
+
complete: "completed",
|
|
6
|
+
current: "current step",
|
|
7
|
+
upcoming: void 0
|
|
8
|
+
};
|
|
9
|
+
function b(t, a) {
|
|
10
|
+
return t < a ? "complete" : t === a ? "current" : "upcoming";
|
|
11
|
+
}
|
|
12
|
+
function v({
|
|
13
|
+
items: t,
|
|
14
|
+
current: a,
|
|
15
|
+
onStepClick: c,
|
|
16
|
+
ariaLabel: o,
|
|
17
|
+
className: p
|
|
18
|
+
}) {
|
|
19
|
+
const m = ["aegis-steps", p ?? ""].filter(Boolean).join(" ");
|
|
20
|
+
return /* @__PURE__ */ e("ol", { className: m, "aria-label": o, children: t.map((n, r) => {
|
|
21
|
+
const s = b(r, a), i = n.disabled === !0 && s === "upcoming" ? "not yet available" : h[s], l = /* @__PURE__ */ u(_, { children: [
|
|
22
|
+
/* @__PURE__ */ e("span", { className: "aegis-steps__marker", "aria-hidden": "true", children: s === "complete" ? /* @__PURE__ */ e(g, {}) : r + 1 }),
|
|
23
|
+
/* @__PURE__ */ e("span", { className: "aegis-steps__hidden", children: `${String(r + 1)}. ` }),
|
|
24
|
+
/* @__PURE__ */ e("span", { className: "aegis-steps__label", children: n.label }),
|
|
25
|
+
i !== void 0 && /* @__PURE__ */ e("span", { className: "aegis-steps__hidden", children: ` (${i})` })
|
|
26
|
+
] }), d = c !== void 0 && s !== "current" && n.disabled !== !0;
|
|
27
|
+
return /* @__PURE__ */ e(
|
|
28
|
+
"li",
|
|
29
|
+
{
|
|
30
|
+
className: `aegis-steps__item aegis-steps__item--${s}`,
|
|
31
|
+
children: d ? /* @__PURE__ */ e(
|
|
32
|
+
"button",
|
|
33
|
+
{
|
|
34
|
+
type: "button",
|
|
35
|
+
className: "aegis-steps__step",
|
|
36
|
+
onClick: () => {
|
|
37
|
+
c(r);
|
|
38
|
+
},
|
|
39
|
+
children: l
|
|
40
|
+
}
|
|
41
|
+
) : /* @__PURE__ */ e(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
className: "aegis-steps__step",
|
|
45
|
+
"aria-current": s === "current" ? "step" : void 0,
|
|
46
|
+
children: l
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
},
|
|
50
|
+
n.key
|
|
51
|
+
);
|
|
52
|
+
}) });
|
|
53
|
+
}
|
|
54
|
+
export {
|
|
55
|
+
v as Steps
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=Steps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Steps.js","sources":["../../../src/components/ui/Steps.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\n\nimport { CheckOutlined } from '@ant-design/icons';\n\nimport './Steps.css';\n\nexport interface StepsItem {\n key: string;\n label: ReactNode;\n /** Keeps the step from being clicked, e.g. a later step whose earlier steps are incomplete. */\n disabled?: boolean;\n}\n\ninterface StepsProps {\n items: StepsItem[];\n /** Index of the current step; the steps before it show as complete. */\n current: number;\n /** Makes every step but the current one a button that reports its index. */\n onStepClick?: (index: number) => void;\n /** Accessible name of the list, e.g. `Install steps`. */\n ariaLabel: string;\n className?: string;\n}\n\ntype StepState = 'complete' | 'current' | 'upcoming';\n\n/** The state the marker shows, put into words for assistive tech. */\nconst STATE_TEXT: Record<StepState, string | undefined> = {\n complete: 'completed',\n current: 'current step',\n upcoming: undefined,\n};\n\nfunction stepState(index: number, current: number): StepState {\n if (index < current) {\n return 'complete';\n }\n return index === current ? 'current' : 'upcoming';\n}\n\nexport function Steps({\n items,\n current,\n onStepClick,\n ariaLabel,\n className,\n}: StepsProps) {\n const cls = ['aegis-steps', className ?? ''].filter(Boolean).join(' ');\n return (\n <ol className={cls} aria-label={ariaLabel}>\n {items.map((item, index) => {\n const state = stepState(index, current);\n const spoken =\n item.disabled === true && state === 'upcoming'\n ? 'not yet available'\n : STATE_TEXT[state];\n const content = (\n <>\n <span className=\"aegis-steps__marker\" aria-hidden=\"true\">\n {state === 'complete' ? <CheckOutlined /> : index + 1}\n </span>\n <span className=\"aegis-steps__hidden\">{`${String(index + 1)}. `}</span>\n <span className=\"aegis-steps__label\">{item.label}</span>\n {spoken !== undefined && (\n <span className=\"aegis-steps__hidden\">{` (${spoken})`}</span>\n )}\n </>\n );\n const clickable =\n onStepClick !== undefined &&\n state !== 'current' &&\n item.disabled !== true;\n return (\n <li\n key={item.key}\n className={`aegis-steps__item aegis-steps__item--${state}`}\n >\n {clickable ? (\n <button\n type=\"button\"\n className=\"aegis-steps__step\"\n onClick={() => {\n onStepClick(index);\n }}\n >\n {content}\n </button>\n ) : (\n <span\n className=\"aegis-steps__step\"\n aria-current={state === 'current' ? 'step' : undefined}\n >\n {content}\n </span>\n )}\n </li>\n );\n })}\n </ol>\n );\n}\n"],"names":["STATE_TEXT","stepState","index","current","Steps","items","onStepClick","ariaLabel","className","cls","jsx","item","state","spoken","content","jsxs","Fragment","CheckOutlined","clickable"],"mappings":";;;AA2BA,MAAMA,IAAoD;AAAA,EACxD,UAAU;AAAA,EACV,SAAS;AAAA,EACT,UAAU;AACZ;AAEA,SAASC,EAAUC,GAAeC,GAA4B;AAC5D,SAAID,IAAQC,IACH,aAEFD,MAAUC,IAAU,YAAY;AACzC;AAEO,SAASC,EAAM;AAAA,EACpB,OAAAC;AAAA,EACA,SAAAF;AAAA,EACA,aAAAG;AAAA,EACA,WAAAC;AAAA,EACA,WAAAC;AACF,GAAe;AACb,QAAMC,IAAM,CAAC,eAAeD,KAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AACrE,SACE,gBAAAE,EAAC,MAAA,EAAG,WAAWD,GAAK,cAAYF,GAC7B,UAAAF,EAAM,IAAI,CAACM,GAAMT,MAAU;AAC1B,UAAMU,IAAQX,EAAUC,GAAOC,CAAO,GAChCU,IACJF,EAAK,aAAa,MAAQC,MAAU,aAChC,sBACAZ,EAAWY,CAAK,GAChBE,IACJ,gBAAAC,EAAAC,GAAA,EACE,UAAA;AAAA,MAAA,gBAAAN,EAAC,QAAA,EAAK,WAAU,uBAAsB,eAAY,QAC/C,UAAAE,MAAU,aAAa,gBAAAF,EAACO,GAAA,CAAA,CAAc,IAAKf,IAAQ,GACtD;AAAA,MACA,gBAAAQ,EAAC,UAAK,WAAU,uBAAuB,aAAG,OAAOR,IAAQ,CAAC,CAAC,KAAA,CAAK;AAAA,MAChE,gBAAAQ,EAAC,QAAA,EAAK,WAAU,sBAAsB,YAAK,OAAM;AAAA,MAChDG,MAAW,UACV,gBAAAH,EAAC,QAAA,EAAK,WAAU,uBAAuB,UAAA,KAAKG,CAAM,IAAA,CAAI;AAAA,IAAA,GAE1D,GAEIK,IACJZ,MAAgB,UAChBM,MAAU,aACVD,EAAK,aAAa;AACpB,WACE,gBAAAD;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAW,wCAAwCE,CAAK;AAAA,QAEvD,UAAAM,IACC,gBAAAR;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,MAAK;AAAA,YACL,WAAU;AAAA,YACV,SAAS,MAAM;AACb,cAAAJ,EAAYJ,CAAK;AAAA,YACnB;AAAA,YAEC,UAAAY;AAAA,UAAA;AAAA,QAAA,IAGH,gBAAAJ;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAU;AAAA,YACV,gBAAcE,MAAU,YAAY,SAAS;AAAA,YAE5C,UAAAE;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,MAnBGH,EAAK;AAAA,IAAA;AAAA,EAuBhB,CAAC,EAAA,CACH;AAEJ;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),f=require("react"),S=require("../../hooks/useSectionSpy.cjs");;/* empty css */const p=require("../../locale/useStrings.cjs"),h=25;function g(n){return n.map(s=>document.getElementById(s))}function x(n){const[s,a]=f.useState(0);return f.useEffect(()=>{const c=n.split(" ");let r=g(c);const l=new MutationObserver(()=>{const i=g(c);i.some((o,u)=>o!==r[u])&&(r=i,a(o=>o+1))});return l.observe(document.body,{childList:!0,subtree:!0}),()=>{l.disconnect()}},[n]),s}function C({items:n,currentId:s,onCurrentChange:a,scrollContainer:c=null,className:r}){const l=p.useStrings(),i=n.map(e=>e.id),o=x(i.join(" ")),{activeId:u,onLinkClick:_}=S.useSectionSpy({ids:i,activationPercent:h,currentId:s,onCurrentChange:a,scrollContainer:c,sectionsVersion:o}),v=["aegis-toc",r??""].filter(Boolean).join(" ");return t.jsx("nav",{"aria-label":l.tableOfContents,className:v,children:t.jsx("ol",{className:"aegis-toc__list",children:n.map(e=>{const d=e.id===u,b=e.level??1,j=["aegis-toc__link",d?"aegis-toc__link--current":"",b>1?`aegis-toc__link--level-${b}`:""].filter(Boolean).join(" ");return t.jsx("li",{children:t.jsxs("a",{href:`#${e.id}`,className:j,"aria-current":d?"location":void 0,onClick:m=>{_(m,e.id)},children:[t.jsx("span",{className:"aegis-toc__indicator","aria-hidden":"true"}),t.jsx("span",{className:"aegis-toc__label",children:e.label})]})},e.id)})})})}exports.TableOfContents=C;
|
|
2
2
|
//# sourceMappingURL=TableOfContents.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TableOfContents.cjs","sources":["../../../src/components/ui/TableOfContents.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"TableOfContents.cjs","sources":["../../../src/components/ui/TableOfContents.tsx"],"sourcesContent":["import { type ReactElement, type ReactNode, useEffect, useState } from 'react';\n\nimport { useSectionSpy } from '../../hooks/useSectionSpy';\nimport { useStrings } from '../../locale';\nimport './TableOfContents.css';\n\nexport interface TableOfContentsItem {\n /** The id of the section element the item links to. */\n id: string;\n label: ReactNode;\n /** Nesting depth of the section; 2 to 4 indent the label. Defaults to 1. */\n level?: 1 | 2 | 3 | 4;\n}\n\nexport interface TableOfContentsProps {\n /** The sections in document order. */\n items: TableOfContentsItem[];\n /** Controls the current item; omit it to follow the scroll position. */\n currentId?: string;\n /** Called with the id that scrolling or a click makes current. */\n onCurrentChange?: (id: string) => void;\n /** The element that scrolls the sections; omitted or null means the viewport. */\n scrollContainer?: HTMLElement | null;\n className?: string;\n}\n\n/** A section becomes current once its top passes this share of the view. */\nconst ACTIVATION_PERCENT = 25;\n\nfunction sectionElements(ids: string[]): Array<HTMLElement | null> {\n return ids.map((id) => document.getElementById(id));\n}\n\n/**\n * Changes whenever an element carrying one of the ids appears, disappears\n * or is replaced, so tracking starts over on the elements a lazily rendered\n * body mounts after the table of contents, or re-creates later.\n */\nfunction useSectionElementsVersion(sectionIds: string): number {\n const [version, setVersion] = useState(0);\n useEffect(() => {\n const ids = sectionIds.split(' ');\n let current = sectionElements(ids);\n const observer = new MutationObserver(() => {\n const next = sectionElements(ids);\n if (next.some((element, index) => element !== current[index])) {\n current = next;\n setVersion((value) => value + 1);\n }\n });\n observer.observe(document.body, { childList: true, subtree: true });\n return () => {\n observer.disconnect();\n };\n }, [sectionIds]);\n return version;\n}\n\nexport function TableOfContents({\n items,\n currentId,\n onCurrentChange,\n scrollContainer = null,\n className,\n}: TableOfContentsProps): ReactElement {\n const strings = useStrings();\n const ids = items.map((item) => item.id);\n const sectionsVersion = useSectionElementsVersion(ids.join(' '));\n const { activeId, onLinkClick } = useSectionSpy({\n ids,\n activationPercent: ACTIVATION_PERCENT,\n currentId,\n onCurrentChange,\n scrollContainer,\n sectionsVersion,\n });\n\n const cls = ['aegis-toc', className ?? ''].filter(Boolean).join(' ');\n\n return (\n <nav aria-label={strings.tableOfContents} className={cls}>\n <ol className=\"aegis-toc__list\">\n {items.map((item) => {\n const current = item.id === activeId;\n const level = item.level ?? 1;\n const linkCls = [\n 'aegis-toc__link',\n current ? 'aegis-toc__link--current' : '',\n level > 1 ? `aegis-toc__link--level-${level}` : '',\n ]\n .filter(Boolean)\n .join(' ');\n return (\n <li key={item.id}>\n <a\n href={`#${item.id}`}\n className={linkCls}\n aria-current={current ? 'location' : undefined}\n onClick={(event) => {\n onLinkClick(event, item.id);\n }}\n >\n <span className=\"aegis-toc__indicator\" aria-hidden=\"true\" />\n <span className=\"aegis-toc__label\">{item.label}</span>\n </a>\n </li>\n );\n })}\n </ol>\n </nav>\n );\n}\n"],"names":["ACTIVATION_PERCENT","sectionElements","ids","id","useSectionElementsVersion","sectionIds","version","setVersion","useState","useEffect","current","observer","next","element","index","value","TableOfContents","items","currentId","onCurrentChange","scrollContainer","className","strings","useStrings","item","sectionsVersion","activeId","onLinkClick","useSectionSpy","cls","jsx","level","linkCls","jsxs","event"],"mappings":"uQA2BMA,EAAqB,GAE3B,SAASC,EAAgBC,EAA0C,CACjE,OAAOA,EAAI,IAAKC,GAAO,SAAS,eAAeA,CAAE,CAAC,CACpD,CAOA,SAASC,EAA0BC,EAA4B,CAC7D,KAAM,CAACC,EAASC,CAAU,EAAIC,EAAAA,SAAS,CAAC,EACxCC,OAAAA,EAAAA,UAAU,IAAM,CACd,MAAMP,EAAMG,EAAW,MAAM,GAAG,EAChC,IAAIK,EAAUT,EAAgBC,CAAG,EACjC,MAAMS,EAAW,IAAI,iBAAiB,IAAM,CAC1C,MAAMC,EAAOX,EAAgBC,CAAG,EAC5BU,EAAK,KAAK,CAACC,EAASC,IAAUD,IAAYH,EAAQI,CAAK,CAAC,IAC1DJ,EAAUE,EACVL,EAAYQ,GAAUA,EAAQ,CAAC,EAEnC,CAAC,EACD,OAAAJ,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,GAAM,QAAS,GAAM,EAC3D,IAAM,CACXA,EAAS,WAAA,CACX,CACF,EAAG,CAACN,CAAU,CAAC,EACRC,CACT,CAEO,SAASU,EAAgB,CAC9B,MAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,gBAAAC,EAAkB,KAClB,UAAAC,CACF,EAAuC,CACrC,MAAMC,EAAUC,EAAAA,WAAA,EACVrB,EAAMe,EAAM,IAAKO,GAASA,EAAK,EAAE,EACjCC,EAAkBrB,EAA0BF,EAAI,KAAK,GAAG,CAAC,EACzD,CAAE,SAAAwB,EAAU,YAAAC,CAAA,EAAgBC,gBAAc,CAC9C,IAAA1B,EACA,kBAAmBF,EACnB,UAAAkB,EACA,gBAAAC,EACA,gBAAAC,EACA,gBAAAK,CAAA,CACD,EAEKI,EAAM,CAAC,YAAaR,GAAa,EAAE,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG,EAEnE,OACES,EAAAA,IAAC,MAAA,CAAI,aAAYR,EAAQ,gBAAiB,UAAWO,EACnD,SAAAC,EAAAA,IAAC,KAAA,CAAG,UAAU,kBACX,SAAAb,EAAM,IAAKO,GAAS,CACnB,MAAMd,EAAUc,EAAK,KAAOE,EACtBK,EAAQP,EAAK,OAAS,EACtBQ,EAAU,CACd,kBACAtB,EAAU,2BAA6B,GACvCqB,EAAQ,EAAI,0BAA0BA,CAAK,GAAK,EAAA,EAE/C,OAAO,OAAO,EACd,KAAK,GAAG,EACX,aACG,KAAA,CACC,SAAAE,EAAAA,KAAC,IAAA,CACC,KAAM,IAAIT,EAAK,EAAE,GACjB,UAAWQ,EACX,eAActB,EAAU,WAAa,OACrC,QAAUwB,GAAU,CAClBP,EAAYO,EAAOV,EAAK,EAAE,CAC5B,EAEA,SAAA,CAAAM,EAAAA,IAAC,OAAA,CAAK,UAAU,uBAAuB,cAAY,OAAO,EAC1DA,EAAAA,IAAC,OAAA,CAAK,UAAU,mBAAoB,WAAK,KAAA,CAAM,CAAA,CAAA,CAAA,CACjD,EAXON,EAAK,EAYd,CAEJ,CAAC,EACH,EACF,CAEJ"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ReactElement, ReactNode } from 'react';
|
|
2
2
|
export interface TableOfContentsItem {
|
|
3
|
-
/** The id of the section element
|
|
3
|
+
/** The id of the section element the item links to. */
|
|
4
4
|
id: string;
|
|
5
5
|
label: ReactNode;
|
|
6
|
-
/** Nesting depth of the section; 2
|
|
7
|
-
level?: 1 | 2 | 3;
|
|
6
|
+
/** Nesting depth of the section; 2 to 4 indent the label. Defaults to 1. */
|
|
7
|
+
level?: 1 | 2 | 3 | 4;
|
|
8
8
|
}
|
|
9
9
|
export interface TableOfContentsProps {
|
|
10
10
|
/** The sections in document order. */
|
|
@@ -1,46 +1,65 @@
|
|
|
1
1
|
import { jsx as i, jsxs as g } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState as h, useEffect as k } from "react";
|
|
3
|
+
import { useSectionSpy as C } from "../../hooks/useSectionSpy.js";
|
|
3
4
|
/* empty css */
|
|
4
|
-
import { useStrings as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
5
|
+
import { useStrings as N } from "../../locale/useStrings.js";
|
|
6
|
+
const E = 25;
|
|
7
|
+
function f(n) {
|
|
8
|
+
return n.map((t) => document.getElementById(t));
|
|
9
|
+
}
|
|
10
|
+
function j(n) {
|
|
11
|
+
const [t, a] = h(0);
|
|
12
|
+
return k(() => {
|
|
13
|
+
const r = n.split(" ");
|
|
14
|
+
let c = f(r);
|
|
15
|
+
const l = new MutationObserver(() => {
|
|
16
|
+
const o = f(r);
|
|
17
|
+
o.some((s, u) => s !== c[u]) && (c = o, a((s) => s + 1));
|
|
18
|
+
});
|
|
19
|
+
return l.observe(document.body, { childList: !0, subtree: !0 }), () => {
|
|
20
|
+
l.disconnect();
|
|
21
|
+
};
|
|
22
|
+
}, [n]), t;
|
|
23
|
+
}
|
|
24
|
+
function y({
|
|
25
|
+
items: n,
|
|
26
|
+
currentId: t,
|
|
27
|
+
onCurrentChange: a,
|
|
28
|
+
scrollContainer: r = null,
|
|
29
|
+
className: c
|
|
12
30
|
}) {
|
|
13
|
-
const
|
|
14
|
-
ids:
|
|
15
|
-
activationPercent:
|
|
16
|
-
currentId:
|
|
17
|
-
onCurrentChange:
|
|
18
|
-
scrollContainer:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
31
|
+
const l = N(), o = n.map((e) => e.id), s = j(o.join(" ")), { activeId: u, onLinkClick: p } = C({
|
|
32
|
+
ids: o,
|
|
33
|
+
activationPercent: E,
|
|
34
|
+
currentId: t,
|
|
35
|
+
onCurrentChange: a,
|
|
36
|
+
scrollContainer: r,
|
|
37
|
+
sectionsVersion: s
|
|
38
|
+
}), _ = ["aegis-toc", c ?? ""].filter(Boolean).join(" ");
|
|
39
|
+
return /* @__PURE__ */ i("nav", { "aria-label": l.tableOfContents, className: _, children: /* @__PURE__ */ i("ol", { className: "aegis-toc__list", children: n.map((e) => {
|
|
40
|
+
const d = e.id === u, m = e.level ?? 1, v = [
|
|
22
41
|
"aegis-toc__link",
|
|
23
|
-
|
|
24
|
-
|
|
42
|
+
d ? "aegis-toc__link--current" : "",
|
|
43
|
+
m > 1 ? `aegis-toc__link--level-${m}` : ""
|
|
25
44
|
].filter(Boolean).join(" ");
|
|
26
45
|
return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ g(
|
|
27
46
|
"a",
|
|
28
47
|
{
|
|
29
|
-
href: `#${
|
|
30
|
-
className:
|
|
31
|
-
"aria-current":
|
|
32
|
-
onClick: (
|
|
33
|
-
|
|
48
|
+
href: `#${e.id}`,
|
|
49
|
+
className: v,
|
|
50
|
+
"aria-current": d ? "location" : void 0,
|
|
51
|
+
onClick: (b) => {
|
|
52
|
+
p(b, e.id);
|
|
34
53
|
},
|
|
35
54
|
children: [
|
|
36
55
|
/* @__PURE__ */ i("span", { className: "aegis-toc__indicator", "aria-hidden": "true" }),
|
|
37
|
-
/* @__PURE__ */ i("span", { className: "aegis-toc__label", children:
|
|
56
|
+
/* @__PURE__ */ i("span", { className: "aegis-toc__label", children: e.label })
|
|
38
57
|
]
|
|
39
58
|
}
|
|
40
|
-
) },
|
|
59
|
+
) }, e.id);
|
|
41
60
|
}) }) });
|
|
42
61
|
}
|
|
43
62
|
export {
|
|
44
|
-
|
|
63
|
+
y as TableOfContents
|
|
45
64
|
};
|
|
46
65
|
//# sourceMappingURL=TableOfContents.js.map
|