@atlaskit/user-picker 10.13.3 → 10.13.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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.13.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#64330](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/64330) [`797c300a51d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/797c300a51d4) - Minor internal refactor to reduce bundle size
8
+
3
9
  ## 10.13.3
4
10
 
5
11
  ### Patch Changes
@@ -12,7 +12,7 @@ var _utils = require("./components/utils");
12
12
  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; }
13
13
  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) { (0, _defineProperty2.default)(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; }
14
14
  var packageName = "@atlaskit/user-picker";
15
- var packageVersion = "10.13.3";
15
+ var packageVersion = "10.13.4";
16
16
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
17
17
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
18
18
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -16,18 +16,18 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _select = require("@atlaskit/select");
18
18
  var _react = _interopRequireWildcard(require("react"));
19
- var _react2 = require("@emotion/react");
20
19
  var _reactDom = _interopRequireDefault(require("react-dom"));
21
20
  var _reactIntlNext = require("react-intl-next");
22
21
  var _i18n = require("./i18n");
23
22
  var _utils = require("./utils");
23
+ var _ValueContainerWrapper = _interopRequireDefault(require("./ValueContainerWrapper"));
24
24
  var _excluded = ["children", "innerProps"];
25
25
  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); }
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
  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; }
28
28
  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) { (0, _defineProperty2.default)(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; }
29
29
  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); }; }
30
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
31
  var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
32
32
  (0, _inherits2.default)(MultiValueContainer, _React$PureComponent);
33
33
  var _super = _createSuper(MultiValueContainer);
@@ -58,7 +58,7 @@ var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_
58
58
  placeholder: placeholder
59
59
  }) : child;
60
60
  });
61
- return (0, _react2.jsx)(_react.Fragment, null, children);
61
+ return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, children);
62
62
  });
63
63
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderChildren", function () {
64
64
  var _this$props$selectPro = _this.props.selectProps,
@@ -69,7 +69,7 @@ var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_
69
69
  return _this.props.children;
70
70
  }
71
71
  if (addMoreMessage === undefined) {
72
- return (0, _react2.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.addMore, function (addMore) {
72
+ return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.addMore, function (addMore) {
73
73
  var _join, _addMoreMessages;
74
74
  var addMoreMessages = addMore;
75
75
  if (addMore && typeof addMore === 'string') {
@@ -82,15 +82,6 @@ var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_
82
82
  return _this.addPlaceholder(addMoreMessage);
83
83
  });
84
84
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onValueContainerClick", _this.props.selectProps.onValueContainerClick);
85
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "Wrapper", function (_ref) {
86
- var children = _ref.children;
87
- return _this.onValueContainerClick ? (0, _react2.jsx)("div", {
88
- css: (0, _react2.css)({
89
- flexGrow: 1
90
- }),
91
- onMouseDown: _this.onValueContainerClick
92
- }, children) : children;
93
- });
94
85
  _this.state = {
95
86
  valueSize: 0,
96
87
  previousValueSize: 0
@@ -132,7 +123,10 @@ var MultiValueContainer = exports.MultiValueContainer = /*#__PURE__*/function (_
132
123
  var props = _objectSpread(_objectSpread({}, valueContainerProps), {}, {
133
124
  innerProps: this.valueContainerInnerProps
134
125
  });
135
- return (0, _react2.jsx)(this.Wrapper, null, (0, _react2.jsx)(_select.components.ValueContainer, props, this.renderChildren()));
126
+ return /*#__PURE__*/_react.default.createElement(_ValueContainerWrapper.default, {
127
+ isEnabled: this.onValueContainerClick,
128
+ onMouseDown: this.onValueContainerClick
129
+ }, /*#__PURE__*/_react.default.createElement(_select.components.ValueContainer, props, this.renderChildren()));
136
130
  }
137
131
  }], [{
138
132
  key: "getDerivedStateFromProps",
@@ -13,15 +13,16 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
13
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
14
14
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _react = _interopRequireDefault(require("react"));
17
- var _react2 = require("@emotion/react");
18
16
  var _select = require("@atlaskit/select");
17
+ var _react = require("@emotion/react");
18
+ var _react2 = _interopRequireDefault(require("react"));
19
19
  var _SizeableAvatar = require("./SizeableAvatar");
20
20
  var _styles = require("./styles");
21
+ var _ValueContainerWrapper = _interopRequireDefault(require("./ValueContainerWrapper"));
21
22
  var _excluded = ["children"];
22
23
  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); }; }
