@atlaskit/mention 23.3.0 → 23.3.2

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,26 @@
1
1
  # @atlaskit/mention
2
2
 
3
+ ## 23.3.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [#152012](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/152012)
8
+ [`30a69f02904da`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/30a69f02904da) -
9
+ [ED-23460] Make sure that error analytics in editor-plugin-mentions can fire by using actions from
10
+ editor-plugin-analytics
11
+
12
+ - **@atlaskit/editor-common**: Add types for `@atlaskit/editor-plugin-mentions` analytics
13
+ - **@atlaskit/editor-plugin-mentions**: Switch to using `@atlaskit/editor-plugin-analytics`
14
+ actions so that error events can be queued and fired consistently
15
+ - **@atlaskit/mention**: Move some enums to the types file and export them so they can be used to
16
+ type analytics events
17
+
18
+ ## 23.3.1
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+
3
24
  ## 23.3.0
4
25
 
5
26
  ### Minor Changes
@@ -388,12 +388,12 @@ var MentionResource = exports.MentionResource = /*#__PURE__*/function (_Abstract
388
388
  return _utilServiceSupport.utils.requestService(this.config, options);
389
389
  case 5:
390
390
  result = _context2.sent;
391
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _analytics.SliNames.INITIAL_STATE, _analytics.Actions.SUCCEEDED);
391
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _types.SliNames.INITIAL_STATE, _types.Actions.SUCCEEDED);
392
392
  return _context2.abrupt("return", this.transformServiceResponse(result, ''));
393
393
  case 10:
394
394
  _context2.prev = 10;
395
395
  _context2.t0 = _context2["catch"](2);
396
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _analytics.SliNames.INITIAL_STATE, _analytics.Actions.FAILED);
396
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _types.SliNames.INITIAL_STATE, _types.Actions.FAILED);
397
397
  throw _context2.t0;
398
398
  case 14:
399
399
  case "end":
@@ -433,12 +433,12 @@ var MentionResource = exports.MentionResource = /*#__PURE__*/function (_Abstract
433
433
  return _utilServiceSupport.utils.requestService(this.config, options);
434
434
  case 4:
435
435
  result = _context3.sent;
436
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _analytics.SliNames.SEARCH, _analytics.Actions.SUCCEEDED);
436
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _types.SliNames.SEARCH, _types.Actions.SUCCEEDED);
437
437
  return _context3.abrupt("return", this.transformServiceResponse(result, query));
438
438
  case 9:
439
439
  _context3.prev = 9;
440
440
  _context3.t0 = _context3["catch"](1);
441
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _analytics.SliNames.SEARCH, _analytics.Actions.FAILED);
441
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _types.SliNames.SEARCH, _types.Actions.FAILED);
442
442
  throw _context3.t0;
443
443
  case 13:
444
444
  case "end":
@@ -488,18 +488,18 @@ var MentionResource = exports.MentionResource = /*#__PURE__*/function (_Abstract
488
488
  method: 'POST'
489
489
  }
490
490
  };
491
- sliName = (0, _types.isTeamMention)(mention) ? _analytics.SliNames.SELECT_TEAM : _analytics.SliNames.SELECT;
491
+ sliName = (0, _types.isTeamMention)(mention) ? _types.SliNames.SELECT_TEAM : _types.SliNames.SELECT;
492
492
  _context4.prev = 2;
493
493
  _context4.next = 5;
494
494
  return _utilServiceSupport.utils.requestService(this.config, options);
495
495
  case 5:
496
496
  result = _context4.sent;
497
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, sliName, _analytics.Actions.SUCCEEDED);
497
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, sliName, _types.Actions.SUCCEEDED);
498
498
  return _context4.abrupt("return", result);
499
499
  case 10:
500
500
  _context4.prev = 10;
501
501
  _context4.t0 = _context4["catch"](2);
502
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, sliName, _analytics.Actions.FAILED);
502
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, sliName, _types.Actions.FAILED);
503
503
  throw _context4.t0;
504
504
  case 14:
505
505
  case "end":
@@ -231,12 +231,12 @@ var TeamMentionResource = exports.default = /*#__PURE__*/function (_MentionResou
231
231
  return _utilServiceSupport.utils.requestService(this.teamMentionConfig, options);
232
232
  case 4:
233
233
  teamResult = _context3.sent;
234
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _analytics.SliNames.SEARCH_TEAM, _analytics.Actions.SUCCEEDED);
234
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _types.SliNames.SEARCH_TEAM, _types.Actions.SUCCEEDED);
235
235
  return _context3.abrupt("return", this.convertTeamResultToMentionResult(teamResult, query));
236
236
  case 9:
237
237
  _context3.prev = 9;
238
238
  _context3.t0 = _context3["catch"](1);
