@atlaskit/popup 3.0.0 → 3.0.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
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 3.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#134955](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/134955)
|
|
8
|
+
[`ba294ad0536de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ba294ad0536de) -
|
|
9
|
+
An onClose listener is being provided to the experimental open layer observer.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.0.0
|
|
4
13
|
|
|
5
14
|
### Major Changes
|
|
@@ -161,8 +161,12 @@ var PopupContent = exports.PopupContent = function PopupContent(_ref4) {
|
|
|
161
161
|
}),
|
|
162
162
|
appearance = _usePopupAppearance.appearance,
|
|
163
163
|
shouldRenderToParent = _usePopupAppearance.shouldRenderToParent;
|
|
164
|
+
var handleOpenLayerObserverCloseSignal = (0, _react.useCallback)(function () {
|
|
165
|
+
onClose === null || onClose === void 0 || onClose(null);
|
|
166
|
+
}, [onClose]);
|
|
164
167
|
(0, _openLayerObserver.useNotifyOpenLayerObserver)({
|
|
165
|
-
isOpen: isOpen
|
|
168
|
+
isOpen: isOpen,
|
|
169
|
+
onClose: handleOpenLayerObserverCloseSignal
|
|
166
170
|
});
|
|
167
171
|
if (!isOpen) {
|
|
168
172
|
return null;
|
package/dist/cjs/popup.js
CHANGED
|
@@ -86,8 +86,12 @@ var Popup = exports.Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
86
86
|
appearance = _usePopupAppearance.appearance,
|
|
87
87
|
shouldRenderToParent = _usePopupAppearance.shouldRenderToParent;
|
|
88
88
|
var id = providedId || generatedId;
|
|
89
|
+
var handleOpenLayerObserverCloseSignal = (0, _react.useCallback)(function () {
|
|
90
|
+
onClose === null || onClose === void 0 || onClose(null);
|
|
91
|
+
}, [onClose]);
|
|
89
92
|
(0, _openLayerObserver.useNotifyOpenLayerObserver)({
|
|
90
|
-
isOpen: isOpen
|
|
93
|
+
isOpen: isOpen,
|
|
94
|
+
onClose: handleOpenLayerObserverCloseSignal
|
|
91
95
|
});
|
|
92
96
|
var renderPopperWrapper = (0, _react2.jsx)(_layering.Layering, {
|
|
93
97
|
isDisabled: false
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { createContext, useContext, useState } from 'react';
|
|
1
|
+
import React, { createContext, useCallback, useContext, useState } from 'react';
|
|
2
2
|
import invariant from 'tiny-invariant';
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
4
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
@@ -140,8 +140,12 @@ export const PopupContent = ({
|
|
|
140
140
|
appearance: inAppearance,
|
|
141
141
|
shouldRenderToParent: inShouldRenderToParent
|
|
142
142
|
});
|
|
143
|
+
const handleOpenLayerObserverCloseSignal = useCallback(() => {
|
|
144
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(null);
|
|
145
|
+
}, [onClose]);
|
|
143
146
|
useNotifyOpenLayerObserver({
|
|
144
|
-
isOpen
|
|
147
|
+
isOpen,
|
|
148
|
+
onClose: handleOpenLayerObserverCloseSignal
|
|
145
149
|
});
|
|
146
150
|
if (!isOpen) {
|
|
147
151
|
return null;
|
package/dist/es2019/popup.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @jsxRuntime classic
|
|
4
4
|
* @jsx jsx
|
|
5
5
|
*/
|
|
6
|
-
import { memo, useState } from 'react';
|
|
6
|
+
import { memo, useCallback, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
9
|
import { jsx } from '@emotion/react';
|
|
@@ -65,8 +65,12 @@ export const Popup = /*#__PURE__*/memo(({
|
|
|
65
65
|
shouldRenderToParent: inShouldRenderToParent
|
|
66
66
|
});
|
|
67
67
|
const id = providedId || generatedId;
|
|
68
|
+
const handleOpenLayerObserverCloseSignal = useCallback(() => {
|
|
69
|
+
onClose === null || onClose === void 0 ? void 0 : onClose(null);
|
|
70
|
+
}, [onClose]);
|
|
68
71
|
useNotifyOpenLayerObserver({
|
|
69
|
-
isOpen
|
|
72
|
+
isOpen,
|
|
73
|
+
onClose: handleOpenLayerObserverCloseSignal
|
|
70
74
|
});
|
|
71
75
|
const renderPopperWrapper = jsx(Layering, {
|
|
72
76
|
isDisabled: false
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { createContext, useContext, useState } from 'react';
|
|
2
|
+
import React, { createContext, useCallback, useContext, useState } from 'react';
|
|
3
3
|
import invariant from 'tiny-invariant';
|
|
4
4
|
import noop from '@atlaskit/ds-lib/noop';
|
|
5
5
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
@@ -151,8 +151,12 @@ export var PopupContent = function PopupContent(_ref4) {
|
|
|
151
151
|
}),
|
|
152
152
|
appearance = _usePopupAppearance.appearance,
|
|
153
153
|
shouldRenderToParent = _usePopupAppearance.shouldRenderToParent;
|
|
154
|
+
var handleOpenLayerObserverCloseSignal = useCallback(function () {
|
|
155
|
+
onClose === null || onClose === void 0 || onClose(null);
|
|
156
|
+
}, [onClose]);
|
|
154
157
|
useNotifyOpenLayerObserver({
|
|
155
|
-
isOpen: isOpen
|
|
158
|
+
isOpen: isOpen,
|
|
159
|
+
onClose: handleOpenLayerObserverCloseSignal
|
|
156
160
|
});
|
|
157
161
|
if (!isOpen) {
|
|
158
162
|
return null;
|
package/dist/esm/popup.js
CHANGED
|
@@ -4,7 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
* @jsxRuntime classic
|
|
5
5
|
* @jsx jsx
|
|
6
6
|
*/
|
|
7
|
-
import { memo, useState } from 'react';
|
|
7
|
+
import { memo, useCallback, useState } from 'react';
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
10
10
|
import { jsx } from '@emotion/react';
|
|
@@ -78,8 +78,12 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
|
78
78
|
appearance = _usePopupAppearance.appearance,
|
|
79
79
|
shouldRenderToParent = _usePopupAppearance.shouldRenderToParent;
|
|
80
80
|
var id = providedId || generatedId;
|
|
81
|
+
var handleOpenLayerObserverCloseSignal = useCallback(function () {
|
|
82
|
+
onClose === null || onClose === void 0 || onClose(null);
|
|
83
|
+
}, [onClose]);
|
|
81
84
|
useNotifyOpenLayerObserver({
|
|
82
|
-
isOpen: isOpen
|
|
85
|
+
isOpen: isOpen,
|
|
86
|
+
onClose: handleOpenLayerObserverCloseSignal
|
|
83
87
|
});
|
|
84
88
|
var renderPopperWrapper = jsx(Layering, {
|
|
85
89
|
isDisabled: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"@atlaskit/css": "^0.10.0",
|
|
42
42
|
"@atlaskit/ds-lib": "^4.0.0",
|
|
43
43
|
"@atlaskit/focus-ring": "^3.0.0",
|
|
44
|
-
"@atlaskit/layering": "^2.
|
|
44
|
+
"@atlaskit/layering": "^2.1.0",
|
|
45
45
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
46
46
|
"@atlaskit/popper": "^7.0.0",
|
|
47
47
|
"@atlaskit/portal": "^5.1.0",
|
|
@@ -63,13 +63,13 @@
|
|
|
63
63
|
"@af/accessibility-testing": "^2.0.0",
|
|
64
64
|
"@af/integration-testing": "^0.5.0",
|
|
65
65
|
"@af/visual-regression": "^1.3.0",
|
|
66
|
-
"@atlaskit/button": "^
|
|
66
|
+
"@atlaskit/button": "^22.0.0",
|
|
67
67
|
"@atlaskit/code": "^16.1.0",
|
|
68
68
|
"@atlaskit/docs": "^10.0.0",
|
|
69
69
|
"@atlaskit/form": "^12.0.0",
|
|
70
70
|
"@atlaskit/heading": "^5.1.0",
|
|
71
|
-
"@atlaskit/icon": "^25.
|
|
72
|
-
"@atlaskit/link": "^3.
|
|
71
|
+
"@atlaskit/icon": "^25.4.0",
|
|
72
|
+
"@atlaskit/link": "^3.1.0",
|
|
73
73
|
"@atlaskit/modal-dialog": "^14.0.0",
|
|
74
74
|
"@atlaskit/section-message": "^8.2.0",
|
|
75
75
|
"@atlaskit/ssr": "^0.4.0",
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"@atlaskit/toggle": "^15.0.0",
|
|
78
78
|
"@atlaskit/visual-regression": "^0.10.0",
|
|
79
79
|
"@atlassian/feature-flags-test-utils": "^0.3.0",
|
|
80
|
+
"@atlassian/ssr-tests": "^0.2.0",
|
|
80
81
|
"@compiled/react": "^0.18.3",
|
|
81
82
|
"@testing-library/react": "^13.4.0",
|
|
82
83
|
"@testing-library/react-hooks": "^8.0.1",
|