@cloudscape-design/components-themeable 3.0.1133 → 3.0.1135

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 (84) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/expandable-section/styles.scss +5 -0
  3. package/lib/internal/scss/header/styles.scss +9 -0
  4. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  5. package/lib/internal/scss/textarea/styles.scss +62 -10
  6. package/lib/internal/template/app-layout/runtime-drawer/index.d.ts +3 -0
  7. package/lib/internal/template/app-layout/runtime-drawer/index.d.ts.map +1 -1
  8. package/lib/internal/template/app-layout/runtime-drawer/index.js.map +1 -1
  9. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js +1 -1
  11. package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
  12. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js +1 -1
  13. package/lib/internal/template/app-layout/visual-refresh-toolbar/index.js.map +1 -1
  14. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +3 -0
  15. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
  16. package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
  17. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js +1 -1
  18. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/index.js.map +1 -1
  19. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts +6 -0
  20. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-ai-drawer.d.ts.map +1 -1
  21. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
  22. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js +9 -1
  23. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
  24. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts +6 -0
  25. package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-bottom-drawers.d.ts.map +1 -1
  26. package/lib/internal/template/code-editor/styles.css.js +33 -33
  27. package/lib/internal/template/code-editor/styles.scoped.css +218 -214
  28. package/lib/internal/template/code-editor/styles.selectors.js +33 -33
  29. package/lib/internal/template/expandable-section/expandable-section-header.d.ts.map +1 -1
  30. package/lib/internal/template/expandable-section/expandable-section-header.js +1 -1
  31. package/lib/internal/template/expandable-section/expandable-section-header.js.map +1 -1
  32. package/lib/internal/template/expandable-section/styles.css.js +35 -34
  33. package/lib/internal/template/expandable-section/styles.scoped.css +68 -65
  34. package/lib/internal/template/expandable-section/styles.selectors.js +35 -34
  35. package/lib/internal/template/header/styles.css.js +34 -34
  36. package/lib/internal/template/header/styles.scoped.css +68 -50
  37. package/lib/internal/template/header/styles.selectors.js +34 -34
  38. package/lib/internal/template/internal/base-component/styles.scoped.css +2 -2
  39. package/lib/internal/template/internal/components/chart-popover/index.d.ts.map +1 -1
  40. package/lib/internal/template/internal/components/chart-popover/index.js +20 -14
  41. package/lib/internal/template/internal/components/chart-popover/index.js.map +1 -1
  42. package/lib/internal/template/internal/environment.js +2 -2
  43. package/lib/internal/template/internal/environment.json +2 -2
  44. package/lib/internal/template/internal/generated/theming/index.cjs +1 -1
  45. package/lib/internal/template/internal/generated/theming/index.js +1 -1
  46. package/lib/internal/template/internal/hooks/forward-focus/radio-group.js +1 -9
  47. package/lib/internal/template/internal/hooks/forward-focus/radio-group.js.map +1 -1
  48. package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +3 -0
  49. package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
  50. package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
  51. package/lib/internal/template/internal/utils/dom.d.ts +1 -0
  52. package/lib/internal/template/internal/utils/dom.d.ts.map +1 -1
  53. package/lib/internal/template/internal/utils/dom.js +3 -0
  54. package/lib/internal/template/internal/utils/dom.js.map +1 -1
  55. package/lib/internal/template/mixed-line-bar-chart/chart-container.d.ts.map +1 -1
  56. package/lib/internal/template/mixed-line-bar-chart/chart-container.js +2 -3
  57. package/lib/internal/template/mixed-line-bar-chart/chart-container.js.map +1 -1
  58. package/lib/internal/template/mixed-line-bar-chart/domain.d.ts.map +1 -1
  59. package/lib/internal/template/mixed-line-bar-chart/domain.js +4 -32
  60. package/lib/internal/template/mixed-line-bar-chart/domain.js.map +1 -1
  61. package/lib/internal/template/popover/internal.js +1 -1
  62. package/lib/internal/template/popover/internal.js.map +1 -1
  63. package/lib/internal/template/s3-resource-selector/s3-modal/table-utils.js +1 -1
  64. package/lib/internal/template/s3-resource-selector/s3-modal/table-utils.js.map +1 -1
  65. package/lib/internal/template/tag-editor/index.js +2 -2
  66. package/lib/internal/template/tag-editor/index.js.map +1 -1
  67. package/lib/internal/template/tag-editor/utils.d.ts +0 -4
  68. package/lib/internal/template/tag-editor/utils.d.ts.map +1 -1
  69. package/lib/internal/template/tag-editor/utils.js +0 -11
  70. package/lib/internal/template/tag-editor/utils.js.map +1 -1
  71. package/lib/internal/template/textarea/index.d.ts.map +1 -1
  72. package/lib/internal/template/textarea/index.js +3 -2
  73. package/lib/internal/template/textarea/index.js.map +1 -1
  74. package/lib/internal/template/textarea/interfaces.d.ts +48 -0
  75. package/lib/internal/template/textarea/interfaces.d.ts.map +1 -1
  76. package/lib/internal/template/textarea/interfaces.js.map +1 -1
  77. package/lib/internal/template/textarea/styles.css.js +5 -5
  78. package/lib/internal/template/textarea/styles.d.ts +3 -0
  79. package/lib/internal/template/textarea/styles.d.ts.map +1 -0
  80. package/lib/internal/template/textarea/styles.js +42 -0
  81. package/lib/internal/template/textarea/styles.js.map +1 -0
  82. package/lib/internal/template/textarea/styles.scoped.css +42 -29
  83. package/lib/internal/template/textarea/styles.selectors.js +5 -5
  84. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "0a448ad47c7ca34630676e41c271ac648a917c7a"
2
+ "commit": "396e178637dc05e00c5c2b91ead059388ba9182a"
3
3
  }
@@ -138,6 +138,11 @@ $icon-total-space-medium: calc(#{$icon-width-medium} + #{$icon-margin-left} + #{
138
138
  // Equal top and bottom padding so standalone header has vertical symmetry.
139
139
  padding-block-end: awsui.$space-container-header-top;
140
140
  }
