@atlaskit/editor-plugin-mentions 2.5.1 → 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,29 @@
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
+
18
+ ## 2.5.2
19
+
20
+ ### Patch Changes
21
+
22
+ - [#136348](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/136348)
23
+ [`fb4fb56f1da7c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb4fb56f1da7c) -
24
+ Use optimised entry-points on editor-common for browser.
25
+ - Updated dependencies
26
+
3
27
  ## 2.5.1
4
28
 
5
29
  ### 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;
@@ -15,8 +15,8 @@ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime
15
15
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
17
  var _react = _interopRequireWildcard(require("react"));
18
+ var _browser = require("@atlaskit/editor-common/browser");
18
19
  var _providerFactory = require("@atlaskit/editor-common/provider-factory");
19
- var _utils = require("@atlaskit/editor-common/utils");
20
20
  var _element = require("@atlaskit/mention/element");
21
21
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
22
22
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -76,7 +76,7 @@ var Mention = exports.default = /*#__PURE__*/function (_PureComponent) {
76
76
  // a mention when "sanitizePrivateContent" is enabled in the editor on safari.
77
77
  // This affects both insertion and paste behaviour it is applied to the component.
78
78
  // https://product-fabric.atlassian.net/browse/ED-14859
79
- if (_utils.browser.safari) {
79
+ if (_browser.browser.safari) {
80
80
  setTimeout(refreshBrowserSelection, 0);
81
81
  }
82
82
  }
@@ -11,8 +11,8 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
11
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
+ var _browser = require("@atlaskit/editor-common/browser");
14
15
  var _mention = require("@atlaskit/editor-common/mention");
15
- var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _element = require("@atlaskit/mention/element");
17
17
  var _resource = require("@atlaskit/mention/resource");
18
18
  var _types = require("@atlaskit/mention/types");
@@ -95,7 +95,7 @@ var Mention = exports.Mention = function Mention(props) {
95
95
  // a mention when "sanitizePrivateContent" is enabled in the editor on safari.
96
96
  // This affects both insertion and paste behaviour it is applied to the component.
97
97
  // https://product-fabric.atlassian.net/browse/ED-14859
98
- if (_utils.browser.safari) {
98
+ if (_browser.browser.safari) {
99
99
  setTimeout(refreshBrowserSelection, 0);
100
100
  }
101
101
  }, []);
@@ -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();
@@ -1,8 +1,8 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React, { PureComponent } from 'react';
4
+ import { browser } from '@atlaskit/editor-common/browser';
4
5
  import { ProviderFactory, WithProviders } from '@atlaskit/editor-common/provider-factory';
5
- import { browser } from '@atlaskit/editor-common/utils';
6
6
  import { ResourcedMention } from '@atlaskit/mention/element';
7
7
  // Workaround for a firefox issue where dom selection is off sync
8
8
  // https://product-fabric.atlassian.net/browse/ED-12442
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect, useState } from 'react';
3
+ import { browser } from '@atlaskit/editor-common/browser';
3
4
  import { MentionWithProfileCard } from '@atlaskit/editor-common/mention';
4
- import { browser } from '@atlaskit/editor-common/utils';
5
5
  import { ResourcedMention } from '@atlaskit/mention/element';
6
6
  import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention/resource';
7
7
  import { isPromise } from '@atlaskit/mention/types';
@@ -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;
@@ -9,8 +9,8 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
9
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
10
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
11
11
  import React, { PureComponent } from 'react';
12
+ import { browser } from '@atlaskit/editor-common/browser';
12
13
  import { ProviderFactory, WithProviders } from '@atlaskit/editor-common/provider-factory';
13
- import { browser } from '@atlaskit/editor-common/utils';
14
14
  import { ResourcedMention } from '@atlaskit/mention/element';
15
15
  // Workaround for a firefox issue where dom selection is off sync
16
16
  // https://product-fabric.atlassian.net/browse/ED-12442
@@ -3,8 +3,8 @@ import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  import React, { useEffect, useState } from 'react';
6
+ import { browser } from '@atlaskit/editor-common/browser';
6
7
  import { MentionWithProfileCard } from '@atlaskit/editor-common/mention';
7
- import { browser } from '@atlaskit/editor-common/utils';
8
8
  import { ResourcedMention } from '@atlaskit/mention/element';
9
9
  import { isResolvingMentionProvider, MentionNameStatus } from '@atlaskit/mention/resource';
10
10
  import { isPromise } from '@atlaskit/mention/types';
@@ -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.1",
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,9 +10,7 @@
10
10
  "atlassian": {
11
11
  "team": "Editor: AI",
12
12
  "singleton": true,
13
- "inPublicMirror": false,
14
- "releaseModel": "continuous",
15
- "runReact18": false
13
+ "runReact18": true
16
14
  },
17
15
  "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
16
  "main": "dist/cjs/index.js",
@@ -35,12 +33,12 @@
35
33
  "dependencies": {
36
34
  "@atlaskit/adf-schema": "^40.9.0",
37
35
  "@atlaskit/analytics-gas-types": "^5.1.0",
38
- "@atlaskit/editor-common": "^88.2.0",
36
+ "@atlaskit/editor-common": "^88.12.0",
39
37
  "@atlaskit/editor-plugin-analytics": "^1.8.0",
40
38
  "@atlaskit/editor-plugin-context-identifier": "^1.3.0",
41
39
  "@atlaskit/editor-plugin-type-ahead": "^1.8.0",
42
40
  "@atlaskit/editor-prosemirror": "5.0.1",
43
- "@atlaskit/icon": "^22.15.0",
41
+ "@atlaskit/icon": "^22.16.0",
44
42
  "@atlaskit/mention": "^23.2.0",
45
43
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
44
  "@atlaskit/theme": "^13.0.0",
@@ -50,7 +48,7 @@
50
48
  "uuid": "^3.1.0"
51
49
  },
52
50
  "peerDependencies": {
53
- "react": "^16.8.0",
51
+ "react": "^16.8.0 || ^17.0.0 || ~18.2.0",
54
52
  "react-dom": "^16.8.0",
55
53
  "react-intl-next": "npm:react-intl@^5.18.1"
56
54
  },