@atlaskit/popup 1.20.1 → 1.20.2
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 +8 -0
- package/__perf__/default.tsx +1 -1
- package/dist/cjs/popper-wrapper.js +1 -1
- package/dist/cjs/popup.js +1 -1
- package/dist/cjs/use-close-manager.js +12 -15
- package/dist/es2019/popper-wrapper.js +1 -1
- package/dist/es2019/popup.js +1 -1
- package/dist/es2019/use-close-manager.js +12 -15
- package/dist/esm/popper-wrapper.js +1 -1
- package/dist/esm/popup.js +1 -1
- package/dist/esm/use-close-manager.js +12 -15
- package/dist/types/popup.d.ts +1 -1
- package/dist/types-ts4.5/popup.d.ts +1 -1
- package/package.json +4 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.20.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#122722](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/122722)
|
|
8
|
+
[`512798d699bd1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/512798d699bd1) -
|
|
9
|
+
Disable onClick event if popup is a disabled layer
|
|
10
|
+
|
|
3
11
|
## 1.20.1
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/__perf__/default.tsx
CHANGED
|
@@ -24,8 +24,8 @@ var _excluded = ["shouldRenderToParent", "shouldFitContainer", "children"];
|
|
|
24
24
|
var _css;
|
|
25
25
|
/**
|
|
26
26
|
* @jsxRuntime classic
|
|
27
|
+
* @jsx jsx
|
|
27
28
|
*/
|
|
28
|
-
/** @jsx jsx */
|
|
29
29
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
30
30
|
var popupFullWidthStyles = (0, _react2.css)({
|
|
31
31
|
width: '100%'
|
package/dist/cjs/popup.js
CHANGED
|
@@ -19,8 +19,8 @@ var _useGetMemoizedMergedTriggerRef = require("./use-get-memoized-merged-trigger
|
|
|
19
19
|
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
20
20
|
/**
|
|
21
21
|
* @jsxRuntime classic
|
|
22
|
+
* @jsx jsx
|
|
22
23
|
*/
|
|
23
|
-
/** @jsx jsx */
|
|
24
24
|
|
|
25
25
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
|
|
@@ -9,7 +9,6 @@ var _react = require("react");
|
|
|
9
9
|
var _bindEventListener = require("bind-event-listener");
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
11
|
var _layering = require("@atlaskit/layering");
|
|
12
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
12
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
14
13
|
|
|
15
14
|
var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
@@ -45,7 +44,7 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
45
44
|
if (!doesDomNodeExist) {
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
48
|
-
if (isLayerDisabled()
|
|
47
|
+
if (isLayerDisabled()) {
|
|
49
48
|
//if it is a disabled layer, we need to disable its click listener.
|
|
50
49
|
return;
|
|
51
50
|
}
|
|
@@ -77,20 +76,18 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
77
76
|
|
|
78
77
|
// bind onBlur event listener to fix popup not close when clicking on iframe outside
|
|
79
78
|
var unbindBlur = _noop.default;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
var wrapper = document.activeElement.closest('[data-ds--level]');
|
|
88
|
-
if (!wrapper || currentLevel > Number(wrapper.getAttribute('data-ds--level'))) {
|
|
89
|
-
closePopup(e);
|
|
90
|
-
}
|
|
79
|
+
unbindBlur = (0, _bindEventListener.bind)(window, {
|
|
80
|
+
type: 'blur',
|
|
81
|
+
listener: function onBlur(e) {
|
|
82
|
+
if (isLayerDisabled() || !(document.activeElement instanceof HTMLIFrameElement)) {
|
|
83
|
+
return;
|
|
91
84
|
}
|
|
92
|
-
|
|
93
|
-
|
|
85
|
+
var wrapper = document.activeElement.closest('[data-ds--level]');
|
|
86
|
+
if (!wrapper || currentLevel > Number(wrapper.getAttribute('data-ds--level'))) {
|
|
87
|
+
closePopup(e);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
});
|
|
94
91
|
return function () {
|
|
95
92
|
unbind();
|
|
96
93
|
unbindBlur();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/**
|
|
3
3
|
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
4
5
|
*/
|
|
5
|
-
/** @jsx jsx */
|
|
6
6
|
import { forwardRef, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
package/dist/es2019/popup.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
2
2
|
/**
|
|
3
3
|
* @jsxRuntime classic
|
|
4
|
+
* @jsx jsx
|
|
4
5
|
*/
|
|
5
|
-
/** @jsx jsx */
|
|
6
6
|
import { memo, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -3,7 +3,6 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { bind, bindAll } from 'bind-event-listener';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { UNSAFE_useLayering } from '@atlaskit/layering';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export const useCloseManager = ({
|
|
8
7
|
isOpen,
|
|
9
8
|
onClose,
|
|
@@ -41,7 +40,7 @@ export const useCloseManager = ({
|
|
|
41
40
|
if (!doesDomNodeExist) {
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
44
|
-
if (isLayerDisabled()
|
|
43
|
+
if (isLayerDisabled()) {
|
|
45
44
|
//if it is a disabled layer, we need to disable its click listener.
|
|
46
45
|
return;
|
|
47
46
|
}
|
|
@@ -75,20 +74,18 @@ export const useCloseManager = ({
|
|
|
75
74
|
|
|
76
75
|
// bind onBlur event listener to fix popup not close when clicking on iframe outside
|
|
77
76
|
let unbindBlur = noop;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const wrapper = document.activeElement.closest('[data-ds--level]');
|
|
86
|
-
if (!wrapper || currentLevel > Number(wrapper.getAttribute('data-ds--level'))) {
|
|
87
|
-
closePopup(e);
|
|
88
|
-
}
|
|
77
|
+
unbindBlur = bind(window, {
|
|
78
|
+
type: 'blur',
|
|
79
|
+
listener: function onBlur(e) {
|
|
80
|
+
if (isLayerDisabled() || !(document.activeElement instanceof HTMLIFrameElement)) {
|
|
81
|
+
return;
|
|
89
82
|
}
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
const wrapper = document.activeElement.closest('[data-ds--level]');
|
|
84
|
+
if (!wrapper || currentLevel > Number(wrapper.getAttribute('data-ds--level'))) {
|
|
85
|
+
closePopup(e);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
});
|
|
92
89
|
return () => {
|
|
93
90
|
unbind();
|
|
94
91
|
unbindBlur();
|
|
@@ -6,8 +6,8 @@ var _excluded = ["shouldRenderToParent", "shouldFitContainer", "children"];
|
|
|
6
6
|
var _css;
|
|
7
7
|
/**
|
|
8
8
|
* @jsxRuntime classic
|
|
9
|
+
* @jsx jsx
|
|
9
10
|
*/
|
|
10
|
-
/** @jsx jsx */
|
|
11
11
|
import { forwardRef, useMemo, useState } from 'react';
|
|
12
12
|
|
|
13
13
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
package/dist/esm/popup.js
CHANGED
|
@@ -2,8 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
/* eslint-disable @repo/internal/react/require-jsdoc */
|
|
3
3
|
/**
|
|
4
4
|
* @jsxRuntime classic
|
|
5
|
+
* @jsx jsx
|
|
5
6
|
*/
|
|
6
|
-
/** @jsx jsx */
|
|
7
7
|
import { memo, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
@@ -3,7 +3,6 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import { bind, bindAll } from 'bind-event-listener';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { UNSAFE_useLayering } from '@atlaskit/layering';
|
|
6
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
export var useCloseManager = function useCloseManager(_ref) {
|
|
8
7
|
var isOpen = _ref.isOpen,
|
|
9
8
|
onClose = _ref.onClose,
|
|
@@ -37,7 +36,7 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
37
36
|
if (!doesDomNodeExist) {
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
if (isLayerDisabled()
|
|
39
|
+
if (isLayerDisabled()) {
|
|
41
40
|
//if it is a disabled layer, we need to disable its click listener.
|
|
42
41
|
return;
|
|
43
42
|
}
|
|
@@ -69,20 +68,18 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
69
68
|
|
|
70
69
|
// bind onBlur event listener to fix popup not close when clicking on iframe outside
|
|
71
70
|
var unbindBlur = noop;
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
var wrapper = document.activeElement.closest('[data-ds--level]');
|
|
80
|
-
if (!wrapper || currentLevel > Number(wrapper.getAttribute('data-ds--level'))) {
|
|
81
|
-
closePopup(e);
|
|
82
|
-
}
|
|
71
|
+
unbindBlur = bind(window, {
|
|
72
|
+
type: 'blur',
|
|
73
|
+
listener: function onBlur(e) {
|
|
74
|
+
if (isLayerDisabled() || !(document.activeElement instanceof HTMLIFrameElement)) {
|
|
75
|
+
return;
|
|
83
76
|
}
|
|
84
|
-
|
|
85
|
-
|
|
77
|
+
var wrapper = document.activeElement.closest('[data-ds--level]');
|
|
78
|
+
if (!wrapper || currentLevel > Number(wrapper.getAttribute('data-ds--level'))) {
|
|
79
|
+
closePopup(e);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
});
|
|
86
83
|
return function () {
|
|
87
84
|
unbind();
|
|
88
85
|
unbindBlur();
|
package/dist/types/popup.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.2",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/portal": "^4.6.0",
|
|
48
48
|
"@atlaskit/primitives": "^11.0.0",
|
|
49
49
|
"@atlaskit/theme": "^12.11.0",
|
|
50
|
-
"@atlaskit/tokens": "^1.
|
|
50
|
+
"@atlaskit/tokens": "^1.56.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1",
|
|
53
53
|
"bind-event-listener": "^3.0.0",
|
|
@@ -63,8 +63,8 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@af/accessibility-testing": "*",
|
|
65
65
|
"@af/visual-regression": "*",
|
|
66
|
-
"@atlaskit/button": "^
|
|
67
|
-
"@atlaskit/icon": "^22.
|
|
66
|
+
"@atlaskit/button": "^19.0.0",
|
|
67
|
+
"@atlaskit/icon": "^22.7.0",
|
|
68
68
|
"@atlaskit/ssr": "*",
|
|
69
69
|
"@atlaskit/textfield": "^6.4.0",
|
|
70
70
|
"@atlaskit/toggle": "^13.2.0",
|
|
@@ -109,9 +109,6 @@
|
|
|
109
109
|
"platform-feature-flags": {
|
|
110
110
|
"platform.design-system-team.iframe_gojiv": {
|
|
111
111
|
"type": "boolean"
|
|
112
|
-
},
|
|
113
|
-
"platform.design-system-team.iframe-layering_p3eb8": {
|
|
114
|
-
"type": "boolean"
|
|
115
112
|
}
|
|
116
113
|
},
|
|
117
114
|
"homepage": "https://atlassian.design/components/popup/"
|