@atlaskit/popup 4.26.0 → 5.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,36 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 5.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - [`f2dc9097319f0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f2dc9097319f0) - ###
8
+ Dropped support for _legacy_ Typescript 4 types. **Typescript 5 is now the new minimum**.
9
+
10
+ Removes the `typesVersions` property and `dist/types-ts4.5` directory from the dist.
11
+
12
+ Types are now exclusively via the `"types": "dist/types/index.d.ts"` property.
13
+
14
+ ```diff
15
+ - "typesVersions": {
16
+ - ">=4.5 <4.9": {
17
+ - "*": [
18
+ - "dist/types-ts4.5/*",
19
+ - "dist/types-ts4.5/index.d.ts"
20
+ - ]
21
+ - }
22
+ - },
23
+ ```
24
+
25
+ ### Minor Changes
26
+
27
+ - [`2e61d5c836f8f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e61d5c836f8f) -
28
+ Internal cleanup of open-layer observer registration in the top-layer Popup adapters.
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies
33
+
3
34
  ## 4.26.0
4
35
 
5
36
  ### Minor Changes
@@ -13,7 +13,6 @@ var React = _react;
13
13
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
14
  var _runtime = require("@compiled/react/runtime");
15
15
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
16
- var _openLayerObserver = require("@atlaskit/layering/experimental/open-layer-observer");
17
16
  var _animations = require("@atlaskit/top-layer/animations");
18
17
  var _placementMap = require("@atlaskit/top-layer/placement-map");
19
18
  var _popover = require("@atlaskit/top-layer/popover");
@@ -183,33 +182,6 @@ function PopupContentTopLayer(_ref) {
183
182
  isOpen: isOpen
184
183
  });
185
184
 
186
- /**
187
- * Register with the open-layer observer as a `popup` while open.
188
- *
189
- * The legacy compositional `PopupContent` registered every open
190
- * popup with the observer regardless of role, and product surfaces
191
- * such as the side-nav panel splitter rely on this signal to detect
192
- * open popups via `getCount({ type: 'popup' }) > 0`. The underlying
193
- * top-layer `Popover` only self-registers when its role is one of
194
- * `menu | listbox | dialog | alertdialog | tree | grid`, which would
195
- * miss role-less popups and silently regress the splitter.
196
- *
197
- * Registering here unconditionally preserves the legacy contract.
198
- * When the role does opt the `Popover` into observer registration
199
- * the count is incremented twice, which is safe because every known
200
- * consumer treats the count as a boolean (`> 0` / `=== 0`).
201
- */
202
- var handleObserverClose = (0, _react.useCallback)(function () {
203
- onClose === null || onClose === void 0 || onClose((0, _popover.createPopoverCloseEvent)({
204
- reason: 'programmatic'
205
- }));
206
- }, [onClose]);
207
- (0, _openLayerObserver.useNotifyOpenLayerObserver)({
208
- type: 'popup',
209
- isOpen: isOpen,
210
- onClose: handleObserverClose
211
- });
212
-
213
185
  // Narrow to ForwardRefExoticComponent so JSX accepts the ref prop.
214
186
  // All popupComponent implementations use forwardRef per the PopupComponentProps contract.
215
187
  var Container = PopupContainer;
@@ -13,7 +13,6 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
16
- var _openLayerObserver = require("@atlaskit/layering/experimental/open-layer-observer");
17
16
  var _animations = require("@atlaskit/top-layer/animations");
18
17
  var _getAriaForTrigger = require("@atlaskit/top-layer/get-aria-for-trigger");
19
18
  var _placementMap = require("@atlaskit/top-layer/placement-map");
@@ -164,33 +163,6 @@ var PopupTopLayer = exports.PopupTopLayer = /*#__PURE__*/(0, _react.memo)(functi
164
163
  isOpen: isOpen
165
164
  });
166
165
 
