@atlaskit/user-picker 11.25.7 → 11.25.8

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
+ ## 11.25.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
3
9
  ## 11.25.7
4
10
 
5
11
  ### Patch Changes
@@ -8,13 +8,14 @@ exports.userInfoEvent = exports.startSession = exports.selectEvent = exports.sea
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _analyticsNext = require("@atlaskit/analytics-next");
10
10
  var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _uuid = require("uuid");
12
13
  var _utils = require("./components/utils");
13
14
  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
15
  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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
15
16
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
16
17
  var packageName = "@atlaskit/user-picker";
17
- var packageVersion = "11.25.6";
18
+ var packageVersion = "0.0.0-development";
18
19
  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}$/;
19
20
  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}$/;
20
21
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -77,13 +78,24 @@ var buildValueForAnalytics = function buildValueForAnalytics(value) {
77
78
  }
78
79
  return [];
79
80
  };
80
- var createDefaultPickerAttributes = function createDefaultPickerAttributes(props, session, journeyId) {
81
+ /**
82
+ * `customGroupLabels` values are React nodes; analytics only records that custom labels are in use.
83
+ */
84
+ var customGroupLabelsAnalyticsAttributes = function customGroupLabelsAnalyticsAttributes(props) {
85
+ if (!props.customGroupLabels) {
86
+ return {};
87
+ }
81
88
  return {
89
+ hasCustomGroupLabels: true
90
+ };
91
+ };
92
+ var createDefaultPickerAttributes = function createDefaultPickerAttributes(props, session, journeyId) {
93
+ return _objectSpread({
82
94
  context: props.fieldId,
83
95
  sessionId: sessionId(session),
84
96
  pickerType: pickerType(props),
85
97
  journeyId: journeyId
86
- };
98
+ }, (0, _platformFeatureFlags.fg)('jsm-wfo-assignee-recommendation-on-queues') ? customGroupLabelsAnalyticsAttributes(props) : {});
87
99
  };
88
100
  var focusEvent = exports.focusEvent = function focusEvent(props, state, session, journeyId) {
89
101
  return createEvent('ui', 'focused', 'userPicker', _objectSpread(_objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)), {}, {
@@ -1,11 +1,12 @@
1
1
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
2
2
  import { createAndFireEvent } from '@atlaskit/analytics-next';
3
3
  import FeatureGates from '@atlaskit/feature-gate-js-client';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
5
6
  import { v4 as uuidv4 } from 'uuid';
6
7
  import { isCustom, isExternalUser } from './components/utils';
7
8
  const packageName = "@atlaskit/user-picker";
8
- const packageVersion = "11.25.6";
9
+ const packageVersion = "0.0.0-development";
9
10
  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}$/;
10
11
  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}$/;
11
12
  const UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -67,11 +68,23 @@ const buildValueForAnalytics = value => {
67
68
  }
68
69
  return [];
69
70
  };
71
+ /**
72
+ * `customGroupLabels` values are React nodes; analytics only records that custom labels are in use.
73
+ */
74
+ const customGroupLabelsAnalyticsAttributes = props => {
75
+ if (!props.customGroupLabels) {
76
+ return {};
77
+ }
78
+ return {
79
+ hasCustomGroupLabels: true
80
+ };
81
+ };
70
82
  const createDefaultPickerAttributes = (props, session, journeyId) => ({
71
83
  context: props.fieldId,
72
84
  sessionId: sessionId(session),
73
85
  pickerType: pickerType(props),
74
- journeyId
86
+ journeyId,
87
+ ...(fg('jsm-wfo-assignee-recommendation-on-queues') ? customGroupLabelsAnalyticsAttributes(props) : {})
75
88
  });
