@atlaskit/popup 1.11.0 → 1.11.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 +12 -0
- package/dist/cjs/popper-wrapper.js +7 -3
- package/dist/cjs/popup.js +4 -1
- package/dist/es2019/popper-wrapper.js +5 -3
- package/dist/es2019/popup.js +4 -1
- package/dist/esm/popper-wrapper.js +7 -3
- package/dist/esm/popup.js +4 -1
- package/package.json +10 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.11.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#41628](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41628) [`b05664f7aba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b05664f7aba) - Use feature flag to toggle if we enable UNSAFE_LAYERING
|
|
8
|
+
|
|
9
|
+
## 1.11.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#41322](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41322) [`f54519b315c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f54519b315c) - This removes the error in console when passing `shouldRenderToParent` prop.
|
|
14
|
+
|
|
3
15
|
## 1.11.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
12
|
var _react = require("react");
|
|
12
13
|
var _react2 = require("@emotion/react");
|
|
@@ -17,6 +18,7 @@ var _tokens = require("@atlaskit/tokens");
|
|
|
17
18
|
var _repositionOnUpdate = require("./reposition-on-update");
|
|
18
19
|
var _useCloseManager = require("./use-close-manager");
|
|
19
20
|
var _useFocusManager = require("./use-focus-manager");
|
|
21
|
+
var _excluded = ["shouldRenderToParent", "children"];
|
|
20
22
|
var _css;
|
|
21
23
|
/** @jsx jsx */
|
|
22
24
|
var popupStyles = (0, _react2.css)((_css = {
|
|
@@ -34,12 +36,14 @@ var popupOverflowStyles = (0, _react2.css)({
|
|
|
34
36
|
overflow: 'auto'
|
|
35
37
|
});
|
|
36
38
|
var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
37
|
-
var shouldRenderToParent = props.shouldRenderToParent
|
|
39
|
+
var shouldRenderToParent = props.shouldRenderToParent,
|
|
40
|
+
children = props.children,
|
|
41
|
+
htmlAttributes = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
38
42
|
return (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
39
43
|
css: [popupStyles, !shouldRenderToParent && popupOverflowStyles]
|
|
40
|
-
},
|
|
44
|
+
}, htmlAttributes, {
|
|
41
45
|
ref: ref
|
|
42
|
-
}));
|
|
46
|
+
}), children);
|
|
43
47
|
});
|
|
44
48
|
function PopperWrapper(_ref) {
|
|
45
49
|
var isOpen = _ref.isOpen,
|
package/dist/cjs/popup.js
CHANGED
|
@@ -9,6 +9,7 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
9
9
|
var _react = require("react");
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _layering = require("@atlaskit/layering");
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _popper = require("@atlaskit/popper");
|
|
13
14
|
var _portal = _interopRequireDefault(require("@atlaskit/portal"));
|
|
14
15
|
var _constants = require("@atlaskit/theme/constants");
|
|
@@ -46,7 +47,9 @@ var Popup = exports.Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
46
47
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
47
48
|
triggerRef = _useState2[0],
|
|
48
49
|
setTriggerRef = _useState2[1];
|
|
49
|
-
var renderPopperWrapper = (0, _react2.jsx)(_layering.UNSAFE_LAYERING,
|
|
50
|
+
var renderPopperWrapper = (0, _react2.jsx)(_layering.UNSAFE_LAYERING, {
|
|
51
|
+
isDisabled: (0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.layering_popup_1cnzt') ? false : true
|
|
52
|
+
}, (0, _react2.jsx)(_popperWrapper.default, {
|
|
50
53
|
content: content,
|
|
51
54
|
isOpen: isOpen,
|
|
52
55
|
placement: placement,
|
|
@@ -27,13 +27,15 @@ const popupOverflowStyles = css({
|
|
|
27
27
|
});
|
|
28
28
|
const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => {
|
|
29
29
|
const {
|
|
30
|
-
shouldRenderToParent
|
|
30
|
+
shouldRenderToParent,
|
|
31
|
+
children,
|
|
32
|
+
...htmlAttributes
|
|
31
33
|
} = props;
|
|
32
34
|
return jsx("div", _extends({
|
|
33
35
|
css: [popupStyles, !shouldRenderToParent && popupOverflowStyles]
|
|
34
|
-
},
|
|
36
|
+
}, htmlAttributes, {
|
|
35
37
|
ref: ref
|
|
36
|
-
}));
|
|
38
|
+
}), children);
|
|
37
39
|
});
|
|
38
40
|
function PopperWrapper({
|
|
39
41
|
isOpen,
|
package/dist/es2019/popup.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { memo, useState } from 'react';
|
|
4
4
|
import { jsx } from '@emotion/react';
|
|
5
5
|
import { UNSAFE_LAYERING } from '@atlaskit/layering';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { Manager, Reference } from '@atlaskit/popper';
|
|
7
8
|
import Portal from '@atlaskit/portal';
|
|
8
9
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -28,7 +29,9 @@ export const Popup = /*#__PURE__*/memo(({
|
|
|
28
29
|
shouldRenderToParent = false
|
|
29
30
|
}) => {
|
|
30
31
|
const [triggerRef, setTriggerRef] = useState(null);
|
|
31
|
-
const renderPopperWrapper = jsx(UNSAFE_LAYERING,
|
|
32
|
+
const renderPopperWrapper = jsx(UNSAFE_LAYERING, {
|
|
33
|
+
isDisabled: getBooleanFF('platform.design-system-team.layering_popup_1cnzt') ? false : true
|
|
34
|
+
}, jsx(PopperWrapper, {
|
|
32
35
|
content: content,
|
|
33
36
|
isOpen: isOpen,
|
|
34
37
|
placement: placement,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
5
|
+
var _excluded = ["shouldRenderToParent", "children"];
|
|
4
6
|
var _css;
|
|
5
7
|
/** @jsx jsx */
|
|
6
8
|
import { forwardRef, useMemo, useState } from 'react';
|
|
@@ -27,12 +29,14 @@ var popupOverflowStyles = css({
|
|
|
27
29
|
overflow: 'auto'
|
|
28
30
|
});
|
|
29
31
|
var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
30
|
-
var shouldRenderToParent = props.shouldRenderToParent
|
|
32
|
+
var shouldRenderToParent = props.shouldRenderToParent,
|
|
33
|
+
children = props.children,
|
|
34
|
+
htmlAttributes = _objectWithoutProperties(props, _excluded);
|
|
31
35
|
return jsx("div", _extends({
|
|
32
36
|
css: [popupStyles, !shouldRenderToParent && popupOverflowStyles]
|
|
33
|
-
},
|
|
37
|
+
}, htmlAttributes, {
|
|
34
38
|
ref: ref
|
|
35
|
-
}));
|
|
39
|
+
}), children);
|
|
36
40
|
});
|
|
37
41
|
function PopperWrapper(_ref) {
|
|
38
42
|
var isOpen = _ref.isOpen,
|
package/dist/esm/popup.js
CHANGED
|
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
4
4
|
import { memo, useState } from 'react';
|
|
5
5
|
import { jsx } from '@emotion/react';
|
|
6
6
|
import { UNSAFE_LAYERING } from '@atlaskit/layering';
|
|
7
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { Manager, Reference } from '@atlaskit/popper';
|
|
8
9
|
import Portal from '@atlaskit/portal';
|
|
9
10
|
import { layers } from '@atlaskit/theme/constants';
|
|
@@ -38,7 +39,9 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
|
38
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
39
40
|
triggerRef = _useState2[0],
|
|
40
41
|
setTriggerRef = _useState2[1];
|
|
41
|
-
var renderPopperWrapper = jsx(UNSAFE_LAYERING,
|
|
42
|
+
var renderPopperWrapper = jsx(UNSAFE_LAYERING, {
|
|
43
|
+
isDisabled: getBooleanFF('platform.design-system-team.layering_popup_1cnzt') ? false : true
|
|
44
|
+
}, jsx(PopperWrapper, {
|
|
42
45
|
content: content,
|
|
43
46
|
isOpen: isOpen,
|
|
44
47
|
placement: placement,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.2",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
39
39
|
"@atlaskit/layering": "^0.2.0",
|
|
40
|
-
"@atlaskit/platform-feature-flags": "
|
|
40
|
+
"@atlaskit/platform-feature-flags": "^0.2.0",
|
|
41
41
|
"@atlaskit/popper": "^5.5.0",
|
|
42
42
|
"@atlaskit/portal": "^4.3.0",
|
|
43
43
|
"@atlaskit/theme": "^12.6.0",
|
|
44
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.27.0",
|
|
45
45
|
"@babel/runtime": "^7.0.0",
|
|
46
46
|
"@emotion/react": "^11.7.1",
|
|
47
47
|
"bind-event-listener": "^2.1.1",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@atlaskit/ssr": "*",
|
|
60
60
|
"@atlaskit/visual-regression": "*",
|
|
61
61
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
62
|
+
"@atlassian/feature-flags-test-utils": "*",
|
|
62
63
|
"@testing-library/dom": "^8.17.1",
|
|
63
64
|
"@testing-library/react": "^12.1.5",
|
|
64
65
|
"ast-types": "^0.13.3",
|
|
@@ -94,11 +95,14 @@
|
|
|
94
95
|
]
|
|
95
96
|
}
|
|
96
97
|
},
|
|
97
|
-
"homepage": "https://atlassian.design/components/popup/",
|
|
98
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
99
98
|
"platform-feature-flags": {
|
|
99
|
+
"platform.design-system-team.layering_popup_1cnzt": {
|
|
100
|
+
"type": "boolean"
|
|
101
|
+
},
|
|
100
102
|
"platform.design-system-team.remove-focus-trap-from-popup_3q7sk": {
|
|
101
103
|
"type": "boolean"
|
|
102
104
|
}
|
|
103
|
-
}
|
|
105
|
+
},
|
|
106
|
+
"homepage": "https://atlassian.design/components/popup/",
|
|
107
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
104
108
|
}
|