167
- /**
168
- * Register with the open-layer observer as a `popup` while open.
169
- *
170
- * The legacy `Popup` registered every open popup with the observer
171
- * regardless of role, and product surfaces such as the side-nav
172
- * panel splitter rely on this signal to detect open popups via
173
- * `getCount({ type: 'popup' }) > 0`. The underlying top-layer
174
- * `Popover` only self-registers when its role is one of
175
- * `menu | listbox | dialog | alertdialog | tree | grid`, which would
176
- * miss role-less popups and silently regress the splitter.
177
- *
178
- * Registering here unconditionally preserves the legacy contract.
179
- * When the role does opt the `Popover` into observer registration
180
- * the count is incremented twice, which is safe because every known
181
- * consumer treats the count as a boolean (`> 0` / `=== 0`).
182
- */
183
- var handleObserverClose = (0, _react.useCallback)(function () {
184
- onClose === null || onClose === void 0 || onClose((0, _popover.createPopoverCloseEvent)({
185
- reason: 'programmatic'
186
- }));
187
- }, [onClose]);
188
- (0, _openLayerObserver.useNotifyOpenLayerObserver)({
189
- type: 'popup',
190
- isOpen: isOpen,
191
- onClose: handleObserverClose
192
- });
193
-
194
166
  // onClose bridge.
195
167
  // Translates top-layer's { reason: TPopoverCloseReason } into legacy
196
168
  // onClose(event, currentLevel?) by synthesizing DOM events.
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
6
6
  import { ax, ix } from '@compiled/react/runtime';
7
7
  import noop from '@atlaskit/ds-lib/noop';
8
- import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
9
8
  import { popupMotion } from '@atlaskit/top-layer/animations';
10
9
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map';
11
10
  import { createPopoverCloseEvent, Popover } from '@atlaskit/top-layer/popover';
@@ -191,33 +190,6 @@ export function PopupContentTopLayer({
191
190
  isOpen
192
191
  });
193
192
 
194
- /**
195
- * Register with the open-layer observer as a `popup` while open.
196
- *
197
- * The legacy compositional `PopupContent` registered every open
198
- * popup with the observer regardless of role, and product surfaces
199
- * such as the side-nav panel splitter rely on this signal to detect
200
- * open popups via `getCount({ type: 'popup' }) > 0`. The underlying
201
- * top-layer `Popover` only self-registers when its role is one of
202
- * `menu | listbox | dialog | alertdialog | tree | grid`, which would
203
- * miss role-less popups and silently regress the splitter.
204
- *
205
- * Registering here unconditionally preserves the legacy contract.
206
- * When the role does opt the `Popover` into observer registration
207
- * the count is incremented twice, which is safe because every known
208
- * consumer treats the count as a boolean (`> 0` / `=== 0`).
209
- */
210
- const handleObserverClose = useCallback(() => {
211
- onClose === null || onClose === void 0 ? void 0 : onClose(createPopoverCloseEvent({
212
- reason: 'programmatic'
213
- }));
214
- }, [onClose]);
215
- useNotifyOpenLayerObserver({
216
- type: 'popup',
217
- isOpen,
218
- onClose: handleObserverClose
219
- });
220
-
221
193
  // Narrow to ForwardRefExoticComponent so JSX accepts the ref prop.
222
194
  // All popupComponent implementations use forwardRef per the PopupComponentProps contract.
223
195
  const Container = PopupContainer;
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { Fragment, memo, useCallback, useEffect, useMemo, useRef } from 'react';
7
7
  import noop from '@atlaskit/ds-lib/noop';
8
- import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
9
8
  import { popupMotion } from '@atlaskit/top-layer/animations';
10
9
  import { getAriaForTrigger } from '@atlaskit/top-layer/get-aria-for-trigger';
11
10
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map';
@@ -175,33 +174,6 @@ export const PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer({
175
174
  isOpen
176
175
  });
177
176
 
178
- /**
179
- * Register with the open-layer observer as a `popup` while open.
180
- *
181
- * The legacy `Popup` registered every open popup with the observer
182
- * regardless of role, and product surfaces such as the side-nav
183
- * panel splitter rely on this signal to detect open popups via
184
- * `getCount({ type: 'popup' }) > 0`. The underlying top-layer
185
- * `Popover` only self-registers when its role is one of
186
- * `menu | listbox | dialog | alertdialog | tree | grid`, which would
187
- * miss role-less popups and silently regress the splitter.
188
- *
189
- * Registering here unconditionally preserves the legacy contract.
190
- * When the role does opt the `Popover` into observer registration
191
- * the count is incremented twice, which is safe because every known
192
- * consumer treats the count as a boolean (`> 0` / `=== 0`).
193
- */
194
- const handleObserverClose = useCallback(() => {
195
- onClose === null || onClose === void 0 ? void 0 : onClose(createPopoverCloseEvent({
196
- reason: 'programmatic'
197
- }));
198
- }, [onClose]);
199
- useNotifyOpenLayerObserver({
200
- type: 'popup',
201
- isOpen,
202
- onClose: handleObserverClose
203
- });
204
-
205
177
  // onClose bridge.