76
89
  export const focusEvent = (props, state, session, journeyId) => createEvent('ui', 'focused', 'userPicker', {
77
90
  ...createDefaultPickerAttributes(props, session, journeyId),
@@ -4,11 +4,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
4
4
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
5
5
  import { createAndFireEvent } from '@atlaskit/analytics-next';
6
6
  import FeatureGates from '@atlaskit/feature-gate-js-client';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
8
9
  import { v4 as uuidv4 } from 'uuid';
9
10
  import { isCustom, isExternalUser } from './components/utils';
10
11
  var packageName = "@atlaskit/user-picker";
11
- var packageVersion = "11.25.6";
12
+ var packageVersion = "0.0.0-development";
12
13
  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}$/;
13
14
  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}$/;
14
15
  var UUID_REGEXP_NEW_AAID = /^[a-fA-F0-9]{24,24}$/;
@@ -71,13 +72,24 @@ var buildValueForAnalytics = function buildValueForAnalytics(value) {
71
72
  }
72
73
  return [];
73
74
  };
74
- var createDefaultPickerAttributes = function createDefaultPickerAttributes(props, session, journeyId) {
75
+ /**
76
+ * `customGroupLabels` values are React nodes; analytics only records that custom labels are in use.
77
+ */
78
+ var customGroupLabelsAnalyticsAttributes = function customGroupLabelsAnalyticsAttributes(props) {
79
+ if (!props.customGroupLabels) {
80
+ return {};
81
+ }
75
82
  return {
83
+ hasCustomGroupLabels: true
84
+ };
85
+ };
86
+ var createDefaultPickerAttributes = function createDefaultPickerAttributes(props, session, journeyId) {
87
+ return _objectSpread({
76
88
  context: props.fieldId,
77
89
  sessionId: sessionId(session),
78
90
  pickerType: pickerType(props),
79
91
  journeyId: journeyId
80
- };
92
+ }, fg('jsm-wfo-assignee-recommendation-on-queues') ? customGroupLabelsAnalyticsAttributes(props) : {});
81
93
  };
