@atlaskit/popup 1.13.2 → 1.14.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,11 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 1.14.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#84410](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84410) [`9d5dc8f7de85`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/9d5dc8f7de85) - Adds a new `strategy` prop to control the positioning strategy to use other than the default 'fixed' position.
8
+
3
9
  ## 1.13.2
4
10
 
5
11
  ### Patch Changes
@@ -76,7 +76,8 @@ function PopperWrapper(_ref) {
76
76
  triggerRef = _ref.triggerRef,
77
77
  shouldUseCaptureOnOutsideClick = _ref.shouldUseCaptureOnOutsideClick,
78
78
  shouldRenderToParent = _ref.shouldRenderToParent,
79
- shouldDisableFocusLock = _ref.shouldDisableFocusLock;
79
+ shouldDisableFocusLock = _ref.shouldDisableFocusLock,
80
+ strategy = _ref.strategy;
80
81
  var _useState = (0, _react.useState)(null),
81
82
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
82
83
  popupRef = _useState2[0],
@@ -118,7 +119,8 @@ function PopperWrapper(_ref) {
118
119
  return (0, _react2.jsx)(_popper.Popper, {
119
120
  placement: placement,
120
121
  offset: offset,
121
- modifiers: modifiers
122
+ modifiers: modifiers,
123
+ strategy: strategy
122
124
  }, function (_ref2) {
123
125
  var _ref3 = _ref2.ref,
124
126
  style = _ref2.style,
package/dist/cjs/popup.js CHANGED
@@ -44,7 +44,8 @@ var Popup = exports.Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
44
44
  _ref$shouldRenderToPa = _ref.shouldRenderToParent,
45
45
  shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa,
46
46
  _ref$shouldDisableFoc = _ref.shouldDisableFocusLock,
47
- shouldDisableFocusLock = _ref$shouldDisableFoc === void 0 ? false : _ref$shouldDisableFoc;
47
+ shouldDisableFocusLock = _ref$shouldDisableFoc === void 0 ? false : _ref$shouldDisableFoc,
48
+ strategy = _ref.strategy;
48
49
  var _useState = (0, _react.useState)(null),
49
50
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
50
51
  triggerRef = _useState2[0],
@@ -95,7 +96,8 @@ var Popup = exports.Popup = /*#__PURE__*/(0, _react.memo)(function (_ref) {
95
96
  shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
96
97
  shouldRenderToParent: shouldRenderToParent,
97
98
  shouldDisableFocusLock: shouldDisableFocusLock,
98
- triggerRef: triggerRef
99
+ triggerRef: triggerRef,
100
+ strategy: strategy
99
101
  }));
100
102
  return (0, _react2.jsx)(_popper.Manager, null, (0, _react2.jsx)(_popper.Reference, null, function (_ref2) {
101
103
  var ref = _ref2.ref;
@@ -65,7 +65,8 @@ function PopperWrapper({
65
65
  triggerRef,
66
66
  shouldUseCaptureOnOutsideClick,
67
67
  shouldRenderToParent,
68
- shouldDisableFocusLock
68
+ shouldDisableFocusLock,
69
+ strategy
69
70
  }) {
70
71
  const [popupRef, setPopupRef] = useState(null);
71
72
  const [initialFocusRef, setInitialFocusRef] = useState(null);
@@ -101,7 +102,8 @@ function PopperWrapper({
101
102
  return jsx(Popper, {
102
103
  placement: placement,
103
104
  offset: offset,
104
- modifiers: modifiers
105
+ modifiers: modifiers,
106
+ strategy: strategy
105
107
  }, ({
106
108
  ref,
107
109
  style,
@@ -27,7 +27,8 @@ export const Popup = /*#__PURE__*/memo(({
27
27
  zIndex = defaultLayer,
28
28
  shouldUseCaptureOnOutsideClick = false,
29
29
  shouldRenderToParent = false,
30
- shouldDisableFocusLock = false
30
+ shouldDisableFocusLock = false,
31
+ strategy
31
32
  }) => {
32
33
  const [triggerRef, setTriggerRef] = useState(null);
33
34
 
@@ -72,7 +73,8 @@ export const Popup = /*#__PURE__*/memo(({
72
73
  shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
73
74
  shouldRenderToParent: shouldRenderToParent,
74
75
  shouldDisableFocusLock: shouldDisableFocusLock,
75
- triggerRef: triggerRef
76
+ triggerRef: triggerRef,
77
+ strategy: strategy
76
78
  }));
77
79
  return jsx(Manager, null, jsx(Reference, null, ({
78
80
  ref
@@ -69,7 +69,8 @@ function PopperWrapper(_ref) {
69
69
  triggerRef = _ref.triggerRef,
70
70
  shouldUseCaptureOnOutsideClick = _ref.shouldUseCaptureOnOutsideClick,
71
71
  shouldRenderToParent = _ref.shouldRenderToParent,
72
- shouldDisableFocusLock = _ref.shouldDisableFocusLock;
72
+ shouldDisableFocusLock = _ref.shouldDisableFocusLock,
73
+ strategy = _ref.strategy;
73
74
  var _useState = useState(null),
74
75
  _useState2 = _slicedToArray(_useState, 2),
75
76
  popupRef = _useState2[0],
@@ -111,7 +112,8 @@ function PopperWrapper(_ref) {
111
112
  return jsx(Popper, {
112
113
  placement: placement,
113
114
  offset: offset,
114
- modifiers: modifiers
115
+ modifiers: modifiers,
116
+ strategy: strategy
115
117
  }, function (_ref2) {
116
118
  var _ref3 = _ref2.ref,
117
119
  style = _ref2.style,
package/dist/esm/popup.js CHANGED
@@ -36,7 +36,8 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
36
36
  _ref$shouldRenderToPa = _ref.shouldRenderToParent,
37
37
  shouldRenderToParent = _ref$shouldRenderToPa === void 0 ? false : _ref$shouldRenderToPa,
38
38
  _ref$shouldDisableFoc = _ref.shouldDisableFocusLock,
39
- shouldDisableFocusLock = _ref$shouldDisableFoc === void 0 ? false : _ref$shouldDisableFoc;
39
+ shouldDisableFocusLock = _ref$shouldDisableFoc === void 0 ? false : _ref$shouldDisableFoc,
40
+ strategy = _ref.strategy;
40
41
  var _useState = useState(null),
41
42
  _useState2 = _slicedToArray(_useState, 2),
42
43
  triggerRef = _useState2[0],
@@ -87,7 +88,8 @@ export var Popup = /*#__PURE__*/memo(function (_ref) {
87
88
  shouldUseCaptureOnOutsideClick: shouldUseCaptureOnOutsideClick,
88
89
  shouldRenderToParent: shouldRenderToParent,
89
90
  shouldDisableFocusLock: shouldDisableFocusLock,
90
- triggerRef: triggerRef
91
+ triggerRef: triggerRef,
92
+ strategy: strategy
91
93
  }));
92
94
  return jsx(Manager, null, jsx(Reference, null, function (_ref2) {
93
95
  var ref = _ref2.ref;
@@ -1,4 +1,4 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { PopperWrapperProps } from './types';
3
- declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, }: PopperWrapperProps): jsx.JSX.Element;
3
+ declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, strategy, }: PopperWrapperProps): jsx.JSX.Element;
4
4
  export default PopperWrapper;
@@ -149,6 +149,11 @@ interface BaseProps {
149
149
  * Defaults to `false`.
150
150
  */
151
151
  shouldDisableFocusLock?: boolean;
152
+ /**
153
+ * Controls the positioning strategy to use. Can vary between `absolute` and `fixed`.
154
+ * Defaults to `fixed`
155
+ */
156
+ strategy?: 'absolute' | 'fixed';
152
157
  }
153
158
  export interface PopupProps extends BaseProps {
154
159
  /**
@@ -1,4 +1,4 @@
1
1
  import { jsx } from '@emotion/react';
2
2
  import { PopperWrapperProps } from './types';
3
- declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, }: PopperWrapperProps): jsx.JSX.Element;
3
+ declare function PopperWrapper({ isOpen, id, offset, testId, content, fallbackPlacements, onClose, boundary, rootBoundary, shouldFlip, placement, popupComponent: PopupContainer, autoFocus, triggerRef, shouldUseCaptureOnOutsideClick, shouldRenderToParent, shouldDisableFocusLock, strategy, }: PopperWrapperProps): jsx.JSX.Element;
4
4
  export default PopperWrapper;
@@ -152,6 +152,11 @@ interface BaseProps {
152
152
  * Defaults to `false`.
153
153
  */
154
154
  shouldDisableFocusLock?: boolean;
155
+ /**
156
+ * Controls the positioning strategy to use. Can vary between `absolute` and `fixed`.
157
+ * Defaults to `fixed`
158
+ */
159
+ strategy?: 'absolute' | 'fixed';
155
160
  }
156
161
  export interface PopupProps extends BaseProps {
157
162
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "1.13.2",
3
+ "version": "1.14.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"