@atlaskit/inline-dialog 14.3.0 → 15.0.0
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 +14 -0
- package/dist/cjs/InlineDialog/index.js +19 -36
- package/dist/cjs/InlineDialog/node-resolver-wrapper.js +35 -0
- package/dist/es2019/InlineDialog/index.js +17 -37
- package/dist/es2019/InlineDialog/node-resolver-wrapper.js +27 -0
- package/dist/esm/InlineDialog/index.js +19 -37
- package/dist/esm/InlineDialog/node-resolver-wrapper.js +28 -0
- package/dist/types/InlineDialog/index.d.ts +2 -15
- package/dist/types/InlineDialog/node-resolver-wrapper.d.ts +18 -0
- package/dist/types-ts4.5/InlineDialog/index.d.ts +2 -15
- package/dist/types-ts4.5/InlineDialog/node-resolver-wrapper.d.ts +18 -0
- package/package.json +11 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/inline-dialog
|
|
2
2
|
|
|
3
|
+
## 15.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- [#135555](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/135555)
|
|
8
|
+
[`530c505c5abab`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/530c505c5abab) -
|
|
9
|
+
Refactors analytics next API to remove usages of legacy react context.
|
|
10
|
+
|
|
11
|
+
## 14.3.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies
|
|
16
|
+
|
|
3
17
|
## 14.3.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -5,16 +5,16 @@ var _typeof = require("@babel/runtime/helpers/typeof");
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.default =
|
|
8
|
+
exports.default = void 0;
|
|
9
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
10
10
|
var _react2 = require("@emotion/react");
|
|
11
11
|
var _bindEventListener = require("bind-event-listener");
|
|
12
|
-
var _reactNodeResolver = _interopRequireDefault(require("react-node-resolver"));
|
|
13
12
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
14
13
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
15
14
|
var _layering = require("@atlaskit/layering");
|
|
16
15
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
17
16
|
var _popper = require("@atlaskit/popper");
|
|
17
|
+
var _nodeResolverWrapper = _interopRequireDefault(require("./node-resolver-wrapper"));
|
|
18
18
|
var _container = require("./styled/container");
|
|
19
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
20
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -25,8 +25,6 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
|
|
26
26
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
27
27
|
|
|
28
|
-
var packageName = "@atlaskit/inline-dialog";
|
|
29
|
-
var packageVersion = "14.3.0";
|
|
30
28
|
var checkIsChildOfPortal = function checkIsChildOfPortal(node) {
|
|
31
29
|
if (!node) {
|
|
32
30
|
return false;
|
|
@@ -43,7 +41,7 @@ var EscapeCloseManager = function EscapeCloseManager(_ref) {
|
|
|
43
41
|
// only create a dummy component for using ths hook in class component
|
|
44
42
|
return (0, _react2.jsx)("span", null);
|
|
45
43
|
};
|
|
46
|
-
var
|
|
44
|
+
var InlineDialog = /*#__PURE__*/(0, _react.memo)(function InlineDialog(_ref2) {
|
|
47
45
|
var _ref2$isOpen = _ref2.isOpen,
|
|
48
46
|
isOpen = _ref2$isOpen === void 0 ? false : _ref2$isOpen,
|
|
49
47
|
_ref2$onContentBlur = _ref2.onContentBlur,
|
|
@@ -53,7 +51,7 @@ var InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/
|
|
|
53
51
|
_ref2$onContentFocus = _ref2.onContentFocus,
|
|
54
52
|
onContentFocus = _ref2$onContentFocus === void 0 ? _noop.default : _ref2$onContentFocus,
|
|
55
53
|
_ref2$onClose = _ref2.onClose,
|
|
56
|
-
|
|
54
|
+
providedOnClose = _ref2$onClose === void 0 ? _noop.default : _ref2$onClose,
|
|
57
55
|
_ref2$placement = _ref2.placement,
|
|
58
56
|
placement = _ref2$placement === void 0 ? 'bottom-start' : _ref2$placement,
|
|
59
57
|
_ref2$strategy = _ref2.strategy,
|
|
@@ -63,6 +61,16 @@ var InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/
|
|
|
63
61
|
children = _ref2.children;
|
|
64
62
|
var containerRef = (0, _react.useRef)(null);
|
|
65
63
|
var triggerRef = (0, _react.useRef)(null);
|
|
64
|
+
var onClose = (0, _analyticsNext.usePlatformLeafEventHandler)({
|
|
65
|
+
fn: function fn(event) {
|
|
66
|
+
return providedOnClose(event);
|
|
67
|
+
},
|
|
68
|
+
action: 'closed',
|
|
69
|
+
componentName: 'inlineDialog',
|
|
70
|
+
packageName: "@atlaskit/inline-dialog",
|
|
71
|
+
packageVersion: "15.0.0"
|
|
72
|
+
});
|
|
73
|
+
|
|
66
74
|
// we put this into a ref to avoid handleCloseRequest having this as a dependency
|
|
67
75
|
var onCloseRef = (0, _react.useRef)(onClose);
|
|
68
76
|
var isLayeringEnabled = (0, _platformFeatureFlags.fg)('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
@@ -177,7 +185,7 @@ var InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/
|
|
|
177
185
|
}) : null;
|
|
178
186
|
return (0, _react2.jsx)(_popper.Manager, null, (0, _react2.jsx)(_popper.Reference, null, function (_ref5) {
|
|
179
187
|
var ref = _ref5.ref;
|
|
180
|
-
return (0, _react2.jsx)(
|
|
188
|
+
return (0, _react2.jsx)(_nodeResolverWrapper.default, {
|
|
181
189
|
innerRef: function innerRef(node) {
|
|
182
190
|
triggerRef.current = node;
|
|
183
191
|
if (typeof ref === 'function') {
|
|
@@ -185,7 +193,9 @@ var InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/
|
|
|
185
193
|
} else {
|
|
186
194
|
ref.current = node;
|
|
187
195
|
}
|
|
188
|
-
|
|
196
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
197
|
+
},
|
|
198
|
+
hasNodeResolver: !(0, _platformFeatureFlags.fg)('dsp-19516-design-system-portal-logic-update')
|
|
189
199
|
}, (0, _react2.jsx)(_react.default.Fragment, null, children));
|
|
190
200
|
}), isLayeringEnabled ? (0, _react2.jsx)(_layering.UNSAFE_LAYERING, {
|
|
191
201
|
isDisabled: false
|
|
@@ -193,33 +203,6 @@ var InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/
|
|
|
193
203
|
handleClose: handleCloseRequest
|
|
194
204
|
})) : popper);
|
|
195
205
|
});
|
|
196
|
-
InlineDialogComponent.displayName = 'InlineDialog';
|
|
197
|
-
var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
|
|
198
206
|
|
|
199
|
-
|
|
200
|
-
* __Inline dialog__
|
|
201
|
-
*
|
|
202
|
-
* _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
|
|
203
|
-
*
|
|
204
|
-
* An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
|
|
205
|
-
*
|
|
206
|
-
* - [Examples](https://atlassian.design/components/inline-dialog/examples)
|
|
207
|
-
* - [Code](https://atlassian.design/components/inline-dialog/code)
|
|
208
|
-
* - [Usage](https://atlassian.design/components/inline-dialog/usage)
|
|
209
|
-
*/
|
|
210
|
-
var InlineDialog = (0, _analyticsNext.withAnalyticsContext)({
|
|
211
|
-
componentName: 'inlineDialog',
|
|
212
|
-
packageName: packageName,
|
|
213
|
-
packageVersion: packageVersion
|
|
214
|
-
})((0, _analyticsNext.withAnalyticsEvents)({
|
|
215
|
-
onClose: createAndFireEventOnAtlaskit({
|
|
216
|
-
action: 'closed',
|
|
217
|
-
actionSubject: 'inlineDialog',
|
|
218
|
-
attributes: {
|
|
219
|
-
componentName: 'inlineDialog',
|
|
220
|
-
packageName: packageName,
|
|
221
|
-
packageVersion: packageVersion
|
|
222
|
-
}
|
|
223
|
-
})
|
|
224
|
-
})(InlineDialogComponent));
|
|
207
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
225
208
|
var _default = exports.default = InlineDialog;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNodeResolver = _interopRequireDefault(require("react-node-resolver"));
|
|
10
|
+
/**
|
|
11
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
12
|
+
*
|
|
13
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
14
|
+
* is intended to be removed once the feature flag is removed.
|
|
15
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
16
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
17
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
18
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, wrape the children in a div setting innerRef with ref to the div.
|
|
19
|
+
*/
|
|
20
|
+
var NodeResolverWrapper = function NodeResolverWrapper(_ref) {
|
|
21
|
+
var hasNodeResolver = _ref.hasNodeResolver,
|
|
22
|
+
children = _ref.children,
|
|
23
|
+
innerRef = _ref.innerRef;
|
|
24
|
+
if (hasNodeResolver) {
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_reactNodeResolver.default, {
|
|
26
|
+
innerRef: innerRef
|
|
27
|
+
}, children);
|
|
28
|
+
}
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
ref: function ref(node) {
|
|
31
|
+
return innerRef(node);
|
|
32
|
+
}
|
|
33
|
+
}, children);
|
|
34
|
+
};
|
|
35
|
+
var _default = exports.default = NodeResolverWrapper;
|
|
@@ -7,15 +7,13 @@ import React, { memo, useCallback, useEffect, useRef } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { bind } from 'bind-event-listener';
|
|
10
|
-
import
|
|
11
|
-
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
12
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
13
12
|
import { UNSAFE_LAYERING, useCloseOnEscapePress } from '@atlaskit/layering';
|
|
14
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
15
|
+
import NodeResolverWrapper from './node-resolver-wrapper';
|
|
16
16
|
import { Container } from './styled/container';
|
|
17
|
-
const packageName = "@atlaskit/inline-dialog";
|
|
18
|
-
const packageVersion = "14.3.0";
|
|
19
17
|
const checkIsChildOfPortal = node => {
|
|
20
18
|
if (!node) {
|
|
21
19
|
return false;
|
|
@@ -33,12 +31,12 @@ const EscapeCloseManager = ({
|
|
|
33
31
|
// only create a dummy component for using ths hook in class component
|
|
34
32
|
return jsx("span", null);
|
|
35
33
|
};
|
|
36
|
-
const
|
|
34
|
+
const InlineDialog = /*#__PURE__*/memo(function InlineDialog({
|
|
37
35
|
isOpen = false,
|
|
38
36
|
onContentBlur = noop,
|
|
39
37
|
onContentClick = noop,
|
|
40
38
|
onContentFocus = noop,
|
|
41
|
-
onClose = noop,
|
|
39
|
+
onClose: providedOnClose = noop,
|
|
42
40
|
placement = 'bottom-start',
|
|
43
41
|
strategy = 'fixed',
|
|
44
42
|
testId,
|
|
@@ -47,6 +45,14 @@ const InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog({
|
|
|
47
45
|
}) {
|
|
48
46
|
const containerRef = useRef(null);
|
|
49
47
|
const triggerRef = useRef(null);
|
|
48
|
+
const onClose = usePlatformLeafEventHandler({
|
|
49
|
+
fn: event => providedOnClose(event),
|
|
50
|
+
action: 'closed',
|
|
51
|
+
componentName: 'inlineDialog',
|
|
52
|
+
packageName: "@atlaskit/inline-dialog",
|
|
53
|
+
packageVersion: "15.0.0"
|
|
54
|
+
});
|
|
55
|
+
|
|
50
56
|
// we put this into a ref to avoid handleCloseRequest having this as a dependency
|
|
51
57
|
const onCloseRef = useRef(onClose);
|
|
52
58
|
const isLayeringEnabled = fg('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
@@ -162,7 +168,7 @@ const InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog({
|
|
|
162
168
|
}, content)) : null;
|
|
163
169
|
return jsx(Manager, null, jsx(Reference, null, ({
|
|
164
170
|
ref
|
|
165
|
-
}) => jsx(
|
|
171
|
+
}) => jsx(NodeResolverWrapper, {
|
|
166
172
|
innerRef: node => {
|
|
167
173
|
triggerRef.current = node;
|
|
168
174
|
if (typeof ref === 'function') {
|
|
@@ -170,41 +176,15 @@ const InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog({
|
|
|
170
176
|
} else {
|
|
171
177
|
ref.current = node;
|
|
172
178
|
}
|
|
173
|
-
|
|
179
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
180
|
+
},
|
|
181
|
+
hasNodeResolver: !fg('dsp-19516-design-system-portal-logic-update')
|
|
174
182
|
}, jsx(React.Fragment, null, children))), isLayeringEnabled ? jsx(UNSAFE_LAYERING, {
|
|
175
183
|
isDisabled: false
|
|
176
184
|
}, popper, jsx(EscapeCloseManager, {
|
|
177
185
|
handleClose: handleCloseRequest
|
|
178
186
|
})) : popper);
|
|
179
187
|
});
|
|
180
|
-
InlineDialogComponent.displayName = 'InlineDialog';
|
|
181
|
-
export { InlineDialogComponent as InlineDialogWithoutAnalytics };
|
|
182
|
-
const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
183
188
|
|
|
184
|
-
|
|
185
|
-
* __Inline dialog__
|
|
186
|
-
*
|
|
187
|
-
* _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
|
|
188
|
-
*
|
|
189
|
-
* An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
|
|
190
|
-
*
|
|
191
|
-
* - [Examples](https://atlassian.design/components/inline-dialog/examples)
|
|
192
|
-
* - [Code](https://atlassian.design/components/inline-dialog/code)
|
|
193
|
-
* - [Usage](https://atlassian.design/components/inline-dialog/usage)
|
|
194
|
-
*/
|
|
195
|
-
const InlineDialog = withAnalyticsContext({
|
|
196
|
-
componentName: 'inlineDialog',
|
|
197
|
-
packageName,
|
|
198
|
-
packageVersion
|
|
199
|
-
})(withAnalyticsEvents({
|
|
200
|
-
onClose: createAndFireEventOnAtlaskit({
|
|
201
|
-
action: 'closed',
|
|
202
|
-
actionSubject: 'inlineDialog',
|
|
203
|
-
attributes: {
|
|
204
|
-
componentName: 'inlineDialog',
|
|
205
|
-
packageName,
|
|
206
|
-
packageVersion
|
|
207
|
-
}
|
|
208
|
-
})
|
|
209
|
-
})(InlineDialogComponent));
|
|
189
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
210
190
|
export default InlineDialog;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NodeResolver from 'react-node-resolver';
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
5
|
+
*
|
|
6
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
7
|
+
* is intended to be removed once the feature flag is removed.
|
|
8
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
9
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
10
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
11
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, wrape the children in a div setting innerRef with ref to the div.
|
|
12
|
+
*/
|
|
13
|
+
const NodeResolverWrapper = ({
|
|
14
|
+
hasNodeResolver,
|
|
15
|
+
children,
|
|
16
|
+
innerRef
|
|
17
|
+
}) => {
|
|
18
|
+
if (hasNodeResolver) {
|
|
19
|
+
return /*#__PURE__*/React.createElement(NodeResolver, {
|
|
20
|
+
innerRef: innerRef
|
|
21
|
+
}, children);
|
|
22
|
+
}
|
|
23
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
ref: node => innerRef(node)
|
|
25
|
+
}, children);
|
|
26
|
+
};
|
|
27
|
+
export default NodeResolverWrapper;
|
|
@@ -7,15 +7,13 @@ import React, { memo, useCallback, useEffect, useRef } from 'react';
|
|
|
7
7
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
8
|
import { jsx } from '@emotion/react';
|
|
9
9
|
import { bind } from 'bind-event-listener';
|
|
10
|
-
import
|
|
11
|
-
import { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
|
+
import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
|
|
12
11
|
import noop from '@atlaskit/ds-lib/noop';
|
|
13
12
|
import { UNSAFE_LAYERING, useCloseOnEscapePress } from '@atlaskit/layering';
|
|
14
13
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
14
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
15
|
+
import NodeResolverWrapper from './node-resolver-wrapper';
|
|
16
16
|
import { Container } from './styled/container';
|
|
17
|
-
var packageName = "@atlaskit/inline-dialog";
|
|
18
|
-
var packageVersion = "14.3.0";
|
|
19
17
|
var checkIsChildOfPortal = function checkIsChildOfPortal(node) {
|
|
20
18
|
if (!node) {
|
|
21
19
|
return false;
|
|
@@ -32,7 +30,7 @@ var EscapeCloseManager = function EscapeCloseManager(_ref) {
|
|
|
32
30
|
// only create a dummy component for using ths hook in class component
|
|
33
31
|
return jsx("span", null);
|
|
34
32
|
};
|
|
35
|
-
var
|
|
33
|
+
var InlineDialog = /*#__PURE__*/memo(function InlineDialog(_ref2) {
|
|
36
34
|
var _ref2$isOpen = _ref2.isOpen,
|
|
37
35
|
isOpen = _ref2$isOpen === void 0 ? false : _ref2$isOpen,
|
|
38
36
|
_ref2$onContentBlur = _ref2.onContentBlur,
|
|
@@ -42,7 +40,7 @@ var InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
|
|
|
42
40
|
_ref2$onContentFocus = _ref2.onContentFocus,
|
|
43
41
|
onContentFocus = _ref2$onContentFocus === void 0 ? noop : _ref2$onContentFocus,
|
|
44
42
|
_ref2$onClose = _ref2.onClose,
|
|
45
|
-
|
|
43
|
+
providedOnClose = _ref2$onClose === void 0 ? noop : _ref2$onClose,
|
|
46
44
|
_ref2$placement = _ref2.placement,
|
|
47
45
|
placement = _ref2$placement === void 0 ? 'bottom-start' : _ref2$placement,
|
|
48
46
|
_ref2$strategy = _ref2.strategy,
|
|
@@ -52,6 +50,16 @@ var InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
|
|
|
52
50
|
children = _ref2.children;
|
|
53
51
|
var containerRef = useRef(null);
|
|
54
52
|
var triggerRef = useRef(null);
|
|
53
|
+
var onClose = usePlatformLeafEventHandler({
|
|
54
|
+
fn: function fn(event) {
|
|
55
|
+
return providedOnClose(event);
|
|
56
|
+
},
|
|
57
|
+
action: 'closed',
|
|
58
|
+
componentName: 'inlineDialog',
|
|
59
|
+
packageName: "@atlaskit/inline-dialog",
|
|
60
|
+
packageVersion: "15.0.0"
|
|
61
|
+
});
|
|
62
|
+
|
|
55
63
|
// we put this into a ref to avoid handleCloseRequest having this as a dependency
|
|
56
64
|
var onCloseRef = useRef(onClose);
|
|
57
65
|
var isLayeringEnabled = fg('platform.design-system-team.inline-message-layering_wfp1p') && isOpen;
|
|
@@ -166,7 +174,7 @@ var InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
|
|
|
166
174
|
}) : null;
|
|
167
175
|
return jsx(Manager, null, jsx(Reference, null, function (_ref5) {
|
|
168
176
|
var ref = _ref5.ref;
|
|
169
|
-
return jsx(
|
|
177
|
+
return jsx(NodeResolverWrapper, {
|
|
170
178
|
innerRef: function innerRef(node) {
|
|
171
179
|
triggerRef.current = node;
|
|
172
180
|
if (typeof ref === 'function') {
|
|
@@ -174,7 +182,9 @@ var InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
|
|
|
174
182
|
} else {
|
|
175
183
|
ref.current = node;
|
|
176
184
|
}
|
|
177
|
-
|
|
185
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
186
|
+
},
|
|
187
|
+
hasNodeResolver: !fg('dsp-19516-design-system-portal-logic-update')
|
|
178
188
|
}, jsx(React.Fragment, null, children));
|
|
179
189
|
}), isLayeringEnabled ? jsx(UNSAFE_LAYERING, {
|
|
180
190
|
isDisabled: false
|
|
@@ -182,34 +192,6 @@ var InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
|
|
|
182
192
|
handleClose: handleCloseRequest
|
|
183
193
|
})) : popper);
|
|
184
194
|
});
|
|
185
|
-
InlineDialogComponent.displayName = 'InlineDialog';
|
|
186
|
-
export { InlineDialogComponent as InlineDialogWithoutAnalytics };
|
|
187
|
-
var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
|
|
188
195
|
|
|
189
|
-
|
|
190
|
-
* __Inline dialog__
|
|
191
|
-
*
|
|
192
|
-
* _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
|
|
193
|
-
*
|
|
194
|
-
* An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
|
|
195
|
-
*
|
|
196
|
-
* - [Examples](https://atlassian.design/components/inline-dialog/examples)
|
|
197
|
-
* - [Code](https://atlassian.design/components/inline-dialog/code)
|
|
198
|
-
* - [Usage](https://atlassian.design/components/inline-dialog/usage)
|
|
199
|
-
*/
|
|
200
|
-
var InlineDialog = withAnalyticsContext({
|
|
201
|
-
componentName: 'inlineDialog',
|
|
202
|
-
packageName: packageName,
|
|
203
|
-
packageVersion: packageVersion
|
|
204
|
-
})(withAnalyticsEvents({
|
|
205
|
-
onClose: createAndFireEventOnAtlaskit({
|
|
206
|
-
action: 'closed',
|
|
207
|
-
actionSubject: 'inlineDialog',
|
|
208
|
-
attributes: {
|
|
209
|
-
componentName: 'inlineDialog',
|
|
210
|
-
packageName: packageName,
|
|
211
|
-
packageVersion: packageVersion
|
|
212
|
-
}
|
|
213
|
-
})
|
|
214
|
-
})(InlineDialogComponent));
|
|
196
|
+
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
215
197
|
export default InlineDialog;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import NodeResolver from 'react-node-resolver';
|
|
3
|
+
/**
|
|
4
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
5
|
+
*
|
|
6
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
7
|
+
* is intended to be removed once the feature flag is removed.
|
|
8
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
9
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
10
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
11
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, wrape the children in a div setting innerRef with ref to the div.
|
|
12
|
+
*/
|
|
13
|
+
var NodeResolverWrapper = function NodeResolverWrapper(_ref) {
|
|
14
|
+
var hasNodeResolver = _ref.hasNodeResolver,
|
|
15
|
+
children = _ref.children,
|
|
16
|
+
innerRef = _ref.innerRef;
|
|
17
|
+
if (hasNodeResolver) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(NodeResolver, {
|
|
19
|
+
innerRef: innerRef
|
|
20
|
+
}, children);
|
|
21
|
+
}
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
23
|
+
ref: function ref(node) {
|
|
24
|
+
return innerRef(node);
|
|
25
|
+
}
|
|
26
|
+
}, children);
|
|
27
|
+
};
|
|
28
|
+
export default NodeResolverWrapper;
|
|
@@ -2,20 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import { type FC } from 'react';
|
|
6
6
|
import type { InlineDialogProps } from '../types';
|
|
7
|
-
declare const
|
|
8
|
-
export { InlineDialogComponent as InlineDialogWithoutAnalytics };
|
|
9
|
-
/**
|
|
10
|
-
* __Inline dialog__
|
|
11
|
-
*
|
|
12
|
-
* _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
|
|
13
|
-
*
|
|
14
|
-
* An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
|
|
15
|
-
*
|
|
16
|
-
* - [Examples](https://atlassian.design/components/inline-dialog/examples)
|
|
17
|
-
* - [Code](https://atlassian.design/components/inline-dialog/code)
|
|
18
|
-
* - [Usage](https://atlassian.design/components/inline-dialog/usage)
|
|
19
|
-
*/
|
|
20
|
-
declare const InlineDialog: React.ForwardRefExoticComponent<Pick<Omit<InlineDialogProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "content" | "isOpen" | "onContentBlur" | "onContentClick" | "onContentFocus" | "onClose" | "placement" | "strategy" | "testId" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
|
|
7
|
+
declare const InlineDialog: FC<InlineDialogProps>;
|
|
21
8
|
export default InlineDialog;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { type FC, type ReactElement } from 'react';
|
|
2
|
+
interface NodeResolverWrapperProps {
|
|
3
|
+
hasNodeResolver: boolean;
|
|
4
|
+
innerRef: React.RefCallback<HTMLElement>;
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
9
|
+
*
|
|
10
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
11
|
+
* is intended to be removed once the feature flag is removed.
|
|
12
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
13
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
14
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
15
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, wrape the children in a div setting innerRef with ref to the div.
|
|
16
|
+
*/
|
|
17
|
+
declare const NodeResolverWrapper: FC<NodeResolverWrapperProps>;
|
|
18
|
+
export default NodeResolverWrapper;
|
|
@@ -2,20 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import { type FC } from 'react';
|
|
6
6
|
import type { InlineDialogProps } from '../types';
|
|
7
|
-
declare const
|
|
8
|
-
export { InlineDialogComponent as InlineDialogWithoutAnalytics };
|
|
9
|
-
/**
|
|
10
|
-
* __Inline dialog__
|
|
11
|
-
*
|
|
12
|
-
* _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
|
|
13
|
-
*
|
|
14
|
-
* An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
|
|
15
|
-
*
|
|
16
|
-
* - [Examples](https://atlassian.design/components/inline-dialog/examples)
|
|
17
|
-
* - [Code](https://atlassian.design/components/inline-dialog/code)
|
|
18
|
-
* - [Usage](https://atlassian.design/components/inline-dialog/usage)
|
|
19
|
-
*/
|
|
20
|
-
declare const InlineDialog: React.ForwardRefExoticComponent<Pick<Omit<InlineDialogProps, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "children" | "content" | "isOpen" | "onContentBlur" | "onContentClick" | "onContentFocus" | "onClose" | "placement" | "strategy" | "testId" | "key" | "analyticsContext"> & React.RefAttributes<any>>;
|
|
7
|
+
declare const InlineDialog: FC<InlineDialogProps>;
|
|
21
8
|
export default InlineDialog;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { type FC, type ReactElement } from 'react';
|
|
2
|
+
interface NodeResolverWrapperProps {
|
|
3
|
+
hasNodeResolver: boolean;
|
|
4
|
+
innerRef: React.RefCallback<HTMLElement>;
|
|
5
|
+
children: ReactElement;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A wrapper component that conditionally applies a NodeResolver to its children.
|
|
9
|
+
*
|
|
10
|
+
* Note: NodeResolver should not be used in React 18 concurrent mode. This component
|
|
11
|
+
* is intended to be removed once the feature flag is removed.
|
|
12
|
+
* @param {boolean} props.hasNodeResolver - Determines whether to apply the NodeResolver.
|
|
13
|
+
* @param {ReactElement} props.children - The child elements to be wrapped.
|
|
14
|
+
* @param {(instance: HTMLDivElement) => void} props.innerRef - A ref callback to get the instance of the HTMLDivElement.
|
|
15
|
+
* @returns {ReactElement} The children wrapped with NodeResolver if hasNodeResolver is true, wrape the children in a div setting innerRef with ref to the div.
|
|
16
|
+
*/
|
|
17
|
+
declare const NodeResolverWrapper: FC<NodeResolverWrapperProps>;
|
|
18
|
+
export default NodeResolverWrapper;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/inline-dialog",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "15.0.0",
|
|
4
4
|
"description": "An inline dialog is a pop-up container for small amounts of information. It can also contain controls.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@atlaskit/analytics-next": "^10.1.0",
|
|
45
|
-
"@atlaskit/ds-lib": "^2.
|
|
45
|
+
"@atlaskit/ds-lib": "^2.5.0",
|
|
46
46
|
"@atlaskit/layering": "^0.4.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
48
48
|
"@atlaskit/popper": "^6.2.0",
|
|
49
|
-
"@atlaskit/theme": "^
|
|
50
|
-
"@atlaskit/tokens": "^1.
|
|
49
|
+
"@atlaskit/theme": "^13.0.0",
|
|
50
|
+
"@atlaskit/tokens": "^1.59.0",
|
|
51
51
|
"@babel/runtime": "^7.0.0",
|
|
52
52
|
"@emotion/react": "^11.7.1",
|
|
53
53
|
"bind-event-listener": "^3.0.0",
|
|
@@ -60,13 +60,13 @@
|
|
|
60
60
|
"@af/accessibility-testing": "*",
|
|
61
61
|
"@af/integration-testing": "*",
|
|
62
62
|
"@af/visual-regression": "*",
|
|
63
|
-
"@atlaskit/button": "^
|
|
64
|
-
"@atlaskit/datetime-picker": "^
|
|
63
|
+
"@atlaskit/button": "^20.1.0",
|
|
64
|
+
"@atlaskit/datetime-picker": "^14.0.0",
|
|
65
65
|
"@atlaskit/docs": "*",
|
|
66
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
66
|
+
"@atlaskit/dropdown-menu": "^12.18.0",
|
|
67
67
|
"@atlaskit/modal-dialog": "^12.15.0",
|
|
68
68
|
"@atlaskit/section-message": "^6.6.0",
|
|
69
|
-
"@atlaskit/select": "^17.
|
|
69
|
+
"@atlaskit/select": "^17.15.0",
|
|
70
70
|
"@atlaskit/ssr": "*",
|
|
71
71
|
"@atlaskit/visual-regression": "*",
|
|
72
72
|
"@testing-library/react": "^12.1.5",
|
|
@@ -114,6 +114,9 @@
|
|
|
114
114
|
"platform-feature-flags": {
|
|
115
115
|
"platform.design-system-team.inline-message-layering_wfp1p": {
|
|
116
116
|
"type": "boolean"
|
|
117
|
+
},
|
|
118
|
+
"dsp-19516-design-system-portal-logic-update": {
|
|
119
|
+
"type": "boolean"
|
|
117
120
|
}
|
|
118
121
|
},
|
|
119
122
|
"homepage": "https://atlassian.design/components/inline-dialog/"
|