@atlaskit/popper 5.4.1 → 5.4.3

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.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 5.4.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`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.
14
+
3
15
  ## 5.4.1
4
16
 
5
17
  ### Patch Changes
@@ -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.1",
3
+ "version": "5.4.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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.1",
3
+ "version": "5.4.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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.1",
3
+ "version": "5.4.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/popper",
3
- "version": "5.4.1",
3
+ "version": "5.4.3",
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.6",
43
44
  "@babel/runtime": "^7.0.0",
44
45
  "@popperjs/core": "^2.9.1",
45
46
  "react-popper": "^2.2.3"
@@ -48,7 +49,7 @@
48
49
  "react": "^16.8.0"
49
50
  },
50
51
  "devDependencies": {
51
- "@atlaskit/button": "^16.4.0",
52
+ "@atlaskit/button": "^16.5.0",
52
53
  "@atlaskit/docs": "*",
53
54
  "@atlaskit/ds-lib": "^2.1.0",
54
55
  "@atlaskit/ssr": "*",