@cloudscape-design/components 3.0.1322 → 3.0.1324

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.
Files changed (100) hide show
  1. package/alert/styles.css.js +27 -27
  2. package/alert/styles.scoped.css +44 -44
  3. package/alert/styles.selectors.js +27 -27
  4. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -1
  5. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +3 -3
  6. package/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -1
  7. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js +1 -1
  8. package/app-layout/visual-refresh-toolbar/drawer/global-bottom-drawer.js.map +1 -1
  9. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +1 -1
  10. package/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
  11. package/app-layout/visual-refresh-toolbar/index.js +1 -1
  12. package/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  13. package/app-layout/visual-refresh-toolbar/state/index.js +1 -1
  14. package/app-layout/visual-refresh-toolbar/state/index.js.map +1 -1
  15. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js +3 -3
  16. package/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.js.map +1 -1
  17. package/app-layout/visual-refresh-toolbar/toolbar/index.js +4 -4
  18. package/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
  19. package/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js +2 -2
  20. package/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.js.map +1 -1
  21. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +2 -2
  22. package/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
  23. package/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js +1 -1
  24. package/app-layout/visual-refresh-toolbar/widget-areas/bottom-content-slot.js.map +1 -1
  25. package/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js +1 -1
  26. package/app-layout/visual-refresh-toolbar/widget-areas/top-content-slot.js.map +1 -1
  27. package/box/styles.css.js +193 -193
  28. package/box/styles.scoped.css +242 -242
  29. package/box/styles.selectors.js +193 -193
  30. package/code-editor/styles.css.js +33 -33
  31. package/code-editor/styles.scoped.css +147 -147
  32. package/code-editor/styles.selectors.js +33 -33
  33. package/error-boundary/interfaces.d.ts +1 -0
  34. package/error-boundary/interfaces.d.ts.map +1 -1
  35. package/error-boundary/interfaces.js.map +1 -1
  36. package/error-boundary/internal.d.ts +2 -1
  37. package/error-boundary/internal.d.ts.map +1 -1
  38. package/error-boundary/internal.js +7 -3
  39. package/error-boundary/internal.js.map +1 -1
  40. package/flashbar/flash.d.ts.map +1 -1
  41. package/flashbar/flash.js +2 -2
  42. package/flashbar/flash.js.map +1 -1
  43. package/flashbar/style.d.ts +3 -0
  44. package/flashbar/style.d.ts.map +1 -1
  45. package/flashbar/style.js +9 -0
  46. package/flashbar/style.js.map +1 -1
  47. package/flashbar/styles.css.js +50 -50
  48. package/flashbar/styles.scoped.css +169 -151
  49. package/flashbar/styles.selectors.js +50 -50
  50. package/form-field/styles.css.js +24 -24
  51. package/form-field/styles.scoped.css +40 -40
  52. package/form-field/styles.selectors.js +24 -24
  53. package/icon/styles.css.js +41 -41
  54. package/icon/styles.scoped.css +94 -94
  55. package/icon/styles.selectors.js +41 -41
  56. package/input/styles.css.js +18 -18
  57. package/input/styles.scoped.css +38 -38
  58. package/input/styles.selectors.js +18 -18
  59. package/internal/analytics/components/analytics-funnel.d.ts.map +1 -1
  60. package/internal/analytics/components/analytics-funnel.js +16 -5
  61. package/internal/analytics/components/analytics-funnel.js.map +1 -1
  62. package/internal/base-component/styles.scoped.css +91 -57
  63. package/internal/components/button-trigger/styles.css.js +14 -14
  64. package/internal/components/button-trigger/styles.scoped.css +35 -35
  65. package/internal/components/button-trigger/styles.selectors.js +14 -14
  66. package/internal/environment.js +2 -2
  67. package/internal/environment.json +2 -2
  68. package/internal/generated/styles/tokens.d.ts +10 -0
  69. package/internal/generated/styles/tokens.js +23 -13
  70. package/internal/generated/theming/index.cjs +262 -21
  71. package/internal/generated/theming/index.cjs.d.ts +90 -0
  72. package/internal/generated/theming/index.d.ts +90 -0
  73. package/internal/generated/theming/index.js +262 -21
  74. package/internal/manifest.json +1 -1
  75. package/manifest.json +2 -2
  76. package/package.json +1 -1
  77. package/popover/body.d.ts.map +1 -1
  78. package/popover/body.js +2 -2
  79. package/popover/body.js.map +1 -1
  80. package/prompt-input/styles.css.js +26 -26
  81. package/prompt-input/styles.scoped.css +61 -61
  82. package/prompt-input/styles.selectors.js +26 -26
  83. package/side-navigation/parts.d.ts.map +1 -1
  84. package/side-navigation/parts.js +21 -14
  85. package/side-navigation/parts.js.map +1 -1
  86. package/side-navigation/styles.css.js +46 -46
  87. package/side-navigation/styles.scoped.css +85 -107
  88. package/side-navigation/styles.selectors.js +46 -46
  89. package/slider/styles.css.js +26 -26
  90. package/slider/styles.scoped.css +112 -112
  91. package/slider/styles.selectors.js +26 -26
  92. package/status-indicator/styles.css.js +24 -24
  93. package/status-indicator/styles.scoped.css +59 -59
  94. package/status-indicator/styles.selectors.js +24 -24
  95. package/textarea/styles.css.js +5 -5
  96. package/textarea/styles.scoped.css +17 -17
  97. package/textarea/styles.selectors.js +5 -5
  98. package/tutorial-panel/components/tutorial-detail-view/styles.css.js +20 -20
  99. package/tutorial-panel/components/tutorial-detail-view/styles.scoped.css +23 -23
  100. package/tutorial-panel/components/tutorial-detail-view/styles.selectors.js +20 -20
