@atlaskit/user-picker 10.29.1 → 10.30.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,19 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.30.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#101739](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101739)
8
+ [`b9f6cdeb8cfcb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b9f6cdeb8cfcb) -
9
+ Add support for React 18
10
+
11
+ ## 10.29.2
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies
16
+
3
17
  ## 10.29.1
4
18
 
5
19
  ### 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.29.1";
15
+ var packageVersion = "10.30.0";
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}$/;
@@ -32,6 +32,7 @@ var wrapper = function wrapper(isDisabled) {
32
32
  alignItems: 'center',
33
33
  boxSizing: 'border-box',
34
34
  display: 'flex',
35
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
35
36
  lineHeight: 1,
36
37
  outline: 'none',
37
38
  margin: 0,
@@ -46,6 +47,7 @@ var optionWrapper = (0, _react2.css)({
46
47
  maxWidth: '100%',
47
48
  minWidth: 0,
48
49
  flex: '1 1 100%',
50
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
49
51
  lineHeight: '1.4',
50
52
  paddingLeft: "var(--ds-space-100, 8px)"
51
53
  });
@@ -158,36 +158,33 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
158
158
  (0, _defineProperty2.default)(_this, "debouncedLoadOptions", (0, _debounce.default)(function (search) {
159
159
  var loadOptions = _this.props.loadOptions;
160
160
  if (loadOptions) {
161
- _this.setState(function (_ref3) {
162
- var previousRequest = _ref3.inflightRequest;
163
- var inflightRequest = previousRequest + 1;
164
- var result = _this.session && _this.session.id ? loadOptions(search, _this.session.id) : loadOptions(search);
165
- var addOptions = _this.addOptions.bind(_this, inflightRequest.toString());
166
- var count = 0;
167
- if ((0, _utils.isIterable)(result)) {
168
- var _iterator = _createForOfIteratorHelper(result),
169
- _step;
170
- try {
171
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
172
- var _value = _step.value;
173
- Promise.resolve(_value).then(addOptions).catch(_this.handleLoadOptionsError);
174
- count++;
175
- }
176
- } catch (err) {
177
- _iterator.e(err);
178
- } finally {
179
- _iterator.f();
161
+ var inflightRequest = _this.state.inflightRequest + 1;
162
+ var result = _this.session && _this.session.id ? loadOptions(search, _this.session.id) : loadOptions(search);
163
+ var addOptions = _this.addOptions.bind(_this, inflightRequest.toString());
164
+ var count = 0;
165
+ if ((0, _utils.isIterable)(result)) {
166
+ var _iterator = _createForOfIteratorHelper(result),
167
+ _step;
168
+ try {
169
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
170
+ var _value = _step.value;
171
+ Promise.resolve(_value).then(addOptions).catch(_this.handleLoadOptionsError);
172
+ count++;
180
173
  }
181
- } else {
182
- Promise.resolve(result).then(addOptions).catch(_this.handleLoadOptionsError);
183
- count++;
174
+ } catch (err) {
175
+ _iterator.e(err);
176
+ } finally {
177
+ _iterator.f();
184
178
  }
185
- return {
186
- inflightRequest: inflightRequest,
187
- count: count,
188
- resolving: count !== 0,
189
- options: []
190
- };
179
+ } else {
180
+ Promise.resolve(result).then(addOptions).catch(_this.handleLoadOptionsError);
181
+ count++;
182
+ }
183
+ _this.setState({
184
+ inflightRequest: inflightRequest,
185
+ count: count,
186
+ resolving: count !== 0,
187
+ options: []
191
188
  });
192
189
  }
193
190
  }, 200));
@@ -272,8 +269,8 @@ var BaseUserPickerWithoutAnalytics = exports.BaseUserPickerWithoutAnalytics = /*
272
269
  options: []
273
270
  });
274
271
  });
275
- (0, _defineProperty2.default)(_this, "handleInputChange", function (search, _ref4) {
276
- var action = _ref4.action;
272
+ (0, _defineProperty2.default)(_this, "handleInputChange", function (search, _ref3) {
273
+ var action = _ref3.action;
277
274
  if (action === 'input-change' || action === 'set-value') {
278
275
  (0, _utils.callCallback)(_this.props.onInputChange, search, _this.getSessionId());
279
276
  _this.setState({
@@ -18,6 +18,7 @@ var outerWrapper = function outerWrapper(isDisabled) {
18
18
  alignItems: 'center',
19
19
  boxSizing: 'border-box',
20
20
  display: 'flex',
21
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
21
22
  lineHeight: 1,
22
23
  outline: 'none',
23
24
  margin: 0,
@@ -33,6 +34,7 @@ var detailsWrapper = (0, _react.css)({
33
34
  maxWidth: '100%',
34
35
  minWidth: 0,
35
36
  flex: '1 1 100%',
37
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
36
38
  lineHeight: 1.4,
37
39
  paddingLeft: "var(--ds-space-100, 8px)",
38
40
  alignItems: 'center'
@@ -27,6 +27,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
27
27
  var placeholderIconContainer = (0, _react.css)({
28
28
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
29
29
  paddingLeft: _styles.BORDER_PADDING,
30
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
30
31
  lineHeight: 0,
31
32
  gridArea: '1/1/2/2'
32
33
  });
@@ -39,7 +39,9 @@ var UserPickerWithoutAnalytics = exports.UserPickerWithoutAnalytics = /*#__PURE_
39
39
  _this = _callSuper(this, UserPickerWithoutAnalytics, [props]);
40
40
  _this.ufoId = (0, _uuid.v4)();
41
41
  var experienceForId = _ufoExperiences.userPickerRenderedUfoExperience.getInstance(_this.ufoId);
42
- experienceForId.start();
42
+ if (![_ufo.UFOExperienceState.IN_PROGRESS.id, _ufo.UFOExperienceState.STARTED.id].includes(experienceForId.state.id)) {
43
+ experienceForId.start();
44
+ }
43
45
  return _this;
44
46
  }
45
47
  (0, _inherits2.default)(UserPickerWithoutAnalytics, _React$Component);
@@ -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.29.1";
5
+ const packageVersion = "10.30.0";
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}$/;
@@ -16,6 +16,7 @@ const wrapper = isDisabled => css({
16
16
  alignItems: 'center',
17
17
  boxSizing: 'border-box',
18
18
  display: 'flex',
19
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
19
20
  lineHeight: 1,
20
21
  outline: 'none',
21
22
  margin: 0,
@@ -29,6 +30,7 @@ const optionWrapper = css({
29
30
  maxWidth: '100%',
30
31
  minWidth: 0,
31
32
  flex: '1 1 100%',
33
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
32
34
  lineHeight: '1.4',
33
35
  paddingLeft: "var(--ds-space-100, 8px)"
34
36
  });
@@ -157,28 +157,24 @@ export class BaseUserPickerWithoutAnalytics extends React.Component {
157
157
  loadOptions
158
158
  } = this.props;
159
159
  if (loadOptions) {
160
- this.setState(({
161
- inflightRequest: previousRequest
162
- }) => {
163
- const inflightRequest = previousRequest + 1;
164
- const result = this.session && this.session.id ? loadOptions(search, this.session.id) : loadOptions(search);
165
- const addOptions = this.addOptions.bind(this, inflightRequest.toString());
166
- let count = 0;
167
- if (isIterable(result)) {
168
- for (const value of result) {
169
- Promise.resolve(value).then(addOptions).catch(this.handleLoadOptionsError);
170
- count++;
171
- }
172
- } else {
173
- Promise.resolve(result).then(addOptions).catch(this.handleLoadOptionsError);
160
+ const inflightRequest = this.state.inflightRequest + 1;
161
+ const result = this.session && this.session.id ? loadOptions(search, this.session.id) : loadOptions(search);
162
+ const addOptions = this.addOptions.bind(this, inflightRequest.toString());
163
+ let count = 0;
164
+ if (isIterable(result)) {
165
+ for (const value of result) {
166
+ Promise.resolve(value).then(addOptions).catch(this.handleLoadOptionsError);
174
167
  count++;
175
168
  }
176
- return {
177
- inflightRequest,
178
- count,
179
- resolving: count !== 0,
180
- options: []
181
- };
169
+ } else {
170
+ Promise.resolve(result).then(addOptions).catch(this.handleLoadOptionsError);
171
+ count++;
172
+ }
173
+ this.setState({
174
+ inflightRequest,
175
+ count,
176
+ resolving: count !== 0,
177
+ options: []
182
178
  });
183
179
  }
184
180
  }, 200));
@@ -10,6 +10,7 @@ const outerWrapper = isDisabled => css({
10
10
  alignItems: 'center',
11
11
  boxSizing: 'border-box',
12
12
  display: 'flex',
13
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
13
14
  lineHeight: 1,
14
15
  outline: 'none',
15
16
  margin: 0,
@@ -24,6 +25,7 @@ const detailsWrapper = css({
24
25
  maxWidth: '100%',
25
26
  minWidth: 0,
26
27
  flex: '1 1 100%',
28
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
27
29
  lineHeight: 1.4,
28
30
  paddingLeft: "var(--ds-space-100, 8px)",
29
31
  alignItems: 'center'
@@ -13,6 +13,7 @@ import ValueContainerWrapper from './ValueContainerWrapper';
13
13
  const placeholderIconContainer = css({
14
14
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
15
15
  paddingLeft: BORDER_PADDING,
16
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
16
17
  lineHeight: 0,
17
18
  gridArea: '1/1/2/2'
18
19
  });
@@ -18,7 +18,9 @@ export class UserPickerWithoutAnalytics extends React.Component {
18
18
  super(props);
19
19
  this.ufoId = uuidv4();
20
20
  const experienceForId = experience.getInstance(this.ufoId);
21
- experienceForId.start();
21
+ if (![UFOExperienceState.IN_PROGRESS.id, UFOExperienceState.STARTED.id].includes(experienceForId.state.id)) {
22
+ experienceForId.start();
23
+ }
22
24
  }
23
25
  componentDidMount() {
24
26
  const experienceForId = experience.getInstance(this.ufoId);
@@ -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.29.1";
8
+ var packageVersion = "10.30.0";
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}$/;
@@ -22,6 +22,7 @@ var wrapper = function wrapper(isDisabled) {
22
22
  alignItems: 'center',
23
23
  boxSizing: 'border-box',
24
24
  display: 'flex',
25
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
25
26
  lineHeight: 1,
26
27
  outline: 'none',
27
28
  margin: 0,
@@ -36,6 +37,7 @@ var optionWrapper = css({
36
37
  maxWidth: '100%',
37
38
  minWidth: 0,
38
39
  flex: '1 1 100%',
40
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
39
41
  lineHeight: '1.4',
40
42
  paddingLeft: "var(--ds-space-100, 8px)"
41
43
  });
@@ -151,36 +151,33 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
151
151
  _defineProperty(_this, "debouncedLoadOptions", debounce(function (search) {
152
152
  var loadOptions = _this.props.loadOptions;
153
153
  if (loadOptions) {
154
- _this.setState(function (_ref3) {
155
- var previousRequest = _ref3.inflightRequest;
156
- var inflightRequest = previousRequest + 1;
157
- var result = _this.session && _this.session.id ? loadOptions(search, _this.session.id) : loadOptions(search);
158
- var addOptions = _this.addOptions.bind(_this, inflightRequest.toString());
159
- var count = 0;
160
- if (isIterable(result)) {
161
- var _iterator = _createForOfIteratorHelper(result),
162
- _step;
163
- try {
164
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
165
- var _value = _step.value;
166
- Promise.resolve(_value).then(addOptions).catch(_this.handleLoadOptionsError);
167
- count++;
168
- }
169
- } catch (err) {
170
- _iterator.e(err);
171
- } finally {
172
- _iterator.f();
154
+ var inflightRequest = _this.state.inflightRequest + 1;
155
+ var result = _this.session && _this.session.id ? loadOptions(search, _this.session.id) : loadOptions(search);
156
+ var addOptions = _this.addOptions.bind(_this, inflightRequest.toString());
157
+ var count = 0;
158
+ if (isIterable(result)) {
159
+ var _iterator = _createForOfIteratorHelper(result),
160
+ _step;
161
+ try {
162
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
163
+ var _value = _step.value;
164
+ Promise.resolve(_value).then(addOptions).catch(_this.handleLoadOptionsError);
165
+ count++;
173
166
  }
174
- } else {
175
- Promise.resolve(result).then(addOptions).catch(_this.handleLoadOptionsError);
176
- count++;
167
+ } catch (err) {
168
+ _iterator.e(err);
169
+ } finally {
170
+ _iterator.f();
177
171
  }
178
- return {
179
- inflightRequest: inflightRequest,
180
- count: count,
181
- resolving: count !== 0,
182
- options: []
183
- };
172
+ } else {
173
+ Promise.resolve(result).then(addOptions).catch(_this.handleLoadOptionsError);
174
+ count++;
175
+ }
176
+ _this.setState({
177
+ inflightRequest: inflightRequest,
178
+ count: count,
179
+ resolving: count !== 0,
180
+ options: []
184
181
  });
185
182
  }
186
183
  }, 200));
@@ -265,8 +262,8 @@ export var BaseUserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Compon
265
262
  options: []
266
263
  });
267
264
  });
268
- _defineProperty(_this, "handleInputChange", function (search, _ref4) {
269
- var action = _ref4.action;
265
+ _defineProperty(_this, "handleInputChange", function (search, _ref3) {
266
+ var action = _ref3.action;
270
267
  if (action === 'input-change' || action === 'set-value') {
271
268
  callCallback(_this.props.onInputChange, search, _this.getSessionId());
272
269
  _this.setState({
@@ -14,6 +14,7 @@ var outerWrapper = function outerWrapper(isDisabled) {
14
14
  alignItems: 'center',
15
15
  boxSizing: 'border-box',
16
16
  display: 'flex',
17
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
17
18
  lineHeight: 1,
18
19
  outline: 'none',
19
20
  margin: 0,
@@ -29,6 +30,7 @@ var detailsWrapper = css({
29
30
  maxWidth: '100%',
30
31
  minWidth: 0,
31
32
  flex: '1 1 100%',
33
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
32
34
  lineHeight: 1.4,
33
35
  paddingLeft: "var(--ds-space-100, 8px)",
34
36
  alignItems: 'center'
@@ -22,6 +22,7 @@ import ValueContainerWrapper from './ValueContainerWrapper';
22
22
  var placeholderIconContainer = css({
23
23
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
24
24
  paddingLeft: BORDER_PADDING,
25
+ // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
25
26
  lineHeight: 0,
26
27
  gridArea: '1/1/2/2'
27
28
  });
@@ -29,7 +29,9 @@ export var UserPickerWithoutAnalytics = /*#__PURE__*/function (_React$Component)
29
29
  _this = _callSuper(this, UserPickerWithoutAnalytics, [props]);
30
30
  _this.ufoId = uuidv4();
31
31
  var experienceForId = experience.getInstance(_this.ufoId);
32
- experienceForId.start();
32
+ if (![UFOExperienceState.IN_PROGRESS.id, UFOExperienceState.STARTED.id].includes(experienceForId.state.id)) {
33
+ experienceForId.start();
34
+ }
33
35
  return _this;
34
36
  }
35
37
  _inherits(UserPickerWithoutAnalytics, _React$Component);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.29.1",
3
+ "version": "10.30.0",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,6 +29,7 @@
29
29
  "./types": "./src/types.ts"
30
30
  },
31
31
  "atlassian": {
32
+ "runReact18": true,
32
33
  "team": "Search Platform: Search Experience",
33
34
  "slack": {
34
35
  "channel": "#search-plex-prs",
@@ -48,7 +49,7 @@
48
49
  "dependencies": {
49
50
  "@atlaskit/analytics-next": "^10.2.0",
50
51
  "@atlaskit/avatar": "^21.17.0",
51
- "@atlaskit/icon": "^23.1.0",
52
+ "@atlaskit/icon": "^23.4.0",
52
53
  "@atlaskit/logo": "^15.1.0",
53
54
  "@atlaskit/lozenge": "^11.12.0",
54
55
  "@atlaskit/people-teams-ui-public": "^2.0.0",
@@ -59,7 +60,7 @@
59
60
  "@atlaskit/spinner": "^16.3.0",
60
61
  "@atlaskit/teams-avatar": "^1.1.0",
61
62
  "@atlaskit/theme": "^14.0.0",
62
- "@atlaskit/tokens": "^2.5.0",
63
+ "@atlaskit/tokens": "^3.1.0",
63
64
  "@atlaskit/tooltip": "^19.0.0",
64
65
  "@atlaskit/ufo": "^0.3.0",
65
66
  "@babel/runtime": "^7.0.0",
@@ -69,8 +70,8 @@
69
70
  "uuid": "^3.1.0"
70
71
  },
71
72
  "peerDependencies": {
72
- "react": "^16.8.0",
73
- "react-dom": "^16.8.0",
73
+ "react": "^16.8.0 || ^17.0.0 || ^18.2.0",
74
+ "react-dom": "^16.8.0 || ^17.0.0 || ^18.2.0",
74
75
  "react-intl-next": "npm:react-intl@^5.18.1"
75
76
  },
76
77
  "devDependencies": {
package/tsconfig.json CHANGED
@@ -9,6 +9,5 @@
9
9
  "./examples/**/*.tsx"
10
10
  ],
11
11
  "compilerOptions": {
12
- "baseUrl": "./"
13
12
  }
14
13
  }