@atlaskit/modal-dialog 16.5.2 → 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 +8 -0
- package/dist/cjs/close-button.js +2 -2
- package/dist/cjs/internal/components/modal-wrapper.js +15 -14
- package/dist/cjs/internal/hooks/use-modal-stack.js +2 -2
- package/dist/es2019/close-button.js +1 -1
- package/dist/es2019/internal/components/modal-wrapper.js +9 -8
- package/dist/es2019/internal/hooks/use-modal-stack.js +1 -1
- package/dist/esm/close-button.js +1 -1
- package/dist/esm/internal/components/modal-wrapper.js +9 -8
- package/dist/esm/internal/hooks/use-modal-stack.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 16.5.2
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/cjs/close-button.js
CHANGED
|
@@ -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
|
|
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(
|
|
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,21 +16,22 @@ 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
|
|
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");
|
|
24
24
|
var _layering = require("@atlaskit/layering/layering");
|
|
25
25
|
var _useNotifyOpenLayerObserver = require("@atlaskit/layering/use-notify-open-layer-observer");
|
|
26
26
|
var _motion = require("@atlaskit/motion");
|
|
27
|
-
var
|
|
27
|
+
var _useExitingPersistence = require("@atlaskit/motion/exiting-persistence/use-exiting-persistence");
|
|
28
28
|
var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
|
|
29
|
-
var
|
|
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
|
|
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,
|
|
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.
|
|
96
|
+
packageVersion: "16.5.2"
|
|
96
97
|
});
|
|
97
98
|
}
|
|
98
99
|
function getScrollMode(_ref) {
|
|
@@ -206,7 +207,7 @@ function ModalWrapperTopLayer(props) {
|
|
|
206
207
|
onStackChange: onStackChange
|
|
207
208
|
});
|
|
208
209
|
var onCloseHandler = useModalCloseHandler(providedOnClose);
|
|
209
|
-
var _useExitingPersistenc = (0,
|
|
210
|
+
var _useExitingPersistenc = (0, _useExitingPersistence.useExitingPersistence)(),
|
|
210
211
|
isExiting = _useExitingPersistenc.isExiting,
|
|
211
212
|
onExitFinish = _useExitingPersistenc.onFinish;
|
|
212
213
|
|
|
@@ -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,
|
|
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(
|
|
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,
|
|
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,
|
|
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
|
|
@@ -10,7 +10,7 @@ var _react = require("react");
|
|
|
10
10
|
var _useLazyCallback = _interopRequireDefault(require("@atlaskit/ds-lib/use-lazy-callback"));
|
|
11
11
|
var _usePreviousValue = _interopRequireDefault(require("@atlaskit/ds-lib/use-previous-value"));
|
|
12
12
|
var _useStateRef3 = _interopRequireDefault(require("@atlaskit/ds-lib/use-state-ref"));
|
|
13
|
-
var
|
|
13
|
+
var _useExitingPersistence = require("@atlaskit/motion/exiting-persistence/use-exiting-persistence");
|
|
14
14
|
/**
|
|
15
15
|
* ________________________________________________
|
|
16
16
|
* | MAJOR VERSIONS WILL NOT KNOW ABOUT EACH OTHER! |
|
|
@@ -30,7 +30,7 @@ var modalStackRegister = [];
|
|
|
30
30
|
*/
|
|
31
31
|
function useModalStack(_ref) {
|
|
32
32
|
var onStackChange = _ref.onStackChange;
|
|
33
|
-
var _useExitingPersistenc = (0,
|
|
33
|
+
var _useExitingPersistenc = (0, _useExitingPersistence.useExitingPersistence)(),
|
|
34
34
|
isExiting = _useExitingPersistenc.isExiting;
|
|
35
35
|
var _useStateRef = (0, _useStateRef3.default)(0),
|
|
36
36
|
_useStateRef2 = (0, _slicedToArray2.default)(_useStateRef, 2),
|
|
@@ -7,21 +7,22 @@ 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';
|
|
15
15
|
import { Layering } from '@atlaskit/layering/layering';
|
|
16
16
|
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer';
|
|
17
17
|
import { Motion } from '@atlaskit/motion';
|
|
18
|
-
import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence';
|
|
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
|
|
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.
|
|
86
|
+
packageVersion: "16.5.2"
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
function getScrollMode({
|
|
@@ -2,7 +2,7 @@ import { useEffect } from 'react';
|
|
|
2
2
|
import useLazyCallback from '@atlaskit/ds-lib/use-lazy-callback';
|
|
3
3
|
import usePreviousValue from '@atlaskit/ds-lib/use-previous-value';
|
|
4
4
|
import useStateRef from '@atlaskit/ds-lib/use-state-ref';
|
|
5
|
-
import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence';
|
|
5
|
+
import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence/use-exiting-persistence';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* ________________________________________________
|
package/dist/esm/close-button.js
CHANGED
|
@@ -8,21 +8,22 @@ 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';
|
|
16
16
|
import { Layering } from '@atlaskit/layering/layering';
|
|
17
17
|
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer';
|
|
18
18
|
import { Motion } from '@atlaskit/motion';
|
|
19
|
-
import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence';
|
|
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
|
|
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.
|
|
87
|
+
packageVersion: "16.5.2"
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
function getScrollMode(_ref) {
|
|
@@ -3,7 +3,7 @@ import { useEffect } from 'react';
|
|
|
3
3
|
import useLazyCallback from '@atlaskit/ds-lib/use-lazy-callback';
|
|
4
4
|
import usePreviousValue from '@atlaskit/ds-lib/use-previous-value';
|
|
5
5
|
import useStateRef from '@atlaskit/ds-lib/use-state-ref';
|
|
6
|
-
import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence';
|
|
6
|
+
import { useExitingPersistence } from '@atlaskit/motion/exiting-persistence/use-exiting-persistence';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* ________________________________________________
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/modal-dialog",
|
|
3
|
-
"version": "16.5.
|
|
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.
|
|
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.
|
|
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",
|