@atlaskit/mention 23.6.0 → 23.7.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,15 @@
1
1
  # @atlaskit/mention
2
2
 
3
+ ## 23.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#99344](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/99344)
8
+ [`fbeb84f180cd2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fbeb84f180cd2) -
9
+ Added optional `isEligibleXProductUserInvite` and `inviteXProductUser` props which will be used in
10
+ CCEDITIONS-4746 (x-product-user-invite experiment). Project poster link -
11
+ https://hello.atlassian.net/wiki/spaces/CV1/pages/3685626022/Project+poster+-+Cross+Product+User+Search+Invites
12
+
3
13
  ## 23.6.0
4
14
 
5
15
  ### Minor Changes
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../../design-system/lozenge/afm-jira/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../../design-system/primitives/afm-jira/tsconfig.json"
43
46
  },
@@ -38,6 +38,9 @@
38
38
  {
39
39
  "path": "../../../design-system/lozenge/afm-post-office/tsconfig.json"
40
40
  },
41
+ {
42
+ "path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
43
+ },
41
44
  {
42
45
  "path": "../../../design-system/primitives/afm-post-office/tsconfig.json"
43
46
  },
@@ -187,6 +187,8 @@ var MentionResource = exports.MentionResource = /*#__PURE__*/function (_Abstract
187
187
  _this.productName = config.productName;
188
188
  _this.shouldEnableInvite = !!config.shouldEnableInvite;
189
189
  _this.onInviteItemClick = config.onInviteItemClick;
190
+ _this.isEligibleXProductUserInvite = config.isEligibleXProductUserInvite;
191
+ _this.inviteXProductUser = config.inviteXProductUser;
190
192
  _this.userRole = config.userRole || 'basic';
191
193
  if (_this.config.debounceTime) {
192
194
  _this.filter = (0, _debounce.default)(_this.filter, _this.config.debounceTime);
@@ -12,7 +12,7 @@ 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.6.0";
15
+ var packageVersion = "23.7.0";
16
16
  var SLI_EVENT_TYPE = exports.SLI_EVENT_TYPE = 'sli';
17
17
  var SMART_EVENT_TYPE = exports.SMART_EVENT_TYPE = 'smart';
18
18
  var fireAnalyticsMentionTypeaheadEvent = exports.fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
@@ -137,6 +137,8 @@ export class MentionResource extends AbstractMentionResource {
137
137
  this.productName = config.productName;
138
138
  this.shouldEnableInvite = !!config.shouldEnableInvite;
139
139
  this.onInviteItemClick = config.onInviteItemClick;
140
+ this.isEligibleXProductUserInvite = config.isEligibleXProductUserInvite;
141
+ this.inviteXProductUser = config.inviteXProductUser;
140
142
  this.userRole = config.userRole || 'basic';
141
143
  if (this.config.debounceTime) {
142
144
  this.filter = debounce(this.filter, this.config.debounceTime);
@@ -2,7 +2,7 @@ import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-t
2
2
  import { ELEMENTS_CHANNEL } from '../_constants';
3
3
  import { ComponentNames, isSpecialMentionText } from '../types';
4
4
  const packageName = "@atlaskit/mention";
5
- const packageVersion = "23.6.0";
5
+ const packageVersion = "23.7.0";
6
6
  export const SLI_EVENT_TYPE = 'sli';
7
7
  export const SMART_EVENT_TYPE = 'smart';
8
8
  export const fireAnalyticsMentionTypeaheadEvent = props => (action, duration, userIds = [], query) => {
@@ -180,6 +180,8 @@ export var MentionResource = /*#__PURE__*/function (_AbstractMentionResou) {
180
180
  _this.productName = config.productName;
181
181
  _this.shouldEnableInvite = !!config.shouldEnableInvite;
182
182
  _this.onInviteItemClick = config.onInviteItemClick;
183
+ _this.isEligibleXProductUserInvite = config.isEligibleXProductUserInvite;
184
+ _this.inviteXProductUser = config.inviteXProductUser;
183
185
  _this.userRole = config.userRole || 'basic';
184
186
  if (_this.config.debounceTime) {
185
187
  _this.filter = debounce(_this.filter, _this.config.debounceTime);
@@ -5,7 +5,7 @@ import { OPERATIONAL_EVENT_TYPE, UI_EVENT_TYPE } from '@atlaskit/analytics-gas-t
5
5
  import { ELEMENTS_CHANNEL } from '../_constants';
6
6
  import { ComponentNames, isSpecialMentionText } from '../types';
7
7
  var packageName = "@atlaskit/mention";
8
- var packageVersion = "23.6.0";
8
+ var packageVersion = "23.7.0";
9
9
  export var SLI_EVENT_TYPE = 'sli';
10
10
  export var SMART_EVENT_TYPE = 'smart';
11
11
  export var fireAnalyticsMentionTypeaheadEvent = function fireAnalyticsMentionTypeaheadEvent(props) {
@@ -1,9 +1,9 @@
1
1
  import { type MentionProvider, type MentionContextIdentifier, ErrorCallback, InfoCallback, ResultCallback } from './MentionResource';
2
- import { type MentionDescription, type InviteFromMentionProvider } from '../types';
2
+ import { type MentionDescription, type InviteFromMentionProvider, type XProductInviteMentionProvider } from '../types';
3
3
  export type { MentionDescription };
4
4
  export type MentionProviderFunctions = Omit<{
5
5
  [Key in keyof MentionProvider]: MentionProvider[Key] extends Function ? MentionProvider[Key] : never;
6
- }, keyof InviteFromMentionProvider>;
6
+ }, keyof InviteFromMentionProvider | keyof XProductInviteMentionProvider>;
7
7
  /**
8
8
  * This component is stateful and should be instantianted per contextIdentifiers.
9
9
  */
@@ -45,6 +45,8 @@ export declare class MentionResource extends AbstractMentionResource implements
45
45
  shouldEnableInvite: boolean;
46
46
  userRole: UserRole;
47
47
  onInviteItemClick?: (flow: InviteFlow) => void;
48
+ isEligibleXProductUserInvite?: boolean;
49
+ inviteXProductUser?: (userId: string) => Promise<void>;
48
50
  constructor(config: MentionResourceConfig);
49
51
  shouldHighlightMention(mention: MentionDescription): boolean;
50
52
  notify(searchTime: number, mentionResult: MentionsResult, query?: string): void;
@@ -32,6 +32,7 @@ export interface MentionResourceConfig extends ServiceConfig {
32
32
  productName?: string;
33
33
  debounceTime?: number;
34
34
  isEligibleXProductUserInvite?: boolean;
35
+ inviteXProductUser?: (userId: string) => Promise<void>;
35
36
  }
36
37
  export interface ResourceProvider<Result> {
37
38
  /**
@@ -56,7 +57,7 @@ export type MentionContextIdentifier = {
56
57
  childObjectId?: string;
57
58
  sessionId?: string;
58
59
  };
59
- export interface MentionProvider extends ResourceProvider<MentionDescription[]>, InviteFromMentionProvider {
60
+ export interface MentionProvider extends ResourceProvider<MentionDescription[]>, InviteFromMentionProvider, XProductInviteMentionProvider {
60
61
  filter(query?: string, contextIdentifier?: MentionContextIdentifier): void;
61
62
  recordMentionSelection(mention: MentionDescription, contextIdentifier?: MentionContextIdentifier): void;
62
63
  shouldHighlightMention(mention: MentionDescription): boolean;
@@ -94,6 +95,7 @@ export interface MentionDescription {
94
95
  userType?: string;
95
96
  context?: MentionDescContext;
96
97
  source?: string;
98
+ isXProductUser?: boolean;
97
99
  }
98
100
  export interface MentionDescContext {
99
101
  members: TeamMember[];
@@ -182,3 +184,7 @@ export interface InviteFromMentionProvider {
182
184
  onInviteItemClick?(flow: InviteFlow): void;
183
185
  userRole?: UserRole;
184
186
  }
187
+ export interface XProductInviteMentionProvider {
188
+ isEligibleXProductUserInvite?: boolean;
189
+ inviteXProductUser?(userId: string): Promise<void>;
190
+ }
@@ -1,9 +1,9 @@
1
1
  import { type MentionProvider, type MentionContextIdentifier, ErrorCallback, InfoCallback, ResultCallback } from './MentionResource';
2
- import { type MentionDescription, type InviteFromMentionProvider } from '../types';
2
+ import { type MentionDescription, type InviteFromMentionProvider, type XProductInviteMentionProvider } from '../types';
3
3
  export type { MentionDescription };
4
4
  export type MentionProviderFunctions = Omit<{
5
5
  [Key in keyof MentionProvider]: MentionProvider[Key] extends Function ? MentionProvider[Key] : never;
6
- }, keyof InviteFromMentionProvider>;
6
+ }, keyof InviteFromMentionProvider | keyof XProductInviteMentionProvider>;
7
7
  /**
8
8
  * This component is stateful and should be instantianted per contextIdentifiers.
9
9
  */
@@ -45,6 +45,8 @@ export declare class MentionResource extends AbstractMentionResource implements
45
45
  shouldEnableInvite: boolean;
46
46
  userRole: UserRole;
47
47
  onInviteItemClick?: (flow: InviteFlow) => void;
48
+ isEligibleXProductUserInvite?: boolean;
49
+ inviteXProductUser?: (userId: string) => Promise<void>;
48
50
  constructor(config: MentionResourceConfig);
49
51
  shouldHighlightMention(mention: MentionDescription): boolean;
50
52
  notify(searchTime: number, mentionResult: MentionsResult, query?: string): void;
@@ -32,6 +32,7 @@ export interface MentionResourceConfig extends ServiceConfig {
32
32
  productName?: string;
33
33
  debounceTime?: number;
34
34
  isEligibleXProductUserInvite?: boolean;
35
+ inviteXProductUser?: (userId: string) => Promise<void>;
35
36
  }
36
37
  export interface ResourceProvider<Result> {
37
38
  /**
@@ -56,7 +57,7 @@ export type MentionContextIdentifier = {
56
57
  childObjectId?: string;
57
58
  sessionId?: string;
58
59
  };
59
- export interface MentionProvider extends ResourceProvider<MentionDescription[]>, InviteFromMentionProvider {
60
+ export interface MentionProvider extends ResourceProvider<MentionDescription[]>, InviteFromMentionProvider, XProductInviteMentionProvider {
60
61
  filter(query?: string, contextIdentifier?: MentionContextIdentifier): void;
61
62
  recordMentionSelection(mention: MentionDescription, contextIdentifier?: MentionContextIdentifier): void;
62
63
  shouldHighlightMention(mention: MentionDescription): boolean;
@@ -94,6 +95,7 @@ export interface MentionDescription {
94
95
  userType?: string;
95
96
  context?: MentionDescContext;
96
97
  source?: string;
98
+ isXProductUser?: boolean;
97
99
  }
98
100
  export interface MentionDescContext {
99
101
  members: TeamMember[];
@@ -182,3 +184,7 @@ export interface InviteFromMentionProvider {
182
184
  onInviteItemClick?(flow: InviteFlow): void;
183
185
  userRole?: UserRole;
184
186
  }
187
+ export interface XProductInviteMentionProvider {
188
+ isEligibleXProductUserInvite?: boolean;
189
+ inviteXProductUser?(userId: string): Promise<void>;
190
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/mention",
3
- "version": "23.6.0",
3
+ "version": "23.7.0",
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/"