import React from 'react'; import { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces'; import { ButtonGroupProps } from '../../button-group/interfaces'; import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context'; import { NonCancelableEventHandler } from '../../internal/events'; import { SomeOptional } from '../../internal/types'; import { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces'; import { SplitPanelProviderProps } from '../split-panel'; import { OnChangeParams } from '../utils/use-drawers'; import { FocusControlMultipleStates, FocusControlState } from '../utils/use-focus-control'; import { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control'; import { VerticalLayoutOutput } from './compute-layout'; export interface AppLayoutInternalProps extends AppLayoutPropsWithDefaults { navigationTriggerHide?: boolean; } export type InternalDrawer = AppLayoutProps.Drawer & { defaultActive?: boolean; isExpandable?: boolean; ariaLabels: AppLayoutProps.Drawer['ariaLabels'] & { expandedModeButton?: string; exitExpandedModeButton?: string; }; header?: React.ReactNode; headerActions?: ReadonlyArray; onHeaderActionClick?: NonCancelableEventHandler; position?: 'side' | 'bottom'; onToggleFocusMode?: NonCancelableEventHandler<{ isExpanded: boolean; }>; }; export interface AppLayoutInternals { ariaLabels: AppLayoutPropsWithDefaults['ariaLabels']; headerVariant: AppLayoutPropsWithDefaults['headerVariant']; placement: AppLayoutPropsWithDefaults['placement']; navigationOpen: AppLayoutPropsWithDefaults['navigationOpen']; navigationFocusControl: FocusControlState; navigation: React.ReactNode; splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position']; splitPanelOpen: boolean; splitPanelControlId: string; splitPanelFocusControl: SplitPanelFocusControlState; splitPanelToggleConfig: SplitPanelSideToggleProps; isMobile: boolean; activeDrawer: InternalDrawer | undefined; activeDrawerSize: number; minDrawerSize: number; maxDrawerSize: number; minGlobalDrawersSizes: Record; maxGlobalDrawersSizes: Record; drawers: ReadonlyArray; drawersFocusControl: FocusControlState; globalDrawersFocusControl: FocusControlMultipleStates; activeGlobalDrawersIds: ReadonlyArray; activeGlobalDrawers: ReadonlyArray; globalDrawers: ReadonlyArray; activeGlobalDrawersSizes: Record; stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications']; breadcrumbs: React.ReactNode; discoveredBreadcrumbs: BreadcrumbGroupProps | null; toolbarState: 'show' | 'hide'; setToolbarState: (state: 'show' | 'hide') => void; verticalOffsets: VerticalLayoutOutput; drawersOpenQueue: ReadonlyArray; setNotificationsHeight: (height: number) => void; setToolbarHeight: (height: number) => void; onSplitPanelToggle: () => void; onNavigationToggle: (open: boolean) => void; onActiveDrawerChange: (newDrawerId: string | null, params: OnChangeParams) => void; onActiveDrawerResize: (detail: { id: string; size: number; }) => void; onActiveGlobalDrawersChange: (newDrawerId: string, params: OnChangeParams) => void; splitPanelAnimationDisabled?: boolean; expandedDrawerId: string | null; setExpandedDrawerId: (value: string | null) => void; aiDrawer?: InternalDrawer | null; onActiveAiDrawerChange?: (newDrawerId: string | null, params?: OnChangeParams) => void; activeAiDrawer?: InternalDrawer | null; activeAiDrawerId: string | null; activeAiDrawerSize?: number; minAiDrawerSize?: number; maxAiDrawerSize?: number; aiDrawerFocusControl?: FocusControlState; onActiveAiDrawerResize: (size: number) => void; } export interface AppLayoutWidgetizedState extends AppLayoutInternals { isNested: boolean; verticalOffsets: VerticalLayoutOutput; navigationAnimationDisabled: boolean; aiDrawerExpandedMode: boolean; splitPanelOffsets: { stickyVerticalBottomOffset: number; mainContentPaddingBlockEnd: number | undefined; }; activeGlobalBottomDrawerId: string | null; onActiveGlobalBottomDrawerChange: (value: string | null, params: OnChangeParams) => void; activeGlobalBottomDrawerSize: number; minGlobalBottomDrawerSize: number; bottomDrawerReportedSize: number; getMaxGlobalBottomDrawerHeight: () => number; reportBottomDrawerSize: (size: number) => void; bottomDrawersFocusControl: FocusControlState; onActiveBottomDrawerResize: ({ id, size }: { id: string; size: number; }) => void; bottomDrawers: ReadonlyArray; } export interface AppLayoutState { rootRef: React.Ref; isIntersecting: boolean; widgetizedState: AppLayoutWidgetizedState; appLayoutInternals: AppLayoutInternals; splitPanelInternals: SplitPanelProviderProps; } export type AppLayoutPendingState = SomeOptional;