@atlaskit/popup 1.9.0 → 1.9.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 +6 -0
- package/dist/cjs/popper-wrapper.js +1 -2
- package/dist/cjs/use-focus-manager.js +2 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/popper-wrapper.js +1 -2
- package/dist/es2019/use-focus-manager.js +2 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/popper-wrapper.js +1 -2
- package/dist/esm/use-focus-manager.js +2 -3
- package/dist/esm/version.json +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/use-focus-manager.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +2 -2
- package/dist/types-ts4.5/use-focus-manager.d.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -66,8 +66,7 @@ function PopperWrapper(_ref) {
|
|
|
66
66
|
setInitialFocusRef = _useState4[1];
|
|
67
67
|
(0, _useFocusManager.useFocusManager)({
|
|
68
68
|
initialFocusRef: initialFocusRef,
|
|
69
|
-
popupRef: popupRef
|
|
70
|
-
autoFocus: autoFocus
|
|
69
|
+
popupRef: popupRef
|
|
71
70
|
});
|
|
72
71
|
(0, _useCloseManager.useCloseManager)({
|
|
73
72
|
isOpen: isOpen,
|
|
@@ -10,8 +10,7 @@ var _focusTrap = _interopRequireDefault(require("focus-trap"));
|
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
11
|
var useFocusManager = function useFocusManager(_ref) {
|
|
12
12
|
var popupRef = _ref.popupRef,
|
|
13
|
-
initialFocusRef = _ref.initialFocusRef
|
|
14
|
-
autoFocus = _ref.autoFocus;
|
|
13
|
+
initialFocusRef = _ref.initialFocusRef;
|
|
15
14
|
(0, _react.useEffect)(function () {
|
|
16
15
|
if (!popupRef) {
|
|
17
16
|
return _noop.default;
|
|
@@ -37,6 +36,6 @@ var useFocusManager = function useFocusManager(_ref) {
|
|
|
37
36
|
}
|
|
38
37
|
focusTrap.deactivate();
|
|
39
38
|
};
|
|
40
|
-
}, [popupRef, initialFocusRef
|
|
39
|
+
}, [popupRef, initialFocusRef]);
|
|
41
40
|
};
|
|
42
41
|
exports.useFocusManager = useFocusManager;
|
package/dist/cjs/version.json
CHANGED
|
@@ -3,8 +3,7 @@ import createFocusTrap from 'focus-trap';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
export const useFocusManager = ({
|
|
5
5
|
popupRef,
|
|
6
|
-
initialFocusRef
|
|
7
|
-
autoFocus
|
|
6
|
+
initialFocusRef
|
|
8
7
|
}) => {
|
|
9
8
|
useEffect(() => {
|
|
10
9
|
if (!popupRef) {
|
|
@@ -31,5 +30,5 @@ export const useFocusManager = ({
|
|
|
31
30
|
}
|
|
32
31
|
focusTrap.deactivate();
|
|
33
32
|
};
|
|
34
|
-
}, [popupRef, initialFocusRef
|
|
33
|
+
}, [popupRef, initialFocusRef]);
|
|
35
34
|
};
|
package/dist/es2019/version.json
CHANGED
|
@@ -3,8 +3,7 @@ import createFocusTrap from 'focus-trap';
|
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
export var useFocusManager = function useFocusManager(_ref) {
|
|
5
5
|
var popupRef = _ref.popupRef,
|
|
6
|
-
initialFocusRef = _ref.initialFocusRef
|
|
7
|
-
autoFocus = _ref.autoFocus;
|
|
6
|
+
initialFocusRef = _ref.initialFocusRef;
|
|
8
7
|
useEffect(function () {
|
|
9
8
|
if (!popupRef) {
|
|
10
9
|
return noop;
|
|
@@ -30,5 +29,5 @@ export var useFocusManager = function useFocusManager(_ref) {
|
|
|
30
29
|
}
|
|
31
30
|
focusTrap.deactivate();
|
|
32
31
|
};
|
|
33
|
-
}, [popupRef, initialFocusRef
|
|
32
|
+
}, [popupRef, initialFocusRef]);
|
|
34
33
|
};
|
package/dist/esm/version.json
CHANGED
package/dist/types/types.d.ts
CHANGED
|
@@ -85,7 +85,8 @@ interface BaseProps {
|
|
|
85
85
|
/**
|
|
86
86
|
* Defines a list of placements to try.
|
|
87
87
|
* When no space is available on the preferred placement,
|
|
88
|
-
* the modifier will test the ones provided in the list, and use the first
|
|
88
|
+
* the modifier will test the ones provided in the list, and use the first suitable one.
|
|
89
|
+
* If no fallback placements are suitable, it reverts back to the original placement.
|
|
89
90
|
*/
|
|
90
91
|
fallbackPlacements?: Placement[];
|
|
91
92
|
/**
|
|
@@ -164,7 +165,6 @@ export type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
|
|
|
164
165
|
export type FocusManagerHook = {
|
|
165
166
|
popupRef: PopupRef;
|
|
166
167
|
initialFocusRef: HTMLElement | null;
|
|
167
|
-
autoFocus: boolean;
|
|
168
168
|
};
|
|
169
169
|
export type RepositionOnUpdateProps = {
|
|
170
170
|
update: PopperChildrenProps['update'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FocusManagerHook } from './types';
|
|
2
|
-
export declare const useFocusManager: ({ popupRef, initialFocusRef,
|
|
2
|
+
export declare const useFocusManager: ({ popupRef, initialFocusRef, }: FocusManagerHook) => void;
|
|
@@ -88,7 +88,8 @@ interface BaseProps {
|
|
|
88
88
|
/**
|
|
89
89
|
* Defines a list of placements to try.
|
|
90
90
|
* When no space is available on the preferred placement,
|
|
91
|
-
* the modifier will test the ones provided in the list, and use the first
|
|
91
|
+
* the modifier will test the ones provided in the list, and use the first suitable one.
|
|
92
|
+
* If no fallback placements are suitable, it reverts back to the original placement.
|
|
92
93
|
*/
|
|
93
94
|
fallbackPlacements?: Placement[];
|
|
94
95
|
/**
|
|
@@ -167,7 +168,6 @@ export type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
|
|
|
167
168
|
export type FocusManagerHook = {
|
|
168
169
|
popupRef: PopupRef;
|
|
169
170
|
initialFocusRef: HTMLElement | null;
|
|
170
|
-
autoFocus: boolean;
|
|
171
171
|
};
|
|
172
172
|
export type RepositionOnUpdateProps = {
|
|
173
173
|
update: PopperChildrenProps['update'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FocusManagerHook } from './types';
|
|
2
|
-
export declare const useFocusManager: ({ popupRef, initialFocusRef,
|
|
2
|
+
export declare const useFocusManager: ({ popupRef, initialFocusRef, }: FocusManagerHook) => void;
|