@atlaskit/popup 4.8.2 → 4.9.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,20 @@
1
1
  # @atlaskit/popup
2
2
 
3
+ ## 4.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`a910081d920cc`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a910081d920cc) -
8
+ Adds a header (with a close button), body, and footer as slot subcomponents of flyout menu item
9
+ content, and adjusts for body scrolling
10
+
11
+ ## 4.8.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`e095aea1aef52`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e095aea1aef52) -
16
+ Remove broken iframe logic
17
+
3
18
  ## 4.8.2
4
19
 
5
20
  ### Patch Changes
@@ -41,7 +41,7 @@ var DefaultPopupComponent = /*#__PURE__*/(0, _react.forwardRef)(function (props,
41
41
  children = props.children,
42
42
  appearance = props.appearance,
43
43
  className = props.className,
44
- isReferenceHidden = props.isReferenceHidden,
44
+ _isReferenceHidden = props.isReferenceHidden,
45
45
  htmlAttributes = (0, _objectWithoutProperties2.default)(props, _excluded);
46
46
  return /*#__PURE__*/React.createElement("div", (0, _extends2.default)({
47
47
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -35,7 +35,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
35
35
  if (!isOpen || !popupRef) {
36
36
  return _noop.default;
37
37
  }
38
- var inIframe = window && window.self !== window.top;
39
38
  var closePopup = function closePopup(event) {
40
39
  if (onClose) {
41
40
  var _currentLevel = null;
@@ -66,7 +65,7 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
66
65
  var onClick = function onClick(event) {
67
66
  var target = event.target;
68
67
  var doesDomNodeExist = document.body.contains(target);
69
- if (!doesDomNodeExist && !inIframe) {
68
+ if (!doesDomNodeExist) {
70
69
  return;
71
70
  }
72
71
  if (isLayerDisabled()) {
@@ -183,18 +182,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
183
182
  }
184
183
  }
185
184
  };
186
- var parentUnbind;
187
- // if the popup is inside iframe, we want to listen to click events outside iframe,
188
- // to close the popup correctly in the iframe.
189
- if (inIframe && isOpen) {
190
- parentUnbind = (0, _bindEventListener.bind)(window.parent.window, {
191
- type: 'click',
192
- listener: onClick,
193
- options: {
194
- capture: capture
195
- }
196
- });
197
- }
198
185
  var unbind = _noop.default;
199
186
  if ((0, _platformFeatureFlags.fg)('popup-onclose-fix')) {
200
187
  setTimeout(function () {
@@ -240,7 +227,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
240
227
  }
241
228
  });
242
229
  return function () {
243
- var _parentUnbind;
244
230
  if ((0, _platformFeatureFlags.fg)('popup-onclose-fix')) {
245
231
  setTimeout(function () {
246
232
  unbind();
@@ -249,7 +235,6 @@ var useCloseManager = exports.useCloseManager = function useCloseManager(_ref) {
249
235
  unbind();
250
236
  }
251
237
  cancelAllFrames();
252
- (_parentUnbind = parentUnbind) === null || _parentUnbind === void 0 || _parentUnbind();
253
238
  unbindBlur();
254
239
  };
255
240
  }, [isOpen, onClose, popupRef, triggerRef, autoFocus, shouldDisableFocusTrap, capture, isLayerDisabled, shouldCloseOnTab, currentLevel, shouldRenderToParent, requestFrame, cancelAllFrames]);
@@ -29,7 +29,7 @@ const DefaultPopupComponent = /*#__PURE__*/forwardRef((props, ref) => {
29
29
  children,
30
30
  appearance,
31
31
  className,
32
- isReferenceHidden,
32
+ isReferenceHidden: _isReferenceHidden,
33
33
  ...htmlAttributes
34
34
  } = props;
35
35
  return /*#__PURE__*/React.createElement("div", _extends({
@@ -30,7 +30,6 @@ export const useCloseManager = ({
30
30
  if (!isOpen || !popupRef) {
31
31
  return noop;
32
32
  }
33
- const inIframe = window && window.self !== window.top;
34
33
  const closePopup = event => {
35
34
  if (onClose) {
36
35
  let currentLevel = null;
@@ -63,7 +62,7 @@ export const useCloseManager = ({
63
62
  target
64
63
  } = event;
65
64
  const doesDomNodeExist = document.body.contains(target);
66
- if (!doesDomNodeExist && !inIframe) {
65
+ if (!doesDomNodeExist) {
67
66
  return;
68
67
  }
69
68
  if (isLayerDisabled()) {
@@ -184,18 +183,6 @@ export const useCloseManager = ({
184
183
  }
185
184
  }
186
185
  };
187
- let parentUnbind;
188
- // if the popup is inside iframe, we want to listen to click events outside iframe,
189
- // to close the popup correctly in the iframe.
190
- if (inIframe && isOpen) {
191
- parentUnbind = bind(window.parent.window, {
192
- type: 'click',
193
- listener: onClick,
194
- options: {
195
- capture
196
- }
197
- });
198
- }
199
186
  let unbind = noop;
200
187
  if (fg('popup-onclose-fix')) {
201
188
  setTimeout(() => {
@@ -241,7 +228,6 @@ export const useCloseManager = ({
241
228
  }
242
229
  });
243
230
  return () => {
244
- var _parentUnbind;
245
231
  if (fg('popup-onclose-fix')) {
246
232
  setTimeout(() => {
247
233
  unbind();
@@ -250,7 +236,6 @@ export const useCloseManager = ({
250
236
  unbind();
251
237
  }
252
238
  cancelAllFrames();
253
- (_parentUnbind = parentUnbind) === null || _parentUnbind === void 0 ? void 0 : _parentUnbind();
254
239
  unbindBlur();
255
240
  };
256
241
  }, [isOpen, onClose, popupRef, triggerRef, autoFocus, shouldDisableFocusTrap, capture, isLayerDisabled, shouldCloseOnTab, currentLevel, shouldRenderToParent, requestFrame, cancelAllFrames]);
@@ -32,7 +32,7 @@ var DefaultPopupComponent = /*#__PURE__*/forwardRef(function (props, ref) {
32
32
  children = props.children,
33
33
  appearance = props.appearance,
34
34
  className = props.className,
35
- isReferenceHidden = props.isReferenceHidden,
35
+ _isReferenceHidden = props.isReferenceHidden,
36
36
  htmlAttributes = _objectWithoutProperties(props, _excluded);
37
37
  return /*#__PURE__*/React.createElement("div", _extends({
38
38
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop
@@ -27,7 +27,6 @@ export var useCloseManager = function useCloseManager(_ref) {
27
27
  if (!isOpen || !popupRef) {
28
28
  return noop;
29
29
  }
30
- var inIframe = window && window.self !== window.top;
31
30
  var closePopup = function closePopup(event) {
32
31
  if (onClose) {
33
32
  var _currentLevel = null;
@@ -58,7 +57,7 @@ export var useCloseManager = function useCloseManager(_ref) {
58
57
  var onClick = function onClick(event) {
59
58
  var target = event.target;
60
59
  var doesDomNodeExist = document.body.contains(target);
61
- if (!doesDomNodeExist && !inIframe) {
60
+ if (!doesDomNodeExist) {
62
61
  return;
63
62
  }
64
63
  if (isLayerDisabled()) {
@@ -175,18 +174,6 @@ export var useCloseManager = function useCloseManager(_ref) {
175
174
  }
176
175
  }
177
176
  };
178
- var parentUnbind;
179
- // if the popup is inside iframe, we want to listen to click events outside iframe,
180
- // to close the popup correctly in the iframe.
181
- if (inIframe && isOpen) {
182
- parentUnbind = bind(window.parent.window, {
183
- type: 'click',
184
- listener: onClick,
185
- options: {
186
- capture: capture
187
- }
188
- });
189
- }
190
177
  var unbind = noop;
191
178
  if (fg('popup-onclose-fix')) {
192
179
  setTimeout(function () {
@@ -232,7 +219,6 @@ export var useCloseManager = function useCloseManager(_ref) {
232
219
  }
233
220
  });
234
221
  return function () {
235
- var _parentUnbind;
236
222
  if (fg('popup-onclose-fix')) {
237
223
  setTimeout(function () {
238
224
  unbind();
@@ -241,7 +227,6 @@ export var useCloseManager = function useCloseManager(_ref) {
241
227
  unbind();
242
228
  }
243
229
  cancelAllFrames();
244
- (_parentUnbind = parentUnbind) === null || _parentUnbind === void 0 || _parentUnbind();
245
230
  unbindBlur();
246
231
  };
247
232
  }, [isOpen, onClose, popupRef, triggerRef, autoFocus, shouldDisableFocusTrap, capture, isLayerDisabled, shouldCloseOnTab, currentLevel, shouldRenderToParent, requestFrame, cancelAllFrames]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popup",
3
- "version": "4.8.2",
3
+ "version": "4.9.0",
4
4
  "description": "A popup displays brief content in an overlay.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -58,7 +58,7 @@
58
58
  "@atlaskit/button": "^23.9.0",
59
59
  "@atlaskit/code": "^17.4.0",
60
60
  "@atlaskit/docs": "^11.2.0",
61
- "@atlaskit/form": "^15.1.0",
61
+ "@atlaskit/form": "^15.2.0",
62
62
  "@atlaskit/heading": "^5.2.0",
63
63
  "@atlaskit/icon": "^29.3.0",
64
64
  "@atlaskit/link": "^3.2.0",