@atlaskit/modal-dialog 14.12.0 → 14.13.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/modal-dialog
2
2
 
3
+ ## 14.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`bbfd308f360d8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bbfd308f360d8) -
8
+ Add flag to remove internal focus lock from running when using `false` in `autoFocus`. This is in
9
+ service of eventually removing boolean `autoFocus` from the API.
10
+
3
11
  ## 14.12.0
4
12
 
5
13
  ### Minor Changes
@@ -20,6 +20,7 @@ var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
20
20
  var _layering = require("@atlaskit/layering");
21
21
  var _openLayerObserver = require("@atlaskit/layering/experimental/open-layer-observer");
22
22
  var _fadeIn = _interopRequireDefault(require("@atlaskit/motion/fade-in"));
23
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
23
24
  var _portal = _interopRequireDefault(require("@atlaskit/portal"));
24
25
  var _constants = require("@atlaskit/theme/constants");
25
26
  var _useModalStack = _interopRequireDefault(require("../hooks/use-modal-stack"));
@@ -82,7 +83,9 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
82
83
  var isForeground = stackIndex === 0;
83
84
 
84
85
  // When a user supplies a ref to focus we skip auto focus via react-focus-lock
85
- var autoFocusLock = typeof autoFocus === 'boolean' ? autoFocus : false;
86
+ // When flag is true and a ref is not supplied, autofocus is true. See https://product-fabric.atlassian.net/browse/DSP-24307
87
+ // When we remove boolean `autoFocus`, we won't have to worry about this
88
+ var autoFocusLock = (0, _platformFeatureFlags.fg)('platform_dst_autofocus-never-false-2') ? typeof autoFocus === 'boolean' : typeof autoFocus === 'boolean' ? autoFocus : false;
86
89
  var onCloseHandler = (0, _analyticsNext.usePlatformLeafEventHandler)({
87
90
  fn: providedOnClose || _noop.default,
88
91
  action: 'closed',
@@ -12,6 +12,7 @@ import noop from '@atlaskit/ds-lib/noop';
12
12
  import { Layering } from '@atlaskit/layering';
13
13
  import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
14
14
  import FadeIn from '@atlaskit/motion/fade-in';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import Portal from '@atlaskit/portal';
16
17
  import { layers } from '@atlaskit/theme/constants';
17
18
  import useModalStack from '../hooks/use-modal-stack';
@@ -69,7 +70,9 @@ const InternalModalWrapper = props => {
69
70
  const isForeground = stackIndex === 0;
70
71
 
71
72
  // When a user supplies a ref to focus we skip auto focus via react-focus-lock
72
- const autoFocusLock = typeof autoFocus === 'boolean' ? autoFocus : false;
73
+ // When flag is true and a ref is not supplied, autofocus is true. See https://product-fabric.atlassian.net/browse/DSP-24307
74
+ // When we remove boolean `autoFocus`, we won't have to worry about this
75
+ const autoFocusLock = fg('platform_dst_autofocus-never-false-2') ? typeof autoFocus === 'boolean' : typeof autoFocus === 'boolean' ? autoFocus : false;
73
76
  const onCloseHandler = usePlatformLeafEventHandler({
74
77
  fn: providedOnClose || noop,
75
78
  action: 'closed',
@@ -12,6 +12,7 @@ import noop from '@atlaskit/ds-lib/noop';
12
12
  import { Layering } from '@atlaskit/layering';
13
13
  import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
14
14
  import FadeIn from '@atlaskit/motion/fade-in';
15
+ import { fg } from '@atlaskit/platform-feature-flags';
15
16
  import Portal from '@atlaskit/portal';
16
17
  import { layers } from '@atlaskit/theme/constants';
17
18
  import useModalStack from '../hooks/use-modal-stack';
@@ -73,7 +74,9 @@ var InternalModalWrapper = function InternalModalWrapper(props) {
73
74
  var isForeground = stackIndex === 0;
74
75
 
75
76
  // When a user supplies a ref to focus we skip auto focus via react-focus-lock
76
- var autoFocusLock = typeof autoFocus === 'boolean' ? autoFocus : false;
77
+ // When flag is true and a ref is not supplied, autofocus is true. See https://product-fabric.atlassian.net/browse/DSP-24307
78
+ // When we remove boolean `autoFocus`, we won't have to worry about this
79
+ var autoFocusLock = fg('platform_dst_autofocus-never-false-2') ? typeof autoFocus === 'boolean' : typeof autoFocus === 'boolean' ? autoFocus : false;
77
80
  var onCloseHandler = usePlatformLeafEventHandler({
78
81
  fn: providedOnClose || noop,
79
82
  action: 'closed',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/modal-dialog",
3
- "version": "14.12.0",
3
+ "version": "14.13.0",
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/"
@@ -32,15 +32,15 @@
32
32
  "@atlaskit/button": "^23.10.0",
33
33
  "@atlaskit/css": "^0.19.0",
34
34
  "@atlaskit/ds-lib": "^6.0.0",
35
- "@atlaskit/icon": "^33.0.0",
35
+ "@atlaskit/icon": "^33.1.0",
36
36
  "@atlaskit/layering": "^3.6.0",
37
37
  "@atlaskit/motion": "^5.4.0",
38
38
  "@atlaskit/platform-feature-flags": "^1.1.0",
39
39
  "@atlaskit/portal": "^5.2.0",
40
40
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
41
- "@atlaskit/primitives": "^18.0.0",
41
+ "@atlaskit/primitives": "^18.1.0",
42
42
  "@atlaskit/theme": "^22.0.0",
43
- "@atlaskit/tokens": "^11.2.0",
43
+ "@atlaskit/tokens": "^11.3.0",
44
44
  "@babel/runtime": "^7.0.0",
45
45
  "@compiled/react": "^0.20.0",
46
46
  "bind-event-listener": "^3.0.0",
@@ -75,8 +75,10 @@
75
75
  "@atlaskit/spotlight": "^0.10.0",
76
76
  "@atlaskit/textfield": "^8.2.0",
77
77
  "@atlaskit/tooltip": "^21.0.0",
78
+ "@atlassian/feature-flags-test-utils": "^1.0.0",
78
79
  "@atlassian/ssr-tests": "workspace:^",
79
80
  "@atlassian/structured-docs-types": "workspace:^",
81
+ "@atlassian/testing-library": "^0.4.0",
80
82
  "@testing-library/dom": "^10.1.0",
81
83
  "@testing-library/react": "^16.3.0",
82
84
  "@testing-library/user-event": "^14.4.3",
@@ -127,6 +129,9 @@
127
129
  },
128
130
  "platform-dst-shape-theme-default": {
129
131
  "type": "boolean"
132
+ },
133
+ "platform_dst_autofocus-never-false-2": {
134
+ "type": "boolean"
130
135
  }
131
136
  },
132
137
  "homepage": "https://atlassian.design/components/modal-dialog/"