@@ -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,OAAO,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAA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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-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AAlB,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, null,
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-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EA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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>\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"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAC9E,OAAO,kBAAkB,MAAM,sCAAsC,CAAC;AACtE,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAE3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAqB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGnE,MAAM,sBAAsB,GAUvB,CAAC,EAAE,sBAAs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,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, null,
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,MAAM,8BAA8B,GAAG,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAuB,EAAE,EAAE;;IAClH,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,MAAA,YAAY,CAAC,OAAO,CAAC,UAAU,mCAAI,KAAK,CAAC,CAAC;IACvF,MAAM,cAAc,GAAG,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAC5E,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IAEvG,eAAe,CAAC,GAAG,EAAE;;QACnB,IAAI,CAAC,CAAA,MAAA,YAAY,CAAC,OAAO,0CAAE,QAAQ,CAAA,EAAE,CAAC;YACpC,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACrD,OAAO;QACT,CAAC;QACD,YAAY,CAAC,OAAO,CAAC,QAAQ,CAC3B,cAAc,EACd,uBAAuB,EACvB,eAAe,CAAC,cAAc,EAAE,cAAc,CAAC,EAC/C,UAAU,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,eAAe,CAAC,GAAG,EAAE;QACnB,YAAY,CAAC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC;IAClD,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAA0B,EAAE,EAAE;IACnE,OAAO,CACL,oBAAC,6BAA6B;QAC5B,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>\n <AppLayoutStateProviderInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n );\n};\n\nexport const createWidgetizedAppLayoutState = createWidgetizedComponent(AppLayoutStateProvider);\n"]}
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,0BAA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c. 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, null,
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);
@@ -1 +1 @@
1
- {"version":3,"file":"drawer-triggers.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/drawer-triggers.tsx"],"names":[],"m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AC,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,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,sBAAsB,EACtB,aAAa,EACb,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,mBAAmB,EACnB,0BAA0B,EA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AAJ,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} 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, null,
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, null,
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, null,
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, null,
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);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC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C;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,yBAAyB,CAAC,8BAA8B,EAAE,eAAe,CAAC,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 { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { ToolbarSkeleton } from '../skeleton/skeleton-parts';\nimport { ToolbarSlot } from '../skeleton/slots';\nimport { ToolbarBreadcrumbsSection, ToolbarContainer } from '../skeleton/toolbar-container';\nimport { FeatureNotificationsProps } from '../state/use-feature-notifications';\nimport { DrawerTriggers, SplitPanelToggleProps } from './drawer-triggers';\nimport TriggerButton from './trigger-button';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { SplitPanelToggleProps };\n\nexport interface ToolbarProps {\n ariaLabels?: AppLayoutProps.Labels;\n // navigation\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n onNavigationToggle?: (open: boolean) => void;\n navigationFocusRef?: React.Ref<Focusable>;\n\n // breadcrumbs\n hasBreadcrumbsPortal?: boolean;\n\n // split panel\n hasSplitPanel?: boolean;\n splitPanelToggleProps?: SplitPanelToggleProps;\n splitPanelFocusRef?: React.Ref<Focusable>;\n onSplitPanelToggle?: () => void;\n\n // drawers\n activeDrawerId?: string | null;\n drawers?: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusRef?: React.Ref<Focusable>;\n bottomDrawersFocusRef?: React.Ref<Focusable>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: ReadonlyArray<string>;\n onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;\n bottomDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n expandedDrawerId?: string | null;\n setExpandedDrawerId?: (value: string | null) => void;\n\n aiDrawer?: AppLayoutProps.Drawer;\n onActiveAiDrawerChange?: (value: string | null) => void;\n activeAiDrawerId?: string | null;\n aiDrawerFocusRef?: React.Ref<Focusable>;\n}\n\nexport interface AppLayoutToolbarImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n toolbarProps: ToolbarProps;\n featureNotificationsProps?: FeatureNotificationsProps;\n}\n\nexport function AppLayoutToolbarImplementation({\n appLayoutInternals,\n // the value could be undefined if this component is loaded as a widget by a different app layout version\n // not testable in a single-version setup\n toolbarProps = {},\n featureNotificationsProps,\n}: AppLayoutToolbarImplementationProps) {\n const {\n breadcrumbs,\n discoveredBreadcrumbs,\n verticalOffsets,\n isMobile,\n setToolbarHeight,\n aiDrawer,\n activeAiDrawer,\n onActiveAiDrawerChange,\n } = appLayoutInternals;\n const {\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n globalDrawersFocusControl,\n globalDrawers,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n hasNavigation,\n navigationOpen,\n navigationFocusRef,\n onNavigationToggle,\n hasSplitPanel,\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n expandedDrawerId,\n setExpandedDrawerId,\n aiDrawerFocusRef,\n onActiveGlobalBottomDrawerChange,\n activeGlobalBottomDrawerId,\n bottomDrawersFocusRef,\n bottomDrawers,\n } = toolbarProps;\n const drawerExpandedMode = !!expandedDrawerId;\n const ref = useRef<HTMLElement>(null);\n const aiDrawerTransitionRef = useRef<HTMLDivElement>(null);\n const activeAiDrawerId = activeAiDrawer?.id;\n useResizeObserver(ref, entry => setToolbarHeight(entry.borderBoxHeight));\n useEffect(() => {\n return () => {\n setToolbarHeight(0);\n };\n // unmount effect only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const anyPanelOpenInMobile =\n !!isMobile &&\n (!!activeDrawerId ||\n !!activeGlobalDrawersIds?.length ||\n !!activeAiDrawerId ||\n !!activeGlobalBottomDrawerId ||\n (!!navigationOpen && !!hasNavigation));\n useEffect(() => {\n if (anyPanelOpenInMobile) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n }, [anyPanelOpenInMobile]);\n\n const navLandmarkAttributes = navigationOpen\n ? { role: 'presentation' }\n : { role: 'navigation', 'aria-label': ariaLabels?.navigation };\n\n return (\n <ToolbarSlot\n ref={ref}\n className={clsx((aiDrawer?.trigger || !!activeAiDrawerId) && styles['with-ai-drawer'], {\n [testutilStyles['mobile-bar']]: isMobile,\n })}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\n <AppLayoutBuiltInErrorBoundary>\n <Transition\n in={!!(aiDrawer?.trigger && !activeAiDrawerId)}\n timeout={{ enter: 0, exit: 165 }}\n mountOnEnter={true}\n unmountOnExit={true}\n nodeRef={aiDrawerTransitionRef}\n >\n {state => (\n <div\n className={clsx(!!aiDrawer?.trigger?.customIcon && styles['universal-toolbar-ai-custom'], [\n sharedStyles['with-motion-horizontal'],\n ])}\n style={{\n opacity: ['entering', 'exiting'].includes(state) ? 0 : 1,\n }}\n >\n <TriggerButton\n ariaLabel={aiDrawer?.ariaLabels?.triggerButton}\n ariaExpanded={!!activeAiDrawerId}\n iconName={aiDrawer?.trigger!.iconName}\n iconSvg={aiDrawer?.trigger!.iconSvg}\n customSvg={aiDrawer?.trigger!.customIcon}\n className={testutilStyles['ai-drawer-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n onActiveAiDrawerChange?.(aiDrawer?.id ?? null, { initiatedByUserAction: true });\n }}\n ref={aiDrawerFocusRef}\n selected={!drawerExpandedMode && !!activeAiDrawerId}\n disabled={anyPanelOpenInMobile}\n variant={aiDrawer?.trigger?.customIcon ? 'custom' : 'default'}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n <ToolbarContainer hasAiDrawer={!!activeAiDrawerId}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\n <AppLayoutBuiltInErrorBoundary>\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n if (navigationOpen && expandedDrawerId) {\n return;\n }\n onNavigationToggle?.(!navigationOpen);\n }}\n ref={navigationFocusRef}\n selected={!drawerExpandedMode && navigationOpen}\n disabled={anyPanelOpenInMobile}\n />\n </AppLayoutBuiltInErrorBoundary>\n </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <AppLayoutBuiltInErrorBoundary>\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n </AppLayoutBuiltInErrorBoundary>\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\n <AppLayoutBuiltInErrorBoundary>\n <DrawerTriggers\n ariaLabels={ariaLabels}\n activeDrawerId={activeDrawerId ?? null}\n drawers={drawers?.filter(item => !!item.trigger) ?? []}\n drawersFocusRef={drawersFocusRef}\n onActiveDrawerChange={onActiveDrawerChange}\n splitPanelToggleProps={splitPanelToggleProps?.displayed ? splitPanelToggleProps : undefined}\n splitPanelFocusRef={splitPanelFocusRef}\n onSplitPanelToggle={onSplitPanelToggle}\n disabled={anyPanelOpenInMobile}\n globalDrawersFocusControl={globalDrawersFocusControl}\n bottomDrawersFocusRef={bottomDrawersFocusRef}\n globalDrawers={globalDrawers?.filter(item => !!item.trigger) ?? []}\n activeGlobalDrawersIds={activeGlobalDrawersIds ?? []}\n onActiveGlobalDrawersChange={onActiveGlobalDrawersChange}\n expandedDrawerId={expandedDrawerId}\n setExpandedDrawerId={setExpandedDrawerId!}\n bottomDrawers={bottomDrawers}\n onActiveGlobalBottomDrawerChange={onActiveGlobalBottomDrawerChange}\n activeGlobalBottomDrawerId={activeGlobalBottomDrawerId}\n featureNotificationsProps={featureNotificationsProps}\n />\n </AppLayoutBuiltInErrorBoundary>\n </div>\n )}\n </ToolbarContainer>\n </ToolbarSlot>\n );\n}\n\nexport const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/toolbar/index.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,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAElF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AAC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ier: Apache-2.0\nimport React, { useEffect, useRef } from 'react';\nimport { Transition } from 'react-transition-group';\nimport clsx from 'clsx';\n\nimport { useResizeObserver } from '@cloudscape-design/component-toolkit/internal';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { OnChangeParams } from '../../utils/use-drawers';\nimport { Focusable, FocusControlMultipleStates } from '../../utils/use-focus-control';\nimport { AppLayoutInternals } from '../interfaces';\nimport { ToolbarSkeleton } from '../skeleton/skeleton-parts';\nimport { ToolbarSlot } from '../skeleton/slots';\nimport { ToolbarBreadcrumbsSection, ToolbarContainer } from '../skeleton/toolbar-container';\nimport { FeatureNotificationsProps } from '../state/use-feature-notifications';\nimport { DrawerTriggers, SplitPanelToggleProps } from './drawer-triggers';\nimport TriggerButton from './trigger-button';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport testutilStyles from '../../test-classes/styles.css.js';\nimport styles from './styles.css.js';\n\nexport { SplitPanelToggleProps };\n\nexport interface ToolbarProps {\n ariaLabels?: AppLayoutProps.Labels;\n // navigation\n hasNavigation?: boolean;\n navigationOpen?: boolean;\n onNavigationToggle?: (open: boolean) => void;\n navigationFocusRef?: React.Ref<Focusable>;\n\n // breadcrumbs\n hasBreadcrumbsPortal?: boolean;\n\n // split panel\n hasSplitPanel?: boolean;\n splitPanelToggleProps?: SplitPanelToggleProps;\n splitPanelFocusRef?: React.Ref<Focusable>;\n onSplitPanelToggle?: () => void;\n\n // drawers\n activeDrawerId?: string | null;\n drawers?: ReadonlyArray<AppLayoutProps.Drawer>;\n drawersFocusRef?: React.Ref<Focusable>;\n bottomDrawersFocusRef?: React.Ref<Focusable>;\n globalDrawersFocusControl?: FocusControlMultipleStates;\n onActiveDrawerChange?: (drawerId: string | null, params: OnChangeParams) => void;\n globalDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalDrawersIds?: ReadonlyArray<string>;\n onActiveGlobalDrawersChange?: ((drawerId: string, params: OnChangeParams) => void) | undefined;\n bottomDrawers?: ReadonlyArray<AppLayoutProps.Drawer> | undefined;\n activeGlobalBottomDrawerId?: string | null;\n onActiveGlobalBottomDrawerChange?: (value: string | null, params: OnChangeParams) => void;\n\n expandedDrawerId?: string | null;\n setExpandedDrawerId?: (value: string | null) => void;\n\n aiDrawer?: AppLayoutProps.Drawer;\n onActiveAiDrawerChange?: (value: string | null) => void;\n activeAiDrawerId?: string | null;\n aiDrawerFocusRef?: React.Ref<Focusable>;\n}\n\nexport interface AppLayoutToolbarImplementationProps {\n appLayoutInternals: AppLayoutInternals;\n toolbarProps: ToolbarProps;\n featureNotificationsProps?: FeatureNotificationsProps;\n}\n\nexport function AppLayoutToolbarImplementation({\n appLayoutInternals,\n // the value could be undefined if this component is loaded as a widget by a different app layout version\n // not testable in a single-version setup\n toolbarProps = {},\n featureNotificationsProps,\n}: AppLayoutToolbarImplementationProps) {\n const {\n breadcrumbs,\n discoveredBreadcrumbs,\n verticalOffsets,\n isMobile,\n setToolbarHeight,\n aiDrawer,\n activeAiDrawer,\n onActiveAiDrawerChange,\n } = appLayoutInternals;\n const {\n ariaLabels,\n activeDrawerId,\n drawers,\n drawersFocusRef,\n onActiveDrawerChange,\n globalDrawersFocusControl,\n globalDrawers,\n activeGlobalDrawersIds,\n onActiveGlobalDrawersChange,\n hasNavigation,\n navigationOpen,\n navigationFocusRef,\n onNavigationToggle,\n hasSplitPanel,\n splitPanelFocusRef,\n splitPanelToggleProps,\n onSplitPanelToggle,\n expandedDrawerId,\n setExpandedDrawerId,\n aiDrawerFocusRef,\n onActiveGlobalBottomDrawerChange,\n activeGlobalBottomDrawerId,\n bottomDrawersFocusRef,\n bottomDrawers,\n } = toolbarProps;\n const drawerExpandedMode = !!expandedDrawerId;\n const ref = useRef<HTMLElement>(null);\n const aiDrawerTransitionRef = useRef<HTMLDivElement>(null);\n const activeAiDrawerId = activeAiDrawer?.id;\n useResizeObserver(ref, entry => setToolbarHeight(entry.borderBoxHeight));\n useEffect(() => {\n return () => {\n setToolbarHeight(0);\n };\n // unmount effect only\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n const anyPanelOpenInMobile =\n !!isMobile &&\n (!!activeDrawerId ||\n !!activeGlobalDrawersIds?.length ||\n !!activeAiDrawerId ||\n !!activeGlobalBottomDrawerId ||\n (!!navigationOpen && !!hasNavigation));\n useEffect(() => {\n if (anyPanelOpenInMobile) {\n document.body.classList.add(styles['block-body-scroll']);\n } else {\n document.body.classList.remove(styles['block-body-scroll']);\n }\n return () => {\n document.body.classList.remove(styles['block-body-scroll']);\n };\n }, [anyPanelOpenInMobile]);\n\n const navLandmarkAttributes = navigationOpen\n ? { role: 'presentation' }\n : { role: 'navigation', 'aria-label': ariaLabels?.navigation };\n\n return (\n <ToolbarSlot\n ref={ref}\n className={clsx((aiDrawer?.trigger || !!activeAiDrawerId) && styles['with-ai-drawer'], {\n [testutilStyles['mobile-bar']]: isMobile,\n })}\n style={{\n insetBlockStart: verticalOffsets.toolbar,\n }}\n >\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"left-drawer-trigger\">\n <Transition\n in={!!(aiDrawer?.trigger && !activeAiDrawerId)}\n timeout={{ enter: 0, exit: 165 }}\n mountOnEnter={true}\n unmountOnExit={true}\n nodeRef={aiDrawerTransitionRef}\n >\n {state => (\n <div\n className={clsx(!!aiDrawer?.trigger?.customIcon && styles['universal-toolbar-ai-custom'], [\n sharedStyles['with-motion-horizontal'],\n ])}\n style={{\n opacity: ['entering', 'exiting'].includes(state) ? 0 : 1,\n }}\n >\n <TriggerButton\n ariaLabel={aiDrawer?.ariaLabels?.triggerButton}\n ariaExpanded={!!activeAiDrawerId}\n iconName={aiDrawer?.trigger!.iconName}\n iconSvg={aiDrawer?.trigger!.iconSvg}\n customSvg={aiDrawer?.trigger!.customIcon}\n className={testutilStyles['ai-drawer-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n onActiveAiDrawerChange?.(aiDrawer?.id ?? null, { initiatedByUserAction: true });\n }}\n ref={aiDrawerFocusRef}\n selected={!drawerExpandedMode && !!activeAiDrawerId}\n disabled={anyPanelOpenInMobile}\n variant={aiDrawer?.trigger?.customIcon ? 'custom' : 'default'}\n testId={`awsui-app-layout-trigger-${aiDrawer?.id}`}\n isForPreviousActiveDrawer={true}\n />\n </div>\n )}\n </Transition>\n </AppLayoutBuiltInErrorBoundary>\n <ToolbarContainer hasAiDrawer={!!activeAiDrawerId}>\n {hasNavigation && (\n <nav {...navLandmarkAttributes} className={clsx(styles['universal-toolbar-nav'])}>\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"toolbar-trigger-nav\">\n <TriggerButton\n ariaLabel={ariaLabels?.navigationToggle ?? undefined}\n ariaExpanded={!drawerExpandedMode && navigationOpen}\n iconName=\"menu\"\n className={testutilStyles['navigation-toggle']}\n onClick={() => {\n if (setExpandedDrawerId) {\n setExpandedDrawerId(null);\n }\n if (navigationOpen && expandedDrawerId) {\n return;\n }\n onNavigationToggle?.(!navigationOpen);\n }}\n ref={navigationFocusRef}\n selected={!drawerExpandedMode && navigationOpen}\n disabled={anyPanelOpenInMobile}\n />\n </AppLayoutBuiltInErrorBoundary>\n </nav>\n )}\n {(breadcrumbs || discoveredBreadcrumbs) && (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"breadcrumbs\">\n <ToolbarBreadcrumbsSection\n ownBreadcrumbs={appLayoutInternals.breadcrumbs}\n discoveredBreadcrumbs={appLayoutInternals.discoveredBreadcrumbs}\n includeTestUtils={true}\n />\n </AppLayoutBuiltInErrorBoundary>\n )}\n {(drawers?.length ||\n globalDrawers?.length ||\n bottomDrawers?.length ||\n (hasSplitPanel && splitPanelToggleProps?.displayed)) && (\n <div className={clsx(styles['universal-toolbar-drawers'])}>\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"toolbar-triggers\">\n <DrawerTriggers\n ariaLabels={ariaLabels}\n activeDrawerId={activeDrawerId ?? null}\n drawers={drawers?.filter(item => !!item.trigger) ?? []}\n drawersFocusRef={drawersFocusRef}\n onActiveDrawerChange={onActiveDrawerChange}\n splitPanelToggleProps={splitPanelToggleProps?.displayed ? splitPanelToggleProps : undefined}\n splitPanelFocusRef={splitPanelFocusRef}\n onSplitPanelToggle={onSplitPanelToggle}\n disabled={anyPanelOpenInMobile}\n globalDrawersFocusControl={globalDrawersFocusControl}\n bottomDrawersFocusRef={bottomDrawersFocusRef}\n globalDrawers={globalDrawers?.filter(item => !!item.trigger) ?? []}\n activeGlobalDrawersIds={activeGlobalDrawersIds ?? []}\n onActiveGlobalDrawersChange={onActiveGlobalDrawersChange}\n expandedDrawerId={expandedDrawerId}\n setExpandedDrawerId={setExpandedDrawerId!}\n bottomDrawers={bottomDrawers}\n onActiveGlobalBottomDrawerChange={onActiveGlobalBottomDrawerChange}\n activeGlobalBottomDrawerId={activeGlobalBottomDrawerId}\n featureNotificationsProps={featureNotificationsProps}\n />\n </AppLayoutBuiltInErrorBoundary>\n </div>\n )}\n </ToolbarContainer>\n </ToolbarSlot>\n );\n}\n\nexport const AppLayoutToolbar = createWidgetizedComponent(AppLayoutToolbarImplementation, ToolbarSkeleton);\n"]}
@@ -25,13 +25,13 @@ export const AfterMainSlotImplementationInternal = ({ appLayoutState, appLayoutP
25
25
  React.createElement(AppLayoutBottomDrawerWrapper, { widgetizedState: appLayoutState.widgetizedState })))),
26
26
  splitPanelPosition === 'side' && (React.createElement("div", { className: clsx(styles['split-panel-side'], !splitPanelOpen && styles['panel-hidden'], drawerExpandedMode && styles.hidden) },
27
27
  React.createElement(AppLayoutSplitPanelSide, { appLayoutInternals: appLayoutState.appLayoutInternals, splitPanelInternals: appLayoutState.splitPanelInternals, bottomDrawerReportedSize: bottomDrawerReportedSize }, appLayoutProps.splitPanel))),
28
- React.createElement(AppLayoutBuiltInErrorBoundary, null,
28
+ React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "tools" },
29
29
  React.createElement("div", { className: clsx(styles.tools, !toolsOpen && styles['panel-hidden'], sharedStyles['with-motion-horizontal'], navigationOpen && !toolsOpen && styles['unfocusable-mobile'], toolsOpen && styles['tools-open'], drawerExpandedMode && styles.hidden) }, drawers && drawers.length > 0 && (React.createElement(AppLayoutDrawer, { appLayoutInternals: appLayoutState.appLayoutInternals, bottomDrawerReportedSize: activeGlobalBottomDrawerId ? bottomDrawerReportedSize : 0 })))),
