@atlaskit/popper 5.4.0 → 5.4.2

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,17 @@
1
1
  # @atlaskit/popper
2
2
 
3
+ ## 5.4.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`03a51e8100d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03a51e8100d) - Introduces a hidden, dummy html element to validate that our new deployment pipeline is working end-to-end.
8
+
9
+ ## 5.4.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`211c04b1c96`](https://bitbucket.org/atlassian/atlassian-frontend/commits/211c04b1c96) - Fixes in-product testing typos causing assert errors
14
+
3
15
  ## 5.4.0
4
16
 
5
17
  ### Minor Changes
@@ -7,11 +7,9 @@ Object.defineProperty(exports, "__esModule", {
7
7
  });
8
8
  exports.BasePopperPageObject = void 0;
9
9
 
10
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
-
12
10
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
11
 
14
- var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
13
 
16
14
  var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
17
15
 
@@ -19,8 +17,6 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
19
17
 
20
18
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
21
19
 
22
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
-
24
20
  var _inProductTesting = require("@atlaskit/in-product-testing");
25
21
 
26
22
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
@@ -32,18 +28,18 @@ var BasePopperPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
32
28
 
33
29
  var _super = _createSuper(BasePopperPageObject);
34
30
 
35
- function BasePopperPageObject(cy) {
36
- var _this;
37
-
31
+ function BasePopperPageObject() {
38
32
  (0, _classCallCheck2.default)(this, BasePopperPageObject);
39
- _this = _super.call(this, cy);
40
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "assertPopperStyle", function (elementSelector) {
41
- return _this.cy.get(elementSelector).should('be.visbile');
42
- });
43
- return _this;
33
+ return _super.apply(this, arguments);
44
34
  }
45
35
 
46
- return (0, _createClass2.default)(BasePopperPageObject);
36
+ (0, _createClass2.default)(BasePopperPageObject, [{
37
+ key: "assertPopperStyle",
38
+ value: function assertPopperStyle(elementSelector) {
39
+ return this.cy.get(elementSelector).should('be.visible');
40
+ }
41
+ }]);
42
+ return BasePopperPageObject;
47
43
  }(_inProductTesting.InProductTestPageObject);
48
44
 
49
45
  exports.BasePopperPageObject = BasePopperPageObject;
@@ -23,6 +23,8 @@ var _react = _interopRequireWildcard(require("react"));
23
23
 
24
24
  var _reactPopper = require("react-popper");
25
25
 
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
27
+
26
28
  var _core = require("@popperjs/core");
27
29
 
28
30
  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); }
@@ -50,6 +52,14 @@ function defaultChildrenFn() {
50
52
  }
51
53
 
52
54
  var defaultOffset = [0, 8];
55
+ var siblingElement = null;
56
+
57
+ if ((0, _platformFeatureFlags.getBooleanFF)('uip.popper.flex-team')) {
58
+ siblingElement = /*#__PURE__*/_react.default.createElement("em", {
59
+ hidden: true,
60
+ "data-flex": "Hello from UIP"
61
+ });
62
+ }
53
63
 
54
64
  function Popper(_ref) {
55
65
  var _ref$children = _ref.children,
@@ -86,10 +96,13 @@ function Popper(_ref) {
86
96
 
87
97
  return [].concat((0, _toConsumableArray2.default)(internalModifiers), (0, _toConsumableArray2.default)(modifiers));
88
98
  }, [internalModifiers, modifiers]);
