@cloudscape-design/components 3.0.520 → 3.0.522

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 (69) 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 +3 -2
  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 +18 -9
  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 +76 -26
  13. package/app-layout/index.js.map +1 -1
  14. package/app-layout/split-panel/index.d.ts +0 -1
  15. package/app-layout/split-panel/index.d.ts.map +1 -1
  16. package/app-layout/split-panel/index.js +0 -1
  17. package/app-layout/split-panel/index.js.map +1 -1
  18. package/app-layout/split-panel/provider.d.ts +2 -2
  19. package/app-layout/split-panel/provider.d.ts.map +1 -1
  20. package/app-layout/split-panel/provider.js +16 -18
  21. package/app-layout/split-panel/provider.js.map +1 -1
  22. package/app-layout/utils/use-window-width.d.ts +2 -0
  23. package/app-layout/utils/use-window-width.d.ts.map +1 -0
  24. package/app-layout/utils/use-window-width.js +13 -0
  25. package/app-layout/utils/use-window-width.js.map +1 -0
  26. package/app-layout/visual-refresh/split-panel.js +1 -1
  27. package/app-layout/visual-refresh/split-panel.js.map +1 -1
  28. package/calendar/interfaces.d.ts +23 -3
  29. package/calendar/interfaces.d.ts.map +1 -1
  30. package/calendar/interfaces.js.map +1 -1
  31. package/calendar/internal.d.ts +1 -1
  32. package/calendar/internal.d.ts.map +1 -1
  33. package/calendar/internal.js +5 -4
  34. package/calendar/internal.js.map +1 -1
  35. package/code-editor/ace-themes.d.ts +6 -0
  36. package/code-editor/ace-themes.d.ts.map +1 -1
  37. package/code-editor/ace-themes.js +2 -0
  38. package/code-editor/ace-themes.js.map +1 -1
  39. package/code-editor/index.js +3 -3
  40. package/code-editor/index.js.map +1 -1
  41. package/code-editor/preferences-modal.d.ts +1 -1
  42. package/code-editor/preferences-modal.d.ts.map +1 -1
  43. package/code-editor/preferences-modal.js +3 -6
  44. package/code-editor/preferences-modal.js.map +1 -1
  45. package/code-editor/use-editor.d.ts.map +1 -1
  46. package/code-editor/use-editor.js +4 -2
  47. package/code-editor/use-editor.js.map +1 -1
  48. package/code-editor/util.d.ts +3 -4
  49. package/code-editor/util.d.ts.map +1 -1
  50. package/code-editor/util.js +29 -10
  51. package/code-editor/util.js.map +1 -1
  52. package/date-picker/index.d.ts.map +1 -1
  53. package/date-picker/index.js +6 -2
  54. package/date-picker/index.js.map +1 -1
  55. package/date-picker/interfaces.d.ts +7 -0
  56. package/date-picker/interfaces.d.ts.map +1 -1
  57. package/date-picker/interfaces.js.map +1 -1
  58. package/internal/environment.js +1 -1
  59. package/internal/environment.json +1 -1
  60. package/internal/manifest.json +1 -1
  61. package/package.json +1 -1
  62. package/app-layout/split-panel/constants.d.ts +0 -3
  63. package/app-layout/split-panel/constants.d.ts.map +0 -1
  64. package/app-layout/split-panel/constants.js +0 -5
  65. package/app-layout/split-panel/constants.js.map +0 -1
  66. package/app-layout/utils/use-document-width.d.ts +0 -2
  67. package/app-layout/utils/use-document-width.d.ts.map +0 -1
  68. package/app-layout/utils/use-document-width.js +0 -11
  69. package/app-layout/utils/use-document-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: Pick<AppLayoutProps, 'minContentWidth' | 'maxContentWidth' | 'navigationOpen' | 'toolsOpen'>, isRefresh: boolean): AppLayoutState;
8
+ export declare function applyDefaults(contentType: AppLayoutProps.ContentType, stateFromProps: AppLayoutState, 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,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
+ {"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 +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,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"]}
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"]}
@@ -43,8 +43,9 @@ export interface ResizableDrawerProps extends DesktopDrawerProps {
43
43
  size: number;
44
44
  id: string;
45
45
  }) => void;
46
- minWidth: number;
47
- maxWidth: number;
46
+ minSize: number;
47
+ size: number;
48
+ getMaxWidth: () => number;
48
49
  refs: FocusControlRefs;
49
50
  toolsContent: React.ReactNode;
50
51
  }
