@cloudscape-design/components-themeable 3.0.1164 → 3.0.1165

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 (44) hide show
  1. package/lib/internal/manifest.json +1 -1
  2. package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +1 -1
  3. package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
  4. package/lib/internal/scss/table/resizer/styles.scss +7 -6
  5. package/lib/internal/template/app-layout/runtime-drawer/index.d.ts.map +1 -1
  6. package/lib/internal/template/app-layout/runtime-drawer/index.js +20 -18
  7. package/lib/internal/template/app-layout/runtime-drawer/index.js.map +1 -1
  8. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +30 -30
  9. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +83 -83
  10. package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +30 -30
  11. package/lib/internal/template/autosuggest/interfaces.d.ts +1 -1
  12. package/lib/internal/template/autosuggest/interfaces.js.map +1 -1
  13. package/lib/internal/template/button-group/interfaces.d.ts +9 -0
  14. package/lib/internal/template/button-group/interfaces.d.ts.map +1 -1
  15. package/lib/internal/template/button-group/interfaces.js.map +1 -1
  16. package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
  17. package/lib/internal/template/internal/environment.js +3 -3
  18. package/lib/internal/template/internal/environment.json +2 -2
  19. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts +2 -2
  20. package/lib/internal/template/internal/plugins/controllers/drawers.d.ts.map +1 -1
  21. package/lib/internal/template/internal/plugins/controllers/drawers.js.map +1 -1
  22. package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +2 -2
  23. package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -1
  24. package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -1
  25. package/lib/internal/template/select/interfaces.d.ts +1 -1
  26. package/lib/internal/template/select/interfaces.js.map +1 -1
  27. package/lib/internal/template/table/header-cell/index.d.ts +1 -1
  28. package/lib/internal/template/table/header-cell/index.d.ts.map +1 -1
  29. package/lib/internal/template/table/header-cell/index.js +1 -1
  30. package/lib/internal/template/table/header-cell/index.js.map +1 -1
  31. package/lib/internal/template/table/header-cell/th-element.d.ts +1 -1
  32. package/lib/internal/template/table/header-cell/th-element.d.ts.map +1 -1
  33. package/lib/internal/template/table/header-cell/th-element.js.map +1 -1
  34. package/lib/internal/template/table/resizer/index.d.ts +2 -1
  35. package/lib/internal/template/table/resizer/index.d.ts.map +1 -1
  36. package/lib/internal/template/table/resizer/index.js +8 -5
  37. package/lib/internal/template/table/resizer/index.js.map +1 -1
  38. package/lib/internal/template/table/resizer/styles.css.js +13 -12
  39. package/lib/internal/template/table/resizer/styles.scoped.css +22 -22
  40. package/lib/internal/template/table/resizer/styles.selectors.js +13 -12
  41. package/lib/internal/template/table/thead.d.ts +1 -1
  42. package/lib/internal/template/table/thead.d.ts.map +1 -1
  43. package/lib/internal/template/table/thead.js.map +1 -1
  44. package/package.json +1 -1
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "6d73d510d605b51f723de7237f21a605825f87b3"
2
+ "commit": "1bfc081cf3a606d870361eaabd7f385af0fd3d98"
3
3
  }
@@ -23,7 +23,7 @@
23
23
  $global-drawer-gap-size: 8px;
24
24
  $global-drawer-expanded-mode-motion: #{awsui.$motion-duration-refresh-only-slow} #{awsui.$motion-easing-refresh-only-a};
25
25
  $drawer-resize-handle-size: awsui.$space-m;
26
- $ai-drawer-heider-height: 41px;
26
+ $ai-drawer-heider-height: 42px;
27
27
 
