@atlaskit/top-layer 6.2.3 → 6.2.4
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 +9 -0
- package/dist/cjs/dialog/dialog-content.js +4 -3
- package/dist/cjs/dialog-scroll-lock/index.js +2 -2
- package/dist/cjs/internal/use-anchored-popover-at-point.js +2 -1
- package/dist/cjs/internal/use-anchored-popover.js +2 -1
- package/dist/cjs/internal/use-animated-visibility.js +3 -2
- package/dist/cjs/popover/popover.js +4 -3
- package/dist/es2019/dialog/dialog-content.js +2 -1
- package/dist/es2019/dialog-scroll-lock/index.js +1 -1
- package/dist/es2019/internal/use-anchored-popover-at-point.js +2 -1
- package/dist/es2019/internal/use-anchored-popover.js +2 -1
- package/dist/es2019/internal/use-animated-visibility.js +2 -1
- package/dist/es2019/popover/popover.js +2 -1
- package/dist/esm/dialog/dialog-content.js +2 -1
- package/dist/esm/dialog-scroll-lock/index.js +1 -1
- package/dist/esm/internal/use-anchored-popover-at-point.js +2 -1
- package/dist/esm/internal/use-anchored-popover.js +2 -1
- package/dist/esm/internal/use-animated-visibility.js +2 -1
- package/dist/esm/popover/popover.js +2 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/top-layer
|
|
2
2
|
|
|
3
|
+
## 6.2.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`4247678302a95`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4247678302a95) -
|
|
8
|
+
Fixed server-side rendering errors and warnings in the top-layer popover, dialog and popper paths
|
|
9
|
+
(`platform-dst-top-layer`).
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 6.2.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -14,6 +14,7 @@ var _react2 = require("@compiled/react");
|
|
|
14
14
|
var _bindEventListener = require("bind-event-listener");
|
|
15
15
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
16
16
|
var _noop = _interopRequireDefault(require("@atlaskit/ds-lib/noop"));
|
|
17
|
+
var _useLayoutEffect = require("@atlaskit/ds-lib/use-layout-effect");
|
|
17
18
|
var _useNotifyOpenLayerObserver = require("@atlaskit/layering/use-notify-open-layer-observer");
|
|
18
19
|
var _useAnimatedVisibility = require("../internal/use-animated-visibility");
|
|
19
20
|
var _useFocusWrap = require("../internal/use-focus-wrap");
|
|
@@ -83,7 +84,7 @@ var Dialog = exports.Dialog = /*#__PURE__*/(0, _react.forwardRef)(function Dialo
|
|
|
83
84
|
var dismissedByRef = (0, _react.useRef)(dismissedBy);
|
|
84
85
|
var onCloseRef = (0, _react.useRef)(onClose);
|
|
85
86
|
// Keep native event handlers stable while ensuring they read the latest committed props.
|
|
86
|
-
(0,
|
|
87
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
87
88
|
dismissedByRef.current = dismissedBy;
|
|
88
89
|
onCloseRef.current = onClose;
|
|
89
90
|
}, [dismissedBy, onClose]);
|
|
@@ -102,7 +103,7 @@ var Dialog = exports.Dialog = /*#__PURE__*/(0, _react.forwardRef)(function Dialo
|
|
|
102
103
|
// Ordering is important: bind native lifecycle listeners before the later
|
|
103
104
|
// layout effect calls showModal() or close(), because `beforetoggle` fires
|
|
104
105
|
// synchronously during those calls.
|
|
105
|
-
(0,
|
|
106
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
106
107
|
if (!isMounted) {
|
|
107
108
|
return;
|
|
108
109
|
}
|
|
@@ -161,7 +162,7 @@ var Dialog = exports.Dialog = /*#__PURE__*/(0, _react.forwardRef)(function Dialo
|
|
|
161
162
|
// No-op: no current use case for programmatic close via OpenLayerObserver.
|
|
162
163
|
onClose: _noop.default
|
|
163
164
|
});
|
|
164
|
-
(0,
|
|
165
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
165
166
|
var dialog = ownRef.current;
|
|
166
167
|
if (!dialog) {
|
|
167
168
|
return;
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.DialogScrollLock = DialogScrollLock;
|
|
7
|
-
var _react = require("react");
|
|
8
7
|
var _browserApis = require("@atlaskit/browser-apis");
|
|
8
|
+
var _useLayoutEffect = require("@atlaskit/ds-lib/use-layout-effect");
|
|
9
9
|
/**
|
|
10
10
|
* __DialogScrollLock__
|
|
11
11
|
*
|
|
@@ -37,7 +37,7 @@ var _browserApis = require("@atlaskit/browser-apis");
|
|
|
37
37
|
*/
|
|
38
38
|
function DialogScrollLock(_ref) {
|
|
39
39
|
var isOpen = _ref.isOpen;
|
|
40
|
-
(0,
|
|
40
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
41
41
|
var _getDocument;
|
|
42
42
|
if (!isOpen) {
|
|
43
43
|
return;
|
|
@@ -8,6 +8,7 @@ exports.useAnchoredPopoverAtPoint = useAnchoredPopoverAtPoint;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
+
var _useLayoutEffect = require("@atlaskit/ds-lib/use-layout-effect");
|
|
11
12
|
var _useAnchoredPopover = require("./use-anchored-popover");
|
|
12
13
|
var _excluded = ["getPoint", "isEnabled"];
|
|
13
14
|
/**
|
|
@@ -97,7 +98,7 @@ function useAnchoredPopoverAtPoint(_ref2) {
|
|
|
97
98
|
// effect must not depend on anything the delegated effect does not: a dependency
|
|
98
99
|
// here alone re-creates the element without that hook writing an `anchor-name`
|
|
99
100
|
// onto it, and positioning silently dies.
|
|
100
|
-
(0,
|
|
101
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
101
102
|
if (!isEnabled) {
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.useAnchoredPopover = useAnchoredPopover;
|
|
7
7
|
var _react = require("react");
|
|
8
8
|
var _useId = require("@atlaskit/ds-lib/use-id");
|
|
9
|
+
var _useLayoutEffect = require("@atlaskit/ds-lib/use-layout-effect");
|
|
9
10
|
var _applyAnchorPositioning = require("./anchor-positioning/apply-anchor-positioning");
|
|
10
11
|
var _anchoredPopoverSize = require("./anchored-popover-size");
|
|
11
12
|
var _applyJavascriptFallbackPositioning = require("./javascript-fallback/apply-javascript-fallback-positioning");
|
|
@@ -214,7 +215,7 @@ function useAnchoredPopover(_ref3) {
|
|
|
214
215
|
// element (the point hook remounts its `<div>`).
|
|
215
216
|
var fallbackAnchorName = useNewAnchorName();
|
|
216
217
|
var stablePlacement = useStablePlacement(placement);
|
|
217
|
-
(0,
|
|
218
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
218
219
|
if (!isEnabled) {
|
|
219
220
|
return;
|
|
220
221
|
}
|
|
@@ -8,6 +8,7 @@ exports.useAnimatedVisibility = useAnimatedVisibility;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
10
10
|
var _react = require("react");
|
|
11
|
+
var _useLayoutEffect = require("@atlaskit/ds-lib/use-layout-effect");
|
|
11
12
|
var _isNativeElementOpen = require("./is-native-element-open");
|
|
12
13
|
var _reducedMotion = require("./reduced-motion");
|
|
13
14
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -208,7 +209,7 @@ function useAnimatedVisibility(_ref4) {
|
|
|
208
209
|
var onEnterFinishRef = (0, _react.useRef)(onEnterFinish);
|
|
209
210
|
var onExitFinishRef = (0, _react.useRef)(onExitFinish);
|
|
210
211
|
var willAnimateRef = (0, _react.useRef)(willAnimate);
|
|
211
|
-
(0,
|
|
212
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
212
213
|
onEnterFinishRef.current = onEnterFinish;
|
|
213
214
|
onExitFinishRef.current = onExitFinish;
|
|
214
215
|
willAnimateRef.current = willAnimate;
|
|
@@ -324,7 +325,7 @@ function useAnimatedVisibility(_ref4) {
|
|
|
324
325
|
onSettled: settleExit
|
|
325
326
|
});
|
|
326
327
|
}, [elementRef, settleExit]);
|
|
327
|
-
(0,
|
|
328
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
328
329
|
return function () {
|
|
329
330
|
// Prevent a pending animation or microtask from notifying after unmount.
|
|
330
331
|
cancelExitSettlementRef.current();
|
|
@@ -14,6 +14,7 @@ var _react2 = require("@compiled/react");
|
|
|
14
14
|
var _bindEventListener = require("bind-event-listener");
|
|
15
15
|
var _mergeRefs = _interopRequireDefault(require("@atlaskit/ds-lib/merge-refs"));
|
|
16
16
|
var _once = _interopRequireDefault(require("@atlaskit/ds-lib/once"));
|
|
17
|
+
var _useLayoutEffect = require("@atlaskit/ds-lib/use-layout-effect");
|
|
17
18
|
var _useNotifyOpenLayerObserver = require("@atlaskit/layering/use-notify-open-layer-observer");
|
|
18
19
|
var _isNativeElementOpen = require("../internal/is-native-element-open");
|
|
19
20
|
var _resolvePlacement2 = require("../internal/resolve-placement");
|
|
@@ -172,7 +173,7 @@ var Popover = exports.Popover = /*#__PURE__*/(0, _react.forwardRef)(function Pop
|
|
|
172
173
|
// Keep the semantic callback current without rebinding native lifecycle
|
|
173
174
|
// listeners during the same commit that calls showPopover()/hidePopover().
|
|
174
175
|
var onCloseRef = (0, _react.useRef)(onClose);
|
|
175
|
-
(0,
|
|
176
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
176
177
|
onCloseRef.current = onClose;
|
|
177
178
|
}, [onClose]);
|
|
178
179
|
|
|
@@ -295,7 +296,7 @@ var Popover = exports.Popover = /*#__PURE__*/(0, _react.forwardRef)(function Pop
|
|
|
295
296
|
// first dispatch, dropping the `focusRestorationTargetRef` snapshot
|
|
296
297
|
// and breaking nested-popover focus restoration on close. React runs
|
|
297
298
|
// layout effects in source order on the same commit.
|
|
298
|
-
(0,
|
|
299
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
299
300
|
var element = ownRef.current;
|
|
300
301
|
if (!element) {
|
|
301
302
|
return;
|
|
@@ -344,7 +345,7 @@ var Popover = exports.Popover = /*#__PURE__*/(0, _react.forwardRef)(function Pop
|
|
|
344
345
|
// Show/hide based on isOpen. `showPopover`/`hidePopover` are no-ops when
|
|
345
346
|
// already in the target state. Try/catch guards `InvalidStateError` on
|
|
346
347
|
// disconnected elements (StrictMode/concurrent/unmount edge cases).
|
|
347
|
-
(0,
|
|
348
|
+
(0, _useLayoutEffect.useLayoutEffect)(function () {
|
|
348
349
|
var element = ownRef.current;
|
|
349
350
|
if (!element) {
|
|
350
351
|
return;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* dialog-content.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./dialog-content.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { forwardRef, useCallback, useId,
|
|
4
|
+
import React, { forwardRef, useCallback, useId, useRef } from 'react';
|
|
5
5
|
import { cx } from '@compiled/react';
|
|
6
6
|
import { bindAll } from 'bind-event-listener';
|
|
7
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
9
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
9
10
|
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer';
|
|
10
11
|
import { useAnimatedVisibility } from '../internal/use-animated-visibility';
|
|
11
12
|
import { useFocusWrap } from '../internal/use-focus-wrap';
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* See `notes/decisions/anchored-popover-at-point.md` for why this is a sibling
|
|
8
8
|
* hook instead of an anchor union inside `useAnchoredPopover`.
|
|
9
9
|
*/
|
|
10
|
-
import {
|
|
10
|
+
import { useRef } from 'react';
|
|
11
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
11
12
|
import { useAnchoredPopover } from './use-anchored-popover';
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
* See `notes/architecture/positioning.md` and
|
|
11
11
|
* `notes/decisions/fit-available-space.md`.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
14
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
15
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
15
16
|
import { applyAnchorPositioning } from './anchor-positioning/apply-anchor-positioning';
|
|
16
17
|
import { getAnchoredPopoverSizeDeclarations } from './anchored-popover-size';
|
|
17
18
|
import { applyJavaScriptFallbackPositioning } from './javascript-fallback/apply-javascript-fallback-positioning';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { useCallback, useEffect,
|
|
1
|
+
import { useCallback, useEffect, useReducer, useRef } from 'react';
|
|
2
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
2
3
|
import { isNativeElementOpen } from './is-native-element-open';
|
|
3
4
|
import { prefersReducedMotion } from './reduced-motion';
|
|
4
5
|
function runCancellableSettlement({
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* popover.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./popover.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { forwardRef, useCallback, useId,
|
|
4
|
+
import React, { forwardRef, useCallback, useId, useMemo, useRef } from 'react';
|
|
5
5
|
import { cx } from '@compiled/react';
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
8
|
import once from '@atlaskit/ds-lib/once';
|
|
9
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
9
10
|
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer';
|
|
10
11
|
import { isNativeElementOpen } from '../internal/is-native-element-open';
|
|
11
12
|
import { resolvePlacement } from '../internal/resolve-placement';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* dialog-content.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./dialog-content.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { forwardRef, useCallback, useId,
|
|
4
|
+
import React, { forwardRef, useCallback, useId, useRef } from 'react';
|
|
5
5
|
import { cx } from '@compiled/react';
|
|
6
6
|
import { bindAll } from 'bind-event-listener';
|
|
7
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
8
|
import noop from '@atlaskit/ds-lib/noop';
|
|
9
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
9
10
|
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer';
|
|
10
11
|
import { useAnimatedVisibility } from '../internal/use-animated-visibility';
|
|
11
12
|
import { useFocusWrap } from '../internal/use-focus-wrap';
|
|
@@ -12,7 +12,8 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
12
12
|
* See `notes/decisions/anchored-popover-at-point.md` for why this is a sibling
|
|
13
13
|
* hook instead of an anchor union inside `useAnchoredPopover`.
|
|
14
14
|
*/
|
|
15
|
-
import {
|
|
15
|
+
import { useRef } from 'react';
|
|
16
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
16
17
|
import { useAnchoredPopover } from './use-anchored-popover';
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
* See `notes/architecture/positioning.md` and
|
|
11
11
|
* `notes/decisions/fit-available-space.md`.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { useMemo } from 'react';
|
|
14
14
|
import { useId } from '@atlaskit/ds-lib/use-id';
|
|
15
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
15
16
|
import { applyAnchorPositioning } from './anchor-positioning/apply-anchor-positioning';
|
|
16
17
|
import { getAnchoredPopoverSizeDeclarations } from './anchored-popover-size';
|
|
17
18
|
import { applyJavaScriptFallbackPositioning } from './javascript-fallback/apply-javascript-fallback-positioning';
|
|
@@ -2,7 +2,8 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
2
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
-
import { useCallback, useEffect,
|
|
5
|
+
import { useCallback, useEffect, useReducer, useRef } from 'react';
|
|
6
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
6
7
|
import { isNativeElementOpen } from './is-native-element-open';
|
|
7
8
|
import { prefersReducedMotion } from './reduced-motion';
|
|
8
9
|
function runCancellableSettlement(_ref) {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/* popover.tsx generated by @compiled/babel-plugin v3.0.2 */
|
|
2
2
|
import "./popover.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
-
import React, { forwardRef, useCallback, useId,
|
|
4
|
+
import React, { forwardRef, useCallback, useId, useMemo, useRef } from 'react';
|
|
5
5
|
import { cx } from '@compiled/react';
|
|
6
6
|
import { bind } from 'bind-event-listener';
|
|
7
7
|
import mergeRefs from '@atlaskit/ds-lib/merge-refs';
|
|
8
8
|
import once from '@atlaskit/ds-lib/once';
|
|
9
|
+
import { useLayoutEffect } from '@atlaskit/ds-lib/use-layout-effect';
|
|
9
10
|
import { useNotifyOpenLayerObserver } from '@atlaskit/layering/use-notify-open-layer-observer';
|
|
10
11
|
import { isNativeElementOpen } from '../internal/is-native-element-open';
|
|
11
12
|
import { resolvePlacement } from '../internal/resolve-placement';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/top-layer",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.4",
|
|
4
4
|
"description": "Low-level layering primitives based on popover and dialog",
|
|
5
5
|
"homepage": "https://atlassian.design/components/top-layer",
|
|
6
6
|
"repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
|