@cloudscape-design/components 3.0.524 → 3.0.526

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/app-layout/defaults.d.ts +2 -2
  2. package/app-layout/defaults.d.ts.map +1 -1
  3. package/app-layout/defaults.js.map +1 -1
  4. package/app-layout/drawer/interfaces.d.ts +2 -3
  5. package/app-layout/drawer/interfaces.d.ts.map +1 -1
  6. package/app-layout/drawer/interfaces.js.map +1 -1
  7. package/app-layout/drawer/resizable-drawer.d.ts +1 -1
  8. package/app-layout/drawer/resizable-drawer.d.ts.map +1 -1
  9. package/app-layout/drawer/resizable-drawer.js +9 -18
  10. package/app-layout/drawer/resizable-drawer.js.map +1 -1
  11. package/app-layout/index.d.ts.map +1 -1
  12. package/app-layout/index.js +41 -79
  13. package/app-layout/index.js.map +1 -1
  14. package/app-layout/split-panel/constants.d.ts +3 -0
  15. package/app-layout/split-panel/constants.d.ts.map +1 -0
  16. package/app-layout/split-panel/constants.js +5 -0
  17. package/app-layout/split-panel/constants.js.map +1 -0
  18. package/app-layout/split-panel/index.d.ts +1 -0
  19. package/app-layout/split-panel/index.d.ts.map +1 -1
  20. package/app-layout/split-panel/index.js +1 -0
  21. package/app-layout/split-panel/index.js.map +1 -1
  22. package/app-layout/split-panel/provider.d.ts +2 -2
  23. package/app-layout/split-panel/provider.d.ts.map +1 -1
  24. package/app-layout/split-panel/provider.js +18 -16
  25. package/app-layout/split-panel/provider.js.map +1 -1
  26. package/app-layout/utils/use-app-layout-rect.d.ts +8 -0
  27. package/app-layout/utils/use-app-layout-rect.d.ts.map +1 -0
  28. package/app-layout/utils/{use-content-width.js → use-app-layout-rect.js} +6 -5
  29. package/app-layout/utils/use-app-layout-rect.js.map +1 -0
  30. package/app-layout/visual-refresh/split-panel.js +1 -1
  31. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  32. package/button-dropdown/styles.css.js +15 -15
  33. package/button-dropdown/styles.scoped.css +23 -23
  34. package/button-dropdown/styles.selectors.js +15 -15
  35. package/container/index.d.ts +1 -1
  36. package/container/index.d.ts.map +1 -1
  37. package/container/index.js +5 -3
  38. package/container/index.js.map +1 -1
  39. package/flashbar/common.d.ts +0 -1
  40. package/flashbar/common.d.ts.map +1 -1
  41. package/flashbar/common.js +3 -2
  42. package/flashbar/common.js.map +1 -1
  43. package/internal/base-component/styles.scoped.css +0 -5
  44. package/internal/environment.js +1 -1
  45. package/internal/environment.json +1 -1
  46. package/internal/generated/theming/index.cjs +0 -31
  47. package/internal/generated/theming/index.js +0 -31
  48. package/internal/hooks/use-base-component/index.d.ts +2 -1
  49. package/internal/hooks/use-base-component/index.d.ts.map +1 -1
  50. package/internal/hooks/use-base-component/index.js +2 -2
  51. package/internal/hooks/use-base-component/index.js.map +1 -1
  52. package/internal/hooks/use-telemetry/index.d.ts +2 -1
  53. package/internal/hooks/use-telemetry/index.d.ts.map +1 -1
  54. package/internal/hooks/use-telemetry/index.js +2 -2
  55. package/internal/hooks/use-telemetry/index.js.map +1 -1
  56. package/internal/manifest.json +1 -1
  57. package/package.json +1 -1
  58. package/table/index.d.ts.map +1 -1
  59. package/table/index.js +11 -1
  60. package/table/index.js.map +1 -1
  61. package/app-layout/utils/use-content-width.d.ts +0 -5
  62. package/app-layout/utils/use-content-width.d.ts.map +0 -1
  63. package/app-layout/utils/use-content-width.js.map +0 -1
  64. package/app-layout/utils/use-window-width.d.ts +0 -2
  65. package/app-layout/utils/use-window-width.d.ts.map +0 -1
  66. package/app-layout/utils/use-window-width.js +0 -13
  67. package/app-layout/utils/use-window-width.js.map +0 -1
@@ -2,8 +2,8 @@ import { AppLayoutProps } from './interfaces';
2
2
  export interface AppLayoutState {
3
3
  navigationOpen?: boolean;
4
4
  toolsOpen?: boolean;
5
- minContentWidth?: number;
5
+ minContentWidth: number;
6
6
  maxContentWidth?: number | undefined;
7
7
  }
