@atlaskit/drawer 7.12.3 → 7.12.4
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/dist/cjs/components/index.js +11 -10
- package/dist/es2019/components/index.js +11 -10
- package/dist/esm/components/index.js +12 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/drawer
|
|
2
2
|
|
|
3
|
+
## 7.12.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#116209](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116209)
|
|
8
|
+
[`0aa2af6a28226`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0aa2af6a28226) -
|
|
9
|
+
Only render escapeManager when open
|
|
10
|
+
|
|
3
11
|
## 7.12.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -29,7 +29,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
29
29
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
30
30
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /* eslint-disable @repo/internal/dom-events/no-unsafe-event-listeners */
|
|
31
31
|
var packageName = "@atlaskit/drawer";
|
|
32
|
-
var packageVersion = "7.12.
|
|
32
|
+
var packageVersion = "7.12.4";
|
|
33
33
|
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
34
34
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
35
35
|
return createAndFireEventOnAtlaskit({
|
|
@@ -49,16 +49,16 @@ var EscapeCloseManager = function EscapeCloseManager(_ref) {
|
|
|
49
49
|
var createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
50
50
|
handleClose = _ref.handleClose;
|
|
51
51
|
var onClose = _react.default.useCallback(function (event) {
|
|
52
|
-
var analyticsEvent = createAnalyticsEvent && createAndFireOnClick(createAnalyticsEvent, 'escKey');
|
|
53
52
|
if (handleClose) {
|
|
54
|
-
|
|
53
|
+
var _analyticsEvent = createAnalyticsEvent && createAndFireOnClick(createAnalyticsEvent, 'escKey');
|
|
54
|
+
handleClose(event, _analyticsEvent);
|
|
55
55
|
}
|
|
56
56
|
}, [handleClose, createAnalyticsEvent]);
|
|
57
57
|
(0, _layering.useCloseOnEscapePress)({
|
|
58
58
|
onClose: onClose
|
|
59
59
|
});
|
|
60
60
|
// only create a dummy component for using ths hook in class component
|
|
61
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
61
|
+
return /*#__PURE__*/_react.default.createElement("span", null);
|
|
62
62
|
};
|
|
63
63
|
var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
64
64
|
(0, _inherits2.default)(DrawerBase, _Component);
|
|
@@ -93,7 +93,7 @@ var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
93
93
|
var _this$props2 = _this.props,
|
|
94
94
|
isOpen = _this$props2.isOpen,
|
|
95
95
|
onKeyDown = _this$props2.onKeyDown;
|
|
96
|
-
if (!(0, _platformFeatureFlags.
|
|
96
|
+
if (!(0, _platformFeatureFlags.fg)('platform.design-system-team.inline-message-layering_wfp1p')) {
|
|
97
97
|
// when feature flag on, we will use the EscapeCloseManager instead
|
|
98
98
|
if (event.key === 'Escape' && isOpen) {
|
|
99
99
|
_this.handleClose(event, 'escKey');
|
|
@@ -155,9 +155,8 @@ var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
155
155
|
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex,
|
|
156
156
|
label = _this$props3.label,
|
|
157
157
|
titleId = _this$props3.titleId;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}, /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
158
|
+
var shouldHaveLayeringEnabled = (0, _platformFeatureFlags.fg)('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
159
|
+
return /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
161
160
|
zIndex: zIndex
|
|
162
161
|
}, /*#__PURE__*/_react.default.createElement(_blanket.default, {
|
|
163
162
|
isOpen: isOpen,
|
|
@@ -182,10 +181,12 @@ var DrawerBase = exports.DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
182
181
|
isFocusLockEnabled: isFocusLockEnabled,
|
|
183
182
|
shouldReturnFocus: shouldReturnFocus,
|
|
184
183
|
scrollContentLabel: scrollContentLabel
|
|
185
|
-
},
|
|
184
|
+
}, shouldHaveLayeringEnabled ? /*#__PURE__*/_react.default.createElement(_layering.UNSAFE_LAYERING, {
|
|
185
|
+
isDisabled: false
|
|
186
|
+
}, children, /*#__PURE__*/_react.default.createElement(EscapeCloseManager, {
|
|
186
187
|
createAnalyticsEvent: this.props.createAnalyticsEvent,
|
|
187
188
|
handleClose: this.handleClose
|
|
188
|
-
}))));
|
|
189
|
+
})) : children));
|
|
189
190
|
}
|
|
190
191
|
}]);
|
|
191
192
|
return DrawerBase;
|
|
@@ -4,13 +4,13 @@ import React, { Component } from 'react';
|
|
|
4
4
|
import { canUseDOM } from 'exenv';
|
|
5
5
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
6
6
|
import { UNSAFE_LAYERING, useCloseOnEscapePress } from '@atlaskit/layering';
|
|
7
|
-
import {
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
8
|
import Portal from '@atlaskit/portal';
|
|
9
9
|
import { defaultFocusLockSettings } from '../constants';
|
|
10
10
|
import Blanket from './blanket';
|
|
11
11
|
import DrawerPrimitive from './primitives';
|
|
12
12
|
const packageName = "@atlaskit/drawer";
|
|
13
|
-
const packageVersion = "7.12.
|
|
13
|
+
const packageVersion = "7.12.4";
|
|
14
14
|
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
15
15
|
const createAndFireOnClick = (createAnalyticsEvent, trigger) => createAndFireEventOnAtlaskit({
|
|
16
16
|
action: 'dismissed',
|
|
@@ -29,8 +29,8 @@ const EscapeCloseManager = ({
|
|
|
29
29
|
handleClose
|
|
30
30
|
}) => {
|
|
31
31
|
const onClose = React.useCallback(event => {
|
|
32
|
-
const analyticsEvent = createAnalyticsEvent && createAndFireOnClick(createAnalyticsEvent, 'escKey');
|
|
33
32
|
if (handleClose) {
|
|
33
|
+
const analyticsEvent = createAnalyticsEvent && createAndFireOnClick(createAnalyticsEvent, 'escKey');
|
|
34
34
|
handleClose(event, analyticsEvent);
|
|
35
35
|
}
|
|
36
36
|
}, [handleClose, createAnalyticsEvent]);
|
|
@@ -38,7 +38,7 @@ const EscapeCloseManager = ({
|
|
|
38
38
|
onClose: onClose
|
|
39
39
|
});
|
|
40
40
|
// only create a dummy component for using ths hook in class component
|
|
41
|
-
return /*#__PURE__*/React.createElement(
|
|
41
|
+
return /*#__PURE__*/React.createElement("span", null);
|
|
42
42
|
};
|
|
43
43
|
export class DrawerBase extends Component {
|
|
44
44
|
constructor(...args) {
|
|
@@ -68,7 +68,7 @@ export class DrawerBase extends Component {
|
|
|
68
68
|
isOpen,
|
|
69
69
|
onKeyDown
|
|
70
70
|
} = this.props;
|
|
71
|
-
if (!
|
|
71
|
+
if (!fg('platform.design-system-team.inline-message-layering_wfp1p')) {
|
|
72
72
|
// when feature flag on, we will use the EscapeCloseManager instead
|
|
73
73
|
if (event.key === 'Escape' && isOpen) {
|
|
74
74
|
this.handleClose(event, 'escKey');
|
|
@@ -125,9 +125,8 @@ export class DrawerBase extends Component {
|
|
|
125
125
|
label,
|
|
126
126
|
titleId
|
|
127
127
|
} = this.props;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}, /*#__PURE__*/React.createElement(Portal, {
|
|
128
|
+
const shouldHaveLayeringEnabled = fg('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
129
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
131
130
|
zIndex: zIndex
|
|
132
131
|
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
133
132
|
isOpen: isOpen,
|
|
@@ -152,10 +151,12 @@ export class DrawerBase extends Component {
|
|
|
152
151
|
isFocusLockEnabled: isFocusLockEnabled,
|
|
153
152
|
shouldReturnFocus: shouldReturnFocus,
|
|
154
153
|
scrollContentLabel: scrollContentLabel
|
|
155
|
-
},
|
|
154
|
+
}, shouldHaveLayeringEnabled ? /*#__PURE__*/React.createElement(UNSAFE_LAYERING, {
|
|
155
|
+
isDisabled: false
|
|
156
|
+
}, children, /*#__PURE__*/React.createElement(EscapeCloseManager, {
|
|
156
157
|
createAnalyticsEvent: this.props.createAnalyticsEvent,
|
|
157
158
|
handleClose: this.handleClose
|
|
158
|
-
}))));
|
|
159
|
+
})) : children));
|
|
159
160
|
}
|
|
160
161
|
}
|
|
161
162
|
_defineProperty(DrawerBase, "defaultProps", {
|
|
@@ -14,13 +14,13 @@ import React, { Component } from 'react';
|
|
|
14
14
|
import { canUseDOM } from 'exenv';
|
|
15
15
|
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
16
|
import { UNSAFE_LAYERING, useCloseOnEscapePress } from '@atlaskit/layering';
|
|
17
|
-
import {
|
|
17
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
18
18
|
import Portal from '@atlaskit/portal';
|
|
19
19
|
import { defaultFocusLockSettings } from '../constants';
|
|
20
20
|
import Blanket from './blanket';
|
|
21
21
|
import DrawerPrimitive from './primitives';
|
|
22
22
|
var packageName = "@atlaskit/drawer";
|
|
23
|
-
var packageVersion = "7.12.
|
|
23
|
+
var packageVersion = "7.12.4";
|
|
24
24
|
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
25
25
|
var createAndFireOnClick = function createAndFireOnClick(createAnalyticsEvent, trigger) {
|
|
26
26
|
return createAndFireEventOnAtlaskit({
|
|
@@ -40,16 +40,16 @@ var EscapeCloseManager = function EscapeCloseManager(_ref) {
|
|
|
40
40
|
var createAnalyticsEvent = _ref.createAnalyticsEvent,
|
|
41
41
|
handleClose = _ref.handleClose;
|
|
42
42
|
var onClose = React.useCallback(function (event) {
|
|
43
|
-
var analyticsEvent = createAnalyticsEvent && createAndFireOnClick(createAnalyticsEvent, 'escKey');
|
|
44
43
|
if (handleClose) {
|
|
45
|
-
|
|
44
|
+
var _analyticsEvent = createAnalyticsEvent && createAndFireOnClick(createAnalyticsEvent, 'escKey');
|
|
45
|
+
handleClose(event, _analyticsEvent);
|
|
46
46
|
}
|
|
47
47
|
}, [handleClose, createAnalyticsEvent]);
|
|
48
48
|
useCloseOnEscapePress({
|
|
49
49
|
onClose: onClose
|
|
50
50
|
});
|
|
51
51
|
// only create a dummy component for using ths hook in class component
|
|
52
|
-
return /*#__PURE__*/React.createElement(
|
|
52
|
+
return /*#__PURE__*/React.createElement("span", null);
|
|
53
53
|
};
|
|
54
54
|
export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
55
55
|
_inherits(DrawerBase, _Component);
|
|
@@ -84,7 +84,7 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
84
84
|
var _this$props2 = _this.props,
|
|
85
85
|
isOpen = _this$props2.isOpen,
|
|
86
86
|
onKeyDown = _this$props2.onKeyDown;
|
|
87
|
-
if (!
|
|
87
|
+
if (!fg('platform.design-system-team.inline-message-layering_wfp1p')) {
|
|
88
88
|
// when feature flag on, we will use the EscapeCloseManager instead
|
|
89
89
|
if (event.key === 'Escape' && isOpen) {
|
|
90
90
|
_this.handleClose(event, 'escKey');
|
|
@@ -146,9 +146,8 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
146
146
|
zIndex = _this$props3$zIndex === void 0 ? 'unset' : _this$props3$zIndex,
|
|
147
147
|
label = _this$props3.label,
|
|
148
148
|
titleId = _this$props3.titleId;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, /*#__PURE__*/React.createElement(Portal, {
|
|
149
|
+
var shouldHaveLayeringEnabled = fg('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
150
|
+
return /*#__PURE__*/React.createElement(Portal, {
|
|
152
151
|
zIndex: zIndex
|
|
153
152
|
}, /*#__PURE__*/React.createElement(Blanket, {
|
|
154
153
|
isOpen: isOpen,
|
|
@@ -173,10 +172,12 @@ export var DrawerBase = /*#__PURE__*/function (_Component) {
|
|
|
173
172
|
isFocusLockEnabled: isFocusLockEnabled,
|
|
174
173
|
shouldReturnFocus: shouldReturnFocus,
|
|
175
174
|
scrollContentLabel: scrollContentLabel
|
|
176
|
-
},
|
|
175
|
+
}, shouldHaveLayeringEnabled ? /*#__PURE__*/React.createElement(UNSAFE_LAYERING, {
|
|
176
|
+
isDisabled: false
|
|
177
|
+
}, children, /*#__PURE__*/React.createElement(EscapeCloseManager, {
|
|
177
178
|
createAnalyticsEvent: this.props.createAnalyticsEvent,
|
|
178
179
|
handleClose: this.handleClose
|
|
179
|
-
}))));
|
|
180
|
+
})) : children));
|
|
180
181
|
}
|
|
181
182
|
}]);
|
|
182
183
|
return DrawerBase;
|