30
30
  React.createElement("div", { className: clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden']) },
31
31
  React.createElement(ActiveDrawersContext.Provider, { value: activeGlobalDrawersIds !== null && activeGlobalDrawersIds !== void 0 ? activeGlobalDrawersIds : [] },
32
32
  React.createElement(AppLayoutGlobalDrawers, { appLayoutInternals: appLayoutState.appLayoutInternals })))));
33
33
  };
34
- export const AfterMainSlotImplementation = (props) => (React.createElement(AppLayoutBuiltInErrorBoundary, null,
34
+ export const AfterMainSlotImplementation = (props) => (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "after-main-slot" },
35
35
  React.createElement(AfterMainSlotImplementationInternal, { ...props })));
36
36
  export const createWidgetizedAppLayoutAfterMainSlot = createWidgetizedComponent(AfterMainSlotImplementation);
37
37
  //# sourceMappingURL=after-main-slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"after-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EACL,6BAA6B,IAAI,eAAe,EAChD,o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ACvE,oBAAC,6BAA6B;IAC5B,oBAAC,mCAAmC,OAAK,KAAK,GAAI,CACpB,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport {\n AppLayoutDrawerImplementation as AppLayoutDrawer,\n AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers,\n} from '../drawer';\nimport { AppLayoutBottomDrawerWrapper } from '../drawer/global-bottom-drawer';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide } from '../split-panel';\nimport { isWidgetReady } from '../state/invariants';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const AfterMainSlotImplementationInternal = ({ appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n const {\n navigationOpen,\n activeGlobalDrawersIds,\n expandedDrawerId,\n activeDrawer,\n splitPanelOpen,\n drawers,\n splitPanelPosition,\n activeGlobalBottomDrawerId,\n bottomDrawers,\n bottomDrawerReportedSize,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n const globalToolsOpen = !!activeGlobalDrawersIds?.length;\n\n return (\n <>\n {!!bottomDrawers.length && (\n <div className={styles['bottom-tool']}>\n <ActiveDrawersContext.Provider value={activeGlobalBottomDrawerId ? [activeGlobalBottomDrawerId] : []}>\n <AppLayoutBottomDrawerWrapper widgetizedState={appLayoutState.widgetizedState} />\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {splitPanelPosition === 'side' && (\n <div\n className={clsx(\n styles['split-panel-side'],\n !splitPanelOpen && styles['panel-hidden'],\n drawerExpandedMode && styles.hidden\n )}\n >\n <AppLayoutSplitPanelSide\n appLayoutInternals={appLayoutState.appLayoutInternals}\n splitPanelInternals={appLayoutState.splitPanelInternals}\n bottomDrawerReportedSize={bottomDrawerReportedSize}\n >\n {appLayoutProps.splitPanel}\n </AppLayoutSplitPanelSide>\n </div>\n )}\n <AppLayoutBuiltInErrorBoundary>\n <div\n className={clsx(\n styles.tools,\n !toolsOpen && styles['panel-hidden'],\n sharedStyles['with-motion-horizontal'],\n navigationOpen && !toolsOpen && styles['unfocusable-mobile'],\n toolsOpen && styles['tools-open'],\n drawerExpandedMode && styles.hidden\n )}\n >\n {drawers && drawers.length > 0 && (\n <AppLayoutDrawer\n appLayoutInternals={appLayoutState.appLayoutInternals}\n bottomDrawerReportedSize={activeGlobalBottomDrawerId ? bottomDrawerReportedSize : 0}\n />\n )}\n </div>\n </AppLayoutBuiltInErrorBoundary>\n <div className={clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden'])}>\n <ActiveDrawersContext.Provider value={activeGlobalDrawersIds ?? []}>\n <AppLayoutGlobalDrawers appLayoutInternals={appLayoutState.appLayoutInternals} />\n </ActiveDrawersContext.Provider>\n </div>\n </>\n );\n};\n\nexport const AfterMainSlotImplementation = (props: SkeletonPartProps) => (\n <AppLayoutBuiltInErrorBoundary>\n <AfterMainSlotImplementationInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n);\n\nexport const createWidgetizedAppLayoutAfterMainSlot = createWidgetizedComponent(AfterMainSlotImplementation);\n"]}