8
- export declare function applyDefaults(contentType: AppLayoutProps.ContentType, stateFromProps: AppLayoutState, isRefresh: boolean): AppLayoutState;
8
+ export declare function applyDefaults(contentType: AppLayoutProps.ContentType, stateFromProps: Pick<AppLayoutProps, 'minContentWidth' | 'maxContentWidth' | 'navigationOpen' | 'toolsOpen'>, isRefresh: boolean): AppLayoutState;
9
9
  //# sourceMappingURL=defaults.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"lib/default/","sources":["app-layout/defaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAqC9C,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,cAAc,CAAC,WAAW,EACvC,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,OAAO,GACjB,cAAc,CAWhB"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"lib/default/","sources":["app-layout/defaults.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAqC9C,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,wBAAgB,aAAa,CAC3B,WAAW,EAAE,cAAc,CAAC,WAAW,EACvC,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,WAAW,CAAC,EAC5G,SAAS,EAAE,OAAO,GACjB,cAAc,CAWhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.js","sourceRoot":"lib/default/","sources":["app-layout/defaults.ts"],"names":[],"mappings":"AAIA,MAAM,uBAAuB,GAAmB;IAC9C,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,GAAG;IACpB,eAAe,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAM,QAAQ,GAAuD;IACnE,OAAO,oBACF,uBAAuB,CAC3B;IACD,SAAS,oBACJ,uBAAuB,CAC3B;IACD,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,IAAI,EAAE;QACJ,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,GAAG;KACrB;IACD,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,MAAM,EAAE;QACN,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,IAAI;KACtB;CACF,CAAC;AASF,MAAM,UAAU,aAAa,CAC3B,WAAuC,EACvC,cAA8B,EAC9B,SAAkB;;IAElB,MAAM,mBAAmB,GAAG,SAAS;QACnC,CAAC,iCAAM,QAAQ,CAAC,WAAW,CAAC,KAAE,eAAe,EAAE,SAAS,IACxD,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE1B,OAAO;QACL,eAAe,EAAE,MAAA,cAAc,CAAC,eAAe,mCAAI,mBAAmB,CAAC,eAAe;QACtF,eAAe,EAAE,MAAA,cAAc,CAAC,eAAe,mCAAI,mBAAmB,CAAC,eAAe;QACtF,cAAc,EAAE,MAAA,cAAc,CAAC,cAAc,mCAAI,mBAAmB,CAAC,cAAc;QACnF,SAAS,EAAE,MAAA,cAAc,CAAC,SAAS,mCAAI,mBAAmB,CAAC,SAAS;KACrE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AppLayoutProps } from './interfaces';\n\nconst defaultContentTypeState: AppLayoutState = {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n};\n\nconst defaults: Record<AppLayoutProps.ContentType, AppLayoutState> = {\n default: {\n ...defaultContentTypeState,\n },\n dashboard: {\n ...defaultContentTypeState,\n },\n cards: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n form: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 800,\n },\n table: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n wizard: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 1080,\n },\n};\n\nexport interface AppLayoutState {\n navigationOpen?: boolean;\n toolsOpen?: boolean;\n minContentWidth?: number;\n maxContentWidth?: number | undefined;\n}\n\nexport function applyDefaults(\n contentType: AppLayoutProps.ContentType,\n stateFromProps: AppLayoutState,\n isRefresh: boolean\n): AppLayoutState {\n const contentTypeDefaults = isRefresh\n ? { ...defaults[contentType], maxContentWidth: undefined }\n : defaults[contentType];\n\n return {\n maxContentWidth: stateFromProps.maxContentWidth ?? contentTypeDefaults.maxContentWidth,\n minContentWidth: stateFromProps.minContentWidth ?? contentTypeDefaults.minContentWidth,\n navigationOpen: stateFromProps.navigationOpen ?? contentTypeDefaults.navigationOpen,\n toolsOpen: stateFromProps.toolsOpen ?? contentTypeDefaults.toolsOpen,\n };\n}\n"]}
1
+ {"version":3,"file":"defaults.js","sourceRoot":"lib/default/","sources":["app-layout/defaults.ts"],"names":[],"mappings":"AAIA,MAAM,uBAAuB,GAAmB;IAC9C,cAAc,EAAE,IAAI;IACpB,eAAe,EAAE,GAAG;IACpB,eAAe,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAM,QAAQ,GAAuD;IACnE,OAAO,oBACF,uBAAuB,CAC3B;IACD,SAAS,oBACJ,uBAAuB,CAC3B;IACD,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,IAAI,EAAE;QACJ,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,GAAG;KACrB;IACD,KAAK,EAAE;QACL,cAAc,EAAE,IAAI;QACpB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,SAAS;KAC3B;IACD,MAAM,EAAE;QACN,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,GAAG;QACpB,eAAe,EAAE,IAAI;KACtB;CACF,CAAC;AASF,MAAM,UAAU,aAAa,CAC3B,WAAuC,EACvC,cAA4G,EAC5G,SAAkB;;IAElB,MAAM,mBAAmB,GAAG,SAAS;QACnC,CAAC,iCAAM,QAAQ,CAAC,WAAW,CAAC,KAAE,eAAe,EAAE,SAAS,IACxD,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAE1B,OAAO;QACL,eAAe,EAAE,MAAA,cAAc,CAAC,eAAe,mCAAI,mBAAmB,CAAC,eAAe;QACtF,eAAe,EAAE,MAAA,cAAc,CAAC,eAAe,mCAAI,mBAAmB,CAAC,eAAe;QACtF,cAAc,EAAE,MAAA,cAAc,CAAC,cAAc,mCAAI,mBAAmB,CAAC,cAAc;QACnF,SAAS,EAAE,MAAA,cAAc,CAAC,SAAS,mCAAI,mBAAmB,CAAC,SAAS;KACrE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AppLayoutProps } from './interfaces';\n\nconst defaultContentTypeState: AppLayoutState = {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n};\n\nconst defaults: Record<AppLayoutProps.ContentType, AppLayoutState> = {\n default: {\n ...defaultContentTypeState,\n },\n dashboard: {\n ...defaultContentTypeState,\n },\n cards: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n form: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 800,\n },\n table: {\n navigationOpen: true,\n minContentWidth: 280,\n maxContentWidth: undefined,\n },\n wizard: {\n navigationOpen: false,\n minContentWidth: 280,\n maxContentWidth: 1080,\n },\n};\n\nexport interface AppLayoutState {\n navigationOpen?: boolean;\n toolsOpen?: boolean;\n minContentWidth: number;\n maxContentWidth?: number | undefined;\n}\n\nexport function applyDefaults(\n contentType: AppLayoutProps.ContentType,\n stateFromProps: Pick<AppLayoutProps, 'minContentWidth' | 'maxContentWidth' | 'navigationOpen' | 'toolsOpen'>,\n isRefresh: boolean\n): AppLayoutState {\n const contentTypeDefaults = isRefresh\n ? { ...defaults[contentType], maxContentWidth: undefined }\n : defaults[contentType];\n\n return {\n maxContentWidth: stateFromProps.maxContentWidth ?? contentTypeDefaults.maxContentWidth,\n minContentWidth: stateFromProps.minContentWidth ?? contentTypeDefaults.minContentWidth,\n navigationOpen: stateFromProps.navigationOpen ?? contentTypeDefaults.navigationOpen,\n toolsOpen: stateFromProps.toolsOpen ?? contentTypeDefaults.toolsOpen,\n };\n}\n"]}
@@ -43,9 +43,8 @@ export interface ResizableDrawerProps extends DesktopDrawerProps {
43
43
  size: number;
44
44
  id: string;
45
45
  }) => void;
