@cloudscape-design/components-themeable 3.0.1083 → 3.0.1085
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.
- package/lib/internal/manifest.json +1 -1
- package/lib/internal/scss/app-layout/constants.scss +2 -0
- package/lib/internal/scss/app-layout/runtime-drawer/styles.scss +4 -0
- package/lib/internal/scss/app-layout/test-classes/styles.scss +3 -1
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/drawer/styles.scss +155 -1
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/skeleton/styles.scss +27 -4
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/toolbar/styles.scss +107 -12
- package/lib/internal/scss/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scss +31 -21
- package/lib/internal/scss/internal/components/panel-resize-handle/styles.scss +2 -1
- package/lib/internal/scss/internal/generated/custom-css-properties/index.scss +1 -1
- package/lib/internal/template/app-layout/interfaces.d.ts +1 -0
- package/lib/internal/template/app-layout/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.d.ts +9 -0
- package/lib/internal/template/app-layout/runtime-drawer/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/index.js +32 -3
- package/lib/internal/template/app-layout/runtime-drawer/index.js.map +1 -1
- package/lib/internal/template/app-layout/runtime-drawer/styles.css.js +2 -1
- package/lib/internal/template/app-layout/runtime-drawer/styles.scoped.css +5 -1
- package/lib/internal/template/app-layout/runtime-drawer/styles.selectors.js +2 -1
- package/lib/internal/template/app-layout/test-classes/styles.css.js +26 -24
- package/lib/internal/template/app-layout/test-classes/styles.scoped.css +26 -24
- package/lib/internal/template/app-layout/test-classes/styles.selectors.js +26 -24
- package/lib/internal/template/app-layout/utils/interfaces.d.ts +1 -1
- package/lib/internal/template/app-layout/utils/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-ai-drawer.d.ts +27 -0
- package/lib/internal/template/app-layout/utils/use-ai-drawer.d.ts.map +1 -0
- package/lib/internal/template/app-layout/utils/use-ai-drawer.js +104 -0
- package/lib/internal/template/app-layout/utils/use-ai-drawer.js.map +1 -0
- package/lib/internal/template/app-layout/utils/use-keyboard-events.js +8 -8
- package/lib/internal/template/app-layout/utils/use-keyboard-events.js.map +1 -1
- package/lib/internal/template/app-layout/utils/use-pointer-events.d.ts.map +1 -1
- package/lib/internal/template/app-layout/utils/use-pointer-events.js +8 -0
- package/lib/internal/template/app-layout/utils/use-pointer-events.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js +6 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/compute-layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts +31 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.d.ts.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js +81 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-ai-drawer.js.map +1 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/global-drawer.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.css.js +24 -17
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.scoped.css +228 -35
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/styles.selectors.js +24 -17
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts +2 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/use-resize.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/use-resize.js +2 -2
- package/lib/internal/template/app-layout/visual-refresh-toolbar/drawer/use-resize.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts +12 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.css.js +25 -23
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.scoped.css +56 -44
- package/lib/internal/template/app-layout/visual-refresh-toolbar/skeleton/styles.selectors.js +25 -23
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/interfaces.d.ts +2 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/interfaces.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/interfaces.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/props-merger.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/props-merger.js +8 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/props-merger.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js +24 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-app-layout.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js +3 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/state/use-skeleton-slots-attributes.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts +4 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js +28 -4
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/styles.css.js +15 -12
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/styles.scoped.css +126 -24
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/styles.selectors.js +15 -12
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts +2 -0
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js +3 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/index.js.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.css.js +7 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.scoped.css +30 -22
- package/lib/internal/template/app-layout/visual-refresh-toolbar/toolbar/trigger-button/styles.selectors.js +7 -5
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.d.ts.map +1 -1
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js +23 -3
- package/lib/internal/template/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.js.map +1 -1
- package/lib/internal/template/internal/base-component/styles.scoped.css +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts +2 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.d.ts.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/index.js +18 -8
- package/lib/internal/template/internal/components/panel-resize-handle/index.js.map +1 -1
- package/lib/internal/template/internal/components/panel-resize-handle/styles.css.js +3 -2
- package/lib/internal/template/internal/components/panel-resize-handle/styles.scoped.css +7 -6
- package/lib/internal/template/internal/components/panel-resize-handle/styles.selectors.js +3 -2
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.d.ts +0 -2
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.d.ts.map +1 -1
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.js +4 -35
- package/lib/internal/template/internal/context/single-tab-stop-navigation-context.js.map +1 -1
- package/lib/internal/template/internal/environment.js +2 -2
- package/lib/internal/template/internal/environment.json +2 -2
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts +59 -0
- package/lib/internal/template/internal/plugins/widget/interfaces.d.ts.map +1 -0
- package/lib/internal/template/internal/plugins/widget/interfaces.js +2 -0
- package/lib/internal/template/internal/plugins/widget/interfaces.js.map +1 -0
- package/lib/internal/template/internal/plugins/widget/internal.d.ts +21 -0
- package/lib/internal/template/internal/plugins/widget/internal.d.ts.map +1 -0
- package/lib/internal/template/internal/plugins/widget/internal.js +55 -0
- package/lib/internal/template/internal/plugins/widget/internal.js.map +1 -0
- package/lib/internal/template/internal/plugins/widget.d.ts +3 -0
- package/lib/internal/template/internal/plugins/widget.d.ts.map +1 -0
- package/lib/internal/template/internal/plugins/widget.js +5 -0
- package/lib/internal/template/internal/plugins/widget.js.map +1 -0
- package/lib/internal/template/internal/types.d.ts +4 -0
- package/lib/internal/template/internal/types.d.ts.map +1 -1
- package/lib/internal/template/internal/types.js +8 -1
- package/lib/internal/template/internal/types.js.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-modal/index.d.ts.map +1 -1
- package/lib/internal/template/s3-resource-selector/s3-modal/index.js +1 -4
- package/lib/internal/template/s3-resource-selector/s3-modal/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAA2B,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIrE,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAA2B,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIrE,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,QAAQ,EAAE,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAC;IAC3C,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,eAAe,CAAC,kBAAkB,CAAC,CAAC;IACtD,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAC7D,aAAa,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;;AAED,wBAsCG"}
|
|
@@ -4,15 +4,25 @@ import React from 'react';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
5
5
|
import InternalDragHandle from '../drag-handle';
|
|
6
6
|
import styles from './styles.css.js';
|
|
7
|
-
export default React.forwardRef(function PanelResizeHandle({ className, ariaLabel, tooltipText, ariaValuenow, position, onDirectionClick, onKeyDown, onPointerDown }, ref) {
|
|
8
|
-
return (React.createElement(InternalDragHandle, { className: clsx(className, styles.slider, styles[`slider-${position}`]), ariaLabel: ariaLabel, tooltipText: tooltipText, ariaValue: { valueMin: 0, valueMax: 100, valueNow: ariaValuenow }, variant:
|
|
7
|
+
export default React.forwardRef(function PanelResizeHandle({ className, ariaLabel, tooltipText, ariaValuenow, position, onDirectionClick, onKeyDown, onPointerDown, disabled }, ref) {
|
|
8
|
+
return (React.createElement(InternalDragHandle, { className: clsx(className, styles.slider, styles[`slider-${position}`]), ariaLabel: ariaLabel, tooltipText: tooltipText, ariaValue: { valueMin: 0, valueMax: 100, valueNow: ariaValuenow !== null && ariaValuenow !== void 0 ? ariaValuenow : 0 }, variant: ['side', 'side-start'].includes(position) ? 'resize-horizontal' : 'resize-vertical', directions: disabled
|
|
9
9
|
? {
|
|
10
|
-
'inline-
|
|
11
|
-
'inline-
|
|
10
|
+
'inline-start': 'disabled',
|
|
11
|
+
'inline-end': 'disabled',
|
|
12
12
|
}
|
|
13
|
-
:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
: position === 'side'
|
|
14
|
+
? {
|
|
15
|
+
'inline-end': ariaValuenow === 0 ? 'disabled' : 'active',
|
|
16
|
+
'inline-start': ariaValuenow === 100 ? 'disabled' : 'active',
|
|
17
|
+
}
|
|
18
|
+
: position === 'side-start'
|
|
19
|
+
? {
|
|
20
|
+
'inline-end': ariaValuenow === 100 ? 'disabled' : 'active',
|
|
21
|
+
'inline-start': ariaValuenow === 0 ? 'disabled' : 'active',
|
|
22
|
+
}
|
|
23
|
+
: {
|
|
24
|
+
'block-end': ariaValuenow === 0 ? 'disabled' : 'active',
|
|
25
|
+
'block-start': ariaValuenow === 100 ? 'disabled' : 'active',
|
|
26
|
+
}, onDirectionClick: onDirectionClick, onKeyDown: onKeyDown, onPointerDown: onPointerDown, ref: ref }));
|
|
17
27
|
});
|
|
18
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,kBAAuC,MAAM,gBAAgB,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/internal/components/panel-resize-handle/index.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,OAAO,kBAAuC,MAAM,gBAAgB,CAAC;AAErE,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAcrC,eAAe,KAAK,CAAC,UAAU,CAAoC,SAAS,iBAAiB,CAC3F,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,aAAa,EAAE,QAAQ,EAAE,EACnH,GAAG;IAEH,OAAO,CACL,oBAAC,kBAAkB,IACjB,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,UAAU,QAAQ,EAAE,CAAC,CAAC,EACvE,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,CAAC,EAAE,EACtE,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,iBAAiB,EAC5F,UAAU,EACR,QAAQ;YACN,CAAC,CAAC;gBACE,cAAc,EAAE,UAAU;gBAC1B,YAAY,EAAE,UAAU;aACzB;YACH,CAAC,CAAC,QAAQ,KAAK,MAAM;gBACnB,CAAC,CAAC;oBACE,YAAY,EAAE,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;oBACxD,cAAc,EAAE,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;iBAC7D;gBACH,CAAC,CAAC,QAAQ,KAAK,YAAY;oBACzB,CAAC,CAAC;wBACE,YAAY,EAAE,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;wBAC1D,cAAc,EAAE,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;qBAC3D;oBACH,CAAC,CAAC;wBACE,WAAW,EAAE,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;wBACvD,aAAa,EAAE,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ;qBAC5D,EAEX,gBAAgB,EAAE,gBAAgB,EAClC,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,GAAG,EAAE,GAAG,GACR,CACH,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport React from 'react';\nimport clsx from 'clsx';\n\nimport InternalDragHandle, { DragHandleProps } from '../drag-handle';\n\nimport styles from './styles.css.js';\n\ninterface ResizeHandleProps {\n className?: string;\n ariaLabel: string | undefined;\n tooltipText?: string | undefined;\n position: 'side-start' | 'side' | 'bottom';\n ariaValuenow: number;\n onDirectionClick: DragHandleProps['onDirectionClick'];\n onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;\n onPointerDown: (event: React.PointerEvent<HTMLElement>) => void;\n disabled?: boolean;\n}\n\nexport default React.forwardRef<HTMLDivElement, ResizeHandleProps>(function PanelResizeHandle(\n { className, ariaLabel, tooltipText, ariaValuenow, position, onDirectionClick, onKeyDown, onPointerDown, disabled },\n ref\n) {\n return (\n <InternalDragHandle\n className={clsx(className, styles.slider, styles[`slider-${position}`])}\n ariaLabel={ariaLabel}\n tooltipText={tooltipText}\n ariaValue={{ valueMin: 0, valueMax: 100, valueNow: ariaValuenow ?? 0 }}\n variant={['side', 'side-start'].includes(position) ? 'resize-horizontal' : 'resize-vertical'}\n directions={\n disabled\n ? {\n 'inline-start': 'disabled',\n 'inline-end': 'disabled',\n }\n : position === 'side'\n ? {\n 'inline-end': ariaValuenow === 0 ? 'disabled' : 'active',\n 'inline-start': ariaValuenow === 100 ? 'disabled' : 'active',\n }\n : position === 'side-start'\n ? {\n 'inline-end': ariaValuenow === 100 ? 'disabled' : 'active',\n 'inline-start': ariaValuenow === 0 ? 'disabled' : 'active',\n }\n : {\n 'block-end': ariaValuenow === 0 ? 'disabled' : 'active',\n 'block-start': ariaValuenow === 100 ? 'disabled' : 'active',\n }\n }\n onDirectionClick={onDirectionClick}\n onKeyDown={onKeyDown}\n onPointerDown={onPointerDown}\n ref={ref}\n />\n );\n});\n"]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
|
|
2
2
|
import './styles.scoped.css';
|
|
3
3
|
export default {
|
|
4
|
-
"slider": "
|
|
5
|
-
"slider-side": "awsui_slider-
|
|
4
|
+
"slider": "awsui_slider_cqzlk_1oyzh_145",
|
|
5
|
+
"slider-side": "awsui_slider-side_cqzlk_1oyzh_179",
|
|
6
|
+
"slider-side-start": "awsui_slider-side-start_cqzlk_1oyzh_180"
|
|
6
7
|
};
|
|
7
8
|
|
|
@@ -142,7 +142,7 @@
|
|
|
142
142
|
*/
|
|
143
143
|
/* Style used for links in slots/components that are text heavy, to help links stand out among
|
|
144
144
|
surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F73#description */
|
|
145
|
-
.
|
|
145
|
+
.awsui_slider_cqzlk_1oyzh_145:not(#\9) {
|
|
146
146
|
padding-block: 0;
|
|
147
147
|
padding-inline: 0;
|
|
148
148
|
cursor: ns-resize;
|
|
@@ -151,17 +151,17 @@ surrounding text. (WCAG F73) https://www.w3.org/WAI/WCAG21/Techniques/failures/F
|
|
|
151
151
|
block-size: 18px;
|
|
152
152
|
touch-action: none;
|
|
153
153
|
}
|
|
154
|
-
.
|
|
154
|
+
.awsui_slider_cqzlk_1oyzh_145:not(#\9):focus {
|
|
155
155
|
outline: none;
|
|
156
156
|
}
|
|
157
|
-
body[data-awsui-focus-visible=true] .
|
|
157
|
+
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_1oyzh_145:not(#\9):focus {
|
|
158
158
|
position: relative;
|
|
159
159
|
}
|
|
160
|
-
body[data-awsui-focus-visible=true] .
|
|
160
|
+
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_1oyzh_145:not(#\9):focus {
|
|
161
161
|
outline: 2px dotted transparent;
|
|
162
162
|
outline-offset: calc(0px - 1px);
|
|
163
163
|
}
|
|
164
|
-
body[data-awsui-focus-visible=true] .
|
|
164
|
+
body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_1oyzh_145:not(#\9):focus::before {
|
|
165
165
|
content: " ";
|
|
166
166
|
display: block;
|
|
167
167
|
position: absolute;
|
|
@@ -176,7 +176,8 @@ body[data-awsui-focus-visible=true] .awsui_slider_cqzlk_144iw_145:not(#\9):focus
|
|
|
176
176
|
box-shadow: 0 0 0 2px var(--color-border-item-focused-r5f6xl, #0073bb);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
.awsui_slider-
|
|
179
|
+
.awsui_slider-side_cqzlk_1oyzh_179:not(#\9),
|
|
180
|
+
.awsui_slider-side-start_cqzlk_1oyzh_180:not(#\9) {
|
|
180
181
|
cursor: ew-resize;
|
|
181
182
|
margin-block: 0;
|
|
182
183
|
margin-inline-end: 0;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
// es-module interop with Babel and Typescript
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
module.exports.default = {
|
|
5
|
-
"slider": "
|
|
6
|
-
"slider-side": "awsui_slider-
|
|
5
|
+
"slider": "awsui_slider_cqzlk_1oyzh_145",
|
|
6
|
+
"slider-side": "awsui_slider-side_cqzlk_1oyzh_179",
|
|
7
|
+
"slider-side-start": "awsui_slider-side-start_cqzlk_1oyzh_180"
|
|
7
8
|
};
|
|
8
9
|
|
|
@@ -3,7 +3,6 @@ export type FocusableChangeHandler = (isFocusable: boolean) => void;
|
|
|
3
3
|
export declare const defaultValue: {
|
|
4
4
|
navigationActive: boolean;
|
|
5
5
|
registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;
|
|
6
|
-
resetFocusTarget(): void;
|
|
7
6
|
};
|
|
8
7
|
/**
|
|
9
8
|
* Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.
|
|
@@ -12,7 +11,6 @@ export declare const defaultValue: {
|
|
|
12
11
|
export declare const SingleTabStopNavigationContext: React.Context<{
|
|
13
12
|
navigationActive: boolean;
|
|
14
13
|
registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;
|
|
15
|
-
resetFocusTarget(): void;
|
|
16
14
|
}>;
|
|
17
15
|
export declare function useSingleTabStopNavigation(focusable: null | React.RefObject<HTMLElement>, options?: {
|
|
18
16
|
tabIndex?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-tab-stop-navigation-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAGA,OAAO,KAQN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"single-tab-stop-navigation-context.d.ts","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAGA,OAAO,KAQN,MAAM,OAAO,CAAC;AAIf,MAAM,MAAM,sBAAsB,GAAG,CAAC,WAAW,EAAE,OAAO,KAAK,IAAI,CAAC;AAEpE,eAAO,MAAM,YAAY,EAAE;IACzB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,sBAAsB,GAAG,MAAM,IAAI,CAAC;CAIxF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,8BAA8B;sBAXvB,OAAO;iCACI,WAAW,WAAW,sBAAsB,GAAG,MAAM,IAAI;EAUf,CAAC;AAE1E,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,EAC9C,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE;;;EAoBhC;AAED,UAAU,oCAAoC;IAC5C,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,kBAAkB,EAAE,MAAM,IAAI,GAAG,WAAW,CAAC;IAC7C,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,OAAO,GAAG,OAAO,CAAC;IACzD,mBAAmB,CAAC,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;IACtD,kBAAkB,CAAC,CAAC,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;CACtD;AAED,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,IAAI,IAAI,CAAC;IAC1B,cAAc,IAAI,IAAI,GAAG,WAAW,CAAC;IACrC,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC;CACzC;AAED,eAAO,MAAM,+BAA+B,yHA8E3C,CAAC"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
3
|
import React, { createContext, forwardRef, useContext, useImperativeHandle, useLayoutEffect, useRef, useState, } from 'react';
|
|
4
|
-
import { useEffectOnUpdate } from '../hooks/use-effect-on-update';
|
|
5
4
|
import { nodeBelongs } from '../utils/node-belongs';
|
|
6
5
|
export const defaultValue = {
|
|
7
6
|
navigationActive: false,
|
|
8
7
|
registerFocusable: () => () => { },
|
|
9
|
-
resetFocusTarget: () => { },
|
|
10
8
|
};
|
|
11
9
|
/**
|
|
12
10
|
* Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.
|
|
@@ -50,9 +48,6 @@ export const SingleTabStopNavigationProvider = forwardRef(({ navigationActive, c
|
|
|
50
48
|
// Register a focusable element to allow navigating into it.
|
|
51
49
|
// The focusable element tabIndex is only set to 0 if the element matches the focus target.
|
|
52
50
|
function registerFocusable(focusableElement, changeHandler) {
|
|
53
|
-
// In case the contexts are nested, we must that the components register to all of them,
|
|
54
|
-
// so that switching between contexts dynamically is possible.
|
|
55
|
-
const parentUnregister = parentContext.registerFocusable(focusableElement, changeHandler);
|
|
56
51
|
focusables.current.add(focusableElement);
|
|
57
52
|
focusHandlers.current.set(focusableElement, changeHandler);
|
|
58
53
|
const isFocusable = !!focusablesState.current.get(focusableElement);
|
|
@@ -62,10 +57,7 @@ export const SingleTabStopNavigationProvider = forwardRef(({ navigationActive, c
|
|
|
62
57
|
changeHandler(newIsFocusable);
|
|
63
58
|
}
|
|
64
59
|
onRegisterFocusable === null || onRegisterFocusable === void 0 ? void 0 : onRegisterFocusable(focusableElement);
|
|
65
|
-
return () =>
|
|
66
|
-
parentUnregister();
|
|
67
|
-
unregisterFocusable(focusableElement);
|
|
68
|
-
};
|
|
60
|
+
return () => unregisterFocusable(focusableElement);
|
|
69
61
|
}
|
|
70
62
|
function unregisterFocusable(focusableElement) {
|
|
71
63
|
focusables.current.delete(focusableElement);
|
|
@@ -73,21 +65,18 @@ export const SingleTabStopNavigationProvider = forwardRef(({ navigationActive, c
|
|
|
73
65
|
onUnregisterFocusable === null || onUnregisterFocusable === void 0 ? void 0 : onUnregisterFocusable(focusableElement);
|
|
74
66
|
}
|
|
75
67
|
// Update focus target with next single focusable element and notify all registered focusables of a change.
|
|
76
|
-
function updateFocusTarget(
|
|
68
|
+
function updateFocusTarget() {
|
|
77
69
|
var _a;
|
|
78
70
|
focusTarget.current = getNextFocusTarget();
|
|
79
71
|
for (const focusableElement of focusables.current) {
|
|
80
72
|
const isFocusable = (_a = focusablesState.current.get(focusableElement)) !== null && _a !== void 0 ? _a : false;
|
|
81
73
|
const newIsFocusable = focusTarget.current === focusableElement || !!(isElementSuppressed === null || isElementSuppressed === void 0 ? void 0 : isElementSuppressed(focusableElement));
|
|
82
|
-
if (newIsFocusable !== isFocusable
|
|
74
|
+
if (newIsFocusable !== isFocusable) {
|
|
83
75
|
focusablesState.current.set(focusableElement, newIsFocusable);
|
|
84
76
|
focusHandlers.current.get(focusableElement)(newIsFocusable);
|
|
85
77
|
}
|
|
86
78
|
}
|
|
87
79
|
}
|
|
88
|
-
function resetFocusTarget() {
|
|
89
|
-
updateFocusTarget(true);
|
|
90
|
-
}
|
|
91
80
|
function getFocusTarget() {
|
|
92
81
|
return focusTarget.current;
|
|
93
82
|
}
|
|
@@ -95,26 +84,6 @@ export const SingleTabStopNavigationProvider = forwardRef(({ navigationActive, c
|
|
|
95
84
|
return focusables.current.has(element);
|
|
96
85
|
}
|
|
97
86
|
useImperativeHandle(ref, () => ({ updateFocusTarget, getFocusTarget, isRegistered }));
|
|
98
|
-
|
|
99
|
-
// The outer context is preferred over the inners. The components using STSN
|
|
100
|
-
// must either work with either outer or inner context, or an explicit switch mechanism
|
|
101
|
-
// needs to be implemented (that turns the outer context on and off based on user interaction).
|
|
102
|
-
const parentContext = useContext(SingleTabStopNavigationContext);
|
|
103
|
-
const value = parentContext.navigationActive
|
|
104
|
-
? parentContext
|
|
105
|
-
: { navigationActive, registerFocusable, updateFocusTarget, resetFocusTarget };
|
|
106
|
-
// When contexts switching occurs, it is essential that the now-active one updates the focus target
|
|
107
|
-
// to ensure the tab indices are correctly set.
|
|
108
|
-
useEffectOnUpdate(() => {
|
|
109
|
-
if (parentContext.navigationActive) {
|
|
110
|
-
parentContext.resetFocusTarget();
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
resetFocusTarget();
|
|
114
|
-
}
|
|
115
|
-
// The updateFocusTarget and its dependencies must be pure.
|
|
116
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
117
|
-
}, [parentContext.navigationActive]);
|
|
118
|
-
return React.createElement(SingleTabStopNavigationContext.Provider, { value: value }, children);
|
|
87
|
+
return (React.createElement(SingleTabStopNavigationContext.Provider, { value: { navigationActive, registerFocusable } }, children));
|
|
119
88
|
});
|
|
120
89
|
//# sourceMappingURL=single-tab-stop-navigation-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"single-tab-stop-navigation-context.js","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,MAAM,YAAY,GAIrB;IACF,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;IACjC,gBAAgB,EAAE,GAAG,EAAE,GAAE,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CACxC,SAA8C,EAC9C,OAA+B;;IAE/B,MAAM,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,GAAG,UAAU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AAC;IAC7B,CAAC;IACD,SAAS,YAAY,CAAC,OAAgB;QACpC,OAAO,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzC,CAAC;IACD,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,iBAAiB,EAAE,cAAc,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAEtF,oDAAoD;IACpD,4EAA4E;IAC5E,uFAAuF;IACvF,+FAA+F;IAC/F,MAAM,aAAa,GAAG,UAAU,CAAC,8BAA8B,CAAC,CAAC;IACjE,MAAM,KAAK,GAAG,aAAa,CAAC,gBAAgB;QAC1C,CAAC,CAAC,aAAa;QACf,CAAC,CAAC,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAEjF,mGAAmG;IACnG,+CAA+C;IAC/C,iBAAiB,CAAC,GAAG,EAAE;QACrB,IAAI,aAAa,CAAC,gBAAgB,EAAE;YAClC,aAAa,CAAC,gBAAgB,EAAE,CAAC;SAClC;aAAM;YACL,gBAAgB,EAAE,CAAC;SACpB;QACD,2DAA2D;QAC3D,uDAAuD;IACzD,CAAC,EAAE,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAErC,OAAO,oBAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IAAG,QAAQ,CAA2C,CAAC;AACrH,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, {\n createContext,\n forwardRef,\n useContext,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { useEffectOnUpdate } from '../hooks/use-effect-on-update';\nimport { nodeBelongs } from '../utils/node-belongs';\n\nexport type FocusableChangeHandler = (isFocusable: boolean) => void;\n\nexport const defaultValue: {\n navigationActive: boolean;\n registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;\n resetFocusTarget(): void;\n} = {\n navigationActive: false,\n registerFocusable: () => () => {},\n resetFocusTarget: () => {},\n};\n\n/**\n * Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.\n * It instructs interactive elements to override tab indices for just a single one to remain user-focusable.\n */\nexport const SingleTabStopNavigationContext = createContext(defaultValue);\n\nexport function useSingleTabStopNavigation(\n focusable: null | React.RefObject<HTMLElement>,\n options?: { tabIndex?: number }\n) {\n const { navigationActive: contextNavigationActive, registerFocusable } = useContext(SingleTabStopNavigationContext);\n const [focusTargetActive, setFocusTargetActive] = useState(false);\n const navigationDisabled = options?.tabIndex && options?.tabIndex < 0;\n const navigationActive = contextNavigationActive && !navigationDisabled;\n\n useLayoutEffect(() => {\n if (navigationActive && focusable && focusable.current) {\n const unregister = registerFocusable(focusable.current, isFocusable => setFocusTargetActive(isFocusable));\n return () => unregister();\n }\n });\n\n let tabIndex = options?.tabIndex;\n if (navigationActive) {\n tabIndex = !focusTargetActive ? -1 : (options?.tabIndex ?? 0);\n }\n\n return { navigationActive, tabIndex };\n}\n\ninterface SingleTabStopNavigationProviderProps {\n navigationActive: boolean;\n children: React.ReactNode;\n getNextFocusTarget: () => null | HTMLElement;\n isElementSuppressed?(focusableElement: Element): boolean;\n onRegisterFocusable?(focusableElement: Element): void;\n onUnregisterActive?(focusableElement: Element): void;\n}\n\nexport interface SingleTabStopNavigationAPI {\n updateFocusTarget(): void;\n getFocusTarget(): null | HTMLElement;\n isRegistered(element: Element): boolean;\n}\n\nexport const SingleTabStopNavigationProvider = forwardRef(\n (\n {\n navigationActive,\n children,\n getNextFocusTarget,\n isElementSuppressed,\n onRegisterFocusable,\n onUnregisterActive,\n }: SingleTabStopNavigationProviderProps,\n ref: React.Ref<SingleTabStopNavigationAPI>\n ) => {\n // A set of registered focusable elements that can use keyboard navigation.\n const focusables = useRef(new Set<Element>());\n // A map of registered focusable element handlers to update the respective tab indices.\n const focusHandlers = useRef(new Map<Element, FocusableChangeHandler>());\n // A map of focusable element states to avoid issuing unnecessary updates to registered elements.\n const focusablesState = useRef(new WeakMap<Element, boolean>());\n // A reference to the currently focused element.\n const focusTarget = useRef<null | HTMLElement>(null);\n\n function onUnregisterFocusable(focusableElement: Element) {\n const isUnregisteringFocusedNode = nodeBelongs(focusableElement, document.activeElement);\n if (isUnregisteringFocusedNode) {\n // Wait for unmounted node to get removed from the DOM.\n setTimeout(() => onUnregisterActive?.(focusableElement), 0);\n }\n }\n\n // Register a focusable element to allow navigating into it.\n // The focusable element tabIndex is only set to 0 if the element matches the focus target.\n function registerFocusable(focusableElement: HTMLElement, changeHandler: FocusableChangeHandler) {\n // In case the contexts are nested, we must that the components register to all of them,\n // so that switching between contexts dynamically is possible.\n const parentUnregister = parentContext.registerFocusable(focusableElement, changeHandler);\n\n focusables.current.add(focusableElement);\n focusHandlers.current.set(focusableElement, changeHandler);\n const isFocusable = !!focusablesState.current.get(focusableElement);\n const newIsFocusable = focusTarget.current === focusableElement || !!isElementSuppressed?.(focusableElement);\n if (newIsFocusable !== isFocusable) {\n focusablesState.current.set(focusableElement, newIsFocusable);\n changeHandler(newIsFocusable);\n }\n onRegisterFocusable?.(focusableElement);\n\n return () => {\n parentUnregister();\n unregisterFocusable(focusableElement);\n };\n }\n function unregisterFocusable(focusableElement: Element) {\n focusables.current.delete(focusableElement);\n focusHandlers.current.delete(focusableElement);\n onUnregisterFocusable?.(focusableElement);\n }\n\n // Update focus target with next single focusable element and notify all registered focusables of a change.\n function updateFocusTarget(forceUpdate = false) {\n focusTarget.current = getNextFocusTarget();\n for (const focusableElement of focusables.current) {\n const isFocusable = focusablesState.current.get(focusableElement) ?? false;\n const newIsFocusable = focusTarget.current === focusableElement || !!isElementSuppressed?.(focusableElement);\n if (newIsFocusable !== isFocusable || forceUpdate) {\n focusablesState.current.set(focusableElement, newIsFocusable);\n focusHandlers.current.get(focusableElement)!(newIsFocusable);\n }\n }\n }\n function resetFocusTarget() {\n updateFocusTarget(true);\n }\n function getFocusTarget() {\n return focusTarget.current;\n }\n function isRegistered(element: Element) {\n return focusables.current.has(element);\n }\n useImperativeHandle(ref, () => ({ updateFocusTarget, getFocusTarget, isRegistered }));\n\n // Only one STSN context should be active at a time.\n // The outer context is preferred over the inners. The components using STSN\n // must either work with either outer or inner context, or an explicit switch mechanism\n // needs to be implemented (that turns the outer context on and off based on user interaction).\n const parentContext = useContext(SingleTabStopNavigationContext);\n const value = parentContext.navigationActive\n ? parentContext\n : { navigationActive, registerFocusable, updateFocusTarget, resetFocusTarget };\n\n // When contexts switching occurs, it is essential that the now-active one updates the focus target\n // to ensure the tab indices are correctly set.\n useEffectOnUpdate(() => {\n if (parentContext.navigationActive) {\n parentContext.resetFocusTarget();\n } else {\n resetFocusTarget();\n }\n // The updateFocusTarget and its dependencies must be pure.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [parentContext.navigationActive]);\n\n return <SingleTabStopNavigationContext.Provider value={value}>{children}</SingleTabStopNavigationContext.Provider>;\n }\n);\n"]}
|
|
1
|
+
{"version":3,"file":"single-tab-stop-navigation-context.js","sourceRoot":"","sources":["../../../../src/internal/context/single-tab-stop-navigation-context.tsx"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,KAAK,EAAE,EACZ,aAAa,EACb,UAAU,EACV,UAAU,EACV,mBAAmB,EACnB,eAAe,EACf,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAIpD,MAAM,CAAC,MAAM,YAAY,GAGrB;IACF,gBAAgB,EAAE,KAAK;IACvB,iBAAiB,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,GAAE,CAAC;CAClC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAG,aAAa,CAAC,YAAY,CAAC,CAAC;AAE1E,MAAM,UAAU,0BAA0B,CACxC,SAA8C,EAC9C,OAA+B;;IAE/B,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AAc,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC;IAEtF,OAAO,CACL,oBAAC,8BAA8B,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IACpF,QAAQ,CAC+B,CAC3C,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport React, {\n createContext,\n forwardRef,\n useContext,\n useImperativeHandle,\n useLayoutEffect,\n useRef,\n useState,\n} from 'react';\n\nimport { nodeBelongs } from '../utils/node-belongs';\n\nexport type FocusableChangeHandler = (isFocusable: boolean) => void;\n\nexport const defaultValue: {\n navigationActive: boolean;\n registerFocusable(focusable: HTMLElement, handler: FocusableChangeHandler): () => void;\n} = {\n navigationActive: false,\n registerFocusable: () => () => {},\n};\n\n/**\n * Single tab stop navigation context is used together with keyboard navigation that requires a single tab stop.\n * It instructs interactive elements to override tab indices for just a single one to remain user-focusable.\n */\nexport const SingleTabStopNavigationContext = createContext(defaultValue);\n\nexport function useSingleTabStopNavigation(\n focusable: null | React.RefObject<HTMLElement>,\n options?: { tabIndex?: number }\n) {\n const { navigationActive: contextNavigationActive, registerFocusable } = useContext(SingleTabStopNavigationContext);\n const [focusTargetActive, setFocusTargetActive] = useState(false);\n const navigationDisabled = options?.tabIndex && options?.tabIndex < 0;\n const navigationActive = contextNavigationActive && !navigationDisabled;\n\n useLayoutEffect(() => {\n if (navigationActive && focusable && focusable.current) {\n const unregister = registerFocusable(focusable.current, isFocusable => setFocusTargetActive(isFocusable));\n return () => unregister();\n }\n });\n\n let tabIndex = options?.tabIndex;\n if (navigationActive) {\n tabIndex = !focusTargetActive ? -1 : (options?.tabIndex ?? 0);\n }\n\n return { navigationActive, tabIndex };\n}\n\ninterface SingleTabStopNavigationProviderProps {\n navigationActive: boolean;\n children: React.ReactNode;\n getNextFocusTarget: () => null | HTMLElement;\n isElementSuppressed?(focusableElement: Element): boolean;\n onRegisterFocusable?(focusableElement: Element): void;\n onUnregisterActive?(focusableElement: Element): void;\n}\n\nexport interface SingleTabStopNavigationAPI {\n updateFocusTarget(): void;\n getFocusTarget(): null | HTMLElement;\n isRegistered(element: Element): boolean;\n}\n\nexport const SingleTabStopNavigationProvider = forwardRef(\n (\n {\n navigationActive,\n children,\n getNextFocusTarget,\n isElementSuppressed,\n onRegisterFocusable,\n onUnregisterActive,\n }: SingleTabStopNavigationProviderProps,\n ref: React.Ref<SingleTabStopNavigationAPI>\n ) => {\n // A set of registered focusable elements that can use keyboard navigation.\n const focusables = useRef(new Set<Element>());\n // A map of registered focusable element handlers to update the respective tab indices.\n const focusHandlers = useRef(new Map<Element, FocusableChangeHandler>());\n // A map of focusable element states to avoid issuing unnecessary updates to registered elements.\n const focusablesState = useRef(new WeakMap<Element, boolean>());\n // A reference to the currently focused element.\n const focusTarget = useRef<null | HTMLElement>(null);\n\n function onUnregisterFocusable(focusableElement: Element) {\n const isUnregisteringFocusedNode = nodeBelongs(focusableElement, document.activeElement);\n if (isUnregisteringFocusedNode) {\n // Wait for unmounted node to get removed from the DOM.\n setTimeout(() => onUnregisterActive?.(focusableElement), 0);\n }\n }\n\n // Register a focusable element to allow navigating into it.\n // The focusable element tabIndex is only set to 0 if the element matches the focus target.\n function registerFocusable(focusableElement: Element, changeHandler: FocusableChangeHandler) {\n focusables.current.add(focusableElement);\n focusHandlers.current.set(focusableElement, changeHandler);\n const isFocusable = !!focusablesState.current.get(focusableElement);\n const newIsFocusable = focusTarget.current === focusableElement || !!isElementSuppressed?.(focusableElement);\n if (newIsFocusable !== isFocusable) {\n focusablesState.current.set(focusableElement, newIsFocusable);\n changeHandler(newIsFocusable);\n }\n onRegisterFocusable?.(focusableElement);\n return () => unregisterFocusable(focusableElement);\n }\n function unregisterFocusable(focusableElement: Element) {\n focusables.current.delete(focusableElement);\n focusHandlers.current.delete(focusableElement);\n onUnregisterFocusable?.(focusableElement);\n }\n\n // Update focus target with next single focusable element and notify all registered focusables of a change.\n function updateFocusTarget() {\n focusTarget.current = getNextFocusTarget();\n for (const focusableElement of focusables.current) {\n const isFocusable = focusablesState.current.get(focusableElement) ?? false;\n const newIsFocusable = focusTarget.current === focusableElement || !!isElementSuppressed?.(focusableElement);\n if (newIsFocusable !== isFocusable) {\n focusablesState.current.set(focusableElement, newIsFocusable);\n focusHandlers.current.get(focusableElement)!(newIsFocusable);\n }\n }\n }\n\n function getFocusTarget() {\n return focusTarget.current;\n }\n\n function isRegistered(element: Element) {\n return focusables.current.has(element);\n }\n\n useImperativeHandle(ref, () => ({ updateFocusTarget, getFocusTarget, isRegistered }));\n\n return (\n <SingleTabStopNavigationContext.Provider value={{ navigationActive, registerFocusable }}>\n {children}\n </SingleTabStopNavigationContext.Provider>\n );\n }\n);\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export var PACKAGE_SOURCE = "components";
|
|
2
|
-
export var PACKAGE_VERSION = "3.0.0 (
|
|
3
|
-
export var GIT_SHA = "
|
|
2
|
+
export var PACKAGE_VERSION = "3.0.0 (7d81355c)";
|
|
3
|
+
export var GIT_SHA = "7d81355c";
|
|
4
4
|
export var THEME = "open-source-visual-refresh";
|
|
5
5
|
export var SYSTEM = "console";
|
|
6
6
|
export var ALWAYS_VISUAL_REFRESH = true;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { NonCancelableEventHandler } from '../../events';
|
|
2
|
+
interface Message<Type, Payload> {
|
|
3
|
+
type: Type;
|
|
4
|
+
payload: Payload;
|
|
5
|
+
}
|
|
6
|
+
type DrawerVisibilityChange = (callback: (isVisible: boolean) => void) => void;
|
|
7
|
+
interface MountContentContext {
|
|
8
|
+
onVisibilityChange: DrawerVisibilityChange;
|
|
9
|
+
}
|
|
10
|
+
interface DrawerStateChangeParams {
|
|
11
|
+
isOpen: boolean;
|
|
12
|
+
initiatedByUserAction?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DrawerPayload {
|
|
15
|
+
id: string;
|
|
16
|
+
ariaLabels: {
|
|
17
|
+
content?: string;
|
|
18
|
+
closeButton?: string;
|
|
19
|
+
triggerButton?: string;
|
|
20
|
+
resizeHandle?: string;
|
|
21
|
+
resizeHandleTooltipText?: string;
|
|
22
|
+
expandedModeButton?: string;
|
|
23
|
+
exitExpandedModeButton?: string;
|
|
24
|
+
};
|
|
25
|
+
isExpandable?: boolean;
|
|
26
|
+
resizable?: boolean;
|
|
27
|
+
defaultSize?: number;
|
|
28
|
+
onResize?: NonCancelableEventHandler<{
|
|
29
|
+
size: number;
|
|
30
|
+
id: string;
|
|
31
|
+
}>;
|
|
32
|
+
defaultActive?: boolean;
|
|
33
|
+
trigger?: {
|
|
34
|
+
iconSvg?: string;
|
|
35
|
+
customIcon?: string;
|
|
36
|
+
};
|
|
37
|
+
mountContent: (container: HTMLElement, mountContext: MountContentContext) => void;
|
|
38
|
+
unmountContent: (container: HTMLElement) => void;
|
|
39
|
+
preserveInactiveContent?: boolean;
|
|
40
|
+
onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;
|
|
41
|
+
mountHeader?: (container: HTMLElement) => void;
|
|
42
|
+
unmountHeader?: (container: HTMLElement) => void;
|
|
43
|
+
}
|
|
44
|
+
export type RegisterDrawerMessage = Message<'registerLeftDrawer', DrawerPayload>;
|
|
45
|
+
export type UpdateDrawerConfigMessage = Message<'updateDrawerConfig', Omit<DrawerPayload, 'mountContent' | 'unmountContent' | 'mountHeader' | 'unmountHeader'>>;
|
|
46
|
+
export type OpenDrawerMessage = Message<'openDrawer', {
|
|
47
|
+
id: string;
|
|
48
|
+
}>;
|
|
49
|
+
export type CloseDrawerMessage = Message<'closeDrawer', {
|
|
50
|
+
id: string;
|
|
51
|
+
}>;
|
|
52
|
+
export type ResizeDrawerMessage = Message<'resizeDrawer', {
|
|
53
|
+
id: string;
|
|
54
|
+
size: number;
|
|
55
|
+
}>;
|
|
56
|
+
export type AppLayoutUpdateMessage = UpdateDrawerConfigMessage | OpenDrawerMessage | CloseDrawerMessage | ResizeDrawerMessage;
|
|
57
|
+
export type AppLayoutMessage = RegisterDrawerMessage | AppLayoutUpdateMessage;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/interfaces.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AAEzD,UAAU,OAAO,CAAC,IAAI,EAAE,OAAO;IAC7B,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,KAAK,sBAAsB,GAAG,CAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,KAAK,IAAI,CAAC;AAE/E,UAAU,mBAAmB;IAC3B,kBAAkB,EAAE,sBAAsB,CAAC;CAC5C;AAED,UAAU,uBAAuB;IAC/B,MAAM,EAAE,OAAO,CAAC;IAChB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE;QACV,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,uBAAuB,CAAC,EAAE,MAAM,CAAC;QACjC,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAC;KACjC,CAAC;IACF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,yBAAyB,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,C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B,GAAG,qBAAqB,GAAG,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { NonCancelableEventHandler } from '../../events';\n\ninterface Message<Type, Payload> {\n type: Type;\n payload: Payload;\n}\n\ntype DrawerVisibilityChange = (callback: (isVisible: boolean) => void) => void;\n\ninterface MountContentContext {\n onVisibilityChange: DrawerVisibilityChange;\n}\n\ninterface DrawerStateChangeParams {\n isOpen: boolean;\n initiatedByUserAction?: boolean;\n}\n\nexport interface DrawerPayload {\n id: string;\n ariaLabels: {\n content?: string;\n closeButton?: string;\n triggerButton?: string;\n resizeHandle?: string;\n resizeHandleTooltipText?: string;\n expandedModeButton?: string;\n exitExpandedModeButton?: string;\n };\n isExpandable?: boolean;\n resizable?: boolean;\n defaultSize?: number;\n onResize?: NonCancelableEventHandler<{ size: number; id: string }>;\n defaultActive?: boolean;\n trigger?: {\n iconSvg?: string;\n customIcon?: string;\n };\n mountContent: (container: HTMLElement, mountContext: MountContentContext) => void;\n unmountContent: (container: HTMLElement) => void;\n preserveInactiveContent?: boolean;\n onToggle?: NonCancelableEventHandler<DrawerStateChangeParams>;\n mountHeader?: (container: HTMLElement) => void;\n unmountHeader?: (container: HTMLElement) => void;\n}\n\nexport type RegisterDrawerMessage = Message<'registerLeftDrawer', DrawerPayload>;\nexport type UpdateDrawerConfigMessage = Message<\n 'updateDrawerConfig',\n Omit<DrawerPayload, 'mountContent' | 'unmountContent' | 'mountHeader' | 'unmountHeader'>\n>;\nexport type OpenDrawerMessage = Message<'openDrawer', { id: string }>;\nexport type CloseDrawerMessage = Message<'closeDrawer', { id: string }>;\nexport type ResizeDrawerMessage = Message<'resizeDrawer', { id: string; size: number }>;\n\nexport type AppLayoutUpdateMessage =\n | UpdateDrawerConfigMessage\n | OpenDrawerMessage\n | CloseDrawerMessage\n | ResizeDrawerMessage;\n\nexport type AppLayoutMessage = RegisterDrawerMessage | AppLayoutUpdateMessage;\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AppLayoutMessage, AppLayoutUpdateMessage, DrawerPayload, RegisterDrawerMessage } from './interfaces';
|
|
2
|
+
type AppLayoutHandler = (event: AppLayoutMessage) => void;
|
|
3
|
+
export declare function getAppLayoutInitialState(): RegisterDrawerMessage[] | undefined;
|
|
4
|
+
export declare function registerAppLayoutHandler(handler: AppLayoutHandler): () => void;
|
|
5
|
+
export declare function clearInitialMessages(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Returns whether there is an app layout present on this page or not
|
|
8
|
+
*/
|
|
9
|
+
export declare function isAppLayoutReady(): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Registers a new runtime drawer to app layout
|
|
12
|
+
* @param drawer
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerLeftDrawer(drawer: DrawerPayload): void;
|
|
15
|
+
/**
|
|
16
|
+
* Interact with already registered app layout drawers
|
|
17
|
+
* @param message
|
|
18
|
+
*/
|
|
19
|
+
export declare function updateDrawer(message: AppLayoutUpdateMessage): void;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=internal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/internal.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAU9G,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAW1D,wBAAgB,wBAAwB,wCAEvC;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,gBAAgB,cASjE;AAED,wBAAgB,oBAAoB,SAEnC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,YAE/B;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,aAAa,QAMvD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,sBAAsB,QAE3D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { reportRuntimeApiWarning } from '../helpers/metrics';
|
|
4
|
+
const storageKeyMessageHandler = Symbol.for('awsui-widget-api-message-handler');
|
|
5
|
+
const storageKeyInitialMessages = Symbol.for('awsui-widget-api-initial-messages');
|
|
6
|
+
function getWindow() {
|
|
7
|
+
return window;
|
|
8
|
+
}
|
|
9
|
+
function getAppLayoutMessageHandler() {
|
|
10
|
+
const win = getWindow();
|
|
11
|
+
return win[storageKeyMessageHandler];
|
|
12
|
+
}
|
|
13
|
+
export function getAppLayoutInitialState() {
|
|
14
|
+
return getWindow()[storageKeyInitialMessages];
|
|
15
|
+
}
|
|
16
|
+
export function registerAppLayoutHandler(handler) {
|
|
17
|
+
const win = getWindow();
|
|
18
|
+
if (win[storageKeyMessageHandler]) {
|
|
19
|
+
reportRuntimeApiWarning('AppLayoutWidget', 'Double registration attempt, the old handler will be overridden');
|
|
20
|
+
}
|
|
21
|
+
win[storageKeyMessageHandler] = handler;
|
|
22
|
+
return () => {
|
|
23
|
+
win[storageKeyMessageHandler] = undefined;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function clearInitialMessages() {
|
|
27
|
+
getWindow()[storageKeyInitialMessages] = undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Returns whether there is an app layout present on this page or not
|
|
31
|
+
*/
|
|
32
|
+
export function isAppLayoutReady() {
|
|
33
|
+
return !!getAppLayoutMessageHandler();
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Registers a new runtime drawer to app layout
|
|
37
|
+
* @param drawer
|
|
38
|
+
*/
|
|
39
|
+
export function registerLeftDrawer(drawer) {
|
|
40
|
+
var _a, _b;
|
|
41
|
+
const win = getWindow();
|
|
42
|
+
const message = { type: 'registerLeftDrawer', payload: drawer };
|
|
43
|
+
win[storageKeyInitialMessages] = (_a = win[storageKeyInitialMessages]) !== null && _a !== void 0 ? _a : [];
|
|
44
|
+
win[storageKeyInitialMessages].push(message);
|
|
45
|
+
(_b = getAppLayoutMessageHandler()) === null || _b === void 0 ? void 0 : _b(message);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Interact with already registered app layout drawers
|
|
49
|
+
* @param message
|
|
50
|
+
*/
|
|
51
|
+
export function updateDrawer(message) {
|
|
52
|
+
var _a;
|
|
53
|
+
(_a = getAppLayoutMessageHandler()) === null || _a === void 0 ? void 0 : _a(message);
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=internal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"internal.js","sourceRoot":"","sources":["../../../../../src/internal/plugins/widget/internal.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AAEtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAG7D,MAAM,wBAAwB,GAAG,MAAM,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;AAChF,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;AASlF,SAAS,SAAS;IAChB,OAAO,MAAiC,CAAC;AAC3C,CAAC;AAED,SAAS,0BAA0B;IACjC,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,OAAO,GAAG,CAAC,wBAAwB,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO,SAAS,EAAE,CAAC,yBAAyB,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,OAAyB;IAChE,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,IAAI,GAAG,CAAC,wBAAwB,CAAC,EAAE;QACjC,uBAAuB,CAAC,iBAAiB,EAAE,iEAAiE,CAAC,CAAC;KAC/G;IACD,GAAG,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC;IACxC,OAAO,GAAG,EAAE;QACV,GAAG,CAAC,wBAAwB,CAAC,GAAG,SAAS,CAAC;IAC5C,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB;IAClC,SAAS,EAAE,CAAC,yBAAyB,CAAC,GAAG,SAAS,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,CAAC,0BAA0B,EAAE,CAAC;AACxC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB;;IACtD,MAAM,GAAG,GAAG,SAAS,EAAE,CAAC;IACxB,MAAM,OAAO,GAA0B,EAAE,IAAI,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACvF,GAAG,CAAC,yBAAyB,CAAC,GAAG,MAAA,GAAG,CAAC,yBAAyB,CAAC,mCAAI,EAAE,CAAC;IACtE,GAAG,CAAC,yBAAyB,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC7C,MAAA,0BAA0B,EAAE,0CAAG,OAAO,CAAC,CAAC;AAC1C,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,OAA+B;;IAC1D,MAAA,0BAA0B,EAAE,0CAAG,OAAO,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { reportRuntimeApiWarning } from '../helpers/metrics';\nimport { AppLayoutMessage, AppLayoutUpdateMessage, DrawerPayload, RegisterDrawerMessage } from './interfaces';\n\nconst storageKeyMessageHandler = Symbol.for('awsui-widget-api-message-handler');\nconst storageKeyInitialMessages = Symbol.for('awsui-widget-api-initial-messages');\n\ninterface WindowWithApi extends Window {\n [storageKeyMessageHandler]: AppLayoutHandler | undefined;\n [storageKeyInitialMessages]: Array<RegisterDrawerMessage> | undefined;\n}\n\ntype AppLayoutHandler = (event: AppLayoutMessage) => void;\n\nfunction getWindow() {\n return window as Window as WindowWithApi;\n}\n\nfunction getAppLayoutMessageHandler() {\n const win = getWindow();\n return win[storageKeyMessageHandler];\n}\n\nexport function getAppLayoutInitialState() {\n return getWindow()[storageKeyInitialMessages];\n}\n\nexport function registerAppLayoutHandler(handler: AppLayoutHandler) {\n const win = getWindow();\n if (win[storageKeyMessageHandler]) {\n reportRuntimeApiWarning('AppLayoutWidget', 'Double registration attempt, the old handler will be overridden');\n }\n win[storageKeyMessageHandler] = handler;\n return () => {\n win[storageKeyMessageHandler] = undefined;\n };\n}\n\nexport function clearInitialMessages() {\n getWindow()[storageKeyInitialMessages] = undefined;\n}\n\n/**\n * Returns whether there is an app layout present on this page or not\n */\nexport function isAppLayoutReady() {\n return !!getAppLayoutMessageHandler();\n}\n\n/**\n * Registers a new runtime drawer to app layout\n * @param drawer\n */\nexport function registerLeftDrawer(drawer: DrawerPayload) {\n const win = getWindow();\n const message: RegisterDrawerMessage = { type: 'registerLeftDrawer', payload: drawer };\n win[storageKeyInitialMessages] = win[storageKeyInitialMessages] ?? [];\n win[storageKeyInitialMessages].push(message);\n getAppLayoutMessageHandler()?.(message);\n}\n\n/**\n * Interact with already registered app layout drawers\n * @param message\n */\nexport function updateDrawer(message: AppLayoutUpdateMessage) {\n getAppLayoutMessageHandler()?.(message);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.d.ts","sourceRoot":"","sources":["../../../../src/internal/plugins/widget.ts"],"names":[],"mappings":"AAEA,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
export * from './widget/interfaces';
|
|
4
|
+
export { registerLeftDrawer, updateDrawer, isAppLayoutReady } from './widget/internal';
|
|
5
|
+
//# sourceMappingURL=widget.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../../src/internal/plugins/widget.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,sCAAsC;AACtC,cAAc,qBAAqB,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport * from './widget/interfaces';\nexport { registerLeftDrawer, updateDrawer, isAppLayoutReady } from './widget/internal';\n"]}
|
|
@@ -32,4 +32,8 @@ export type SomeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
export type Optional<Type> = Type | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* Use this function to mark conditions which should never be visited
|
|
37
|
+
*/
|
|
38
|
+
export declare function assertNever(_value: never): null;
|
|
35
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/internal/types.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,IAAI,GAAG;KAC9D,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/internal/types.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,YAAY,CAAC,IAAI,EAAE,IAAI,SAAS,MAAM,IAAI,IAAI,IAAI,GAAG;KAC9D,GAAG,IAAI,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;CAC3B,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAElF;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,CAAC,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC;AAE9C;;GAEG;AAEH,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,QAGxC"}
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Use this function to mark conditions which should never be visited
|
|
3
|
+
*/
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
5
|
+
export function assertNever(_value) {
|
|
6
|
+
/* istanbul ignore next: this code is not intended to be visited */
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
2
9
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/internal/types.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Makes specified properties required.\n *\n * @example\n * ```\n * import { AlertProps } from '~components/alert/interfaces'\n *\n * type InternalAlertProps = SomeRequired<AlertProps, 'type'>\n *\n * function Alert(props: AlertProps) { ... }\n * function InternalAlert(props: InternalAlertProps) { ... }\n * ```\n */\nexport type SomeRequired<Type, Keys extends keyof Type> = Type & {\n [Key in Keys]-?: Type[Key];\n};\n\n/**\n * Makes specified properties optional.\n *\n * @example\n * ```\n * type PartialAlertProps = SomeOptional<AlertProps, 'type' | 'children'>\n * ```\n */\nexport type SomeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * Utility type that makes a union of given type and undefined.\n * @example\n * ```\n * type OptionalString = Optional<string>\n * type OptionalStringOrNumber = Optional<string | number>\n * ```\n */\nexport type Optional<Type> = Type | undefined;\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/internal/types.ts"],"names":[],"mappings":"AAuCA;;GAEG;AACH,6DAA6D;AAC7D,MAAM,UAAU,WAAW,CAAC,MAAa;IACvC,mEAAmE;IACnE,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n/**\n * Makes specified properties required.\n *\n * @example\n * ```\n * import { AlertProps } from '~components/alert/interfaces'\n *\n * type InternalAlertProps = SomeRequired<AlertProps, 'type'>\n *\n * function Alert(props: AlertProps) { ... }\n * function InternalAlert(props: InternalAlertProps) { ... }\n * ```\n */\nexport type SomeRequired<Type, Keys extends keyof Type> = Type & {\n [Key in Keys]-?: Type[Key];\n};\n\n/**\n * Makes specified properties optional.\n *\n * @example\n * ```\n * type PartialAlertProps = SomeOptional<AlertProps, 'type' | 'children'>\n * ```\n */\nexport type SomeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * Utility type that makes a union of given type and undefined.\n * @example\n * ```\n * type OptionalString = Optional<string>\n * type OptionalStringOrNumber = Optional<string | number>\n * ```\n */\nexport type Optional<Type> = Type | undefined;\n\n/**\n * Use this function to mark conditions which should never be visited\n */\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport function assertNever(_value: never) {\n /* istanbul ignore next: this code is not intended to be visited */\n return null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/s3-resource-selector/s3-modal/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAWlD,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AASxD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,oBAAoB,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;IACtE,YAAY,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACtD,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,qBAAqB,EAAE,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;IACxE,YAAY,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACtD,qBAAqB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,qBAAqB,EAAE,uBAAuB,CAAC,uBAAuB,CAAC,CAAC;IACxE,aAAa,EAAE,uBAAuB,CAAC,eAAe,CAAC,CAAC;IACxD,sBAAsB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC9C,sBAAsB,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,CAAC;IAC1E,WAAW,EAAE,uBAAuB,CAAC,WAAW,GAAG,SAAS,CAAC;IAC7D,YAAY,EAAE,uBAAuB,CAAC,cAAc,CAAC,CAAC;IACtD,eAAe,EAAE,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;IAC5D,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,QAAQ,EAAE,CAAC,QAAQ,EAAE,uBAAuB,CAAC,QAAQ,KAAK,IAAI,CAAC;CAChE;AAsDD,wBAAgB,OAAO,CAAC,EACtB,WAAW,EACX,KAAK,EACL,oBAAoB,EACpB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,YAAY,EACZ,qBAAqB,EACrB,qBAAqB,EACrB,aAAa,EACb,sBAAsB,EACtB,sBAAsB,EACtB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,SAAS,GACV,EAAE,YAAY,eAwHd"}
|
|
@@ -6,6 +6,7 @@ import { InternalButton } from '../../button/internal';
|
|
|
6
6
|
import { useInternalI18n } from '../../i18n/context';
|
|
7
7
|
import { useEffectOnUpdate } from '../../internal/hooks/use-effect-on-update';
|
|
8
8
|
import { useVisualRefresh } from '../../internal/hooks/use-visual-mode';
|
|
9
|
+
import { assertNever } from '../../internal/types';
|
|
9
10
|
import InternalModal from '../../modal/internal';
|
|
10
11
|
import InternalSpaceBetween from '../../space-between/internal';
|
|
11
12
|
import { joinObjectPath } from '../utils';
|
|
@@ -14,10 +15,6 @@ import { ObjectsTable } from './objects-table';
|
|
|
14
15
|
import { VersionsTable } from './versions-table';
|
|
15
16
|
import testUtilStyles from '../test-classes/styles.css.js';
|
|
16
17
|
import styles from './styles.css.js';
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
-
function assertNever(_value) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
18
|
const initialBrowseState = {
|
|
22
19
|
selectedItem: null,
|
|
23
20
|
currentView: 'buckets',
|