1
+ {"version":3,"file":"after-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/after-main-slot.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI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AAE,sBAAsB,aAAtB,sBAAsB,cAAtB,sBAAsB,GAAI,EAAE;gBAChE,oBAAC,sBAAsB,IAAC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,GAAI,CACnD,CAC5B,CACL,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACvE,oBAAC,6BAA6B,IAAC,aAAa,EAAC,iBAAiB;IAC5D,oBAAC,mCAAmC,OAAK,KAAK,GAAI,CACpB,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,sCAAsC,GAAG,yBAAyB,CAAC,2BAA2B,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport {\n AppLayoutDrawerImplementation as AppLayoutDrawer,\n AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers,\n} from '../drawer';\nimport { AppLayoutBottomDrawerWrapper } from '../drawer/global-bottom-drawer';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide } from '../split-panel';\nimport { isWidgetReady } from '../state/invariants';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const AfterMainSlotImplementationInternal = ({ appLayoutState, appLayoutProps }: SkeletonPartProps) => {\n if (!isWidgetReady(appLayoutState)) {\n return null;\n }\n const {\n navigationOpen,\n activeGlobalDrawersIds,\n expandedDrawerId,\n activeDrawer,\n splitPanelOpen,\n drawers,\n splitPanelPosition,\n activeGlobalBottomDrawerId,\n bottomDrawers,\n bottomDrawerReportedSize,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n const globalToolsOpen = !!activeGlobalDrawersIds?.length;\n\n return (\n <>\n {!!bottomDrawers.length && (\n <div className={styles['bottom-tool']}>\n <ActiveDrawersContext.Provider value={activeGlobalBottomDrawerId ? [activeGlobalBottomDrawerId] : []}>\n <AppLayoutBottomDrawerWrapper widgetizedState={appLayoutState.widgetizedState} />\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {splitPanelPosition === 'side' && (\n <div\n className={clsx(\n styles['split-panel-side'],\n !splitPanelOpen && styles['panel-hidden'],\n drawerExpandedMode && styles.hidden\n )}\n >\n <AppLayoutSplitPanelSide\n appLayoutInternals={appLayoutState.appLayoutInternals}\n splitPanelInternals={appLayoutState.splitPanelInternals}\n bottomDrawerReportedSize={bottomDrawerReportedSize}\n >\n {appLayoutProps.splitPanel}\n </AppLayoutSplitPanelSide>\n </div>\n )}\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"tools\">\n <div\n className={clsx(\n styles.tools,\n !toolsOpen && styles['panel-hidden'],\n sharedStyles['with-motion-horizontal'],\n navigationOpen && !toolsOpen && styles['unfocusable-mobile'],\n toolsOpen && styles['tools-open'],\n drawerExpandedMode && styles.hidden\n )}\n >\n {drawers && drawers.length > 0 && (\n <AppLayoutDrawer\n appLayoutInternals={appLayoutState.appLayoutInternals}\n bottomDrawerReportedSize={activeGlobalBottomDrawerId ? bottomDrawerReportedSize : 0}\n />\n )}\n </div>\n </AppLayoutBuiltInErrorBoundary>\n <div className={clsx(styles['global-tools'], !globalToolsOpen && styles['panel-hidden'])}>\n <ActiveDrawersContext.Provider value={activeGlobalDrawersIds ?? []}>\n <AppLayoutGlobalDrawers appLayoutInternals={appLayoutState.appLayoutInternals} />\n </ActiveDrawersContext.Provider>\n </div>\n </>\n );\n};\n\nexport const AfterMainSlotImplementation = (props: SkeletonPartProps) => (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"after-main-slot\">\n <AfterMainSlotImplementationInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n);\n\nexport const createWidgetizedAppLayoutAfterMainSlot = createWidgetizedComponent(AfterMainSlotImplementation);\n"]}
@@ -48,10 +48,10 @@ export const BeforeMainSlotImplementationInternal = ({ toolbarProps, appLayoutSt
48
48
  setExpandedDrawerId,
49
49
  } })))))),