82
94
  export var focusEvent = function focusEvent(props, state, session, journeyId) {
83
95
  return createEvent('ui', 'focused', 'userPicker', _objectSpread(_objectSpread({}, createDefaultPickerAttributes(props, session, journeyId)), {}, {
@@ -111,50 +111,33 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
111
111
  shouldFlip?: boolean;
112
112
  target: Target;
113
113
  }, keyof WithAnalyticsEventsProps>, never> & {
114
- footer?: React.ReactNode;
115
- header?: React.ReactNode;
116
- search?: string | undefined;
117
- appearance?: Appearance | undefined;
118
- height?: number | string | undefined;
119
- minHeight?: number | string | undefined;
120
- width?: number | string | undefined;
121
- offset?: [number, number] | undefined;
122
- shouldFlip?: boolean | undefined;
123
- boundariesElement?: BoundariesElement | undefined;
124
- placement?: Placement | undefined;
125
- anchor?: React.ComponentType<any> | undefined;
126
- onInputChange?: OnInputChange | undefined;
127
- onSelection?: OnOption | undefined;
128
- options?: OptionData[] | undefined;
129
- required?: boolean | undefined;
130
- name?: string | undefined;
131
- placeholder?: React.ReactNode;
132
- value?: Value;
133
- onChange?: OnChange | undefined;
134
- defaultValue?: DefaultValue;
135
- autoFocus?: boolean | undefined;
136
- onFocus?: OnPicker | undefined;
137
- onBlur?: OnPicker | undefined;
138
- onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined;
139
- isDisabled?: boolean | undefined;
140
114
  addMoreMessage?: string | undefined;
141
115
  allowEmail?: boolean | undefined;
116
+ anchor?: React.ComponentType<any> | undefined;
117
+ appearance?: Appearance | undefined;
142
118
  ariaDescribedBy?: string | undefined;
143
119
  ariaLabel?: string | undefined;
144
120
  ariaLabelledBy?: string | undefined;
145
121
  ariaLive?: 'polite' | 'off' | 'assertive' | undefined;
122
+ autoFocus?: boolean | undefined;
123
+ boundariesElement?: BoundariesElement | undefined;
146
124
  captureMenuScroll?: boolean | undefined;
147
125
  clearValueLabel?: string | undefined;
148
126
  closeMenuOnScroll?: (boolean | EventListener) | undefined;
149
127
  components?: SelectComponentsConfig<OptionData, boolean> | undefined;
128
+ defaultValue?: DefaultValue;
150
129
  disableInput?: boolean | undefined;
151
130
  emailLabel?: string | undefined;
152
131
  fieldId?: string | null | undefined;
132
+ footer?: React.ReactNode;
153
133
  forwardedRef?: React.ForwardedRef<UserPickerRef> | undefined;
154
134
  groupByTypeOrder?: NonNullable<OptionData['type']>[] | undefined;
135
+ header?: React.ReactNode;
136
+ height?: number | string | undefined;
155
137
  includeTeamsUpdates?: boolean | undefined;
156
138
  inputId?: string | undefined;
157
139
  isClearable?: boolean | undefined;
140
+ isDisabled?: boolean | undefined;
158
141
  isFooterFocused?: boolean | undefined;
159
142
  isHeaderFocused?: boolean | undefined;
160
143
  isInvalid?: boolean | undefined;
@@ -173,31 +156,48 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
173
156
  menuPortalTarget?: HTMLElement | undefined;
174
157
  menuPosition?: 'absolute' | 'fixed' | undefined;
175
158
  menuShouldBlockScroll?: boolean | undefined;
159
+ minHeight?: number | string | undefined;
160
+ name?: string | undefined;
176
161
  noBorder?: boolean | undefined;
177
162
  noOptionsMessage?: React.ReactNode | ((value: {
178
163
  inputValue: string;
179
164
  }) => string | null | React.ReactNode);
165
+ offset?: [number, number] | undefined;
166
+ onBlur?: OnPicker | undefined;
167
+ onChange?: OnChange | undefined;
180
168
  onClear?: OnPicker | undefined;
181
169
  onClose?: OnPicker | undefined;
170
+ onFocus?: OnPicker | undefined;
171
+ onInputChange?: OnInputChange | undefined;
172
+ onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined;
182
173
  onOpen?: OnPicker | undefined;
174
+ onSelection?: OnOption | undefined;
183
175
  open?: boolean | undefined;
184
176
  openMenuOnClick?: boolean | undefined;
177
+ options?: OptionData[] | undefined;
178
+ placeholder?: React.ReactNode;
185
179
  placeholderAvatar?: 'person' | 'team' | undefined;
180
+ placement?: Placement | undefined;
186
181
  popupSelectProps?: PopupSelectProps<OptionData> | undefined;
182
+ popupTitle?: string | undefined;
183
+ required?: boolean | undefined;
184
+ rootBoundary?: RootBoundary | undefined;
185
+ search?: string | undefined;
187
186
  setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
188
187
  setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
188
+ shouldFlip?: boolean | undefined;
189
189
  showClearIndicator?: boolean | undefined;
190
190
  strategy?: 'fixed' | 'absolute' | undefined;
191
191
  styles?: StylesConfig | undefined;
192
192
  subtle?: boolean | undefined;
193
193
  suggestEmailsForDomain?: string | undefined;
194
+ target?: Target | undefined;
194
195
  textFieldBackgroundColor?: boolean | undefined;
195
196
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
196
- popupTitle?: string | undefined;
197
- rootBoundary?: RootBoundary | undefined;
198
- target?: Target | undefined;
197
+ value?: Value;
198
+ width?: number | string | undefined;
199
199
  } & {
200
- ref?: React.Ref<any> | undefined;
201
200
  createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined;
201
+ ref?: React.Ref<any> | undefined;
202
202
  }, 'ref'> & React.RefAttributes<any>>;
203
203
  export {};
@@ -114,53 +114,33 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
114
114
  shouldFlip?: boolean;
115
115
  target: Target;
116
116
  }, keyof WithAnalyticsEventsProps>, never> & {
117
- footer?: React.ReactNode;
118
- header?: React.ReactNode;
119
- search?: string | undefined;
120
- appearance?: Appearance | undefined;
121
- height?: number | string | undefined;
122
- minHeight?: number | string | undefined;
123
- width?: number | string | undefined;
124
- offset?: [
125
- number,
126
- number
127
- ] | undefined;
128
- shouldFlip?: boolean | undefined;
129
- boundariesElement?: BoundariesElement | undefined;
130
- placement?: Placement | undefined;
131
- anchor?: React.ComponentType<any> | undefined;
132
- onInputChange?: OnInputChange | undefined;
133
- onSelection?: OnOption | undefined;
134
- options?: OptionData[] | undefined;
135
- required?: boolean | undefined;
136
- name?: string | undefined;
137
- placeholder?: React.ReactNode;
138
- value?: Value;
139
- onChange?: OnChange | undefined;
140
- defaultValue?: DefaultValue;
141
- autoFocus?: boolean | undefined;
142
- onFocus?: OnPicker | undefined;
143
- onBlur?: OnPicker | undefined;
144
- onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined;
145
- isDisabled?: boolean | undefined;
146
117
  addMoreMessage?: string | undefined;
147
118
  allowEmail?: boolean | undefined;
119
+ anchor?: React.ComponentType<any> | undefined;
120
+ appearance?: Appearance | undefined;
148
121
  ariaDescribedBy?: string | undefined;
149
122
  ariaLabel?: string | undefined;
150
123
  ariaLabelledBy?: string | undefined;
151
124
  ariaLive?: 'polite' | 'off' | 'assertive' | undefined;
125
+ autoFocus?: boolean | undefined;
126
+ boundariesElement?: BoundariesElement | undefined;
152
127
  captureMenuScroll?: boolean | undefined;
153
128
  clearValueLabel?: string | undefined;
154
129
  closeMenuOnScroll?: (boolean | EventListener) | undefined;
155
130
  components?: SelectComponentsConfig<OptionData, boolean> | undefined;
131
+ defaultValue?: DefaultValue;
156
132
  disableInput?: boolean | undefined;
157
133
  emailLabel?: string | undefined;
158
134
  fieldId?: string | null | undefined;
135
+ footer?: React.ReactNode;
159
136
  forwardedRef?: React.ForwardedRef<UserPickerRef> | undefined;
160
137
  groupByTypeOrder?: NonNullable<OptionData['type']>[] | undefined;
138
+ header?: React.ReactNode;
139
+ height?: number | string | undefined;
161
140
  includeTeamsUpdates?: boolean | undefined;
162
141
  inputId?: string | undefined;
163
142
  isClearable?: boolean | undefined;
143
+ isDisabled?: boolean | undefined;
164
144
  isFooterFocused?: boolean | undefined;
165
145
  isHeaderFocused?: boolean | undefined;
166
146
  isInvalid?: boolean | undefined;
@@ -179,31 +159,51 @@ export declare const PopupUserPicker: React.ForwardRefExoticComponent<Omit<Pick<
179
159
  menuPortalTarget?: HTMLElement | undefined;
180
160
  menuPosition?: 'absolute' | 'fixed' | undefined;
181
161
  menuShouldBlockScroll?: boolean | undefined;
162
+ minHeight?: number | string | undefined;
163
+ name?: string | undefined;
182
164
  noBorder?: boolean | undefined;
183
165
  noOptionsMessage?: React.ReactNode | ((value: {
184
166
  inputValue: string;
185
167
  }) => string | null | React.ReactNode);
168
+ offset?: [
169
+ number,
170
+ number
171
+ ] | undefined;
172
+ onBlur?: OnPicker | undefined;
173
+ onChange?: OnChange | undefined;
186
174
  onClear?: OnPicker | undefined;
187
175
  onClose?: OnPicker | undefined;
176
+ onFocus?: OnPicker | undefined;
177
+ onInputChange?: OnInputChange | undefined;
178
+ onKeyDown?: ((event: React.KeyboardEvent) => void) | undefined;
188
179
  onOpen?: OnPicker | undefined;
180
+ onSelection?: OnOption | undefined;
189
181
  open?: boolean | undefined;
190
182
  openMenuOnClick?: boolean | undefined;
183
+ options?: OptionData[] | undefined;
184
+ placeholder?: React.ReactNode;
191
185
  placeholderAvatar?: 'person' | 'team' | undefined;
186
+ placement?: Placement | undefined;
192
187
  popupSelectProps?: PopupSelectProps<OptionData> | undefined;
188
+ popupTitle?: string | undefined;
189
+ required?: boolean | undefined;
190
+ rootBoundary?: RootBoundary | undefined;
191
+ search?: string | undefined;
193
192
  setIsFooterFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
194
193
  setIsHeaderFocused?: React.Dispatch<React.SetStateAction<boolean>> | undefined;
194
+ shouldFlip?: boolean | undefined;
195
195
  showClearIndicator?: boolean | undefined;
196
196
  strategy?: 'fixed' | 'absolute' | undefined;
197
197
  styles?: StylesConfig | undefined;
198
198
  subtle?: boolean | undefined;
199
199
  suggestEmailsForDomain?: string | undefined;
200
+ target?: Target | undefined;
200
201
  textFieldBackgroundColor?: boolean | undefined;
201
202
  UNSAFE_hasDraggableParentComponent?: boolean | undefined;
202
- popupTitle?: string | undefined;
203
- rootBoundary?: RootBoundary | undefined;
204
- target?: Target | undefined;
203
+ value?: Value;
204
+ width?: number | string | undefined;
205
205
  } & {
206
- ref?: React.Ref<any> | undefined;
207
206
  createAnalyticsEvent?: CreateUIAnalyticsEvent | undefined;
207
+ ref?: React.Ref<any> | undefined;
208
208
  }, 'ref'> & React.RefAttributes<any>>;
209
209
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/user-picker",
3
- "version": "11.25.7",
3
+ "version": "11.25.8",
4
4
  "description": "Fabric component for display a dropdown to select a user from",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -47,17 +47,17 @@
47
47
  "@atlaskit/avatar": "^25.11.0",
48
48
  "@atlaskit/feature-gate-js-client": "^5.5.0",
49
49
  "@atlaskit/icon": "^34.0.0",
50
- "@atlaskit/logo": "^19.10.0",
50
+ "@atlaskit/logo": "^20.0.0",
51
51
  "@atlaskit/lozenge": "^13.5.0",
52
52
  "@atlaskit/people-teams-ui-public": "^3.7.0",
53
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
54
54
  "@atlaskit/popper": "^7.1.0",
55
55
  "@atlaskit/primitives": "^18.1.0",
56
56
  "@atlaskit/select": "^21.10.0",
57
- "@atlaskit/spinner": "^19.0.0",
58
- "@atlaskit/tag": "^14.6.0",
57
+ "@atlaskit/spinner": "^19.1.0",
58
+ "@atlaskit/tag": "^14.7.0",
59
59
  "@atlaskit/teams-avatar": "^2.4.0",
60
- "@atlaskit/tokens": "^11.4.0",
60
+ "@atlaskit/tokens": "^12.0.0",
61
61
  "@atlaskit/tooltip": "^21.1.0",
62
62
  "@atlaskit/ufo": "^0.4.0",
63
63
  "@babel/runtime": "^7.0.0",
@@ -77,7 +77,7 @@
77
77
  "@af/search-test-utils": "workspace:^",
78
78
  "@af/visual-regression": "workspace:^",
79
79
  "@atlaskit/elements-test-helpers": "workspace:^",
80
- "@atlaskit/heading": "^5.3.0",
80
+ "@atlaskit/heading": "^5.4.0",
81
81
  "@atlassian/a11y-jest-testing": "^0.11.0",
82
82
  "@atlassian/feature-flags-test-utils": "^1.0.0",
83
83
  "@emotion/styled": "^11.0.0",