@@ -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,gBAAgB,EAAE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AC;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":";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
+ {"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,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { ResizableDrawerProps } from './interfaces';
3
- export declare const ResizableDrawer: ({ onResize, maxWidth, minWidth, refs, activeDrawer, toolsContent, ...props }: ResizableDrawerProps) => JSX.Element;
3
+ export declare const ResizableDrawer: ({ onResize, size, minSize, getMaxWidth, 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,iFAQzB,oBAAoB,gBAiEtB,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,yFASzB,oBAAoB,gBAyEtB,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, { useRef } from 'react';
5
+ import React, { useEffect, useState, 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,14 +14,23 @@ 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, 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);
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);
23
32
  const id = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id;
24
- if (isOpen && id && maxWidth >= minWidth) {
33
+ if (isOpen && id && maxWidth >= minSize) {
25
34
  onResize({ size, id });
26
35
  }
27
36
  };
@@ -36,7 +45,7 @@ export const ResizableDrawer = (_a) => {
36
45
  const onKeyDown = useKeyboardEvents(sizeControlProps);
37
46
  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 },
38
47
  React.createElement(ResizeHandler, { className: clsx(splitPanelStyles['slider-icon'], splitPanelStyles[`slider-icon-side`]) })));
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 &&
48
+ return (React.createElement(Drawer, Object.assign({}, props, { id: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.id, ref: drawerRefObject, isHidden: !activeDrawer, resizeHandle: !isMobile &&
40
49
  (activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.resizable) && React.createElement("div", { className: splitPanelStyles['slider-wrapper-side'] }, resizeHandle), ariaLabels: {
41
50
  openLabel: (_c = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _c === void 0 ? void 0 : _c.triggerButton,
42
51
  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,MAAM,EAAE,MAAM,OAAO,CAAC;AAEtC,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,CAAC;AAErC,OAAO,EAAE,eAAe,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,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
+ {"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,MA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AAE;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, { 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 +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;AAwC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAiCd,CAAC;AAmlBF,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;AAmC9C,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,QAAA,MAAM,SAAS,2FAiCd,CAAC;AAkpBF,eAAe,SAAS,CAAC"}
@@ -11,7 +11,7 @@ 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 useDocumentWidth from './utils/use-document-width';
14
+ import useWindowWidth from './utils/use-window-width';
15
15
  import useContentHeight from './utils/use-content-height';
16
16
  import styles from './styles.css.js';
17
17
  import testutilStyles from './test-classes/styles.css.js';
@@ -24,7 +24,7 @@ import { useVisualRefresh } from '../internal/hooks/use-visual-mode';
24
24
  import ContentWrapper from './content-wrapper';
25
25
  import { Drawer, DrawerTriggersBar } from './drawer';
26
26
  import { ResizableDrawer } from './drawer/resizable-drawer';
27
- import { SPLIT_PANEL_MIN_WIDTH, SideSplitPanelDrawer, SplitPanelProvider, } from './split-panel';
27
+ import { SplitPanelProvider, SideSplitPanelDrawer } from './split-panel';
28
28
  import useAppLayoutOffsets from './utils/use-content-width';
29
29
  import { isDevelopment } from '../internal/is-development';
30
30
  import { useStableCallback, warnOnce } from '@cloudscape-design/component-toolkit/internal';
@@ -110,6 +110,7 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
110
110
  const navigationVisible = !navigationHide && navigationOpen;
111
111
  const toolsVisible = !toolsHide && toolsOpen;
112
112
  const { contentHeightStyle, headerHeight, footerHeight } = useContentHeight(headerSelector, footerSelector, disableBodyScroll);
113
+ const [isSplitpanelForcedPosition, setIsSplitpanelForcedPosition] = useState(false);
113
114
  const [notificationsHeight, notificationsRef] = useContainerQuery(rect => rect.contentBoxHeight);
114
115
  const anyPanelOpen = navigationVisible || toolsVisible || !!activeDrawer;
115
116
  const hasRenderedNotifications = notificationsHeight ? notificationsHeight > 0 : false;
@@ -133,12 +134,14 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
133
134
  const closedDrawerWidth = 40;
134
135
  const effectiveNavigationWidth = navigationHide ? 0 : navigationOpen ? navigationWidth : closedDrawerWidth;
135
136
  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
+ }
136
142
  if (activeDrawer && activeDrawerSize) {
137
143
  return activeDrawerSize;
138
144
  }
139
- if (toolsHide || drawers) {
140
- return 0;
141
- }
142
145
  if (toolsOpen) {
143
146
  return toolsWidth;
144
147
  }
@@ -171,6 +174,30 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
171
174
  setSplitPanelLastInteraction({ type: splitPanelOpen ? 'close' : 'open' });
172
175
  fireNonCancelableEvent(onSplitPanelToggle, { open: !splitPanelOpen });
173
176
  }, [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
+ });
174
201
  const getSplitPanelMaxHeight = useStableCallback(() => {
175
202
  if (typeof document === 'undefined') {
176
203
  return 0; // render the split panel in its minimum possible size
@@ -186,42 +213,65 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
186
213
  : availableHeight - MAIN_PANEL_MIN_HEIGHT;
187
214
  }
188
215
  });
189
- const documentWidth = useDocumentWidth();
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();
190
221
  const { left: leftOffset, right: rightOffset } = useAppLayoutOffsets(rootRef.current);
191
- const rightDrawerBarWidth = drawers ? (drawers.length > 1 ? closedDrawerWidth : 0) : 0;
192
- const contentPadding = 80;
193
- // all content except split-panel + drawers/tools area
194
- const resizableSpaceAvailable = Math.max(0, documentWidth -
222
+ const contentWidthWithSplitPanel = windowWidth -
195
223
  leftOffset -
196
224
  rightOffset -
225
+ effectiveToolsWidth -
197
226
  effectiveNavigationWidth -
198
- defaults.minContentWidth -
199
- contentPadding -
200
- rightDrawerBarWidth);
201
- // if there is no space to display split panel in the side, force to bottom
202
- const isSplitPanelForcedPosition = isMobile || resizableSpaceAvailable - effectiveToolsWidth < SPLIT_PANEL_MIN_WIDTH;
203
- const finalSplitPanePosition = isSplitPanelForcedPosition ? 'bottom' : splitPanelPosition;
204
- const splitPaneAvailableOnTheSide = splitPanelDisplayed && finalSplitPanePosition === 'side';
205
- const sideSplitPanelSize = splitPaneAvailableOnTheSide ? (splitPanelOpen ? splitPanelSize : closedDrawerWidth) : 0;
206
- const splitPanelMaxWidth = Math.max(0, resizableSpaceAvailable - effectiveToolsWidth);
207
- const drawerMaxSize = Math.max(0, resizableSpaceAvailable - sideSplitPanelSize);
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]);
208
236
  const navigationClosedWidth = navigationHide || isMobile ? 0 : closedDrawerWidth;
237
+ const toolsClosedWidth = toolsHide || isMobile || (!hasDrawers && toolsHide) ? 0 : closedDrawerWidth;
209
238
  const contentMaxWidthStyle = !isMobile ? { maxWidth: defaults.maxContentWidth } : undefined;
210
239
  const [splitPanelReportedSize, setSplitPanelReportedSize] = useState(0);
211
240
  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
+ };
212
262
  const splitPanelContextProps = {
213
263
  topOffset: headerHeight + (finalSplitPanePosition === 'bottom' ? stickyNotificationsHeight || 0 : 0),
214
264
  bottomOffset: footerHeight,
215
265
  leftOffset: leftOffset + (isMobile ? 0 : !navigationHide && navigationOpen ? navigationWidth : navigationClosedWidth),
216
- rightOffset: isMobile ? 0 : rightOffset + effectiveToolsWidth + rightDrawerBarWidth,
266
+ rightOffset: rightOffset + getSplitPanelRightOffset(),
217
267
  position: finalSplitPanePosition,
218
268
  size: splitPanelSize,
219
- maxWidth: splitPanelMaxWidth,
269
+ getMaxWidth: getSplitPanelMaxWidth,
220
270
  getMaxHeight: getSplitPanelMaxHeight,
221
271
  disableContentPaddings,
222
272
  contentWidthStyles: contentMaxWidthStyle,
223
273
  isOpen: splitPanelOpen,
224
- isForcedPosition: isSplitPanelForcedPosition,
274
+ isForcedPosition: isSplitpanelForcedPosition,
225
275
  onResize: onSplitPanelSizeSet,
226
276
  onToggle: onSplitPanelToggleHandler,
227
277
  onPreferencesChange: onSplitPanelPreferencesSet,
@@ -245,7 +295,7 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
245
295
  // 2. Tools panel is present and open
246
296
  toolsVisible ||
247
297
  // 3. Split panel is open in side position
248
- (splitPaneAvailableOnTheSide && splitPanelOpen),
298
+ splitPanelOpenOnTheSide,
249
299
  isMobile,
250
300
  };