46
- minSize: number;
47
- size: number;
48
- getMaxWidth: () => number;
46
+ minWidth: number;
47
+ maxWidth: number;
49
48
  refs: FocusControlRefs;
50
49
  toolsContent: React.ReactNode;
51
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE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GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,yBAAyB,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,yBAAyB,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":";AA6FA,sBAAsB","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { NonCancelableEventHandler } from '../../internal/events';\n\nimport { FocusControlRefs } from '../utils/use-focus-control';\n\nexport interface DesktopDrawerProps {\n id?: string;\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<{ focus(): void }>;\n close: React.Ref<{ focus(): void }>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: {\n mainLabel: string | undefined;\n closeLabel: string | undefined;\n openLabel: string | undefined;\n resizeHandle?: string;\n };\n children: React.ReactNode;\n hideOpenButton?: boolean;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n isHidden?: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer: AppLayoutProps.Drawer | undefined;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n minSize: number;\n size: number;\n getMaxWidth: () => number;\n refs: FocusControlRefs;\n toolsContent: React.ReactNode;\n}\n\nexport interface DrawerTriggersBarProps {\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers: Array<AppLayoutProps.Drawer>;\n activeDrawerId: string | null;\n onDrawerChange: (newDrawerId: string | null) => void;\n ariaLabels: AppLayoutProps['ariaLabels'];\n drawerRefs: FocusControlRefs;\n}\n\n// Beta interfaces\n// TODO: remove after beta consumers migrate to prod API\ninterface BetaDrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\ninterface BetaDrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: BetaDrawerItemAriaLabels;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n badge?: boolean;\n}\n\nexport interface BetaDrawersProps {\n items: Array<BetaDrawerItem>;\n activeDrawerId?: string | null;\n onChange?: NonCancelableEventHandler<string | null>;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n ariaLabel?: string;\n overflowAriaLabel?: string;\n overflowWithBadgeAriaLabel?: string;\n}\n// Beta interfaces end\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/interfaces.ts"],"names":[],"mappings":";AA4FA,sBAAsB","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport { togglesConfig } from '../toggles';\nimport { AppLayoutProps } from '../interfaces';\nimport { IconProps } from '../../icon/interfaces';\nimport { NonCancelableEventHandler } from '../../internal/events';\n\nimport { FocusControlRefs } from '../utils/use-focus-control';\n\nexport interface DesktopDrawerProps {\n id?: string;\n contentClassName: string;\n toggleClassName: string;\n closeClassName: string;\n toggleRefs: {\n toggle: React.Ref<{ focus(): void }>;\n close: React.Ref<{ focus(): void }>;\n };\n width: number;\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n ariaLabels: {\n mainLabel: string | undefined;\n closeLabel: string | undefined;\n openLabel: string | undefined;\n resizeHandle?: string;\n };\n children: React.ReactNode;\n hideOpenButton?: boolean;\n type: keyof typeof togglesConfig;\n isMobile: boolean;\n isOpen: boolean;\n isHidden?: boolean;\n onToggle: (isOpen: boolean) => void;\n onClick?: (event: React.MouseEvent) => void;\n onLoseFocus?: (event: React.FocusEvent) => void;\n resizeHandle?: React.ReactNode;\n}\n\nexport interface ResizableDrawerProps extends DesktopDrawerProps {\n activeDrawer: AppLayoutProps.Drawer | undefined;\n onResize: (resizeDetail: { size: number; id: string }) => void;\n minWidth: number;\n maxWidth: number;\n refs: FocusControlRefs;\n toolsContent: React.ReactNode;\n}\n\nexport interface DrawerTriggersBarProps {\n topOffset: number | undefined;\n bottomOffset: number | undefined;\n isMobile: boolean;\n drawers: Array<AppLayoutProps.Drawer>;\n activeDrawerId: string | null;\n onDrawerChange: (newDrawerId: string | null) => void;\n ariaLabels: AppLayoutProps['ariaLabels'];\n drawerRefs: FocusControlRefs;\n}\n\n// Beta interfaces\n// TODO: remove after beta consumers migrate to prod API\ninterface BetaDrawerItemAriaLabels {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n}\n\ninterface BetaDrawerItem {\n id: string;\n content: React.ReactNode;\n trigger: {\n iconName?: IconProps.Name;\n iconSvg?: React.ReactNode;\n };\n ariaLabels: BetaDrawerItemAriaLabels;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n badge?: boolean;\n}\n\nexport interface BetaDrawersProps {\n items: Array<BetaDrawerItem>;\n activeDrawerId?: string | null;\n onChange?: NonCancelableEventHandler<string | null>;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n ariaLabel?: string;\n overflowAriaLabel?: string;\n overflowWithBadgeAriaLabel?: string;\n}\n// Beta interfaces end\n"]}
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ResizableDrawerProps } from './interfaces';
3
- export declare const ResizableDrawer: ({ onResize, size, minSize, getMaxWidth, refs, activeDrawer, toolsContent, ...props }: ResizableDrawerProps) => JSX.Element;
3
+ export declare const ResizableDrawer: ({ onResize, maxWidth, minWidth, refs, activeDrawer, toolsContent, ...props }: ResizableDrawerProps) => JSX.Element;
4
4
  //# sourceMappingURL=resizable-drawer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-drawer.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,eAAe,yFASzB,oBAAoB,gBAyEtB,CAAC"}
