@atlaskit/popup 4.8.2 → 4.8.3
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
CHANGED
|
@@ -35,7 +35,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
35
35
|
if (!isOpen || !popupRef) {
|
|
36
36
|
return _noop.default;
|
|
37
37
|
}
|
|
38
|
-
var inIframe = window && window.self !== window.top;
|
|
39
38
|
var closePopup = function closePopup(event) {
|
|
40
39
|
if (onClose) {
|
|
41
40
|
var _currentLevel = null;
|
|
@@ -66,7 +65,7 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
66
65
|
var onClick = function onClick(event) {
|
|
67
66
|
var target = event.target;
|
|
68
67
|
var doesDomNodeExist = document.body.contains(target);
|
|
69
|
-
if (!doesDomNodeExist
|
|
68
|
+
if (!doesDomNodeExist) {
|
|
70
69
|
return;
|
|
71
70
|
}
|
|
72
71
|
if (isLayerDisabled()) {
|
|
@@ -183,18 +182,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
183
182
|
}
|
|
184
183
|
}
|
|
185
184
|
};
|
|
186
|
-
var parentUnbind;
|
|
187
|
-
// if the popup is inside iframe, we want to listen to click events outside iframe,
|
|
188
|
-
// to close the popup correctly in the iframe.
|
|
189
|
-
if (inIframe && isOpen) {
|
|
190
|
-
parentUnbind = (0, _bindEventListener.bind)(window.parent.window, {
|
|
191
|
-
type: 'click',
|
|
192
|
-
listener: onClick,
|
|
193
|
-
options: {
|
|
194
|
-
capture: capture
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
185
|
var unbind = _noop.default;
|
|
199
186
|
if ((0, _platformFeatureFlags.fg)('popup-onclose-fix')) {
|
|
200
187
|
setTimeout(function () {
|
|
@@ -240,7 +227,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
240
227
|
}
|
|
241
228
|
});
|
|
242
229
|
return function () {
|
|
243
|
-
var _parentUnbind;
|
|
244
230
|
if ((0, _platformFeatureFlags.fg)('popup-onclose-fix')) {
|
|
245
231
|
setTimeout(function () {
|
|
246
232
|
unbind();
|
|
@@ -249,7 +235,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
|
249
235
|
unbind();
|
|
250
236
|
}
|
|
251
237
|
cancelAllFrames();
|
|
252
|
-
(_parentUnbind = parentUnbind) === null || _parentUnbind === void 0 || _parentUnbind();
|
|
253
238
|
unbindBlur();
|
|
254
239
|
};
|
|
255
240
|
}, [isOpen, onClose, popupRef, triggerRef, autoFocus, shouldDisableFocusTrap, capture, isLayerDisabled, shouldCloseOnTab, currentLevel, shouldRenderToParent, requestFrame, cancelAllFrames]);
|
|
@@ -30,7 +30,6 @@ export const useCloseManager = ({
|
|
|
30
30
|
if (!isOpen || !popupRef) {
|
|
31
31
|
return noop;
|
|
32
32
|
}
|
|
33
|
-
const inIframe = window && window.self !== window.top;
|
|
34
33
|
const closePopup = event => {
|
|
35
34
|
if (onClose) {
|
|
36
35
|
let currentLevel = null;
|
|
@@ -63,7 +62,7 @@ export const useCloseManager = ({
|
|
|
63
62
|
target
|
|
64
63
|
} = event;
|
|
65
64
|
const doesDomNodeExist = document.body.contains(target);
|
|
66
|
-
if (!doesDomNodeExist
|
|
65
|
+
if (!doesDomNodeExist) {
|
|
67
66
|
return;
|
|
68
67
|
}
|
|
69
68
|
if (isLayerDisabled()) {
|
|
@@ -184,18 +183,6 @@ export const useCloseManager = ({
|
|
|
184
183
|
}
|
|
185
184
|
}
|
|
186
185
|
};
|
|
187
|
-
let parentUnbind;
|
|
188
|
-
// if the popup is inside iframe, we want to listen to click events outside iframe,
|
|
189
|
-
// to close the popup correctly in the iframe.
|
|
190
|
-
if (inIframe && isOpen) {
|
|
191
|
-
parentUnbind = bind(window.parent.window, {
|
|
192
|
-
type: 'click',
|
|
193
|
-
listener: onClick,
|
|
194
|
-
options: {
|
|
195
|
-
capture
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
186
|
let unbind = noop;
|
|
200
187
|
if (fg('popup-onclose-fix')) {
|
|
201
188
|
setTimeout(() => {
|
|
@@ -241,7 +228,6 @@ export const useCloseManager = ({
|
|
|
241
228
|
}
|
|
242
229
|
});
|
|
243
230
|
return () => {
|
|
244
|
-
var _parentUnbind;
|
|
245
231
|
if (fg('popup-onclose-fix')) {
|
|
246
232
|
setTimeout(() => {
|
|
247
233
|
unbind();
|
|
@@ -250,7 +236,6 @@ export const useCloseManager = ({
|
|
|
250
236
|
unbind();
|
|
251
237
|
}
|
|
252
238
|
cancelAllFrames();
|
|
253
|
-
(_parentUnbind = parentUnbind) === null || _parentUnbind === void 0 ? void 0 : _parentUnbind();
|
|
254
239
|
unbindBlur();
|
|
255
240
|
};
|
|
256
241
|
}, [isOpen, onClose, popupRef, triggerRef, autoFocus, shouldDisableFocusTrap, capture, isLayerDisabled, shouldCloseOnTab, currentLevel, shouldRenderToParent, requestFrame, cancelAllFrames]);
|
|
@@ -27,7 +27,6 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
27
27
|
if (!isOpen || !popupRef) {
|
|
28
28
|
return noop;
|
|
29
29
|
}
|
|
30
|
-
var inIframe = window && window.self !== window.top;
|
|
31
30
|
var closePopup = function closePopup(event) {
|
|
32
31
|
if (onClose) {
|
|
33
32
|
var _currentLevel = null;
|
|
@@ -58,7 +57,7 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
58
57
|
var onClick = function onClick(event) {
|
|
59
58
|
var target = event.target;
|
|
60
59
|
var doesDomNodeExist = document.body.contains(target);
|
|
61
|
-
if (!doesDomNodeExist
|
|
60
|
+
if (!doesDomNodeExist) {
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
63
|
if (isLayerDisabled()) {
|
|
@@ -175,18 +174,6 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
};
|
|
178
|
-
var parentUnbind;
|
|
179
|
-
// if the popup is inside iframe, we want to listen to click events outside iframe,
|
|
180
|
-
// to close the popup correctly in the iframe.
|
|
181
|
-
if (inIframe && isOpen) {
|
|
182
|
-
parentUnbind = bind(window.parent.window, {
|
|
183
|
-
type: 'click',
|
|
184
|
-
listener: onClick,
|
|
185
|
-
options: {
|
|
186
|
-
capture: capture
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
177
|
var unbind = noop;
|
|
191
178
|
if (fg('popup-onclose-fix')) {
|
|
192
179
|
setTimeout(function () {
|
|
@@ -232,7 +219,6 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
232
219
|
}
|
|
233
220
|
});
|
|
234
221
|
return function () {
|
|
235
|
-
var _parentUnbind;
|
|
236
222
|
if (fg('popup-onclose-fix')) {
|
|
237
223
|
setTimeout(function () {
|
|
238
224
|
unbind();
|
|
@@ -241,7 +227,6 @@ export var useCloseManager = function useCloseManager(_ref) {
|
|
|
241
227
|
unbind();
|
|
242
228
|
}
|
|
243
229
|
cancelAllFrames();
|
|
244
|
-
(_parentUnbind = parentUnbind) === null || _parentUnbind === void 0 || _parentUnbind();
|
|
245
230
|
unbindBlur();
|
|
246
231
|
};
|
|
247
232
|
}, [isOpen, onClose, popupRef, triggerRef, autoFocus, shouldDisableFocusTrap, capture, isLayerDisabled, shouldCloseOnTab, currentLevel, shouldRenderToParent, requestFrame, cancelAllFrames]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.3",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"@atlaskit/button": "^23.9.0",
|
|
59
59
|
"@atlaskit/code": "^17.4.0",
|
|
60
60
|
"@atlaskit/docs": "^11.2.0",
|
|
61
|
-
"@atlaskit/form": "^15.
|
|
61
|
+
"@atlaskit/form": "^15.2.0",
|
|
62
62
|
"@atlaskit/heading": "^5.2.0",
|
|
63
63
|
"@atlaskit/icon": "^29.3.0",
|
|
64
64
|
"@atlaskit/link": "^3.2.0",
|