@atlaskit/popup 1.10.1 → 1.11.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 +57 -45
- package/dist/cjs/index.js +1 -2
- package/dist/cjs/popper-wrapper.js +1 -2
- package/dist/cjs/popup.js +2 -4
- package/dist/cjs/reposition-on-update.js +2 -3
- package/dist/cjs/use-close-manager.js +2 -3
- package/dist/cjs/use-focus-manager.js +37 -16
- package/dist/es2019/use-focus-manager.js +35 -13
- package/dist/esm/use-focus-manager.js +35 -13
- package/dist/types/types.d.ts +1 -1
- package/dist/types/use-focus-manager.d.ts +1 -1
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/dist/types-ts4.5/use-focus-manager.d.ts +1 -1
- package/package.json +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
# @atlaskit/popup
|
|
2
2
|
|
|
3
|
+
## 1.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#41251](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41251) [`b0a2a8d78c6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b0a2a8d78c6) - [ux] We are testing removing the `focus-trap` package for a smaller sharper implementation of focus management behind a feature flag. If this fix is successful it will be available in a later release.
|
|
8
|
+
|
|
9
|
+
## 1.10.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#41354](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41354) [`d621fe3e4f8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d621fe3e4f8) - fix ReferenceError where frameId is used before it is initialised
|
|
14
|
+
|
|
3
15
|
## 1.10.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
6
18
|
|
|
7
|
-
- [`a54578d2ea9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a54578d2ea9) - This removes the feature flag for the `shouldRenderToParent` prop. The prop is available for use.
|
|
19
|
+
- [#40515](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40515) [`a54578d2ea9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a54578d2ea9) - This removes the feature flag for the `shouldRenderToParent` prop. The prop is available for use.
|
|
8
20
|
|
|
9
21
|
## 1.10.0
|
|
10
22
|
|
|
11
23
|
### Minor Changes
|
|
12
24
|
|
|
13
|
-
- [`f355884a4aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f355884a4aa) - [ux] Support to press escape key and only close the top layer
|
|
25
|
+
- [#39726](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39726) [`f355884a4aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f355884a4aa) - [ux] Support to press escape key and only close the top layer
|
|
14
26
|
|
|
15
27
|
### Patch Changes
|
|
16
28
|
|
|
@@ -20,44 +32,44 @@
|
|
|
20
32
|
|
|
21
33
|
### Patch Changes
|
|
22
34
|
|
|
23
|
-
- [`84442a93613`](https://bitbucket.org/atlassian/atlassian-frontend/commits/84442a93613) - Adds support for surface detection when using design tokens. Enabling children to be styled with the surface color of the popup when using the `utility.elevation.surface.current` design token.
|
|
35
|
+
- [#39278](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39278) [`84442a93613`](https://bitbucket.org/atlassian/atlassian-frontend/commits/84442a93613) - Adds support for surface detection when using design tokens. Enabling children to be styled with the surface color of the popup when using the `utility.elevation.surface.current` design token.
|
|
24
36
|
- Updated dependencies
|
|
25
37
|
|
|
26
38
|
## 1.9.2
|
|
27
39
|
|
|
28
40
|
### Patch Changes
|
|
29
41
|
|
|
30
|
-
- [`065da872439`](https://bitbucket.org/atlassian/atlassian-frontend/commits/065da872439) - Css changes for testing the feature flag `platform.design-system-team.render-popup-in-parent_f73ij`.
|
|
42
|
+
- [#38011](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38011) [`065da872439`](https://bitbucket.org/atlassian/atlassian-frontend/commits/065da872439) - Css changes for testing the feature flag `platform.design-system-team.render-popup-in-parent_f73ij`.
|
|
31
43
|
|
|
32
44
|
## 1.9.1
|
|
33
45
|
|
|
34
46
|
### Patch Changes
|
|
35
47
|
|
|
36
|
-
- [`6a0a3c059ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a0a3c059ba) - Remove unused argument from internal focus management function.
|
|
48
|
+
- [#37614](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37614) [`6a0a3c059ba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a0a3c059ba) - Remove unused argument from internal focus management function.
|
|
37
49
|
|
|
38
50
|
## 1.9.0
|
|
39
51
|
|
|
40
52
|
### Minor Changes
|
|
41
53
|
|
|
42
|
-
- [`3920dcfd848`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3920dcfd848) - This removes the feature flag made for upgrading the `focus-trap` dependency and keeps `focus-trap` at it's original version.
|
|
54
|
+
- [#34797](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34797) [`3920dcfd848`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3920dcfd848) - This removes the feature flag made for upgrading the `focus-trap` dependency and keeps `focus-trap` at it's original version.
|
|
43
55
|
|
|
44
56
|
## 1.8.3
|
|
45
57
|
|
|
46
58
|
### Patch Changes
|
|
47
59
|
|
|
48
|
-
- [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
|
|
60
|
+
- [#36754](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36754) [`4ae083a7e66`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4ae083a7e66) - Use `@af/accessibility-testing` for default jest-axe config and jest-axe import in accessibility testing.
|
|
49
61
|
|
|
50
62
|
## 1.8.2
|
|
51
63
|
|
|
52
64
|
### Patch Changes
|
|
53
65
|
|
|
54
|
-
- [`472a62ce219`](https://bitbucket.org/atlassian/atlassian-frontend/commits/472a62ce219) - [ux] Fixes `autoFocus` functionality on upgrade of focus-trap to v7.
|
|
66
|
+
- [#36447](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36447) [`472a62ce219`](https://bitbucket.org/atlassian/atlassian-frontend/commits/472a62ce219) - [ux] Fixes `autoFocus` functionality on upgrade of focus-trap to v7.
|
|
55
67
|
|
|
56
68
|
## 1.8.1
|
|
57
69
|
|
|
58
70
|
### Patch Changes
|
|
59
71
|
|
|
60
|
-
- [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
72
|
+
- [#35441](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35441) [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
61
73
|
|
|
62
74
|
## 1.8.0
|
|
63
75
|
|
|
@@ -69,37 +81,37 @@
|
|
|
69
81
|
|
|
70
82
|
### Minor Changes
|
|
71
83
|
|
|
72
|
-
- [`eca89633804`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eca89633804) - Add a new prop `shouldRenderToParent` to allow render popup into a DOM node within the parent DOM hierarchy instead of React portal.
|
|
84
|
+
- [#35092](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35092) [`eca89633804`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eca89633804) - Add a new prop `shouldRenderToParent` to allow render popup into a DOM node within the parent DOM hierarchy instead of React portal.
|
|
73
85
|
|
|
74
86
|
## 1.6.4
|
|
75
87
|
|
|
76
88
|
### Patch Changes
|
|
77
89
|
|
|
78
|
-
- [`e2a6337bb05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2a6337bb05) - Reverts changes 1.6.3 in @atlaskit/popup, reverts disabling pointer events on iframes when popup is open.
|
|
90
|
+
- [#35299](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35299) [`e2a6337bb05`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2a6337bb05) - Reverts changes 1.6.3 in @atlaskit/popup, reverts disabling pointer events on iframes when popup is open.
|
|
79
91
|
|
|
80
92
|
## 1.6.3
|
|
81
93
|
|
|
82
94
|
### Patch Changes
|
|
83
95
|
|
|
84
|
-
- [`c394dbc632f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c394dbc632f) - Addresses the problem where the popup fails to close upon clicking on the iframe
|
|
96
|
+
- [#34314](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34314) [`c394dbc632f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c394dbc632f) - Addresses the problem where the popup fails to close upon clicking on the iframe
|
|
85
97
|
|
|
86
98
|
## 1.6.2
|
|
87
99
|
|
|
88
100
|
### Patch Changes
|
|
89
101
|
|
|
90
|
-
- [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
102
|
+
- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793) [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure legacy types are published for TS 4.5-4.8
|
|
91
103
|
|
|
92
104
|
## 1.6.1
|
|
93
105
|
|
|
94
106
|
### Patch Changes
|
|
95
107
|
|
|
96
|
-
- [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
108
|
+
- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649) [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade Typescript from `4.5.5` to `4.9.5`
|
|
97
109
|
|
|
98
110
|
## 1.6.0
|
|
99
111
|
|
|
100
112
|
### Minor Changes
|
|
101
113
|
|
|
102
|
-
- [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
114
|
+
- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258) [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip minor dependency bump
|
|
103
115
|
|
|
104
116
|
### Patch Changes
|
|
105
117
|
|
|
@@ -133,31 +145,31 @@
|
|
|
133
145
|
|
|
134
146
|
### Patch Changes
|
|
135
147
|
|
|
136
|
-
- [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
|
|
148
|
+
- [#26303](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26303) [`9827dcb82b8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9827dcb82b8) - No-op change to introduce spacing tokens to design system components.
|
|
137
149
|
|
|
138
150
|
## 1.5.0
|
|
139
151
|
|
|
140
152
|
### Minor Changes
|
|
141
153
|
|
|
142
|
-
- [`c520e306869`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c520e306869) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
154
|
+
- [#24710](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24710) [`c520e306869`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c520e306869) - Updates `@emotion/core` to `@emotion/react`; v10 to v11. There is no expected behavior change.
|
|
143
155
|
|
|
144
156
|
## 1.4.2
|
|
145
157
|
|
|
146
158
|
### Patch Changes
|
|
147
159
|
|
|
148
|
-
- [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
160
|
+
- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874) [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
|
|
149
161
|
|
|
150
162
|
## 1.4.1
|
|
151
163
|
|
|
152
164
|
### Patch Changes
|
|
153
165
|
|
|
154
|
-
- [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
166
|
+
- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492) [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
|
|
155
167
|
|
|
156
168
|
## 1.4.0
|
|
157
169
|
|
|
158
170
|
### Minor Changes
|
|
159
171
|
|
|
160
|
-
- [`01d80d395bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01d80d395bc) - pass event to onOpenChange consistently
|
|
172
|
+
- [#23381](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/23381) [`01d80d395bc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01d80d395bc) - pass event to onOpenChange consistently
|
|
161
173
|
|
|
162
174
|
### Patch Changes
|
|
163
175
|
|
|
@@ -168,13 +180,13 @@
|
|
|
168
180
|
|
|
169
181
|
### Patch Changes
|
|
170
182
|
|
|
171
|
-
- [`8a5bdb3c844`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a5bdb3c844) - Upgrading internal dependency (bind-event-listener) for improved internal types
|
|
183
|
+
- [#22614](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/22614) [`8a5bdb3c844`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8a5bdb3c844) - Upgrading internal dependency (bind-event-listener) for improved internal types
|
|
172
184
|
|
|
173
185
|
## 1.3.9
|
|
174
186
|
|
|
175
187
|
### Patch Changes
|
|
176
188
|
|
|
177
|
-
- [`dcf8150c49c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dcf8150c49c) - Allow `trigger` props to be applied to any HTML element tag without causing type errors for the `ref` type
|
|
189
|
+
- [#21570](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21570) [`dcf8150c49c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dcf8150c49c) - Allow `trigger` props to be applied to any HTML element tag without causing type errors for the `ref` type
|
|
178
190
|
|
|
179
191
|
## 1.3.8
|
|
180
192
|
|
|
@@ -186,13 +198,13 @@
|
|
|
186
198
|
|
|
187
199
|
### Patch Changes
|
|
188
200
|
|
|
189
|
-
- [`2e7bbdfd813`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e7bbdfd813) - Upgrading internal dependency 'bind-event-listener' to 2.1.0 for improved types
|
|
201
|
+
- [#21242](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/21242) [`2e7bbdfd813`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e7bbdfd813) - Upgrading internal dependency 'bind-event-listener' to 2.1.0 for improved types
|
|
190
202
|
|
|
191
203
|
## 1.3.6
|
|
192
204
|
|
|
193
205
|
### Patch Changes
|
|
194
206
|
|
|
195
|
-
- [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
207
|
+
- [#20650](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/20650) [`cb2392f6d33`](https://bitbucket.org/atlassian/atlassian-frontend/commits/cb2392f6d33) - Upgrade to TypeScript 4.2.4
|
|
196
208
|
|
|
197
209
|
## 1.3.5
|
|
198
210
|
|
|
@@ -216,7 +228,7 @@
|
|
|
216
228
|
|
|
217
229
|
### Patch Changes
|
|
218
230
|
|
|
219
|
-
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
231
|
+
- [#16752](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16752) [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
220
232
|
- [`19d72473dfb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/19d72473dfb) - The no-unsafe-design-token-usage eslint rule now respects the new token naming conventions when auto-fixing by correctly formatting token ids.
|
|
221
233
|
- Updated dependencies
|
|
222
234
|
|
|
@@ -230,7 +242,7 @@
|
|
|
230
242
|
|
|
231
243
|
### Minor Changes
|
|
232
244
|
|
|
233
|
-
- [`2e42aa0d900`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e42aa0d900) - **Note**: It is a re-release of the wrongly `patched` version `1.1.6` that should have been a `minor` release.
|
|
245
|
+
- [#17576](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/17576) [`2e42aa0d900`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e42aa0d900) - **Note**: It is a re-release of the wrongly `patched` version `1.1.6` that should have been a `minor` release.
|
|
234
246
|
|
|
235
247
|
Expose `fallbackPlacement` modifier from to specify a list of fallback options to try incase there isn't enough space
|
|
236
248
|
|
|
@@ -242,7 +254,7 @@
|
|
|
242
254
|
|
|
243
255
|
### Minor Changes
|
|
244
256
|
|
|
245
|
-
- [`c2dd770a743`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2dd770a743) - Add new prop which controls is outside click should be bound using capture
|
|
257
|
+
- [#16960](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/16960) [`c2dd770a743`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c2dd770a743) - Add new prop which controls is outside click should be bound using capture
|
|
246
258
|
|
|
247
259
|
## 1.1.6
|
|
248
260
|
|
|
@@ -250,7 +262,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
250
262
|
|
|
251
263
|
### Minor Changes
|
|
252
264
|
|
|
253
|
-
- [`f142150a3e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f142150a3e8) - Expose `fallbackPlacement` modifier from to specify a list of fallback options to try incase there isn't enough space
|
|
265
|
+
- [#15998](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/15998) [`f142150a3e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f142150a3e8) - Expose `fallbackPlacement` modifier from to specify a list of fallback options to try incase there isn't enough space
|
|
254
266
|
|
|
255
267
|
### Patch Changes
|
|
256
268
|
|
|
@@ -291,7 +303,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
291
303
|
|
|
292
304
|
### Minor Changes
|
|
293
305
|
|
|
294
|
-
- [`04cf9c3d28c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04cf9c3d28c) - [ux] Colors now sourced from tokens.
|
|
306
|
+
- [#12837](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12837) [`04cf9c3d28c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/04cf9c3d28c) - [ux] Colors now sourced from tokens.
|
|
295
307
|
|
|
296
308
|
### Patch Changes
|
|
297
309
|
|
|
@@ -301,31 +313,31 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
301
313
|
|
|
302
314
|
### Patch Changes
|
|
303
315
|
|
|
304
|
-
- [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
316
|
+
- [#12880](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12880) [`378d1cef00f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/378d1cef00f) - Bump `@atlaskit/theme` to version `^11.3.0`.
|
|
305
317
|
|
|
306
318
|
## 1.0.7
|
|
307
319
|
|
|
308
320
|
### Patch Changes
|
|
309
321
|
|
|
310
|
-
- [`d6f7ff383cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f7ff383cf) - Updates to development dependency `storybook-addon-performance`
|
|
322
|
+
- [#12167](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/12167) [`d6f7ff383cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d6f7ff383cf) - Updates to development dependency `storybook-addon-performance`
|
|
311
323
|
|
|
312
324
|
## 1.0.6
|
|
313
325
|
|
|
314
326
|
### Patch Changes
|
|
315
327
|
|
|
316
|
-
- [`1858f20ac3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1858f20ac3) - Optimised popup performance as part of the lite-mode project. Changes are internal and have no implications for component API or usage.
|
|
328
|
+
- [#6930](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/6930) [`1858f20ac3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1858f20ac3) - Optimised popup performance as part of the lite-mode project. Changes are internal and have no implications for component API or usage.
|
|
317
329
|
|
|
318
330
|
## 1.0.5
|
|
319
331
|
|
|
320
332
|
### Patch Changes
|
|
321
333
|
|
|
322
|
-
- [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
334
|
+
- [#5857](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5857) [`d3265f19be`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3265f19be) - Transpile packages using babel rather than tsc
|
|
323
335
|
|
|
324
336
|
## 1.0.4
|
|
325
337
|
|
|
326
338
|
### Patch Changes
|
|
327
339
|
|
|
328
|
-
- [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
340
|
+
- [#5497](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/5497) [`5f58283e1f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5f58283e1f) - Export types using Typescript's new "export type" syntax to satisfy Typescript's --isolatedModules compiler option.
|
|
329
341
|
This requires version 3.8 of Typescript, read more about how we handle Typescript versions here: https://atlaskit.atlassian.com/get-started
|
|
330
342
|
Also add `typescript` to `devDependencies` to denote version that the package was built with.
|
|
331
343
|
|
|
@@ -339,13 +351,13 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
339
351
|
|
|
340
352
|
### Patch Changes
|
|
341
353
|
|
|
342
|
-
- [`fc8f6e61f3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc8f6e61f3) - Fix codemod utilities being exposed through the codemod cli
|
|
354
|
+
- [#4346](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4346) [`fc8f6e61f3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fc8f6e61f3) - Fix codemod utilities being exposed through the codemod cli
|
|
343
355
|
|
|
344
356
|
## 1.0.1
|
|
345
357
|
|
|
346
358
|
### Patch Changes
|
|
347
359
|
|
|
348
|
-
- [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
360
|
+
- [#3885](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3885) [`6c525a8229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6c525a8229) - Upgraded to TypeScript 3.9.6 and tslib to 2.0.0
|
|
349
361
|
|
|
350
362
|
Since tslib is a dependency for all our packages we recommend that products also follow this tslib upgrade
|
|
351
363
|
to prevent duplicates of tslib being bundled.
|
|
@@ -354,7 +366,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
354
366
|
|
|
355
367
|
### Major Changes
|
|
356
368
|
|
|
357
|
-
- [`740e011f8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/740e011f8d) - This first major release of popup brings in major changes from @atlaskit/popper. These changes come with performance, maintainability and behavioral improvements.
|
|
369
|
+
- [#3823](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3823) [`740e011f8d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/740e011f8d) - This first major release of popup brings in major changes from @atlaskit/popper. These changes come with performance, maintainability and behavioral improvements.
|
|
358
370
|
|
|
359
371
|
As popup wraps popper's functionality, these changes result in a breaking change for popup as well.
|
|
360
372
|
|
|
@@ -386,7 +398,7 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
386
398
|
`npx @atlaskit/codemod-cli --parser [PARSER] --extensions [FILE_EXTENSIONS] [TARGET_PATH]`
|
|
387
399
|
|
|
388
400
|
Or run `npx @atlaskit/codemod-cli -h` for more details on usage.
|
|
389
|
-
For Atlassians, refer to [this doc](https://
|
|
401
|
+
For Atlassians, refer to [this doc](https://hello.atlassian.net/wiki/spaces/AF/pages/2627171992/Codemods) for more details on the codemod CLI.
|
|
390
402
|
|
|
391
403
|
### Patch Changes
|
|
392
404
|
|
|
@@ -396,13 +408,13 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
396
408
|
|
|
397
409
|
### Patch Changes
|
|
398
410
|
|
|
399
|
-
- [`8dd80245bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8dd80245bb) - Remove unnecessary code for IE11.
|
|
411
|
+
- [#4329](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/4329) [`8dd80245bb`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8dd80245bb) - Remove unnecessary code for IE11.
|
|
400
412
|
|
|
401
413
|
## 0.6.0
|
|
402
414
|
|
|
403
415
|
### Minor Changes
|
|
404
416
|
|
|
405
|
-
- [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
417
|
+
- [#3335](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3335) [`87f4720f27`](https://bitbucket.org/atlassian/atlassian-frontend/commits/87f4720f27) - Officially dropping IE11 support, from this version onwards there are no warranties of the package working in IE11.
|
|
406
418
|
For more information see: https://community.developer.atlassian.com/t/atlaskit-to-drop-support-for-internet-explorer-11-from-1st-july-2020/39534
|
|
407
419
|
|
|
408
420
|
### Patch Changes
|
|
@@ -413,31 +425,31 @@ _WRONG RELEASE TYPE - DON'T USE_
|
|
|
413
425
|
|
|
414
426
|
### Minor Changes
|
|
415
427
|
|
|
416
|
-
- [`ebcb467688`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ebcb467688) - Add a new prop `autoFocus` to allow consumers to control whether the Popup takes focus when opened
|
|
428
|
+
- [#3289](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/3289) [`ebcb467688`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ebcb467688) - Add a new prop `autoFocus` to allow consumers to control whether the Popup takes focus when opened
|
|
417
429
|
|
|
418
430
|
## 0.4.3
|
|
419
431
|
|
|
420
432
|
### Patch Changes
|
|
421
433
|
|
|
422
|
-
- [`54a9514fcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54a9514fcf) - Build and supporting files will no longer be published to npm
|
|
434
|
+
- [#2866](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2866) [`54a9514fcf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/54a9514fcf) - Build and supporting files will no longer be published to npm
|
|
423
435
|
|
|
424
436
|
## 0.4.2
|
|
425
437
|
|
|
426
438
|
### Patch Changes
|
|
427
439
|
|
|
428
|
-
- [`649f69b6d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/649f69b6d7) - Patch all packages that are used by confluence that have a broken es2019 dist
|
|
440
|
+
- [#2430](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2430) [`649f69b6d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/649f69b6d7) - Patch all packages that are used by confluence that have a broken es2019 dist
|
|
429
441
|
|
|
430
442
|
## 0.4.1
|
|
431
443
|
|
|
432
444
|
### Patch Changes
|
|
433
445
|
|
|
434
|
-
- [`f4d4de67e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4d4de67e4) - Prevent closing of popup when clicked element (which is inside content) is removed from the DOM
|
|
446
|
+
- [#2186](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2186) [`f4d4de67e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f4d4de67e4) - Prevent closing of popup when clicked element (which is inside content) is removed from the DOM
|
|
435
447
|
|
|
436
448
|
## 0.4.0
|
|
437
449
|
|
|
438
450
|
### Minor Changes
|
|
439
451
|
|
|
440
|
-
- [`ead13374cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ead13374cf) - **BREAKING:** Removes `tag` prop and unneeded wrapping element around the trigger.
|
|
452
|
+
- [#2060](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/2060) [`ead13374cf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ead13374cf) - **BREAKING:** Removes `tag` prop and unneeded wrapping element around the trigger.
|
|
441
453
|
|
|
442
454
|
## 0.3.5
|
|
443
455
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -12,5 +12,4 @@ Object.defineProperty(exports, "Popup", {
|
|
|
12
12
|
exports.default = void 0;
|
|
13
13
|
var _popup = require("./popup");
|
|
14
14
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
15
|
-
var _default = _popup.Popup;
|
|
16
|
-
exports.default = _default;
|
|
15
|
+
var _default = exports.default = _popup.Popup;
|
package/dist/cjs/popup.js
CHANGED
|
@@ -17,7 +17,7 @@ var _popperWrapper = _interopRequireDefault(require("./popper-wrapper"));
|
|
|
17
17
|
/** @jsx jsx */
|
|
18
18
|
|
|
19
19
|
var defaultLayer = _constants.layers.layer();
|
|
20
|
-
var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
20
|
+
var Popup = exports.Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
21
21
|
var isOpen = _ref.isOpen,
|
|
22
22
|
id = _ref.id,
|
|
23
23
|
offset = _ref.offset,
|
|
@@ -85,6 +85,4 @@ var Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
|
|
85
85
|
zIndex: zIndex
|
|
86
86
|
}, renderPopperWrapper)));
|
|
87
87
|
});
|
|
88
|
-
exports.
|
|
89
|
-
var _default = Popup;
|
|
90
|
-
exports.default = _default;
|
|
88
|
+
var _default = exports.default = Popup;
|
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
10
10
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
11
11
|
// eslint-disable-next-line @repo/internal/react/require-jsdoc
|
|
12
|
-
var RepositionOnUpdate = function RepositionOnUpdate(_ref) {
|
|
12
|
+
var RepositionOnUpdate = exports.RepositionOnUpdate = function RepositionOnUpdate(_ref) {
|
|
13
13
|
var children = _ref.children,
|
|
14
14
|
update = _ref.update;
|
|
15
15
|
// Ref used here to skip update on first render (when refs haven't been set)
|
|
@@ -25,5 +25,4 @@ var RepositionOnUpdate = function RepositionOnUpdate(_ref) {
|
|
|
25
25
|
|
|
26
26
|
// wrapping in fragment to make TS happy (known issue with FC returning children)
|
|
27
27
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children);
|
|
28
|
-
};
|
|
29
|
-
exports.RepositionOnUpdate = RepositionOnUpdate;
|
|
28
|
+
};
|
|
@@ -9,7 +9,7 @@ var _react = require("react");
|
|
|
9
9
|
var _bindEventListener = require("bind-event-listener");
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
11
|
var _layering = require("@atlaskit/layering");
|
|
12
|
-
var useCloseManager = function useCloseManager(_ref) {
|
|
12
|
+
var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
|
|
13
13
|
var isOpen = _ref.isOpen,
|
|
14
14
|
onClose = _ref.onClose,
|
|
15
15
|
popupRef = _ref.popupRef,
|
|
@@ -67,5 +67,4 @@ var useCloseManager = function useCloseManager(_ref) {
|
|
|
67
67
|
}]);
|
|
68
68
|
return unbind;
|
|
69
69
|
}, [isOpen, onClose, popupRef, triggerRef, capture, isLayerDisabled]);
|
|
70
|
-
};
|
|
71
|
-
exports.useCloseManager = useCloseManager;
|
|
70
|
+
};
|
|
@@ -8,34 +8,55 @@ exports.useFocusManager = void 0;
|
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _focusTrap = _interopRequireDefault(require("focus-trap"));
|
|
10
10
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
|
+
var useFocusManager = exports.useFocusManager = function useFocusManager(_ref) {
|
|
13
|
+
var initialFocusRef = _ref.initialFocusRef,
|
|
14
|
+
popupRef = _ref.popupRef;
|
|
14
15
|
(0, _react.useEffect)(function () {
|
|
15
16
|
if (!popupRef) {
|
|
16
17
|
return _noop.default;
|
|
17
18
|
}
|
|
18
|
-
var
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
var previouslyFocusedElement;
|
|
20
|
+
var focusTrap;
|
|
21
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
22
|
+
previouslyFocusedElement = document.activeElement;
|
|
23
|
+
} else {
|
|
24
|
+
var trapConfig = {
|
|
25
|
+
clickOutsideDeactivates: true,
|
|
26
|
+
escapeDeactivates: true,
|
|
27
|
+
initialFocus: initialFocusRef || popupRef,
|
|
28
|
+
fallbackFocus: popupRef,
|
|
29
|
+
returnFocusOnDeactivate: true
|
|
30
|
+
};
|
|
31
|
+
focusTrap = (0, _focusTrap.default)(popupRef, trapConfig);
|
|
32
|
+
}
|
|
33
|
+
var frameId = null;
|
|
26
34
|
|
|
27
35
|
// wait for the popup to reposition itself before we focus
|
|
28
|
-
|
|
36
|
+
frameId = requestAnimationFrame(function () {
|
|
29
37
|
frameId = null;
|
|
30
|
-
|
|
38
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
39
|
+
if (initialFocusRef && initialFocusRef.focus) {
|
|
40
|
+
initialFocusRef.focus();
|
|
41
|
+
} else {
|
|
42
|
+
popupRef.focus();
|
|
43
|
+
}
|
|
44
|
+
} else {
|
|
45
|
+
focusTrap.activate();
|
|
46
|
+
}
|
|
31
47
|
});
|
|
32
48
|
return function () {
|
|
33
49
|
if (frameId != null) {
|
|
34
50
|
cancelAnimationFrame(frameId);
|
|
35
51
|
frameId = null;
|
|
36
52
|
}
|
|
37
|
-
|
|
53
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
54
|
+
if (previouslyFocusedElement && previouslyFocusedElement.focus) {
|
|
55
|
+
previouslyFocusedElement.focus();
|
|
56
|
+
}
|
|
57
|
+
} else {
|
|
58
|
+
focusTrap.deactivate();
|
|
59
|
+
}
|
|
38
60
|
};
|
|
39
61
|
}, [popupRef, initialFocusRef]);
|
|
40
|
-
};
|
|
41
|
-
exports.useFocusManager = useFocusManager;
|
|
62
|
+
};
|
|
@@ -1,34 +1,56 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import createFocusTrap from 'focus-trap';
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
export const useFocusManager = ({
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
initialFocusRef,
|
|
7
|
+
popupRef
|
|
7
8
|
}) => {
|
|
8
9
|
useEffect(() => {
|
|
9
10
|
if (!popupRef) {
|
|
10
11
|
return noop;
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
let previouslyFocusedElement;
|
|
14
|
+
let focusTrap;
|
|
15
|
+
if (getBooleanFF('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
16
|
+
previouslyFocusedElement = document.activeElement;
|
|
17
|
+
} else {
|
|
18
|
+
const trapConfig = {
|
|
19
|
+
clickOutsideDeactivates: true,
|
|
20
|
+
escapeDeactivates: true,
|
|
21
|
+
initialFocus: initialFocusRef || popupRef,
|
|
22
|
+
fallbackFocus: popupRef,
|
|
23
|
+
returnFocusOnDeactivate: true
|
|
24
|
+
};
|
|
25
|
+
focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
26
|
+
}
|
|
27
|
+
let frameId = null;
|
|
20
28
|
|
|
21
29
|
// wait for the popup to reposition itself before we focus
|
|
22
|
-
|
|
30
|
+
frameId = requestAnimationFrame(() => {
|
|
23
31
|
frameId = null;
|
|
24
|
-
|
|
32
|
+
if (getBooleanFF('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
33
|
+
if (initialFocusRef && initialFocusRef.focus) {
|
|
34
|
+
initialFocusRef.focus();
|
|
35
|
+
} else {
|
|
36
|
+
popupRef.focus();
|
|
37
|
+
}
|
|
38
|
+
} else {
|
|
39
|
+
focusTrap.activate();
|
|
40
|
+
}
|
|
25
41
|
});
|
|
26
42
|
return () => {
|
|
27
43
|
if (frameId != null) {
|
|
28
44
|
cancelAnimationFrame(frameId);
|
|
29
45
|
frameId = null;
|
|
30
46
|
}
|
|
31
|
-
|
|
47
|
+
if (getBooleanFF('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
48
|
+
if (previouslyFocusedElement && previouslyFocusedElement.focus) {
|
|
49
|
+
previouslyFocusedElement.focus();
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
focusTrap.deactivate();
|
|
53
|
+
}
|
|
32
54
|
};
|
|
33
55
|
}, [popupRef, initialFocusRef]);
|
|
34
56
|
};
|
|
@@ -1,33 +1,55 @@
|
|
|
1
1
|
import { useEffect } from 'react';
|
|
2
2
|
import createFocusTrap from 'focus-trap';
|
|
3
3
|
import noop from '@atlaskit/ds-lib/noop';
|
|
4
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
export var useFocusManager = function useFocusManager(_ref) {
|
|
5
|
-
var
|
|
6
|
-
|
|
6
|
+
var initialFocusRef = _ref.initialFocusRef,
|
|
7
|
+
popupRef = _ref.popupRef;
|
|
7
8
|
useEffect(function () {
|
|
8
9
|
if (!popupRef) {
|
|
9
10
|
return noop;
|
|
10
11
|
}
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
var previouslyFocusedElement;
|
|
13
|
+
var focusTrap;
|
|
14
|
+
if (getBooleanFF('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
15
|
+
previouslyFocusedElement = document.activeElement;
|
|
16
|
+
} else {
|
|
17
|
+
var trapConfig = {
|
|
18
|
+
clickOutsideDeactivates: true,
|
|
19
|
+
escapeDeactivates: true,
|
|
20
|
+
initialFocus: initialFocusRef || popupRef,
|
|
21
|
+
fallbackFocus: popupRef,
|
|
22
|
+
returnFocusOnDeactivate: true
|
|
23
|
+
};
|
|
24
|
+
focusTrap = createFocusTrap(popupRef, trapConfig);
|
|
25
|
+
}
|
|
26
|
+
var frameId = null;
|
|
19
27
|
|
|
20
28
|
// wait for the popup to reposition itself before we focus
|
|
21
|
-
|
|
29
|
+
frameId = requestAnimationFrame(function () {
|
|
22
30
|
frameId = null;
|
|
23
|
-
|
|
31
|
+
if (getBooleanFF('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
32
|
+
if (initialFocusRef && initialFocusRef.focus) {
|
|
33
|
+
initialFocusRef.focus();
|
|
34
|
+
} else {
|
|
35
|
+
popupRef.focus();
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
focusTrap.activate();
|
|
39
|
+
}
|
|
24
40
|
});
|
|
25
41
|
return function () {
|
|
26
42
|
if (frameId != null) {
|
|
27
43
|
cancelAnimationFrame(frameId);
|
|
28
44
|
frameId = null;
|
|
29
45
|
}
|
|
30
|
-
|
|
46
|
+
if (getBooleanFF('platform.design-system-team.remove-focus-trap-from-popup_3q7sk')) {
|
|
47
|
+
if (previouslyFocusedElement && previouslyFocusedElement.focus) {
|
|
48
|
+
previouslyFocusedElement.focus();
|
|
49
|
+
}
|
|
50
|
+
} else {
|
|
51
|
+
focusTrap.deactivate();
|
|
52
|
+
}
|
|
31
53
|
};
|
|
32
54
|
}, [popupRef, initialFocusRef]);
|
|
33
55
|
};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -168,8 +168,8 @@ export type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
|
|
|
168
168
|
shouldUseCaptureOnOutsideClick?: boolean;
|
|
169
169
|
};
|
|
170
170
|
export type FocusManagerHook = {
|
|
171
|
-
popupRef: PopupRef;
|
|
172
171
|
initialFocusRef: HTMLElement | null;
|
|
172
|
+
popupRef: PopupRef;
|
|
173
173
|
};
|
|
174
174
|
export type RepositionOnUpdateProps = {
|
|
175
175
|
update: PopperChildrenProps['update'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FocusManagerHook } from './types';
|
|
2
|
-
export declare const useFocusManager: ({
|
|
2
|
+
export declare const useFocusManager: ({ initialFocusRef, popupRef, }: FocusManagerHook) => void;
|
|
@@ -171,8 +171,8 @@ export type CloseManagerHook = Pick<PopupProps, 'isOpen' | 'onClose'> & {
|
|
|
171
171
|
shouldUseCaptureOnOutsideClick?: boolean;
|
|
172
172
|
};
|
|
173
173
|
export type FocusManagerHook = {
|
|
174
|
-
popupRef: PopupRef;
|
|
175
174
|
initialFocusRef: HTMLElement | null;
|
|
175
|
+
popupRef: PopupRef;
|
|
176
176
|
};
|
|
177
177
|
export type RepositionOnUpdateProps = {
|
|
178
178
|
update: PopperChildrenProps['update'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FocusManagerHook } from './types';
|
|
2
|
-
export declare const useFocusManager: ({
|
|
2
|
+
export declare const useFocusManager: ({ initialFocusRef, popupRef, }: FocusManagerHook) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/popup",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "A popup displays brief content in an overlay.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,10 +37,11 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
39
39
|
"@atlaskit/layering": "^0.2.0",
|
|
40
|
+
"@atlaskit/platform-feature-flags": "*",
|
|
40
41
|
"@atlaskit/popper": "^5.5.0",
|
|
41
42
|
"@atlaskit/portal": "^4.3.0",
|
|
42
43
|
"@atlaskit/theme": "^12.6.0",
|
|
43
|
-
"@atlaskit/tokens": "^1.
|
|
44
|
+
"@atlaskit/tokens": "^1.26.0",
|
|
44
45
|
"@babel/runtime": "^7.0.0",
|
|
45
46
|
"@emotion/react": "^11.7.1",
|
|
46
47
|
"bind-event-listener": "^2.1.1",
|
|
@@ -94,5 +95,10 @@
|
|
|
94
95
|
}
|
|
95
96
|
},
|
|
96
97
|
"homepage": "https://atlassian.design/components/popup/",
|
|
97
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
98
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
99
|
+
"platform-feature-flags": {
|
|
100
|
+
"platform.design-system-team.remove-focus-trap-from-popup_3q7sk": {
|
|
101
|
+
"type": "boolean"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
98
104
|
}
|