@atlaskit/popup 6.2.2 → 6.3.1
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/CHANGELOG.md +22 -0
- package/dist/cjs/use-focus-manager.js +7 -0
- package/dist/es2019/use-focus-manager.js +7 -0
- package/dist/esm/use-focus-manager.js +7 -0
- package/package.json +27 -24
- package/report.api.md +0 -108
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 6.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1c9e0caa93d4c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1c9e0caa93d4c) -
|
|
8
|
+
Behind platform_dst-popup-trigger-initial-focus-ref: when the popup's focus trap deactivates and
|
|
9
|
+
shouldReturnFocus is true, an animation-frame callback now rescues focus back to the trigger
|
|
10
|
+
element if the browser silently dropped focus to document.body instead of returning it to the
|
|
11
|
+
trigger.
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 6.3.0
|
|
15
|
+
|
|
16
|
+
### Minor Changes
|
|
17
|
+
|
|
18
|
+
- [`bd2c5b0112185`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bd2c5b0112185) -
|
|
19
|
+
Remove stale API report artifacts from published Platform packages.
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies
|
|
24
|
+
|
|
3
25
|
## 6.2.2
|
|
4
26
|
|
|
5
27
|
### Patch Changes
|
|
@@ -61,6 +61,13 @@ var useFocusManager = exports.useFocusManager = function useFocusManager(_ref) {
|
|
|
61
61
|
return function () {
|
|
62
62
|
cancelAllFrames();
|
|
63
63
|
focusTrap.deactivate();
|
|
64
|
+
if ((0, _fg.fg)('platform_dst-popup-trigger-initial-focus-ref') && shouldReturnFocus) {
|
|
65
|
+
requestFrame(function () {
|
|
66
|
+
if (triggerRef !== null && triggerRef !== void 0 && triggerRef.isConnected && (document.activeElement === document.body || document.activeElement === document.documentElement || !document.activeElement)) {
|
|
67
|
+
triggerRef.focus();
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
64
71
|
};
|
|
65
72
|
}, [popupRef, triggerRef, autoFocus, initialFocusRef, shouldCloseOnTab, shouldDisableFocusTrap, requestFrame, cancelAllFrames, shouldReturnFocus, shouldRenderToParent, currentLevel]);
|
|
66
73
|
};
|
|
@@ -57,6 +57,13 @@ export const useFocusManager = ({
|
|
|
57
57
|
return () => {
|
|
58
58
|
cancelAllFrames();
|
|
59
59
|
focusTrap.deactivate();
|
|
60
|
+
if (fg('platform_dst-popup-trigger-initial-focus-ref') && shouldReturnFocus) {
|
|
61
|
+
requestFrame(() => {
|
|
62
|
+
if (triggerRef !== null && triggerRef !== void 0 && triggerRef.isConnected && (document.activeElement === document.body || document.activeElement === document.documentElement || !document.activeElement)) {
|
|
63
|
+
triggerRef.focus();
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
60
67
|
};
|
|
61
68
|
}, [popupRef, triggerRef, autoFocus, initialFocusRef, shouldCloseOnTab, shouldDisableFocusTrap, requestFrame, cancelAllFrames, shouldReturnFocus, shouldRenderToParent, currentLevel]);
|
|
62
69
|
};
|
|
@@ -54,6 +54,13 @@ export var useFocusManager = function useFocusManager(_ref) {
|
|
|
54
54
|
return function () {
|
|
55
55
|
cancelAllFrames();
|
|
56
56
|
focusTrap.deactivate();
|
|
57
|
+
if (fg('platform_dst-popup-trigger-initial-focus-ref') && shouldReturnFocus) {
|
|
58
|
+
requestFrame(function () {
|
|
59
|
+
if (triggerRef !== null && triggerRef !== void 0 && triggerRef.isConnected && (document.activeElement === document.body || document.activeElement === document.documentElement || !document.activeElement)) {
|
|
60
|
+
triggerRef.focus();
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
57
64
|
};
|
|
58
65
|
}, [popupRef, triggerRef, autoFocus, initialFocusRef, shouldCloseOnTab, shouldDisableFocusTrap, requestFrame, cancelAllFrames, shouldReturnFocus, shouldRenderToParent, currentLevel]);
|
|
59
66
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.1",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@atlaskit/css": "^1.1.0",
|
|
35
35
|
"@atlaskit/ds-lib": "^8.0.0",
|
|
36
|
-
"@atlaskit/layering": "^5.
|
|
37
|
-
"@atlaskit/motion": "^8.
|
|
38
|
-
"@atlaskit/platform-feature-flags": "^2.
|
|
39
|
-
"@atlaskit/popper": "^9.
|
|
40
|
-
"@atlaskit/portal": "^6.
|
|
41
|
-
"@atlaskit/primitives": "^22.
|
|
36
|
+
"@atlaskit/layering": "^5.2.0",
|
|
37
|
+
"@atlaskit/motion": "^8.6.0",
|
|
38
|
+
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
39
|
+
"@atlaskit/popper": "^9.4.0",
|
|
40
|
+
"@atlaskit/portal": "^6.4.0",
|
|
41
|
+
"@atlaskit/primitives": "^22.5.0",
|
|
42
42
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
43
|
-
"@atlaskit/tokens": "^16.
|
|
43
|
+
"@atlaskit/tokens": "^16.11.0",
|
|
44
44
|
"@atlaskit/top-layer": "^4.4.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@compiled/react": "^1.0.2",
|
|
@@ -57,24 +57,24 @@
|
|
|
57
57
|
"@af/accessibility-testing": "workspace:^",
|
|
58
58
|
"@af/integration-testing": "workspace:^",
|
|
59
59
|
"@af/visual-regression": "workspace:^",
|
|
60
|
-
"@atlaskit/banner": "^15.
|
|
61
|
-
"@atlaskit/button": "^25.
|
|
62
|
-
"@atlaskit/code": "^19.
|
|
60
|
+
"@atlaskit/banner": "^15.3.0",
|
|
61
|
+
"@atlaskit/button": "^25.3.0",
|
|
62
|
+
"@atlaskit/code": "^19.2.0",
|
|
63
63
|
"@atlaskit/docs": "^12.2.0",
|
|
64
|
-
"@atlaskit/dropdown-menu": "^18.
|
|
65
|
-
"@atlaskit/form": "^17.
|
|
66
|
-
"@atlaskit/heading": "^7.
|
|
67
|
-
"@atlaskit/icon": "^37.
|
|
64
|
+
"@atlaskit/dropdown-menu": "^18.3.0",
|
|
65
|
+
"@atlaskit/form": "^17.2.0",
|
|
66
|
+
"@atlaskit/heading": "^7.2.0",
|
|
67
|
+
"@atlaskit/icon": "^37.6.0",
|
|
68
68
|
"@atlaskit/link": "^5.1.0",
|
|
69
|
-
"@atlaskit/menu": "^10.
|
|
70
|
-
"@atlaskit/modal-dialog": "^16.
|
|
71
|
-
"@atlaskit/radio": "^10.
|
|
72
|
-
"@atlaskit/section-message": "^10.
|
|
73
|
-
"@atlaskit/select": "^22.
|
|
74
|
-
"@atlaskit/textfield": "^10.
|
|
75
|
-
"@atlaskit/toggle": "^17.
|
|
76
|
-
"@atlaskit/visually-hidden": "^4.
|
|
77
|
-
"@atlassian/feature-flags-test-utils": "^1.
|
|
69
|
+
"@atlaskit/menu": "^10.2.0",
|
|
70
|
+
"@atlaskit/modal-dialog": "^16.6.0",
|
|
71
|
+
"@atlaskit/radio": "^10.2.0",
|
|
72
|
+
"@atlaskit/section-message": "^10.2.0",
|
|
73
|
+
"@atlaskit/select": "^22.11.0",
|
|
74
|
+
"@atlaskit/textfield": "^10.2.0",
|
|
75
|
+
"@atlaskit/toggle": "^17.3.0",
|
|
76
|
+
"@atlaskit/visually-hidden": "^4.4.0",
|
|
77
|
+
"@atlassian/feature-flags-test-utils": "^1.3.0",
|
|
78
78
|
"@atlassian/ssr-tests": "workspace:^",
|
|
79
79
|
"@atlassian/structured-docs-types": "workspace:^",
|
|
80
80
|
"@atlassian/testing-library": "^0.11.0",
|
|
@@ -116,6 +116,9 @@
|
|
|
116
116
|
},
|
|
117
117
|
"platform-dst-motion-uplift-popup": {
|
|
118
118
|
"type": "boolean"
|
|
119
|
+
},
|
|
120
|
+
"platform_dst-popup-trigger-initial-focus-ref": {
|
|
121
|
+
"type": "boolean"
|
|
119
122
|
}
|
|
120
123
|
},
|
|
121
124
|
"homepage": "https://atlassian.design/components/popup/"
|
package/report.api.md
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
<!-- API Report Version: 2.3 -->
|
|
2
|
-
|
|
3
|
-
## API Report File for "@atlaskit/popup"
|
|
4
|
-
|
|
5
|
-
> Do not edit this file. This report is auto-generated using
|
|
6
|
-
> [API Extractor](https://api-extractor.com/).
|
|
7
|
-
> [Learn more about API reports](https://hello.atlassian.net/wiki/spaces/UR/pages/1825484529/Package+API+Reports)
|
|
8
|
-
|
|
9
|
-
### Table of contents
|
|
10
|
-
|
|
11
|
-
- [Main Entry Types](#main-entry-types)
|
|
12
|
-
- [Peer Dependencies](#peer-dependencies)
|
|
13
|
-
|
|
14
|
-
### Main Entry Types
|
|
15
|
-
|
|
16
|
-
<!--SECTION START: Main Entry Types-->
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import { ComponentType } from 'react';
|
|
20
|
-
import { CSSProperties } from 'react';
|
|
21
|
-
import { Dispatch } from 'react';
|
|
22
|
-
import { FC } from 'react';
|
|
23
|
-
import { Placement } from '@atlaskit/popper';
|
|
24
|
-
import { PopperChildrenProps } from '@atlaskit/popper';
|
|
25
|
-
import { default as React_2 } from 'react';
|
|
26
|
-
import { ReactNode } from 'react';
|
|
27
|
-
import { Ref } from 'react';
|
|
28
|
-
import { SetStateAction } from 'react';
|
|
29
|
-
|
|
30
|
-
// @public (undocumented)
|
|
31
|
-
interface BaseProps {
|
|
32
|
-
autoFocus?: boolean;
|
|
33
|
-
boundary?: 'clippingParents' | HTMLElement;
|
|
34
|
-
content: (props: ContentProps) => React_2.ReactNode;
|
|
35
|
-
fallbackPlacements?: Placement[];
|
|
36
|
-
id?: string;
|
|
37
|
-
isOpen: boolean;
|
|
38
|
-
offset?: [number, number];
|
|
39
|
-
onClose?(event: Event | React_2.KeyboardEvent | React_2.MouseEvent): void;
|
|
40
|
-
placement?: Placement;
|
|
41
|
-
popupComponent?: ComponentType<PopupComponentProps>;
|
|
42
|
-
rootBoundary?: 'document' | 'viewport';
|
|
43
|
-
shouldFlip?: boolean;
|
|
44
|
-
shouldRenderToParent?: boolean;
|
|
45
|
-
shouldUseCaptureOnOutsideClick?: boolean;
|
|
46
|
-
testId?: string;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// @public (undocumented)
|
|
50
|
-
export interface ContentProps {
|
|
51
|
-
isOpen: boolean;
|
|
52
|
-
onClose?: BaseProps['onClose'];
|
|
53
|
-
setInitialFocusRef: Dispatch<SetStateAction<HTMLElement | null>>;
|
|
54
|
-
update: PopperChildrenProps['update'];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// @public (undocumented)
|
|
58
|
-
const Popup: FC<PopupProps>;
|
|
59
|
-
export { Popup };
|
|
60
|
-
export default Popup;
|
|
61
|
-
|
|
62
|
-
// @public (undocumented)
|
|
63
|
-
export interface PopupComponentProps {
|
|
64
|
-
'data-placement': Placement;
|
|
65
|
-
'data-testid'?: string;
|
|
66
|
-
children: ReactNode;
|
|
67
|
-
id?: string;
|
|
68
|
-
ref: Ref<HTMLDivElement>;
|
|
69
|
-
shouldRenderToParent?: boolean;
|
|
70
|
-
style: CSSProperties;
|
|
71
|
-
tabIndex: number | undefined;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// @public (undocumented)
|
|
75
|
-
export interface PopupProps extends BaseProps {
|
|
76
|
-
trigger: (props: TriggerProps) => React_2.ReactNode;
|
|
77
|
-
zIndex?: number;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// @public (undocumented)
|
|
81
|
-
export interface TriggerProps {
|
|
82
|
-
// (undocumented)
|
|
83
|
-
'aria-controls'?: string;
|
|
84
|
-
// (undocumented)
|
|
85
|
-
'aria-expanded': boolean;
|
|
86
|
-
// (undocumented)
|
|
87
|
-
'aria-haspopup': boolean;
|
|
88
|
-
// (undocumented)
|
|
89
|
-
ref: Ref<any>;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// (No @packageDocumentation comment for this package)
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
<!--SECTION END: Main Entry Types-->
|
|
96
|
-
|
|
97
|
-
### Peer Dependencies
|
|
98
|
-
|
|
99
|
-
<!--SECTION START: Peer Dependencies-->
|
|
100
|
-
|
|
101
|
-
```json
|
|
102
|
-
{
|
|
103
|
-
"react": "^16.8.0",
|
|
104
|
-
"react-dom": "^16.8.0"
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
<!--SECTION END: Peer Dependencies-->
|