141
+
142
+ &.wrapper-not-expanded-without-actions {
143
+ padding-block-end: calc(#{awsui.$space-container-header-top} + #{awsui.$space-scaled-xxs});
144
+ }
145
+
141
146
  &.header-deprecated {
142
147
  padding-inline-start: container.$header-padding-horizontal;
143
148
  }
@@ -5,6 +5,7 @@
5
5
 
6
6
  @use '../internal/styles/tokens' as awsui;
7
7
  @use '../internal/styles' as styles;
8
+ @use '@cloudscape-design/component-toolkit/internal/focus-visible' as focus-visible;
8
9
 
9
10
  @function space-heading-button-diff($heading-height) {
10
11
  @return calc((#{awsui.$size-vertical-input} - #{$heading-height}) / 2);
@@ -220,6 +221,14 @@
220
221
  font-size: inherit;
221
222
  @include styles.info-link-spacing();
222
223
 
224
+ &:focus {
225
+ outline: none;
226
+ }
227
+
228
+ @include focus-visible.when-visible {
229
+ @include styles.link-focus;
230
+ }
231
+
223
232
  &-variant-h1 {
224
233
  @include styles.font(heading-xl);
225
234
  }
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "0a448ad4";
3
+ $awsui-commit-hash: "396e1786";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-b75yp7;
6
6
  $minContentWidth: --awsui-min-content-width-b75yp7;
@@ -5,6 +5,8 @@
5
5
 
6
6
  @use '../internal/styles' as styles;
7
7
  @use '../internal/styles/tokens' as awsui;
8
+ @use '../internal/styles/foundation' as foundation;
9
+ @use '../internal/generated/custom-css-properties/index.scss' as custom-props;
8
10
 
9
11
  .root {
10
12
  /* used for test-utils */
@@ -22,31 +24,77 @@
22
24
  padding-block: styles.$control-padding-vertical;
23
25
  padding-inline: styles.$control-padding-horizontal;
24
26
 
25
- color: awsui.$color-text-body-default;
27
+ color: var(#{custom-props.$styleColorDefault}, awsui.$color-text-body-default);
26
28
  max-inline-size: 100%;
27
29
  inline-size: 100%;
28
30
  display: block;
29
31
  box-sizing: border-box;
30
- background-color: awsui.$color-background-input-default;
32
+ background-color: var(#{custom-props.$styleBackgroundDefault}, awsui.$color-background-input-default);
31
33
  border-start-start-radius: styles.$control-border-radius;
32
34
  border-start-end-radius: styles.$control-border-radius;
33
35
  border-end-start-radius: styles.$control-border-radius;
34
36
  border-end-end-radius: styles.$control-border-radius;
35
- border-block: awsui.$border-width-field solid awsui.$color-border-input-default;
36
- border-inline: awsui.$border-width-field solid awsui.$color-border-input-default;
37
+
38
+ border-block: awsui.$border-width-field solid
39
+ var(#{custom-props.$styleBorderColorDefault}, awsui.$color-border-input-default);
40
+ border-inline: awsui.$border-width-field solid
41
+ var(#{custom-props.$styleBorderColorDefault}, awsui.$color-border-input-default);
42
+
43
+ box-shadow: var(#{custom-props.$styleBoxShadowDefault});
44
+
37
45
  @include styles.font-body-m;
38
46
 
47
+ &:hover {
48
+ border-color: var(
49
+ #{custom-props.$styleBorderColorHover},
50
+ var(#{custom-props.$styleBorderColorDefault}, awsui.$color-border-input-default)
51
+ );
52
+ color: var(
53
+ #{custom-props.$styleColorHover},
54
+ var(#{custom-props.$styleBorderColorDefault}, awsui.$color-text-body-default)
55
+ );
56
+ background-color: var(
57
+ #{custom-props.$styleBackgroundHover},
58
+ var(#{custom-props.$styleBackgroundDefault}, awsui.$color-background-input-default)
59
+ );
60
+ box-shadow: var(#{custom-props.$styleBoxShadowHover}, #{custom-props.$styleBoxShadowDefault});
61
+ }
62
+
39
63
  &.textarea-readonly {
40
- @include styles.form-readonly-element;
64
+ @include styles.form-readonly-element(
65
+ $background-color: var(
66
+ #{custom-props.$styleBackgroundReadonly},
67
+ var(#{custom-props.$styleBackgroundDefault}, awsui.$color-background-input-default)
68
+ ),
69
+ $border-color: var(
70
+ #{custom-props.$styleBorderColorReadonly},
71
+ var(#{custom-props.$styleBorderColorDefault}, awsui.$color-border-input-disabled)
72
+ )
73
+ );
74
+ color: var(
75
+ #{custom-props.$styleColorReadonly},
76
+ var(#{custom-props.$styleColorDefault}, awsui.$color-text-body-default)
77
+ );
78
+ box-shadow: var(#{custom-props.$styleBoxShadowReadonly});
41
79
  }
42
80
 
43
81
  &::placeholder {
44
- @include styles.form-placeholder;
82
+ @include styles.form-placeholder(
83
+ $color: var(#{custom-props.$stylePlaceholderColor}, awsui.$color-text-input-placeholder),
84
+ $font-size: var(#{custom-props.$stylePlaceholderFontSize}),
85
+ $font-style: var(#{custom-props.$stylePlaceholderFontStyle}, italic),
86
+ $font-weight: var(#{custom-props.$stylePlaceholderFontWeight})
87
+ );
45
88
  opacity: 1;
46
89
  }
47
90
 
48
91
  &:focus {
49
- @include styles.form-focus-element;
92
+ @include styles.form-focus-element(
93
+ $border-color: var(#{custom-props.$styleBorderColorFocus}, awsui.$color-border-input-focused),
94
+ $box-shadow: var(#{custom-props.$styleBoxShadowFocus}, foundation.$box-shadow-focused-light)
95
+ );
96
+ color: var(#{custom-props.$styleColorFocus}, awsui.$color-text-body-default);
97
+ background-color: var(#{custom-props.$styleBackgroundFocus}, awsui.$color-background-input-default);
50
98
  }
51
99
 
52
100
  &:invalid {
@@ -55,9 +103,13 @@
55
103
  }
56
104
 
57
105
  &:disabled {
58
- @include styles.form-disabled-element;
59
- cursor: default;
60
-
106
+ @include styles.form-disabled-element(
107
+ $background-color: var(#{custom-props.$styleBackgroundDisabled}, awsui.$color-background-input-disabled),
108
+ $border-color: var(#{custom-props.$styleBorderColorDisabled}, awsui.$color-border-input-disabled),
109
+ $color: var(#{custom-props.$styleColorDisabled}, awsui.$color-text-input-disabled),
110
+ $cursor: default
111
+ );
112
+ box-shadow: var(#{custom-props.$styleBoxShadowDisabled});
61
113
  &::placeholder {
62
114
  @include styles.form-placeholder-disabled;
63
115
  opacity: 1;
@@ -23,6 +23,9 @@ export declare const mapRuntimeConfigToAiDrawer: (runtimeConfig: RuntimeAiDrawer
23
23
  onToggle?: NonCancelableEventHandler<DrawerStateChangeParams> | undefined;
24
24
  headerActions?: readonly ButtonGroupProps.Item[] | undefined;
25
25
  exitExpandedModeTrigger?: React.ReactNode;
26
+ onToggleFocusMode?: NonCancelableEventHandler<{
27
+ isExpanded: boolean;
28
+ }> | undefined;
26
29
  };
27
30
  export declare function convertRuntimeDrawers(localDrawers: Array<RuntimeDrawerConfig>, globalDrawers: Array<RuntimeDrawerConfig>): DrawersLayout;
28
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/runtime-drawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAwC,MAAM,OAAO,CAAC;AAI7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAA0B,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,OAAO,EACL,YAAY,IAAI,mBAAmB,EACnC,uBAAuB,EACxB,MAAM,4CAA4C,CAAC;AAEpD,OAAO,EAAE,aAAa,IAAI,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/C,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,MAAM;IAC1D,QAAQ,CAAC,EAAE,yBAAyB,CAAC,uBAAuB,CAAC,CAAC;IAC9D,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;CAC9B;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAClC,UAAU,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAClC;AAkFD,eAAO,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AAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useRef } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonGroupProps } from '../../button-group/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../internal/events';\nimport {\n DrawerConfig as RuntimeDrawerConfig,\n DrawerStateChangeParams,\n} from '../../internal/plugins/controllers/drawers';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ActiveDrawersContext } from '../utils/visibility-context';\n\nimport styles from './styles.css.js';\n\nexport interface RuntimeDrawer extends AppLayoutProps.Drawer {\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n position?: 'side' | 'bottom';\n}\n\nexport interface DrawersLayout {\n global: Array<RuntimeDrawer>;\n localBefore: Array<RuntimeDrawer>;\n localAfter: Array<RuntimeDrawer>;\n}\n\ntype VisibilityCallback = (isVisible: boolean) => void;\n\ninterface RuntimeContentWrapperProps {\n id?: string;\n mountContent: RuntimeDrawerConfig['mountContent'];\n unmountContent: RuntimeDrawerConfig['unmountContent'];\n}\n\nfunction RuntimeDrawerWrapper({ mountContent, unmountContent, id }: RuntimeContentWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n const visibilityChangeCallback = useRef<VisibilityCallback | null>(null);\n const activeDrawersIds = useContext(ActiveDrawersContext);\n const isVisible = !!id && activeDrawersIds.includes(id);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container, {\n onVisibilityChange: cb => {\n visibilityChangeCallback.current = cb;\n },\n });\n return () => {\n unmountContent(container);\n visibilityChangeCallback.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n visibilityChangeCallback.current?.(isVisible);\n }, [isVisible]);\n\n return <div ref={ref} className={styles['runtime-content-wrapper']} data-awsui-runtime-drawer-root-id={id}></div>;\n}\n\ninterface RuntimeContentHeaderProps {\n mountHeader: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n}\n\nfunction RuntimeDrawerHeader({ mountHeader, unmountHeader }: RuntimeContentHeaderProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountHeader?.(container);\n return () => {\n unmountHeader?.(container);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div className={styles['runtime-header-wrapper']} ref={ref} />;\n}\n\nfunction checkForUnsupportedProps(headerActions: ReadonlyArray<ButtonGroupProps.Item>) {\n const unsupportedProps = new Set([\n 'iconSvg',\n 'popoverFeedback',\n 'pressedIconSvg',\n 'popoverFeedback',\n 'pressedPopoverFeedback',\n ]);\n for (const item of headerActions) {\n const unsupported = Object.keys(item).filter(key => unsupportedProps.has(key));\n if (unsupported.length > 0) {\n warnOnce('AppLayout', `The headerActions properties are not supported for runtime api: ${unsupported.join(' ')}`);\n }\n }\n return headerActions;\n}\n\nconst convertRuntimeTriggerToReactNode = (runtimeTrigger?: string) => {\n if (!runtimeTrigger) {\n return undefined;\n }\n // eslint-disable-next-line react/no-danger\n return <span style={{ lineHeight: 0 }} dangerouslySetInnerHTML={{ __html: runtimeTrigger }} />;\n};\n\nexport const mapRuntimeConfigToDrawer = (\n runtimeConfig: RuntimeDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n} => {\n const { mountContent, unmountContent, trigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: trigger\n ? {\n ...(trigger.iconSvg && {\n iconSvg: convertRuntimeTriggerToReactNode(trigger.iconSvg),\n }),\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,\n };\n};\n\nexport const mapRuntimeConfigToAiDrawer = (\n runtimeConfig: RuntimeAiDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n exitExpandedModeTrigger?: React.ReactNode;\n} => {\n const { mountContent, unmountContent, trigger, exitExpandedModeTrigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n ...(trigger && {\n trigger: {\n customIcon: convertRuntimeTriggerToReactNode(trigger?.customIcon),\n iconSvg: convertRuntimeTriggerToReactNode(trigger?.iconSvg),\n },\n }),\n exitExpandedModeTrigger: exitExpandedModeTrigger\n ? {\n customIcon: convertRuntimeTriggerToReactNode(exitExpandedModeTrigger?.customIcon),\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n ...(runtimeDrawer.mountHeader && {\n header: (\n <RuntimeDrawerHeader mountHeader={runtimeDrawer.mountHeader} unmountHeader={runtimeDrawer.unmountHeader} />\n ),\n }),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,\n };\n};\n\nexport function convertRuntimeDrawers(\n localDrawers: Array<RuntimeDrawerConfig>,\n globalDrawers: Array<RuntimeDrawerConfig>\n): DrawersLayout {\n const converted = localDrawers.map(mapRuntimeConfigToDrawer);\n const sorted = sortByPriority(converted);\n return {\n global: sortByPriority(globalDrawers.map(mapRuntimeConfigToDrawer)),\n localBefore: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n localAfter: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/runtime-drawer/index.tsx"],"names":[],"mappings":";AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC;AAGzE,OAAO,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAK1F,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAqBrC,SAAS,oBAAoB,CAAC,EAAE,YAAY,EAAE,cAAc,EAAE,EAAE,EAA8B;IAC5F,MAAM,GAAG,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IACzC,MAAM,wBAAwB,GAAG,MAAM,CAA4B,IAAI,CAAC,CAAC;IACzE,MAAM,gBAAgB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,CAAC,CAAC,EAAE,IAAI,gBAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAExD,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,GAAG,CAAC,OAAQ,CAAC;QAC/B,YAAY,CAAC,SAAS,EAAE;YACtB,kBAAkB,EAAE,EAAE,CAAC,EAAE;gBACvB,wBAAwB,CA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WAAW,IAAI;QAC/B,MAAM,EAAE,CACN,oBAAC,mBAAmB,IAAC,WAAW,EAAE,aAAa,CAAC,WAAW,EAAE,aAAa,EAAE,aAAa,CAAC,aAAa,GAAI,CAC5G;KACF,CAAC,KACF,QAAQ,EAAE,KAAK,CAAC,EAAE;YAChB,sBAAsB,CAAC,aAAa,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,aAAa,CAAC,EAAE,EAAE,CAAC,CAAC;QACpG,CAAC,EACD,aAAa,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAwB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,IAC9G;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,qBAAqB,CACnC,YAAwC,EACxC,aAAyC;IAEzC,MAAM,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;IAC7D,MAAM,MAAM,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;IACzC,OAAO;QACL,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC;QACnE,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC;QACjE,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,WAAC,OAAA,CAAC,MAAA,IAAI,CAAC,aAAa,mCAAI,CAAC,CAAC,IAAI,CAAC,CAAA,EAAA,CAAC;KAClE,CAAC;AACJ,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useContext, useEffect, useRef } from 'react';\n\nimport { warnOnce } from '@cloudscape-design/component-toolkit/internal';\n\nimport { ButtonGroupProps } from '../../button-group/interfaces';\nimport { fireNonCancelableEvent, NonCancelableEventHandler } from '../../internal/events';\nimport {\n DrawerConfig as RuntimeDrawerConfig,\n DrawerStateChangeParams,\n} from '../../internal/plugins/controllers/drawers';\nimport { sortByPriority } from '../../internal/plugins/helpers/utils';\nimport { DrawerPayload as RuntimeAiDrawerConfig } from '../../internal/plugins/widget/interfaces';\nimport { AppLayoutProps } from '../interfaces';\nimport { ActiveDrawersContext } from '../utils/visibility-context';\n\nimport styles from './styles.css.js';\n\nexport interface RuntimeDrawer extends AppLayoutProps.Drawer {\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n position?: 'side' | 'bottom';\n}\n\nexport interface DrawersLayout {\n global: Array<RuntimeDrawer>;\n localBefore: Array<RuntimeDrawer>;\n localAfter: Array<RuntimeDrawer>;\n}\n\ntype VisibilityCallback = (isVisible: boolean) => void;\n\ninterface RuntimeContentWrapperProps {\n id?: string;\n mountContent: RuntimeDrawerConfig['mountContent'];\n unmountContent: RuntimeDrawerConfig['unmountContent'];\n}\n\nfunction RuntimeDrawerWrapper({ mountContent, unmountContent, id }: RuntimeContentWrapperProps) {\n const ref = useRef<HTMLDivElement>(null);\n const visibilityChangeCallback = useRef<VisibilityCallback | null>(null);\n const activeDrawersIds = useContext(ActiveDrawersContext);\n const isVisible = !!id && activeDrawersIds.includes(id);\n\n useEffect(() => {\n const container = ref.current!;\n mountContent(container, {\n onVisibilityChange: cb => {\n visibilityChangeCallback.current = cb;\n },\n });\n return () => {\n unmountContent(container);\n visibilityChangeCallback.current = null;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n useEffect(() => {\n visibilityChangeCallback.current?.(isVisible);\n }, [isVisible]);\n\n return <div ref={ref} className={styles['runtime-content-wrapper']} data-awsui-runtime-drawer-root-id={id}></div>;\n}\n\ninterface RuntimeContentHeaderProps {\n mountHeader: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n}\n\nfunction RuntimeDrawerHeader({ mountHeader, unmountHeader }: RuntimeContentHeaderProps) {\n const ref = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const container = ref.current!;\n mountHeader?.(container);\n return () => {\n unmountHeader?.(container);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n return <div className={styles['runtime-header-wrapper']} ref={ref} />;\n}\n\nfunction checkForUnsupportedProps(headerActions: ReadonlyArray<ButtonGroupProps.Item>) {\n const unsupportedProps = new Set([\n 'iconSvg',\n 'popoverFeedback',\n 'pressedIconSvg',\n 'popoverFeedback',\n 'pressedPopoverFeedback',\n ]);\n for (const item of headerActions) {\n const unsupported = Object.keys(item).filter(key => unsupportedProps.has(key));\n if (unsupported.length > 0) {\n warnOnce('AppLayout', `The headerActions properties are not supported for runtime api: ${unsupported.join(' ')}`);\n }\n }\n return headerActions;\n}\n\nconst convertRuntimeTriggerToReactNode = (runtimeTrigger?: string) => {\n if (!runtimeTrigger) {\n return undefined;\n }\n // eslint-disable-next-line react/no-danger\n return <span style={{ lineHeight: 0 }} dangerouslySetInnerHTML={{ __html: runtimeTrigger }} />;\n};\n\nexport const mapRuntimeConfigToDrawer = (\n runtimeConfig: RuntimeDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n} => {\n const { mountContent, unmountContent, trigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n trigger: trigger\n ? {\n ...(trigger.iconSvg && {\n iconSvg: convertRuntimeTriggerToReactNode(trigger.iconSvg),\n }),\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,\n };\n};\n\nexport const mapRuntimeConfigToAiDrawer = (\n runtimeConfig: RuntimeAiDrawerConfig\n): AppLayoutProps.Drawer & {\n orderPriority?: number;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n exitExpandedModeTrigger?: React.ReactNode;\n onToggleFocusMode?: NonCancelableEventHandler<{ isExpanded: boolean }>;\n} => {\n const { mountContent, unmountContent, trigger, exitExpandedModeTrigger, ...runtimeDrawer } = runtimeConfig;\n\n return {\n ...runtimeDrawer,\n ariaLabels: { drawerName: runtimeDrawer.ariaLabels.content ?? '', ...runtimeDrawer.ariaLabels },\n ...(trigger && {\n trigger: {\n customIcon: convertRuntimeTriggerToReactNode(trigger?.customIcon),\n iconSvg: convertRuntimeTriggerToReactNode(trigger?.iconSvg),\n },\n }),\n exitExpandedModeTrigger: exitExpandedModeTrigger\n ? {\n customIcon: convertRuntimeTriggerToReactNode(exitExpandedModeTrigger?.customIcon),\n }\n : undefined,\n content: (\n <RuntimeDrawerWrapper\n key={runtimeDrawer.id}\n mountContent={mountContent}\n unmountContent={unmountContent}\n id={runtimeDrawer.id}\n />\n ),\n ...(runtimeDrawer.mountHeader && {\n header: (\n <RuntimeDrawerHeader mountHeader={runtimeDrawer.mountHeader} unmountHeader={runtimeDrawer.unmountHeader} />\n ),\n }),\n onResize: event => {\n fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });\n },\n headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,\n };\n};\n\nexport function convertRuntimeDrawers(\n localDrawers: Array<RuntimeDrawerConfig>,\n globalDrawers: Array<RuntimeDrawerConfig>\n): DrawersLayout {\n const converted = localDrawers.map(mapRuntimeConfigToDrawer);\n const sorted = sortByPriority(converted);\n return {\n global: sortByPriority(globalDrawers.map(mapRuntimeConfigToDrawer)),\n localBefore: sorted.filter(item => (item.orderPriority ?? 0) > 0),\n localAfter: sorted.filter(item => (item.orderPriority ?? 0) <= 0),\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,UAAU,qBAAqB;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;IAClD,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,OAAO,CAAC;IAClB,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjD,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,eAAe,QAAS,CAAC;AAEtC,wBAAgB,uBAAuB,CAAC,EACtC,cAAc,EACd,eAAe,EACf,SAAS,EACT,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,QAAQ,EACR,wBAAwB,EACxB,kBAAkB,GACnB,EAAE,qBAAqB;;;;;;;;;;EA6CvB;AAED,UAAU,mBAAmB;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CAAC,EACpC,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,mBAAmB,GACpB,EAAE,mBAAmB,GAAG,oBAAoB,CAe5C;AAED,UAAU,qBAAqB;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,kBAAkB,EAAE,QAAQ,GAAG,MAAM,CAAC;IACtC,cAAc,EAAE,OAAO,CAAC;IACxB,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oBAAoB,EAAE,MAAM,CAAC;CAC9B;AAED,wBAAgB,wBAAwB,CAAC,EACvC,aAAa,EACb,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,qBAAqB;;;;;;EAYvB;AAED,wBAAgB,eAAe,CAC7B,eAAe,EAAE,oBAAoB,EACrC,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,EAClD,4BAA4B,GAAE,MAAU,GACvC;IACD,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CAIA"}
1
+ {"version":3,"file":"compute-layout.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,UAAU,qBAAqB;IAC7B,cAAc,EAAE,OAAO,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,CAAC;IACnD,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,OAAO,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b,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,oBAAoB,EACpB,sBAAsB,GACvB,EAAE,qBAAqB;;;;;;EAYvB;AAED,wBAAgB,eAAe,CAC7B,eAAe,EAAE,oBAAoB,EACrC,QAAQ,EAAE,OAAO,EACjB,SAAS,EAAE,0BAA0B,CAAC,WAAW,CAAC,EAClD,4BAA4B,GAAE,MAAU,GACvC;IACD,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;CACtB,CAIA"}
@@ -4,7 +4,7 @@ import { shouldSplitPanelBeForcedToBottom } from '../split-panel/split-panel-for
4
4
  export const CONTENT_PADDING = 2 * 24; // space-xl
5
5
  export function computeHorizontalLayout({ navigationOpen, navigationWidth, placement, minContentWidth, activeDrawerSize, splitPanelOpen, splitPanelPosition, splitPanelSize, isMobile, activeGlobalDrawersSizes, activeAiDrawerSize, }) {
6
6
  const activeNavigationWidth = navigationOpen ? navigationWidth : 0;
7
- let resizableSpaceAvailable = Math.max(0, placement.inlineSize - minContentWidth - CONTENT_PADDING - activeNavigationWidth - activeAiDrawerSize);
7
+ let resizableSpaceAvailable = placement.inlineSize - minContentWidth - CONTENT_PADDING - activeNavigationWidth - activeAiDrawerSize;
8
8
  const totalActiveGlobalDrawersSize = Object.values(activeGlobalDrawersSizes).reduce((acc, size) => acc + size, 0);
9
9
  const availableWidthForSplitPanel = resizableSpaceAvailable - activeDrawerSize;
10
10
  const splitPanelForcedPosition = shouldSplitPanelBeForcedToBottom({
@@ -1 +1 @@
1
- {"version":3,"file":"compute-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAGtC,OAAO,EAAE,gCAAgC,EAAE,MAAM,4CAA4C,CAAC;AAgB9F,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,WAAW;AAElD,MAAM,UAAU,uBAAuB,CAAC,EACtC,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AAC;KACH;IACD,MAAM,uBAAuB,GAAG,cAAc,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAC/F,OAAO;QACL,0BAA0B,EAAE,uBAAuB,GAAG,SAAS,CAAC,aAAa;QAC7E,0BAA0B,EAAE,uBAAuB;KACpD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,eAAqC,EACrC,QAAiB,EACjB,SAAkD,EAClD,+BAAuC,CAAC;;IAKxC,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAA,eAAe,CAAC,OAAO,mCAAI,SAAS,CAAC,eAAe,CAAC,CAAC;IACpH,MAAM,YAAY,GAAG,gBAAgB,eAAe,QAAQ,SAAS,CAAC,aAAa,QAAQ,4BAA4B,KAAK,CAAC;IAC7H,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AppLayoutPropsWithDefaults } from '../interfaces';\nimport { shouldSplitPanelBeForcedToBottom } from '../split-panel/split-panel-forced-position';\n\ninterface HorizontalLayoutInput {\n navigationOpen: boolean;\n navigationWidth: number;\n placement: AppLayoutPropsWithDefaults['placement'];\n minContentWidth: number;\n activeDrawerSize: number;\n splitPanelOpen: boolean;\n splitPanelPosition: 'side' | 'bottom' | undefined;\n splitPanelSize: number;\n isMobile: boolean;\n activeGlobalDrawersSizes: Record<string, number>;\n activeAiDrawerSize: number;\n}\n\nexport const CONTENT_PADDING = 2 * 24; // space-xl\n\nexport function computeHorizontalLayout({\n navigationOpen,\n navigationWidth,\n placement,\n minContentWidth,\n activeDrawerSize,\n splitPanelOpen,\n splitPanelPosition,\n splitPanelSize,\n isMobile,\n activeGlobalDrawersSizes,\n activeAiDrawerSize,\n}: HorizontalLayoutInput) {\n const activeNavigationWidth = navigationOpen ? navigationWidth : 0;\n\n let resizableSpaceAvailable = Math.max(\n 0,\n placement.inlineSize - minContentWidth - CONTENT_PADDING - activeNavigationWidth - activeAiDrawerSize\n );\n const totalActiveGlobalDrawersSize = Object.values(activeGlobalDrawersSizes).reduce((acc, size) => acc + size, 0);\n\n const availableWidthForSplitPanel = resizableSpaceAvailable - activeDrawerSize;\n const splitPanelForcedPosition = shouldSplitPanelBeForcedToBottom({\n isMobile,\n availableWidthForSplitPanel,\n });\n const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : (splitPanelPosition ?? 'bottom');\n const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? (splitPanelSize ?? 0) : 0;\n const maxSplitPanelSize = Math.max(resizableSpaceAvailable - totalActiveGlobalDrawersSize - activeDrawerSize, 0);\n resizableSpaceAvailable -= sideSplitPanelSize;\n const maxDrawerSize = resizableSpaceAvailable - totalActiveGlobalDrawersSize;\n const maxAiDrawerSize = resizableSpaceAvailable - totalActiveGlobalDrawersSize + activeAiDrawerSize;\n const maxGlobalDrawersSizes: Record<string, number> = Object.keys(activeGlobalDrawersSizes).reduce(\n (acc, drawerId) => {\n return {\n ...acc,\n [drawerId]:\n resizableSpaceAvailable -\n activeDrawerSize -\n totalActiveGlobalDrawersSize +\n activeGlobalDrawersSizes[drawerId],\n };\n },\n {}\n );\n\n return {\n splitPanelPosition: resolvedSplitPanelPosition,\n splitPanelForcedPosition,\n sideSplitPanelSize,\n maxSplitPanelSize,\n maxDrawerSize,\n maxGlobalDrawersSizes,\n totalActiveGlobalDrawersSize,\n resizableSpaceAvailable,\n maxAiDrawerSize,\n };\n}\n\ninterface VerticalLayoutInput {\n topOffset: number;\n hasVisibleToolbar: boolean;\n toolbarHeight: number;\n stickyNotifications: boolean;\n notificationsHeight: number;\n}\n\nexport interface VerticalLayoutOutput {\n toolbar: number;\n notifications: number;\n header: number;\n drawers: number;\n}\n\nexport function computeVerticalLayout({\n topOffset,\n hasVisibleToolbar,\n toolbarHeight,\n stickyNotifications,\n notificationsHeight,\n}: VerticalLayoutInput): VerticalLayoutOutput {\n const toolbar = topOffset;\n let notifications = topOffset;\n let drawers = topOffset;\n\n if (hasVisibleToolbar) {\n notifications += toolbarHeight;\n drawers += toolbarHeight;\n }\n let header = notifications;\n if (stickyNotifications) {\n header += notificationsHeight;\n }\n\n return { toolbar, notifications, header, drawers };\n}\n\ninterface SplitPanelOffsetInput {\n hasSplitPanel: boolean;\n placement: AppLayoutPropsWithDefaults['placement'];\n splitPanelPosition: 'bottom' | 'side';\n splitPanelOpen: boolean;\n splitPanelHeaderHeight: number;\n splitPanelFullHeight: number;\n}\n\nexport function computeSplitPanelOffsets({\n hasSplitPanel,\n splitPanelPosition,\n placement,\n splitPanelOpen,\n splitPanelFullHeight,\n splitPanelHeaderHeight,\n}: SplitPanelOffsetInput) {\n if (!hasSplitPanel || splitPanelPosition !== 'bottom') {\n return {\n stickyVerticalBottomOffset: placement.insetBlockEnd,\n mainContentPaddingBlockEnd: undefined,\n };\n }\n const mainContentBottomOffset = splitPanelOpen ? splitPanelFullHeight : splitPanelHeaderHeight;\n return {\n stickyVerticalBottomOffset: mainContentBottomOffset + placement.insetBlockEnd,\n mainContentPaddingBlockEnd: mainContentBottomOffset,\n };\n}\n\nexport function getDrawerStyles(\n verticalOffsets: VerticalLayoutOutput,\n isMobile: boolean,\n placement: AppLayoutPropsWithDefaults['placement'],\n activeGlobalBottomDrawerSize: number = 0\n): {\n drawerTopOffset: number;\n drawerHeight: string;\n} {\n const drawerTopOffset = isMobile ? verticalOffsets.toolbar : (verticalOffsets.drawers ?? placement.insetBlockStart);\n const drawerHeight = `calc(100vh - ${drawerTopOffset}px - ${placement.insetBlockEnd}px - ${activeGlobalBottomDrawerSize}px)`;\n return { drawerTopOffset, drawerHeight };\n}\n"]}
1
+ {"version":3,"file":"compute-layout.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/compute-layout.ts"],"names":[],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oB,EACpB,sBAAsB,GACA;IACtB,IAAI,CAAC,aAAa,IAAI,kBAAkB,KAAK,QAAQ,EAAE;QACrD,OAAO;YACL,0BAA0B,EAAE,SAAS,CAAC,aAAa;YACnD,0BAA0B,EAAE,SAAS;SACtC,CAAC;KACH;IACD,MAAM,uBAAuB,GAAG,cAAc,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,sBAAsB,CAAC;IAC/F,OAAO;QACL,0BAA0B,EAAE,uBAAuB,GAAG,SAAS,CAAC,aAAa;QAC7E,0BAA0B,EAAE,uBAAuB;KACpD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,eAAe,CAC7B,eAAqC,EACrC,QAAiB,EACjB,SAAkD,EAClD,+BAAuC,CAAC;;IAKxC,MAAM,eAAe,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAA,eAAe,CAAC,OAAO,mCAAI,SAAS,CAAC,eAAe,CAAC,CAAC;IACpH,MAAM,YAAY,GAAG,gBAAgB,eAAe,QAAQ,SAAS,CAAC,aAAa,QAAQ,4BAA4B,KAAK,CAAC;IAC7H,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC;AAC3C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { AppLayoutPropsWithDefaults } from '../interfaces';\nimport { shouldSplitPanelBeForcedToBottom } from '../split-panel/split-panel-forced-position';\n\ninterface HorizontalLayoutInput {\n navigationOpen: boolean;\n navigationWidth: number;\n placement: AppLayoutPropsWithDefaults['placement'];\n minContentWidth: number;\n activeDrawerSize: number;\n splitPanelOpen: boolean;\n splitPanelPosition: 'side' | 'bottom' | undefined;\n splitPanelSize: number;\n isMobile: boolean;\n activeGlobalDrawersSizes: Record<string, number>;\n activeAiDrawerSize: number;\n}\n\nexport const CONTENT_PADDING = 2 * 24; // space-xl\n\nexport function computeHorizontalLayout({\n navigationOpen,\n navigationWidth,\n placement,\n minContentWidth,\n activeDrawerSize,\n splitPanelOpen,\n splitPanelPosition,\n splitPanelSize,\n isMobile,\n activeGlobalDrawersSizes,\n activeAiDrawerSize,\n}: HorizontalLayoutInput) {\n const activeNavigationWidth = navigationOpen ? navigationWidth : 0;\n\n let resizableSpaceAvailable =\n placement.inlineSize - minContentWidth - CONTENT_PADDING - activeNavigationWidth - activeAiDrawerSize;\n const totalActiveGlobalDrawersSize = Object.values(activeGlobalDrawersSizes).reduce((acc, size) => acc + size, 0);\n\n const availableWidthForSplitPanel = resizableSpaceAvailable - activeDrawerSize;\n const splitPanelForcedPosition = shouldSplitPanelBeForcedToBottom({\n isMobile,\n availableWidthForSplitPanel,\n });\n const resolvedSplitPanelPosition = splitPanelForcedPosition ? 'bottom' : (splitPanelPosition ?? 'bottom');\n const sideSplitPanelSize = resolvedSplitPanelPosition === 'side' && splitPanelOpen ? (splitPanelSize ?? 0) : 0;\n const maxSplitPanelSize = Math.max(resizableSpaceAvailable - totalActiveGlobalDrawersSize - activeDrawerSize, 0);\n resizableSpaceAvailable -= sideSplitPanelSize;\n const maxDrawerSize = resizableSpaceAvailable - totalActiveGlobalDrawersSize;\n const maxAiDrawerSize = resizableSpaceAvailable - totalActiveGlobalDrawersSize + activeAiDrawerSize;\n const maxGlobalDrawersSizes: Record<string, number> = Object.keys(activeGlobalDrawersSizes).reduce(\n (acc, drawerId) => {\n return {\n ...acc,\n [drawerId]:\n resizableSpaceAvailable -\n activeDrawerSize -\n totalActiveGlobalDrawersSize +\n activeGlobalDrawersSizes[drawerId],\n };\n },\n {}\n );\n\n return {\n splitPanelPosition: resolvedSplitPanelPosition,\n splitPanelForcedPosition,\n sideSplitPanelSize,\n maxSplitPanelSize,\n maxDrawerSize,\n maxGlobalDrawersSizes,\n totalActiveGlobalDrawersSize,\n resizableSpaceAvailable,\n maxAiDrawerSize,\n };\n}\n\ninterface VerticalLayoutInput {\n topOffset: number;\n hasVisibleToolbar: boolean;\n toolbarHeight: number;\n stickyNotifications: boolean;\n notificationsHeight: number;\n}\n\nexport interface VerticalLayoutOutput {\n toolbar: number;\n notifications: number;\n header: number;\n drawers: number;\n}\n\nexport function computeVerticalLayout({\n topOffset,\n hasVisibleToolbar,\n toolbarHeight,\n stickyNotifications,\n notificationsHeight,\n}: VerticalLayoutInput): VerticalLayoutOutput {\n const toolbar = topOffset;\n let notifications = topOffset;\n let drawers = topOffset;\n\n if (hasVisibleToolbar) {\n notifications += toolbarHeight;\n drawers += toolbarHeight;\n }\n let header = notifications;\n if (stickyNotifications) {\n header += notificationsHeight;\n }\n\n return { toolbar, notifications, header, drawers };\n}\n\ninterface SplitPanelOffsetInput {\n hasSplitPanel: boolean;\n placement: AppLayoutPropsWithDefaults['placement'];\n splitPanelPosition: 'bottom' | 'side';\n splitPanelOpen: boolean;\n splitPanelHeaderHeight: number;\n splitPanelFullHeight: number;\n}\n\nexport function computeSplitPanelOffsets({\n hasSplitPanel,\n splitPanelPosition,\n placement,\n splitPanelOpen,\n splitPanelFullHeight,\n splitPanelHeaderHeight,\n}: SplitPanelOffsetInput) {\n if (!hasSplitPanel || splitPanelPosition !== 'bottom') {\n return {\n stickyVerticalBottomOffset: placement.insetBlockEnd,\n mainContentPaddingBlockEnd: undefined,\n };\n }\n const mainContentBottomOffset = splitPanelOpen ? splitPanelFullHeight : splitPanelHeaderHeight;\n return {\n stickyVerticalBottomOffset: mainContentBottomOffset + placement.insetBlockEnd,\n mainContentPaddingBlockEnd: mainContentBottomOffset,\n };\n}\n\nexport function getDrawerStyles(\n verticalOffsets: VerticalLayoutOutput,\n isMobile: boolean,\n placement: AppLayoutPropsWithDefaults['placement'],\n activeGlobalBottomDrawerSize: number = 0\n): {\n drawerTopOffset: number;\n drawerHeight: string;\n} {\n const drawerTopOffset = isMobile ? verticalOffsets.toolbar : (verticalOffsets.drawers ?? placement.insetBlockStart);\n const drawerHeight = `calc(100vh - ${drawerTopOffset}px - ${placement.insetBlockEnd}px - ${activeGlobalBottomDrawerSize}px)`;\n return { drawerTopOffset, drawerHeight };\n}\n"]}
@@ -34,7 +34,7 @@ const AppLayoutStateProvider = ({ forceDeduplicationType, appLayoutProps, stateM
34
34
  return React.createElement(React.Fragment, null, children(registered, appLayoutState, toolbarProps, skeletonAttributes));
35
35
  };
36
36
  const AppLayoutVisualRefreshToolbar = React.forwardRef((props, forwardRef) => {
37
- const stateManager = useRef({ setState: undefined, hasToolbar: true, setToolbar: undefined });
37
+ const stateManager = useRef({ setState: undefined, hasToolbar: false, setToolbar: undefined });
38
38
  const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } = props;
39
39
  return (React.createElement(React.Fragment, null,
40
40
  React.createElement(AppLayoutStateProvider, { forceDeduplicationType: forceDeduplicationType, appLayoutProps: props, stateManager: stateManager }, (registered, appLayoutState, toolbarProps, skeletonAttributes) => (React.createElement(AppLayoutVisibilityContext.Provider, { value: appLayoutState.isIntersecting },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,gBAAgB,MAAM,6CAA6C,CAAC;AAE3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,YAAY,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,OAAO,EAAqB,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAGnE,MAAM,sBAAsB,GAUvB,CAAC,EAAE,sB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AE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,CACtG,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { unstable_batchedUpdates } from 'react-dom';\n\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutVisibilityContext } from './contexts';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from './interfaces';\nimport { AppLayoutWidgetizedState } from './internal';\nimport { SkeletonLayout } from './skeleton';\nimport { SkeletonSlotsAttributes } from './skeleton/interfaces';\nimport { DeduplicationType, useMultiAppLayout } from './skeleton/multi-layout';\nimport { StateManager } from './state';\nimport { SharedProps } from './state/interfaces';\nimport { getPropsToMerge, mergeProps } from './state/props-merger';\nimport { ToolbarProps } from './toolbar';\n\nconst AppLayoutStateProvider: React.FC<{\n forceDeduplicationType: DeduplicationType;\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n children: (\n registered: boolean,\n appLayoutState: AppLayoutPendingState,\n toolbarProps: ToolbarProps | null,\n skeletonAttributes: SkeletonSlotsAttributes\n ) => React.ReactNode;\n}> = ({ forceDeduplicationType, appLayoutProps, stateManager, children }) => {\n const [appLayoutState, setAppLayoutState] = useState<AppLayoutPendingState>({ isIntersecting: true });\n const [skeletonAttributes, setSkeletonAttributes] = useState<SkeletonSlotsAttributes>({});\n // use { fn: } object wrapper to avoid confusion with callback form of setState\n const [deduplicator, setDeduplicator] = useState({ fn: mergeProps });\n const [deduplicationProps, setDeduplicationProps] = useState<SharedProps | undefined>(undefined);\n\n const { registered, toolbarProps } = useMultiAppLayout(\n forceDeduplicationType,\n appLayoutState.isIntersecting,\n deduplicationProps ?? getPropsToMerge(appLayoutProps, appLayoutState),\n deduplicator.fn\n );\n\n useLayoutEffect(() => {\n stateManager.current.setState = (appLayoutState, skeletonAttributes, deduplicationProps, mergeProps) => {\n unstable_batchedUpdates(() => {\n setAppLayoutState(appLayoutState);\n setSkeletonAttributes(skeletonAttributes);\n setDeduplicationProps(deduplicationProps);\n setDeduplicator({ fn: mergeProps });\n });\n };\n }, [stateManager]);\n\n const hasToolbar = !!toolbarProps;\n useEffect(() => {\n stateManager.current.hasToolbar = hasToolbar;\n stateManager.current.setToolbar?.(hasToolbar);\n }, [stateManager, hasToolbar]);\n\n return <>{children(registered, appLayoutState, toolbarProps, skeletonAttributes)}</>;\n};\n\nconst AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLayoutInternalProps>(\n (props, forwardRef) => {\n const stateManager = useRef<StateManager>({ setState: undefined, hasToolbar: true, setToolbar: undefined });\n const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } = props as any;\n\n return (\n <>\n <AppLayoutStateProvider\n forceDeduplicationType={forceDeduplicationType}\n appLayoutProps={props}\n stateManager={stateManager}\n >\n {(registered, appLayoutState, toolbarProps, skeletonAttributes) => (\n <AppLayoutVisibilityContext.Provider value={appLayoutState.isIntersecting}>\n {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */}\n {(embeddedViewMode || !toolbarProps) && props.breadcrumbs ? (\n <ScreenreaderOnly>{props.breadcrumbs}</ScreenreaderOnly>\n ) : null}\n <SkeletonLayout\n registered={registered}\n toolbarProps={toolbarProps}\n appLayoutProps={props}\n appLayoutState={appLayoutState}\n skeletonSlotsAttributes={skeletonAttributes}\n />\n </AppLayoutVisibilityContext.Provider>\n )}\n </AppLayoutStateProvider>\n <AppLayoutWidgetizedState forwardRef={forwardRef} appLayoutProps={props} stateManager={stateManager} />\n </>\n );\n }\n);\n\nexport default AppLayoutVisualRefreshToolbar;\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/app-layout/visual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cAAc,EAAE,KAAK,EACrB,YAAY,EAAE,YAAY,IAEzB,CAAC,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,EAAE,CAAC,CACjE,oBAAC,0BAA0B,CAAC,QAAQ,IAAC,KAAK,EAAE,cAAc,CAAC,cAAc;YAEtE,CAAC,gBAAgB,IAAI,CAAC,YAAY,CAAC,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAC1D,oBAAC,gBAAgB,QAAE,KAAK,CAAC,WAAW,CAAoB,CACzD,CAAC,CAAC,CAAC,IAAI;YACR,oBAAC,cAAc,IACb,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,cAAc,EAAE,KAAK,EACrB,cAAc,EAAE,cAAc,EAC9B,uBAAuB,EAAE,kBAAkB,GAC3C,CACkC,CACvC,CACsB;QACzB,oBAAC,wBAAwB,IAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,EAAE,YAAY,GAAI,CACtG,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,6BAA6B,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { useEffect, useLayoutEffect, useRef, useState } from 'react';\nimport { unstable_batchedUpdates } from 'react-dom';\n\nimport ScreenreaderOnly from '../../internal/components/screenreader-only';\nimport { AppLayoutProps } from '../interfaces';\nimport { AppLayoutVisibilityContext } from './contexts';\nimport { AppLayoutInternalProps, AppLayoutPendingState } from './interfaces';\nimport { AppLayoutWidgetizedState } from './internal';\nimport { SkeletonLayout } from './skeleton';\nimport { SkeletonSlotsAttributes } from './skeleton/interfaces';\nimport { DeduplicationType, useMultiAppLayout } from './skeleton/multi-layout';\nimport { StateManager } from './state';\nimport { SharedProps } from './state/interfaces';\nimport { getPropsToMerge, mergeProps } from './state/props-merger';\nimport { ToolbarProps } from './toolbar';\n\nconst AppLayoutStateProvider: React.FC<{\n forceDeduplicationType: DeduplicationType;\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n children: (\n registered: boolean,\n appLayoutState: AppLayoutPendingState,\n toolbarProps: ToolbarProps | null,\n skeletonAttributes: SkeletonSlotsAttributes\n ) => React.ReactNode;\n}> = ({ forceDeduplicationType, appLayoutProps, stateManager, children }) => {\n const [appLayoutState, setAppLayoutState] = useState<AppLayoutPendingState>({ isIntersecting: true });\n const [skeletonAttributes, setSkeletonAttributes] = useState<SkeletonSlotsAttributes>({});\n // use { fn: } object wrapper to avoid confusion with callback form of setState\n const [deduplicator, setDeduplicator] = useState({ fn: mergeProps });\n const [deduplicationProps, setDeduplicationProps] = useState<SharedProps | undefined>(undefined);\n\n const { registered, toolbarProps } = useMultiAppLayout(\n forceDeduplicationType,\n appLayoutState.isIntersecting,\n deduplicationProps ?? getPropsToMerge(appLayoutProps, appLayoutState),\n deduplicator.fn\n );\n\n useLayoutEffect(() => {\n stateManager.current.setState = (appLayoutState, skeletonAttributes, deduplicationProps, mergeProps) => {\n unstable_batchedUpdates(() => {\n setAppLayoutState(appLayoutState);\n setSkeletonAttributes(skeletonAttributes);\n setDeduplicationProps(deduplicationProps);\n setDeduplicator({ fn: mergeProps });\n });\n };\n }, [stateManager]);\n\n const hasToolbar = !!toolbarProps;\n useEffect(() => {\n stateManager.current.hasToolbar = hasToolbar;\n stateManager.current.setToolbar?.(hasToolbar);\n }, [stateManager, hasToolbar]);\n\n return <>{children(registered, appLayoutState, toolbarProps, skeletonAttributes)}</>;\n};\n\nconst AppLayoutVisualRefreshToolbar = React.forwardRef<AppLayoutProps.Ref, AppLayoutInternalProps>(\n (props, forwardRef) => {\n const stateManager = useRef<StateManager>({ setState: undefined, hasToolbar: false, setToolbar: undefined });\n const { __forceDeduplicationType: forceDeduplicationType, __embeddedViewMode: embeddedViewMode } = props as any;\n\n return (\n <>\n <AppLayoutStateProvider\n forceDeduplicationType={forceDeduplicationType}\n appLayoutProps={props}\n stateManager={stateManager}\n >\n {(registered, appLayoutState, toolbarProps, skeletonAttributes) => (\n <AppLayoutVisibilityContext.Provider value={appLayoutState.isIntersecting}>\n {/* Rendering a hidden copy of breadcrumbs to trigger their deduplication */}\n {(embeddedViewMode || !toolbarProps) && props.breadcrumbs ? (\n <ScreenreaderOnly>{props.breadcrumbs}</ScreenreaderOnly>\n ) : null}\n <SkeletonLayout\n registered={registered}\n toolbarProps={toolbarProps}\n appLayoutProps={props}\n appLayoutState={appLayoutState}\n skeletonSlotsAttributes={skeletonAttributes}\n />\n </AppLayoutVisibilityContext.Provider>\n )}\n </AppLayoutStateProvider>\n <AppLayoutWidgetizedState forwardRef={forwardRef} appLayoutProps={props} stateManager={stateManager} />\n </>\n );\n }\n);\n\nexport default AppLayoutVisualRefreshToolbar;\n"]}
@@ -24,6 +24,9 @@ export type InternalDrawer = AppLayoutProps.Drawer & {
24
24
  headerActions?: ReadonlyArray<ButtonGroupProps.Item>;
25
25
  onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;
26
26
  position?: 'side' | 'bottom';
27
+ onToggleFocusMode?: NonCancelableEventHandler<{
28
+ isExpanded: boolean;
29
+ }>;
27
30
  };
28
31
  export interface AppLayoutInternals {
29
32
  ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AACvF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,C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AC,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IAExB,eAAe,EAAE,wBAAwB,CAAC;IAE1C,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,mBAAmB,EAAE,uBAAuB,CAAC;CAC9C;AAED,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAC9C,cAAc,EACd,oBAAoB,GAAG,qBAAqB,GAAG,iBAAiB,GAAG,SAAS,CAC7E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';\nimport { ButtonGroupProps } from '../../button-group/interfaces';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { NonCancelableEventHandler } from '../../internal/events';\nimport { SomeOptional } from '../../internal/types';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SplitPanelProviderProps } from '../split-panel';\nimport { OnChangeParams } from '../utils/use-drawers';\nimport { FocusControlMultipleStates, FocusControlState } from '../utils/use-focus-control';\nimport { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control';\nimport { VerticalLayoutOutput } from './compute-layout';\n\nexport interface AppLayoutInternalProps extends AppLayoutPropsWithDefaults {\n navigationTriggerHide?: boolean;\n}\n\nexport type InternalDrawer = AppLayoutProps.Drawer & {\n defaultActive?: boolean;\n isExpandable?: boolean;\n ariaLabels: AppLayoutProps.Drawer['ariaLabels'] & { expandedModeButton?: string; exitExpandedModeButton?: string };\n header?: React.ReactNode;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n position?: 'side' | 'bottom';\n};\n\n// Widgetization notice: structures in this file are shared multiple app layout instances, possibly different minor versions.\n// Treat these structures as an API and do not make incompatible changes.\n// Legacy widget interface\nexport interface AppLayoutInternals {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n headerVariant: AppLayoutPropsWithDefaults['headerVariant'];\n placement: AppLayoutPropsWithDefaults['placement'];\n navigationOpen: AppLayoutPropsWithDefaults['navigationOpen'];\n navigationFocusControl: FocusControlState;\n navigation: React.ReactNode;\n splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelOpen: boolean;\n splitPanelControlId: string;\n splitPanelFocusControl: SplitPanelFocusControlState;\n splitPanelToggleConfig: SplitPanelSideToggleProps;\n isMobile: boolean;\n activeDrawer: InternalDrawer | undefined;\n activeDrawerSize: number;\n minDrawerSize: number;\n maxDrawerSize: number;\n minGlobalDrawersSizes: Record<string, number>;\n maxGlobalDrawersSizes: Record<string, number>;\n drawers: ReadonlyArray<InternalDrawer>;\n drawersFocusControl: FocusControlState;\n globalDrawersFocusControl: FocusControlMultipleStates;\n activeGlobalDrawersIds: ReadonlyArray<string>;\n activeGlobalDrawers: ReadonlyArray<InternalDrawer>;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n activeGlobalDrawersSizes: Record<string, number>;\n stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications'];\n breadcrumbs: React.ReactNode;\n discoveredBreadcrumbs: BreadcrumbGroupProps | null;\n toolbarState: 'show' | 'hide';\n setToolbarState: (state: 'show' | 'hide') => void;\n verticalOffsets: VerticalLayoutOutput;\n drawersOpenQueue: ReadonlyArray<string>;\n setNotificationsHeight: (height: number) => void;\n setToolbarHeight: (height: number) => void;\n onSplitPanelToggle: () => void;\n onNavigationToggle: (open: boolean) => void;\n onActiveDrawerChange: (newDrawerId: string | null, params: OnChangeParams) => void;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n onActiveGlobalDrawersChange: (newDrawerId: string, params: OnChangeParams) => void;\n splitPanelAnimationDisabled?: boolean;\n expandedDrawerId: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n aiDrawer?: InternalDrawer | null;\n onActiveAiDrawerChange?: (newDrawerId: string | null, params?: OnChangeParams) => void;\n activeAiDrawer?: InternalDrawer | null;\n activeAiDrawerId: string | null;\n activeAiDrawerSize?: number;\n minAiDrawerSize?: number;\n maxAiDrawerSize?: number;\n aiDrawerFocusControl?: FocusControlState;\n onActiveAiDrawerResize: (size: number) => void;\n}\n\nexport interface AppLayoutWidgetizedState extends AppLayoutInternals {\n isNested: boolean;\n verticalOffsets: VerticalLayoutOutput;\n navigationAnimationDisabled: boolean;\n aiDrawerExpandedMode: boolean;\n splitPanelOffsets: {\n stickyVerticalBottomOffset: number;\n mainContentPaddingBlockEnd: number | undefined;\n };\n activeGlobalBottomDrawerId: string | null;\n onActiveGlobalBottomDrawerChange: (value: string | null, params: OnChangeParams) => void;\n activeGlobalBottomDrawerSize: number;\n minGlobalBottomDrawerSize: number;\n bottomDrawerReportedSize: number;\n getMaxGlobalBottomDrawerHeight: () => number;\n reportBottomDrawerSize: (size: number) => void;\n bottomDrawersFocusControl: FocusControlState;\n onActiveBottomDrawerResize: ({ id, size }: { id: string; size: number }) => void;\n bottomDrawers: ReadonlyArray<InternalDrawer>;\n}\n\n// New widget interface\nexport interface AppLayoutState {\n rootRef: React.Ref<HTMLElement>;\n isIntersecting: boolean;\n // new state management\n widgetizedState: AppLayoutWidgetizedState;\n // the old object shape for backward compatibility\n appLayoutInternals: AppLayoutInternals;\n splitPanelInternals: SplitPanelProviderProps;\n}\n\nexport type AppLayoutPendingState = SomeOptional<\n AppLayoutState,\n 'appLayoutInternals' | 'splitPanelInternals' | 'widgetizedState' | 'rootRef'\n>;\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../src/app-layout/visual-refresh-toolbar/interfaces.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React from 'react';\n\nimport { BreadcrumbGroupProps } from '../../breadcrumb-group/interfaces';\nimport { ButtonGroupProps } from '../../button-group/interfaces';\nimport { SplitPanelSideToggleProps } from '../../internal/context/split-panel-context';\nimport { NonCancelableEventHandler } from '../../internal/events';\nimport { SomeOptional } from '../../internal/types';\nimport { AppLayoutProps, AppLayoutPropsWithDefaults } from '../interfaces';\nimport { SplitPanelProviderProps } from '../split-panel';\nimport { OnChangeParams } from '../utils/use-drawers';\nimport { FocusControlMultipleStates, FocusControlState } from '../utils/use-focus-control';\nimport { SplitPanelFocusControlState } from '../utils/use-split-panel-focus-control';\nimport { VerticalLayoutOutput } from './compute-layout';\n\nexport interface AppLayoutInternalProps extends AppLayoutPropsWithDefaults {\n navigationTriggerHide?: boolean;\n}\n\nexport type InternalDrawer = AppLayoutProps.Drawer & {\n defaultActive?: boolean;\n isExpandable?: boolean;\n ariaLabels: AppLayoutProps.Drawer['ariaLabels'] & { expandedModeButton?: string; exitExpandedModeButton?: string };\n header?: React.ReactNode;\n headerActions?: ReadonlyArray<ButtonGroupProps.Item>;\n onHeaderActionClick?: NonCancelableEventHandler<ButtonGroupProps.ItemClickDetails>;\n position?: 'side' | 'bottom';\n onToggleFocusMode?: NonCancelableEventHandler<{ isExpanded: boolean }>;\n};\n\n// Widgetization notice: structures in this file are shared multiple app layout instances, possibly different minor versions.\n// Treat these structures as an API and do not make incompatible changes.\n// Legacy widget interface\nexport interface AppLayoutInternals {\n ariaLabels: AppLayoutPropsWithDefaults['ariaLabels'];\n headerVariant: AppLayoutPropsWithDefaults['headerVariant'];\n placement: AppLayoutPropsWithDefaults['placement'];\n navigationOpen: AppLayoutPropsWithDefaults['navigationOpen'];\n navigationFocusControl: FocusControlState;\n navigation: React.ReactNode;\n splitPanelPosition: AppLayoutProps.SplitPanelPreferences['position'];\n splitPanelOpen: boolean;\n splitPanelControlId: string;\n splitPanelFocusControl: SplitPanelFocusControlState;\n splitPanelToggleConfig: SplitPanelSideToggleProps;\n isMobile: boolean;\n activeDrawer: InternalDrawer | undefined;\n activeDrawerSize: number;\n minDrawerSize: number;\n maxDrawerSize: number;\n minGlobalDrawersSizes: Record<string, number>;\n maxGlobalDrawersSizes: Record<string, number>;\n drawers: ReadonlyArray<InternalDrawer>;\n drawersFocusControl: FocusControlState;\n globalDrawersFocusControl: FocusControlMultipleStates;\n activeGlobalDrawersIds: ReadonlyArray<string>;\n activeGlobalDrawers: ReadonlyArray<InternalDrawer>;\n globalDrawers: ReadonlyArray<InternalDrawer>;\n activeGlobalDrawersSizes: Record<string, number>;\n stickyNotifications: AppLayoutPropsWithDefaults['stickyNotifications'];\n breadcrumbs: React.ReactNode;\n discoveredBreadcrumbs: BreadcrumbGroupProps | null;\n toolbarState: 'show' | 'hide';\n setToolbarState: (state: 'show' | 'hide') => void;\n verticalOffsets: VerticalLayoutOutput;\n drawersOpenQueue: ReadonlyArray<string>;\n setNotificationsHeight: (height: number) => void;\n setToolbarHeight: (height: number) => void;\n onSplitPanelToggle: () => void;\n onNavigationToggle: (open: boolean) => void;\n onActiveDrawerChange: (newDrawerId: string | null, params: OnChangeParams) => void;\n onActiveDrawerResize: (detail: { id: string; size: number }) => void;\n onActiveGlobalDrawersChange: (newDrawerId: string, params: OnChangeParams) => void;\n splitPanelAnimationDisabled?: boolean;\n expandedDrawerId: string | null;\n setExpandedDrawerId: (value: string | null) => void;\n aiDrawer?: InternalDrawer | null;\n onActiveAiDrawerChange?: (newDrawerId: string | null, params?: OnChangeParams) => void;\n activeAiDrawer?: InternalDrawer | null;\n activeAiDrawerId: string | null;\n activeAiDrawerSize?: number;\n minAiDrawerSize?: number;\n maxAiDrawerSize?: number;\n aiDrawerFocusControl?: FocusControlState;\n onActiveAiDrawerResize: (size: number) => void;\n}\n\nexport interface AppLayoutWidgetizedState extends AppLayoutInternals {\n isNested: boolean;\n verticalOffsets: VerticalLayoutOutput;\n navigationAnimationDisabled: boolean;\n aiDrawerExpandedMode: boolean;\n splitPanelOffsets: {\n stickyVerticalBottomOffset: number;\n mainContentPaddingBlockEnd: number | undefined;\n };\n activeGlobalBottomDrawerId: string | null;\n onActiveGlobalBottomDrawerChange: (value: string | null, params: OnChangeParams) => void;\n activeGlobalBottomDrawerSize: number;\n minGlobalBottomDrawerSize: number;\n bottomDrawerReportedSize: number;\n getMaxGlobalBottomDrawerHeight: () => number;\n reportBottomDrawerSize: (size: number) => void;\n bottomDrawersFocusControl: FocusControlState;\n onActiveBottomDrawerResize: ({ id, size }: { id: string; size: number }) => void;\n bottomDrawers: ReadonlyArray<InternalDrawer>;\n}\n\n// New widget interface\nexport interface AppLayoutState {\n rootRef: React.Ref<HTMLElement>;\n isIntersecting: boolean;\n // new state management\n widgetizedState: AppLayoutWidgetizedState;\n // the old object shape for backward compatibility\n appLayoutInternals: AppLayoutInternals;\n splitPanelInternals: SplitPanelProviderProps;\n}\n\nexport type AppLayoutPendingState = SomeOptional<\n AppLayoutState,\n 'appLayoutInternals' | 'splitPanelInternals' | 'widgetizedState' | 'rootRef'\n>;\n"]}
@@ -7,7 +7,7 @@ import { useAppLayout } from './use-app-layout';
7
7
  import { useSkeletonSlotsAttributes } from './use-skeleton-slots-attributes';
8
8
  export const AppLayoutStateProvider = ({ appLayoutProps, stateManager, forwardRef }) => {
9
9
  var _a;
10
- const [hasToolbar, setHasToolbar] = useState((_a = stateManager.current.hasToolbar) !== null && _a !== void 0 ? _a : true);
10
+ const [hasToolbar, setHasToolbar] = useState((_a = stateManager.current.hasToolbar) !== null && _a !== void 0 ? _a : false);
11
11
  const appLayoutState = useAppLayout(hasToolbar, appLayoutProps, forwardRef);
12
12
  const skeletonSlotsAttributes = useSkeletonSlotsAttributes(hasToolbar, appLayoutProps, appLayoutState);
13
13
  useLayoutEffect(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/index.tsx"],"names":[],"mappings":"AAAA,qEAAq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BAA8B,GAAG,yBAAyB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ForwardedRef, useLayoutEffect, useState } from 'react';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { AppLayoutInternalProps, AppLayoutState } from '../interfaces';\nimport { SkeletonSlotsAttributes } from '../skeleton/interfaces';\nimport { MergeProps, SharedProps } from './interfaces';\nimport { getPropsToMerge, mergeProps } from './props-merger';\nimport { useAppLayout } from './use-app-layout';\nimport { useSkeletonSlotsAttributes } from './use-skeleton-slots-attributes';\n\nexport interface StateManager {\n setState:\n | ((\n appLayoutState: AppLayoutState,\n skeletonAttributes: SkeletonSlotsAttributes,\n deduplicationProps: SharedProps,\n mergeProps: MergeProps\n ) => void)\n | undefined;\n hasToolbar: boolean;\n setToolbar: ((hasToolbar: boolean) => void) | undefined;\n}\n\nexport interface AppLayoutStateProps {\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n forwardRef: ForwardedRef<AppLayoutProps.Ref>;\n}\n\nexport const AppLayoutStateProvider = ({ appLayoutProps, stateManager, forwardRef }: AppLayoutStateProps) => {\n const [hasToolbar, setHasToolbar] = useState(stateManager.current.hasToolbar ?? true);\n const appLayoutState = useAppLayout(hasToolbar, appLayoutProps, forwardRef);\n const skeletonSlotsAttributes = useSkeletonSlotsAttributes(hasToolbar, appLayoutProps, appLayoutState);\n\n useLayoutEffect(() => {\n if (!stateManager.current?.setState) {\n console.warn('AppLayout state manager is not found');\n return;\n }\n stateManager.current.setState(\n appLayoutState,\n skeletonSlotsAttributes,\n getPropsToMerge(appLayoutProps, appLayoutState),\n mergeProps\n );\n });\n\n useLayoutEffect(() => {\n stateManager.current.setToolbar = setHasToolbar;\n }, [stateManager]);\n\n return <></>;\n};\n\nexport const createWidgetizedAppLayoutState = createWidgetizedComponent(AppLayoutStateProvider);\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,EAAE,EAAgB,eAAe,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAC;AAKtE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAqB7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAuB,EAAE,EAAE;;IAC1G,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,MAAA,YAAY,CAAC,OAAO,CAAC,UAAU,mCAAI,KAAK,CAAC,CAAC;IACvF,MAAM,cAAc,GAAG,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;IAC5E,MAAM,uBAAuB,GAAG,0BAA0B,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;IAEvG,eAAe,CAAC,GAAG,EAAE;;QACnB,IAAI,CAAC,CAAA,MAAA,YAAY,CAAC,OAAO,0CAAE,QAAQ,CAAA,EAAE;YACnC,OAAO,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;YACrD,OAAO;SACR;QACD,YAAY,CAAC,OAAO,CAAC,QAAQ,CAC3B,cAAc,EACd,uBAAuB,EACvB,eAAe,CAAC,cAAc,EAAE,cAAc,CAAC,EAC/C,UAAU,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,eAAe,CAAC,GAAG,EAAE;QACnB,YAAY,CAAC,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC;IAClD,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,8BAA8B,GAAG,yBAAyB,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React, { ForwardedRef, useLayoutEffect, useState } from 'react';\n\nimport { createWidgetizedComponent } from '../../../internal/widgets';\nimport { AppLayoutProps } from '../../interfaces';\nimport { AppLayoutInternalProps, AppLayoutState } from '../interfaces';\nimport { SkeletonSlotsAttributes } from '../skeleton/interfaces';\nimport { MergeProps, SharedProps } from './interfaces';\nimport { getPropsToMerge, mergeProps } from './props-merger';\nimport { useAppLayout } from './use-app-layout';\nimport { useSkeletonSlotsAttributes } from './use-skeleton-slots-attributes';\n\nexport interface StateManager {\n setState:\n | ((\n appLayoutState: AppLayoutState,\n skeletonAttributes: SkeletonSlotsAttributes,\n deduplicationProps: SharedProps,\n mergeProps: MergeProps\n ) => void)\n | undefined;\n hasToolbar: boolean;\n setToolbar: ((hasToolbar: boolean) => void) | undefined;\n}\n\nexport interface AppLayoutStateProps {\n appLayoutProps: AppLayoutInternalProps;\n stateManager: React.MutableRefObject<StateManager>;\n forwardRef: ForwardedRef<AppLayoutProps.Ref>;\n}\n\nexport const AppLayoutStateProvider = ({ appLayoutProps, stateManager, forwardRef }: AppLayoutStateProps) => {\n const [hasToolbar, setHasToolbar] = useState(stateManager.current.hasToolbar ?? false);\n const appLayoutState = useAppLayout(hasToolbar, appLayoutProps, forwardRef);\n const skeletonSlotsAttributes = useSkeletonSlotsAttributes(hasToolbar, appLayoutProps, appLayoutState);\n\n useLayoutEffect(() => {\n if (!stateManager.current?.setState) {\n console.warn('AppLayout state manager is not found');\n return;\n }\n stateManager.current.setState(\n appLayoutState,\n skeletonSlotsAttributes,\n getPropsToMerge(appLayoutProps, appLayoutState),\n mergeProps\n );\n });\n\n useLayoutEffect(() => {\n stateManager.current.setToolbar = setHasToolbar;\n }, [stateManager]);\n\n return <></>;\n};\n\nexport const createWidgetizedAppLayoutState = createWidgetizedComponent(AppLayoutStateProvider);\n"]}
@@ -15,6 +15,9 @@ export declare function useAiDrawer({ onAiDrawerFocus, expandedDrawerId, setExpa
15
15
  onToggle?: import("../../../internal/events").NonCancelableEventHandler<import("../../../internal/plugins/controllers/drawers").DrawerStateChangeParams> | undefined;
16
16
  headerActions?: readonly import("../../..").ButtonGroupProps.Item[] | undefined;
17
17
  exitExpandedModeTrigger?: import("react").ReactNode;
18
+ onToggleFocusMode?: import("../../../internal/events").NonCancelableEventHandler<{
19
+ isExpanded: boolean;
20
+ }> | undefined;
18
21
  }) | null;
19
22
  aiDrawerMessageHandler: (event: WidgetMessage) => void;
20
23
  onActiveAiDrawerChange: (newDrawerId: string | null, { initiatedByUserAction }?: OnChangeParams) => void;
@@ -23,6 +26,9 @@ export declare function useAiDrawer({ onAiDrawerFocus, expandedDrawerId, setExpa
23
26
  onToggle?: import("../../../internal/events").NonCancelableEventHandler<import("../../../internal/plugins/controllers/drawers").DrawerStateChangeParams> | undefined;
24
27
  headerActions?: readonly import("../../..").ButtonGroupProps.Item[] | undefined;
25
28
  exitExpandedModeTrigger?: import("react").ReactNode;
29
+ onToggleFocusMode?: import("../../../internal/events").NonCancelableEventHandler<{
30
+ isExpanded: boolean;
31
+ }> | undefined;
26
32
  }) | null;
27
33
  activeAiDrawerId: string | null;
28
34
  activeAiDrawerSize: number;
@@ -1 +1 @@
1
- {"version":3,"file":"use-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-ai-drawer.ts"],"names":[],"mappings":";AAKA,OAAO,EAA0C,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAIpH,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAMD,UAAU,eAAe;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,kBAAkB,EAAE,MAAM,MAAM,CAAC;CAClC;AAED,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,EAAE,eAAe;;;;;;;oCAkCuB,aAAa;0CApBrC,MAAM,GAAG,IAAI,8BACC,cAAc;;;;;;;;;;mCARL,MAAM;EAmE7C"}
1
+ {"version":3,"file":"use-ai-drawer.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-ai-drawer.ts"],"names":[],"mappings":";AAKA,OAAO,EAA0C,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAIpH,MAAM,WAAW,cAAc;IAC7B,qBAAqB,EAAE,OAAO,CAAC;CAChC;AAMD,UAAU,eAAe;IACvB,eAAe,EAAE,MAAM,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACpD,kBAAkB,EAAE,MAAM,MAAM,CAAC;CAClC;AAED,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,GACnB,EAAE,eAAe;;;;;;;;;;oCAkCuB,aAAa;0CApBrC,MAAM,GAAG,IAAI,8BACC,cAAc;;;;;;;;;;;;;mCARL,MAAM;EAmE7C"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-app-layout.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-app-layout.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,YAAY,EAAiE,MAAM,OAAO,CAAC;AAc3G,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYlD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAsB,MAAM,eAAe,CAAC;AAK3E,eAAO,MAAM,YAAY,eACX,OAAO,4fA2BhB,sBAAsB,cACb,aAAa,eAAe,GAAG,CAAC,KAC3C,cAqiBF,CAAC"}
1
+ {"version":3,"file":"use-app-layout.d.ts","sourceRoot":"","sources":["../../../../../src/app-layout/visual-refresh-toolbar/state/use-app-layout.tsx"],"names":[],"mappings":"AAEA,OAAc,EAAE,YAAY,EAAiE,MAAM,OAAO,CAAC;AAc3G,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAYlD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,sBAAsB,EAAsB,MAAM,eAAe,CAAC;AAK3E,eAAO,MAAM,YAAY,eACX,OAAO,4fA2BhB,sBAAsB,cACb,aAAa,eAAe,GAAG,CAAC,KAC3C,cA+iBF,CAAC"}
@@ -30,7 +30,7 @@ export const useAppLayout = (hasToolbar, _a, forwardRef) => {
30
30
  const [navigationAnimationDisabled, setNavigationAnimationDisabled] = useState(true);
31
31
  const [splitPanelAnimationDisabled, setSplitPanelAnimationDisabled] = useState(true);
32
32
  const [isNested, setIsNested] = useState(false);
33
- const [expandedDrawerId, setExpandedDrawerId] = useState(null);
33
+ const [expandedDrawerId, setInternalExpandedDrawerId] = useState(null);
34
34
  const rootRefInternal = useRef(null);
35
35
  // This workaround ensures the ref is defined before checking if the app layout is nested.
36
36
  // On initial render, the ref might be undefined because this component loads asynchronously via the widget API.
@@ -47,6 +47,14 @@ export const useAppLayout = (hasToolbar, _a, forwardRef) => {
47
47
  drawersFocusControl.setFocus();
48
48
  fireNonCancelableEvent(onToolsChange, { open });
49
49
  };
50
+ const setExpandedDrawerId = (value) => {
51
+ setInternalExpandedDrawerId(value);
52
+ if ((aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.onToggleFocusMode) && (value === (aiDrawer === null || aiDrawer === void 0 ? void 0 : aiDrawer.id) || value === null)) {
53
+ fireNonCancelableEvent(aiDrawer.onToggleFocusMode, {
54
+ isExpanded: !!value,
55
+ });
56
+ }
57
+ };
50
58
  const onGlobalDrawerFocus = (drawerId, open) => {
51
59
  globalDrawersFocusControl.setFocus({ force: true, drawerId, open });
52
60
  };