@cloudscape-design/components-themeable 3.0.1323 → 3.0.1325
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/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/flashbar/styles.scss +25 -4
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/scss/side-navigation/styles.scss +17 -19
- package/lib/internal/template/alert/styles.css.js +27 -27
- package/lib/internal/template/alert/styles.scoped.css +44 -44
- package/lib/internal/template/alert/styles.selectors.js +27 -27
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +4 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js.map +1 -1
- package/lib/internal/template/box/styles.css.js +193 -193
- package/lib/internal/template/box/styles.scoped.css +242 -242
- package/lib/internal/template/box/styles.selectors.js +193 -193
- package/lib/internal/template/code-editor/styles.css.js +33 -33
- package/lib/internal/template/code-editor/styles.scoped.css +195 -195
- package/lib/internal/template/code-editor/styles.selectors.js +33 -33
- package/lib/internal/template/error-boundary/interfaces.d.ts +1 -0
- package/lib/internal/template/error-boundary/interfaces.d.ts.map +1 -1
- package/lib/internal/template/error-boundary/interfaces.js.map +1 -1
- package/lib/internal/template/error-boundary/internal.d.ts +1 -1
- package/lib/internal/template/error-boundary/internal.d.ts.map +1 -1
- package/lib/internal/template/error-boundary/internal.js +7 -3
- package/lib/internal/template/error-boundary/internal.js.map +1 -1
- package/lib/internal/template/flashbar/flash.d.ts.map +1 -1
- package/lib/internal/template/flashbar/flash.js +2 -2
- package/lib/internal/template/flashbar/flash.js.map +1 -1
- package/lib/internal/template/flashbar/style.d.ts +3 -0
- package/lib/internal/template/flashbar/style.d.ts.map +1 -1
- package/lib/internal/template/flashbar/style.js +9 -0
- package/lib/internal/template/flashbar/style.js.map +1 -1
- package/lib/internal/template/flashbar/styles.css.js +50 -50
- package/lib/internal/template/flashbar/styles.scoped.css +169 -151
- package/lib/internal/template/flashbar/styles.selectors.js +50 -50
- package/lib/internal/template/form-field/styles.css.js +24 -24
- package/lib/internal/template/form-field/styles.scoped.css +40 -40
- package/lib/internal/template/form-field/styles.selectors.js +24 -24
- package/lib/internal/template/icon/styles.css.js +41 -41
- package/lib/internal/template/icon/styles.scoped.css +94 -94
- package/lib/internal/template/icon/styles.selectors.js +41 -41
- package/lib/internal/template/input/styles.css.js +18 -18
- package/lib/internal/template/input/styles.scoped.css +38 -38
- package/lib/internal/template/input/styles.selectors.js +18 -18
- package/lib/internal/template/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js +16 -5
- package/lib/internal/template/internal/analytics/components/analytics-funnel.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +146 -88
- package/lib/internal/template/internal/components/button-trigger/styles.css.js +14 -14
- package/lib/internal/template/internal/components/button-trigger/styles.scoped.css +35 -35
- package/lib/internal/template/internal/components/button-trigger/styles.selectors.js +14 -14
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/generated/styles/tokens.d.ts +10 -0
- package/lib/internal/template/internal/generated/styles/tokens.js +23 -13
- package/lib/internal/template/internal/generated/theming/index.cjs +262 -21
- package/lib/internal/template/internal/generated/theming/index.cjs.d.ts +90 -0
- package/lib/internal/template/internal/generated/theming/index.d.ts +90 -0
- package/lib/internal/template/internal/generated/theming/index.js +262 -21
- package/lib/internal/template/popover/body.d.ts.map +1 -1
- package/lib/internal/template/popover/body.js +2 -2
- package/lib/internal/template/popover/body.js.map +1 -1
- package/lib/internal/template/prompt-input/styles.css.js +26 -26
- package/lib/internal/template/prompt-input/styles.scoped.css +61 -61
- package/lib/internal/template/prompt-input/styles.selectors.js +26 -26
- package/lib/internal/template/side-navigation/parts.d.ts.map +1 -1
- package/lib/internal/template/side-navigation/parts.js +21 -14
- package/lib/internal/template/side-navigation/parts.js.map +1 -1
- package/lib/internal/template/side-navigation/styles.css.js +46 -46
- package/lib/internal/template/side-navigation/styles.scoped.css +85 -107
- package/lib/internal/template/side-navigation/styles.selectors.js +46 -46
- package/lib/internal/template/slider/styles.css.js +26 -26
- package/lib/internal/template/slider/styles.scoped.css +112 -112
- package/lib/internal/template/slider/styles.selectors.js +26 -26
- package/lib/internal/template/status-indicator/styles.css.js +24 -24
- package/lib/internal/template/status-indicator/styles.scoped.css +59 -59
- package/lib/internal/template/status-indicator/styles.selectors.js +24 -24
- package/lib/internal/template/textarea/styles.css.js +5 -5
- package/lib/internal/template/textarea/styles.scoped.css +17 -17
- package/lib/internal/template/textarea/styles.selectors.js +5 -5
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +23 -23
- package/lib/internal/template/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
- package/package.json +1 -1
package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js
CHANGED
|
@@ -128,7 +128,7 @@ function AppLayoutGlobalBottomDrawerImplementation({ widgetizedState, show, acti
|
|
|
128
128
|
useEffect(() => {
|
|
129
129
|
reportBottomDrawerSize(size);
|
|
130
130
|
}, [reportBottomDrawerSize, size]);
|
|
131
|
-
return (React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
131
|
+
return (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "bottom-drawer" },
|
|
132
132
|
React.createElement(Transition, { nodeRef: drawerRef, in: show || isExpanded, appear: show || isExpanded, mountOnEnter: true, timeout: 250 }, state => {
|
|
133
133
|
var _a, _b, _c, _d, _e;
|
|
134
134
|
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['bottom-drawer'], styles[state], !animationDisabled && sharedStyles['with-motion-vertical'], !animationDisabled && isExpanded && styles['with-expanded-motion'], {
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-bottom-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAEzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,MAAM,UAAU,4BAA4B,CAAC,EAAE,eAAe,EAAiD;IAC7G,MAAM,EAAE,0BAA0B,EAAE,aAAa,EAAE,GAAG,eAAe,CAAC;IACtE,MAAM,wBAAwB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IAChE,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,0BAA0B,EAAE,CAAC;YAC/B,wBAAwB,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACnE,CAAC;IACH,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,CAAC;IAEjC,OAAO,CACL,0CACG,aAAa,CAAC,G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AI,CAAC,MAAM,CAAC,0BAA0B,CAAC,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAC,iBAC9E,mCAAmC,cAAc,EAAE;wBAEhE,6BACE,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,KAAK,EAAE;gCACL,SAAS,EACP,QAAQ,IAAI,UAAU;oCACpB,CAAC,CAAC,sBAAsB;oCACxB,CAAC,CAAC,GAAG,IAAI,GAAG,UAAU,GAAG,qBAAqB,GAAG,CAAC,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,IAAI;6BACjG,IAEA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACF,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,CAAC;AAED,eAAe,yCAAyC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutWidgetizedState, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nexport function AppLayoutBottomDrawerWrapper({ widgetizedState }: { widgetizedState: AppLayoutWidgetizedState }) {\n const { activeGlobalBottomDrawerId, bottomDrawers } = widgetizedState;\n const openBottomDrawersHistory = useRef<Set<string>>(new Set());\n useEffect(() => {\n if (activeGlobalBottomDrawerId) {\n openBottomDrawersHistory.current.add(activeGlobalBottomDrawerId);\n }\n }, [activeGlobalBottomDrawerId]);\n\n return (\n <>\n {bottomDrawers.map(drawer => {\n return (\n <AppLayoutGlobalBottomDrawerImplementation\n key={drawer.id}\n activeDrawer={\n activeGlobalBottomDrawerId === drawer.id ||\n (drawer.preserveInactiveContent && openBottomDrawersHistory.current.has(drawer.id))\n ? drawer\n : undefined\n }\n show={activeGlobalBottomDrawerId === drawer.id}\n widgetizedState={widgetizedState}\n />\n );\n })}\n </>\n );\n}\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n widgetizedState: AppLayoutWidgetizedState;\n show: boolean;\n activeDrawer: InternalDrawer | undefined;\n}\n\nconst GAP_HEIGHT = 10;\nconst RESIZE_HANDLER_HEIGHT = 18;\n\nfunction AppLayoutGlobalBottomDrawerImplementation({\n widgetizedState,\n show,\n activeDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n isMobile,\n onActiveGlobalBottomDrawerChange,\n onActiveBottomDrawerResize,\n minGlobalBottomDrawerSize,\n activeGlobalBottomDrawerSize,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n bottomDrawersFocusControl,\n getMaxGlobalBottomDrawerHeight,\n reportBottomDrawerSize,\n verticalOffsets,\n placement,\n drawerAnimationDisabled,\n } = widgetizedState;\n const drawerRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLHeadingElement>(null);\n const activeDrawerId = activeDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset: mobileDrawerTopOffset, drawerHeight: drawerFullScreenHeight } = getDrawerStyles(\n verticalOffsets,\n isMobile,\n placement\n );\n const activeDrawerSize = activeGlobalBottomDrawerSize ?? 0;\n const minDrawerSize = minGlobalBottomDrawerSize ?? 0;\n const maxDrawerSize = getMaxGlobalBottomDrawerHeight();\n const refs = bottomDrawersFocusControl.refs;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveBottomDrawerResize({ id: activeDrawerId!, size }),\n position: 'bottom',\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeDrawer?.trigger;\n const isExpanded = activeDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id)) ||\n (wasExpanded && !isExpanded);\n\n // Prevent main content scroll when bottom drawer opens with animations\n useEffect(() => {\n if (show && drawerRef.current) {\n const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n const abortController = new AbortController();\n\n // Temporarily prevent scrolling during animation\n const preventScroll = () => {\n document.documentElement.scrollTop = scrollTop;\n document.body.scrollTop = scrollTop;\n };\n\n // Handle transition end to remove scroll prevention\n const handleTransitionEnd = (event: TransitionEvent) => {\n // Only handle transitions on the drawer element itself\n if (event.target === drawerRef.current) {\n abortController.abort();\n }\n };\n\n // Add scroll prevention during animation\n document.addEventListener('scroll', preventScroll, {\n passive: false,\n signal: abortController.signal,\n });\n\n drawerRef.current.addEventListener('transitionend', handleTransitionEnd, {\n signal: abortController.signal,\n });\n\n return () => {\n abortController.abort();\n };\n }\n }, [show]);\n\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-down',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-toggle-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeDrawer?.ariaLabels?.expandedModeButton ?? '',\n pressed: !!isExpanded,\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n useEffect(() => {\n reportBottomDrawerSize(size);\n }, [reportBottomDrawerSize, size]);\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition\n nodeRef={drawerRef}\n in={show || isExpanded}\n appear={show || isExpanded}\n mountOnEnter={true}\n timeout={250}\n >\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['bottom-drawer'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-vertical'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show && state === 'exited',\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n bottomDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n ...(isMobile && {\n blockSize: drawerFullScreenHeight,\n insetBlockStart: mobileDrawerTopOffset,\n }),\n ...(!isMobile && {\n [customCssProps.bottomDrawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? drawerFullScreenHeight : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && !isExpanded && <div className={styles['drawer-gap']} />}\n {!isMobile && activeDrawer?.resizable && !isExpanded && (\n // Prevents receiving focus in Firefox\n <div className={styles['drawer-slider']} tabIndex={-1}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"bottom\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <header className={styles['bottom-drawer-content-header']} ref={headerRef}>\n <div className={styles['bottom-drawer-content-header-content']}>\n {activeDrawer?.header ?? <div />}\n <div className={styles['bottom-drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalBottomDrawerChange(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = {\n current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable,\n };\n }}\n />\n </div>\n </div>\n </header>\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\n <div\n className={styles['drawer-content']}\n style={{\n blockSize:\n isMobile || isExpanded\n ? drawerFullScreenHeight\n : `${size - GAP_HEIGHT - RESIZE_HANDLER_HEIGHT - (headerRef?.current?.clientHeight ?? 0)}px`,\n }}\n >\n {activeDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalBottomDrawerImplementation;\n"]}
|
|
1
|
+
{"version":3,"file":"global-bottom-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAEzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,MAAM,UAAU,4BAA4B,CAAC,EAAE,eAAe,EAAiD;IAC7G,MAAM,EAAE,0BAA0B,EAAE,aAAa,EAAE,GAAG,eAAe,CAAC;IACtE,MAAM,wBAAwB,GAAG,MAAM,CAAc,IAAI,GAAG,EAAE,CAAC,CAAC;IACh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AAC,IAAiB,EAAE,EAAE;wCACvC,IAAI,CAAC,IAAI,EAAE,CAAC;4CACV,OAAO;wCACT,CAAC;wCACD,IAAI,CAAC,KAAK,GAAG;4CACX,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAyB;yCAC7E,CAAC;oCACJ,CAAC,GACD,CACE,CACF,CACC;oBACT,6BACE,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,0BAA0B,CAAC,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAC,iBAC9E,mCAAmC,cAAc,EAAE;wBAEhE,6BACE,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EACnC,KAAK,EAAE;gCACL,SAAS,EACP,QAAQ,IAAI,UAAU;oCACpB,CAAC,CAAC,sBAAsB;oCACxB,CAAC,CAAC,GAAG,IAAI,GAAG,UAAU,GAAG,qBAAqB,GAAG,CAAC,MAAA,MAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,OAAO,0CAAE,YAAY,mCAAI,CAAC,CAAC,IAAI;6BACjG,IAEA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAClB,CACF,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,CAAC;AAED,eAAe,yCAAyC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutWidgetizedState, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\nexport function AppLayoutBottomDrawerWrapper({ widgetizedState }: { widgetizedState: AppLayoutWidgetizedState }) {\n const { activeGlobalBottomDrawerId, bottomDrawers } = widgetizedState;\n const openBottomDrawersHistory = useRef<Set<string>>(new Set());\n useEffect(() => {\n if (activeGlobalBottomDrawerId) {\n openBottomDrawersHistory.current.add(activeGlobalBottomDrawerId);\n }\n }, [activeGlobalBottomDrawerId]);\n\n return (\n <>\n {bottomDrawers.map(drawer => {\n return (\n <AppLayoutGlobalBottomDrawerImplementation\n key={drawer.id}\n activeDrawer={\n activeGlobalBottomDrawerId === drawer.id ||\n (drawer.preserveInactiveContent && openBottomDrawersHistory.current.has(drawer.id))\n ? drawer\n : undefined\n }\n show={activeGlobalBottomDrawerId === drawer.id}\n widgetizedState={widgetizedState}\n />\n );\n })}\n </>\n );\n}\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n widgetizedState: AppLayoutWidgetizedState;\n show: boolean;\n activeDrawer: InternalDrawer | undefined;\n}\n\nconst GAP_HEIGHT = 10;\nconst RESIZE_HANDLER_HEIGHT = 18;\n\nfunction AppLayoutGlobalBottomDrawerImplementation({\n widgetizedState,\n show,\n activeDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n isMobile,\n onActiveGlobalBottomDrawerChange,\n onActiveBottomDrawerResize,\n minGlobalBottomDrawerSize,\n activeGlobalBottomDrawerSize,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n bottomDrawersFocusControl,\n getMaxGlobalBottomDrawerHeight,\n reportBottomDrawerSize,\n verticalOffsets,\n placement,\n drawerAnimationDisabled,\n } = widgetizedState;\n const drawerRef = useRef<HTMLDivElement>(null);\n const headerRef = useRef<HTMLHeadingElement>(null);\n const activeDrawerId = activeDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeDrawer ? activeDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeDrawer ? activeDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset: mobileDrawerTopOffset, drawerHeight: drawerFullScreenHeight } = getDrawerStyles(\n verticalOffsets,\n isMobile,\n placement\n );\n const activeDrawerSize = activeGlobalBottomDrawerSize ?? 0;\n const minDrawerSize = minGlobalBottomDrawerSize ?? 0;\n const maxDrawerSize = getMaxGlobalBottomDrawerHeight();\n const refs = bottomDrawersFocusControl.refs;\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveBottomDrawerResize({ id: activeDrawerId!, size }),\n position: 'bottom',\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeDrawer?.trigger;\n const isExpanded = activeDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeDrawer?.defaultActive && !drawersOpenQueue.includes(activeDrawer.id)) ||\n (wasExpanded && !isExpanded);\n\n // Prevent main content scroll when bottom drawer opens with animations\n useEffect(() => {\n if (show && drawerRef.current) {\n const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;\n const abortController = new AbortController();\n\n // Temporarily prevent scrolling during animation\n const preventScroll = () => {\n document.documentElement.scrollTop = scrollTop;\n document.body.scrollTop = scrollTop;\n };\n\n // Handle transition end to remove scroll prevention\n const handleTransitionEnd = (event: TransitionEvent) => {\n // Only handle transitions on the drawer element itself\n if (event.target === drawerRef.current) {\n abortController.abort();\n }\n };\n\n // Add scroll prevention during animation\n document.addEventListener('scroll', preventScroll, {\n passive: false,\n signal: abortController.signal,\n });\n\n drawerRef.current.addEventListener('transitionend', handleTransitionEnd, {\n signal: abortController.signal,\n });\n\n return () => {\n abortController.abort();\n };\n }\n }, [show]);\n\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-down',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-toggle-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeDrawer?.ariaLabels?.expandedModeButton ?? '',\n pressed: !!isExpanded,\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n useEffect(() => {\n reportBottomDrawerSize(size);\n }, [reportBottomDrawerSize, size]);\n\n return (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"bottom-drawer\">\n <Transition\n nodeRef={drawerRef}\n in={show || isExpanded}\n appear={show || isExpanded}\n mountOnEnter={true}\n timeout={250}\n >\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['bottom-drawer'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-vertical'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show && state === 'exited',\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n bottomDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n ...(isMobile && {\n blockSize: drawerFullScreenHeight,\n insetBlockStart: mobileDrawerTopOffset,\n }),\n ...(!isMobile && {\n [customCssProps.bottomDrawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? drawerFullScreenHeight : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && !isExpanded && <div className={styles['drawer-gap']} />}\n {!isMobile && activeDrawer?.resizable && !isExpanded && (\n // Prevents receiving focus in Firefox\n <div className={styles['drawer-slider']} tabIndex={-1}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"bottom\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n <header className={styles['bottom-drawer-content-header']} ref={headerRef}>\n <div className={styles['bottom-drawer-content-header-content']}>\n {activeDrawer?.header ?? <div />}\n <div className={styles['bottom-drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalBottomDrawerChange(null, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = {\n current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable,\n };\n }}\n />\n </div>\n </div>\n </header>\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\n <div\n className={styles['drawer-content']}\n style={{\n blockSize:\n isMobile || isExpanded\n ? drawerFullScreenHeight\n : `${size - GAP_HEIGHT - RESIZE_HANDLER_HEIGHT - (headerRef?.current?.clientHeight ?? 0)}px`,\n }}\n >\n {activeDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalBottomDrawerImplementation;\n"]}
|
|
@@ -75,7 +75,7 @@ function AppLayoutGlobalDrawerImplementation({ appLayoutInternals, show, activeG
|
|
|
75
75
|
...drawerActions,
|
|
76
76
|
];
|
|
77
77
|
}
|
|
78
|
-
return (React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
78
|
+
return (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "global-drawer" },
|
|
79
79
|
React.createElement(Transition, { nodeRef: drawerRef, in: show || isExpanded, appear: show || isExpanded, timeout: 0 }, state => {
|
|
80
80
|
var _a, _b;
|
|
81
81
|
return (React.createElement("aside", { id: activeDrawerId, "aria-hidden": !show, "aria-label": computedAriaLabels.content, className: clsx(styles.drawer, styles['drawer-global'], styles[state], !animationDisabled && sharedStyles['with-motion-horizontal'], !animationDisabled && isExpanded && styles['with-expanded-motion'], {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAA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CAAC,IAAI,EAAE,CAAC;wCACV,OAAO;oCACT,CAAC;oCACD,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAyB,EAAE,CAAC;gCAChG,CAAC,GACD,CACE;wBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CACxB,CACF,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer: InternalDrawer | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n activeGlobalDrawers,\n verticalOffsets,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n drawerAnimationDisabled,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(verticalOffsets, isMobile, placement);\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n const isExpanded = activeGlobalDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||\n (wasExpanded && !isExpanded);\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-right',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeGlobalDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeGlobalDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeGlobalDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeGlobalDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary>\n <Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['drawer-global'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-horizontal'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n [styles['has-next-siblings']]:\n activeGlobalDrawers.findIndex(drawer => drawer.id === activeDrawerId) + 1 <\n activeGlobalDrawers.length,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? '100%' : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && <div className={styles['drawer-gap']}></div>}\n {!isMobile && activeGlobalDrawer?.resizable && !isExpanded && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeGlobalDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeGlobalDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = { current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable };\n }}\n />\n </div>\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
|
1
|
+
{"version":3,"file":"global-drawer.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/drawer/global-drawer.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,WAAW,MAAM,gCAAgC,CAAC;AAEzD,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,iBAAiB,MAAM,kDAAkD,CAAC;AACjF,OAAO,cAAc,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAExE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAQrC,SAAS,mCAAmC,CAAC,EAC3C,kBAAkB,EAClB,IAAI,EACJ,kBAAkB,GACuB;;IACzC,MAAM,EACJ,UAAU,EACV,yBAAyB,EACzB,QAAQ,EACR,SAAS,EACT,2BAA2B,EAC3B,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,uBAAuB,GACxB,GAAG,kBAAkB,CAAC;IACvB,MAAM,SAAS,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAC/C,MAAM,cAAc,GAAG,MAAA,kBAAkB,aAAlB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AAM;wCACR;4CACE,MAAA,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,mBAAmB,mEAAG,KAAK,CAAC,CAAC;oCACrD,CAAC;gCACH,CAAC,EACD,SAAS,EAAC,sBAAsB,EAChC,KAAK,EAAE,aAAa,EACpB,iBAAiB,EAAE,CAAC,IAAiB,EAAE,EAAE;oCACvC,IAAI,CAAC,IAAI,EAAE,CAAC;wCACV,OAAO;oCACT,CAAC;oCACD,IAAI,CAAC,KAAK,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB,CAAyB,EAAE,CAAC;gCAChG,CAAC,GACD,CACE;wBACN,6BAAK,SAAS,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,IACzE,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAE,OAAO,CACxB,CACF,CACF,CACA,CACT,CAAC;QACJ,CAAC,CACU,CACiB,CACjC,CAAC;AACJ,CAAC;AAED,eAAe,mCAAmC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport ButtonGroup from '../../../button-group/internal';\nimport { InternalItemOrGroup } from '../../../button-group/internal-interfaces';\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport PanelResizeHandle from '../../../internal/components/panel-resize-handle';\nimport customCssProps from '../../../internal/generated/custom-css-properties';\nimport { usePrevious } from '../../../internal/hooks/use-previous';\nimport { getLimitedValue } from '../../../split-panel/utils/size-utils';\nimport { Focusable } from '../../utils/use-focus-control';\nimport { getDrawerStyles } from '../compute-layout';\nimport { AppLayoutInternals, InternalDrawer } from '../interfaces';\nimport { useResize } from './use-resize';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\ninterface AppLayoutGlobalDrawerImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n show: boolean;\n activeGlobalDrawer: InternalDrawer | undefined;\n}\n\nfunction AppLayoutGlobalDrawerImplementation({\n appLayoutInternals,\n show,\n activeGlobalDrawer,\n}: AppLayoutGlobalDrawerImplementationProps) {\n const {\n ariaLabels,\n globalDrawersFocusControl,\n isMobile,\n placement,\n onActiveGlobalDrawersChange,\n onActiveDrawerResize,\n minGlobalDrawersSizes,\n maxGlobalDrawersSizes,\n activeGlobalDrawersSizes,\n activeGlobalDrawers,\n verticalOffsets,\n drawersOpenQueue,\n expandedDrawerId,\n setExpandedDrawerId,\n activeAiDrawer,\n drawerAnimationDisabled,\n } = appLayoutInternals;\n const drawerRef = useRef<HTMLDivElement>(null);\n const activeDrawerId = activeGlobalDrawer?.id ?? '';\n\n const computedAriaLabels = {\n closeButton: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.closeButton : ariaLabels?.toolsClose,\n content: activeGlobalDrawer ? activeGlobalDrawer.ariaLabels?.drawerName : ariaLabels?.tools,\n };\n\n const { drawerTopOffset, drawerHeight } = getDrawerStyles(verticalOffsets, isMobile, placement);\n const activeDrawerSize = (activeDrawerId ? activeGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const minDrawerSize = (activeDrawerId ? minGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const maxDrawerSize = (activeDrawerId ? maxGlobalDrawersSizes[activeDrawerId] : 0) ?? 0;\n const refs = globalDrawersFocusControl.refs[activeDrawerId];\n const resizeProps = useResize({\n currentWidth: activeDrawerSize,\n minWidth: minDrawerSize,\n maxWidth: maxDrawerSize,\n panelRef: drawerRef,\n handleRef: refs?.slider,\n onResize: size => onActiveDrawerResize({ id: activeDrawerId!, size }),\n });\n const size = getLimitedValue(minDrawerSize, activeDrawerSize, maxDrawerSize);\n const lastOpenedDrawerId = drawersOpenQueue.length ? drawersOpenQueue[0] : null;\n const hasTriggerButton = !!activeGlobalDrawer?.trigger;\n const isExpanded = activeGlobalDrawer?.isExpandable && expandedDrawerId === activeDrawerId;\n const wasExpanded = usePrevious(isExpanded);\n const animationDisabled =\n drawerAnimationDisabled ||\n (activeGlobalDrawer?.defaultActive && !drawersOpenQueue.includes(activeGlobalDrawer.id)) ||\n (wasExpanded && !isExpanded);\n let drawerActions: ReadonlyArray<InternalItemOrGroup> = [\n {\n type: 'icon-button',\n id: 'close',\n iconName: isMobile ? 'close' : 'angle-right',\n text: computedAriaLabels.closeButton ?? '',\n analyticsAction: 'close',\n },\n ];\n if (!isMobile && activeGlobalDrawer?.isExpandable) {\n drawerActions = [\n {\n type: 'icon-button',\n id: 'expand',\n iconName: isExpanded ? 'shrink' : 'expand',\n text: activeGlobalDrawer?.ariaLabels?.expandedModeButton ?? '',\n analyticsAction: isExpanded ? 'expand' : 'collapse',\n },\n ...drawerActions,\n ];\n }\n if (activeGlobalDrawer?.headerActions) {\n drawerActions = [\n {\n type: 'group',\n text: 'Actions',\n items: activeGlobalDrawer.headerActions!,\n },\n ...drawerActions,\n ];\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"global-drawer\">\n <Transition nodeRef={drawerRef} in={show || isExpanded} appear={show || isExpanded} timeout={0}>\n {state => {\n return (\n <aside\n id={activeDrawerId}\n aria-hidden={!show}\n aria-label={computedAriaLabels.content}\n className={clsx(\n styles.drawer,\n styles['drawer-global'],\n styles[state],\n !animationDisabled && sharedStyles['with-motion-horizontal'],\n !animationDisabled && isExpanded && styles['with-expanded-motion'],\n {\n [styles['drawer-hidden']]: !show,\n [styles['last-opened']]: (!activeAiDrawer && lastOpenedDrawerId === activeDrawerId) || isExpanded,\n [testutilStyles['active-drawer']]: show,\n [styles['drawer-expanded']]: isExpanded,\n [styles['has-next-siblings']]:\n activeGlobalDrawers.findIndex(drawer => drawer.id === activeDrawerId) + 1 <\n activeGlobalDrawers.length,\n }\n )}\n ref={drawerRef}\n onBlur={e => {\n // Drawers with trigger buttons follow this restore focus logic:\n // If a previously focused element exists, restore focus on it; otherwise, focus on the associated trigger button.\n // This function resets the previously focused element.\n // If the drawer has no trigger button and loses focus on the previously focused element, it defaults to document.body,\n // which ideally should never happen.\n if (!hasTriggerButton) {\n return;\n }\n\n if (!e.relatedTarget || !e.currentTarget.contains(e.relatedTarget)) {\n globalDrawersFocusControl.loseFocus();\n }\n }}\n style={{\n blockSize: drawerHeight,\n insetBlockStart: drawerTopOffset,\n ...(!isMobile && {\n [customCssProps.drawerSize]: `${['entering', 'entered'].includes(state) ? (isExpanded ? '100%' : size + 'px') : 0}`,\n }),\n }}\n data-testid={`awsui-app-layout-drawer-${activeDrawerId}`}\n >\n <div className={clsx(styles['global-drawer-wrapper'])}>\n {!isMobile && <div className={styles['drawer-gap']}></div>}\n {!isMobile && activeGlobalDrawer?.resizable && !isExpanded && (\n <div className={styles['drawer-slider']}>\n <PanelResizeHandle\n ref={refs?.slider}\n position=\"side\"\n className={testutilStyles['drawers-slider']}\n ariaLabel={activeGlobalDrawer?.ariaLabels?.resizeHandle}\n tooltipText={activeGlobalDrawer?.ariaLabels?.resizeHandleTooltipText}\n ariaValuenow={resizeProps.relativeSize}\n onKeyDown={resizeProps.onKeyDown}\n onDirectionClick={resizeProps.onDirectionClick}\n onPointerDown={resizeProps.onPointerDown}\n />\n </div>\n )}\n\n <div\n className={clsx(styles['drawer-content-container'], sharedStyles['with-motion-horizontal'])}\n data-testid={`awsui-app-layout-drawer-content-${activeDrawerId}`}\n >\n <div className={styles['drawer-actions']}>\n <ButtonGroup\n dropdownExpandToViewport={false}\n variant=\"icon\"\n onItemClick={event => {\n switch (event.detail.id) {\n case 'close':\n onActiveGlobalDrawersChange(activeDrawerId, { initiatedByUserAction: true });\n break;\n case 'expand':\n setExpandedDrawerId(isExpanded ? null : activeDrawerId);\n break;\n default:\n activeGlobalDrawer?.onHeaderActionClick?.(event);\n }\n }}\n ariaLabel=\"Global panel actions\"\n items={drawerActions}\n __internalRootRef={(root: HTMLElement) => {\n if (!root) {\n return;\n }\n refs.close = { current: root.querySelector('[data-itemid=\"close\"]') as unknown as Focusable };\n }}\n />\n </div>\n <div className={styles['drawer-content']} style={{ blockSize: drawerHeight }}>\n {activeGlobalDrawer?.content}\n </div>\n </div>\n </div>\n </aside>\n );\n }}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n );\n}\n\nexport default AppLayoutGlobalDrawerImplementation;\n"]}
|
|
@@ -47,7 +47,7 @@ function AppLayoutVisualRefreshToolbarWithI18n({ appLayoutRef, stateManagerRef,
|
|
|
47
47
|
const appLayoutPropsWithI18n = { ...appLayoutProps, ariaLabels };
|
|
48
48
|
return (React.createElement(React.Fragment, null,
|
|
49
49
|
React.createElement(AppLayoutStateProvider, { forceDeduplicationType: forceDeduplicationType, appLayoutProps: appLayoutPropsWithI18n, stateManager: stateManagerRef }, (registered, appLayoutState, toolbarProps, skeletonAttributes) => (React.createElement(AppLayoutVisibilityContext.Provider, { value: appLayoutState.isIntersecting },
|
|
50
|
-
(embeddedViewMode || !toolbarProps) && appLayoutPropsWithI18n.breadcrumbs ? (React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
50
|
+
(embeddedViewMode || !toolbarProps) && appLayoutPropsWithI18n.breadcrumbs ? (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "screenreader-only-breadcrumbs" },
|
|
51
51
|
React.createElement(ScreenreaderOnly, null, appLayoutPropsWithI18n.breadcrumbs))) : null,
|
|
52
52
|
React.createElement(SkeletonLayout, { registered: registered, toolbarProps: toolbarProps, appLayoutProps: appLayoutPropsWithI18n, appLayoutState: appLayoutState, skeletonSlotsAttributes: skeletonAttributes })))),
|
|
53
53
|
React.createElement(AppLayoutWidgetizedState, { forwardRef: appLayoutRef, appLayoutProps: appLayoutPropsWithI18n, stateManager: stateManagerRef })));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refres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B,EAAE,gBAAgB,EAAE,GAC9F,cAAqB,CAAC;IAExB,MAAM,UAAU,GAAG,aAAa,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IAC5D,MAAM,sBAAsB,GAAG,EAAE,GAAG,cAAc,EAAE,UAAU,EAAE,CAAC;IAEjE,OAAO,CACL;QACE,oBAAC,sBAAsB,IACrB,sBAAsB,EAAE,sBAAsB,EAC9C,cAAc,EAAE,sBAAsB,EACtC,YAAY,EAAE,eAAe,IAE5B,CAAC,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,EAAE,CAAC,CACjE,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,cAAc,CAAC,cAAc;YAEtE,CAAC,gBAAgB,IAAI,CAAC,YAAY,CAAC,IAAI,sBAAsB,CAAC,WAAW,CAAC,CAAC,CAAC,CAC3E,oBAAC,6BAA6B,IAAC,aAAa,EAAC,+BAA+B;gBAC1E,oBAAC,gBAAgB,QAAE,sBAAsB,CAAC,WAAW,CAAoB,CAC3C,CACjC,CAAC,CAAC,CAAC,IAAI;YACR,oBAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,sBAAsB,EACtC,cAAc,EAAE,cAAc,EAC9B,uBAAuB,EAAE,kBAAkB,GAC3C,CACkC,CACvC,CACsB;QACzB,oBAAC,wBAAwB,IACvB,UAAU,EAAE,YAAY,EACxB,cAAc,EAAE,sBAAsB,EACtC,YAAY,EAAE,eAAe,GAC7B,CACD,CACJ,CAAC;AACJ,CAAC;AAED,eAAe,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { unstable_batchedUpdates } from 'react-dom';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../error-boundary/internal';\nimport RemoteI18nProvider from '../../i18n/providers/remote-provider';\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { AppLayoutProps } from '../interfaces';\nimport { useAriaLabels } from '../utils/use-aria-labels';\nimport { AppLayoutVisibilityContext } from './contexts';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from './interfaces';\nimport { AppLayoutWidgetizedState, loadFormatter } from './internal';\nimport { SkeletonLayout } from './skeleton';\nimport { SkeletonSlotsAttributes } from './skeleton/interfaces';\nimport { DeduplicationType, useMultiAppLayout } from './skeleton/multi-layout';\nimport { StateManager } from './state';\nimport { SharedProps } from './state/interfaces';\nimport { getPropsToMerge, mergeProps } from './state/props-merger';\nimport { ToolbarProps } from './toolbar';\n\nconst AppLayoutStateProvider: React.FC<{\n forceDeduplicationType: DeduplicationType;\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n children: (\n registered: boolean,\n appLayoutState: AppLayoutPendingState,\n toolbarProps: ToolbarProps | null,\n skeletonAttributes: SkeletonSlotsAttributes\n ) => React.ReactNode;\n}> = ({ forceDeduplicationType, appLayoutProps, stateManager, children }) => {\n const [appLayoutState, setAppLayoutState] = useState<AppLayoutPendingState>({ isIntersecting: true });\n const [skeletonAttributes, setSkeletonAttributes] = useState<SkeletonSlotsAttributes>({});\n // use { fn: } object wrapper to avoid confusion with callback form of setState\n const [deduplicator, setDeduplicator] = useState({ fn: mergeProps });\n const [deduplicationProps, setDeduplicationProps] = useState<SharedProps | undefined>(undefined);\n\n const { registered, toolbarProps } = useMultiAppLayout(\n forceDeduplicationType,\n appLayoutState.isIntersecting,\n deduplicationProps ?? getPropsToMerge(appLayoutProps, appLayoutState),\n deduplicator.fn\n );\n\n useLayoutEffect(() => {\n stateManager.current.setState = (appLayoutState, skeletonAttributes, deduplicationProps, mergeProps) => {\n unstable_batchedUpdates(() => {\n setAppLayoutState(appLayoutState);\n setSkeletonAttributes(skeletonAttributes);\n setDeduplicationProps(deduplicationProps);\n setDeduplicator({ fn: mergeProps });\n });\n };\n }, [stateManager]);\n\n const hasToolbar = !!toolbarProps;\n useEffect(() => {\n stateManager.current.hasToolbar = hasToolbar;\n stateManager.current.setToolbar?.(hasToolbar);\n }, [stateManager, hasToolbar]);\n\n return <>{children(registered, appLayoutState, toolbarProps, skeletonAttributes)}</>;\n};\n\nconst AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLayoutInternalProps>(\n (props, forwardRef) => {\n const stateManagerRef = useRef<StateManager>({ setState: undefined, hasToolbar: false, setToolbar: undefined });\n\n return (\n <RemoteI18nProvider loadFormatter={loadFormatter}>\n <AppLayoutVisualRefreshToolbarWithI18n\n appLayoutRef={forwardRef}\n stateManagerRef={stateManagerRef}\n appLayoutProps={props}\n />\n </RemoteI18nProvider>\n );\n }\n);\n\nfunction AppLayoutVisualRefreshToolbarWithI18n({\n appLayoutRef,\n stateManagerRef,\n appLayoutProps,\n}: {\n appLayoutRef: React.ForwardedRef<AppLayoutProps.Ref>;\n stateManagerRef: React.MutableRefObject<StateManager>;\n appLayoutProps: AppLayoutInternalProps;\n}) {\n const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } =\n appLayoutProps as any;\n\n const ariaLabels = useAriaLabels(appLayoutProps.ariaLabels);\n const appLayoutPropsWithI18n = { ...appLayoutProps, ariaLabels };\n\n return (\n <>\n <AppLayoutStateProvider\n forceDeduplicationType={forceDeduplicationType}\n appLayoutProps={appLayoutPropsWithI18n}\n stateManager={stateManagerRef}\n >\n {(registered, appLayoutState, toolbarProps, skeletonAttributes) => (\n <AppLayoutVisibilityContext.Provider value={appLayoutState.isIntersecting}>\n {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */}\n {(embeddedViewMode || !toolbarProps) && appLayoutPropsWithI18n.breadcrumbs ? (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"screenreader-only-breadcrumbs\">\n <ScreenreaderOnly>{appLayoutPropsWithI18n.breadcrumbs}</ScreenreaderOnly>\n </AppLayoutBuiltInErrorBoundary>\n ) : null}\n <SkeletonLayout\n registered={registered}\n toolbarProps={toolbarProps}\n appLayoutProps={appLayoutPropsWithI18n}\n appLayoutState={appLayoutState}\n skeletonSlotsAttributes={skeletonAttributes}\n />\n </AppLayoutVisibilityContext.Provider>\n )}\n </AppLayoutStateProvider>\n <AppLayoutWidgetizedState\n forwardRef={appLayoutRef}\n appLayoutProps={appLayoutPropsWithI18n}\n stateManager={stateManagerRef}\n />\n </>\n );\n}\n\nexport default AppLayoutVisualRefreshToolbar;\n"]}
|
|
@@ -25,7 +25,7 @@ export const AppLayoutStateProviderInternal = ({ appLayoutProps, stateManager, f
|
|
|
25
25
|
return React.createElement(React.Fragment, null);
|
|
26
26
|
};
|
|
27
27
|
export const AppLayoutStateProvider = (props) => {
|
|
28
|
-
return (React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
28
|
+
return (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "app-layout-state" },
|
|
29
29
|
React.createElement(AppLayoutStateProviderInternal, { ...props })));
|
|
30
30
|
};
|
|
31
31
|
export const createWidgetizedAppLayoutState = createWidgetizedComponent(AppLayoutStateProvider);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAgB,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAqB7E,MAAM,CAAC,MA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a,EAAC,kBAAkB;QAC7D,oBAAC,8BAA8B,OAAK,KAAK,GAAI,CACf,CACjC,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ForwardedRef, useLayoutEffect, useState } from 'react';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { AppLayoutInternalProps, AppLayoutState } from '../interfaces';\nimport { SkeletonSlotsAttributes } from '../skeleton/interfaces';\nimport { MergeProps, SharedProps } from './interfaces';\nimport { getPropsToMerge, mergeProps } from './props-merger';\nimport { useAppLayout } from './use-app-layout';\nimport { useSkeletonSlotsAttributes } from './use-skeleton-slots-attributes';\n\nexport interface StateManager {\n setState:\n | ((\n appLayoutState: AppLayoutState,\n skeletonAttributes: SkeletonSlotsAttributes,\n deduplicationProps: SharedProps,\n mergeProps: MergeProps\n ) => void)\n | undefined;\n hasToolbar: boolean;\n setToolbar: ((hasToolbar: boolean) => void) | undefined;\n}\n\nexport interface AppLayoutStateProps {\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n forwardRef: ForwardedRef<AppLayoutProps.Ref>;\n}\n\nexport const AppLayoutStateProviderInternal = ({ appLayoutProps, stateManager, forwardRef }: AppLayoutStateProps) => {\n const [hasToolbar, setHasToolbar] = useState(stateManager.current.hasToolbar ?? false);\n const appLayoutState = useAppLayout(hasToolbar, appLayoutProps, forwardRef);\n const skeletonSlotsAttributes = useSkeletonSlotsAttributes(hasToolbar, appLayoutProps, appLayoutState);\n\n useLayoutEffect(() => {\n if (!stateManager.current?.setState) {\n console.warn('AppLayout state manager is not found');\n return;\n }\n stateManager.current.setState(\n appLayoutState,\n skeletonSlotsAttributes,\n getPropsToMerge(appLayoutProps, appLayoutState),\n mergeProps\n );\n });\n\n useLayoutEffect(() => {\n stateManager.current.setToolbar = setHasToolbar;\n }, [stateManager]);\n\n return <></>;\n};\n\nexport const AppLayoutStateProvider = (props: AppLayoutStateProps) => {\n return (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"app-layout-state\">\n <AppLayoutStateProviderInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n );\n};\n\nexport const createWidgetizedAppLayoutState = createWidgetizedComponent(AppLayoutStateProvider);\n"]}
|
|
@@ -78,7 +78,7 @@ export function DrawerTriggers({ ariaLabels, activeDrawerId, drawers, drawersFoc
|
|
|
78
78
|
const isForPreviousActiveDrawer = (previousActiveLocalDrawerId === null || previousActiveLocalDrawerId === void 0 ? void 0 : previousActiveLocalDrawerId.current) === item.id;
|
|
79
79
|
const selected = !expandedDrawerId && item.id === activeDrawerId;
|
|
80
80
|
const isFeatureNotificationsDrawer = ((_a = featureNotificationsProps === null || featureNotificationsProps === void 0 ? void 0 : featureNotificationsProps.drawer) === null || _a === void 0 ? void 0 : _a.id) === item.id;
|
|
81
|
-
return (React.createElement(AppLayoutBuiltInErrorBoundary, { key: item.id },
|
|
81
|
+
return (React.createElement(AppLayoutBuiltInErrorBoundary, { key: item.id, appLayoutPart: "toolbar-trigger-drawer" },
|
|
82
82
|
React.createElement(TriggerButton, { ariaLabel: (_b = item.ariaLabels) === null || _b === void 0 ? void 0 : _b.triggerButton, ariaExpanded: selected, ariaControls: activeDrawerId === item.id ? item.id : undefined, className: clsx(styles['drawers-trigger'], !toolsOnlyMode && testutilStyles['drawers-trigger'], item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => {
|
|
83
83
|
exitExpandedMode();
|
|
84
84
|
if (!!expandedDrawerId && activeDrawerId === item.id) {
|
|
@@ -101,7 +101,7 @@ export function DrawerTriggers({ ariaLabels, activeDrawerId, drawers, drawersFoc
|
|
|
101
101
|
selected = item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);
|
|
102
102
|
isForPreviousActiveDrawer = previousActiveGlobalBottomDrawerId.current === item.id;
|
|
103
103
|
}
|
|
104
|
-
return (React.createElement(AppLayoutBuiltInErrorBoundary, { key: item.id },
|
|
104
|
+
return (React.createElement(AppLayoutBuiltInErrorBoundary, { key: item.id, appLayoutPart: "toolbar-trigger-drawer" },
|
|
105
105
|
React.createElement(TriggerButton, { ariaLabel: (_a = item.ariaLabels) === null || _a === void 0 ? void 0 : _a.triggerButton, ariaExpanded: selected, ariaControls: selected ? item.id : undefined, className: clsx(styles['drawers-trigger'], testutilStyles['drawers-trigger'], testutilStyles['drawers-trigger-global']), iconName: item.trigger.iconName, iconSvg: item.trigger.iconSvg, key: item.id, onClick: () => {
|
|
106
106
|
exitExpandedMode();
|
|
107
107
|
if (!!expandedDrawerId && item.id !== expandedDrawerId && activeGlobalDrawersIds.includes(item.id)) {
|
|
@@ -114,7 +114,7 @@ export function DrawerTriggers({ ariaLabels, activeDrawerId, drawers, drawersFoc
|
|
|
114
114
|
onActiveGlobalDrawersChange === null || onActiveGlobalDrawersChange === void 0 ? void 0 : onActiveGlobalDrawersChange(item.id, { initiatedByUserAction: true });
|
|
115
115
|
}, ref: isBottom ? bottomDrawersFocusRef : (_b = globalDrawersFocusControl === null || globalDrawersFocusControl === void 0 ? void 0 : globalDrawersFocusControl.refs[item.id]) === null || _b === void 0 ? void 0 : _b.toggle, selected: selected, badge: item.badge, testId: `awsui-app-layout-trigger-${item.id}`, hasTooltip: true, hasOpenDrawer: hasOpenDrawer, tooltipText: (_c = item.ariaLabels) === null || _c === void 0 ? void 0 : _c.drawerName, isForPreviousActiveDrawer: isForPreviousActiveDrawer, isMobile: isMobile, disabled: disabled })));
|
|
116
116
|
}),
|
|
117
|
-
overflowItems.length > 0 && (React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
117
|
+
overflowItems.length > 0 && (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "toolbar-trigger-overflow-menu" },
|
|
118
118
|
React.createElement(OverflowMenu, { items: overflowItems.map(item => {
|
|
119
119
|
const isBottom = (item === null || item === void 0 ? void 0 : item.position) === 'bottom';
|
|
120
120
|
let active = activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);
|
package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawer-triggers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAI1E,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,OAAO,wBAAwB,MAAM,iDAAiD,CAAC;AACvF,OAAO,cAAc,MAAM,kCAAkC,CAAC;AAC9D,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAsCrC,MAAM,UAAU,cAAc,CAAC,EAC7B,UAAU,EACV,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GAAG,QAAQ,EAC7B,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAClB,QAAQ,EACR,sBAA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,IAAI,uBAAJ,IAAI,CAAE,QAAQ,MAAK,QAAQ,CAAC;wBAC7C,IAAI,QAAQ,EAAE,CAAC;4BACb,MAAM,QAAQ,GACZ,IAAI,CAAC,EAAE,KAAK,0BAA0B,IAAI,CAAC,CAAC,gBAAgB,IAAI,IAAI,CAAC,EAAE,KAAK,gBAAgB,CAAC,CAAC;4BAChG,gCAAgC,aAAhC,gCAAgC,uBAAhC,gCAAgC,CAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;4BAC/F,OAAO;wBACT,CAAC;wBACD,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;4BACnD,IAAI,CAAC,CAAC,gBAAgB,IAAI,EAAE,KAAK,gBAAgB,IAAI,sBAAsB,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC;gCACzF,OAAO;4BACT,CAAC;4BACD,2BAA2B,aAA3B,2BAA2B,uBAA3B,2BAA2B,CAAG,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;wBACrE,CAAC;6BAAM,CAAC;4BACN,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAG,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;wBAC3E,CAAC;oBACH,CAAC,EACD,uBAAuB,EAAE,uBAAuB,GAAG,mBAAmB,GACtE,CAC4B,CACjC,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { useMobile } from '../../../internal/hooks/use-mobile';\nimport { splitItems } from '../../drawer/drawers-helpers';\nimport OverflowMenu from '../../drawer/overflow-menu';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../../interfaces';\nimport { OnChangeParams, TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { InternalDrawer } from '../interfaces';\nimport { FeatureNotificationsProps } from '../state/use-feature-notifications';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface SplitPanelToggleProps {\n displayed: boolean | undefined;\n ariaLabel: string | undefined;\n controlId: string | undefined;\n active: boolean | undefined;\n position: AppLayoutProps.SplitPanelPosition;\n}\ninterface DrawerTriggersProps {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n\n activeDrawerId: string | null;\n drawersFocusRef: React.Ref<Focusable> | undefined;\n drawers: ReadonlyArray<InternalDrawer>;\n onActiveDrawerChange: ((drawerId: string | null, params: OnChangeParams) => void) | undefined;\n\n activeGlobalDrawersIds: ReadonlyArray<string>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n bottomDrawers?: ReadonlyArray<InternalDrawer>;\n bottomDrawersFocusRef?: React.Ref<Focusable> | undefined;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n onActiveGlobalDrawersChange?: (newDrawerId: string, params: OnChangeParams) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n splitPanelOpen?: boolean;\n splitPanelPosition?: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelToggleProps: SplitPanelToggleProps | undefined;\n splitPanelFocusRef: React.Ref<Focusable> | undefined;\n onSplitPanelToggle: (() => void) | undefined;\n disabled: boolean;\n\n featureNotificationsProps?: FeatureNotificationsProps;\n}\n\nexport function DrawerTriggers({\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n splitPanelOpen,\n splitPanelPosition = 'bottom',\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n disabled,\n activeGlobalDrawersIds,\n globalDrawers,\n globalDrawersFocusControl,\n onActiveGlobalDrawersChange,\n expandedDrawerId,\n setExpandedDrawerId,\n activeGlobalBottomDrawerId,\n onActiveGlobalBottomDrawerChange,\n bottomDrawersFocusRef,\n bottomDrawers,\n featureNotificationsProps,\n}: DrawerTriggersProps) {\n const isMobile = useMobile();\n const hasMultipleTriggers = drawers.length > 1;\n const previousActiveLocalDrawerId = useRef(activeDrawerId);\n const previousActiveGlobalBottomDrawerId = useRef(activeGlobalBottomDrawerId);\n const previousActiveGlobalDrawersIds = useRef(activeGlobalDrawersIds);\n const [containerWidth, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const featureNotificationTriggerRef = useRef<HTMLButtonElement>(null);\n if (!drawers.length && !globalDrawers.length && !bottomDrawers?.length && !splitPanelToggleProps) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveLocalDrawerId.current = activeDrawerId;\n }\n\n if (activeGlobalDrawersIds.length) {\n previousActiveGlobalDrawersIds.current = activeGlobalDrawersIds;\n }\n\n if (activeGlobalBottomDrawerId) {\n previousActiveGlobalBottomDrawerId.current = activeGlobalBottomDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (isMobile) {\n return 2;\n }\n if (containerWidth) {\n const ITEM_WIDTH = 50; // Roughly 34px + padding = 42px but added extra for safety\n const overflowSpot = containerWidth;\n\n const index = Math.floor(overflowSpot / ITEM_WIDTH);\n\n let splitPanelItem = 0;\n if (splitPanelToggleProps) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n return 0;\n };\n\n const indexOfOverflowItem = getIndexOfOverflowItem();\n\n const { visibleItems, overflowItems } = splitItems(\n [...drawers, ...globalDrawers, ...(bottomDrawers || [])],\n indexOfOverflowItem,\n activeDrawerId ?? null\n );\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const globalDrawersStartIndex = drawers.length;\n const hasOpenDrawer = !!activeDrawerId || (splitPanelPosition === 'side' && splitPanelOpen);\n const splitPanelResolvedPosition = splitPanelToggleProps?.position;\n\n const exitExpandedMode = () => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n };\n\n return (\n <aside\n className={styles[`drawers-${isMobile ? 'mobile' : 'desktop'}-triggers-container`]}\n aria-label={ariaLabels?.drawers}\n ref={triggersContainerRef}\n role=\"region\"\n >\n {featureNotificationsProps?.renderLatestFeaturePrompt?.({ triggerRef: featureNotificationTriggerRef })}\n <div\n className={styles['drawers-trigger-content']}\n aria-label={ariaLabels?.drawers}\n role=\"toolbar\"\n aria-orientation=\"horizontal\"\n >\n {splitPanelToggleProps && (\n <>\n <TriggerButton\n ariaLabel={splitPanelToggleProps.ariaLabel}\n ariaControls={splitPanelToggleProps.controlId}\n ariaExpanded={!expandedDrawerId && splitPanelToggleProps.active}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n splitPanelTestUtilStyles['open-button']\n )}\n iconName={splitPanelResolvedPosition === 'side' ? 'view-vertical' : 'view-horizontal'}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && splitPanelToggleProps.active) {\n return;\n }\n onSplitPanelToggle?.();\n }}\n selected={!expandedDrawerId && splitPanelToggleProps.active}\n ref={splitPanelResolvedPosition === 'side' ? splitPanelFocusRef : undefined}\n hasTooltip={true}\n isMobile={isMobile}\n isForSplitPanel={true}\n disabled={disabled}\n />\n {hasMultipleTriggers ? <div className={styles['group-divider']}></div> : null}\n </>\n )}\n {visibleItems.slice(0, globalDrawersStartIndex).map(item => {\n const isForPreviousActiveDrawer = previousActiveLocalDrawerId?.current === item.id;\n const selected = !expandedDrawerId && item.id === activeDrawerId;\n const isFeatureNotificationsDrawer = featureNotificationsProps?.drawer?.id === item.id;\n return (\n <AppLayoutBuiltInErrorBoundary key={item.id}>\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n !toolsOnlyMode && testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && activeDrawerId === item.id) {\n return;\n }\n onActiveDrawerChange?.(activeDrawerId !== item.id ? item.id : null, { initiatedByUserAction: true });\n }}\n ref={\n item.id === previousActiveLocalDrawerId.current\n ? drawersFocusRef\n : isFeatureNotificationsDrawer\n ? featureNotificationTriggerRef\n : null\n }\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n </AppLayoutBuiltInErrorBoundary>\n );\n })}\n {globalDrawersStartIndex > 0 && visibleItems.length > globalDrawersStartIndex && (\n <div className={styles['group-divider']}></div>\n )}\n {visibleItems.slice(globalDrawersStartIndex).map(item => {\n let isForPreviousActiveDrawer = previousActiveGlobalDrawersIds?.current.includes(item.id);\n const isBottom = item.position === 'bottom';\n let selected =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n if (isBottom) {\n selected = item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n isForPreviousActiveDrawer = previousActiveGlobalBottomDrawerId.current === item.id;\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary key={item.id}>\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={selected ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && item.id !== expandedDrawerId && activeGlobalDrawersIds.includes(item.id)) {\n return;\n }\n if (isBottom) {\n onActiveGlobalBottomDrawerChange?.(selected ? null : item.id, { initiatedByUserAction: true });\n return;\n }\n onActiveGlobalDrawersChange?.(item.id, { initiatedByUserAction: true });\n }}\n ref={isBottom ? bottomDrawersFocusRef : globalDrawersFocusControl?.refs[item.id]?.toggle}\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n </AppLayoutBuiltInErrorBoundary>\n );\n })}\n {overflowItems.length > 0 && (\n <AppLayoutBuiltInErrorBoundary>\n <OverflowMenu\n items={overflowItems.map(item => {\n const isBottom = item?.position === 'bottom';\n let active =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n if (isBottom) {\n active =\n item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n }\n return {\n ...item,\n active,\n };\n })}\n ariaLabel={overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => {\n return (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global'],\n testUtilsClass\n )}\n iconName=\"ellipsis\"\n onClick={onClick}\n disabled={disabled}\n />\n );\n }}\n onItemClick={event => {\n const id = event.detail.id;\n exitExpandedMode();\n const item = overflowItems.find(item => item.id === id);\n const isBottom = item?.position === 'bottom';\n if (isBottom) {\n const selected =\n item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n onActiveGlobalBottomDrawerChange?.(selected ? null : item.id, { initiatedByUserAction: true });\n return;\n }\n if (globalDrawers.find(drawer => drawer.id === id)) {\n if (!!expandedDrawerId && id !== expandedDrawerId && activeGlobalDrawersIds.includes(id)) {\n return;\n }\n onActiveGlobalDrawersChange?.(id, { initiatedByUserAction: true });\n } else {\n onActiveDrawerChange?.(event.detail.id, { initiatedByUserAction: true });\n }\n }}\n globalDrawersStartIndex={globalDrawersStartIndex - indexOfOverflowItem}\n />\n </AppLayoutBuiltInErrorBoundary>\n )}\n </div>\n </aside>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"drawer-triggers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,YAAY,MAAM,4BAA4B,CAAC;AAEtD,OAAO,EAAkB,eAAe,EAAE,MAAM,yBAAyB,CAA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AC;6BAAM,CAAC;4BACN,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAG,KAAK,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,qBAAqB,EAAE,IAAI,EAAE,CAAC,CAAC;wBAC3E,CAAC;oBACH,CAAC,EACD,uBAAuB,EAAE,uBAAuB,GAAG,mBAAmB,GACtE,CAC4B,CACjC,CACG,CACA,CACT,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useRef } from 'react';\nimport clsx from 'clsx';\n\nimport { useContainerQuery } from '@cloudscape-design/component-toolkit';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { useMobile } from '../../../internal/hooks/use-mobile';\nimport { splitItems } from '../../drawer/drawers-helpers';\nimport OverflowMenu from '../../drawer/overflow-menu';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../../interfaces';\nimport { OnChangeParams, TOOLS_DRAWER_ID } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { InternalDrawer } from '../interfaces';\nimport { FeatureNotificationsProps } from '../state/use-feature-notifications';\nimport TriggerButton from './trigger-button';\n\nimport splitPanelTestUtilStyles from '../../../split-panel/test-classes/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport interface SplitPanelToggleProps {\n displayed: boolean | undefined;\n ariaLabel: string | undefined;\n controlId: string | undefined;\n active: boolean | undefined;\n position: AppLayoutProps.SplitPanelPosition;\n}\ninterface DrawerTriggersProps {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n\n activeDrawerId: string | null;\n drawersFocusRef: React.Ref<Focusable> | undefined;\n drawers: ReadonlyArray<InternalDrawer>;\n onActiveDrawerChange: ((drawerId: string | null, params: OnChangeParams) => void) | undefined;\n\n activeGlobalDrawersIds: ReadonlyArray<string>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n bottomDrawers?: ReadonlyArray<InternalDrawer>;\n bottomDrawersFocusRef?: React.Ref<Focusable> | undefined;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n onActiveGlobalDrawersChange?: (newDrawerId: string, params: OnChangeParams) => void;\n expandedDrawerId?: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n splitPanelOpen?: boolean;\n splitPanelPosition?: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelToggleProps: SplitPanelToggleProps | undefined;\n splitPanelFocusRef: React.Ref<Focusable> | undefined;\n onSplitPanelToggle: (() => void) | undefined;\n disabled: boolean;\n\n featureNotificationsProps?: FeatureNotificationsProps;\n}\n\nexport function DrawerTriggers({\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n splitPanelOpen,\n splitPanelPosition = 'bottom',\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n disabled,\n activeGlobalDrawersIds,\n globalDrawers,\n globalDrawersFocusControl,\n onActiveGlobalDrawersChange,\n expandedDrawerId,\n setExpandedDrawerId,\n activeGlobalBottomDrawerId,\n onActiveGlobalBottomDrawerChange,\n bottomDrawersFocusRef,\n bottomDrawers,\n featureNotificationsProps,\n}: DrawerTriggersProps) {\n const isMobile = useMobile();\n const hasMultipleTriggers = drawers.length > 1;\n const previousActiveLocalDrawerId = useRef(activeDrawerId);\n const previousActiveGlobalBottomDrawerId = useRef(activeGlobalBottomDrawerId);\n const previousActiveGlobalDrawersIds = useRef(activeGlobalDrawersIds);\n const [containerWidth, triggersContainerRef] = useContainerQuery(rect => rect.contentBoxWidth);\n const featureNotificationTriggerRef = useRef<HTMLButtonElement>(null);\n if (!drawers.length && !globalDrawers.length && !bottomDrawers?.length && !splitPanelToggleProps) {\n return null;\n }\n\n if (activeDrawerId) {\n previousActiveLocalDrawerId.current = activeDrawerId;\n }\n\n if (activeGlobalDrawersIds.length) {\n previousActiveGlobalDrawersIds.current = activeGlobalDrawersIds;\n }\n\n if (activeGlobalBottomDrawerId) {\n previousActiveGlobalBottomDrawerId.current = activeGlobalBottomDrawerId;\n }\n\n const getIndexOfOverflowItem = () => {\n if (isMobile) {\n return 2;\n }\n if (containerWidth) {\n const ITEM_WIDTH = 50; // Roughly 34px + padding = 42px but added extra for safety\n const overflowSpot = containerWidth;\n\n const index = Math.floor(overflowSpot / ITEM_WIDTH);\n\n let splitPanelItem = 0;\n if (splitPanelToggleProps) {\n splitPanelItem = 1;\n }\n return index - splitPanelItem;\n }\n return 0;\n };\n\n const indexOfOverflowItem = getIndexOfOverflowItem();\n\n const { visibleItems, overflowItems } = splitItems(\n [...drawers, ...globalDrawers, ...(bottomDrawers || [])],\n indexOfOverflowItem,\n activeDrawerId ?? null\n );\n const overflowMenuHasBadge = !!overflowItems.find(item => item.badge);\n const toolsOnlyMode = drawers.length === 1 && drawers[0].id === TOOLS_DRAWER_ID;\n const globalDrawersStartIndex = drawers.length;\n const hasOpenDrawer = !!activeDrawerId || (splitPanelPosition === 'side' && splitPanelOpen);\n const splitPanelResolvedPosition = splitPanelToggleProps?.position;\n\n const exitExpandedMode = () => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n };\n\n return (\n <aside\n className={styles[`drawers-${isMobile ? 'mobile' : 'desktop'}-triggers-container`]}\n aria-label={ariaLabels?.drawers}\n ref={triggersContainerRef}\n role=\"region\"\n >\n {featureNotificationsProps?.renderLatestFeaturePrompt?.({ triggerRef: featureNotificationTriggerRef })}\n <div\n className={styles['drawers-trigger-content']}\n aria-label={ariaLabels?.drawers}\n role=\"toolbar\"\n aria-orientation=\"horizontal\"\n >\n {splitPanelToggleProps && (\n <>\n <TriggerButton\n ariaLabel={splitPanelToggleProps.ariaLabel}\n ariaControls={splitPanelToggleProps.controlId}\n ariaExpanded={!expandedDrawerId && splitPanelToggleProps.active}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n splitPanelTestUtilStyles['open-button']\n )}\n iconName={splitPanelResolvedPosition === 'side' ? 'view-vertical' : 'view-horizontal'}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && splitPanelToggleProps.active) {\n return;\n }\n onSplitPanelToggle?.();\n }}\n selected={!expandedDrawerId && splitPanelToggleProps.active}\n ref={splitPanelResolvedPosition === 'side' ? splitPanelFocusRef : undefined}\n hasTooltip={true}\n isMobile={isMobile}\n isForSplitPanel={true}\n disabled={disabled}\n />\n {hasMultipleTriggers ? <div className={styles['group-divider']}></div> : null}\n </>\n )}\n {visibleItems.slice(0, globalDrawersStartIndex).map(item => {\n const isForPreviousActiveDrawer = previousActiveLocalDrawerId?.current === item.id;\n const selected = !expandedDrawerId && item.id === activeDrawerId;\n const isFeatureNotificationsDrawer = featureNotificationsProps?.drawer?.id === item.id;\n return (\n <AppLayoutBuiltInErrorBoundary key={item.id} appLayoutPart=\"toolbar-trigger-drawer\">\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={activeDrawerId === item.id ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n !toolsOnlyMode && testutilStyles['drawers-trigger'],\n item.id === TOOLS_DRAWER_ID && testutilStyles['tools-toggle']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && activeDrawerId === item.id) {\n return;\n }\n onActiveDrawerChange?.(activeDrawerId !== item.id ? item.id : null, { initiatedByUserAction: true });\n }}\n ref={\n item.id === previousActiveLocalDrawerId.current\n ? drawersFocusRef\n : isFeatureNotificationsDrawer\n ? featureNotificationTriggerRef\n : null\n }\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n </AppLayoutBuiltInErrorBoundary>\n );\n })}\n {globalDrawersStartIndex > 0 && visibleItems.length > globalDrawersStartIndex && (\n <div className={styles['group-divider']}></div>\n )}\n {visibleItems.slice(globalDrawersStartIndex).map(item => {\n let isForPreviousActiveDrawer = previousActiveGlobalDrawersIds?.current.includes(item.id);\n const isBottom = item.position === 'bottom';\n let selected =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n if (isBottom) {\n selected = item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n isForPreviousActiveDrawer = previousActiveGlobalBottomDrawerId.current === item.id;\n }\n\n return (\n <AppLayoutBuiltInErrorBoundary key={item.id} appLayoutPart=\"toolbar-trigger-drawer\">\n <TriggerButton\n ariaLabel={item.ariaLabels?.triggerButton}\n ariaExpanded={selected}\n ariaControls={selected ? item.id : undefined}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global']\n )}\n iconName={item.trigger!.iconName}\n iconSvg={item.trigger!.iconSvg}\n key={item.id}\n onClick={() => {\n exitExpandedMode();\n if (!!expandedDrawerId && item.id !== expandedDrawerId && activeGlobalDrawersIds.includes(item.id)) {\n return;\n }\n if (isBottom) {\n onActiveGlobalBottomDrawerChange?.(selected ? null : item.id, { initiatedByUserAction: true });\n return;\n }\n onActiveGlobalDrawersChange?.(item.id, { initiatedByUserAction: true });\n }}\n ref={isBottom ? bottomDrawersFocusRef : globalDrawersFocusControl?.refs[item.id]?.toggle}\n selected={selected}\n badge={item.badge}\n testId={`awsui-app-layout-trigger-${item.id}`}\n hasTooltip={true}\n hasOpenDrawer={hasOpenDrawer}\n tooltipText={item.ariaLabels?.drawerName}\n isForPreviousActiveDrawer={isForPreviousActiveDrawer}\n isMobile={isMobile}\n disabled={disabled}\n />\n </AppLayoutBuiltInErrorBoundary>\n );\n })}\n {overflowItems.length > 0 && (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"toolbar-trigger-overflow-menu\">\n <OverflowMenu\n items={overflowItems.map(item => {\n const isBottom = item?.position === 'bottom';\n let active =\n activeGlobalDrawersIds.includes(item.id) && (!expandedDrawerId || item.id === expandedDrawerId);\n if (isBottom) {\n active =\n item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n }\n return {\n ...item,\n active,\n };\n })}\n ariaLabel={overflowMenuHasBadge ? ariaLabels?.drawersOverflowWithBadge : ariaLabels?.drawersOverflow}\n customTriggerBuilder={({ onClick, triggerRef, ariaLabel, ariaExpanded, testUtilsClass }) => {\n return (\n <TriggerButton\n ref={triggerRef}\n ariaLabel={ariaLabel}\n ariaExpanded={ariaExpanded}\n badge={overflowMenuHasBadge}\n className={clsx(\n styles['drawers-trigger'],\n testutilStyles['drawers-trigger'],\n testutilStyles['drawers-trigger-global'],\n testUtilsClass\n )}\n iconName=\"ellipsis\"\n onClick={onClick}\n disabled={disabled}\n />\n );\n }}\n onItemClick={event => {\n const id = event.detail.id;\n exitExpandedMode();\n const item = overflowItems.find(item => item.id === id);\n const isBottom = item?.position === 'bottom';\n if (isBottom) {\n const selected =\n item.id === activeGlobalBottomDrawerId && (!expandedDrawerId || item.id === expandedDrawerId);\n onActiveGlobalBottomDrawerChange?.(selected ? null : item.id, { initiatedByUserAction: true });\n return;\n }\n if (globalDrawers.find(drawer => drawer.id === id)) {\n if (!!expandedDrawerId && id !== expandedDrawerId && activeGlobalDrawersIds.includes(id)) {\n return;\n }\n onActiveGlobalDrawersChange?.(id, { initiatedByUserAction: true });\n } else {\n onActiveDrawerChange?.(event.detail.id, { initiatedByUserAction: true });\n }\n }}\n globalDrawersStartIndex={globalDrawersStartIndex - indexOfOverflowItem}\n />\n </AppLayoutBuiltInErrorBoundary>\n )}\n </div>\n </aside>\n );\n}\n"]}
|
|
@@ -58,7 +58,7 @@ toolbarProps = {}, featureNotificationsProps, }) {
|
|
|
58
58
|
}), style: {
|
|
59
59
|
insetBlockStart: verticalOffsets.toolbar,
|
|
60
60
|
} },
|
|
61
|
-
React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
61
|
+
React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "left-drawer-trigger" },
|
|
62
62
|
React.createElement(Transition, { in: !!((aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.trigger) && !activeAiDrawerId), timeout: { enter: 0, exit: 165 }, mountOnEnter: true, unmountOnExit: true, nodeRef: aiDrawerTransitionRef }, state => {
|
|
63
63
|
var _a, _b, _c;
|
|
64
64
|
return (React.createElement("div", { className: clsx(!!((_a = aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.trigger) === null || _a === void 0 ? void 0 : _a.customIcon) && styles['universal-toolbar-ai-custom'], [
|
|
@@ -76,7 +76,7 @@ toolbarProps = {}, featureNotificationsProps, }) {
|
|
|
76
76
|
})),
|
|
77
77
|
React.createElement(ToolbarContainer, { hasAiDrawer: !!activeAiDrawerId },
|
|
78
78
|
hasNavigation && (React.createElement("nav", { ...navLandmarkAttributes, className: clsx(styles['universal-toolbar-nav']) },
|
|
79
|
-
React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
79
|
+
React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "toolbar-trigger-nav" },
|
|
80
80
|
React.createElement(TriggerButton, { ariaLabel: (_a = ariaLabels === null || ariaLabels === void 0 ? void 0 : ariaLabels.navigationToggle) !== null && _a !== void 0 ? _a : undefined, ariaExpanded: !drawerExpandedMode && navigationOpen, iconName: "menu", className: testutilStyles['navigation-toggle'], onClick: () => {
|
|
81
81
|
if (setExpandedDrawerId) {
|
|
82
82
|
setExpandedDrawerId(null);
|
|
@@ -86,13 +86,13 @@ toolbarProps = {}, featureNotificationsProps, }) {
|
|
|
86
86
|
}
|
|
87
87
|
onNavigationToggle === null || onNavigationToggle === void 0 ? void 0 : onNavigationToggle(!navigationOpen);
|
|
88
88
|
}, ref: navigationFocusRef, selected: !drawerExpandedMode && navigationOpen, disabled: anyPanelOpenInMobile })))),
|
|
89
|
-
(breadcrumbs || discoveredBreadcrumbs) && (React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
89
|
+
(breadcrumbs || discoveredBreadcrumbs) && (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "breadcrumbs" },
|
|
90
90
|
React.createElement(ToolbarBreadcrumbsSection, { ownBreadcrumbs: appLayoutInternals.breadcrumbs, discoveredBreadcrumbs: appLayoutInternals.discoveredBreadcrumbs, includeTestUtils: true }))),
|
|
91
91
|
((drawers === null || drawers === void 0 ? void 0 : drawers.length) ||
|
|
92
92
|
(globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.length) ||
|
|
93
93
|
(bottomDrawers === null || bottomDrawers === void 0 ? void 0 : bottomDrawers.length) ||
|
|
94
94
|
(hasSplitPanel && (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed))) && (React.createElement("div", { className: clsx(styles['universal-toolbar-drawers']) },
|
|
95
|
-
React.createElement(AppLayoutBuiltInErrorBoundary,
|
|
95
|
+
React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "toolbar-triggers" },
|
|
96
96
|
React.createElement(DrawerTriggers, { ariaLabels: ariaLabels, activeDrawerId: activeDrawerId !== null && activeDrawerId !== void 0 ? activeDrawerId : null, drawers: (_b = drawers === null || drawers === void 0 ? void 0 : drawers.filter(item => !!item.trigger)) !== null && _b !== void 0 ? _b : [], drawersFocusRef: drawersFocusRef, onActiveDrawerChange: onActiveDrawerChange, splitPanelToggleProps: (splitPanelToggleProps === null || splitPanelToggleProps === void 0 ? void 0 : splitPanelToggleProps.displayed) ? splitPanelToggleProps : undefined, splitPanelFocusRef: splitPanelFocusRef, onSplitPanelToggle: onSplitPanelToggle, disabled: anyPanelOpenInMobile, globalDrawersFocusControl: globalDrawersFocusControl, bottomDrawersFocusRef: bottomDrawersFocusRef, globalDrawers: (_c = globalDrawers === null || globalDrawers === void 0 ? void 0 : globalDrawers.filter(item => !!item.trigger)) !== null && _c !== void 0 ? _c : [], activeGlobalDrawersIds: activeGlobalDrawersIds !== null && activeGlobalDrawersIds !== void 0 ? activeGlobalDrawersIds : [], onActiveGlobalDrawersChange: onActiveGlobalDrawersChange, expandedDrawerId: expandedDrawerId, setExpandedDrawerId: setExpandedDrawerId, bottomDrawers: bottomDrawers, onActiveGlobalBottomDrawerChange: onActiveGlobalBottomDrawerChange, activeGlobalBottomDrawerId: activeGlobalBottomDrawerId, featureNotificationsProps: featureNotificationsProps })))))));
|
|
97
97
|
}
|
|
98
98
|
export const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);
|