251
301
  useImperativeHandle(ref, () => ({
@@ -320,13 +370,13 @@ const OldAppLayout = React.forwardRef((_a, ref) => {
320
370
  closeLabel: (_d = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _d === void 0 ? void 0 : _d.closeButton,
321
371
  mainLabel: activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels.drawerName,
322
372
  resizeHandle: (_e = activeDrawer === null || activeDrawer === void 0 ? void 0 : activeDrawer.ariaLabels) === null || _e === void 0 ? void 0 : _e.resizeHandle,
323
- }, minWidth: minDrawerSize, maxWidth: drawerMaxSize, width: activeDrawerSize, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: isOpen => {
373
+ }, width: !isResizeInvalid ? activeDrawerSize : toolsWidth, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, onToggle: isOpen => {
324
374
  if (!isOpen) {
325
375
  focusToolsButtons();
326
376
  focusDrawersButtons();
327
377
  onActiveDrawerChange(null);
328
378
  }
329
- }, 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))),
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))),
330
380
  hasDrawers && drawers.length > 0 && (React.createElement(DrawerTriggersBar, { drawerRefs: drawerRefs, bottomOffset: footerHeight, topOffset: headerHeight, isMobile: isMobile, drawers: drawers, activeDrawerId: activeDrawerId, onDrawerChange: newDrawerId => {
331
381
  if (activeDrawerId !== newDrawerId) {
332
382
  focusToolsButtons();