@atlaskit/popup 1.8.2 → 1.9.0
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 +12 -0
- package/dist/cjs/use-focus-manager.js +9 -24
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/use-focus-manager.js +9 -24
- package/dist/es2019/version.json +1 -1
- package/dist/esm/use-focus-manager.js +9 -24
- package/dist/esm/version.json +1 -1
- package/package.json +7 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`3920dcfd848`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3920dcfd848) - This removes the feature flag made for upgrading the `focus-trap` dependency and keeps `focus-trap` at it's original version.
|
|
8
|
+
|
|
9
|
+
## 1.8.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
|
|
14
|
+
|
|
3
15
|
## 1.8.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.useFocusManager = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
|
-
var _focusTrap = require("focus-trap");
|
|
10
|
-
var _focusTrapV = _interopRequireDefault(require("focus-trap-v2"));
|
|
9
|
+
var _focusTrap = _interopRequireDefault(require("focus-trap"));
|
|
11
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
11
|
var useFocusManager = function useFocusManager(_ref) {
|
|
14
12
|
var popupRef = _ref.popupRef,
|
|
15
13
|
initialFocusRef = _ref.initialFocusRef,
|
|
@@ -18,27 +16,14 @@ var useFocusManager = function useFocusManager(_ref) {
|
|
|
18
16
|
if (!popupRef) {
|
|
19
17
|
return _noop.default;
|
|
20
18
|
}
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
returnFocusOnDeactivate: true
|
|
30
|
-
};
|
|
31
|
-
focusTrap = (0, _focusTrap.createFocusTrap)(popupRef, trapConfig);
|
|
32
|
-
} else {
|
|
33
|
-
var _trapConfig = {
|
|
34
|
-
clickOutsideDeactivates: true,
|
|
35
|
-
escapeDeactivates: true,
|
|
36
|
-
initialFocus: initialFocusRef || popupRef,
|
|
37
|
-
fallbackFocus: popupRef,
|
|
38
|
-
returnFocusOnDeactivate: true
|
|
39
|
-
};
|
|
40
|
-
focusTrap = (0, _focusTrapV.default)(popupRef, _trapConfig);
|
|
41
|
-
}
|
|
19
|
+
var trapConfig = {
|
|
20
|
+
clickOutsideDeactivates: true,
|
|
21
|
+
escapeDeactivates: true,
|
|
22
|
+
initialFocus: initialFocusRef || popupRef,
|
|
23
|
+
fallbackFocus: popupRef,
|
|
24
|
+
returnFocusOnDeactivate: true
|
|
25
|
+
};
|
|
26
|
+
var focusTrap = (0, _focusTrap.default)(popupRef, trapConfig);
|
|
42
27
|
|
|
43
28
|
// wait for the popup to reposition itself before we focus
|
|
44
29
|
var frameId = requestAnimationFrame(function () {
|
package/dist/cjs/version.json
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import createFocusTrapV2 from 'focus-trap-v2';
|
|
2
|
+
import createFocusTrap from 'focus-trap';
|
|
4
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
4
|
export const useFocusManager = ({
|
|
7
5
|
popupRef,
|
|
8
6
|
initialFocusRef,
|
|
@@ -12,27 +10,14 @@ export const useFocusManager = ({
|
|
|
12
10
|
if (!popupRef) {
|
|
13
11
|
return noop;
|
|
14
12
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
returnFocusOnDeactivate: true
|
|
24
|
-
};
|
|
25
|
-
focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
26
|
-
} else {
|
|
27
|
-
const trapConfig = {
|
|
28
|
-
clickOutsideDeactivates: true,
|
|
29
|
-
escapeDeactivates: true,
|
|
30
|
-
initialFocus: initialFocusRef || popupRef,
|
|
31
|
-
fallbackFocus: popupRef,
|
|
32
|
-
returnFocusOnDeactivate: true
|
|
33
|
-
};
|
|
34
|
-
focusTrap = createFocusTrapV2(popupRef, trapConfig);
|
|
35
|
-
}
|
|
13
|
+
const trapConfig = {
|
|
14
|
+
clickOutsideDeactivates: true,
|
|
15
|
+
escapeDeactivates: true,
|
|
16
|
+
initialFocus: initialFocusRef || popupRef,
|
|
17
|
+
fallbackFocus: popupRef,
|
|
18
|
+
returnFocusOnDeactivate: true
|
|
19
|
+
};
|
|
20
|
+
const focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
36
21
|
|
|
37
22
|
// wait for the popup to reposition itself before we focus
|
|
38
23
|
let frameId = requestAnimationFrame(() => {
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import createFocusTrapV2 from 'focus-trap-v2';
|
|
2
|
+
import createFocusTrap from 'focus-trap';
|
|
4
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
4
|
export var useFocusManager = function useFocusManager(_ref) {
|
|
7
5
|
var popupRef = _ref.popupRef,
|
|
8
6
|
initialFocusRef = _ref.initialFocusRef,
|
|
@@ -11,27 +9,14 @@ export var useFocusManager = function useFocusManager(_ref) {
|
|
|
11
9
|
if (!popupRef) {
|
|
12
10
|
return noop;
|
|
13
11
|
}
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
returnFocusOnDeactivate: true
|
|
23
|
-
};
|
|
24
|
-
focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
25
|
-
} else {
|
|
26
|
-
var _trapConfig = {
|
|
27
|
-
clickOutsideDeactivates: true,
|
|
28
|
-
escapeDeactivates: true,
|
|
29
|
-
initialFocus: initialFocusRef || popupRef,
|
|
30
|
-
fallbackFocus: popupRef,
|
|
31
|
-
returnFocusOnDeactivate: true
|
|
32
|
-
};
|
|
33
|
-
focusTrap = createFocusTrapV2(popupRef, _trapConfig);
|
|
34
|
-
}
|
|
12
|
+
var trapConfig = {
|
|
13
|
+
clickOutsideDeactivates: true,
|
|
14
|
+
escapeDeactivates: true,
|
|
15
|
+
initialFocus: initialFocusRef || popupRef,
|
|
16
|
+
fallbackFocus: popupRef,
|
|
17
|
+
returnFocusOnDeactivate: true
|
|
18
|
+
};
|
|
19
|
+
var focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
35
20
|
|
|
36
21
|
// wait for the popup to reposition itself before we focus
|
|
37
22
|
var frameId = requestAnimationFrame(function () {
|
package/dist/esm/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,29 +40,27 @@
|
|
|
40
40
|
"@atlaskit/popper": "^5.5.0",
|
|
41
41
|
"@atlaskit/portal": "^4.3.0",
|
|
42
42
|
"@atlaskit/theme": "^12.5.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
43
|
+
"@atlaskit/tokens": "^1.13.0",
|
|
44
44
|
"@babel/runtime": "^7.0.0",
|
|
45
45
|
"@emotion/react": "^11.7.1",
|
|
46
46
|
"bind-event-listener": "^2.1.1",
|
|
47
|
-
"focus-trap": "^
|
|
48
|
-
"focus-trap-v2": "npm:focus-trap@^2.4.5"
|
|
47
|
+
"focus-trap": "^2.4.5"
|
|
49
48
|
},
|
|
50
49
|
"peerDependencies": {
|
|
51
50
|
"react": "^16.8.0",
|
|
52
51
|
"react-dom": "^16.8.0"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
54
|
+
"@af/accessibility-testing": "*",
|
|
55
55
|
"@atlaskit/button": "^16.8.0",
|
|
56
56
|
"@atlaskit/icon": "^21.12.0",
|
|
57
57
|
"@atlaskit/ssr": "*",
|
|
58
58
|
"@atlaskit/visual-regression": "*",
|
|
59
|
-
"@atlaskit/webdriver-runner": "*",
|
|
60
59
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
61
60
|
"@atlassian/feature-flags-test-utils": "*",
|
|
62
61
|
"@testing-library/dom": "^8.17.1",
|
|
63
62
|
"@testing-library/react": "^12.1.5",
|
|
64
63
|
"ast-types": "^0.13.3",
|
|
65
|
-
"jest-axe": "^4.0.0",
|
|
66
64
|
"jscodeshift": "^0.13.0",
|
|
67
65
|
"raf-stub": "^2.0.1",
|
|
68
66
|
"react-dom": "^16.8.0",
|
|
@@ -96,13 +94,10 @@
|
|
|
96
94
|
}
|
|
97
95
|
},
|
|
98
96
|
"homepage": "https://atlassian.design/components/popup/",
|
|
97
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
99
98
|
"platform-feature-flags": {
|
|
100
99
|
"platform.design-system-team.render-popup-in-parent_f73ij": {
|
|
101
100
|
"type": "boolean"
|
|
102
|
-
},
|
|
103
|
-
"platform.design-system-team.focus-trap-upgrade_p2cei": {
|
|
104
|
-
"type": "boolean"
|
|
105
101
|
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
}
|
|
102
|
+
}
|
|
103
|
+
}
|