99
+ var wrappedChildren = (0, _react.useCallback)(function (childrenProps) {
100
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, siblingElement, children(childrenProps));
101
+ }, [children]);
89
102
  return /*#__PURE__*/_react.default.createElement(_reactPopper.Popper, {
90
103
  modifiers: mergedModifiers,
91
104
  placement: placement,
92
105
  strategy: strategy,
93
106
  referenceElement: referenceElement
94
- }, children);
107
+ }, wrappedChildren);
95
108
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,12 +1,7 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  import { InProductTestPageObject } from '@atlaskit/in-product-testing';
3
2
  export class BasePopperPageObject extends InProductTestPageObject {
4
- constructor(cy) {
5
- super(cy);
6
-
7
- _defineProperty(this, "assertPopperStyle", elementSelector => {
8
- return this.cy.get(elementSelector).should('be.visbile');
9
- });
3
+ assertPopperStyle(elementSelector) {
4
+ return this.cy.get(elementSelector).should('be.visible');
10
5
  }
11
6
 
12
7
  }
@@ -1,5 +1,6 @@
1
- import React, { useMemo } from 'react';
1
+ import React, { Fragment, useCallback, useMemo } from 'react';
2
2
  import { Popper as ReactPopper } from 'react-popper';
3
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
3
4
  export { placements } from '@popperjs/core'; // Export types from PopperJS / React Popper
4
5
 
5
6
  const constantModifiers = [{
@@ -23,6 +24,15 @@ function defaultChildrenFn() {
23
24
  }
24
25
 
25
26
  const defaultOffset = [0, 8];
27
+ let siblingElement = null;
28
+
29
+ if (getBooleanFF('uip.popper.flex-team')) {
30
+ siblingElement = /*#__PURE__*/React.createElement("em", {
31
+ hidden: true,
32
+ "data-flex": "Hello from UIP"
33
+ });
34
+ }
35
+
26
36
  export function Popper({
27
37
  children = defaultChildrenFn,
28
38
  offset = defaultOffset,
@@ -50,10 +60,13 @@ export function Popper({
50
60
 
51
61
  return [...internalModifiers, ...modifiers];
52
62
  }, [internalModifiers, modifiers]);
63
+ const wrappedChildren = useCallback(childrenProps => {
64
+ return /*#__PURE__*/React.createElement(Fragment, null, siblingElement, children(childrenProps));
65
+ }, [children]);
53
66
  return /*#__PURE__*/React.createElement(ReactPopper, {
54
67
  modifiers: mergedModifiers,
55
68
  placement: placement,
56
69
  strategy: strategy,
57
70
  referenceElement: referenceElement
58
- }, children);
71
+ }, wrappedChildren);
59
72
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,10 +1,8 @@
1
- import _createClass from "@babel/runtime/helpers/createClass";
2
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
4
3
  import _inherits from "@babel/runtime/helpers/inherits";
5
4
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
5
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
6
 
9
7
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
8
 
@@ -16,19 +14,18 @@ export var BasePopperPageObject = /*#__PURE__*/function (_InProductTestPageObj)
16
14
 
17
15
  var _super = _createSuper(BasePopperPageObject);
18
16
 
19
- function BasePopperPageObject(cy) {
20
- var _this;
21
-
17
+ function BasePopperPageObject() {
22
18
  _classCallCheck(this, BasePopperPageObject);
23
19
 
24
- _this = _super.call(this, cy);
25
-
26
- _defineProperty(_assertThisInitialized(_this), "assertPopperStyle", function (elementSelector) {
27
- return _this.cy.get(elementSelector).should('be.visbile');
28
- });
29
-
30
- return _this;
20
+ return _super.apply(this, arguments);
31
21
  }
32
22
 
33
- return _createClass(BasePopperPageObject);
23
+ _createClass(BasePopperPageObject, [{
24
+ key: "assertPopperStyle",
25
+ value: function assertPopperStyle(elementSelector) {
26
+ return this.cy.get(elementSelector).should('be.visible');
27
+ }
28
+ }]);
29
+
30
+ return BasePopperPageObject;
34
31
  }(InProductTestPageObject);
@@ -1,7 +1,8 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
- import React, { useMemo } from 'react';
3
+ import React, { Fragment, useCallback, useMemo } from 'react';
4
4
  import { Popper as ReactPopper } from 'react-popper';
5
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
6
  export { placements } from '@popperjs/core'; // Export types from PopperJS / React Popper
6
7
 
7
8
  var constantModifiers = [{
@@ -25,6 +26,15 @@ function defaultChildrenFn() {
25
26
  }
26
27
 
27
28
  var defaultOffset = [0, 8];
29
+ var siblingElement = null;
30
+
31
+ if (getBooleanFF('uip.popper.flex-team')) {
32
+ siblingElement = /*#__PURE__*/React.createElement("em", {
33
+ hidden: true,
34
+ "data-flex": "Hello from UIP"
35
+ });
36
+ }
37
+
28
38
  export function Popper(_ref) {
29
39
  var _ref$children = _ref.children,
30
40
  children = _ref$children === void 0 ? defaultChildrenFn : _ref$children,
@@ -60,10 +70,13 @@ export function Popper(_ref) {
60
70
 
61
71
  return [].concat(_toConsumableArray(internalModifiers), _toConsumableArray(modifiers));
62
72
  }, [internalModifiers, modifiers]);
73
+ var wrappedChildren = useCallback(function (childrenProps) {
74
+ return /*#__PURE__*/React.createElement(Fragment, null, siblingElement, children(childrenProps));
75
+ }, [children]);
63
76
  return /*#__PURE__*/React.createElement(ReactPopper, {
64
77
  modifiers: mergedModifiers,
65
78
  placement: placement,
66
79
  strategy: strategy,
67
80
  referenceElement: referenceElement
68
- }, children);
81
+ }, wrappedChildren);
69
82
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "sideEffects": false
5
5
  }
@@ -1,6 +1,5 @@
1
1
  /// <reference types="cypress" />
2
- import { CypressType, InProductTestPageObject } from '@atlaskit/in-product-testing';
2
+ import { InProductTestPageObject } from '@atlaskit/in-product-testing';
3
3
  export declare class BasePopperPageObject extends InProductTestPageObject {
4
- constructor(cy: CypressType);
5
- assertPopperStyle: (elementSelector: keyof HTMLElementTagNameMap | string) => Cypress.Chainable<JQuery<HTMLElement>>;
4
+ assertPopperStyle(elementSelector: keyof HTMLElementTagNameMap | string): Cypress.Chainable<JQuery<HTMLElement>>;
6
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.4.0",
3
+ "version": "5.4.2",
4
4
  "description": "Wrapper for react-popper with common config and some helpers",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,6 +40,7 @@
40
40
  },
41
41
  "dependencies": {
42
42
  "@atlaskit/in-product-testing": "^0.1.5",
43
+ "@atlaskit/platform-feature-flags": "^0.0.5",
43
44
  "@babel/runtime": "^7.0.0",
44
45
  "@popperjs/core": "^2.9.1",
45
46
  "react-popper": "^2.2.3"
package/report.api.md CHANGED
@@ -8,6 +8,7 @@
8
8
  ### Table of contents
9
9
 
10
10
  - [Main Entry Types](#main-entry-types)
11
+ - [Peer Dependencies](#peer-dependencies)
11
12
 
12
13
  ### Main Entry Types
13
14
 
@@ -77,3 +78,15 @@ export { StrictModifier };
77
78
  ```
78
79
 
79
80
  <!--SECTION END: Main Entry Types-->
81
+
82
+ ### Peer Dependencies
83
+
84
+ <!--SECTION START: Peer Dependencies-->
85
+
86
+ ```json
87
+ {
88
+ "react": "^16.8.0"
89
+ }
90
+ ```
91
+
92
+ <!--SECTION END: Peer Dependencies-->