28
28
  .drawer {
29
29
  position: sticky;
@@ -1,6 +1,6 @@
1
1
 
2
2
  // Build environment
3
- $awsui-commit-hash: "6d73d510";
3
+ $awsui-commit-hash: "1bfc081c";
4
4
  // Manually managed CSS-variables
5
5
  $maxContentWidth: --awsui-max-content-width-d43v8n;
6
6
  $minContentWidth: --awsui-min-content-width-d43v8n;
@@ -20,12 +20,12 @@ $block-gap: calc(2 * #{awsui.$space-xs} + #{awsui.$space-xxxs});
20
20
  .resizer-wrapper {
21
21
  inset-block: 0;
22
22
  position: absolute;
23
- inset-inline-end: calc(-1 * #{$handle-width} / 2);
23
+ inset-inline-end: calc(-1 * $handle-width / 2);
24
24
  inline-size: $handle-width;
25
25
  overflow: hidden;
26
26
  z-index: 10;
27
27
 
28
- th:last-child > &:has(.divider-interactive):not(.is-visual-refresh) {
28
+ th:last-child > &:has(.divider-interactive).is-borderless {
29
29
  inset-inline-end: 0;
30
30
  }
31
31
  }
@@ -58,6 +58,11 @@ th:not(:last-child) > .divider-disabled {
58
58
  inset-inline-end: calc(#{$handle-width} / 2);
59
59
  }
60
60
 
61
+ // stylelint-disable-next-line selector-combinator-disallowed-list
62
+ th:last-child > .resizer-wrapper.visual-refresh.is-borderless .divider-interactive {
63
+ inset-inline-end: 0;
64
+ }
65
+
61
66
  .divider-active {
62
67
  border-inline-start: $active-separator-width solid awsui.$color-border-divider-active;
63
68
  }
@@ -89,10 +94,6 @@ th:not(:last-child) > .divider-disabled {
89
94
  }
90
95
  }
91
96
 
92
- th:last-child > .resizer:not(.is-visual-refresh) {
93
- inset-inline-end: 0;
94
- }
95
-
96
97
  .tracker {
97
98
  display: none;
98
99
  position: absolute;
@@ -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,EAA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AAC,SAAS,CAAC;IAC1C,iBAAiB,CAAC,EAAE,yBAAyB,CAAC;QAAE,UAAU,EAAE,OAAO,CAAA;KAAE,CAAC,CAAC;CAsCxE,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,YAAY,EAAE,KAAK,CAAC,mBAAmB,CAAC,EACxC,aAAa,EAAE,KAAK,CAAC,mBAAmB,CAAC,GACxC,aAAa,CAQf"}
@@ -1,7 +1,6 @@
1
1
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
  import React, { useContext, useEffect, useRef } from 'react';
4
- import { warnOnce } from '@cloudscape-design/component-toolkit/internal';
5
4
  import { fireNonCancelableEvent } from '../../internal/events';
6
5
  import { sortByPriority } from '../../internal/plugins/helpers/utils';
7
6
  import { ActiveDrawersContext } from '../utils/visibility-context';
@@ -42,21 +41,20 @@ function RuntimeDrawerHeader({ mountHeader, unmountHeader }) {
42
41
  }, []);
43
42
  return React.createElement("div", { className: styles['runtime-header-wrapper'], ref: ref });
44
43
  }
45
- function checkForUnsupportedProps(headerActions) {
46
- const unsupportedProps = new Set([
47
- 'iconSvg',
48
- 'popoverFeedback',
49
- 'pressedIconSvg',
50
- 'popoverFeedback',
51
- 'pressedPopoverFeedback',
52
- ]);
53
- for (const item of headerActions) {
54
- const unsupported = Object.keys(item).filter(key => unsupportedProps.has(key));
55
- if (unsupported.length > 0) {
56
- warnOnce('AppLayout', `The headerActions properties are not supported for runtime api: ${unsupported.join(' ')}`);
57
- }
58
- }
59
- return headerActions;
44
+ function mapRuntimeHeaderActionsToHeaderActions(runtimeHeaderActions) {
45
+ return runtimeHeaderActions.map(runtimeHeaderAction => {
46
+ return {
47
+ ...runtimeHeaderAction,
48
+ ...('iconSvg' in runtimeHeaderAction &&
49
+ runtimeHeaderAction.iconSvg && {
50
+ iconSvg: convertRuntimeTriggerToReactNode(runtimeHeaderAction.iconSvg),
51
+ }),
52
+ ...('pressedIconSvg' in runtimeHeaderAction &&
53
+ runtimeHeaderAction.pressedIconSvg && {
54
+ iconSvg: convertRuntimeTriggerToReactNode(runtimeHeaderAction.pressedIconSvg),
55
+ }),
56
+ };
57
+ });
60
58
  }
61
59
  const convertRuntimeTriggerToReactNode = (runtimeTrigger) => {
62
60
  if (!runtimeTrigger) {
@@ -82,7 +80,9 @@ export const mapRuntimeConfigToDrawer = (runtimeConfig) => {
82
80
  onResize: event => {
83
81
  fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });
84
82
  },
85
- headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,
83
+ headerActions: runtimeDrawer.headerActions
84
+ ? mapRuntimeHeaderActionsToHeaderActions(runtimeDrawer.headerActions)
85
+ : undefined,
86
86
  };
87
87
  };
88
88
  export const mapRuntimeConfigToAiDrawer = (runtimeConfig) => {
@@ -109,7 +109,9 @@ export const mapRuntimeConfigToAiDrawer = (runtimeConfig) => {
109
109
  onResize: event => {
110
110
  fireNonCancelableEvent(runtimeDrawer.onResize, { size: event.detail.size, id: runtimeDrawer.id });
111
111
  },
112
- headerActions: runtimeDrawer.headerActions ? checkForUnsupportedProps(runtimeDrawer.headerActions) : undefined,
112
+ headerActions: runtimeDrawer.headerActions
113
+ ? mapRuntimeHeaderActionsToHeaderActions(runtimeDrawer.headerActions)
114
+ : undefined,
113
115
  };
114
116
  };
115
117
  export function convertRuntimeDrawers(localDrawers, globalDrawers) {
@@ -1 +1 @@
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,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F,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
+ {"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;AAG7D,OAAO,EAAE,sBAAsB,EAA6B,MAAM,uBAAuB,CAAC;AAK1F,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAGtE,OAAO,EAAE,oBAA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AM,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 { ButtonGroupProps, ItemRuntime } 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 mapRuntimeHeaderActionsToHeaderActions(\n runtimeHeaderActions: ReadonlyArray<ItemRuntime>\n): ReadonlyArray<ButtonGroupProps.Item> {\n return runtimeHeaderActions.map(runtimeHeaderAction => {\n return {\n ...runtimeHeaderAction,\n ...('iconSvg' in runtimeHeaderAction &&\n runtimeHeaderAction.iconSvg && {\n iconSvg: convertRuntimeTriggerToReactNode(runtimeHeaderAction.iconSvg),\n }),\n ...('pressedIconSvg' in runtimeHeaderAction &&\n runtimeHeaderAction.pressedIconSvg && {\n iconSvg: convertRuntimeTriggerToReactNode(runtimeHeaderAction.pressedIconSvg),\n }),\n };\n });\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\n ? mapRuntimeHeaderActionsToHeaderActions(runtimeDrawer.headerActions)\n : 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\n ? mapRuntimeHeaderActionsToHeaderActions(runtimeDrawer.headerActions)\n : 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,35 +1,35 @@
1
1
 
2
2
  import './styles.scoped.css';
3
3
  export default {
4
- "drawer": "awsui_drawer_12i0j_pby2u_193",
5
- "with-expanded-motion": "awsui_with-expanded-motion_12i0j_pby2u_207",
6
- "legacy": "awsui_legacy_12i0j_pby2u_221",
7
- "ai-drawer": "awsui_ai-drawer_12i0j_pby2u_221",
8
- "bottom-drawer": "awsui_bottom-drawer_12i0j_pby2u_221",
9
- "last-opened": "awsui_last-opened_12i0j_pby2u_229",
10
- "drawer-global": "awsui_drawer-global_12i0j_pby2u_233",
11
- "drawer-expanded": "awsui_drawer-expanded_12i0j_pby2u_242",
12
- "drawer-hidden": "awsui_drawer-hidden_12i0j_pby2u_246",
13
- "has-next-siblings": "awsui_has-next-siblings_12i0j_pby2u_256",
14
- "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_pby2u_256",
15
- "drawer-content-container": "awsui_drawer-content-container_12i0j_pby2u_270",
16
- "drawer-gap": "awsui_drawer-gap_12i0j_pby2u_273",
17
- "drawer-close-button": "awsui_drawer-close-button_12i0j_pby2u_291",
18
- "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_pby2u_297",
19
- "drawer-content": "awsui_drawer-content_12i0j_pby2u_270",
20
- "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_pby2u_309",
21
- "drawer-slider": "awsui_drawer-slider_12i0j_pby2u_312",
22
- "drawer-actions": "awsui_drawer-actions_12i0j_pby2u_364",
23
- "ai-drawer-slider-handle": "awsui_ai-drawer-slider-handle_12i0j_pby2u_421",
24
- "drawer-content-header": "awsui_drawer-content-header_12i0j_pby2u_440",
25
- "drawer-content-header-content": "awsui_drawer-content-header-content_12i0j_pby2u_453",
26
- "drawer-back-to-console-slot": "awsui_drawer-back-to-console-slot_12i0j_pby2u_470",
27
- "drawer-back-to-console-button-wrapper": "awsui_drawer-back-to-console-button-wrapper_12i0j_pby2u_509",
28
- "drawer-back-to-console-button": "awsui_drawer-back-to-console-button_12i0j_pby2u_509",
29
- "drawer-back-to-console-custom-button": "awsui_drawer-back-to-console-custom-button_12i0j_pby2u_582",
30
- "drawer-content-content": "awsui_drawer-content-content_12i0j_pby2u_588",
31
- "bottom-drawer-content-header": "awsui_bottom-drawer-content-header_12i0j_pby2u_646",
32
- "bottom-drawer-content-header-content": "awsui_bottom-drawer-content-header-content_12i0j_pby2u_653",
33
- "bottom-drawer-actions": "awsui_bottom-drawer-actions_12i0j_pby2u_661"
4
+ "drawer": "awsui_drawer_12i0j_8ky8x_193",
5
+ "with-expanded-motion": "awsui_with-expanded-motion_12i0j_8ky8x_207",
6
+ "legacy": "awsui_legacy_12i0j_8ky8x_221",
7
+ "ai-drawer": "awsui_ai-drawer_12i0j_8ky8x_221",
8
+ "bottom-drawer": "awsui_bottom-drawer_12i0j_8ky8x_221",
9
+ "last-opened": "awsui_last-opened_12i0j_8ky8x_229",
10
+ "drawer-global": "awsui_drawer-global_12i0j_8ky8x_233",
11
+ "drawer-expanded": "awsui_drawer-expanded_12i0j_8ky8x_242",
12
+ "drawer-hidden": "awsui_drawer-hidden_12i0j_8ky8x_246",
13
+ "has-next-siblings": "awsui_has-next-siblings_12i0j_8ky8x_256",
14
+ "global-drawer-wrapper": "awsui_global-drawer-wrapper_12i0j_8ky8x_256",
15
+ "drawer-content-container": "awsui_drawer-content-container_12i0j_8ky8x_270",
16
+ "drawer-gap": "awsui_drawer-gap_12i0j_8ky8x_273",
17
+ "drawer-close-button": "awsui_drawer-close-button_12i0j_8ky8x_291",
18
+ "drawer-expanded-mode-button": "awsui_drawer-expanded-mode-button_12i0j_8ky8x_297",
19
+ "drawer-content": "awsui_drawer-content_12i0j_8ky8x_270",
20
+ "drawer-content-hidden": "awsui_drawer-content-hidden_12i0j_8ky8x_309",
21
+ "drawer-slider": "awsui_drawer-slider_12i0j_8ky8x_312",
22
+ "drawer-actions": "awsui_drawer-actions_12i0j_8ky8x_364",
23
+ "ai-drawer-slider-handle": "awsui_ai-drawer-slider-handle_12i0j_8ky8x_421",
24
+ "drawer-content-header": "awsui_drawer-content-header_12i0j_8ky8x_440",
25
+ "drawer-content-header-content": "awsui_drawer-content-header-content_12i0j_8ky8x_453",
26
+ "drawer-back-to-console-slot": "awsui_drawer-back-to-console-slot_12i0j_8ky8x_470",
27
+ "drawer-back-to-console-button-wrapper": "awsui_drawer-back-to-console-button-wrapper_12i0j_8ky8x_509",
28
+ "drawer-back-to-console-button": "awsui_drawer-back-to-console-button_12i0j_8ky8x_509",
29
+ "drawer-back-to-console-custom-button": "awsui_drawer-back-to-console-custom-button_12i0j_8ky8x_582",
30
+ "drawer-content-content": "awsui_drawer-content-content_12i0j_8ky8x_588",
31
+ "bottom-drawer-content-header": "awsui_bottom-drawer-content-header_12i0j_8ky8x_646",
32
+ "bottom-drawer-content-header-content": "awsui_bottom-drawer-content-header-content_12i0j_8ky8x_653",
33
+ "bottom-drawer-actions": "awsui_bottom-drawer-actions_12i0j_8ky8x_661"
34
34
  };
35
35