@atlaskit/modal-dialog 16.5.1 → 16.5.3

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,20 @@
1
1
  # @atlaskit/modal-dialog
2
2
 
3
+ ## 16.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`75e41b355abb1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/75e41b355abb1) -
8
+ Change `useExitingPersistence` import to newly created named export
9
+ - Updated dependencies
10
+
11
+ ## 16.5.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Use `@atlassian/testing-library` exclusively in unit tests.
16
+ - Updated dependencies
17
+
3
18
  ## 16.5.1
4
19
 
5
20
  ### Patch Changes
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.CloseButton = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
- var _new = require("@atlaskit/button/new");
9
+ var _button = _interopRequireDefault(require("@atlaskit/button/icon/button"));
10
10
  var _cross = _interopRequireDefault(require("@atlaskit/icon/core/cross"));
11
11
  /**
12
12
  * __Close button__
@@ -25,7 +25,7 @@ var CloseButton = exports.CloseButton = function CloseButton(_ref) {
25
25
  onBlur = _ref.onBlur,
26
26
  onClick = _ref.onClick,
27
27
  testId = _ref.testId;
28
- return /*#__PURE__*/_react.default.createElement(_new.IconButton, {
28
+ return /*#__PURE__*/_react.default.createElement(_button.default, {
29
29
  testId: testId && "".concat(testId, "--close-button"),
30
30
  appearance: "subtle",
31
31
  icon: _cross.default,
@@ -16,8 +16,8 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
16
16
  var _bindEventListener = require("bind-event-listener");
17
17
  var _reactFocusLock = _interopRequireDefault(require("react-focus-lock"));
18
18
  var _reactScrolllock = _interopRequireWildcard(require("react-scrolllock"));
19
- var _analyticsNext = require("@atlaskit/analytics-next");
20
- var _blanket = _interopRequireDefault(require("@atlaskit/blanket"));
19
+ var _usePlatformLeafEventHandler = require("@atlaskit/analytics-next/usePlatformLeafEventHandler");
20
+ var _blanket = _interopRequireDefault(require("@atlaskit/blanket/blanket"));
21
21
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
22
22
  var _useAutoFocus = _interopRequireDefault(require("@atlaskit/ds-lib/use-auto-focus"));
23
23
  var _useId = require("@atlaskit/ds-lib/use-id");
@@ -26,11 +26,12 @@ var _useNotifyOpenLayerObserver = require("@atlaskit/layering/use-notify-open-la
26
26
  var _motion = require("@atlaskit/motion");
27
27
  var _useExitingPersistence = require("@atlaskit/motion/exiting-persistence/use-exiting-persistence");
28
28
  var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
29
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
- var _portal = _interopRequireDefault(require("@atlaskit/portal"));
31
- var _combine = require("@atlaskit/pragmatic-drag-and-drop/combine");
29
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
30
+ var _portal = _interopRequireDefault(require("@atlaskit/portal/portal"));
31
+ var _combine = require("@atlaskit/pragmatic-drag-and-drop/utils/combine");
32
32
  var _constants = require("@atlaskit/theme/constants");
33
- var _dialog = require("@atlaskit/top-layer/dialog");
33
+ var _createCloseEvent = require("@atlaskit/top-layer/create-close-event");
34
+ var _dialogContent = require("@atlaskit/top-layer/dialog-content");
34
35
  var _dialogScrollLock = require("@atlaskit/top-layer/dialog-scroll-lock");
35
36
  var _context = require("../context");
36
37
  var _useModalStack = _interopRequireDefault(require("../hooks/use-modal-stack"));
@@ -87,12 +88,12 @@ var allowlistElements = function allowlistElements(element, callback) {
87
88
  // Analytics-wrapped close handler. Extracted so both rendering paths build it
88
89
  // identically.
89
90
  function useModalCloseHandler(providedOnClose) {
90
- return (0, _analyticsNext.usePlatformLeafEventHandler)({
91
+ return (0, _usePlatformLeafEventHandler.usePlatformLeafEventHandler)({
91
92
  fn: providedOnClose || _noop.default,
92
93
  action: 'closed',
93
94
  componentName: 'modalDialog',
94
95
  packageName: "@atlaskit/modal-dialog",
95
- packageVersion: "16.5.0"
96
+ packageVersion: "16.5.2"
96
97
  });
97
98
  }
98
99
  function getScrollMode(_ref) {
@@ -241,7 +242,7 @@ function ModalWrapperTopLayer(props) {
241
242
  // Pass a synthetic event to satisfy the KeyboardOrMouseEvent contract.
242
243
  var onDialogClose = (0, _react.useCallback)(function (_ref3) {
243
244
  var reason = _ref3.reason;
244
- onCloseHandler((0, _dialog.createCloseEvent)({
245
+ onCloseHandler((0, _createCloseEvent.createCloseEvent)({
245
246
  reason: reason
246
247
  }));
247
248
  }, [onCloseHandler]);
@@ -318,7 +319,7 @@ function ModalWrapperTopLayer(props) {
318
319
  isFullScreen: isFullScreen,
319
320
  shouldScrollInViewport: shouldScrollInViewport
320
321
  });
321
- return /*#__PURE__*/React.createElement(_dialog.Dialog, (0, _extends2.default)({
322
+ return /*#__PURE__*/React.createElement(_dialogContent.Dialog, (0, _extends2.default)({
322
323
  ref: dialogRef,
323
324
  onClose: onDialogClose,
324
325
  dismissedBy: dismissedBy,
@@ -453,7 +454,7 @@ var ModalWrapperLegacy = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
453
454
  isDisabled: false
454
455
  }, /*#__PURE__*/React.createElement(_portal.default, {
455
456
  zIndex: _constants.layers.modal()
456
- }, !UNSAFE_shouldDisableMotionUplift && (0, _platformFeatureFlags.fg)('platform-dst-motion-uplift-modal') ? /*#__PURE__*/React.createElement(_motion.Motion, {
457
+ }, !UNSAFE_shouldDisableMotionUplift && (0, _fg.fg)('platform-dst-motion-uplift-modal') ? /*#__PURE__*/React.createElement(_motion.Motion, {
457
458
  enteringAnimation: "var(--ds-blanket-enter, 250ms cubic-bezier(0.4, 0, 0, 1) FadeIn0to100)",
458
459
  exitingAnimation: "var(--ds-blanket-exit, 200ms cubic-bezier(0.6, 0, 0.8, 0.6) FadeOut100to0)"
459
460
  }, /*#__PURE__*/React.createElement("div", {
@@ -483,7 +484,7 @@ var ModalWrapperLegacy = /*#__PURE__*/(0, _react.forwardRef)(function (props, re
483
484
  // hooks unconditionally, so a runtime feature-flag change swaps component types
484
485
  // (a clean remount) instead of changing the hook order of a mounted component.
485
486
  var InternalModalWrapper = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
486
- if ((0, _platformFeatureFlags.fg)('platform-dst-top-layer')) {
487
+ if ((0, _fg.fg)('platform-dst-top-layer')) {
487
488
  // TODO: the top-layer path does not forward the external `ref` (parity
488
489
  // with the pre-refactor behavior, where the top-layer branch never
489
490
  // consumed it). The public type still advertises `RefAttributes`, so a
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IconButton } from '@atlaskit/button/new';
2
+ import IconButton from '@atlaskit/button/icon/button';
3
3
  import CrossIcon from '@atlaskit/icon/core/cross';
4
4
  /**
5
5
  * __Close button__
@@ -7,8 +7,8 @@ import { forwardRef, useCallback, useEffect, useMemo, useRef } from 'react';
7
7
  import { bind } from 'bind-event-listener';
8
8
  import FocusLock from 'react-focus-lock';
9
9
  import ScrollLock, { TouchScrollable } from 'react-scrolllock';
10
- import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
11
- import Blanket from '@atlaskit/blanket';
10
+ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
11
+ import Blanket from '@atlaskit/blanket/blanket';
12
12
  import noop from '@atlaskit/ds-lib/noop';
13
13
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
14
14
  import { useId } from '@atlaskit/ds-lib/use-id';
@@ -17,11 +17,12 @@ import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-l
17
17
  import { Motion } from '@atlaskit/motion';
18
18
  import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence/use-exiting-persistence';
19
19
  import FadeIn from '@atlaskit/motion/fade-in';
20
- import { fg } from '@atlaskit/platform-feature-flags';
21
- import Portal from '@atlaskit/portal';
22
- import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
20
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
21
+ import Portal from '@atlaskit/portal/portal';
22
+ import { combine } from '@atlaskit/pragmatic-drag-and-drop/utils/combine';
23
23
  import { layers } from '@atlaskit/theme/constants';
24
- import { createCloseEvent, Dialog } from '@atlaskit/top-layer/dialog';
24
+ import { createCloseEvent } from '@atlaskit/top-layer/create-close-event';
25
+ import { Dialog } from '@atlaskit/top-layer/dialog-content';
25
26
  import { DialogScrollLock } from '@atlaskit/top-layer/dialog-scroll-lock';
26
27
  import { ModalContext } from '../context';
27
28
  import useModalStack from '../hooks/use-modal-stack';
@@ -82,7 +83,7 @@ function useModalCloseHandler(providedOnClose) {
82
83
  action: 'closed',
83
84
  componentName: 'modalDialog',
84
85
  packageName: "@atlaskit/modal-dialog",
85
- packageVersion: "16.5.0"
86
+ packageVersion: "16.5.2"
86
87
  });
87
88
  }
88
89
  function getScrollMode({
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IconButton } from '@atlaskit/button/new';
2
+ import IconButton from '@atlaskit/button/icon/button';
3
3
  import CrossIcon from '@atlaskit/icon/core/cross';
4
4
  /**
5
5
  * __Close button__
@@ -8,8 +8,8 @@ import { forwardRef, useCallback, useEffect, useMemo, useRef } from 'react';
8
8
  import { bind } from 'bind-event-listener';
9
9
  import FocusLock from 'react-focus-lock';
10
10
  import ScrollLock, { TouchScrollable } from 'react-scrolllock';
11
- import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next';
12
- import Blanket from '@atlaskit/blanket';
11
+ import { usePlatformLeafEventHandler } from '@atlaskit/analytics-next/usePlatformLeafEventHandler';
12
+ import Blanket from '@atlaskit/blanket/blanket';
13
13
  import noop from '@atlaskit/ds-lib/noop';
14
14
  import useAutoFocus from '@atlaskit/ds-lib/use-auto-focus';
15
15
  import { useId } from '@atlaskit/ds-lib/use-id';
@@ -18,11 +18,12 @@ import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-l
18
18
  import { Motion } from '@atlaskit/motion';
19
19
  import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence/use-exiting-persistence';
20
20
  import FadeIn from '@atlaskit/motion/fade-in';
21
- import { fg } from '@atlaskit/platform-feature-flags';
22
- import Portal from '@atlaskit/portal';
23
- import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';
21
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
22
+ import Portal from '@atlaskit/portal/portal';
23
+ import { combine } from '@atlaskit/pragmatic-drag-and-drop/utils/combine';
24
24
  import { layers } from '@atlaskit/theme/constants';
25
- import { createCloseEvent, Dialog } from '@atlaskit/top-layer/dialog';
25
+ import { createCloseEvent } from '@atlaskit/top-layer/create-close-event';
26
+ import { Dialog } from '@atlaskit/top-layer/dialog-content';
26
27
  import { DialogScrollLock } from '@atlaskit/top-layer/dialog-scroll-lock';
27
28
  import { ModalContext } from '../context';
28
29
  import useModalStack from '../hooks/use-modal-stack';
@@ -83,7 +84,7 @@ function useModalCloseHandler(providedOnClose) {
83
84
  action: 'closed',
84
85
  componentName: 'modalDialog',
85
86
  packageName: "@atlaskit/modal-dialog",
86
- packageVersion: "16.5.0"
87
+ packageVersion: "16.5.2"
87
88
  });
88
89
  }
89
90
  function getScrollMode(_ref) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "16.5.1",
3
+ "version": "16.5.3",
4
4
  "description": "A modal dialog displays content that requires user interaction, in a layer above the page.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,14 +34,14 @@
34
34
  "watch": "tsc --watch --noEmit --project './tsconfig.json'"
35
35
  },
36
36
  "dependencies": {
37
- "@atlaskit/analytics-next": "^12.3.0",
37
+ "@atlaskit/analytics-next": "^12.4.0",
38
38
  "@atlaskit/blanket": "^16.3.0",
39
39
  "@atlaskit/button": "^25.2.0",
40
40
  "@atlaskit/css": "^1.0.0",
41
41
  "@atlaskit/ds-lib": "^8.0.0",
42
42
  "@atlaskit/icon": "^37.5.0",
43
43
  "@atlaskit/layering": "^5.1.0",
44
- "@atlaskit/motion": "^8.4.0",
44
+ "@atlaskit/motion": "^8.5.0",
45
45
  "@atlaskit/platform-feature-flags": "^2.1.0",
46
46
  "@atlaskit/portal": "^6.3.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop": "^3.0.0",
@@ -80,7 +80,7 @@
80
80
  "@atlaskit/popup": "^6.2.0",
81
81
  "@atlaskit/radio": "^10.1.0",
82
82
  "@atlaskit/section-message": "^10.1.0",
83
- "@atlaskit/select": "^22.8.0",
83
+ "@atlaskit/select": "^22.9.0",
84
84
  "@atlaskit/spotlight": "^4.2.0",
85
85
  "@atlaskit/textfield": "^10.1.0",
86
86
  "@atlaskit/tooltip": "^24.2.0",
@@ -89,8 +89,6 @@
89
89
  "@atlassian/structured-docs-types": "workspace:^",
90
90
  "@atlassian/testing-library": "^0.11.0",
91
91
  "@testing-library/dom": "^10.1.0",
92
- "@testing-library/react": "^16.3.0",
93
- "@testing-library/user-event": "^14.4.3",
94
92
  "@types/raf-schd": "^4.0.1",
95
93
  "jscodeshift": "^17.0.0",
96
94
  "react": "^18.2.0",