@atlaskit/user-picker 10.16.0 → 10.17.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,17 @@
1
1
  # @atlaskit/user-picker
2
2
 
3
+ ## 10.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#73914](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/73914) [`ca85dd7a4109`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ca85dd7a4109) - Added ExternalUserType and exported it in the public API
8
+
9
+ ## 10.16.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#70460](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70460) [`2f37600156ae`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f37600156ae) - The internal composition of a component in this package has changed. There is no expected change in behaviour.
14
+
3
15
  ## 10.16.0
4
16
 
5
17
  ### Minor 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.16.0";
15
+ var packageVersion = "10.17.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}$/;
@@ -16,6 +16,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/ge
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _react = _interopRequireDefault(require("react"));
18
18
  var _reactIntlNext = require("react-intl-next");
19
+ var _primitives = require("@atlaskit/primitives");
19
20
  var _select = require("@atlaskit/select");
20
21
  var _react2 = require("@emotion/react");
21
22
  var _AddOptionAvatar = require("./AddOptionAvatar");
@@ -39,8 +40,8 @@ var scrollToValue = exports.scrollToValue = function scrollToValue(valueContaine
39
40
  valueContainer.scrollIntoView(false);
40
41
  }
41
42
  };
42
- var groupTagContainer = (0, _react2.css)({
43
- paddingLeft: "var(--ds-space-025, 2px)"
43
+ var groupTagContainer = (0, _primitives.xcss)({
44
+ paddingLeft: 'space.025'
44
45
  });
45
46
  var nameWrapper = (0, _react2.css)({
46
47
  paddingLeft: '5px'
@@ -68,8 +69,8 @@ var MultiValue = exports.MultiValue = /*#__PURE__*/function (_React$Component) {
68
69
  });
69
70
  }
70
71
  if ((0, _utils.isGroup)(data)) {
71
- return (0, _react2.jsx)("div", {
72
- css: groupTagContainer
72
+ return (0, _react2.jsx)(_primitives.Box, {
73
+ xcss: groupTagContainer
73
74
  }, (0, _react2.jsx)(_people.default, {
74
75
  label: "group-icon",
75
76
  size: "small"
@@ -13,7 +13,7 @@ var _select = require("@atlaskit/select");
13
13
  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; }
14
14
  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; }
15
15
  var isExternalUser = exports.isExternalUser = function isExternalUser(option) {
16
- return isUser(option) && Boolean(option.isExternal);
16
+ return option.type === _types.ExternalUserType || Boolean(option.isExternal);
17
17
  };
18
18
  var isUser = exports.isUser = function isUser(option) {
19
19
  return option.type === undefined || option.type === _types.UserType;
package/dist/cjs/index.js CHANGED
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "EmailType", {
15
15
  return _types.EmailType;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "ExternalUserType", {
19
+ enumerable: true,
20
+ get: function get() {
21
+ return _types.ExternalUserType;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "GroupType", {
19
25
  enumerable: true,
20
26
  get: function get() {
package/dist/cjs/types.js CHANGED
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.UserType = exports.TeamType = exports.GroupType = exports.EmailType = exports.CustomType = void 0;
6
+ exports.UserType = exports.TeamType = exports.GroupType = exports.ExternalUserType = exports.EmailType = exports.CustomType = void 0;
7
7
  var UserType = exports.UserType = 'user';
8
+ var ExternalUserType = exports.ExternalUserType = 'external_user';
8
9
  var TeamType = exports.TeamType = 'team';
9
10
  var GroupType = exports.GroupType = 'group';
10
11
 
@@ -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.16.0";
5
+ const packageVersion = "10.17.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}$/;
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  /** @jsx jsx */
4
4
  import React from 'react';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
+ import { Box, xcss } from '@atlaskit/primitives';
6
7
  import { components } from '@atlaskit/select';
7
8
  import { css, jsx } from '@emotion/react';
8
9
  import { AddOptionAvatar } from './AddOptionAvatar';
@@ -25,8 +26,8 @@ export const scrollToValue = (valueContainer, control) => {
25
26
  valueContainer.scrollIntoView(false);
26
27
  }
27
28
  };
28
- const groupTagContainer = css({
29
- paddingLeft: "var(--ds-space-025, 2px)"
29
+ const groupTagContainer = xcss({
30
+ paddingLeft: 'space.025'
30
31
  });
31
32
  const nameWrapper = css({
32
33
  paddingLeft: '5px'
@@ -51,8 +52,8 @@ export class MultiValue extends React.Component {
51
52
  }));
52
53
  }
53
54
  if (isGroup(data)) {
54
- return jsx("div", {
55
- css: groupTagContainer
55
+ return jsx(Box, {
56
+ xcss: groupTagContainer
56
57
  }, jsx(PeopleIcon, {
57
58
  label: "group-icon",
58
59
  size: "small"
@@ -1,7 +1,7 @@
1
1
  import memoizeOne from 'memoize-one';
2
- import { CustomType, EmailType, TeamType, GroupType, UserType } from '../types';
2
+ import { CustomType, EmailType, TeamType, GroupType, UserType, ExternalUserType } from '../types';
3
3
  import { PopupSelect } from '@atlaskit/select';
4
- export const isExternalUser = option => isUser(option) && Boolean(option.isExternal);
4
+ export const isExternalUser = option => option.type === ExternalUserType || Boolean(option.isExternal);
5
5
  export const isUser = option => option.type === undefined || option.type === UserType;
6
6
  export const isTeam = option => option.type === TeamType;
7
7
  export const isGroup = option => option.type === GroupType;
@@ -4,4 +4,4 @@ export { PopupUserPicker } from './components/PopupUserPicker';
4
4
  export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
5
5
  export {
6
6
  // Constants
7
- CustomType, EmailType, GroupType, TeamType, UserType } from './types';
7
+ CustomType, EmailType, GroupType, TeamType, UserType, ExternalUserType } from './types';
@@ -1,4 +1,5 @@
1
1
  export const UserType = 'user';
2
+ export const ExternalUserType = 'external_user';
2
3
  export const TeamType = 'team';
3
4
  export const GroupType = 'group';
4
5
 
@@ -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.16.0";
8
+ var packageVersion = "10.17.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}$/;
@@ -13,6 +13,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
13
13
  /** @jsx jsx */
14
14
  import React from 'react';
15
15
  import { FormattedMessage } from 'react-intl-next';
16
+ import { Box, xcss } from '@atlaskit/primitives';
16
17
  import { components } from '@atlaskit/select';
17
18
  import { css, jsx } from '@emotion/react';
18
19
  import { AddOptionAvatar } from './AddOptionAvatar';
@@ -33,8 +34,8 @@ export var scrollToValue = function scrollToValue(valueContainer, control) {
33
34
  valueContainer.scrollIntoView(false);
34
35
  }
35
36
  };
36
- var groupTagContainer = css({
37
- paddingLeft: "var(--ds-space-025, 2px)"
37
+ var groupTagContainer = xcss({
38
+ paddingLeft: 'space.025'
38
39
  });
39
40
  var nameWrapper = css({
40
41
  paddingLeft: '5px'
@@ -62,8 +63,8 @@ export var MultiValue = /*#__PURE__*/function (_React$Component) {
62
63
  });
63
64
  }
64
65
  if (isGroup(data)) {
65
- return jsx("div", {
66
- css: groupTagContainer
66
+ return jsx(Box, {
67
+ xcss: groupTagContainer
67
68
  }, jsx(PeopleIcon, {
68
69
  label: "group-icon",
69
70
  size: "small"
@@ -3,10 +3,10 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  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; }
4
4
  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; }
5
5
  import memoizeOne from 'memoize-one';
6
- import { CustomType, EmailType, TeamType, GroupType, UserType } from '../types';
6
+ import { CustomType, EmailType, TeamType, GroupType, UserType, ExternalUserType } from '../types';
7
7
  import { PopupSelect } from '@atlaskit/select';
8
8
  export var isExternalUser = function isExternalUser(option) {
9
- return isUser(option) && Boolean(option.isExternal);
9
+ return option.type === ExternalUserType || Boolean(option.isExternal);
10
10
  };
11
11
  export var isUser = function isUser(option) {
12
12
  return option.type === undefined || option.type === UserType;
package/dist/esm/index.js CHANGED
@@ -4,4 +4,4 @@ export { PopupUserPicker } from './components/PopupUserPicker';
4
4
  export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
5
5
  export {
6
6
  // Constants
7
- CustomType, EmailType, GroupType, TeamType, UserType } from './types';
7
+ CustomType, EmailType, GroupType, TeamType, UserType, ExternalUserType } from './types';
package/dist/esm/types.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export var UserType = 'user';
2
+ export var ExternalUserType = 'external_user';
2
3
  export var TeamType = 'team';
3
4
  export var GroupType = 'group';
4
5
 
@@ -3,5 +3,5 @@ export type { EmailValidationResponse, EmailValidator, } from './components/emai
3
3
  export { UserPicker as default } from './components/UserPicker';
4
4
  export { PopupUserPicker } from './components/PopupUserPicker';
5
5
  export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
6
- export { CustomType, EmailType, GroupType, TeamType, UserType, } from './types';
6
+ export { CustomType, EmailType, GroupType, TeamType, UserType, ExternalUserType, } from './types';
7
7
  export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, UserPickerProps, UserPickerState, Value, Custom, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamMember, TeamHighlight, User, UserHighlight, ExternalUser, UserSource, } from './types';
@@ -242,6 +242,7 @@ export interface OptionData {
242
242
  tooltip?: string;
243
243
  }
244
244
  export declare const UserType = "user";
245
+ export declare const ExternalUserType = "external_user";
245
246
  export type UserSource = 'google' | 'slack' | 'microsoft' | 'jira' | 'confluence' | 'other-atlassian';
246
247
  export interface ExternalUser extends User {
247
248
  externalUserType?: 'crossSite' | 'thirdParty';
@@ -3,5 +3,5 @@ export type { EmailValidationResponse, EmailValidator, } from './components/emai
3
3
  export { UserPicker as default } from './components/UserPicker';
4
4
  export { PopupUserPicker } from './components/PopupUserPicker';
5
5
  export { isEmail, isExternalUser, isTeam, isUser } from './components/utils';
6
- export { CustomType, EmailType, GroupType, TeamType, UserType, } from './types';
6
+ export { CustomType, EmailType, GroupType, TeamType, UserType, ExternalUserType, } from './types';
7
7
  export type { ActionTypes, Appearance, AtlasKitSelectChange, AtlaskitSelectValue, DefaultValue, InputActionTypes, LozengeProps, OnChange, OnInputChange, OnOption, OnPicker, Option, OptionData, OptionIdentifier, PopupUserPickerProps, Promisable, Target, UserPickerProps, UserPickerState, Value, Custom, Email, Group, GroupHighlight, HighlightRange, LoadOptions, Team, TeamMember, TeamHighlight, User, UserHighlight, ExternalUser, UserSource, } from './types';
@@ -245,6 +245,7 @@ export interface OptionData {
245
245
  tooltip?: string;
246
246
  }
247
247
  export declare const UserType = "user";
248
+ export declare const ExternalUserType = "external_user";
248
249
  export type UserSource = 'google' | 'slack' | 'microsoft' | 'jira' | 'confluence' | 'other-atlassian';
249
250
  export interface ExternalUser extends User {
250
251
  externalUserType?: 'crossSite' | 'thirdParty';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "10.16.0",
3
+ "version": "10.17.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/"
@@ -50,10 +50,10 @@
50
50
  "@atlaskit/platform-feature-flags": "^0.2.0",
51
51
  "@atlaskit/popper": "^5.5.0",
52
52
  "@atlaskit/primitives": "^2.0.0",
53
- "@atlaskit/select": "^17.0.3",
53
+ "@atlaskit/select": "^17.1.0",
54
54
  "@atlaskit/spinner": "^16.0.0",
55
55
  "@atlaskit/theme": "^12.6.0",
56
- "@atlaskit/tokens": "^1.35.0",
56
+ "@atlaskit/tokens": "^1.37.0",
57
57
  "@atlaskit/tooltip": "^18.1.0",
58
58
  "@atlaskit/ufo": "^0.2.0",
59
59
  "@babel/runtime": "^7.0.0",