@atlaskit/editor-plugin-mentions 2.5.2 → 2.6.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,20 @@
1
1
  # @atlaskit/editor-plugin-mentions
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#138305](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138305)
8
+ [`c79d9c18032b6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c79d9c18032b6) -
9
+ Passing task local ID from editor mentions plugin
10
+
11
+ ### Patch Changes
12
+
13
+ - [#138118](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/138118)
14
+ [`5e4d9eb1aefe4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5e4d9eb1aefe4) -
15
+ NOISSUE: Upgrades editor React peer dependencies to v18
16
+ - Updated dependencies
17
+
3
18
  ## 2.5.2
4
19
 
5
20
  ### Patch Changes
@@ -320,11 +320,20 @@ var createTypeAheadConfig = exports.createTypeAheadConfig = function createTypeA
320
320
  }
321
321
  var mentionLocalId = (0, _uuid.default)();
322
322
  if (handleMentionsChanged) {
323
- handleMentionsChanged([{
324
- type: 'added',
325
- localId: mentionLocalId,
326
- id: id
327
- }]);
323
+ if (taskItemId) {
324
+ handleMentionsChanged([{
325
+ type: 'added',
326
+ localId: mentionLocalId,
327
+ id: id,
328
+ taskLocalId: taskItemId
329
+ }]);
330
+ } else {
331
+ handleMentionsChanged([{
332
+ type: 'added',
333
+ localId: mentionLocalId,
334
+ id: id
335
+ }]);
336
+ }
328
337
  }
329
338
  fireEvent((0, _analytics.buildTypeAheadInsertedPayload)(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
330
339
  return x.mention;
@@ -306,11 +306,20 @@ export const createTypeAheadConfig = ({
306
306
  }
307
307
  const mentionLocalId = uuid();
308
308
  if (handleMentionsChanged) {
309
- handleMentionsChanged([{
310
- type: 'added',
311
- localId: mentionLocalId,
312
- id: id
313
- }]);
309
+ if (taskItemId) {
310
+ handleMentionsChanged([{
311
+ type: 'added',
312
+ localId: mentionLocalId,
313
+ id: id,
314
+ taskLocalId: taskItemId
315
+ }]);
316
+ } else {
317
+ handleMentionsChanged([{
318
+ type: 'added',
319
+ localId: mentionLocalId,
320
+ id: id
321
+ }]);
322
+ }
314
323
  }
315
324
  fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(x => x.mention), query, contextIdentifierProvider, taskListId, taskItemId));
316
325
  sessionId = uuid();
@@ -308,11 +308,20 @@ export var createTypeAheadConfig = function createTypeAheadConfig(_ref6) {
308
308
  }
309
309
  var mentionLocalId = uuid();
310
310
  if (handleMentionsChanged) {
311
- handleMentionsChanged([{
312
- type: 'added',
313
- localId: mentionLocalId,
314
- id: id
315
- }]);
311
+ if (taskItemId) {
312
+ handleMentionsChanged([{
313
+ type: 'added',
314
+ localId: mentionLocalId,
315
+ id: id,
316
+ taskLocalId: taskItemId
317
+ }]);
318
+ } else {
319
+ handleMentionsChanged([{
320
+ type: 'added',
321
+ localId: mentionLocalId,
322
+ id: id
323
+ }]);
324
+ }
316
325
  }
317
326
  fireEvent(buildTypeAheadInsertedPayload(pickerElapsedTime, stats.keyCount.arrowUp, stats.keyCount.arrowDown, sessionId, mode, item.mention, mentionLocalId, sourceListItem.map(function (x) {
318
327
  return x.mention;
@@ -17,6 +17,7 @@ type Props = {
17
17
  type: 'added' | 'deleted';
18
18
  localId: string;
19
19
  id: string;
20
+ taskLocalId?: string;
20
21
  }[]) => void;
21
22
  };
22
23
  export declare const createTypeAheadConfig: ({ sanitizePrivateContent, mentionInsertDisplayName, fireEvent, HighlightComponent, api, handleMentionsChanged, }: Props) => TypeAheadHandler;
@@ -23,6 +23,7 @@ export interface MentionPluginOptions extends MentionPluginConfig {
23
23
  type: 'added' | 'deleted';
24
24
  localId: string;
25
25
  id: string;
26
+ taskLocalId?: string;
26
27
  }[]) => void;
27
28
  }
28
29
  export type MentionPluginState = {
@@ -48,6 +49,7 @@ export type MentionsPlugin = NextEditorPlugin<'mention', {
48
49
  type: 'added' | 'deleted';
49
50
  localId: string;
50
51
  id: string;
52
+ taskLocalId?: string;
51
53
  }[]) => void;
52
54
  };
53
55
  }>;
@@ -17,6 +17,7 @@ type Props = {
17
17
  type: 'added' | 'deleted';
18
18
  localId: string;
19
19
  id: string;
20
+ taskLocalId?: string;
20
21
  }[]) => void;
21
22
  };
22
23
  export declare const createTypeAheadConfig: ({ sanitizePrivateContent, mentionInsertDisplayName, fireEvent, HighlightComponent, api, handleMentionsChanged, }: Props) => TypeAheadHandler;
@@ -23,6 +23,7 @@ export interface MentionPluginOptions extends MentionPluginConfig {
23
23
  type: 'added' | 'deleted';
24
24
  localId: string;
25
25
  id: string;
26
+ taskLocalId?: string;
26
27
  }[]) => void;
27
28
  }
28
29
  export type MentionPluginState = {
@@ -48,6 +49,7 @@ export type MentionsPlugin = NextEditorPlugin<'mention', {
48
49
  type: 'added' | 'deleted';
49
50
  localId: string;
50
51
  id: string;
52
+ taskLocalId?: string;
51
53
  }[]) => void;
52
54
  };
53
55
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-mentions",
3
- "version": "2.5.2",
3
+ "version": "2.6.0",
4
4
  "description": "Mentions plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -10,7 +10,7 @@
10
10
  "atlassian": {
11
11
  "team": "Editor: AI",
12
12
  "singleton": true,
13
- "runReact18": false
13
+ "runReact18": true
14
14
  },
15
15
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
16
16
  "main": "dist/cjs/index.js",
@@ -33,12 +33,12 @@
33
33
  "dependencies": {
34
34
  "@atlaskit/adf-schema": "^40.9.0",
35
35
  "@atlaskit/analytics-gas-types": "^5.1.0",
36
- "@atlaskit/editor-common": "^88.8.0",
36
+ "@atlaskit/editor-common": "^88.12.0",
37
37
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
38
38
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
39
39
  "@atlaskit/editor-plugin-type-ahead": "^1.8.0",
40
40
  "@atlaskit/editor-prosemirror": "5.0.1",
41
- "@atlaskit/icon": "^22.15.0",
41
+ "@atlaskit/icon": "^22.16.0",
42
42
  "@atlaskit/mention": "^23.2.0",
43
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
44
44
  "@atlaskit/theme": "^13.0.0",
@@ -48,7 +48,7 @@
48
48
  "uuid": "^3.1.0"
49
49
  },
50
50
  "peerDependencies": {
51
- "react": "^16.8.0",
51
+ "react": "^16.8.0 || ^17.0.0 || ~18.2.0",
52
52
  "react-dom": "^16.8.0",
53
53
  "react-intl-next": "npm:react-intl@^5.18.1"
54
54
  },