diff --git a/src/app-layout/__tests__/__snapshots__/widget-contract-split-panel.test.tsx.snap b/src/app-layout/__tests__/__snapshots__/widget-contract-split-panel.test.tsx.snap index ae87427ab1..63db2163b7 100644 --- a/src/app-layout/__tests__/__snapshots__/widget-contract-split-panel.test.tsx.snap +++ b/src/app-layout/__tests__/__snapshots__/widget-contract-split-panel.test.tsx.snap @@ -3,12 +3,41 @@ exports[`Theme=refresh-toolbar, Size=desktop contract with split panel (trigger is hidden) 1`] = ` Map { [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "children": [Function], + "forwardRef": null, + "node": undefined, + "props": { + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + }, + [Function] => { + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -21,8 +50,154 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setFocus": [Function], + }, + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", + }, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel67", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": false, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, "drawers": [ { "ariaLabels": { @@ -38,71 +213,28 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": "__JSX__", - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel64", - "splitPanelFocusControl": { + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -114,16 +246,57 @@ Map { "current": null, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -131,14 +304,39 @@ Map { "toolbar": 0, }, }, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, + }, + }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", + }, + }, + }, }, [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -151,8 +349,154 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setFocus": [Function], + }, + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", + }, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel67", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": false, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, "drawers": [ { "ariaLabels": { @@ -168,13 +512,31 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, + "isMobile": false, + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { - "close": { - "current": { - "focus": [Function], - }, + "preferences": { + "current": null, }, "slider": { "current": null, @@ -183,43 +545,115 @@ Map { "current": null, }, }, - "setFocus": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", }, }, - "slider": { - "current": null, - }, - "toggle": "__JSX__", + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], + }, + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, }, - "setFocus": [Function], }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", + }, + }, + }, + }, + [Function] => { + "appLayoutProps": { + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], + "navigationWidth": 280, + "onNavigationChange": [Function], "placement": { "inlineSize": Infinity, "insetBlockEnd": 0, @@ -227,12 +661,178 @@ Map { "insetInlineEnd": 0, "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel64", - "splitPanelFocusControl": { + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setFocus": [Function], + }, + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", + }, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel67", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": false, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, + "isMobile": false, + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -244,16 +844,57 @@ Map { "current": null, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -261,36 +902,35 @@ Map { "toolbar": 0, }, }, - "children": "__JSX__", - "splitPanelInternals": { - "bottomOffset": 0, - "getMaxHeight": [Function], - "headerHeight": 0, - "isForcedPosition": false, - "isOpen": false, - "leftOffset": 0, - "maxWidth": Infinity, - "onPreferencesChange": [Function], - "onResize": [Function], - "onToggle": [Function], - "position": "bottom", - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, }, - "toggle": { - "current": null, + }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", }, }, - "reportHeaderHeight": [Function], - "reportSize": [Function], - "rightOffset": 0, - "setSplitPanelToggle": [Function], - "size": 0, - "topOffset": 0, }, }, [Function] => { @@ -315,12 +955,7 @@ Map { }, }, [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -333,75 +968,12 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": "__JSX__", - }, - "setFocus": [Function], - }, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], + "navigationWidth": 280, + "onNavigationChange": [Function], "placement": { "inlineSize": Infinity, "insetBlockEnd": 0, @@ -409,192 +981,141 @@ Map { "insetInlineEnd": 0, "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel64", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, + "splitPanel": "__JSX__", + "toolsWidth": 290, }, - }, - [Function] => { - "appLayoutInternals": { + "appLayoutState": { "activeDrawer": undefined, "activeDrawerSize": 290, - "activeGlobalDrawers": [], "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", }, }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, }, + "setFocus": [Function], }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", }, - "slider": { - "current": null, - }, - "toggle": "__JSX__", + "setFocus": [Function], }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel64", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel67", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": false, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, "drawers": [ { "ariaLabels": { @@ -610,71 +1131,28 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": "__JSX__", - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel64", - "splitPanelFocusControl": { + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -686,16 +1164,57 @@ Map { "current": null, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -703,43 +1222,35 @@ Map { "toolbar": 0, }, }, - "toolbarProps": { - "activeDrawerId": null, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, + }, }, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", }, - ], - "drawersFocusRef": { - "current": null, }, - "hasNavigation": true, - "navigationFocusRef": "__JSX__", - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onNavigationToggle": [Function], }, }, } @@ -748,12 +1259,10 @@ Map { exports[`Theme=refresh-toolbar, Size=desktop contract with split panel 1`] = ` Map { [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "children": [Function], + "forwardRef": null, + "node": undefined, + "props": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -766,77 +1275,12 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], + "navigationWidth": 280, + "onNavigationChange": [Function], "placement": { "inlineSize": Infinity, "insetBlockEnd": 0, @@ -844,50 +1288,12 @@ Map { "insetInlineEnd": 0, "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel27", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": { - "focus": [Function], - }, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": true, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, + "splitPanel": "__JSX__", + "toolsWidth": 290, }, }, [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -900,8 +1306,156 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setFocus": [Function], + }, + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", + }, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel29", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": { + "focus": [Function], + }, + }, + }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": true, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, "drawers": [ { "ariaLabels": { @@ -917,73 +1471,28 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel27", - "splitPanelFocusControl": { + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -997,16 +1506,71 @@ Map { }, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": true, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "hasSplitPanel": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "splitPanelFocusRef": { + "current": { + "focus": [Function], + }, + }, + "splitPanelToggleProps": { + "active": false, + "ariaLabel": undefined, + "controlId": "split-panel29", + "displayed": true, + "position": "bottom", + }, }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -1014,68 +1578,39 @@ Map { "toolbar": 0, }, }, - "children": "__JSX__", - "splitPanelInternals": { - "bottomOffset": 0, - "getMaxHeight": [Function], - "headerHeight": 0, - "isForcedPosition": false, - "isOpen": false, - "leftOffset": 0, - "maxWidth": Infinity, - "onPreferencesChange": [Function], - "onResize": [Function], - "onToggle": [Function], - "position": "bottom", - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, }, - "toggle": { - "current": { - "focus": [Function], - }, + }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", }, }, - "reportHeaderHeight": [Function], - "reportSize": [Function], - "rightOffset": 0, - "setSplitPanelToggle": [Function], - "size": 0, - "topOffset": 0, - }, - }, - [Function] => { - "__internalRootRef": { - "current": null, - }, - "children": "__JSX__", - "closeBehavior": "collapse", - "header": "Split panel header", - "hidePreferencesButton": false, - "i18nStrings": { - "closeButtonAriaLabel": undefined, - "openButtonAriaLabel": undefined, - "preferencesCancel": undefined, - "preferencesConfirm": undefined, - "preferencesPositionBottom": undefined, - "preferencesPositionDescription": undefined, - "preferencesPositionLabel": undefined, - "preferencesPositionSide": undefined, - "preferencesTitle": undefined, - "resizeHandleAriaLabel": undefined, }, }, [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -1088,90 +1623,193 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", }, }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, }, + "setFocus": [Function], }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel29", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": { + "focus": [Function], + }, + }, }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": true, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel27", - "splitPanelFocusControl": { + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, + "isMobile": false, + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -1185,16 +1823,71 @@ Map { }, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": true, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "hasSplitPanel": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "splitPanelFocusRef": { + "current": { + "focus": [Function], + }, + }, + "splitPanelToggleProps": { + "active": false, + "ariaLabel": undefined, + "controlId": "split-panel29", + "displayed": true, + "position": "bottom", + }, }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -1202,14 +1895,39 @@ Map { "toolbar": 0, }, }, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, + }, + }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", + }, + }, + }, }, [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -1222,8 +1940,156 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setFocus": [Function], + }, + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", + }, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel29", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": { + "focus": [Function], + }, + }, + }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": true, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, "drawers": [ { "ariaLabels": { @@ -1239,73 +2105,28 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel27", - "splitPanelFocusControl": { + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -1319,16 +2140,71 @@ Map { }, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": true, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "hasSplitPanel": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "splitPanelFocusRef": { + "current": { + "focus": [Function], + }, + }, + "splitPanelToggleProps": { + "active": false, + "ariaLabel": undefined, + "controlId": "split-panel29", + "displayed": true, + "position": "bottom", + }, }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -1336,14 +2212,60 @@ Map { "toolbar": 0, }, }, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, + }, + }, + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", + }, + }, + }, }, [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "__internalRootRef": { + "current": null, + }, + "children": "__JSX__", + "closeBehavior": "collapse", + "header": "Split panel header", + "hidePreferencesButton": false, + "i18nStrings": { + "closeButtonAriaLabel": undefined, + "openButtonAriaLabel": undefined, + "preferencesCancel": undefined, + "preferencesConfirm": undefined, + "preferencesPositionBottom": undefined, + "preferencesPositionDescription": undefined, + "preferencesPositionLabel": undefined, + "preferencesPositionSide": undefined, + "preferencesTitle": undefined, + "resizeHandleAriaLabel": undefined, + }, + }, + [Function] => { + "appLayoutProps": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -1356,8 +2278,156 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigationOpen": true, + "navigationWidth": 280, + "onNavigationChange": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "splitPanel": "__JSX__", + "toolsWidth": 290, + }, + "appLayoutState": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawersIds": [], + "appLayoutInternals": { + "activeDrawer": undefined, + "activeDrawerSize": 290, + "activeGlobalDrawers": [], + "activeGlobalDrawersIds": [], + "activeGlobalDrawersSizes": {}, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "breadcrumbs": undefined, + "discoveredBreadcrumbs": null, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": null, + }, + }, + "setFocus": [Function], + }, + "drawersOpenQueue": [], + "globalDrawers": [], + "globalDrawersFocusControl": { + "loseFocus": [Function], + "refs": {}, + "setFocus": [Function], + }, + "headerVariant": undefined, + "isMobile": false, + "maxDrawerSize": Infinity, + "maxGlobalDrawersSizes": {}, + "minDrawerSize": 290, + "minGlobalDrawersSizes": {}, + "navigation": "__JSX__", + "navigationFocusControl": { + "loseFocus": [Function], + "refs": { + "close": { + "current": { + "focus": [Function], + }, + }, + "slider": { + "current": null, + }, + "toggle": "__JSX__", + }, + "setFocus": [Function], + }, + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onActiveDrawerResize": [Function], + "onActiveGlobalDrawersChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "placement": { + "inlineSize": Infinity, + "insetBlockEnd": 0, + "insetBlockStart": 0, + "insetInlineEnd": 0, + "insetInlineStart": 0, + }, + "setNotificationsHeight": [Function], + "setToolbarHeight": [Function], + "setToolbarState": [Function], + "splitPanelAnimationDisabled": true, + "splitPanelControlId": "split-panel29", + "splitPanelFocusControl": { + "refs": { + "preferences": { + "current": null, + }, + "slider": { + "current": null, + }, + "toggle": { + "current": { + "focus": [Function], + }, + }, + }, + "setLastInteraction": [Function], + }, + "splitPanelOpen": false, + "splitPanelPosition": "bottom", + "splitPanelToggleConfig": { + "ariaLabel": undefined, + "displayed": true, + }, + "stickyNotifications": false, + "toolbarState": "show", + "verticalOffsets": { + "drawers": 0, + "header": 0, + "notifications": 0, + "toolbar": 0, + }, + }, "drawers": [ { "ariaLabels": { @@ -1373,73 +2443,28 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, + "hasToolbar": true, + "intersectionObserverRef": [Function], + "isIntersecting": true, "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": "__JSX__", - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": { - "focus": [Function], - }, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel27", - "splitPanelFocusControl": { + "isNested": false, + "navigationAnimationDisabled": true, + "registered": true, + "resolvedNavigation": "__JSX__", + "resolvedNavigationOpen": true, + "rootRef": [Function], + "splitPanelInternals": { + "bottomOffset": 0, + "getMaxHeight": [Function], + "headerHeight": 0, + "isForcedPosition": false, + "isOpen": false, + "leftOffset": 0, + "maxWidth": Infinity, + "onPreferencesChange": [Function], + "onResize": [Function], + "onToggle": [Function], + "position": "bottom", "refs": { "preferences": { "current": null, @@ -1453,16 +2478,71 @@ Map { }, }, }, - "setLastInteraction": [Function], + "reportHeaderHeight": [Function], + "reportSize": [Function], + "rightOffset": 0, + "setSplitPanelToggle": [Function], + "size": 0, + "topOffset": 0, + }, + "splitPanelOffsets": { + "mainContentPaddingBlockEnd": 0, + "stickyVerticalBottomOffset": 0, }, "splitPanelOpen": false, "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": true, + "toolbarProps": { + "activeDrawerId": null, + "ariaLabels": { + "drawers": undefined, + "drawersOverflow": undefined, + "drawersOverflowWithBadge": undefined, + "navigation": undefined, + "navigationClose": undefined, + "navigationToggle": undefined, + "notifications": undefined, + "tools": undefined, + "toolsClose": undefined, + "toolsToggle": undefined, + }, + "drawers": [ + { + "ariaLabels": { + "closeButton": undefined, + "drawerName": "", + "triggerButton": undefined, + }, + "content": undefined, + "id": "awsui-internal-tools", + "resizable": false, + "trigger": { + "iconName": "status-info", + }, + }, + ], + "drawersFocusRef": { + "current": null, + }, + "hasNavigation": true, + "hasSplitPanel": true, + "navigationFocusRef": "__JSX__", + "navigationOpen": true, + "onActiveDrawerChange": [Function], + "onNavigationToggle": [Function], + "onSplitPanelToggle": [Function], + "splitPanelFocusRef": { + "current": { + "focus": [Function], + }, + }, + "splitPanelToggleProps": { + "active": false, + "ariaLabel": undefined, + "controlId": "split-panel29", + "displayed": true, + "position": "bottom", + }, }, - "stickyNotifications": false, - "toolbarState": "show", "verticalOffsets": { "drawers": 0, "header": 0, @@ -1470,58 +2550,34 @@ Map { "toolbar": 0, }, }, - "toolbarProps": { - "activeDrawerId": null, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, + "skeletonSlotsAttributes": { + "contentElAttributes": { + "className": "awsui_content awsui_content", + }, + "contentHeaderElAttributes": { + "className": "awsui_content-header", + }, + "contentWrapperElAttributes": { + "className": "awsui_main", + "style": { + "--awsui-sticky-vertical-bottom-offset": "0px", + "--awsui-sticky-vertical-top-offset": "0px", + "minWidth": "280px", + "paddingBlockEnd": 0, }, - ], - "drawersFocusRef": { - "current": null, }, - "hasNavigation": true, - "hasSplitPanel": true, - "navigationFocusRef": { - "current": null, - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "splitPanelFocusRef": { - "current": { - "focus": [Function], - }, - }, - "splitPanelToggleProps": { - "active": false, - "ariaLabel": undefined, - "controlId": "split-panel27", - "displayed": true, - "position": "bottom", + "mainElAttributes": { + "className": "awsui_main-landmark", + }, + "wrapperElAttributes": { + "className": "awsui_root awsui_root awsui_has-adaptive-widths-default", + "ref": [Function], + "style": { + "--awsui-max-content-width-g964ok": "", + "--awsui-navigation-width-g964ok": "280px", + "--awsui-tools-width-g964ok": "290px", + "minBlockSize": "calc(100vh - 0px)", + }, }, }, }, diff --git a/src/app-layout/__tests__/__snapshots__/widget-contract.test.tsx.snap b/src/app-layout/__tests__/__snapshots__/widget-contract.test.tsx.snap index ce4f838b1a..14ca987185 100644 --- a/src/app-layout/__tests__/__snapshots__/widget-contract.test.tsx.snap +++ b/src/app-layout/__tests__/__snapshots__/widget-contract.test.tsx.snap @@ -3,12 +3,10 @@ exports[`Theme=refresh-toolbar, Size=desktop contract for default use-case 1`] = ` Map { [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "children": [Function], + "forwardRef": null, + "node": undefined, + "props": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -21,2012 +19,12 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel4", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel4", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "children": undefined, - "splitPanelInternals": { - "bottomOffset": 0, - "getMaxHeight": [Function], - "headerHeight": 0, - "isForcedPosition": false, - "isOpen": false, - "leftOffset": 0, - "maxWidth": Infinity, - "onPreferencesChange": [Function], - "onResize": [Function], - "onToggle": [Function], - "position": "bottom", - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "reportHeaderHeight": [Function], - "reportSize": [Function], - "rightOffset": 0, - "setSplitPanelToggle": [Function], - "size": 0, - "topOffset": 0, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel4", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel4", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel4", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "toolbarProps": { - "activeDrawerId": null, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content": undefined, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusRef": { - "current": null, - }, - "hasNavigation": true, - "navigationFocusRef": { - "current": null, - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onNavigationToggle": [Function], - }, - }, -} -`; - -exports[`Theme=refresh-toolbar, Size=desktop contract with all slots provided 1`] = ` -Map { - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs":
- breadcrumbs -
, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation":
- navigation -
, - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel6", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs":
- breadcrumbs -
, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation":
- navigation -
, - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel6", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "children":
- notifications -
, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs":
- breadcrumbs -
, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation":
- navigation -
, - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel6", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "children":
- split panel -
, - "splitPanelInternals": { - "bottomOffset": 0, - "getMaxHeight": [Function], - "headerHeight": 0, - "isForcedPosition": false, - "isOpen": false, - "leftOffset": 0, - "maxWidth": Infinity, - "onPreferencesChange": [Function], - "onResize": [Function], - "onToggle": [Function], - "position": "bottom", - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "reportHeaderHeight": [Function], - "reportSize": [Function], - "rightOffset": 0, - "setSplitPanelToggle": [Function], - "size": 0, - "topOffset": 0, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs":
- breadcrumbs -
, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation":
- navigation -
, - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel6", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs":
- breadcrumbs -
, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation":
- navigation -
, - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel6", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": undefined, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs":
- breadcrumbs -
, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation":
- navigation -
, - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel6", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "toolbarProps": { - "activeDrawerId": null, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "drawers": [ - { - "ariaLabels": { - "closeButton": undefined, - "drawerName": "", - "triggerButton": undefined, - }, - "content":
- tools -
, - "id": "awsui-internal-tools", - "resizable": false, - "trigger": { - "iconName": "status-info", - }, - }, - ], - "drawersFocusRef": { - "current": null, - }, - "hasBreadcrumbsPortal": true, - "hasNavigation": true, - "navigationFocusRef": { - "current": null, - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onNavigationToggle": [Function], - }, - }, -} -`; - -exports[`Theme=refresh-toolbar, Size=desktop contract with drawers 1`] = ` -Map { - [Function] => { - "appLayoutInternals": { - "activeDrawer": { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel8", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], - "placement": { - "inlineSize": Infinity, - "insetBlockEnd": 0, - "insetBlockStart": 0, - "insetInlineEnd": 0, - "insetInlineStart": 0, - }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel8", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "children": undefined, - "splitPanelInternals": { - "bottomOffset": 0, - "getMaxHeight": [Function], - "headerHeight": 0, - "isForcedPosition": false, - "isOpen": false, - "leftOffset": 0, - "maxWidth": Infinity, - "onPreferencesChange": [Function], - "onResize": [Function], - "onToggle": [Function], - "position": "bottom", - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "reportHeaderHeight": [Function], - "reportSize": [Function], - "rightOffset": 0, - "setSplitPanelToggle": [Function], - "size": 0, - "topOffset": 0, - }, - }, - [Function] => { - "appLayoutInternals": { - "activeDrawer": { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], + "navigationWidth": 280, + "onNavigationChange": [Function], "placement": { "inlineSize": Infinity, "insetBlockEnd": 0, @@ -2034,62 +32,19 @@ Map { "insetInlineEnd": 0, "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel8", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, + "toolsWidth": 290, }, }, +} +`; + +exports[`Theme=refresh-toolbar, Size=desktop contract with all slots provided 1`] = ` +Map { [Function] => { - "appLayoutInternals": { - "activeDrawer": { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "children": [Function], + "forwardRef": null, + "node": undefined, + "props": { "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -2102,75 +57,24 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, - "drawers": [ - { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, + "breadcrumbs":
+ breadcrumbs +
, + "content":
+ content +
, + "contentType": "default", + "maxContentWidth": undefined, + "minContentWidth": 280, + "navigation":
+ navigation +
, "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], + "navigationWidth": 280, + "notifications":
+ notifications +
, + "onNavigationChange": [Function], "placement": { "inlineSize": Infinity, "insetBlockEnd": 0, @@ -2178,62 +82,26 @@ Map { "insetInlineEnd": 0, "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel8", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, + "splitPanel":
+ split panel +
, + "tools":
+ tools +
, + "toolsWidth": 290, }, }, +} +`; + +exports[`Theme=refresh-toolbar, Size=desktop contract with drawers 1`] = ` +Map { [Function] => { - "appLayoutInternals": { - "activeDrawer": { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - "activeDrawerSize": 290, - "activeGlobalDrawers": [], - "activeGlobalDrawersIds": [], - "activeGlobalDrawersSizes": {}, + "children": [Function], + "forwardRef": null, + "node": undefined, + "props": { + "activeDrawerId": "security", "ariaLabels": { "drawers": undefined, "drawersOverflow": undefined, @@ -2246,8 +114,7 @@ Map { "toolsClose": undefined, "toolsToggle": undefined, }, - "breadcrumbs": undefined, - "discoveredBreadcrumbs": null, + "contentType": "default", "drawers": [ { "ariaLabels": { @@ -2265,56 +132,12 @@ Map { }, }, ], - "drawersFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, - "drawersOpenQueue": [], - "globalDrawers": [], - "globalDrawersFocusControl": { - "loseFocus": [Function], - "refs": {}, - "setFocus": [Function], - }, - "headerVariant": undefined, - "isMobile": false, - "maxDrawerSize": Infinity, - "maxGlobalDrawersSizes": {}, - "minDrawerSize": 290, - "minGlobalDrawersSizes": {}, - "navigation": , - "navigationFocusControl": { - "loseFocus": [Function], - "refs": { - "close": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setFocus": [Function], - }, + "maxContentWidth": undefined, + "minContentWidth": 280, "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onActiveDrawerResize": [Function], - "onActiveGlobalDrawersChange": [Function], - "onNavigationToggle": [Function], - "onSplitPanelToggle": [Function], + "navigationWidth": 280, + "onDrawerChange": [Function], + "onNavigationChange": [Function], "placement": { "inlineSize": Infinity, "insetBlockEnd": 0, @@ -2322,81 +145,7 @@ Map { "insetInlineEnd": 0, "insetInlineStart": 0, }, - "setNotificationsHeight": [Function], - "setToolbarHeight": [Function], - "setToolbarState": [Function], - "splitPanelAnimationDisabled": true, - "splitPanelControlId": "split-panel8", - "splitPanelFocusControl": { - "refs": { - "preferences": { - "current": null, - }, - "slider": { - "current": null, - }, - "toggle": { - "current": null, - }, - }, - "setLastInteraction": [Function], - }, - "splitPanelOpen": false, - "splitPanelPosition": "bottom", - "splitPanelToggleConfig": { - "ariaLabel": undefined, - "displayed": false, - }, - "stickyNotifications": false, - "toolbarState": "show", - "verticalOffsets": { - "drawers": 0, - "header": 0, - "notifications": 0, - "toolbar": 0, - }, - }, - "toolbarProps": { - "activeDrawerId": "security", - "ariaLabels": { - "drawers": undefined, - "drawersOverflow": undefined, - "drawersOverflowWithBadge": undefined, - "navigation": undefined, - "navigationClose": undefined, - "navigationToggle": undefined, - "notifications": undefined, - "tools": undefined, - "toolsClose": undefined, - "toolsToggle": undefined, - }, - "drawers": [ - { - "ariaLabels": { - "closeButton": "Security close button", - "drawerName": "Security drawer content", - "resizeHandle": "Security resize handle", - "triggerButton": "Security trigger button", - }, - "content": - Security - , - "id": "security", - "trigger": { - "iconName": "security", - }, - }, - ], - "drawersFocusRef": { - "current": null, - }, - "hasNavigation": true, - "navigationFocusRef": { - "current": null, - }, - "navigationOpen": true, - "onActiveDrawerChange": [Function], - "onNavigationToggle": [Function], + "toolsWidth": 290, }, }, } diff --git a/src/app-layout/__tests__/app-layout.ssr.test.tsx b/src/app-layout/__tests__/app-layout.ssr.test.tsx index 908815bcc9..3a00aac541 100644 --- a/src/app-layout/__tests__/app-layout.ssr.test.tsx +++ b/src/app-layout/__tests__/app-layout.ssr.test.tsx @@ -13,7 +13,6 @@ import AppLayout from '../../../lib/components/app-layout'; import classicStyles from '../../../lib/components/app-layout/styles.selectors.js'; import refreshStyles from '../../../lib/components/app-layout/visual-refresh/styles.selectors.js'; -import refreshToolbarStyles from '../../../lib/components/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js'; const globalWithFlags = globalThis as any; @@ -36,11 +35,11 @@ test('should render refresh-toolbar app layout with the widget flag', () => { globalWithFlags[Symbol.for('awsui-visual-refresh-flag')] = () => true; globalWithFlags[Symbol.for('awsui-global-flags')] = { appLayoutWidget: true }; const content = renderToStaticMarkup(); - expect(content).toContain(refreshToolbarStyles.root); + expect(content).toBe('
'); }); test('should render refresh-toolbar app layout with the toolbar flag', () => { globalWithFlags[Symbol.for('awsui-visual-refresh-flag')] = () => true; globalWithFlags[Symbol.for('awsui-global-flags')] = { appLayoutToolbar: true }; const content = renderToStaticMarkup(); - expect(content).toContain(refreshToolbarStyles.root); + expect(content).toBe('
'); }); diff --git a/src/app-layout/__tests__/reverse-portal.test.tsx b/src/app-layout/__tests__/reverse-portal.test.tsx new file mode 100644 index 0000000000..95115f0baa --- /dev/null +++ b/src/app-layout/__tests__/reverse-portal.test.tsx @@ -0,0 +1,332 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React, { useState } from 'react'; +import { act, fireEvent, render, screen } from '@testing-library/react'; + +import { createHtmlPortalNode, InPortal, OutPortal } from '../visual-refresh-toolbar/reverse-portal'; + +describe('Reverse portal', () => { + const TestContent = ({ onClick = () => {} }) => ( +
+ Test Content +
+ ); + + it('should render content in InPortal and display it in OutPortal', () => { + const portalNode = createHtmlPortalNode({ containerElement: 'section' }); + + render( + <> + + + + + + ); + + expect(screen.getByTestId('test-content')).toBeInTheDocument(); + }); + + it('should not have multiple OutPortal instances with same node', () => { + const portalNode = createHtmlPortalNode(); + + render( + <> + + + +
+ +
+
+ +
+ + ); + + const instances = screen.getAllByText('Test Content'); + expect(instances).toHaveLength(1); + }); + + it('should work with useMemo hook', () => { + const PortalComponent = () => { + const portalNode = React.useMemo(() => createHtmlPortalNode(), []); + + return ( + <> + + + + + + ); + }; + + render(); + expect(screen.getByTestId('test-content')).toBeInTheDocument(); + }); + + it('should handle conditional rendering of OutPortal', () => { + const portalNode = createHtmlPortalNode(); + + const PortalWrapper = ({ showFirst = true }) => ( + <> + + + + {showFirst ? ( +
+ +
+ ) : ( +
+ +
+ )} + + ); + + const { rerender } = render(); + expect(screen.getByTestId('first-container')).toBeInTheDocument(); + + rerender(); + expect(screen.getByTestId('second-container')).toBeInTheDocument(); + }); + + it('should handle click events correctly', () => { + const handleClick = jest.fn(); + const portalNode = createHtmlPortalNode(); + + render( +
+ + + + +
+ ); + + const element = screen.getByTestId('test-content'); + fireEvent.click(element); + expect(handleClick).toHaveBeenCalled(); + }); + + it('should handle keyboard events', () => { + const handleKeyDown = jest.fn(); + const portalNode = createHtmlPortalNode(); + + render( +
+ + + + +
+ ); + + const input = screen.getByTestId('test-input'); + fireEvent.keyDown(input, { key: 'Enter', code: 'Enter' }); + expect(handleKeyDown).toHaveBeenCalled(); + }); + + it('should update portal content when props change', () => { + const portalNode = createHtmlPortalNode(); + + const PortalContent = ({ text }: { text: string }) =>
{text}
; + + const { rerender } = render( + <> + + + + + + ); + + expect(screen.getByText('Initial')).toBeInTheDocument(); + + rerender( + <> + + + + + + ); + + expect(screen.getByText('Updated')).toBeInTheDocument(); + }); + + it('should handle missing portal node gracefully', () => { + const consoleError = jest.spyOn(console, 'error').mockImplementation(() => {}); + + expect(() => { + render(); + }).not.toThrow(); + + consoleError.mockRestore(); + }); + + it('should handle rapid state updates', () => { + const portalNode = createHtmlPortalNode(); + + const RapidUpdateComponent = () => { + const [count, setCount] = React.useState(0); + + const handleClick = () => { + setCount(c => c + 1); + setCount(c => c + 1); + setCount(c => c + 1); + }; + + return ( + <> + + + + + + ); + }; + + render(); + const button = screen.getByTestId('update-button'); + + act(() => { + fireEvent.click(button); + }); + + expect(button.textContent).toBe('Count: 3'); + }); + + it('should clean up properly on unmount', () => { + const portalNode = createHtmlPortalNode(); + const { unmount } = render( + <> + + + + + + ); + + unmount(); + expect(document.body.innerHTML).not.toContain('test-content'); + }); + + it('should handle unmounting and remounting without errors', () => { + const portalNode = createHtmlPortalNode(); + + const { unmount, rerender } = render( + <> + + + + + + ); + + unmount(); + + expect(() => { + rerender( + <> + + + + + + ); + }).not.toThrow(); + }); + + it('should set multiple attributes on element creation', () => { + const attributes = { + 'data-testid': 'test-portal', + 'aria-label': 'Test Portal', + class: 'portal-class', + role: 'dialog', + }; + + const portalNode = createHtmlPortalNode({ + attributes, + }); + + for (const [key, value] of Object.entries(attributes)) { + expect(portalNode.element.getAttribute(key)).toBe(value); + } + }); + + it('should handle same placeholder mount attempts', () => { + const portalNode = createHtmlPortalNode(); + const parent = document.createElement('div'); + const placeholder = document.createElement('div'); + + parent.appendChild(placeholder); + document.body.appendChild(parent); + + portalNode.mount(parent, placeholder); + const firstMountParent = portalNode.element.parentNode; + + portalNode.mount(parent, placeholder); + const secondMountParent = portalNode.element.parentNode; + + expect(firstMountParent).toBe(secondMountParent); + + document.body.removeChild(parent); + }); + + it('should handle undefined node', () => { + expect(() => { + render( + +
Content
+
+ ); + }).not.toThrow(); + }); + + it('should handle non-React children correctly', () => { + const portalNode = createHtmlPortalNode(); + + const { container } = render( + <> + 123 + + + ); + + expect(container.textContent).toContain('123'); + }); + + it('should maintain props when switching portal nodes', () => { + const TestComponent = ({ count }: { count: number }) =>
Count: {count}
; + + const WrapperComponent = () => { + const [isNodesSwapped, setIsNodesSwapped] = useState(false); + const firstNode = createHtmlPortalNode(); + const secondNode = createHtmlPortalNode(); + return ( + <> + + + + +
+ +
+ + ); + }; + + const { container } = render(); + + expect(container.textContent).toContain('Count: 1'); + screen.getByTestId('button').click(); + expect(container.textContent).toContain('Count: 1'); + }); +}); diff --git a/src/app-layout/__tests__/skeleton.test.tsx b/src/app-layout/__tests__/skeleton.test.tsx index acf0073342..c24d51f99a 100644 --- a/src/app-layout/__tests__/skeleton.test.tsx +++ b/src/app-layout/__tests__/skeleton.test.tsx @@ -4,7 +4,6 @@ import React from 'react'; import AppLayout from '../../../lib/components/app-layout'; import BreadcrumbGroup from '../../../lib/components/breadcrumb-group'; -import { getFunnelKeySelector } from '../../internal/analytics/selectors'; import { describeEachAppLayout, renderComponent } from './utils'; let widgetMockEnabled = false; @@ -26,7 +25,7 @@ jest.mock('../../../lib/components/internal/widgets', () => ({ createWidgetizedComponent: createWidgetizedComponentMock, })); -describeEachAppLayout({ themes: ['refresh-toolbar'] }, () => { +describeEachAppLayout({ themes: ['refresh-toolbar'], skipInitialTest: true }, () => { it('renders complete component by default', () => { const { wrapper } = renderComponent( { expect(wrapper.findToolbar()).toBeTruthy(); expect(wrapper.findNavigation()).toBeTruthy(); expect(wrapper.findBreadcrumbs()).toBeTruthy(); - expect(wrapper.find(getFunnelKeySelector('funnel-name'))).toBeTruthy(); expect(wrapper.findNotifications()).toBeTruthy(); expect(wrapper.findTools()).toBeTruthy(); expect(wrapper.findContentRegion()).toBeTruthy(); @@ -65,7 +63,6 @@ describeEachAppLayout({ themes: ['refresh-toolbar'] }, () => { expect(wrapper.findToolbar()).toBeFalsy(); expect(wrapper.findNavigation()).toBeFalsy(); expect(wrapper.findBreadcrumbs()).toBeFalsy(); - expect(wrapper.find(getFunnelKeySelector('funnel-name'))).toBeTruthy(); expect(wrapper.findNotifications()).toBeFalsy(); expect(wrapper.findTools()).toBeFalsy(); expect(wrapper.findContentRegion()).toBeTruthy(); diff --git a/src/app-layout/__tests__/utils.tsx b/src/app-layout/__tests__/utils.tsx index 24963823ad..fbd3d59f50 100644 --- a/src/app-layout/__tests__/utils.tsx +++ b/src/app-layout/__tests__/utils.tsx @@ -31,6 +31,7 @@ type Size = 'desktop' | 'mobile'; interface AppLayoutTestConfig { themes: Array; sizes: Array; + skipInitialTest?: boolean; } type AppLayoutTestSuite = (config: { theme: Theme; size: Size }) => void; @@ -38,6 +39,7 @@ type AppLayoutTestSuite = (config: { theme: Theme; size: Size }) => void; const defaultTestConfig: AppLayoutTestConfig = { themes: ['classic', 'refresh', 'refresh-toolbar'], sizes: ['desktop', 'mobile'], + skipInitialTest: false, }; const globalWithFlags = globalThis as any; @@ -64,7 +66,7 @@ export function describeEachAppLayout( setGlobalFlag('appLayoutWidget', undefined); clearVisualRefreshState(); }); - test('mocks applied correctly', () => { + (config.skipInitialTest ? test.skip : test)('mocks applied correctly', () => { const { wrapper } = renderComponent(); expect(!!wrapper.matches(`.${visualRefreshStyles.layout}`)).toEqual(theme === 'refresh'); expect(!!wrapper.matches(`.${visualRefreshToolbarStyles.root}`)).toEqual(theme === 'refresh-toolbar'); diff --git a/src/app-layout/__tests__/widget-contract-split-panel.test.tsx b/src/app-layout/__tests__/widget-contract-split-panel.test.tsx index e078a5a2ed..3e1376776d 100644 --- a/src/app-layout/__tests__/widget-contract-split-panel.test.tsx +++ b/src/app-layout/__tests__/widget-contract-split-panel.test.tsx @@ -11,6 +11,17 @@ import createWrapper from '../../../lib/components/test-utils/selectors'; const isObject = (value: any) => Object.prototype.toString.call(value) === '[object Object]'; +// this string +// awsui_root_7nfqu_jksfw_153 awsui_root_1fj9k_z5zo8_5 awsui_has-adaptive-widths-default_7nfqu_jksfw_197 +// becomes +// awsui_root awsui_root awsui_has-adaptive-widths-default +function skipHashInClassnames(classNames: string): string { + return classNames + .split(' ') + .map(className => className.replace(/_[a-z0-9]+_[a-z0-9]+_\d+$/i, '')) + .join(' '); +} + function sanitizeProps(props: any): any { if (!isObject(props)) { return props; @@ -18,6 +29,16 @@ function sanitizeProps(props: any): any { if (React.isValidElement(props) || props?.current instanceof Element) { return '__JSX__'; } + // Now that classNames and styles are provided by the widget API, + // they need to be included in the check. + // However, they're regenerated on every build, and the hash part makes the snapshot test flaky. + // To avoid this, we strip out the hash portion. + if (props.className) { + return { + ...props, + className: skipHashInClassnames(props.className), + }; + } return Object.fromEntries( Object.entries(props).map(([key, value]) => { return [key, sanitizeProps(value)]; diff --git a/src/app-layout/__tests__/widget-contract.test.tsx b/src/app-layout/__tests__/widget-contract.test.tsx index 7b6dd80ac2..896112b0d5 100644 --- a/src/app-layout/__tests__/widget-contract.test.tsx +++ b/src/app-layout/__tests__/widget-contract.test.tsx @@ -26,7 +26,7 @@ jest.mock('../../../lib/components/internal/hooks/use-unique-id', () => { }; }); -describeEachAppLayout({ themes: ['refresh-toolbar'], sizes: ['desktop'] }, () => { +describeEachAppLayout({ themes: ['refresh-toolbar'], sizes: ['desktop'], skipInitialTest: true }, () => { beforeEach(() => { renderedProps.clear(); }); diff --git a/src/app-layout/visual-refresh-toolbar/app-layout-state.tsx b/src/app-layout/visual-refresh-toolbar/app-layout-state.tsx new file mode 100644 index 0000000000..0ec276e5b8 --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/app-layout-state.tsx @@ -0,0 +1,31 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React, { ForwardedRef } from 'react'; + +import { createWidgetizedComponent } from '../../internal/widgets'; +import { AppLayoutProps } from '../interfaces'; +import { AppLayoutInternalProps } from './interfaces'; +import { useSkeletonSlotsAttributes } from './skeleton/widget-slots/use-skeleton-slots-attributes'; +import { useAppLayout } from './use-app-layout'; + +export interface AppLayoutStateProps { + props: AppLayoutInternalProps; + forwardRef: ForwardedRef; + children: ( + state: ReturnType, + skeletonSlotsAttributes: ReturnType + ) => React.ReactNode; +} + +export const AppLayoutState = (props: AppLayoutStateProps) => { + const state = useAppLayout(props.props, props.forwardRef); + const skeletonSlotsAttributes = useSkeletonSlotsAttributes({ appLayoutProps: props.props, appLayoutState: state }); + + return <>{props.children(state, skeletonSlotsAttributes)}; +}; + +export const AppLayoutStateSkeleton = React.forwardRef((props, ref) => { + return
}>{props.children({} as any, {} as any)}
; +}); + +export const createWidgetizedAppLayoutState = createWidgetizedComponent(AppLayoutState, AppLayoutStateSkeleton); diff --git a/src/app-layout/visual-refresh-toolbar/index.tsx b/src/app-layout/visual-refresh-toolbar/index.tsx index 0bf8253873..290d3564a9 100644 --- a/src/app-layout/visual-refresh-toolbar/index.tsx +++ b/src/app-layout/visual-refresh-toolbar/index.tsx @@ -1,551 +1,57 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 -import React, { useEffect, useImperativeHandle, useLayoutEffect, useRef, useState } from 'react'; - -import { useStableCallback } from '@cloudscape-design/component-toolkit/internal'; +import React from 'react'; import ScreenreaderOnly from '../../internal/components/screenreader-only'; -import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context'; -import { fireNonCancelableEvent } from '../../internal/events'; -import { useControllable } from '../../internal/hooks/use-controllable'; -import { useIntersectionObserver } from '../../internal/hooks/use-intersection-observer'; -import { useMergeRefs } from '../../internal/hooks/use-merge-refs'; -import { useMobile } from '../../internal/hooks/use-mobile'; -import { useUniqueId } from '../../internal/hooks/use-unique-id'; -import { useGetGlobalBreadcrumbs } from '../../internal/plugins/helpers/use-global-breadcrumbs'; -import globalVars from '../../internal/styles/global-vars'; -import { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils'; import { AppLayoutProps } from '../interfaces'; -import { SplitPanelProviderProps } from '../split-panel'; -import { MIN_DRAWER_SIZE, OnChangeParams, useDrawers } from '../utils/use-drawers'; -import { useFocusControl, useMultipleFocusControl } from '../utils/use-focus-control'; -import { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control'; -import { ActiveDrawersContext } from '../utils/visibility-context'; -import { - computeHorizontalLayout, - computeSplitPanelOffsets, - computeVerticalLayout, - CONTENT_PADDING, -} from './compute-layout'; import { AppLayoutVisibilityContext } from './contexts'; -import { AppLayoutInternalProps, AppLayoutInternals } from './interfaces'; -import { - AppLayoutDrawer, - AppLayoutGlobalDrawers, - AppLayoutNavigation, - AppLayoutNotifications, - AppLayoutSplitPanelBottom, - AppLayoutSplitPanelSide, - AppLayoutToolbar, -} from './internal'; -import { useMultiAppLayout } from './multi-layout'; +import { AppLayoutInternalProps } from './interfaces'; +import { AppLayoutState } from './internal'; +import { createHtmlPortalNode, HtmlPortalNode, InPortal, OutPortal } from './reverse-portal'; import { SkeletonLayout } from './skeleton'; +import { useSkeletonSlotsAttributes } from './skeleton/widget-slots/use-skeleton-slots-attributes'; +import { useAppLayout } from './use-app-layout'; + +const AppLayoutStateParent = (props: { + children: ( + state: ReturnType, + skeletonSlotsAttributes: ReturnType + ) => React.ReactNode; + node: HtmlPortalNode; +}) => { + return ; +}; const AppLayoutVisualRefreshToolbar = React.forwardRef( - ( - { - ariaLabels, - contentHeader, - content, - navigationOpen, - navigationWidth, - navigation, - navigationHide, - onNavigationChange, - tools, - toolsOpen: controlledToolsOpen, - onToolsChange, - toolsHide, - toolsWidth, - contentType, - headerVariant, - breadcrumbs, - notifications, - stickyNotifications, - splitPanelPreferences: controlledSplitPanelPreferences, - splitPanelOpen: controlledSplitPanelOpen, - splitPanel, - splitPanelSize: controlledSplitPanelSize, - onSplitPanelToggle, - onSplitPanelResize, - onSplitPanelPreferencesChange, - disableContentPaddings, - minContentWidth, - maxContentWidth, - placement, - navigationTriggerHide, - ...rest - }, - forwardRef - ) => { - const isMobile = useMobile(); - const { __embeddedViewMode: embeddedViewMode, __forceDeduplicationType: forceDeduplicationType } = rest as any; - const splitPanelControlId = useUniqueId('split-panel'); - const [toolbarState, setToolbarState] = useState<'show' | 'hide'>('show'); - const [toolbarHeight, setToolbarHeight] = useState(0); - const [notificationsHeight, setNotificationsHeight] = useState(0); - const [navigationAnimationDisabled, setNavigationAnimationDisabled] = useState(true); - const [splitPanelAnimationDisabled, setSplitPanelAnimationDisabled] = useState(true); - const [isNested, setIsNested] = useState(false); - const rootRef = useRef(null); - - const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, { - componentName: 'AppLayout', - controlledProp: 'toolsOpen', - changeHandler: 'onToolsChange', - }); - const onToolsToggle = (open: boolean) => { - setToolsOpen(open); - drawersFocusControl.setFocus(); - fireNonCancelableEvent(onToolsChange, { open }); - }; - - const onGlobalDrawerFocus = (drawerId: string, open: boolean) => { - globalDrawersFocusControl.setFocus({ force: true, drawerId, open }); - }; - - const onAddNewActiveDrawer = (drawerId: string) => { - // If a local drawer is already open, and we attempt to open a new one, - // it will replace the existing one instead of opening an additional drawer, - // since only one local drawer is supported. Therefore, layout calculations are not necessary. - if (activeDrawer && drawers?.find(drawer => drawer.id === drawerId)) { - return; - } - // get the size of drawerId. it could be either local or global drawer - const combinedDrawers = [...(drawers || []), ...globalDrawers]; - const newDrawer = combinedDrawers.find(drawer => drawer.id === drawerId); - if (!newDrawer) { - return; - } - const newDrawerSize = Math.min( - newDrawer.defaultSize ?? drawerSizes[drawerId] ?? MIN_DRAWER_SIZE, - MIN_DRAWER_SIZE - ); - // check if the active drawers could be resized to fit the new drawers - // to do this, we need to take all active drawers, sum up their min sizes, truncate it from resizableSpaceAvailable - // and compare a given number with the new drawer id min size - - // the total size of all global drawers resized to their min size - const availableSpaceForNewDrawer = resizableSpaceAvailable - totalActiveDrawersMinSize; - if (availableSpaceForNewDrawer >= newDrawerSize) { - return; - } - - // now we made sure we cannot accommodate the new drawer with existing ones - closeFirstDrawer(); - }; - - const { - drawers, - activeDrawer, - minDrawerSize, - minGlobalDrawersSizes, - activeDrawerSize, - ariaLabelsWithDrawers, - globalDrawers, - activeGlobalDrawers, - activeGlobalDrawersIds, - activeGlobalDrawersSizes, - drawerSizes, - drawersOpenQueue, - onActiveDrawerChange, - onActiveDrawerResize, - onActiveGlobalDrawersChange, - } = useDrawers({ ...rest, onGlobalDrawerFocus, onAddNewActiveDrawer }, ariaLabels, { - ariaLabels, - toolsHide, - toolsOpen, - tools, - toolsWidth, - onToolsToggle, - }); - - const onActiveDrawerChangeHandler = ( - drawerId: string | null, - params: OnChangeParams = { initiatedByUserAction: true } - ) => { - onActiveDrawerChange(drawerId, params); - drawersFocusControl.setFocus(); - }; - - const [splitPanelOpen = false, setSplitPanelOpen] = useControllable( - controlledSplitPanelOpen, - onSplitPanelToggle, - false, - { - componentName: 'AppLayout', - controlledProp: 'splitPanelOpen', - changeHandler: 'onSplitPanelToggle', - } - ); - - const onSplitPanelToggleHandler = () => { - setSplitPanelAnimationDisabled(false); - setSplitPanelOpen(!splitPanelOpen); - splitPanelFocusControl.setLastInteraction({ type: splitPanelOpen ? 'close' : 'open' }); - fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen }); - }; - - const [splitPanelPreferences, setSplitPanelPreferences] = useControllable( - controlledSplitPanelPreferences, - onSplitPanelPreferencesChange, - undefined, - { - componentName: 'AppLayout', - controlledProp: 'splitPanelPreferences', - changeHandler: 'onSplitPanelPreferencesChange', - } - ); - - const onSplitPanelPreferencesChangeHandler = (detail: AppLayoutProps.SplitPanelPreferences) => { - setSplitPanelPreferences(detail); - splitPanelFocusControl.setLastInteraction({ type: 'position' }); - fireNonCancelableEvent(onSplitPanelPreferencesChange, detail); - }; - - const [splitPanelSize = 0, setSplitPanelSize] = useControllable( - controlledSplitPanelSize, - onSplitPanelResize, - getSplitPanelDefaultSize(splitPanelPreferences?.position ?? 'bottom'), - { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' } - ); - - const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0); - const [splitPanelHeaderBlockSize, setSplitPanelHeaderBlockSize] = useState(0); - - const onSplitPanelResizeHandler = (size: number) => { - setSplitPanelSize(size); - fireNonCancelableEvent(onSplitPanelResize, { size }); - }; - - const [splitPanelToggleConfig, setSplitPanelToggleConfig] = useState({ - ariaLabel: undefined, - displayed: false, - }); - - const globalDrawersFocusControl = useMultipleFocusControl(true, activeGlobalDrawersIds); - const drawersFocusControl = useFocusControl(!!activeDrawer?.id, true, activeDrawer?.id); - const navigationFocusControl = useFocusControl(navigationOpen, navigationTriggerHide); - const splitPanelFocusControl = useSplitPanelFocusControl([splitPanelPreferences, splitPanelOpen]); - - const onNavigationToggle = useStableCallback((open: boolean) => { - setNavigationAnimationDisabled(false); - navigationFocusControl.setFocus(); - fireNonCancelableEvent(onNavigationChange, { open }); - }); - - useImperativeHandle(forwardRef, () => ({ - closeNavigationIfNecessary: () => isMobile && onNavigationToggle(false), - openTools: () => onToolsToggle(true), - focusToolsClose: () => drawersFocusControl.setFocus(true), - focusActiveDrawer: () => drawersFocusControl.setFocus(true), - focusSplitPanel: () => splitPanelFocusControl.refs.slider.current?.focus(), - focusNavigation: () => navigationFocusControl.setFocus(true), - })); - - const resolvedStickyNotifications = !!stickyNotifications && !isMobile; - //navigation must be null if hidden so toolbar knows to hide the toggle button - const resolvedNavigation = navigationHide ? null : navigation || <>; - //navigation must not be open if navigationHide is true - const resolvedNavigationOpen = !!resolvedNavigation && navigationOpen; - const { - maxDrawerSize, - maxSplitPanelSize, - splitPanelForcedPosition, - splitPanelPosition, - maxGlobalDrawersSizes, - resizableSpaceAvailable, - } = computeHorizontalLayout({ - activeDrawerSize: activeDrawer ? activeDrawerSize : 0, - splitPanelSize, - minContentWidth, - navigationOpen: resolvedNavigationOpen, - navigationWidth, - placement, - splitPanelOpen, - splitPanelPosition: splitPanelPreferences?.position, - isMobile, - activeGlobalDrawersSizes, - }); - - const { ref: intersectionObserverRef, isIntersecting } = useIntersectionObserver({ initialState: true }); - const { registered, toolbarProps } = useMultiAppLayout( - { - forceDeduplicationType, - ariaLabels: ariaLabelsWithDrawers, - navigation: resolvedNavigation && !navigationTriggerHide, - navigationOpen: resolvedNavigationOpen, - onNavigationToggle, - navigationFocusRef: navigationFocusControl.refs.toggle, - breadcrumbs, - activeDrawerId: activeDrawer?.id ?? null, - // only pass it down if there are non-empty drawers or tools - drawers: drawers?.length || !toolsHide ? drawers : undefined, - globalDrawersFocusControl, - globalDrawers: globalDrawers?.length ? globalDrawers : undefined, - activeGlobalDrawersIds, - onActiveGlobalDrawersChange, - onActiveDrawerChange: onActiveDrawerChangeHandler, - drawersFocusRef: drawersFocusControl.refs.toggle, - splitPanel, - splitPanelToggleProps: { - ...splitPanelToggleConfig, - active: splitPanelOpen, - controlId: splitPanelControlId, - position: splitPanelPosition, - }, - splitPanelFocusRef: splitPanelFocusControl.refs.toggle, - onSplitPanelToggle: onSplitPanelToggleHandler, - }, - isIntersecting - ); - - const hasToolbar = !embeddedViewMode && !!toolbarProps; - const discoveredBreadcrumbs = useGetGlobalBreadcrumbs(hasToolbar && !breadcrumbs); - - const verticalOffsets = computeVerticalLayout({ - topOffset: placement.insetBlockStart, - hasVisibleToolbar: hasToolbar && toolbarState !== 'hide', - notificationsHeight: notificationsHeight ?? 0, - toolbarHeight: toolbarHeight ?? 0, - stickyNotifications: resolvedStickyNotifications, - }); - - const appLayoutInternals: AppLayoutInternals = { - ariaLabels: ariaLabelsWithDrawers, - headerVariant, - isMobile, - breadcrumbs, - discoveredBreadcrumbs, - stickyNotifications: resolvedStickyNotifications, - navigationOpen: resolvedNavigationOpen, - navigation: resolvedNavigation, - navigationFocusControl, - activeDrawer, - activeDrawerSize, - minDrawerSize, - maxDrawerSize, - minGlobalDrawersSizes, - maxGlobalDrawersSizes, - drawers: drawers!, - globalDrawers, - activeGlobalDrawers, - activeGlobalDrawersIds, - activeGlobalDrawersSizes, - onActiveGlobalDrawersChange, - drawersFocusControl, - globalDrawersFocusControl, - splitPanelPosition, - splitPanelToggleConfig, - splitPanelOpen, - splitPanelControlId, - splitPanelFocusControl, - placement, - toolbarState, - setToolbarState, - verticalOffsets, - drawersOpenQueue, - setToolbarHeight, - setNotificationsHeight, - onSplitPanelToggle: onSplitPanelToggleHandler, - onNavigationToggle, - onActiveDrawerChange: onActiveDrawerChangeHandler, - onActiveDrawerResize, - splitPanelAnimationDisabled, - }; - - const splitPanelInternals: SplitPanelProviderProps = { - bottomOffset: 0, - getMaxHeight: () => { - const availableHeight = - document.documentElement.clientHeight - placement.insetBlockStart - placement.insetBlockEnd; - // If the page is likely zoomed in at 200%, allow the split panel to fill the content area. - return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250; - }, - maxWidth: maxSplitPanelSize, - isForcedPosition: splitPanelForcedPosition, - isOpen: splitPanelOpen, - leftOffset: 0, - onPreferencesChange: onSplitPanelPreferencesChangeHandler, - onResize: onSplitPanelResizeHandler, - onToggle: onSplitPanelToggleHandler, - position: splitPanelPosition, - reportSize: size => setSplitPanelReportedSize(size), - reportHeaderHeight: size => setSplitPanelHeaderBlockSize(size), - headerHeight: splitPanelHeaderBlockSize, - rightOffset: 0, - size: splitPanelSize, - topOffset: 0, - setSplitPanelToggle: setSplitPanelToggleConfig, - refs: splitPanelFocusControl.refs, - }; - - const closeFirstDrawer = useStableCallback(() => { - const drawerToClose = drawersOpenQueue[drawersOpenQueue.length - 1]; - if (activeDrawer && activeDrawer?.id === drawerToClose) { - onActiveDrawerChange(null, { initiatedByUserAction: true }); - } else if (activeGlobalDrawersIds.includes(drawerToClose)) { - onActiveGlobalDrawersChange(drawerToClose, { initiatedByUserAction: true }); - } - }); - - useEffect(() => { - // Close navigation drawer on mobile so that the main content is visible - if (isMobile) { - onNavigationToggle(false); - } - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [isMobile]); - - const getTotalActiveDrawersMinSize = () => { - const combinedDrawers = [...(drawers || []), ...globalDrawers]; - let result = activeGlobalDrawersIds - .map(activeDrawerId => - Math.min( - combinedDrawers.find(drawer => drawer.id === activeDrawerId)?.defaultSize ?? MIN_DRAWER_SIZE, - MIN_DRAWER_SIZE - ) - ) - .reduce((acc, curr) => acc + curr, 0); - if (activeDrawer) { - result += Math.min(activeDrawer?.defaultSize ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE); - } - - return result; - }; - - const totalActiveDrawersMinSize = getTotalActiveDrawersMinSize(); - - useEffect(() => { - if (isMobile) { - return; - } - - const activeNavigationWidth = !navigationHide && navigationOpen ? navigationWidth : 0; - const scrollWidth = activeNavigationWidth + CONTENT_PADDING + totalActiveDrawersMinSize; - const hasHorizontalScroll = scrollWidth > placement.inlineSize; - if (hasHorizontalScroll) { - if (!navigationHide && navigationOpen) { - onNavigationToggle(false); - return; - } - - closeFirstDrawer(); - } - }, [ - totalActiveDrawersMinSize, - closeFirstDrawer, - isMobile, - navigationHide, - navigationOpen, - navigationWidth, - onNavigationToggle, - placement.inlineSize, - ]); - - /** - * Returns true if the AppLayout is nested - * Does not apply to iframe - */ - const getIsNestedInAppLayout = (element: HTMLElement | null): boolean => { - let currentElement: Element | null = element?.parentElement ?? null; - - // this traverse is needed only for JSDOM - // in real browsers the globalVar will be propagated to all descendants and this loops exits after initial iteration - while (currentElement) { - if (getComputedStyle(currentElement).getPropertyValue(globalVars.stickyVerticalTopOffset)) { - return true; - } - currentElement = currentElement.parentElement; - } - - return false; - }; - - useLayoutEffect(() => { - if (!hasToolbar) { - setIsNested(getIsNestedInAppLayout(rootRef.current)); - } - }, [hasToolbar]); - - const splitPanelOffsets = computeSplitPanelOffsets({ - placement, - hasSplitPanel: !!splitPanel, - splitPanelOpen, - splitPanelPosition, - splitPanelFullHeight: splitPanelReportedSize, - splitPanelHeaderHeight: splitPanelHeaderBlockSize, - }); + (props, forwardRef) => { + const portalNode = React.useMemo(() => (typeof window !== 'undefined' ? createHtmlPortalNode() : null), []); return ( - - {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */} - {!hasToolbar && breadcrumbs ? {breadcrumbs} : null} - + + + {() => <>} + + + + {(appLayoutState, skeletonSlotsAttributes) => { + return ( + + {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */} + {Object.keys(appLayoutState).length > 0 && !appLayoutState?.hasToolbar && props.breadcrumbs ? ( + {props.breadcrumbs} + ) : null} + + + + ); }} - toolbar={ - hasToolbar && - } - notifications={ - notifications && ( - {notifications} - ) - } - headerVariant={headerVariant} - contentHeader={contentHeader} - // delay rendering the content until registration of this instance is complete - content={registered ? content : null} - navigation={resolvedNavigation && } - navigationOpen={resolvedNavigationOpen} - navigationWidth={navigationWidth} - navigationAnimationDisabled={navigationAnimationDisabled} - tools={drawers && drawers.length > 0 && } - globalTools={ - - - - } - globalToolsOpen={!!activeGlobalDrawersIds.length} - toolsOpen={!!activeDrawer} - toolsWidth={activeDrawerSize} - sideSplitPanel={ - splitPanelPosition === 'side' && ( - - {splitPanel} - - ) - } - bottomSplitPanel={ - splitPanelPosition === 'bottom' && ( - - {splitPanel} - - ) - } - splitPanelOpen={splitPanelOpen} - placement={placement} - contentType={contentType} - maxContentWidth={maxContentWidth} - disableContentPaddings={disableContentPaddings} - /> - + + ); } ); diff --git a/src/app-layout/visual-refresh-toolbar/internal.tsx b/src/app-layout/visual-refresh-toolbar/internal.tsx index 0f7e01ece4..530f9e4d61 100644 --- a/src/app-layout/visual-refresh-toolbar/internal.tsx +++ b/src/app-layout/visual-refresh-toolbar/internal.tsx @@ -1,8 +1,15 @@ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 +import React, { useEffect, useRef, useState } from 'react'; + +import { AppLayoutState as AppLayoutStateImplementation, createWidgetizedAppLayoutState } from './app-layout-state'; import { createWidgetizedAppLayoutDrawer, createWidgetizedAppLayoutGlobalDrawers } from './drawer'; import { createWidgetizedAppLayoutNavigation } from './navigation'; import { createWidgetizedAppLayoutNotifications } from './notifications'; +import { createWidgetizedAppLayoutBottomPageContentSlot } from './skeleton/widget-slots/bottom-page-content-slot'; +import { createWidgetizedAppLayoutSidePageSlot } from './skeleton/widget-slots/side-page-slot'; +import { createWidgetizedAppLayoutTopPageContentSlot } from './skeleton/widget-slots/top-page-content-slot'; +import { createWidgetizedAppLayoutTopPageSlot, TopPageSlot } from './skeleton/widget-slots/top-page-slot'; import { createWidgetizedAppLayoutSplitPanelDrawerBottom, createWidgetizedAppLayoutSplitPanelDrawerSide, @@ -16,3 +23,38 @@ export const AppLayoutNotifications = createWidgetizedAppLayoutNotifications(); export const AppLayoutToolbar = createWidgetizedAppLayoutToolbar(); export const AppLayoutSplitPanelBottom = createWidgetizedAppLayoutSplitPanelDrawerBottom(); export const AppLayoutSplitPanelSide = createWidgetizedAppLayoutSplitPanelDrawerSide(); +export const AppLayoutSkeletonTopSlot = createWidgetizedAppLayoutTopPageSlot( + createAppLayoutPart({ Component: TopPageSlot }) +); +export const AppLayoutSkeletonSideSlot = createWidgetizedAppLayoutSidePageSlot(); +export const AppLayoutSkeletonTopContentSlot = createWidgetizedAppLayoutTopPageContentSlot(); +export const AppLayoutSkeletonBottomContentSlot = createWidgetizedAppLayoutBottomPageContentSlot(); +export const AppLayoutState = createWidgetizedAppLayoutState( + createAppLayoutPart({ Component: AppLayoutStateImplementation }) +); + +const enableDelayedComponents = false; +const enableSyncComponents = true; + +export function createAppLayoutPart({ Component }: { Component: React.JSXElementConstructor }) { + const AppLayoutPartLoader = ({ Skeleton, ...props }: any) => { + const [mount, setMount] = useState(false); + const ref = useRef(null); + + useEffect(() => { + setTimeout(() => { + setMount(true); + }, 1000); + }, []); + + if (enableSyncComponents || (mount && enableDelayedComponents)) { + return ; + } + + if (Skeleton) { + return ; + } + return
; + }; + return AppLayoutPartLoader; +} diff --git a/src/app-layout/visual-refresh-toolbar/reverse-portal.tsx b/src/app-layout/visual-refresh-toolbar/reverse-portal.tsx new file mode 100644 index 0000000000..8e997c83a2 --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/reverse-portal.tsx @@ -0,0 +1,228 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 + +/** + * This file contains code copied from the npm package: https://www.npmjs.com/package/react-reverse-portal + * + * We don’t use the original package directly for the following reasons: + * + * - The original library throws errors during SSR, whereas this version returns `null` and degrades gracefully. + * - The original package has no test coverage, which makes it unreliable. This version is fully covered by unit tests. + * + * The implementation remains unchanged and uses class components, along with the original comments. + */ + +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; + +interface BaseOptions { + attributes?: { [key: string]: string }; +} + +type HtmlOptions = BaseOptions & { + containerElement?: keyof HTMLElementTagNameMap; +}; + +type Options = HtmlOptions; + +type Component

= React.Component

| React.ComponentType

; + +type ComponentProps> = C extends Component ? P : never; + +interface PortalNodeBase> { + // Used by the out portal to send props back to the real element + // Hooked by InPortal to become a state update (and thus rerender) + setPortalProps(p: ComponentProps): void; + // Used to track props set before the InPortal hooks setPortalProps + getInitialPortalProps(): ComponentProps; + // Move the node from wherever it is, to this parent, replacing the placeholder + mount(newParent: Node, placeholder: Node): void; + // If mounted, unmount the node and put the initial placeholder back + // If an expected placeholder is provided, only unmount if that's still that was the + // latest placeholder we replaced. This avoids some race conditions. + unmount(expectedPlaceholder?: Node): void; +} +export interface HtmlPortalNode = Component> extends PortalNodeBase { + element: HTMLElement; +} +type AnyPortalNode = Component> = HtmlPortalNode; + +// This is the internal implementation: the public entry points set elementType to an appropriate value +const createPortalNode = >(options?: Options): AnyPortalNode => { + let initialProps = {} as ComponentProps; + + let parent: Node | undefined; + let lastPlaceholder: Node | undefined; + + const element = document.createElement(options?.containerElement ?? 'div'); + + if (options && typeof options === 'object' && options.attributes) { + for (const [key, value] of Object.entries(options.attributes)) { + element.setAttribute(key, value); + } + } + + const portalNode: AnyPortalNode = { + element, + setPortalProps: (props: ComponentProps) => { + initialProps = props; + }, + getInitialPortalProps: () => { + return initialProps; + }, + mount: (newParent: HTMLElement, newPlaceholder: HTMLElement) => { + if (newPlaceholder === lastPlaceholder) { + // Already mounted - noop. + return; + } + portalNode.unmount(); + + newParent.replaceChild(portalNode.element, newPlaceholder); + + parent = newParent; + lastPlaceholder = newPlaceholder; + }, + unmount: (expectedPlaceholder?: Node) => { + if (expectedPlaceholder && expectedPlaceholder !== lastPlaceholder) { + // Skip unmounts for placeholders that aren't currently mounted + // They will have been automatically unmounted already by a subsequent mount() + return; + } + + if (parent && lastPlaceholder) { + parent.replaceChild(lastPlaceholder, portalNode.element); + + parent = undefined; + lastPlaceholder = undefined; + } + }, + } as AnyPortalNode; + + return portalNode; +}; + +interface InPortalProps { + node: AnyPortalNode; + children: React.ReactNode; +} + +class InPortal extends React.PureComponent { + constructor(props: InPortalProps) { + super(props); + this.state = { + nodeProps: this.props.node?.getInitialPortalProps() ?? {}, + }; + } + + addPropsChannel = () => { + if (!this.props.node) { + return; + } + Object.assign(this.props.node, { + setPortalProps: (props: object) => { + // Rerender the child node here if/when the out portal props change + this.setState({ nodeProps: props }); + }, + }); + }; + + componentDidMount() { + this.addPropsChannel(); + } + + componentDidUpdate() { + this.addPropsChannel(); + } + + render() { + const { children, node } = this.props; + + if (!node) { + return null; + } + + return ReactDOM.createPortal( + React.Children.map(children, child => { + if (!React.isValidElement(child)) { + return child; + } + return React.cloneElement(child, this.state.nodeProps); + }), + node.element + ); + } +} + +type OutPortalProps> = { + node: AnyPortalNode; +} & Partial>; + +class OutPortal> extends React.PureComponent> { + private placeholderNode = React.createRef(); + private currentPortalNode?: AnyPortalNode; + + constructor(props: OutPortalProps) { + super(props); + this.passPropsThroughPortal(); + } + + passPropsThroughPortal() { + const propsForTarget = Object.assign({}, this.props, { node: undefined }); + this.props.node?.setPortalProps?.(propsForTarget); + } + + componentDidMount() { + const node = this.props.node as AnyPortalNode; + this.currentPortalNode = node; + + const placeholder = this.placeholderNode.current!; + if (!placeholder) { + return; + } + const parent = placeholder.parentNode!; + node.mount(parent, placeholder); + this.passPropsThroughPortal(); + } + + componentDidUpdate() { + // We re-mount on update, just in case we were unmounted (e.g. by + // a second OutPortal, which has now been removed) + const node = this.props.node as AnyPortalNode; + + // If we're switching portal nodes, we need to clean up the current one first. + if (this.currentPortalNode && node !== this.currentPortalNode) { + this.currentPortalNode.unmount(this.placeholderNode.current!); + this.currentPortalNode = node; + } + + const placeholder = this.placeholderNode.current!; + const parent = placeholder.parentNode!; + node.mount(parent, placeholder); + this.passPropsThroughPortal(); + } + + componentWillUnmount() { + const node = this.props.node as AnyPortalNode; + if (!node) { + return; + } + node.unmount(this.placeholderNode.current!); + } + + render() { + if (!this.props.node) { + return null; + } + + // Render a placeholder to the DOM, so we can get a reference into + // our location in the DOM, and swap it out for the portaled node. + const tagName = this.props.node.element.tagName; + const type = tagName.toLowerCase(); + + return React.createElement(type, { ref: this.placeholderNode }); + } +} + +const createHtmlPortalNode = createPortalNode; + +export { createHtmlPortalNode, InPortal, OutPortal }; diff --git a/src/app-layout/visual-refresh-toolbar/skeleton/index.tsx b/src/app-layout/visual-refresh-toolbar/skeleton/index.tsx index 38115018e0..e686aa5546 100644 --- a/src/app-layout/visual-refresh-toolbar/skeleton/index.tsx +++ b/src/app-layout/visual-refresh-toolbar/skeleton/index.tsx @@ -5,147 +5,73 @@ import clsx from 'clsx'; import VisualContext from '../../../internal/components/visual-context'; import customCssProps from '../../../internal/generated/custom-css-properties'; -import { useMobile } from '../../../internal/hooks/use-mobile'; -import { highContrastHeaderClassName } from '../../../internal/utils/content-header-utils'; -import { AppLayoutPropsWithDefaults } from '../../interfaces'; +import { AppLayoutInternalProps } from '../interfaces'; +import { + AppLayoutSkeletonBottomContentSlot, + AppLayoutSkeletonSideSlot, + AppLayoutSkeletonTopContentSlot, + AppLayoutSkeletonTopSlot, +} from '../internal'; +import { useAppLayout } from '../use-app-layout'; +import { useSkeletonSlotsAttributes } from './widget-slots/use-skeleton-slots-attributes'; -import sharedStyles from '../../resize/styles.css.js'; import testutilStyles from '../../test-classes/styles.css.js'; import styles from './styles.css.js'; -const contentTypeCustomWidths: Array = ['dashboard', 'cards', 'table']; +export interface SkeletonLayoutProps { + appLayoutProps: AppLayoutInternalProps; + appLayoutState: ReturnType; +} -interface SkeletonLayoutProps - extends Pick< - AppLayoutPropsWithDefaults, - | 'notifications' - | 'headerVariant' - | 'contentHeader' - | 'content' - | 'contentType' - | 'maxContentWidth' - | 'disableContentPaddings' - | 'navigation' - | 'navigationOpen' - | 'navigationWidth' - | 'tools' - | 'toolsOpen' - | 'toolsWidth' - | 'placement' - > { - style?: React.CSSProperties; - toolbar?: React.ReactNode; - splitPanelOpen?: boolean; - sideSplitPanel?: React.ReactNode; - bottomSplitPanel?: React.ReactNode; - globalTools?: React.ReactNode; - globalToolsOpen?: boolean; - navigationAnimationDisabled?: boolean; - isNested?: boolean; +export interface RootSkeletonLayoutProps extends SkeletonLayoutProps { + skeletonSlotsAttributes: ReturnType; } -export const SkeletonLayout = React.forwardRef( - ( - { - style, - notifications, - headerVariant, - contentHeader, - content, - navigation, - navigationOpen, - navigationWidth, - tools, - globalTools, - toolsOpen, - toolsWidth, - toolbar, - sideSplitPanel, - bottomSplitPanel, - splitPanelOpen, - placement, - contentType, - maxContentWidth, - disableContentPaddings, - globalToolsOpen, - navigationAnimationDisabled, - isNested, - }, - ref - ) => { - const isMobile = useMobile(); - const isMaxWidth = maxContentWidth === Number.MAX_VALUE || maxContentWidth === Number.MAX_SAFE_INTEGER; - const anyPanelOpen = navigationOpen || toolsOpen; - return ( - -

{ + const { appLayoutProps, appLayoutState, skeletonSlotsAttributes } = props; + const { registered } = appLayoutState; + const { contentHeader, content, navigationWidth } = appLayoutProps; + const { + wrapperElAttributes, + mainElAttributes, + contentWrapperElAttributes, + contentHeaderElAttributes, + contentElAttributes, + } = skeletonSlotsAttributes; + + const isAppLayoutStateLoading = Object.keys(appLayoutState).length === 0; + + return ( + +
- {toolbar} - {navigation && ( -
- {navigation} -
- )} -
- {notifications && ( -
- )} - {notifications} -
- {contentHeader &&
{contentHeader}
} -
{content}
-
- {bottomSplitPanel && ( -
- {bottomSplitPanel} -
- )} -
- {sideSplitPanel && ( -
- {sideSplitPanel} -
- )} + } + } + > + +
+ {!isAppLayoutStateLoading && }
- {tools} + {contentHeader &&
{contentHeader}
} + {/*delay rendering the content until registration of this instance is complete*/} +
+ {isAppLayoutStateLoading || registered ? content : null} +
-
{globalTools}
-
-
- ); - } -); + {!isAppLayoutStateLoading && } + + {!isAppLayoutStateLoading && } +
+ + ); +}; diff --git a/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/bottom-page-content-slot.tsx b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/bottom-page-content-slot.tsx new file mode 100644 index 0000000000..384c990bc8 --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/bottom-page-content-slot.tsx @@ -0,0 +1,29 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React from 'react'; + +import { createWidgetizedComponent } from '../../../../internal/widgets'; +import { AppLayoutSplitPanelDrawerBottomImplementation as AppLayoutSplitPanelBottom } from '../../split-panel'; +import { SkeletonLayoutProps } from '../index'; + +import styles from '../styles.css.js'; + +const BottomPageContentSlot = (props: SkeletonLayoutProps) => { + const { + appLayoutState: { splitPanelPosition, appLayoutInternals, splitPanelInternals }, + appLayoutProps: { placement, splitPanel }, + } = props; + return ( + <> + {splitPanelPosition === 'bottom' && ( +
+ + {splitPanel} + +
+ )} + + ); +}; + +export const createWidgetizedAppLayoutBottomPageContentSlot = createWidgetizedComponent(BottomPageContentSlot); diff --git a/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/side-page-slot.tsx b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/side-page-slot.tsx new file mode 100644 index 0000000000..8672bcd8ea --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/side-page-slot.tsx @@ -0,0 +1,63 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React from 'react'; +import clsx from 'clsx'; + +import { createWidgetizedComponent } from '../../../../internal/widgets'; +import { ActiveDrawersContext } from '../../../utils/visibility-context'; +import { + AppLayoutDrawerImplementation as AppLayoutDrawer, + AppLayoutGlobalDrawersImplementation as AppLayoutGlobalDrawers, +} from '../../drawer'; +import { AppLayoutSplitPanelDrawerSideImplementation as AppLayoutSplitPanelSide } from '../../split-panel'; +import { SkeletonLayoutProps } from '../index'; + +import sharedStyles from '../../../resize/styles.css.js'; +import styles from '../styles.css.js'; + +const SidePageSlot = (props: SkeletonLayoutProps) => { + const { + appLayoutProps: { splitPanel }, + appLayoutState: { + resolvedNavigationOpen, + activeGlobalDrawersIds, + activeDrawer, + splitPanelOpen, + drawers, + appLayoutInternals, + splitPanelInternals, + splitPanelPosition, + }, + } = props; + const toolsOpen = !!activeDrawer; + const globalToolsOpen = !!activeGlobalDrawersIds.length; + return ( + <> + {splitPanelPosition === 'side' && ( +
+ + {splitPanel} + +
+ )} +
+ {drawers && drawers.length > 0 && } +
+
+ + + +
+ + ); +}; + +export const createWidgetizedAppLayoutSidePageSlot = createWidgetizedComponent(SidePageSlot); diff --git a/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/top-page-content-slot.tsx b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/top-page-content-slot.tsx new file mode 100644 index 0000000000..8029ca2d42 --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/top-page-content-slot.tsx @@ -0,0 +1,35 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React from 'react'; +import clsx from 'clsx'; + +import { highContrastHeaderClassName } from '../../../../internal/utils/content-header-utils'; +import { createWidgetizedComponent } from '../../../../internal/widgets'; +import { AppLayoutNotificationsImplementation as AppLayoutNotifications } from '../../notifications'; +import { SkeletonLayoutProps } from '../index'; + +import styles from '../styles.css.js'; + +const TopPageContentSlot = (props: SkeletonLayoutProps) => { + const { + appLayoutProps: { headerVariant, notifications }, + appLayoutState: { appLayoutInternals }, + } = props; + return ( + <> + {notifications && ( +
+ )} + {notifications && ( + {notifications} + )} + + ); +}; + +export const createWidgetizedAppLayoutTopPageContentSlot = createWidgetizedComponent(TopPageContentSlot); diff --git a/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/top-page-slot.tsx b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/top-page-slot.tsx new file mode 100644 index 0000000000..7872dcd6dd --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/top-page-slot.tsx @@ -0,0 +1,65 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React from 'react'; +import clsx from 'clsx'; + +import { createWidgetizedComponent } from '../../../../internal/widgets'; +import { useMultiAppLayout } from '../../multi-layout'; +import { AppLayoutNavigationImplementation as AppLayoutNavigation } from '../../navigation'; +import { AppLayoutToolbarImplementation as AppLayoutToolbar } from '../../toolbar'; +import { SkeletonLayoutProps } from '../index'; +import { ToolbarSkeleton } from '../slot-skeletons'; + +import sharedStyles from '../../../resize/styles.css.js'; +import styles from '../styles.css.js'; + +export const TopPageSlot = (props: SkeletonLayoutProps) => { + const { + appLayoutState: { + resolvedNavigationOpen, + navigationAnimationDisabled, + activeDrawer, + hasToolbar, + appLayoutInternals, + toolbarProps, + resolvedNavigation, + }, + } = props; + const toolsOpen = !!activeDrawer; + return ( + <> + {hasToolbar && } + {resolvedNavigation && ( +
+ {resolvedNavigation && } +
+ )} + + ); +}; + +export const TopPageSlotSkeleton = React.forwardRef((props, ref) => { + const { appLayoutProps } = props; + const { __embeddedViewMode: embeddedViewMode } = appLayoutProps as any; + const { toolbarProps } = useMultiAppLayout(appLayoutProps as any, true); + const hasToolbar = !embeddedViewMode && !!toolbarProps; + const resolvedNavigation = appLayoutProps?.navigationHide ? null : appLayoutProps?.navigation || <>; + const resolvedNavigationOpen = !!resolvedNavigation && appLayoutProps?.navigationOpen; + return ( + <> + {hasToolbar && ( + } toolbarProps={{} as any} appLayoutInternals={{} as any} /> + )} + {resolvedNavigationOpen &&
} + + ); +}); + +export const createWidgetizedAppLayoutTopPageSlot = createWidgetizedComponent(TopPageSlot, TopPageSlotSkeleton); diff --git a/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/use-skeleton-slots-attributes.tsx b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/use-skeleton-slots-attributes.tsx new file mode 100644 index 0000000000..7b2f096a69 --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/skeleton/widget-slots/use-skeleton-slots-attributes.tsx @@ -0,0 +1,84 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import clsx from 'clsx'; + +import customCssProps from '../../../../internal/generated/custom-css-properties'; +import { useMergeRefs } from '../../../../internal/hooks/use-merge-refs'; +import { useMobile } from '../../../../internal/hooks/use-mobile'; +import globalVars from '../../../../internal/styles/global-vars'; +import { SkeletonLayoutProps } from '../index'; + +import testutilStyles from '../../../test-classes/styles.css.js'; +import styles from '../styles.css.js'; + +const contentTypeCustomWidths: Array = ['dashboard', 'cards', 'table']; + +export const useSkeletonSlotsAttributes = ({ appLayoutProps, appLayoutState }: SkeletonLayoutProps) => { + const { + intersectionObserverRef, + rootRef, + isNested, + activeDrawerSize, + resolvedNavigationOpen, + splitPanelOffsets, + hasToolbar, + verticalOffsets, + activeDrawer, + } = appLayoutState ?? {}; + const { contentType, placement, maxContentWidth, navigationWidth, minContentWidth, disableContentPaddings } = + appLayoutProps; + const isMobile = useMobile(); + const ref = useMergeRefs(intersectionObserverRef, rootRef); + const toolsOpen = !!activeDrawer; + const anyPanelOpen = resolvedNavigationOpen || toolsOpen; + const isMaxWidth = maxContentWidth === Number.MAX_VALUE || maxContentWidth === Number.MAX_SAFE_INTEGER; + const wrapperElAttributes = { + ref, + className: clsx(styles.root, testutilStyles.root, { + [styles['has-adaptive-widths-default']]: !contentTypeCustomWidths.includes(contentType), + [styles['has-adaptive-widths-dashboard']]: contentType === 'dashboard', + }), + style: { + minBlockSize: isNested ? '100%' : `calc(100vh - ${placement.insetBlockStart + placement.insetBlockEnd}px)`, + [customCssProps.maxContentWidth]: isMaxWidth ? '100%' : maxContentWidth ? `${maxContentWidth}px` : '', + [customCssProps.navigationWidth]: `${navigationWidth}px`, + [customCssProps.toolsWidth]: `${activeDrawerSize}px`, + }, + }; + + const mainElAttributes = { + className: clsx(styles['main-landmark'], isMobile && anyPanelOpen && styles['unfocusable-mobile']), + }; + + const contentWrapperElAttributes = { + className: clsx(styles.main, { [styles['main-disable-paddings']]: disableContentPaddings }), + style: { + paddingBlockEnd: splitPanelOffsets?.mainContentPaddingBlockEnd, + ...(hasToolbar || !isNested + ? { + [globalVars.stickyVerticalTopOffset]: `${verticalOffsets?.header}px`, + [globalVars.stickyVerticalBottomOffset]: `${splitPanelOffsets?.stickyVerticalBottomOffset}px`, + } + : {}), + ...(!isMobile ? { minWidth: `${minContentWidth}px` } : {}), + }, + }; + + const contentHeaderElAttributes = { + className: styles['content-header'], + }; + + const contentElAttributes = { + className: clsx(styles.content, testutilStyles.content), + }; + + return { + wrapperElAttributes, + mainElAttributes, + contentWrapperElAttributes, + contentHeaderElAttributes, + contentElAttributes, + }; +}; diff --git a/src/app-layout/visual-refresh-toolbar/use-app-layout.tsx b/src/app-layout/visual-refresh-toolbar/use-app-layout.tsx new file mode 100644 index 0000000000..f948370a0f --- /dev/null +++ b/src/app-layout/visual-refresh-toolbar/use-app-layout.tsx @@ -0,0 +1,478 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import React, { ForwardedRef, useCallback, useEffect, useImperativeHandle, useRef, useState } from 'react'; + +import { useStableCallback } from '@cloudscape-design/component-toolkit/internal'; + +import { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context'; +import { fireNonCancelableEvent } from '../../internal/events'; +import { useControllable } from '../../internal/hooks/use-controllable'; +import { useIntersectionObserver } from '../../internal/hooks/use-intersection-observer'; +import { useMergeRefs } from '../../internal/hooks/use-merge-refs'; +import { useMobile } from '../../internal/hooks/use-mobile'; +import { useUniqueId } from '../../internal/hooks/use-unique-id'; +import { useGetGlobalBreadcrumbs } from '../../internal/plugins/helpers/use-global-breadcrumbs'; +import globalVars from '../../internal/styles/global-vars'; +import { getSplitPanelDefaultSize } from '../../split-panel/utils/size-utils'; +import { AppLayoutProps } from '../interfaces'; +import { SplitPanelProviderProps } from '../split-panel'; +import { MIN_DRAWER_SIZE, OnChangeParams, useDrawers } from '../utils/use-drawers'; +import { useFocusControl, useMultipleFocusControl } from '../utils/use-focus-control'; +import { useSplitPanelFocusControl } from '../utils/use-split-panel-focus-control'; +import { + computeHorizontalLayout, + computeSplitPanelOffsets, + computeVerticalLayout, + CONTENT_PADDING, +} from './compute-layout'; +import { AppLayoutInternalProps, AppLayoutInternals } from './interfaces'; +import { useMultiAppLayout } from './multi-layout'; + +export const useAppLayout = (props: AppLayoutInternalProps, forwardRef: ForwardedRef) => { + const { + ariaLabels, + navigationOpen, + navigationWidth, + navigation, + navigationHide, + onNavigationChange, + tools, + toolsOpen: controlledToolsOpen, + onToolsChange, + toolsHide, + toolsWidth, + headerVariant, + breadcrumbs, + stickyNotifications, + splitPanelPreferences: controlledSplitPanelPreferences, + splitPanelOpen: controlledSplitPanelOpen, + splitPanel, + splitPanelSize: controlledSplitPanelSize, + onSplitPanelToggle, + onSplitPanelResize, + onSplitPanelPreferencesChange, + minContentWidth, + placement, + navigationTriggerHide, + ...rest + } = props; + const isMobile = useMobile(); + const { __embeddedViewMode: embeddedViewMode, __forceDeduplicationType: forceDeduplicationType } = rest as any; + const splitPanelControlId = useUniqueId('split-panel'); + const [toolbarState, setToolbarState] = useState<'show' | 'hide'>('show'); + const [toolbarHeight, setToolbarHeight] = useState(0); + const [notificationsHeight, setNotificationsHeight] = useState(0); + const [navigationAnimationDisabled, setNavigationAnimationDisabled] = useState(true); + const [splitPanelAnimationDisabled, setSplitPanelAnimationDisabled] = useState(true); + const [isNested, setIsNested] = useState(false); + const rootRefInternal = useRef(null); + // This workaround ensures the ref is defined before checking if the app layout is nested. + // On initial render, the ref might be undefined because this component loads asynchronously via the widget API. + const onMountRootRef = useCallback(node => { + setIsNested(getIsNestedInAppLayout(node)); + }, []); + const rootRef = useMergeRefs(rootRefInternal, onMountRootRef); + + const [toolsOpen = false, setToolsOpen] = useControllable(controlledToolsOpen, onToolsChange, false, { + componentName: 'AppLayout', + controlledProp: 'toolsOpen', + changeHandler: 'onToolsChange', + }); + const onToolsToggle = (open: boolean) => { + setToolsOpen(open); + drawersFocusControl.setFocus(); + fireNonCancelableEvent(onToolsChange, { open }); + }; + + const onGlobalDrawerFocus = (drawerId: string, open: boolean) => { + globalDrawersFocusControl.setFocus({ force: true, drawerId, open }); + }; + + const onAddNewActiveDrawer = (drawerId: string) => { + // If a local drawer is already open, and we attempt to open a new one, + // it will replace the existing one instead of opening an additional drawer, + // since only one local drawer is supported. Therefore, layout calculations are not necessary. + if (activeDrawer && drawers?.find(drawer => drawer.id === drawerId)) { + return; + } + // get the size of drawerId. it could be either local or global drawer + const combinedDrawers = [...(drawers || []), ...globalDrawers]; + const newDrawer = combinedDrawers.find(drawer => drawer.id === drawerId); + if (!newDrawer) { + return; + } + const newDrawerSize = Math.min(newDrawer.defaultSize ?? drawerSizes[drawerId] ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE); + // check if the active drawers could be resized to fit the new drawers + // to do this, we need to take all active drawers, sum up their min sizes, truncate it from resizableSpaceAvailable + // and compare a given number with the new drawer id min size + + // the total size of all global drawers resized to their min size + const availableSpaceForNewDrawer = resizableSpaceAvailable - totalActiveDrawersMinSize; + if (availableSpaceForNewDrawer >= newDrawerSize) { + return; + } + + // now we made sure we cannot accommodate the new drawer with existing ones + closeFirstDrawer(); + }; + + const { + drawers, + activeDrawer, + minDrawerSize, + minGlobalDrawersSizes, + activeDrawerSize, + ariaLabelsWithDrawers, + globalDrawers, + activeGlobalDrawers, + activeGlobalDrawersIds, + activeGlobalDrawersSizes, + drawerSizes, + drawersOpenQueue, + onActiveDrawerChange, + onActiveDrawerResize, + onActiveGlobalDrawersChange, + } = useDrawers({ ...rest, onGlobalDrawerFocus, onAddNewActiveDrawer }, ariaLabels, { + ariaLabels, + toolsHide, + toolsOpen, + tools, + toolsWidth, + onToolsToggle, + }); + + const onActiveDrawerChangeHandler = ( + drawerId: string | null, + params: OnChangeParams = { initiatedByUserAction: true } + ) => { + onActiveDrawerChange(drawerId, params); + drawersFocusControl.setFocus(); + }; + + const [splitPanelOpen = false, setSplitPanelOpen] = useControllable( + controlledSplitPanelOpen, + onSplitPanelToggle, + false, + { + componentName: 'AppLayout', + controlledProp: 'splitPanelOpen', + changeHandler: 'onSplitPanelToggle', + } + ); + + const onSplitPanelToggleHandler = () => { + setSplitPanelAnimationDisabled(false); + setSplitPanelOpen(!splitPanelOpen); + splitPanelFocusControl.setLastInteraction({ type: splitPanelOpen ? 'close' : 'open' }); + fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen }); + }; + + const [splitPanelPreferences, setSplitPanelPreferences] = useControllable( + controlledSplitPanelPreferences, + onSplitPanelPreferencesChange, + undefined, + { + componentName: 'AppLayout', + controlledProp: 'splitPanelPreferences', + changeHandler: 'onSplitPanelPreferencesChange', + } + ); + + const onSplitPanelPreferencesChangeHandler = (detail: AppLayoutProps.SplitPanelPreferences) => { + setSplitPanelPreferences(detail); + splitPanelFocusControl.setLastInteraction({ type: 'position' }); + fireNonCancelableEvent(onSplitPanelPreferencesChange, detail); + }; + + const [splitPanelSize = 0, setSplitPanelSize] = useControllable( + controlledSplitPanelSize, + onSplitPanelResize, + getSplitPanelDefaultSize(splitPanelPreferences?.position ?? 'bottom'), + { componentName: 'AppLayout', controlledProp: 'splitPanelSize', changeHandler: 'onSplitPanelResize' } + ); + + const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0); + const [splitPanelHeaderBlockSize, setSplitPanelHeaderBlockSize] = useState(0); + + const onSplitPanelResizeHandler = (size: number) => { + setSplitPanelSize(size); + fireNonCancelableEvent(onSplitPanelResize, { size }); + }; + + const [splitPanelToggleConfig, setSplitPanelToggleConfig] = useState({ + ariaLabel: undefined, + displayed: false, + }); + + const globalDrawersFocusControl = useMultipleFocusControl(true, activeGlobalDrawersIds); + const drawersFocusControl = useFocusControl(!!activeDrawer?.id, true, activeDrawer?.id); + const navigationFocusControl = useFocusControl(navigationOpen, navigationTriggerHide); + const splitPanelFocusControl = useSplitPanelFocusControl([splitPanelPreferences, splitPanelOpen]); + + const onNavigationToggle = useStableCallback((open: boolean) => { + setNavigationAnimationDisabled(false); + navigationFocusControl.setFocus(); + fireNonCancelableEvent(onNavigationChange, { open }); + }); + + useImperativeHandle(forwardRef, () => ({ + closeNavigationIfNecessary: () => isMobile && onNavigationToggle(false), + openTools: () => onToolsToggle(true), + focusToolsClose: () => drawersFocusControl.setFocus(true), + focusActiveDrawer: () => drawersFocusControl.setFocus(true), + focusSplitPanel: () => splitPanelFocusControl.refs.slider.current?.focus(), + focusNavigation: () => navigationFocusControl.setFocus(true), + })); + + const resolvedStickyNotifications = !!stickyNotifications && !isMobile; + //navigation must be null if hidden so toolbar knows to hide the toggle button + const resolvedNavigation = navigationHide ? null : navigation || <>; + //navigation must not be open if navigationHide is true + const resolvedNavigationOpen = !!resolvedNavigation && navigationOpen; + const { + maxDrawerSize, + maxSplitPanelSize, + splitPanelForcedPosition, + splitPanelPosition, + maxGlobalDrawersSizes, + resizableSpaceAvailable, + } = computeHorizontalLayout({ + activeDrawerSize: activeDrawer ? activeDrawerSize : 0, + splitPanelSize, + minContentWidth, + navigationOpen: resolvedNavigationOpen, + navigationWidth, + placement, + splitPanelOpen, + splitPanelPosition: splitPanelPreferences?.position, + isMobile, + activeGlobalDrawersSizes, + }); + + const { ref: intersectionObserverRef, isIntersecting } = useIntersectionObserver({ initialState: true }); + const { registered, toolbarProps } = useMultiAppLayout( + { + forceDeduplicationType, + ariaLabels: ariaLabelsWithDrawers, + navigation: resolvedNavigation && !navigationTriggerHide, + navigationOpen: resolvedNavigationOpen, + onNavigationToggle, + navigationFocusRef: navigationFocusControl.refs.toggle, + breadcrumbs, + activeDrawerId: activeDrawer?.id ?? null, + // only pass it down if there are non-empty drawers or tools + drawers: drawers?.length || !toolsHide ? drawers : undefined, + globalDrawersFocusControl, + globalDrawers: globalDrawers?.length ? globalDrawers : undefined, + activeGlobalDrawersIds, + onActiveGlobalDrawersChange, + onActiveDrawerChange: onActiveDrawerChangeHandler, + drawersFocusRef: drawersFocusControl.refs.toggle, + splitPanel, + splitPanelToggleProps: { + ...splitPanelToggleConfig, + active: splitPanelOpen, + controlId: splitPanelControlId, + position: splitPanelPosition, + }, + splitPanelFocusRef: splitPanelFocusControl.refs.toggle, + onSplitPanelToggle: onSplitPanelToggleHandler, + }, + isIntersecting + ); + + const hasToolbar = !embeddedViewMode && !!toolbarProps; + const discoveredBreadcrumbs = useGetGlobalBreadcrumbs(hasToolbar && !breadcrumbs); + + const verticalOffsets = computeVerticalLayout({ + topOffset: placement.insetBlockStart, + hasVisibleToolbar: hasToolbar && toolbarState !== 'hide', + notificationsHeight: notificationsHeight ?? 0, + toolbarHeight: toolbarHeight ?? 0, + stickyNotifications: resolvedStickyNotifications, + }); + + const appLayoutInternals: AppLayoutInternals = { + ariaLabels: ariaLabelsWithDrawers, + headerVariant, + isMobile, + breadcrumbs, + discoveredBreadcrumbs, + stickyNotifications: resolvedStickyNotifications, + navigationOpen: resolvedNavigationOpen, + navigation: resolvedNavigation, + navigationFocusControl, + activeDrawer, + activeDrawerSize, + minDrawerSize, + maxDrawerSize, + minGlobalDrawersSizes, + maxGlobalDrawersSizes, + drawers: drawers!, + globalDrawers, + activeGlobalDrawers, + activeGlobalDrawersIds, + activeGlobalDrawersSizes, + onActiveGlobalDrawersChange, + drawersFocusControl, + globalDrawersFocusControl, + splitPanelPosition, + splitPanelToggleConfig, + splitPanelOpen, + splitPanelControlId, + splitPanelFocusControl, + placement, + toolbarState, + setToolbarState, + verticalOffsets, + drawersOpenQueue, + setToolbarHeight, + setNotificationsHeight, + onSplitPanelToggle: onSplitPanelToggleHandler, + onNavigationToggle, + onActiveDrawerChange: onActiveDrawerChangeHandler, + onActiveDrawerResize, + splitPanelAnimationDisabled, + }; + + const splitPanelInternals: SplitPanelProviderProps = { + bottomOffset: 0, + getMaxHeight: () => { + const availableHeight = + document.documentElement.clientHeight - placement.insetBlockStart - placement.insetBlockEnd; + // If the page is likely zoomed in at 200%, allow the split panel to fill the content area. + return availableHeight < 400 ? availableHeight - 40 : availableHeight - 250; + }, + maxWidth: maxSplitPanelSize, + isForcedPosition: splitPanelForcedPosition, + isOpen: splitPanelOpen, + leftOffset: 0, + onPreferencesChange: onSplitPanelPreferencesChangeHandler, + onResize: onSplitPanelResizeHandler, + onToggle: onSplitPanelToggleHandler, + position: splitPanelPosition, + reportSize: size => setSplitPanelReportedSize(size), + reportHeaderHeight: size => setSplitPanelHeaderBlockSize(size), + headerHeight: splitPanelHeaderBlockSize, + rightOffset: 0, + size: splitPanelSize, + topOffset: 0, + setSplitPanelToggle: setSplitPanelToggleConfig, + refs: splitPanelFocusControl.refs, + }; + + const closeFirstDrawer = useStableCallback(() => { + const drawerToClose = drawersOpenQueue[drawersOpenQueue.length - 1]; + if (activeDrawer && activeDrawer?.id === drawerToClose) { + onActiveDrawerChange(null, { initiatedByUserAction: true }); + } else if (activeGlobalDrawersIds.includes(drawerToClose)) { + onActiveGlobalDrawersChange(drawerToClose, { initiatedByUserAction: true }); + } + }); + + useEffect(() => { + // Close navigation drawer on mobile so that the main content is visible + if (isMobile) { + onNavigationToggle(false); + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [isMobile]); + + const getTotalActiveDrawersMinSize = () => { + const combinedDrawers = [...(drawers || []), ...globalDrawers]; + let result = activeGlobalDrawersIds + .map(activeDrawerId => + Math.min( + combinedDrawers.find(drawer => drawer.id === activeDrawerId)?.defaultSize ?? MIN_DRAWER_SIZE, + MIN_DRAWER_SIZE + ) + ) + .reduce((acc, curr) => acc + curr, 0); + if (activeDrawer) { + result += Math.min(activeDrawer?.defaultSize ?? MIN_DRAWER_SIZE, MIN_DRAWER_SIZE); + } + + return result; + }; + + const totalActiveDrawersMinSize = getTotalActiveDrawersMinSize(); + + useEffect(() => { + if (isMobile) { + return; + } + + const activeNavigationWidth = !navigationHide && navigationOpen ? navigationWidth : 0; + const scrollWidth = activeNavigationWidth + CONTENT_PADDING + totalActiveDrawersMinSize; + const hasHorizontalScroll = scrollWidth > placement.inlineSize; + if (hasHorizontalScroll) { + if (!navigationHide && navigationOpen) { + onNavigationToggle(false); + return; + } + + closeFirstDrawer(); + } + }, [ + totalActiveDrawersMinSize, + closeFirstDrawer, + isMobile, + navigationHide, + navigationOpen, + navigationWidth, + onNavigationToggle, + placement.inlineSize, + ]); + + /** + * Returns true if the AppLayout is nested + * Does not apply to iframe + */ + const getIsNestedInAppLayout = (element: HTMLElement | null): boolean => { + let currentElement: Element | null = element?.parentElement ?? null; + + // this traverse is needed only for JSDOM + // in real browsers the globalVar will be propagated to all descendants and this loops exits after initial iteration + while (currentElement) { + if (getComputedStyle(currentElement).getPropertyValue(globalVars.stickyVerticalTopOffset)) { + return true; + } + currentElement = currentElement.parentElement; + } + + return false; + }; + + const splitPanelOffsets = computeSplitPanelOffsets({ + placement, + hasSplitPanel: !!splitPanel, + splitPanelOpen, + splitPanelPosition, + splitPanelFullHeight: splitPanelReportedSize, + splitPanelHeaderHeight: splitPanelHeaderBlockSize, + }); + + return { + navigationAnimationDisabled, + isNested, + isIntersecting, + hasToolbar, + intersectionObserverRef, + rootRef, + splitPanelOffsets, + verticalOffsets, + isMobile, + appLayoutInternals, + toolbarProps, + registered, + resolvedNavigation, + resolvedNavigationOpen, + drawers, + activeGlobalDrawersIds, + activeDrawer, + activeDrawerSize, + splitPanelPosition, + splitPanelOpen, + splitPanelInternals, + }; +}; diff --git a/src/internal/components/chart-popover/test-classes/styles.scss b/src/internal/components/chart-popover/test-classes/styles.scss index 333c7f7e45..beaae30ed2 100644 --- a/src/internal/components/chart-popover/test-classes/styles.scss +++ b/src/internal/components/chart-popover/test-classes/styles.scss @@ -7,4 +7,4 @@ .body, .footer { /* used in test-utils */ -} \ No newline at end of file +}