1
+ {"version":3,"file":"resizable-drawer.d.ts","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAeA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD,eAAO,MAAM,eAAe,iFAQzB,oBAAoB,gBAiEtB,CAAC"}
@@ -2,7 +2,7 @@ import { __rest } from "tslib";
2
2
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  import clsx from 'clsx';
5
- import React, { useEffect, useState, useRef } from 'react';
5
+ import React, { useRef } from 'react';
6
6
  import { getLimitedValue } from '../../split-panel/utils/size-utils';
7
7
  import { usePointerEvents } from '../utils/use-pointer-events';
8
8
  import { useKeyboardEvents } from '../utils/use-keyboard-events';
@@ -14,23 +14,14 @@ import styles from './styles.css.js';
14
14
  import { TOOLS_DRAWER_ID } from '../utils/use-drawers';
15
15
  export const ResizableDrawer = (_a) => {
16
16
  var _b, _c, _d, _e;
17
- var { onResize, size, minSize, getMaxWidth, refs, activeDrawer, toolsContent } = _a, props = __rest(_a, ["onResize", "size", "minSize", "getMaxWidth", "refs", "activeDrawer", "toolsContent"]);
18
- const { isOpen, children, isMobile } = props;
19
- const [relativeSize, setRelativeSize] = useState(0);
20
- useEffect(() => {
21
- // effects are called inside out in the components tree
22
- // wait one frame to allow app-layout to complete its calculations
23
- const handle = requestAnimationFrame(() => {
24
- const maxSize = getMaxWidth();
25
- setRelativeSize((size / maxSize) * 100);
26
- });
27
- return () => cancelAnimationFrame(handle);
28
- }, [size, getMaxWidth]);
29
- const setSidePanelWidth = (width) => {
30
- const maxWidth = getMaxWidth();
31
- const size = getLimitedValue(minSize, width, maxWidth);
17
+ var { onResize, maxWidth, minWidth, refs, activeDrawer, toolsContent } = _a, props = __rest(_a, ["onResize", "maxWidth", "minWidth", "refs", "activeDrawer", "toolsContent"]);
18
+ const { isOpen, children, width, isMobile } = props;
19
+ const clampedWidth = getLimitedValue(minWidth, width, maxWidth);
20
+ const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;
21
+ const setSidePanelWidth = (newWidth) => {
22
+ const size = getLimitedValue(minWidth, newWidth, maxWidth);
32
23
  const id = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id;
33
- if (isOpen && id && maxWidth >= minSize) {
24
+ if (isOpen && id && maxWidth >= minWidth) {
34
25
  onResize({ size, id });
35
26
  }
36
27
  };
@@ -45,7 +36,7 @@ export const ResizableDrawer = (_a) => {
45
36
  const onKeyDown = useKeyboardEvents(sizeControlProps);
46
37
  const resizeHandle = (React.createElement("div", { ref: refs.slider, role: "slider", tabIndex: 0, "aria-label": (_b = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _b === void 0 ? void 0 : _b.resizeHandle, "aria-valuemax": 100, "aria-valuemin": 0, "aria-valuenow": relativeSize, className: clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`], testutilStyles['drawers-slider']), onKeyDown: onKeyDown, onPointerDown: onSliderPointerDown },
47
38
  React.createElement(ResizeHandler, { className: clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`]) })));
48
- return (React.createElement(Drawer, Object.assign({}, props, { id: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id, ref: drawerRefObject, isHidden: !activeDrawer, resizeHandle: !isMobile &&
39
+ return (React.createElement(Drawer, Object.assign({}, props, { id: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id, width: clampedWidth, ref: drawerRefObject, isHidden: !activeDrawer, resizeHandle: !isMobile &&
49
40
  (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && React.createElement("div", { className: splitPanelStyles['slider-wrapper-side'] }, resizeHandle), ariaLabels: {
50
41
  openLabel: (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.triggerButton,
51
42
  mainLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.drawerName,
@@ -1 +1 @@
1
- {"version":3,"file":"resizable-drawer.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,cAAc,MAAM,+BAA+B,CAAC;AAE3D,OAAO,aAAa,MAAM,wCAAwC,CAAC;AACnE,OAAO,gBAAgB,MAAM,iCAAiC,CAAC;AAC/D,OAAO,MAAM,MAAM,iBAAiB,C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AAS,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,UAAU;YAC/C,UAAU,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,WAAW;SAClD;QAEA,YAAY,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,MAAK,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,IAAG,YAAY,CAAO;QAC/G,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,MAAK,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAChD,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useEffect, useState, useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../utils/use-pointer-events';\nimport { useKeyboardEvents } from '../utils/use-keyboard-events';\nimport { SizeControlProps } from '../utils/interfaces';\nimport { Drawer } from './index';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport { ResizableDrawerProps } from './interfaces';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\nexport const ResizableDrawer = ({\n onResize,\n size,\n minSize,\n getMaxWidth,\n refs,\n activeDrawer,\n toolsContent,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, isMobile } = props;\n const [relativeSize, setRelativeSize] = useState(0);\n\n useEffect(() => {\n // effects are called inside out in the components tree\n // wait one frame to allow app-layout to complete its calculations\n const handle = requestAnimationFrame(() => {\n const maxSize = getMaxWidth();\n setRelativeSize((size / maxSize) * 100);\n });\n return () => cancelAnimationFrame(handle);\n }, [size, getMaxWidth]);\n\n const setSidePanelWidth = (width: number) => {\n const maxWidth = getMaxWidth();\n const size = getLimitedValue(minSize, width, maxWidth);\n const id = activeDrawer?.id;\n\n if (isOpen && id && maxWidth >= minSize) {\n onResize({ size, id });\n }\n };\n\n const drawerRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: refs.slider,\n onResize: setSidePanelWidth,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={activeDrawer?.ariaLabels?.resizeHandle}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`], testutilStyles['drawers-slider'])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`])} />\n </div>\n );\n\n return (\n <Drawer\n {...props}\n id={activeDrawer?.id}\n ref={drawerRefObject}\n isHidden={!activeDrawer}\n resizeHandle={\n !isMobile &&\n activeDrawer?.resizable && <div className={splitPanelStyles['slider-wrapper-side']}>{resizeHandle}</div>\n }\n ariaLabels={{\n openLabel: activeDrawer?.ariaLabels?.triggerButton,\n mainLabel: activeDrawer?.ariaLabels?.drawerName,\n closeLabel: activeDrawer?.ariaLabels?.closeButton,\n }}\n >\n {toolsContent && <div className={clsx(activeDrawer?.id !== TOOLS_DRAWER_ID && styles.hide)}>{toolsContent}</div>}\n {activeDrawer?.id !== TOOLS_DRAWER_ID ? children : null}\n </Drawer>\n );\n};\n"]}
1
+ {"version":3,"file":"resizable-drawer.js","sourceRoot":"lib/default/","sources":["app-layout/drawer/resizable-drawer.tsx"],"names":[],"mappings":";AAAA,qEAAq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,YAAY,uBAAZ,YAAY,CAAE,SAAS,CAAA,IAAI,6BAAK,SAAS,EAAE,gBAAgB,CAAC,qBAAqB,CAAC,IAAG,YAAY,CAAO,EAE1G,UAAU,EAAE;YACV,SAAS,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,aAAa;YAClD,SAAS,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,UAAU;YAC/C,UAAU,EAAE,MAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,0CAAE,WAAW;SAClD;QAEA,YAAY,IAAI,6BAAK,SAAS,EAAE,IAAI,CAAC,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,MAAK,eAAe,IAAI,MAAM,CAAC,IAAI,CAAC,IAAG,YAAY,CAAO;QAC/G,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,EAAE,MAAK,eAAe,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAChD,CACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport clsx from 'clsx';\nimport React, { useRef } from 'react';\n\nimport { getLimitedValue } from '../../split-panel/utils/size-utils';\nimport { usePointerEvents } from '../utils/use-pointer-events';\nimport { useKeyboardEvents } from '../utils/use-keyboard-events';\nimport { SizeControlProps } from '../utils/interfaces';\nimport { Drawer } from './index';\nimport testutilStyles from '../test-classes/styles.css.js';\n\nimport ResizeHandler from '../../split-panel/icons/resize-handler';\nimport splitPanelStyles from '../../split-panel/styles.css.js';\nimport styles from './styles.css.js';\nimport { ResizableDrawerProps } from './interfaces';\nimport { TOOLS_DRAWER_ID } from '../utils/use-drawers';\n\nexport const ResizableDrawer = ({\n onResize,\n maxWidth,\n minWidth,\n refs,\n activeDrawer,\n toolsContent,\n ...props\n}: ResizableDrawerProps) => {\n const { isOpen, children, width, isMobile } = props;\n\n const clampedWidth = getLimitedValue(minWidth, width, maxWidth);\n const relativeSize = ((clampedWidth - minWidth) / (maxWidth - minWidth)) * 100;\n\n const setSidePanelWidth = (newWidth: number) => {\n const size = getLimitedValue(minWidth, newWidth, maxWidth);\n const id = activeDrawer?.id;\n\n if (isOpen && id && maxWidth >= minWidth) {\n onResize({ size, id });\n }\n };\n\n const drawerRefObject = useRef<HTMLDivElement>(null);\n\n const sizeControlProps: SizeControlProps = {\n position: 'side',\n panelRef: drawerRefObject,\n handleRef: refs.slider,\n onResize: setSidePanelWidth,\n };\n\n const onSliderPointerDown = usePointerEvents(sizeControlProps);\n const onKeyDown = useKeyboardEvents(sizeControlProps);\n\n const resizeHandle = (\n <div\n ref={refs.slider}\n role=\"slider\"\n tabIndex={0}\n aria-label={activeDrawer?.ariaLabels?.resizeHandle}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuenow={relativeSize}\n className={clsx(splitPanelStyles.slider, splitPanelStyles[`slider-side`], testutilStyles['drawers-slider'])}\n onKeyDown={onKeyDown}\n onPointerDown={onSliderPointerDown}\n >\n <ResizeHandler className={clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`])} />\n </div>\n );\n\n return (\n <Drawer\n {...props}\n id={activeDrawer?.id}\n width={clampedWidth}\n ref={drawerRefObject}\n isHidden={!activeDrawer}\n resizeHandle={\n !isMobile &&\n activeDrawer?.resizable && <div className={splitPanelStyles['slider-wrapper-side']}>{resizeHandle}</div>\n }\n ariaLabels={{\n openLabel: activeDrawer?.ariaLabels?.triggerButton,\n mainLabel: activeDrawer?.ariaLabels?.drawerName,\n closeLabel: activeDrawer?.ariaLabels?.closeButton,\n }}\n >\n {toolsContent && <div className={clsx(activeDrawer?.id !== TOOLS_DRAWER_ID && styles.hide)}>{toolsContent}</div>}\n {activeDrawer?.id !== TOOLS_DRAWER_ID ? children : null}\n </Drawer>\n );\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAM7F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAmC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAiCd,CAAC;AAkpBF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"lib/default/","sources":["app-layout/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAwE,MAAM,OAAO,CAAC;AAM7F,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAuC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FA+Cd,CAAC;AAklBF,eAAe,SAAS,CAAC"}
@@ -11,7 +11,6 @@ import { applyDefaults } from './defaults';
11
11
  import { Notifications } from './notifications';
12
12
  import { MobileToolbar } from './mobile-toolbar';
13
13
  import { useFocusControl } from './utils/use-focus-control';
14
- import useWindowWidth from './utils/use-window-width';
15
14
  import useContentHeight from './utils/use-content-height';
16
15
  import styles from './styles.css.js';
17
16
  import testutilStyles from './test-classes/styles.css.js';
@@ -24,8 +23,8 @@ import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
24
23
  import ContentWrapper from './content-wrapper';
25
24
  import { Drawer, DrawerTriggersBar } from './drawer';
26
25
  import { ResizableDrawer } from './drawer/resizable-drawer';
27
- import { SplitPanelProvider, SideSplitPanelDrawer } from './split-panel';
28
- import useAppLayoutOffsets from './utils/use-content-width';
26
+ import { SPLIT_PANEL_MIN_WIDTH, SideSplitPanelDrawer, SplitPanelProvider, } from './split-panel';
27
+ import useAppLayoutRect from './utils/use-app-layout-rect';
29
28
  import { isDevelopment } from '../internal/is-development';
30
29
  import { useStableCallback, warnOnce } from '@cloudscape-design/component-toolkit/internal';
31
30
  import RefreshedAppLayout from './visual-refresh';
@@ -37,7 +36,21 @@ import { togglesConfig } from './toggles';
37
36
  const AppLayout = React.forwardRef((_a, ref) => {
38
37
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
39
38
  var { contentType = 'default', headerSelector = '#b #h', footerSelector = '#b #f' } = _a, rest = __rest(_a, ["contentType", "headerSelector", "footerSelector"]);
40
- const { __internalRootRef } = useBaseComponent('AppLayout');
39
+ const { __internalRootRef } = useBaseComponent('AppLayout', {
40
+ props: {
41
+ contentType,
42
+ disableContentPaddings: rest.disableContentPaddings,
43
+ disableBodyScroll: rest.disableBodyScroll,
44
+ navigationWidth: rest.navigationWidth,
45
+ navigationHide: rest.navigationHide,
46
+ toolsHide: rest.toolsHide,
47
+ toolsWidth: rest.toolsWidth,
48
+ maxContentWidth: rest.maxContentWidth,
49
+ minContentWidth: rest.minContentWidth,
50
+ stickyNotifications: rest.stickyNotifications,
51
+ disableContentHeaderOverlap: rest.disableContentHeaderOverlap,
52
+ },
53
+ });
41
54
  const isRefresh = useVisualRefresh();
42
55
  const i18n = useInternalI18n('app-layout');
43
56
  const ariaLabels = {
@@ -110,7 +123,6 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
110
123
  const navigationVisible = !navigationHide && navigationOpen;
111
124
  const toolsVisible = !toolsHide && toolsOpen;
112
125
  const { contentHeightStyle, headerHeight, footerHeight } = useContentHeight(headerSelector, footerSelector, disableBodyScroll);
113
- const [isSplitpanelForcedPosition, setIsSplitpanelForcedPosition] = useState(false);
114
126
  const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.contentBoxHeight);
115
127
  const anyPanelOpen = navigationVisible || toolsVisible || !!activeDrawer;
116
128
  const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false;
@@ -134,14 +146,12 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
134
146
  const closedDrawerWidth = 40;
135
147
  const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth;
136
148
  const getEffectiveToolsWidth = () => {
137
- if (toolsHide &&
138
- (!splitPanelDisplayed || (splitPanelPreferences === null || splitPanelPreferences === void 0 ? void 0 : splitPanelPreferences.position) !== 'side') &&
139
- (!drawers || drawers.length === 0)) {
140
- return 0;
141
- }
142
149
  if (activeDrawer && activeDrawerSize) {
143
150
  return activeDrawerSize;
144
151
  }
152
+ if (toolsHide || drawers) {
153
+ return 0;
154
+ }
145
155
  if (toolsOpen) {
146
156
  return toolsWidth;
147
157
  }
@@ -174,30 +184,6 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
174
184
  setSplitPanelLastInteraction({ type: splitPanelOpen ? 'close' : 'open' });
175
185
  fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });
176
186
  }, [setSplitPanelOpen, splitPanelOpen, onSplitPanelToggle, setSplitPanelLastInteraction]);
177
- const getSplitPanelMaxWidth = useStableCallback(() => {
178
- if (!mainContentRef.current || !defaults.minContentWidth) {
179
- return NaN;
180
- }
181
- const width = parseInt(getComputedStyle(mainContentRef.current).width);
182
- // when disableContentPaddings is true there is less available space,
183
- // so we subtract space-scaled-2x-xxxl * 2 for left and right padding
184
- const contentPadding = disableContentPaddings ? 80 : 0;
185
- const spaceAvailable = width - defaults.minContentWidth - contentPadding;
186
- const spaceTaken = finalSplitPanePosition === 'side' ? splitPanelSize : 0;
187
- return Math.max(0, spaceTaken + spaceAvailable);
188
- });
189
- const getDrawerMaxWidth = useStableCallback(() => {
190
- if (!mainContentRef.current || !defaults.minContentWidth) {
191
- return NaN;
192
- }
193
- // Either use the computed width of the drawer or the drawerSize as defined.
194
- const width = parseInt(getComputedStyle(mainContentRef.current).width || `${activeDrawerSize}`);
195
- // when disableContentPaddings is true there is less available space,
196
- // so we subtract space-scaled-2x-xxxl * 2 for left and right padding
197
- const contentPadding = disableContentPaddings ? 80 : 0;
198
- const spaceAvailable = width - defaults.minContentWidth - contentPadding;
199
- return Math.max(0, activeDrawerSize + spaceAvailable);
200
- });
201
187
  const getSplitPanelMaxHeight = useStableCallback(() => {
202
188
  if (typeof document === 'undefined') {
203
189
  return 0; // render the split panel in its minimum possible size
@@ -213,65 +199,41 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
213
199
  : availableHeight - MAIN_PANEL_MIN_HEIGHT;
214
200
  }
215
201
  });
216
- const finalSplitPanePosition = isSplitpanelForcedPosition ? 'bottom' : splitPanelPosition;
217
- const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === 'side';
218
- const splitPanelOpenOnTheSide = splitPaneAvailableOnTheSide && splitPanelOpen;
219
- const toggleButtonsBarWidth = 0;
220
- const windowWidth = useWindowWidth();
221
- const { left: leftOffset, right: rightOffset } = useAppLayoutOffsets(rootRef.current);
222
- const contentWidthWithSplitPanel = windowWidth -
202
+ const { left: leftOffset, right: rightOffset, width: documentWidth } = useAppLayoutRect(rootRef.current);
203
+ const rightDrawerBarWidth = drawers ? (drawers.length > 1 ? closedDrawerWidth : 0) : 0;
204
+ const contentPadding = 80;
205
+ // all content except split-panel + drawers/tools area
206
+ const resizableSpaceAvailable = Math.max(0, documentWidth -
223
207
  leftOffset -
224
208
  rightOffset -
225
- effectiveToolsWidth -
226
209
  effectiveNavigationWidth -
227
- (disableContentPaddings ? 0 : toggleButtonsBarWidth);
228
- const isResizeInvalid = isMobile || (defaults.minContentWidth || 0) > contentWidthWithSplitPanel;
229
- useEffect(() => {
230
- const contentWidth = contentWidthWithSplitPanel - splitPanelSize;
231
- setIsSplitpanelForcedPosition(isMobile || (defaults.minContentWidth || 0) > contentWidth);
232
- // This is a workaround to avoid a forced position due to splitPanelSize, which is
233
- // user controlled variable.
234
- // eslint-disable-next-line react-hooks/exhaustive-deps
235
- }, [contentWidthWithSplitPanel, activeDrawerSize, defaults.minContentWidth, isMobile]);
210
+ defaults.minContentWidth -
211
+ contentPadding -
212
+ rightDrawerBarWidth);
213
+ // if there is no space to display split panel in the side, force to bottom
214
+ const isSplitPanelForcedPosition = isMobile || resizableSpaceAvailable - effectiveToolsWidth < SPLIT_PANEL_MIN_WIDTH;
215
+ const finalSplitPanePosition = isSplitPanelForcedPosition ? 'bottom' : splitPanelPosition;
216
+ const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === 'side';
217
+ const sideSplitPanelSize = splitPaneAvailableOnTheSide ? (splitPanelOpen ? splitPanelSize : closedDrawerWidth) : 0;
218
+ const splitPanelMaxWidth = Math.max(0, resizableSpaceAvailable - effectiveToolsWidth);
219
+ const drawerMaxSize = Math.max(0, resizableSpaceAvailable - sideSplitPanelSize);
236
220
  const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth;
237
- const toolsClosedWidth = toolsHide || isMobile || (!hasDrawers && toolsHide) ? 0 : closedDrawerWidth;
238
221
  const contentMaxWidthStyle = !isMobile ? { maxWidth: defaults.maxContentWidth } : undefined;
239
222
  const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);
240
223
  const [splitPanelReportedHeaderHeight, setSplitPanelReportedHeaderHeight] = useState(0);
241
- const getSplitPanelRightOffset = () => {
242
- if (isMobile) {
243
- return 0;
244
- }
245
- if (hasDrawers) {
246
- if (activeDrawer) {
247
- if (drawers.length === 1) {
248
- return activeDrawerSize;
249
- }
250
- if (!isResizeInvalid && activeDrawerSize) {
251
- return activeDrawerSize + closedDrawerWidth;
252
- }
253
- return toolsWidth + closedDrawerWidth;
254
- }
255
- return drawers.length > 0 ? closedDrawerWidth : 0;
256
- }
257
- if (!toolsHide && toolsOpen) {
258
- return toolsWidth;
259
- }
260
- return toolsClosedWidth;
261
- };
262
224
  const splitPanelContextProps = {
263
225
  topOffset: headerHeight + (finalSplitPanePosition === 'bottom' ? stickyNotificationsHeight || 0 : 0),
264
226
  bottomOffset: footerHeight,
265
227
  leftOffset: leftOffset + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth),
266
- rightOffset: rightOffset + getSplitPanelRightOffset(),
228
+ rightOffset: isMobile ? 0 : rightOffset + effectiveToolsWidth + rightDrawerBarWidth,
267
229
  position: finalSplitPanePosition,
268
230
  size: splitPanelSize,
269
- getMaxWidth: getSplitPanelMaxWidth,
231
+ maxWidth: splitPanelMaxWidth,
270
232
  getMaxHeight: getSplitPanelMaxHeight,
271
233
  disableContentPaddings,
272
234
  contentWidthStyles: contentMaxWidthStyle,
273
235
  isOpen: splitPanelOpen,
274
- isForcedPosition: isSplitpanelForcedPosition,
236
+ isForcedPosition: isSplitPanelForcedPosition,
275
237
  onResize: onSplitPanelSizeSet,
276
238
  onToggle: onSplitPanelToggleHandler,
277
239
  onPreferencesChange: onSplitPanelPreferencesSet,
@@ -295,7 +257,7 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
295
257
  // 2. Tools panel is present and open
296
258
  toolsVisible ||
297
259
  // 3. Split panel is open in side position
298
- splitPanelOpenOnTheSide,
260
+ (splitPaneAvailableOnTheSide && splitPanelOpen),
299
261
  isMobile,
300
262
  };
301
263
  useImperativeHandle(ref, () => ({
@@ -370,13 +332,13 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
370
332
  closeLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.closeButton,
371
333
  mainLabel: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels.drawerName,
372
334
  resizeHandle: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.resizeHandle,
373
- }, width: !isResizeInvalid ? activeDrawerSize : toolsWidth, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: isOpen => {
335
+ }, minWidth: minDrawerSize, maxWidth: drawerMaxSize, width: activeDrawerSize, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: isOpen => {
374
336
  if (!isOpen) {
375
337
  focusToolsButtons();
376
338
  focusDrawersButtons();
377
339
  onActiveDrawerChange(null);
378
340
  }
379
- }, isOpen: true, hideOpenButton: true, toggleRefs: drawerRefs, type: "tools", onLoseFocus: loseDrawersFocus, activeDrawer: activeDrawer, minSize: minDrawerSize, size: !isResizeInvalid ? activeDrawerSize : toolsWidth, onResize: changeDetail => onActiveDrawerResize(changeDetail), refs: drawerRefs, getMaxWidth: getDrawerMaxWidth, toolsContent: (_f = drawers === null || drawers === void 0 ? void 0 : drawers.find(drawer => drawer.id === TOOLS_DRAWER_ID)) === null || _f === void 0 ? void 0 : _f.content }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)) : (!toolsHide && (React.createElement(Drawer, { contentClassName: testutilStyles.tools, toggleClassName: testutilStyles['tools-toggle'], closeClassName: testutilStyles['tools-close'], ariaLabels: togglesConfig.tools.getLabels(ariaLabels), width: effectiveToolsWidth, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: onToolsToggle, isOpen: toolsOpen, toggleRefs: toolsRefs, type: "tools", onLoseFocus: loseToolsFocus }, tools))),
341
+ }, isOpen: true, hideOpenButton: true, toggleRefs: drawerRefs, type: "tools", onLoseFocus: loseDrawersFocus, activeDrawer: activeDrawer, onResize: changeDetail => onActiveDrawerResize(changeDetail), refs: drawerRefs, toolsContent: (_f = drawers === null || drawers === void 0 ? void 0 : drawers.find(drawer => drawer.id === TOOLS_DRAWER_ID)) === null || _f === void 0 ? void 0 : _f.content }, activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.content)) : (!toolsHide && (React.createElement(Drawer, { contentClassName: testutilStyles.tools, toggleClassName: testutilStyles['tools-toggle'], closeClassName: testutilStyles['tools-close'], ariaLabels: togglesConfig.tools.getLabels(ariaLabels), width: toolsWidth, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: onToolsToggle, isOpen: toolsOpen, toggleRefs: toolsRefs, type: "tools", onLoseFocus: loseToolsFocus }, tools))),
380
342
  hasDrawers && drawers.length > 0 && (React.createElement(DrawerTriggersBar, { drawerRefs: drawerRefs, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, drawers: drawers, activeDrawerId: activeDrawerId, onDrawerChange: newDrawerId => {
381
343
  if (activeDrawerId !== newDrawerId) {
382
344
  focusToolsButtons();