206
178
  // Translates top-layer's { reason: TPopoverCloseReason } into legacy
207
179
  // onClose(event, currentLevel?) by synthesizing DOM events.
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import { useCallback, useContext, useEffect, useMemo, useRef } from 'react';
6
6
  import { ax, ix } from '@compiled/react/runtime';
7
7
  import noop from '@atlaskit/ds-lib/noop';
8
- import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
9
8
  import { popupMotion } from '@atlaskit/top-layer/animations';
10
9
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map';
11
10
  import { createPopoverCloseEvent, Popover } from '@atlaskit/top-layer/popover';
@@ -174,33 +173,6 @@ export function PopupContentTopLayer(_ref) {
174
173
  isOpen: isOpen
175
174
  });
176
175
 
177
- /**
178
- * Register with the open-layer observer as a `popup` while open.
179
- *
180
- * The legacy compositional `PopupContent` registered every open
181
- * popup with the observer regardless of role, and product surfaces
182
- * such as the side-nav panel splitter rely on this signal to detect
183
- * open popups via `getCount({ type: 'popup' }) > 0`. The underlying
184
- * top-layer `Popover` only self-registers when its role is one of
185
- * `menu | listbox | dialog | alertdialog | tree | grid`, which would
186
- * miss role-less popups and silently regress the splitter.
187
- *
188
- * Registering here unconditionally preserves the legacy contract.
189
- * When the role does opt the `Popover` into observer registration
190
- * the count is incremented twice, which is safe because every known
191
- * consumer treats the count as a boolean (`> 0` / `=== 0`).
192
- */
193
- var handleObserverClose = useCallback(function () {
194
- onClose === null || onClose === void 0 || onClose(createPopoverCloseEvent({
195
- reason: 'programmatic'
196
- }));
197
- }, [onClose]);
198
- useNotifyOpenLayerObserver({
199
- type: 'popup',
200
- isOpen: isOpen,
201
- onClose: handleObserverClose
202
- });
203
-
204
176
  // Narrow to ForwardRefExoticComponent so JSX accepts the ref prop.
205
177
  // All popupComponent implementations use forwardRef per the PopupComponentProps contract.
206
178
  var Container = PopupContainer;
@@ -5,7 +5,6 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { Fragment, memo, useCallback, useEffect, useMemo, useRef } from 'react';
7
7
  import noop from '@atlaskit/ds-lib/noop';
8
- import { useNotifyOpenLayerObserver } from '@atlaskit/layering/experimental/open-layer-observer';
9
8
  import { popupMotion } from '@atlaskit/top-layer/animations';
10
9
  import { getAriaForTrigger } from '@atlaskit/top-layer/get-aria-for-trigger';
11
10
  import { fromLegacyPlacement } from '@atlaskit/top-layer/placement-map';
@@ -155,33 +154,6 @@ export var PopupTopLayer = /*#__PURE__*/memo(function PopupTopLayer(_ref) {
155
154
  isOpen: isOpen
156
155
  });
157
156
 
