@lincyaw/aegis-ui 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/ask/AskPanel.cjs +1 -1
- package/dist/agent/ask/AskPanel.cjs.map +1 -1
- package/dist/agent/ask/AskPanel.d.ts +5 -0
- package/dist/agent/ask/AskPanel.js +107 -100
- package/dist/agent/ask/AskPanel.js.map +1 -1
- package/dist/commands/commandContext.cjs.map +1 -1
- package/dist/commands/commandContext.d.ts +4 -1
- package/dist/commands/commandContext.js.map +1 -1
- package/dist/components/ui/AgentPanel.cjs +1 -1
- package/dist/components/ui/AgentPanel.cjs.map +1 -1
- package/dist/components/ui/AgentPanel.js +15 -14
- package/dist/components/ui/AgentPanel.js.map +1 -1
- package/dist/components/ui/Avatar.cjs +1 -1
- package/dist/components/ui/Avatar.cjs.map +1 -1
- package/dist/components/ui/Avatar.js +21 -19
- package/dist/components/ui/Avatar.js.map +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs +1 -1
- package/dist/components/ui/BlastRadiusBar.cjs.map +1 -1
- package/dist/components/ui/BlastRadiusBar.d.ts +16 -4
- package/dist/components/ui/BlastRadiusBar.js +27 -23
- package/dist/components/ui/BlastRadiusBar.js.map +1 -1
- package/dist/components/ui/ChatComposer.cjs +1 -1
- package/dist/components/ui/ChatComposer.cjs.map +1 -1
- package/dist/components/ui/ChatComposer.js +32 -31
- package/dist/components/ui/ChatComposer.js.map +1 -1
- package/dist/components/ui/ChatSessionList.cjs +1 -1
- package/dist/components/ui/ChatSessionList.cjs.map +1 -1
- package/dist/components/ui/ChatSessionList.js +68 -66
- package/dist/components/ui/ChatSessionList.js.map +1 -1
- package/dist/components/ui/Checkbox.cjs +1 -1
- package/dist/components/ui/Checkbox.cjs.map +1 -1
- package/dist/components/ui/Checkbox.d.ts +6 -2
- package/dist/components/ui/Checkbox.js +21 -17
- package/dist/components/ui/Checkbox.js.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs +1 -1
- package/dist/components/ui/ChoiceCardGroup.cjs.map +1 -1
- package/dist/components/ui/ChoiceCardGroup.d.ts +13 -4
- package/dist/components/ui/ChoiceCardGroup.js +47 -35
- package/dist/components/ui/ChoiceCardGroup.js.map +1 -1
- package/dist/components/ui/CodeEditor.cjs +1 -1
- package/dist/components/ui/CodeEditor.cjs.map +1 -1
- package/dist/components/ui/CodeEditor.d.ts +11 -1
- package/dist/components/ui/CodeEditor.js +100 -74
- package/dist/components/ui/CodeEditor.js.map +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs +1 -1
- package/dist/components/ui/CommandInvocationCard.cjs.map +1 -1
- package/dist/components/ui/CommandInvocationCard.js +28 -31
- package/dist/components/ui/CommandInvocationCard.js.map +1 -1
- package/dist/components/ui/CommandPalette.cjs +1 -1
- package/dist/components/ui/CommandPalette.cjs.map +1 -1
- package/dist/components/ui/CommandPalette.d.ts +3 -3
- package/dist/components/ui/CommandPalette.js +75 -75
- package/dist/components/ui/CommandPalette.js.map +1 -1
- package/dist/components/ui/CommitGraph.cjs +1 -1
- package/dist/components/ui/CommitGraph.cjs.map +1 -1
- package/dist/components/ui/CommitGraph.d.ts +3 -1
- package/dist/components/ui/CommitGraph.js +77 -74
- package/dist/components/ui/CommitGraph.js.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs +1 -1
- package/dist/components/ui/ContentInspectorDialog.cjs.map +1 -1
- package/dist/components/ui/ContentInspectorDialog.js +25 -31
- package/dist/components/ui/ContentInspectorDialog.js.map +1 -1
- package/dist/components/ui/ContentPreview.cjs +2 -2
- package/dist/components/ui/ContentPreview.cjs.map +1 -1
- package/dist/components/ui/ContentPreview.js +55 -56
- package/dist/components/ui/ContentPreview.js.map +1 -1
- package/dist/components/ui/DangerZone.cjs +1 -1
- package/dist/components/ui/DangerZone.cjs.map +1 -1
- package/dist/components/ui/DangerZone.js +13 -12
- package/dist/components/ui/DangerZone.js.map +1 -1
- package/dist/components/ui/DataList.cjs +1 -1
- package/dist/components/ui/DataList.cjs.map +1 -1
- package/dist/components/ui/DataList.js +25 -24
- 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.js +41 -41
- 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.js +41 -40
- package/dist/components/ui/DropdownMenu.js.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs +1 -1
- package/dist/components/ui/EnvironmentSwitcher.cjs.map +1 -1
- package/dist/components/ui/EnvironmentSwitcher.js +26 -24
- package/dist/components/ui/EnvironmentSwitcher.js.map +1 -1
- package/dist/components/ui/EventTable.cjs +1 -1
- package/dist/components/ui/EventTable.cjs.map +1 -1
- package/dist/components/ui/EventTable.js +60 -53
- package/dist/components/ui/EventTable.js.map +1 -1
- package/dist/components/ui/FileDropzone.cjs +1 -1
- package/dist/components/ui/FileDropzone.cjs.map +1 -1
- package/dist/components/ui/FileDropzone.js +38 -40
- package/dist/components/ui/FileDropzone.js.map +1 -1
- package/dist/components/ui/FilePreview.cjs +1 -1
- package/dist/components/ui/FilePreview.cjs.map +1 -1
- package/dist/components/ui/FilePreview.js +60 -61
- package/dist/components/ui/FilePreview.js.map +1 -1
- package/dist/components/ui/FolderDropzone.cjs +1 -1
- package/dist/components/ui/FolderDropzone.cjs.map +1 -1
- package/dist/components/ui/FolderDropzone.js +114 -84
- package/dist/components/ui/FolderDropzone.js.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs +1 -1
- package/dist/components/ui/ForgotPasswordForm.cjs.map +1 -1
- package/dist/components/ui/ForgotPasswordForm.js +22 -21
- package/dist/components/ui/ForgotPasswordForm.js.map +1 -1
- package/dist/components/ui/FormRow.cjs +1 -1
- package/dist/components/ui/FormRow.cjs.map +1 -1
- package/dist/components/ui/FormRow.d.ts +32 -11
- package/dist/components/ui/FormRow.js +24 -15
- package/dist/components/ui/FormRow.js.map +1 -1
- package/dist/components/ui/InboxPage.cjs +1 -1
- package/dist/components/ui/InboxPage.cjs.map +1 -1
- package/dist/components/ui/InboxPage.d.ts +12 -3
- package/dist/components/ui/InboxPage.js +91 -77
- package/dist/components/ui/InboxPage.js.map +1 -1
- package/dist/components/ui/LoginForm.cjs +1 -1
- package/dist/components/ui/LoginForm.cjs.map +1 -1
- package/dist/components/ui/LoginForm.js +43 -43
- package/dist/components/ui/LoginForm.js.map +1 -1
- package/dist/components/ui/MonoValue.cjs +1 -1
- package/dist/components/ui/MonoValue.cjs.map +1 -1
- package/dist/components/ui/MonoValue.d.ts +5 -1
- package/dist/components/ui/MonoValue.js +17 -17
- package/dist/components/ui/MonoValue.js.map +1 -1
- package/dist/components/ui/NotificationBell.cjs +1 -1
- package/dist/components/ui/NotificationBell.cjs.map +1 -1
- package/dist/components/ui/NotificationBell.d.ts +17 -1
- package/dist/components/ui/NotificationBell.js +129 -75
- package/dist/components/ui/NotificationBell.js.map +1 -1
- package/dist/components/ui/NumberField.cjs +1 -1
- package/dist/components/ui/NumberField.cjs.map +1 -1
- package/dist/components/ui/NumberField.d.ts +3 -1
- package/dist/components/ui/NumberField.js +52 -49
- package/dist/components/ui/NumberField.js.map +1 -1
- package/dist/components/ui/ObjectBrowser.cjs +1 -1
- package/dist/components/ui/ObjectBrowser.cjs.map +1 -1
- package/dist/components/ui/ObjectBrowser.js +83 -78
- package/dist/components/ui/ObjectBrowser.js.map +1 -1
- package/dist/components/ui/PageSizeSelect.cjs +1 -1
- package/dist/components/ui/PageSizeSelect.cjs.map +1 -1
- package/dist/components/ui/PageSizeSelect.js +30 -29
- package/dist/components/ui/PageSizeSelect.js.map +1 -1
- package/dist/components/ui/Panel.cjs.map +1 -1
- package/dist/components/ui/Panel.d.ts +5 -2
- package/dist/components/ui/Panel.js.map +1 -1
- package/dist/components/ui/ParquetViewer.cjs +1 -1
- package/dist/components/ui/ParquetViewer.cjs.map +1 -1
- package/dist/components/ui/ParquetViewer.js +69 -74
- package/dist/components/ui/ParquetViewer.js.map +1 -1
- package/dist/components/ui/PasswordField.cjs +1 -1
- package/dist/components/ui/PasswordField.cjs.map +1 -1
- package/dist/components/ui/PasswordField.js +28 -27
- package/dist/components/ui/PasswordField.js.map +1 -1
- package/dist/components/ui/PickerField.cjs +1 -1
- package/dist/components/ui/PickerField.cjs.map +1 -1
- package/dist/components/ui/PickerField.d.ts +25 -6
- package/dist/components/ui/PickerField.js +20 -17
- package/dist/components/ui/PickerField.js.map +1 -1
- package/dist/components/ui/ProjectSelector.cjs +1 -1
- package/dist/components/ui/ProjectSelector.cjs.map +1 -1
- package/dist/components/ui/ProjectSelector.js +40 -37
- package/dist/components/ui/ProjectSelector.js.map +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs +1 -1
- package/dist/components/ui/QueryAutocomplete.cjs.map +1 -1
- package/dist/components/ui/QueryAutocomplete.d.ts +7 -1
- package/dist/components/ui/QueryAutocomplete.js +141 -134
- 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.js +41 -40
- package/dist/components/ui/RegisterForm.js.map +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs +1 -1
- package/dist/components/ui/ResizableSidePanel.cjs.map +1 -1
- package/dist/components/ui/ResizableSidePanel.js +41 -40
- package/dist/components/ui/ResizableSidePanel.js.map +1 -1
- package/dist/components/ui/SavedQueryBar.cjs +1 -1
- package/dist/components/ui/SavedQueryBar.cjs.map +1 -1
- package/dist/components/ui/SavedQueryBar.d.ts +1 -1
- package/dist/components/ui/SavedQueryBar.js +375 -277
- package/dist/components/ui/SavedQueryBar.js.map +1 -1
- package/dist/components/ui/SearchInput.cjs +1 -1
- package/dist/components/ui/SearchInput.cjs.map +1 -1
- package/dist/components/ui/SearchInput.d.ts +5 -1
- package/dist/components/ui/SearchInput.js +28 -24
- package/dist/components/ui/SearchInput.js.map +1 -1
- package/dist/components/ui/Select.cjs +1 -1
- package/dist/components/ui/Select.cjs.map +1 -1
- package/dist/components/ui/Select.d.ts +3 -1
- package/dist/components/ui/Select.js +21 -19
- package/dist/components/ui/Select.js.map +1 -1
- package/dist/components/ui/ServiceMap.cjs +1 -1
- package/dist/components/ui/ServiceMap.cjs.map +1 -1
- package/dist/components/ui/ServiceMap.d.ts +9 -3
- package/dist/components/ui/ServiceMap.js +291 -231
- package/dist/components/ui/ServiceMap.js.map +1 -1
- package/dist/components/ui/Slider.cjs +1 -1
- package/dist/components/ui/Slider.cjs.map +1 -1
- package/dist/components/ui/Slider.d.ts +3 -1
- package/dist/components/ui/Slider.js +11 -9
- package/dist/components/ui/Slider.js.map +1 -1
- package/dist/components/ui/SparkLine.cjs +1 -1
- package/dist/components/ui/SparkLine.cjs.map +1 -1
- package/dist/components/ui/SparkLine.js +24 -23
- package/dist/components/ui/SparkLine.js.map +1 -1
- package/dist/components/ui/Steps.cjs +1 -1
- package/dist/components/ui/Steps.cjs.map +1 -1
- package/dist/components/ui/Steps.js +25 -29
- package/dist/components/ui/Steps.js.map +1 -1
- package/dist/components/ui/Terminal.cjs +1 -1
- package/dist/components/ui/Terminal.cjs.map +1 -1
- package/dist/components/ui/Terminal.js +18 -17
- package/dist/components/ui/Terminal.js.map +1 -1
- package/dist/components/ui/TextField.cjs +1 -1
- package/dist/components/ui/TextField.cjs.map +1 -1
- package/dist/components/ui/TextField.js +6 -6
- package/dist/components/ui/TextField.js.map +1 -1
- package/dist/components/ui/ThemeToggle.cjs +1 -1
- package/dist/components/ui/ThemeToggle.cjs.map +1 -1
- package/dist/components/ui/ThemeToggle.js +15 -18
- package/dist/components/ui/ThemeToggle.js.map +1 -1
- package/dist/components/ui/TimeDisplay.cjs +1 -1
- package/dist/components/ui/TimeDisplay.cjs.map +1 -1
- package/dist/components/ui/TimeDisplay.js +12 -12
- package/dist/components/ui/TimeDisplay.js.map +1 -1
- package/dist/components/ui/TimeRangePicker.cjs +1 -1
- package/dist/components/ui/TimeRangePicker.cjs.map +1 -1
- package/dist/components/ui/TimeRangePicker.js +128 -111
- package/dist/components/ui/TimeRangePicker.js.map +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs +1 -1
- package/dist/components/ui/TraceSpanInspector.cjs.map +1 -1
- package/dist/components/ui/TraceSpanInspector.js +43 -46
- package/dist/components/ui/TraceSpanInspector.js.map +1 -1
- package/dist/components/ui/TraceTree.cjs +1 -1
- package/dist/components/ui/TraceTree.cjs.map +1 -1
- package/dist/components/ui/TraceTree.d.ts +1 -1
- package/dist/components/ui/TraceTree.js +33 -33
- package/dist/components/ui/TraceTree.js.map +1 -1
- package/dist/components/ui/UploadQueue.cjs +1 -1
- package/dist/components/ui/UploadQueue.cjs.map +1 -1
- package/dist/components/ui/UploadQueue.js +59 -70
- package/dist/components/ui/UploadQueue.js.map +1 -1
- package/dist/components/ui/authValidation.cjs +1 -1
- package/dist/components/ui/authValidation.cjs.map +1 -1
- package/dist/components/ui/authValidation.d.ts +2 -2
- package/dist/components/ui/authValidation.js +4 -5
- package/dist/components/ui/authValidation.js.map +1 -1
- package/dist/components/ui/classifyContent.cjs +3 -3
- package/dist/components/ui/classifyContent.cjs.map +1 -1
- package/dist/components/ui/classifyContent.d.ts +2 -1
- package/dist/components/ui/classifyContent.js +52 -54
- package/dist/components/ui/classifyContent.js.map +1 -1
- package/dist/components/ui/relativeTime.cjs +1 -1
- package/dist/components/ui/relativeTime.cjs.map +1 -1
- package/dist/components/ui/relativeTime.d.ts +5 -3
- package/dist/components/ui/relativeTime.js +15 -6
- package/dist/components/ui/relativeTime.js.map +1 -1
- package/dist/hooks/popoverOverflow.cjs +2 -0
- package/dist/hooks/popoverOverflow.cjs.map +1 -0
- package/dist/hooks/popoverOverflow.d.ts +8 -0
- package/dist/hooks/popoverOverflow.js +9 -0
- package/dist/hooks/popoverOverflow.js.map +1 -0
- package/dist/hooks/useDialogPopover.cjs +2 -0
- package/dist/hooks/useDialogPopover.cjs.map +1 -0
- package/dist/hooks/useDialogPopover.d.ts +23 -0
- package/dist/hooks/useDialogPopover.js +48 -0
- package/dist/hooks/useDialogPopover.js.map +1 -0
- package/dist/hooks/useMenuPopover.cjs +1 -1
- package/dist/hooks/useMenuPopover.cjs.map +1 -1
- package/dist/hooks/useMenuPopover.d.ts +0 -8
- package/dist/hooks/useMenuPopover.js +17 -22
- package/dist/hooks/useMenuPopover.js.map +1 -1
- package/dist/hooks/useSavedQueries.cjs +1 -1
- package/dist/hooks/useSavedQueries.cjs.map +1 -1
- package/dist/hooks/useSavedQueries.js +29 -28
- package/dist/hooks/useSavedQueries.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/layouts/shell/AegisShell.cjs +1 -1
- package/dist/layouts/shell/AegisShell.cjs.map +1 -1
- package/dist/layouts/shell/AegisShell.js +41 -41
- package/dist/layouts/shell/AegisShell.js.map +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs +1 -1
- package/dist/layouts/shell/AppSwitcher.cjs.map +1 -1
- package/dist/layouts/shell/AppSwitcher.js +53 -36
- package/dist/layouts/shell/AppSwitcher.js.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs +1 -1
- package/dist/layouts/shell/AuthRequiredCard.cjs.map +1 -1
- package/dist/layouts/shell/AuthRequiredCard.js +24 -22
- package/dist/layouts/shell/AuthRequiredCard.js.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.cjs.map +1 -1
- package/dist/layouts/shell/RouteErrorBoundary.d.ts +4 -1
- package/dist/layouts/shell/RouteErrorBoundary.js +15 -10
- package/dist/layouts/shell/RouteErrorBoundary.js.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs +1 -1
- package/dist/layouts/shell/ShellInboxPage.cjs.map +1 -1
- package/dist/layouts/shell/ShellInboxPage.js +17 -16
- package/dist/layouts/shell/ShellInboxPage.js.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs +1 -1
- package/dist/layouts/shell/ShellNotificationBell.cjs.map +1 -1
- package/dist/layouts/shell/ShellNotificationBell.js +20 -14
- package/dist/layouts/shell/ShellNotificationBell.js.map +1 -1
- package/dist/layouts/shell/TopHeader.cjs +1 -1
- package/dist/layouts/shell/TopHeader.cjs.map +1 -1
- package/dist/layouts/shell/TopHeader.js +74 -74
- package/dist/layouts/shell/TopHeader.js.map +1 -1
- package/dist/layouts/shell/useShellUser.cjs +1 -1
- package/dist/layouts/shell/useShellUser.cjs.map +1 -1
- package/dist/layouts/shell/useShellUser.js +15 -13
- package/dist/layouts/shell/useShellUser.js.map +1 -1
- package/dist/lib/chart.cjs +1 -1
- package/dist/lib/chart.cjs.map +1 -1
- package/dist/lib/chart.d.ts +5 -7
- package/dist/lib/chart.js +49 -34
- package/dist/lib/chart.js.map +1 -1
- package/dist/lib/timeRange.cjs +1 -1
- package/dist/lib/timeRange.cjs.map +1 -1
- package/dist/lib/timeRange.d.ts +14 -4
- package/dist/lib/timeRange.js +41 -40
- package/dist/lib/timeRange.js.map +1 -1
- package/dist/locale/strings.cjs +1 -1
- package/dist/locale/strings.cjs.map +1 -1
- package/dist/locale/strings.d.ts +241 -2
- package/dist/locale/strings.js +543 -26
- package/dist/locale/strings.js.map +1 -1
- package/dist/notifications/notificationContext.cjs.map +1 -1
- package/dist/notifications/notificationContext.d.ts +12 -2
- package/dist/notifications/notificationContext.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/theme/antdTheme.cjs +1 -1
- package/dist/theme/antdTheme.cjs.map +1 -1
- package/dist/theme/antdTheme.js +2 -0
- package/dist/theme/antdTheme.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellInboxPage.js","sources":["../../../src/layouts/shell/ShellInboxPage.tsx"],"sourcesContent":["import { type ReactElement, useCallback } from 'react';\n\nimport {\n InboxPage,\n type InboxPageSurface,\n} from '../../components/ui/InboxPage';\nimport { useNotifications } from '../../notifications';\nimport { useOpenNotification } from './useOpenNotification';\n\ninterface ShellInboxPageProps {\n defaultFilter?: 'all' | 'unread';\n surface?: InboxPageSurface;\n}\n\n/**\n * The InboxPage filled from `<NotificationProvider>`: opening an item marks\n * it read and follows its `to`. Mount it on the route `inboxPath` names.\n */\nexport function ShellInboxPage({\n defaultFilter,\n surface,\n}: ShellInboxPageProps): ReactElement {\n const { items, unreadCount, markAllRead, error, refetch } =\n useNotifications();\n const open = useOpenNotification();\n const markAll = useCallback(() => {\n void markAllRead?.();\n }, [markAllRead]);\n const retry = useCallback(() => {\n void refetch?.();\n }, [refetch]);\n return (\n <InboxPage\n items={items}\n unreadCount={unreadCount}\n onOpen={open}\n onMarkAllRead={markAllRead ? markAll : undefined}\n error={error}\n onRetry={refetch ? retry : undefined}\n defaultFilter={defaultFilter}\n surface={surface}\n />\n );\n}\n"],"names":["ShellInboxPage","defaultFilter","surface","items","unreadCount","markAllRead","error","refetch","useNotifications","open","useOpenNotification","markAll","useCallback","retry","jsx","InboxPage"],"mappings":";;;;;AAkBO,SAASA,EAAe;AAAA,EAC7B,eAAAC;AAAA,EACA,SAAAC;AACF,GAAsC;AACpC,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,aAAAC,GAAa,OAAAC,GAAO,SAAAC,EAAA,
|
|
1
|
+
{"version":3,"file":"ShellInboxPage.js","sources":["../../../src/layouts/shell/ShellInboxPage.tsx"],"sourcesContent":["import { type ReactElement, useCallback } from 'react';\n\nimport {\n InboxPage,\n type InboxPageSurface,\n} from '../../components/ui/InboxPage';\nimport { useNotifications } from '../../notifications';\nimport { useOpenNotification } from './useOpenNotification';\n\ninterface ShellInboxPageProps {\n defaultFilter?: 'all' | 'unread';\n surface?: InboxPageSurface;\n}\n\n/**\n * The InboxPage filled from `<NotificationProvider>`: opening an item marks\n * it read and follows its `to`. Mount it on the route `inboxPath` names.\n */\nexport function ShellInboxPage({\n defaultFilter,\n surface,\n}: ShellInboxPageProps): ReactElement {\n const { items, unreadCount, markAllRead, error, liveError, refetch } =\n useNotifications();\n const open = useOpenNotification();\n const markAll = useCallback(() => {\n void markAllRead?.();\n }, [markAllRead]);\n const retry = useCallback(() => {\n void refetch?.();\n }, [refetch]);\n return (\n <InboxPage\n items={items}\n unreadCount={unreadCount}\n onOpen={open}\n onMarkAllRead={markAllRead ? markAll : undefined}\n error={error}\n liveError={liveError}\n onRetry={refetch ? retry : undefined}\n defaultFilter={defaultFilter}\n surface={surface}\n />\n );\n}\n"],"names":["ShellInboxPage","defaultFilter","surface","items","unreadCount","markAllRead","error","liveError","refetch","useNotifications","open","useOpenNotification","markAll","useCallback","retry","jsx","InboxPage"],"mappings":";;;;;AAkBO,SAASA,EAAe;AAAA,EAC7B,eAAAC;AAAA,EACA,SAAAC;AACF,GAAsC;AACpC,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,aAAAC,GAAa,OAAAC,GAAO,WAAAC,GAAW,SAAAC,EAAA,IACzDC,EAAA,GACIC,IAAOC,EAAA,GACPC,IAAUC,EAAY,MAAM;AAChC,IAAKR,IAAA;AAAA,EACP,GAAG,CAACA,CAAW,CAAC,GACVS,IAAQD,EAAY,MAAM;AAC9B,IAAKL,IAAA;AAAA,EACP,GAAG,CAACA,CAAO,CAAC;AACZ,SACE,gBAAAO;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAb;AAAA,MACA,aAAAC;AAAA,MACA,QAAQM;AAAA,MACR,eAAeL,IAAcO,IAAU;AAAA,MACvC,OAAAN;AAAA,MACA,WAAAC;AAAA,MACA,SAASC,IAAUM,IAAQ;AAAA,MAC3B,eAAAb;AAAA,MACA,SAAAC;AAAA,IAAA;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 u=require("react/jsx-runtime"),l=require("react"),a=require("../../components/ui/NotificationBell.cjs"),f=require("./RouterLink.cjs"),N=require("./useOpenNotification.cjs"),p=require("../../notifications/useNotifications.cjs");function q({inboxPath:t}){const{items:i,unreadCount:o,error:n,liveError:r,refetch:e}=p.useNotifications(),c=N.useOpenNotification(),s=l.useCallback(()=>{e?.()},[e]);return u.jsx(a.NotificationBell,{items:i,unreadCount:o,error:n,liveError:r,onRetry:e?s:void 0,onOpen:c,inboxPath:t,linkComponent:f.RouterLink})}exports.ShellNotificationBell=q;
|
|
2
2
|
//# sourceMappingURL=ShellNotificationBell.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellNotificationBell.cjs","sources":["../../../src/layouts/shell/ShellNotificationBell.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"ShellNotificationBell.cjs","sources":["../../../src/layouts/shell/ShellNotificationBell.tsx"],"sourcesContent":["import { type ReactElement, useCallback } from 'react';\n\nimport { NotificationBell } from '../../components/ui/NotificationBell';\nimport { useNotifications } from '../../notifications';\nimport { RouterLink } from './RouterLink';\nimport { useOpenNotification } from './useOpenNotification';\n\n/** The NotificationBell filled from `<NotificationProvider>`. */\nexport function ShellNotificationBell({\n inboxPath,\n}: {\n inboxPath: string;\n}): ReactElement {\n const { items, unreadCount, error, liveError, refetch } = useNotifications();\n const open = useOpenNotification();\n const retry = useCallback(() => {\n void refetch?.();\n }, [refetch]);\n return (\n <NotificationBell\n items={items}\n unreadCount={unreadCount}\n error={error}\n liveError={liveError}\n onRetry={refetch ? retry : undefined}\n onOpen={open}\n inboxPath={inboxPath}\n linkComponent={RouterLink}\n />\n );\n}\n"],"names":["ShellNotificationBell","inboxPath","items","unreadCount","error","liveError","refetch","useNotifications","open","useOpenNotification","retry","useCallback","jsx","NotificationBell","RouterLink"],"mappings":"yTAQO,SAASA,EAAsB,CACpC,UAAAC,CACF,EAEiB,CACf,KAAM,CAAE,MAAAC,EAAO,YAAAC,EAAa,MAAAC,EAAO,UAAAC,EAAW,QAAAC,CAAA,EAAYC,mBAAA,EACpDC,EAAOC,EAAAA,oBAAA,EACPC,EAAQC,EAAAA,YAAY,IAAM,CACzBL,IAAA,CACP,EAAG,CAACA,CAAO,CAAC,EACZ,OACEM,EAAAA,IAACC,EAAAA,iBAAA,CACC,MAAAX,EACA,YAAAC,EACA,MAAAC,EACA,UAAAC,EACA,QAASC,EAAUI,EAAQ,OAC3B,OAAQF,EACR,UAAAP,EACA,cAAea,EAAAA,UAAA,CAAA,CAGrB"}
|
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsx as p } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as c } from "react";
|
|
3
|
+
import { NotificationBell as l } from "../../components/ui/NotificationBell.js";
|
|
4
|
+
import { RouterLink as s } from "./RouterLink.js";
|
|
5
|
+
import { useOpenNotification as u } from "./useOpenNotification.js";
|
|
6
|
+
import { useNotifications as a } from "../../notifications/useNotifications.js";
|
|
7
|
+
function x({
|
|
8
|
+
inboxPath: r
|
|
8
9
|
}) {
|
|
9
|
-
const { items: t, unreadCount: i } =
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const { items: t, unreadCount: i, error: e, liveError: n, refetch: o } = a(), m = u(), f = c(() => {
|
|
11
|
+
o?.();
|
|
12
|
+
}, [o]);
|
|
13
|
+
return /* @__PURE__ */ p(
|
|
14
|
+
l,
|
|
12
15
|
{
|
|
13
16
|
items: t,
|
|
14
17
|
unreadCount: i,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
+
error: e,
|
|
19
|
+
liveError: n,
|
|
20
|
+
onRetry: o ? f : void 0,
|
|
21
|
+
onOpen: m,
|
|
22
|
+
inboxPath: r,
|
|
23
|
+
linkComponent: s
|
|
18
24
|
}
|
|
19
25
|
);
|
|
20
26
|
}
|
|
21
27
|
export {
|
|
22
|
-
|
|
28
|
+
x as ShellNotificationBell
|
|
23
29
|
};
|
|
24
30
|
//# sourceMappingURL=ShellNotificationBell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShellNotificationBell.js","sources":["../../../src/layouts/shell/ShellNotificationBell.tsx"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"ShellNotificationBell.js","sources":["../../../src/layouts/shell/ShellNotificationBell.tsx"],"sourcesContent":["import { type ReactElement, useCallback } from 'react';\n\nimport { NotificationBell } from '../../components/ui/NotificationBell';\nimport { useNotifications } from '../../notifications';\nimport { RouterLink } from './RouterLink';\nimport { useOpenNotification } from './useOpenNotification';\n\n/** The NotificationBell filled from `<NotificationProvider>`. */\nexport function ShellNotificationBell({\n inboxPath,\n}: {\n inboxPath: string;\n}): ReactElement {\n const { items, unreadCount, error, liveError, refetch } = useNotifications();\n const open = useOpenNotification();\n const retry = useCallback(() => {\n void refetch?.();\n }, [refetch]);\n return (\n <NotificationBell\n items={items}\n unreadCount={unreadCount}\n error={error}\n liveError={liveError}\n onRetry={refetch ? retry : undefined}\n onOpen={open}\n inboxPath={inboxPath}\n linkComponent={RouterLink}\n />\n );\n}\n"],"names":["ShellNotificationBell","inboxPath","items","unreadCount","error","liveError","refetch","useNotifications","open","useOpenNotification","retry","useCallback","jsx","NotificationBell","RouterLink"],"mappings":";;;;;;AAQO,SAASA,EAAsB;AAAA,EACpC,WAAAC;AACF,GAEiB;AACf,QAAM,EAAE,OAAAC,GAAO,aAAAC,GAAa,OAAAC,GAAO,WAAAC,GAAW,SAAAC,EAAA,IAAYC,EAAA,GACpDC,IAAOC,EAAA,GACPC,IAAQC,EAAY,MAAM;AAC9B,IAAKL,IAAA;AAAA,EACP,GAAG,CAACA,CAAO,CAAC;AACZ,SACE,gBAAAM;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAAX;AAAA,MACA,aAAAC;AAAA,MACA,OAAAC;AAAA,MACA,WAAAC;AAAA,MACA,SAASC,IAAUI,IAAQ;AAAA,MAC3B,QAAQF;AAAA,MACR,WAAAP;AAAA,MACA,eAAea;AAAA,IAAA;AAAA,EAAA;AAGrB;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("antd"),p=require("react-router-dom"),q=require("../../components/ui/Avatar.cjs"),C=require("../../components/ui/Chip.cjs"),A=require("../../components/ui/DropdownMenu.cjs"),E=require("../../components/ui/EnvironmentSwitcher.cjs"),B=require("./AppSwitcher.cjs"),U=require("./ShellNotificationBell.cjs"),v=require("../../locale/useStrings.cjs"),D=require("./environments/useEnvironment.cjs");function I({brand:s,apps:n,activeAppId:i,onAppSwitch:a,appSwitcher:o=!0,scrolled:l=!1,user:t,headerCenter:w,headerActions:N,inboxPath:d,onMobileMenuToggle:g,mobileMenuOpen:u=!1,menuToggleRef:b,showMobileMenu:f,sidebarCollapsible:y,sidebarCollapsed:h,onSidebarToggle:_,inlineSlotRef:k,inlineSlotActive:m,agentPanelOpen:c=!1,onAgentPanelToggle:x}){const r=v.useStrings(),j=e.jsxs(e.Fragment,{children:[s.logo&&e.jsx("span",{className:"aegis-shell__brand-logo",children:s.logo}),e.jsx("span",{className:"aegis-shell__brand-name",children:s.name})]});return e.jsxs("header",{className:l?"aegis-shell__header aegis-shell__header--scrolled":"aegis-shell__header",children:[e.jsxs("div",{className:"aegis-shell__header-left",children:[f&&g&&e.jsx("button",{ref:b,type:"button",className:"aegis-shell__menu-toggle",onClick:g,"aria-label":u?r.closeNavigation:r.openNavigation,"aria-expanded":u,children:e.jsx("span",{className:"aegis-shell__menu-toggle-glyph","aria-hidden":"true",children:"☰"})}),y&&_&&e.jsx("button",{type:"button",className:"aegis-shell__sidebar-toggle",onClick:_,"aria-label":h?r.showSidebar:r.hideSidebar,"aria-pressed":h,title:h?r.showSidebar:r.hideSidebar,children:e.jsx("span",{className:"aegis-shell__sidebar-toggle-glyph","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2"}),e.jsx("line",{x1:"8",y1:"3.5",x2:"8",y2:"16.5"})]})})}),o?e.jsx(B.AppSwitcher,{apps:n,activeAppId:i,onAppSwitch:a}):null,s.href?e.jsx(p.Link,{to:s.href,className:"aegis-shell__brand",children:j}):e.jsx("span",{className:"aegis-shell__brand",children:j})]}),e.jsx("div",{className:m?"aegis-shell__header-center aegis-shell__header-center--app":"aegis-shell__header-center",ref:k,"data-aegis-inline-slot":"",children:!m&&w}),e.jsxs("div",{className:"aegis-shell__header-right",children:[e.jsx(L,{}),N,d&&e.jsx(U.ShellNotificationBell,{inboxPath:d}),t&&e.jsx(R,{user:t}),x&&e.jsx("button",{type:"button",className:"aegis-shell__agent-toggle",onClick:x,"aria-label":c?r.hideAgentPanel:r.showAgentPanel,"aria-pressed":c,title:c?r.hideAgentPanel:r.showAgentPanel,children:e.jsx("span",{className:"aegis-shell__agent-toggle-glyph","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2"}),e.jsx("line",{x1:"12",y1:"3.5",x2:"12",y2:"16.5"})]})})})]})]})}function L(){const s=v.useStrings(),n=D.useEnvironmentManifest();if(n.status==="error")return e.jsx(S.Tooltip,{title:s.environmentsRetry(n.error.message),children:e.jsx("span",{className:"aegis-shell__env-error",children:e.jsxs(C.Chip,{tone:"warning",onClick:n.retry,children:[e.jsx("span",{className:"aegis-shell__env-error-full",children:s.environmentsUnavailable}),e.jsx("span",{className:"aegis-shell__env-error-short",children:s.environmentsUnavailableShort})]})})});if(n.status!=="ready")return null;const i=n.manifest.environments.map(a=>({id:a.id,label:a.label,badge:a.badge,hint:a.baseUrl}));return e.jsx(E.EnvironmentSwitcher,{className:"aegis-shell__env-switcher",options:i,currentId:n.currentEnvId,onChange:n.setCurrentEnv})}function R({user:s}){const n=p.useNavigate(),i=(s.menu??[]).map(l=>{const t=l.to;return{key:l.key,label:l.label,onClick:t?()=>{n(t)}:l.onClick}}),a=s.avatar??(typeof s.name=="string"?e.jsx(q.Avatar,{name:s.name,size:"sm",className:"aegis-shell__user-initials"}):null),o=e.jsxs("span",{className:a?"aegis-shell__user aegis-shell__user--badge":"aegis-shell__user",children:[a,e.jsx("span",{className:"aegis-shell__user-name",children:s.name})]});return i.length===0?o:e.jsx(A.DropdownMenu,{trigger:o,items:i})}exports.TopHeader=I;
|
|
2
2
|
//# sourceMappingURL=TopHeader.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopHeader.cjs","sources":["../../../src/layouts/shell/TopHeader.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { Tooltip } from 'antd';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { Avatar } from '../../components/ui/Avatar';\nimport { Chip } from '../../components/ui/Chip';\nimport {\n type DropdownItem,\n DropdownMenu,\n} from '../../components/ui/DropdownMenu';\nimport { EnvironmentSwitcher } from '../../components/ui/EnvironmentSwitcher';\nimport { useStrings } from '../../locale';\nimport { AppSwitcher } from './AppSwitcher';\nimport { ShellNotificationBell } from './ShellNotificationBell';\nimport { useEnvironmentManifest } from './environments';\nimport type { AegisApp, AegisBrand, AegisUser } from './types';\n\ninterface TopHeaderProps {\n brand: AegisBrand;\n apps: AegisApp[];\n activeAppId?: string;\n onAppSwitch?: (appId: string) => void;\n /** Whether to render the app launcher. */\n appSwitcher?: boolean;\n /** The page has scrolled under the header; it gets a shadow. */\n scrolled?: boolean;\n user?: AegisUser;\n headerCenter?: ReactNode;\n headerActions?: ReactNode;\n /** When set, render a notification bell linking to this path. */\n inboxPath?: string;\n /** Fired by the mobile hamburger; the shell owns the open state. */\n onMobileMenuToggle?: () => void;\n /** Whether the navigation drawer is open — drives aria-expanded on the hamburger. */\n mobileMenuOpen?: boolean;\n /** The hamburger button, which takes focus back when the drawer is dismissed. */\n menuToggleRef?: Ref<HTMLButtonElement>;\n /** Whether to render the mobile hamburger at all (only when sidebar exists). */\n showMobileMenu?: boolean;\n /** Whether to render the desktop sidebar collapse toggle. */\n sidebarCollapsible?: boolean;\n /** Current collapsed state — drives aria-pressed on the toggle. */\n sidebarCollapsed?: boolean;\n /** Fired by the desktop collapse button; the shell owns the state. */\n onSidebarToggle?: () => void;\n /**\n * Ref callback for the inline app-header slot. The active app's\n * `header` is portalled into this node so it appears inside the shell\n * header instead of below it.\n */\n inlineSlotRef?: (node: HTMLDivElement | null) => void;\n /** When true, hide the global `headerCenter` (an app header took it over). */\n inlineSlotActive?: boolean;\n /** Current agent panel state — drives aria-pressed on its toggle. */\n agentPanelOpen?: boolean;\n /** Fired by the agent panel toggle; the toggle renders only when set. */\n onAgentPanelToggle?: () => void;\n}\n\nexport function TopHeader({\n brand,\n apps,\n activeAppId,\n onAppSwitch,\n appSwitcher = true,\n scrolled = false,\n user,\n headerCenter,\n headerActions,\n inboxPath,\n onMobileMenuToggle,\n mobileMenuOpen = false,\n menuToggleRef,\n showMobileMenu,\n sidebarCollapsible,\n sidebarCollapsed,\n onSidebarToggle,\n inlineSlotRef,\n inlineSlotActive,\n agentPanelOpen = false,\n onAgentPanelToggle,\n}: TopHeaderProps): ReactElement {\n const strings = useStrings();\n const brandInner = (\n <>\n {brand.logo && (\n <span className=\"aegis-shell__brand-logo\">{brand.logo}</span>\n )}\n <span className=\"aegis-shell__brand-name\">{brand.name}</span>\n </>\n );\n\n return (\n <header\n className={\n scrolled\n ? 'aegis-shell__header aegis-shell__header--scrolled'\n : 'aegis-shell__header'\n }\n >\n <div className=\"aegis-shell__header-left\">\n {showMobileMenu && onMobileMenuToggle && (\n <button\n ref={menuToggleRef}\n type=\"button\"\n className=\"aegis-shell__menu-toggle\"\n onClick={onMobileMenuToggle}\n aria-label={\n mobileMenuOpen ? strings.closeNavigation : strings.openNavigation\n }\n aria-expanded={mobileMenuOpen}\n >\n <span className=\"aegis-shell__menu-toggle-glyph\" aria-hidden=\"true\">\n ☰\n </span>\n </button>\n )}\n {sidebarCollapsible && onSidebarToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__sidebar-toggle\"\n onClick={onSidebarToggle}\n aria-label={\n sidebarCollapsed ? strings.showSidebar : strings.hideSidebar\n }\n aria-pressed={sidebarCollapsed}\n title={sidebarCollapsed ? strings.showSidebar : strings.hideSidebar}\n >\n <span\n className=\"aegis-shell__sidebar-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"8\" y1=\"3.5\" x2=\"8\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n {appSwitcher ? (\n <AppSwitcher\n apps={apps}\n activeAppId={activeAppId}\n onAppSwitch={onAppSwitch}\n />\n ) : null}\n {brand.href ? (\n <Link to={brand.href} className=\"aegis-shell__brand\">\n {brandInner}\n </Link>\n ) : (\n <span className=\"aegis-shell__brand\">{brandInner}</span>\n )}\n </div>\n <div\n className={\n inlineSlotActive\n ? 'aegis-shell__header-center aegis-shell__header-center--app'\n : 'aegis-shell__header-center'\n }\n ref={inlineSlotRef}\n data-aegis-inline-slot=\"\"\n >\n {!inlineSlotActive && headerCenter}\n </div>\n <div className=\"aegis-shell__header-right\">\n <ActiveEnvironmentSwitcher />\n {headerActions}\n {inboxPath && <ShellNotificationBell inboxPath={inboxPath} />}\n {user && <UserMenu user={user} />}\n {onAgentPanelToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__agent-toggle\"\n onClick={onAgentPanelToggle}\n aria-label={\n agentPanelOpen ? 'Hide agent panel' : 'Show agent panel'\n }\n aria-pressed={agentPanelOpen}\n title={agentPanelOpen ? 'Hide agent panel' : 'Show agent panel'}\n >\n <span\n className=\"aegis-shell__agent-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"12\" y1=\"3.5\" x2=\"12\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n </div>\n </header>\n );\n}\n\nfunction ActiveEnvironmentSwitcher(): ReactElement | null {\n const state = useEnvironmentManifest();\n if (state.status === 'error') {\n return (\n <Tooltip title={`${state.error.message} Click to retry.`}>\n <span className=\"aegis-shell__env-error\">\n <Chip tone=\"warning\" onClick={state.retry}>\n <span className=\"aegis-shell__env-error-full\">\n Environments unavailable\n </span>\n <span className=\"aegis-shell__env-error-short\">Env error</span>\n </Chip>\n </span>\n </Tooltip>\n );\n }\n if (state.status !== 'ready') {\n return null;\n }\n const options = state.manifest.environments.map((e) => ({\n id: e.id,\n label: e.label,\n badge: e.badge,\n hint: e.baseUrl,\n }));\n return (\n <EnvironmentSwitcher\n className=\"aegis-shell__env-switcher\"\n options={options}\n currentId={state.currentEnvId}\n onChange={state.setCurrentEnv}\n />\n );\n}\n\nfunction UserMenu({ user }: { user: AegisUser }): ReactElement {\n const navigate = useNavigate();\n const items: DropdownItem[] = (user.menu ?? []).map((entry) => {\n const to = entry.to;\n return {\n key: entry.key,\n label: entry.label,\n onClick: to\n ? () => {\n navigate(to);\n }\n : entry.onClick,\n };\n });\n const badge =\n user.avatar ??\n (typeof user.name === 'string' ? (\n <Avatar\n name={user.name}\n size=\"sm\"\n className=\"aegis-shell__user-initials\"\n />\n ) : null);\n const trigger = (\n <span\n className={\n badge\n ? 'aegis-shell__user aegis-shell__user--badge'\n : 'aegis-shell__user'\n }\n >\n {badge}\n <span className=\"aegis-shell__user-name\">{user.name}</span>\n </span>\n );\n if (items.length === 0) {\n return trigger;\n }\n return <DropdownMenu trigger={trigger} items={items} />;\n}\n"],"names":["TopHeader","brand","apps","activeAppId","onAppSwitch","appSwitcher","scrolled","user","headerCenter","headerActions","inboxPath","onMobileMenuToggle","mobileMenuOpen","menuToggleRef","showMobileMenu","sidebarCollapsible","sidebarCollapsed","onSidebarToggle","inlineSlotRef","inlineSlotActive","agentPanelOpen","onAgentPanelToggle","strings","useStrings","brandInner","jsxs","Fragment","jsx","AppSwitcher","Link","ActiveEnvironmentSwitcher","ShellNotificationBell","UserMenu","state","useEnvironmentManifest","Tooltip","Chip","options","e","EnvironmentSwitcher","navigate","useNavigate","items","entry","to","badge","Avatar","trigger","DropdownMenu"],"mappings":"sgBA4DO,SAASA,EAAU,CACxB,MAAAC,EACA,KAAAC,EACA,YAAAC,EACA,YAAAC,EACA,YAAAC,EAAc,GACd,SAAAC,EAAW,GACX,KAAAC,EACA,aAAAC,EACA,cAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,eAAAC,EAAiB,GACjB,cAAAC,EACA,eAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EAAiB,GACjB,mBAAAC,CACF,EAAiC,CAC/B,MAAMC,EAAUC,EAAAA,WAAA,EACVC,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAA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{"version":3,"file":"TopHeader.cjs","sources":["../../../src/layouts/shell/TopHeader.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { Tooltip } from 'antd';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { Avatar } from '../../components/ui/Avatar';\nimport { Chip } from '../../components/ui/Chip';\nimport {\n type DropdownItem,\n DropdownMenu,\n} from '../../components/ui/DropdownMenu';\nimport { EnvironmentSwitcher } from '../../components/ui/EnvironmentSwitcher';\nimport { useStrings } from '../../locale';\nimport { AppSwitcher } from './AppSwitcher';\nimport { ShellNotificationBell } from './ShellNotificationBell';\nimport { useEnvironmentManifest } from './environments';\nimport type { AegisApp, AegisBrand, AegisUser } from './types';\n\ninterface TopHeaderProps {\n brand: AegisBrand;\n apps: AegisApp[];\n activeAppId?: string;\n onAppSwitch?: (appId: string) => void;\n /** Whether to render the app launcher. */\n appSwitcher?: boolean;\n /** The page has scrolled under the header; it gets a shadow. */\n scrolled?: boolean;\n user?: AegisUser;\n headerCenter?: ReactNode;\n headerActions?: ReactNode;\n /** When set, render a notification bell linking to this path. */\n inboxPath?: string;\n /** Fired by the mobile hamburger; the shell owns the open state. */\n onMobileMenuToggle?: () => void;\n /** Whether the navigation drawer is open — drives aria-expanded on the hamburger. */\n mobileMenuOpen?: boolean;\n /** The hamburger button, which takes focus back when the drawer is dismissed. */\n menuToggleRef?: Ref<HTMLButtonElement>;\n /** Whether to render the mobile hamburger at all (only when sidebar exists). */\n showMobileMenu?: boolean;\n /** Whether to render the desktop sidebar collapse toggle. */\n sidebarCollapsible?: boolean;\n /** Current collapsed state — drives aria-pressed on the toggle. */\n sidebarCollapsed?: boolean;\n /** Fired by the desktop collapse button; the shell owns the state. */\n onSidebarToggle?: () => void;\n /**\n * Ref callback for the inline app-header slot. The active app's\n * `header` is portalled into this node so it appears inside the shell\n * header instead of below it.\n */\n inlineSlotRef?: (node: HTMLDivElement | null) => void;\n /** When true, hide the global `headerCenter` (an app header took it over). */\n inlineSlotActive?: boolean;\n /** Current agent panel state — drives aria-pressed on its toggle. */\n agentPanelOpen?: boolean;\n /** Fired by the agent panel toggle; the toggle renders only when set. */\n onAgentPanelToggle?: () => void;\n}\n\nexport function TopHeader({\n brand,\n apps,\n activeAppId,\n onAppSwitch,\n appSwitcher = true,\n scrolled = false,\n user,\n headerCenter,\n headerActions,\n inboxPath,\n onMobileMenuToggle,\n mobileMenuOpen = false,\n menuToggleRef,\n showMobileMenu,\n sidebarCollapsible,\n sidebarCollapsed,\n onSidebarToggle,\n inlineSlotRef,\n inlineSlotActive,\n agentPanelOpen = false,\n onAgentPanelToggle,\n}: TopHeaderProps): ReactElement {\n const strings = useStrings();\n const brandInner = (\n <>\n {brand.logo && (\n <span className=\"aegis-shell__brand-logo\">{brand.logo}</span>\n )}\n <span className=\"aegis-shell__brand-name\">{brand.name}</span>\n </>\n );\n\n return (\n <header\n className={\n scrolled\n ? 'aegis-shell__header aegis-shell__header--scrolled'\n : 'aegis-shell__header'\n }\n >\n <div className=\"aegis-shell__header-left\">\n {showMobileMenu && onMobileMenuToggle && (\n <button\n ref={menuToggleRef}\n type=\"button\"\n className=\"aegis-shell__menu-toggle\"\n onClick={onMobileMenuToggle}\n aria-label={\n mobileMenuOpen ? strings.closeNavigation : strings.openNavigation\n }\n aria-expanded={mobileMenuOpen}\n >\n <span className=\"aegis-shell__menu-toggle-glyph\" aria-hidden=\"true\">\n ☰\n </span>\n </button>\n )}\n {sidebarCollapsible && onSidebarToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__sidebar-toggle\"\n onClick={onSidebarToggle}\n aria-label={\n sidebarCollapsed ? strings.showSidebar : strings.hideSidebar\n }\n aria-pressed={sidebarCollapsed}\n title={sidebarCollapsed ? strings.showSidebar : strings.hideSidebar}\n >\n <span\n className=\"aegis-shell__sidebar-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"8\" y1=\"3.5\" x2=\"8\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n {appSwitcher ? (\n <AppSwitcher\n apps={apps}\n activeAppId={activeAppId}\n onAppSwitch={onAppSwitch}\n />\n ) : null}\n {brand.href ? (\n <Link to={brand.href} className=\"aegis-shell__brand\">\n {brandInner}\n </Link>\n ) : (\n <span className=\"aegis-shell__brand\">{brandInner}</span>\n )}\n </div>\n <div\n className={\n inlineSlotActive\n ? 'aegis-shell__header-center aegis-shell__header-center--app'\n : 'aegis-shell__header-center'\n }\n ref={inlineSlotRef}\n data-aegis-inline-slot=\"\"\n >\n {!inlineSlotActive && headerCenter}\n </div>\n <div className=\"aegis-shell__header-right\">\n <ActiveEnvironmentSwitcher />\n {headerActions}\n {inboxPath && <ShellNotificationBell inboxPath={inboxPath} />}\n {user && <UserMenu user={user} />}\n {onAgentPanelToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__agent-toggle\"\n onClick={onAgentPanelToggle}\n aria-label={\n agentPanelOpen ? strings.hideAgentPanel : strings.showAgentPanel\n }\n aria-pressed={agentPanelOpen}\n title={\n agentPanelOpen ? strings.hideAgentPanel : strings.showAgentPanel\n }\n >\n <span\n className=\"aegis-shell__agent-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"12\" y1=\"3.5\" x2=\"12\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n </div>\n </header>\n );\n}\n\nfunction ActiveEnvironmentSwitcher(): ReactElement | null {\n const strings = useStrings();\n const state = useEnvironmentManifest();\n if (state.status === 'error') {\n return (\n <Tooltip title={strings.environmentsRetry(state.error.message)}>\n <span className=\"aegis-shell__env-error\">\n <Chip tone=\"warning\" onClick={state.retry}>\n <span className=\"aegis-shell__env-error-full\">\n {strings.environmentsUnavailable}\n </span>\n <span className=\"aegis-shell__env-error-short\">\n {strings.environmentsUnavailableShort}\n </span>\n </Chip>\n </span>\n </Tooltip>\n );\n }\n if (state.status !== 'ready') {\n return null;\n }\n const options = state.manifest.environments.map((e) => ({\n id: e.id,\n label: e.label,\n badge: e.badge,\n hint: e.baseUrl,\n }));\n return (\n <EnvironmentSwitcher\n className=\"aegis-shell__env-switcher\"\n options={options}\n currentId={state.currentEnvId}\n onChange={state.setCurrentEnv}\n />\n );\n}\n\nfunction UserMenu({ user }: { user: AegisUser }): ReactElement {\n const navigate = useNavigate();\n const items: DropdownItem[] = (user.menu ?? []).map((entry) => {\n const to = entry.to;\n return {\n key: entry.key,\n label: entry.label,\n onClick: to\n ? () => {\n navigate(to);\n }\n : entry.onClick,\n };\n });\n const badge =\n user.avatar ??\n (typeof user.name === 'string' ? (\n <Avatar\n name={user.name}\n size=\"sm\"\n className=\"aegis-shell__user-initials\"\n />\n ) : null);\n const trigger = (\n <span\n className={\n badge\n ? 'aegis-shell__user aegis-shell__user--badge'\n : 'aegis-shell__user'\n }\n >\n {badge}\n <span className=\"aegis-shell__user-name\">{user.name}</span>\n </span>\n );\n if (items.length === 0) {\n return trigger;\n }\n return <DropdownMenu trigger={trigger} items={items} />;\n}\n"],"names":["TopHeader","brand","apps","activeAppId","onAppSwitch","appSwitcher","scrolled","user","headerCenter","headerActions","inboxPath","onMobileMenuToggle","mobileMenuOpen","menuToggleRef","showMobileMenu","sidebarCollapsible","sidebarCollapsed","onSidebarToggle","inlineSlotRef","inlineSlotActive","agentPanelOpen","onAgentPanelToggle","strings","useStrings","brandInner","jsxs","Fragment","jsx","AppSwitcher","Link","ActiveEnvironmentSwitcher","ShellNotificationBell","UserMenu","state","useEnvironmentManifest","Tooltip","Chip","options","e","EnvironmentSwitcher","navigate","useNavigate","items","entry","to","badge","Avatar","trigger","DropdownMenu"],"mappings":"sgBA4DO,SAASA,EAAU,CACxB,MAAAC,EACA,KAAAC,EACA,YAAAC,EACA,YAAAC,EACA,YAAAC,EAAc,GACd,SAAAC,EAAW,GACX,KAAAC,EACA,aAAAC,EACA,cAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,eAAAC,EAAiB,GACjB,cAAAC,EACA,eAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EAAiB,GACjB,mBAAAC,CACF,EAAiC,CAC/B,MAAMC,EAAUC,EAAAA,WAAA,EACVC,EACJC,EAAAA,KAAAC,EAAAA,SAAA,CACG,SAAA,CAAAzB,EAAM,MACL0B,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA2B,WAAM,KAAK,EAExDA,EAAAA,IAAC,OAAA,CAAK,UAAU,0BAA2B,WAAM,IAAA,CAAK,CAAA,EACxD,EAGF,OACEF,EAAAA,KAAC,SAAA,CACC,UACEnB,EACI,oDACA,sBAGN,SAAA,CAAAmB,EAAAA,KAAC,MAAA,CAAI,UAAU,2BACZ,SAAA,CAAAX,GAAkBH,GACjBgB,EAAAA,IAAC,SAAA,CACC,IAAKd,EACL,KAAK,SACL,UAAU,2BACV,QAASF,EACT,aACEC,EAAiBU,EAAQ,gBAAkBA,EAAQ,eAErD,gBAAeV,EAEf,eAAC,OAAA,CAAK,UAAU,iCAAiC,cAAY,OAAO,SAAA,GAAA,CAEpE,CAAA,CAAA,EAGHG,GAAsBE,GACrBU,EAAAA,IAAC,SAAA,CACC,KAAK,SACL,UAAU,8BACV,QAASV,EACT,aACED,EAAmBM,EAAQ,YAAcA,EAAQ,YAEnD,eAAcN,EACd,MAAOA,EAAmBM,EAAQ,YAAcA,EAA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AAQ,CAAA,GAAI,IAAKoC,GAAU,CAC7D,MAAMC,EAAKD,EAAM,GACjB,MAAO,CACL,IAAKA,EAAM,IACX,MAAOA,EAAM,MACb,QAASC,EACL,IAAM,CACJJ,EAASI,CAAE,CACb,EACAD,EAAM,OAAA,CAEd,CAAC,EACKE,EACJtC,EAAK,SACJ,OAAOA,EAAK,MAAS,SACpBoB,EAAAA,IAACmB,EAAAA,OAAA,CACC,KAAMvC,EAAK,KACX,KAAK,KACL,UAAU,4BAAA,CAAA,EAEV,MACAwC,EACJtB,EAAAA,KAAC,OAAA,CACC,UACEoB,EACI,6CACA,oBAGL,SAAA,CAAAA,EACDlB,EAAAA,IAAC,OAAA,CAAK,UAAU,yBAA0B,WAAK,IAAA,CAAK,CAAA,CAAA,CAAA,EAGxD,OAAIe,EAAM,SAAW,EACZK,EAEFpB,EAAAA,IAACqB,EAAAA,aAAA,CAAa,QAAAD,EAAkB,MAAAL,CAAA,CAAc,CACvD"}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { jsxs as i, Fragment as S, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as A } from "antd";
|
|
3
3
|
import { Link as E, useNavigate as j } from "react-router-dom";
|
|
4
|
-
import { Avatar as
|
|
5
|
-
import { Chip as
|
|
4
|
+
import { Avatar as U } from "../../components/ui/Avatar.js";
|
|
5
|
+
import { Chip as B } from "../../components/ui/Chip.js";
|
|
6
6
|
import { DropdownMenu as I } from "../../components/ui/DropdownMenu.js";
|
|
7
7
|
import { EnvironmentSwitcher as L } from "../../components/ui/EnvironmentSwitcher.js";
|
|
8
|
-
import { AppSwitcher as
|
|
9
|
-
import { ShellNotificationBell as
|
|
10
|
-
import { useStrings as
|
|
11
|
-
import { useEnvironmentManifest as
|
|
8
|
+
import { AppSwitcher as W } from "./AppSwitcher.js";
|
|
9
|
+
import { ShellNotificationBell as z } from "./ShellNotificationBell.js";
|
|
10
|
+
import { useStrings as N } from "../../locale/useStrings.js";
|
|
11
|
+
import { useEnvironmentManifest as D } from "./environments/useEnvironment.js";
|
|
12
12
|
function Z({
|
|
13
|
-
brand:
|
|
14
|
-
apps:
|
|
15
|
-
activeAppId:
|
|
16
|
-
onAppSwitch:
|
|
13
|
+
brand: s,
|
|
14
|
+
apps: a,
|
|
15
|
+
activeAppId: n,
|
|
16
|
+
onAppSwitch: l,
|
|
17
17
|
appSwitcher: h = !0,
|
|
18
|
-
scrolled:
|
|
19
|
-
user:
|
|
20
|
-
headerCenter:
|
|
21
|
-
headerActions:
|
|
18
|
+
scrolled: t = !1,
|
|
19
|
+
user: o,
|
|
20
|
+
headerCenter: w,
|
|
21
|
+
headerActions: b,
|
|
22
22
|
inboxPath: g,
|
|
23
23
|
onMobileMenuToggle: m,
|
|
24
24
|
mobileMenuOpen: _ = !1,
|
|
25
|
-
menuToggleRef:
|
|
26
|
-
showMobileMenu:
|
|
27
|
-
sidebarCollapsible:
|
|
25
|
+
menuToggleRef: k,
|
|
26
|
+
showMobileMenu: x,
|
|
27
|
+
sidebarCollapsible: y,
|
|
28
28
|
sidebarCollapsed: c,
|
|
29
29
|
onSidebarToggle: p,
|
|
30
|
-
inlineSlotRef:
|
|
30
|
+
inlineSlotRef: C,
|
|
31
31
|
inlineSlotActive: u,
|
|
32
32
|
agentPanelOpen: d = !1,
|
|
33
33
|
onAgentPanelToggle: f
|
|
34
34
|
}) {
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
/* @__PURE__ */ e("span", { className: "aegis-shell__brand-name", children:
|
|
35
|
+
const r = N(), v = /* @__PURE__ */ i(S, { children: [
|
|
36
|
+
s.logo && /* @__PURE__ */ e("span", { className: "aegis-shell__brand-logo", children: s.logo }),
|
|
37
|
+
/* @__PURE__ */ e("span", { className: "aegis-shell__brand-name", children: s.name })
|
|
38
38
|
] });
|
|
39
|
-
return /* @__PURE__ */
|
|
39
|
+
return /* @__PURE__ */ i(
|
|
40
40
|
"header",
|
|
41
41
|
{
|
|
42
|
-
className:
|
|
42
|
+
className: t ? "aegis-shell__header aegis-shell__header--scrolled" : "aegis-shell__header",
|
|
43
43
|
children: [
|
|
44
|
-
/* @__PURE__ */
|
|
45
|
-
|
|
44
|
+
/* @__PURE__ */ i("div", { className: "aegis-shell__header-left", children: [
|
|
45
|
+
x && m && /* @__PURE__ */ e(
|
|
46
46
|
"button",
|
|
47
47
|
{
|
|
48
|
-
ref:
|
|
48
|
+
ref: k,
|
|
49
49
|
type: "button",
|
|
50
50
|
className: "aegis-shell__menu-toggle",
|
|
51
51
|
onClick: m,
|
|
52
|
-
"aria-label": _ ?
|
|
52
|
+
"aria-label": _ ? r.closeNavigation : r.openNavigation,
|
|
53
53
|
"aria-expanded": _,
|
|
54
54
|
children: /* @__PURE__ */ e("span", { className: "aegis-shell__menu-toggle-glyph", "aria-hidden": "true", children: "☰" })
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
|
-
|
|
57
|
+
y && p && /* @__PURE__ */ e(
|
|
58
58
|
"button",
|
|
59
59
|
{
|
|
60
60
|
type: "button",
|
|
61
61
|
className: "aegis-shell__sidebar-toggle",
|
|
62
62
|
onClick: p,
|
|
63
|
-
"aria-label": c ?
|
|
63
|
+
"aria-label": c ? r.showSidebar : r.hideSidebar,
|
|
64
64
|
"aria-pressed": c,
|
|
65
|
-
title: c ?
|
|
65
|
+
title: c ? r.showSidebar : r.hideSidebar,
|
|
66
66
|
children: /* @__PURE__ */ e(
|
|
67
67
|
"span",
|
|
68
68
|
{
|
|
69
69
|
className: "aegis-shell__sidebar-toggle-glyph",
|
|
70
70
|
"aria-hidden": "true",
|
|
71
|
-
children: /* @__PURE__ */
|
|
71
|
+
children: /* @__PURE__ */ i(
|
|
72
72
|
"svg",
|
|
73
73
|
{
|
|
74
74
|
width: "18",
|
|
@@ -90,44 +90,44 @@ function Z({
|
|
|
90
90
|
}
|
|
91
91
|
),
|
|
92
92
|
h ? /* @__PURE__ */ e(
|
|
93
|
-
|
|
93
|
+
W,
|
|
94
94
|
{
|
|
95
|
-
apps:
|
|
96
|
-
activeAppId:
|
|
97
|
-
onAppSwitch:
|
|
95
|
+
apps: a,
|
|
96
|
+
activeAppId: n,
|
|
97
|
+
onAppSwitch: l
|
|
98
98
|
}
|
|
99
99
|
) : null,
|
|
100
|
-
|
|
100
|
+
s.href ? /* @__PURE__ */ e(E, { to: s.href, className: "aegis-shell__brand", children: v }) : /* @__PURE__ */ e("span", { className: "aegis-shell__brand", children: v })
|
|
101
101
|
] }),
|
|
102
102
|
/* @__PURE__ */ e(
|
|
103
103
|
"div",
|
|
104
104
|
{
|
|
105
105
|
className: u ? "aegis-shell__header-center aegis-shell__header-center--app" : "aegis-shell__header-center",
|
|
106
|
-
ref:
|
|
106
|
+
ref: C,
|
|
107
107
|
"data-aegis-inline-slot": "",
|
|
108
|
-
children: !u &&
|
|
108
|
+
children: !u && w
|
|
109
109
|
}
|
|
110
110
|
),
|
|
111
|
-
/* @__PURE__ */
|
|
112
|
-
/* @__PURE__ */ e(
|
|
113
|
-
|
|
114
|
-
g && /* @__PURE__ */ e(
|
|
115
|
-
|
|
111
|
+
/* @__PURE__ */ i("div", { className: "aegis-shell__header-right", children: [
|
|
112
|
+
/* @__PURE__ */ e(F, {}),
|
|
113
|
+
b,
|
|
114
|
+
g && /* @__PURE__ */ e(z, { inboxPath: g }),
|
|
115
|
+
o && /* @__PURE__ */ e(H, { user: o }),
|
|
116
116
|
f && /* @__PURE__ */ e(
|
|
117
117
|
"button",
|
|
118
118
|
{
|
|
119
119
|
type: "button",
|
|
120
120
|
className: "aegis-shell__agent-toggle",
|
|
121
121
|
onClick: f,
|
|
122
|
-
"aria-label": d ?
|
|
122
|
+
"aria-label": d ? r.hideAgentPanel : r.showAgentPanel,
|
|
123
123
|
"aria-pressed": d,
|
|
124
|
-
title: d ?
|
|
124
|
+
title: d ? r.hideAgentPanel : r.showAgentPanel,
|
|
125
125
|
children: /* @__PURE__ */ e(
|
|
126
126
|
"span",
|
|
127
127
|
{
|
|
128
128
|
className: "aegis-shell__agent-toggle-glyph",
|
|
129
129
|
"aria-hidden": "true",
|
|
130
|
-
children: /* @__PURE__ */
|
|
130
|
+
children: /* @__PURE__ */ i(
|
|
131
131
|
"svg",
|
|
132
132
|
{
|
|
133
133
|
width: "18",
|
|
@@ -153,20 +153,20 @@ function Z({
|
|
|
153
153
|
}
|
|
154
154
|
);
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const a =
|
|
156
|
+
function F() {
|
|
157
|
+
const s = N(), a = D();
|
|
158
158
|
if (a.status === "error")
|
|
159
|
-
return /* @__PURE__ */ e(
|
|
160
|
-
/* @__PURE__ */ e("span", { className: "aegis-shell__env-error-full", children:
|
|
161
|
-
/* @__PURE__ */ e("span", { className: "aegis-shell__env-error-short", children:
|
|
159
|
+
return /* @__PURE__ */ e(A, { title: s.environmentsRetry(a.error.message), children: /* @__PURE__ */ e("span", { className: "aegis-shell__env-error", children: /* @__PURE__ */ i(B, { tone: "warning", onClick: a.retry, children: [
|
|
160
|
+
/* @__PURE__ */ e("span", { className: "aegis-shell__env-error-full", children: s.environmentsUnavailable }),
|
|
161
|
+
/* @__PURE__ */ e("span", { className: "aegis-shell__env-error-short", children: s.environmentsUnavailableShort })
|
|
162
162
|
] }) }) });
|
|
163
163
|
if (a.status !== "ready")
|
|
164
164
|
return null;
|
|
165
|
-
const n = a.manifest.environments.map((
|
|
166
|
-
id:
|
|
167
|
-
label:
|
|
168
|
-
badge:
|
|
169
|
-
hint:
|
|
165
|
+
const n = a.manifest.environments.map((l) => ({
|
|
166
|
+
id: l.id,
|
|
167
|
+
label: l.label,
|
|
168
|
+
badge: l.badge,
|
|
169
|
+
hint: l.baseUrl
|
|
170
170
|
}));
|
|
171
171
|
return /* @__PURE__ */ e(
|
|
172
172
|
L,
|
|
@@ -178,34 +178,34 @@ function D() {
|
|
|
178
178
|
}
|
|
179
179
|
);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
const
|
|
183
|
-
const
|
|
181
|
+
function H({ user: s }) {
|
|
182
|
+
const a = j(), n = (s.menu ?? []).map((t) => {
|
|
183
|
+
const o = t.to;
|
|
184
184
|
return {
|
|
185
|
-
key:
|
|
186
|
-
label:
|
|
187
|
-
onClick:
|
|
188
|
-
|
|
189
|
-
} :
|
|
185
|
+
key: t.key,
|
|
186
|
+
label: t.label,
|
|
187
|
+
onClick: o ? () => {
|
|
188
|
+
a(o);
|
|
189
|
+
} : t.onClick
|
|
190
190
|
};
|
|
191
|
-
}),
|
|
192
|
-
|
|
191
|
+
}), l = s.avatar ?? (typeof s.name == "string" ? /* @__PURE__ */ e(
|
|
192
|
+
U,
|
|
193
193
|
{
|
|
194
|
-
name:
|
|
194
|
+
name: s.name,
|
|
195
195
|
size: "sm",
|
|
196
196
|
className: "aegis-shell__user-initials"
|
|
197
197
|
}
|
|
198
|
-
) : null), h = /* @__PURE__ */
|
|
198
|
+
) : null), h = /* @__PURE__ */ i(
|
|
199
199
|
"span",
|
|
200
200
|
{
|
|
201
|
-
className:
|
|
201
|
+
className: l ? "aegis-shell__user aegis-shell__user--badge" : "aegis-shell__user",
|
|
202
202
|
children: [
|
|
203
|
-
|
|
204
|
-
/* @__PURE__ */ e("span", { className: "aegis-shell__user-name", children:
|
|
203
|
+
l,
|
|
204
|
+
/* @__PURE__ */ e("span", { className: "aegis-shell__user-name", children: s.name })
|
|
205
205
|
]
|
|
206
206
|
}
|
|
207
207
|
);
|
|
208
|
-
return
|
|
208
|
+
return n.length === 0 ? h : /* @__PURE__ */ e(I, { trigger: h, items: n });
|
|
209
209
|
}
|
|
210
210
|
export {
|
|
211
211
|
Z as TopHeader
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TopHeader.js","sources":["../../../src/layouts/shell/TopHeader.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { Tooltip } from 'antd';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { Avatar } from '../../components/ui/Avatar';\nimport { Chip } from '../../components/ui/Chip';\nimport {\n type DropdownItem,\n DropdownMenu,\n} from '../../components/ui/DropdownMenu';\nimport { EnvironmentSwitcher } from '../../components/ui/EnvironmentSwitcher';\nimport { useStrings } from '../../locale';\nimport { AppSwitcher } from './AppSwitcher';\nimport { ShellNotificationBell } from './ShellNotificationBell';\nimport { useEnvironmentManifest } from './environments';\nimport type { AegisApp, AegisBrand, AegisUser } from './types';\n\ninterface TopHeaderProps {\n brand: AegisBrand;\n apps: AegisApp[];\n activeAppId?: string;\n onAppSwitch?: (appId: string) => void;\n /** Whether to render the app launcher. */\n appSwitcher?: boolean;\n /** The page has scrolled under the header; it gets a shadow. */\n scrolled?: boolean;\n user?: AegisUser;\n headerCenter?: ReactNode;\n headerActions?: ReactNode;\n /** When set, render a notification bell linking to this path. */\n inboxPath?: string;\n /** Fired by the mobile hamburger; the shell owns the open state. */\n onMobileMenuToggle?: () => void;\n /** Whether the navigation drawer is open — drives aria-expanded on the hamburger. */\n mobileMenuOpen?: boolean;\n /** The hamburger button, which takes focus back when the drawer is dismissed. */\n menuToggleRef?: Ref<HTMLButtonElement>;\n /** Whether to render the mobile hamburger at all (only when sidebar exists). */\n showMobileMenu?: boolean;\n /** Whether to render the desktop sidebar collapse toggle. */\n sidebarCollapsible?: boolean;\n /** Current collapsed state — drives aria-pressed on the toggle. */\n sidebarCollapsed?: boolean;\n /** Fired by the desktop collapse button; the shell owns the state. */\n onSidebarToggle?: () => void;\n /**\n * Ref callback for the inline app-header slot. The active app's\n * `header` is portalled into this node so it appears inside the shell\n * header instead of below it.\n */\n inlineSlotRef?: (node: HTMLDivElement | null) => void;\n /** When true, hide the global `headerCenter` (an app header took it over). */\n inlineSlotActive?: boolean;\n /** Current agent panel state — drives aria-pressed on its toggle. */\n agentPanelOpen?: boolean;\n /** Fired by the agent panel toggle; the toggle renders only when set. */\n onAgentPanelToggle?: () => void;\n}\n\nexport function TopHeader({\n brand,\n apps,\n activeAppId,\n onAppSwitch,\n appSwitcher = true,\n scrolled = false,\n user,\n headerCenter,\n headerActions,\n inboxPath,\n onMobileMenuToggle,\n mobileMenuOpen = false,\n menuToggleRef,\n showMobileMenu,\n sidebarCollapsible,\n sidebarCollapsed,\n onSidebarToggle,\n inlineSlotRef,\n inlineSlotActive,\n agentPanelOpen = false,\n onAgentPanelToggle,\n}: TopHeaderProps): ReactElement {\n const strings = useStrings();\n const brandInner = (\n <>\n {brand.logo && (\n <span className=\"aegis-shell__brand-logo\">{brand.logo}</span>\n )}\n <span className=\"aegis-shell__brand-name\">{brand.name}</span>\n </>\n );\n\n return (\n <header\n className={\n scrolled\n ? 'aegis-shell__header aegis-shell__header--scrolled'\n : 'aegis-shell__header'\n }\n >\n <div className=\"aegis-shell__header-left\">\n {showMobileMenu && onMobileMenuToggle && (\n <button\n ref={menuToggleRef}\n type=\"button\"\n className=\"aegis-shell__menu-toggle\"\n onClick={onMobileMenuToggle}\n aria-label={\n mobileMenuOpen ? strings.closeNavigation : strings.openNavigation\n }\n aria-expanded={mobileMenuOpen}\n >\n <span className=\"aegis-shell__menu-toggle-glyph\" aria-hidden=\"true\">\n ☰\n </span>\n </button>\n )}\n {sidebarCollapsible && onSidebarToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__sidebar-toggle\"\n onClick={onSidebarToggle}\n aria-label={\n sidebarCollapsed ? strings.showSidebar : strings.hideSidebar\n }\n aria-pressed={sidebarCollapsed}\n title={sidebarCollapsed ? strings.showSidebar : strings.hideSidebar}\n >\n <span\n className=\"aegis-shell__sidebar-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"8\" y1=\"3.5\" x2=\"8\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n {appSwitcher ? (\n <AppSwitcher\n apps={apps}\n activeAppId={activeAppId}\n onAppSwitch={onAppSwitch}\n />\n ) : null}\n {brand.href ? (\n <Link to={brand.href} className=\"aegis-shell__brand\">\n {brandInner}\n </Link>\n ) : (\n <span className=\"aegis-shell__brand\">{brandInner}</span>\n )}\n </div>\n <div\n className={\n inlineSlotActive\n ? 'aegis-shell__header-center aegis-shell__header-center--app'\n : 'aegis-shell__header-center'\n }\n ref={inlineSlotRef}\n data-aegis-inline-slot=\"\"\n >\n {!inlineSlotActive && headerCenter}\n </div>\n <div className=\"aegis-shell__header-right\">\n <ActiveEnvironmentSwitcher />\n {headerActions}\n {inboxPath && <ShellNotificationBell inboxPath={inboxPath} />}\n {user && <UserMenu user={user} />}\n {onAgentPanelToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__agent-toggle\"\n onClick={onAgentPanelToggle}\n aria-label={\n agentPanelOpen ? 'Hide agent panel' : 'Show agent panel'\n }\n aria-pressed={agentPanelOpen}\n title={agentPanelOpen ? 'Hide agent panel' : 'Show agent panel'}\n >\n <span\n className=\"aegis-shell__agent-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"12\" y1=\"3.5\" x2=\"12\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n </div>\n </header>\n );\n}\n\nfunction ActiveEnvironmentSwitcher(): ReactElement | null {\n const state = useEnvironmentManifest();\n if (state.status === 'error') {\n return (\n <Tooltip title={`${state.error.message} Click to retry.`}>\n <span className=\"aegis-shell__env-error\">\n <Chip tone=\"warning\" onClick={state.retry}>\n <span className=\"aegis-shell__env-error-full\">\n Environments unavailable\n </span>\n <span className=\"aegis-shell__env-error-short\">Env error</span>\n </Chip>\n </span>\n </Tooltip>\n );\n }\n if (state.status !== 'ready') {\n return null;\n }\n const options = state.manifest.environments.map((e) => ({\n id: e.id,\n label: e.label,\n badge: e.badge,\n hint: e.baseUrl,\n }));\n return (\n <EnvironmentSwitcher\n className=\"aegis-shell__env-switcher\"\n options={options}\n currentId={state.currentEnvId}\n onChange={state.setCurrentEnv}\n />\n );\n}\n\nfunction UserMenu({ user }: { user: AegisUser }): ReactElement {\n const navigate = useNavigate();\n const items: DropdownItem[] = (user.menu ?? []).map((entry) => {\n const to = entry.to;\n return {\n key: entry.key,\n label: entry.label,\n onClick: to\n ? () => {\n navigate(to);\n }\n : entry.onClick,\n };\n });\n const badge =\n user.avatar ??\n (typeof user.name === 'string' ? (\n <Avatar\n name={user.name}\n size=\"sm\"\n className=\"aegis-shell__user-initials\"\n />\n ) : null);\n const trigger = (\n <span\n className={\n badge\n ? 'aegis-shell__user aegis-shell__user--badge'\n : 'aegis-shell__user'\n }\n >\n {badge}\n <span className=\"aegis-shell__user-name\">{user.name}</span>\n </span>\n );\n if (items.length === 0) {\n return trigger;\n }\n return <DropdownMenu trigger={trigger} items={items} />;\n}\n"],"names":["TopHeader","brand","apps","activeAppId","onAppSwitch","appSwitcher","scrolled","user","headerCenter","headerActions","inboxPath","onMobileMenuToggle","mobileMenuOpen","menuToggleRef","showMobileMenu","sidebarCollapsible","sidebarCollapsed","onSidebarToggle","inlineSlotRef","inlineSlotActive","agentPanelOpen","onAgentPanelToggle","strings","useStrings","brandInner","jsxs","Fragment","jsx","AppSwitcher","Link","ActiveEnvironmentSwitcher","ShellNotificationBell","UserMenu","state","useEnvironmentManifest","Tooltip","Chip","options","e","EnvironmentSwitcher","navigate","useNavigate","items","entry","to","badge","Avatar","trigger","DropdownMenu"],"mappings":";;;;;;;;;;;AA4DO,SAASA,EAAU;AAAA,EACxB,OAAAC;AAAA,EACA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A0B,YAAK,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGxD,SAAIe,EAAM,WAAW,IACZK,IAEF,gBAAApB,EAACqB,GAAA,EAAa,SAAAD,GAAkB,OAAAL,EAAA,CAAc;AACvD;"}
|
|
1
|
+
{"version":3,"file":"TopHeader.js","sources":["../../../src/layouts/shell/TopHeader.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { Tooltip } from 'antd';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { Avatar } from '../../components/ui/Avatar';\nimport { Chip } from '../../components/ui/Chip';\nimport {\n type DropdownItem,\n DropdownMenu,\n} from '../../components/ui/DropdownMenu';\nimport { EnvironmentSwitcher } from '../../components/ui/EnvironmentSwitcher';\nimport { useStrings } from '../../locale';\nimport { AppSwitcher } from './AppSwitcher';\nimport { ShellNotificationBell } from './ShellNotificationBell';\nimport { useEnvironmentManifest } from './environments';\nimport type { AegisApp, AegisBrand, AegisUser } from './types';\n\ninterface TopHeaderProps {\n brand: AegisBrand;\n apps: AegisApp[];\n activeAppId?: string;\n onAppSwitch?: (appId: string) => void;\n /** Whether to render the app launcher. */\n appSwitcher?: boolean;\n /** The page has scrolled under the header; it gets a shadow. */\n scrolled?: boolean;\n user?: AegisUser;\n headerCenter?: ReactNode;\n headerActions?: ReactNode;\n /** When set, render a notification bell linking to this path. */\n inboxPath?: string;\n /** Fired by the mobile hamburger; the shell owns the open state. */\n onMobileMenuToggle?: () => void;\n /** Whether the navigation drawer is open — drives aria-expanded on the hamburger. */\n mobileMenuOpen?: boolean;\n /** The hamburger button, which takes focus back when the drawer is dismissed. */\n menuToggleRef?: Ref<HTMLButtonElement>;\n /** Whether to render the mobile hamburger at all (only when sidebar exists). */\n showMobileMenu?: boolean;\n /** Whether to render the desktop sidebar collapse toggle. */\n sidebarCollapsible?: boolean;\n /** Current collapsed state — drives aria-pressed on the toggle. */\n sidebarCollapsed?: boolean;\n /** Fired by the desktop collapse button; the shell owns the state. */\n onSidebarToggle?: () => void;\n /**\n * Ref callback for the inline app-header slot. The active app's\n * `header` is portalled into this node so it appears inside the shell\n * header instead of below it.\n */\n inlineSlotRef?: (node: HTMLDivElement | null) => void;\n /** When true, hide the global `headerCenter` (an app header took it over). */\n inlineSlotActive?: boolean;\n /** Current agent panel state — drives aria-pressed on its toggle. */\n agentPanelOpen?: boolean;\n /** Fired by the agent panel toggle; the toggle renders only when set. */\n onAgentPanelToggle?: () => void;\n}\n\nexport function TopHeader({\n brand,\n apps,\n activeAppId,\n onAppSwitch,\n appSwitcher = true,\n scrolled = false,\n user,\n headerCenter,\n headerActions,\n inboxPath,\n onMobileMenuToggle,\n mobileMenuOpen = false,\n menuToggleRef,\n showMobileMenu,\n sidebarCollapsible,\n sidebarCollapsed,\n onSidebarToggle,\n inlineSlotRef,\n inlineSlotActive,\n agentPanelOpen = false,\n onAgentPanelToggle,\n}: TopHeaderProps): ReactElement {\n const strings = useStrings();\n const brandInner = (\n <>\n {brand.logo && (\n <span className=\"aegis-shell__brand-logo\">{brand.logo}</span>\n )}\n <span className=\"aegis-shell__brand-name\">{brand.name}</span>\n </>\n );\n\n return (\n <header\n className={\n scrolled\n ? 'aegis-shell__header aegis-shell__header--scrolled'\n : 'aegis-shell__header'\n }\n >\n <div className=\"aegis-shell__header-left\">\n {showMobileMenu && onMobileMenuToggle && (\n <button\n ref={menuToggleRef}\n type=\"button\"\n className=\"aegis-shell__menu-toggle\"\n onClick={onMobileMenuToggle}\n aria-label={\n mobileMenuOpen ? strings.closeNavigation : strings.openNavigation\n }\n aria-expanded={mobileMenuOpen}\n >\n <span className=\"aegis-shell__menu-toggle-glyph\" aria-hidden=\"true\">\n ☰\n </span>\n </button>\n )}\n {sidebarCollapsible && onSidebarToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__sidebar-toggle\"\n onClick={onSidebarToggle}\n aria-label={\n sidebarCollapsed ? strings.showSidebar : strings.hideSidebar\n }\n aria-pressed={sidebarCollapsed}\n title={sidebarCollapsed ? strings.showSidebar : strings.hideSidebar}\n >\n <span\n className=\"aegis-shell__sidebar-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"8\" y1=\"3.5\" x2=\"8\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n {appSwitcher ? (\n <AppSwitcher\n apps={apps}\n activeAppId={activeAppId}\n onAppSwitch={onAppSwitch}\n />\n ) : null}\n {brand.href ? (\n <Link to={brand.href} className=\"aegis-shell__brand\">\n {brandInner}\n </Link>\n ) : (\n <span className=\"aegis-shell__brand\">{brandInner}</span>\n )}\n </div>\n <div\n className={\n inlineSlotActive\n ? 'aegis-shell__header-center aegis-shell__header-center--app'\n : 'aegis-shell__header-center'\n }\n ref={inlineSlotRef}\n data-aegis-inline-slot=\"\"\n >\n {!inlineSlotActive && headerCenter}\n </div>\n <div className=\"aegis-shell__header-right\">\n <ActiveEnvironmentSwitcher />\n {headerActions}\n {inboxPath && <ShellNotificationBell inboxPath={inboxPath} />}\n {user && <UserMenu user={user} />}\n {onAgentPanelToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__agent-toggle\"\n onClick={onAgentPanelToggle}\n aria-label={\n agentPanelOpen ? strings.hideAgentPanel : strings.showAgentPanel\n }\n aria-pressed={agentPanelOpen}\n title={\n agentPanelOpen ? strings.hideAgentPanel : strings.showAgentPanel\n }\n >\n <span\n className=\"aegis-shell__agent-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"12\" y1=\"3.5\" x2=\"12\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n </div>\n </header>\n );\n}\n\nfunction ActiveEnvironmentSwitcher(): ReactElement | null {\n const strings = useStrings();\n const state = useEnvironmentManifest();\n if (state.status === 'error') {\n return (\n <Tooltip title={strings.environmentsRetry(state.error.message)}>\n <span className=\"aegis-shell__env-error\">\n <Chip tone=\"warning\" onClick={state.retry}>\n <span className=\"aegis-shell__env-error-full\">\n {strings.environmentsUnavailable}\n </span>\n <span className=\"aegis-shell__env-error-short\">\n {strings.environmentsUnavailableShort}\n </span>\n </Chip>\n </span>\n </Tooltip>\n );\n }\n if (state.status !== 'ready') {\n return null;\n }\n const options = state.manifest.environments.map((e) => ({\n id: e.id,\n label: e.label,\n badge: e.badge,\n hint: e.baseUrl,\n }));\n return (\n <EnvironmentSwitcher\n className=\"aegis-shell__env-switcher\"\n options={options}\n currentId={state.currentEnvId}\n onChange={state.setCurrentEnv}\n />\n );\n}\n\nfunction UserMenu({ user }: { user: AegisUser }): ReactElement {\n const navigate = useNavigate();\n const items: DropdownItem[] = (user.menu ?? []).map((entry) => {\n const to = entry.to;\n return {\n key: entry.key,\n label: entry.label,\n onClick: to\n ? () => {\n navigate(to);\n }\n : entry.onClick,\n };\n });\n const badge =\n user.avatar ??\n (typeof user.name === 'string' ? (\n <Avatar\n name={user.name}\n size=\"sm\"\n className=\"aegis-shell__user-initials\"\n />\n ) : null);\n const trigger = (\n <span\n className={\n badge\n ? 'aegis-shell__user aegis-shell__user--badge'\n : 'aegis-shell__user'\n }\n >\n {badge}\n <span className=\"aegis-shell__user-name\">{user.name}</span>\n </span>\n );\n if (items.length === 0) {\n return trigger;\n }\n return <DropdownMenu trigger={trigger} items={items} />;\n}\n"],"names":["TopHeader","brand","apps","activeAppId","onAppSwitch","appSwitcher","scrolled","user","headerCenter","headerActions","inboxPath","onMobileMenuToggle","mobileMenuOpen","menuToggleRef","showMobileMenu","sidebarCollapsible","sidebarCollapsed","onSidebarToggle","inlineSlotRef","inlineSlotActive","agentPanelOpen","onAgentPanelToggle","strings","useStrings","brandInner","jsxs","Fragment","jsx","AppSwitcher","Link","ActiveEnvironmentSwitcher","ShellNotificationBell","UserMenu","state","useEnvironmentManifest","Tooltip","Chip","options","e","EnvironmentSwitcher","navigate","useNavigate","items","entry","to","badge","Avatar","trigger","DropdownMenu"],"mappings":";;;;;;;;;;;AA4DO,SAASA,EAAU;AAAA,EACxB,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,UAAAC,IAAW;AAAA,EACX,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,eAAAC;AAAA,EACA,WAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,oBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,eAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,gBAAAC,IAAiB;AAAA,EACjB,oBAAAC;AACF,GAAiC;AAC/B,QAAMC,IAAUC,EAAA,GACVC,IACJ,gBAAAC,EAAAC,GAAA,EACG,UAAA;AAAA,IAAAzB,EAAM,QACL,gBAAA0B,EAAC,QAAA,EAAK,WAAU,2BAA2B,YAAM,MAAK;AAAA,IAExD,gBAAAA,EAAC,QAAA,EAAK,WAAU,2BAA2B,YAAM,KAAA,CAAK;AAAA,EAAA,GACxD;AAGF,SACE,gBAAAF;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WACEnB,IACI,sDACA;AAAA,MAGN,UAAA;AAAA,QAAA,gBAAAmB,EAAC,OAAA,EAAI,WAAU,4BACZ,UAAA;AAAA,UAAAX,KAAkBH,KACjB,gBAAAgB;AAAA,YA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,EAAM;AAAA,MACb,SAASC,IACL,MAAM;AACJ,QAAAJ,EAASI,CAAE;AAAA,MACb,IACAD,EAAM;AAAA,IAAA;AAAA,EAEd,CAAC,GACKE,IACJtC,EAAK,WACJ,OAAOA,EAAK,QAAS,WACpB,gBAAAoB;AAAA,IAACmB;AAAA,IAAA;AAAA,MACC,MAAMvC,EAAK;AAAA,MACX,MAAK;AAAA,MACL,WAAU;AAAA,IAAA;AAAA,EAAA,IAEV,OACAwC,IACJ,gBAAAtB;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WACEoB,IACI,+CACA;AAAA,MAGL,UAAA;AAAA,QAAAA;AAAA,QACD,gBAAAlB,EAAC,QAAA,EAAK,WAAU,0BAA0B,YAAK,KAAA,CAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGxD,SAAIe,EAAM,WAAW,IACZK,IAEF,gBAAApB,EAACqB,GAAA,EAAa,SAAAD,GAAkB,OAAAL,EAAA,CAAc;AACvD;"}
|
|
@@ -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 u=require("react"),o=require("../../locale/useStrings.cjs");function c(t,n,e){const{signOut:s}=o.useStrings();return u.useMemo(()=>{if(t)return t;if(e.status!=="authenticated"||!e.user)return;const r=[...n??[]],{signOut:i}=e;return i&&r.push({key:"sign-out",label:s,onClick:()=>{i()}}),{name:e.user.name,menu:r}},[t,n,e,s])}exports.useShellUser=c;
|
|
2
2
|
//# sourceMappingURL=useShellUser.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShellUser.cjs","sources":["../../../src/layouts/shell/useShellUser.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { AegisAuthUser, AuthContextValue } from '../../auth';\nimport type { AegisUser, AegisUserMenuItem } from './types';\n\n/**\n * The header's user: `user` when the host passes one, else the signed-in\n * user from the auth context with `userMenu` plus a Sign out entry.\n */\nexport function useShellUser(\n user: AegisUser | undefined,\n userMenu: AegisUserMenuItem[] | undefined,\n auth: AuthContextValue<AegisAuthUser>,\n): AegisUser | undefined {\n return useMemo(() => {\n if (user) {\n return user;\n }\n if (auth.status !== 'authenticated' || !auth.user) {\n return undefined;\n }\n const menu = [...(userMenu ?? [])];\n const { signOut } = auth;\n if (signOut) {\n menu.push({\n key: 'sign-out',\n label:
|
|
1
|
+
{"version":3,"file":"useShellUser.cjs","sources":["../../../src/layouts/shell/useShellUser.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { AegisAuthUser, AuthContextValue } from '../../auth';\nimport { useStrings } from '../../locale';\nimport type { AegisUser, AegisUserMenuItem } from './types';\n\n/**\n * The header's user: `user` when the host passes one, else the signed-in\n * user from the auth context with `userMenu` plus a Sign out entry.\n */\nexport function useShellUser(\n user: AegisUser | undefined,\n userMenu: AegisUserMenuItem[] | undefined,\n auth: AuthContextValue<AegisAuthUser>,\n): AegisUser | undefined {\n const { signOut: signOutLabel } = useStrings();\n return useMemo(() => {\n if (user) {\n return user;\n }\n if (auth.status !== 'authenticated' || !auth.user) {\n return undefined;\n }\n const menu = [...(userMenu ?? [])];\n const { signOut } = auth;\n if (signOut) {\n menu.push({\n key: 'sign-out',\n label: signOutLabel,\n onClick: () => {\n void signOut();\n },\n });\n }\n return { name: auth.user.name, menu };\n }, [user, userMenu, auth, signOutLabel]);\n}\n"],"names":["useShellUser","user","userMenu","auth","signOutLabel","useStrings","useMemo","menu","signOut"],"mappings":"kJAUO,SAASA,EACdC,EACAC,EACAC,EACuB,CACvB,KAAM,CAAE,QAASC,CAAA,EAAiBC,aAAA,EAClC,OAAOC,EAAAA,QAAQ,IAAM,CACnB,GAAIL,EACF,OAAOA,EAET,GAAIE,EAAK,SAAW,iBAAmB,CAACA,EAAK,KAC3C,OAEF,MAAMI,EAAO,CAAC,GAAIL,GAAY,EAAG,EAC3B,CAAE,QAAAM,GAAYL,EACpB,OAAIK,GACFD,EAAK,KAAK,CACR,IAAK,WACL,MAAOH,EACP,QAAS,IAAM,CACRI,EAAA,CACP,CAAA,CACD,EAEI,CAAE,KAAML,EAAK,KAAK,KAAM,KAAAI,CAAA,CACjC,EAAG,CAACN,EAAMC,EAAUC,EAAMC,CAAY,CAAC,CACzC"}
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { useMemo as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
if (e
|
|
1
|
+
import { useMemo as s } from "react";
|
|
2
|
+
import { useStrings as u } from "../../locale/useStrings.js";
|
|
3
|
+
function f(e, t, n) {
|
|
4
|
+
const { signOut: i } = u();
|
|
5
|
+
return s(() => {
|
|
6
|
+
if (e)
|
|
7
|
+
return e;
|
|
8
|
+
if (n.status !== "authenticated" || !n.user)
|
|
7
9
|
return;
|
|
8
|
-
const
|
|
9
|
-
return
|
|
10
|
+
const o = [...t ?? []], { signOut: r } = n;
|
|
11
|
+
return r && o.push({
|
|
10
12
|
key: "sign-out",
|
|
11
|
-
label:
|
|
13
|
+
label: i,
|
|
12
14
|
onClick: () => {
|
|
13
|
-
|
|
15
|
+
r();
|
|
14
16
|
}
|
|
15
|
-
}), { name:
|
|
16
|
-
}, [
|
|
17
|
+
}), { name: n.user.name, menu: o };
|
|
18
|
+
}, [e, t, n, i]);
|
|
17
19
|
}
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
f as useShellUser
|
|
20
22
|
};
|
|
21
23
|
//# sourceMappingURL=useShellUser.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useShellUser.js","sources":["../../../src/layouts/shell/useShellUser.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { AegisAuthUser, AuthContextValue } from '../../auth';\nimport type { AegisUser, AegisUserMenuItem } from './types';\n\n/**\n * The header's user: `user` when the host passes one, else the signed-in\n * user from the auth context with `userMenu` plus a Sign out entry.\n */\nexport function useShellUser(\n user: AegisUser | undefined,\n userMenu: AegisUserMenuItem[] | undefined,\n auth: AuthContextValue<AegisAuthUser>,\n): AegisUser | undefined {\n return useMemo(() => {\n if (user) {\n return user;\n }\n if (auth.status !== 'authenticated' || !auth.user) {\n return undefined;\n }\n const menu = [...(userMenu ?? [])];\n const { signOut } = auth;\n if (signOut) {\n menu.push({\n key: 'sign-out',\n label:
|
|
1
|
+
{"version":3,"file":"useShellUser.js","sources":["../../../src/layouts/shell/useShellUser.ts"],"sourcesContent":["import { useMemo } from 'react';\n\nimport type { AegisAuthUser, AuthContextValue } from '../../auth';\nimport { useStrings } from '../../locale';\nimport type { AegisUser, AegisUserMenuItem } from './types';\n\n/**\n * The header's user: `user` when the host passes one, else the signed-in\n * user from the auth context with `userMenu` plus a Sign out entry.\n */\nexport function useShellUser(\n user: AegisUser | undefined,\n userMenu: AegisUserMenuItem[] | undefined,\n auth: AuthContextValue<AegisAuthUser>,\n): AegisUser | undefined {\n const { signOut: signOutLabel } = useStrings();\n return useMemo(() => {\n if (user) {\n return user;\n }\n if (auth.status !== 'authenticated' || !auth.user) {\n return undefined;\n }\n const menu = [...(userMenu ?? [])];\n const { signOut } = auth;\n if (signOut) {\n menu.push({\n key: 'sign-out',\n label: signOutLabel,\n onClick: () => {\n void signOut();\n },\n });\n }\n return { name: auth.user.name, menu };\n }, [user, userMenu, auth, signOutLabel]);\n}\n"],"names":["useShellUser","user","userMenu","auth","signOutLabel","useStrings","useMemo","menu","signOut"],"mappings":";;AAUO,SAASA,EACdC,GACAC,GACAC,GACuB;AACvB,QAAM,EAAE,SAASC,EAAA,IAAiBC,EAAA;AAClC,SAAOC,EAAQ,MAAM;AACnB,QAAIL;AACF,aAAOA;AAET,QAAIE,EAAK,WAAW,mBAAmB,CAACA,EAAK;AAC3C;AAEF,UAAMI,IAAO,CAAC,GAAIL,KAAY,EAAG,GAC3B,EAAE,SAAAM,MAAYL;AACpB,WAAIK,KACFD,EAAK,KAAK;AAAA,MACR,KAAK;AAAA,MACL,OAAOH;AAAA,MACP,SAAS,MAAM;AACb,QAAKI,EAAA;AAAA,MACP;AAAA,IAAA,CACD,GAEI,EAAE,MAAML,EAAK,KAAK,MAAM,MAAAI,EAAA;AAAA,EACjC,GAAG,CAACN,GAAMC,GAAUC,GAAMC,CAAY,CAAC;AACzC;"}
|