23
24
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /** @jsx jsx */
24
- var placeholderIconContainer = (0, _react2.css)({
25
+ var placeholderIconContainer = (0, _react.css)({
25
26
  paddingLeft: "".concat(_styles.BORDER_PADDING, "px"),
26
27
  lineHeight: 0,
27
28
  gridArea: '1/1/2/2'
@@ -48,7 +49,7 @@ var SingleValueContainer = exports.SingleValueContainer = /*#__PURE__*/function
48
49
  inputValue = _this$props$selectPro.inputValue,
49
50
  value = _this$props$selectPro.value;
50
51
  if (isFocused || !hasValue) {
51
- return (0, _react2.jsx)(_SizeableAvatar.SizeableAvatar, {
52
+ return (0, _react.jsx)(_SizeableAvatar.SizeableAvatar, {
52
53
  appearance: appearance,
53
54
  src: showUserAvatar(inputValue, value) ? value.data.avatarUrl : undefined
54
55
  });
@@ -58,8 +59,8 @@ var SingleValueContainer = exports.SingleValueContainer = /*#__PURE__*/function
58
59
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onValueContainerClick", _this.props.selectProps.onValueContainerClick);
59
60
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "Wrapper", function (_ref) {
60
61
  var children = _ref.children;
61
- return _this.onValueContainerClick ? (0, _react2.jsx)("div", {
62
- css: (0, _react2.css)({
62
+ return _this.onValueContainerClick ? (0, _react.jsx)("div", {
63
+ css: (0, _react.css)({
63
64
  flexGrow: 1
64
65
  }),
65
66
  onMouseDown: _this.onValueContainerClick
@@ -73,10 +74,13 @@ var SingleValueContainer = exports.SingleValueContainer = /*#__PURE__*/function
73
74
  var _this$props2 = this.props,
74
75
  children = _this$props2.children,
75
76
  valueContainerProps = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
76
- return (0, _react2.jsx)(this.Wrapper, null, (0, _react2.jsx)(_select.components.ValueContainer, valueContainerProps, (0, _react2.jsx)("div", {
77
+ return (0, _react.jsx)(_ValueContainerWrapper.default, {
78
+ isEnabled: this.onValueContainerClick,
79
+ onMouseDown: this.onValueContainerClick
80
+ }, (0, _react.jsx)(_select.components.ValueContainer, valueContainerProps, (0, _react.jsx)("div", {
77
81
  css: placeholderIconContainer
78
82
  }, this.renderAvatar()), children));
79
83
  }
80
84
  }]);
81
85
  return SingleValueContainer;
82
- }(_react.default.Component);
86
+ }(_react2.default.Component);
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("@emotion/react");
8
+ /** @jsx jsx */
9
+
10
+ /**
11
+ * Conditional wrapper for the ValueContainer in Select. Provides a workaround
12
+ * for issues using react-select on react-beautiful-dnd Draggable elements.
13
+ * @returns
14
+ */
15
+ var ValueContainerWrapper = function ValueContainerWrapper(_ref) {
16
+ var children = _ref.children,
17
+ isEnabled = _ref.isEnabled,
18
+ onMouseDown = _ref.onMouseDown;
19
+ return isEnabled ? (0, _react.jsx)("div", {
20
+ css: (0, _react.css)({
21
+ flexGrow: 1
22
+ }),
23
+ onMouseDown: onMouseDown
24
+ }, children) : children;
25
+ };
26
+ var _default = exports.default = ValueContainerWrapper;
@@ -2,7 +2,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
3
  import { isCustom, isExternalUser } from './components/utils';
4
4
  const packageName = "@atlaskit/user-picker";
5
- const packageVersion = "10.13.3";
5
+ const packageVersion = "10.13.4";
6
6
  const UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
7
7
  const UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
8
8
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -1,12 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- /** @jsx jsx */
3
2
  import { components } from '@atlaskit/select';
4
3
  import React, { Fragment } from 'react';
5
- import { css, jsx } from '@emotion/react';
6
4
  import ReactDOM from 'react-dom';
7
5
  import { FormattedMessage } from 'react-intl-next';
8
6
  import { messages } from './i18n';
9
7
  import { isChildInput } from './utils';
8
+ import ValueContainerWrapper from './ValueContainerWrapper';
10
9
  export class MultiValueContainer extends React.PureComponent {
11
10
  static getDerivedStateFromProps(nextProps, prevState) {
12
11
  return {
@@ -45,7 +44,7 @@ export class MultiValueContainer extends React.PureComponent {
45
44
  const children = React.Children.map(this.props.children, child => isChildInput(child) && this.showPlaceholder() ? /*#__PURE__*/React.cloneElement(child, {
46
45
  placeholder
47
46
  }) : child);
48
- return jsx(Fragment, null, children);
47
+ return /*#__PURE__*/React.createElement(Fragment, null, children);
49
48
  });
50
49
  _defineProperty(this, "renderChildren", () => {
51
50
  const {
@@ -59,7 +58,7 @@ export class MultiValueContainer extends React.PureComponent {
59
58
  return this.props.children;
60
59
  }
61
60
  if (addMoreMessage === undefined) {
62
- return jsx(FormattedMessage, messages.addMore, addMore => {
61
+ return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, addMore => {
63
62
  var _join, _addMoreMessages;
64
63
  let addMoreMessages = addMore;
65
64
  if (addMore && typeof addMore === 'string') {
@@ -72,16 +71,6 @@ export class MultiValueContainer extends React.PureComponent {
72
71
  return this.addPlaceholder(addMoreMessage);
73
72
  });
74
73
  _defineProperty(this, "onValueContainerClick", this.props.selectProps.onValueContainerClick);
75
- _defineProperty(this, "Wrapper", ({
76
- children
77
- }) => {
78
- return this.onValueContainerClick ? jsx("div", {
79
- css: css({
80
- flexGrow: 1
81
- }),
82
- onMouseDown: this.onValueContainerClick
83
- }, children) : children;
84
- });
85
74
  this.state = {
86
75
  valueSize: 0,
87
76
  previousValueSize: 0
@@ -121,6 +110,9 @@ export class MultiValueContainer extends React.PureComponent {
121
110
  ...valueContainerProps,
122
111
  innerProps: this.valueContainerInnerProps
123
112
  };
124
- return jsx(this.Wrapper, null, jsx(components.ValueContainer, props, this.renderChildren()));
113
+ return /*#__PURE__*/React.createElement(ValueContainerWrapper, {
114
+ isEnabled: this.onValueContainerClick,
115
+ onMouseDown: this.onValueContainerClick
116
+ }, /*#__PURE__*/React.createElement(components.ValueContainer, props, this.renderChildren()));
125
117
  }
126
118
  }
@@ -1,10 +1,11 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  /** @jsx jsx */
3
- import React from 'react';
4
- import { css, jsx } from '@emotion/react';
5
3
  import { components } from '@atlaskit/select';
4
+ import { css, jsx } from '@emotion/react';
5
+ import React from 'react';
6
6
  import { SizeableAvatar } from './SizeableAvatar';
7
7
  import { BORDER_PADDING } from './styles';
8
+ import ValueContainerWrapper from './ValueContainerWrapper';
8
9
  const placeholderIconContainer = css({
9
10
  paddingLeft: `${BORDER_PADDING}px`,
10
11
  lineHeight: 0,
@@ -49,7 +50,10 @@ export class SingleValueContainer extends React.Component {
49
50
  children,
50
51
  ...valueContainerProps
51
52
  } = this.props;
52
- return jsx(this.Wrapper, null, jsx(components.ValueContainer, valueContainerProps, jsx("div", {
53
+ return jsx(ValueContainerWrapper, {
54
+ isEnabled: this.onValueContainerClick,
55
+ onMouseDown: this.onValueContainerClick
56
+ }, jsx(components.ValueContainer, valueContainerProps, jsx("div", {
53
57
  css: placeholderIconContainer
54
58
  }, this.renderAvatar()), children));
55
59
  }
@@ -0,0 +1,21 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+
4
+ /**
5
+ * Conditional wrapper for the ValueContainer in Select. Provides a workaround
6
+ * for issues using react-select on react-beautiful-dnd Draggable elements.
7
+ * @returns
8
+ */
9
+ const ValueContainerWrapper = ({
10
+ children,
11
+ isEnabled,
12
+ onMouseDown
13
+ }) => {
14
+ return isEnabled ? jsx("div", {
15
+ css: css({
16
+ flexGrow: 1
17
+ }),
18
+ onMouseDown: onMouseDown
19
+ }, children) : children;
20
+ };
21
+ export default ValueContainerWrapper;
@@ -5,7 +5,7 @@ import { createAndFireEvent } from '@atlaskit/analytics-next';
5
5
  import { v4 as uuidv4 } from 'uuid';
6
6
  import { isCustom, isExternalUser } from './components/utils';
7
7
  var packageName = "@atlaskit/user-picker";
8
- var packageVersion = "10.13.3";
8
+ var packageVersion = "10.13.4";
9
9
  var UUID_REGEXP_TEAMS_GROUPS = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
10
10
  var UUID_REGEXP_OLD_AAID = /^[a-fA-F0-9]{1,8}:[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
11
11
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -11,14 +11,13 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
11
11
  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; }
12
12
  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); }; }
13
13
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
- /** @jsx jsx */
15
14
  import { components } from '@atlaskit/select';
16
15
  import React, { Fragment } from 'react';
17
- import { css, jsx } from '@emotion/react';
18
16
  import ReactDOM from 'react-dom';
19
17
  import { FormattedMessage } from 'react-intl-next';
20
18
  import { messages } from './i18n';
21
19
  import { isChildInput } from './utils';
20
+ import ValueContainerWrapper from './ValueContainerWrapper';
22
21
  export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
23
22
  _inherits(MultiValueContainer, _React$PureComponent);
24
23
  var _super = _createSuper(MultiValueContainer);
@@ -49,7 +48,7 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
49
48
  placeholder: placeholder
50
49
  }) : child;
51
50
  });
52
- return jsx(Fragment, null, children);
51
+ return /*#__PURE__*/React.createElement(Fragment, null, children);
53
52
  });
54
53
  _defineProperty(_assertThisInitialized(_this), "renderChildren", function () {
55
54
  var _this$props$selectPro = _this.props.selectProps,
@@ -60,7 +59,7 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
60
59
  return _this.props.children;
61
60
  }
62
61
  if (addMoreMessage === undefined) {
63
- return jsx(FormattedMessage, messages.addMore, function (addMore) {
62
+ return /*#__PURE__*/React.createElement(FormattedMessage, messages.addMore, function (addMore) {
64
63
  var _join, _addMoreMessages;
65
64
  var addMoreMessages = addMore;
66
65
  if (addMore && typeof addMore === 'string') {
@@ -73,15 +72,6 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
73
72
  return _this.addPlaceholder(addMoreMessage);
74
73
  });
75
74
  _defineProperty(_assertThisInitialized(_this), "onValueContainerClick", _this.props.selectProps.onValueContainerClick);
76
- _defineProperty(_assertThisInitialized(_this), "Wrapper", function (_ref) {
77
- var children = _ref.children;
78
- return _this.onValueContainerClick ? jsx("div", {
79
- css: css({
80
- flexGrow: 1
81
- }),
82
- onMouseDown: _this.onValueContainerClick
83
- }, children) : children;
84
- });
85
75
  _this.state = {
86
76
  valueSize: 0,
87
77
  previousValueSize: 0
@@ -123,7 +113,10 @@ export var MultiValueContainer = /*#__PURE__*/function (_React$PureComponent) {
123
113
  var props = _objectSpread(_objectSpread({}, valueContainerProps), {}, {
124
114
  innerProps: this.valueContainerInnerProps
125
115
  });
126
- return jsx(this.Wrapper, null, jsx(components.ValueContainer, props, this.renderChildren()));
116
+ return /*#__PURE__*/React.createElement(ValueContainerWrapper, {
117
+ isEnabled: this.onValueContainerClick,
118
+ onMouseDown: this.onValueContainerClick
119
+ }, /*#__PURE__*/React.createElement(components.ValueContainer, props, this.renderChildren()));
127
120
  }
128
121
  }], [{
129
122
  key: "getDerivedStateFromProps",
@@ -10,11 +10,12 @@ var _excluded = ["children"];
10
10
  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); }; }
11
11
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12
12
  /** @jsx jsx */
13
- import React from 'react';
14
- import { css, jsx } from '@emotion/react';
15
13
  import { components } from '@atlaskit/select';
14
+ import { css, jsx } from '@emotion/react';
15
+ import React from 'react';
16
16
  import { SizeableAvatar } from './SizeableAvatar';
17
17
  import { BORDER_PADDING } from './styles';
18
+ import ValueContainerWrapper from './ValueContainerWrapper';
18
19
  var placeholderIconContainer = css({
19
20
  paddingLeft: "".concat(BORDER_PADDING, "px"),
20
21
  lineHeight: 0,
@@ -67,7 +68,10 @@ export var SingleValueContainer = /*#__PURE__*/function (_React$Component) {
67
68
  var _this$props2 = this.props,
68
69
  children = _this$props2.children,
69
70
  valueContainerProps = _objectWithoutProperties(_this$props2, _excluded);
70
- return jsx(this.Wrapper, null, jsx(components.ValueContainer, valueContainerProps, jsx("div", {
71
+ return jsx(ValueContainerWrapper, {
72
+ isEnabled: this.onValueContainerClick,
73
+ onMouseDown: this.onValueContainerClick
74
+ }, jsx(components.ValueContainer, valueContainerProps, jsx("div", {
71
75
  css: placeholderIconContainer
72
76
  }, this.renderAvatar()), children));
73
77
  }
@@ -0,0 +1,20 @@
1
+ /** @jsx jsx */
2
+ import { css, jsx } from '@emotion/react';
3
+
4
+ /**
5
+ * Conditional wrapper for the ValueContainer in Select. Provides a workaround
6
+ * for issues using react-select on react-beautiful-dnd Draggable elements.
7
+ * @returns
8
+ */
9
+ var ValueContainerWrapper = function ValueContainerWrapper(_ref) {
10
+ var children = _ref.children,
11
+ isEnabled = _ref.isEnabled,
12
+ onMouseDown = _ref.onMouseDown;
13
+ return isEnabled ? jsx("div", {
14
+ css: css({
15
+ flexGrow: 1
16
+ }),
17
+ onMouseDown: onMouseDown
18
+ }, children) : children;
19
+ };
20
+ export default ValueContainerWrapper;
@@ -1,8 +1,6 @@
1
- /** @jsx jsx */
2
1
  import { MultiValueProps } from '@atlaskit/select';
3
2
  import React from 'react';
4
- import { jsx } from '@emotion/react';
5
- import { User, Option } from '../types';
3
+ import { Option, User } from '../types';
6
4
  export type State = {
7
5
  valueSize: number;
8
6
  previousValueSize: number;
@@ -28,9 +26,6 @@ export declare class MultiValueContainer extends React.PureComponent<Props, Stat
28
26
  private addPlaceholder;
29
27
  private renderChildren;
30
28
  onValueContainerClick: any;
31
- Wrapper: ({ children }: {
32
- children: React.ReactElement;
33
- }) => jsx.JSX.Element;
34
- render(): jsx.JSX.Element;
29
+ render(): JSX.Element;
35
30
  }
36
31
  export {};
@@ -1,8 +1,8 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  import { ValueContainerProps } from '@atlaskit/select';
5
- import { User, Option } from '../types';
3
+ import { jsx } from '@emotion/react';
4
+ import React from 'react';
5
+ import { Option, User } from '../types';
6
6
  export declare class SingleValueContainer extends React.Component<ValueContainerProps<Option<User>>> {
7
7
  private renderAvatar;
8
8
  onValueContainerClick: any;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ /**
4
+ * Conditional wrapper for the ValueContainer in Select. Provides a workaround
5
+ * for issues using react-select on react-beautiful-dnd Draggable elements.
6
+ * @returns
7
+ */
8
+ declare const ValueContainerWrapper: ({ children, isEnabled, onMouseDown, }: {
9
+ children: React.ReactElement;
10
+ isEnabled: boolean;
11
+ onMouseDown: () => void;
12
+ }) => jsx.JSX.Element;
13
+ export default ValueContainerWrapper;
@@ -1,8 +1,6 @@
1
- /** @jsx jsx */
2
1
  import { MultiValueProps } from '@atlaskit/select';
3
2
  import React from 'react';
4
- import { jsx } from '@emotion/react';
5
- import { User, Option } from '../types';
3
+ import { Option, User } from '../types';
6
4
  export type State = {
7
5
  valueSize: number;
8
6
  previousValueSize: number;
@@ -28,9 +26,6 @@ export declare class MultiValueContainer extends React.PureComponent<Props, Stat
28
26
  private addPlaceholder;
29
27
  private renderChildren;
30
28
  onValueContainerClick: any;
31
- Wrapper: ({ children }: {
32
- children: React.ReactElement;
33
- }) => jsx.JSX.Element;
34
- render(): jsx.JSX.Element;
29
+ render(): JSX.Element;
35
30
  }
36
31
  export {};
@@ -1,8 +1,8 @@
1
1
  /** @jsx jsx */
2
- import React from 'react';
3
- import { jsx } from '@emotion/react';
4
2
  import { ValueContainerProps } from '@atlaskit/select';
5
- import { User, Option } from '../types';
3
+ import { jsx } from '@emotion/react';
4
+ import React from 'react';
5
+ import { Option, User } from '../types';
6
6
  export declare class SingleValueContainer extends React.Component<ValueContainerProps<Option<User>>> {
7
7
  private renderAvatar;
8
8
  onValueContainerClick: any;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { jsx } from '@emotion/react';
3
+ /**
4
+ * Conditional wrapper for the ValueContainer in Select. Provides a workaround
5
+ * for issues using react-select on react-beautiful-dnd Draggable elements.
6
+ * @returns
7
+ */
8
+ declare const ValueContainerWrapper: ({ children, isEnabled, onMouseDown, }: {
9
+ children: React.ReactElement;
10
+ isEnabled: boolean;
11
+ onMouseDown: () => void;
12
+ }) => jsx.JSX.Element;
13
+ export default ValueContainerWrapper;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.13.3",
3
+ "version": "10.13.4",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -44,8 +44,8 @@
44
44
  "@atlaskit/select": "^17.0.3",
45
45
  "@atlaskit/spinner": "^16.0.0",
46
46
  "@atlaskit/theme": "^12.6.0",
47
- "@atlaskit/tokens": "^1.30.0",
48
- "@atlaskit/tooltip": "^18.0.0",
47
+ "@atlaskit/tokens": "^1.33.0",
48
+ "@atlaskit/tooltip": "^18.1.0",
49
49
  "@atlaskit/ufo": "^0.2.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/analytics-viewer": "^0.5.0",
63
63
  "@atlaskit/elements-test-helpers": "^0.7.0",
64
64
  "@atlaskit/heading": "^1.4.0",
65
- "@atlaskit/primitives": "^1.15.0",
65
+ "@atlaskit/primitives": "^1.16.0",
66
66
  "@atlaskit/visual-regression": "*",
67
67
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
68
68
  "@emotion/styled": "^11.0.0",