239
- this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _analytics.SliNames.SEARCH_TEAM, _analytics.Actions.FAILED);
239
+ this._notifyAnalyticsListeners(_analytics.SLI_EVENT_TYPE, _types.SliNames.SEARCH_TEAM, _types.Actions.FAILED);
240
240
  throw _context3.t0;
241
241
  case 13:
242
242
  case "end":
package/dist/cjs/index.js CHANGED
@@ -17,6 +17,18 @@ Object.defineProperty(exports, "AbstractPresenceResource", {
17
17
  return _PresenceResource.AbstractPresenceResource;
18
18
  }
19
19
  });
20
+ Object.defineProperty(exports, "Actions", {
21
+ enumerable: true,
22
+ get: function get() {
23
+ return _types.Actions;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, "ComponentNames", {
27
+ enumerable: true,
28
+ get: function get() {
29
+ return _types.ComponentNames;
30
+ }
31
+ });
20
32
  Object.defineProperty(exports, "ContextMentionResource", {
21
33
  enumerable: true,
22
34
  get: function get() {
@@ -89,6 +101,12 @@ Object.defineProperty(exports, "ResourcedMentionList", {
89
101
  return _ResourcedMentionList.default;
90
102
  }
91
103
  });
104
+ Object.defineProperty(exports, "SliNames", {
105
+ enumerable: true,
106
+ get: function get() {
107
+ return _types.SliNames;
108
+ }
109
+ });
92
110
  Object.defineProperty(exports, "TeamMentionResource", {
93
111
  enumerable: true,
94
112
  get: function get() {
package/dist/cjs/types.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.UserType = exports.UserAccessLevel = exports.MentionType = exports.MentionNameStatus = void 0;
6
+ exports.UserType = exports.UserAccessLevel = exports.SliNames = exports.MentionType = exports.MentionNameStatus = exports.ComponentNames = exports.Actions = void 0;
7
7
  exports.isAppMention = isAppMention;
8
8
  exports.isPromise = void 0;
9
9
  exports.isRestricted = isRestricted;
@@ -32,6 +32,27 @@ var UserType = exports.UserType = /*#__PURE__*/function (UserType) {
32
32
  UserType[UserType["SYSTEM"] = 4] = "SYSTEM";
33
33
  return UserType;
34
34
  }({});
35
+ var SliNames = exports.SliNames = /*#__PURE__*/function (SliNames) {
36
+ SliNames["SEARCH"] = "searchUser";
37
+ SliNames["SEARCH_TEAM"] = "searchTeam";
38
+ SliNames["INITIAL_STATE"] = "initialState";
39
+ SliNames["SELECT"] = "select";
40
+ SliNames["SELECT_TEAM"] = "selectTeam";
41
+ return SliNames;
42
+ }({});
43
+ var ComponentNames = exports.ComponentNames = /*#__PURE__*/function (ComponentNames) {
44
+ ComponentNames["TYPEAHEAD"] = "mentionTypeahead";
45
+ ComponentNames["MENTION"] = "mention";
46
+ return ComponentNames;
47
+ }({});
48
+ var Actions = exports.Actions = /*#__PURE__*/function (Actions) {
49
+ Actions["VIEWED"] = "viewed";
50
+ Actions["CLICKED"] = "clicked";
51
+ Actions["CLOSED"] = "closed";
52
+ Actions["SUCCEEDED"] = "succeeded";
53
+ Actions["FAILED"] = "failed";
54
+ return Actions;
55
+ }({});
35
56
  var MentionNameStatus = exports.MentionNameStatus = /*#__PURE__*/function (MentionNameStatus) {
36
57
  MentionNameStatus[MentionNameStatus["UNKNOWN"] = 0] = "UNKNOWN";
37
58
  MentionNameStatus[MentionNameStatus["SERVICE_ERROR"] = 1] = "SERVICE_ERROR";
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.fireSliAnalyticsEvent = exports.fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionHydrationEvent = exports.fireAnalyticsMentionEvent = exports.fireAnalytics = exports.buildSliPayload = exports.SliNames = exports.SMART_EVENT_TYPE = exports.SLI_EVENT_TYPE = exports.ComponentNames = exports.Actions = void 0;
7
+ exports.fireSliAnalyticsEvent = exports.fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionHydrationEvent = exports.fireAnalyticsMentionEvent = exports.fireAnalytics = exports.buildSliPayload = exports.SMART_EVENT_TYPE = exports.SLI_EVENT_TYPE = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
10
10
  var _constants = require("../_constants");
@@ -12,30 +12,9 @@ var _types = require("../types");
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/mention";
15
- var packageVersion = "23.3.0";
15
+ var packageVersion = "23.3.2";
16
16
  var SLI_EVENT_TYPE = exports.SLI_EVENT_TYPE = 'sli';
17
17
  var SMART_EVENT_TYPE = exports.SMART_EVENT_TYPE = 'smart';
18
- var SliNames = exports.SliNames = /*#__PURE__*/function (SliNames) {
19
- SliNames["SEARCH"] = "searchUser";
20
- SliNames["SEARCH_TEAM"] = "searchTeam";
21
- SliNames["INITIAL_STATE"] = "initialState";
22
- SliNames["SELECT"] = "select";
23
- SliNames["SELECT_TEAM"] = "selectTeam";
24
- return SliNames;
25
- }({});
26
- var ComponentNames = exports.ComponentNames = /*#__PURE__*/function (ComponentNames) {
27
- ComponentNames["TYPEAHEAD"] = "mentionTypeahead";
28
- ComponentNames["MENTION"] = "mention";
29
- return ComponentNames;
30
- }({});
31
- var Actions = exports.Actions = /*#__PURE__*/function (Actions) {
32
- Actions["VIEWED"] = "viewed";
33
- Actions["CLICKED"] = "clicked";
34
- Actions["CLOSED"] = "closed";
35
- Actions["SUCCEEDED"] = "succeeded";
36
- Actions["FAILED"] = "failed";
37
- return Actions;
38
- }({});
39
18
  var fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
40
19
  return function (action, duration) {
41
20
  var userIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -43,11 +22,11 @@ var fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionTypeaheadEv
43
22
  if (props.createAnalyticsEvent) {
44
23
  var eventPayload = {
45
24
  action: action,
46
- actionSubject: ComponentNames.TYPEAHEAD,
25
+ actionSubject: _types.ComponentNames.TYPEAHEAD,
47
26
  attributes: {
48
27
  packageName: packageName,
49
28
  packageVersion: packageVersion,
50
- componentName: ComponentNames.MENTION,
29
+ componentName: _types.ComponentNames.MENTION,
51
30
  duration: Math.round(duration),
52
31
  userIds: userIds,
53
32
  queryLength: query ? query.length : 0
@@ -68,7 +47,7 @@ var fireAnalyticsMentionEvent = exports.fireAnalyticsMentionEvent = function fir
68
47
  attributes: {
69
48
  packageName: packageName,
70
49
  packageVersion: packageVersion,
71
- componentName: ComponentNames.MENTION,
50
+ componentName: _types.ComponentNames.MENTION,
72
51
  accessLevel: accessLevel,
73
52
  isSpecial: (0, _types.isSpecialMentionText)(text),
74
53
  userId: id
@@ -95,7 +74,7 @@ var buildSliPayload = exports.buildSliPayload = function buildSliPayload(actionS
95
74
  attributes: _objectSpread({
96
75
  packageName: packageName,
97
76
  packageVersion: packageVersion,
98
- componentName: ComponentNames.MENTION
77
+ componentName: _types.ComponentNames.MENTION
99
78
  }, attributes)
100
79
  };
101
80
  return eventPayload;
@@ -105,12 +84,12 @@ var fireAnalyticsMentionHydrationEvent = exports.fireAnalyticsMentionHydrationEv
105
84
  if (props.createAnalyticsEvent) {
106
85
  var eventPayload = {
107
86
  action: action,
108
- actionSubject: ComponentNames.MENTION,
87
+ actionSubject: _types.ComponentNames.MENTION,
109
88
  actionSubjectId: 'hydration',
110
89
  attributes: {
111
90
  packageName: packageName,
112
91
  packageVersion: packageVersion,
113
- componentName: ComponentNames.MENTION,
92
+ componentName: _types.ComponentNames.MENTION,
114
93
  userId: userId,
115
94
  fromCache: fromCache,
116
95
  duration: Math.round(duration)
@@ -1,12 +1,12 @@
1
1
  import { utils as serviceUtils } from '@atlaskit/util-service-support';
2
- import { isAppMention, isTeamMention, MentionNameStatus } from '../types';
2
+ import { isAppMention, isTeamMention, MentionNameStatus, SliNames, Actions } from '../types';
3
3
  import debug from '../util/logger';
4
4
  const MAX_QUERY_ITEMS = 100;
5
5
  const MAX_NOTIFIED_ITEMS = 20;
6
6
  // Re-exporting types to prevent breaking change
7
7
  // Re-exporting types to prevent breaking change
8
8
 
9
- import { SLI_EVENT_TYPE, Actions, SliNames } from '../util/analytics';
9
+ import { SLI_EVENT_TYPE } from '../util/analytics';
10
10
  import debounce from 'lodash/debounce';
11
11
 
12
12
  /**
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { SLI_EVENT_TYPE, SliNames, Actions } from './../util/analytics';
2
+ import { SLI_EVENT_TYPE } from './../util/analytics';
3
3
  import { utils as serviceUtils } from '@atlaskit/util-service-support';
4
- import { UserType, UserAccessLevel } from '../types';
4
+ import { UserType, UserAccessLevel, SliNames, Actions } from '../types';
5
5
  import MentionResource from './MentionResource';
6
6
  import debug from '../util/logger';
7
7
  const MAX_QUERY_TEAMS = 20;
@@ -8,14 +8,14 @@ import ResourcedMentionList from './components/ResourcedMentionList';
8
8
  import { MentionPickerWithAnalytics as MentionPicker } from './components/MentionPicker';
9
9
  import Mention from './components/Mention';
10
10
  import ResourcedMention from './components/Mention/ResourcedMention';
11
- import { MentionNameStatus, isSpecialMention, UserAccessLevel, UserType } from './types';
11
+ import { MentionNameStatus, isSpecialMention, UserAccessLevel, UserType, ComponentNames, Actions, SliNames } from './types';
12
12
  import { ELEMENTS_CHANNEL } from './_constants';
13
13
  import ContextMentionResource from './api/ContextMentionResource';
14
14
  export {
15
15
  // Classes
16
16
  ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus,
17
17
  // Components
18
- MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType,
18
+ MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType, ComponentNames, SliNames, Actions,
19
19
  // Functions
20
20
  isSpecialMention, isResolvingMentionProvider,
21
21
  // Constants
@@ -21,6 +21,27 @@ export let UserType = /*#__PURE__*/function (UserType) {
21
21
  UserType[UserType["SYSTEM"] = 4] = "SYSTEM";
22
22
  return UserType;
23
23
  }({});
24
+ export let SliNames = /*#__PURE__*/function (SliNames) {
25
+ SliNames["SEARCH"] = "searchUser";
26
+ SliNames["SEARCH_TEAM"] = "searchTeam";
27
+ SliNames["INITIAL_STATE"] = "initialState";
28
+ SliNames["SELECT"] = "select";
29
+ SliNames["SELECT_TEAM"] = "selectTeam";
30
+ return SliNames;
31
+ }({});
32
+ export let ComponentNames = /*#__PURE__*/function (ComponentNames) {
33
+ ComponentNames["TYPEAHEAD"] = "mentionTypeahead";
34
+ ComponentNames["MENTION"] = "mention";
35
+ return ComponentNames;
36
+ }({});
37
+ export let Actions = /*#__PURE__*/function (Actions) {
38
+ Actions["VIEWED"] = "viewed";
39
+ Actions["CLICKED"] = "clicked";
40
+ Actions["CLOSED"] = "closed";
41
+ Actions["SUCCEEDED"] = "succeeded";
42
+ Actions["FAILED"] = "failed";
43
+ return Actions;
44
+ }({});
24
45
  export let MentionNameStatus = /*#__PURE__*/function (MentionNameStatus) {
25
46
  MentionNameStatus[MentionNameStatus["UNKNOWN"] = 0] = "UNKNOWN";
26
47
  MentionNameStatus[MentionNameStatus["SERVICE_ERROR"] = 1] = "SERVICE_ERROR";
@@ -1,31 +1,10 @@
1
1
  import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
2
2
  import { ELEMENTS_CHANNEL } from '../_constants';
3
- import { isSpecialMentionText } from '../types';
3
+ import { ComponentNames, isSpecialMentionText } from '../types';
4
4
  const packageName = "@atlaskit/mention";
5
- const packageVersion = "23.3.0";
5
+ const packageVersion = "23.3.2";
6
6
  export const SLI_EVENT_TYPE = 'sli';
7
7
  export const SMART_EVENT_TYPE = 'smart';
8
- export let SliNames = /*#__PURE__*/function (SliNames) {
9
- SliNames["SEARCH"] = "searchUser";
10
- SliNames["SEARCH_TEAM"] = "searchTeam";
11
- SliNames["INITIAL_STATE"] = "initialState";
12
- SliNames["SELECT"] = "select";
13
- SliNames["SELECT_TEAM"] = "selectTeam";
14
- return SliNames;
15
- }({});
16
- export let ComponentNames = /*#__PURE__*/function (ComponentNames) {
17
- ComponentNames["TYPEAHEAD"] = "mentionTypeahead";
18
- ComponentNames["MENTION"] = "mention";
19
- return ComponentNames;
20
- }({});
21
- export let Actions = /*#__PURE__*/function (Actions) {
22
- Actions["VIEWED"] = "viewed";
23
- Actions["CLICKED"] = "clicked";
24
- Actions["CLOSED"] = "closed";
25
- Actions["SUCCEEDED"] = "succeeded";
26
- Actions["FAILED"] = "failed";
27
- return Actions;
28
- }({});
29
8
  export const fireAnalyticsMentionTypeaheadEvent = props => (action, duration, userIds = [], query) => {
30
9
  if (props.createAnalyticsEvent) {
31
10
  const eventPayload = {
@@ -11,14 +11,14 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
11
11
  function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
12
12
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
13
13
  import { utils as serviceUtils } from '@atlaskit/util-service-support';
14
- import { isAppMention, isTeamMention, MentionNameStatus } from '../types';
14
+ import { isAppMention, isTeamMention, MentionNameStatus, SliNames, Actions } from '../types';
15
15
  import debug from '../util/logger';
16
16
  var MAX_QUERY_ITEMS = 100;
17
17
  var MAX_NOTIFIED_ITEMS = 20;
18
18
  // Re-exporting types to prevent breaking change
19
19
  // Re-exporting types to prevent breaking change
20
20
 
21
- import { SLI_EVENT_TYPE, Actions, SliNames } from '../util/analytics';
21
+ import { SLI_EVENT_TYPE } from '../util/analytics';
22
22
  import debounce from 'lodash/debounce';
23
23
 
24
24
  /**
@@ -13,9 +13,9 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  import _regeneratorRuntime from "@babel/runtime/regenerator";
14
14
  function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
15
15
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
16
- import { SLI_EVENT_TYPE, SliNames, Actions } from './../util/analytics';
16
+ import { SLI_EVENT_TYPE } from './../util/analytics';
17
17
  import { utils as serviceUtils } from '@atlaskit/util-service-support';
18
- import { UserType, UserAccessLevel } from '../types';
18
+ import { UserType, UserAccessLevel, SliNames, Actions } from '../types';
19
19
  import MentionResource from './MentionResource';
20
20
  import debug from '../util/logger';
21
21
  var MAX_QUERY_TEAMS = 20;
package/dist/esm/index.js CHANGED
@@ -8,14 +8,14 @@ import ResourcedMentionList from './components/ResourcedMentionList';
8
8
  import { MentionPickerWithAnalytics as MentionPicker } from './components/MentionPicker';
9
9
  import Mention from './components/Mention';
10
10
  import ResourcedMention from './components/Mention/ResourcedMention';
11
- import { MentionNameStatus, isSpecialMention, UserAccessLevel, UserType } from './types';
11
+ import { MentionNameStatus, isSpecialMention, UserAccessLevel, UserType, ComponentNames, Actions, SliNames } from './types';
12
12
  import { ELEMENTS_CHANNEL } from './_constants';
13
13
  import ContextMentionResource from './api/ContextMentionResource';
14
14
  export {
15
15
  // Classes
16
16
  ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus,
17
17
  // Components
18
- MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType,
18
+ MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType, ComponentNames, SliNames, Actions,
19
19
  // Functions
20
20
  isSpecialMention, isResolvingMentionProvider,
21
21
  // Constants
package/dist/esm/types.js CHANGED
@@ -21,6 +21,27 @@ export var UserType = /*#__PURE__*/function (UserType) {
21
21
  UserType[UserType["SYSTEM"] = 4] = "SYSTEM";
22
22
  return UserType;
23
23
  }({});
24
+ export var SliNames = /*#__PURE__*/function (SliNames) {
25
+ SliNames["SEARCH"] = "searchUser";
26
+ SliNames["SEARCH_TEAM"] = "searchTeam";
27
+ SliNames["INITIAL_STATE"] = "initialState";
28
+ SliNames["SELECT"] = "select";
29
+ SliNames["SELECT_TEAM"] = "selectTeam";
30
+ return SliNames;
31
+ }({});
32
+ export var ComponentNames = /*#__PURE__*/function (ComponentNames) {
33
+ ComponentNames["TYPEAHEAD"] = "mentionTypeahead";
34
+ ComponentNames["MENTION"] = "mention";
35
+ return ComponentNames;
36
+ }({});
37
+ export var Actions = /*#__PURE__*/function (Actions) {
38
+ Actions["VIEWED"] = "viewed";
39
+ Actions["CLICKED"] = "clicked";
40
+ Actions["CLOSED"] = "closed";
41
+ Actions["SUCCEEDED"] = "succeeded";
42
+ Actions["FAILED"] = "failed";
43
+ return Actions;
44
+ }({});
24
45
  export var MentionNameStatus = /*#__PURE__*/function (MentionNameStatus) {
25
46
  MentionNameStatus[MentionNameStatus["UNKNOWN"] = 0] = "UNKNOWN";
26
47
  MentionNameStatus[MentionNameStatus["SERVICE_ERROR"] = 1] = "SERVICE_ERROR";
@@ -3,32 +3,11 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
3
3
  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; }
4
4
  import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
5
5
  import { ELEMENTS_CHANNEL } from '../_constants';
6
- import { isSpecialMentionText } from '../types';
6
+ import { ComponentNames, isSpecialMentionText } from '../types';
7
7
  var packageName = "@atlaskit/mention";
8
- var packageVersion = "23.3.0";
8
+ var packageVersion = "23.3.2";
9
9
  export var SLI_EVENT_TYPE = 'sli';
10
10
  export var SMART_EVENT_TYPE = 'smart';
11
- export var SliNames = /*#__PURE__*/function (SliNames) {
12
- SliNames["SEARCH"] = "searchUser";
13
- SliNames["SEARCH_TEAM"] = "searchTeam";
14
- SliNames["INITIAL_STATE"] = "initialState";
15
- SliNames["SELECT"] = "select";
16
- SliNames["SELECT_TEAM"] = "selectTeam";
17
- return SliNames;
18
- }({});
19
- export var ComponentNames = /*#__PURE__*/function (ComponentNames) {
20
- ComponentNames["TYPEAHEAD"] = "mentionTypeahead";
21
- ComponentNames["MENTION"] = "mention";
22
- return ComponentNames;
23
- }({});
24
- export var Actions = /*#__PURE__*/function (Actions) {
25
- Actions["VIEWED"] = "viewed";
26
- Actions["CLICKED"] = "clicked";
27
- Actions["CLOSED"] = "closed";
28
- Actions["SUCCEEDED"] = "succeeded";
29
- Actions["FAILED"] = "failed";
30
- return Actions;
31
- }({});
32
11
  export var fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
33
12
  return function (action, duration) {
34
13
  var userIds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare const AsyncLockCircleIcon: import("react").LazyExoticComponent<{
3
- (props: Omit<import("@atlaskit/icon").UNSAFE_NewIconProps, "dangerouslySetGlyph" | "type" | "LEGACY_fallbackIcon">): JSX.Element;
3
+ (props: Omit<import("@atlaskit/icon").UNSAFE_NewCoreIconProps, "dangerouslySetGlyph" | "type" | "LEGACY_fallbackIcon">): JSX.Element;
4
4
  displayName: string;
5
5
  }>;
6
6
  export default AsyncLockCircleIcon;
@@ -27,6 +27,6 @@ export declare class MentionInternal extends React.PureComponent<Props, {}> {
27
27
  renderUnknownUserError(id: string): JSX.Element;
28
28
  render(): JSX.Element;
29
29
  }
30
- declare const Mention: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
30
+ declare const Mention: React.ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
31
31
  type Mention = MentionInternal;
32
32
  export default Mention;
@@ -41,6 +41,6 @@ export declare class ResourcedMentionListWithoutAnalytics extends React.PureComp
41
41
  private handleMentionListRef;
42
42
  render(): JSX.Element;
43
43
  }
44
- declare const ResourcedMentionList: React.ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
44
+ declare const ResourcedMentionList: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
45
45
  type ResourcedMentionList = ResourcedMentionListWithoutAnalytics;
46
46
  export default ResourcedMentionList;
@@ -9,9 +9,9 @@ import ResourcedMentionList from './components/ResourcedMentionList';
9
9
  import { MentionPickerWithAnalytics as MentionPicker } from './components/MentionPicker';
10
10
  import Mention from './components/Mention';
11
11
  import ResourcedMention from './components/Mention/ResourcedMention';
12
- import { type MentionDescription, type MentionsResult, MentionNameStatus, type MentionNameDetails, type InviteFlow, isSpecialMention, type TeamMember, UserAccessLevel, type UserRole, UserType } from './types';
12
+ import { type MentionDescription, type MentionsResult, MentionNameStatus, type MentionNameDetails, type InviteFlow, isSpecialMention, type TeamMember, UserAccessLevel, type UserRole, UserType, ComponentNames, Actions, SliNames } from './types';
13
13
  import { ELEMENTS_CHANNEL } from './_constants';
14
14
  import ContextMentionResource from './api/ContextMentionResource';
15
- export { ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus, MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType, isSpecialMention, isResolvingMentionProvider, ELEMENTS_CHANNEL, };
15
+ export { ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus, MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType, ComponentNames, SliNames, Actions, isSpecialMention, isResolvingMentionProvider, ELEMENTS_CHANNEL, };
16
16
  export type { ResolvingMentionProvider, MentionProvider, PresenceProvider, MentionDescription, MentionsResult, MentionNameResolver, MentionNameClient, MentionNameDetails, MentionContextIdentifier, MentionStats, TeamMember, MentionResourceConfig, TeamMentionResourceConfig, InviteFlow, UserRole, };
17
17
  export default MentionPicker;
@@ -139,6 +139,24 @@ export declare enum UserType {
139
139
  TEAM = 3,
140
140
  SYSTEM = 4
141
141
  }
142
+ export declare enum SliNames {
143
+ SEARCH = "searchUser",
144
+ SEARCH_TEAM = "searchTeam",
145
+ INITIAL_STATE = "initialState",
146
+ SELECT = "select",
147
+ SELECT_TEAM = "selectTeam"
148
+ }
149
+ export declare enum ComponentNames {
150
+ TYPEAHEAD = "mentionTypeahead",
151
+ MENTION = "mention"
152
+ }
153
+ export declare enum Actions {
154
+ VIEWED = "viewed",
155
+ CLICKED = "clicked",
156
+ CLOSED = "closed",
157
+ SUCCEEDED = "succeeded",
158
+ FAILED = "failed"
159
+ }
142
160
  export declare enum MentionNameStatus {
143
161
  UNKNOWN = 0,
144
162
  SERVICE_ERROR = 1,
@@ -2,24 +2,6 @@ import { type UIAnalyticsEvent, type WithAnalyticsEventsProps, type CreateUIAnal
2
2
  import { type GasPayload } from '@atlaskit/analytics-gas-types';
3
3
  export declare const SLI_EVENT_TYPE = "sli";
4
4
  export declare const SMART_EVENT_TYPE = "smart";
5
- export declare enum SliNames {
6
- SEARCH = "searchUser",
7
- SEARCH_TEAM = "searchTeam",
8
- INITIAL_STATE = "initialState",
9
- SELECT = "select",
10
- SELECT_TEAM = "selectTeam"
11
- }
12
- export declare enum ComponentNames {
13
- TYPEAHEAD = "mentionTypeahead",
14
- MENTION = "mention"
15
- }
16
- export declare enum Actions {
17
- VIEWED = "viewed",
18
- CLICKED = "clicked",
19
- CLOSED = "closed",
20
- SUCCEEDED = "succeeded",
21
- FAILED = "failed"
22
- }
23
5
  export declare const fireAnalyticsMentionTypeaheadEvent: (props: WithAnalyticsEventsProps) => (action: string, duration: number, userIds?: string[], query?: string) => void;
24
6
  export declare const fireAnalyticsMentionEvent: (createEvent: CreateUIAnalyticsEvent) => (actionSubject: string, action: string, text: string, id: string, accessLevel?: string) => UIAnalyticsEvent;
25
7
  export declare const fireSliAnalyticsEvent: (props: WithAnalyticsEventsProps) => (actionSubject: string, action: string) => void;
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  declare const AsyncLockCircleIcon: import("react").LazyExoticComponent<{
3
- (props: Omit<import("@atlaskit/icon").UNSAFE_NewIconProps, "dangerouslySetGlyph" | "type" | "LEGACY_fallbackIcon">): JSX.Element;
3
+ (props: Omit<import("@atlaskit/icon").UNSAFE_NewCoreIconProps, "dangerouslySetGlyph" | "type" | "LEGACY_fallbackIcon">): JSX.Element;
4
4
  displayName: string;
5
5
  }>;
6
6
  export default AsyncLockCircleIcon;
@@ -27,6 +27,6 @@ export declare class MentionInternal extends React.PureComponent<Props, {}> {
27
27
  renderUnknownUserError(id: string): JSX.Element;
28
28
  render(): JSX.Element;
29
29
  }
30
- declare const Mention: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
30
+ declare const Mention: React.ForwardRefExoticComponent<Omit<OwnProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
31
31
  type Mention = MentionInternal;
32
32
  export default Mention;
@@ -41,6 +41,6 @@ export declare class ResourcedMentionListWithoutAnalytics extends React.PureComp
41
41
  private handleMentionListRef;
42
42
  render(): JSX.Element;
43
43
  }
44
- declare const ResourcedMentionList: React.ForwardRefExoticComponent<Omit<Props & WithAnalyticsEventsProps, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
44
+ declare const ResourcedMentionList: React.ForwardRefExoticComponent<Omit<Props, keyof WithAnalyticsEventsProps> & React.RefAttributes<any>>;
45
45
  type ResourcedMentionList = ResourcedMentionListWithoutAnalytics;
46
46
  export default ResourcedMentionList;
@@ -9,9 +9,9 @@ import ResourcedMentionList from './components/ResourcedMentionList';
9
9
  import { MentionPickerWithAnalytics as MentionPicker } from './components/MentionPicker';
10
10
  import Mention from './components/Mention';
11
11
  import ResourcedMention from './components/Mention/ResourcedMention';
12
- import { type MentionDescription, type MentionsResult, MentionNameStatus, type MentionNameDetails, type InviteFlow, isSpecialMention, type TeamMember, UserAccessLevel, type UserRole, UserType } from './types';
12
+ import { type MentionDescription, type MentionsResult, MentionNameStatus, type MentionNameDetails, type InviteFlow, isSpecialMention, type TeamMember, UserAccessLevel, type UserRole, UserType, ComponentNames, Actions, SliNames } from './types';
13
13
  import { ELEMENTS_CHANNEL } from './_constants';
14
14
  import ContextMentionResource from './api/ContextMentionResource';
15
- export { ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus, MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType, isSpecialMention, isResolvingMentionProvider, ELEMENTS_CHANNEL, };
15
+ export { ContextMentionResource, MentionResource, TeamMentionResource, PresenceResource, DefaultMentionNameResolver, AbstractMentionResource, AbstractPresenceResource, MentionNameStatus, MentionItem, MentionList, ResourcedMentionList, MentionPicker, Mention, ResourcedMention, UserAccessLevel, UserType, ComponentNames, SliNames, Actions, isSpecialMention, isResolvingMentionProvider, ELEMENTS_CHANNEL, };
16
16
  export type { ResolvingMentionProvider, MentionProvider, PresenceProvider, MentionDescription, MentionsResult, MentionNameResolver, MentionNameClient, MentionNameDetails, MentionContextIdentifier, MentionStats, TeamMember, MentionResourceConfig, TeamMentionResourceConfig, InviteFlow, UserRole, };
17
17
  export default MentionPicker;
@@ -139,6 +139,24 @@ export declare enum UserType {
139
139
  TEAM = 3,
140
140
  SYSTEM = 4
141
141
  }
142
+ export declare enum SliNames {
143
+ SEARCH = "searchUser",
144
+ SEARCH_TEAM = "searchTeam",
145
+ INITIAL_STATE = "initialState",
146
+ SELECT = "select",
147
+ SELECT_TEAM = "selectTeam"
148
+ }
149
+ export declare enum ComponentNames {
150
+ TYPEAHEAD = "mentionTypeahead",
151
+ MENTION = "mention"
152
+ }
153
+ export declare enum Actions {
154
+ VIEWED = "viewed",
155
+ CLICKED = "clicked",
156
+ CLOSED = "closed",
157
+ SUCCEEDED = "succeeded",
158
+ FAILED = "failed"
159
+ }
142
160
  export declare enum MentionNameStatus {
143
161
  UNKNOWN = 0,
144
162
  SERVICE_ERROR = 1,
@@ -2,24 +2,6 @@ import { type UIAnalyticsEvent, type WithAnalyticsEventsProps, type CreateUIAnal
2
2
  import { type GasPayload } from '@atlaskit/analytics-gas-types';
3
3
  export declare const SLI_EVENT_TYPE = "sli";
4
4
  export declare const SMART_EVENT_TYPE = "smart";
5
- export declare enum SliNames {
6
- SEARCH = "searchUser",
7
- SEARCH_TEAM = "searchTeam",
8
- INITIAL_STATE = "initialState",
9
- SELECT = "select",
10
- SELECT_TEAM = "selectTeam"
11
- }
12
- export declare enum ComponentNames {
13
- TYPEAHEAD = "mentionTypeahead",
14
- MENTION = "mention"
15
- }
16
- export declare enum Actions {
17
- VIEWED = "viewed",
18
- CLICKED = "clicked",
19
- CLOSED = "closed",
20
- SUCCEEDED = "succeeded",
21
- FAILED = "failed"
22
- }
23
5
  export declare const fireAnalyticsMentionTypeaheadEvent: (props: WithAnalyticsEventsProps) => (action: string, duration: number, userIds?: string[], query?: string) => void;
24
6
  export declare const fireAnalyticsMentionEvent: (createEvent: CreateUIAnalyticsEvent) => (actionSubject: string, action: string, text: string, id: string, accessLevel?: string) => UIAnalyticsEvent;
25
7
  export declare const fireSliAnalyticsEvent: (props: WithAnalyticsEventsProps) => (actionSubject: string, action: string) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/mention",
3
- "version": "23.3.0",
3
+ "version": "23.3.2",
4
4
  "description": "A React component used to display user profiles in a list for 'Mention' functionality",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,6 +24,14 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Search Platform: Search Experience",
27
+ "slack": {
28
+ "channel": "#search-plex-prs",
29
+ "notifications": {
30
+ "mergedPR": {
31
+ "message": "A PR was merged in @atlaskit/mention without maintainer approval."
32
+ }
33
+ }
34
+ },
27
35
  "website": {
28
36
  "name": "Mention"
29
37
  }
@@ -36,11 +44,11 @@
36
44
  "@atlaskit/analytics-next": "^10.1.0",
37
45
  "@atlaskit/avatar": "^21.15.0",
38
46
  "@atlaskit/focus-ring": "^1.6.0",
39
- "@atlaskit/icon": "^22.18.0",
40
- "@atlaskit/lozenge": "^11.10.0",
41
- "@atlaskit/theme": "^13.0.0",
42
- "@atlaskit/tokens": "^1.61.0",
43
- "@atlaskit/tooltip": "^18.7.0",
47
+ "@atlaskit/icon": "^22.22.0",
48
+ "@atlaskit/lozenge": "^11.11.0",
49
+ "@atlaskit/theme": "^13.1.0",
50
+ "@atlaskit/tokens": "^2.0.0",
51
+ "@atlaskit/tooltip": "^18.8.0",
44
52
  "@atlaskit/ufo": "^0.3.0",
45
53
  "@atlaskit/util-service-support": "^6.2.0",
46
54
  "@babel/runtime": "^7.0.0",