@atlaskit/inline-dialog 14.3.1 → 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 CHANGED
@@ -1,5 +1,13 @@
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
+
3
11
  ## 14.3.1
4
12
 
5
13
  ### Patch Changes
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.default = exports.InlineDialogWithoutAnalytics = void 0;
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");
@@ -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.1";
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 InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/(0, _react.memo)(function InlineDialog(_ref2) {
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
- onClose = _ref2$onClose === void 0 ? _noop.default : _ref2$onClose,
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;
@@ -195,33 +203,6 @@ var InlineDialogComponent = exports.InlineDialogWithoutAnalytics = /*#__PURE__*/
195
203
  handleClose: handleCloseRequest
196
204
  })) : popper);
197
205
  });
198
- InlineDialogComponent.displayName = 'InlineDialog';
199
- var createAndFireEventOnAtlaskit = (0, _analyticsNext.createAndFireEvent)('atlaskit');
200
206
 
201
- /**
202
- * __Inline dialog__
203
- *
204
- * _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
205
- *
206
- * An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
207
- *
208
- * - [Examples](https://atlassian.design/components/inline-dialog/examples)
209
- * - [Code](https://atlassian.design/components/inline-dialog/code)
210
- * - [Usage](https://atlassian.design/components/inline-dialog/usage)
211
- */
212
- var InlineDialog = (0, _analyticsNext.withAnalyticsContext)({
213
- componentName: 'inlineDialog',
214
- packageName: packageName,
215
- packageVersion: packageVersion
216
- })((0, _analyticsNext.withAnalyticsEvents)({
217
- onClose: createAndFireEventOnAtlaskit({
218
- action: 'closed',
219
- actionSubject: 'inlineDialog',
220
- attributes: {
221
- componentName: 'inlineDialog',
222
- packageName: packageName,
223
- packageVersion: packageVersion
224
- }
225
- })
226
- })(InlineDialogComponent));
207
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
227
208
  var _default = exports.default = InlineDialog;
@@ -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 { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
10
+ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
11
11
  import noop from '@atlaskit/ds-lib/noop';
12
12
  import { UNSAFE_LAYERING, useCloseOnEscapePress } from '@atlaskit/layering';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import { Manager, Popper, Reference } from '@atlaskit/popper';
15
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.1";
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 InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog({
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;
@@ -179,34 +185,6 @@ const InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog({
179
185
  handleClose: handleCloseRequest
180
186
  })) : popper);
181
187
  });
182
- InlineDialogComponent.displayName = 'InlineDialog';
183
- export { InlineDialogComponent as InlineDialogWithoutAnalytics };
184
- const createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
185
188
 
186
- /**
187
- * __Inline dialog__
188
- *
189
- * _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
190
- *
191
- * An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
192
- *
193
- * - [Examples](https://atlassian.design/components/inline-dialog/examples)
194
- * - [Code](https://atlassian.design/components/inline-dialog/code)
195
- * - [Usage](https://atlassian.design/components/inline-dialog/usage)
196
- */
197
- const InlineDialog = withAnalyticsContext({
198
- componentName: 'inlineDialog',
199
- packageName,
200
- packageVersion
201
- })(withAnalyticsEvents({
202
- onClose: createAndFireEventOnAtlaskit({
203
- action: 'closed',
204
- actionSubject: 'inlineDialog',
205
- attributes: {
206
- componentName: 'inlineDialog',
207
- packageName,
208
- packageVersion
209
- }
210
- })
211
- })(InlineDialogComponent));
189
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
212
190
  export default InlineDialog;
@@ -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 { createAndFireEvent, withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
10
+ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
11
11
  import noop from '@atlaskit/ds-lib/noop';
12
12
  import { UNSAFE_LAYERING, useCloseOnEscapePress } from '@atlaskit/layering';
13
13
  import { fg } from '@atlaskit/platform-feature-flags';
14
14
  import { Manager, Popper, Reference } from '@atlaskit/popper';
15
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.1";
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 InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
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
- onClose = _ref2$onClose === void 0 ? noop : _ref2$onClose,
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;
@@ -184,34 +192,6 @@ var InlineDialogComponent = /*#__PURE__*/memo(function InlineDialog(_ref2) {
184
192
  handleClose: handleCloseRequest
185
193
  })) : popper);
186
194
  });
187
- InlineDialogComponent.displayName = 'InlineDialog';
188
- export { InlineDialogComponent as InlineDialogWithoutAnalytics };
189
- var createAndFireEventOnAtlaskit = createAndFireEvent('atlaskit');
190
195
 
191
- /**
192
- * __Inline dialog__
193
- *
194
- * _We are planning on deprecating Inline dialog. We recommend using the Popup component instead._
195
- *
196
- * An inline dialog is a pop-up container for small amounts of information. It can also contain controls.
197
- *
198
- * - [Examples](https://atlassian.design/components/inline-dialog/examples)
199
- * - [Code](https://atlassian.design/components/inline-dialog/code)
200
- * - [Usage](https://atlassian.design/components/inline-dialog/usage)
201
- */
202
- var InlineDialog = withAnalyticsContext({
203
- componentName: 'inlineDialog',
204
- packageName: packageName,
205
- packageVersion: packageVersion
206
- })(withAnalyticsEvents({
207
- onClose: createAndFireEventOnAtlaskit({
208
- action: 'closed',
209
- actionSubject: 'inlineDialog',
210
- attributes: {
211
- componentName: 'inlineDialog',
212
- packageName: packageName,
213
- packageVersion: packageVersion
214
- }
215
- })
216
- })(InlineDialogComponent));
196
+ // eslint-disable-next-line @repo/internal/react/require-jsdoc
217
197
  export default InlineDialog;
@@ -2,20 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import React, { type FC } from 'react';
5
+ import { type FC } from 'react';
6
6
  import type { InlineDialogProps } from '../types';
7
- declare const InlineDialogComponent: FC<InlineDialogProps>;
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;
@@ -2,20 +2,7 @@
2
2
  * @jsxRuntime classic
3
3
  * @jsx jsx
4
4
  */
5
- import React, { type FC } from 'react';
5
+ import { type FC } from 'react';
6
6
  import type { InlineDialogProps } from '../types';
7
- declare const InlineDialogComponent: FC<InlineDialogProps>;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/inline-dialog",
3
- "version": "14.3.1",
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.4.0",
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
49
  "@atlaskit/theme": "^13.0.0",
50
- "@atlaskit/tokens": "^1.58.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": "^19.2.0",
64
- "@atlaskit/datetime-picker": "^13.10.0",
63
+ "@atlaskit/button": "^20.1.0",
64
+ "@atlaskit/datetime-picker": "^14.0.0",
65
65
  "@atlaskit/docs": "*",
66
- "@atlaskit/dropdown-menu": "^12.17.0",
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.13.0",
69
+ "@atlaskit/select": "^17.15.0",
70
70
  "@atlaskit/ssr": "*",
71
71
  "@atlaskit/visual-regression": "*",
72
72
  "@testing-library/react": "^12.1.5",