50
50
  navigation && (React.createElement("div", { className: clsx(styles.navigation, !navigationOpen && styles['panel-hidden'], toolsOpen && styles['unfocusable-mobile'], !navigationAnimationDisabled && sharedStyles['with-motion-horizontal'], (drawerExpandedMode || drawerExpandedModeInChildLayout) && styles.hidden) },
51
- React.createElement(AppLayoutBuiltInErrorBoundary, null,
51
+ React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "nav" },
52
52
  React.createElement(AppLayoutNavigation, { appLayoutInternals: appLayoutState.appLayoutInternals, bottomDrawerReportedSize: bottomDrawerReportedSize }))))));
53
53
  };
54
- export const BeforeMainSlotImplementation = (props) => (React.createElement(AppLayoutBuiltInErrorBoundary, null,
54
+ export const BeforeMainSlotImplementation = (props) => (React.createElement(AppLayoutBuiltInErrorBoundary, { appLayoutPart: "before-main-slot" },
55
55
  React.createElement(BeforeMainSlotImplementationInternal, { ...props })));
56
56
  export const createWidgetizedAppLayoutBeforeMainSlot = createWidgetizedComponent(BeforeMainSlotImplementation, BeforeMainSlotSkeleton);
57
57
  //# sourceMappingURL=before-main-slot.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"before-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.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,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC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AR,QAAQ,GAAI,IAAI,EAChC,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,aAAa,EAAE;wBACb,kBAAkB,EAAE,kBAAmB;wBACvC,eAAe,EAAE,eAAgB;wBACjC,eAAe,EAAE,eAAgB;wBACjC,QAAQ,EAAE,QAAS;wBACnB,UAAU;wBACV,oBAAoB;wBACpB,QAAQ;wBACR,gBAAgB;wBAChB,sBAAsB;wBACtB,oBAAoB,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC;wBAChE,gBAAgB;wBAChB,mBAAmB;qBACpB,GACD,CACD,CACJ,CAC6B,CAC5B,CACP;QACA,UAAU,IAAI,CACb,6BACE,SAAS,EAAE,IAAI,CACb,MAAM,CAAC,UAAU,EACjB,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,CAAC,EACzC,SAAS,IAAI,MAAM,CAAC,oBAAoB,CAAC,EACzC,CAAC,2BAA2B,IAAI,YAAY,CAAC,wBAAwB,CAAC,EACtE,CAAC,kBAAkB,IAAI,+BAA+B,CAAC,IAAI,MAAM,CAAC,MAAM,CACzE;YAED,oBAAC,6BAA6B;gBAC5B,oBAAC,mBAAmB,IAClB,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,wBAAwB,EAAE,wBAAwB,GAClD,CAC4B,CAC5B,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACxE,oBAAC,6BAA6B;IAC5B,oBAAC,oCAAoC,OAAK,KAAK,GAAI,CACrB,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAC9E,4BAA4B,EAC5B,sBAAsB,CACvB,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 { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport { AppLayoutGlobalAiDrawerImplementation } from '../drawer/global-ai-drawer';\nimport { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../navigation';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { BeforeMainSlotSkeleton } from '../skeleton/skeleton-parts';\nimport { isWidgetReady } from '../state/invariants';\nimport { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../toolbar';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const BeforeMainSlotImplementationInternal = ({\n toolbarProps,\n appLayoutState,\n appLayoutProps,\n}: SkeletonPartProps) => {\n const wasAiDrawerOpenRef = useRef(false);\n if (!isWidgetReady(appLayoutState)) {\n return (\n <BeforeMainSlotSkeleton\n toolbarProps={toolbarProps}\n appLayoutProps={appLayoutProps}\n appLayoutState={appLayoutState}\n />\n );\n }\n const {\n activeDrawer,\n navigationOpen,\n navigation,\n expandedDrawerId,\n setExpandedDrawerId,\n navigationAnimationDisabled,\n activeAiDrawerId,\n aiDrawerExpandedMode,\n aiDrawer,\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n onActiveAiDrawerResize,\n aiDrawerFocusControl,\n ariaLabels,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n activeAiDrawer,\n bottomDrawerReportedSize,\n featureNotificationsProps,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n // Must use `toolbarProps` because all layouts have to apply this mode, not just the one with toolbar\n const drawerExpandedModeInChildLayout = !!toolbarProps?.expandedDrawerId;\n const { __embeddedViewMode: embeddedViewMode } = appLayoutProps as any;\n return (\n <>\n {!!toolbarProps && !embeddedViewMode && !aiDrawerExpandedMode && (\n <AppLayoutToolbar\n appLayoutInternals={appLayoutState.appLayoutInternals}\n toolbarProps={toolbarProps}\n featureNotificationsProps={featureNotificationsProps}\n />\n )}\n {!toolbarProps && !!activeAiDrawerId && (\n <div\n className={styles['pseudo-toolbar']}\n style={{\n insetBlockStart: appLayoutState.appLayoutInternals?.verticalOffsets?.toolbar,\n }}\n >\n <div className={styles['pseudo-toolbar-content']} />\n </div>\n )}\n {aiDrawer && (\n <div\n className={clsx(\n styles['ai-drawer'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && !aiDrawerExpandedMode && styles.hidden\n )}\n >\n <ActiveDrawersContext.Provider value={activeAiDrawer ? [activeAiDrawer.id] : []}>\n {(!!activeAiDrawerId || (aiDrawer?.preserveInactiveContent && wasAiDrawerOpenRef.current)) && (\n <>\n {(wasAiDrawerOpenRef.current = true)}\n <AppLayoutGlobalAiDrawerImplementation\n show={!!activeAiDrawerId}\n activeAiDrawer={aiDrawer ?? null}\n appLayoutInternals={appLayoutState.appLayoutInternals}\n aiDrawerProps={{\n activeAiDrawerSize: activeAiDrawerSize!,\n minAiDrawerSize: minAiDrawerSize!,\n maxAiDrawerSize: maxAiDrawerSize!,\n aiDrawer: aiDrawer!,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize: ({ size }) => onActiveAiDrawerResize(size),\n expandedDrawerId,\n setExpandedDrawerId,\n }}\n />\n </>\n )}\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {navigation && (\n <div\n className={clsx(\n styles.navigation,\n !navigationOpen && styles['panel-hidden'],\n toolsOpen && styles['unfocusable-mobile'],\n !navigationAnimationDisabled && sharedStyles['with-motion-horizontal'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && styles.hidden\n )}\n >\n <AppLayoutBuiltInErrorBoundary>\n <AppLayoutNavigation\n appLayoutInternals={appLayoutState.appLayoutInternals}\n bottomDrawerReportedSize={bottomDrawerReportedSize}\n />\n </AppLayoutBuiltInErrorBoundary>\n </div>\n )}\n </>\n );\n};\n\nexport const BeforeMainSlotImplementation = (props: SkeletonPartProps) => (\n <AppLayoutBuiltInErrorBoundary>\n <BeforeMainSlotImplementationInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n);\n\nexport const createWidgetizedAppLayoutBeforeMainSlot = createWidgetizedComponent(\n BeforeMainSlotImplementation,\n BeforeMainSlotSkeleton\n);\n"]}
1
+ {"version":3,"file":"before-main-slot.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.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,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,qCAAqC,EAAE,MAAM,4BAA4B,CAAC;AACnF,OAAO,EAAE,iCAAiC,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,8BAA8B,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,YAAY,MAAM,4BAA4B,CAAC;AACtD,OAAO,MAAM,MAAM,2BAA2B,CAAC;AAE/C,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,EACnD,YAAY,EACZ,cAAc,EACd,cAAc,GACI,EAAE,EAAE;;IACtB,MAAM,kBAAkB,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE,CAAC;QAC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B,CAAC,EACtE,CAAC,kBAAkB,IAAI,+BAA+B,CAAC,IAAI,MAAM,CAAC,MAAM,CACzE;YAED,oBAAC,6BAA6B,IAAC,aAAa,EAAC,KAAK;gBAChD,oBAAC,mBAAmB,IAClB,kBAAkB,EAAE,cAAc,CAAC,kBAAkB,EACrD,wBAAwB,EAAE,wBAAwB,GAClD,CAC4B,CAC5B,CACP,CACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,KAAwB,EAAE,EAAE,CAAC,CACxE,oBAAC,6BAA6B,IAAC,aAAa,EAAC,kBAAkB;IAC7D,oBAAC,oCAAoC,OAAK,KAAK,GAAI,CACrB,CACjC,CAAC;AAEF,MAAM,CAAC,MAAM,uCAAuC,GAAG,yBAAyB,CAC9E,4BAA4B,EAC5B,sBAAsB,CACvB,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 { AppLayoutBuiltInErrorBoundary } from '../../../error-boundary/internal';\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { ActiveDrawersContext } from '../../utils/visibility-context';\nimport { AppLayoutGlobalAiDrawerImplementation } from '../drawer/global-ai-drawer';\nimport { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../navigation';\nimport { SkeletonPartProps } from '../skeleton/interfaces';\nimport { BeforeMainSlotSkeleton } from '../skeleton/skeleton-parts';\nimport { isWidgetReady } from '../state/invariants';\nimport { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../toolbar';\n\nimport sharedStyles from '../../resize/styles.css.js';\nimport styles from '../skeleton/styles.css.js';\n\nexport const BeforeMainSlotImplementationInternal = ({\n toolbarProps,\n appLayoutState,\n appLayoutProps,\n}: SkeletonPartProps) => {\n const wasAiDrawerOpenRef = useRef(false);\n if (!isWidgetReady(appLayoutState)) {\n return (\n <BeforeMainSlotSkeleton\n toolbarProps={toolbarProps}\n appLayoutProps={appLayoutProps}\n appLayoutState={appLayoutState}\n />\n );\n }\n const {\n activeDrawer,\n navigationOpen,\n navigation,\n expandedDrawerId,\n setExpandedDrawerId,\n navigationAnimationDisabled,\n activeAiDrawerId,\n aiDrawerExpandedMode,\n aiDrawer,\n activeAiDrawerSize,\n minAiDrawerSize,\n maxAiDrawerSize,\n onActiveAiDrawerResize,\n aiDrawerFocusControl,\n ariaLabels,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n activeAiDrawer,\n bottomDrawerReportedSize,\n featureNotificationsProps,\n } = appLayoutState.widgetizedState;\n const drawerExpandedMode = !!expandedDrawerId;\n const toolsOpen = !!activeDrawer;\n // Must use `toolbarProps` because all layouts have to apply this mode, not just the one with toolbar\n const drawerExpandedModeInChildLayout = !!toolbarProps?.expandedDrawerId;\n const { __embeddedViewMode: embeddedViewMode } = appLayoutProps as any;\n return (\n <>\n {!!toolbarProps && !embeddedViewMode && !aiDrawerExpandedMode && (\n <AppLayoutToolbar\n appLayoutInternals={appLayoutState.appLayoutInternals}\n toolbarProps={toolbarProps}\n featureNotificationsProps={featureNotificationsProps}\n />\n )}\n {!toolbarProps && !!activeAiDrawerId && (\n <div\n className={styles['pseudo-toolbar']}\n style={{\n insetBlockStart: appLayoutState.appLayoutInternals?.verticalOffsets?.toolbar,\n }}\n >\n <div className={styles['pseudo-toolbar-content']} />\n </div>\n )}\n {aiDrawer && (\n <div\n className={clsx(\n styles['ai-drawer'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && !aiDrawerExpandedMode && styles.hidden\n )}\n >\n <ActiveDrawersContext.Provider value={activeAiDrawer ? [activeAiDrawer.id] : []}>\n {(!!activeAiDrawerId || (aiDrawer?.preserveInactiveContent && wasAiDrawerOpenRef.current)) && (\n <>\n {(wasAiDrawerOpenRef.current = true)}\n <AppLayoutGlobalAiDrawerImplementation\n show={!!activeAiDrawerId}\n activeAiDrawer={aiDrawer ?? null}\n appLayoutInternals={appLayoutState.appLayoutInternals}\n aiDrawerProps={{\n activeAiDrawerSize: activeAiDrawerSize!,\n minAiDrawerSize: minAiDrawerSize!,\n maxAiDrawerSize: maxAiDrawerSize!,\n aiDrawer: aiDrawer!,\n ariaLabels,\n aiDrawerFocusControl,\n isMobile,\n drawersOpenQueue,\n onActiveAiDrawerChange,\n onActiveDrawerResize: ({ size }) => onActiveAiDrawerResize(size),\n expandedDrawerId,\n setExpandedDrawerId,\n }}\n />\n </>\n )}\n </ActiveDrawersContext.Provider>\n </div>\n )}\n {navigation && (\n <div\n className={clsx(\n styles.navigation,\n !navigationOpen && styles['panel-hidden'],\n toolsOpen && styles['unfocusable-mobile'],\n !navigationAnimationDisabled && sharedStyles['with-motion-horizontal'],\n (drawerExpandedMode || drawerExpandedModeInChildLayout) && styles.hidden\n )}\n >\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"nav\">\n <AppLayoutNavigation\n appLayoutInternals={appLayoutState.appLayoutInternals}\n bottomDrawerReportedSize={bottomDrawerReportedSize}\n />\n </AppLayoutBuiltInErrorBoundary>\n </div>\n )}\n </>\n );\n};\n\nexport const BeforeMainSlotImplementation = (props: SkeletonPartProps) => (\n <AppLayoutBuiltInErrorBoundary appLayoutPart=\"before-main-slot\">\n <BeforeMainSlotImplementationInternal {...props} />\n </AppLayoutBuiltInErrorBoundary>\n);\n\nexport const createWidgetizedAppLayoutBeforeMainSlot = createWidgetizedComponent(\n BeforeMainSlotImplementation,\n BeforeMainSlotSkeleton\n);\n"]}