158
- /**
159
- * Register with the open-layer observer as a `popup` while open.
160
- *
161
- * The legacy `Popup` registered every open popup with the observer
162
- * regardless of role, and product surfaces such as the side-nav
163
- * panel splitter rely on this signal to detect open popups via
164
- * `getCount({ type: 'popup' }) > 0`. The underlying top-layer
165
- * `Popover` only self-registers when its role is one of
166
- * `menu | listbox | dialog | alertdialog | tree | grid`, which would
167
- * miss role-less popups and silently regress the splitter.
168
- *
169
- * Registering here unconditionally preserves the legacy contract.
170
- * When the role does opt the `Popover` into observer registration
171
- * the count is incremented twice, which is safe because every known
172
- * consumer treats the count as a boolean (`> 0` / `=== 0`).
173
- */
174
- var handleObserverClose = useCallback(function () {
175
- onClose === null || onClose === void 0 || onClose(createPopoverCloseEvent({
176
- reason: 'programmatic'
177
- }));
178
- }, [onClose]);
179
- useNotifyOpenLayerObserver({
180
- type: 'popup',
181
- isOpen: isOpen,
182
- onClose: handleObserverClose
183
- });
184
-
185
157
  // onClose bridge.
186
158
  // Translates top-layer's { reason: TPopoverCloseReason } into legacy
187
159
  // onClose(event, currentLevel?) by synthesizing DOM events.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "4.26.0",
3
+ "version": "5.0.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": [
24
16
  "**/*.compiled.css"
25
17
  ],
@@ -39,16 +31,16 @@
39
31
  }
40
32
  },
41
33
  "dependencies": {
42
- "@atlaskit/css": "^0.19.0",
43
- "@atlaskit/ds-lib": "^7.0.0",
44
- "@atlaskit/layering": "^3.8.0",
45
- "@atlaskit/motion": "^6.2.0",
46
- "@atlaskit/platform-feature-flags": "^1.1.0",
47
- "@atlaskit/popper": "^7.2.0",
48
- "@atlaskit/portal": "^5.5.0",
49
- "@atlaskit/primitives": "^19.0.0",
50
- "@atlaskit/tokens": "^13.4.0",
51
- "@atlaskit/top-layer": "^0.18.0",
34
+ "@atlaskit/css": "^1.0.0",
35
+ "@atlaskit/ds-lib": "^8.0.0",
36
+ "@atlaskit/layering": "^4.0.0",
37
+ "@atlaskit/motion": "^7.0.0",
38
+ "@atlaskit/platform-feature-flags": "^2.0.0",
39
+ "@atlaskit/popper": "^8.0.0",
40
+ "@atlaskit/portal": "^6.0.0",
41
+ "@atlaskit/primitives": "^20.0.0",
42
+ "@atlaskit/tokens": "^14.0.0",
43
+ "@atlaskit/top-layer": "^1.0.0",
52
44
  "@babel/runtime": "^7.0.0",
53
45
  "@compiled/react": "^0.20.0",
54
46
  "bind-event-listener": "^3.0.0",
@@ -64,17 +56,17 @@
64
56
  "@af/accessibility-testing": "workspace:^",
65
57
  "@af/integration-testing": "workspace:^",
66
58
  "@af/visual-regression": "workspace:^",
67
- "@atlaskit/button": "^23.11.0",
68
- "@atlaskit/code": "^17.5.0",
69
- "@atlaskit/docs": "^11.8.0",
70
- "@atlaskit/form": "^15.5.0",
71
- "@atlaskit/heading": "^5.4.0",
72
- "@atlaskit/icon": "^35.4.0",
73
- "@atlaskit/link": "^3.4.0",
74
- "@atlaskit/modal-dialog": "^15.3.0",
75
- "@atlaskit/section-message": "^8.13.0",
76
- "@atlaskit/textfield": "^8.3.0",
77
- "@atlaskit/toggle": "^16.1.0",
59
+ "@atlaskit/button": "^24.0.0",
60
+ "@atlaskit/code": "^18.0.0",
61
+ "@atlaskit/docs": "^12.0.0",
62
+ "@atlaskit/form": "^16.0.0",
63
+ "@atlaskit/heading": "^6.0.0",
64
+ "@atlaskit/icon": "^36.0.0",
65
+ "@atlaskit/link": "^4.0.0",
66
+ "@atlaskit/modal-dialog": "^16.0.0",
67
+ "@atlaskit/section-message": "^9.0.0",
68
+ "@atlaskit/textfield": "^9.0.0",
69
+ "@atlaskit/toggle": "^17.0.0",
78
70
  "@atlassian/feature-flags-test-utils": "^1.1.0",
79
71
  "@atlassian/react-compiler-gating": "workspace:^",
80
72
  "@atlassian/ssr-tests": "workspace:^",